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());
}
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override
protected void showEditorPane() {
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.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.container.WParameterLayout;
import com.fr.general.Background;
import com.fr.general.Inter;
import com.fr.stable.Constants;
@ -112,7 +113,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
WParameterLayout wParameterLayout = (WParameterLayout) creator.toData();
wParameterLayout.setDesignWidth((int) designerWidth.getValue());
wParameterLayout.setDelayDisplayContent(displayReport.isSelected());
wParameterLayout.setBackground(wParameterLayout.getBackground());
wParameterLayout.setBackground((Background) background.getValue());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex());
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){
removeRepeatCheckBox.setSelected(ob.isRemoveRepeat());
waterMarkField.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob);
}
protected ComboBox updateSubDictionaryEditorBean(){
ComboBox combo = (ComboBox) creator.toData();
combo.setWaterMark(waterMarkField.getText());
combo.setRemoveRepeat(removeRepeatCheckBox.isSelected());
formWidgetValuePane.update(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();
fomatHeadGroup.setSelectedIndex(getDateType(e));
currentFormatComboBox.setSelectedItem(formatText);
waterMarkDictPane.populate(e);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1);
formWidgetValuePane.populate(e);
startDv.populate(e.getStartDate());
@ -186,7 +186,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override
protected DateEditor updateSubDirectWriteEditorBean() {
DateEditor ob = new DateEditor();
waterMarkDictPane.update(ob);
ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0);
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() {
FreeButton freeButton = (FreeButton) creator.toData();
backgroundCompPane.update(freeButton);
frFontPane.update(freeButton.getFont());
FRFont frFont = freeButton.getFont();
if(frFont != null){
frFontPane.update(frFont);
}
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 WaterMarkDictPane waterMarkDictPane;
private ActionListener actionListener1 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
} else {
limitNumberPane.setVisible(false);
}
}
};
private ActionListener actionListener1;
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() {
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() {
private ChangeListener changeListener1;
@Override
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()));
}
}
}
};
private ChangeListener changeListener2 ;
public NumberEditorDefinePane() {
super();
@ -173,8 +87,110 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
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() {
initListeners();
// super.addValidatePane();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
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[] columnSize = {p,f};
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));
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) {
WidgetValue widgetValue = ob.getWidgetValue();
if(widgetValue == null){
return;
}
for (int i = 0; i < editor.length; i++) {
if (editor[i].accept(widgetValue)) {
setCardValue(i, widgetValue);
if (editor[i].accept(widgetValue.getValue())) {
setCardValue(i, widgetValue.getValue());
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);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreator(xfl);
for (int i = 0; i < components.length; i++) {
Component comp = xfl.getComponent(i);
@ -139,6 +138,8 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
xfl.addCompInterval(xfl.getAcualInterval());
}
xfl.toData().setLayoutType(WBodyLayoutType.FIT);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreator(xfl);
return true;
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());

Loading…
Cancel
Save