Browse Source

抽象出抽象类

master
mengao 7 years ago
parent
commit
2f3d3e8016
  1. 144
      designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java
  2. 192
      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. 39
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java
  7. 24
      designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java
  8. 27
      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());
}
}

192
designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java

@ -1,144 +1,56 @@
package com.fr.design.hyperlink; package com.fr.design.hyperlink;
import com.fr.base.Utils; import com.fr.base.chart.BasePlot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.general.Inter; import com.fr.js.JavaScript;
import com.fr.js.Hyperlink;
/**
import javax.swing.*; * Created by mengao on 2017/10/12.
import java.awt.*; */
import java.awt.event.ActionEvent; public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
import java.awt.event.ActionListener; private BasePlot plot;
protected ReportletParameterViewPane parameterViewPane;
public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBeanPane<T> {
public static final int NEW_WINDOW = 0;
public static final int DIALOG = 1; public AbstractHyperLinkPane(BasePlot plot) {
public static final int SELF = 2; this.plot = plot;
public static final int DEFAULT_H_VALUE = 400; }
public static final int DEFAULT_V_VALUE = 600;
public AbstractHyperLinkPane() {
private JPanel headerPane; }
private UIComboBox targetFrameComboBox;
public BasePlot getPlot() {
private UINumberField heightTextFiled; return plot;
private UINumberField widthTextFiled; }
public ReportletParameterViewPane getParameterViewPane() {
public AbstractHyperlinkPane() { return parameterViewPane;
this.initComponents(); }
}
public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) {
protected void initComponents() { this.parameterViewPane = parameterViewPane;
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); }
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
headerPane = this.setHeaderPanel(); public boolean accept(Object ob){
this.add(headerPane, BorderLayout.NORTH); return ob instanceof JavaScript;
this.add(centerPane, BorderLayout.CENTER); }
targetFrameComboBox = new UIComboBox(getTargetFrames());
targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { public void reset() {}
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); protected int getChartParaType() {
return this; return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE;
} }
});
JPanel targetFramePanel = new JPanel(); protected ValueEditorPane getValueEditorPane() {
targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in"))); return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot);
targetFramePanel.add(targetFrameComboBox); }
targetFrameComboBox.setEditable(true);
targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); protected boolean needRenamePane(){
return plot != null && plot.isNeedRenameHyperLinkPane();
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());
}
} }

27
designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java

