Browse Source

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

master
kerry 7 years ago
parent
commit
6224ff6bbb
  1. 141
      designer/src/com/fr/design/widget/ui/ButtonGroupDictPane.java
  2. 19
      designer/src/com/fr/design/widget/ui/CheckBoxDictPane.java
  3. 45
      designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  4. 23
      designer/src/com/fr/design/widget/ui/ComboBoxDefinePane.java
  5. 47
      designer/src/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java
  6. 2
      designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java
  7. 14
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  8. 20
      designer/src/com/fr/design/widget/ui/ListEditorDefinePane.java
  9. 111
      designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java
  10. 2
      designer/src/com/fr/design/widget/ui/WritableRepeatEditorPane.java
  11. 36
      designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java
  12. 3
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java
  13. 8
      designer_form/src/com/fr/design/widget/ui/designer/RadioGroupDefinePane.java

141
designer/src/com/fr/design/widget/ui/ButtonGroupDictPane.java

@ -1,63 +1,80 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import java.awt.event.ActionListener; import com.fr.data.Dictionary;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ilable.UILabel; import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.icheckbox.UICheckBox; import javax.swing.*;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.ButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.general.Inter; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
public class ButtonGroupDictPane extends JPanel { import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
private UIBasicSpinner columnSpinner; import com.fr.form.ui.ButtonGroup;
private UICheckBox adaptiveCheckbox; import com.fr.general.Inter;
private UILabel columnLabel;
public ButtonGroupDictPane() { public class ButtonGroupDictPane extends JPanel {
this.initComponents(); private UIBasicSpinner columnSpinner;
} private UICheckBox adaptiveCheckbox;
private UILabel columnLabel;
/** private AccessibleDictionaryEditor dictPane;
*
*/
public void initComponents() { public ButtonGroupDictPane() {
this.setLayout(new FlowLayout(0)); this.initComponents();
JPanel pane = new JPanel(new FlowLayout()); }
adaptiveCheckbox = new UICheckBox(Inter.getLocText("Adaptive"), true);
adaptiveCheckbox.addActionListener(new ActionListener() { /**
public void actionPerformed(ActionEvent e) { *
columnSpinner.setVisible(!adaptiveCheckbox.isSelected()); */
columnLabel.setVisible(!adaptiveCheckbox.isSelected()); public void initComponents() {
} dictPane = new AccessibleDictionaryEditor();
}); this.setLayout(FRGUIPaneFactory.createBorderLayout());
adaptiveCheckbox = new UICheckBox(Inter.getLocText("Adaptive"), true);
this.columnLabel = new UILabel(Inter.getLocText("Button-Group-Display-Columns")); adaptiveCheckbox.addActionListener(new ActionListener() {
columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1)); public void actionPerformed(ActionEvent e) {
pane.add(adaptiveCheckbox); columnSpinner.setVisible(!adaptiveCheckbox.isSelected());
pane.add(columnLabel); columnLabel.setVisible(!adaptiveCheckbox.isSelected());
pane.add(columnSpinner); }
});
this.add(pane); this.columnLabel = new UILabel(Inter.getLocText("Button-Group-Display-Columns") + ":");
} columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
public void populate(ButtonGroup buttonGroup) { double f = TableLayout.FILL;
adaptiveCheckbox.setSelected(buttonGroup.isAdaptive()); double p = TableLayout.PREFERRED;
columnSpinner.setVisible(!adaptiveCheckbox.isSelected()); double rowSize[] = {p, p};
columnLabel.setVisible(!adaptiveCheckbox.isSelected()); double columnSize[] = {p, p, f};
columnSpinner.setValue(buttonGroup.getColumnsInRow()); Component[][] n_components = {
} {new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane, null},
{adaptiveCheckbox, columnLabel, columnSpinner}
public void update(ButtonGroup buttonGroup) { };
buttonGroup.setAdaptive(adaptiveCheckbox.isSelected()); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 16, 8);
buttonGroup.setColumnsInRow((Integer)(columnSpinner.getValue())); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
} this.add(panel);
}
public void populate(ButtonGroup buttonGroup) {
dictPane.setValue(buttonGroup.getDictionary());
adaptiveCheckbox.setSelected(buttonGroup.isAdaptive());
columnSpinner.setVisible(!adaptiveCheckbox.isSelected());
columnLabel.setVisible(!adaptiveCheckbox.isSelected());
columnSpinner.setValue(buttonGroup.getColumnsInRow());
}
public void update(ButtonGroup buttonGroup) {
buttonGroup.setDictionary((Dictionary) this.dictPane.getValue());
buttonGroup.setAdaptive(adaptiveCheckbox.isSelected());
buttonGroup.setColumnsInRow((Integer)(columnSpinner.getValue()));
}
} }

