Browse Source

修改代码格式

master
mengao 7 years ago
parent
commit
a6770fbc2f
  1. 7
      designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java
  2. 207
      designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java
  3. 8
      designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java
  4. 116
      designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java
  5. 171
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java
  6. 149
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  7. 158
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  8. 182
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  9. 25
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java
  10. 515
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

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

@ -34,11 +34,12 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
this.parameterViewPane = parameterViewPane; this.parameterViewPane = parameterViewPane;
} }
public boolean accept(Object ob){ public boolean accept(Object ob) {
return ob instanceof JavaScript; return ob instanceof JavaScript;
} }
public void reset() {} public void reset() {
}
protected int getChartParaType() { protected int getChartParaType() {
return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE;
@ -48,7 +49,7 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), hyperLinkEditorMap); return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), hyperLinkEditorMap);
} }
protected boolean needRenamePane(){ protected boolean needRenamePane() {
return needRenamePane; return needRenamePane;
} }

207
designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java

@ -15,130 +15,131 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
public abstract class AbstractHyperNorthPane<T extends Hyperlink> extends BasicBeanPane<T> { public abstract class AbstractHyperNorthPane<T extends Hyperlink> extends BasicBeanPane<T> {
public static final int NEW_WINDOW = 0; public static final int NEW_WINDOW = 0;
public static final int DIALOG = 1; public static final int DIALOG = 1;
public static final int SELF = 2; public static final int SELF = 2;
public static final int DEFAULT_H_VALUE = 400; public static final int DEFAULT_H_VALUE = 400;
public static final int DEFAULT_V_VALUE = 600; public static final int DEFAULT_V_VALUE = 600;
private JPanel headerPane; private JPanel headerPane;
private UIComboBox targetFrameComboBox; private UIComboBox targetFrameComboBox;
private UINumberField heightTextFiled; private UINumberField heightTextFiled;
private UINumberField widthTextFiled; private UINumberField widthTextFiled;
public AbstractHyperNorthPane() { public AbstractHyperNorthPane() {
this.initComponents(); this.initComponents();
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
headerPane = this.setHeaderPanel(); headerPane = this.setHeaderPanel();
this.add(headerPane, BorderLayout.NORTH); this.add(headerPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
targetFrameComboBox = new UIComboBox(getTargetFrames()); targetFrameComboBox = new UIComboBox(getTargetFrames());
targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { targetFrameComboBox.setRenderer(new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
return this; return this;
} }
}); });
JPanel targetFramePanel = new JPanel(); JPanel targetFramePanel = new JPanel();
targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in"))); targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in")));
targetFramePanel.add(targetFrameComboBox); targetFramePanel.add(targetFrameComboBox);
targetFrameComboBox.setEditable(true); targetFrameComboBox.setEditable(true);
targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); targetFrameComboBox.setPreferredSize(new Dimension(100, 20));
final JPanel newWindowConfPane = new JPanel(); final JPanel newWindowConfPane = new JPanel();
newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": "));
heightTextFiled = new UINumberField(); heightTextFiled = new UINumberField();
heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE));
heightTextFiled.setPreferredSize(new Dimension(40, 20)); heightTextFiled.setPreferredSize(new Dimension(40, 20));
newWindowConfPane.add(heightTextFiled); newWindowConfPane.add(heightTextFiled);
newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": "));
widthTextFiled = new UINumberField(); widthTextFiled = new UINumberField();
widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE));
widthTextFiled.setPreferredSize(new Dimension(40, 20)); widthTextFiled.setPreferredSize(new Dimension(40, 20));
newWindowConfPane.add(widthTextFiled); newWindowConfPane.add(widthTextFiled);
JPanel centerPanel = new JPanel(new BorderLayout()); JPanel centerPanel = new JPanel(new BorderLayout());
centerPanel.add(targetFramePanel, BorderLayout.WEST); centerPanel.add(targetFramePanel, BorderLayout.WEST);
centerPanel.add(newWindowConfPane, BorderLayout.EAST); centerPanel.add(newWindowConfPane, BorderLayout.EAST);
newWindowConfPane.setVisible(false); newWindowConfPane.setVisible(false);
centerPane.add(centerPanel); centerPane.add(centerPanel);
targetFrameComboBox.addActionListener(new ActionListener() { targetFrameComboBox.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
newWindowConfPane.setVisible(DIALOG == targetFrameComboBox.getSelectedIndex()); newWindowConfPane.setVisible(DIALOG == targetFrameComboBox.getSelectedIndex());
} }
}); });
this.add(this.setFootPanel(), BorderLayout.SOUTH); 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 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() { protected abstract void populateSubHyperlinkBean(T link);
return targetFrameComboBox;
}
public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { public UIComboBox getTargetFrameComboBox() {
this.targetFrameComboBox = targetFrameComboBox; return targetFrameComboBox;
} }
public UINumberField getHeightTextFiled() { public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) {
return heightTextFiled; this.targetFrameComboBox = targetFrameComboBox;
} }
public void setHeightTextFiled(UINumberField heightTextFiled) { public UINumberField getHeightTextFiled() {
this.heightTextFiled = heightTextFiled; return heightTextFiled;
} }
public UINumberField getWidthTextFiled() { public void setHeightTextFiled(UINumberField heightTextFiled) {
return widthTextFiled; this.heightTextFiled = heightTextFiled;
} }
public void setWidthTextFiled(UINumberField widthTextFiled) { public UINumberField getWidthTextFiled() {
this.widthTextFiled = widthTextFiled; return widthTextFiled;
} }
@Override public void setWidthTextFiled(UINumberField widthTextFiled) {
public void populateBean(T link) { this.widthTextFiled = widthTextFiled;
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(); @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 protected abstract void updateSubHyperlinkBean(T t);
public T updateBean() {
T link = updateSubHyperlinkBean();
updateBean(link); @Override
public T updateBean() {
T link = updateSubHyperlinkBean();
return link; updateBean(link);
}
public void updateBean(T link) { return link;
updateSubHyperlinkBean(link); }
link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName());
link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue()); public void updateBean(T link) {
link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue()); 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());
}
} }

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