@ -1,38 +1,33 @@
package com.fr.design.hyperlink; 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.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.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; 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.itextfield.UITextField;
import com.fr.design.gui.itree.filetree.ReportletPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.ReportletHyperlink; import com.fr.js.ReportletHyperlink;
import com.fr.stable.StringUtils; 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 * @author kunsnat
*/ */
public class ReporletHyperNorthPane extends AbstractHyperlinkPane<ReportletHyperlink> { public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHyperlink> {
private UITextField itemNameTextField; private UITextField itemNameTextField;
private boolean needRenamePane = false; private boolean needRenamePane = false;
private UITextField reportPathTextField; 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.BaseUtils;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.chart.BasePlot; 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.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
@ -24,19 +21,12 @@ import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.util.List; import java.util.List;
public class ReportletHyperlinkPane extends BasicBeanPane<ReportletHyperlink> { public class ReportletHyperlinkPane extends AbstractHyperLinkPane<ReportletHyperlink> {
private BasePlot plot;
private ReporletHyperNorthPane northPane; private ReporletHyperNorthPane northPane;
private ReportletParameterViewPane parameterViewPane = null;
private UICheckBox extendParametersCheckBox; private UICheckBox extendParametersCheckBox;
protected BasePlot getPlot() {
return plot;
}
public ReportletHyperlinkPane(BasePlot plot) { public ReportletHyperlinkPane(BasePlot plot) {
super(); super(plot);
this.plot = plot;
this.initComponents(); this.initComponents();
} }
@ -62,22 +52,10 @@ public class ReportletHyperlinkPane extends BasicBeanPane<ReportletHyperlink> {
} }
@Override @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("FR-Hyperlink_Reportlet"); 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 @Override
public void populateBean(ReportletHyperlink ob) { public void populateBean(ReportletHyperlink ob) {
northPane.populateBean(ob); northPane.populateBean(ob);
@ -168,14 +146,6 @@ public class ReportletHyperlinkPane extends BasicBeanPane<ReportletHyperlink> {
this.northPane = northPane; this.northPane = northPane;
} }
public ReportletParameterViewPane getParameterViewPane() {
return parameterViewPane;
}
public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) {
this.parameterViewPane = parameterViewPane;
}
public UICheckBox getExtendParametersCheckBox() { public UICheckBox getExtendParametersCheckBox() {
return extendParametersCheckBox; 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.base.ConfigManager;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -19,7 +18,7 @@ import java.awt.*;
* *
* @author kunsnat * @author kunsnat
*/ */
public class WebHyperNorthPane extends AbstractHyperlinkPane<WebHyperlink> { public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
private UITextField itemNameTextField; private UITextField itemNameTextField;
private boolean needRenamePane = false; private boolean needRenamePane = false;
private UITextField urlTextField; private UITextField urlTextField;

39
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.Parameter;
import com.fr.base.chart.BasePlot; 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.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
@ -18,28 +15,20 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.List; import java.util.List;
public class WebHyperlinkPane extends BasicBeanPane<WebHyperlink> { public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
private BasePlot plot;
private WebHyperNorthPane northPane; private WebHyperNorthPane northPane;
private ReportletParameterViewPane parameterViewPane;
private UICheckBox useCJKCheckBox; private UICheckBox useCJKCheckBox;
private UICheckBox extendParametersCheckBox; private UICheckBox extendParametersCheckBox;
protected BasePlot getPlot() {
return plot;
}
public WebHyperlinkPane() { public WebHyperlinkPane() {
super(); super();
this.initComponents(); this.initComponents();
} }
public WebHyperlinkPane(BasePlot plot) { public WebHyperlinkPane(BasePlot plot) {
super(); super(plot);
this.plot = plot;
this.initComponents(); this.initComponents();
} }
@ -60,23 +49,11 @@ public class WebHyperlinkPane extends BasicBeanPane<WebHyperlink> {
} }
@Override @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("Hyperlink-Web_link"); return Inter.getLocText("Hyperlink-Web_link");
} }
protected int getChartParaType() { @Override
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(WebHyperlink ob) { public void populateBean(WebHyperlink ob) {
northPane.populateBean(ob); northPane.populateBean(ob);
//parameter //parameter
@ -131,14 +108,6 @@ public class WebHyperlinkPane extends BasicBeanPane<WebHyperlink> {
this.northPane = northPane; this.northPane = northPane;
} }
public ReportletParameterViewPane getParameterViewPane() {
return parameterViewPane;
}
public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) {
this.parameterViewPane = parameterViewPane;
}
public UICheckBox getUseCJKCheckBox() { public UICheckBox getUseCJKCheckBox() {
return useCJKCheckBox; 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.Parameter;
import com.fr.base.chart.BasePlot; import com.fr.base.chart.BasePlot;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; 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.frpane.ReportletParameterViewPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -26,24 +24,20 @@ import java.awt.*;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
public class JavaScriptImplPane extends FurtherBasicBeanPane<JavaScriptImpl> { public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
private BasePlot plot;
private UITextField itemNameTextField; private UITextField itemNameTextField;
private JSContentPane jsPane; private JSContentPane jsPane;
private UITableEditorPane<String> importedJsPane; private UITableEditorPane<String> importedJsPane;
private ReportletParameterViewPane parameterPane; private ReportletParameterViewPane parameterPane;
private String[] defaultArgs; private String[] defaultArgs;
protected BasePlot getPlot() {
return plot;
}
public JavaScriptImplPane() { public JavaScriptImplPane() {
this(new String[0]); this(new String[0]);
} }
public JavaScriptImplPane(BasePlot plot) { public JavaScriptImplPane(BasePlot plot) {
this.plot = plot; super(plot);
this.defaultArgs = new String[0]; this.defaultArgs = new String[0];
initComponents(); initComponents();
} }
@ -109,18 +103,6 @@ public class JavaScriptImplPane extends FurtherBasicBeanPane<JavaScriptImpl> {
this.reLayoutForChart(); 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 参数列表. * @param list 参数列表.

27
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.Parameter;
import com.fr.base.chart.BasePlot; 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.frpane.ReportletParameterViewPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.ParameterJavaScript; import com.fr.js.ParameterJavaScript;
@ -16,21 +14,16 @@ import com.fr.stable.ParameterProvider;
import java.awt.*; import java.awt.*;
import java.util.List; import java.util.List;
public class ParameterJavaScriptPane extends BasicBeanPane<ParameterJavaScript> { public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJavaScript> {
private BasePlot plot;
private UITextField itemNameTextField; private UITextField itemNameTextField;
private ReportletParameterViewPane parameterViewPane;
protected BasePlot getPlot() {
return plot;
}
public ParameterJavaScriptPane(){ public ParameterJavaScriptPane(){
this(null); this(null);
} }
public ParameterJavaScriptPane(BasePlot plot){ public ParameterJavaScriptPane(BasePlot plot){
this.plot = plot; super(plot);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER); this.add(parameterViewPane, BorderLayout.CENTER);
@ -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 @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("JavaScript-Dynamic_Parameters"); 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.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.gui.ChartComponent; 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.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.ChartHyperEditPane; import com.fr.design.mainframe.chart.ChartHyperEditPane;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
@ -27,25 +24,21 @@ import java.awt.*;
* @author kunsnat E-mail:kunsnat@gmail.com * @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-12-28 上午10:41:39 * @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 long serialVersionUID = 2469115951510144738L;
private static final int EDIT_PANE_WIDTH = 248; private static final int EDIT_PANE_WIDTH = 248;
private UITextField itemNameTextField; private UITextField itemNameTextField;
private ChartHyperEditPane hyperEditPane; private ChartHyperEditPane hyperEditPane;
private ChartComponent chartComponent; private ChartComponent chartComponent;
private BasePlot plot;
protected BasePlot getPlot() {
return plot;
}
public ChartHyperPoplinkPane() { public ChartHyperPoplinkPane() {
this(null); this(null);
} }
public ChartHyperPoplinkPane(BasePlot plot) { public ChartHyperPoplinkPane(BasePlot plot) {
this.plot = plot; super(plot);
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
if(this.needRenamePane()){ if(this.needRenamePane()){
@ -87,20 +80,8 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
return cc; 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 @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Pop_Chart"); 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.Utils;
import com.fr.base.chart.BasePlot; import com.fr.base.chart.BasePlot;
import com.fr.chart.web.ChartHyperRelateCellLink; 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.columnrow.ColumnRowVerticalPane;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -25,25 +22,19 @@ import java.util.List;
* @version 创建时间2011-12-28 下午02:51:10 * @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 static final long serialVersionUID = 7874948047886548990L;
private UITextField itemNameTextField; private UITextField itemNameTextField;
private ColumnRowVerticalPane colRowPane; private ColumnRowVerticalPane colRowPane;
private ReportletParameterViewPane parameterViewPane; private ReportletParameterViewPane parameterViewPane;
private BasePlot plot;
protected BasePlot getPlot() {
return plot;
}
public ChartHyperRelateCellLinkPane() { public ChartHyperRelateCellLinkPane() {
this.initComponent(); this.initComponent();
} }
public ChartHyperRelateCellLinkPane(BasePlot plot) { public ChartHyperRelateCellLinkPane(BasePlot plot) {
this.plot = plot; super(plot);
this.initComponent(); this.initComponent();
} }
@ -68,18 +59,6 @@ public class ChartHyperRelateCellLinkPane extends BasicBeanPane<ChartHyperRelate
this.add(parameterViewPane, BorderLayout.SOUTH); 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 @Override
public void populateBean(ChartHyperRelateCellLink ob) { public void populateBean(ChartHyperRelateCellLink ob) {
if(ob == null) { if(ob == null) {
@ -133,7 +112,7 @@ public class ChartHyperRelateCellLinkPane extends BasicBeanPane<ChartHyperRelate
} }
@Override @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText(new String[]{"Related", "Cell"}); 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.base.chart.BasePlot;
import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants; 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.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; 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.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -30,27 +27,19 @@ import java.util.List;
* @version 创建时间2011-12-28 下午03:02:43 * @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 static final long serialVersionUID = -3308412003405587689L;
private UITextField itemNameTextField; private UITextField itemNameTextField;
private UIComboBox floatNameBox; private UIComboBox floatNameBox;
private ReportletParameterViewPane parameterViewPane;
private BasePlot plot;
protected BasePlot getPlot() {
return plot;
}
public ChartHyperRelateFloatLinkPane() { public ChartHyperRelateFloatLinkPane() {
this.initComponent(); this.initComponent();
} }
public ChartHyperRelateFloatLinkPane(BasePlot plot) { public ChartHyperRelateFloatLinkPane(BasePlot plot) {
super(plot);
this.plot = plot;
this.initComponent(); this.initComponent();
} }
@ -86,18 +75,6 @@ public class ChartHyperRelateFloatLinkPane extends BasicBeanPane<ChartHyperRelat
this.add(parameterViewPane, BorderLayout.SOUTH); 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() { private String[] getFloatNames() {
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
if(adapter != null ) { if(adapter != null ) {
@ -156,7 +133,7 @@ public class ChartHyperRelateFloatLinkPane extends BasicBeanPane<ChartHyperRelat
} }
@Override @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText(new String[]{"Related", "M_Insert-Float"}); 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.Parameter;
import com.fr.base.chart.BasePlot; 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.frpane.ReportletParameterViewPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.ElementCaseEditorProvider; import com.fr.form.ui.ElementCaseEditorProvider;
@ -18,19 +16,13 @@ import com.fr.stable.bridge.StableFactory;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
public class FormHyperlinkPane extends BasicBeanPane<FormHyperlinkProvider> { public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> {
private BasePlot plot;
private ReportletParameterViewPane parameterViewPane;
private FormHyperlinkNorthPane northPane; private FormHyperlinkNorthPane northPane;
protected BasePlot getPlot() {
return plot;
}
public FormHyperlinkPane(BasePlot plot) { public FormHyperlinkPane(BasePlot plot) {
super(); super(plot);
this.plot = plot;
this.initComponents(); this.initComponents();
} }
@ -51,22 +43,10 @@ public class FormHyperlinkPane extends BasicBeanPane<FormHyperlinkProvider> {
} }
@Override @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("Hyperlink-Form_link"); 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() { protected int getHyperlinkType() {
if (northPane.getEditingEditor() != null){ if (northPane.getEditingEditor() != null){
if (northPane.getEditingEditor().acceptType(ElementCaseEditorProvider.class)) { if (northPane.getEditingEditor().acceptType(ElementCaseEditorProvider.class)) {

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

@ -1,5 +1,6 @@
package com.fr.plugin.chart.custom.component; package com.fr.plugin.chart.custom.component;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateCellLink;
@ -75,7 +76,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
protected BasicBeanPane createPaneByCreators(NameableCreator creator) { protected BasicBeanPane createPaneByCreators(NameableCreator creator) {
Constructor<? extends BasicBeanPane> constructor = null; Constructor<? extends BasicBeanPane> constructor = null;
try { try {
constructor = creator.getUpdatePane().getConstructor(Plot.class); constructor = creator.getUpdatePane().getConstructor(BasePlot.class);
return constructor.newInstance(plot); return constructor.newInstance(plot);
} catch (InstantiationException e) { } 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; package com.fr.plugin.chart.designer.component;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator;
@ -11,9 +12,9 @@ import java.lang.reflect.Constructor;
* Created by hufan on 2016/11/15. * Created by hufan on 2016/11/15.
*/ */
public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { public class ChartUIMenuNameableCreator extends UIMenuNameableCreator {
private 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); super(name, obj, paneClazz);
this.plot = plot; this.plot = plot;
} }

Loading…
Cancel
Save