Browse Source

REPORT-3958 && REPORT-4374 [9.0一轮回归]按钮控件按钮类型设置无效 控件设置的标签名称,有的控件能保存有的不能

master
kerry 7 years ago
parent
commit
2b1d0bb9f6
  1. 8
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  2. 4
      designer/src/com/fr/design/widget/WidgetPane.java
  3. 4
      designer/src/com/fr/design/widget/ui/ButtonDefinePane.java
  4. 60
      designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java
  5. 18
      designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java
  6. 2
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  7. 3
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

8
designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -75,8 +75,8 @@ public class CellWidgetPropertyPane extends BasicPane {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);
} }
} }
cellEditorDefPane.populate(cellWidget);
cellEditorDefPane.populate(cellWidget);
} }
@ -122,10 +122,16 @@ public class CellWidgetPropertyPane extends BasicPane {
} }
} }
}); });
if(DesignerContext.getDesignerFrame().getSelectedJTemplate() != null){
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
} }
}
public void reInitAllListener(){
cellEditorDefPane.registerListener();
}
private Widget upDateWidgetAuthority(TemplateCellElement cellElement, Widget newWidget) { private Widget upDateWidgetAuthority(TemplateCellElement cellElement, Widget newWidget) {
try { try {
Widget oldWidget = (Widget) cellElement.getWidget().clone(); Widget oldWidget = (Widget) cellElement.getWidget().clone();

4
designer/src/com/fr/design/widget/WidgetPane.java

@ -163,6 +163,10 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
} }
public void registerListener(){
initAllListeners();
}
private static class EditorTypeComboBox extends UIComboBox { private static class EditorTypeComboBox extends UIComboBox {
private Item item = new Item(Inter.getLocText("Widget-User_Defined"), private Item item = new Item(Inter.getLocText("Widget-User_Defined"),

4
designer/src/com/fr/design/widget/ui/ButtonDefinePane.java

@ -1,10 +1,12 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory; import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.design.widget.btn.ButtonDetailPane; import com.fr.design.widget.btn.ButtonDetailPane;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
@ -38,6 +40,8 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
} }
}); });
this.updateUI(); this.updateUI();
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
} }
@Override @Override

60
designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java

@ -11,7 +11,6 @@ import com.fr.base.background.ColorBackground;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.border.TitledBorder;
import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageBackground;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -19,22 +18,18 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.design.style.background.BackgroundButtonPane; import com.fr.design.style.background.BackgroundButtonPane;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.Inter; import com.fr.general.Inter;
public class ButtonSytleDefinedPane extends BasicPane { public class ButtonSytleDefinedPane extends BasicPane {
protected AccessibleBackgroundEditor initBackgroundPane;
// private UIComboBox buttonStyleComboBox; protected AccessibleBackgroundEditor overBackgroundPane;
// private JPanel card; protected AccessibleBackgroundEditor clickBackgroundPane;
// private CardLayout cardLayout;
private BackgroundPane initBackgroundPane;
private BackgroundPane overBackgroundPane;
private BackgroundPane clickBackgroundPane;
private Background initBackground;
private Background overBackground;
private Background clickBackground;
public ButtonSytleDefinedPane() { public ButtonSytleDefinedPane() {
this.initComponents(); this.initComponents();
@ -42,21 +37,22 @@ public class ButtonSytleDefinedPane extends BasicPane {
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
initBackgroundPane = new AccessibleBackgroundEditor();
JPanel buttonStylePane = new JPanel(); overBackgroundPane = new AccessibleBackgroundEditor();
buttonStylePane.setLayout(new BorderLayout()); clickBackgroundPane = new AccessibleBackgroundEditor();
initBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Initial") + ":", Inter.getLocText("FR-Designer_Initial_Background_Tips")); double f = TableLayout.FILL;
overBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Over") + ":", Inter.getLocText("FR-Designer_Mouse_Move_Tips")); final double p = TableLayout.PREFERRED;
clickBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Click") + ":", Inter.getLocText("FR-Designer_Mouse_Click_Tips")); double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
JPanel table = FRGUIPaneFactory.createYBoxEmptyBorderPane(); int[][] rowCount = {{1, 1},{1, 1},{1, 1}};
table.setBorder(new TitledBorder(Inter.getLocText(new String[]{"Custom", "Form-Button", "Style"}))); Component[][] components = new Component[][]{
table.add(initBackgroundPane); new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Initial")), initBackgroundPane},
table.add(overBackgroundPane); new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Over")), overBackgroundPane},
table.add(clickBackgroundPane); new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Click")), clickBackgroundPane},
buttonStylePane.add(table, BorderLayout.WEST); };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7);
this.add(buttonStylePane, BorderLayout.CENTER); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.CENTER);
} }
@ -64,16 +60,16 @@ public class ButtonSytleDefinedPane extends BasicPane {
if (button == null) { if (button == null) {
return; return;
} }
initBackgroundPane.populate(button.getInitialBackground()); initBackgroundPane.setValue(button.getInitialBackground());
overBackgroundPane.populate(button.getOverBackground()); overBackgroundPane.setValue(button.getOverBackground());
clickBackgroundPane.populate(button.getClickBackground()); clickBackgroundPane.setValue(button.getClickBackground());
} }
public FreeButton update(FreeButton button) { public FreeButton update(FreeButton button) {
button.setCustomStyle(true); button.setCustomStyle(true);
button.setInitialBackground(initBackgroundPane.update()); button.setInitialBackground((Background) initBackgroundPane.getValue());
button.setOverBackground(overBackgroundPane.update()); button.setOverBackground((Background) overBackgroundPane.getValue());
button.setClickBackground(clickBackgroundPane.update()); button.setClickBackground((Background) clickBackgroundPane.getValue());
return button; return button;
} }

