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. 202
      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;
} }
} }

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

@ -41,105 +41,19 @@ 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;
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
} else {
limitNumberPane.setVisible(false);
}
}
};
private ActionListener actionListener2 = new ActionListener() { private ActionListener actionListener2;
@Override
public void actionPerformed(ActionEvent e) {
if (allowNegativeCheckBox.isSelected()) {
minValueModel.setMinimum(-Double.MAX_VALUE);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(-Double.MAX_VALUE);
}
} else {
minValueModel.setMinimum(0.0);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
if (maxValue < 0.0) {
maxValueSpinner.setValue(0.0);
}
}
}
};
private ActionListener actionListener3;
private ActionListener actionListener3 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMinValueCheckBox.isSelected()) {
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
value = minValue;
}
}
maxValueSpinner.setValue(value);
} else {
maxValueSpinner.setEnabled(false);
minValueModel.setMaximum(Double.MAX_VALUE);
}
}
};
private ActionListener actionListener4 ;
private ActionListener actionListener4 = new ActionListener() { private ChangeListener changeListener1;
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
value = maxValue;
}
}
minValueSpinner.setValue(value);
} else {
minValueSpinner.setEnabled(false);
maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
}
}
};
private ChangeListener changeListener1 = new ChangeListener() {
@Override private ChangeListener changeListener2 ;
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
private ChangeListener changeListener2 = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
super(); super();
@ -173,8 +87,110 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
return boundsPane; return boundsPane;
} }
private void initListeners(){
actionListener1 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
} else {
limitNumberPane.setVisible(false);
}
}
};
actionListener2 = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (allowNegativeCheckBox.isSelected()) {
minValueModel.setMinimum(-Double.MAX_VALUE);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(-Double.MAX_VALUE);
}
} else {
minValueModel.setMinimum(0.0);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
if (maxValue < 0.0) {
maxValueSpinner.setValue(0.0);
}
}
}
};
actionListener3 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMinValueCheckBox.isSelected()) {
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
value = minValue;
}
}
maxValueSpinner.setValue(value);
} else {
maxValueSpinner.setEnabled(false);
minValueModel.setMaximum(Double.MAX_VALUE);
}
}
};
actionListener4 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
value = maxValue;
}
}
minValueSpinner.setValue(value);
} else {
minValueSpinner.setEnabled(false);
maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
}
}
};
changeListener1 = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
changeListener2 = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
}
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