@ -84,11 +84,11 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
}); });
Component[][] components; Component[][] components;
if(!this.needRenamePane){ if (!this.needRenamePane) {
components = new Component[][]{ components = new Component[][]{
{new UILabel(" " + Inter.getLocText("Reportlet") + ":"), reportletNamePane}, {new UILabel(" " + Inter.getLocText("Reportlet") + ":"), reportletNamePane},
}; };
}else{ } else {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
components = new Component[][]{ components = new Component[][]{
{new UILabel(" " + Inter.getLocText("Name") + ":"), itemNameTextField}, {new UILabel(" " + Inter.getLocText("Name") + ":"), itemNameTextField},
@ -107,7 +107,7 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
@Override @Override
protected void populateSubHyperlinkBean(ReportletHyperlink link) { protected void populateSubHyperlinkBean(ReportletHyperlink link) {
if(itemNameTextField != null){ if (itemNameTextField != null) {
this.itemNameTextField.setText(link.getItemName()); this.itemNameTextField.setText(link.getItemName());
} }
this.reportPathTextField.setText(link.getReportletPath()); this.reportPathTextField.setText(link.getReportletPath());
@ -125,7 +125,7 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
@Override @Override
protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) { protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) {
if(itemNameTextField != null){ if (itemNameTextField != null) {
reportletHyperlink.setItemName(this.itemNameTextField.getText()); reportletHyperlink.setItemName(this.itemNameTextField.getText());
} }
reportletHyperlink.setReportletPath(this.reportPathTextField.getText()); reportletHyperlink.setReportletPath(this.reportPathTextField.getText());

116
designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java

@ -15,35 +15,35 @@ import java.awt.*;
/** /**
* chart 网页链接 定义属性 target url 特征的 界面 * chart 网页链接 定义属性 target url 特征的 界面
* *
* @author kunsnat * @author kunsnat
*/ */
public class WebHyperNorthPane extends AbstractHyperNorthPane<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;
public WebHyperNorthPane(boolean needRenamePane){ public WebHyperNorthPane(boolean needRenamePane) {
this.needRenamePane = needRenamePane; this.needRenamePane = needRenamePane;
this.inits(); this.inits();
} }
public WebHyperNorthPane() { public WebHyperNorthPane() {
this.inits(); this.inits();
} }
/** /**
* 初始化 * 初始化
* *
* @date 2014-4-11 * @date 2014-4-11
*/ */
public void inits() { public void inits() {
super.initComponents(); super.initComponents();
} }
@Override @Override
protected JPanel setHeaderPanel() { protected JPanel setHeaderPanel() {
JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
JPanel urlPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane(); JPanel urlPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
urlTextField = new UITextField(24); urlTextField = new UITextField(24);
@ -55,57 +55,57 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
urlWithHelp.add(GUICoreUtils.createNamedPane(urlPane, "URL:")); urlWithHelp.add(GUICoreUtils.createNamedPane(urlPane, "URL:"));
//urlWithHelp.add(label); //urlWithHelp.add(label);
if(this.needRenamePane){ if (this.needRenamePane) {
headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE,LayoutConstants.VGAP_SMALL)); headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_SMALL));
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
headerPane.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Designer_Name") + ":"), BorderLayout.NORTH); headerPane.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Designer_Name") + ":"), BorderLayout.NORTH);
headerPane.add(urlWithHelp, BorderLayout.CENTER); headerPane.add(urlWithHelp, BorderLayout.CENTER);
}else{ } else {
headerPane.add(urlWithHelp, BorderLayout.NORTH); headerPane.add(urlWithHelp, BorderLayout.NORTH);
} }
return headerPane; return headerPane;
} }
public String getURL() { public String getURL() {
return this.urlTextField.getText(); return this.urlTextField.getText();
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "web"; return "web";
} }
@Override @Override
protected void populateSubHyperlinkBean(WebHyperlink link) { protected void populateSubHyperlinkBean(WebHyperlink link) {
String url = link.getURL(); String url = link.getURL();
if (StringUtils.isBlank(url)) { if (StringUtils.isBlank(url)) {
url = ConfigManager.getProviderInstance().getHyperlinkAddress(); url = ConfigManager.getProviderInstance().getHyperlinkAddress();
} }
this.urlTextField.setText(url); this.urlTextField.setText(url);
if(itemNameTextField != null){ if (itemNameTextField != null) {
this.itemNameTextField.setText(link.getItemName()); this.itemNameTextField.setText(link.getItemName());
} }
} }
@Override @Override
protected WebHyperlink updateSubHyperlinkBean() { protected WebHyperlink updateSubHyperlinkBean() {
WebHyperlink webHyperlink = new WebHyperlink(); WebHyperlink webHyperlink = new WebHyperlink();
updateSubHyperlinkBean(webHyperlink); updateSubHyperlinkBean(webHyperlink);
return webHyperlink; return webHyperlink;
} }
protected void updateSubHyperlinkBean(WebHyperlink webHyperlink) { protected void updateSubHyperlinkBean(WebHyperlink webHyperlink) {
webHyperlink.setURL(this.urlTextField.getText()); webHyperlink.setURL(this.urlTextField.getText());
if(itemNameTextField != null){ if (itemNameTextField != null) {
webHyperlink.setItemName(this.itemNameTextField.getText()); webHyperlink.setItemName(this.itemNameTextField.getText());
} }
} }
@Override @Override
protected JPanel setFootPanel() { protected JPanel setFootPanel() {
return new JPanel(); return new JPanel();
} }
} }

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

@ -16,111 +16,112 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> { public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
private WebHyperNorthPane northPane; private WebHyperNorthPane northPane;
private UICheckBox useCJKCheckBox; private UICheckBox useCJKCheckBox;
private UICheckBox extendParametersCheckBox; private UICheckBox extendParametersCheckBox;
public WebHyperlinkPane() { public WebHyperlinkPane() {
super(); super();
this.initComponents(); this.initComponents();
} }
public WebHyperlinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { public WebHyperlinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane); super(hyperLinkEditorMap, needRenamePane);
this.initComponents(); this.initComponents();
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
northPane = new WebHyperNorthPane(needRenamePane()); northPane = new WebHyperNorthPane(needRenamePane());
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER); this.add(parameterViewPane, BorderLayout.CENTER);
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameters"), null)); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameters"), null));
useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter")); useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter"));
extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters")); extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters"));
this.add(GUICoreUtils.createFlowPane(new Component[] {useCJKCheckBox, extendParametersCheckBox}, FlowLayout.LEFT), BorderLayout.SOUTH); 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<ParameterProvider> parameterList = this.parameterViewPane.update();
parameterList.clear();
ParameterProvider[] parameters = ob.getParameters();
parameterViewPane.populate(parameters);
useCJKCheckBox.setSelected(ob.isUseCJK());
extendParametersCheckBox.setSelected(ob.isExtendParameters());
}
@Override @Override
public WebHyperlink updateBean() { public String title4PopupWindow() {
WebHyperlink webHyperlink = new WebHyperlink(); return Inter.getLocText("Hyperlink-Web_link");
}
updateBean(webHyperlink);
@Override
return webHyperlink; public void populateBean(WebHyperlink ob) {
} northPane.populateBean(ob);
//parameter
List<ParameterProvider> 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) { public void updateBean(WebHyperlink webHyperlink) {
northPane.updateBean(webHyperlink); northPane.updateBean(webHyperlink);
//Parameter. //Parameter.
List<ParameterProvider> parameterList = this.parameterViewPane.update(); List<ParameterProvider> parameterList = this.parameterViewPane.update();
if (!parameterList.isEmpty()) { if (!parameterList.isEmpty()) {
Parameter[] parameters = new Parameter[parameterList.size()]; Parameter[] parameters = new Parameter[parameterList.size()];
parameterList.toArray(parameters); parameterList.toArray(parameters);
webHyperlink.setParameters(parameters); webHyperlink.setParameters(parameters);
} else { } else {
webHyperlink.setParameters(null); webHyperlink.setParameters(null);
} }
webHyperlink.setUseCJK(this.useCJKCheckBox.isSelected()); webHyperlink.setUseCJK(this.useCJKCheckBox.isSelected());
webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected()); webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected());
} }
public static class CHART_NO_RENAME extends WebHyperlinkPane{ public static class CHART_NO_RENAME extends WebHyperlinkPane {
protected boolean needRenamePane(){ protected boolean needRenamePane() {
return false; return false;
} }
protected int getChartParaType() { protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE; return ParameterTableModel.CHART_NORMAL_USE;
} }
} }
public WebHyperNorthPane getNorthPane() { public WebHyperNorthPane getNorthPane() {
return northPane; return northPane;
} }
public void setNorthPane(WebHyperNorthPane northPane) { public void setNorthPane(WebHyperNorthPane northPane) {
this.northPane = northPane; this.northPane = northPane;
} }
public UICheckBox getUseCJKCheckBox() { public UICheckBox getUseCJKCheckBox() {
return useCJKCheckBox; return useCJKCheckBox;
} }
public void setUseCJKCheckBox(UICheckBox useCJKCheckBox) { public void setUseCJKCheckBox(UICheckBox useCJKCheckBox) {
this.useCJKCheckBox = useCJKCheckBox; this.useCJKCheckBox = useCJKCheckBox;
} }
public UICheckBox getExtendParametersCheckBox() { public UICheckBox getExtendParametersCheckBox() {
return extendParametersCheckBox; return extendParametersCheckBox;
} }
public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) { public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) {
this.extendParametersCheckBox = extendParametersCheckBox; this.extendParametersCheckBox = extendParametersCheckBox;
} }
} }

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

