Browse Source

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

master
kerry 7 years ago
parent
commit
f3bf49e528
  1. 4
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleBackgroundEditor.java
  2. 3
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  3. 2
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  4. 4
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  5. 5
      designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java
  6. 94
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  7. 7
      designer_form/src/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java
  8. 5
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

4
designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleBackgroundEditor.java

@ -25,10 +25,6 @@ public class AccessibleBackgroundEditor extends UneditableAccessibleEditor {
super(new BackgroundWrapper()); super(new BackgroundWrapper());
} }
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (backgroundPane == null) { if (backgroundPane == null) {

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

@ -15,6 +15,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; 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.WParameterLayout; import com.fr.form.ui.container.WParameterLayout;
import com.fr.general.Background;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -112,7 +113,7 @@ 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.setBackground((Background) background.getValue());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex());
return wParameterLayout; return wParameterLayout;
} }

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

@ -32,11 +32,13 @@ public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
protected void populateSubDictionaryEditorBean(ComboBox ob){ protected void populateSubDictionaryEditorBean(ComboBox ob){
removeRepeatCheckBox.setSelected(ob.isRemoveRepeat()); removeRepeatCheckBox.setSelected(ob.isRemoveRepeat());
waterMarkField.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob); formWidgetValuePane.populate(ob);
} }
protected ComboBox updateSubDictionaryEditorBean(){ protected ComboBox updateSubDictionaryEditorBean(){
ComboBox combo = (ComboBox) creator.toData(); ComboBox combo = (ComboBox) creator.toData();
combo.setWaterMark(waterMarkField.getText());
combo.setRemoveRepeat(removeRepeatCheckBox.isSelected()); combo.setRemoveRepeat(removeRepeatCheckBox.isSelected());
formWidgetValuePane.update(combo); formWidgetValuePane.update(combo);
return combo; return combo;

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

@ -176,7 +176,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
String formatText = e.getFormatText(); String formatText = e.getFormatText();
fomatHeadGroup.setSelectedIndex(getDateType(e)); fomatHeadGroup.setSelectedIndex(getDateType(e));
currentFormatComboBox.setSelectedItem(formatText); currentFormatComboBox.setSelectedItem(formatText);
waterMarkDictPane.populate(e);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1); returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1);
formWidgetValuePane.populate(e); formWidgetValuePane.populate(e);
startDv.populate(e.getStartDate()); startDv.populate(e.getStartDate());
@ -186,7 +186,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected DateEditor updateSubDirectWriteEditorBean() { protected DateEditor updateSubDirectWriteEditorBean() {
DateEditor ob = new DateEditor(); DateEditor ob = new DateEditor();
waterMarkDictPane.update(ob);
ob.setFormatText(this.getSimpleDateFormat().toPattern()); ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0); ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0);
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);

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

@ -45,7 +45,10 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
public FreeButton updateSubButtonPane() { public FreeButton updateSubButtonPane() {
FreeButton freeButton = (FreeButton) creator.toData(); FreeButton freeButton = (FreeButton) creator.toData();
backgroundCompPane.update(freeButton); backgroundCompPane.update(freeButton);
frFontPane.update(freeButton.getFont()); FRFont frFont = freeButton.getFont();
if(frFont != null){
frFontPane.update(frFont);
}
return freeButton; return freeButton;
} }
} }

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

@ -41,7 +41,54 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private JPanel limitNumberPane; private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private ActionListener actionListener1 = new ActionListener() { private ActionListener actionListener1;
private ActionListener actionListener2;
private ActionListener actionListener3;
private ActionListener actionListener4 ;
private ChangeListener changeListener1;
private ChangeListener changeListener2 ;
public NumberEditorDefinePane() {
super();
}
@Override
public String title4PopupWindow() {
return "number";
}
@Override
protected JPanel setFirstContentPane() {
// richer:数字的允许直接编辑没有意义
waterMarkDictPane = new WaterMarkDictPane();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
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_WaterMark")), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}};
JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(advancePane);
return boundsPane;
}
private void initListeners(){
actionListener1 = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true); limitNumberPane.setVisible(true);
@ -51,7 +98,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
}; };
private ActionListener actionListener2 = new ActionListener() { actionListener2 = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -78,7 +125,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
private ActionListener actionListener3 = new ActionListener() { actionListener3 = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) { if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true); maxValueSpinner.setEnabled(true);
@ -98,7 +145,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
private ActionListener actionListener4 = new ActionListener() { actionListener4 = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true); minValueSpinner.setEnabled(true);
@ -117,7 +164,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
}; };
private ChangeListener changeListener1 = new ChangeListener() { changeListener1 = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -129,7 +176,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
}; };
private ChangeListener changeListener2 = new ChangeListener() { changeListener2 = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -140,41 +187,10 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
} }
}; };
public NumberEditorDefinePane() {
super();
}
@Override
public String title4PopupWindow() {
return "number";
}
@Override
protected JPanel setFirstContentPane() {
// richer:数字的允许直接编辑没有意义
waterMarkDictPane = new WaterMarkDictPane();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
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_WaterMark")), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}};
JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(advancePane);
return boundsPane;
} }
public JPanel setValidatePane() { public JPanel setValidatePane() {
initListeners();
// super.addValidatePane(); // super.addValidatePane();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
@ -218,7 +234,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {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, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 3); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return panel; return panel;

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

@ -109,9 +109,12 @@ public class FormWidgetValuePane extends JPanel {
public void populate(DataControl ob) { public void populate(DataControl ob) {
WidgetValue widgetValue = ob.getWidgetValue(); WidgetValue widgetValue = ob.getWidgetValue();
if(widgetValue == null){
return;
}
for (int i = 0; i < editor.length; i++) { for (int i = 0; i < editor.length; i++) {
if (editor[i].accept(widgetValue)) { if (editor[i].accept(widgetValue.getValue())) {
setCardValue(i, widgetValue); setCardValue(i, widgetValue.getValue());
break; break;
} }
} }

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

@ -122,8 +122,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
} }
//这边计算的时候会先把组件间隔去掉 //这边计算的时候会先把组件间隔去掉
moveComponents2FitLayout(xfl); moveComponents2FitLayout(xfl);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreator(xfl);
for (int i = 0; i < components.length; i++) { for (int i = 0; i < components.length; i++) {
Component comp = xfl.getComponent(i); Component comp = xfl.getComponent(i);
@ -139,6 +138,8 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
xfl.addCompInterval(xfl.getAcualInterval()); xfl.addCompInterval(xfl.getAcualInterval());
} }
xfl.toData().setLayoutType(WBodyLayoutType.FIT); xfl.toData().setLayoutType(WBodyLayoutType.FIT);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreator(xfl);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
FRLogger.getLogger().error(e.getMessage()); FRLogger.getLogger().error(e.getMessage());

Loading…
Cancel
Save