Browse Source

抽象出抽象类

master
mengao 7 years ago
parent
commit
d71a0278d8
  1. 23
      designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java
  2. 19
      designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java
  3. 6
      designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java
  4. 6
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java
  5. 6
      designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java
  6. 6
      designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java
  7. 6
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  8. 6
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  9. 6
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  10. 6
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java
  11. 8
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java
  12. 22
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  13. 5
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  14. 14
      designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java

23
designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java

@ -1,7 +1,6 @@
package com.fr.design.editor; package com.fr.design.editor;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.base.chart.BasePlot;
import com.fr.design.editor.editor.BooleanEditor; import com.fr.design.editor.editor.BooleanEditor;
import com.fr.design.editor.editor.ColumnRowEditor; import com.fr.design.editor.editor.ColumnRowEditor;
import com.fr.design.editor.editor.ColumnRowGroupEditor; import com.fr.design.editor.editor.ColumnRowGroupEditor;
@ -202,24 +201,24 @@ public class ValueEditorPaneFactory {
return createVallueEditorPaneWithUseType(paraUseType, null); 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) { if (paraUseType == ParameterTableModel.NO_CHART_USE) {
return createBasicValueEditorPane(); return createBasicValueEditorPane();
} else if (paraUseType == ParameterTableModel.FORM_NORMAL_USE) { } else if (paraUseType == ParameterTableModel.FORM_NORMAL_USE) {
return createFormEditorPane(); return createFormEditorPane();
} else { } else {
return createChartHotValueEditorPane(plot); return createChartHotValueEditorPane(hyperLinkEditorMap);
} }
} }
/** /**
* 图表用的参数编辑器的ValueEditorPane * 图表用的参数编辑器的ValueEditorPane
* *
* @param plot plot类型 * @param hyperLinkEditorMap 超链下拉参数类型
* @return 值编辑器 * @return 值编辑器
*/ */
public static ValueEditorPane createChartHotValueEditorPane(BasePlot plot) { public static ValueEditorPane createChartHotValueEditorPane(HashMap hyperLinkEditorMap) {
return createValueEditorPane(chartHotEditors(plot), StringUtils.EMPTY, StringUtils.EMPTY); return createValueEditorPane(chartHotEditors(hyperLinkEditorMap), StringUtils.EMPTY, StringUtils.EMPTY);
} }
/** /**
@ -446,8 +445,8 @@ public class ValueEditorPaneFactory {
* *
* @return 值编辑器 * @return 值编辑器
*/ */
public static Editor[] chartHotEditors(BasePlot plot) { public static Editor[] chartHotEditors(HashMap hyperLinkEditorMap) {
List<Editor> list = createEditors4Chart(plot); List<Editor> list = createEditors4Chart(hyperLinkEditorMap);
list.add(new TextEditor()); list.add(new TextEditor());
list.add(new IntegerEditor()); list.add(new IntegerEditor());
@ -467,14 +466,12 @@ public class ValueEditorPaneFactory {
* *
* @return 值编辑器 * @return 值编辑器
*/ */
private static List<Editor> createEditors4Chart(BasePlot plot) { private static List<Editor> createEditors4Chart(HashMap hyperLinkEditorMap) {
List<Editor> lists = new ArrayList<Editor>(); List<Editor> lists = new ArrayList<Editor>();
if (plot == null) { if (hyperLinkEditorMap == null) {
return lists; return lists;
} }
HashMap<String, Formula> map = plot.getHyperLinkEditorMap(); Iterator<Map.Entry<String, Formula>> entries = hyperLinkEditorMap.entrySet().iterator();
Iterator<Map.Entry<String, Formula>> entries = map.entrySet().iterator();
while (entries.hasNext()) { while (entries.hasNext()) {
Map.Entry<String, Formula> entry = entries.next(); Map.Entry<String, Formula> entry = entries.next();
ConstantsEditor editor = new ConstantsEditor(entry.getKey(), entry.getValue()); ConstantsEditor editor = new ConstantsEditor(entry.getKey(), entry.getValue());

19
designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java

@ -1,6 +1,5 @@
package com.fr.design.hyperlink; package com.fr.design.hyperlink;
import com.fr.base.chart.BasePlot;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; 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.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.js.JavaScript; import com.fr.js.JavaScript;
import java.util.HashMap;
/** /**
* Created by mengao on 2017/10/12. * Created by mengao on 2017/10/12.
*/ */
public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> { public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
private BasePlot plot; private HashMap hyperLinkEditorMap;
protected ReportletParameterViewPane parameterViewPane; protected ReportletParameterViewPane parameterViewPane;
public AbstractHyperLinkPane(BasePlot plot) { public AbstractHyperLinkPane(HashMap hyperLinkEditorMap) {
this.plot = plot; this.hyperLinkEditorMap = hyperLinkEditorMap;
} }
public AbstractHyperLinkPane() { public AbstractHyperLinkPane() {
} }
public BasePlot getPlot() {
return plot;
}
public ReportletParameterViewPane getParameterViewPane() { public ReportletParameterViewPane getParameterViewPane() {
return parameterViewPane; return parameterViewPane;
} }
@ -42,15 +39,15 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
public void reset() {} public void reset() {}
protected int getChartParaType() { 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() { protected ValueEditorPane getValueEditorPane() {
return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), hyperLinkEditorMap);
} }
protected boolean needRenamePane(){ protected boolean needRenamePane(){
return plot != null && plot.isNeedRenameHyperLinkPane(); return false;
} }
} }

6
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.BaseUtils;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.chart.BasePlot;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
@ -19,14 +18,15 @@ import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.List; import java.util.List;
public class ReportletHyperlinkPane extends AbstractHyperLinkPane<ReportletHyperlink> { public class ReportletHyperlinkPane extends AbstractHyperLinkPane<ReportletHyperlink> {
private ReporletHyperNorthPane northPane; private ReporletHyperNorthPane northPane;
private UICheckBox extendParametersCheckBox; private UICheckBox extendParametersCheckBox;
public ReportletHyperlinkPane(BasePlot plot) { public ReportletHyperlinkPane(HashMap hyperLinkEditorMap) {
super(plot); super(hyperLinkEditorMap);
this.initComponents(); this.initComponents();
} }

6
designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java

@ -1,7 +1,6 @@
package com.fr.design.hyperlink; package com.fr.design.hyperlink;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.chart.BasePlot;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
@ -13,6 +12,7 @@ import com.fr.stable.ParameterProvider;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.HashMap;
import java.util.List; import java.util.List;
public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> { public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
@ -27,8 +27,8 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
this.initComponents(); this.initComponents();
} }
public WebHyperlinkPane(BasePlot plot) { public WebHyperlinkPane(HashMap hyperLinkEditorMap) {
super(plot); super(hyperLinkEditorMap);
this.initComponents(); this.initComponents();
} }

6
designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java

@ -1,7 +1,6 @@
package com.fr.design.javascript; package com.fr.design.javascript;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.chart.BasePlot;
import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
@ -21,6 +20,7 @@ import javax.swing.*;
import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener; import javax.swing.event.TableModelListener;
import java.awt.*; import java.awt.*;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -36,8 +36,8 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
this(new String[0]); this(new String[0]);
} }
public JavaScriptImplPane(BasePlot plot) { public JavaScriptImplPane(HashMap hyperLinkEditorMap) {
super(plot); super(hyperLinkEditorMap);
this.defaultArgs = new String[0]; this.defaultArgs = new String[0];
initComponents(); initComponents();
} }

6
designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java

@ -1,7 +1,6 @@
package com.fr.design.javascript; package com.fr.design.javascript;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.chart.BasePlot;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -12,6 +11,7 @@ import com.fr.js.ParameterJavaScript;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import java.awt.*; import java.awt.*;
import java.util.HashMap;
import java.util.List; import java.util.List;
public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJavaScript> { public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJavaScript> {
@ -22,8 +22,8 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJava
this(null); this(null);
} }
public ParameterJavaScriptPane(BasePlot plot){ public ParameterJavaScriptPane(HashMap hyperLinkEditorMap){
super(plot); super(hyperLinkEditorMap);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER); this.add(parameterViewPane, BorderLayout.CENTER);

6
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -1,7 +1,6 @@
package com.fr.design.chart.series.SeriesCondition.impl; package com.fr.design.chart.series.SeriesCondition.impl;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
@ -18,6 +17,7 @@ import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import java.awt.*; import java.awt.*;
import java.util.HashMap;
/** /**
* 类说明: 图表超链 -- 弹出 悬浮窗. * 类说明: 图表超链 -- 弹出 悬浮窗.
@ -37,8 +37,8 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
this(null); this(null);
} }
public ChartHyperPoplinkPane(BasePlot plot) { public ChartHyperPoplinkPane(HashMap hyperLinkEditorMap) {
super(plot); super(hyperLinkEditorMap);
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
if(this.needRenamePane()){ if(this.needRenamePane()){

6
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java

@ -1,7 +1,6 @@
package com.fr.design.chart.series.SeriesCondition.impl; package com.fr.design.chart.series.SeriesCondition.impl;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.base.chart.BasePlot;
import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateCellLink;
import com.fr.design.gui.columnrow.ColumnRowVerticalPane; import com.fr.design.gui.columnrow.ColumnRowVerticalPane;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
@ -15,6 +14,7 @@ import com.fr.stable.ParameterProvider;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -33,8 +33,8 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
this.initComponent(); this.initComponent();
} }
public ChartHyperRelateCellLinkPane(BasePlot plot) { public ChartHyperRelateCellLinkPane(HashMap hyperLinkEditorMap) {
super(plot); super(hyperLinkEditorMap);
this.initComponent(); this.initComponent();
} }

6
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

@ -1,7 +1,6 @@
package com.fr.design.chart.series.SeriesCondition.impl; package com.fr.design.chart.series.SeriesCondition.impl;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.base.chart.BasePlot;
import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
@ -20,6 +19,7 @@ import javax.swing.border.Border;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import java.awt.*; import java.awt.*;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -38,8 +38,8 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
this.initComponent(); this.initComponent();
} }
public ChartHyperRelateFloatLinkPane(BasePlot plot) { public ChartHyperRelateFloatLinkPane(HashMap hyperLinkEditorMap) {
super(plot); super(hyperLinkEditorMap);
this.initComponent(); this.initComponent();
} }

6
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

@ -1,7 +1,6 @@
package com.fr.design.chart.series.SeriesCondition.impl; package com.fr.design.chart.series.SeriesCondition.impl;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.chart.BasePlot;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.hyperlink.AbstractHyperLinkPane;
@ -15,14 +14,15 @@ import com.fr.stable.bridge.StableFactory;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.HashMap;
public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> { public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> {
private FormHyperlinkNorthPane northPane; private FormHyperlinkNorthPane northPane;
public FormHyperlinkPane(BasePlot plot) { public FormHyperlinkPane(HashMap hyperLinkEditorMap) {
super(plot); super(hyperLinkEditorMap);
this.initComponents(); this.initComponents();
} }

8
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java

@ -4,6 +4,7 @@
package com.fr.design.mainframe.chart.gui.other; package com.fr.design.mainframe.chart.gui.other;
import com.fr.base.Formula;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartdata.TopDefinition; import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.mainframe.chart.gui.ChartOtherPane; import com.fr.design.mainframe.chart.gui.ChartOtherPane;
@ -30,11 +31,12 @@ public class ChartDesignerInteractivePane extends ChartInteractivePane {
protected List<ChartUIMenuNameableCreator> refreshList(HashMap map) { protected List<ChartUIMenuNameableCreator> refreshList(HashMap map) {
List<ChartUIMenuNameableCreator> list = new ArrayList<ChartUIMenuNameableCreator>(); List<ChartUIMenuNameableCreator> list = new ArrayList<ChartUIMenuNameableCreator>();
java.util.HashMap<String, Formula> 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))); new WebHyperlink(), getUseMap(map, WebHyperlink.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("RelatedChart"),null,null)); list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("RelatedChart"),null,null));
return list; return list;
} }

22
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.chart.gui.other; package com.fr.design.mainframe.chart.gui.other;
import com.fr.base.CoreDecimalFormat; import com.fr.base.CoreDecimalFormat;
import com.fr.base.Formula;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.AttrContents; import com.fr.chart.base.AttrContents;
@ -685,7 +686,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
NameJavaScript javaScript = nameGroup.getNameHyperlink(i); NameJavaScript javaScript = nameGroup.getNameHyperlink(i);
if(javaScript != null && javaScript.getJavaScript() != null) { if(javaScript != null && javaScript.getJavaScript() != null) {
JavaScript script = javaScript.getJavaScript(); 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<Chart> implements UIOb
protected List<ChartUIMenuNameableCreator> refreshList(HashMap map) { protected List<ChartUIMenuNameableCreator> refreshList(HashMap map) {
List<ChartUIMenuNameableCreator> list = new ArrayList<ChartUIMenuNameableCreator>(); List<ChartUIMenuNameableCreator> list = new ArrayList<ChartUIMenuNameableCreator>();
java.util.HashMap<String, Formula> 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))); new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class)));
list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, 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_Web"),
new WebHyperlink(), getUseMap(map, WebHyperlink.class))); 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))); 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))); 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))); 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))); new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class)));
FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.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))); hyperlink, getUseMap(map, FormHyperlinkProvider.class)));
return list; return list;

5
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java

@ -1,6 +1,5 @@
package com.fr.plugin.chart.custom.component; package com.fr.plugin.chart.custom.component;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateCellLink;
@ -76,8 +75,8 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
protected BasicBeanPane createPaneByCreators(NameableCreator creator) { protected BasicBeanPane createPaneByCreators(NameableCreator creator) {
Constructor<? extends BasicBeanPane> constructor = null; Constructor<? extends BasicBeanPane> constructor = null;
try { try {
constructor = creator.getUpdatePane().getConstructor(BasePlot.class); constructor = creator.getUpdatePane().getConstructor(HashMap.class);
return constructor.newInstance(plot); return constructor.newInstance(plot.getHyperLinkEditorMap());
} catch (InstantiationException e) { } catch (InstantiationException e) {
throw new RuntimeException(e); throw new RuntimeException(e);

14
designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java

@ -1,22 +1,22 @@
package com.fr.plugin.chart.designer.component; package com.fr.plugin.chart.designer.component;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.HashMap;
/** /**
* Created by hufan on 2016/11/15. * Created by hufan on 2016/11/15.
*/ */
public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { public class ChartUIMenuNameableCreator extends UIMenuNameableCreator {
private BasePlot plot; private HashMap hyperLinkEditorMap;
public ChartUIMenuNameableCreator(BasePlot plot, String name, Object obj, Class<? extends BasicBeanPane> paneClazz) { public ChartUIMenuNameableCreator(HashMap hyperLinkEditorMap, String name, Object obj, Class<? extends BasicBeanPane> paneClazz) {
super(name, obj, paneClazz); super(name, obj, paneClazz);
this.plot = plot; this.hyperLinkEditorMap = hyperLinkEditorMap;
} }
public UIMenuNameableCreator clone() { public UIMenuNameableCreator clone() {
@ -28,15 +28,15 @@ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator {
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
FRLogger.getLogger().error("UIMenuNameableCreator IllegalAccessException"); FRLogger.getLogger().error("UIMenuNameableCreator IllegalAccessException");
} }
return new ChartUIMenuNameableCreator(plot, name, cloneObj, (Class<? extends BasicBeanPane>) this.paneClazz); return new ChartUIMenuNameableCreator(hyperLinkEditorMap, name, cloneObj, (Class<? extends BasicBeanPane>) this.paneClazz);
} }
public BasicBeanPane getPane() { public BasicBeanPane getPane() {
try { try {
if (plot != null) { if (hyperLinkEditorMap != null) {
Constructor<? extends BasicBeanPane> constructor = paneClazz.getConstructor(Plot.class); Constructor<? extends BasicBeanPane> constructor = paneClazz.getConstructor(Plot.class);
return constructor.newInstance(plot); return constructor.newInstance(hyperLinkEditorMap);
} }
} catch (Exception e) { } catch (Exception e) {
return super.getPane(); return super.getPane();

Loading…
Cancel
Save