@ -20,115 +20,116 @@ import java.awt.*;
import java.util.HashMap; import java.util.HashMap;
/** /**
* 类说明: 图表超链 -- 弹出 悬浮窗. * 类说明: 图表超链 -- 弹出 悬浮窗.
*
* @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 AbstractHyperLinkPane<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;
public ChartHyperPoplinkPane() {
this(null, false);
}
public ChartHyperPoplinkPane() { public ChartHyperPoplinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) {
this(null, false); 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(); itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH);
} }
hyperEditPane = new ChartHyperEditPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); hyperEditPane = new ChartHyperEditPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
hyperEditPane.setPreferredSize(new Dimension(EDIT_PANE_WIDTH, (int)hyperEditPane.getPreferredSize().getHeight()));// 固定属性配置面板大小,灵活调整图表显示面板. hyperEditPane.setPreferredSize(new Dimension(EDIT_PANE_WIDTH, (int) hyperEditPane.getPreferredSize().getHeight()));// 固定属性配置面板大小,灵活调整图表显示面板.
this.add(hyperEditPane, BorderLayout.WEST); this.add(hyperEditPane, BorderLayout.WEST);
ChartCollection cc = createChartCollection(); ChartCollection cc = createChartCollection();
chartComponent = new ChartComponent(); chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension((int)this.getPreferredSize().getWidth()-EDIT_PANE_WIDTH, 170));// 在单元格弹出时 需要调整保证属性表的大小. chartComponent.setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth() - EDIT_PANE_WIDTH, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setSupportEdit(false); chartComponent.setSupportEdit(false);
chartComponent.populate(cc); chartComponent.populate(cc);
this.add(chartComponent, BorderLayout.CENTER); this.add(chartComponent, BorderLayout.CENTER);
hyperEditPane.populate(cc); hyperEditPane.populate(cc);
hyperEditPane.useChartComponent(chartComponent); hyperEditPane.useChartComponent(chartComponent);
} }
private ChartCollection createChartCollection() { private ChartCollection createChartCollection() {
ChartCollection cc = new ChartCollection(); ChartCollection cc = new ChartCollection();
Chart chart = ChartTypeManager.getFirstChart(); Chart chart = ChartTypeManager.getFirstChart();
if (chart != null){ if (chart != null) {
try { try {
cc.addChart((Chart)chart.clone()); cc.addChart((Chart) chart.clone());
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FRLogger.getLogger().error(e.getMessage(), e); FRLogger.getLogger().error(e.getMessage(), e);
} }
}else { } else {
cc.addChart(new Chart(new Bar2DPlot())); cc.addChart(new Chart(new Bar2DPlot()));
} }
return cc; return cc;
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Pop_Chart"); return Inter.getLocText("FR-Chart-Pop_Chart");
} }
@Override @Override
public void populateBean(ChartHyperPoplink chartHyperlink) { public void populateBean(ChartHyperPoplink chartHyperlink) {
if(itemNameTextField != null){ if (itemNameTextField != null) {
this.itemNameTextField.setText(chartHyperlink.getItemName()); this.itemNameTextField.setText(chartHyperlink.getItemName());
} }
BaseChartCollection cc = chartHyperlink.getChartCollection(); BaseChartCollection cc = chartHyperlink.getChartCollection();
if (cc == null || cc.getChartCount() < 1) { if (cc == null || cc.getChartCount() < 1) {
cc = createChartCollection(); cc = createChartCollection();
chartHyperlink.setChartCollection(cc); chartHyperlink.setChartCollection(cc);
} }
hyperEditPane.populateHyperLink(chartHyperlink); hyperEditPane.populateHyperLink(chartHyperlink);
chartComponent.populate(cc); chartComponent.populate(cc);
} }
/** /**
* 超链数组HyperlinkGoup切换时 updateBean. * 超链数组HyperlinkGoup切换时 updateBean.
* @return 返回的弹出超链. *
*/ * @return 返回的弹出超链.
public ChartHyperPoplink updateBean() { */
ChartHyperPoplink chartLink = new ChartHyperPoplink(); public ChartHyperPoplink updateBean() {
updateBean(chartLink); ChartHyperPoplink chartLink = new ChartHyperPoplink();
if(itemNameTextField != null){ updateBean(chartLink);
if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText()); chartLink.setItemName(this.itemNameTextField.getText());
} }
return chartLink; return chartLink;
} }
/** /**
* 属性表 对应update * 属性表 对应update
*/ */
public void updateBean(ChartHyperPoplink chartHyperlink) { public void updateBean(ChartHyperPoplink chartHyperlink) {
hyperEditPane.updateHyperLink(chartHyperlink); hyperEditPane.updateHyperLink(chartHyperlink);
chartHyperlink.setChartCollection(chartComponent.update()); chartHyperlink.setChartCollection(chartComponent.update());
DesignModuleFactory.getChartPropertyPane().getChartEditPane().fire();// 响应整个图表保存事件等. DesignModuleFactory.getChartPropertyPane().getChartEditPane().fire();// 响应整个图表保存事件等.
if(itemNameTextField != null){ if (itemNameTextField != null) {
chartHyperlink.setItemName(this.itemNameTextField.getText()); chartHyperlink.setItemName(this.itemNameTextField.getText());
} }
} }
public static class CHART_NO_RENAME extends ChartHyperPoplinkPane{ public static class CHART_NO_RENAME extends ChartHyperPoplinkPane {
protected boolean needRenamePane(){ protected boolean needRenamePane() {
return false; return false;
} }
} }

158
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 * @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-12-28 下午02:51:10 * @version 创建时间2011-12-28 下午02:51:10
* 类说明: 图表超链 -- 关联单元格图表. * 类说明: 图表超链 -- 关联单元格图表.
*/ */
public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<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;
public ChartHyperRelateCellLinkPane() { public ChartHyperRelateCellLinkPane() {
this.initComponent(); this.initComponent();
} }
public ChartHyperRelateCellLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { public ChartHyperRelateCellLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane); super(hyperLinkEditorMap, needRenamePane);
this.initComponent(); this.initComponent();
} }
private void initComponent() { private void initComponent() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
if(needRenamePane()){ if (needRenamePane()) {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH);
} }
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
centerPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Related", "Cell"}))); centerPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Related", "Cell"})));
colRowPane = new ColumnRowVerticalPane(); colRowPane = new ColumnRowVerticalPane();
centerPane.add(colRowPane, BorderLayout.NORTH); centerPane.add(colRowPane, BorderLayout.NORTH);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"))); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters")));
parameterViewPane.setPreferredSize(new Dimension(500, 200)); parameterViewPane.setPreferredSize(new Dimension(500, 200));
this.add(parameterViewPane, BorderLayout.SOUTH); this.add(parameterViewPane, BorderLayout.SOUTH);
} }
@Override @Override
public void populateBean(ChartHyperRelateCellLink ob) { public void populateBean(ChartHyperRelateCellLink ob) {
if(ob == null) { if (ob == null) {
return; return;
} }
if(itemNameTextField != null){ if (itemNameTextField != null) {
itemNameTextField.setText(ob.getItemName()); itemNameTextField.setText(ob.getItemName());
} }
if(ob.getRelateCCName() != null) { if (ob.getRelateCCName() != null) {
ColumnRow colRow = ColumnRow.valueOf(ob.getRelateCCName()); ColumnRow colRow = ColumnRow.valueOf(ob.getRelateCCName());
colRowPane.populate(colRow); colRowPane.populate(colRow);
} else { } else {
colRowPane.populate(ColumnRow.valueOf("A1")); colRowPane.populate(ColumnRow.valueOf("A1"));
} }
List parameterList = this.parameterViewPane.update(); List parameterList = this.parameterViewPane.update();
parameterList.clear(); parameterList.clear();
ParameterProvider[] parameters = ob.getParameters(); ParameterProvider[] parameters = ob.getParameters();
parameterViewPane.populate(parameters); parameterViewPane.populate(parameters);
} }
@Override @Override
public ChartHyperRelateCellLink updateBean() { public ChartHyperRelateCellLink updateBean() {
ChartHyperRelateCellLink chartLink = new ChartHyperRelateCellLink(); ChartHyperRelateCellLink chartLink = new ChartHyperRelateCellLink();
updateBean(chartLink); updateBean(chartLink);
if(itemNameTextField != null){ if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText()); chartLink.setItemName(this.itemNameTextField.getText());
} }
return chartLink; return chartLink;
} }
/** /**
* 属性表 对应update * 属性表 对应update
*/ */
public void updateBean(ChartHyperRelateCellLink chartLink) { public void updateBean(ChartHyperRelateCellLink chartLink) {
chartLink.setRelateCCName(Utils.objectToString(colRowPane.update())); chartLink.setRelateCCName(Utils.objectToString(colRowPane.update()));
List parameterList = this.parameterViewPane.update(); List parameterList = this.parameterViewPane.update();
if (parameterList != null && !parameterList.isEmpty()) { if (parameterList != null && !parameterList.isEmpty()) {
ParameterProvider[] parameters = new ParameterProvider[parameterList.size()]; ParameterProvider[] parameters = new ParameterProvider[parameterList.size()];
parameterList.toArray(parameters); parameterList.toArray(parameters);
chartLink.setParameters(parameters); chartLink.setParameters(parameters);
} else { } else {
chartLink.setParameters(null); chartLink.setParameters(null);
} }
if(itemNameTextField != null){ if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText()); chartLink.setItemName(this.itemNameTextField.getText());
} }
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText(new String[]{"Related", "Cell"}); return Inter.getLocText(new String[]{"Related", "Cell"});
} }
public static class CHART_NO_RENAME extends ChartHyperRelateCellLinkPane{ public static class CHART_NO_RENAME extends ChartHyperRelateCellLinkPane {
protected boolean needRenamePane(){ protected boolean needRenamePane() {
return false; return false;
} }
} }

