Browse Source

REPORT-3293 界面各个控件调整

master
kerry 7 years ago
parent
commit
e91c698e2e
  1. 6
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  2. 11
      designer_base/src/com/fr/design/locale/designer.properties
  3. 1
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  4. 2
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  5. 3
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  6. 1
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  7. 1
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  8. 2
      designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java
  9. 2
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  10. 13
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  11. 2
      designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  12. 3
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  13. 2
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  14. 4
      designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  15. 27
      designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  16. 21
      designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java
  17. 16
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  18. 34
      designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java
  19. 10
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  20. 14
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java
  21. 42
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  22. 46
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java
  23. 5
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

6
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -52,14 +52,8 @@ public class CellWidgetCardPane extends BasicPane {
public CellWidgetCardPane(ElementCasePane pane) {
this.pane = pane;
// this.initComponents(pane);
}
public BasicWidgetPropertySettingPane initBasicWidgetPropertyPane(){
return new BasicWidgetPropertySettingPane();
}
private void initComponents(ElementCasePane pane) {
this.removeAll();
this.setLayout(FRGUIPaneFactory.createBorderLayout());

11
designer_base/src/com/fr/design/locale/designer.properties

@ -2109,8 +2109,9 @@ FR-Designer_Widget_Position=widget Position
FR-Designer_Widget_Field=field
FR-Designer_Widget_Formula=formula
FR-Designer_Widget_String=String
FR-Designer_Widget_Display_Report_Tool=display report tool \u663E\u793A\u62A5\u8868\u5757\u5DE5\u5177\u680F
FR-Designer_Widget_No_Repeat=no repeat \u53BB\u9664\u91CD\u590D\u9879
FR-Designer_Widget_Error_Tip=no repeat \u9519\u8BEF\u63D0\u793A
FR-Designer_Widget_Return_Leaf=no repeat \u7ED3\u679C\u8FD4\u56DE\u53F6\u5B50\u8282\u70B9
FR-Designer_Widget_Return_Path=no repeat \u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\u8DEF\u5F84
FR-Designer_Widget_Display_Report_Tool=display report tool
FR-Designer_Widget_No_Repeat=no repeat
FR-Designer_Widget_Error_Tip=error tip
FR-Designer_Widget_Return_Leaf=return leaf
FR-Designer_Widget_Return_Path=return path
FR-Designer_Widget_Display_Position=Display Position

1
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2115,3 +2115,4 @@ FR-Designer_Widget_No_Repeat=no repeat
FR-Designer_Widget_Error_Tip=error tip
FR-Designer_Widget_Return_Leaf=return leaf
FR-Designer_Widget_Return_Path=return path
FR-Designer_Widget_Display_Position=Display Position

2
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -2118,3 +2118,5 @@ FR-Designer_Widget_No_Repeat=
FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position=

3
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2117,4 +2117,5 @@ FR-Designer_Widget_Display_Report_Tool=
FR-Designer_Widget_No_Repeat=
FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position=

1
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2121,3 +2121,4 @@ FR-Designer_Widget_No_Repeat=\u53BB\u9664\u91CD\u590D\u9879
FR-Designer_Widget_Error_Tip=\u9519\u8BEF\u63D0\u793A
FR-Designer_Widget_Return_Leaf=\u7ED3\u679C\u8FD4\u56DE\u53F6\u5B50\u8282\u70B9
FR-Designer_Widget_Return_Path=\u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\u8DEF\u5F84
FR-Designer_Widget_Display_Position=\u663E\u793A\u4F4D\u7F6E

1
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2118,3 +2118,4 @@ FR-Designer_Widget_No_Repeat=
FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position=

2
designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java

@ -34,11 +34,13 @@ public class FormBasicWidgetPropertyPane extends FormBasicPropertyPane {
}
public void populate(Widget widget) {
super.populate(widget);
enableCheckBox.setSelected(widget.isEnabled());
visibleCheckBox.setSelected(widget.isVisible());
}
public void update(Widget widget) {
super.update(widget);
widget.setEnabled(enableCheckBox.isSelected());
widget.setEnabled(visibleCheckBox.isSelected());
}

2
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -186,6 +186,8 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (xCreator instanceof XWScaleLayout) {
XCreator xCreator1 = xCreator.getEditingChildCreator();
xCreator1.resetData(widget);
xCreator.removeAll();
xCreator.add(xCreator1);
} else {
xCreator.resetData(widget);
}

13
designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java

@ -33,6 +33,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
private XWParameterLayout root;
private UISpinner designerWidth;
private UICheckBox displayReport;
private UITextField background;
private UITextField displayPosition;
public RootDesignDefinePane(XCreator xCreator) {
super(xCreator);
@ -70,15 +72,17 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
public JPanel createAdvancePane(){
displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery"));
background = new UITextField();
displayPosition = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p,p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), new UITextField()},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background},
new Component[]{displayReport, null },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), new UITextField()}
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), displayPosition}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5,5,5));
@ -87,12 +91,13 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override
public String title4PopupWindow() {
return "wfitlayout";
return "parameter";
}
@Override
public void populateBean(WParameterLayout ob) {
displayReport.setSelected(ob.isDelayDisplayContent());
designerWidth.setValue(ob.getDesignWidth());
}

