|
|
|
@ -1,36 +1,39 @@
|
|
|
|
|
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.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.UIToggleButton; |
|
|
|
|
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.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
|
|
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
|
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartPlot; |
|
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; |
|
|
|
|
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.VanChartConstants; |
|
|
|
|
import com.fr.plugin.chart.base.VanChartAttrMarker; |
|
|
|
|
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.stable.StableUtils; |
|
|
|
|
import com.fr.van.chart.custom.component.VanChartHyperLinkPane; |
|
|
|
|
import com.fr.van.chart.designer.AbstractVanChartScrollPane; |
|
|
|
|
import com.fr.van.chart.designer.PlotFactory; |
|
|
|
|
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.event.ChangeEvent; |
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
@ -46,6 +49,10 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
protected UICheckBox fullScreenDisplay; |
|
|
|
|
protected UIToggleButton collapse; |
|
|
|
|
|
|
|
|
|
protected VanChart chart; |
|
|
|
|
private UIComboBox largeDataMode; |
|
|
|
|
private UISpinner largeModeThresholdNumber; |
|
|
|
|
|
|
|
|
|
protected UIButtonGroup isChartAnimation; |
|
|
|
|
|
|
|
|
|
//坐标轴翻转属性
|
|
|
|
@ -53,22 +60,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
|
|
|
|
|
private AutoRefreshPane autoRefreshPane; |
|
|
|
|
|
|
|
|
|
private UIButtonGroup zoomWidget; |
|
|
|
|
protected UIButtonGroup zoomGesture;//地图手势缩放
|
|
|
|
|
private UIButtonGroup zoomResize; |
|
|
|
|
private TinyFormulaPane from; |
|
|
|
|
private TinyFormulaPane to; |
|
|
|
|
private UIButtonGroup<String> zoomType; |
|
|
|
|
private JPanel changeEnablePane; |
|
|
|
|
private JPanel zoomTypePane; |
|
|
|
|
private ZoomPane zoomPane; |
|
|
|
|
|
|
|
|
|
protected VanChartHyperLinkPane superLink; |
|
|
|
|
|
|
|
|
|
protected Chart chart; |
|
|
|
|
private JPanel largeModeThresholdNumberPane; |
|
|
|
|
protected JPanel interactivePane; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 界面标题. |
|
|
|
|
* |
|
|
|
|
* @return 返回标题. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
@ -100,6 +100,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, |
|
|
|
|
new Component[]{createLargeDataModePane(), null}, |
|
|
|
|
new Component[]{createAnimationPane(), null}, |
|
|
|
|
new Component[]{createAxisRotationPane(new double[]{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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) { |
|
|
|
|
if (!plot.isSupportZoomDirection()) { |
|
|
|
|
private JPanel createLargeDataModePane() { |
|
|
|
|
if (!isCurrentChartSupportLargeDataMode()) { |
|
|
|
|
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")}); |
|
|
|
|
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")}); |
|
|
|
|
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}, |
|
|
|
|
}; |
|
|
|
|
largeDataMode = new UIComboBox(new LargeDataModeType[]{LargeDataModeType.CLOSE, LargeDataModeType.OPEN_BEYOND_THRESHOLD}); |
|
|
|
|
largeModeThresholdNumber = new UISpinner(0, Integer.MAX_VALUE, 100, chart.getPlot().getLargeDataAttribute().getLargeModeThresholdNumber()); |
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
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() { |
|
|
|
|
largeDataMode.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
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) { |
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction"), zoomType); |
|
|
|
|
JPanel contentPane = new JPanel(new BorderLayout(0, 6)); |
|
|
|
|
|
|
|
|
|
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) { |
|
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 4)); |
|
|
|
|
if (plot.isSupportZoomCategoryAxis()) {//支持缩放控件
|
|
|
|
|
panel.add(zoomWidgetPane, BorderLayout.NORTH); |
|
|
|
|
panel.add(changeEnablePane, BorderLayout.CENTER); |
|
|
|
|
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) { |
|
|
|
|
zoomPane = createZoomPane(); |
|
|
|
|
if (zoomPane == null) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
panel.add(zoomTypePane, BorderLayout.SOUTH); |
|
|
|
|
return panel; |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected ZoomPane createZoomPane() { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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"), |
|
|
|
|
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[][]{ |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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) { |
|
|
|
|
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) { |
|
|
|
|
boolean isLargeModel = largeModel(plot); |
|
|
|
|
return new AutoRefreshPane((VanChart) chart, isLargeModel); |
|
|
|
|
return new AutoRefreshPane(chart, isLargeModel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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() { |
|
|
|
|
boolean zoomWidgetEnabled = zoomWidget.getSelectedIndex() == 0; |
|
|
|
|
changeEnablePane.setVisible(zoomWidgetEnabled); |
|
|
|
|
zoomType.setEnabled(!zoomWidgetEnabled); |
|
|
|
|
VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class); |
|
|
|
|
if (attrMarker != null && !attrMarker.isCommon()) { |
|
|
|
|
conditionAttr.remove(VanChartAttrMarker.class); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -274,29 +277,28 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
if (chart == null || chart.getPlot() == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.chart = chart; |
|
|
|
|
VanChartPlot plot = (VanChartPlot)chart.getPlot(); |
|
|
|
|
this.chart = (VanChart) chart; |
|
|
|
|
VanChartPlot plot = chart.getPlot(); |
|
|
|
|
|
|
|
|
|
if (interactivePane == null) { |
|
|
|
|
this.remove(leftcontentPane); |
|
|
|
|
reLayoutContentPane(plot); |
|
|
|
|
} |
|
|
|
|
if(plot.isSupportZoomDirection()){//支持缩放方向=方向+控件
|
|
|
|
|
populateChartZoom((VanChart)chart); |
|
|
|
|
checkZoomPane(); |
|
|
|
|
|
|
|
|
|
if (zoomPane != null) { |
|
|
|
|
zoomPane.populateBean(this.chart.getZoomAttribute()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) { |
|
|
|
|
populateChartAxisRotation(plot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
populateChartTools((VanChart) chart); |
|
|
|
|
populateChartAnimate(chart, plot); |
|
|
|
|
populateAutoRefresh((VanChart)chart); |
|
|
|
|
populateChartTools(this.chart); |
|
|
|
|
populateLargeMode(plot); |
|
|
|
|
populateChartAnimate(this.chart, plot); |
|
|
|
|
populateAutoRefresh(this.chart); |
|
|
|
|
|
|
|
|
|
populateHyperlink(plot); |
|
|
|
|
|
|
|
|
|
checkZoomEnabled(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -312,25 +314,13 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
collapse.setSelected(vanChartTools.isHidden()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void populateChartZoom(VanChart chart) { |
|
|
|
|
VanChartZoom zoom = chart.getVanChartZoom(); |
|
|
|
|
if(zoom == null){ |
|
|
|
|
zoom = new VanChartZoom(); |
|
|
|
|
} |
|
|
|
|
zoomWidget.setSelectedIndex(zoom.isZoomVisible() ? 0 : 1); |
|
|
|
|
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())); |
|
|
|
|
private void populateLargeMode(Plot plot) { |
|
|
|
|
if (largeDataMode != null) { |
|
|
|
|
LargeDataAttribute attribute = plot.getLargeDataAttribute(); |
|
|
|
|
|
|
|
|
|
largeDataMode.setSelectedItem(attribute.getLargeDataModeType()); |
|
|
|
|
largeModeThresholdNumber.setValue(attribute.getLargeModeThresholdNumber()); |
|
|
|
|
} |
|
|
|
|
zoomType.setSelectedItem(zoom.getZoomType()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void populateChartAxisRotation(VanChartPlot plot) { |
|
|
|
@ -349,7 +339,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void populateAutoRefresh(VanChart chart) { |
|
|
|
|
VanChartPlot plot = (VanChartPlot)chart.getPlot(); |
|
|
|
|
VanChartPlot plot = chart.getPlot(); |
|
|
|
|
|
|
|
|
|
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel(); |
|
|
|
|
if (refreshMoreLabel == null) { |
|
|
|
@ -366,17 +356,20 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VanChartPlot plot = (VanChartPlot)chart.getPlot(); |
|
|
|
|
VanChart vanChart = (VanChart) chart; |
|
|
|
|
VanChartPlot plot = chart.getPlot(); |
|
|
|
|
|
|
|
|
|
if(plot.isSupportZoomDirection()){ |
|
|
|
|
updateChartZoom((VanChart)chart); |
|
|
|
|
if (zoomPane != null) { |
|
|
|
|
vanChart.setZoomAttribute(zoomPane.updateBean()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) { |
|
|
|
|
updateChartAxisRotation((VanChart)chart); |
|
|
|
|
updateChartAxisRotation(vanChart); |
|
|
|
|
} |
|
|
|
|
updateChartTools((VanChart)chart); |
|
|
|
|
updateChartAnimate(chart, plot); |
|
|
|
|
updateAutoRefresh((VanChart)chart); |
|
|
|
|
updateChartTools(vanChart); |
|
|
|
|
updateChartAnimate(vanChart, plot); |
|
|
|
|
updateLargeData(plot); |
|
|
|
|
updateAutoRefresh(vanChart); |
|
|
|
|
updateHyperlink(plot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -393,37 +386,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
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) { |
|
|
|
|
//坐标轴和plot都需要这个属性,因为坐标轴和plot是分开画的
|
|
|
|
|
VanChartPlot plot = (VanChartPlot) chart.getPlot(); |
|
|
|
|
VanChartPlot plot = chart.getPlot(); |
|
|
|
|
plot.setAxisRotation(axisRotation.getSelectedIndex() == 0); |
|
|
|
|
//同时更新坐标轴旋转属性
|
|
|
|
|
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) { |
|
|
|
|
if (plot.isSupportAnimate()) { |
|
|
|
|
chart.setJSDraw(isChartAnimation.getSelectedIndex() == 0); |
|
|
|
@ -458,7 +432,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Chart updateBean() { |
|
|
|
|
public VanChart updateBean() { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|