Browse Source

REPORT-3293 9.0设计器控件设置重画

master
kerry 7 years ago
parent
commit
9f57df842e
  1. 6
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  2. 31
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  3. 6
      designer_base/src/com/fr/design/mainframe/widget/editors/DataBindingEditor.java
  4. 69
      designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  5. 36
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  6. 11
      designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  7. 86
      designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  8. 18
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  9. 27
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  10. 39
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  11. 81
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  12. 2
      designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java
  13. 52
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  14. 47
      designer_form/src/com/fr/design/widget/ui/designer/DictEditorDefinePane.java
  15. 34
      designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  16. 51
      designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java
  17. 29
      designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java
  18. 60
      designer_form/src/com/fr/design/widget/ui/designer/ListEditorDefinePane.java
  19. 8
      designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java
  20. 15
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  21. 10
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  22. 65
      designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java
  23. 91
      designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java
  24. 18
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java
  25. 115
      designer_form/src/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java
  26. 10
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  27. 27
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

6
designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -12,6 +12,7 @@ import com.fr.form.ui.Widget;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl; import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
@ -86,7 +87,10 @@ public class CellWidgetPropertyPane extends BasicPane {
public void populate(ElementCasePane ePane) { public void populate(ElementCasePane ePane) {
Selection editingSelection = ePane.getSelection();
if(editingSelection instanceof FloatSelection){
return;
}
cellEditorDefPane = new WidgetPane(ePane); cellEditorDefPane = new WidgetPane(ePane);
this.removeAll(); this.removeAll();
this.add(cellEditorDefPane, BorderLayout.CENTER); this.add(cellEditorDefPane, BorderLayout.CENTER);

31
designer_base/src/com/fr/design/gui/frpane/RegPane.java

@ -342,10 +342,11 @@ public class RegPane extends BasicPane {
DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType); DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType);
public RegPhonePane() { public RegPhonePane() {
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(new UILabel(Inter.getLocText("FR-Designer_Data_Type") + ":"));
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel); dataTypeComboBox = new UIComboBox(DefaultComboBoxModel);
JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent()); JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent());
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Data_Type")), dataTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(panel);
editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN)); editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN));
dataTypeComboBox.addItemListener(new ItemListener() { dataTypeComboBox.addItemListener(new ItemListener() {
@Override @Override
@ -364,7 +365,6 @@ public class RegPane extends BasicPane {
}); });
dataTypeComboBox.setSelectedIndex(0); dataTypeComboBox.setSelectedIndex(0);
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString()); firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString());
this.add(dataTypeComboBox);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
@ -405,14 +405,8 @@ public class RegPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.setPreferredSize(new Dimension(210, 56)); this.setPreferredSize(new Dimension(210, 56));
// this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"));
minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
// this.add(minLenSpinner);
// this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"));
maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
// this.add(maxLenSpinner);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -461,11 +455,11 @@ public class RegPane extends BasicPane {
private UITextField regTextField; private UITextField regTextField;
public CustomRegRexPane(){ public CustomRegRexPane(){
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions") + ":")); regTextField = new UITextField();
regTextField = new UITextField(10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions")), regTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(regTextField); this.add(panel);
} }
@Override @Override
@ -495,16 +489,15 @@ public class RegPane extends BasicPane {
private UITextField regErrorMsgField; private UITextField regErrorMsgField;
public RegErrorMsgPane(){ public RegErrorMsgPane(){
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
initRegErrorMsgField(); initRegErrorMsgField();
// this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip") + ":")); this.add(panel);
regErrorMsgField = new UITextField(10);
this.add(regErrorMsgField);
} }
private void initRegErrorMsgField(){ private void initRegErrorMsgField(){
regErrorMsgField = new UITextField(13); regErrorMsgField = new UITextField();
regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() { regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText()); regErrorMsgField.setToolTipText(regErrorMsgField.getText());

6
designer_base/src/com/fr/design/mainframe/widget/editors/DataBindingEditor.java

@ -27,6 +27,8 @@ import com.fr.general.Inter;
* @since 2012-3-29下午5:26:28 * @since 2012-3-29下午5:26:28
*/ */
public class DataBindingEditor extends Editor<DataBinding> { public class DataBindingEditor extends Editor<DataBinding> {
private final static int HORI_GAP = 1;
private final static int VER_GAP = 7;
private TableDataComboBox tableDataComboBox; private TableDataComboBox tableDataComboBox;
private LazyComboBox columnNameComboBox; private LazyComboBox columnNameComboBox;
@ -61,7 +63,7 @@ public class DataBindingEditor extends Editor<DataBinding> {
private void initCompontents() { private void initCompontents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout(HORI_GAP, VER_GAP));
tableDataComboBox = new TableDataComboBox(getTableDataSource()); tableDataComboBox = new TableDataComboBox(getTableDataSource());
tableDataComboBox.setPreferredSize(new Dimension(55, 20)); tableDataComboBox.setPreferredSize(new Dimension(55, 20));
tableDataComboBox.addItemListener(tableDataComboBoxListener); tableDataComboBox.addItemListener(tableDataComboBoxListener);
@ -86,7 +88,7 @@ public class DataBindingEditor extends Editor<DataBinding> {
} }
}); });
columnNameComboBox.setEditable(true); columnNameComboBox.setEditable(true);
this.add(tableDataComboBox, BorderLayout.WEST); this.add(tableDataComboBox, BorderLayout.NORTH);
this.add(columnNameComboBox, BorderLayout.CENTER); this.add(columnNameComboBox, BorderLayout.CENTER);
columnNameComboBox.addItemListener(columnNameComboboxListener); columnNameComboBox.addItemListener(columnNameComboboxListener);
} }

69
designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java

@ -1,7 +1,9 @@
package com.fr.design.widget.btn; package com.fr.design.widget.btn;
import com.fr.design.foldablepane.UIExpandablePane; import java.awt.*;
import com.fr.design.gui.frpane.AttributeChangeListener;
import javax.swing.*;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -12,11 +14,6 @@ import com.fr.form.ui.Button;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
* Author : Richer * Author : Richer
@ -28,62 +25,39 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
private UITextField hotkeysTextField; private UITextField hotkeysTextField;
private UITextField buttonNameTextField; private UITextField buttonNameTextField;
private IconDefinePane iconPane; private IconDefinePane iconPane;
private AttributeChangeListener listener;
public ButtonWithHotkeysDetailPane() { public ButtonWithHotkeysDetailPane() {
initComponents(); initComponents();
} }
private void initComponents() { private void initComponents() {
// creator.
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
// JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); advancedPane.setPreferredSize(new Dimension(600, 341));
// advancedPane.setPreferredSize(new Dimension(600, 341));
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4)); attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
this.add(advancedPane);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double rowSize[] = {p, p, p, p};
double rowSize[] = {p, p, p, p, p, p, p}; double columnSize[] = {p, p};
double columnSize[] = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 3}, {1, 1}, {1, 1}};
JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
iconPane = new IconDefinePane(); iconPane = new IconDefinePane();
labelPane.add(iconPane); labelPane.add(iconPane);
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField = new UITextField()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField = new UITextField(16)},
{new UILabel("背景" + ":"), new UITextField()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Icon") + ":"), labelPane},
{new UILabel("字体" + ":"), new UITextField()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()},
{new UILabel("图标" + ":"), new UITextField()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField = new UITextField(16)}
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField = new UITextField()}
}; };
buttonNameTextField.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
}
@Override
public void focusLost(FocusEvent e) {
// creator.getWidget().set
}
});
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ",")); hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 8); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 8);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); advancedPane.add(panel,BorderLayout.NORTH);
jPanel.add(panel, BorderLayout.CENTER); Component comp = createCenterPane();
UIExpandablePane advancedPane = new UIExpandablePane("高级", 280, 20, jPanel); if(comp != null ) {
this.add(advancedPane); advancedPane.add(comp,BorderLayout.CENTER);
} }
//add By kerry
public void addAttributeChangeListener(AttributeChangeListener listener) {
this.listener = listener;
} }
protected abstract Component createCenterPane(); protected abstract Component createCenterPane();
@Override @Override
@ -104,11 +78,4 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
button.setHotkeys(hotkeysTextField.getText()); button.setHotkeys(hotkeysTextField.getText());
return button; return button;
} }
public void updateBean(Button ob) {
ob.setIconName(iconPane.update());
ob.setText(buttonNameTextField.getText());
ob.setHotkeys(hotkeysTextField.getText());
}
} }

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

