Browse Source

重构FRLeftFlowLayout、TreeRootPane

persist/11.0-arabic
obo 4 months ago
parent
commit
3961ddfd9f
  1. 11
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java
  2. 2
      designer-base/src/main/java/com/fr/design/layout/FRLeftFlowLayout.java

11
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java

@ -1,16 +1,13 @@
package com.fr.design.gui.itree.refreshabletree; package com.fr.design.gui.itree.refreshabletree;
import com.fr.base.i18n.BidiUtils;
import com.fr.data.impl.TreeAttr; import com.fr.data.impl.TreeAttr;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import groovy.swing.factory.LayoutFactory;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.FlowLayout;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
@ -35,7 +32,7 @@ public class TreeRootPane extends BasicPane {
public TreeRootPane() { public TreeRootPane() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
JPanel checkTypePane = BidiUtils.rtl() ? FRGUIPaneFactory.createTrailingFlowInnerContainer_S_Pane() : FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0(); JPanel checkTypePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Mutiple_Selection_Or_Not")); checkTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Mutiple_Selection_Or_Not"));
checkTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
@ -43,7 +40,7 @@ public class TreeRootPane extends BasicPane {
checkTypePane.add(checkTypeCheckBox); checkTypePane.add(checkTypeCheckBox);
this.add(checkTypePane); this.add(checkTypePane);
JPanel loadTypePane = BidiUtils.rtl() ? FRGUIPaneFactory.createTrailingFlowInnerContainer_S_Pane() : FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0(); JPanel loadTypePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async")); loadTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async"));
loadTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); loadTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
@ -51,14 +48,14 @@ public class TreeRootPane extends BasicPane {
loadTypePane.add(loadTypeCheckBox); loadTypePane.add(loadTypeCheckBox);
this.add(loadTypePane); this.add(loadTypePane);
JPanel leafSelectPane = BidiUtils.rtl() ? FRGUIPaneFactory.createTrailingFlowInnerContainer_S_Pane() : FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0(); JPanel leafSelectPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
leafSelectPane.add(layerTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Select_Leaf_Only"))); leafSelectPane.add(layerTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Select_Leaf_Only")));
layerTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); layerTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.add(leafSelectPane); this.add(leafSelectPane);
JPanel returnFullPathPane = BidiUtils.rtl() ? FRGUIPaneFactory.createTrailingFlowInnerContainer_S_Pane() : FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0(); JPanel returnFullPathPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Return_Full_Path"))); returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Return_Full_Path")));
returnFullPathCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); returnFullPathCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

2
designer-base/src/main/java/com/fr/design/layout/FRLeftFlowLayout.java

@ -18,7 +18,7 @@ public class FRLeftFlowLayout extends FlowLayout {
public void layoutContainer(Container target) { public void layoutContainer(Container target) {
synchronized (target.getTreeLock()) { synchronized (target.getTreeLock()) {
Insets insets = target.getInsets(); Insets insets = target.getInsets();
int maxwidth = target.getWidth() - (insets.left + insets.right + getHgap()*2); int maxwidth = target.getPreferredSize().width - (insets.left + insets.right + getHgap()*2);
int nmembers = target.getComponentCount(); int nmembers = target.getComponentCount();
int x = 0, y = insets.top + getVgap(); int x = 0, y = insets.top + getVgap();
int rowh = 0, start = 0; int rowh = 0, start = 0;

Loading…
Cancel
Save