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;
import java.awt.*;
import java.awt.event.ActionEvent;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import java.awt.event.ActionListener;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.ButtonGroup;
import com.fr.general.Inter;
public class ButtonGroupDictPane extends JPanel {
private UIBasicSpinner columnSpinner;
private UICheckBox adaptiveCheckbox;
private UILabel columnLabel;
public ButtonGroupDictPane() {
this.initComponents();
}
/**
*
*/
public void initComponents() {
this.setLayout(new FlowLayout(0));
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());
}
});
this.columnLabel = new UILabel(Inter.getLocText("Button-Group-Display-Columns"));
columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
pane.add(adaptiveCheckbox);
pane.add(columnLabel);
pane.add(columnSpinner);
this.add(pane);
}
public void populate(ButtonGroup buttonGroup) {
adaptiveCheckbox.setSelected(buttonGroup.isAdaptive());
columnSpinner.setVisible(!adaptiveCheckbox.isSelected());
columnLabel.setVisible(!adaptiveCheckbox.isSelected());
columnSpinner.setValue(buttonGroup.getColumnsInRow());
}
public void update(ButtonGroup buttonGroup) {
buttonGroup.setAdaptive(adaptiveCheckbox.isSelected());
buttonGroup.setColumnsInRow((Integer)(columnSpinner.getValue()));
}
package com.fr.design.widget.ui;
import java.awt.*;
import java.awt.event.ActionEvent;
import com.fr.data.Dictionary;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import java.awt.event.ActionListener;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import com.fr.design.gui.icheckbox.UICheckBox;
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.form.ui.ButtonGroup;
import com.fr.general.Inter;
public class ButtonGroupDictPane extends JPanel {
private UIBasicSpinner columnSpinner;
private UICheckBox adaptiveCheckbox;
private UILabel columnLabel;
private AccessibleDictionaryEditor dictPane;
public ButtonGroupDictPane() {
this.initComponents();
}
/**
*
*/
public void initComponents() {
dictPane = new AccessibleDictionaryEditor();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
adaptiveCheckbox = new UICheckBox(Inter.getLocText("Adaptive"), true);
adaptiveCheckbox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
columnSpinner.setVisible(!adaptiveCheckbox.isSelected());
columnLabel.setVisible(!adaptiveCheckbox.isSelected());
}
});
this.columnLabel = new UILabel(Inter.getLocText("Button-Group-Display-Columns") + ":");
columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p};
double columnSize[] = {p, p, f};
Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictPane, null},
{adaptiveCheckbox, columnLabel, columnSpinner}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 16, 8);
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;
import java.awt.BorderLayout;
import java.awt.*;
import java.awt.event.ActionEvent;
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.DictionaryConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.CheckBoxGroup;
import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter;
@ -27,31 +28,29 @@ public class CheckBoxDictPane extends JPanel {
private JPanel endPane;
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);
returnTypeComboBox = new UIComboBox(new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")});
returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER);
this.add(returnTypePane);
delimiterPane =FRGUIPaneFactory.createBorderLayout_S_Pane();
UILabel label = new UILabel(Inter.getLocText("Form-Delimiter") + ":");
delimiterPane.add(label, BorderLayout.WEST);
delimiterPane.add(delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays), BorderLayout.CENTER);
delimiterComboBox.setEditable(true);
this.add(delimiterPane);
startPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
startPane.add(new UILabel(Inter.getLocText("ComboCheckBox-Start_Symbol") + ":"), BorderLayout.WEST);
startPane.add(startComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER);
startComboBox.setEditable(true);
this.add(startPane);
endPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
endPane.add(new UILabel(Inter.getLocText("ComboCheckBox-End_Symbol") + ":"), BorderLayout.WEST);
endPane.add(endComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER);
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(){
public void actionPerformed(ActionEvent e) {
checkVisible();

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

@ -1,7 +1,6 @@
package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -9,9 +8,13 @@ import javax.swing.JPanel;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI;
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.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.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.CheckBoxGroup;
import com.fr.general.Inter;
@ -31,7 +34,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected void initComponents() {
super.initComponents();
dictPane = new AccessibleDictionaryEditor();
}
@Override
@ -41,27 +43,28 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override
protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
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();
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
dictPane = new AccessibleDictionaryEditor();
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.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0));
centerPane.add(buttonGroupDictPane);
attrPane.add(centerPane, BorderLayout.CENTER);
checkBoxDictPane = new CheckBoxDictPane();
double f = TableLayout.FILL;
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

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