2
designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java

@ -10,6 +10,7 @@ import com.fr.design.widget.ui.designer.layout.*;
import com.fr.form.ui.*;
import com.fr.form.ui.container.*;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Inter;
import com.fr.stable.bridge.BridgeMark;
import com.fr.stable.bridge.StableFactory;
@ -63,6 +64,7 @@ public class FormWidgetDefinePaneFactoryBase {
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "tab"));
defineMap.put(WTitleLayout.class, new Appearance(WTitleLayoutDefinePane.class, "tab"));
defineMap.put(Label.class, new Appearance(LabelDefinePane.class, "label"));
defineMap.put(WTabFitLayout.class, new Appearance(WTabFitLayoutDefinePane.class, "label"));
defineMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap());
}

3
designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java

@ -21,13 +21,14 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
}
protected void populateSubCustomWritableRepeatEditorBean(ComboBox e) {
removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
this.dictPane.populateBean(e.getDictionary());
}
protected ComboBox updateSubCustomWritableRepeatEditorBean() {
ComboBox combo = new ComboBox();
combo.setDictionary(this.dictPane.updateBean());
combo.setRemoveRepeat(removeRepeatCheckBox.isSelected());
return combo;
}

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

@ -50,6 +50,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
this.dictPane.populateBean(e.getDictionary());
this.checkBoxDictPane.populate(e);
this.supportTagCheckBox.setSelected(e.isSupportTag());
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
}
public JPanel createOtherPane(){
@ -73,6 +74,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
combo.setSupportTag(this.supportTagCheckBox.isSelected());
combo.setDictionary(this.dictPane.updateBean());
checkBoxDictPane.update(combo);
combo.setRemoveRepeat(removeRepeatCheckBox.isSelected());
return combo;
}

4
designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java