@ -1,27 +1,22 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.base.BaseUtils;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item;
import com.fr.design.designer.properties.items.ItemProvider;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; 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.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.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WParameterLayout;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -33,8 +28,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
private XWParameterLayout root; private XWParameterLayout root;
private UISpinner designerWidth; private UISpinner designerWidth;
private UICheckBox displayReport; private UICheckBox displayReport;
private UITextField background; private AccessibleBackgroundEditor background;
private UITextField displayPosition; private UIButtonGroup hAlignmentPane;
public RootDesignDefinePane(XCreator xCreator) { public RootDesignDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -50,10 +45,9 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane); UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
this.add(advanceExpandablePane, BorderLayout.NORTH); this.add(advanceExpandablePane, BorderLayout.NORTH);
JPanel layoutPane = createBoundsPane(); JPanel layoutPane = createBoundsPane();
// layoutPane.setLayout(FRGUIPaneFactory.createBorderLayout());
// layoutPane.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel("设计宽度"), designerWidth}, FlowLayout.LEFT, 4));
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("Size"), 280, 20, layoutPane); UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("Size"), 280, 20, layoutPane);
this.add(layoutExpandablePane, BorderLayout.CENTER); this.add(layoutExpandablePane, BorderLayout.CENTER);
} }
public JPanel createBoundsPane() { public JPanel createBoundsPane() {
@ -72,8 +66,14 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")); displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery"));
background = new UITextField(); background = new AccessibleBackgroundEditor();
displayPosition = new UITextField(); Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),};
Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Left")
, Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")});
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
@ -82,7 +82,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background},
new Component[]{displayReport, null}, new Component[]{displayReport, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), displayPosition} new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
@ -96,8 +96,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override @Override
public void populateBean(WParameterLayout ob) { public void populateBean(WParameterLayout ob) {
background.setValue(ob.getBackground());
displayReport.setSelected(ob.isDelayDisplayContent()); displayReport.setSelected(ob.isDelayDisplayContent());
designerWidth.setValue(ob.getDesignWidth()); designerWidth.setValue(ob.getDesignWidth());
hAlignmentPane.setSelectedIndex(ob.getPosition());
} }
@ -106,6 +108,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
WParameterLayout wParameterLayout = (WParameterLayout) creator.toData(); WParameterLayout wParameterLayout = (WParameterLayout) creator.toData();
wParameterLayout.setDesignWidth((int) designerWidth.getValue()); wParameterLayout.setDesignWidth((int) designerWidth.getValue());
wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected());
wParameterLayout.setBackground(wParameterLayout.getBackground());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex());
return wParameterLayout; return wParameterLayout;
} }

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

@ -44,19 +44,18 @@ public class FormWidgetDefinePaneFactoryBase {
defineMap.put(TextEditor.class, new Appearance(TextFieldEditorDefinePane.class, WidgetConstants.TEXT + "")); defineMap.put(TextEditor.class, new Appearance(TextFieldEditorDefinePane.class, WidgetConstants.TEXT + ""));
defineMap.put(NameWidget.class, new Appearance(UserEditorDefinePane.class, "UserDefine")); defineMap.put(NameWidget.class, new Appearance(UserEditorDefinePane.class, "UserDefine"));
defineMap.put(ComboCheckBox.class, new Appearance(ComboCheckBoxDefinePane.class, WidgetConstants.COMBOCHECKBOX + "")); defineMap.put(ComboCheckBox.class, new Appearance(ComboCheckBoxDefinePane.class, WidgetConstants.COMBOCHECKBOX + ""));
defineMap.put(ListEditor.class, new Appearance(ListEditorDefinePane.class, WidgetConstants.LIST + ""));
defineMap.put(ComboBox.class, new Appearance(ComboBoxDefinePane.class, WidgetConstants.COMBOBOX + "")); defineMap.put(ComboBox.class, new Appearance(ComboBoxDefinePane.class, WidgetConstants.COMBOBOX + ""));
defineMap.put(RadioGroup.class, new Appearance(RadioGroupDefinePane.class, WidgetConstants.RADIOGROUP + "")); defineMap.put(RadioGroup.class, new Appearance(RadioGroupDefinePane.class, WidgetConstants.RADIOGROUP + ""));
defineMap.put(CheckBoxGroup.class, new Appearance(CheckBoxGroupDefinePane.class, WidgetConstants.CHECKBOXGROUP + "")); defineMap.put(CheckBoxGroup.class, new Appearance(CheckBoxGroupDefinePane.class, WidgetConstants.CHECKBOXGROUP + ""));
defineMap.put(NoneWidget.class, new Appearance(NoneWidgetDefinePane.class, WidgetConstants.NONE + "")); defineMap.put(NoneWidget.class, new Appearance(NoneWidgetDefinePane.class, WidgetConstants.NONE + ""));
defineMap.put(Button.class, new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + "")); defineMap.put(Button.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(FreeButton.class, new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + "")); defineMap.put(FreeButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + ""));
defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"))); defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout")));
defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, Inter.getLocText("WLayout-Card-ToolTips"))); defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, Inter.getLocText("WLayout-Card-ToolTips")));
if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) { // if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) {
defineMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class), new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + "")); // defineMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class), new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + ""));
} // }
defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout"))); defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout")));
defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"))); defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout")));

86
designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java

@ -1,19 +1,26 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.btn.ButtonDetailPane; import com.fr.design.layout.TableLayout;
import com.fr.design.widget.ui.designer.btn.ButtonDetailPaneFactory; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleIconEditor;
import com.fr.design.widget.btn.ButtonConstants;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton; import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
public class ButtonDefinePane extends AbstractDataModify<Button> { public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> {
private ButtonDetailPane detailPane; private UITextField hotkeysTextField;
private UITextField buttonNameTextField;
private AccessibleIconEditor iconPane;
public ButtonDefinePane(XCreator creator){ public ButtonDefinePane(XCreator creator){
super(creator); super(creator);
@ -21,8 +28,31 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
} }
private void initComponent() { private void initComponent() {
setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double rowSize[] = {p, p, p, p, p, p, p};
double columnSize[] = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
iconPane = new AccessibleIconEditor();
hotkeysTextField = new UITextField();
buttonNameTextField = new UITextField();
Component[] backgroundCompPane = createBackgroundComp();
Component[] frFont = createFontPane();
UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background"));
backgroundLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField},
backgroundCompPane,
frFont,
{new UILabel(Inter.getLocText("FR-Designer_Icon" + ":")), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField}
};
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 8);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
UIExpandablePane advancedPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, panel);
this.add(advancedPane);
} }
@Override @Override
@ -30,31 +60,33 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
return "Button"; return "Button";
} }
private void resetDetailPane(Button btn, Class cls) { public Component[] createBackgroundComp(){
if (detailPane != null) { return new Component[]{null, null};
remove(detailPane);
}
detailPane = ButtonDetailPaneFactory.createButtonDetailPane(cls, btn);
add(detailPane, BorderLayout.CENTER);
detailPane.addTypeChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
resetDetailPane(null, (Class) e.getSource());
} }
});
this.updateUI(); public Component[] createFontPane(){
return new Component[]{null, null};
} }
@Override @Override
public void populateBean(Button btn) { public void populateBean(T btn) {
resetDetailPane(btn, btn instanceof FreeButton && !((FreeButton) btn).isCustomStyle() ? Button.class : null); hotkeysTextField.setText(btn.getHotkeys());
buttonNameTextField.setText(btn.getLabelName());
iconPane.setValue(btn.getIconName());
populateSubButtonPane(btn);
} }
@Override public abstract void populateSubButtonPane(T e);
public Button updateBean() {
public abstract T updateSubButtonPane();
// resetDetailPane(btn, btn instanceof FreeButton && !((FreeButton) btn).isCustomStyle() ? Button.class : null); @Override
return new Button(); public T updateBean() {
T btn = updateSubButtonPane();
btn.setHotkeys(hotkeysTextField.getText());
btn.setLabelName(buttonNameTextField.getText());
btn.setIconName((String)iconPane.getValue());
return btn;
} }
} }

18
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java

@ -3,7 +3,9 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; 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.gui.itextfield.UITextField;
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.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
@ -15,7 +17,8 @@ import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UITextField text;
private UITextField fontSizePane; private UISpinner fontSizePane;
private FormWidgetValuePane formWidgetValuePane;
public CheckBoxDefinePane(XCreator xCreator) { public CheckBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -23,9 +26,10 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
} }
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UITextField(); text = new UITextField();
fontSizePane = new UITextField(); fontSizePane = new UISpinner(0, 20, 1, 0);
FormWidgetValuePane formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -50,13 +54,17 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
@Override @Override
public void populateBean(CheckBox check) { public void populateBean(CheckBox check) {
// text.setText(check.getText()); text.setText(check.getText());
fontSizePane.setValue(check.getFontSize());
formWidgetValuePane.populate(check);
} }
@Override @Override
public CheckBox updateBean() { public CheckBox updateBean() {
CheckBox box = new CheckBox(); CheckBox box = (CheckBox)creator.toData();
box.setText(text.getText()); box.setText(text.getText());
box.setFontSize((int)fontSizePane.getValue());
formWidgetValuePane.update(box);
return box; return box;
} }
} }

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

@ -2,9 +2,9 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
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.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
@ -17,7 +17,7 @@ import java.awt.*;
public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> { public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane; private DictionaryPane dictPane;
private UIHeadGroup returnType;
private UICheckBox checkbox; private UICheckBox checkbox;
public CheckBoxGroupDefinePane(XCreator xCreator) { public CheckBoxGroupDefinePane(XCreator xCreator) {
@ -40,11 +40,26 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){ public JPanel createOtherPane(){
checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"})); checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
CheckBoxGroup combo = (CheckBoxGroup) creator.toData();
//todo
if (index == 1) {
combo.setReturnString(true);
} else {
combo.setReturnString(false);
}
}
};
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{checkbox, null }, new Component[]{checkbox, null },
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), new UITextField()}, new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnType},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -56,6 +71,11 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected void populateSubButtonGroupBean(CheckBoxGroup ob) { protected void populateSubButtonGroupBean(CheckBoxGroup ob) {
if (ob.isReturnString()) {
returnType.setSelectedIndex(1);
} else {
returnType.setSelectedIndex(0);
}
this.dictPane.populateBean(ob.getDictionary()); this.dictPane.populateBean(ob.getDictionary());
checkbox.setSelected(ob.isChooseAll()); checkbox.setSelected(ob.isChooseAll());
} }
@ -65,7 +85,6 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected CheckBoxGroup updateSubButtonGroupBean() { protected CheckBoxGroup updateSubButtonGroupBean() {
CheckBoxGroup ob = (CheckBoxGroup) creator.toData(); CheckBoxGroup ob = (CheckBoxGroup) creator.toData();
ob.setDictionary(this.dictPane.updateBean()); ob.setDictionary(this.dictPane.updateBean());
ob.setChooseAll(checkbox.isSelected()); ob.setChooseAll(checkbox.isSelected());
return ob; return ob;

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

@ -2,36 +2,45 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.ComboBox; import com.fr.form.ui.ComboBox;
import com.fr.general.Inter;
import javax.swing.*; import java.awt.*;
public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox> {
protected DictionaryPane dictPane;
public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
private UICheckBox removeRepeatCheckBox;
private UITextField waterMarkField;
public ComboBoxDefinePane(XCreator xCreator) { public ComboBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
dictPane = new DictionaryPane();
} }
protected JPanel setForthContentPane () { public UICheckBox createRepeatCheckBox(){
return null; removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat"));
return removeRepeatCheckBox;
}
public Component[] createWaterMarkPane() {
waterMarkField = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField};
} }
protected void populateSubCustomWritableRepeatEditorBean(ComboBox e) { protected void populateSubDictionaryEditorBean(ComboBox ob){
removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); removeRepeatCheckBox.setSelected(ob.isRemoveRepeat());
this.dictPane.populateBean(e.getDictionary()); formWidgetValuePane.populate(ob);
} }
protected ComboBox updateSubCustomWritableRepeatEditorBean() { protected ComboBox updateSubDictionaryEditorBean(){
ComboBox combo = new ComboBox(); ComboBox combo = (ComboBox) creator.toData();
combo.setDictionary(this.dictPane.updateBean());
combo.setRemoveRepeat(removeRepeatCheckBox.isSelected()); combo.setRemoveRepeat(removeRepeatCheckBox.isSelected());
formWidgetValuePane.update(combo);
return combo; return combo;
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "ComboBox"; return "ComboBox";
@ -39,6 +48,6 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
} }

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

@ -2,63 +2,61 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
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.present.dict.DictionaryPane;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private CheckBoxDictPane checkBoxDictPane;
private DictionaryPane dictPane;
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
private UIHeadGroup returnType;
private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox;
public ComboCheckBoxDefinePane(XCreator xCreator) { public ComboCheckBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
dictPane = new DictionaryPane(); }
checkBoxDictPane = new CheckBoxDictPane();
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
public UICheckBox createRepeatCheckBox(){
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat"));
return removeRepeatCheckBox;
} }
@Override public Component[] createWaterMarkPane() {
protected JPanel setForthContentPane() { waterMarkDictPane = new UITextField();
JPanel attrPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); }
JPanel contenter = FRGUIPaneFactory.createBorderLayout_L_Pane();
contenter.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
attrPane.add(contenter);
//是否以标签形式显示
JPanel tagPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
tagPane.add(supportTagCheckBox);
contenter.add(tagPane, BorderLayout.NORTH);
contenter.add(checkBoxDictPane, BorderLayout.WEST); public JPanel createOtherPane(){
return attrPane; supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
}
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIHeadGroup(tabTitles) {
@Override @Override
protected void populateSubCustomWritableRepeatEditorBean(ComboCheckBox e) { public void tabChanged(int index) {
this.dictPane.populateBean(e.getDictionary()); ComboCheckBox combo = (ComboCheckBox) creator.toData();
this.checkBoxDictPane.populate(e); //todo
this.supportTagCheckBox.setSelected(e.isSupportTag()); if (index == 1) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); combo.setReturnString(true);
} else {
combo.setReturnString(false);
} }
}
};
public JPanel createOtherPane(){
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UICheckBox(Inter.getLocText("Form-SupportTag")), null }, new Component[]{supportTagCheckBox, null },
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), new UITextField()}, new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnType},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -68,19 +66,30 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
return panel; return panel;
} }
@Override protected void populateSubDictionaryEditorBean(ComboCheckBox ob){
protected ComboCheckBox updateSubCustomWritableRepeatEditorBean() { if (ob.isReturnString()) {
ComboCheckBox combo = new ComboCheckBox(); returnType.setSelectedIndex(1);
} else {
returnType.setSelectedIndex(0);
}
waterMarkDictPane.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob);
this.supportTagCheckBox.setSelected(ob.isSupportTag());
this.removeRepeatCheckBox.setSelected(ob.isRemoveRepeat());
}
protected ComboCheckBox updateSubDictionaryEditorBean(){
ComboCheckBox combo = (ComboCheckBox) creator.toData();
formWidgetValuePane.update(combo);
combo.setWaterMark(waterMarkDictPane.getText());
combo.setSupportTag(this.supportTagCheckBox.isSelected()); combo.setSupportTag(this.supportTagCheckBox.isSelected());
combo.setDictionary(this.dictPane.updateBean());
checkBoxDictPane.update(combo);
combo.setRemoveRepeat(removeRepeatCheckBox.isSelected()); combo.setRemoveRepeat(removeRepeatCheckBox.isSelected());
return combo; return combo;
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
@Override @Override

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

@ -1 +1 @@
package com.fr.design.widget.ui.designer; import com.fr.base.GraphHelper; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane(XCreator xCreator) { super(xCreator); } // @Override // protected JPanel setThirdContentPane() { // JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); // contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // JPanel otherContentPane = this.setForthContentPane(); // if (otherContentPane != null) { // contentPane.add(otherContentPane,BorderLayout.CENTER); // } // return contentPane; // } public JPanel setValidatePane(){ this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); JPanel otherContentPane = super.setValidatePane(); otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5)); return otherContentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } package com.fr.design.widget.ui.designer; import com.fr.base.GraphHelper; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane(XCreator xCreator) { super(xCreator); } public JPanel setValidatePane(){ this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); JPanel otherContentPane = super.setValidatePane(); otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5)); return otherContentPane; } protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); }

52
designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -7,12 +7,15 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; 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;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.DateEditor; import com.fr.form.ui.DateEditor;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -34,6 +37,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox dateFormatComboBox; private UIComboBox dateFormatComboBox;
private ValueEditorPane startDv; private ValueEditorPane startDv;
private ValueEditorPane endDv; private ValueEditorPane endDv;
private WaterMarkDictPane waterMarkDictPane;
private FormWidgetValuePane formWidgetValuePane;
private UISpinner fontSizePane;
private UIHeadGroup formatHeader;
public DateEditorDefinePane(XCreator xCreator) { public DateEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -48,6 +55,8 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
fontSizePane = new UISpinner(0, 20, 1, 0);
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST); returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIComboBox(new String[]{Inter.getLocText("String"), Inter.getLocText("Date")}); returnTypeComboBox = new UIComboBox(new String[]{Inter.getLocText("String"), Inter.getLocText("Date")});
@ -57,7 +66,8 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4)); sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER); sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont()); sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane("示例");
previewPane.add(sampleLabel);
// content pane // content pane
String[] arr = getDateFormateArray(); String[] arr = getDateFormateArray();
dateFormatComboBox = new UIComboBox(arr); dateFormatComboBox = new UIComboBox(arr);
@ -68,33 +78,41 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
}); });
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),dateFormatComboBox,sampleLabel}, FlowLayout.LEFT, 5);
secondPanel.setPreferredSize(new Dimension(220,30));
startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null); startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null); endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
initFormatHeader();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox}, new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox},
new Component[]{null, sampleLabel}, new Component[]{null, previewPane},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv}, new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv},
new Component[]{new UILabel(Inter.getLocText("FS_End_Date") + ":"), endDv}, new Component[]{new UILabel(Inter.getLocText("FS_End_Date") + ":"), endDv},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark") + ":"), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane},
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox}
}; };
double[] rowSize = {p, p,p,p,p}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel; return panel;
} }
protected JPanel setSecondContentPane(){ protected void initFormatHeader() {
return null; String [] tabTitles = getDateFormateArray();
formatHeader = new UIHeadGroup(tabTitles){
protected void tabChanged(int newSelectedIndex) {
} }
};
}
private String[] getDateFormateArray() { private String[] getDateFormateArray() {
return FormatField.getInstance().getDateFormatArray(); return FormatField.getInstance().getDateFormatArray();
} }
@ -137,10 +155,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected void populateSubDirectWriteEditorBean(DateEditor e) { protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText(); String formatText = e.getFormatText();
// dateFormatComboBox.setSelectedItem(formatText); dateFormatComboBox.setSelectedItem(formatText);
//
// returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0);
formWidgetValuePane.populate(e);
populateStartEnd(e); populateStartEnd(e);
} }
@ -150,7 +168,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
ob.setFormatText(this.getSimpleDateFormat().toPattern()); ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 1); ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 1);
formWidgetValuePane.update(ob);
updateStartEnd(ob); updateStartEnd(ob);
return ob; return ob;
@ -158,6 +176,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
/** /**
* 初始起止日期 * 初始起止日期
*
* @param dateWidgetEditor 日期控件 * @param dateWidgetEditor 日期控件
*/ */
public void populateStartEnd(DateEditor dateWidgetEditor) { public void populateStartEnd(DateEditor dateWidgetEditor) {
@ -179,6 +198,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
/** /**
* 更新日期控件的起止日期 * 更新日期控件的起止日期
*
* @param dateWidgetEditor 日期控件 * @param dateWidgetEditor 日期控件
*/ */
public void updateStartEnd(DateEditor dateWidgetEditor) { public void updateStartEnd(DateEditor dateWidgetEditor) {

47
designer_form/src/com/fr/design/widget/ui/designer/DictEditorDefinePane.java

@ -0,0 +1,47 @@
package com.fr.design.widget.ui.designer;
import com.fr.data.Dictionary;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.form.ui.DictContainedCustomWriteAbleEditor;
import com.fr.general.Inter;
import java.awt.*;
/**
* Created by ibm on 2017/8/6.
*/
public abstract class DictEditorDefinePane<T extends DictContainedCustomWriteAbleEditor> extends CustomWritableRepeatEditorPane<T> {
private AccessibleDictionaryEditor dictionaryEditor;
public DictEditorDefinePane(XCreator xCreator) {
super(xCreator);
}
protected Component[] createDictPane(){
dictionaryEditor = new AccessibleDictionaryEditor();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor};
}
@Override
protected void populateSubCustomWritableRepeatEditorBean(T e) {
populateSubDictionaryEditorBean(e);
dictionaryEditor.setValue(e.getDictionary());
}
@Override
protected T updateSubCustomWritableRepeatEditorBean() {
T e = updateSubDictionaryEditorBean();
e.setDictionary((Dictionary) dictionaryEditor.getValue());
return e;
}
protected abstract void populateSubDictionaryEditorBean(T e);
protected abstract T updateSubDictionaryEditorBean();
}

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

@ -3,7 +3,6 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; 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;
@ -18,8 +17,7 @@ import java.awt.*;
//richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树 //richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树
public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> { public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> {
public UICheckBox directWriteCheckBox; public UICheckBox directWriteCheckBox;
protected WaterMarkDictPane waterMarkDictPane; protected FormWidgetValuePane formWidgetValuePane;
protected UICheckBox removeRepeatCheckBox;
public DirectWriteEditorDefinePane(XCreator xCreator) { public DirectWriteEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -29,17 +27,17 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
waterMarkDictPane = new WaterMarkDictPane(); Component[] removeRepeatPane = new Component[]{createRepeatCheckBox(), null};
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget_No_Repeat")); Component[] dicPane = createDictPane();
FormWidgetValuePane formWidgetValuePane = new FormWidgetValuePane(); Component[] waterMarkComponent = createWaterMarkPane();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), new UITextField()}, dicPane,
new Component[]{removeRepeatCheckBox, null}, removeRepeatPane,
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}, waterMarkComponent,
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p, p,p}; double[] rowSize = {p, p, p, p, p, p,p};
@ -56,6 +54,18 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
return advancePane; return advancePane;
} }
public UICheckBox createRepeatCheckBox(){
return null;
}
public Component[] createWaterMarkPane() {
return new Component[]{null, null};
}
protected Component[] createDictPane(){
return new Component[]{null, null};
}
public JPanel createOtherPane(){ public JPanel createOtherPane(){
return null; return null;
} }
@ -73,8 +83,6 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected void populateSubFieldEditorBean(T e) { protected void populateSubFieldEditorBean(T e) {
this.directWriteCheckBox.setSelected(e.isDirectEdit()); this.directWriteCheckBox.setSelected(e.isDirectEdit());
this.waterMarkDictPane.populate(e);
removeRepeatCheckBox.setSelected(e.isChartRelated());
populateSubDirectWriteEditorBean(e); populateSubDirectWriteEditorBean(e);
} }
@ -83,9 +91,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected T updateSubFieldEditorBean() { protected T updateSubFieldEditorBean() {
T e = updateSubDirectWriteEditorBean(); T e = updateSubDirectWriteEditorBean();
e.setDirectEdit(directWriteCheckBox.isSelected()); e.setDirectEdit(directWriteCheckBox.isSelected());
this.waterMarkDictPane.update(e);
return e; return e;
} }

51
designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java

@ -0,0 +1,51 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.widget.ui.designer.component.BackgroundCompPane;
import com.fr.form.ui.FreeButton;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by ibm on 2017/8/6.
*/
public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
private BackgroundCompPane backgroundCompPane;
private FRFontPane frFontPane;
public FreeButtonDefinePane(XCreator xcreator) {
super(xcreator);
}
public Component[] createBackgroundComp() {
backgroundCompPane = new BackgroundCompPane();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane};
}
public Component[] createFontPane(){
UILabel fontLabel = new UILabel(Inter.getLocText("FR-Designer_Font"));
fontLabel.setVerticalAlignment(SwingConstants.TOP);
frFontPane = new FRFontPane();
return new Component[]{fontLabel, frFontPane};
}
public void populateSubButtonPane(FreeButton e) {
backgroundCompPane.populate(e);
FRFont frFont = e.getFont();
if(frFont!=null){
frFontPane.populateBean(e.getFont());
}
}
public FreeButton updateSubButtonPane() {
FreeButton freeButton = (FreeButton) creator.toData();
backgroundCompPane.update(freeButton);
frFontPane.update(freeButton.getFont());
return freeButton;
}
}

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

@ -1,16 +1,19 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.base.BaseUtils;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory; 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.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.Label; import com.fr.form.ui.Label;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -23,6 +26,8 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
private UICheckBox isPageSetupVertically; private UICheckBox isPageSetupVertically;
private UICheckBox isStyleAlignmentWrapText; private UICheckBox isStyleAlignmentWrapText;
private UIButtonGroup hAlignmentPane;
private FRFontPane frFontPane;
public LabelDefinePane(XCreator xCreator) { public LabelDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -37,20 +42,30 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
} }
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
isPageSetupVertically = new UICheckBox(Inter.getLocText("FR-Designer_PageSetup-Vertically")); isPageSetupVertically = new UICheckBox(Inter.getLocText("FR-Designer_PageSetup-Vertically"));
isStyleAlignmentWrapText = new UICheckBox(Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text")); isStyleAlignmentWrapText = new UICheckBox(Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text"));
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),};
Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Left")
, Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")});
frFontPane = new FRFontPane();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
UILabel fontLabel = new UILabel(Inter.getLocText("FR-Designer_Font-Size"));
fontLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{isStyleAlignmentWrapText, null}, new Component[]{isStyleAlignmentWrapText, null},
new Component[]{isPageSetupVertically, 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_Widget_Display_Position")), hAlignmentPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), new UITextField()}, new Component[]{fontLabel, frFontPane},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
@ -64,16 +79,22 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
@Override @Override
public void populateBean(Label ob) { public void populateBean(Label ob) {
formWidgetValuePane.populate(ob);
isStyleAlignmentWrapText.setSelected(ob.isAutoLine()); isStyleAlignmentWrapText.setSelected(ob.isAutoLine());
isPageSetupVertically.setSelected(ob.isVerticalCenter()); isPageSetupVertically.setSelected(ob.isVerticalCenter());
hAlignmentPane.setSelectedIndex(ob.getTextalign());
frFontPane.populateBean(ob.getFont());
} }
@Override @Override
public Label updateBean() { public Label updateBean() {
Label layout = (Label) creator.toData(); Label layout = (Label) creator.toData();
formWidgetValuePane.update(layout);
layout.setAutoLine(isStyleAlignmentWrapText.isSelected()); layout.setAutoLine(isStyleAlignmentWrapText.isSelected());
layout.setVerticalCenter(isPageSetupVertically.isSelected()); layout.setVerticalCenter(isPageSetupVertically.isSelected());
layout.setTextalign(hAlignmentPane.getSelectedIndex());
layout.setFont(frFontPane.update(layout.getFont()));
return layout; return layout;
} }
} }

60
designer_form/src/com/fr/design/widget/ui/designer/ListEditorDefinePane.java