@ -1,13 +1,20 @@
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.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.form.ui.ComboBox;
import com.fr.general.Inter;
import java.awt.*;
public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox> {
protected DictionaryPane dictPane;
protected AccessibleDictionaryEditor dictPane;
public ComboBoxDefinePane() {
this.initComponents();
@ -16,20 +23,22 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
@Override
protected void initComponents() {
super.initComponents();
dictPane = new DictionaryPane();
}
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) {
this.dictPane.populateBean(e.getDictionary());
this.dictPane.setValue(e.getDictionary());
}
protected ComboBox updateSubCustomWritableRepeatEditorBean() {
ComboBox combo = new ComboBox();
combo.setDictionary(this.dictPane.updateBean());
combo.setDictionary((Dictionary) this.dictPane.getValue());
return combo;
}
@ -41,6 +50,6 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
@Override
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;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI;
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.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.form.ui.ComboCheckBox;
import com.fr.general.Inter;
import com.fr.third.fr.pdf.layout.border.Border;
import javax.swing.*;
import java.awt.*;
public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> {
private CheckBoxDictPane checkBoxDictPane;
private DictionaryPane dictPane;
private AccessibleDictionaryEditor dictPane;
private UICheckBox supportTagCheckBox;
public ComboCheckBoxDefinePane() {
super.initComponents();
dictPane = new DictionaryPane();
}
@Override
protected JPanel setForthContentPane() {
JPanel attrPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contenter = FRGUIPaneFactory.createBorderLayout_L_Pane();
contenter.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
dictPane = new AccessibleDictionaryEditor();
checkBoxDictPane = new CheckBoxDictPane();
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
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);
//是否以标签形式显示
JPanel tagPane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
tagPane.add(supportTagCheckBox);
contenter.add(tagPane, BorderLayout.NORTH);
contenter.add(checkBoxDictPane, BorderLayout.WEST);
return attrPane;
};
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;
}
@Override
protected void populateSubCustomWritableRepeatEditorBean(ComboCheckBox e) {
this.dictPane.populateBean(e.getDictionary());
this.dictPane.setValue(e.getDictionary());
this.checkBoxDictPane.populate(e);
this.supportTagCheckBox.setSelected(e.isSupportTag());
}
@ -50,14 +59,14 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
protected ComboCheckBox updateSubCustomWritableRepeatEditorBean() {
ComboCheckBox combo = new ComboCheckBox();
combo.setSupportTag(this.supportTagCheckBox.isSelected());
combo.setDictionary(this.dictPane.updateBean());
combo.setDictionary((Dictionary) this.dictPane.getValue());
checkBoxDictPane.update(combo);
return combo;
}
@Override
public DataCreatorUI dataUI() {
return dictPane;
return null;
}
@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;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.DirectWriteEditor;
import com.fr.general.Inter;
@ -12,7 +15,7 @@ import java.awt.*;
//richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树
public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> {
public UICheckBox directWriteCheckBox;
private WaterMarkDictPane waterMarkDictPane;
protected WaterMarkDictPane waterMarkDictPane;
public DirectWriteEditorDefinePane() {
this.initComponents();
@ -21,16 +24,17 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override
protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
directWriteCheckBox.setPreferredSize(new Dimension(100, 30));
waterMarkDictPane = new WaterMarkDictPane();
contentPane.add(waterMarkDictPane);
contentPane.add(waterMarkDictPane, BorderLayout.NORTH);
JPanel otherContentPane = this.setSecondContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane);
contentPane.add(otherContentPane, BorderLayout.CENTER);
}
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 com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.ListEditor;
import com.fr.general.Inter;
import java.awt.*;
public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor> {
private UICheckBox needHeadCheckBox;
private DictionaryPane dictPane;
private AccessibleDictionaryEditor dictPane;
public ListEditorDefinePane() {
this.initComponents();
@ -20,9 +25,14 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
@Override
protected void 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
protected JPanel setThirdContentPane() {
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
@ -40,7 +50,7 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
@Override
protected void populateSubWriteUnableRepeatBean(ListEditor e) {
needHeadCheckBox.setSelected(e.isNeedHead());
this.dictPane.populateBean(e.getDictionary());
this.dictPane.setValue(e.getDictionary());
}
@Override
@ -48,13 +58,13 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
ListEditor ob = new ListEditor();
ob.setNeedHead(needHeadCheckBox.isSelected());
ob.setDictionary(this.dictPane.updateBean());
ob.setDictionary((Dictionary) this.dictPane.getValue());
return ob;
}
@Override
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;
import java.awt.FlowLayout;
import javax.swing.JPanel;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.RadioGroup;
public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
private DictionaryPane dictPane;
private ButtonGroupDictPane buttonGroupDictPane;
public RadioGroupDefinePane() {
this.initComponents();
}
@Override
protected void initComponents() {
super.initComponents();
dictPane = new DictionaryPane();
}
@Override
protected JPanel setFirstContentPane() {
JPanel centerPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonGroupDictPane = new ButtonGroupDictPane();
buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
centerPane.add(buttonGroupDictPane);
return centerPane;
}
@Override
protected RadioGroup updateSubFieldEditorBean() {
RadioGroup ob = new RadioGroup();
ob.setDictionary(this.dictPane.updateBean());
this.buttonGroupDictPane.update(ob);
return ob;
}
@Override
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;
}
package com.fr.design.widget.ui;
import javax.swing.JPanel;
import com.fr.design.data.DataCreatorUI;
import com.fr.form.ui.RadioGroup;
public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
private ButtonGroupDictPane buttonGroupDictPane;
public RadioGroupDefinePane() {
this.initComponents();
}
@Override
protected void initComponents() {
super.initComponents();
}
@Override
protected JPanel setFirstContentPane() {
buttonGroupDictPane = new ButtonGroupDictPane();
return buttonGroupDictPane;
}
@Override
protected RadioGroup updateSubFieldEditorBean() {
RadioGroup ob = new RadioGroup();
this.buttonGroupDictPane.update(ob);
return ob;
}
@Override
protected String title4PopupWindow() {
return "radiogroup";
}
@Override
protected void populateSubFieldEditorBean(RadioGroup ob) {
this.buttonGroupDictPane.populate(ob);
}
@Override
public DataCreatorUI dataUI() {
return null;
}
}

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

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

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

