From 351b5b8b649d9b2b605b9298260a0b10a8838f40 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 30 Aug 2017 09:57:36 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4141=209.0=E7=9A=84=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=B1=9E=E6=80=A7=E6=97=A0=E6=B3=95=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=EF=BC=8C=E5=8C=85=E6=8B=AC=E5=9B=BE=E8=A1=A8=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormWidgetDefinePaneFactoryBase.java | 35 ++++++---- .../ui/designer/AbstractDataModify.java | 2 - .../ui/designer/DefaultWidgetDefinePane.java | 30 ++++++++ .../ui/designer/FieldEditorDefinePane.java | 4 -- .../ui/designer/IframeEditorDefinePane.java | 5 +- .../ui/designer/NoneWidgetDefinePane.java | 7 +- .../ui/designer/NumberEditorDefinePane.java | 3 - .../widget/ui/designer/RadioDefinePane.java | 6 +- .../ui/designer/UserEditorDefinePane.java | 20 +----- .../designer/WriteUnableRepeatEditorPane.java | 9 +-- .../layout/BorderStyleWidgetDefinePane.java | 69 +++++++++++++++++++ .../layout/ChartEditorDefinePane.java | 7 -- 12 files changed, 140 insertions(+), 57 deletions(-) create mode 100644 designer_form/src/com/fr/design/widget/ui/designer/DefaultWidgetDefinePane.java create mode 100644 designer_form/src/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java delete mode 100644 designer_form/src/com/fr/design/widget/ui/designer/layout/ChartEditorDefinePane.java diff --git a/designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java b/designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java index 94ed71ea1..6de14fd38 100644 --- a/designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java +++ b/designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java @@ -1,7 +1,6 @@ package com.fr.design.widget; import com.fr.base.FRContext; -import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.core.WidgetConstants; import com.fr.design.parameter.RootDesignDefinePane; @@ -53,29 +52,35 @@ public class FormWidgetDefinePaneFactoryBase { defineMap.put(Button.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + "")); defineMap.put(FreeButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + "")); defineMap.put(FormSubmitButton.class, new Appearance(FreeButtonDefinePane.class, WidgetConstants.BUTTON + "")); - defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"))); - defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, Inter.getLocText("WLayout-Card-ToolTips"))); -// if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) { -// defineMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class), new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + "")); -// } - - defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout"))); - defineMap.put(ElementCaseEditor.class, new Appearance(ElementEditorDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout"))); - defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"))); - defineMap.put(WParameterLayout.class, new Appearance(RootDesignDefinePane.class, Inter.getLocText("FR-Designer_Para-Body"))); - defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "tab")); - defineMap.put(WCardLayout.class, new Appearance(WCardLayoutDefinePane.class, "tablayout")); + defineMap.put(WFitLayout.class, new Appearance(FRFitLayoutDefinePane.class, "wFitLayout")); + defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "wCardMainBorderLayout")); + if (StableFactory.getMarkedClass(BridgeMark.Chart_Editor, AbstractBorderStyleWidget.class) != null) { + defineMap.put(StableFactory.getMarkedClass(BridgeMark.Chart_Editor, AbstractBorderStyleWidget.class), new Appearance(BorderStyleWidgetDefinePane.class, "chartEditor")); + } + + defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, "wAbsoluteLayout")); + defineMap.put(ElementCaseEditor.class, new Appearance(ElementEditorDefinePane.class, "elementCaseEditor")); + defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, "wAbsoluteBodyLayout")); + defineMap.put(WParameterLayout.class, new Appearance(RootDesignDefinePane.class, "wParameterLayout")); + defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "wCardMainBorderLayout")); + defineMap.put(WCardLayout.class, new Appearance(WCardLayoutDefinePane.class, "wCardLayout")); defineMap.put(Label.class, new Appearance(LabelDefinePane.class, "label")); - defineMap.put(WTabFitLayout.class, new Appearance(WTabFitLayoutDefinePane.class, "label")); - defineMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap()); + defineMap.put(WTabFitLayout.class, new Appearance(WTabFitLayoutDefinePane.class, "wTabFitLayout")); + //todo 添加扩展控件接口 +// defineMap.putAll(getOtherWidgetOptionMap()); + } + private FormWidgetDefinePaneFactoryBase() { } public static RN createWidgetDefinePane(XCreator creator, Widget widget, Operator operator) { Appearance dn = defineMap.get(widget.getClass()); + if(dn == null){ + dn = new Appearance(DefaultWidgetDefinePane.class, "default"); + } DataModify definePane = null; try { Constructor con = dn.getDefineClass().getConstructor(XCreator.class); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/AbstractDataModify.java b/designer_form/src/com/fr/design/widget/ui/designer/AbstractDataModify.java index c4f97fee2..7e521ac91 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/AbstractDataModify.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/AbstractDataModify.java @@ -13,9 +13,7 @@ import javax.swing.*; public abstract class AbstractDataModify extends BasicBeanPane implements DataModify { protected XCreator creator; - public AbstractDataModify(){ - } public AbstractDataModify(XCreator xCreator){ this.creator = xCreator; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/DefaultWidgetDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/DefaultWidgetDefinePane.java new file mode 100644 index 000000000..51d1d51e7 --- /dev/null +++ b/designer_form/src/com/fr/design/widget/ui/designer/DefaultWidgetDefinePane.java @@ -0,0 +1,30 @@ +package com.fr.design.widget.ui.designer; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.ui.Widget; + +/** + * Created by kerry on 2017/8/30. + */ +public class DefaultWidgetDefinePane extends AbstractDataModify { + + public DefaultWidgetDefinePane(XCreator xCreator){ + super(xCreator); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + } + + @Override + public String title4PopupWindow() { + return "default"; + } + + @Override + public void populateBean(Widget w) { + } + + @Override + public Widget updateBean() { + return creator.toData(); + } +} diff --git a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index cc7ecc664..a1d51d0eb 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java @@ -33,10 +33,6 @@ public abstract class FieldEditorDefinePane extends Abstr this.initComponents(); } - public FieldEditorDefinePane() { - this.initComponents(); - } - protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); labelNameTextField = new UITextField(); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java index fb7399ef8..c49471aeb 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java @@ -1,6 +1,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; @@ -23,8 +24,8 @@ public class IframeEditorDefinePane extends AbstractDataModify { private UICheckBox horizontalCheck; private UICheckBox verticalCheck; - public IframeEditorDefinePane() { - this.initComponents(); + public IframeEditorDefinePane(XCreator xCreator) { + super(xCreator); } private void initComponents() { diff --git a/designer_form/src/com/fr/design/widget/ui/designer/NoneWidgetDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/NoneWidgetDefinePane.java index 352ddf967..7d12f27d5 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/NoneWidgetDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/NoneWidgetDefinePane.java @@ -1,5 +1,6 @@ package com.fr.design.widget.ui.designer; +import com.fr.design.designer.creator.XCreator; import com.fr.form.ui.NoneWidget; /** @@ -8,7 +9,11 @@ import com.fr.form.ui.NoneWidget; * 用于处理没有控件的情况 */ public class NoneWidgetDefinePane extends AbstractDataModify { - + + public NoneWidgetDefinePane(XCreator xCreator){ + super(xCreator); + } + @Override public String title4PopupWindow() { return "none"; diff --git a/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java index 9ca625a15..00f204f1c 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java @@ -54,9 +54,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane private ChangeListener minValueChangeListener; - public NumberEditorDefinePane() { - super(); - } @Override diff --git a/designer_form/src/com/fr/design/widget/ui/designer/RadioDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/RadioDefinePane.java index 0cee5536f..8ca631cff 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/RadioDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/RadioDefinePane.java @@ -1,6 +1,7 @@ package com.fr.design.widget.ui.designer; import com.fr.base.FRContext; +import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.Radio; @@ -11,8 +12,9 @@ import javax.swing.*; import java.awt.*; public class RadioDefinePane extends AbstractDataModify { - public RadioDefinePane() { - this.iniComoponents(); + public RadioDefinePane(XCreator xCreator) { + super(xCreator); + iniComoponents(); } private void iniComoponents() { diff --git a/designer_form/src/com/fr/design/widget/ui/designer/UserEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/UserEditorDefinePane.java index 823e22073..ffc1d8f49 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/UserEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/UserEditorDefinePane.java @@ -1,32 +1,18 @@ package com.fr.design.widget.ui.designer; -import com.fr.base.FRContext; -import com.fr.design.gui.ilable.UILabel; +import com.fr.design.designer.creator.XCreator; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.NameWidget; -import com.fr.general.FRFont; -import com.fr.general.Inter; - -import javax.swing.*; -import java.awt.*; public class UserEditorDefinePane extends AbstractDataModify { private NameWidget nWidget; - public UserEditorDefinePane() { + public UserEditorDefinePane(XCreator xCreator) { + super(xCreator); this.initComponents(); } private void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - - UILabel infoLabel = new UILabel(); - FRFont frFont = FRContext.getDefaultValues().getFRFont(); - infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24)); - infoLabel.setText(Inter.getLocText( - "Widget-User_Defined_Editor") + "."); - infoLabel.setHorizontalAlignment(SwingConstants.CENTER); - - this.add(infoLabel, BorderLayout.CENTER); } @Override diff --git a/designer_form/src/com/fr/design/widget/ui/designer/WriteUnableRepeatEditorPane.java b/designer_form/src/com/fr/design/widget/ui/designer/WriteUnableRepeatEditorPane.java index 853353077..90fe52cd4 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/WriteUnableRepeatEditorPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/WriteUnableRepeatEditorPane.java @@ -1,5 +1,6 @@ package com.fr.design.widget.ui.designer; +import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.WriteUnableRepeatEditor; @@ -11,11 +12,11 @@ import java.awt.*; public abstract class WriteUnableRepeatEditorPane extends FieldEditorDefinePane { // richer:是否去除重复的值 protected UICheckBox removeRepeatCheckBox; - - public WriteUnableRepeatEditorPane(){ - this.initComponents(); + + public WriteUnableRepeatEditorPane(XCreator xCreator){ + super(xCreator); } - + @Override protected JPanel setFirstContentPane() { JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java new file mode 100644 index 000000000..a5bf7e858 --- /dev/null +++ b/designer_form/src/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java @@ -0,0 +1,69 @@ +package com.fr.design.widget.ui.designer.layout; + +import com.fr.design.data.DataCreatorUI; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor; +import com.fr.design.widget.ui.designer.AbstractDataModify; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.LayoutBorderStyle; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by kerry on 2017/8/29. + */ +public class BorderStyleWidgetDefinePane extends AbstractDataModify { + private AccessibleWLayoutBorderStyleEditor borderStyleEditor; + + public BorderStyleWidgetDefinePane(XCreator xCreator) { + super(xCreator); + initComponent(); + } + + + public void initComponent() { + borderStyleEditor = new AccessibleWLayoutBorderStyleEditor(); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")), borderStyleEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); + advancePane.add(jPanel, BorderLayout.CENTER); + + UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane ); + + this.add(layoutExpandablePane, BorderLayout.CENTER); + } + + + @Override + public String title4PopupWindow() { + return "borderStyleWidget"; + } + + @Override + public void populateBean(AbstractBorderStyleWidget ob) { + borderStyleEditor.setValue(ob.getBorderStyle()); + } + + + @Override + public AbstractBorderStyleWidget updateBean() { + AbstractBorderStyleWidget abstractBorderStyleWidget = (AbstractBorderStyleWidget)creator.toData(); + abstractBorderStyleWidget.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue()); + return abstractBorderStyleWidget; + + } + + + @Override + public DataCreatorUI dataUI() { + return null; + } + +} \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/layout/ChartEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/layout/ChartEditorDefinePane.java deleted file mode 100644 index 715f62de9..000000000 --- a/designer_form/src/com/fr/design/widget/ui/designer/layout/ChartEditorDefinePane.java +++ /dev/null @@ -1,7 +0,0 @@ -//package com.fr.design.widget.ui.designer.layout; -// -///** -// * Created by ibm on 2017/8/7. -// */ -//public class ChartEditorDefinePane extends { -//}