@ -1,60 +0,0 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.ListEditor;
import com.fr.general.Inter;
import javax.swing.*;
public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor> {
private UICheckBox needHeadCheckBox;
private DictionaryPane dictPane;
public ListEditorDefinePane() {
this.initComponents();
}
@Override
protected void initComponents() {
super.initComponents();
dictPane = new DictionaryPane();
}
@Override
protected JPanel setThirdContentPane() {
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel centerPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
centerPane.add(needHeadCheckBox = new UICheckBox(Inter.getLocText("List-Need_Head")));
contenter.add(centerPane);
return contenter;
}
@Override
public String title4PopupWindow() {
return "List";
}
@Override
protected void populateSubWriteUnableRepeatBean(ListEditor e) {
needHeadCheckBox.setSelected(e.isNeedHead());
this.dictPane.populateBean(e.getDictionary());
}
@Override
protected ListEditor updateSubWriteUnableRepeatBean() {
ListEditor ob = new ListEditor();
ob.setNeedHead(needHeadCheckBox.isSelected());
ob.setDictionary(this.dictPane.updateBean());
return ob;
}
@Override
public DataCreatorUI dataUI() {
return dictPane;
}
}

8
designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java

@ -5,8 +5,8 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; 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;
@ -20,7 +20,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
private DictionaryComboBox acceptType; private DictionaryComboBox acceptType;
private UICheckBox singleFileCheckBox; private UICheckBox singleFileCheckBox;
private UINumberField fileSizeField; private UINumberField fileSizeField;
private UITextField fontSizeField; private UISpinner fontSizeField;
public MultiFileEditorPane(XCreator xCreator) { public MultiFileEditorPane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -37,7 +37,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays); acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays);
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD")); singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD"));
fileSizeField = new UINumberField(); fileSizeField = new UINumberField();
fontSizeField = new UITextField(); fontSizeField = new UISpinner(0, 20, 1, 0);
JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
@ -77,6 +77,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
acceptType.setSelectedItem(e.getAccept()); acceptType.setSelectedItem(e.getAccept());
singleFileCheckBox.setSelected(e.isSingleFile()); singleFileCheckBox.setSelected(e.isSingleFile());
fileSizeField.setValue(e.getMaxSize()); fileSizeField.setValue(e.getMaxSize());
fontSizeField.setValue(e.getFontSize());
} }
@Override @Override
@ -85,6 +86,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
ob.setAccept((String) acceptType.getSelectedItem()); ob.setAccept((String) acceptType.getSelectedItem());
ob.setSingleFile(singleFileCheckBox.isSelected()); ob.setSingleFile(singleFileCheckBox.isSelected());
ob.setMaxSize(fileSizeField.getValue()); ob.setMaxSize(fileSizeField.getValue());
ob.setFontSize((int)fontSizeField.getValue());
return ob; return ob;
} }

15
designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -4,7 +4,6 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UITextField;
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.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
@ -23,7 +22,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public NumberEditorDefinePane(XCreator xCreator){ public NumberEditorDefinePane(XCreator xCreator){
super(xCreator); super(xCreator);
} }
private FormWidgetValuePane formWidgetValuePane;
/** /**
* *
*/ */
@ -154,13 +153,13 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
// richer:数字的允许直接编辑没有意义 // richer:数字的允许直接编辑没有意义
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
FormWidgetValuePane formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel("控件值"), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel("水印"), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane},
new Component[]{new UILabel("字体大小"), new UITextField()} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
@ -217,7 +216,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 3); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 3);
return panel; return panel;
} }
@ -252,6 +250,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setEnabled(true); minValueSpinner.setEnabled(true);
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
formWidgetValuePane.populate(e);
// this.regErrorMsgTextField.setText(e.getRegErrorMessage()); // this.regErrorMsgTextField.setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@ -260,6 +259,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
protected NumberEditor updateSubFieldEditorBean() { protected NumberEditor updateSubFieldEditorBean() {
NumberEditor ob = new NumberEditor(); NumberEditor ob = new NumberEditor();
formWidgetValuePane.update(ob);
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength(this.decimalLength.getValue()); ob.setMaxDecimalLength(this.decimalLength.getValue());
@ -280,7 +280,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.waterMarkDictPane.update(ob); this.waterMarkDictPane.update(ob);
// ob.setRegErrorMessage(this.regErrorMsgTextField.getText());
return ob; return ob;
} }

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

@ -8,13 +8,10 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -34,7 +31,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
// fontSizePane = new UISpinner(0,20,1);
regPane = createRegPane(); regPane = createRegPane();
final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() { final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() {
@ -72,7 +68,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
// }); // });
formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -106,18 +102,16 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected void populateSubFieldEditorBean(TextEditor e) { protected void populateSubFieldEditorBean(TextEditor e) {
this.regPane.populate(e.getRegex()); this.regPane.populate(e.getRegex());
// regErrorMsgTextField.setText(e.getRegErrorMessage());
waterMarkDictPane.setText(e.getWaterMark()); waterMarkDictPane.setText(e.getWaterMark());
formWidgetValuePane.populate(e);
} }
@Override @Override
protected TextEditor updateSubFieldEditorBean() { protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance(); TextEditor ob = newTextEditorInstance();
// ob.setRegErrorMessage(this.regErrorMsgTextField.getText());
ob.setRegex(this.regPane.update()); ob.setRegex(this.regPane.update());
ob.setWaterMark(waterMarkDictPane.getText()); ob.setWaterMark(waterMarkDictPane.getText());
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);
// ob.setFontSize((int)fontSizePane.getValue());
return ob; return ob;
} }

65
designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java