19
designer/src/com/fr/design/widget/ui/CheckBoxDictPane.java

@ -1,6 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -11,6 +11,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
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.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -27,31 +28,29 @@ public class CheckBoxDictPane extends JPanel {
private JPanel endPane; private JPanel endPane;
public CheckBoxDictPane() { public CheckBoxDictPane() {
JPanel returnTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); this.setLayout(FRGUIPaneFactory.createBorderLayout());
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("Widget-Array"), Inter.getLocText("String")}); returnTypeComboBox = new UIComboBox(new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")});
returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER); returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER);
this.add(returnTypePane);
delimiterPane =FRGUIPaneFactory.createBorderLayout_S_Pane(); delimiterPane =FRGUIPaneFactory.createBorderLayout_S_Pane();
UILabel label = new UILabel(Inter.getLocText("Form-Delimiter") + ":"); UILabel label = new UILabel(Inter.getLocText("Form-Delimiter") + ":");
delimiterPane.add(label, BorderLayout.WEST); delimiterPane.add(label, BorderLayout.WEST);
delimiterPane.add(delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays), BorderLayout.CENTER); delimiterPane.add(delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays), BorderLayout.CENTER);
delimiterComboBox.setEditable(true); delimiterComboBox.setEditable(true);
this.add(delimiterPane);
startPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); startPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
startPane.add(new UILabel(Inter.getLocText("ComboCheckBox-Start_Symbol") + ":"), BorderLayout.WEST); startPane.add(new UILabel(Inter.getLocText("ComboCheckBox-Start_Symbol") + ":"), BorderLayout.WEST);
startPane.add(startComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER); startPane.add(startComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER);
startComboBox.setEditable(true); startComboBox.setEditable(true);
this.add(startPane);
endPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); endPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
endPane.add(new UILabel(Inter.getLocText("ComboCheckBox-End_Symbol") + ":"), BorderLayout.WEST); endPane.add(new UILabel(Inter.getLocText("ComboCheckBox-End_Symbol") + ":"), BorderLayout.WEST);
endPane.add(endComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER); endPane.add(endComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER);
endComboBox.setEditable(true); endComboBox.setEditable(true);
this.add(endPane); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{returnTypePane, delimiterPane, startPane, endComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(jPanel);
returnTypeComboBox.addActionListener(new ActionListener(){ returnTypeComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkVisible(); checkVisible();

45
designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -1,7 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.FlowLayout;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -9,9 +8,13 @@ import javax.swing.JPanel;
import com.fr.data.Dictionary; import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
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.AccessibleDictionaryEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -31,7 +34,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
dictPane = new AccessibleDictionaryEditor();
} }
@Override @Override
@ -41,27 +43,28 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); dictPane = new AccessibleDictionaryEditor();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkBoxDictPane = new CheckBoxDictPane();
checkBoxDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));
northPane.add(checkBoxDictPane, BorderLayout.NORTH);
JPanel chooseAllPane = new JPanel();
checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"})); checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
chooseAllPane.add(checkbox);
chooseAllPane.setLayout(new FlowLayout(FlowLayout.LEFT, 8, 0));
northPane.add(chooseAllPane, BorderLayout.CENTER);
attrPane.add(northPane, BorderLayout.NORTH);
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0)); checkBoxDictPane = new CheckBoxDictPane();
centerPane.add(buttonGroupDictPane); double f = TableLayout.FILL;
attrPane.add(centerPane, BorderLayout.CENTER); double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{buttonGroupDictPane, null },
new Component[]{checkbox, null },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane },
new Component[]{checkBoxDictPane, null },
};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel);
return advancePane;
return attrPane;
} }
@Override @Override

23
designer/src/com/fr/design/widget/ui/ComboBoxDefinePane.java

