From 82955cd847b7a8a9264264c4d4de7bd412208230 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 09:33:04 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/hyperlink/ReportletHyperlinkPane.java | 2 +- designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java | 2 +- .../src/com/fr/design/javascript/JavaScriptImplPane.java | 2 +- .../src/com/fr/design/javascript/ParameterJavaScriptPane.java | 2 +- .../series/SeriesCondition/impl/ChartHyperPoplinkPane.java | 2 +- .../SeriesCondition/impl/ChartHyperRelateCellLinkPane.java | 2 +- .../SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java | 2 +- .../chart/series/SeriesCondition/impl/FormHyperlinkPane.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 395c6dbd8..9fc87f67e 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -75,7 +75,7 @@ public class ReportletHyperlinkPane extends BasicBeanPane { } protected boolean needRenamePane(){ - return plot != null && plot.needRenameHyperLinkPane(); + return plot != null && plot.isNeedRenameHyperLinkPane(); } @Override diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index c3185d392..d906d4efa 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -73,7 +73,7 @@ public class WebHyperlinkPane extends BasicBeanPane { } protected boolean needRenamePane(){ - return plot != null && plot.needRenameHyperLinkPane(); + return plot != null && plot.isNeedRenameHyperLinkPane(); } @Override diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java index c110471a3..dae8bc232 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java @@ -118,7 +118,7 @@ public class JavaScriptImplPane extends FurtherBasicBeanPane { } protected boolean needRenamePane(){ - return plot != null && plot.needRenameHyperLinkPane(); + return plot != null && plot.isNeedRenameHyperLinkPane(); } /** diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index 353fd887d..02981703f 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -49,7 +49,7 @@ public class ParameterJavaScriptPane extends BasicBeanPane } protected boolean needRenamePane(){ - return plot != null && plot.needRenameHyperLinkPane(); + return plot != null && plot.isNeedRenameHyperLinkPane(); } @Override 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 f0669a99e..5edcf38f3 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 @@ -96,7 +96,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane { } protected boolean needRenamePane(){ - return plot != null && plot.needRenameHyperLinkPane(); + return plot != null && plot.isNeedRenameHyperLinkPane(); } @Override 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 6d535e487..be7b2ce60 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 @@ -77,7 +77,7 @@ public class ChartHyperRelateCellLinkPane extends BasicBeanPane { } protected boolean needRenamePane(){ - return plot != null && plot.needRenameHyperLinkPane(); + return plot != null && plot.isNeedRenameHyperLinkPane(); } protected int getHyperlinkType() { From 2f3d3e80163cca9e0dd15d35b7516a985562f1f3 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 11:30:02 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E6=8A=BD=E8=B1=A1=E5=87=BA=E6=8A=BD?= =?UTF-8?q?=E8=B1=A1=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/AbstractHyperNorthPane.java | 144 +++++++++++++ .../hyperlink/AbstractHyperlinkPane.java | 200 +++++------------- .../hyperlink/ReporletHyperNorthPane.java | 27 +-- .../hyperlink/ReportletHyperlinkPane.java | 36 +--- .../design/hyperlink/WebHyperNorthPane.java | 3 +- .../fr/design/hyperlink/WebHyperlinkPane.java | 41 +--- .../design/javascript/JavaScriptImplPane.java | 24 +-- .../javascript/ParameterJavaScriptPane.java | 29 +-- .../impl/ChartHyperPoplinkPane.java | 27 +-- .../impl/ChartHyperRelateCellLinkPane.java | 29 +-- .../impl/ChartHyperRelateFloatLinkPane.java | 31 +-- .../impl/FormHyperlinkPane.java | 28 +-- .../component/VanChartHyperLinkPane.java | 3 +- .../component/ChartUIMenuNameableCreator.java | 5 +- 14 files changed, 249 insertions(+), 378 deletions(-) create mode 100644 designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java new file mode 100644 index 000000000..6a04ebafb --- /dev/null +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java @@ -0,0 +1,144 @@ +package com.fr.design.hyperlink; + +import com.fr.base.Utils; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; +import com.fr.js.Hyperlink; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public abstract class AbstractHyperNorthPane extends BasicBeanPane { + public static final int NEW_WINDOW = 0; + public static final int DIALOG = 1; + public static final int SELF = 2; + public static final int DEFAULT_H_VALUE = 400; + public static final int DEFAULT_V_VALUE = 600; + + private JPanel headerPane; + private UIComboBox targetFrameComboBox; + + private UINumberField heightTextFiled; + private UINumberField widthTextFiled; + + + public AbstractHyperNorthPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + headerPane = this.setHeaderPanel(); + this.add(headerPane, BorderLayout.NORTH); + this.add(centerPane, BorderLayout.CENTER); + targetFrameComboBox = new UIComboBox(getTargetFrames()); + targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + return this; + } + }); + JPanel targetFramePanel = new JPanel(); + targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in"))); + targetFramePanel.add(targetFrameComboBox); + targetFrameComboBox.setEditable(true); + targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); + + final JPanel newWindowConfPane = new JPanel(); + newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); + heightTextFiled = new UINumberField(); + heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); + heightTextFiled.setPreferredSize(new Dimension(40, 20)); + newWindowConfPane.add(heightTextFiled); + newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); + widthTextFiled = new UINumberField(); + widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); + widthTextFiled.setPreferredSize(new Dimension(40, 20)); + newWindowConfPane.add(widthTextFiled); + + JPanel centerPanel = new JPanel(new BorderLayout()); + centerPanel.add(targetFramePanel, BorderLayout.WEST); + centerPanel.add(newWindowConfPane, BorderLayout.EAST); + newWindowConfPane.setVisible(false); + + centerPane.add(centerPanel); + targetFrameComboBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + newWindowConfPane.setVisible(DIALOG == targetFrameComboBox.getSelectedIndex()); + } + }); + + this.add(this.setFootPanel(), BorderLayout.SOUTH); + } + protected String[] getTargetFrames(){ + return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}; + } + + protected abstract JPanel setHeaderPanel(); + + protected abstract JPanel setFootPanel(); + + protected abstract void populateSubHyperlinkBean(T link); + + public UIComboBox getTargetFrameComboBox() { + return targetFrameComboBox; + } + + public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { + this.targetFrameComboBox = targetFrameComboBox; + } + + public UINumberField getHeightTextFiled() { + return heightTextFiled; + } + + public void setHeightTextFiled(UINumberField heightTextFiled) { + this.heightTextFiled = heightTextFiled; + } + + public UINumberField getWidthTextFiled() { + return widthTextFiled; + } + + public void setWidthTextFiled(UINumberField widthTextFiled) { + this.widthTextFiled = widthTextFiled; + } + + @Override + public void populateBean(T link) { + String name = link.getTargetFrame(); + targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(name)); + heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); + widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); + populateSubHyperlinkBean(link); + } + + protected abstract T updateSubHyperlinkBean(); + + protected abstract void updateSubHyperlinkBean(T t); + + @Override + public T updateBean() { + T link = updateSubHyperlinkBean(); + + updateBean(link); + + return link; + } + + public void updateBean(T link) { + updateSubHyperlinkBean(link); + link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName()); + link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue()); + link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue()); + } + +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index 43f73b870..2b06f0c78 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -1,144 +1,56 @@ -package com.fr.design.hyperlink; - -import com.fr.base.Utils; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UINumberField; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.general.Inter; -import com.fr.js.Hyperlink; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -public abstract class AbstractHyperlinkPane extends BasicBeanPane { - public static final int NEW_WINDOW = 0; - public static final int DIALOG = 1; - public static final int SELF = 2; - public static final int DEFAULT_H_VALUE = 400; - public static final int DEFAULT_V_VALUE = 600; - - private JPanel headerPane; - private UIComboBox targetFrameComboBox; - - private UINumberField heightTextFiled; - private UINumberField widthTextFiled; - - - public AbstractHyperlinkPane() { - this.initComponents(); - } - - protected void initComponents() { - this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - headerPane = this.setHeaderPanel(); - this.add(headerPane, BorderLayout.NORTH); - this.add(centerPane, BorderLayout.CENTER); - targetFrameComboBox = new UIComboBox(getTargetFrames()); - targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - return this; - } - }); - JPanel targetFramePanel = new JPanel(); - targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in"))); - targetFramePanel.add(targetFrameComboBox); - targetFrameComboBox.setEditable(true); - targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); - - final JPanel newWindowConfPane = new JPanel(); - newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); - heightTextFiled = new UINumberField(); - heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); - heightTextFiled.setPreferredSize(new Dimension(40, 20)); - newWindowConfPane.add(heightTextFiled); - newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); - widthTextFiled = new UINumberField(); - widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); - widthTextFiled.setPreferredSize(new Dimension(40, 20)); - newWindowConfPane.add(widthTextFiled); - - JPanel centerPanel = new JPanel(new BorderLayout()); - centerPanel.add(targetFramePanel, BorderLayout.WEST); - centerPanel.add(newWindowConfPane, BorderLayout.EAST); - newWindowConfPane.setVisible(false); - - centerPane.add(centerPanel); - targetFrameComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - newWindowConfPane.setVisible(DIALOG == targetFrameComboBox.getSelectedIndex()); - } - }); - - this.add(this.setFootPanel(), BorderLayout.SOUTH); - } - protected String[] getTargetFrames(){ - return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}; - } - - protected abstract JPanel setHeaderPanel(); - - protected abstract JPanel setFootPanel(); - - protected abstract void populateSubHyperlinkBean(T link); - - public UIComboBox getTargetFrameComboBox() { - return targetFrameComboBox; - } - - public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { - this.targetFrameComboBox = targetFrameComboBox; - } - - public UINumberField getHeightTextFiled() { - return heightTextFiled; - } - - public void setHeightTextFiled(UINumberField heightTextFiled) { - this.heightTextFiled = heightTextFiled; - } - - public UINumberField getWidthTextFiled() { - return widthTextFiled; - } - - public void setWidthTextFiled(UINumberField widthTextFiled) { - this.widthTextFiled = widthTextFiled; - } - - @Override - public void populateBean(T link) { - String name = link.getTargetFrame(); - targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(name)); - heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); - widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); - populateSubHyperlinkBean(link); - } - - protected abstract T updateSubHyperlinkBean(); - - protected abstract void updateSubHyperlinkBean(T t); - - @Override - public T updateBean() { - T link = updateSubHyperlinkBean(); - - updateBean(link); - - return link; - } - - public void updateBean(T link) { - updateSubHyperlinkBean(link); - link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName()); - link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue()); - link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue()); - } - -} \ No newline at end of file +package com.fr.design.hyperlink; + +import com.fr.base.chart.BasePlot; +import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.editor.ValueEditorPane; +import com.fr.design.editor.ValueEditorPaneFactory; +import com.fr.design.gui.frpane.ReportletParameterViewPane; +import com.fr.design.gui.itableeditorpane.ParameterTableModel; +import com.fr.js.JavaScript; + +/** + * Created by mengao on 2017/10/12. + */ +public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { + private BasePlot plot; + protected ReportletParameterViewPane parameterViewPane; + + + public AbstractHyperLinkPane(BasePlot plot) { + this.plot = plot; + } + + public AbstractHyperLinkPane() { + } + + public BasePlot getPlot() { + return plot; + } + + public ReportletParameterViewPane getParameterViewPane() { + return parameterViewPane; + } + + public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) { + this.parameterViewPane = parameterViewPane; + } + + public boolean accept(Object ob){ + return ob instanceof JavaScript; + } + + public void reset() {} + + protected int getChartParaType() { + return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; + } + + protected ValueEditorPane getValueEditorPane() { + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); + } + + protected boolean needRenamePane(){ + return plot != null && plot.isNeedRenameHyperLinkPane(); + } + +} diff --git a/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java b/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java index 6061aa915..897148379 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java @@ -1,38 +1,33 @@ package com.fr.design.hyperlink; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import com.fr.design.gui.ilable.UILabel; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.SwingUtilities; - import com.fr.design.actions.UpdateAction; -import com.fr.design.gui.itree.filetree.ReportletPane; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itree.filetree.ReportletPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.js.ReportletHyperlink; import com.fr.stable.StringUtils; -import com.fr.design.utils.gui.GUICoreUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; /** * 热点链接部分 上方 定义特征 样式 报表 等属性的界面. * * @author kunsnat */ -public class ReporletHyperNorthPane extends AbstractHyperlinkPane { +public class ReporletHyperNorthPane extends AbstractHyperNorthPane { private UITextField itemNameTextField; private boolean needRenamePane = false; private UITextField reportPathTextField; diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 9fc87f67e..689fce0e0 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -3,9 +3,6 @@ package com.fr.design.hyperlink; import com.fr.base.BaseUtils; import com.fr.base.Parameter; import com.fr.base.chart.BasePlot; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -24,19 +21,12 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.util.List; -public class ReportletHyperlinkPane extends BasicBeanPane { - private BasePlot plot; +public class ReportletHyperlinkPane extends AbstractHyperLinkPane { private ReporletHyperNorthPane northPane; - private ReportletParameterViewPane parameterViewPane = null; private UICheckBox extendParametersCheckBox; - protected BasePlot getPlot() { - return plot; - } - public ReportletHyperlinkPane(BasePlot plot) { - super(); - this.plot = plot; + super(plot); this.initComponents(); } @@ -62,22 +52,10 @@ public class ReportletHyperlinkPane extends BasicBeanPane { } @Override - protected String title4PopupWindow() { + public String title4PopupWindow() { return Inter.getLocText("FR-Hyperlink_Reportlet"); } - protected int getChartParaType() { - return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; - } - - protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); - } - - protected boolean needRenamePane(){ - return plot != null && plot.isNeedRenameHyperLinkPane(); - } - @Override public void populateBean(ReportletHyperlink ob) { northPane.populateBean(ob); @@ -168,14 +146,6 @@ public class ReportletHyperlinkPane extends BasicBeanPane { this.northPane = northPane; } - public ReportletParameterViewPane getParameterViewPane() { - return parameterViewPane; - } - - public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) { - this.parameterViewPane = parameterViewPane; - } - public UICheckBox getExtendParametersCheckBox() { return extendParametersCheckBox; } diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java index ee3adaf76..14f9900a4 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java @@ -2,7 +2,6 @@ package com.fr.design.hyperlink; import com.fr.base.ConfigManager; import com.fr.design.constants.LayoutConstants; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; @@ -19,7 +18,7 @@ import java.awt.*; * * @author kunsnat */ -public class WebHyperNorthPane extends AbstractHyperlinkPane { +public class WebHyperNorthPane extends AbstractHyperNorthPane { private UITextField itemNameTextField; private boolean needRenamePane = false; private UITextField urlTextField; diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index d906d4efa..b6514dccf 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -2,9 +2,6 @@ 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; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -18,28 +15,20 @@ import javax.swing.*; import java.awt.*; import java.util.List; -public class WebHyperlinkPane extends BasicBeanPane { - private BasePlot plot; +public class WebHyperlinkPane extends AbstractHyperLinkPane { private WebHyperNorthPane northPane; - - private ReportletParameterViewPane parameterViewPane; - + private UICheckBox useCJKCheckBox; private UICheckBox extendParametersCheckBox; - protected BasePlot getPlot() { - return plot; - } - public WebHyperlinkPane() { super(); this.initComponents(); } public WebHyperlinkPane(BasePlot plot) { - super(); - this.plot = plot; + super(plot); this.initComponents(); } @@ -60,23 +49,11 @@ public class WebHyperlinkPane extends BasicBeanPane { } @Override - protected String title4PopupWindow() { + public String title4PopupWindow() { return Inter.getLocText("Hyperlink-Web_link"); } - - protected int getChartParaType() { - return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; - } - - protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); - } - - protected boolean needRenamePane(){ - return plot != null && plot.isNeedRenameHyperLinkPane(); - } - @Override + @Override public void populateBean(WebHyperlink ob) { northPane.populateBean(ob); //parameter @@ -131,14 +108,6 @@ public class WebHyperlinkPane extends BasicBeanPane { this.northPane = northPane; } - public ReportletParameterViewPane getParameterViewPane() { - return parameterViewPane; - } - - public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) { - this.parameterViewPane = parameterViewPane; - } - public UICheckBox getUseCJKCheckBox() { return useCJKCheckBox; } diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java index dae8bc232..31a24f845 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java @@ -2,15 +2,13 @@ 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; -import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.utils.gui.GUICoreUtils; @@ -26,24 +24,20 @@ import java.awt.*; import java.util.HashSet; import java.util.List; -public class JavaScriptImplPane extends FurtherBasicBeanPane { - private BasePlot plot; +public class JavaScriptImplPane extends AbstractHyperLinkPane { 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; + super(plot); this.defaultArgs = new String[0]; initComponents(); } @@ -109,18 +103,6 @@ public class JavaScriptImplPane extends FurtherBasicBeanPane { this.reLayoutForChart(); } - protected int getChartParaType() { - return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; - } - - protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); - } - - protected boolean needRenamePane(){ - return plot != null && plot.isNeedRenameHyperLinkPane(); - } - /** *参数改变 * @param list 参数列表. diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index 02981703f..3e03d4abc 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -2,12 +2,10 @@ 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; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.js.ParameterJavaScript; @@ -16,22 +14,17 @@ import com.fr.stable.ParameterProvider; import java.awt.*; import java.util.List; -public class ParameterJavaScriptPane extends BasicBeanPane { - private BasePlot plot; +public class ParameterJavaScriptPane extends AbstractHyperLinkPane { private UITextField itemNameTextField; - private ReportletParameterViewPane parameterViewPane; - protected BasePlot getPlot() { - return plot; - } public ParameterJavaScriptPane(){ this(null); } public ParameterJavaScriptPane(BasePlot plot){ - this.plot = plot; - this.setLayout(new BorderLayout()); + super(plot); + this.setLayout(new BorderLayout()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); this.add(parameterViewPane, BorderLayout.CENTER); if(needRenamePane()){ @@ -40,20 +33,8 @@ public class ParameterJavaScriptPane extends BasicBeanPane } } - protected int getChartParaType() { - return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; - } - - protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); - } - - protected boolean needRenamePane(){ - return plot != null && plot.isNeedRenameHyperLinkPane(); - } - @Override - protected String title4PopupWindow() { + public String title4PopupWindow() { return Inter.getLocText("JavaScript-Dynamic_Parameters"); } 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 5edcf38f3..ff4d9da85 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 @@ -7,12 +7,9 @@ import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chart.web.ChartHyperPoplink; -import com.fr.design.beans.BasicBeanPane; import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.editor.ValueEditorPaneFactory; -import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.ChartHyperEditPane; import com.fr.design.module.DesignModuleFactory; @@ -27,25 +24,21 @@ import java.awt.*; * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2011-12-28 上午10:41:39 */ -public class ChartHyperPoplinkPane extends BasicBeanPane { +public class ChartHyperPoplinkPane extends AbstractHyperLinkPane { private static final long serialVersionUID = 2469115951510144738L; private static final int EDIT_PANE_WIDTH = 248; 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; + super(plot); this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); if(this.needRenamePane()){ @@ -86,21 +79,9 @@ public class ChartHyperPoplinkPane extends BasicBeanPane { } return cc; } - - protected int getChartParaType() { - return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; - } - - protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); - } - - protected boolean needRenamePane(){ - return plot != null && plot.isNeedRenameHyperLinkPane(); - } @Override - protected String title4PopupWindow() { + public String title4PopupWindow() { return Inter.getLocText("FR-Chart-Pop_Chart"); } 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 be7b2ce60..e286e610f 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 @@ -3,13 +3,10 @@ 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; -import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.gui.columnrow.ColumnRowVerticalPane; import com.fr.design.gui.frpane.ReportletParameterViewPane; -import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; @@ -25,25 +22,19 @@ import java.util.List; * @version 创建时间:2011-12-28 下午02:51:10 * 类说明: 图表超链 -- 关联单元格图表. */ -public class ChartHyperRelateCellLinkPane extends BasicBeanPane{ +public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane { private static final long serialVersionUID = 7874948047886548990L; private UITextField itemNameTextField; private ColumnRowVerticalPane colRowPane; private ReportletParameterViewPane parameterViewPane; - private BasePlot plot; - - protected BasePlot getPlot() { - return plot; - } - public ChartHyperRelateCellLinkPane() { this.initComponent(); } public ChartHyperRelateCellLinkPane(BasePlot plot) { - this.plot = plot; + super(plot); this.initComponent(); } @@ -67,18 +58,6 @@ public class ChartHyperRelateCellLinkPane extends BasicBeanPane { +public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane { private static final long serialVersionUID = -3308412003405587689L; private UITextField itemNameTextField; private UIComboBox floatNameBox; - private ReportletParameterViewPane parameterViewPane; - private BasePlot plot; - - protected BasePlot getPlot() { - return plot; - } - public ChartHyperRelateFloatLinkPane() { this.initComponent(); } public ChartHyperRelateFloatLinkPane(BasePlot plot) { - - this.plot = plot; + super(plot); this.initComponent(); } @@ -86,18 +75,6 @@ public class ChartHyperRelateFloatLinkPane extends BasicBeanPane { - private BasePlot plot; +public class FormHyperlinkPane extends AbstractHyperLinkPane { - private ReportletParameterViewPane parameterViewPane; private FormHyperlinkNorthPane northPane; - protected BasePlot getPlot() { - return plot; - } public FormHyperlinkPane(BasePlot plot) { - super(); - this.plot = plot; + super(plot); this.initComponents(); } @@ -51,21 +43,9 @@ public class FormHyperlinkPane extends BasicBeanPane { } @Override - protected String title4PopupWindow() { + public String title4PopupWindow() { return Inter.getLocText("Hyperlink-Form_link"); } - - protected int getChartParaType() { - return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; - } - - protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); - } - - protected boolean needRenamePane(){ - return plot != null && plot.isNeedRenameHyperLinkPane(); - } protected int getHyperlinkType() { if (northPane.getEditingEditor() != null){ 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 0fbeb752f..18d147805 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java @@ -1,5 +1,6 @@ package com.fr.plugin.chart.custom.component; +import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperRelateCellLink; @@ -75,7 +76,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { protected BasicBeanPane createPaneByCreators(NameableCreator creator) { Constructor constructor = null; try { - constructor = creator.getUpdatePane().getConstructor(Plot.class); + constructor = creator.getUpdatePane().getConstructor(BasePlot.class); return constructor.newInstance(plot); } catch (InstantiationException e) { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java index c660d1750..a8a1e568c 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java @@ -1,5 +1,6 @@ package com.fr.plugin.chart.designer.component; +import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; @@ -11,9 +12,9 @@ import java.lang.reflect.Constructor; * Created by hufan on 2016/11/15. */ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { - private Plot plot; + private BasePlot plot; - public ChartUIMenuNameableCreator(Plot plot, String name, Object obj, Class paneClazz) { + public ChartUIMenuNameableCreator(BasePlot plot, String name, Object obj, Class paneClazz) { super(name, obj, paneClazz); this.plot = plot; } From a672e057efd730c67cc5faf3ba6997c6189453dd Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 11:31:21 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E6=8A=BD=E8=B1=A1=E5=87=BA=E6=8A=BD?= =?UTF-8?q?=E8=B1=A1=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{AbstractHyperlinkPane.java => AbstractHyperLinkPane.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename designer_base/src/com/fr/design/hyperlink/{AbstractHyperlinkPane.java => AbstractHyperLinkPane.java} (100%) diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java similarity index 100% rename from designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java rename to designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java From d71a0278d817b5ebe1c6ebedd7f97e8fad237f7c Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 12:11:02 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E6=8A=BD=E8=B1=A1=E5=87=BA=E6=8A=BD?= =?UTF-8?q?=E8=B1=A1=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/editor/ValueEditorPaneFactory.java | 23 ++++++++----------- .../hyperlink/AbstractHyperLinkPane.java | 19 +++++++-------- .../hyperlink/ReportletHyperlinkPane.java | 6 ++--- .../fr/design/hyperlink/WebHyperlinkPane.java | 6 ++--- .../design/javascript/JavaScriptImplPane.java | 6 ++--- .../javascript/ParameterJavaScriptPane.java | 6 ++--- .../impl/ChartHyperPoplinkPane.java | 6 ++--- .../impl/ChartHyperRelateCellLinkPane.java | 6 ++--- .../impl/ChartHyperRelateFloatLinkPane.java | 6 ++--- .../impl/FormHyperlinkPane.java | 6 ++--- .../other/ChartDesignerInteractivePane.java | 8 ++++--- .../chart/gui/other/ChartInteractivePane.java | 22 ++++++++++-------- .../component/VanChartHyperLinkPane.java | 5 ++-- .../component/ChartUIMenuNameableCreator.java | 14 +++++------ 14 files changed, 68 insertions(+), 71 deletions(-) diff --git a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java index 2da01d896..f9425ec2b 100644 --- a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java +++ b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java @@ -1,7 +1,6 @@ package com.fr.design.editor; import com.fr.base.Formula; -import com.fr.base.chart.BasePlot; import com.fr.design.editor.editor.BooleanEditor; import com.fr.design.editor.editor.ColumnRowEditor; import com.fr.design.editor.editor.ColumnRowGroupEditor; @@ -202,24 +201,24 @@ public class ValueEditorPaneFactory { return createVallueEditorPaneWithUseType(paraUseType, null); } - public static ValueEditorPane createVallueEditorPaneWithUseType(int paraUseType, BasePlot plot) { + public static ValueEditorPane createVallueEditorPaneWithUseType(int paraUseType, HashMap hyperLinkEditorMap) { if (paraUseType == ParameterTableModel.NO_CHART_USE) { return createBasicValueEditorPane(); } else if (paraUseType == ParameterTableModel.FORM_NORMAL_USE) { return createFormEditorPane(); } else { - return createChartHotValueEditorPane(plot); + return createChartHotValueEditorPane(hyperLinkEditorMap); } } /** * 图表用的参数编辑器的ValueEditorPane * - * @param plot plot类型 + * @param hyperLinkEditorMap 超链下拉参数类型 * @return 值编辑器 */ - public static ValueEditorPane createChartHotValueEditorPane(BasePlot plot) { - return createValueEditorPane(chartHotEditors(plot), StringUtils.EMPTY, StringUtils.EMPTY); + public static ValueEditorPane createChartHotValueEditorPane(HashMap hyperLinkEditorMap) { + return createValueEditorPane(chartHotEditors(hyperLinkEditorMap), StringUtils.EMPTY, StringUtils.EMPTY); } /** @@ -446,8 +445,8 @@ public class ValueEditorPaneFactory { * * @return 值编辑器 */ - public static Editor[] chartHotEditors(BasePlot plot) { - List list = createEditors4Chart(plot); + public static Editor[] chartHotEditors(HashMap hyperLinkEditorMap) { + List list = createEditors4Chart(hyperLinkEditorMap); list.add(new TextEditor()); list.add(new IntegerEditor()); @@ -467,14 +466,12 @@ public class ValueEditorPaneFactory { * * @return 值编辑器 */ - private static List createEditors4Chart(BasePlot plot) { + private static List createEditors4Chart(HashMap hyperLinkEditorMap) { List lists = new ArrayList(); - if (plot == null) { + if (hyperLinkEditorMap == null) { return lists; } - HashMap map = plot.getHyperLinkEditorMap(); - - Iterator> entries = map.entrySet().iterator(); + Iterator> entries = hyperLinkEditorMap.entrySet().iterator(); while (entries.hasNext()) { Map.Entry entry = entries.next(); ConstantsEditor editor = new ConstantsEditor(entry.getKey(), entry.getValue()); diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java index 2b06f0c78..8629c60d4 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java @@ -1,6 +1,5 @@ package com.fr.design.hyperlink; -import com.fr.base.chart.BasePlot; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; @@ -8,25 +7,23 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.js.JavaScript; +import java.util.HashMap; + /** * Created by mengao on 2017/10/12. */ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { - private BasePlot plot; + private HashMap hyperLinkEditorMap; protected ReportletParameterViewPane parameterViewPane; - public AbstractHyperLinkPane(BasePlot plot) { - this.plot = plot; + public AbstractHyperLinkPane(HashMap hyperLinkEditorMap) { + this.hyperLinkEditorMap = hyperLinkEditorMap; } public AbstractHyperLinkPane() { } - public BasePlot getPlot() { - return plot; - } - public ReportletParameterViewPane getParameterViewPane() { return parameterViewPane; } @@ -42,15 +39,15 @@ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { public void reset() {} protected int getChartParaType() { - return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; + return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; } protected ValueEditorPane getValueEditorPane() { - return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); + return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), hyperLinkEditorMap); } protected boolean needRenamePane(){ - return plot != null && plot.isNeedRenameHyperLinkPane(); + return false; } } diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 689fce0e0..51d8069ec 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -2,7 +2,6 @@ package com.fr.design.hyperlink; import com.fr.base.BaseUtils; import com.fr.base.Parameter; -import com.fr.base.chart.BasePlot; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -19,14 +18,15 @@ import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; +import java.util.HashMap; import java.util.List; public class ReportletHyperlinkPane extends AbstractHyperLinkPane { private ReporletHyperNorthPane northPane; private UICheckBox extendParametersCheckBox; - public ReportletHyperlinkPane(BasePlot plot) { - super(plot); + public ReportletHyperlinkPane(HashMap hyperLinkEditorMap) { + super(hyperLinkEditorMap); this.initComponents(); } diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index b6514dccf..6860b7ac6 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -1,7 +1,6 @@ package com.fr.design.hyperlink; import com.fr.base.Parameter; -import com.fr.base.chart.BasePlot; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -13,6 +12,7 @@ import com.fr.stable.ParameterProvider; import javax.swing.*; import java.awt.*; +import java.util.HashMap; import java.util.List; public class WebHyperlinkPane extends AbstractHyperLinkPane { @@ -27,8 +27,8 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane { this.initComponents(); } - public WebHyperlinkPane(BasePlot plot) { - super(plot); + public WebHyperlinkPane(HashMap hyperLinkEditorMap) { + super(hyperLinkEditorMap); this.initComponents(); } diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java index 31a24f845..31ef73254 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java @@ -1,7 +1,6 @@ package com.fr.design.javascript; import com.fr.base.Parameter; -import com.fr.base.chart.BasePlot; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -21,6 +20,7 @@ import javax.swing.*; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import java.awt.*; +import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -36,8 +36,8 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { this(new String[0]); } - public JavaScriptImplPane(BasePlot plot) { - super(plot); + public JavaScriptImplPane(HashMap hyperLinkEditorMap) { + super(hyperLinkEditorMap); this.defaultArgs = new String[0]; initComponents(); } diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index 3e03d4abc..fda398d49 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -1,7 +1,6 @@ package com.fr.design.javascript; import com.fr.base.Parameter; -import com.fr.base.chart.BasePlot; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itextfield.UITextField; @@ -12,6 +11,7 @@ import com.fr.js.ParameterJavaScript; import com.fr.stable.ParameterProvider; import java.awt.*; +import java.util.HashMap; import java.util.List; public class ParameterJavaScriptPane extends AbstractHyperLinkPane { @@ -22,8 +22,8 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane { private FormHyperlinkNorthPane northPane; - public FormHyperlinkPane(BasePlot plot) { - super(plot); + public FormHyperlinkPane(HashMap hyperLinkEditorMap) { + super(hyperLinkEditorMap); this.initComponents(); } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java index 416a70238..0ca4c66e0 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java @@ -4,6 +4,7 @@ package com.fr.design.mainframe.chart.gui.other; +import com.fr.base.Formula; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartdata.TopDefinition; import com.fr.design.mainframe.chart.gui.ChartOtherPane; @@ -30,11 +31,12 @@ public class ChartDesignerInteractivePane extends ChartInteractivePane { protected List refreshList(HashMap map) { List list = new ArrayList(); + java.util.HashMap hyperLinkEditorMap = plot.getHyperLinkEditorMap(); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Hyperlink-Web_link"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Hyperlink-Web_link"), new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(plot,"JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("RelatedChart"),null,null)); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap,"JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("RelatedChart"),null,null)); return list; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java index 66efccb84..591bfc9cd 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.chart.gui.other; import com.fr.base.CoreDecimalFormat; +import com.fr.base.Formula; import com.fr.base.Style; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.base.AttrContents; @@ -685,7 +686,7 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb NameJavaScript javaScript = nameGroup.getNameHyperlink(i); if(javaScript != null && javaScript.getJavaScript() != null) { JavaScript script = javaScript.getJavaScript(); - hyperList.add(new ChartUIMenuNameableCreator(plot, javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); + hyperList.add(new ChartUIMenuNameableCreator(plot.getHyperLinkEditorMap(), javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); } } @@ -857,25 +858,26 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb protected List refreshList(HashMap map) { List list = new ArrayList(); + java.util.HashMap hyperLinkEditorMap = plot.getHyperLinkEditorMap(); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Reportlet"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Reportlet"), new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Web"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Web"), new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Dynamic_Parameters"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Dynamic_Parameters"), new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class))); - list.add(new ChartUIMenuNameableCreator(plot, "JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, "JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Float_Chart"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Float_Chart"), new ChartHyperPoplink(), getUseMap(map, ChartHyperPoplink.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Cell"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Cell"), new ChartHyperRelateCellLink(), getUseMap(map, ChartHyperRelateCellLink.class))); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Float"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Float"), new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class))); FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); - list.add(new ChartUIMenuNameableCreator(plot, Inter.getLocText("Chart-Link_Form"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Form"), hyperlink, getUseMap(map, FormHyperlinkProvider.class))); return list; diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java index 18d147805..125adfc6b 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java @@ -1,6 +1,5 @@ package com.fr.plugin.chart.custom.component; -import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperRelateCellLink; @@ -76,8 +75,8 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { protected BasicBeanPane createPaneByCreators(NameableCreator creator) { Constructor constructor = null; try { - constructor = creator.getUpdatePane().getConstructor(BasePlot.class); - return constructor.newInstance(plot); + constructor = creator.getUpdatePane().getConstructor(HashMap.class); + return constructor.newInstance(plot.getHyperLinkEditorMap()); } catch (InstantiationException e) { throw new RuntimeException(e); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java index a8a1e568c..828fbaf1f 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java @@ -1,22 +1,22 @@ package com.fr.plugin.chart.designer.component; -import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.general.FRLogger; import java.lang.reflect.Constructor; +import java.util.HashMap; /** * Created by hufan on 2016/11/15. */ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { - private BasePlot plot; + private HashMap hyperLinkEditorMap; - public ChartUIMenuNameableCreator(BasePlot plot, String name, Object obj, Class paneClazz) { + public ChartUIMenuNameableCreator(HashMap hyperLinkEditorMap, String name, Object obj, Class paneClazz) { super(name, obj, paneClazz); - this.plot = plot; + this.hyperLinkEditorMap = hyperLinkEditorMap; } public UIMenuNameableCreator clone() { @@ -28,15 +28,15 @@ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { } catch (IllegalAccessException e) { FRLogger.getLogger().error("UIMenuNameableCreator IllegalAccessException"); } - return new ChartUIMenuNameableCreator(plot, name, cloneObj, (Class) this.paneClazz); + return new ChartUIMenuNameableCreator(hyperLinkEditorMap, name, cloneObj, (Class) this.paneClazz); } public BasicBeanPane getPane() { try { - if (plot != null) { + if (hyperLinkEditorMap != null) { Constructor constructor = paneClazz.getConstructor(Plot.class); - return constructor.newInstance(plot); + return constructor.newInstance(hyperLinkEditorMap); } } catch (Exception e) { return super.getPane(); From d822ea7665a15fcb98a72d4f044aab23df1a42ec Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 13:48:20 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/hyperlink/AbstractHyperLinkPane.java | 5 +++-- .../src/com/fr/design/hyperlink/ReportletHyperlinkPane.java | 4 ++-- .../src/com/fr/design/hyperlink/WebHyperlinkPane.java | 4 ++-- .../src/com/fr/design/javascript/JavaScriptImplPane.java | 4 ++-- .../com/fr/design/javascript/ParameterJavaScriptPane.java | 6 +++--- .../series/SeriesCondition/impl/ChartHyperPoplinkPane.java | 6 +++--- .../SeriesCondition/impl/ChartHyperRelateCellLinkPane.java | 4 ++-- .../SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java | 4 ++-- .../series/SeriesCondition/impl/FormHyperlinkPane.java | 4 ++-- .../chart/custom/component/VanChartHyperLinkPane.java | 4 ++-- .../designer/component/ChartUIMenuNameableCreator.java | 4 ++-- 11 files changed, 25 insertions(+), 24 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java index 8629c60d4..5ed04136c 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java @@ -14,10 +14,11 @@ import java.util.HashMap; */ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { private HashMap hyperLinkEditorMap; + private boolean needRenamePane = false; protected ReportletParameterViewPane parameterViewPane; - public AbstractHyperLinkPane(HashMap hyperLinkEditorMap) { + public AbstractHyperLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { this.hyperLinkEditorMap = hyperLinkEditorMap; } @@ -47,7 +48,7 @@ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { } protected boolean needRenamePane(){ - return false; + return needRenamePane; } } diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 51d8069ec..24fac1482 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -25,8 +25,8 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane { this.initComponents(); } - public WebHyperlinkPane(HashMap hyperLinkEditorMap) { - super(hyperLinkEditorMap); + public WebHyperlinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { + super(hyperLinkEditorMap, needRenamePane); this.initComponents(); } diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java index 31ef73254..a449c89de 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java @@ -36,8 +36,8 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { this(new String[0]); } - public JavaScriptImplPane(HashMap hyperLinkEditorMap) { - super(hyperLinkEditorMap); + public JavaScriptImplPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { + super(hyperLinkEditorMap, needRenamePane); this.defaultArgs = new String[0]; initComponents(); } diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index fda398d49..bc07199ba 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -19,11 +19,11 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane constructor = null; try { - constructor = creator.getUpdatePane().getConstructor(HashMap.class); - return constructor.newInstance(plot.getHyperLinkEditorMap()); + constructor = creator.getUpdatePane().getConstructor(HashMap.class, boolean.class); + return constructor.newInstance(plot.getHyperLinkEditorMap(), false); } catch (InstantiationException e) { throw new RuntimeException(e); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java index 828fbaf1f..3007f31e6 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java @@ -35,8 +35,8 @@ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { public BasicBeanPane getPane() { try { if (hyperLinkEditorMap != null) { - Constructor constructor = paneClazz.getConstructor(Plot.class); - return constructor.newInstance(hyperLinkEditorMap); + Constructor constructor = paneClazz.getConstructor(HashMap.class, boolean.class); + return constructor.newInstance(hyperLinkEditorMap,true); } } catch (Exception e) { return super.getPane(); From 0cddb691bbbf81dcbac94867bb38cee197242953 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 13:49:23 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99impor?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/component/ChartUIMenuNameableCreator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java index 3007f31e6..befd04357 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java @@ -1,6 +1,5 @@ package com.fr.plugin.chart.designer.component; -import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.general.FRLogger; From 370c1dbd136c7eed4719bed3145aa1cbbfb63450 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 13:58:16 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/hyperlink/AbstractHyperLinkPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java index 5ed04136c..7c8cc1b8d 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java @@ -20,6 +20,7 @@ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { public AbstractHyperLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { this.hyperLinkEditorMap = hyperLinkEditorMap; + this.needRenamePane = needRenamePane; } public AbstractHyperLinkPane() { From a6770fbc2f62c02d6fdc734d6067cd3b63eb9701 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 14:02:14 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/AbstractHyperLinkPane.java | 7 +- .../hyperlink/AbstractHyperNorthPane.java | 207 +++---- .../hyperlink/ReporletHyperNorthPane.java | 8 +- .../design/hyperlink/WebHyperNorthPane.java | 116 ++-- .../fr/design/hyperlink/WebHyperlinkPane.java | 171 +++--- .../impl/ChartHyperPoplinkPane.java | 149 ++--- .../impl/ChartHyperRelateCellLinkPane.java | 158 +++--- .../impl/ChartHyperRelateFloatLinkPane.java | 182 +++---- .../impl/FormHyperlinkPane.java | 25 +- .../chart/gui/other/ChartInteractivePane.java | 515 +++++++++--------- 10 files changed, 773 insertions(+), 765 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java index 7c8cc1b8d..bdd46a9ec 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java @@ -34,11 +34,12 @@ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { this.parameterViewPane = parameterViewPane; } - public boolean accept(Object ob){ + public boolean accept(Object ob) { return ob instanceof JavaScript; } - public void reset() {} + public void reset() { + } protected int getChartParaType() { return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; @@ -48,7 +49,7 @@ public abstract class AbstractHyperLinkPane extends FurtherBasicBeanPane { return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), hyperLinkEditorMap); } - protected boolean needRenamePane(){ + protected boolean needRenamePane() { return needRenamePane; } diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java index 6a04ebafb..149fecead 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java @@ -15,130 +15,131 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public abstract class AbstractHyperNorthPane extends BasicBeanPane { - public static final int NEW_WINDOW = 0; - public static final int DIALOG = 1; - public static final int SELF = 2; - public static final int DEFAULT_H_VALUE = 400; - public static final int DEFAULT_V_VALUE = 600; - - private JPanel headerPane; - private UIComboBox targetFrameComboBox; - - private UINumberField heightTextFiled; - private UINumberField widthTextFiled; - - - public AbstractHyperNorthPane() { - this.initComponents(); - } - - protected void initComponents() { - this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - headerPane = this.setHeaderPanel(); - this.add(headerPane, BorderLayout.NORTH); - this.add(centerPane, BorderLayout.CENTER); - targetFrameComboBox = new UIComboBox(getTargetFrames()); - targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - return this; - } - }); - JPanel targetFramePanel = new JPanel(); - targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in"))); - targetFramePanel.add(targetFrameComboBox); - targetFrameComboBox.setEditable(true); - targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); - - final JPanel newWindowConfPane = new JPanel(); - newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); - heightTextFiled = new UINumberField(); + public static final int NEW_WINDOW = 0; + public static final int DIALOG = 1; + public static final int SELF = 2; + public static final int DEFAULT_H_VALUE = 400; + public static final int DEFAULT_V_VALUE = 600; + + private JPanel headerPane; + private UIComboBox targetFrameComboBox; + + private UINumberField heightTextFiled; + private UINumberField widthTextFiled; + + + public AbstractHyperNorthPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + headerPane = this.setHeaderPanel(); + this.add(headerPane, BorderLayout.NORTH); + this.add(centerPane, BorderLayout.CENTER); + targetFrameComboBox = new UIComboBox(getTargetFrames()); + targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + return this; + } + }); + JPanel targetFramePanel = new JPanel(); + targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in"))); + targetFramePanel.add(targetFrameComboBox); + targetFrameComboBox.setEditable(true); + targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); + + final JPanel newWindowConfPane = new JPanel(); + newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); + heightTextFiled = new UINumberField(); heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); - heightTextFiled.setPreferredSize(new Dimension(40, 20)); - newWindowConfPane.add(heightTextFiled); - newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); - widthTextFiled = new UINumberField(); + heightTextFiled.setPreferredSize(new Dimension(40, 20)); + newWindowConfPane.add(heightTextFiled); + newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); + widthTextFiled = new UINumberField(); widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); - widthTextFiled.setPreferredSize(new Dimension(40, 20)); - newWindowConfPane.add(widthTextFiled); + widthTextFiled.setPreferredSize(new Dimension(40, 20)); + newWindowConfPane.add(widthTextFiled); - JPanel centerPanel = new JPanel(new BorderLayout()); - centerPanel.add(targetFramePanel, BorderLayout.WEST); - centerPanel.add(newWindowConfPane, BorderLayout.EAST); + JPanel centerPanel = new JPanel(new BorderLayout()); + centerPanel.add(targetFramePanel, BorderLayout.WEST); + centerPanel.add(newWindowConfPane, BorderLayout.EAST); newWindowConfPane.setVisible(false); - centerPane.add(centerPanel); - targetFrameComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - newWindowConfPane.setVisible(DIALOG == targetFrameComboBox.getSelectedIndex()); - } - }); + centerPane.add(centerPanel); + targetFrameComboBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + newWindowConfPane.setVisible(DIALOG == targetFrameComboBox.getSelectedIndex()); + } + }); - this.add(this.setFootPanel(), BorderLayout.SOUTH); - } - protected String[] getTargetFrames(){ - return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}; - } + this.add(this.setFootPanel(), BorderLayout.SOUTH); + } - protected abstract JPanel setHeaderPanel(); + protected String[] getTargetFrames() { + return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}; + } - protected abstract JPanel setFootPanel(); + protected abstract JPanel setHeaderPanel(); - protected abstract void populateSubHyperlinkBean(T link); + protected abstract JPanel setFootPanel(); - public UIComboBox getTargetFrameComboBox() { - return targetFrameComboBox; - } + protected abstract void populateSubHyperlinkBean(T link); - public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { - this.targetFrameComboBox = targetFrameComboBox; - } + public UIComboBox getTargetFrameComboBox() { + return targetFrameComboBox; + } - public UINumberField getHeightTextFiled() { - return heightTextFiled; - } + public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { + this.targetFrameComboBox = targetFrameComboBox; + } - public void setHeightTextFiled(UINumberField heightTextFiled) { - this.heightTextFiled = heightTextFiled; - } + public UINumberField getHeightTextFiled() { + return heightTextFiled; + } - public UINumberField getWidthTextFiled() { - return widthTextFiled; - } + public void setHeightTextFiled(UINumberField heightTextFiled) { + this.heightTextFiled = heightTextFiled; + } - public void setWidthTextFiled(UINumberField widthTextFiled) { - this.widthTextFiled = widthTextFiled; - } + public UINumberField getWidthTextFiled() { + return widthTextFiled; + } - @Override - public void populateBean(T link) { - String name = link.getTargetFrame(); - targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(name)); - heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); - widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); - populateSubHyperlinkBean(link); - } + public void setWidthTextFiled(UINumberField widthTextFiled) { + this.widthTextFiled = widthTextFiled; + } - protected abstract T updateSubHyperlinkBean(); + @Override + public void populateBean(T link) { + String name = link.getTargetFrame(); + targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(name)); + heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); + widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); + populateSubHyperlinkBean(link); + } - protected abstract void updateSubHyperlinkBean(T t); + protected abstract T updateSubHyperlinkBean(); - @Override - public T updateBean() { - T link = updateSubHyperlinkBean(); + protected abstract void updateSubHyperlinkBean(T t); - updateBean(link); + @Override + public T updateBean() { + T link = updateSubHyperlinkBean(); - return link; - } + updateBean(link); - public void updateBean(T link) { - updateSubHyperlinkBean(link); - link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName()); - link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue()); - link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue()); - } + return link; + } + + public void updateBean(T link) { + updateSubHyperlinkBean(link); + link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName()); + link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue()); + link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue()); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java b/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java index 897148379..b450f6dda 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java @@ -84,11 +84,11 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane { private UITextField itemNameTextField; private boolean needRenamePane = false; - private UITextField urlTextField; + private UITextField urlTextField; - public WebHyperNorthPane(boolean needRenamePane){ + public WebHyperNorthPane(boolean needRenamePane) { this.needRenamePane = needRenamePane; this.inits(); } - public WebHyperNorthPane() { - this.inits(); - } + public WebHyperNorthPane() { + this.inits(); + } - /** - * 初始化 - * - * @date 2014-4-11 - */ - public void inits() { - super.initComponents(); - } + /** + * 初始化 + * + * @date 2014-4-11 + */ + public void inits() { + super.initComponents(); + } - @Override - protected JPanel setHeaderPanel() { - JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + @Override + protected JPanel setHeaderPanel() { + JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel urlPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane(); urlTextField = new UITextField(24); @@ -55,57 +55,57 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane { urlWithHelp.add(GUICoreUtils.createNamedPane(urlPane, "URL:")); //urlWithHelp.add(label); - if(this.needRenamePane){ - headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE,LayoutConstants.VGAP_SMALL)); + if (this.needRenamePane) { + headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_SMALL)); itemNameTextField = new UITextField(); headerPane.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Designer_Name") + ":"), BorderLayout.NORTH); headerPane.add(urlWithHelp, BorderLayout.CENTER); - }else{ + } else { headerPane.add(urlWithHelp, BorderLayout.NORTH); } - return headerPane; - } - - public String getURL() { - return this.urlTextField.getText(); - } - - @Override - protected String title4PopupWindow() { - return "web"; - } - - @Override - protected void populateSubHyperlinkBean(WebHyperlink link) { - String url = link.getURL(); - if (StringUtils.isBlank(url)) { - url = ConfigManager.getProviderInstance().getHyperlinkAddress(); - } - this.urlTextField.setText(url); - if(itemNameTextField != null){ + return headerPane; + } + + public String getURL() { + return this.urlTextField.getText(); + } + + @Override + protected String title4PopupWindow() { + return "web"; + } + + @Override + protected void populateSubHyperlinkBean(WebHyperlink link) { + String url = link.getURL(); + if (StringUtils.isBlank(url)) { + url = ConfigManager.getProviderInstance().getHyperlinkAddress(); + } + this.urlTextField.setText(url); + if (itemNameTextField != null) { this.itemNameTextField.setText(link.getItemName()); } - } - - @Override - protected WebHyperlink updateSubHyperlinkBean() { - WebHyperlink webHyperlink = new WebHyperlink(); - updateSubHyperlinkBean(webHyperlink); - - return webHyperlink; - } - - protected void updateSubHyperlinkBean(WebHyperlink webHyperlink) { - webHyperlink.setURL(this.urlTextField.getText()); - if(itemNameTextField != null){ + } + + @Override + protected WebHyperlink updateSubHyperlinkBean() { + WebHyperlink webHyperlink = new WebHyperlink(); + updateSubHyperlinkBean(webHyperlink); + + return webHyperlink; + } + + protected void updateSubHyperlinkBean(WebHyperlink webHyperlink) { + webHyperlink.setURL(this.urlTextField.getText()); + if (itemNameTextField != null) { webHyperlink.setItemName(this.itemNameTextField.getText()); } - } + } - @Override - protected JPanel setFootPanel() { - return new JPanel(); - } + @Override + protected JPanel setFootPanel() { + return new JPanel(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index 176753bd9..25d698e86 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -16,111 +16,112 @@ import java.util.HashMap; import java.util.List; public class WebHyperlinkPane extends AbstractHyperLinkPane { - private WebHyperNorthPane northPane; + private WebHyperNorthPane northPane; private UICheckBox useCJKCheckBox; - + private UICheckBox extendParametersCheckBox; - public WebHyperlinkPane() { - super(); - this.initComponents(); - } - - public WebHyperlinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { - super(hyperLinkEditorMap, needRenamePane); - this.initComponents(); - } - - protected void initComponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); - - northPane = new WebHyperNorthPane(needRenamePane()); - this.add(northPane, BorderLayout.NORTH); - - parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); - this.add(parameterViewPane, BorderLayout.CENTER); - parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameters"), null)); - - useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter")); + public WebHyperlinkPane() { + super(); + this.initComponents(); + } + + public WebHyperlinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { + super(hyperLinkEditorMap, needRenamePane); + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); + + northPane = new WebHyperNorthPane(needRenamePane()); + this.add(northPane, BorderLayout.NORTH); + + parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); + this.add(parameterViewPane, BorderLayout.CENTER); + parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameters"), null)); + + useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter")); extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters")); - this.add(GUICoreUtils.createFlowPane(new Component[] {useCJKCheckBox, extendParametersCheckBox}, FlowLayout.LEFT), BorderLayout.SOUTH); - } - - @Override - public String title4PopupWindow() { - return Inter.getLocText("Hyperlink-Web_link"); - } - - @Override - public void populateBean(WebHyperlink ob) { - northPane.populateBean(ob); - //parameter - List parameterList = this.parameterViewPane.update(); - parameterList.clear(); - - ParameterProvider[] parameters = ob.getParameters(); - parameterViewPane.populate(parameters); - useCJKCheckBox.setSelected(ob.isUseCJK()); - extendParametersCheckBox.setSelected(ob.isExtendParameters()); - } + this.add(GUICoreUtils.createFlowPane(new Component[]{useCJKCheckBox, extendParametersCheckBox}, FlowLayout.LEFT), BorderLayout.SOUTH); + } @Override - public WebHyperlink updateBean() { - WebHyperlink webHyperlink = new WebHyperlink(); - - updateBean(webHyperlink); - - return webHyperlink; - } - + public String title4PopupWindow() { + return Inter.getLocText("Hyperlink-Web_link"); + } + + @Override + public void populateBean(WebHyperlink ob) { + northPane.populateBean(ob); + //parameter + List parameterList = this.parameterViewPane.update(); + parameterList.clear(); + + ParameterProvider[] parameters = ob.getParameters(); + parameterViewPane.populate(parameters); + useCJKCheckBox.setSelected(ob.isUseCJK()); + extendParametersCheckBox.setSelected(ob.isExtendParameters()); + } + + @Override + public WebHyperlink updateBean() { + WebHyperlink webHyperlink = new WebHyperlink(); + + updateBean(webHyperlink); + + return webHyperlink; + } + public void updateBean(WebHyperlink webHyperlink) { - northPane.updateBean(webHyperlink); - //Parameter. - List parameterList = this.parameterViewPane.update(); - if (!parameterList.isEmpty()) { - Parameter[] parameters = new Parameter[parameterList.size()]; - parameterList.toArray(parameters); - - webHyperlink.setParameters(parameters); - } else { - webHyperlink.setParameters(null); - } - webHyperlink.setUseCJK(this.useCJKCheckBox.isSelected()); - webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected()); + northPane.updateBean(webHyperlink); + //Parameter. + List parameterList = this.parameterViewPane.update(); + if (!parameterList.isEmpty()) { + Parameter[] parameters = new Parameter[parameterList.size()]; + parameterList.toArray(parameters); + + webHyperlink.setParameters(parameters); + } else { + webHyperlink.setParameters(null); + } + webHyperlink.setUseCJK(this.useCJKCheckBox.isSelected()); + webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected()); } - public static class CHART_NO_RENAME extends WebHyperlinkPane{ - protected boolean needRenamePane(){ + public static class CHART_NO_RENAME extends WebHyperlinkPane { + protected boolean needRenamePane() { return false; } + protected int getChartParaType() { return ParameterTableModel.CHART_NORMAL_USE; } } - public WebHyperNorthPane getNorthPane() { - return northPane; - } + public WebHyperNorthPane getNorthPane() { + return northPane; + } - public void setNorthPane(WebHyperNorthPane northPane) { - this.northPane = northPane; - } + public void setNorthPane(WebHyperNorthPane northPane) { + this.northPane = northPane; + } - public UICheckBox getUseCJKCheckBox() { - return useCJKCheckBox; - } + public UICheckBox getUseCJKCheckBox() { + return useCJKCheckBox; + } - public void setUseCJKCheckBox(UICheckBox useCJKCheckBox) { - this.useCJKCheckBox = useCJKCheckBox; - } + public void setUseCJKCheckBox(UICheckBox useCJKCheckBox) { + this.useCJKCheckBox = useCJKCheckBox; + } - public UICheckBox getExtendParametersCheckBox() { - return extendParametersCheckBox; - } + public UICheckBox getExtendParametersCheckBox() { + return extendParametersCheckBox; + } - public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) { - this.extendParametersCheckBox = extendParametersCheckBox; - } + public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) { + this.extendParametersCheckBox = extendParametersCheckBox; + } } \ No newline at end of file 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 2556412b1..d1ddd235d 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 @@ -20,115 +20,116 @@ import java.awt.*; import java.util.HashMap; /** - * 类说明: 图表超链 -- 弹出 悬浮窗. + * 类说明: 图表超链 -- 弹出 悬浮窗. + * * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2011-12-28 上午10:41:39 */ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane { - private static final long serialVersionUID = 2469115951510144738L; - private static final int EDIT_PANE_WIDTH = 248; - private UITextField itemNameTextField; - private ChartHyperEditPane hyperEditPane; - private ChartComponent chartComponent; + private static final long serialVersionUID = 2469115951510144738L; + private static final int EDIT_PANE_WIDTH = 248; + private UITextField itemNameTextField; + private ChartHyperEditPane hyperEditPane; + private ChartComponent chartComponent; + public ChartHyperPoplinkPane() { + this(null, false); + } - public ChartHyperPoplinkPane() { - this(null, false); - } - - public ChartHyperPoplinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { - super(hyperLinkEditorMap, needRenamePane); - this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); + public ChartHyperPoplinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { + super(hyperLinkEditorMap, needRenamePane); + this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - if(this.needRenamePane()){ + if (this.needRenamePane()) { itemNameTextField = new UITextField(); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH); } - hyperEditPane = new ChartHyperEditPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); - hyperEditPane.setPreferredSize(new Dimension(EDIT_PANE_WIDTH, (int)hyperEditPane.getPreferredSize().getHeight()));// 固定属性配置面板大小,灵活调整图表显示面板. - this.add(hyperEditPane, BorderLayout.WEST); + hyperEditPane = new ChartHyperEditPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); + hyperEditPane.setPreferredSize(new Dimension(EDIT_PANE_WIDTH, (int) hyperEditPane.getPreferredSize().getHeight()));// 固定属性配置面板大小,灵活调整图表显示面板. + this.add(hyperEditPane, BorderLayout.WEST); ChartCollection cc = createChartCollection(); - - chartComponent = new ChartComponent(); - chartComponent.setPreferredSize(new Dimension((int)this.getPreferredSize().getWidth()-EDIT_PANE_WIDTH, 170));// 在单元格弹出时 需要调整保证属性表的大小. - chartComponent.setSupportEdit(false); - chartComponent.populate(cc); - - this.add(chartComponent, BorderLayout.CENTER); - - hyperEditPane.populate(cc); - - hyperEditPane.useChartComponent(chartComponent); - } + + chartComponent = new ChartComponent(); + chartComponent.setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth() - EDIT_PANE_WIDTH, 170));// 在单元格弹出时 需要调整保证属性表的大小. + chartComponent.setSupportEdit(false); + chartComponent.populate(cc); + + this.add(chartComponent, BorderLayout.CENTER); + + hyperEditPane.populate(cc); + + hyperEditPane.useChartComponent(chartComponent); + } private ChartCollection createChartCollection() { ChartCollection cc = new ChartCollection(); Chart chart = ChartTypeManager.getFirstChart(); - if (chart != null){ + if (chart != null) { try { - cc.addChart((Chart)chart.clone()); + cc.addChart((Chart) chart.clone()); } catch (CloneNotSupportedException e) { FRLogger.getLogger().error(e.getMessage(), e); } - }else { + } else { cc.addChart(new Chart(new Bar2DPlot())); } return cc; } - - @Override - public String title4PopupWindow() { - return Inter.getLocText("FR-Chart-Pop_Chart"); - } - - @Override - public void populateBean(ChartHyperPoplink chartHyperlink) { - if(itemNameTextField != null){ + + @Override + public String title4PopupWindow() { + return Inter.getLocText("FR-Chart-Pop_Chart"); + } + + @Override + public void populateBean(ChartHyperPoplink chartHyperlink) { + if (itemNameTextField != null) { this.itemNameTextField.setText(chartHyperlink.getItemName()); } - BaseChartCollection cc = chartHyperlink.getChartCollection(); - if (cc == null || cc.getChartCount() < 1) { - cc = createChartCollection(); - chartHyperlink.setChartCollection(cc); - } - - hyperEditPane.populateHyperLink(chartHyperlink); - chartComponent.populate(cc); - } - - /** - * 超链数组HyperlinkGoup切换时 updateBean. - * @return 返回的弹出超链. - */ - public ChartHyperPoplink updateBean() { - ChartHyperPoplink chartLink = new ChartHyperPoplink(); - updateBean(chartLink); - if(itemNameTextField != null){ + BaseChartCollection cc = chartHyperlink.getChartCollection(); + if (cc == null || cc.getChartCount() < 1) { + cc = createChartCollection(); + chartHyperlink.setChartCollection(cc); + } + + hyperEditPane.populateHyperLink(chartHyperlink); + chartComponent.populate(cc); + } + + /** + * 超链数组HyperlinkGoup切换时 updateBean. + * + * @return 返回的弹出超链. + */ + public ChartHyperPoplink updateBean() { + ChartHyperPoplink chartLink = new ChartHyperPoplink(); + updateBean(chartLink); + if (itemNameTextField != null) { chartLink.setItemName(this.itemNameTextField.getText()); } - return chartLink; - } - - /** - * 属性表 对应update - */ - public void updateBean(ChartHyperPoplink chartHyperlink) { - hyperEditPane.updateHyperLink(chartHyperlink); - chartHyperlink.setChartCollection(chartComponent.update()); - - DesignModuleFactory.getChartPropertyPane().getChartEditPane().fire();// 响应整个图表保存事件等. - if(itemNameTextField != null){ + return chartLink; + } + + /** + * 属性表 对应update + */ + public void updateBean(ChartHyperPoplink chartHyperlink) { + hyperEditPane.updateHyperLink(chartHyperlink); + chartHyperlink.setChartCollection(chartComponent.update()); + + DesignModuleFactory.getChartPropertyPane().getChartEditPane().fire();// 响应整个图表保存事件等. + if (itemNameTextField != null) { chartHyperlink.setItemName(this.itemNameTextField.getText()); } - } + } - public static class CHART_NO_RENAME extends ChartHyperPoplinkPane{ - protected boolean needRenamePane(){ + public static class CHART_NO_RENAME extends ChartHyperPoplinkPane { + protected boolean needRenamePane() { return false; } } 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 2429430aa..0904957c7 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 @@ -20,104 +20,104 @@ import java.util.List; /** * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2011-12-28 下午02:51:10 - * 类说明: 图表超链 -- 关联单元格图表. + * 类说明: 图表超链 -- 关联单元格图表. */ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane { - private static final long serialVersionUID = 7874948047886548990L; + private static final long serialVersionUID = 7874948047886548990L; private UITextField itemNameTextField; - private ColumnRowVerticalPane colRowPane; - private ReportletParameterViewPane parameterViewPane; + private ColumnRowVerticalPane colRowPane; + private ReportletParameterViewPane parameterViewPane; - public ChartHyperRelateCellLinkPane() { - this.initComponent(); - } + public ChartHyperRelateCellLinkPane() { + this.initComponent(); + } - public ChartHyperRelateCellLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { - super(hyperLinkEditorMap, needRenamePane); - this.initComponent(); - } + public ChartHyperRelateCellLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { + super(hyperLinkEditorMap, needRenamePane); + this.initComponent(); + } - private void initComponent() { - this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - if(needRenamePane()){ + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); + if (needRenamePane()) { itemNameTextField = new UITextField(); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); } - JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - this.add(centerPane, BorderLayout.CENTER); - - centerPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Related", "Cell"}))); - - colRowPane = new ColumnRowVerticalPane(); - centerPane.add(colRowPane, BorderLayout.NORTH); - - parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); - parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"))); - parameterViewPane.setPreferredSize(new Dimension(500, 200)); - this.add(parameterViewPane, BorderLayout.SOUTH); - } - - @Override - public void populateBean(ChartHyperRelateCellLink ob) { - if(ob == null) { - return; - } - if(itemNameTextField != null){ + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + this.add(centerPane, BorderLayout.CENTER); + + centerPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Related", "Cell"}))); + + colRowPane = new ColumnRowVerticalPane(); + centerPane.add(colRowPane, BorderLayout.NORTH); + + parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); + parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"))); + parameterViewPane.setPreferredSize(new Dimension(500, 200)); + this.add(parameterViewPane, BorderLayout.SOUTH); + } + + @Override + public void populateBean(ChartHyperRelateCellLink ob) { + if (ob == null) { + return; + } + if (itemNameTextField != null) { itemNameTextField.setText(ob.getItemName()); } - if(ob.getRelateCCName() != null) { - ColumnRow colRow = ColumnRow.valueOf(ob.getRelateCCName()); - colRowPane.populate(colRow); - } else { - colRowPane.populate(ColumnRow.valueOf("A1")); - } - - List parameterList = this.parameterViewPane.update(); - parameterList.clear(); - - ParameterProvider[] parameters = ob.getParameters(); - parameterViewPane.populate(parameters); - } - - @Override - public ChartHyperRelateCellLink updateBean() { - ChartHyperRelateCellLink chartLink = new ChartHyperRelateCellLink(); - updateBean(chartLink); - if(itemNameTextField != null){ + if (ob.getRelateCCName() != null) { + ColumnRow colRow = ColumnRow.valueOf(ob.getRelateCCName()); + colRowPane.populate(colRow); + } else { + colRowPane.populate(ColumnRow.valueOf("A1")); + } + + List parameterList = this.parameterViewPane.update(); + parameterList.clear(); + + ParameterProvider[] parameters = ob.getParameters(); + parameterViewPane.populate(parameters); + } + + @Override + public ChartHyperRelateCellLink updateBean() { + ChartHyperRelateCellLink chartLink = new ChartHyperRelateCellLink(); + updateBean(chartLink); + if (itemNameTextField != null) { chartLink.setItemName(this.itemNameTextField.getText()); } - return chartLink; - } - - /** - * 属性表 对应update - */ - public void updateBean(ChartHyperRelateCellLink chartLink) { - chartLink.setRelateCCName(Utils.objectToString(colRowPane.update())); - - List parameterList = this.parameterViewPane.update(); - if (parameterList != null && !parameterList.isEmpty()) { - ParameterProvider[] parameters = new ParameterProvider[parameterList.size()]; - parameterList.toArray(parameters); - - chartLink.setParameters(parameters); - } else { - chartLink.setParameters(null); - } - if(itemNameTextField != null){ + return chartLink; + } + + /** + * 属性表 对应update + */ + public void updateBean(ChartHyperRelateCellLink chartLink) { + chartLink.setRelateCCName(Utils.objectToString(colRowPane.update())); + + List parameterList = this.parameterViewPane.update(); + if (parameterList != null && !parameterList.isEmpty()) { + ParameterProvider[] parameters = new ParameterProvider[parameterList.size()]; + parameterList.toArray(parameters); + + chartLink.setParameters(parameters); + } else { + chartLink.setParameters(null); + } + if (itemNameTextField != null) { chartLink.setItemName(this.itemNameTextField.getText()); } - } + } - @Override - public String title4PopupWindow() { - return Inter.getLocText(new String[]{"Related", "Cell"}); - } + @Override + public String title4PopupWindow() { + return Inter.getLocText(new String[]{"Related", "Cell"}); + } - public static class CHART_NO_RENAME extends ChartHyperRelateCellLinkPane{ - protected boolean needRenamePane(){ + public static class CHART_NO_RENAME extends ChartHyperRelateCellLinkPane { + protected boolean needRenamePane() { return false; } } diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java index c26b4d131..e12f08ed1 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java @@ -25,120 +25,120 @@ import java.util.List; /** * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2011-12-28 下午03:02:43 - * 类说明: 图表超链 关联悬浮元素 + * 类说明: 图表超链 关联悬浮元素 */ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane { - private static final long serialVersionUID = -3308412003405587689L; + private static final long serialVersionUID = -3308412003405587689L; private UITextField itemNameTextField; - private UIComboBox floatNameBox; + private UIComboBox floatNameBox; - public ChartHyperRelateFloatLinkPane() { - this.initComponent(); - } + public ChartHyperRelateFloatLinkPane() { + this.initComponent(); + } + + public ChartHyperRelateFloatLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { + super(hyperLinkEditorMap, needRenamePane); + this.initComponent(); + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); - public ChartHyperRelateFloatLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { - super(hyperLinkEditorMap, needRenamePane); - this.initComponent(); - } - - private void initComponent() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - - JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - if(needRenamePane()){ + if (needRenamePane()) { itemNameTextField = new UITextField(); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); } - this.add(centerPane, BorderLayout.CENTER); - floatNameBox = new UIComboBox(getFloatNames()); - floatNameBox.setPreferredSize(new Dimension(90, 20)); - - JPanel pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); - pane.add(new UILabel(Inter.getLocText("M_Insert-Float") + ":")); - pane.add(floatNameBox); - - Border boder = new LineBorder(UIConstants.TITLED_BORDER_COLOR); - Font font = null; - TitledBorder border = new TitledBorder(boder, Inter.getLocText(new String[]{"Related", "M_Insert-Float"}), 4, 2, font, new Color(1, 159, 222)); - // 圆角不行 - centerPane.setBorder(border); - - centerPane.add(pane, BorderLayout.NORTH); - - parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); - parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"))); - parameterViewPane.setPreferredSize(new Dimension(500, 200)); - this.add(parameterViewPane, BorderLayout.SOUTH); - } - - private String[] getFloatNames() { - DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); - if(adapter != null ) { - return adapter.getFloatNames(); - } - return new String[0]; - } - - @Override - public void populateBean(ChartHyperRelateFloatLink ob) { - if(ob == null) { - return ; - } - - if(itemNameTextField != null){ + this.add(centerPane, BorderLayout.CENTER); + floatNameBox = new UIComboBox(getFloatNames()); + floatNameBox.setPreferredSize(new Dimension(90, 20)); + + JPanel pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); + pane.add(new UILabel(Inter.getLocText("M_Insert-Float") + ":")); + pane.add(floatNameBox); + + Border boder = new LineBorder(UIConstants.TITLED_BORDER_COLOR); + Font font = null; + TitledBorder border = new TitledBorder(boder, Inter.getLocText(new String[]{"Related", "M_Insert-Float"}), 4, 2, font, new Color(1, 159, 222)); + // 圆角不行 + centerPane.setBorder(border); + + centerPane.add(pane, BorderLayout.NORTH); + + parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); + parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"))); + parameterViewPane.setPreferredSize(new Dimension(500, 200)); + this.add(parameterViewPane, BorderLayout.SOUTH); + } + + private String[] getFloatNames() { + DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); + if (adapter != null) { + return adapter.getFloatNames(); + } + return new String[0]; + } + + @Override + public void populateBean(ChartHyperRelateFloatLink ob) { + if (ob == null) { + return; + } + + if (itemNameTextField != null) { itemNameTextField.setText(ob.getItemName()); } - floatNameBox.setSelectedItem(ob.getRelateCCName()); - - List parameterList = this.parameterViewPane.update(); - parameterList.clear(); + floatNameBox.setSelectedItem(ob.getRelateCCName()); - ParameterProvider[] parameters = ob.getParameters(); - parameterViewPane.populate(parameters); - } + List parameterList = this.parameterViewPane.update(); + parameterList.clear(); + + ParameterProvider[] parameters = ob.getParameters(); + parameterViewPane.populate(parameters); + } - @Override - public ChartHyperRelateFloatLink updateBean() { - ChartHyperRelateFloatLink chartLink = new ChartHyperRelateFloatLink(); - updateBean(chartLink); - if(itemNameTextField != null){ + @Override + public ChartHyperRelateFloatLink updateBean() { + ChartHyperRelateFloatLink chartLink = new ChartHyperRelateFloatLink(); + updateBean(chartLink); + if (itemNameTextField != null) { chartLink.setItemName(this.itemNameTextField.getText()); } - return chartLink; - } - - public void updateBean(ChartHyperRelateFloatLink chartLink) { - - if(floatNameBox.getSelectedItem() != null) { - chartLink.setRelateCCName(Utils.objectToString(floatNameBox.getSelectedItem())); - } - - List parameterList = this.parameterViewPane.update(); - if (parameterList != null && !parameterList.isEmpty()) { - ParameterProvider[] parameters = new ParameterProvider[parameterList.size()]; - parameterList.toArray(parameters); - - chartLink.setParameters(parameters); - } else { - chartLink.setParameters(null); - } - if(itemNameTextField != null){ + return chartLink; + } + + public void updateBean(ChartHyperRelateFloatLink chartLink) { + + if (floatNameBox.getSelectedItem() != null) { + chartLink.setRelateCCName(Utils.objectToString(floatNameBox.getSelectedItem())); + } + + List parameterList = this.parameterViewPane.update(); + if (parameterList != null && !parameterList.isEmpty()) { + ParameterProvider[] parameters = new ParameterProvider[parameterList.size()]; + parameterList.toArray(parameters); + + chartLink.setParameters(parameters); + } else { + chartLink.setParameters(null); + } + if (itemNameTextField != null) { chartLink.setItemName(this.itemNameTextField.getText()); } - } + } - @Override - public String title4PopupWindow() { - return Inter.getLocText(new String[]{"Related", "M_Insert-Float"}); - } + @Override + public String title4PopupWindow() { + return Inter.getLocText(new String[]{"Related", "M_Insert-Float"}); + } - public static class CHART_NO_RENAME extends ChartHyperRelateFloatLinkPane{ - protected boolean needRenamePane(){ + public static class CHART_NO_RENAME extends ChartHyperRelateFloatLinkPane { + protected boolean needRenamePane() { return false; } } diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java index 7bb95bcee..5924f89da 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java @@ -46,14 +46,14 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane parameterList = this.parameterViewPane.update(); @@ -92,10 +92,11 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane implements UIObserver{ - private static final long serialVersionUID = 3477409806918835992L; +public class ChartInteractivePane extends BasicScrollPane implements UIObserver { + private static final long serialVersionUID = 3477409806918835992L; private static HashMap normalMap = new HashMap(); private static final int TIME_SWITCH_GAP = 40; - private UICheckBox isChartAnimation;// 动态 + private UICheckBox isChartAnimation;// 动态 private UICheckBox isSeriesDragEnable; //系列拖拽 private UICheckBox isAxisZoom;// 缩放 - private UICheckBox isDatapointValue;// 数据点提示 - private UIButton dataPointValueFormat; + private UICheckBox isDatapointValue;// 数据点提示 + private UIButton dataPointValueFormat; - private UICheckBox isDatapointPercent; - private UIButton dataPointPercentFormat; + private UICheckBox isDatapointPercent; + private UIButton dataPointPercentFormat; private UILabel tooltipStyleLabel; private UIComboBox tooltipStyle; @@ -102,24 +102,24 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb private UICheckBox isAddress; private UICheckBox isAddressName; - private UICheckBox isAxisShowToolTip;// 坐标轴提示 + private UICheckBox isAxisShowToolTip;// 坐标轴提示 - protected UICheckBox isAutoRefresh;// 自动刷新 - protected UISpinner autoRefreshTime; + protected UICheckBox isAutoRefresh;// 自动刷新 + protected UISpinner autoRefreshTime; - private UICorrelationComboBoxPane superLink;// 超链 + private UICorrelationComboBoxPane superLink;// 超链 - private FormatPane valueFormatPane; - private FormatPane percentFormatPane; - private Format valueFormat; - private Format percentFormat; + private FormatPane valueFormatPane; + private FormatPane percentFormatPane; + private Format valueFormat; + private Format percentFormat; - private JPanel tooltipPane; - private JPanel axisShowPane; - private JPanel autoRefreshPane; - private JPanel superlinkPane; + private JPanel tooltipPane; + private JPanel axisShowPane; + private JPanel autoRefreshPane; + private JPanel superlinkPane; - private ChartOtherPane parent; + private ChartOtherPane parent; private UICheckBox timeSwitch; @@ -128,47 +128,49 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb protected Plot plot; - private static final int SIZEX = 258; - private static final int SIZEY = 209; - private static final int DET = 20; - public ChartInteractivePane(ChartOtherPane parent) { - super(); - this.parent = parent; - } + private static final int SIZEX = 258; + private static final int SIZEY = 209; + private static final int DET = 20; - /** - * 界面标题. + public ChartInteractivePane(ChartOtherPane parent) { + super(); + this.parent = parent; + } + + /** + * 界面标题. + * * @return 返回标题. - */ - public String title4PopupWindow() { - return Inter.getLocText("Chart-Interactive_Tab"); - } - - @Override - protected JPanel createContentPane() { - isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow")); + */ + public String title4PopupWindow() { + return Inter.getLocText("Chart-Interactive_Tab"); + } + + @Override + protected JPanel createContentPane() { + isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow")); isSeriesDragEnable = new UICheckBox(Inter.getLocText("Chart-Series_Drag")); - isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value")); - dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format")); - isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent")); - dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format")); - tooltipStyle = new UIComboBox(new String []{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")}); + isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value")); + dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format")); + isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent")); + dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format")); + tooltipStyle = new UIComboBox(new String[]{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")}); tooltipStyleLabel = new UILabel(Inter.getLocText("Chart-Style_Name")); - tooltipShowType = new UIComboBox(new String []{Inter.getLocText("Chart-Series_SingleData"), Inter.getLocText("Chart-Series_AllData")}); + tooltipShowType = new UIComboBox(new String[]{Inter.getLocText("Chart-Series_SingleData"), Inter.getLocText("Chart-Series_AllData")}); tooltipShowTypeLabel = new UILabel(Inter.getLocText("Chart-Use_Show")); isAddressTittle = new UICheckBox(Inter.getLocText("Chart-Area_Title")); isAddress = new UICheckBox(Inter.getLocText("Chart-Gis_Address")); isAddressName = new UICheckBox(Inter.getLocText("Chart-Address_Name")); - isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip")); - isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom")); - isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"})); - autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1); - superLink = new UICorrelationComboBoxPane(); + isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip")); + isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom")); + isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"})); + autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1); + superLink = new UICorrelationComboBoxPane(); - isAutoRefresh.addActionListener(new ActionListener() { + isAutoRefresh.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkAutoRefresh(); @@ -176,9 +178,9 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb }); timeSwitch = new UICheckBox(Inter.getLocText("FR-Chart-Interactive_timeSwitch")); timeSwitchPane = new TimeSwitchPane(); - initFormatListener(); - return initPaneWithListener(); - } + initFormatListener(); + return initPaneWithListener(); + } private void initFormatListener() { @@ -188,7 +190,7 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb @Override public void itemStateChanged(ItemEvent e) { timeSwitch.setEnabled(isAxisZoom.isSelected()); - if(!isAxisZoom.isSelected()){ + if (!isAxisZoom.isSelected()) { timeSwitch.setSelected(false); } } @@ -254,19 +256,20 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb }); } - private void checkAutoRefresh() { - GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected()); - } + private void checkAutoRefresh() { + GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected()); + } - /** - * 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件. - * @return - */ - private JPanel initPaneWithListener() { - initDataPointToolTipPane(); - initAxisShowPane(); - initAutoRefreshPane(); - initSuperlinkPane(); + /** + * 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件. + * + * @return + */ + private JPanel initPaneWithListener() { + initDataPointToolTipPane(); + initAxisShowPane(); + initAutoRefreshPane(); + initSuperlinkPane(); initTimeSwitchPane(); @@ -285,34 +288,33 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb }; //初始化界面时 加载事件 return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } + } - private void initTimeSwitchPane(){ + private void initTimeSwitchPane() { timeSwitchContainer = new JPanel(new BorderLayout()); timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER); } - /** * 全部初始化, 对所有的界面 都加入, 然后会加载事件响应. 后续再relayout. */ - private void initDataPointToolTipPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = new double[]{p, f}; - double[] rowSize = new double[]{p, p, p, p, p, p, p}; + private void initDataPointToolTipPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = new double[]{p, f}; + double[] rowSize = new double[]{p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{isDatapointValue, dataPointValueFormat}, new Component[]{isDatapointPercent, dataPointPercentFormat}, new Component[]{isAddress, null}, - new Component[]{isAddressName,null}, + new Component[]{isAddressName, null}, new Component[]{isAddressTittle, null}, new Component[]{tooltipShowTypeLabel, tooltipShowType}, new Component[]{tooltipStyleLabel, tooltipStyle} }; - tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize); - } + tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize); + } private void relayoutDataPointToolTipPane(Plot plot) { double p = TableLayout.PREFERRED; @@ -320,21 +322,21 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb double[] columnSize = new double[]{p, f}; double[] rowSize = new double[]{p, p}; - if(plot.isShowAllDataPointLabel()) { + if (plot.isShowAllDataPointLabel()) { isDatapointPercent.setText(Inter.getLocText("Chart-Value_Conversion")); } - if(plot.isSupportAddress4Gis()) { + if (plot.isSupportAddress4Gis()) { UIButton tmpButton = new UIButton(); //用来调整对齐 tmpButton.setVisible(false); rowSize = new double[]{p, p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{isAddress, null}, - new Component[]{isAddressName,null}, + new Component[]{isAddressName, null}, new Component[]{isAddressTittle, tmpButton}, new Component[]{isDatapointValue, dataPointValueFormat}, }; - tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize); - } else if(plot.isSupportValuePercent()) { + tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize); + } else if (plot.isSupportValuePercent()) { Component[][] components; if (plot.isSupportTooltipSeriesType()) { rowSize = new double[]{p, p, p, p}; @@ -347,18 +349,18 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb } else { rowSize = new double[]{p, p, p}; components = new Component[][]{ - new Component[]{isDatapointValue, dataPointValueFormat}, - new Component[]{isDatapointPercent, dataPointPercentFormat}, + new Component[]{isDatapointValue, dataPointValueFormat}, + new Component[]{isDatapointPercent, dataPointPercentFormat}, getTooltipStyleComponent() }; } - tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize); + tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize); } else { Component[][] components = new Component[][]{ new Component[]{isDatapointValue, dataPointValueFormat}, getTooltipStyleComponent() }; - tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize); + tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize); } } @@ -369,8 +371,8 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb new Component[]{tooltipShowTypeLabel, tooltipShowType} }; double[] newColumnSize = new double[]{f, p}; - double []newRowSize = new double[]{p}; - return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null}; + double[] newRowSize = new double[]{p}; + return new Component[]{TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null}; } private Component[] getTooltipStyleComponent() { @@ -380,53 +382,53 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb new Component[]{tooltipStyleLabel, tooltipStyle} }; double[] newColumnSize = new double[]{f, p}; - double []newRowSize = new double[]{p}; - return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null}; - } - - private void initAxisShowPane() { - double p = TableLayout.PREFERRED; - double[] columnSize = new double[]{p}; - double[] rowSize = new double[]{p}; - Component[][] components = new Component[][]{ - new Component[]{isAxisShowToolTip}, - }; - axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize); - } - - private void initAutoRefreshPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = new double[]{p, f}; - double[] rowSize = new double[]{p, p, p,p}; - - Component[][] components = new Component[][]{ - new Component[]{isAutoRefresh,null}, - new Component[]{GUICoreUtils.createFlowPane(new Component[]{ - new UILabel(Inter.getLocText("Chart-Time_Interval")), - autoRefreshTime, - new UILabel(Inter.getLocText("Chart-Time_Seconds")) - }, 1)}, + double[] newRowSize = new double[]{p}; + return new Component[]{TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null}; + } + + private void initAxisShowPane() { + double p = TableLayout.PREFERRED; + double[] columnSize = new double[]{p}; + double[] rowSize = new double[]{p}; + Component[][] components = new Component[][]{ + new Component[]{isAxisShowToolTip}, + }; + axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"}, components, rowSize, columnSize); + } + + private void initAutoRefreshPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = new double[]{p, f}; + double[] rowSize = new double[]{p, p, p, p}; + + Component[][] components = new Component[][]{ + new Component[]{isAutoRefresh, null}, + new Component[]{GUICoreUtils.createFlowPane(new Component[]{ + new UILabel(Inter.getLocText("Chart-Time_Interval")), + autoRefreshTime, + new UILabel(Inter.getLocText("Chart-Time_Seconds")) + }, 1)}, new Component[]{new UILabel("" + Inter.getLocText("FR-Chart-AutoRefresh_NotSupportIMGAndReportData") + ""), null}, - }; - autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"},components, rowSize, columnSize); - } - - private void initSuperlinkPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = new double[]{p, f}; - double[] rowSize = new double[]{p}; - Component[][] components = new Component[][]{ - new Component[]{superLink, null}, - - }; - superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize); - } - - private void relayoutWithPlot(Plot plot) { - this.removeAll(); - double p = TableLayout.PREFERRED; + }; + autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"}, components, rowSize, columnSize); + } + + private void initSuperlinkPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = new double[]{p, f}; + double[] rowSize = new double[]{p}; + Component[][] components = new Component[][]{ + new Component[]{superLink, null}, + + }; + superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"}, components, rowSize, columnSize); + } + + private void relayoutWithPlot(Plot plot) { + this.removeAll(); + double p = TableLayout.PREFERRED; double[] columnSize = new double[]{TableLayout.FILL}; double[] rowSize = new double[]{p, p, p}; @@ -441,11 +443,11 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb double[] row = new double[]{p, p, p, p, p, p}; reloaPane(TableLayoutHelper.createTableLayoutPane(components, row, columnSize)); - } + } private Component[] getChartAnimatePane(Plot plot, double[] row, double[] col) { - if(plot.isSupportAnimate() && plot.isSupportSeriesDrag()) { + if (plot.isSupportAnimate() && plot.isSupportSeriesDrag()) { return new Component[]{TableLayoutHelper.createTableLayoutPane( new Component[][]{ new Component[]{isChartAnimation}, @@ -453,7 +455,7 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb new Component[]{new JSeparator()} }, row, col) }; - }else if(plot.isSupportAnimate() && !plot.isSupportSeriesDrag()){ + } else if (plot.isSupportAnimate() && !plot.isSupportSeriesDrag()) { return new Component[]{TableLayoutHelper.createTableLayoutPane( new Component[][]{ new Component[]{isChartAnimation}, @@ -461,36 +463,36 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb }, row, col) }; } - return new Component[]{null}; + return new Component[]{null}; } - private void relayoutTimeSwitchPane(){ + private void relayoutTimeSwitchPane() { timeSwitchContainer.removeAll(); timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER); - if(timeSwitch.isSelected()){ + if (timeSwitch.isSelected()) { double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = new double[]{TIME_SWITCH_GAP,f}; - double[] rowSize = new double[]{p}; + double f = TableLayout.FILL; + double[] columnSize = new double[]{TIME_SWITCH_GAP, f}; + double[] rowSize = new double[]{p}; Component[][] components = new Component[][]{ new Component[]{null, timeSwitchPane}, }; - JPanel panel= TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); timeSwitchContainer.add(panel, BorderLayout.SOUTH); } timeSwitchContainer.revalidate(); } private Component[] getChartScalePane(Plot plot, double[] row, double[] col) { - boolean isNeedTimeSwitch = plot.getxAxis()!=null && plot.getxAxis().isDate(); - if(plot.isSupportZoomCategoryAxis() && !isNeedTimeSwitch) { + boolean isNeedTimeSwitch = plot.getxAxis() != null && plot.getxAxis().isDate(); + if (plot.isSupportZoomCategoryAxis() && !isNeedTimeSwitch) { return new Component[]{TableLayoutHelper.createTableLayoutPane( new Component[][]{ new Component[]{isAxisZoom}, new Component[]{new JSeparator()} }, row, col) }; - }else if(plot.isSupportZoomCategoryAxis() && isNeedTimeSwitch){ + } else if (plot.isSupportZoomCategoryAxis() && isNeedTimeSwitch) { return new Component[]{TableLayoutHelper.createTableLayoutPane( new Component[][]{ new Component[]{isAxisZoom}, @@ -499,29 +501,29 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb }, row, col) }; } - return new Component[]{null}; + return new Component[]{null}; } private Component[] getDataTooltipPane(Plot plot, double[] row, double[] col) { relayoutDataPointToolTipPane(plot); - if(plot.isSupportTooltipInInteractivePane()) { + if (plot.isSupportTooltipInInteractivePane()) { return new Component[]{TableLayoutHelper.createTableLayoutPane(new Component[][]{ new Component[]{tooltipPane}, new Component[]{new JSeparator()}}, row, col)}; } - return new Component[]{null}; + return new Component[]{null}; } private Component[] getAxisTipPane(Plot plot, double[] row, double[] col) { - if(plot.isSupportAxisTip()) { + if (plot.isSupportAxisTip()) { return new Component[]{TableLayoutHelper.createTableLayoutPane(new Component[][]{ new Component[]{axisShowPane}, new Component[]{new JSeparator()}}, row, col)}; } - return new Component[]{null}; + return new Component[]{null}; } private Component[] getAutoRefreshPane(Plot plot, double[] row, double[] col) { - if(plot.isSupportAutoRefresh()) { + if (plot.isSupportAutoRefresh()) { return new Component[]{TableLayoutHelper.createTableLayoutPane( new Component[][]{ new Component[]{autoRefreshPane}, @@ -537,16 +539,16 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb return new Component[]{superlinkPane}; } - @Override - public void populateBean(Chart chart) { - if (chart == null || chart.getPlot() == null) { - return; - } + @Override + public void populateBean(Chart chart) { + if (chart == null || chart.getPlot() == null) { + return; + } - Plot plot = chart.getPlot(); - this.plot =plot; + Plot plot = chart.getPlot(); + this.plot = plot; relayoutWithGis(chart, plot); - relayoutWithPlot(plot); + relayoutWithPlot(plot); populateChartAnimate(chart, plot); populateChartScale(plot); @@ -555,63 +557,63 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb populateAutoRefresh(chart); populateHyperlink(plot); - checkAutoRefresh(); - } + checkAutoRefresh(); + } private void relayoutWithGis(Chart chart, Plot plot) { - if(plot.isSupportAddress4Gis()) { + if (plot.isSupportAddress4Gis()) { TopDefinitionProvider definition = chart.getFilterDefinition(); boolean addressType = true; - if(definition instanceof GisMapTableDefinition){ - addressType = ((GisMapTableDefinition)definition).isAddress(); - }else if(definition instanceof GisMapReportDefinition){ - addressType = ((GisMapReportDefinition)definition).isAddress(); + if (definition instanceof GisMapTableDefinition) { + addressType = ((GisMapTableDefinition) definition).isAddress(); + } else if (definition instanceof GisMapReportDefinition) { + addressType = ((GisMapReportDefinition) definition).isAddress(); } - if(addressType){ + if (addressType) { this.isAddress.setText(Inter.getLocText("Chart-Use_Address")); - }else{ + } else { this.isAddress.setText(Inter.getLocText("Chart-Use_LatLng")); } } } private void populateChartAnimate(Chart chart, Plot plot) { - if(plot.isSupportAnimate()) { + if (plot.isSupportAnimate()) { isChartAnimation.setSelected(chart.isJSDraw()); } - if(plot.isSupportSeriesDrag()){ + if (plot.isSupportSeriesDrag()) { isSeriesDragEnable.setSelected(plot.isSeriesDragEnable()); } } private void populateChartScale(Plot plot) { - if(plot.isSupportZoomCategoryAxis()) { + if (plot.isSupportZoomCategoryAxis()) { isAxisZoom.setSelected(plot.getxAxis() != null && plot.getxAxis().isZoom()); } timeSwitch.setSelected(false); timeSwitch.setEnabled(false); //只有坐标轴为时间坐标轴,并且勾选了图表缩放的时候,才支持时间切换 - if(!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()){ - return; + if (!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()) { + return; } - if(plot.getxAxis() ==null && !plot.getxAxis().isDate()){ + if (plot.getxAxis() == null && !plot.getxAxis().isDate()) { return; } timeSwitch.setEnabled(true); - ArrayList timeMap=plot.getxAxis().getTimeSwitchMap(); + ArrayList timeMap = plot.getxAxis().getTimeSwitchMap(); timeSwitch.setSelected(timeMap != null && !timeMap.isEmpty()); - if(timeSwitch.isSelected()){ + if (timeSwitch.isSelected()) { timeSwitchPane.populate(plot); } } private void populateDataTooltip(Plot plot) { - if(plot.isSupportTooltipInInteractivePane()) { + if (plot.isSupportTooltipInInteractivePane()) { AttrContents contents = plot.getHotTooltipStyle(); if (contents == null) { return; @@ -627,12 +629,12 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb } else { tooltipStyle.setSelectedIndex(1); } - if(plot.isSupportValuePercent()) { + if (plot.isSupportValuePercent()) { percentFormat = contents.getPercentFormat(); isDatapointPercent.setSelected(dataLabel.contains(ChartConstants.PERCENT_PARA)); } - if(plot.isSupportAddress4Gis()) { + if (plot.isSupportAddress4Gis()) { isAddressTittle.setSelected(dataLabel.contains(ChartConstants.AREA_TITTLE_PARA)); isAddress.setSelected(dataLabel.contains(ChartConstants.ADDRESS_PARA)); isAddressName.setSelected(dataLabel.contains(ChartConstants.ADDRESS_NAME_PARA)); @@ -649,14 +651,14 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb } private void populateAxisTip(Plot plot) { - if(plot.isSupportAxisTip()) { + if (plot.isSupportAxisTip()) { isAxisShowToolTip.setSelected(plot.isInteractiveAxisTooltip()); } } protected void populateAutoRefresh(Chart chart) { Plot plot = chart.getPlot(); - if(plot.isSupportAutoRefresh()) { + if (plot.isSupportAutoRefresh()) { if (plot.getAutoRefreshPerSecond() < 1) { isAutoRefresh.setSelected(false); autoRefreshTime.setValue(2); @@ -682,9 +684,9 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb List hyperList = new ArrayList(); NameJavaScriptGroup nameGroup = plot.getHotHyperLink(); - for(int i = 0; nameGroup != null && i < nameGroup.size(); i++) { + for (int i = 0; nameGroup != null && i < nameGroup.size(); i++) { NameJavaScript javaScript = nameGroup.getNameHyperlink(i); - if(javaScript != null && javaScript.getJavaScript() != null) { + if (javaScript != null && javaScript.getJavaScript() != null) { JavaScript script = javaScript.getJavaScript(); hyperList.add(new ChartUIMenuNameableCreator(plot.getHyperLinkEditorMap(), javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); } @@ -694,13 +696,13 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb superLink.doLayout(); } - @Override - public void updateBean(Chart chart) { - if (chart == null || chart.getPlot() == null) { - return; - } + @Override + public void updateBean(Chart chart) { + if (chart == null || chart.getPlot() == null) { + return; + } - Plot plot = chart.getPlot(); + Plot plot = chart.getPlot(); updateChartAnimate(chart, plot); updateChartScale(plot); @@ -708,38 +710,38 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb updateAxisTip(plot); updateAutoRefresh(plot); updateHyperlink(plot); - } + } private void updateChartAnimate(Chart chart, Plot plot) { - if(plot.isSupportAnimate()) { + if (plot.isSupportAnimate()) { chart.setJSDraw(isChartAnimation.isSelected()); } - if(plot.isSupportSeriesDrag()){ + if (plot.isSupportSeriesDrag()) { plot.setSeriesDragEnable(isSeriesDragEnable.isSelected()); } } private void updateChartScale(Plot plot) { - if(plot.isSupportZoomCategoryAxis() && plot.getxAxis() != null) { + if (plot.isSupportZoomCategoryAxis() && plot.getxAxis() != null) { plot.getxAxis().setZoom(isAxisZoom.isSelected()); } - if(plot.getxAxis() == null){ + if (plot.getxAxis() == null) { return; } - boolean isNeedTimeSwitch = plot.getxAxis()!=null && plot.getxAxis().isDate(); - boolean isClear = !isNeedTimeSwitch || !timeSwitch.isSelected(); - if(isClear && plot.getxAxis().getTimeSwitchMap() != null){ + boolean isNeedTimeSwitch = plot.getxAxis() != null && plot.getxAxis().isDate(); + boolean isClear = !isNeedTimeSwitch || !timeSwitch.isSelected(); + if (isClear && plot.getxAxis().getTimeSwitchMap() != null) { plot.getxAxis().getTimeSwitchMap().clear(); return; } - if(plot.getxAxis().isDate() && timeSwitch.isSelected()){ + if (plot.getxAxis().isDate() && timeSwitch.isSelected()) { timeSwitchPane.update(plot); } } private void updateDataTooltip(Plot plot) { - if(plot.isSupportTooltipInInteractivePane()) { + if (plot.isSupportTooltipInInteractivePane()) { AttrContents seriesAttrContents = plot.getHotTooltipStyle(); if (seriesAttrContents == null) { seriesAttrContents = new AttrContents(); @@ -747,18 +749,18 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb String contents = plot.isSupportAddress4Gis() ? getGisTooltipContent() : getTooltipContent(plot); seriesAttrContents.setSeriesLabel(contents); - if(tooltipStyle != null){ + if (tooltipStyle != null) { boolean isWhiteBackground = tooltipStyle.getSelectedIndex() == 0; seriesAttrContents.setWhiteBackground(isWhiteBackground); } - if(tooltipShowType != null){ + if (tooltipShowType != null) { boolean isShowMutiSeries = plot.isSupportTooltipSeriesType() && tooltipShowType.getSelectedIndex() == 1; seriesAttrContents.setShowMutiSeries(isShowMutiSeries); } seriesAttrContents.setFormat(valueFormat); - if(plot.isSupportValuePercent()) { + if (plot.isSupportValuePercent()) { if (percentFormat != null) { seriesAttrContents.setPercentFormat(percentFormat); } @@ -786,23 +788,24 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb String contents = StringUtils.EMPTY; contents += ChartConstants.SERIES_PARA + ChartConstants.BREAKLINE_PARA + ChartConstants.CATEGORY_PARA; boolean noPara = true; - if(isDatapointValue.isSelected()){ + if (isDatapointValue.isSelected()) { contents += ChartConstants.BREAKLINE_PARA + ChartConstants.VALUE_PARA; noPara = false; } - if(isAddressTittle.isSelected()){ + if (isAddressTittle.isSelected()) { contents += ChartConstants.BREAKLINE_PARA + ChartConstants.AREA_TITTLE_PARA; noPara = false; } - if(isAddress.isSelected()){ + if (isAddress.isSelected()) { contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_PARA; noPara = false; } - if(isAddressName.isSelected()){ - contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_NAME_PARA;; + if (isAddressName.isSelected()) { + contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_NAME_PARA; + ; noPara = false; } - if(noPara){ + if (noPara) { contents = null; } @@ -816,8 +819,8 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb } private void updateAutoRefresh(Plot plot) { - if(plot.isSupportAutoRefresh()) { - if(isAutoRefresh.isSelected() && autoRefreshTime.getValue() >= 2) { + if (plot.isSupportAutoRefresh()) { + if (isAutoRefresh.isSelected() && autoRefreshTime.getValue() >= 2) { plot.setAutoRefreshPerSecond((int) autoRefreshTime.getValue()); } else { plot.setAutoRefreshPerSecond(0); @@ -831,62 +834,62 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb superLink.resetItemName(); List list = superLink.updateBean(); - for(int i = 0; i < list.size(); i++) { - UIMenuNameableCreator menu = (UIMenuNameableCreator)list.get(i); - NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj()); + for (int i = 0; i < list.size(); i++) { + UIMenuNameableCreator menu = (UIMenuNameableCreator) list.get(i); + NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript) menu.getObj()); nameGroup.addNameHyperlink(nameJava); } plot.setHotHyperLink(nameGroup); } - protected Class getUseMap(HashMap map, Object key) { - if(map.get(key) != null){ - return (Class)map.get(key); + protected Class getUseMap(HashMap map, Object key) { + if (map.get(key) != null) { + return (Class) map.get(key); } //引擎在这边放了个provider。。 Iterator iterator = map.keySet().iterator(); - while (iterator.hasNext()){ - Class clz = (Class)iterator.next(); - if(clz.isAssignableFrom((Class)key)){ - return (Class)map.get(clz); + while (iterator.hasNext()) { + Class clz = (Class) iterator.next(); + if (clz.isAssignableFrom((Class) key)) { + return (Class) map.get(clz); } } return null; - } - - protected List refreshList(HashMap map) { - List list = new ArrayList(); + } + + protected List refreshList(HashMap map) { + List list = new ArrayList(); java.util.HashMap hyperLinkEditorMap = plot.getHyperLinkEditorMap(); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Reportlet"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Reportlet"), new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Web"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Web"), new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Dynamic_Parameters"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Dynamic_Parameters"), new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class))); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, "JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, "JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Float_Chart"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Float_Chart"), new ChartHyperPoplink(), getUseMap(map, ChartHyperPoplink.class))); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Cell"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Cell"), new ChartHyperRelateCellLink(), getUseMap(map, ChartHyperRelateCellLink.class))); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Float"), + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Float"), new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class))); - - FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); + + FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Form"), - hyperlink, getUseMap(map, FormHyperlinkProvider.class))); - - return list; - } + hyperlink, getUseMap(map, FormHyperlinkProvider.class))); + + return list; + } private HashMap getPlotHyperMap() { - if(normalMap.isEmpty()) { - FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); - + if (normalMap.isEmpty()) { + FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); + normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.class); normalMap.put(EmailJavaScript.class, ChartEmailPane.class); normalMap.put(WebHyperlink.class, WebHyperlinkPane.class); @@ -899,33 +902,33 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb normalMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.class); //兼容老的FormHyperlink.class - if(fp != null){ + if (fp != null) { normalMap.put(fp.getClass(), FormHyperlinkPane.class); } } return normalMap; } - - @Override - public Chart updateBean() { - return null; - } + + @Override + public Chart updateBean() { + return null; + } /** - * 给组件登记一个观察者监听事件 - * - * @param listener 观察者监听事件 - */ + * 给组件登记一个观察者监听事件 + * + * @param listener 观察者监听事件 + */ public void registerChangeListener(UIObserverListener listener) { timeSwitch.registerChangeListener(listener); timeSwitchPane.registerChangeListener(listener); } /** - * 组件是否需要响应添加的观察者事件 - * - * @return 如果需要响应观察者事件则返回true,否则返回false - */ + * 组件是否需要响应添加的观察者事件 + * + * @return 如果需要响应观察者事件则返回true,否则返回false + */ public boolean shouldResponseChangeListener() { return true; } From 6a1ac3880e865fdcc8f5e14c7e1348d5250cb9b6 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 14:15:25 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascript/ParameterJavaScriptPane.java | 63 ++++++++++--------- .../component/VanChartHyperLinkPane.java | 8 ++- .../component/ChartUIMenuNameableCreator.java | 2 +- 3 files changed, 38 insertions(+), 35 deletions(-) diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index bc07199ba..a1129573b 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -18,63 +18,64 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane parameterList = parameterViewPane.update(); - parameter.setParameters(parameterList.toArray(new Parameter[parameterList.size()])); - if(this.itemNameTextField != null){ + List parameterList = parameterViewPane.update(); + parameter.setParameters(parameterList.toArray(new Parameter[parameterList.size()])); + if (this.itemNameTextField != null) { parameter.setItemName(itemNameTextField.getText()); } } - public static class CHART_NO_RENAME extends ParameterJavaScriptPane{ + public static class CHART_NO_RENAME extends ParameterJavaScriptPane { protected int getChartParaType() { return ParameterTableModel.CHART_NORMAL_USE; } - protected boolean needRenamePane(){ + + protected boolean needRenamePane() { return false; } } 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 e46d4d4f9..70808d1c4 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 @@ -22,6 +22,7 @@ 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.FRLogger; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.js.EmailJavaScript; @@ -79,13 +80,13 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { return constructor.newInstance(plot.getHyperLinkEditorMap(), false); } catch (InstantiationException e) { - throw new RuntimeException(e); + FRLogger.getLogger().error(e.getMessage(), e); } catch (IllegalAccessException e) { - throw new RuntimeException(e); + FRLogger.getLogger().error(e.getMessage(), e); } catch (NoSuchMethodException e) { return super.createPaneByCreators(creator); } catch (InvocationTargetException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } return null; } @@ -122,6 +123,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } public void populate(TargetComponent elementCasePane) { + //populate } /** diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java index befd04357..f6f159c57 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java @@ -35,7 +35,7 @@ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { try { if (hyperLinkEditorMap != null) { Constructor constructor = paneClazz.getConstructor(HashMap.class, boolean.class); - return constructor.newInstance(hyperLinkEditorMap,true); + return constructor.newInstance(hyperLinkEditorMap, true); } } catch (Exception e) { return super.getPane(); From f2ef53ee2bbac30c4e880655c75dee7ec6e0d7c4 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 14:48:27 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/other/ChartInteractivePane.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) 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 13dbd5ea7..e5f9a8a7d 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 @@ -449,16 +449,14 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb private Component[] getChartAnimatePane(Plot plot, double[] row, double[] col) { if (plot.isSupportAnimate() && plot.isSupportSeriesDrag()) { return new Component[]{TableLayoutHelper.createTableLayoutPane( - new Component[][]{ - new Component[]{isChartAnimation}, + new Component[][]{new Component[]{isChartAnimation}, new Component[]{isSeriesDragEnable}, new Component[]{new JSeparator()} }, row, col) }; } else if (plot.isSupportAnimate() && !plot.isSupportSeriesDrag()) { return new Component[]{TableLayoutHelper.createTableLayoutPane( - new Component[][]{ - new Component[]{isChartAnimation}, + new Component[][]{new Component[]{isChartAnimation}, new Component[]{new JSeparator()} }, row, col) }; @@ -487,15 +485,13 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb boolean isNeedTimeSwitch = plot.getxAxis() != null && plot.getxAxis().isDate(); if (plot.isSupportZoomCategoryAxis() && !isNeedTimeSwitch) { return new Component[]{TableLayoutHelper.createTableLayoutPane( - new Component[][]{ - new Component[]{isAxisZoom}, + new Component[][]{new Component[]{isAxisZoom}, new Component[]{new JSeparator()} }, row, col) }; } else if (plot.isSupportZoomCategoryAxis() && isNeedTimeSwitch) { return new Component[]{TableLayoutHelper.createTableLayoutPane( - new Component[][]{ - new Component[]{isAxisZoom}, + new Component[][]{new Component[]{isAxisZoom}, new Component[]{timeSwitchContainer}, new Component[]{new JSeparator()} }, row, col) @@ -525,8 +521,7 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb private Component[] getAutoRefreshPane(Plot plot, double[] row, double[] col) { if (plot.isSupportAutoRefresh()) { return new Component[]{TableLayoutHelper.createTableLayoutPane( - new Component[][]{ - new Component[]{autoRefreshPane}, + new Component[][]{new Component[]{autoRefreshPane}, new Component[]{new JSeparator()} }, row, col) }; @@ -760,10 +755,8 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb } seriesAttrContents.setFormat(valueFormat); - if (plot.isSupportValuePercent()) { - if (percentFormat != null) { - seriesAttrContents.setPercentFormat(percentFormat); - } + if (plot.isSupportValuePercent() && percentFormat != null) { + seriesAttrContents.setPercentFormat(percentFormat); } } } From 7f49ecbea43b8936a6ee4cdf46e37c6a257636f8 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 14:53:58 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/ReportletHyperlinkPane.java | 2 +- .../design/javascript/JavaScriptImplPane.java | 326 +++++++++--------- 2 files changed, 166 insertions(+), 162 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 24fac1482..c3ee7de4e 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -124,7 +124,7 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane { private UITextField itemNameTextField; - private JSContentPane jsPane; - private UITableEditorPane importedJsPane; - private ReportletParameterViewPane parameterPane; - private String[] defaultArgs; - - - public JavaScriptImplPane() { - this(new String[0]); - } - - public JavaScriptImplPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { - super(hyperLinkEditorMap, needRenamePane); - 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() { - public void tableChanged(TableModelEvent e) { - List list = parameterPane.update(); - HashSet tempSet = new HashSet(); - for (int i = 0; i < list.size(); i++) { - if (StringUtils.isEmpty(list.get(i).getName())) { - continue; - } - if (tempSet.contains(list.get(i).toString())) { - list.remove(i); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Repeat", "Parameter_Name"}) + "!"); - parameterChanger(list); - return; - } - tempSet.add(list.get(i).toString()); - } - parameterChanger(list); - } - }); - - 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() }; - } - - @Override - public UITableEditAction getAddAction() { - return new AddJsAction(); - } - }; - 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(defaultArgs); - jsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText("FR-Designer_JavaScript"))); - - parameterPane.setPreferredSize(new Dimension(265, 150)); - JPanel topPane = GUICoreUtils.createBorderLayoutPane( - importedJsPane, BorderLayout.CENTER, - parameterPane, BorderLayout.EAST - ); - 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.reLayoutForChart(); - } - - /** - *参数改变 - * @param list 参数列表. - */ - public void parameterChanger(List list) { - String[] name = new String[list.size()]; - for (int i = 0; i < list.size(); i++) { - if (list.get(i) instanceof Parameter) { - name[i] = list.get(i).getName(); - } - } - jsPane.setFunctionTitle(name, defaultArgs); - } - - /** - * title for popup window 弹出界面标题 - * @return 标题. - */ - public String title4PopupWindow() { - return Inter.getLocText("FR-Designer_JavaScript"); - } + private JSContentPane jsPane; + private UITableEditorPane importedJsPane; + private ReportletParameterViewPane parameterPane; + private String[] defaultArgs; + + + public JavaScriptImplPane() { + this(new String[0]); + } + + public JavaScriptImplPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { + super(hyperLinkEditorMap, needRenamePane); + 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() { + public void tableChanged(TableModelEvent e) { + List list = parameterPane.update(); + HashSet tempSet = new HashSet(); + for (int i = 0; i < list.size(); i++) { + if (StringUtils.isEmpty(list.get(i).getName())) { + continue; + } + if (tempSet.contains(list.get(i).toString())) { + list.remove(i); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Repeat", "Parameter_Name"}) + "!"); + parameterChanger(list); + return; + } + tempSet.add(list.get(i).toString()); + } + parameterChanger(list); + } + }); + + 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()}; + } + + @Override + public UITableEditAction getAddAction() { + return new AddJsAction(); + } + }; + 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(defaultArgs); + jsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText("FR-Designer_JavaScript"))); + + parameterPane.setPreferredSize(new Dimension(265, 150)); + JPanel topPane = GUICoreUtils.createBorderLayoutPane( + importedJsPane, BorderLayout.CENTER, + parameterPane, BorderLayout.EAST + ); + 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.reLayoutForChart(); + } + + /** + * 参数改变 + * + * @param list 参数列表. + */ + public void parameterChanger(List list) { + String[] name = new String[list.size()]; + for (int i = 0; i < list.size(); i++) { + if (list.get(i) instanceof Parameter) { + name[i] = list.get(i).getName(); + } + } + jsPane.setFunctionTitle(name, defaultArgs); + } + + /** + * title for popup window 弹出界面标题 + * + * @return 标题. + */ + public String title4PopupWindow() { + return Inter.getLocText("FR-Designer_JavaScript"); + } /** * 重置 */ - public void reset() { - populateBean(null); - } - - public void populateBean(JavaScriptImpl javaScriptImpl) { - if (javaScriptImpl == null) { - javaScriptImpl = new JavaScriptImpl(); - } - - int rowCount = javaScriptImpl.getJSImportSize(); - String[] value = new String[rowCount]; - for (int i = 0; i < rowCount; i++) { - value[i] = javaScriptImpl.getJSImport(i); - } - importedJsPane.populate(value); - parameterPane.populate(javaScriptImpl.getParameters()); - jsPane.populate(javaScriptImpl.getContent()); - - if(itemNameTextField != null){ + public void reset() { + populateBean(null); + } + + public void populateBean(JavaScriptImpl javaScriptImpl) { + if (javaScriptImpl == null) { + javaScriptImpl = new JavaScriptImpl(); + } + + int rowCount = javaScriptImpl.getJSImportSize(); + String[] value = new String[rowCount]; + for (int i = 0; i < rowCount; i++) { + value[i] = javaScriptImpl.getJSImport(i); + } + importedJsPane.populate(value); + parameterPane.populate(javaScriptImpl.getParameters()); + jsPane.populate(javaScriptImpl.getContent()); + + if (itemNameTextField != null) { itemNameTextField.setText(javaScriptImpl.getItemName()); } - } - - public JavaScriptImpl updateBean() { - JavaScriptImpl javaScript = new JavaScriptImpl(); - updateBean(javaScript); - return javaScript; - } - - public void updateBean(JavaScriptImpl javaScript) { - List list = importedJsPane.update(); + } + + public JavaScriptImpl updateBean() { + JavaScriptImpl javaScript = new JavaScriptImpl(); + updateBean(javaScript); + return javaScript; + } + + public void updateBean(JavaScriptImpl javaScript) { + List list = importedJsPane.update(); javaScript.clearJSImports(); - for (int i = 0; i < list.size(); i++) { - String a = list.get(i); - javaScript.addJSImort(a); - } + for (int i = 0; i < list.size(); i++) { + String a = list.get(i); + javaScript.addJSImort(a); + } - List parameterList = parameterPane.update(); - javaScript.setParameters(parameterList.toArray(new Parameter[parameterList.size()])); - javaScript.setContent(jsPane.update()); + List parameterList = parameterPane.update(); + javaScript.setParameters(parameterList.toArray(new Parameter[parameterList.size()])); + javaScript.setContent(jsPane.update()); - if(this.itemNameTextField != null){ + if (this.itemNameTextField != null) { javaScript.setItemName(itemNameTextField.getText()); } - } - - private GridBagConstraints setConstraints(int x, int y, int w, int h, double wx, double wy, GridBagConstraints c) { - if (c == null) { - return null; - } - c.gridx = x; - c.gridy = y; - c.gridheight = h; - c.gridwidth = w; - c.weightx = wx; - c.weighty = wy; - return c; - } - - protected void reLayoutForChart(){ - if(needRenamePane()){ + } + + private GridBagConstraints setConstraints(int x, int y, int w, int h, double wx, double wy, GridBagConstraints c) { + if (c == null) { + return null; + } + c.gridx = x; + c.gridy = y; + c.gridheight = h; + c.gridwidth = w; + c.weightx = wx; + c.weighty = wy; + return c; + } + + protected void reLayoutForChart() { + if (needRenamePane()) { this.removeAll(); itemNameTextField = new UITextField(); JPanel topPane = GUICoreUtils.createBorderLayoutPane( - GUICoreUtils.createNamedPane(itemNameTextField,Inter.getLocText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH, + GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH, importedJsPane, BorderLayout.CENTER, parameterPane, BorderLayout.EAST ); topPane.setPreferredSize(new Dimension(300, 150)); this.setLayout(new BorderLayout()); - this.add(topPane,BorderLayout.NORTH) ; - this.add(jsPane,BorderLayout.CENTER); + this.add(topPane, BorderLayout.NORTH); + this.add(jsPane, BorderLayout.CENTER); this.repaint(); } } - public static class CHART_NO_RENAME extends JavaScriptImplPane{ + public static class CHART_NO_RENAME extends JavaScriptImplPane { protected int getChartParaType() { return ParameterTableModel.CHART_NORMAL_USE; } - protected boolean needRenamePane(){ + + protected boolean needRenamePane() { return false; } } /** * 判断类型 - * @param ob 判断目标 + * + * @param ob 判断目标 * @return 返回是否符合类型. */ - public boolean accept(Object ob) { - return ob instanceof JavaScriptImpl; - } + public boolean accept(Object ob) { + return ob instanceof JavaScriptImpl; + } } \ No newline at end of file From cc03fe5bc631fb165c4096d7853d986c66677584 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 15:24:32 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/editor/ValueEditorPaneFactory.java | 10 ++++----- .../hyperlink/ReporletHyperNorthPane.java | 10 ++++----- .../fr/design/hyperlink/WebHyperlinkPane.java | 3 ++- .../javascript/ParameterJavaScriptPane.java | 2 +- .../impl/ChartHyperRelateCellLinkPane.java | 6 ++--- .../impl/ChartHyperRelateFloatLinkPane.java | 4 ++-- .../impl/FormHyperlinkPane.java | 10 ++++----- .../other/ChartDesignerInteractivePane.java | 22 +++++++++---------- 8 files changed, 33 insertions(+), 34 deletions(-) diff --git a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java index f9425ec2b..7d0316273 100644 --- a/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java +++ b/designer_base/src/com/fr/design/editor/ValueEditorPaneFactory.java @@ -252,7 +252,7 @@ public class ValueEditorPaneFactory { new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new BooleanEditor(), formulaEditor, - new WidgetNameEditor(Inter.getLocText("Widget")) + new WidgetNameEditor(Inter.getLocText("FR-Designer_Widget")) }; } @@ -316,7 +316,7 @@ public class ValueEditorPaneFactory { */ public static Editor[] URLEditors(String popupName, String textEditorValue) { return new Editor[]{ - new NoneEditor(textEditorValue, StringUtils.isEmpty(popupName) ? Inter.getLocText("None") : popupName), + new NoneEditor(textEditorValue, StringUtils.isEmpty(popupName) ? Inter.getLocText("FR-Designer_None") : popupName), new TextEditor() }; } @@ -330,7 +330,7 @@ public class ValueEditorPaneFactory { */ public static Editor[] dateEditors(String popupName, String textEditorValue) { return new Editor[]{ - new NoneEditor(textEditorValue, StringUtils.isEmpty(popupName) ? Inter.getLocText("None") : popupName), + new NoneEditor(textEditorValue, StringUtils.isEmpty(popupName) ? Inter.getLocText("FR-Designer_None") : popupName), new DateEditor(true, Inter.getLocText("FR-Designer_Date")), new FormulaEditor(Inter.getLocText("FR-Designer_Parameter-Formula")) }; @@ -493,12 +493,12 @@ public class ValueEditorPaneFactory { JPanel paneLeft = FRGUIPaneFactory.createBorderLayout_S_Pane(); pane.add(paneLeft); - paneLeft.add(new UILabel(" " + Inter.getLocText("Actual_Value") + ":"), BorderLayout.NORTH); + paneLeft.add(new UILabel(" " + Inter.getLocText("FR-Designer_Actual_Value") + ":"), BorderLayout.NORTH); paneLeft.add(keyColumnPane, BorderLayout.CENTER); JPanel paneRight = FRGUIPaneFactory.createBorderLayout_S_Pane(); pane.add(paneRight); - paneRight.add(new UILabel(" " + Inter.getLocText("Display_Value") + ":"), BorderLayout.NORTH); + paneRight.add(new UILabel(" " + Inter.getLocText("FR-Designer_Display_Value") + ":"), BorderLayout.NORTH); paneRight.add(valueDictPane, BorderLayout.CENTER); diff --git a/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java b/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java index b450f6dda..b02c9dfae 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java @@ -86,13 +86,13 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane { + private final int BORDER_WIDTH = 4; private WebHyperNorthPane northPane; private UICheckBox useCJKCheckBox; @@ -34,7 +35,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane { protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); + this.setBorder(BorderFactory.createEmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH)); northPane = new WebHyperNorthPane(needRenamePane()); this.add(northPane, BorderLayout.NORTH); diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index a1129573b..0a6774507 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -29,7 +29,7 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane { - + private final int BORDER_WIDTH = 4; private FormHyperlinkNorthPane northPane; @@ -33,7 +33,7 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane refreshList(HashMap map) { - List list = new ArrayList(); + List list = new ArrayList(); java.util.HashMap hyperLinkEditorMap = plot.getHyperLinkEditorMap(); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Hyperlink-Web_link"), - new WebHyperlink(), getUseMap(map, WebHyperlink.class))); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap,"JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); - list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("RelatedChart"),null,null)); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Hyperlink-Web_link"), + new WebHyperlink(), getUseMap(map, WebHyperlink.class))); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, "FR-Designer_JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); + list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("FR-Engine_Interactive-chart"), null, null)); - return list; - } + return list; + } - protected void populateAutoRefresh(Chart chart){ + protected void populateAutoRefresh(Chart chart) { super.populateAutoRefresh(chart); - if(chart.getFilterDefinition() != null){ - TopDefinition definition = (TopDefinition)chart.getFilterDefinition(); + if (chart.getFilterDefinition() != null) { + TopDefinition definition = (TopDefinition) chart.getFilterDefinition(); isAutoRefresh.setEnabled(definition.isSupportAutoRefresh()); - if(!isAutoRefresh.isEnabled()){ + if (!isAutoRefresh.isEnabled()) { isAutoRefresh.setSelected(false); } autoRefreshTime.setEnabled(definition.isSupportAutoRefresh()); From f580d8f3dccab6538fd4da06cf12b874504be56c Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 12 Oct 2017 15:37:29 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/ReporletHyperNorthPane.java | 2 +- .../hyperlink/ReportletHyperlinkPane.java | 2 +- .../fr/design/hyperlink/WebHyperlinkPane.java | 6 +- .../design/javascript/JavaScriptImplPane.java | 5 +- .../javascript/ParameterJavaScriptPane.java | 2 +- .../com/fr/design/module/DesignModule.java | 108 +++++++++--------- .../impl/FormHyperlinkPane.java | 4 +- 7 files changed, 68 insertions(+), 61 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java b/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java index b02c9dfae..d88294bfd 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java @@ -65,7 +65,7 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane { - private final int BORDER_WIDTH = 4; + private final int borderWidth = 4; private WebHyperNorthPane northPane; private UICheckBox useCJKCheckBox; @@ -35,7 +35,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane { protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH)); + this.setBorder(BorderFactory.createEmptyBorder(borderWidth, borderWidth, borderWidth, borderWidth)); northPane = new WebHyperNorthPane(needRenamePane()); this.add(northPane, BorderLayout.NORTH); @@ -92,7 +92,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane { webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected()); } - public static class CHART_NO_RENAME extends WebHyperlinkPane { + public static class chartNoRename extends WebHyperlinkPane { protected boolean needRenamePane() { return false; } diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java index 2e0b1ce4a..3a700c9d7 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java @@ -25,6 +25,7 @@ import java.util.HashSet; import java.util.List; public class JavaScriptImplPane extends AbstractHyperLinkPane { + private final int bottomBorder = 12; private UITextField itemNameTextField; private JSContentPane jsPane; private UITableEditorPane importedJsPane; @@ -94,7 +95,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { parameterPane, BorderLayout.EAST ); topPane.setPreferredSize(new Dimension(300, 150)); - topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 12, 0)); + topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, bottomBorder, 0)); this.setLayout(new BorderLayout()); this.add(topPane, BorderLayout.NORTH); @@ -208,7 +209,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { } } - public static class CHART_NO_RENAME extends JavaScriptImplPane { + public static class chartNoRename extends JavaScriptImplPane { protected int getChartParaType() { return ParameterTableModel.CHART_NORMAL_USE; } diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index 0a6774507..3a7957e00 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -70,7 +70,7 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane[] apps = apps4TemplateOpener(); - for (App app : apps) { - DesignerFrame.registApp(app); - } + public static final String LOCALE_FILE_PATH = "com/fr/design/locale/designer"; + + public void start() { + super.start(); + App[] apps = apps4TemplateOpener(); + for (App app : apps) { + DesignerFrame.registApp(app); + } ModuleContext.registerStartedModule(DesignModule.class.getName(), this); - StableFactory.registerMarkedClass(ExtraDesignClassManagerProvider.XML_TAG, ExtraDesignClassManager.class); - ActionFactory.registerCellInsertActionClass(actionsForInsertCellElement()); - ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); - DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); - } + StableFactory.registerMarkedClass(ExtraDesignClassManagerProvider.XML_TAG, ExtraDesignClassManager.class); + ActionFactory.registerCellInsertActionClass(actionsForInsertCellElement()); + ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); + DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); + } public boolean isStarted() { return ModuleContext.isModuleStarted(DesignModule.class.getName()); } - /** - * 返回设计器能打开的模板类型的一个数组列表 - * - * @return 可以打开的模板类型的数组 - */ - public abstract App[] apps4TemplateOpener(); + /** + * 返回设计器能打开的模板类型的一个数组列表 + * + * @return 可以打开的模板类型的数组 + */ + public abstract App[] apps4TemplateOpener(); - /** - * 国际化文件路径 - * @return 国际化文件路径 - */ - public String[] getLocaleFile() { - return new String[]{LOCALE_FILE_PATH}; - } + /** + * 国际化文件路径 + * + * @return 国际化文件路径 + */ + public String[] getLocaleFile() { + return new String[]{LOCALE_FILE_PATH}; + } - public Class[] actionsForInsertCellElement() { - List> classes = new ArrayList<>(); - Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); - for (ElementUIProvider provider : providers) { - classes.add(provider.actionForInsertCellElement()); - } - return classes.toArray(new Class[classes.size()]); - } + public Class[] actionsForInsertCellElement() { + List> classes = new ArrayList<>(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); + for (ElementUIProvider provider : providers) { + classes.add(provider.actionForInsertCellElement()); + } + return classes.toArray(new Class[classes.size()]); + } - public Class[] actionsForInsertFloatElement() { - List> classes = new ArrayList<>(); - Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); - for (ElementUIProvider provider : providers) { - classes.add(provider.actionForInsertFloatElement()); - } - return classes.toArray(new Class[classes.size()]); - } + public Class[] actionsForInsertFloatElement() { + List> classes = new ArrayList<>(); + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); + for (ElementUIProvider provider : providers) { + classes.add(provider.actionForInsertFloatElement()); + } + return classes.toArray(new Class[classes.size()]); + } - public NameableCreator[] hyperlinkTypes() { - return new NameableCreator[]{ - new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.CHART_NO_RENAME.class), - new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class), - new NameObjectCreator(Inter.getLocText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.CHART_NO_RENAME.class), - new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.CHART_NO_RENAME.class), - new NameObjectCreator("JavaScript", JavaScriptImpl.class, JavaScriptImplPane.CHART_NO_RENAME.class) - }; - } + public NameableCreator[] hyperlinkTypes() { + return new NameableCreator[]{ + new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.chartNoRename.class), + new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class), + new NameObjectCreator(Inter.getLocText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.chartNoRename.class), + new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.chartNoRename.class), + new NameObjectCreator("FR-Designer_JavaScript", JavaScriptImpl.class, JavaScriptImplPane.chartNoRename.class) + }; + } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java index b83a7bcc1..10ea52976 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java @@ -17,7 +17,7 @@ import java.awt.*; import java.util.HashMap; public class FormHyperlinkPane extends AbstractHyperLinkPane { - private final int BORDER_WIDTH = 4; + private final int borderWidth = 4; private FormHyperlinkNorthPane northPane; @@ -33,7 +33,7 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane Date: Thu, 12 Oct 2017 15:45:16 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/hyperlink/ReportletHyperlinkPane.java | 2 +- .../src/com/fr/design/hyperlink/WebHyperlinkPane.java | 6 +++--- .../src/com/fr/design/javascript/JavaScriptImplPane.java | 6 +++--- .../com/fr/design/javascript/ParameterJavaScriptPane.java | 2 +- designer_base/src/com/fr/design/module/DesignModule.java | 8 ++++---- .../series/SeriesCondition/impl/FormHyperlinkPane.java | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index d7e1cf733..2406786e0 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -128,7 +128,7 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane { - private final int borderWidth = 4; + private static final int BORDER_WIDTH = 4; private WebHyperNorthPane northPane; private UICheckBox useCJKCheckBox; @@ -35,7 +35,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane { protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(borderWidth, borderWidth, borderWidth, borderWidth)); + this.setBorder(BorderFactory.createEmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH)); northPane = new WebHyperNorthPane(needRenamePane()); this.add(northPane, BorderLayout.NORTH); @@ -92,7 +92,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane { webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected()); } - public static class chartNoRename extends WebHyperlinkPane { + public static class ChartNoRename extends WebHyperlinkPane { protected boolean needRenamePane() { return false; } diff --git a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java index 3a700c9d7..3c67ba7b0 100644 --- a/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java @@ -25,7 +25,7 @@ import java.util.HashSet; import java.util.List; public class JavaScriptImplPane extends AbstractHyperLinkPane { - private final int bottomBorder = 12; + private static final int BOTTOM_BORDER = 12; private UITextField itemNameTextField; private JSContentPane jsPane; private UITableEditorPane importedJsPane; @@ -95,7 +95,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { parameterPane, BorderLayout.EAST ); topPane.setPreferredSize(new Dimension(300, 150)); - topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, bottomBorder, 0)); + topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, BOTTOM_BORDER, 0)); this.setLayout(new BorderLayout()); this.add(topPane, BorderLayout.NORTH); @@ -209,7 +209,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { } } - public static class chartNoRename extends JavaScriptImplPane { + public static class ChartNoRename extends JavaScriptImplPane { protected int getChartParaType() { return ParameterTableModel.CHART_NORMAL_USE; } diff --git a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java index 3a7957e00..9ac045d0e 100644 --- a/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java +++ b/designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java @@ -70,7 +70,7 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane { - private final int borderWidth = 4; + private static final int BORDER_WIDTH = 4; private FormHyperlinkNorthPane northPane; @@ -33,7 +33,7 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane Date: Thu, 12 Oct 2017 15:56:48 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ChartHyperPoplinkPane.java | 2 +- .../impl/ChartHyperRelateCellLinkPane.java | 2 +- .../impl/ChartHyperRelateFloatLinkPane.java | 2 +- .../fr/design/module/ChartHyperlinkGroup.java | 32 ++++++++++--------- .../fr/design/module/FormHyperlinkGroup.java | 4 +-- 5 files changed, 22 insertions(+), 20 deletions(-) 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 d1ddd235d..6151c8538 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 @@ -128,7 +128,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane