|
|
@ -1,36 +1,39 @@ |
|
|
|
package com.fr.van.chart.designer.other; |
|
|
|
package com.fr.van.chart.designer.other; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseFormula; |
|
|
|
|
|
|
|
import com.fr.base.Utils; |
|
|
|
|
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
import com.fr.design.formula.TinyFormulaPane; |
|
|
|
import com.fr.chart.chartglyph.ConditionAttr; |
|
|
|
|
|
|
|
import com.fr.chart.chartglyph.ConditionCollection; |
|
|
|
|
|
|
|
import com.fr.chartx.attr.LargeDataAttribute; |
|
|
|
|
|
|
|
import com.fr.chartx.attr.LargeDataModeType; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIToggleButton; |
|
|
|
import com.fr.design.gui.ibutton.UIToggleButton; |
|
|
|
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.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
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.plugin.chart.attr.axis.VanChartAxis; |
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartPlot; |
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartPlot; |
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; |
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; |
|
|
|
import com.fr.plugin.chart.axis.type.AxisPlotType; |
|
|
|
import com.fr.plugin.chart.axis.type.AxisPlotType; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.AttrEffect; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.AttrLabel; |
|
|
|
import com.fr.plugin.chart.base.RefreshMoreLabel; |
|
|
|
import com.fr.plugin.chart.base.RefreshMoreLabel; |
|
|
|
import com.fr.plugin.chart.base.VanChartConstants; |
|
|
|
import com.fr.plugin.chart.base.VanChartAttrMarker; |
|
|
|
import com.fr.plugin.chart.base.VanChartTools; |
|
|
|
import com.fr.plugin.chart.base.VanChartTools; |
|
|
|
import com.fr.plugin.chart.base.VanChartZoom; |
|
|
|
import com.fr.plugin.chart.map.line.condition.AttrLineEffect; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; |
|
|
|
import com.fr.plugin.chart.vanchart.VanChart; |
|
|
|
import com.fr.plugin.chart.vanchart.VanChart; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
|
|
|
import com.fr.van.chart.custom.component.VanChartHyperLinkPane; |
|
|
|
import com.fr.van.chart.custom.component.VanChartHyperLinkPane; |
|
|
|
import com.fr.van.chart.designer.AbstractVanChartScrollPane; |
|
|
|
import com.fr.van.chart.designer.AbstractVanChartScrollPane; |
|
|
|
import com.fr.van.chart.designer.PlotFactory; |
|
|
|
import com.fr.van.chart.designer.PlotFactory; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
|
|
|
import com.fr.van.chart.designer.other.zoom.ZoomPane; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
@ -46,6 +49,10 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
protected UICheckBox fullScreenDisplay; |
|
|
|
protected UICheckBox fullScreenDisplay; |
|
|
|
protected UIToggleButton collapse; |
|
|
|
protected UIToggleButton collapse; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected VanChart chart; |
|
|
|
|
|
|
|
private UIComboBox largeDataMode; |
|
|
|
|
|
|
|
private UISpinner largeModeThresholdNumber; |
|
|
|
|
|
|
|
|
|
|
|
protected UIButtonGroup isChartAnimation; |
|
|
|
protected UIButtonGroup isChartAnimation; |
|
|
|
|
|
|
|
|
|
|
|
//坐标轴翻转属性
|
|
|
|
//坐标轴翻转属性
|
|
|
@ -53,22 +60,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
|
|
|
|
|
|
|
|
private AutoRefreshPane autoRefreshPane; |
|
|
|
private AutoRefreshPane autoRefreshPane; |
|
|
|
|
|
|
|
|
|
|
|
private UIButtonGroup zoomWidget; |
|
|
|
private ZoomPane zoomPane; |
|
|
|
protected UIButtonGroup zoomGesture;//地图手势缩放
|
|
|
|
|
|
|
|
private UIButtonGroup zoomResize; |
|
|
|
|
|
|
|
private TinyFormulaPane from; |
|
|
|
|
|
|
|
private TinyFormulaPane to; |
|
|
|
|
|
|
|
private UIButtonGroup<String> zoomType; |
|
|
|
|
|
|
|
private JPanel changeEnablePane; |
|
|
|
|
|
|
|
private JPanel zoomTypePane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected VanChartHyperLinkPane superLink; |
|
|
|
protected VanChartHyperLinkPane superLink; |
|
|
|
|
|
|
|
private JPanel largeModeThresholdNumberPane; |
|
|
|
protected Chart chart; |
|
|
|
|
|
|
|
protected JPanel interactivePane; |
|
|
|
protected JPanel interactivePane; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 界面标题. |
|
|
|
* 界面标题. |
|
|
|
|
|
|
|
* |
|
|
|
* @return 返回标题. |
|
|
|
* @return 返回标题. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
@ -100,6 +100,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, |
|
|
|
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, |
|
|
|
|
|
|
|
new Component[]{createLargeDataModePane(), null}, |
|
|
|
new Component[]{createAnimationPane(), null}, |
|
|
|
new Component[]{createAnimationPane(), null}, |
|
|
|
new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null}, |
|
|
|
new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null}, |
|
|
|
new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null}, |
|
|
|
new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null}, |
|
|
@ -110,55 +111,53 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) { |
|
|
|
private JPanel createLargeDataModePane() { |
|
|
|
if (!plot.isSupportZoomDirection()) { |
|
|
|
if (!isCurrentChartSupportLargeDataMode()) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
zoomWidget = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); |
|
|
|
largeDataMode = new UIComboBox(new LargeDataModeType[]{LargeDataModeType.CLOSE, LargeDataModeType.OPEN_BEYOND_THRESHOLD}); |
|
|
|
zoomResize = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Change"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Non_Adjustment")}); |
|
|
|
largeModeThresholdNumber = new UISpinner(0, Integer.MAX_VALUE, 100, chart.getPlot().getLargeDataAttribute().getLargeModeThresholdNumber()); |
|
|
|
from = new TinyFormulaPane(); |
|
|
|
|
|
|
|
to = new TinyFormulaPane(); |
|
|
|
|
|
|
|
zoomType = new UIButtonGroup(getNameArray(), getValueArray()); |
|
|
|
|
|
|
|
zoomGesture = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel zoomWidgetPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget"), zoomWidget); |
|
|
|
|
|
|
|
JPanel zoomGesturePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ZoomGesture"), zoomGesture); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Boundary")), zoomResize}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_From")), from}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_To")), to}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
largeDataMode.addActionListener(new ActionListener() { |
|
|
|
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; |
|
|
|
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
|
|
|
changeEnablePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize); |
|
|
|
|
|
|
|
changeEnablePane.setBorder(BorderFactory.createEmptyBorder(10,12,0,0)); |
|
|
|
|
|
|
|
zoomTypePane = getzoomTypePane(zoomType); |
|
|
|
|
|
|
|
JPanel panel = createZoomPaneContent(zoomWidgetPane, zoomGesturePane, changeEnablePane, zoomTypePane, plot); |
|
|
|
|
|
|
|
zoomWidget.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
checkZoomPane(); |
|
|
|
checkLargeDataMode(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel); |
|
|
|
|
|
|
|
} |
|
|
|
Component[][] comps1 = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Large_Model")), largeDataMode} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
Component[][] comps2 = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Threshold_Number")), largeModeThresholdNumber} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] row = {TableLayout.PREFERRED}, col = {TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getzoomTypePane(UIButtonGroup zoomType) { |
|
|
|
JPanel contentPane = new JPanel(new BorderLayout(0, 6)); |
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction"), zoomType); |
|
|
|
|
|
|
|
|
|
|
|
contentPane.add(TableLayout4VanChartHelper.createGapTableLayoutPane(comps1, row, col), BorderLayout.CENTER); |
|
|
|
|
|
|
|
largeModeThresholdNumberPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps2, row, col); |
|
|
|
|
|
|
|
contentPane.add(largeModeThresholdNumberPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), contentPane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected boolean isCurrentChartSupportLargeDataMode() { |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, JPanel changeEnablePane, JPanel zoomTypePane, VanChartPlot plot) { |
|
|
|
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) { |
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 4)); |
|
|
|
zoomPane = createZoomPane(); |
|
|
|
if (plot.isSupportZoomCategoryAxis()) {//支持缩放控件
|
|
|
|
if (zoomPane == null) { |
|
|
|
panel.add(zoomWidgetPane, BorderLayout.NORTH); |
|
|
|
return null; |
|
|
|
panel.add(changeEnablePane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
panel.add(zoomTypePane, BorderLayout.SOUTH); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane); |
|
|
|
return panel; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ZoomPane createZoomPane() { |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot) { |
|
|
|
private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot) { |
|
|
@ -167,12 +166,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
} |
|
|
|
} |
|
|
|
axisRotation = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), |
|
|
|
axisRotation = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); |
|
|
|
axisRotation.addChangeListener(new ChangeListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
|
|
|
checkZoomEnabled(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")), axisRotation} |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")), axisRotation} |
|
|
@ -181,28 +175,6 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkZoomEnabled() { |
|
|
|
|
|
|
|
if (zoomWidget != null && axisRotation != null) { |
|
|
|
|
|
|
|
if (axisRotation.getSelectedIndex() == 0) { |
|
|
|
|
|
|
|
//只有开启坐标轴翻转,才需要将缩放控件强制关闭。
|
|
|
|
|
|
|
|
zoomWidget.setSelectedIndex(1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
checkZoomPane(); |
|
|
|
|
|
|
|
zoomWidget.setEnabled(axisRotation.getSelectedIndex() == 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected String[] getNameArray() { |
|
|
|
|
|
|
|
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_X_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Y_Axis") |
|
|
|
|
|
|
|
,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected String[] getValueArray() { |
|
|
|
|
|
|
|
return new String[]{VanChartConstants.ZOOM_TYPE_X, VanChartConstants.ZOOM_TYPE_Y |
|
|
|
|
|
|
|
,VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createToolBarPane(double[] row, double[] col) { |
|
|
|
protected JPanel createToolBarPane(double[] row, double[] col) { |
|
|
|
isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort")); |
|
|
|
isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort")); |
|
|
@ -254,7 +226,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
|
|
|
|
|
|
|
|
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { |
|
|
|
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { |
|
|
|
boolean isLargeModel = largeModel(plot); |
|
|
|
boolean isLargeModel = largeModel(plot); |
|
|
|
return new AutoRefreshPane((VanChart) chart, isLargeModel); |
|
|
|
return new AutoRefreshPane(chart, isLargeModel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createHyperlinkPane() { |
|
|
|
protected JPanel createHyperlinkPane() { |
|
|
@ -262,11 +234,42 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void checkLargeDataMode() { |
|
|
|
|
|
|
|
largeModeThresholdNumberPane.setVisible(largeDataMode.getSelectedItem() == LargeDataModeType.OPEN_BEYOND_THRESHOLD); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resetAttr(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void resetAttr() { |
|
|
|
|
|
|
|
if (largeDataMode.getSelectedItem() == LargeDataModeType.OPEN_BEYOND_THRESHOLD) { |
|
|
|
|
|
|
|
VanChartPlot plot = this.chart.getPlot(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AttrLabel attrLabel = plot.getAttrLabelFromConditionCollection(); |
|
|
|
|
|
|
|
if (attrLabel == null) { |
|
|
|
|
|
|
|
attrLabel = plot.getDefaultAttrLabel(); |
|
|
|
|
|
|
|
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr(); |
|
|
|
|
|
|
|
defaultAttr.addDataSeriesCondition(attrLabel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
attrLabel.setEnable(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resetCustomCondition(plot.getConditionCollection()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void resetCustomCondition(ConditionCollection conditionCollection) { |
|
|
|
|
|
|
|
for (int i = 0, len = conditionCollection.getConditionAttrSize(); i < len; i++) { |
|
|
|
|
|
|
|
ConditionAttr conditionAttr = conditionCollection.getConditionAttr(i); |
|
|
|
|
|
|
|
conditionAttr.remove(AttrLabel.class); |
|
|
|
|
|
|
|
conditionAttr.remove(ScatterAttrLabel.class); |
|
|
|
|
|
|
|
conditionAttr.remove(AttrEffect.class); |
|
|
|
|
|
|
|
conditionAttr.remove(AttrLineEffect.class); |
|
|
|
|
|
|
|
|
|
|
|
private void checkZoomPane() { |
|
|
|
VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class); |
|
|
|
boolean zoomWidgetEnabled = zoomWidget.getSelectedIndex() == 0; |
|
|
|
if (attrMarker != null && !attrMarker.isCommon()) { |
|
|
|
changeEnablePane.setVisible(zoomWidgetEnabled); |
|
|
|
conditionAttr.remove(VanChartAttrMarker.class); |
|
|
|
zoomType.setEnabled(!zoomWidgetEnabled); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -274,29 +277,28 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
if (chart == null || chart.getPlot() == null) { |
|
|
|
if (chart == null || chart.getPlot() == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
this.chart = chart; |
|
|
|
this.chart = (VanChart) chart; |
|
|
|
VanChartPlot plot = (VanChartPlot)chart.getPlot(); |
|
|
|
VanChartPlot plot = chart.getPlot(); |
|
|
|
|
|
|
|
|
|
|
|
if (interactivePane == null) { |
|
|
|
if (interactivePane == null) { |
|
|
|
this.remove(leftcontentPane); |
|
|
|
this.remove(leftcontentPane); |
|
|
|
reLayoutContentPane(plot); |
|
|
|
reLayoutContentPane(plot); |
|
|
|
} |
|
|
|
} |
|
|
|
if(plot.isSupportZoomDirection()){//支持缩放方向=方向+控件
|
|
|
|
|
|
|
|
populateChartZoom((VanChart)chart); |
|
|
|
if (zoomPane != null) { |
|
|
|
checkZoomPane(); |
|
|
|
zoomPane.populateBean(this.chart.getZoomAttribute()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) { |
|
|
|
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) { |
|
|
|
populateChartAxisRotation(plot); |
|
|
|
populateChartAxisRotation(plot); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
populateChartTools((VanChart) chart); |
|
|
|
populateChartTools(this.chart); |
|
|
|
populateChartAnimate(chart, plot); |
|
|
|
populateLargeMode(plot); |
|
|
|
populateAutoRefresh((VanChart)chart); |
|
|
|
populateChartAnimate(this.chart, plot); |
|
|
|
|
|
|
|
populateAutoRefresh(this.chart); |
|
|
|
|
|
|
|
|
|
|
|
populateHyperlink(plot); |
|
|
|
populateHyperlink(plot); |
|
|
|
|
|
|
|
|
|
|
|
checkZoomEnabled(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -312,25 +314,13 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
collapse.setSelected(vanChartTools.isHidden()); |
|
|
|
collapse.setSelected(vanChartTools.isHidden()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void populateChartZoom(VanChart chart) { |
|
|
|
private void populateLargeMode(Plot plot) { |
|
|
|
VanChartZoom zoom = chart.getVanChartZoom(); |
|
|
|
if (largeDataMode != null) { |
|
|
|
if(zoom == null){ |
|
|
|
LargeDataAttribute attribute = plot.getLargeDataAttribute(); |
|
|
|
zoom = new VanChartZoom(); |
|
|
|
|
|
|
|
} |
|
|
|
largeDataMode.setSelectedItem(attribute.getLargeDataModeType()); |
|
|
|
zoomWidget.setSelectedIndex(zoom.isZoomVisible() ? 0 : 1); |
|
|
|
largeModeThresholdNumber.setValue(attribute.getLargeModeThresholdNumber()); |
|
|
|
zoomGesture.setSelectedIndex(zoom.isZoomGesture() ? 0 : 1); |
|
|
|
|
|
|
|
zoomResize.setSelectedIndex(zoom.isZoomResize() ? 0 : 1); |
|
|
|
|
|
|
|
if (zoom.getFrom() instanceof BaseFormula) { |
|
|
|
|
|
|
|
from.populateBean(((BaseFormula) zoom.getFrom()).getContent()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
from.populateBean(Utils.objectToString(zoom.getFrom())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (zoom.getTo() instanceof BaseFormula) { |
|
|
|
|
|
|
|
to.populateBean(((BaseFormula) zoom.getTo()).getContent()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
to.populateBean(Utils.objectToString(zoom.getTo())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
zoomType.setSelectedItem(zoom.getZoomType()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void populateChartAxisRotation(VanChartPlot plot) { |
|
|
|
private void populateChartAxisRotation(VanChartPlot plot) { |
|
|
@ -349,7 +339,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void populateAutoRefresh(VanChart chart) { |
|
|
|
protected void populateAutoRefresh(VanChart chart) { |
|
|
|
VanChartPlot plot = (VanChartPlot)chart.getPlot(); |
|
|
|
VanChartPlot plot = chart.getPlot(); |
|
|
|
|
|
|
|
|
|
|
|
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel(); |
|
|
|
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel(); |
|
|
|
if (refreshMoreLabel == null) { |
|
|
|
if (refreshMoreLabel == null) { |
|
|
@ -366,17 +356,20 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
VanChartPlot plot = (VanChartPlot)chart.getPlot(); |
|
|
|
VanChart vanChart = (VanChart) chart; |
|
|
|
|
|
|
|
VanChartPlot plot = chart.getPlot(); |
|
|
|
|
|
|
|
|
|
|
|
if(plot.isSupportZoomDirection()){ |
|
|
|
if (zoomPane != null) { |
|
|
|
updateChartZoom((VanChart)chart); |
|
|
|
vanChart.setZoomAttribute(zoomPane.updateBean()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) { |
|
|
|
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) { |
|
|
|
updateChartAxisRotation((VanChart)chart); |
|
|
|
updateChartAxisRotation(vanChart); |
|
|
|
} |
|
|
|
} |
|
|
|
updateChartTools((VanChart)chart); |
|
|
|
updateChartTools(vanChart); |
|
|
|
updateChartAnimate(chart, plot); |
|
|
|
updateChartAnimate(vanChart, plot); |
|
|
|
updateAutoRefresh((VanChart)chart); |
|
|
|
updateLargeData(plot); |
|
|
|
|
|
|
|
updateAutoRefresh(vanChart); |
|
|
|
updateHyperlink(plot); |
|
|
|
updateHyperlink(plot); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -393,37 +386,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
chart.setVanChartTools(vanChartTools); |
|
|
|
chart.setVanChartTools(vanChartTools); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void updateChartZoom(VanChart chart) { |
|
|
|
|
|
|
|
VanChartZoom zoom = chart.getVanChartZoom(); |
|
|
|
|
|
|
|
if(zoom == null){ |
|
|
|
|
|
|
|
zoom = new VanChartZoom(); |
|
|
|
|
|
|
|
chart.setVanChartZoom(zoom); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
zoom.setZoomVisible(zoomWidget.getSelectedIndex() == 0); |
|
|
|
|
|
|
|
zoom.setZoomGesture(zoomGesture.getSelectedIndex() == 0); |
|
|
|
|
|
|
|
zoom.setZoomResize(zoomResize.getSelectedIndex() == 0); |
|
|
|
|
|
|
|
String fromString = from.updateBean(); |
|
|
|
|
|
|
|
Object fromObject; |
|
|
|
|
|
|
|
if (StableUtils.maybeFormula(fromString)) { |
|
|
|
|
|
|
|
fromObject = BaseFormula.createFormulaBuilder().build(fromString); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
fromObject = fromString; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
zoom.setFrom(fromObject); |
|
|
|
|
|
|
|
String toString = to.updateBean(); |
|
|
|
|
|
|
|
Object toObject; |
|
|
|
|
|
|
|
if (StableUtils.maybeFormula(toString)) { |
|
|
|
|
|
|
|
toObject = BaseFormula.createFormulaBuilder().build(toString); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
toObject = toString; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
zoom.setTo(toObject); |
|
|
|
|
|
|
|
zoom.setZoomType(zoomType.getSelectedItem()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateChartAxisRotation(VanChart chart) { |
|
|
|
private void updateChartAxisRotation(VanChart chart) { |
|
|
|
//坐标轴和plot都需要这个属性,因为坐标轴和plot是分开画的
|
|
|
|
//坐标轴和plot都需要这个属性,因为坐标轴和plot是分开画的
|
|
|
|
VanChartPlot plot = (VanChartPlot) chart.getPlot(); |
|
|
|
VanChartPlot plot = chart.getPlot(); |
|
|
|
plot.setAxisRotation(axisRotation.getSelectedIndex() == 0); |
|
|
|
plot.setAxisRotation(axisRotation.getSelectedIndex() == 0); |
|
|
|
//同时更新坐标轴旋转属性
|
|
|
|
//同时更新坐标轴旋转属性
|
|
|
|
for (VanChartAxis axis : ((VanChartRectanglePlot) plot).getXAxisList()) { |
|
|
|
for (VanChartAxis axis : ((VanChartRectanglePlot) plot).getXAxisList()) { |
|
|
@ -440,6 +405,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateLargeData(Plot plot) { |
|
|
|
|
|
|
|
if (largeDataMode != null) { |
|
|
|
|
|
|
|
LargeDataAttribute attribute = new LargeDataAttribute(); |
|
|
|
|
|
|
|
attribute.setLargeDataModeType((LargeDataModeType) largeDataMode.getSelectedItem()); |
|
|
|
|
|
|
|
attribute.setLargeModeThresholdNumber(largeModeThresholdNumber.getValue()); |
|
|
|
|
|
|
|
plot.setLargeDataAttribute(attribute); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void updateChartAnimate(Chart chart, Plot plot) { |
|
|
|
private void updateChartAnimate(Chart chart, Plot plot) { |
|
|
|
if (plot.isSupportAnimate()) { |
|
|
|
if (plot.isSupportAnimate()) { |
|
|
|
chart.setJSDraw(isChartAnimation.getSelectedIndex() == 0); |
|
|
|
chart.setJSDraw(isChartAnimation.getSelectedIndex() == 0); |
|
|
@ -458,7 +432,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Chart updateBean() { |
|
|
|
public VanChart updateBean() { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|