Browse Source

Merge pull request #1442 in BA/design from ~KERRY/design:release/9.0 to release/9.0

* commit 'adf33a2635ac4632a4d88b86aff3709652e32e45':
  REPORT-5491 9.0设计器交互验收
master
superman 7 years ago
parent
commit
c42c405c82
  1. 11
      designer_base/src/com/fr/design/gui/style/FRFontPane.java
  2. 19
      designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java
  3. 2
      designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java
  4. 44
      designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java

11
designer_base/src/com/fr/design/gui/style/FRFontPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -41,6 +42,8 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
public static Integer[] FONT_SIZES = {new Integer(6), new Integer(8), new Integer(9), new Integer(10), new Integer(11), new Integer(12), new Integer(14), new Integer(16), public static Integer[] FONT_SIZES = {new Integer(6), new Integer(8), new Integer(9), new Integer(10), new Integer(11), new Integer(12), new Integer(14), new Integer(16),
new Integer(18), new Integer(20), new Integer(22), new Integer(24), new Integer(26), new Integer(28), new Integer(36), new Integer(48), new Integer(72)}; new Integer(18), new Integer(20), new Integer(22), new Integer(24), new Integer(26), new Integer(28), new Integer(36), new Integer(48), new Integer(72)};
private static final Dimension BUTTON_SIZE = new Dimension(20, 18); private static final Dimension BUTTON_SIZE = new Dimension(20, 18);
private static final Dimension UNDER_LINE_SIZE = new Dimension(87, 20);
private static final Dimension HIDE_SIZE = new Dimension(0, 0);
private final String[] fontSizeStyles = {Inter.getLocText("FR-Designer_FRFont_plain"), Inter.getLocText("FR-Designer_FRFont_bold"), Inter.getLocText("FR-Designer_FRFont_italic"), Inter.getLocText("FR-Designer_FRFont_bolditalic")}; private final String[] fontSizeStyles = {Inter.getLocText("FR-Designer_FRFont_plain"), Inter.getLocText("FR-Designer_FRFont_bold"), Inter.getLocText("FR-Designer_FRFont_italic"), Inter.getLocText("FR-Designer_FRFont_bolditalic")};
private JPanel buttonPane; private JPanel buttonPane;
private JPanel isSuperOrSubPane; private JPanel isSuperOrSubPane;
@ -104,9 +107,11 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
if (line == Constants.LINE_NONE) { if (line == Constants.LINE_NONE) {
underline.setSelected(false); underline.setSelected(false);
cly.show(linePane, "none"); cly.show(linePane, "none");
linePane.setPreferredSize(HIDE_SIZE);
} else { } else {
underline.setSelected(true); underline.setSelected(true);
cly.show(linePane, "combobox"); cly.show(linePane, "combobox");
linePane.setPreferredSize(UNDER_LINE_SIZE);
this.underlineCombo.setSelectedLineStyle(line); this.underlineCombo.setSelectedLineStyle(line);
} }
// effects // effects
@ -297,8 +302,14 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
CardLayout cly = (CardLayout) linePane.getLayout(); CardLayout cly = (CardLayout) linePane.getLayout();
cly.show(linePane, underline.isSelected() ? "combobox" : "none"); cly.show(linePane, underline.isSelected() ? "combobox" : "none");
if(underline.isSelected()){
linePane.setPreferredSize(UNDER_LINE_SIZE);
}else{
linePane.setPreferredSize(HIDE_SIZE);
}
} }
}); });
return linePane; return linePane;
} }

19
designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -28,7 +28,7 @@ public class WidgetBoundsPaneFactory {
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel); boundsPane.add(panel);
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, boundsPane); return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, boundsPane);
@ -49,19 +49,24 @@ public class WidgetBoundsPaneFactory {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] northComponents = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), createRightPane(x, y)}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), createRightPane(x, y)},
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER))}, new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER))},
};
Component[][] centerComponents = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), createRightPane(width, height)}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), createRightPane(width, height)},
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER))}, new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER))},
}; };
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); final JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(northComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6);
final JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); northPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel); centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
boundsPane.add(northPanel, BorderLayout.NORTH);
boundsPane.add(centerPanel, BorderLayout.CENTER);
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, boundsPane); return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, boundsPane);
} }
} }

2
designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -75,7 +75,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
boundsPane.add(panel); boundsPane.add(panel);
return boundsPane; return boundsPane;
} }

44
designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java

@ -14,6 +14,7 @@ import com.fr.general.Inter;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
@ -40,32 +41,37 @@ public class PaddingBoundPane extends BasicPane{
bottom.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding")); bottom.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
left.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding")); left.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
right.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding")); right.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
double f = TableLayout.FILL; UILabel label = new UILabel(Inter.getLocText("FR-Designer_Layout-Padding"));
double p = TableLayout.PREFERRED; label.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
double[] rowSize = {p, p, p, p}; label.setVerticalAlignment(SwingConstants.TOP);
double[] columnSize = {p, f}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; new Component[]{label, createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1 );
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Layout-Padding")), createRightPane(top, bottom)},
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer_Top"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Bottom"), SwingConstants.CENTER))},
new Component[]{null, createRightPane(left, right)},
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer_Left"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Right"), SwingConstants.CENTER))},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
this.add(panel); this.add(panel);
} }
public JPanel createRightPane(Component com1, Component com2){
public JPanel createRightPane(){
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p}; double[] rowSize = {p, p};
double[] columnSize = {f, f}; double[] columnSize = {f, f};
int[][] rowCount = {{1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components1 = new Component[][]{
new Component[]{com1, com2} new Component[]{top, bottom},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Top"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Bottom"), SwingConstants.CENTER)}
};
Component[][] components2 = new Component[][]{
new Component[]{left, right},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Left"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Right"), SwingConstants.CENTER)}
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L1); JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(components1, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L6);
northPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0));
JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(components2, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L6);
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
panel.add(northPanel, BorderLayout.NORTH);
panel.add(centerPanel, BorderLayout.CENTER);
return panel;
} }

Loading…
Cancel
Save