From 20e489848ead746bd81099dc1d3ffd0bc5150c72 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 20 May 2016 17:09:19 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=A8=A1=E6=9D=BFweb=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=89=93=E4=B8=8D=E5=BC=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/background/BackgroundFactory.java | 21 ++++++++++++------- .../fr/design/module/ChartDesignerModule.java | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java index 2706f81b1..61b444a6c 100644 --- a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java +++ b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java @@ -21,6 +21,13 @@ public class BackgroundFactory { private static Map, BackgroundUIWrapper> map = new LinkedHashMap<>(); private static Map, BackgroundUIWrapper> browser = new LinkedHashMap<>(); + private static final int NULL_BACKGROUND_INDEX = 0; + private static final int COLOR_BACKGROUND_INDEX = 1; + private static final int TEXTURE_BACKGROUND_INDEX = 2; + private static final int PATTERN_BACKGROUND_INDEX = 3; + private static final int GRADIENT_BACKGROUND_INDEX = 4; + private static final int IMAGE_BACKGROUND_INDEX = 5; + static { registerUniversal(map); registerImageBackground(map); @@ -32,25 +39,25 @@ public class BackgroundFactory { private static void registerUniversal(Map, BackgroundUIWrapper> map) { map.put(null, BackgroundUIWrapper.create() - .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null"))); + .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null")).setIndex(NULL_BACKGROUND_INDEX)); map.put(ColorBackground.class, BackgroundUIWrapper.create() - .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color"))); + .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color")).setIndex(COLOR_BACKGROUND_INDEX)); map.put(TextureBackground.class, BackgroundUIWrapper.create() - .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture"))); + .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture")).setIndex(TEXTURE_BACKGROUND_INDEX)); map.put(PatternBackground.class, BackgroundUIWrapper.create() - .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern"))); + .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern")).setIndex(PATTERN_BACKGROUND_INDEX)); map.put(GradientBackground.class, BackgroundUIWrapper.create() - .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color"))); + .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color")).setIndex(GRADIENT_BACKGROUND_INDEX)); } private static void registerImageBackground(Map, BackgroundUIWrapper> map) { map.put(ImageBackground.class, BackgroundUIWrapper.create() - .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image"))); + .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image")).setIndex(IMAGE_BACKGROUND_INDEX)); } private static void registerBrowserImageBackground(Map, BackgroundUIWrapper> map) { map.put(ImageBackground.class, BackgroundUIWrapper.create() - .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image"))); + .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image")).setIndex(IMAGE_BACKGROUND_INDEX)); } private static void registerExtra(Map, BackgroundUIWrapper> map) { diff --git a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java index 7a209855f..fd90e3160 100644 --- a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java +++ b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java @@ -1 +1 @@ -package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartAndWidgetPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); GeneralContext.addPluginReadListener(new PluginReadListener() { @Override public void success() { DesignModuleFactory.registerExtraWidgetOptions(options4Show()); } }); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } } \ No newline at end of file +package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartAndWidgetPropertyPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.PluginReadListener; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); GeneralContext.addPluginReadListener(new PluginReadListener() { @Override public void success() { DesignModuleFactory.registerExtraWidgetOptions(options4Show()); } }); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if(rowChart == null) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } } \ No newline at end of file From e41cd5adeadeeccc7af1ad2d05963f7a84fdaed8 Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 21 May 2016 13:06:29 +0800 Subject: [PATCH 2/7] 11 --- .../style/background/BackgroundFactory.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java index 61b444a6c..2706f81b1 100644 --- a/designer_base/src/com/fr/design/style/background/BackgroundFactory.java +++ b/designer_base/src/com/fr/design/style/background/BackgroundFactory.java @@ -21,13 +21,6 @@ public class BackgroundFactory { private static Map, BackgroundUIWrapper> map = new LinkedHashMap<>(); private static Map, BackgroundUIWrapper> browser = new LinkedHashMap<>(); - private static final int NULL_BACKGROUND_INDEX = 0; - private static final int COLOR_BACKGROUND_INDEX = 1; - private static final int TEXTURE_BACKGROUND_INDEX = 2; - private static final int PATTERN_BACKGROUND_INDEX = 3; - private static final int GRADIENT_BACKGROUND_INDEX = 4; - private static final int IMAGE_BACKGROUND_INDEX = 5; - static { registerUniversal(map); registerImageBackground(map); @@ -39,25 +32,25 @@ public class BackgroundFactory { private static void registerUniversal(Map, BackgroundUIWrapper> map) { map.put(null, BackgroundUIWrapper.create() - .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null")).setIndex(NULL_BACKGROUND_INDEX)); + .setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null"))); map.put(ColorBackground.class, BackgroundUIWrapper.create() - .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color")).setIndex(COLOR_BACKGROUND_INDEX)); + .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color"))); map.put(TextureBackground.class, BackgroundUIWrapper.create() - .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture")).setIndex(TEXTURE_BACKGROUND_INDEX)); + .setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture"))); map.put(PatternBackground.class, BackgroundUIWrapper.create() - .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern")).setIndex(PATTERN_BACKGROUND_INDEX)); + .setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern"))); map.put(GradientBackground.class, BackgroundUIWrapper.create() - .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color")).setIndex(GRADIENT_BACKGROUND_INDEX)); + .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color"))); } private static void registerImageBackground(Map, BackgroundUIWrapper> map) { map.put(ImageBackground.class, BackgroundUIWrapper.create() - .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image")).setIndex(IMAGE_BACKGROUND_INDEX)); + .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image"))); } private static void registerBrowserImageBackground(Map, BackgroundUIWrapper> map) { map.put(ImageBackground.class, BackgroundUIWrapper.create() - .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image")).setIndex(IMAGE_BACKGROUND_INDEX)); + .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image"))); } private static void registerExtra(Map, BackgroundUIWrapper> map) { From 00311d96a0229d3a2233ab9e9a9c0090feab16d7 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 21 Jun 2016 09:46:10 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E9=9B=86=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormModelAdapter.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormModelAdapter.java b/designer_form/src/com/fr/design/mainframe/FormModelAdapter.java index 1ec52ee76..19daf3113 100644 --- a/designer_form/src/com/fr/design/mainframe/FormModelAdapter.java +++ b/designer_form/src/com/fr/design/mainframe/FormModelAdapter.java @@ -1,20 +1,16 @@ package com.fr.design.mainframe; -import java.util.ArrayList; -import java.util.List; - +import com.fr.base.Parameter; import com.fr.design.DesignModelAdapter; import com.fr.design.file.HistoryTemplateListPane; import com.fr.form.main.Form; import com.fr.form.main.WidgetGatherAdapter; -import com.fr.form.ui.ChartEditorProvider; -import com.fr.form.ui.DataControl; -import com.fr.form.ui.ElementCaseEditor; -import com.fr.form.ui.MultiFileEditor; -import com.fr.form.ui.Widget; -import com.fr.general.ComparatorUtils; +import com.fr.form.ui.*; import com.fr.stable.js.WidgetName; +import java.util.ArrayList; +import java.util.List; + public class FormModelAdapter extends DesignModelAdapter { public FormModelAdapter(BaseJForm jForm) { @@ -100,4 +96,9 @@ public class FormModelAdapter extends DesignModelAdapter { return linkAbleList.toArray(new Widget[linkAbleList.size()]); } + + @Override + public Parameter[] getParameters() { + return this.getBook().getParameters(); + } } \ No newline at end of file From 0f795f2f26412204a01e2aedfb742b6a231dff84 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 24 Jun 2016 10:00:51 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E5=8F=98=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E7=B3=BB=E6=95=B0,=E7=94=A8=E4=BA=8E=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E6=8F=92=E4=BB=B6=E7=9A=84=E4=BC=98=E5=85=88?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/fun/impl/AbstractCellAttributeProvider.java | 4 ++++ .../fr/design/fun/impl/AbstractDesignerEnvProcessor.java | 4 ++++ .../fun/impl/AbstractFormElementCaseEditorProcessor.java | 4 ++++ .../design/fun/impl/AbstractIndentationUnitProcessor.java | 6 +++++- .../src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java | 4 ++++ .../src/com/fr/design/fun/impl/AbstractTitleProcessor.java | 4 ++++ .../com/fr/design/fun/impl/AbstractUIFormulaProcessor.java | 4 ++++ .../com/fr/design/fun/impl/AbstractWidgetDesignHandler.java | 4 ++++ 8 files changed, 33 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java index 86c89d5b4..fd4b149d4 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractCellAttributeProvider.java @@ -13,4 +13,8 @@ public abstract class AbstractCellAttributeProvider implements CellAttributeProv return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java index 75dd0e2f9..f80d219a3 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java @@ -13,6 +13,10 @@ public abstract class AbstractDesignerEnvProcessor implements DesignerEnvProcess return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + public String changeEnvPathBeforeConnect(String userName, String password, String path){ return path; } diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index ad65b2dba..caafda0b8 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -16,6 +16,10 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + /** * 生成属性表 diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java index 4ebf914da..0fcdcd312 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractIndentationUnitProcessor.java @@ -7,13 +7,17 @@ import com.fr.stable.fun.mark.API; * Created by zhouping on 2015/9/20. */ @API(level = IndentationUnitProcessor.CURRENT_LEVEL) -public class AbstractIndentationUnitProcessor implements IndentationUnitProcessor { +public abstract class AbstractIndentationUnitProcessor implements IndentationUnitProcessor { private int indentationUnit = 1; public int currentAPILevel() { return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + public void setIndentationUnit(int value){ this.indentationUnit = value; diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java index 53da881a8..6a2d51b93 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractTDPaneProcessor.java @@ -14,4 +14,8 @@ public abstract class AbstractTDPaneProcessor implements TableDataPaneProcessor public int currentAPILevel() { return CURRENT_LEVEL; } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } } diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java index 5eaa7ba87..eb01bfa53 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractTitleProcessor.java @@ -10,5 +10,9 @@ public abstract class AbstractTitleProcessor implements TitlePlaceProcessor { return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java index 2b4144488..445c2aa40 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractUIFormulaProcessor.java @@ -15,4 +15,8 @@ public abstract class AbstractUIFormulaProcessor implements UIFormulaProcessor { return CURRENT_LEVEL; } + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java b/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java index 17f6d8b4d..4a7667ff0 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java @@ -15,4 +15,8 @@ public abstract class AbstractWidgetDesignHandler implements WidgetDesignHandler public int currentAPILevel() { return CURRENT_LEVEL; } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } } From daad29bcc52c41995c85d585bb1a9680036de38f Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 27 Jun 2016 17:02:44 +0800 Subject: [PATCH 5/7] rt --- .../src/com/fr/design/designer/creator/XElementCase.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 3824016e5..090561cf8 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -94,6 +94,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme FitProvider wbTpl = (FitProvider) designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); ElementCaseEditor editor = this.toData(); + //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) + if (editor.getFitStateInPC() == 0) { + editor.setReportFitAttr(null); + } ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); From 06145b11a9127c9bc37b94b64e5d034a6c5e8696 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 28 Jun 2016 10:21:29 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E8=A1=80?= =?UTF-8?q?=E7=BC=98=E5=85=B3=E7=B3=BB,=20=E8=87=AA=E5=AE=9A=E4=B9=89gridu?= =?UTF-8?q?i=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/grid/DefaultGridUIProcessor.java | 17 +++++++ designer/src/com/fr/grid/Grid.java | 26 +++++----- designer/src/com/fr/grid/GridUI.java | 49 +++++-------------- .../com/fr/design/fun/GridUIProcessor.java | 23 +++++++++ .../fun/impl/AbstractGridUIProcessor.java | 15 ++++++ .../mobile/ElementCasePropertyTable.java | 2 +- 6 files changed, 82 insertions(+), 50 deletions(-) create mode 100644 designer/src/com/fr/grid/DefaultGridUIProcessor.java create mode 100644 designer_base/src/com/fr/design/fun/GridUIProcessor.java create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java diff --git a/designer/src/com/fr/grid/DefaultGridUIProcessor.java b/designer/src/com/fr/grid/DefaultGridUIProcessor.java new file mode 100644 index 000000000..65b6aa456 --- /dev/null +++ b/designer/src/com/fr/grid/DefaultGridUIProcessor.java @@ -0,0 +1,17 @@ +package com.fr.grid; + +import com.fr.design.fun.impl.AbstractGridUIProcessor; + +import javax.swing.plaf.ComponentUI; + +/** + * Created by Administrator on 2016/6/28/0028. + */ +public class DefaultGridUIProcessor extends AbstractGridUIProcessor{ + + @Override + public ComponentUI appearanceForGrid(int resolution) { + return new GridUI(resolution); + } + +} diff --git a/designer/src/com/fr/grid/Grid.java b/designer/src/com/fr/grid/Grid.java index ec9ee4941..a259cf63b 100644 --- a/designer/src/com/fr/grid/Grid.java +++ b/designer/src/com/fr/grid/Grid.java @@ -3,20 +3,11 @@ */ package com.fr.grid; -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.geom.Point2D; -import java.util.Hashtable; -import java.util.Iterator; - import com.fr.base.DynamicUnitList; -import com.fr.design.cell.editor.CellEditor; -import com.fr.design.cell.editor.FloatEditor; -import com.fr.design.cell.editor.FormulaCellEditor; -import com.fr.design.cell.editor.GeneralCellEditor; -import com.fr.design.cell.editor.GeneralFloatEditor; -import com.fr.design.cell.editor.TextCellEditor; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.cell.editor.*; import com.fr.design.constants.UIConstants; +import com.fr.design.fun.GridUIProcessor; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.utils.gui.GUICoreUtils; @@ -40,6 +31,13 @@ import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.TemplateElementCase; import com.fr.stable.StringUtils; +import javax.swing.plaf.ComponentUI; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.geom.Point2D; +import java.util.Hashtable; +import java.util.Iterator; + /** * Grid used to paint and edit grid. * @@ -144,7 +142,9 @@ public class Grid extends BaseGridComponent { * */ public void updateUI() { - this.setUI(new GridUI(resolution)); + GridUIProcessor localGridUIProcessor = ExtraDesignClassManager.getInstance().getSingle(GridUIProcessor.MARK_STRING, new DefaultGridUIProcessor()); + ComponentUI localComponentUI = localGridUIProcessor.appearanceForGrid(this.resolution); + setUI(localComponentUI); } /** diff --git a/designer/src/com/fr/grid/GridUI.java b/designer/src/com/fr/grid/GridUI.java index e3d2a5efc..526f0f074 100644 --- a/designer/src/com/fr/grid/GridUI.java +++ b/designer/src/com/fr/grid/GridUI.java @@ -1,38 +1,6 @@ package com.fr.grid; -import java.awt.AlphaComposite; -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Composite; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.Rectangle; -import java.awt.Shape; -import java.awt.Stroke; -import java.awt.geom.Area; -import java.awt.geom.GeneralPath; -import java.awt.geom.Line2D; -import java.awt.geom.Line2D.Double; -import java.awt.geom.Path2D; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.swing.JComponent; -import javax.swing.UIManager; -import javax.swing.plaf.ComponentUI; - -import com.fr.base.BaseUtils; -import com.fr.base.DynamicUnitList; -import com.fr.base.FRContext; -import com.fr.base.Formula; -import com.fr.base.GraphHelper; -import com.fr.base.Margin; -import com.fr.base.PaperSize; -import com.fr.base.Utils; +import com.fr.base.*; import com.fr.base.background.ColorBackground; import com.fr.base.background.ImageBackground; import com.fr.design.constants.UIConstants; @@ -70,6 +38,15 @@ import com.fr.stable.script.CalculatorUtils; import com.fr.stable.unit.FU; import com.fr.third.antlr.ANTLRException; +import javax.swing.*; +import javax.swing.plaf.ComponentUI; +import java.awt.*; +import java.awt.geom.*; +import java.awt.geom.Line2D.Double; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + public class GridUI extends ComponentUI { public static int INVALID_INTEGER = Integer.MIN_VALUE;// 作为不合法的数值. @@ -438,7 +415,7 @@ public class GridUI extends ComponentUI { paintDetailedCellElements(g2d, cells, tmpCellElement, reportPane, selectedCellElement, hideWidth, hideHeight, oldClip, report); paintBorder(g2d, tmpCellElement, report); - paintFatherLeft(g2d); + paintFatherLeft(g2d, selectedCellElement, report); } private void paintDetailedCellElements(Graphics2D g2d, Iterator cells, TemplateCellElement tmpCellElement, ElementCasePane reportPane, @@ -565,7 +542,7 @@ public class GridUI extends ComponentUI { } } - private void paintFatherLeft(Graphics2D g2d) { + protected void paintFatherLeft(Graphics2D g2d, CellElement selectedCellElement, TemplateElementCase report) { // 画左父格子. if (validate(this.left_col_row_rect) && this.left_col_row_rect.getHeight() > 5) { g2d.setPaint(Color.BLUE); @@ -827,7 +804,7 @@ public class GridUI extends ComponentUI { } } - private void paintFormulaCellArea(Graphics2D g2d, Area formulaCellArea, int i) { + protected void paintFormulaCellArea(Graphics2D g2d, Area formulaCellArea, int i) { // denny: 标记格子的边框 formulaCellArea = new Area(new Rectangle2D.Double(this.tmpRectangle.getX(), this.tmpRectangle.getY(), this.tmpRectangle.getWidth(), diff --git a/designer_base/src/com/fr/design/fun/GridUIProcessor.java b/designer_base/src/com/fr/design/fun/GridUIProcessor.java new file mode 100644 index 000000000..d900d7cb5 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/GridUIProcessor.java @@ -0,0 +1,23 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.mark.Immutable; + +import javax.swing.plaf.ComponentUI; + +/** + * Զ嵥Ԫuiӿ + * + * @return + */ +public interface GridUIProcessor extends Immutable { + + String MARK_STRING = "GridUIProcessor"; + int CURRENT_LEVEL = 1; + + /** + * Զgridui, ʵһЩԶĸӻ. + * + * @return Զgridui + */ + ComponentUI appearanceForGrid(int paramInt); +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java new file mode 100644 index 000000000..b772d7b64 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/impl/AbstractGridUIProcessor.java @@ -0,0 +1,15 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.GridUIProcessor; +import com.fr.stable.fun.mark.API; + +@API(level = GridUIProcessor.CURRENT_LEVEL) +public abstract class AbstractGridUIProcessor implements GridUIProcessor { + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java index c846d48f5..051968459 100644 --- a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java @@ -10,7 +10,7 @@ import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.PropertyGroup; import com.fr.design.gui.xtable.ReportAppPropertyGroupModel; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.WidgetPropertyPane;; +import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; import com.fr.design.mainframe.widget.editors.RefinedDoubleEditor; import com.fr.form.ui.ElementCaseEditor; From 5d629a5b9c6874806375d762664c29df4f24bbd4 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 28 Jun 2016 10:23:42 +0800 Subject: [PATCH 7/7] 1 --- designer_base/src/com/fr/design/fun/GridUIProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/GridUIProcessor.java b/designer_base/src/com/fr/design/fun/GridUIProcessor.java index d900d7cb5..15dae93a2 100644 --- a/designer_base/src/com/fr/design/fun/GridUIProcessor.java +++ b/designer_base/src/com/fr/design/fun/GridUIProcessor.java @@ -5,7 +5,7 @@ import com.fr.stable.fun.mark.Immutable; import javax.swing.plaf.ComponentUI; /** - * Զ嵥Ԫuiӿ + * 自定义单元格ui接口 * * @return */ @@ -15,9 +15,9 @@ public interface GridUIProcessor extends Immutable { int CURRENT_LEVEL = 1; /** - * Զgridui, ʵһЩԶĸӻ. + * 自定义gridui, 用于实现一些自定义的格子绘制. * - * @return Զgridui + * @return 自定义gridui */ ComponentUI appearanceForGrid(int paramInt); } \ No newline at end of file