@ -1,13 +1,20 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import javax.swing.JPanel; import javax.swing.*;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.ComboBox; import com.fr.form.ui.ComboBox;
import com.fr.general.Inter;
import java.awt.*;
public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox> { public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox> {
protected DictionaryPane dictPane; protected AccessibleDictionaryEditor dictPane;
public ComboBoxDefinePane() { public ComboBoxDefinePane() {
this.initComponents(); this.initComponents();
@ -16,20 +23,22 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
@Override @Override
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
dictPane = new DictionaryPane();
} }
protected JPanel setForthContentPane () { protected JPanel setForthContentPane () {
return null; dictPane = new AccessibleDictionaryEditor();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return jPanel;
} }
protected void populateSubCustomWritableRepeatEditorBean(ComboBox e) { protected void populateSubCustomWritableRepeatEditorBean(ComboBox e) {
this.dictPane.populateBean(e.getDictionary()); this.dictPane.setValue(e.getDictionary());
} }
protected ComboBox updateSubCustomWritableRepeatEditorBean() { protected ComboBox updateSubCustomWritableRepeatEditorBean() {
ComboBox combo = new ComboBox(); ComboBox combo = new ComboBox();
combo.setDictionary(this.dictPane.updateBean()); combo.setDictionary((Dictionary) this.dictPane.getValue());
return combo; return combo;
} }
@ -41,6 +50,6 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
} }

47
designer/src/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java

@ -1,47 +1,56 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
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.AccessibleDictionaryEditor;
import com.fr.design.present.dict.DictionaryPane; 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 com.fr.third.fr.pdf.layout.border.Border;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> {
private CheckBoxDictPane checkBoxDictPane; private CheckBoxDictPane checkBoxDictPane;
private DictionaryPane dictPane; private AccessibleDictionaryEditor dictPane;
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
public ComboCheckBoxDefinePane() { public ComboCheckBoxDefinePane() {
super.initComponents(); super.initComponents();
dictPane = new DictionaryPane();
} }
@Override @Override
protected JPanel setForthContentPane() { protected JPanel setForthContentPane() {
JPanel attrPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); dictPane = new AccessibleDictionaryEditor();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkBoxDictPane = new CheckBoxDictPane();
JPanel contenter = FRGUIPaneFactory.createBorderLayout_L_Pane(); supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
contenter.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{supportTagCheckBox, null },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane },
new Component[]{checkBoxDictPane, null },
checkBoxDictPane = new CheckBoxDictPane(); };
attrPane.add(contenter); double[] rowSize = {p, p, p, p};
//是否以标签形式显示 double[] columnSize = {p, f};
JPanel tagPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); int[][] rowCount = {{1, 1},{1, 1},{1,1},{1,1}};
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
tagPane.add(supportTagCheckBox); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
contenter.add(tagPane, BorderLayout.NORTH); advancePane.add(panel);
return advancePane;
contenter.add(checkBoxDictPane, BorderLayout.WEST);
return attrPane;
} }
@Override @Override
protected void populateSubCustomWritableRepeatEditorBean(ComboCheckBox e) { protected void populateSubCustomWritableRepeatEditorBean(ComboCheckBox e) {
this.dictPane.populateBean(e.getDictionary()); this.dictPane.setValue(e.getDictionary());
this.checkBoxDictPane.populate(e); this.checkBoxDictPane.populate(e);
this.supportTagCheckBox.setSelected(e.isSupportTag()); this.supportTagCheckBox.setSelected(e.isSupportTag());
} }
@ -50,14 +59,14 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
protected ComboCheckBox updateSubCustomWritableRepeatEditorBean() { protected ComboCheckBox updateSubCustomWritableRepeatEditorBean() {
ComboCheckBox combo = new ComboCheckBox(); ComboCheckBox combo = new ComboCheckBox();
combo.setSupportTag(this.supportTagCheckBox.isSelected()); combo.setSupportTag(this.supportTagCheckBox.isSelected());
combo.setDictionary(this.dictPane.updateBean()); combo.setDictionary((Dictionary) this.dictPane.getValue());
checkBoxDictPane.update(combo); checkBoxDictPane.update(combo);
return combo; return combo;
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
@Override @Override

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

@ -1 +1 @@
package com.fr.design.widget.ui; import com.fr.base.GraphHelper; 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() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 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 = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } public JPanel setValidatePane(){ 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; import com.fr.base.GraphHelper; 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() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 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 = this.setForthContentPane(); return otherContentPane; } public JPanel setValidatePane(){ 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(); }

14
designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java

@ -1,7 +1,10 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
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.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.DirectWriteEditor; import com.fr.form.ui.DirectWriteEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -12,7 +15,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;
private WaterMarkDictPane waterMarkDictPane; protected WaterMarkDictPane waterMarkDictPane;
public DirectWriteEditorDefinePane() { public DirectWriteEditorDefinePane() {
this.initComponents(); this.initComponents();
@ -21,16 +24,17 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false); directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
directWriteCheckBox.setPreferredSize(new Dimension(100, 30)); directWriteCheckBox.setPreferredSize(new Dimension(100, 30));
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
contentPane.add(waterMarkDictPane); contentPane.add(waterMarkDictPane, BorderLayout.NORTH);
JPanel otherContentPane = this.setSecondContentPane(); JPanel otherContentPane = this.setSecondContentPane();
if (otherContentPane != null) { if (otherContentPane != null) {
contentPane.add(otherContentPane); contentPane.add(otherContentPane, BorderLayout.CENTER);
} }
return contentPane; return contentPane;
} }