182
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 * @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-12-28 下午03:02:43 * @version 创建时间2011-12-28 下午03:02:43
* 类说明: 图表超链 关联悬浮元素 * 类说明: 图表超链 关联悬浮元素
*/ */
public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<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;
public ChartHyperRelateFloatLinkPane() { public ChartHyperRelateFloatLinkPane() {
this.initComponent(); 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) { JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
super(hyperLinkEditorMap, needRenamePane);
this.initComponent();
}
private void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
if(needRenamePane()){ if (needRenamePane()) {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH);
} }
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
floatNameBox = new UIComboBox(getFloatNames()); floatNameBox = new UIComboBox(getFloatNames());
floatNameBox.setPreferredSize(new Dimension(90, 20)); floatNameBox.setPreferredSize(new Dimension(90, 20));
JPanel pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); JPanel pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
pane.add(new UILabel(Inter.getLocText("M_Insert-Float") + ":")); pane.add(new UILabel(Inter.getLocText("M_Insert-Float") + ":"));
pane.add(floatNameBox); pane.add(floatNameBox);
Border boder = new LineBorder(UIConstants.TITLED_BORDER_COLOR); Border boder = new LineBorder(UIConstants.TITLED_BORDER_COLOR);
Font font = null; Font font = null;
TitledBorder border = new TitledBorder(boder, Inter.getLocText(new String[]{"Related", "M_Insert-Float"}), 4, 2, font, new Color(1, 159, 222)); 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.setBorder(border);
centerPane.add(pane, BorderLayout.NORTH); centerPane.add(pane, BorderLayout.NORTH);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"))); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters")));
parameterViewPane.setPreferredSize(new Dimension(500, 200)); parameterViewPane.setPreferredSize(new Dimension(500, 200));
this.add(parameterViewPane, BorderLayout.SOUTH); this.add(parameterViewPane, BorderLayout.SOUTH);
} }
private String[] getFloatNames() { private String[] getFloatNames() {
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
if(adapter != null ) { if (adapter != null) {
return adapter.getFloatNames(); return adapter.getFloatNames();
} }
return new String[0]; return new String[0];
} }
@Override @Override
public void populateBean(ChartHyperRelateFloatLink ob) { public void populateBean(ChartHyperRelateFloatLink ob) {
if(ob == null) { if (ob == null) {
return ; return;
} }
if(itemNameTextField != null){ if (itemNameTextField != null) {
itemNameTextField.setText(ob.getItemName()); itemNameTextField.setText(ob.getItemName());
} }
floatNameBox.setSelectedItem(ob.getRelateCCName()); floatNameBox.setSelectedItem(ob.getRelateCCName());
List parameterList = this.parameterViewPane.update();
parameterList.clear();
ParameterProvider[] parameters = ob.getParameters(); List parameterList = this.parameterViewPane.update();
parameterViewPane.populate(parameters); parameterList.clear();
}
ParameterProvider[] parameters = ob.getParameters();
parameterViewPane.populate(parameters);
}
@Override @Override
public ChartHyperRelateFloatLink updateBean() { public ChartHyperRelateFloatLink updateBean() {
ChartHyperRelateFloatLink chartLink = new ChartHyperRelateFloatLink(); ChartHyperRelateFloatLink chartLink = new ChartHyperRelateFloatLink();
updateBean(chartLink); updateBean(chartLink);
if(itemNameTextField != null){ if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText()); chartLink.setItemName(this.itemNameTextField.getText());
} }
return chartLink; return chartLink;
} }
public void updateBean(ChartHyperRelateFloatLink chartLink) { public void updateBean(ChartHyperRelateFloatLink chartLink) {
if(floatNameBox.getSelectedItem() != null) { if (floatNameBox.getSelectedItem() != null) {
chartLink.setRelateCCName(Utils.objectToString(floatNameBox.getSelectedItem())); chartLink.setRelateCCName(Utils.objectToString(floatNameBox.getSelectedItem()));
} }
List parameterList = this.parameterViewPane.update(); List parameterList = this.parameterViewPane.update();
if (parameterList != null && !parameterList.isEmpty()) { if (parameterList != null && !parameterList.isEmpty()) {
ParameterProvider[] parameters = new ParameterProvider[parameterList.size()]; ParameterProvider[] parameters = new ParameterProvider[parameterList.size()];
parameterList.toArray(parameters); parameterList.toArray(parameters);
chartLink.setParameters(parameters); chartLink.setParameters(parameters);
} else { } else {
chartLink.setParameters(null); chartLink.setParameters(null);
} }
if(itemNameTextField != null){ if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText()); chartLink.setItemName(this.itemNameTextField.getText());
} }
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText(new String[]{"Related", "M_Insert-Float"}); return Inter.getLocText(new String[]{"Related", "M_Insert-Float"});
} }
public static class CHART_NO_RENAME extends ChartHyperRelateFloatLinkPane{ public static class CHART_NO_RENAME extends ChartHyperRelateFloatLinkPane {
protected boolean needRenamePane(){ protected boolean needRenamePane() {
return false; return false;
} }
} }

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

