From d71a0278d817b5ebe1c6ebedd7f97e8fad237f7c Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 12:11:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E8=B1=A1=E5=87=BA=E6=8A=BD=E8=B1=A1?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/editor/ValueEditorPaneFactory.java | 23 ++++++++----------- .../hyperlink/AbstractHyperLinkPane.java | 19 +++++++-------- .../hyperlink/ReportletHyperlinkPane.java | 6 ++--- .../fr/design/hyperlink/WebHyperlinkPane.java | 6 ++--- .../design/javascript/JavaScriptImplPane.java | 6 ++--- .../javascript/ParameterJavaScriptPane.java | 6 ++--- .../impl/ChartHyperPoplinkPane.java | 6 ++--- .../impl/ChartHyperRelateCellLinkPane.java | 6 ++--- .../impl/ChartHyperRelateFloatLinkPane.java | 6 ++--- .../impl/FormHyperlinkPane.java | 6 ++--- .../other/ChartDesignerInteractivePane.java | 8 ++++--- .../chart/gui/other/ChartInteractivePane.java | 22 ++++++++++-------- .../component/VanChartHyperLinkPane.java | 5 ++-- .../component/ChartUIMenuNameableCreator.java | 14 +++++------ 14 files changed, 68 insertions(+), 71 deletions(-) diff --git a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java index 2da01d896b..f9425ec2b8 100644 --- a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java +++ b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java @@ -1,7 +1,6 @@ package com.fr.design.editor; import com.fr.base.Formula; -import com.fr.base.chart.BasePlot; import com.fr.design.editor.editor.BooleanEditor; import com.fr.design.editor.editor.ColumnRowEditor; import com.fr.design.editor.editor.ColumnRowGroupEditor; @@ -202,24 +201,24 @@ public class ValueEditorPaneFactory { return createVallueEditorPaneWithUseType(paraUseType, null); } - public static ValueEditorPane createVallueEditorPaneWithUseType(int paraUseType, BasePlot plot) { + public static ValueEditorPane createVallueEditorPaneWithUseType(int paraUseType, HashMap hyperLinkEditorMap) { if (paraUseType == ParameterTableModel.NO_CHART_USE) { return createBasicValueEditorPane(); } else if (paraUseType == ParameterTableModel.FORM_NORMAL_USE) { return createFormEditorPane(); } else { - return createChartHotValueEditorPane(plot); + return createChartHotValueEditorPane(hyperLinkEditorMap); } } /** * 图表用的参数编辑器的ValueEditorPane * - * @param plot plot类型 + * @param hyperLinkEditorMap 超链下拉参数类型 * @return 值编辑器 */ - public static ValueEditorPane createChartHotValueEditorPane(BasePlot plot) { - return createValueEditorPane(chartHotEditors(plot), StringUtils.EMPTY, StringUtils.EMPTY); + public static ValueEditorPane createChartHotValueEditorPane(HashMap hyperLinkEditorMap) { + return createValueEditorPane(chartHotEditors(hyperLinkEditorMap), StringUtils.EMPTY, StringUtils.EMPTY); } /** @@ -446,8 +445,8 @@ public class ValueEditorPaneFactory { * * @return 值编辑器 */ - public static Editor[] chartHotEditors(BasePlot plot) { - List list = createEditors4Chart(plot); + public static Editor[] chartHotEditors(HashMap hyperLinkEditorMap) { + List list = createEditors4Chart(hyperLinkEditorMap); list.add(new TextEditor()); list.add(new IntegerEditor()); @@ -467,14 +466,12 @@ public class ValueEditorPaneFactory { * * @return 值编辑器 */ - private static List createEditors4Chart(BasePlot plot) { + private static List createEditors4Chart(HashMap hyperLinkEditorMap) { List lists = new ArrayList(); - if (plot == null) { + if (hyperLinkEditorMap == null) { return lists; } - HashMap map = plot.getHyperLinkEditorMap(); - - Iterator> entries = map.entrySet().iterator(); + Iterator> entries = hyperLinkEditorMap.entrySet().iterator(); while (entries.hasNext()) { Map.Entry entry = entries.next(); ConstantsEditor editor = new ConstantsEditor(entry.getKey(), entry.getValue()); diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java index 2b06f0c78a..8629c60d48 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java @@ -1,6 +1,5 @@ package com.fr.design.hyperlink; -import com.fr.base.chart.BasePlot; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; @@ -8,25 +7,23 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.js.JavaScript; +import java.util.HashMap; + /** * Created by mengao on 2017/10/12. */ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { - private BasePlot plot; + private HashMap hyperLinkEditorMap; protected ReportletParameterViewPane parameterViewPane; - public AbstractHyperLinkPane(BasePlot plot) { - this.plot = plot; + public AbstractHyperLinkPane(HashMap hyperLinkEditorMap) { + this.hyperLinkEditorMap = hyperLinkEditorMap; } public AbstractHyperLinkPane() { } - public BasePlot getPlot() { - return plot; - } - public ReportletParameterViewPane getParameterViewPane() { return parameterViewPane; } @@ -42,15 +39,15 @@ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { public void reset() {} protected int getChartParaType() { - return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; + return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; } protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), hyperLinkEditorMap); } protected boolean needRenamePane(){ - return plot != null && plot.isNeedRenameHyperLinkPane(); + return false; } } diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 689fce0e0a..51d8069ec7 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -2,7 +2,6 @@ package com.fr.design.hyperlink; import com.fr.base.BaseUtils; import com.fr.base.Parameter; -import com.fr.base.chart.BasePlot; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -19,14 +18,15 @@ import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; +import java.util.HashMap; import java.util.List; public class ReportletHyperlinkPane extends AbstractHyperLinkPane { private ReporletHyperNorthPane northPane; private UICheckBox extendParametersCheckBox; - public ReportletHyperlinkPane(BasePlot plot) { - super(plot); + public ReportletHyperlinkPane(HashMap hyperLinkEditorMap) { + super(hyperLinkEditorMap); this.initComponents(); } diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index b6514dccf2..6860b7ac6d 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -1,7 +1,6 @@ package com.fr.design.hyperlink; import com.fr.base.Parameter; -import com.fr.base.chart.BasePlot; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -13,6 +12,7 @@ import com.fr.stable.ParameterProvider; import javax.swing.*; import java.awt.*; +import java.util.HashMap; import java.util.List; public class WebHyperlinkPane extends AbstractHyperLinkPane { @@ -27,8 +27,8 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane { this.initComponents(); } - public WebHyperlinkPane(BasePlot plot) { - super(plot); + public WebHyperlinkPane(HashMap hyperLinkEditorMap) { + super(hyperLinkEditorMap); this.initComponents(); } diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java index 31a24f8455..31ef732547 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java @@ -1,7 +1,6 @@ package com.fr.design.javascript; import com.fr.base.Parameter; -import com.fr.base.chart.BasePlot; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -21,6 +20,7 @@ import javax.swing.*; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import java.awt.*; +import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -36,8 +36,8 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { this(new String[0]); } - public JavaScriptImplPane(BasePlot plot) { - super(plot); + public JavaScriptImplPane(HashMap hyperLinkEditorMap) { + super(hyperLinkEditorMap); this.defaultArgs = new String[0]; initComponents(); } diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index 3e03d4abc3..fda398d499 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -1,7 +1,6 @@ package com.fr.design.javascript; import com.fr.base.Parameter; -import com.fr.base.chart.BasePlot; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itextfield.UITextField; @@ -12,6 +11,7 @@ import com.fr.js.ParameterJavaScript; import com.fr.stable.ParameterProvider; import java.awt.*; +import java.util.HashMap; import java.util.List; public class ParameterJavaScriptPane extends AbstractHyperLinkPane { @@ -22,8 +22,8 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane { private FormHyperlinkNorthPane northPane; - public FormHyperlinkPane(BasePlot plot) { - super(plot); + public FormHyperlinkPane(HashMap hyperLinkEditorMap) { + super(hyperLinkEditorMap); this.initComponents(); } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java index 416a70238c..0ca4c66e08 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java @@ -4,6 +4,7 @@ package com.fr.design.mainframe.chart.gui.other; +import com.fr.base.Formula; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartdata.TopDefinition; import com.fr.design.mainframe.chart.gui.ChartOtherPane; @@ -30,11 +31,12 @@ public class ChartDesignerInteractivePane extends ChartInteractivePane { protected List refreshList(HashMap map) { List list = new ArrayList(); + java.util.HashMap hyperLinkEditorMap = plot.getHyperLinkEditorMap(); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Hyperlink-Web_link"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Hyperlink-Web_link"), new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(plot,"JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("RelatedChart"),null,null)); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap,"JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("RelatedChart"),null,null)); return list; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java index 66efccb84a..591bfc9cdf 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.chart.gui.other; import com.fr.base.CoreDecimalFormat; +import com.fr.base.Formula; import com.fr.base.Style; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.base.AttrContents; @@ -685,7 +686,7 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb NameJavaScript javaScript = nameGroup.getNameHyperlink(i); if(javaScript != null && javaScript.getJavaScript() != null) { JavaScript script = javaScript.getJavaScript(); - hyperList.add(new ChartUIMenuNameableCreator(plot, javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); + hyperList.add(new ChartUIMenuNameableCreator(plot.getHyperLinkEditorMap(), javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); } } @@ -857,25 +858,26 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb protected List refreshList(HashMap map) { List list = new ArrayList(); + java.util.HashMap hyperLinkEditorMap = plot.getHyperLinkEditorMap(); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Reportlet"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Reportlet"), new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Web"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Web"), new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Dynamic_Parameters"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Dynamic_Parameters"), new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class))); - list.add(new ChartUIMenuNameableCreator(plot, "JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, "JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Float_Chart"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Float_Chart"), new ChartHyperPoplink(), getUseMap(map, ChartHyperPoplink.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Cell"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Cell"), new ChartHyperRelateCellLink(), getUseMap(map, ChartHyperRelateCellLink.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Float"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Float"), new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class))); FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Form"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Form"), hyperlink, getUseMap(map, FormHyperlinkProvider.class))); return list; diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java index 18d1478056..125adfc6be 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java @@ -1,6 +1,5 @@ package com.fr.plugin.chart.custom.component; -import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperRelateCellLink; @@ -76,8 +75,8 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { protected BasicBeanPane createPaneByCreators(NameableCreator creator) { Constructor constructor = null; try { - constructor = creator.getUpdatePane().getConstructor(BasePlot.class); - return constructor.newInstance(plot); + constructor = creator.getUpdatePane().getConstructor(HashMap.class); + return constructor.newInstance(plot.getHyperLinkEditorMap()); } catch (InstantiationException e) { throw new RuntimeException(e); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java index a8a1e568c8..828fbaf1ff 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java @@ -1,22 +1,22 @@ package com.fr.plugin.chart.designer.component; -import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.general.FRLogger; import java.lang.reflect.Constructor; +import java.util.HashMap; /** * Created by hufan on 2016/11/15. */ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { - private BasePlot plot; + private HashMap hyperLinkEditorMap; - public ChartUIMenuNameableCreator(BasePlot plot, String name, Object obj, Class paneClazz) { + public ChartUIMenuNameableCreator(HashMap hyperLinkEditorMap, String name, Object obj, Class paneClazz) { super(name, obj, paneClazz); - this.plot = plot; + this.hyperLinkEditorMap = hyperLinkEditorMap; } public UIMenuNameableCreator clone() { @@ -28,15 +28,15 @@ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { } catch (IllegalAccessException e) { FRLogger.getLogger().error("UIMenuNameableCreator IllegalAccessException"); } - return new ChartUIMenuNameableCreator(plot, name, cloneObj, (Class) this.paneClazz); + return new ChartUIMenuNameableCreator(hyperLinkEditorMap, name, cloneObj, (Class) this.paneClazz); } public BasicBeanPane getPane() { try { - if (plot != null) { + if (hyperLinkEditorMap != null) { Constructor constructor = paneClazz.getConstructor(Plot.class); - return constructor.newInstance(plot); + return constructor.newInstance(hyperLinkEditorMap); } } catch (Exception e) { return super.getPane();