@ -2,75 +2,46 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> { public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
protected TreeSettingPane treeSettingPane;
protected TreeRootPane treeRootPane; protected UITextField waterMarkDictPane;
public TreeComboBoxEditorDefinePane(XCreator xCreator) { public TreeComboBoxEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
} }
public Component[] createWaterMarkPane(){
@Override waterMarkDictPane = new UITextField();
protected JPanel setForthContentPane() { return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane();
content.add(treeRootPane, BorderLayout.NORTH);
treeSettingPane = new TreeSettingPane(true);
return content;
}
public JPanel createOtherPane(){
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"))},
new Component[]{new UICheckBox(Inter.getLocText("Widget-Load_By_Async"))},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Leaf"))},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Path"))}
};
double[] rowSize = {p, p,p,p};
double[] columnSize = {p};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
return panel;
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "treecombobox"; return "treecombobox";
} }
@Override protected void populateSubDictionaryEditorBean(TreeEditor ob){
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) { super.populateSubDictionaryEditorBean(ob);
// treeSettingPane.populate(e); formWidgetValuePane.populate(ob);
// treeRootPane.populate(e.getTreeAttr()); waterMarkDictPane.setText(ob.getWaterMark());
} }
@Override protected TreeEditor updateSubDictionaryEditorBean(){
protected TreeComboBoxEditor updateSubCustomWritableRepeatEditorBean() { TreeEditor editor = super.updateSubDictionaryEditorBean();
TreeComboBoxEditor editor = (TreeComboBoxEditor)creator.toData(); formWidgetValuePane.update(editor);
editor.setTreeAttr(treeRootPane.update()); editor.setWaterMark(waterMarkDictPane.getText());
return editor; return editor;
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return treeSettingPane; return treeSettingPane;

91
designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java

@ -4,13 +4,11 @@ import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
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.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -21,69 +19,32 @@ import java.awt.*;
/* /*
* richer:tree editor * richer:tree editor
*/ */
public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> { public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
protected TreeSettingPane treeSettingPane; protected TreeSettingPane treeSettingPane;
protected TreeRootPane treeRootPane; protected TreeRootPane treeRootPane;
private FormWidgetValuePane formWidgetValuePane; private UICheckBox mutiSelect;
private UICheckBox loadAsync;
private UICheckBox removeRepeatCheckBox; private UICheckBox returnLeaf;
private UICheckBox returnPath;
public TreeEditorDefinePane(XCreator xCreator) { public TreeEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
}
@Override
protected void populateSubFieldEditorBean(TreeEditor e) {
this.treeSettingPane.populate(e);
treeRootPane.populate(e.getTreeAttr());
if (this.removeRepeatCheckBox != null) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
}
}
@Override
protected TreeEditor updateSubFieldEditorBean() {
TreeEditor editor = treeSettingPane.updateTreeEditor();
editor.setTreeAttr(treeRootPane.update());
if (this.removeRepeatCheckBox != null) {
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected());
}
return editor;
}
@Override
protected JPanel setFirstContentPane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
treeRootPane = new TreeRootPane(); treeRootPane = new TreeRootPane();
treeSettingPane = new TreeSettingPane(true); treeSettingPane = new TreeSettingPane(true);
formWidgetValuePane = new FormWidgetValuePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), new UITextField()},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
};
double[] rowSize = {p, p,p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
jPanel.add(panel, BorderLayout.NORTH);
JPanel otherContentPane = this.createOtherPane();
jPanel.add(otherContentPane,BorderLayout.CENTER);
return jPanel;
} }
public JPanel createOtherPane() { public JPanel createOtherPane() {
mutiSelect = new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"));
loadAsync = new UICheckBox(Inter.getLocText("Widget-Load_By_Async"));
returnLeaf = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Leaf"));
returnPath = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Path"));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"))}, new Component[]{mutiSelect},
new Component[]{new UICheckBox(Inter.getLocText("Widget-Load_By_Async"))}, new Component[]{loadAsync},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Leaf"))}, new Component[]{returnLeaf},
new Component[]{new UICheckBox(Inter.getLocText("FR-Designer_Widget_Return_Path"))} new Component[]{returnPath}
}; };
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p, p, p};
double[] columnSize = {p}; double[] columnSize = {p};
@ -97,6 +58,28 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
return "tree"; return "tree";
} }
protected void populateSubDictionaryEditorBean(TreeEditor e){
formWidgetValuePane.populate(e);
treeSettingPane.populate(e);
treeRootPane.populate(e.getTreeAttr());
mutiSelect.setSelected(e.isMultipleSelection());
loadAsync.setSelected(e.isAjax());
returnLeaf.setSelected(e.isSelectLeafOnly());
returnPath.setSelected(e.isReturnFullPath());
}
protected TreeEditor updateSubDictionaryEditorBean(){
TreeEditor editor = (TreeEditor)creator.toData();
formWidgetValuePane.update(editor);
editor.setTreeAttr(treeRootPane.update());
editor.setMultipleSelection(mutiSelect.isSelected());
editor.setAjax(loadAsync.isSelected());
editor.setSelectLeafOnly(returnLeaf.isSelected());
editor.setReturnFullPath(returnPath.isSelected());
return editor;
}
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return treeSettingPane; return treeSettingPane;

18
designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -1,34 +1,28 @@
package com.fr.design.widget.ui.designer.btn; package com.fr.design.widget.ui.designer.btn;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; 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.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; 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.widget.ui.designer.AbstractDataModify; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.ui.designer.ButtonGroupDictPane; import com.fr.design.widget.ui.designer.ButtonGroupDictPane;
import com.fr.design.widget.ui.designer.FieldEditorDefinePane; import com.fr.design.widget.ui.designer.FieldEditorDefinePane;
import com.fr.design.widget.ui.designer.WaterMarkDictPane;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.ButtonGroup; import com.fr.form.ui.ButtonGroup;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/** /**
* Created by ibm on 2017/8/5. * Created by ibm on 2017/8/5.
*/ */
public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends FieldEditorDefinePane<T> { public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends FieldEditorDefinePane<T> {
protected AccessibleDictionaryEditor dictionaryEditor;
private ButtonGroupDictPane buttonGroupDictPane; private ButtonGroupDictPane buttonGroupDictPane;
private FormWidgetValuePane formWidgetValuePane;
public ButtonGroupDefinePane(XCreator xCreator) { public ButtonGroupDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -38,8 +32,9 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
dictionaryEditor = new AccessibleDictionaryEditor();
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
FormWidgetValuePane formWidgetValuePane = new FormWidgetValuePane(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -70,6 +65,7 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
@Override @Override
protected void populateSubFieldEditorBean(T e) { protected void populateSubFieldEditorBean(T e) {
this.buttonGroupDictPane.populate(e); this.buttonGroupDictPane.populate(e);
formWidgetValuePane.populate(e);
populateSubButtonGroupBean(e); populateSubButtonGroupBean(e);
} }
@ -81,11 +77,11 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
protected T updateSubFieldEditorBean() { protected T updateSubFieldEditorBean() {
T e = updateSubButtonGroupBean(); T e = updateSubButtonGroupBean();
this.buttonGroupDictPane.update(e); this.buttonGroupDictPane.update(e);
formWidgetValuePane.update(e);
return e; return e;
} }
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {

115
designer_form/src/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java

@ -1,9 +1,16 @@
package com.fr.design.widget.ui.designer.component; package com.fr.design.widget.ui.designer.component;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.editor.*;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.widget.ui.designer.custom.*; import com.fr.design.mainframe.widget.editors.DataBindingEditor;
import com.fr.form.ui.TextEditor; import com.fr.design.mainframe.widget.editors.DataTableEditor;
import com.fr.design.mainframe.widget.editors.ServerDataBindingEditor;
import com.fr.design.mainframe.widget.editors.ServerDataTableEditor;
import com.fr.form.ui.DataControl;
import com.fr.form.ui.WidgetValue;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -13,44 +20,114 @@ import java.awt.*;
*/ */
public class FormWidgetValuePane extends JPanel { public class FormWidgetValuePane extends JPanel {
private UIHeadGroup widgetValueHead; private UIHeadGroup widgetValueHead;
private Editor[] editor;
public FormWidgetValuePane() {
WidgetValuePane StringPane = new WidgetValueString(); public FormWidgetValuePane(Object o, boolean onlyServer) {
WidgetValuePane FormulaPane = new WidgetValueFormula(); DataControl widget = (DataControl) o;
WidgetValuePane FieldPane = new WidgetValueField(); editor = createWidgetValueEditor(widget, onlyServer);
this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL)); this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL));
final CardLayout cardLayout = new CardLayout(); final CardLayout cardLayout = new CardLayout();
final JPanel customPane = new JPanel(cardLayout); final JPanel customPane = new JPanel(cardLayout);
customPane.add(StringPane.createWidgetValuePane(), StringPane.markTitle()); final String [] tabTitles = new String[editor.length];
customPane.add(FormulaPane.createWidgetValuePane(), FormulaPane.markTitle()); for(int i = 0; i < editor.length; i++){
customPane.add(FieldPane.createWidgetValuePane(), FieldPane.markTitle()); customPane.add(editor[i], editor[i].getName());
tabTitles[i] = editor[i].getName();
final String[] tabTitles = new String[]{StringPane.markTitle(), FormulaPane.markTitle(), FieldPane.markTitle()}; }
widgetValueHead = new UIHeadGroup(tabTitles) { widgetValueHead = new UIHeadGroup(tabTitles) {
@Override @Override
public void tabChanged(int index) { public void tabChanged(int index) {
//todo //todo
if (index == 2) { attributeChange(index, customPane, cardLayout, tabTitles);
}
};
this.add(widgetValueHead, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER);
}
public void attributeChange(int index, JPanel customPane, CardLayout cardLayout, String[] tabTitles){
if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("FieldBinding"))) {
customPane.setPreferredSize(new Dimension(100, 50)); customPane.setPreferredSize(new Dimension(100, 50));
} else { } else {
customPane.setPreferredSize(new Dimension(100, 20)); customPane.setPreferredSize(new Dimension(100, 20));
} }
cardLayout.show(customPane, tabTitles[index]); cardLayout.show(customPane, tabTitles[index]);
} }
};
this.add(widgetValueHead, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER);
/**
* 根据类型创建
* @param type 类型
* @param onlyServer 是否是服务器
* @return 编辑器
*/
public static Editor createWidgetValueEditorByType(int type, boolean onlyServer) {
switch (type) {
case DataControl.TYPE_NUMBER:
return new DoubleEditor();
case DataControl.TYPE_FORMULA:
return new FormulaEditor(Inter.getLocText("Parameter-Formula"));
case DataControl.TYPE_DATABINDING:
return onlyServer ? new ServerDataBindingEditor() : new DataBindingEditor();
case DataControl.TYPE_STRING:
return new com.fr.design.editor.editor.TextEditor();
case DataControl.TYPE_BOOLEAN:
return new BooleanEditor(false);
case DataControl.TYPE_DATE:
return new DateEditor(true, Inter.getLocText("Date"));
case DataControl.TYPE_TABLEDATA:
return onlyServer ? new ServerDataTableEditor() : new DataTableEditor();
default:
return null;
}
} }
public void update(TextEditor ob) {
//todo /**
* 用DataControl构建
* @param data 数据
* @param onlyServer 是否是服务器
* @return 编辑器
*/
public static Editor[] createWidgetValueEditor(DataControl data, boolean onlyServer) {
int types[] = data.getValueType();
Editor[] editor = new Editor[types.length ];
for (int i = 0; i < types.length; i++) {
editor[i] = createWidgetValueEditorByType(types[i], onlyServer);
} }
return editor;
}
public void populate(TextEditor ob) { public void update(DataControl ob) {
//todo int index = widgetValueHead.getSelectedIndex();
Editor e = editor[index];
Object value = e.getValue();
ob.setWidgetValue(new WidgetValue(value));
}
public void populate(DataControl ob) {
WidgetValue widgetValue = ob.getWidgetValue();
for (int i = 0; i < editor.length; i++) {
if (editor[i].accept(widgetValue)) {
setCardValue(i, widgetValue);
break;
}
}
}
private void setCardValue(int i, Object object){
widgetValueHead.setSelectedIndex(i);
editor[i].setValue(object);
// kunsnat: bug7861 所有的Editor值都要跟随改变, 因为populate的editor 从""
// 一定是最后的Editor哦.
for (int j = 0; j < editor.length; j++) {
if (i == j) {
continue;
}
this.editor[j].setValue(null);
}
} }
} }

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