@ -19,7 +19,7 @@ import java.awt.*;
public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> {
public UICheckBox directWriteCheckBox;
protected WaterMarkDictPane waterMarkDictPane;
private UICheckBox removeRepeatCheckBox;
protected UICheckBox removeRepeatCheckBox;
public DirectWriteEditorDefinePane(XCreator xCreator) {
super(xCreator);
@ -74,7 +74,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
protected void populateSubFieldEditorBean(T e) {
this.directWriteCheckBox.setSelected(e.isDirectEdit());
this.waterMarkDictPane.populate(e);
removeRepeatCheckBox.setSelected(e.isChartRelated());
populateSubDirectWriteEditorBean(e);
}

27
designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -41,8 +41,8 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
fontSizePane = new UISpinner(0,20,1);
errorMsgTextField = new UITextField(10);
fontSizePane = new UISpinner(0, 20, 1, 0);
errorMsgTextField = new UITextField();
JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane("高级", 280, 20, contentPane);
@ -50,10 +50,12 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
}
this.addValidatePane();
}
@Override
public void populateBean(T ob) {
this.allowBlankCheckBox.setSelected(ob.isAllowBlank());
this.errorMsgTextField.setText(ob.getErrorMessage());
this.fontSizePane.setValue(ob.getFontSize());
populateSubFieldEditorBean(ob);
}
@ -65,7 +67,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
e.setAllowBlank(this.allowBlankCheckBox.isSelected());
e.setErrorMessage(this.errorMsgTextField.getText());
e.setFontSize((int)fontSizePane.getValue());
return e;
}
@ -83,7 +85,6 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() {
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip"));
errorMsgTextField = new UITextField(10);
allowBlankCheckBox.addItemListener(new ItemListener() {
@Override
@ -91,10 +92,10 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
boolean isSelected = allowBlankCheckBox.isSelected();
uiLabel.setVisible(!isSelected);
errorMsgTextField.setVisible(!isSelected);
if(isSelected){
if (isSelected) {
uiLabel.setPreferredSize(new Dimension(0, 0));
errorMsgTextField.setPreferredSize(new Dimension(0, 0));
}else{
} else {
uiLabel.setPreferredSize(new Dimension(66, 20));
errorMsgTextField.setPreferredSize(new Dimension(150, 20));
}
@ -105,14 +106,14 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox, null },
new Component[]{allowBlankCheckBox, null},
new Component[]{uiLabel, errorMsgTextField},
};
double[] rowSize = {p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 2);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 2);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane();
if (contentPane != null) {
@ -124,7 +125,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
}
public XLayoutContainer getParent (XCreator source){
public XLayoutContainer getParent(XCreator source) {
XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source);
if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) {
container = null;
@ -132,7 +133,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
return container;
}
public JPanel setValidatePane(){
public JPanel setValidatePane() {
return null;
}

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

@ -20,6 +20,9 @@ import java.awt.*;
* Created by ibm on 2017/8/3.
*/
public class LabelDefinePane extends AbstractDataModify<Label> {
private FormWidgetValuePane formWidgetValuePane;
private UICheckBox isPageSetupVertically;
private UICheckBox isStyleAlignmentWrapText;
public LabelDefinePane(XCreator xCreator) {
super(xCreator);
@ -34,17 +37,20 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
}
public JPanel createAdvancePane() {
formWidgetValuePane = new FormWidgetValuePane();
isPageSetupVertically = new UICheckBox(Inter.getLocText("FR-Designer_PageSetup-Vertically"));
isStyleAlignmentWrapText = new UICheckBox(Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), new FormWidgetValuePane()},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text")), null},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_PageSetup-Vertically")), null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), new UITextField()},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), new UITextField(16)},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{isStyleAlignmentWrapText, null},
new Component[]{isPageSetupVertically, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Display_Position")), new UITextField()},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), new UITextField()},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
@ -58,13 +64,16 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
@Override
public void populateBean(Label ob) {
isStyleAlignmentWrapText.setSelected(ob.isAutoLine());
isPageSetupVertically.setSelected(ob.isVerticalCenter());
}
@Override
public Label updateBean() {
Label layout = (Label) creator.toData();
layout.setAutoLine(isStyleAlignmentWrapText.isSelected());
layout.setVerticalCenter(isPageSetupVertically.isSelected());
return layout;
}
}

16
designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -63,13 +63,13 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
}
});
//监听填写规则下拉框的值的变化
regPane.getRegComboBox().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
// regErrorMsgTextField.setEnabled(regExp.errorMessageEditable());
}
});
// regPane.getRegComboBox().addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
//// regErrorMsgTextField.setEnabled(regExp.errorMessageEditable());
//
// }
// });
formWidgetValuePane = new FormWidgetValuePane();
@ -117,7 +117,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
ob.setRegex(this.regPane.update());
ob.setWaterMark(waterMarkDictPane.getText());
formWidgetValuePane.update(ob);
ob.setFontSize((int)fontSizePane.getValue());
// ob.setFontSize((int)fontSizePane.getValue());
return ob;
}

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

