Browse Source

抽象出抽象类

master
mengao 7 years ago
parent
commit
2f3d3e8016
  1. 144
      designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java
  2. 200
      designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
  3. 27
      designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java
  4. 36
      designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java
  5. 3
      designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java
  6. 41
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java
  7. 24
      designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java
  8. 29
      designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java
  9. 27
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  10. 29
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  11. 31
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  12. 28
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java
  13. 3
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  14. 5
      designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java

144
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<T extends Hyperlink> extends BasicBeanPane<T> {
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());
}
}

200
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<T extends Hyperlink> extends BasicBeanPane<T> {
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());
}
}
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<T> extends FurtherBasicBeanPane<T> {
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();
}
}

27
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<ReportletHyperlink> {
public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHyperlink> {
private UITextField itemNameTextField;
private boolean needRenamePane = false;
private UITextField reportPathTextField;

36
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<ReportletHyperlink> {
private BasePlot plot;
public class ReportletHyperlinkPane extends AbstractHyperLinkPane<ReportletHyperlink> {
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<ReportletHyperlink> {
}
@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<ReportletHyperlink> {
this.northPane = northPane;
}
public ReportletParameterViewPane getParameterViewPane() {
return parameterViewPane;
}
public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) {
this.parameterViewPane = parameterViewPane;
}
public UICheckBox getExtendParametersCheckBox() {
return extendParametersCheckBox;
}

3
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<WebHyperlink> {
public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
private UITextField itemNameTextField;
private boolean needRenamePane = false;
private UITextField urlTextField;

41
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<WebHyperlink> {
private BasePlot plot;
public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
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<WebHyperlink> {
}
@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<WebHyperlink> {
this.northPane = northPane;
}
public ReportletParameterViewPane getParameterViewPane() {
return parameterViewPane;
}
public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) {
this.parameterViewPane = parameterViewPane;
}
public UICheckBox getUseCJKCheckBox() {
return useCJKCheckBox;
}

24
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<JavaScriptImpl> {
private BasePlot plot;
public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
private UITextField itemNameTextField;
private JSContentPane jsPane;
private UITableEditorPane<String> 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<JavaScriptImpl> {
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 参数列表.

29
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<ParameterJavaScript> {
private BasePlot plot;
public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJavaScript> {
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<ParameterJavaScript>
}
}
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");
}

27
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<ChartHyperPoplink> {
public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPoplink> {
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<ChartHyperPoplink> {
}
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");
}

29
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<ChartHyperRelateCellLink>{
public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyperRelateCellLink> {
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<ChartHyperRelate
parameterViewPane.setPreferredSize(new Dimension(500, 200));
this.add(parameterViewPane, BorderLayout.SOUTH);
}
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(ChartHyperRelateCellLink ob) {
@ -133,7 +112,7 @@ public class ChartHyperRelateCellLinkPane extends BasicBeanPane<ChartHyperRelate
}
@Override
protected String title4PopupWindow() {
public String title4PopupWindow() {
return Inter.getLocText(new String[]{"Related", "Cell"});
}

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

@ -4,15 +4,12 @@ import com.fr.base.Utils;
import com.fr.base.chart.BasePlot;
import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.DesignModelAdapter;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
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;
@ -30,27 +27,19 @@ import java.util.List;
* @version 创建时间2011-12-28 下午03:02:43
* 类说明: 图表超链 关联悬浮元素
*/
public class ChartHyperRelateFloatLinkPane extends BasicBeanPane<ChartHyperRelateFloatLink> {
public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHyperRelateFloatLink> {
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<ChartHyperRelat
this.add(parameterViewPane, BorderLayout.SOUTH);
}
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();
}
private String[] getFloatNames() {
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
if(adapter != null ) {
@ -156,7 +133,7 @@ public class ChartHyperRelateFloatLinkPane extends BasicBeanPane<ChartHyperRelat
}
@Override
protected String title4PopupWindow() {
public String title4PopupWindow() {
return Inter.getLocText(new String[]{"Related", "M_Insert-Float"});
}

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

@ -2,11 +2,9 @@ package com.fr.design.chart.series.SeriesCondition.impl;
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.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.ElementCaseEditorProvider;
@ -18,19 +16,13 @@ import com.fr.stable.bridge.StableFactory;
import javax.swing.*;
import java.awt.*;
public class FormHyperlinkPane extends BasicBeanPane<FormHyperlinkProvider> {
private BasePlot plot;
public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> {
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<FormHyperlinkProvider> {
}
@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){

3
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<? extends BasicBeanPane> constructor = null;
try {
constructor = creator.getUpdatePane().getConstructor(Plot.class);
constructor = creator.getUpdatePane().getConstructor(BasePlot.class);
return constructor.newInstance(plot);
} catch (InstantiationException e) {

5
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<? extends BasicBeanPane> paneClazz) {
public ChartUIMenuNameableCreator(BasePlot plot, String name, Object obj, Class<? extends BasicBeanPane> paneClazz) {
super(name, obj, paneClazz);
this.plot = plot;
}

Loading…
Cancel
Save