@ -1,12 +1,15 @@
package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WriteUnableRepeatEditor;
import com.fr.general.Inter;
@ -21,15 +24,40 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
@Override
protected JPanel setFirstContentPane() {
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);
contentPane.add(contenter);
contenter.add(removeRepeatCheckBox);
// contentPane.add(contenter);
// 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();
if (otherContentPane != null)
contentPane.add(otherContentPane,BorderLayout.CENTER);
return contentPane;
}
protected Component[] createDicPane(){
return new Component[]{null, null};
}
protected abstract JPanel setThirdContentPane();
@Override
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());
}
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override
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;
public class RadioGroupDefinePane extends ButtonGroupDefinePane<RadioGroup> {
private DictionaryPane dictPane;
public RadioGroupDefinePane(XCreator xCreator) {
@ -18,16 +17,12 @@ public class RadioGroupDefinePane extends ButtonGroupDefinePane<RadioGroup> {
@Override
protected void initComponents() {
super.initComponents();
dictPane = new DictionaryPane();
}
@Override
protected RadioGroup updateSubButtonGroupBean() {
RadioGroup ob = (RadioGroup)creator.toData();
ob.setDictionary(this.dictPane.updateBean());
return ob;
}
@ -38,11 +33,10 @@ public class RadioGroupDefinePane extends ButtonGroupDefinePane<RadioGroup> {
@Override
protected void populateSubButtonGroupBean(RadioGroup ob) {
this.dictPane.populateBean(ob.getDictionary());
}
@Override
public DataCreatorUI dataUI() {
return dictPane;
return null;
}
}
Loading…
Cancel
Save