@ -1,6 +1,5 @@
package com.fr.design.widget.ui.designer.component;
import com.fr.design.designer.creator.*;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
@ -8,6 +7,8 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.AbstractMarginWidget;
import com.fr.form.ui.PaddingMargin;
import com.fr.general.Inter;
import javax.swing.*;
@ -21,26 +22,23 @@ public class PaddingBoundPane extends BasicPane {
protected UISpinner bottom;
protected UISpinner left;
protected UISpinner right;
private XCreator creator;
public PaddingBoundPane(XCreator source) {
this.creator = source;
public PaddingBoundPane() {
initBoundPane();
}
public void initBoundPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
top = new UISpinner(0, 1000, 1);
bottom = new UISpinner(0, 1000, 1);
left = new UISpinner(0, 1000, 1);
right = new UISpinner(0, 1000, 1);
top = new UISpinner(0, 1000, 1, 0);
bottom = new UISpinner(0, 1000, 1, 0);
left = new UISpinner(0, 1000, 1, 0);
right = new UISpinner(0, 1000, 1, 0);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), new UITextField(), null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Layout-Padding")), top, bottom},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_Top"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Bottom"), SwingConstants.CENTER)},
new Component[]{null, left, right},
@ -49,19 +47,23 @@ public class PaddingBoundPane extends BasicPane {
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.add(panel);
}
public void update() {
//todo
}
public void update(AbstractMarginWidget marginWidget) {
marginWidget.setMargin(new PaddingMargin((int)top.getValue(), (int)left.getValue(), (int)bottom.getValue(), (int)right.getValue() ));
}
protected String title4PopupWindow() {
return "";
}
public void populate() {
//todo
public void populate(AbstractMarginWidget marginWidget) {
PaddingMargin paddingMargin = marginWidget.getMargin();
top.setValue(paddingMargin.getTop());
bottom.setValue(paddingMargin.getBottom());
left.setValue(paddingMargin.getLeft());
right.setValue(paddingMargin.getRight());
}
}

10
designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -71,12 +71,13 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
return "absoluteBodyLayout";
}
public void populateBean(WAbsoluteBodyLayout ob) {
public void populateSubPane(WAbsoluteLayout ob) {
// WAbsoluteBodyLayout layout = (WAbsoluteBodyLayout) ob;
layoutCombox.setSelectedIndex(1);
}
public WAbsoluteLayout updateSubPane() {
WAbsoluteLayout layout = (WAbsoluteLayout) creator.toData();
public WAbsoluteBodyLayout updateSubPane() {
WAbsoluteBodyLayout layout = (WAbsoluteBodyLayout) creator.toData();
Item item = (Item) layoutCombox.getSelectedItem();
Object value = item.getValue();
int state = 0;
@ -88,7 +89,6 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
if (state == WBodyLayoutType.FIT.getTypeValue()) {
switch2FitBodyLayout();
}
layout.setCompState(state);
}
return layout;
}

14
designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java

@ -28,6 +28,7 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
private WAbsoluteLayout wAbsoluteLayout;
protected UIComboBox comboBox;
private WBodyLayoutType layoutType = WBodyLayoutType.ABSOLUTE;
private WidgetBoundPane boundPane;
public FRAbsoluteLayoutDefinePane(XCreator xCreator) {
super(xCreator);
@ -40,8 +41,9 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
public void initComponent() {
boundPane = new WidgetBoundPane(creator);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(new WidgetBoundPane(creator), BorderLayout.NORTH);
this.add(boundPane, BorderLayout.NORTH);
initUIComboBox();
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer-Widget_Area_Scaling"), 280, 20, createThirdPane());
@ -79,13 +81,17 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
@Override
public void populateBean(WAbsoluteLayout ob) {
populateSubPane(ob);
comboBox.setSelectedIndex(ob.getCompState());
boundPane.populate();
}
@Override
public WAbsoluteLayout updateBean() {
WAbsoluteLayout wAbsoluteLayout = updateSubPane();
wAbsoluteLayout.setCompState(comboBox.getSelectedIndex());
boundPane.update();
return wAbsoluteLayout;
}
@ -94,6 +100,10 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
return new WAbsoluteLayout();
}
public void populateSubPane(WAbsoluteLayout ob) {
}
@Override
public DataCreatorUI dataUI() {
return null;

42
designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -12,6 +12,7 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -26,6 +27,7 @@ import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
@ -40,6 +42,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
private UIComboBox adaptComboBox;
private UISpinner componentIntervel;
private PaddingBoundPane paddingBound;
private UITextField background;
public FRFitLayoutDefinePane(XCreator xCreator) {
super(xCreator);
@ -52,16 +55,20 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancePane = createAdvancePane();
UIExpandablePane advanceExpandablePane = new UIExpandablePane("高级", 280, 20, advancePane);
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
this.add(advanceExpandablePane, BorderLayout.NORTH);
UIExpandablePane layoutExpandablePane = new UIExpandablePane("布局", 280, 20, createLayoutPane());
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Layout"), 280, 20, createLayoutPane());
this.add(layoutExpandablePane, BorderLayout.CENTER);
}
public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBound = new PaddingBoundPane(creator);
background = new UITextField();
paddingBound = new PaddingBoundPane();
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
jp2.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
jPanel.add(paddingBound, BorderLayout.CENTER);
jPanel.add(jp2, BorderLayout.NORTH);
return jPanel;
}
@ -69,16 +76,16 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
layoutComboBox = initUIComboBox(FRLayoutTypeItems.ITEMS);
adaptComboBox = initUIComboBox(FRFitConstraintsItems.ITEMS);
componentIntervel = new UISpinner(0, 100, 1);
componentIntervel = new UISpinner(0, 100, 1, 0);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p,p,p};
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel("布局方式"), layoutComboBox},
new Component[]{new UILabel("组件缩放"), adaptComboBox},
new Component[]{new UILabel("组件间隔"), componentIntervel}
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Attr_Layout_Type")), layoutComboBox},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Scale")), adaptComboBox},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentIntervel}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
@ -88,7 +95,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
}
public UIComboBox initUIComboBox(Item [] items) {
public UIComboBox initUIComboBox(Item[] items) {
DefaultComboBoxModel model = new DefaultComboBoxModel();
for (Item item : items) {
model.addElement(item);
@ -104,13 +111,18 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
@Override
public void populateBean(WFitLayout ob) {
background.setText("test");
paddingBound.populate(ob);
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());
adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval());
}
@Override
public WFitLayout updateBean() {
WFitLayout layout = (WFitLayout)creator.toData();
WFitLayout layout = (WFitLayout) creator.toData();
paddingBound.update(layout);
Item item = (Item) layoutComboBox.getSelectedItem();
Object value = item.getValue();
int state = 0;
@ -139,17 +151,15 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{wAbsoluteBodyLayout}));
} else {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{xWFitLayout.toData()}));
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
//todo 验证下
layout.setLayoutType(WBodyLayoutType.parse(state));
layout.setCompState(adaptComboBox.getSelectedIndex());
layout.setCompInterval((int)componentIntervel.getValue());
return layout;
}