@ -46,14 +46,14 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("Hyperlink-Form_link"); return Inter.getLocText("Hyperlink-Form_link");
} }
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)) {
return FormHyperlinkProvider.ELEMENTCASE; return FormHyperlinkProvider.ELEMENTCASE;
} }
} }
return FormHyperlinkProvider.CHART; return FormHyperlinkProvider.CHART;
} }
@Override @Override
@ -69,7 +69,7 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
@Override @Override
public FormHyperlinkProvider updateBean() { public FormHyperlinkProvider updateBean() {
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
formHyperlink.setType(getHyperlinkType()); formHyperlink.setType(getHyperlinkType());
updateBean(formHyperlink); updateBean(formHyperlink);
@ -77,8 +77,8 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
} }
public void updateBean(FormHyperlinkProvider formHyperlink) { public void updateBean(FormHyperlinkProvider formHyperlink) {
formHyperlink.setType(getHyperlinkType()); formHyperlink.setType(getHyperlinkType());
northPane.updateBean(formHyperlink); northPane.updateBean(formHyperlink);
//Parameter. //Parameter.
java.util.List<ParameterProvider> parameterList = this.parameterViewPane.update(); java.util.List<ParameterProvider> parameterList = this.parameterViewPane.update();
@ -92,10 +92,11 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
} }
} }
public static class CHART_NO_RENAME extends FormHyperlinkPane{ public static class CHART_NO_RENAME extends FormHyperlinkPane {
protected boolean needRenamePane(){ protected boolean needRenamePane() {
return false; return false;
} }
protected int getChartParaType() { protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE; return ParameterTableModel.CHART_NORMAL_USE;
} }

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

@ -75,22 +75,22 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver{ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver {
private static final long serialVersionUID = 3477409806918835992L; private static final long serialVersionUID = 3477409806918835992L;
private static HashMap normalMap = new HashMap(); private static HashMap normalMap = new HashMap();
private static final int TIME_SWITCH_GAP = 40; private static final int TIME_SWITCH_GAP = 40;
private UICheckBox isChartAnimation;// 动态 private UICheckBox isChartAnimation;// 动态
private UICheckBox isSeriesDragEnable; //系列拖拽 private UICheckBox isSeriesDragEnable; //系列拖拽
private UICheckBox isAxisZoom;// 缩放 private UICheckBox isAxisZoom;// 缩放
private UICheckBox isDatapointValue;// 数据点提示 private UICheckBox isDatapointValue;// 数据点提示
private UIButton dataPointValueFormat; private UIButton dataPointValueFormat;
private UICheckBox isDatapointPercent; private UICheckBox isDatapointPercent;
private UIButton dataPointPercentFormat; private UIButton dataPointPercentFormat;
private UILabel tooltipStyleLabel; private UILabel tooltipStyleLabel;
private UIComboBox tooltipStyle; private UIComboBox tooltipStyle;
@ -102,24 +102,24 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private UICheckBox isAddress; private UICheckBox isAddress;
private UICheckBox isAddressName; private UICheckBox isAddressName;
private UICheckBox isAxisShowToolTip;// 坐标轴提示 private UICheckBox isAxisShowToolTip;// 坐标轴提示
protected UICheckBox isAutoRefresh;// 自动刷新 protected UICheckBox isAutoRefresh;// 自动刷新
protected UISpinner autoRefreshTime; protected UISpinner autoRefreshTime;
private UICorrelationComboBoxPane superLink;// 超链 private UICorrelationComboBoxPane superLink;// 超链
private FormatPane valueFormatPane; private FormatPane valueFormatPane;
private FormatPane percentFormatPane; private FormatPane percentFormatPane;
private Format valueFormat; private Format valueFormat;
private Format percentFormat; private Format percentFormat;
private JPanel tooltipPane; private JPanel tooltipPane;
private JPanel axisShowPane; private JPanel axisShowPane;
private JPanel autoRefreshPane; private JPanel autoRefreshPane;
private JPanel superlinkPane; private JPanel superlinkPane;
private ChartOtherPane parent; private ChartOtherPane parent;
private UICheckBox timeSwitch; private UICheckBox timeSwitch;
@ -128,47 +128,49 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
protected Plot plot; protected Plot plot;
private static final int SIZEX = 258; private static final int SIZEX = 258;
private static final int SIZEY = 209; private static final int SIZEY = 209;
private static final int DET = 20; private static final int DET = 20;
public ChartInteractivePane(ChartOtherPane parent) {
super();
this.parent = parent;
}
/** public ChartInteractivePane(ChartOtherPane parent) {
* 界面标题. super();
this.parent = parent;
}
/**
* 界面标题.
*
* @return 返回标题. * @return 返回标题.
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("Chart-Interactive_Tab"); return Inter.getLocText("Chart-Interactive_Tab");
} }
@Override @Override
protected JPanel createContentPane() { protected JPanel createContentPane() {
isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow")); isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow"));
isSeriesDragEnable = new UICheckBox(Inter.getLocText("Chart-Series_Drag")); isSeriesDragEnable = new UICheckBox(Inter.getLocText("Chart-Series_Drag"));
isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value")); isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value"));
dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format")); dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent")); isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent"));
dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format")); dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
tooltipStyle = new UIComboBox(new String []{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")}); tooltipStyle = new UIComboBox(new String[]{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")});
tooltipStyleLabel = new UILabel(Inter.getLocText("Chart-Style_Name")); 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")); tooltipShowTypeLabel = new UILabel(Inter.getLocText("Chart-Use_Show"));
isAddressTittle = new UICheckBox(Inter.getLocText("Chart-Area_Title")); isAddressTittle = new UICheckBox(Inter.getLocText("Chart-Area_Title"));
isAddress = new UICheckBox(Inter.getLocText("Chart-Gis_Address")); isAddress = new UICheckBox(Inter.getLocText("Chart-Gis_Address"));
isAddressName = new UICheckBox(Inter.getLocText("Chart-Address_Name")); isAddressName = new UICheckBox(Inter.getLocText("Chart-Address_Name"));
isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip")); isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip"));
isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom")); isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom"));
isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"})); isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"}));
autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1); autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1);
superLink = new UICorrelationComboBoxPane(); superLink = new UICorrelationComboBoxPane();
isAutoRefresh.addActionListener(new ActionListener() { isAutoRefresh.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkAutoRefresh(); checkAutoRefresh();
@ -176,9 +178,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}); });
timeSwitch = new UICheckBox(Inter.getLocText("FR-Chart-Interactive_timeSwitch")); timeSwitch = new UICheckBox(Inter.getLocText("FR-Chart-Interactive_timeSwitch"));
timeSwitchPane = new TimeSwitchPane(); timeSwitchPane = new TimeSwitchPane();
initFormatListener(); initFormatListener();
return initPaneWithListener(); return initPaneWithListener();
} }
private void initFormatListener() { private void initFormatListener() {
@ -188,7 +190,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
timeSwitch.setEnabled(isAxisZoom.isSelected()); timeSwitch.setEnabled(isAxisZoom.isSelected());
if(!isAxisZoom.isSelected()){ if (!isAxisZoom.isSelected()) {
timeSwitch.setSelected(false); timeSwitch.setSelected(false);
} }
} }
@ -254,19 +256,20 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}); });
} }
private void checkAutoRefresh() { private void checkAutoRefresh() {
GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected()); GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected());
} }
/** /**
* 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件. * 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件.
* @return *
*/ * @return
private JPanel initPaneWithListener() { */
initDataPointToolTipPane(); private JPanel initPaneWithListener() {
initAxisShowPane(); initDataPointToolTipPane();
initAutoRefreshPane(); initAxisShowPane();
initSuperlinkPane(); initAutoRefreshPane();
initSuperlinkPane();
initTimeSwitchPane(); initTimeSwitchPane();
@ -285,34 +288,33 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}; };
//初始化界面时 加载事件 //初始化界面时 加载事件
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
private void initTimeSwitchPane(){ private void initTimeSwitchPane() {
timeSwitchContainer = new JPanel(new BorderLayout()); timeSwitchContainer = new JPanel(new BorderLayout());
timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER); timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER);
} }
/** /**
* 全部初始化, 对所有的界面 都加入, 然后会加载事件响应. 后续再relayout. * 全部初始化, 对所有的界面 都加入, 然后会加载事件响应. 后续再relayout.
*/ */
private void initDataPointToolTipPane() { private void initDataPointToolTipPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p, p, p, p, p}; double[] rowSize = new double[]{p, p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat}, new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat}, new Component[]{isDatapointPercent, dataPointPercentFormat},
new Component[]{isAddress, null}, new Component[]{isAddress, null},
new Component[]{isAddressName,null}, new Component[]{isAddressName, null},
new Component[]{isAddressTittle, null}, new Component[]{isAddressTittle, null},
new Component[]{tooltipShowTypeLabel, tooltipShowType}, new Component[]{tooltipShowTypeLabel, tooltipShowType},
new Component[]{tooltipStyleLabel, tooltipStyle} 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) { private void relayoutDataPointToolTipPane(Plot plot) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
@ -320,21 +322,21 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p}; double[] rowSize = new double[]{p, p};
if(plot.isShowAllDataPointLabel()) { if (plot.isShowAllDataPointLabel()) {
isDatapointPercent.setText(Inter.getLocText("Chart-Value_Conversion")); isDatapointPercent.setText(Inter.getLocText("Chart-Value_Conversion"));
} }
if(plot.isSupportAddress4Gis()) { if (plot.isSupportAddress4Gis()) {
UIButton tmpButton = new UIButton(); //用来调整对齐 UIButton tmpButton = new UIButton(); //用来调整对齐
tmpButton.setVisible(false); tmpButton.setVisible(false);
rowSize = new double[]{p, p, p, p, p}; rowSize = new double[]{p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isAddress, null}, new Component[]{isAddress, null},
new Component[]{isAddressName,null}, new Component[]{isAddressName, null},
new Component[]{isAddressTittle, tmpButton}, new Component[]{isAddressTittle, tmpButton},
new Component[]{isDatapointValue, dataPointValueFormat}, new Component[]{isDatapointValue, dataPointValueFormat},
}; };
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize); tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize);
} else if(plot.isSupportValuePercent()) { } else if (plot.isSupportValuePercent()) {
Component[][] components; Component[][] components;
if (plot.isSupportTooltipSeriesType()) { if (plot.isSupportTooltipSeriesType()) {
rowSize = new double[]{p, p, p, p}; rowSize = new double[]{p, p, p, p};
@ -347,18 +349,18 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} else { } else {
rowSize = new double[]{p, p, p}; rowSize = new double[]{p, p, p};
components = new Component[][]{ components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat}, new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat}, new Component[]{isDatapointPercent, dataPointPercentFormat},
getTooltipStyleComponent() getTooltipStyleComponent()
}; };
} }
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize); tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize);
} else { } else {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat}, new Component[]{isDatapointValue, dataPointValueFormat},
getTooltipStyleComponent() 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<Chart> implements UIOb
new Component[]{tooltipShowTypeLabel, tooltipShowType} new Component[]{tooltipShowTypeLabel, tooltipShowType}
}; };
double[] newColumnSize = new double[]{f, p}; double[] newColumnSize = new double[]{f, p};
double []newRowSize = new double[]{p}; double[] newRowSize = new double[]{p};
return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null}; return new Component[]{TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
} }
private Component[] getTooltipStyleComponent() { private Component[] getTooltipStyleComponent() {
@ -380,53 +382,53 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{tooltipStyleLabel, tooltipStyle} new Component[]{tooltipStyleLabel, tooltipStyle}
}; };
double[] newColumnSize = new double[]{f, p}; double[] newColumnSize = new double[]{f, p};
double []newRowSize = new double[]{p}; double[] newRowSize = new double[]{p};
return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null}; return new Component[]{TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
} }
private void initAxisShowPane() { private void initAxisShowPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{p}; double[] columnSize = new double[]{p};
double[] rowSize = new double[]{p}; double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isAxisShowToolTip}, new Component[]{isAxisShowToolTip},
}; };
axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize); axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"}, components, rowSize, columnSize);
} }
private void initAutoRefreshPane() { private void initAutoRefreshPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p,p}; double[] rowSize = new double[]{p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isAutoRefresh,null}, new Component[]{isAutoRefresh, null},
new Component[]{GUICoreUtils.createFlowPane(new Component[]{ new Component[]{GUICoreUtils.createFlowPane(new Component[]{
new UILabel(Inter.getLocText("Chart-Time_Interval")), new UILabel(Inter.getLocText("Chart-Time_Interval")),
autoRefreshTime, autoRefreshTime,
new UILabel(Inter.getLocText("Chart-Time_Seconds")) new UILabel(Inter.getLocText("Chart-Time_Seconds"))
}, 1)}, }, 1)},
new Component[]{new UILabel("<html><font size='2' face='Microsoft Yahei' color='red'>" + Inter.getLocText("FR-Chart-AutoRefresh_NotSupportIMGAndReportData") + "</font></html>"), null}, new Component[]{new UILabel("<html><font size='2' face='Microsoft Yahei' color='red'>" + Inter.getLocText("FR-Chart-AutoRefresh_NotSupportIMGAndReportData") + "</font></html>"), null},
}; };
autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"},components, rowSize, columnSize); autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"}, components, rowSize, columnSize);
} }
private void initSuperlinkPane() { private void initSuperlinkPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p}; double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{superLink, null}, new Component[]{superLink, null},
}; };
superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize); superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"}, components, rowSize, columnSize);
} }
private void relayoutWithPlot(Plot plot) { private void relayoutWithPlot(Plot plot) {
this.removeAll(); this.removeAll();
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{TableLayout.FILL}; double[] columnSize = new double[]{TableLayout.FILL};
double[] rowSize = new double[]{p, p, p}; double[] rowSize = new double[]{p, p, p};
@ -441,11 +443,11 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
double[] row = new double[]{p, p, p, p, p, p}; double[] row = new double[]{p, p, p, p, p, p};
reloaPane(TableLayoutHelper.createTableLayoutPane(components, row, columnSize)); reloaPane(TableLayoutHelper.createTableLayoutPane(components, row, columnSize));
} }
private Component[] getChartAnimatePane(Plot plot, double[] row, double[] col) { private Component[] getChartAnimatePane(Plot plot, double[] row, double[] col) {
if(plot.isSupportAnimate() && plot.isSupportSeriesDrag()) { if (plot.isSupportAnimate() && plot.isSupportSeriesDrag()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane( return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{isChartAnimation}, new Component[]{isChartAnimation},
@ -453,7 +455,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{new JSeparator()} new Component[]{new JSeparator()}
}, row, col) }, row, col)
}; };
}else if(plot.isSupportAnimate() && !plot.isSupportSeriesDrag()){ } else if (plot.isSupportAnimate() && !plot.isSupportSeriesDrag()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane( return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{isChartAnimation}, new Component[]{isChartAnimation},
@ -461,36 +463,36 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}, row, col) }, row, col)
}; };
} }
return new Component[]{null}; return new Component[]{null};
} }
private void relayoutTimeSwitchPane(){ private void relayoutTimeSwitchPane() {
timeSwitchContainer.removeAll(); timeSwitchContainer.removeAll();
timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER); timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER);
if(timeSwitch.isSelected()){ if (timeSwitch.isSelected()) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = new double[]{TIME_SWITCH_GAP,f}; double[] columnSize = new double[]{TIME_SWITCH_GAP, f};
double[] rowSize = new double[]{p}; double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, timeSwitchPane}, new Component[]{null, timeSwitchPane},
}; };
JPanel panel= TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
timeSwitchContainer.add(panel, BorderLayout.SOUTH); timeSwitchContainer.add(panel, BorderLayout.SOUTH);
} }
timeSwitchContainer.revalidate(); timeSwitchContainer.revalidate();
} }
private Component[] getChartScalePane(Plot plot, double[] row, double[] col) { private Component[] getChartScalePane(Plot plot, double[] row, double[] col) {
boolean isNeedTimeSwitch = plot.getxAxis()!=null && plot.getxAxis().isDate(); boolean isNeedTimeSwitch = plot.getxAxis() != null && plot.getxAxis().isDate();
if(plot.isSupportZoomCategoryAxis() && !isNeedTimeSwitch) { if (plot.isSupportZoomCategoryAxis() && !isNeedTimeSwitch) {
return new Component[]{TableLayoutHelper.createTableLayoutPane( return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{isAxisZoom}, new Component[]{isAxisZoom},
new Component[]{new JSeparator()} new Component[]{new JSeparator()}
}, row, col) }, row, col)
}; };
}else if(plot.isSupportZoomCategoryAxis() && isNeedTimeSwitch){ } else if (plot.isSupportZoomCategoryAxis() && isNeedTimeSwitch) {
return new Component[]{TableLayoutHelper.createTableLayoutPane( return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{isAxisZoom}, new Component[]{isAxisZoom},
@ -499,29 +501,29 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}, row, col) }, row, col)
}; };
} }
return new Component[]{null}; return new Component[]{null};
} }
private Component[] getDataTooltipPane(Plot plot, double[] row, double[] col) { private Component[] getDataTooltipPane(Plot plot, double[] row, double[] col) {
relayoutDataPointToolTipPane(plot); relayoutDataPointToolTipPane(plot);
if(plot.isSupportTooltipInInteractivePane()) { if (plot.isSupportTooltipInInteractivePane()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(new Component[][]{ return new Component[]{TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{tooltipPane}, new Component[]{new JSeparator()}}, row, col)}; 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) { private Component[] getAxisTipPane(Plot plot, double[] row, double[] col) {
if(plot.isSupportAxisTip()) { if (plot.isSupportAxisTip()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(new Component[][]{ return new Component[]{TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{axisShowPane}, new Component[]{new JSeparator()}}, row, col)}; 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) { private Component[] getAutoRefreshPane(Plot plot, double[] row, double[] col) {
if(plot.isSupportAutoRefresh()) { if (plot.isSupportAutoRefresh()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane( return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{autoRefreshPane}, new Component[]{autoRefreshPane},
@ -537,16 +539,16 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return new Component[]{superlinkPane}; return new Component[]{superlinkPane};
} }
@Override @Override
public void populateBean(Chart chart) { public void populateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) { if (chart == null || chart.getPlot() == null) {
return; return;
} }
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
this.plot =plot; this.plot = plot;
relayoutWithGis(chart, plot); relayoutWithGis(chart, plot);
relayoutWithPlot(plot); relayoutWithPlot(plot);
populateChartAnimate(chart, plot); populateChartAnimate(chart, plot);
populateChartScale(plot); populateChartScale(plot);
@ -555,63 +557,63 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
populateAutoRefresh(chart); populateAutoRefresh(chart);
populateHyperlink(plot); populateHyperlink(plot);
checkAutoRefresh(); checkAutoRefresh();
} }
private void relayoutWithGis(Chart chart, Plot plot) { private void relayoutWithGis(Chart chart, Plot plot) {
if(plot.isSupportAddress4Gis()) { if (plot.isSupportAddress4Gis()) {
TopDefinitionProvider definition = chart.getFilterDefinition(); TopDefinitionProvider definition = chart.getFilterDefinition();
boolean addressType = true; boolean addressType = true;
if(definition instanceof GisMapTableDefinition){ if (definition instanceof GisMapTableDefinition) {
addressType = ((GisMapTableDefinition)definition).isAddress(); addressType = ((GisMapTableDefinition) definition).isAddress();
}else if(definition instanceof GisMapReportDefinition){ } else if (definition instanceof GisMapReportDefinition) {
addressType = ((GisMapReportDefinition)definition).isAddress(); addressType = ((GisMapReportDefinition) definition).isAddress();
} }
if(addressType){ if (addressType) {
this.isAddress.setText(Inter.getLocText("Chart-Use_Address")); this.isAddress.setText(Inter.getLocText("Chart-Use_Address"));
}else{ } else {
this.isAddress.setText(Inter.getLocText("Chart-Use_LatLng")); this.isAddress.setText(Inter.getLocText("Chart-Use_LatLng"));
} }
} }
} }
private void populateChartAnimate(Chart chart, Plot plot) { private void populateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) { if (plot.isSupportAnimate()) {
isChartAnimation.setSelected(chart.isJSDraw()); isChartAnimation.setSelected(chart.isJSDraw());
} }
if(plot.isSupportSeriesDrag()){ if (plot.isSupportSeriesDrag()) {
isSeriesDragEnable.setSelected(plot.isSeriesDragEnable()); isSeriesDragEnable.setSelected(plot.isSeriesDragEnable());
} }
} }
private void populateChartScale(Plot plot) { private void populateChartScale(Plot plot) {
if(plot.isSupportZoomCategoryAxis()) { if (plot.isSupportZoomCategoryAxis()) {
isAxisZoom.setSelected(plot.getxAxis() != null && plot.getxAxis().isZoom()); isAxisZoom.setSelected(plot.getxAxis() != null && plot.getxAxis().isZoom());
} }
timeSwitch.setSelected(false); timeSwitch.setSelected(false);
timeSwitch.setEnabled(false); timeSwitch.setEnabled(false);
//只有坐标轴为时间坐标轴,并且勾选了图表缩放的时候,才支持时间切换 //只有坐标轴为时间坐标轴,并且勾选了图表缩放的时候,才支持时间切换
if(!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()){ if (!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()) {
return; return;
} }
if(plot.getxAxis() ==null && !plot.getxAxis().isDate()){ if (plot.getxAxis() == null && !plot.getxAxis().isDate()) {
return; return;
} }
timeSwitch.setEnabled(true); timeSwitch.setEnabled(true);
ArrayList<TimeSwitchAttr> timeMap=plot.getxAxis().getTimeSwitchMap(); ArrayList<TimeSwitchAttr> timeMap = plot.getxAxis().getTimeSwitchMap();
timeSwitch.setSelected(timeMap != null && !timeMap.isEmpty()); timeSwitch.setSelected(timeMap != null && !timeMap.isEmpty());
if(timeSwitch.isSelected()){ if (timeSwitch.isSelected()) {
timeSwitchPane.populate(plot); timeSwitchPane.populate(plot);
} }
} }
private void populateDataTooltip(Plot plot) { private void populateDataTooltip(Plot plot) {
if(plot.isSupportTooltipInInteractivePane()) { if (plot.isSupportTooltipInInteractivePane()) {
AttrContents contents = plot.getHotTooltipStyle(); AttrContents contents = plot.getHotTooltipStyle();
if (contents == null) { if (contents == null) {
return; return;
@ -627,12 +629,12 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} else { } else {
tooltipStyle.setSelectedIndex(1); tooltipStyle.setSelectedIndex(1);
} }
if(plot.isSupportValuePercent()) { if (plot.isSupportValuePercent()) {
percentFormat = contents.getPercentFormat(); percentFormat = contents.getPercentFormat();
isDatapointPercent.setSelected(dataLabel.contains(ChartConstants.PERCENT_PARA)); isDatapointPercent.setSelected(dataLabel.contains(ChartConstants.PERCENT_PARA));
} }
if(plot.isSupportAddress4Gis()) { if (plot.isSupportAddress4Gis()) {
isAddressTittle.setSelected(dataLabel.contains(ChartConstants.AREA_TITTLE_PARA)); isAddressTittle.setSelected(dataLabel.contains(ChartConstants.AREA_TITTLE_PARA));
isAddress.setSelected(dataLabel.contains(ChartConstants.ADDRESS_PARA)); isAddress.setSelected(dataLabel.contains(ChartConstants.ADDRESS_PARA));
isAddressName.setSelected(dataLabel.contains(ChartConstants.ADDRESS_NAME_PARA)); isAddressName.setSelected(dataLabel.contains(ChartConstants.ADDRESS_NAME_PARA));
@ -649,14 +651,14 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} }
private void populateAxisTip(Plot plot) { private void populateAxisTip(Plot plot) {
if(plot.isSupportAxisTip()) { if (plot.isSupportAxisTip()) {
isAxisShowToolTip.setSelected(plot.isInteractiveAxisTooltip()); isAxisShowToolTip.setSelected(plot.isInteractiveAxisTooltip());
} }
} }
protected void populateAutoRefresh(Chart chart) { protected void populateAutoRefresh(Chart chart) {
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
if(plot.isSupportAutoRefresh()) { if (plot.isSupportAutoRefresh()) {
if (plot.getAutoRefreshPerSecond() < 1) { if (plot.getAutoRefreshPerSecond() < 1) {
isAutoRefresh.setSelected(false); isAutoRefresh.setSelected(false);
autoRefreshTime.setValue(2); autoRefreshTime.setValue(2);
@ -682,9 +684,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
List<ChartUIMenuNameableCreator> hyperList = new ArrayList<ChartUIMenuNameableCreator>(); List<ChartUIMenuNameableCreator> hyperList = new ArrayList<ChartUIMenuNameableCreator>();
NameJavaScriptGroup nameGroup = plot.getHotHyperLink(); 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); NameJavaScript javaScript = nameGroup.getNameHyperlink(i);
if(javaScript != null && javaScript.getJavaScript() != null) { if (javaScript != null && javaScript.getJavaScript() != null) {
JavaScript script = javaScript.getJavaScript(); JavaScript script = javaScript.getJavaScript();
hyperList.add(new ChartUIMenuNameableCreator(plot.getHyperLinkEditorMap(), javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); hyperList.add(new ChartUIMenuNameableCreator(plot.getHyperLinkEditorMap(), javaScript.getName(), script, getUseMap(paneMap, script.getClass())));
} }
@ -694,13 +696,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
superLink.doLayout(); superLink.doLayout();
} }
@Override @Override
public void updateBean(Chart chart) { public void updateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) { if (chart == null || chart.getPlot() == null) {
return; return;
} }
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
updateChartAnimate(chart, plot); updateChartAnimate(chart, plot);
updateChartScale(plot); updateChartScale(plot);
@ -708,38 +710,38 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
updateAxisTip(plot); updateAxisTip(plot);
updateAutoRefresh(plot); updateAutoRefresh(plot);
updateHyperlink(plot); updateHyperlink(plot);
} }
private void updateChartAnimate(Chart chart, Plot plot) { private void updateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) { if (plot.isSupportAnimate()) {
chart.setJSDraw(isChartAnimation.isSelected()); chart.setJSDraw(isChartAnimation.isSelected());
} }
if(plot.isSupportSeriesDrag()){ if (plot.isSupportSeriesDrag()) {
plot.setSeriesDragEnable(isSeriesDragEnable.isSelected()); plot.setSeriesDragEnable(isSeriesDragEnable.isSelected());
} }
} }
private void updateChartScale(Plot plot) { private void updateChartScale(Plot plot) {
if(plot.isSupportZoomCategoryAxis() && plot.getxAxis() != null) { if (plot.isSupportZoomCategoryAxis() && plot.getxAxis() != null) {
plot.getxAxis().setZoom(isAxisZoom.isSelected()); plot.getxAxis().setZoom(isAxisZoom.isSelected());
} }
if(plot.getxAxis() == null){ if (plot.getxAxis() == null) {
return; return;
} }
boolean isNeedTimeSwitch = plot.getxAxis()!=null && plot.getxAxis().isDate(); boolean isNeedTimeSwitch = plot.getxAxis() != null && plot.getxAxis().isDate();
boolean isClear = !isNeedTimeSwitch || !timeSwitch.isSelected(); boolean isClear = !isNeedTimeSwitch || !timeSwitch.isSelected();
if(isClear && plot.getxAxis().getTimeSwitchMap() != null){ if (isClear && plot.getxAxis().getTimeSwitchMap() != null) {
plot.getxAxis().getTimeSwitchMap().clear(); plot.getxAxis().getTimeSwitchMap().clear();
return; return;
} }
if(plot.getxAxis().isDate() && timeSwitch.isSelected()){ if (plot.getxAxis().isDate() && timeSwitch.isSelected()) {
timeSwitchPane.update(plot); timeSwitchPane.update(plot);
} }
} }
private void updateDataTooltip(Plot plot) { private void updateDataTooltip(Plot plot) {
if(plot.isSupportTooltipInInteractivePane()) { if (plot.isSupportTooltipInInteractivePane()) {
AttrContents seriesAttrContents = plot.getHotTooltipStyle(); AttrContents seriesAttrContents = plot.getHotTooltipStyle();
if (seriesAttrContents == null) { if (seriesAttrContents == null) {
seriesAttrContents = new AttrContents(); seriesAttrContents = new AttrContents();
@ -747,18 +749,18 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
String contents = plot.isSupportAddress4Gis() ? getGisTooltipContent() : getTooltipContent(plot); String contents = plot.isSupportAddress4Gis() ? getGisTooltipContent() : getTooltipContent(plot);
seriesAttrContents.setSeriesLabel(contents); seriesAttrContents.setSeriesLabel(contents);
if(tooltipStyle != null){ if (tooltipStyle != null) {
boolean isWhiteBackground = tooltipStyle.getSelectedIndex() == 0; boolean isWhiteBackground = tooltipStyle.getSelectedIndex() == 0;
seriesAttrContents.setWhiteBackground(isWhiteBackground); seriesAttrContents.setWhiteBackground(isWhiteBackground);
} }
if(tooltipShowType != null){ if (tooltipShowType != null) {
boolean isShowMutiSeries = plot.isSupportTooltipSeriesType() && tooltipShowType.getSelectedIndex() == 1; boolean isShowMutiSeries = plot.isSupportTooltipSeriesType() && tooltipShowType.getSelectedIndex() == 1;
seriesAttrContents.setShowMutiSeries(isShowMutiSeries); seriesAttrContents.setShowMutiSeries(isShowMutiSeries);
} }
seriesAttrContents.setFormat(valueFormat); seriesAttrContents.setFormat(valueFormat);
if(plot.isSupportValuePercent()) { if (plot.isSupportValuePercent()) {
if (percentFormat != null) { if (percentFormat != null) {
seriesAttrContents.setPercentFormat(percentFormat); seriesAttrContents.setPercentFormat(percentFormat);
} }
@ -786,23 +788,24 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
String contents = StringUtils.EMPTY; String contents = StringUtils.EMPTY;
contents += ChartConstants.SERIES_PARA + ChartConstants.BREAKLINE_PARA + ChartConstants.CATEGORY_PARA; contents += ChartConstants.SERIES_PARA + ChartConstants.BREAKLINE_PARA + ChartConstants.CATEGORY_PARA;
boolean noPara = true; boolean noPara = true;
if(isDatapointValue.isSelected()){ if (isDatapointValue.isSelected()) {
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.VALUE_PARA; contents += ChartConstants.BREAKLINE_PARA + ChartConstants.VALUE_PARA;
noPara = false; noPara = false;
} }
if(isAddressTittle.isSelected()){ if (isAddressTittle.isSelected()) {
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.AREA_TITTLE_PARA; contents += ChartConstants.BREAKLINE_PARA + ChartConstants.AREA_TITTLE_PARA;
noPara = false; noPara = false;
} }
if(isAddress.isSelected()){ if (isAddress.isSelected()) {
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_PARA; contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_PARA;
noPara = false; noPara = false;
} }
if(isAddressName.isSelected()){ if (isAddressName.isSelected()) {
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_NAME_PARA;; contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_NAME_PARA;
;
noPara = false; noPara = false;
} }
if(noPara){ if (noPara) {
contents = null; contents = null;
} }
@ -816,8 +819,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} }
private void updateAutoRefresh(Plot plot) { private void updateAutoRefresh(Plot plot) {
if(plot.isSupportAutoRefresh()) { if (plot.isSupportAutoRefresh()) {
if(isAutoRefresh.isSelected() && autoRefreshTime.getValue() >= 2) { if (isAutoRefresh.isSelected() && autoRefreshTime.getValue() >= 2) {
plot.setAutoRefreshPerSecond((int) autoRefreshTime.getValue()); plot.setAutoRefreshPerSecond((int) autoRefreshTime.getValue());
} else { } else {
plot.setAutoRefreshPerSecond(0); plot.setAutoRefreshPerSecond(0);
@ -831,62 +834,62 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
superLink.resetItemName(); superLink.resetItemName();
List list = superLink.updateBean(); List list = superLink.updateBean();
for(int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
UIMenuNameableCreator menu = (UIMenuNameableCreator)list.get(i); UIMenuNameableCreator menu = (UIMenuNameableCreator) list.get(i);
NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj()); NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript) menu.getObj());
nameGroup.addNameHyperlink(nameJava); nameGroup.addNameHyperlink(nameJava);
} }
plot.setHotHyperLink(nameGroup); plot.setHotHyperLink(nameGroup);
} }
protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) { protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) {
if(map.get(key) != null){ if (map.get(key) != null) {
return (Class<? extends BasicBeanPane>)map.get(key); return (Class<? extends BasicBeanPane>) map.get(key);
} }
//引擎在这边放了个provider。。 //引擎在这边放了个provider。。
Iterator iterator = map.keySet().iterator(); Iterator iterator = map.keySet().iterator();
while (iterator.hasNext()){ while (iterator.hasNext()) {
Class clz = (Class)iterator.next(); Class clz = (Class) iterator.next();
if(clz.isAssignableFrom((Class)key)){ if (clz.isAssignableFrom((Class) key)) {
return (Class<? extends BasicBeanPane>)map.get(clz); return (Class<? extends BasicBeanPane>) map.get(clz);
} }
} }
return null; return null;
} }
protected List<ChartUIMenuNameableCreator> refreshList(HashMap map) { protected List<ChartUIMenuNameableCreator> refreshList(HashMap map) {
List<ChartUIMenuNameableCreator> list = new ArrayList<ChartUIMenuNameableCreator>(); List<ChartUIMenuNameableCreator> list = new ArrayList<ChartUIMenuNameableCreator>();
java.util.HashMap<String, Formula> hyperLinkEditorMap = plot.getHyperLinkEditorMap(); java.util.HashMap<String, Formula> 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))); 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_Mail"), new EmailJavaScript(), ChartEmailPane.class));
list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Web"), list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Web"),
new WebHyperlink(), getUseMap(map, WebHyperlink.class))); new WebHyperlink(), getUseMap(map, WebHyperlink.class)));
list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Dynamic_Parameters"), list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Dynamic_Parameters"),
new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class))); new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class)));
list.add(new ChartUIMenuNameableCreator(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))); 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))); 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))); 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"), list.add(new ChartUIMenuNameableCreator(hyperLinkEditorMap, Inter.getLocText("Chart-Link_Form"),
hyperlink, getUseMap(map, FormHyperlinkProvider.class))); hyperlink, getUseMap(map, FormHyperlinkProvider.class)));
return list; return list;
} }
private HashMap getPlotHyperMap() { private HashMap getPlotHyperMap() {
if(normalMap.isEmpty()) { if (normalMap.isEmpty()) {
FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.class); normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.class);
normalMap.put(EmailJavaScript.class, ChartEmailPane.class); normalMap.put(EmailJavaScript.class, ChartEmailPane.class);
normalMap.put(WebHyperlink.class, WebHyperlinkPane.class); normalMap.put(WebHyperlink.class, WebHyperlinkPane.class);
@ -899,33 +902,33 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
normalMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.class); normalMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.class);
//兼容老的FormHyperlink.class //兼容老的FormHyperlink.class
if(fp != null){ if (fp != null) {
normalMap.put(fp.getClass(), FormHyperlinkPane.class); normalMap.put(fp.getClass(), FormHyperlinkPane.class);
} }
} }
return normalMap; return normalMap;
} }
@Override @Override
public Chart updateBean() { public Chart updateBean() {
return null; return null;
} }
/** /**
* 给组件登记一个观察者监听事件 * 给组件登记一个观察者监听事件
* *
* @param listener 观察者监听事件 * @param listener 观察者监听事件
*/ */
public void registerChangeListener(UIObserverListener listener) { public void registerChangeListener(UIObserverListener listener) {
timeSwitch.registerChangeListener(listener); timeSwitch.registerChangeListener(listener);
timeSwitchPane.registerChangeListener(listener); timeSwitchPane.registerChangeListener(listener);
} }
/** /**
* 组件是否需要响应添加的观察者事件 * 组件是否需要响应添加的观察者事件
* *
* @return 如果需要响应观察者事件则返回true否则返回false * @return 如果需要响应观察者事件则返回true否则返回false
*/ */
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return true; return true;
} }

Loading…
Cancel
Save