@ -12,15 +12,16 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; 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.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.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.mainframe.FormSelectionUtils;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
@ -42,7 +43,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
private UIComboBox adaptComboBox; private UIComboBox adaptComboBox;
private UISpinner componentIntervel; private UISpinner componentIntervel;
private PaddingBoundPane paddingBound; private PaddingBoundPane paddingBound;
private UITextField background; private AccessibleWLayoutBorderStyleEditor background;
public FRFitLayoutDefinePane(XCreator xCreator) { public FRFitLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -63,7 +64,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
background = new UITextField(); background = new AccessibleWLayoutBorderStyleEditor();
paddingBound = new PaddingBoundPane(); paddingBound = new PaddingBoundPane();
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); 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)); jp2.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
@ -111,11 +112,11 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
@Override @Override
public void populateBean(WFitLayout ob) { public void populateBean(WFitLayout ob) {
background.setText("test");
paddingBound.populate(ob); paddingBound.populate(ob);
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());
adaptComboBox.setSelectedIndex(ob.getCompState()); adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval()); componentIntervel.setValue(ob.getCompInterval());
background.setValue(ob.getBackground());
} }
@ -123,6 +124,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public WFitLayout updateBean() { public WFitLayout updateBean() {
WFitLayout layout = (WFitLayout) creator.toData(); WFitLayout layout = (WFitLayout) creator.toData();
paddingBound.update(layout); paddingBound.update(layout);
layout.setBorderStyle((LayoutBorderStyle) background.getValue());
Item item = (Item) layoutComboBox.getSelectedItem(); Item item = (Item) layoutComboBox.getSelectedItem();
Object value = item.getValue(); Object value = item.getValue();
int state = 0; int state = 0;

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

@ -3,7 +3,11 @@ package com.fr.design.widget.ui.designer.layout;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
@ -16,6 +20,7 @@ import java.awt.*;
* Created by ibm on 2017/8/3. * Created by ibm on 2017/8/3.
*/ */
public class WTitleLayoutDefinePane extends AbstractDataModify<WTitleLayout> { public class WTitleLayoutDefinePane extends AbstractDataModify<WTitleLayout> {
private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
private PaddingBoundPane paddingBoundPane; private PaddingBoundPane paddingBoundPane;
private UICheckBox displayECToolBar; private UICheckBox displayECToolBar;
public WTitleLayoutDefinePane(XCreator xCreator) { public WTitleLayoutDefinePane(XCreator xCreator) {
@ -25,13 +30,25 @@ public class WTitleLayoutDefinePane extends AbstractDataModify<WTitleLayout> {
public void initComponent() { public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); borderStyleEditor = new AccessibleWLayoutBorderStyleEditor();
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
paddingBoundPane = new PaddingBoundPane(); paddingBoundPane = new PaddingBoundPane();
displayECToolBar = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Display_Report_Tool")); displayECToolBar = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Display_Report_Tool"));
advancePane.add(paddingBoundPane, BorderLayout.NORTH); double f = TableLayout.FILL;
advancePane.add(displayECToolBar, BorderLayout.CENTER); 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_Style")), borderStyleEditor},
new Component[]{paddingBoundPane, null},
new Component[]{displayECToolBar, null}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, panel);
this.add(advanceExpandablePane); this.add(advanceExpandablePane);
} }
@Override @Override
@ -42,7 +59,7 @@ public class WTitleLayoutDefinePane extends AbstractDataModify<WTitleLayout> {
@Override @Override
public void populateBean(WTitleLayout ob) { public void populateBean(WTitleLayout ob) {
paddingBoundPane.populate(ob); paddingBoundPane.populate(ob);
// displayECToolBar.setSelected(ob.ds); // displayECToolBar.setSelected(ob.);
} }

Loading…
Cancel
Save