diff --git a/designer/designer.iml b/designer/designer.iml deleted file mode 100644 index 9ff693f28..000000000 --- a/designer/designer.iml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java index 4000176bb..2da01d896 100644 --- a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java +++ b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java @@ -1,17 +1,36 @@ 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; +import com.fr.design.editor.editor.ColumnSelectedEditor; +import com.fr.design.editor.editor.ConstantsEditor; +import com.fr.design.editor.editor.CursorEditor; +import com.fr.design.editor.editor.DateEditor; +import com.fr.design.editor.editor.DoubleEditor; +import com.fr.design.editor.editor.Editor; +import com.fr.design.editor.editor.FormulaEditor; +import com.fr.design.editor.editor.IntegerEditor; +import com.fr.design.editor.editor.NoneEditor; +import com.fr.design.editor.editor.ParameterEditor; +import com.fr.design.editor.editor.SpinnerIntegerEditor; +import com.fr.design.editor.editor.TextEditor; +import com.fr.design.editor.editor.WidgetNameEditor; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.editor.editor.*; import com.fr.general.Inter; import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; +import java.util.Map; public class ValueEditorPaneFactory { @@ -180,23 +199,27 @@ public class ValueEditorPaneFactory { * @return 值编辑器 */ public static ValueEditorPane createVallueEditorPaneWithUseType(int paraUseType) { + return createVallueEditorPaneWithUseType(paraUseType, null); + } + + public static ValueEditorPane createVallueEditorPaneWithUseType(int paraUseType, BasePlot plot) { if (paraUseType == ParameterTableModel.NO_CHART_USE) { return createBasicValueEditorPane(); } else if (paraUseType == ParameterTableModel.FORM_NORMAL_USE) { return createFormEditorPane(); } else { - return createChartHotValueEditorPane(paraUseType); + return createChartHotValueEditorPane(plot); } } /** * 图表用的参数编辑器的ValueEditorPane * - * @param paraUseType 参数类型 + * @param plot plot类型 * @return 值编辑器 */ - public static ValueEditorPane createChartHotValueEditorPane(int paraUseType) { - return createValueEditorPane(chartHotEditors(paraUseType), StringUtils.EMPTY, StringUtils.EMPTY); + public static ValueEditorPane createChartHotValueEditorPane(BasePlot plot) { + return createValueEditorPane(chartHotEditors(plot), StringUtils.EMPTY, StringUtils.EMPTY); } /** @@ -421,11 +444,10 @@ public class ValueEditorPaneFactory { /** * 图表热点的一些编辑器 * - * @param paraUseType 参数类型 * @return 值编辑器 */ - public static Editor[] chartHotEditors(int paraUseType) { - List list = createEditors4Chart(paraUseType); + public static Editor[] chartHotEditors(BasePlot plot) { + List list = createEditors4Chart(plot); list.add(new TextEditor()); list.add(new IntegerEditor()); @@ -443,179 +465,22 @@ public class ValueEditorPaneFactory { /** * 为图表创建编辑器. * - * @param paraUseType 参数类型 * @return 值编辑器 */ - private static List createEditors4Chart(int paraUseType) { - switch (paraUseType) { - case ParameterTableModel.CHART_PIE_USE: - return getPieEditor(); - case ParameterTableModel.CHART_MAP_USE: - return getMapEditor(); - case ParameterTableModel.CHART_GIS_USE: - return getGisEditor(); - case ParameterTableModel.CHART__XY_USE: - return getXYEditor(); - case ParameterTableModel.CHART_BUBBLE_USE: - return getBubbbleEdtor(); - case ParameterTableModel.CHART_NO_USE: - return getChartNoUseEditor(); - case ParameterTableModel.CHART_METER_USE: - return getMeterEditor(); - case ParameterTableModel.CHART_STOCK_USE: - return getStockEditor(); - case ParameterTableModel.CHART_GANTT_USE: - return getGanttEditor(); - case ParameterTableModel.FORM_ELEMENTCASE_USE: - return getFormElementCaseEditor(); - case ParameterTableModel.FORM_CHART_USE: - return getFormChartEditor(); - default: - return getChartEditor(); - } - } - - private static List getMeterEditor() { - ConstantsEditor cate = new ConstantsEditor(Inter.getLocText("CategoryName"), new Formula("CATEGORY")); - cate.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Series_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(cate); - lists.add(value); - - return lists; - } - - private static List getPieEditor() { - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Series_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(series); - lists.add(value); - return lists; - } - - private static List getGisEditor() { - ConstantsEditor areaValue = new ConstantsEditor(Inter.getLocText("Area_Value"), new Formula("AREA_VALUE")); - areaValue.setEnabled(false); - ConstantsEditor chartAddress = new ConstantsEditor(Inter.getLocText("Chart-Address"), new Formula("ADDRESS")); - chartAddress.setEnabled(false); - ConstantsEditor addressName = new ConstantsEditor(Inter.getLocText("Chart-Address-Name"), new Formula("ADDRESS_NAME")); - addressName.setEnabled(false); - - List lists = new ArrayList(); - lists.add(chartAddress); - lists.add(addressName); - lists.add(areaValue); - - return lists; - } - - private static List getGanttEditor() { - ConstantsEditor projectid = new ConstantsEditor(Inter.getLocText("Chart_ProjectID"), new Formula("PROJECTID")); - projectid.setEnabled(false); - ConstantsEditor step = new ConstantsEditor(Inter.getLocText("Chart_Step_Name"), new Formula("STEP")); - step.setEnabled(false); - + private static List createEditors4Chart(BasePlot plot) { List lists = new ArrayList(); - lists.add(projectid); - lists.add(step); - - return lists; - } - - private static List getXYEditor() { - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Series_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(series); - lists.add(value); - - return lists; - } - - private static List getStockEditor() { - List lists = new ArrayList(); - - return lists; - } - - private static List getBubbbleEdtor() { - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Series_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(series); - lists.add(value); - - return lists; - } - - private static List getChartNoUseEditor() { - List lists = new ArrayList(); - - return lists; - } - - private static List getMapEditor() { - ConstantsEditor areaValue = new ConstantsEditor(Inter.getLocText("Area_Value"), new Formula("AREA_VALUE")); - areaValue.setEnabled(false); - ConstantsEditor areaName = new ConstantsEditor(Inter.getLocText("Area_Name"), new Formula("AREA_NAME")); - areaName.setEnabled(false); - - List lists = new ArrayList(); - lists.add(areaName); - lists.add(areaValue); - - return lists; - } - - private static List getChartEditor() { - ConstantsEditor cate = new ConstantsEditor(Inter.getLocText("CategoryName"), new Formula("CATEGORY")); - cate.setEnabled(false); - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Series_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(cate); - lists.add(series); - lists.add(value); - - return lists; - } - - private static List getFormElementCaseEditor() { - - List lists = new ArrayList(); - - return lists; - } - - private static List getFormChartEditor() { - ConstantsEditor cate = new ConstantsEditor(Inter.getLocText("CategoryName"), new Formula("CATEGORY")); - cate.setEnabled(false); - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Series_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(cate); - lists.add(series); - lists.add(value); - + if (plot == null) { + return lists; + } + HashMap map = plot.getHyperLinkEditorMap(); + + Iterator> entries = map.entrySet().iterator(); + while (entries.hasNext()) { + Map.Entry entry = entries.next(); + ConstantsEditor editor = new ConstantsEditor(entry.getKey(), entry.getValue()); + editor.setEnabled(false); + lists.add(editor); + } return lists; } diff --git a/designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java b/designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java index 36a760b5b..c38758997 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java +++ b/designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; +import com.fr.js.JavaScript; import javax.swing.*; @@ -62,6 +63,11 @@ public abstract class AbstractNameableCreator implements NameableCreator { return this.menuIcon; } + @Override + public Class getHyperlink() { + return this.clazzOfObject; + } + /** * get clazzOfEditor * @return diff --git a/designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java b/designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java index f497be1e6..1a5e7d35d 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java +++ b/designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java @@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ilist.ListModelElement; +import com.fr.js.JavaScript; import com.fr.stable.Nameable; import javax.swing.*; @@ -21,5 +22,8 @@ public interface NameableCreator { public void saveUpdatedBean(ListModelElement wrapper, Object bean); - public boolean isNeedParameterWhenPopulateJControlPane(); + public Class getHyperlink(); + + + public boolean isNeedParameterWhenPopulateJControlPane(); } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java b/designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java index 3ed7994b9..1cc79f373 100644 --- a/designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java @@ -40,7 +40,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { private JPopupMenu popMenu; private UIMenuTable tablePane; private UIButton addButton; - private List values; + private List values; private UIObserverListener uiObserverListener; public UICorrelationComboBoxPane() { @@ -78,7 +78,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { * 刷新下拉列表和按钮 * @param values 下拉列表里的值 */ - public void refreshMenuAndAddMenuAction(List values) { + public void refreshMenuAndAddMenuAction(List values) { if (values == null || values.isEmpty()) { return; } @@ -378,13 +378,13 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { content.setLayout(new BorderLayout()); List data = new ArrayList(); UIMenuNameableCreator reportlet = new UIMenuNameableCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), - new ReportletHyperlink(), true ? ReportletHyperlinkPane.CHART.class : ReportletHyperlinkPane.class); + new ReportletHyperlink(), ReportletHyperlinkPane.class); UIMenuNameableCreator email = new UIMenuNameableCreator(Inter.getLocText("FR-Designer_Email"), new EmailJavaScript(), EmailPane.class); UIMenuNameableCreator web = new UIMenuNameableCreator(Inter.getLocText("Hyperlink-Web_link"), - new WebHyperlink(), true ? WebHyperlinkPane.CHART.class : WebHyperlinkPane.class); + new WebHyperlink(), WebHyperlinkPane.class); data.add(reportlet); data.add(email); data.add(web); diff --git a/designer_base/src/com/fr/design/gui/imenutable/UIMenuTable.java b/designer_base/src/com/fr/design/gui/imenutable/UIMenuTable.java index caf95a40d..3500623a0 100644 --- a/designer_base/src/com/fr/design/gui/imenutable/UIMenuTable.java +++ b/designer_base/src/com/fr/design/gui/imenutable/UIMenuTable.java @@ -1,36 +1,28 @@ package com.fr.design.gui.imenutable; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.JComponent; -import javax.swing.JFrame; - +import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ilable.UILabel; -import javax.swing.JPanel; -import javax.swing.JTable; -import javax.swing.SwingUtilities; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.plaf.TableUI; -import javax.swing.table.TableCellRenderer; - -import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.itable.UITable; import com.fr.design.hyperlink.ReportletHyperlinkPane; import com.fr.design.hyperlink.WebHyperlinkPane; import com.fr.design.javascript.EmailPane; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.dialog.UIDialog; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.js.EmailJavaScript; import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; -import com.fr.design.utils.gui.GUICoreUtils; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.plaf.TableUI; +import javax.swing.table.TableCellRenderer; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; public class UIMenuTable extends JTable { protected int selectedRowIndex = -1; @@ -220,13 +212,13 @@ public class UIMenuTable extends JTable { content.setLayout(new BorderLayout()); List data = new ArrayList(); UIMenuNameableCreator reportlet = new UIMenuNameableCreator(Inter.getLocText("Reportlet"), - new ReportletHyperlink(), true ? ReportletHyperlinkPane.CHART.class : ReportletHyperlinkPane.class); + new ReportletHyperlink(), ReportletHyperlinkPane.class); UIMenuNameableCreator email = new UIMenuNameableCreator(Inter.getLocText("Email"), new EmailJavaScript(), EmailPane.class); UIMenuNameableCreator web = new UIMenuNameableCreator(Inter.getLocText("Hyperlink-Web_link"), - new WebHyperlink(), true ? WebHyperlinkPane.CHART.class : WebHyperlinkPane.class ); + new WebHyperlink(), WebHyperlinkPane.class ); data.add(reportlet); data.add(email); data.add(web); diff --git a/designer_base/src/com/fr/design/gui/itableeditorpane/ParameterTableModel.java b/designer_base/src/com/fr/design/gui/itableeditorpane/ParameterTableModel.java index 9b46977da..debfc7ced 100644 --- a/designer_base/src/com/fr/design/gui/itableeditorpane/ParameterTableModel.java +++ b/designer_base/src/com/fr/design/gui/itableeditorpane/ParameterTableModel.java @@ -26,18 +26,7 @@ public class ParameterTableModel extends UITableModelAdapter public static final int NO_CHART_USE = 0; public static final int CHART_NORMAL_USE = 1; - public static final int CHART_MAP_USE = 2; - public static final int CHART_PIE_USE = 3; - public static final int CHART__XY_USE = 4; - public static final int CHART_BUBBLE_USE = 5; - public static final int CHART_STOCK_USE = 6; - public static final int CHART_NO_USE = 7; - public static final int CHART_GIS_USE = 8; - public static final int CHART_GANTT_USE = 9; - public static final int CHART_METER_USE = 10; public static final int FORM_NORMAL_USE = -1; - public static final int FORM_ELEMENTCASE_USE = 11; - public static final int FORM_CHART_USE = 12; private static final long serialVersionUID = 1L; protected Component component = null; //指定确认对话框的父窗口,bug40340 diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 2664a746c..395c6dbd8 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -2,6 +2,7 @@ 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.beans.BasicBeanPane; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; @@ -24,10 +25,21 @@ import java.awt.event.ActionEvent; import java.util.List; public class ReportletHyperlinkPane extends BasicBeanPane { + private BasePlot plot; private ReporletHyperNorthPane northPane; private ReportletParameterViewPane parameterViewPane = null; private UICheckBox extendParametersCheckBox; + protected BasePlot getPlot() { + return plot; + } + + public ReportletHyperlinkPane(BasePlot plot) { + super(); + this.plot = plot; + this.initComponents(); + } + public ReportletHyperlinkPane() { super(); this.initComponents(); @@ -55,15 +67,15 @@ public class ReportletHyperlinkPane extends BasicBeanPane { } protected int getChartParaType() { - return ParameterTableModel.NO_CHART_USE; + return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; } protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType()); + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); } - protected boolean needRenamePane() { - return getChartParaType() != ParameterTableModel.NO_CHART_USE; + protected boolean needRenamePane(){ + return plot != null && plot.needRenameHyperLinkPane(); } @Override @@ -148,65 +160,6 @@ public class ReportletHyperlinkPane extends BasicBeanPane { } } - public static class CHART extends ReportletHyperlinkPane { - - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_NORMAL_USE; - } - } - - public static class CHART_MAP extends ReportletHyperlinkPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_MAP_USE; - } - } - - public static class CHART_GIS extends ReportletHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_GIS_USE; - } - } - - public static class CHART_PIE extends ReportletHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_PIE_USE; - } - } - - ; - - public static class CHART_XY extends ReportletHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART__XY_USE; - } - } - - public static class CHART_BUBBLE extends ReportletHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_BUBBLE_USE; - } - } - - public static class CHART_STOCK extends ReportletHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_STOCK_USE; - } - } - - public static class CHART_GANTT extends ReportletHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_GANTT_USE; - } - } - - public static class CHART_METER extends ReportletHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_METER_USE; - } - } - public ReporletHyperNorthPane getNorthPane() { return northPane; } diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index fda40217b..c3185d392 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -1,6 +1,7 @@ package com.fr.design.hyperlink; import com.fr.base.Parameter; +import com.fr.base.chart.BasePlot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; @@ -18,6 +19,7 @@ import java.awt.*; import java.util.List; public class WebHyperlinkPane extends BasicBeanPane { + private BasePlot plot; private WebHyperNorthPane northPane; private ReportletParameterViewPane parameterViewPane; @@ -25,11 +27,21 @@ public class WebHyperlinkPane extends BasicBeanPane { private UICheckBox useCJKCheckBox; private UICheckBox extendParametersCheckBox; - + + protected BasePlot getPlot() { + return plot; + } + public WebHyperlinkPane() { super(); this.initComponents(); } + + public WebHyperlinkPane(BasePlot plot) { + super(); + this.plot = plot; + this.initComponents(); + } protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -53,15 +65,15 @@ public class WebHyperlinkPane extends BasicBeanPane { } protected int getChartParaType() { - return ParameterTableModel.NO_CHART_USE; + return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; } protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType()); + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); } protected boolean needRenamePane(){ - return getChartParaType() != ParameterTableModel.NO_CHART_USE; + return plot != null && plot.needRenameHyperLinkPane(); } @Override @@ -111,63 +123,6 @@ public class WebHyperlinkPane extends BasicBeanPane { } } - public static class CHART extends WebHyperlinkPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_NORMAL_USE; - } - } - - public static class CHART_MAP extends WebHyperlinkPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_MAP_USE; - } - } - - public static class CHART_GIS extends WebHyperlinkPane{ - protected int getChartParaType() { - return ParameterTableModel.CHART_GIS_USE; - } - } - - public static class CHART_PIE extends WebHyperlinkPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_PIE_USE; - } - }; - - public static class CHART_XY extends WebHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART__XY_USE; - } - } - - public static class CHART_BUBBLE extends WebHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_BUBBLE_USE; - } - } - - public static class CHART_STOCK extends WebHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_STOCK_USE; - } - } - - public static class CHART_GANTT extends WebHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_GANTT_USE; - } - } - - public static class CHART_METER extends WebHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_METER_USE; - } - } - public WebHyperNorthPane getNorthPane() { return northPane; } diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java index f362170be..c110471a3 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java @@ -1,6 +1,7 @@ package com.fr.design.javascript; import com.fr.base.Parameter; +import com.fr.base.chart.BasePlot; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; import com.fr.design.editor.ValueEditorPane; @@ -26,18 +27,34 @@ import java.util.HashSet; import java.util.List; public class JavaScriptImplPane extends FurtherBasicBeanPane { + private BasePlot plot; private UITextField itemNameTextField; private JSContentPane jsPane; private UITableEditorPane importedJsPane; private ReportletParameterViewPane parameterPane; private String[] defaultArgs; + protected BasePlot getPlot() { + return plot; + } + public JavaScriptImplPane() { this(new String[0]); } + public JavaScriptImplPane(BasePlot plot) { + this.plot = plot; + this.defaultArgs = new String[0]; + initComponents(); + } + + public JavaScriptImplPane(String[] args) { this.defaultArgs = args; + initComponents(); + } + + protected void initComponents() { parameterPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText("FR-Designer_Parameter"))); parameterPane.addTableEditorListener(new TableModelListener() { @@ -61,7 +78,7 @@ public class JavaScriptImplPane extends FurtherBasicBeanPane { }); OneListTableModel model = new OneListTableModel(Inter.getLocText("ReportServerP-Import_JavaScript"), this) { - + public UITableEditAction[] createAction() { return new UITableEditAction[] { getAddAction(),new DeleteAction(this.component), new MoveUpAction(), new MoveDownAction() }; } @@ -74,7 +91,7 @@ public class JavaScriptImplPane extends FurtherBasicBeanPane { importedJsPane = new UITableEditorPane(model); importedJsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText("ReportServerP-Import_JavaScript"))); importedJsPane.setPreferredSize(new Dimension(265, 150)); - jsPane = new JSContentPane(args); + jsPane = new JSContentPane(defaultArgs); jsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText("FR-Designer_JavaScript"))); parameterPane.setPreferredSize(new Dimension(265, 150)); @@ -85,24 +102,24 @@ public class JavaScriptImplPane extends FurtherBasicBeanPane { topPane.setPreferredSize(new Dimension(300, 150)); topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 12, 0)); - this.setLayout(new BorderLayout()); - this.add(topPane,BorderLayout.NORTH) ; - this.add(jsPane,BorderLayout.CENTER); + this.setLayout(new BorderLayout()); + this.add(topPane,BorderLayout.NORTH) ; + this.add(jsPane,BorderLayout.CENTER); - this.reLayoutForChart(); + this.reLayoutForChart(); } protected int getChartParaType() { - return ParameterTableModel.NO_CHART_USE; + return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; } protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType()); + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); } - protected boolean needRenamePane(){ - return getChartParaType() != ParameterTableModel.NO_CHART_USE; - } + protected boolean needRenamePane(){ + return plot != null && plot.needRenameHyperLinkPane(); + } /** *参数改变 @@ -216,62 +233,6 @@ public class JavaScriptImplPane extends FurtherBasicBeanPane { } } - public static class CHART extends JavaScriptImplPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_NORMAL_USE; - } - } - - public static class CHART_MAP extends JavaScriptImplPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_MAP_USE; - } - } - - public static class CHART_GIS extends JavaScriptImplPane{ - protected int getChartParaType() { - return ParameterTableModel.CHART_GIS_USE; - } - } - - - public static class CHART_PIE extends JavaScriptImplPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_PIE_USE; - } - }; - - public static class CHART_XY extends JavaScriptImplPane { - protected int getChartParaType() { - return ParameterTableModel.CHART__XY_USE; - } - } - - public static class CHART_BUBBLE extends JavaScriptImplPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_BUBBLE_USE; - } - } - - public static class CHART_STOCK extends JavaScriptImplPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_STOCK_USE; - } - } - - public static class CHART_GANTT extends JavaScriptImplPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_GANTT_USE; - } - } - - public static class CHART_METER extends JavaScriptImplPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_METER_USE; - } - } - /** * 判断类型 * @param ob 判断目标 diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index 14e8000de..353fd887d 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -1,6 +1,7 @@ package com.fr.design.javascript; import com.fr.base.Parameter; +import com.fr.base.chart.BasePlot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; @@ -16,10 +17,20 @@ import java.awt.*; import java.util.List; public class ParameterJavaScriptPane extends BasicBeanPane { + private BasePlot plot; private UITextField itemNameTextField; private ReportletParameterViewPane parameterViewPane; - - public ParameterJavaScriptPane(){ + + protected BasePlot getPlot() { + return plot; + } + + public ParameterJavaScriptPane(){ + this(null); + } + + public ParameterJavaScriptPane(BasePlot plot){ + this.plot = plot; this.setLayout(new BorderLayout()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); this.add(parameterViewPane, BorderLayout.CENTER); @@ -28,17 +39,17 @@ public class ParameterJavaScriptPane extends BasicBeanPane this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); } } - - protected int getChartParaType() { - return ParameterTableModel.NO_CHART_USE; - } + + protected int getChartParaType() { + return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; + } protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType()); + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); } protected boolean needRenamePane(){ - return getChartParaType() != ParameterTableModel.NO_CHART_USE; + return plot != null && plot.needRenameHyperLinkPane(); } @Override @@ -86,61 +97,4 @@ public class ParameterJavaScriptPane extends BasicBeanPane return false; } } - - public static class CHART extends ParameterJavaScriptPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_NORMAL_USE; - } - } - - public static class CHART_MAP extends ParameterJavaScriptPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_MAP_USE; - } - } - - public static class CHART_GIS extends ParameterJavaScriptPane{ - protected int getChartParaType() { - return ParameterTableModel.CHART_GIS_USE; - } - } - - public static class CHART_PIE extends ParameterJavaScriptPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_PIE_USE; - } - }; - - public static class CHART_XY extends ParameterJavaScriptPane { - protected int getChartParaType() { - return ParameterTableModel.CHART__XY_USE; - } - } - - public static class CHART_BUBBLE extends ParameterJavaScriptPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_BUBBLE_USE; - } - } - - public static class CHART_STOCK extends ParameterJavaScriptPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_STOCK_USE; - } - } - - public static class CHART_GANTT extends ParameterJavaScriptPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_GANTT_USE; - } - } - - public static class CHART_METER extends ParameterJavaScriptPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_METER_USE; - } - } - } \ No newline at end of file diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index f80a3a584..842257d1f 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -29,11 +29,7 @@ import com.fr.file.CacheManager; import com.fr.file.DatasourceManager; import com.fr.file.DatasourceManagerProvider; import com.fr.file.filetree.FileNode; -import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; -import com.fr.general.IOUtils; -import com.fr.general.Inter; -import com.fr.general.LogRecordTime; +import com.fr.general.*; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONException; @@ -1839,7 +1835,7 @@ public class RemoteEnv extends AbstractEnv { if (input == null) { return; } - LogRecordTime[] records = DavXMLUtils.readXMLLogRecords(input); + LogRecordTime[] records = LogUtils.readXMLLogRecords(input); for (LogRecordTime logRecordTime : records) { //TODO } diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java index 3d9e0026d..f0669a99e 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java @@ -1,6 +1,7 @@ package com.fr.design.chart.series.SeriesCondition.impl; import com.fr.base.chart.BaseChartCollection; +import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; @@ -32,8 +33,19 @@ public class ChartHyperPoplinkPane extends BasicBeanPane { private UITextField itemNameTextField; private ChartHyperEditPane hyperEditPane; private ChartComponent chartComponent; - + + private BasePlot plot; + + protected BasePlot getPlot() { + return plot; + } + public ChartHyperPoplinkPane() { + this(null); + } + + public ChartHyperPoplinkPane(BasePlot plot) { + this.plot = plot; this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); if(this.needRenamePane()){ @@ -75,21 +87,17 @@ public class ChartHyperPoplinkPane extends BasicBeanPane { return cc; } - protected int getChartParaType() { - return ParameterTableModel.CHART_NORMAL_USE; + protected int getChartParaType() { + return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; } protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType()); + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); } - /** - * 是否需要加载重命名的空间 - * @return 默认需要加载 - */ - protected boolean needRenamePane(){ - return true; - } + protected boolean needRenamePane(){ + return plot != null && plot.needRenameHyperLinkPane(); + } @Override protected String title4PopupWindow() { @@ -143,55 +151,4 @@ public class ChartHyperPoplinkPane extends BasicBeanPane { return false; } } - - public static class CHART_MAP extends ChartHyperPoplinkPane { - - protected int getChartParaType() { - return ParameterTableModel.CHART_MAP_USE; - } - } - - public static class CHART_GIS extends ChartHyperPoplinkPane { - - protected int getChartParaType() { - return ParameterTableModel.CHART_GIS_USE; - } - } - - public static class CHART_PIE extends ChartHyperPoplinkPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_PIE_USE; - } - } - - public static class CHART_XY extends ChartHyperPoplinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART__XY_USE; - } - } - - public static class CHART_BUBBLE extends ChartHyperPoplinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_BUBBLE_USE; - } - } - - public static class CHART_STOCK extends ChartHyperPoplinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_STOCK_USE; - } - } - - public static class CHART_GANTT extends ChartHyperPoplinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_GANTT_USE; - } - } - - public static class CHART_METER extends ChartHyperPoplinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_METER_USE; - } - } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java index b1477c434..6d535e487 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java @@ -1,6 +1,7 @@ package com.fr.design.chart.series.SeriesCondition.impl; import com.fr.base.Utils; +import com.fr.base.chart.BasePlot; import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.design.beans.BasicBeanPane; import com.fr.design.editor.ValueEditorPane; @@ -30,11 +31,22 @@ public class ChartHyperRelateCellLinkPane extends BasicBeanPane { + private BasePlot plot; private ReportletParameterViewPane parameterViewPane; private FormHyperlinkNorthPane northPane; + protected BasePlot getPlot() { + return plot; + } + + public FormHyperlinkPane(BasePlot plot) { + super(); + this.plot = plot; + this.initComponents(); + } + public FormHyperlinkPane() { super(); this.initComponents(); @@ -44,15 +56,15 @@ public class FormHyperlinkPane extends BasicBeanPane { } protected int getChartParaType() { - return ParameterTableModel.NO_CHART_USE; + return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; } protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType()); + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); } protected boolean needRenamePane(){ - return getChartParaType() != ParameterTableModel.NO_CHART_USE; + return plot != null && plot.needRenameHyperLinkPane(); } protected int getHyperlinkType() { @@ -108,61 +120,4 @@ public class FormHyperlinkPane extends BasicBeanPane { return ParameterTableModel.CHART_NORMAL_USE; } } - - public static class CHART extends FormHyperlinkPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_NORMAL_USE; - } - } - - public static class CHART_MAP extends FormHyperlinkPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_MAP_USE; - } - } - - public static class CHART_GIS extends FormHyperlinkPane{ - protected int getChartParaType() { - return ParameterTableModel.CHART_GIS_USE; - } - } - - public static class CHART_PIE extends FormHyperlinkPane { - @Override - protected int getChartParaType() { - return ParameterTableModel.CHART_PIE_USE; - } - }; - - public static class CHART_XY extends FormHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART__XY_USE; - } - } - - public static class CHART_BUBBLE extends FormHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_BUBBLE_USE; - } - } - - public static class CHART_STOCK extends FormHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_STOCK_USE; - } - } - - public static class CHART_GANTT extends FormHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_GANTT_USE; - } - } - - public static class CHART_METER extends FormHyperlinkPane { - protected int getChartParaType() { - return ParameterTableModel.CHART_METER_USE; - } - } } \ No newline at end of file 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 c655e0800..416a70238 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 @@ -6,10 +6,11 @@ package com.fr.design.mainframe.chart.gui.other; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartdata.TopDefinition; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.mainframe.chart.gui.ChartOtherPane; import com.fr.general.Inter; -import com.fr.js.*; +import com.fr.js.JavaScriptImpl; +import com.fr.js.WebHyperlink; +import com.fr.plugin.chart.designer.component.ChartUIMenuNameableCreator; import com.fr.third.org.hsqldb.lib.HashMap; import java.util.ArrayList; @@ -27,13 +28,13 @@ public class ChartDesignerInteractivePane extends ChartInteractivePane { super(parent); } - protected List refreshList(HashMap map) { - List list = new ArrayList(); + protected List refreshList(HashMap map) { + List list = new ArrayList(); - list.add(new UIMenuNameableCreator(Inter.getLocText("Hyperlink-Web_link"), + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Hyperlink-Web_link"), new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new UIMenuNameableCreator("JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("RelatedChart"),null,null)); + list.add(new ChartUIMenuNameableCreator(plot,"JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); + list.add(new ChartUIMenuNameableCreator(plot, 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 e0f4fa311..66efccb84 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 @@ -6,21 +6,14 @@ import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.base.AttrContents; import com.fr.chart.base.ChartConstants; import com.fr.chart.base.TimeSwitchAttr; -import com.fr.chart.chartattr.BubblePlot; import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.GanttPlot; -import com.fr.chart.chartattr.GisMapPlot; -import com.fr.chart.chartattr.MapPlot; -import com.fr.chart.chartattr.MeterPlot; -import com.fr.chart.chartattr.PiePlot; import com.fr.chart.chartattr.Plot; -import com.fr.chart.chartattr.StockPlot; -import com.fr.chart.chartattr.XYScatterPlot; import com.fr.chart.chartdata.GisMapReportDefinition; import com.fr.chart.chartdata.GisMapTableDefinition; import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateFloatLink; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chart.javascript.ChartEmailPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; @@ -30,6 +23,8 @@ import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; +import com.fr.design.fun.HyperlinkProvider; +import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.frpane.UIBubbleFloatPane; import com.fr.design.gui.frpane.UICorrelationComboBoxPane; import com.fr.design.gui.ibutton.UIButton; @@ -57,6 +52,7 @@ import com.fr.js.NameJavaScriptGroup; import com.fr.js.ParameterJavaScript; import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; +import com.fr.plugin.chart.designer.component.ChartUIMenuNameableCreator; import com.fr.plugin.chart.designer.component.format.FormatPaneWithOutFont; import com.fr.stable.Constants; import com.fr.stable.StringUtils; @@ -76,19 +72,11 @@ import java.text.DecimalFormat; import java.text.Format; import java.util.ArrayList; import java.util.List; +import java.util.Set; public class ChartInteractivePane extends BasicScrollPane implements UIObserver{ private static final long serialVersionUID = 3477409806918835992L; private static HashMap normalMap = new HashMap(); - private static HashMap gisMap = new HashMap(); - private static HashMap mapMap = new HashMap(); - private static HashMap pieMap = new HashMap(); - - private static HashMap xyMap = new HashMap(); - private static HashMap bubbleMap = new HashMap(); - private static HashMap stockMap = new HashMap(); - private static HashMap ganttMap = new HashMap(); - private static HashMap meterMap = new HashMap(); private static final int TIME_SWITCH_GAP = 40; @@ -137,6 +125,8 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb private JPanel timeSwitchContainer; private TimeSwitchPane timeSwitchPane; + protected Plot plot; + private static final int SIZEX = 258; private static final int SIZEY = 209; private static final int DET = 20; @@ -553,6 +543,7 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb } Plot plot = chart.getPlot(); + this.plot =plot; relayoutWithGis(chart, plot); relayoutWithPlot(plot); @@ -676,18 +667,25 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb } private void populateHyperlink(Plot plot) { - HashMap paneMap = renewMapWithPlot(plot); + HashMap paneMap = getPlotHyperMap(); + //安装平台内打开插件时,添加相应按钮 + Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); + for (HyperlinkProvider provider : providers) { + NameableCreator nc = provider.createHyperlinkCreator(); + paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); + } - List list = refreshList(paneMap); + + List list = refreshList(paneMap); superLink.refreshMenuAndAddMenuAction(list); - List hyperList = new ArrayList(); + List hyperList = new ArrayList(); NameJavaScriptGroup nameGroup = plot.getHotHyperLink(); for(int i = 0; nameGroup != null && i < nameGroup.size(); i++) { NameJavaScript javaScript = nameGroup.getNameHyperlink(i); if(javaScript != null && javaScript.getJavaScript() != null) { JavaScript script = javaScript.getJavaScript(); - hyperList.add(new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); + hyperList.add(new ChartUIMenuNameableCreator(plot, javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); } } @@ -857,209 +855,50 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb return null; } - protected List refreshList(HashMap map) { - List list = new ArrayList(); + protected List refreshList(HashMap map) { + List list = new ArrayList(); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"), + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Reportlet"), new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"), + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Web"), new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"), + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Dynamic_Parameters"), new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class))); - list.add(new UIMenuNameableCreator("JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); + list.add(new ChartUIMenuNameableCreator(plot, "JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Float_Chart"), + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Float_Chart"), new ChartHyperPoplink(), getUseMap(map, ChartHyperPoplink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Cell"), + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Cell"), new ChartHyperRelateCellLink(), getUseMap(map, ChartHyperRelateCellLink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Float"), + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Float"), new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class))); FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Form"), + list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Form"), hyperlink, getUseMap(map, FormHyperlinkProvider.class))); return list; } - private HashMap renewMapWithPlot(Plot plot) { - if(plot instanceof PiePlot) { - return getPiePlotHyperMap(); - } else if(plot instanceof MapPlot) { - return getMapPlotHyperMap(); - } else if(plot instanceof GisMapPlot) { - return getGisPlotHyperMap(); - } else if(plot instanceof XYScatterPlot) { - return getXYHyperMap(); - } else if(plot instanceof BubblePlot) { - return getBubbleHyperMap(); - } else if(plot instanceof StockPlot) { - return getStockHyperMap(); - } else if(plot instanceof GanttPlot) { - return getGanttHyperMap(); - } else if(plot instanceof MeterPlot) { - return getMeterHyperMap(); - } - - else { - return getNormalPlotHyperMap(); - } - } - - private HashMap getXYHyperMap() { - if(xyMap.isEmpty()) { - xyMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART_XY.class); - xyMap.put(EmailJavaScript.class, ChartEmailPane.class); - xyMap.put(WebHyperlink.class, WebHyperlinkPane.CHART_XY.class); - xyMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART_XY.class); - - xyMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART_XY.class); - xyMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.CHART_XY.class); - xyMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.CHART_XY.class); - xyMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.CHART_XY.class); - - xyMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART_XY.class); - } - return xyMap; - } - - private HashMap getBubbleHyperMap() { - if(bubbleMap.isEmpty()) { - bubbleMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART_BUBBLE.class); - bubbleMap.put(EmailJavaScript.class, ChartEmailPane.class); - bubbleMap.put(WebHyperlink.class, WebHyperlinkPane.CHART_BUBBLE.class); - bubbleMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART_BUBBLE.class); - - bubbleMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART_BUBBLE.class); - bubbleMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.CHART_BUBBLE.class); - bubbleMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.CHART_BUBBLE.class); - bubbleMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.CHART_BUBBLE.class); - bubbleMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART_BUBBLE.class); - } - return bubbleMap; - } - - private HashMap getStockHyperMap() { - if(stockMap.isEmpty()) { - stockMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART_STOCK.class); - stockMap.put(EmailJavaScript.class, ChartEmailPane.class); - stockMap.put(WebHyperlink.class, WebHyperlinkPane.CHART_STOCK.class); - stockMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART_STOCK.class); - - stockMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART_STOCK.class); - stockMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.CHART_STOCK.class); - stockMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.CHART_STOCK.class); - stockMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.CHART_STOCK.class); - - stockMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART_STOCK.class); - } - return stockMap; - } - - private HashMap getGanttHyperMap() { - if(ganttMap.isEmpty()) { - ganttMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART_GANTT.class); - ganttMap.put(EmailJavaScript.class, ChartEmailPane.class); - ganttMap.put(WebHyperlink.class, WebHyperlinkPane.CHART_GANTT.class); - ganttMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART_GANTT.class); - - ganttMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART_GANTT.class); - ganttMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.CHART_GANTT.class); - ganttMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.CHART_GANTT.class); - ganttMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.CHART_GANTT.class); - - ganttMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART_GANTT.class); - } - return ganttMap; - } - - private HashMap getMeterHyperMap() { - if(meterMap.isEmpty()) { - meterMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART_METER.class); - meterMap.put(EmailJavaScript.class, ChartEmailPane.class); - meterMap.put(WebHyperlink.class, WebHyperlinkPane.CHART_METER.class); - meterMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART_METER.class); - - meterMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART_METER.class); - meterMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.CHART_METER.class); - meterMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.CHART_METER.class); - meterMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.CHART_METER.class); - - meterMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART_METER.class); - } - return meterMap; - } - - private HashMap getMapPlotHyperMap() { - if(mapMap.isEmpty()) { - mapMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART_MAP.class); - mapMap.put(EmailJavaScript.class, ChartEmailPane.class); - mapMap.put(WebHyperlink.class, WebHyperlinkPane.CHART_MAP.class); - mapMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART_MAP.class); - - mapMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART_MAP.class); - mapMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.CHART_MAP.class); - mapMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.CHART_MAP.class); - mapMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.CHART_MAP.class); - - mapMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART_MAP.class); - } - return mapMap; - } - - private HashMap getPiePlotHyperMap() { - if(pieMap.isEmpty()) { - pieMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART_PIE.class); - pieMap.put(EmailJavaScript.class, ChartEmailPane.class); - pieMap.put(WebHyperlink.class, WebHyperlinkPane.CHART_PIE.class); - pieMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART_PIE.class); - - pieMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART_PIE.class); - pieMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.CHART_PIE.class); - pieMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.CHART_PIE.class); - pieMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.CHART_PIE.class); - - pieMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART_PIE.class); - } - return pieMap; - } - - private HashMap getGisPlotHyperMap() { - if(gisMap.isEmpty()) { - gisMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART_GIS.class); - gisMap.put(EmailJavaScript.class, ChartEmailPane.class); - gisMap.put(WebHyperlink.class, WebHyperlinkPane.CHART_GIS.class); - gisMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART_GIS.class); - - gisMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART_GIS.class); - gisMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.CHART_GIS.class); - gisMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.CHART_GIS.class); - gisMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.CHART_GIS.class); - - gisMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART_GIS.class); - } - return gisMap; - } - - private HashMap getNormalPlotHyperMap() { + private HashMap getPlotHyperMap() { if(normalMap.isEmpty()) { FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); - normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART.class); + normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.class); normalMap.put(EmailJavaScript.class, ChartEmailPane.class); - normalMap.put(WebHyperlink.class, WebHyperlinkPane.CHART.class); - normalMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.CHART.class); + normalMap.put(WebHyperlink.class, WebHyperlinkPane.class); + normalMap.put(ParameterJavaScript.class, ParameterJavaScriptPane.class); - normalMap.put(JavaScriptImpl.class, JavaScriptImplPane.CHART.class); + normalMap.put(JavaScriptImpl.class, JavaScriptImplPane.class); normalMap.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.class); normalMap.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.class); normalMap.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.class); - normalMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.CHART.class); + normalMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.class); //兼容老的FormHyperlink.class if(fp != null){ - normalMap.put(fp.getClass(), FormHyperlinkPane.CHART.class); + normalMap.put(fp.getClass(), FormHyperlinkPane.class); } } return normalMap; 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 2f0e0c628..0fbeb752f 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 @@ -6,12 +6,21 @@ import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.chart.javascript.ChartEmailPane; +import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; +import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateCellLinkPane; +import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateFloatLinkPane; +import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane; import com.fr.design.designer.TargetComponent; import com.fr.design.fun.HyperlinkProvider; import com.fr.design.gui.HyperlinkFilterHelper; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator; +import com.fr.design.hyperlink.ReportletHyperlinkPane; +import com.fr.design.hyperlink.WebHyperlinkPane; +import com.fr.design.javascript.JavaScriptImplPane; +import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.module.DesignModuleFactory; import com.fr.general.Inter; import com.fr.general.NameObject; @@ -25,11 +34,12 @@ import com.fr.js.ParameterJavaScript; import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; import com.fr.plugin.chart.designer.component.VanChartUIListControlPane; -import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; import com.fr.stable.ListMap; import com.fr.stable.Nameable; import com.fr.stable.bridge.StableFactory; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -62,6 +72,25 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } + protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + Constructor constructor = null; + try { + constructor = creator.getUpdatePane().getConstructor(Plot.class); + return constructor.newInstance(plot); + + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (NoSuchMethodException e) { + return super.createPaneByCreators(creator); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + return null; + } + + /** * 弹出列表的标题. * @@ -119,8 +148,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); for (HyperlinkProvider provider : providers) { NameableCreator nc = provider.createHyperlinkCreator(); - //todo@shine9.0 - // paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); + paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); } java.util.List list = refreshList(paneMap); @@ -155,7 +183,20 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } protected HashMap getHyperlinkMap(Plot plot) { - return HyperlinkMapFactory.getHyperlinkMap(plot); + HashMap map = new HashMap(); + + map.put(ReportletHyperlink.class, ReportletHyperlinkPane.class); + map.put(EmailJavaScript.class, ChartEmailPane.class); + map.put(WebHyperlink.class, WebHyperlinkPane.class); + map.put(ParameterJavaScript.class, ParameterJavaScriptPane.class); + + map.put(JavaScriptImpl.class, JavaScriptImplPane.class); + map.put(ChartHyperPoplink.class, ChartHyperPoplinkPane.class); + map.put(ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.class); + map.put(ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.class); + + map.put(FormHyperlinkProvider.class, FormHyperlinkPane.class); + return map; } public void update(Plot plot) { @@ -191,7 +232,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"), new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class))); - list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), HyperlinkMapFactory.VanChartEmailPane.class)); + list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), VanChartEmailPane.class)); list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"), new WebHyperlink(), getUseMap(map, WebHyperlink.class))); list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"), @@ -237,5 +278,13 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } } + //邮箱 + public static class VanChartEmailPane extends ChartEmailPane { + @Override + protected boolean needRenamePane() { + return false; + } + } + } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/ConditionUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java similarity index 60% rename from designer_chart/src/com/fr/plugin/chart/designer/component/ConditionUIMenuNameableCreator.java rename to designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java index 5b78f970a..c660d1750 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/ConditionUIMenuNameableCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java @@ -2,7 +2,6 @@ package com.fr.plugin.chart.designer.component; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.general.FRLogger; @@ -11,10 +10,10 @@ import java.lang.reflect.Constructor; /** * Created by hufan on 2016/11/15. */ -public class ConditionUIMenuNameableCreator extends UIMenuNameableCreator { +public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { private Plot plot; - public ConditionUIMenuNameableCreator(Plot plot, String name, Object obj, Class paneClazz) { + public ChartUIMenuNameableCreator(Plot plot, String name, Object obj, Class paneClazz) { super(name, obj, paneClazz); this.plot = plot; } @@ -28,16 +27,18 @@ public class ConditionUIMenuNameableCreator extends UIMenuNameableCreator { } catch (IllegalAccessException e) { FRLogger.getLogger().error("UIMenuNameableCreator IllegalAccessException"); } - return new ConditionUIMenuNameableCreator(plot, name, cloneObj, (Class) this.paneClazz); + return new ChartUIMenuNameableCreator(plot, name, cloneObj, (Class) this.paneClazz); } public BasicBeanPane getPane() { try { - Constructor constructor = paneClazz.getConstructor(Plot.class); - return constructor.newInstance(plot); + if (plot != null) { + Constructor constructor = paneClazz.getConstructor(Plot.class); + return constructor.newInstance(plot); + } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); + return super.getPane(); } return null; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/HyperlinkMapFactory.java b/designer_chart/src/com/fr/plugin/chart/designer/other/HyperlinkMapFactory.java deleted file mode 100644 index 2ca0e2504..000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/HyperlinkMapFactory.java +++ /dev/null @@ -1,1096 +0,0 @@ -package com.fr.plugin.chart.designer.other; - -import com.fr.base.Formula; -import com.fr.chart.chartattr.Plot; -import com.fr.chart.web.ChartHyperPoplink; -import com.fr.chart.web.ChartHyperRelateCellLink; -import com.fr.chart.web.ChartHyperRelateFloatLink; -import com.fr.design.chart.javascript.ChartEmailPane; -import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; -import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateCellLinkPane; -import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateFloatLinkPane; -import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.editor.ValueEditorPaneFactory; -import com.fr.design.editor.editor.BooleanEditor; -import com.fr.design.editor.editor.ConstantsEditor; -import com.fr.design.editor.editor.DateEditor; -import com.fr.design.editor.editor.DoubleEditor; -import com.fr.design.editor.editor.Editor; -import com.fr.design.editor.editor.FormulaEditor; -import com.fr.design.editor.editor.IntegerEditor; -import com.fr.design.editor.editor.TextEditor; -import com.fr.design.hyperlink.ReportletHyperlinkPane; -import com.fr.design.hyperlink.WebHyperlinkPane; -import com.fr.design.javascript.JavaScriptImplPane; -import com.fr.design.javascript.ParameterJavaScriptPane; -import com.fr.general.Inter; -import com.fr.js.EmailJavaScript; -import com.fr.js.FormHyperlinkProvider; -import com.fr.js.JavaScriptImpl; -import com.fr.js.ParameterJavaScript; -import com.fr.js.ReportletHyperlink; -import com.fr.js.WebHyperlink; -import com.fr.plugin.chart.area.VanChartAreaPlot; -import com.fr.plugin.chart.bubble.BubblePlotType; -import com.fr.plugin.chart.bubble.VanChartBubblePlot; -import com.fr.plugin.chart.column.VanChartColumnPlot; -import com.fr.plugin.chart.custom.VanChartCustomPlot; -import com.fr.plugin.chart.custom.type.CustomStyle; -import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; -import com.fr.plugin.chart.funnel.VanChartFunnelPlot; -import com.fr.plugin.chart.gantt.VanChartGanttPlot; -import com.fr.plugin.chart.gauge.VanChartGaugePlot; -import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot; -import com.fr.plugin.chart.line.VanChartLinePlot; -import com.fr.plugin.chart.map.VanChartMapPlot; -import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot; -import com.fr.plugin.chart.scatter.VanChartScatterPlot; -import com.fr.plugin.chart.structure.VanChartStructurePlot; -import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; -import com.fr.plugin.chart.type.GaugeStyle; -import com.fr.plugin.chart.type.MapType; -import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - - -/** - * 根据plot返回不同的超链的map - */ - -public class HyperlinkMapFactory { - //注意啦:下面超链面板那些类名如VAN_CHART_SCATTER要和SCATTER = "$VAN_CHART_SCATTER"完全一致。 - private static final String NORMAL = "$VAN_CHART"; - private static final String GAUGE = "$VAN_CHART_GAUGE"; - private static final String SCATTER = "$VAN_CHART_SCATTER"; - private static final String GANNT = "$VAN_CHART_GANNT"; - private static final String MULTIPIE = "$VAN_CHART_MULTIPIE"; - private static final String MAP = "$VAN_CHART_MAP"; - private static final String LINEMAP = "$VAN_CHART_LINE_MAP"; - private static final String DIRLLMAPCATALOG = "$VAN_CHART_DRILLMAPCATALOG"; - private static final String FUNNEL = "$VAN_CHART_FUNNEL"; - private static final String WORDCLOUD = "$VAN_CHART_WORDCLOUD"; - private static final String STRUCTURE = "$VAN_CHART_STRUCTURE"; - private static final String MULTICATEGORY = "$VAN_CHART_MULTICATEGORY"; - - private static final String KEY_GAUGE_SLOT = VanChartGaugePlot.class.getName() + GaugeStyle.SLOT.ordinal(); - private static final String KEY_GAUGE_RING = VanChartGaugePlot.class.getName() + GaugeStyle.RING.ordinal(); - private static final String KEY_GAUGE_THERMOMETER = VanChartGaugePlot.class.getName() + GaugeStyle.THERMOMETER.ordinal(); - private static final String KEY_LINE_MAP = VanChartMapPlot.class.getName() + MapType.LINE.ordinal(); - - private static final String KEY_CUSTOM_COLUMN_LINE = VanChartCustomPlot.class.getName() + CustomStyle.COMMON_COLUMN_AREA.ordinal(); - private static final String KEY_CUSTOM_COLUMN_AREA = VanChartCustomPlot.class.getName() + CustomStyle.COMMON_COLUMN_AREA.ordinal(); - private static final String KEY_CUSTOM_STACK_COLUMN_LINE = VanChartCustomPlot.class.getName() + CustomStyle.COMMON_COLUMN_AREA.ordinal(); - - private static final String KEY_BUBBLE_FORCE = VanChartBubblePlot.class.getName() + BubblePlotType.FORCE.ordinal(); - - private static HashMap plotTypeMap = new HashMap(); - - static { - plotTypeMap.put(KEY_GAUGE_SLOT, GAUGE); - plotTypeMap.put(KEY_GAUGE_RING, GAUGE); - plotTypeMap.put(KEY_GAUGE_THERMOMETER, GAUGE); - plotTypeMap.put(VanChartScatterPlot.class.getName(), SCATTER); - plotTypeMap.put(VanChartBubblePlot.class.getName(), SCATTER); - plotTypeMap.put(VanChartMultiPiePlot.class.getName(), MULTIPIE); - plotTypeMap.put(VanChartTreeMapPlot.class.getName(), MULTIPIE); - plotTypeMap.put(KEY_BUBBLE_FORCE, NORMAL); - plotTypeMap.put(VanChartMapPlot.class.getName(), MAP); - plotTypeMap.put(KEY_LINE_MAP, LINEMAP); - plotTypeMap.put(VanChartDrillMapPlot.class.getName(), MAP); - plotTypeMap.put(VanChartFunnelPlot.class.getName(), FUNNEL); - plotTypeMap.put(VanChartHeatMapPlot.class.getName(), MAP); - plotTypeMap.put(VanChartWordCloudPlot.class.getName(), WORDCLOUD); - plotTypeMap.put(VanChartGanttPlot.class.getName(), GANNT); - plotTypeMap.put(VanChartStructurePlot.class.getName(), STRUCTURE); - plotTypeMap.put(VanChartColumnPlot.class.getName(), MULTICATEGORY); - plotTypeMap.put(VanChartLinePlot.class.getName(), MULTICATEGORY); - plotTypeMap.put(VanChartAreaPlot.class.getName(), MULTICATEGORY); - plotTypeMap.put(KEY_CUSTOM_COLUMN_LINE, MULTICATEGORY); - plotTypeMap.put(KEY_CUSTOM_COLUMN_AREA, MULTICATEGORY); - plotTypeMap.put(KEY_CUSTOM_STACK_COLUMN_LINE, MULTICATEGORY); - } - - public static HashMap getHyperlinkMap(Plot plot) { - String plotType = plotTypeMap.get(plot.getClass().getName() + plot.getDetailType()); - if (plotType == null) { - plotType = plotTypeMap.get(plot.getClass().getName()); - if (plotType == null) { - plotType = NORMAL; - } - } - return getHyperlinkMapWithType(plotType); - } - - public static HashMap getDrillUpLinkMap() { - return getHyperlinkMapWithType(DIRLLMAPCATALOG); - } - - public static HashMap getLineMapHyperLinkMap() { - return getHyperlinkMapWithType(LINEMAP); - } - - private static HashMap getHyperlinkMapWithType(String plotType) { - HashMap map = new HashMap(); - - map.put(ReportletHyperlink.class, getClassWithPrefix(HyperlinkMapFactory.Report.class, plotType)); - map.put(EmailJavaScript.class, VanChartEmailPane.class); - map.put(WebHyperlink.class, getClassWithPrefix(HyperlinkMapFactory.Web.class, plotType)); - map.put(ParameterJavaScript.class, getClassWithPrefix(HyperlinkMapFactory.Para.class, plotType)); - - map.put(JavaScriptImpl.class, getClassWithPrefix(HyperlinkMapFactory.Js.class, plotType)); - map.put(ChartHyperPoplink.class, getClassWithPrefix(HyperlinkMapFactory.Chart_Chart.class, plotType)); - map.put(ChartHyperRelateCellLink.class, getClassWithPrefix(HyperlinkMapFactory.Chart_Cell.class, plotType)); - map.put(ChartHyperRelateFloatLink.class, getClassWithPrefix(HyperlinkMapFactory.Chart_Float.class, plotType)); - - map.put(FormHyperlinkProvider.class, getClassWithPrefix(HyperlinkMapFactory.Form.class, plotType)); - return map; - } - - private static Class getClassWithPrefix(Class superClass, String plotType) { - String wholeClassString = superClass.getName() + plotType; - try { - return Class.forName(wholeClassString); - } catch (Exception e) { - return superClass; - } - } - - private static Editor[] addBasicEditors(List list) { - list.add(new TextEditor()); - list.add(new IntegerEditor()); - list.add(new DoubleEditor()); - list.add(new DateEditor(true, Inter.getLocText("FR-Base_Sche_Day"))); - list.add(new BooleanEditor()); - - FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("Plugin-ChartF_Formula")); - formulaEditor.setEnabled(true); - list.add(formulaEditor); - - return list.toArray(new Editor[list.size()]); - } - - private static List getVanMultiPieEditor() { - ConstantsEditor seriesName = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name"), new Formula("SERIES")); - seriesName.setEnabled(false); - ConstantsEditor levelName = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Level_Name"), new Formula("NAME")); - levelName.setEnabled(false); - ConstantsEditor levelOrder = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Level_Order"), new Formula("LEVEL")); - levelOrder.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Use_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(seriesName); - lists.add(levelName); - lists.add(levelOrder); - lists.add(value); - return lists; - } - - private static List getVanMultiCategoryEditor() { - ConstantsEditor category = new ConstantsEditor(Inter.getLocText("Chart-Category_Name"), new Formula("CATEGORY")); - category.setEnabled(false); - ConstantsEditor categoryArray = new ConstantsEditor(Inter.getLocText("Plugin-Chart_Category_Array"), new Formula("CATEGORYARRAY")); - categoryArray.setEnabled(false); - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Use_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(category); - lists.add(categoryArray); - lists.add(series); - lists.add(value); - return lists; - } - - private static List getVanScatterEditor() { - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor size = new ConstantsEditor("SIZE", new Formula("SIZE")); - size.setEnabled(false); - ConstantsEditor x = new ConstantsEditor("X", new Formula("X")); - x.setEnabled(false); - ConstantsEditor y = new ConstantsEditor("Y", new Formula("Y")); - y.setEnabled(false); - - List lists = new ArrayList(); - lists.add(series); - lists.add(x); - lists.add(y); - lists.add(size); - return lists; - } - - private static List getVanGanntEditor() { - ConstantsEditor project = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Project_Name"), new Formula("PROJECT")); - project.setEnabled(false); - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor startTime = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Start_Time"), new Formula("START_TIME")); - startTime.setEnabled(false); - ConstantsEditor endTime = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_End_Time"), new Formula("END_TIME")); - endTime.setEnabled(false); - ConstantsEditor progress = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Process"), new Formula("PROGRESS")); - progress.setEnabled(false); - - List lists = new ArrayList(); - lists.add(project); - lists.add(series); - lists.add(startTime); - lists.add(endTime); - lists.add(progress); - - return lists; - } - - private static List getVanMapEditor() { - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor areaName = new ConstantsEditor(Inter.getLocText("FR-Chart-Area_Name"), new Formula("AREA_NAME")); - areaName.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Use_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(series); - lists.add(areaName); - lists.add(value); - return lists; - } - - private static List getVanLineMapEditor() { - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor startAreaName = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Start_Point"), new Formula("START_AREA_NAME")); - startAreaName.setEnabled(false); - ConstantsEditor endAreaName = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_End_Point"), new Formula("END_AREA_NAME")); - endAreaName.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Use_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(series); - lists.add(startAreaName); - lists.add(endAreaName); - lists.add(value); - return lists; - } - - private static List getDrillMapCatalogEditor() { - ConstantsEditor areaName = new ConstantsEditor(Inter.getLocText("FR-Chart-Area_Name"), new Formula("AREA_NAME")); - areaName.setEnabled(false); - - List lists = new ArrayList(); - lists.add(areaName); - return lists; - } - - private static List getVanFunnelEditor() { - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("ChartF-Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Use_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(series); - lists.add(value); - return lists; - } - - private static List getVanWordCloudEditor() { - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor name = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Word_Name"), new Formula("WORD_NAME")); - name.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Word_Value"), new Formula("WORD_VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(series); - lists.add(name); - lists.add(value); - return lists; - } - - private static List getVanStructureEditor() { - ConstantsEditor name = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_Node_Name"), new Formula("NAME")); - name.setEnabled(false); - ConstantsEditor series = new ConstantsEditor(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name"), new Formula("SERIES")); - series.setEnabled(false); - ConstantsEditor value = new ConstantsEditor(Inter.getLocText("Chart-Use_Value"), new Formula("VALUE")); - value.setEnabled(false); - - List lists = new ArrayList(); - lists.add(name); - lists.add(series); - lists.add(value); - return lists; - } - - private static ValueEditorPane getMultiCategoryEditorPane() { - List list = getVanMultiCategoryEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getScatterValueEditorPane() { - List list = getVanScatterEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getGanntValueEditorPane() { - List list = getVanGanntEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getMultiPieValueEditorPane() { - List list = getVanMultiPieEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getMapValueEditorPane() { - List list = getVanMapEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getLineMapValueEditorPane() { - List list = getVanLineMapEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getDrillMapCatalogValueEditorPane() { - List list = getDrillMapCatalogEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getFunnelValueEditorPane() { - List list = getVanFunnelEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getWordCloudValueEditorPane() { - List list = getVanWordCloudEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - private static ValueEditorPane getStructureValueEditorPane() { - List list = getVanStructureEditor(); - return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); - } - - - //网络报表 - public static class Report { - public static class VAN_CHART extends ReportletHyperlinkPane.CHART { - - @Override - protected boolean needRenamePane() { - return false; - } - - } - - public static class VAN_CHART_MULTICATEGORY extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiCategoryEditorPane(); - } - } - - public static class VAN_CHART_SCATTER extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getScatterValueEditorPane(); - } - } - - public static class VAN_CHART_GANNT extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getGanntValueEditorPane(); - } - } - - public static class VAN_CHART_MULTIPIE extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiPieValueEditorPane(); - } - } - - public static class VAN_CHART_GAUGE extends ReportletHyperlinkPane.CHART_METER { - - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MAP extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMapValueEditorPane(); - } - } - - public static class VAN_CHART_LINE_MAP extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getLineMapValueEditorPane(); - } - } - - public static class VAN_CHART_DRILLMAPCATALOG extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getDrillMapCatalogValueEditorPane(); - } - } - - public static class VAN_CHART_FUNNEL extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getFunnelValueEditorPane(); - } - } - - public static class VAN_CHART_WORDCLOUD extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getWordCloudValueEditorPane(); - } - } - - public static class VAN_CHART_STRUCTURE extends Report.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getStructureValueEditorPane(); - } - } - } - - //邮箱 - public static class VanChartEmailPane extends ChartEmailPane { - @Override - protected boolean needRenamePane() { - return false; - } - } - - //网页链接 - public static class Web { - public static class VAN_CHART extends WebHyperlinkPane.CHART { - - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MULTICATEGORY extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiCategoryEditorPane(); - } - } - - public static class VAN_CHART_SCATTER extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getScatterValueEditorPane(); - } - } - - public static class VAN_CHART_GANNT extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getGanntValueEditorPane(); - } - } - - public static class VAN_CHART_GAUGE extends WebHyperlinkPane.CHART_METER { - - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MAP extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMapValueEditorPane(); - } - } - - public static class VAN_CHART_LINE_MAP extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getLineMapValueEditorPane(); - } - } - - - public static class VAN_CHART_DRILLMAPCATALOG extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getDrillMapCatalogValueEditorPane(); - } - } - - public static class VAN_CHART_MULTIPIE extends Web.VAN_CHART { - protected ValueEditorPane getValueEditorPane() { - return getMultiPieValueEditorPane(); - } - } - - public static class VAN_CHART_FUNNEL extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getFunnelValueEditorPane(); - } - } - - public static class VAN_CHART_WORDCLOUD extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getWordCloudValueEditorPane(); - } - } - - public static class VAN_CHART_STRUCTURE extends Web.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getStructureValueEditorPane(); - } - } - } - - //动态参数 - public static class Para { - public static class VAN_CHART extends ParameterJavaScriptPane.CHART { - - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MULTICATEGORY extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiCategoryEditorPane(); - } - } - - public static class VAN_CHART_SCATTER extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getScatterValueEditorPane(); - } - } - - public static class VAN_CHART_GANNT extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getGanntValueEditorPane(); - } - } - - public static class VAN_CHART_GAUGE extends ParameterJavaScriptPane.CHART_METER { - - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MAP extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMapValueEditorPane(); - } - } - - public static class VAN_CHART_LINE_MAP extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getLineMapValueEditorPane(); - } - } - - - public static class VAN_CHART_DRILLMAPCATALOG extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getDrillMapCatalogValueEditorPane(); - } - } - - public static class VAN_CHART_MULTIPIE extends Para.VAN_CHART { - protected ValueEditorPane getValueEditorPane() { - return getMultiPieValueEditorPane(); - } - } - - public static class VAN_CHART_FUNNEL extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getFunnelValueEditorPane(); - } - } - - public static class VAN_CHART_WORDCLOUD extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getWordCloudValueEditorPane(); - } - } - - public static class VAN_CHART_STRUCTURE extends Para.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getStructureValueEditorPane(); - } - } - } - - //js超链 - public static class Js { - public static class VAN_CHART extends JavaScriptImplPane.CHART { - - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MULTICATEGORY extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiCategoryEditorPane(); - } - } - - public static class VAN_CHART_SCATTER extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getScatterValueEditorPane(); - } - } - - public static class VAN_CHART_GANNT extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getGanntValueEditorPane(); - } - } - - public static class VAN_CHART_GAUGE extends Js.VAN_CHART { - - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MAP extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMapValueEditorPane(); - } - } - - public static class VAN_CHART_LINE_MAP extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getLineMapValueEditorPane(); - } - } - - public static class VAN_CHART_DRILLMAPCATALOG extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getDrillMapCatalogValueEditorPane(); - } - } - - public static class VAN_CHART_MULTIPIE extends Js.VAN_CHART { - protected ValueEditorPane getValueEditorPane() { - return getMultiPieValueEditorPane(); - } - } - - public static class VAN_CHART_FUNNEL extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getFunnelValueEditorPane(); - } - } - - public static class VAN_CHART_WORDCLOUD extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getWordCloudValueEditorPane(); - } - } - - public static class VAN_CHART_STRUCTURE extends Js.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getStructureValueEditorPane(); - } - } - } - - //图表超链-悬浮窗图表 - public static class Chart_Chart { - public static class VAN_CHART extends ChartHyperPoplinkPane { - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MULTICATEGORY extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiCategoryEditorPane(); - } - } - - public static class VAN_CHART_SCATTER extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getScatterValueEditorPane(); - } - } - - public static class VAN_CHART_GANNT extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getGanntValueEditorPane(); - } - } - - public static class VAN_CHART_GAUGE extends ChartHyperPoplinkPane.CHART_METER { - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MAP extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMapValueEditorPane(); - } - } - - public static class VAN_CHART_LINE_MAP extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getLineMapValueEditorPane(); - } - } - - public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getDrillMapCatalogValueEditorPane(); - } - } - - public static class VAN_CHART_MULTIPIE extends Chart_Chart.VAN_CHART { - protected ValueEditorPane getValueEditorPane() { - return getMultiPieValueEditorPane(); - } - } - - public static class VAN_CHART_FUNNEL extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getFunnelValueEditorPane(); - } - } - - public static class VAN_CHART_WORDCLOUD extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getWordCloudValueEditorPane(); - } - } - - public static class VAN_CHART_STRUCTURE extends Chart_Chart.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getStructureValueEditorPane(); - } - } - } - - //图表超链-联动单元格 - public static class Chart_Cell { - public static class VAN_CHART extends ChartHyperRelateCellLinkPane { - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MULTICATEGORY extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiCategoryEditorPane(); - } - } - - public static class VAN_CHART_SCATTER extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getScatterValueEditorPane(); - } - } - - public static class VAN_CHART_GANNT extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getGanntValueEditorPane(); - } - } - - public static class VAN_CHART_GAUGE extends ChartHyperRelateCellLinkPane.CHART_METER { - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MAP extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMapValueEditorPane(); - } - } - - public static class VAN_CHART_LINE_MAP extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getLineMapValueEditorPane(); - } - } - - public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getDrillMapCatalogValueEditorPane(); - } - } - - public static class VAN_CHART_MULTIPIE extends Chart_Cell.VAN_CHART { - protected ValueEditorPane getValueEditorPane() { - return getMultiPieValueEditorPane(); - } - } - - public static class VAN_CHART_FUNNEL extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getFunnelValueEditorPane(); - } - } - - public static class VAN_CHART_WORDCLOUD extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getWordCloudValueEditorPane(); - } - } - - public static class VAN_CHART_STRUCTURE extends Chart_Cell.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getStructureValueEditorPane(); - } - } - } - - //图表超链-悬浮元素 - public static class Chart_Float { - public static class VAN_CHART extends ChartHyperRelateFloatLinkPane { - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MULTICATEGORY extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiCategoryEditorPane(); - } - } - - public static class VAN_CHART_SCATTER extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getScatterValueEditorPane(); - } - } - - public static class VAN_CHART_GANNT extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getGanntValueEditorPane(); - } - } - - public static class VAN_CHART_GAUGE extends ChartHyperRelateFloatLinkPane.CHART_METER { - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MAP extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMapValueEditorPane(); - } - } - - public static class VAN_CHART_LINE_MAP extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getLineMapValueEditorPane(); - } - } - - public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getDrillMapCatalogValueEditorPane(); - } - } - - public static class VAN_CHART_MULTIPIE extends Chart_Float.VAN_CHART { - protected ValueEditorPane getValueEditorPane() { - return getMultiPieValueEditorPane(); - } - } - - public static class VAN_CHART_FUNNEL extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getFunnelValueEditorPane(); - } - } - - public static class VAN_CHART_WORDCLOUD extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getWordCloudValueEditorPane(); - } - } - - public static class VAN_CHART_STRUCTURE extends Chart_Float.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getStructureValueEditorPane(); - } - } - } - - //当前表单对象 - public static class Form { - public static class VAN_CHART extends FormHyperlinkPane.CHART { - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MULTICATEGORY extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMultiCategoryEditorPane(); - } - } - - public static class VAN_CHART_SCATTER extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getScatterValueEditorPane(); - } - } - - public static class VAN_CHART_GANNT extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getGanntValueEditorPane(); - } - } - - public static class VAN_CHART_GAUGE extends FormHyperlinkPane.CHART_METER { - @Override - protected boolean needRenamePane() { - return false; - } - } - - public static class VAN_CHART_MAP extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getMapValueEditorPane(); - } - } - - public static class VAN_CHART_LINE_MAP extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getLineMapValueEditorPane(); - } - } - - - public static class VAN_CHART_DRILLMAPCATALOG extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getDrillMapCatalogValueEditorPane(); - } - } - - public static class VAN_CHART_MULTIPIE extends Form.VAN_CHART { - protected ValueEditorPane getValueEditorPane() { - return getMultiPieValueEditorPane(); - } - } - - public static class VAN_CHART_FUNNEL extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getFunnelValueEditorPane(); - } - } - - public static class VAN_CHART_WORDCLOUD extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getWordCloudValueEditorPane(); - } - } - - public static class VAN_CHART_STRUCTURE extends Form.VAN_CHART { - @Override - protected ValueEditorPane getValueEditorPane() { - return getStructureValueEditorPane(); - } - } - } - -} \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/drillmap/designer/other/VanChartCatalogHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/drillmap/designer/other/VanChartCatalogHyperLinkPane.java index 30d0cfca2..8bf8bdfe6 100644 --- a/designer_chart/src/com/fr/plugin/chart/drillmap/designer/other/VanChartCatalogHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/drillmap/designer/other/VanChartCatalogHyperLinkPane.java @@ -3,18 +3,12 @@ package com.fr.plugin.chart.drillmap.designer.other; import com.fr.chart.chartattr.Plot; import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.chart.custom.component.VanChartHyperLinkPane; -import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; -import java.util.HashMap; - /** * Created by hufan on 2016/12/13. */ public class VanChartCatalogHyperLinkPane extends VanChartHyperLinkPane{ - protected HashMap getHyperlinkMap(Plot plot){ - return HyperlinkMapFactory.getDrillUpLinkMap(); - } protected void updateHotHyperLink(Plot plot, NameJavaScriptGroup nameGroup) { if (plot instanceof VanChartDrillMapPlot) { diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapHyperLinkPane.java index 435c39cb4..bcdc76782 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapHyperLinkPane.java @@ -4,14 +4,12 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.dialog.BasicScrollPane; import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.chart.custom.component.VanChartHyperLinkPane; -import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; -import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.designer.VanMapAreaPointAndLineGroupPane; +import com.fr.plugin.chart.type.MapType; import javax.swing.*; import java.awt.*; -import java.util.HashMap; /** * Created by hufan on 2016/12/20. @@ -194,11 +192,6 @@ public class VanChartMapHyperLinkPane extends BasicScrollPane { protected NameJavaScriptGroup populateHotHyperLink(Plot plot) { return ((VanChartMapPlot)plot).getLineHotHyperLink(); } - - @Override - protected HashMap getHyperlinkMap(Plot plot){ - return HyperlinkMapFactory.getLineMapHyperLinkMap(); - } }; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index 1b88936c9..eaafb9dbf 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -3,6 +3,7 @@ package com.fr.design.widget.ui.designer.layout; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWScaleLayout; @@ -117,6 +118,13 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { @Override public void populateBean(WFitLayout ob) { + FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + XLayoutContainer rootLayout = selectedBodyLayout(formDesigner); + if (rootLayout != formDesigner.getRootComponent() + && formDesigner.getSelectionModel().getSelection().getSelectedCreator() == formDesigner.getRootComponent()) { + formDesigner.getSelectionModel().setSelectedCreators( + FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()})); + } paddingBound.populate(ob); layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); adaptComboBox.setSelectedIndex(ob.getCompState()); @@ -124,6 +132,14 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { stylePane.setValue(ob.getBorderStyle()); } + private XLayoutContainer selectedBodyLayout(FormDesigner formDesigner) { + XLayoutContainer rootLayout = formDesigner.getRootComponent(); + if (rootLayout.getComponentCount() == 1 && rootLayout.getXCreator(0).acceptType(XWAbsoluteBodyLayout.class)){ + rootLayout = (XWAbsoluteBodyLayout)rootLayout.getXCreator(0); + } + return rootLayout; + } + @Override public WFitLayout updateBean() {