From 6f0d0880d271ce39cf2d05fa3fb38450a44a6f86 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 11 Jul 2016 13:35:39 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/poly/PolyComponetsBar.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/poly/PolyComponetsBar.java b/designer/src/com/fr/poly/PolyComponetsBar.java index 347063d9d9..41f9e6562e 100644 --- a/designer/src/com/fr/poly/PolyComponetsBar.java +++ b/designer/src/com/fr/poly/PolyComponetsBar.java @@ -28,6 +28,7 @@ public class PolyComponetsBar extends JToolBar { private static Color FOLDER_PANE_BACKGROUND = new Color(214, 223, 247); private BaseChartNameID[] typeName = BaseChartGetter.getStaticAllChartBaseNames(); private SerIcon[] serIcons; + private static final int MAX_BAR_NUM = 15; public PolyComponetsBar() { setOrientation(SwingConstants.VERTICAL); @@ -35,10 +36,10 @@ public class PolyComponetsBar extends JToolBar { setFloatable(false); setBackground(UIConstants.NORMAL_BACKGROUND); setLayout(FRGUIPaneFactory.create1ColumnGridLayout()); - serIcons = new SerIcon[typeName.length + 1]; + serIcons = new SerIcon[typeName.length < MAX_BAR_NUM ? typeName.length : MAX_BAR_NUM + 1]; serIcons[0] = new SerIcon(PolyECBlock.class, Inter.getLocText("Poly-Report_Block"), "Poly-Report_Block"); this.add(serIcons[0]); - for (int i = 0, len = typeName.length; i < len; i++) { + for (int i = 0, len = typeName.length; i < len && i < MAX_BAR_NUM; i++) { BaseChart[] rowChart = BaseChartGetter.getStaticChartTypes(typeName[i].getPlotID()); serIcons[i + 1] = new SerIcon(rowChart[0], Inter.getLocText(typeName[i].getName()), typeName[i].getName()); this.add(serIcons[i + 1]); From 7fbcfc0179161c714147a7e454fd5a99df4ab71c Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 11 Jul 2016 13:37:16 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/poly/PolyComponetsBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/src/com/fr/poly/PolyComponetsBar.java b/designer/src/com/fr/poly/PolyComponetsBar.java index 41f9e6562e..b4625080e8 100644 --- a/designer/src/com/fr/poly/PolyComponetsBar.java +++ b/designer/src/com/fr/poly/PolyComponetsBar.java @@ -36,7 +36,7 @@ public class PolyComponetsBar extends JToolBar { setFloatable(false); setBackground(UIConstants.NORMAL_BACKGROUND); setLayout(FRGUIPaneFactory.create1ColumnGridLayout()); - serIcons = new SerIcon[typeName.length < MAX_BAR_NUM ? typeName.length : MAX_BAR_NUM + 1]; + serIcons = new SerIcon[(typeName.length < MAX_BAR_NUM ? typeName.length : MAX_BAR_NUM) + 1]; serIcons[0] = new SerIcon(PolyECBlock.class, Inter.getLocText("Poly-Report_Block"), "Poly-Report_Block"); this.add(serIcons[0]); for (int i = 0, len = typeName.length; i < len && i < MAX_BAR_NUM; i++) { From 652fc735e7e2594f66f74d5add89fd8eb0b45f79 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 11 Jul 2016 14:52:45 +0800 Subject: [PATCH 3/6] update --- designer/src/com/fr/poly/PolyComponetsBar.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/poly/PolyComponetsBar.java b/designer/src/com/fr/poly/PolyComponetsBar.java index b4625080e8..1413a26e1c 100644 --- a/designer/src/com/fr/poly/PolyComponetsBar.java +++ b/designer/src/com/fr/poly/PolyComponetsBar.java @@ -36,10 +36,11 @@ public class PolyComponetsBar extends JToolBar { setFloatable(false); setBackground(UIConstants.NORMAL_BACKGROUND); setLayout(FRGUIPaneFactory.create1ColumnGridLayout()); - serIcons = new SerIcon[(typeName.length < MAX_BAR_NUM ? typeName.length : MAX_BAR_NUM) + 1]; + int typeLen = typeName.length < MAX_BAR_NUM ? typeName.length : MAX_BAR_NUM; + serIcons = new SerIcon[typeLen + 1]; serIcons[0] = new SerIcon(PolyECBlock.class, Inter.getLocText("Poly-Report_Block"), "Poly-Report_Block"); this.add(serIcons[0]); - for (int i = 0, len = typeName.length; i < len && i < MAX_BAR_NUM; i++) { + for (int i = 0; i < typeLen; i++) { BaseChart[] rowChart = BaseChartGetter.getStaticChartTypes(typeName[i].getPlotID()); serIcons[i + 1] = new SerIcon(rowChart[0], Inter.getLocText(typeName[i].getName()), typeName[i].getName()); this.add(serIcons[i + 1]); From b67c6b7df64aaf00d9841dfd8d7eb929d9ddb985 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 11 Jul 2016 20:04:12 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/images/form/toolbar/ChartF-TreeMap.png | Bin 0 -> 269 bytes .../poly/toolbar/Plugin-ChartF_NewTreeMap.png | Bin 0 -> 269 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/form/toolbar/ChartF-TreeMap.png create mode 100644 designer_base/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png diff --git a/designer_base/src/com/fr/design/images/form/toolbar/ChartF-TreeMap.png b/designer_base/src/com/fr/design/images/form/toolbar/ChartF-TreeMap.png new file mode 100644 index 0000000000000000000000000000000000000000..09edd2b77ec413c2eead3db6bcddafc3ecafbc74 GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|&H|6fVg?3oVGw3ym^DWNC@5Lt z8c`CQpH@+2u$DqB_b`ZBbhKY7Yyk0WJBDTtpeq?X MUHx3vIVCg!01hT#rT_o{ literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png b/designer_base/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png new file mode 100644 index 0000000000000000000000000000000000000000..09edd2b77ec413c2eead3db6bcddafc3ecafbc74 GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|&H|6fVg?3oVGw3ym^DWNC@5Lt z8c`CQpH@+2u$DqB_b`ZBbhKY7Yyk0WJBDTtpeq?X MUHx3vIVCg!01hT#rT_o{ literal 0 HcmV?d00001 From 2b1d0782e4793a31ddf56c1c33aff8475f36bf75 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Mon, 11 Jul 2016 20:15:53 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=B1=BB=E5=9E=8B=E5=A2=9E=E5=8A=A0=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/FormParaWidgetPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java index a1f8067b42..78af66a84d 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java @@ -46,7 +46,7 @@ public class FormParaWidgetPane extends JPanel{ //预定义控件最多显示20行 private int preWidgetShowMaxRow = 20; //显示8个图表组件 - private int commonChartNum = 8; + private static final int commonChartNum = 8; //显示10个普通控件 private int commonWidgetNum = 10; private JSeparator jSeparatorPara; @@ -118,7 +118,6 @@ public class FormParaWidgetPane extends JPanel{ // 初始化的时候根据图表的总个数获得单行显示图表的个数 int totalChartNums = loadChartOptions().length; if (totalChartNums > 0) { - commonChartNum = ++totalChartNums/2; JPanel chartTypePane = new JPanel(new FlowLayout()); for (int i = 0;i < commonChartNum ;i++) { chartTypePane.add( new ToolBarButton(loadChartOptions()[i])); @@ -209,11 +208,12 @@ public class FormParaWidgetPane extends JPanel{ public void mouseClicked(MouseEvent e) { if(chartTypeWindow == null) { JPanel componentsPara = new JPanel(new FlowLayout(FlowLayout.LEFT)); - for (WidgetOption chartOption : loadChartOptions()) { + WidgetOption[] chartOptions = loadChartOptions(); + for (WidgetOption chartOption : chartOptions) { componentsPara.add( new ToolBarButton(chartOption)); } int x = commonChartNum * (widgetButtonWidth + smallGAP); - int y = (int)Math.ceil(((double)loadWidgetOptions().length/(double)commonChartNum)) * (widgetButtonHeight + smallGAP); + int y = (int)Math.ceil(chartOptions.length/((double)commonChartNum)) * (widgetButtonHeight + smallGAP); componentsPara.setPreferredSize(new Dimension(x,y)); chartTypeWindow = new PopUpWindow(componentsPara, Inter.getLocText("FR-Designer-Form-ToolBar_Chart")); chartTypeWindow.setLocation((int)jSeparatorLayout.getLocationOnScreen().getX() + 1, (int)jSeparatorLayout.getLocationOnScreen().getY()); From 58a57de24e1a591f26a4759aa267cd82536fb536 Mon Sep 17 00:00:00 2001 From: eason-skx Date: Tue, 12 Jul 2016 09:32:00 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E5=8C=96manager=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/module/ChartDesignerModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java index 7d2b72cfd9..92a0d4f112 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()); 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 +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.IOUtils; import com.fr.general.Inter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; 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); StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); 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