20
designer/src/com/fr/design/widget/ui/ListEditorDefinePane.java

@ -2,16 +2,21 @@ package com.fr.design.widget.ui;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
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.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.ListEditor; import com.fr.form.ui.ListEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import java.awt.*;
public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor> { public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor> {
private UICheckBox needHeadCheckBox; private UICheckBox needHeadCheckBox;
private DictionaryPane dictPane; private AccessibleDictionaryEditor dictPane;
public ListEditorDefinePane() { public ListEditorDefinePane() {
this.initComponents(); this.initComponents();
@ -20,9 +25,14 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
@Override @Override
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
dictPane = new DictionaryPane();
} }
protected Component[] createDicPane(){
dictPane = new AccessibleDictionaryEditor();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane};
}
@Override @Override
protected JPanel setThirdContentPane() { protected JPanel setThirdContentPane() {
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
@ -40,7 +50,7 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
@Override @Override
protected void populateSubWriteUnableRepeatBean(ListEditor e) { protected void populateSubWriteUnableRepeatBean(ListEditor e) {
needHeadCheckBox.setSelected(e.isNeedHead()); needHeadCheckBox.setSelected(e.isNeedHead());
this.dictPane.populateBean(e.getDictionary()); this.dictPane.setValue(e.getDictionary());
} }
@Override @Override
@ -48,13 +58,13 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
ListEditor ob = new ListEditor(); ListEditor ob = new ListEditor();
ob.setNeedHead(needHeadCheckBox.isSelected()); ob.setNeedHead(needHeadCheckBox.isSelected());
ob.setDictionary(this.dictPane.updateBean()); ob.setDictionary((Dictionary) this.dictPane.getValue());
return ob; return ob;
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
} }

111
designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java

@ -1,63 +1,50 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.FlowLayout; import javax.swing.JPanel;
import com.fr.design.data.DataCreatorUI;
import javax.swing.JPanel; import com.fr.form.ui.RadioGroup;
import com.fr.design.data.DataCreatorUI; public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane; private ButtonGroupDictPane buttonGroupDictPane;
import com.fr.form.ui.RadioGroup;
public RadioGroupDefinePane() {
public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> { this.initComponents();
private DictionaryPane dictPane; }
private ButtonGroupDictPane buttonGroupDictPane; @Override
protected void initComponents() {
public RadioGroupDefinePane() { super.initComponents();
this.initComponents();
} }
@Override @Override
protected void initComponents() { protected JPanel setFirstContentPane() {
super.initComponents(); buttonGroupDictPane = new ButtonGroupDictPane();
return buttonGroupDictPane;
dictPane = new DictionaryPane(); }
}
@Override
@Override protected RadioGroup updateSubFieldEditorBean() {
protected JPanel setFirstContentPane() { RadioGroup ob = new RadioGroup();
JPanel centerPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); this.buttonGroupDictPane.update(ob);
buttonGroupDictPane = new ButtonGroupDictPane();
buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); return ob;
centerPane.add(buttonGroupDictPane); }
return centerPane;
} @Override
protected String title4PopupWindow() {
@Override return "radiogroup";
protected RadioGroup updateSubFieldEditorBean() { }
RadioGroup ob = new RadioGroup();
@Override
ob.setDictionary(this.dictPane.updateBean()); protected void populateSubFieldEditorBean(RadioGroup ob) {
this.buttonGroupDictPane.update(ob); this.buttonGroupDictPane.populate(ob);
}
return ob;
} @Override
public DataCreatorUI dataUI() {
@Override return null;
protected String title4PopupWindow() { }
return "radiogroup";
}
@Override
protected void populateSubFieldEditorBean(RadioGroup ob) {
this.dictPane.populateBean(ob.getDictionary());
this.buttonGroupDictPane.populate(ob);
}
@Override
public DataCreatorUI dataUI() {
return dictPane;
}
} }

