|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package com.fr.van.chart.designer.other; |
|
|
|
|
|
|
|
|
|
import com.fine.swing.ui.layout.Column; |
|
|
|
|
import com.fine.theme.utils.FineLayoutBuilder; |
|
|
|
|
import com.fr.base.BaseFormula; |
|
|
|
|
import com.fr.base.Utils; |
|
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
@ -7,6 +9,7 @@ import com.fr.chart.chartattr.Plot;
|
|
|
|
|
import com.fr.chart.chartglyph.ConditionAttr; |
|
|
|
|
import com.fr.chart.chartglyph.ConditionCollection; |
|
|
|
|
import com.fr.chartx.attr.LargeDataModeType; |
|
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
import com.fr.design.formula.DefaultTinyFormulaPane; |
|
|
|
|
import com.fr.design.formula.TinyFormulaPane; |
|
|
|
|
import com.fr.design.gui.frpane.UINumberDragPane; |
|
|
|
@ -20,7 +23,6 @@ import com.fr.design.gui.ispinner.UISpinner;
|
|
|
|
|
import com.fr.design.gui.ispinner.UnsignedIntUISpinner; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.mainframe.chart.mode.ChartEditContext; |
|
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
|
|
|
@ -48,11 +50,9 @@ 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.CardLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
@ -127,30 +127,23 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel getInteractivePane(VanChartPlot plot) { |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
double[] rowSize = {p, p, p, p, p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = ChartEditContext.normalMode() ? new Component[][]{ |
|
|
|
|
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, |
|
|
|
|
new Component[]{createToolBarPane(), null}, |
|
|
|
|
//大数据模式 恢复用注释。取消注释。
|
|
|
|
|
//new Component[]{createLargeDataModePane(), null},
|
|
|
|
|
new Component[]{createAnimationPane(), null}, |
|
|
|
|
new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null}, |
|
|
|
|
new Component[]{createAxisRotationPane(plot), null}, |
|
|
|
|
new Component[]{createZoomPane(plot), null}, |
|
|
|
|
new Component[]{createAutoRefreshPane(plot), null}, |
|
|
|
|
new Component[]{createHyperlinkPane(), null} |
|
|
|
|
} : new Component[][]{ |
|
|
|
|
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, |
|
|
|
|
new Component[]{createToolBarPane(), null}, |
|
|
|
|
new Component[]{createAnimationPane(), null}, |
|
|
|
|
new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null}, |
|
|
|
|
new Component[]{createZoomPane(plot), null} |
|
|
|
|
new Component[]{createAxisRotationPane(plot), null}, |
|
|
|
|
new Component[]{createZoomPane(plot, false), null} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 0}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//大数据模式 恢复用注释。取消注释。
|
|
|
|
@ -192,27 +185,25 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createZoomPane(VanChartPlot plot) { |
|
|
|
|
//图表缩放新设计 恢复用注释。取消注释。
|
|
|
|
|
// zoomPane = createZoomPane();
|
|
|
|
|
// if (zoomPane == null) {
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
// return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane);
|
|
|
|
|
return this.createZoomPane(plot, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//图表缩放新设计 恢复用注释。删除下面方法体所有代码。
|
|
|
|
|
protected JPanel createZoomPane(VanChartPlot plot, boolean withUnderline) { |
|
|
|
|
if (!plot.isSupportZoomDirection()) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
zoomWidget = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Open_Zoom_Control")); |
|
|
|
|
zoomGesture = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}); |
|
|
|
|
JPanel zoomWidgetPane = TableLayout4VanChartHelper.createGapTableLayoutPaneWithoutTop(Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget"), zoomWidget); |
|
|
|
|
JPanel zoomGesturePane = TableLayout4VanChartHelper.createGapTableLayoutPaneWithoutTop(Toolkit.i18nText("Fine-Design_Chart_ZoomGesture"), zoomGesture); |
|
|
|
|
JPanel zoomWidgetPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, |
|
|
|
|
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget")), zoomWidget); |
|
|
|
|
JPanel zoomGesturePane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, |
|
|
|
|
new UILabel(Toolkit.i18nText("Fine-Design_Chart_ZoomGesture")), zoomGesture); |
|
|
|
|
zoomType = new UIButtonGroup(getNameArray(), getValueArray()); |
|
|
|
|
zoomTypePane = getZoomTypePane(zoomType); |
|
|
|
|
|
|
|
|
|
JPanel panel = createZoomPaneContent(zoomWidgetPane, zoomGesturePane, plot); |
|
|
|
|
zoomWidget.addActionListener((event) -> checkZoomPane()); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel); |
|
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel, withUnderline); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createChangeEnablePane(VanChartRectanglePlot plot) { |
|
|
|
@ -235,17 +226,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
centerPane.add(scaleAxisPane, scaleAxis); |
|
|
|
|
centerPane.add(scrollPane, scroll); |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
double[] row = {p, p}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Control_Type")), controlType}, |
|
|
|
|
new Component[]{centerPane, null} |
|
|
|
|
}; |
|
|
|
|
changeEnablePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize); |
|
|
|
|
changeEnablePane.setBorder(BorderFactory.createEmptyBorder(5, 12, 0, 0)); |
|
|
|
|
changeEnablePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
|
|
|
|
|
controlType.addActionListener((event) -> checkCardPane()); |
|
|
|
|
} |
|
|
|
@ -259,14 +244,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_From")), from}, |
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_To")), to}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
double[] row = {p, p, p}; |
|
|
|
|
JPanel resizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize); |
|
|
|
|
return resizePane; |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -274,11 +252,6 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
VanChartAxis vanChartAxis = plot.getCategoryAxisList().get(0); |
|
|
|
|
AxisType axisType = vanChartAxis.getAxisType(); |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
double[] row = {p}; |
|
|
|
|
Component[][] components; |
|
|
|
|
if (axisType == AxisType.AXIS_CATEGORY) { |
|
|
|
|
categoryNum = new UnsignedIntUISpinner(1, Double.MAX_VALUE, 1); |
|
|
|
@ -291,7 +264,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Scaling")), scaling}, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void checkCardPane() { |
|
|
|
@ -312,13 +285,14 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, VanChartPlot plot) { |
|
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 4)); |
|
|
|
|
Column panel = new Column(); |
|
|
|
|
panel.setSpacing(10); |
|
|
|
|
if (plot.isSupportZoomCategoryAxis()) {//支持缩放控件
|
|
|
|
|
createChangeEnablePane((VanChartRectanglePlot) plot); |
|
|
|
|
panel.add(zoomWidgetPane, BorderLayout.NORTH); |
|
|
|
|
panel.add(changeEnablePane, BorderLayout.CENTER); |
|
|
|
|
panel.add(zoomWidgetPane); |
|
|
|
|
panel.add(changeEnablePane); |
|
|
|
|
} |
|
|
|
|
panel.add(zoomTypePane, BorderLayout.SOUTH); |
|
|
|
|
panel.add(zoomTypePane); |
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -430,7 +404,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot) { |
|
|
|
|
private JPanel createAxisRotationPane(VanChartPlot plot) { |
|
|
|
|
if (!(plot.getAxisPlotType() == AxisPlotType.RECTANGLE)) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
@ -449,12 +423,12 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")), axisRotation} |
|
|
|
|
}; |
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel); |
|
|
|
|
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createToolBarPane(double[] row, double[] col) { |
|
|
|
|
protected JPanel createToolBarPane() { |
|
|
|
|
isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort")); |
|
|
|
|
exportImages = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Export_Image")); |
|
|
|
|
fullScreenDisplay = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_FullScreen_Display")); |
|
|
|
@ -462,8 +436,8 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
|
|
|
|
|
Component[][] components = createToolBarComponents(); |
|
|
|
|
|
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel); |
|
|
|
|
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected double[] getToolBarRowSize() { |
|
|
|
@ -492,24 +466,19 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
protected JPanel createAnimationPane() { |
|
|
|
|
isChartAnimation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); |
|
|
|
|
chartAnimationLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Animation_Effects")); |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
double[] rowSize = {p, p}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{chartAnimationLabel, isChartAnimation} |
|
|
|
|
}; |
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel); |
|
|
|
|
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createAutoRefreshPane(VanChartPlot plot) { |
|
|
|
|
|
|
|
|
|
autoRefreshPane = getMoreLabelPane(plot); |
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Moniter_refresh"), autoRefreshPane); |
|
|
|
|
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Moniter_refresh"), autoRefreshPane, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { |
|
|
|
@ -519,7 +488,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
|
|
|
|
|
|
|
|
|
|
protected JPanel createHyperlinkPane() { |
|
|
|
|
superLink = new VanChartHyperLinkPane(); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink); |
|
|
|
|
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkLargeDataMode() { |
|
|
|
|