46
designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java

@ -0,0 +1,46 @@
package com.fr.design.widget.ui.designer.layout;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Inter;
import java.awt.*;
/**
* Created by ibm on 2017/8/5.
*/
public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
private PaddingBoundPane paddingBoundPane;
public WTabFitLayoutDefinePane(XCreator xCreator) {
super(xCreator);
initComponent();
}
public void initComponent() {
paddingBoundPane = new PaddingBoundPane();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, paddingBoundPane);
this.add(advanceExpandablePane, BorderLayout.CENTER);
}
@Override
public String title4PopupWindow() {
return "tabFitLayout";
}
@Override
public void populateBean(WTabFitLayout ob) {
}
@Override
public WTabFitLayout updateBean() {
WTabFitLayout layout = (WTabFitLayout) creator.toData();
return layout;
}
}

5
designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

@ -27,7 +27,7 @@ public class WTitleLayoutDefinePane extends AbstractDataModify<WTitleLayout> {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
paddingBoundPane = new PaddingBoundPane(creator);
paddingBoundPane = new PaddingBoundPane();
displayECToolBar = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Display_Report_Tool"));
advancePane.add(paddingBoundPane, BorderLayout.NORTH);
advancePane.add(displayECToolBar, BorderLayout.CENTER);
@ -41,7 +41,8 @@ public class WTitleLayoutDefinePane extends AbstractDataModify<WTitleLayout> {
@Override
public void populateBean(WTitleLayout ob) {
paddingBoundPane.populate(ob);
// displayECToolBar.setSelected(ob.ds);
}

Loading…
Cancel
Save