2
designer/src/com/fr/design/widget/ui/WritableRepeatEditorPane.java

@ -15,7 +15,7 @@ public abstract class WritableRepeatEditorPane<E extends WriteAbleRepeatEditor>
@Override @Override
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel otherContentPane = this.setThirdContentPane(); JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) { if (otherContentPane != null) {

36
designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java

@ -1,12 +1,15 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.BorderLayout; import java.awt.*;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
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.form.ui.WriteUnableRepeatEditor; import com.fr.form.ui.WriteUnableRepeatEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -21,15 +24,40 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); JPanel contentPane = FRGUIPaneFactory.createYBoxEmptyBorderPane();
JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); // JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false);
contentPane.add(contenter); // contentPane.add(contenter);
contenter.add(removeRepeatCheckBox); // contenter.add(removeRepeatCheckBox);
// JPanel otherContentPane = this.setThirdContentPane();
// if (otherContentPane != null)
// contentPane.add(otherContentPane,BorderLayout.CENTER);
Component[] dicPane = createDicPane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
dicPane,
new Component[]{removeRepeatCheckBox, null},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
contentPane.add(panel);
JPanel otherContentPane = this.setThirdContentPane(); JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) if (otherContentPane != null)
contentPane.add(otherContentPane,BorderLayout.CENTER); contentPane.add(otherContentPane,BorderLayout.CENTER);
return contentPane; return contentPane;
} }
protected Component[] createDicPane(){
return new Component[]{null, null};
}
protected abstract JPanel setThirdContentPane(); protected abstract JPanel setThirdContentPane();
@Override @Override
protected void populateSubFieldEditorBean(WriteUnableRepeatEditor e) { protected void populateSubFieldEditorBean(WriteUnableRepeatEditor e) {

3
designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java

@ -18,9 +18,6 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor {
super(new DictionaryWrapper()); super(new DictionaryWrapper());
} }
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {

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

@ -7,7 +7,6 @@ import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane;
import com.fr.form.ui.RadioGroup; import com.fr.form.ui.RadioGroup;
public class RadioGroupDefinePane extends ButtonGroupDefinePane<RadioGroup> { public class RadioGroupDefinePane extends ButtonGroupDefinePane<RadioGroup> {
private DictionaryPane dictPane;
public RadioGroupDefinePane(XCreator xCreator) { public RadioGroupDefinePane(XCreator xCreator) {
@ -18,16 +17,12 @@ public class RadioGroupDefinePane extends ButtonGroupDefinePane<RadioGroup> {
@Override @Override
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
dictPane = new DictionaryPane();
} }
@Override @Override
protected RadioGroup updateSubButtonGroupBean() { protected RadioGroup updateSubButtonGroupBean() {
RadioGroup ob = (RadioGroup)creator.toData(); RadioGroup ob = (RadioGroup)creator.toData();
ob.setDictionary(this.dictPane.updateBean());
return ob; return ob;
} }
@ -38,11 +33,10 @@ public class RadioGroupDefinePane extends ButtonGroupDefinePane<RadioGroup> {
@Override @Override
protected void populateSubButtonGroupBean(RadioGroup ob) { protected void populateSubButtonGroupBean(RadioGroup ob) {
this.dictPane.populateBean(ob.getDictionary());
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return dictPane; return null;
} }
} }
Loading…
Cancel
Save