18
designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java

@ -1,25 +1,17 @@
package com.fr.design.widget.ui.btn; package com.fr.design.widget.ui.btn;
import java.awt.Component; import java.awt.Component;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.ButtonBackgroundPane;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane;
import com.fr.general.Inter;
import javax.swing.*;
public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> { public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton> {
private ButtonBackgroundPane backgroundCompPane; private ButtonSytleDefinedPane buttonSytleDefinedPane;
@Override @Override
protected Component createCenterPane() { protected Component createCenterPane() {
backgroundCompPane = new ButtonBackgroundPane(); buttonSytleDefinedPane = new ButtonSytleDefinedPane();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); return buttonSytleDefinedPane;
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return jPanel;
} }
@Override @Override
@ -29,13 +21,13 @@ public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane<FreeButton
public void populate(FreeButton button) { public void populate(FreeButton button) {
super.populate(button); super.populate(button);
backgroundCompPane.populate(button); buttonSytleDefinedPane.populate(button);
} }
@Override @Override
public FreeButton update() { public FreeButton update() {
FreeButton button = super.update(); FreeButton button = super.update();
backgroundCompPane.update(button); buttonSytleDefinedPane.update(button);
return button; return button;
} }

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

@ -62,6 +62,7 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
text.setText(check.getText()); text.setText(check.getText());
fontSizePane.setValue(check.getFontSize()); fontSizePane.setValue(check.getFontSize());
formWidgetValuePane.populate(check); formWidgetValuePane.populate(check);
labelNameTextField.setText(check.getLabelName());
} }
@Override @Override
@ -70,6 +71,7 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
box.setText(text.getText()); box.setText(text.getText());
box.setFontSize((int)fontSizePane.getValue()); box.setFontSize((int)fontSizePane.getValue());
formWidgetValuePane.update(box); formWidgetValuePane.update(box);
box.setLabelName(labelNameTextField.getText());
return box; return box;
} }
} }

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

@ -9,7 +9,6 @@ import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -39,7 +38,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox currentFormatComboBox; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel; private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup; private UIHeadGroup fomatHeadGroup;
protected UITextField labelNameTextField;
public DateEditorDefinePane(XCreator xCreator) { public DateEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -60,7 +58,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
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 UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}); returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")});
JPanel formatHead = createFormatHead(); JPanel formatHead = createFormatHead();
labelNameTextField = new UITextField();
startDv = new DateValuePane(); startDv = new DateValuePane();
endDv = new DateValuePane(); endDv = new DateValuePane();
double f = TableLayout.FILL; double f = TableLayout.FILL;

Loading…
Cancel
Save