From b3401f978c49e475128e10492e0bf55af102d074 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Thu, 23 Jun 2016 17:35:29 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E8=BF=AD=E4=BB=A3-=E5=87=B8=E6=98=BE?= =?UTF-8?q?=E6=96=B0=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 9edac3e5f..4f5db4b69 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -1,5 +1,6 @@ package com.fr.design; +import com.fr.base.Utils; import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; @@ -29,16 +30,15 @@ import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * Created by eason on 14/12/29. */ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraChartDesignClassManagerProvider { + private static final String OLD_CHART_PREFIX = "FineReport"; + private static ClassLoader loader = Thread.currentThread().getContextClassLoader(); private static ChartTypeInterfaceManager classManager = null; @@ -133,14 +133,32 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh * @param paneList pane容器 */ public void addPlotTypePaneList(List> paneList) { - + //先构建新旧图表数组 + List newChartList = new ArrayList(); + List oldChartList = new ArrayList(); Iterator iterator = chartTypeInterfaces.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); - IndependentChartUIProvider creator = (IndependentChartUIProvider) entry.getValue(); - paneList.add(creator.getPlotTypePane()); + if (isNewChart(entry.getKey())){ + newChartList.add((IndependentChartUIProvider) entry.getValue()); + }else { + oldChartList.add((IndependentChartUIProvider) entry.getValue()); + } + } + //新图表 + for (int i = 0; i < newChartList.size(); i++) { + paneList.add(newChartList.get(i).getPlotTypePane()); } + //老图表 + for (int i = 0; i < oldChartList.size(); i++) { + paneList.add(oldChartList.get(i).getPlotTypePane()); + } + + + } + private boolean isNewChart(Object key) { + return !Utils.objectToString(key).startsWith(OLD_CHART_PREFIX); } public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { From 6ae8a27ead76eb8b46ff60aee6deb3f1b7406cb9 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 4 Jul 2016 14:56:34 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 75 ++++++++----------- .../creator/cardlayout/XWCoverCardLayout.java | 7 ++ 2 files changed, 37 insertions(+), 45 deletions(-) create mode 100644 designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 4f5db4b69..599263004 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -1,6 +1,5 @@ package com.fr.design; -import com.fr.base.Utils; import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; @@ -30,26 +29,29 @@ import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; -import java.util.*; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; /** * Created by eason on 14/12/29. */ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraChartDesignClassManagerProvider { - private static final String OLD_CHART_PREFIX = "FineReport"; - private static ClassLoader loader = Thread.currentThread().getContextClassLoader(); private static ChartTypeInterfaceManager classManager = null; + private static boolean isReadDefault = false; + private static LinkedHashMap chartTypeInterfaces = new LinkedHashMap(); public synchronized static ChartTypeInterfaceManager getInstance() { if (classManager == null) { classManager = new ChartTypeInterfaceManager(); chartTypeInterfaces.clear(); - classManager.readDefault(); + //默认图表类型在新图表类型后面读取 classManager.readXMLFile(); } return classManager; @@ -68,25 +70,26 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh } private static void readDefault() { - - chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); - + if (!isReadDefault) { + chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); + } + isReadDefault = true; } @@ -133,32 +136,14 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh * @param paneList pane容器 */ public void addPlotTypePaneList(List> paneList) { - //先构建新旧图表数组 - List newChartList = new ArrayList(); - List oldChartList = new ArrayList(); + classManager.readDefault(); Iterator iterator = chartTypeInterfaces.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); - if (isNewChart(entry.getKey())){ - newChartList.add((IndependentChartUIProvider) entry.getValue()); - }else { - oldChartList.add((IndependentChartUIProvider) entry.getValue()); - } + IndependentChartUIProvider creator = (IndependentChartUIProvider) entry.getValue(); + paneList.add(creator.getPlotTypePane()); } - //新图表 - for (int i = 0; i < newChartList.size(); i++) { - paneList.add(newChartList.get(i).getPlotTypePane()); - } - //老图表 - for (int i = 0; i < oldChartList.size(); i++) { - paneList.add(oldChartList.get(i).getPlotTypePane()); - } - - - } - private boolean isNewChart(Object key) { - return !Utils.objectToString(key).startsWith(OLD_CHART_PREFIX); } public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java new file mode 100644 index 000000000..12c808382 --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java @@ -0,0 +1,7 @@ +package com.fr.design.designer.creator.cardlayout; + +/** + * Created by Fangjie on 2016/6/30. + */ +public class XWCoverCardLayout { +} From b4d4f2eb4cd5f28fb7273467e5da378241e9a82c Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 4 Jul 2016 15:14:55 +0800 Subject: [PATCH 03/12] update --- .../fr/design/ChartTypeInterfaceManager.java | 44 ++++++++----------- .../creator/cardlayout/XWCoverCardLayout.java | 7 --- 2 files changed, 18 insertions(+), 33 deletions(-) delete mode 100644 designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 599263004..d102a3fc0 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -38,20 +38,17 @@ import java.util.Map; * Created by eason on 14/12/29. */ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraChartDesignClassManagerProvider { - private static ClassLoader loader = Thread.currentThread().getContextClassLoader(); private static ChartTypeInterfaceManager classManager = null; - private static boolean isReadDefault = false; - private static LinkedHashMap chartTypeInterfaces = new LinkedHashMap(); public synchronized static ChartTypeInterfaceManager getInstance() { if (classManager == null) { classManager = new ChartTypeInterfaceManager(); chartTypeInterfaces.clear(); - //默认图表类型在新图表类型后面读取 + classManager.readDefault(); classManager.readXMLFile(); } return classManager; @@ -70,27 +67,23 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh } private static void readDefault() { - if (!isReadDefault) { - chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); - } - isReadDefault = true; - + chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); } public String getIconPath(String plotID) { @@ -136,7 +129,6 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh * @param paneList pane容器 */ public void addPlotTypePaneList(List> paneList) { - classManager.readDefault(); Iterator iterator = chartTypeInterfaces.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java deleted file mode 100644 index 12c808382..000000000 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.fr.design.designer.creator.cardlayout; - -/** - * Created by Fangjie on 2016/6/30. - */ -public class XWCoverCardLayout { -} From 812007545655579dd2ab892eaeb60a6642adddfb Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 4 Jul 2016 15:42:13 +0800 Subject: [PATCH 04/12] update --- .../fr/design/ChartTypeInterfaceManager.java | 26 +++++--- .../creator/cardlayout/XWCoverCardLayout.java | 63 +++++++++++++++++++ 2 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index d102a3fc0..ae30cb25f 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -1,9 +1,11 @@ package com.fr.design; import com.fr.chart.base.ChartConstants; +import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.charttypes.ChartTypeManager; +import com.fr.chart.fun.IndependentChartProvider; import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chart.fun.IndependentChartUIProvider; @@ -29,10 +31,7 @@ import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * Created by eason on 14/12/29. @@ -43,6 +42,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh private static ChartTypeInterfaceManager classManager = null; private static LinkedHashMap chartTypeInterfaces = new LinkedHashMap(); + private static List chartOrderList = new ArrayList(); public synchronized static ChartTypeInterfaceManager getInstance() { if (classManager == null) { @@ -84,6 +84,12 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); + + for (String plotID :chartTypeInterfaces.keySet()){ + if (!chartOrderList.contains(plotID)){ + chartOrderList.add(plotID); + } + } } public String getIconPath(String plotID) { @@ -109,6 +115,10 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh PluginMessage.remindUpdate(className); } else if (!chartTypeInterfaces.containsKey(plotID)) { chartTypeInterfaces.put(plotID, provider); + //新图表类型插入到前面 + if (!chartOrderList.contains(plotID)) { + chartOrderList.add(0, plotID); + } } } catch (ClassNotFoundException e) { FRLogger.getLogger().error("class not found:" + e.getMessage()); @@ -129,13 +139,11 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh * @param paneList pane容器 */ public void addPlotTypePaneList(List> paneList) { - Iterator iterator = chartTypeInterfaces.entrySet().iterator(); - while (iterator.hasNext()) { - Map.Entry entry = (Map.Entry) iterator.next(); - IndependentChartUIProvider creator = (IndependentChartUIProvider) entry.getValue(); + for (int i = 0; i < chartOrderList.size(); i++){ + String plotID = chartOrderList.get(i); + IndependentChartUIProvider creator = chartTypeInterfaces.get(plotID); paneList.add(creator.getPlotTypePane()); } - } public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java new file mode 100644 index 000000000..8d0cb1089 --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java @@ -0,0 +1,63 @@ +package com.fr.design.designer.creator.cardlayout; + +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; + +import java.awt.*; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; + +/** + * Created by Fangjie on 2016/6/30. + */ +public class XWCoverCardLayout extends XWCardMainBorderLayout{ + + private boolean mouseEnter; + + public boolean isMouseEnter() { + return mouseEnter; + } + + public void setMouseEnter(boolean mouseEnter) { + this.mouseEnter = mouseEnter; + } + + /** + * 构造函数 + * + * @param border + * @param dimension + */ + public XWCoverCardLayout(WCardMainBorderLayout border, Dimension dimension) { + super(border, dimension); + } + + public void paint(Graphics g) { + super.paint(g); + + if (mouseEnter) { + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + Paint old_paint = g2d.getPaint(); + + g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); + + g2d.setColor(Color.YELLOW); + + int x = 1; + int y = 1; + int w = getWidth(); + int h = getHeight(); + + g2d.fillRect(x, y, w, h); + + g2d.setColor(Color.BLACK); + + g2d.drawRect(getX(), getY(), getWidth(), getHeight()); + + g2d.setComposite(oldComposite); + + g2d.setPaint(old_paint); + } + } + +} From 4efeeb7d75ea11645abc9d11be579ae6285fcfcb Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 4 Jul 2016 15:46:45 +0800 Subject: [PATCH 05/12] updae --- .../creator/cardlayout/XWCoverCardLayout.java | 63 ------------------- 1 file changed, 63 deletions(-) delete mode 100644 designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java deleted file mode 100644 index 8d0cb1089..000000000 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.fr.design.designer.creator.cardlayout; - -import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; - -import java.awt.*; -import java.awt.event.ComponentAdapter; -import java.awt.event.ComponentEvent; - -/** - * Created by Fangjie on 2016/6/30. - */ -public class XWCoverCardLayout extends XWCardMainBorderLayout{ - - private boolean mouseEnter; - - public boolean isMouseEnter() { - return mouseEnter; - } - - public void setMouseEnter(boolean mouseEnter) { - this.mouseEnter = mouseEnter; - } - - /** - * 构造函数 - * - * @param border - * @param dimension - */ - public XWCoverCardLayout(WCardMainBorderLayout border, Dimension dimension) { - super(border, dimension); - } - - public void paint(Graphics g) { - super.paint(g); - - if (mouseEnter) { - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - Paint old_paint = g2d.getPaint(); - - g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); - - g2d.setColor(Color.YELLOW); - - int x = 1; - int y = 1; - int w = getWidth(); - int h = getHeight(); - - g2d.fillRect(x, y, w, h); - - g2d.setColor(Color.BLACK); - - g2d.drawRect(getX(), getY(), getWidth(), getHeight()); - - g2d.setComposite(oldComposite); - - g2d.setPaint(old_paint); - } - } - -} From cb106878b5b40c9dfcc092b36b66bc7ef4162e69 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 4 Jul 2016 15:49:19 +0800 Subject: [PATCH 06/12] update --- designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index ae30cb25f..3704db124 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -1,11 +1,9 @@ package com.fr.design; import com.fr.chart.base.ChartConstants; -import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.charttypes.ChartTypeManager; -import com.fr.chart.fun.IndependentChartProvider; import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chart.fun.IndependentChartUIProvider; From ef30f9e9d8711f9381b7a9f7363bd3e9073af94d Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 4 Jul 2016 19:49:07 +0800 Subject: [PATCH 07/12] update --- .../fr/design/ChartTypeInterfaceManager.java | 46 +++++++++----- .../creator/cardlayout/XWCoverCardLayout.java | 63 +++++++++++++++++++ 2 files changed, 93 insertions(+), 16 deletions(-) create mode 100644 designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 3704db124..0d2b3ad68 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -25,28 +25,31 @@ import com.fr.stable.EnvChangedListener; import com.fr.stable.StringUtils; import com.fr.stable.fun.Authorize; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; +import com.fr.stable.plugin.PluginReadListener; import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; -import java.util.*; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; /** * Created by eason on 14/12/29. */ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraChartDesignClassManagerProvider { + private static ClassLoader loader = Thread.currentThread().getContextClassLoader(); private static ChartTypeInterfaceManager classManager = null; private static LinkedHashMap chartTypeInterfaces = new LinkedHashMap(); - private static List chartOrderList = new ArrayList(); public synchronized static ChartTypeInterfaceManager getInstance() { if (classManager == null) { classManager = new ChartTypeInterfaceManager(); chartTypeInterfaces.clear(); - classManager.readDefault(); classManager.readXMLFile(); } return classManager; @@ -60,11 +63,23 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh }); } + static { + GeneralContext.addPluginReadListener(new PluginReadListener() { + @Override + public void success() { + if (chartTypeInterfaces != null) { + readDefault(); + } + } + }); + } + private synchronized static void envChanged() { classManager = null; } private static void readDefault() { + chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); @@ -83,15 +98,15 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); - for (String plotID :chartTypeInterfaces.keySet()){ - if (!chartOrderList.contains(plotID)){ - chartOrderList.add(plotID); - } - } + } public String getIconPath(String plotID) { - return chartTypeInterfaces.get(plotID).getIconPath(); + if (chartTypeInterfaces.get(plotID) != null) { + return chartTypeInterfaces.get(plotID).getIconPath(); + }else { + return StringUtils.EMPTY; + } } /** @@ -113,10 +128,6 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh PluginMessage.remindUpdate(className); } else if (!chartTypeInterfaces.containsKey(plotID)) { chartTypeInterfaces.put(plotID, provider); - //新图表类型插入到前面 - if (!chartOrderList.contains(plotID)) { - chartOrderList.add(0, plotID); - } } } catch (ClassNotFoundException e) { FRLogger.getLogger().error("class not found:" + e.getMessage()); @@ -137,11 +148,14 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh * @param paneList pane容器 */ public void addPlotTypePaneList(List> paneList) { - for (int i = 0; i < chartOrderList.size(); i++){ - String plotID = chartOrderList.get(i); - IndependentChartUIProvider creator = chartTypeInterfaces.get(plotID); + + Iterator iterator = chartTypeInterfaces.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = (Map.Entry) iterator.next(); + IndependentChartUIProvider creator = (IndependentChartUIProvider) entry.getValue(); paneList.add(creator.getPlotTypePane()); } + } public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java new file mode 100644 index 000000000..8d0cb1089 --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java @@ -0,0 +1,63 @@ +package com.fr.design.designer.creator.cardlayout; + +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; + +import java.awt.*; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; + +/** + * Created by Fangjie on 2016/6/30. + */ +public class XWCoverCardLayout extends XWCardMainBorderLayout{ + + private boolean mouseEnter; + + public boolean isMouseEnter() { + return mouseEnter; + } + + public void setMouseEnter(boolean mouseEnter) { + this.mouseEnter = mouseEnter; + } + + /** + * 构造函数 + * + * @param border + * @param dimension + */ + public XWCoverCardLayout(WCardMainBorderLayout border, Dimension dimension) { + super(border, dimension); + } + + public void paint(Graphics g) { + super.paint(g); + + if (mouseEnter) { + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + Paint old_paint = g2d.getPaint(); + + g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); + + g2d.setColor(Color.YELLOW); + + int x = 1; + int y = 1; + int w = getWidth(); + int h = getHeight(); + + g2d.fillRect(x, y, w, h); + + g2d.setColor(Color.BLACK); + + g2d.drawRect(getX(), getY(), getWidth(), getHeight()); + + g2d.setComposite(oldComposite); + + g2d.setPaint(old_paint); + } + } + +} From 67e6c176153c129f3fa63b5ad45722eba9356228 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 4 Jul 2016 19:51:24 +0800 Subject: [PATCH 08/12] update --- .../creator/cardlayout/XWCoverCardLayout.java | 63 ------------------- 1 file changed, 63 deletions(-) delete mode 100644 designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java deleted file mode 100644 index 8d0cb1089..000000000 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCoverCardLayout.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.fr.design.designer.creator.cardlayout; - -import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; - -import java.awt.*; -import java.awt.event.ComponentAdapter; -import java.awt.event.ComponentEvent; - -/** - * Created by Fangjie on 2016/6/30. - */ -public class XWCoverCardLayout extends XWCardMainBorderLayout{ - - private boolean mouseEnter; - - public boolean isMouseEnter() { - return mouseEnter; - } - - public void setMouseEnter(boolean mouseEnter) { - this.mouseEnter = mouseEnter; - } - - /** - * 构造函数 - * - * @param border - * @param dimension - */ - public XWCoverCardLayout(WCardMainBorderLayout border, Dimension dimension) { - super(border, dimension); - } - - public void paint(Graphics g) { - super.paint(g); - - if (mouseEnter) { - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - Paint old_paint = g2d.getPaint(); - - g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); - - g2d.setColor(Color.YELLOW); - - int x = 1; - int y = 1; - int w = getWidth(); - int h = getHeight(); - - g2d.fillRect(x, y, w, h); - - g2d.setColor(Color.BLACK); - - g2d.drawRect(getX(), getY(), getWidth(), getHeight()); - - g2d.setComposite(oldComposite); - - g2d.setPaint(old_paint); - } - } - -} From 81ebf05ac0b2974fc8f2a14275c21b59e0727f34 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Tue, 5 Jul 2016 09:53:22 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 0d2b3ad68..9002f4af7 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -44,6 +44,9 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh private static ChartTypeInterfaceManager classManager = null; + //判断默认图表是否读取 + private static boolean isReadDefault = false; + private static LinkedHashMap chartTypeInterfaces = new LinkedHashMap(); public synchronized static ChartTypeInterfaceManager getInstance() { @@ -80,33 +83,35 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh private static void readDefault() { - chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); + if (!isReadDefault) { + chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); + isReadDefault = true; + } } public String getIconPath(String plotID) { - if (chartTypeInterfaces.get(plotID) != null) { - return chartTypeInterfaces.get(plotID).getIconPath(); - }else { - return StringUtils.EMPTY; + if (!isReadDefault){ + readDefault(); } + return chartTypeInterfaces.get(plotID).getIconPath(); } /** From b5b3bc4c4c572a2cff2595814d571e6652280dfb Mon Sep 17 00:00:00 2001 From: xiaohu Date: Tue, 5 Jul 2016 14:49:37 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 73 ++++++++++++------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 9002f4af7..ae2164de9 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -1,23 +1,30 @@ package com.fr.design; import com.fr.chart.base.ChartConstants; +import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chart.fun.IndependentChartUIProvider; +import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.chartinterface.*; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; +import com.fr.design.module.DesignModuleFactory; import com.fr.file.XMLFileManager; +import com.fr.form.ui.ChartEditor; import com.fr.general.FRLogger; import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; +import com.fr.general.Inter; import com.fr.plugin.PluginCollector; import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginMessage; @@ -30,6 +37,7 @@ import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; +import javax.swing.*; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; @@ -72,46 +80,59 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh public void success() { if (chartTypeInterfaces != null) { readDefault(); + //重新注册designModuleFactory + DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); } } }); } + public static WidgetOption[] initWidgetOption(){ + 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; + } + private synchronized static void envChanged() { classManager = null; } private static void readDefault() { - - if (!isReadDefault) { - chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); - chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); - isReadDefault = true; - } - - + chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); + chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); } public String getIconPath(String plotID) { - if (!isReadDefault){ - readDefault(); + if (chartTypeInterfaces.get(plotID) != null) { + return chartTypeInterfaces.get(plotID).getIconPath(); + }else { + return StringUtils.EMPTY; } - return chartTypeInterfaces.get(plotID).getIconPath(); } /** From c48feaa687dee96b04c74d8e5d758a5ad53b4201 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Tue, 5 Jul 2016 15:27:05 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E5=88=AA=E9=99=A4=E8=A8=BB=E5=86=8A?= 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 fd90e3160..4be736ca5 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); 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.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 From 407bae3a95e6c00a5776180c17d5959c55386859 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Tue, 5 Jul 2016 15:30:39 +0800 Subject: [PATCH 12/12] update --- .../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 4be736ca5..7d2b72cfd 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.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