Browse Source

Merge pull request #1430 in DESIGN/design from ~ZHENG/c-design:feature/10.0 to feature/10.0

* commit '29cfb125c2bb99043ba808c4cc9c5f8a3cd846dc':
  CHART-12733 图表数据结构 地图相关 回退
  CHART-12733 线型支持虚线 补充网格线 警戒线 趋势线。 回退
  CHART-12733 图表数据结构 回退
  CHART-12733 大数据模式 回退
  CHART-12733 线型支持虚线 回退
  CHART-12733 轴标签缩略间隔显示 回退
  CHART-12733 标签的自动调整 回退
  CHART-12733 区域显示策略 回退
  CHART-12733 图表缩放新设计 回退
  CHART-12086 组合图中的饼图分类从不要回退到灰化,原因:标签提示超链等需要统一
research/11.0
zheng 5 years ago
parent
commit
10456cd69e
  1. 25
      designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java
  2. 2
      designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java
  3. 58
      designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java
  4. 10
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java
  5. 5
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java
  6. 6
      designer-chart/src/main/java/com/fr/van/chart/custom/CustomIndependentVanChartInterface.java
  7. 16
      designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java
  8. 43
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java
  9. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java
  10. 72
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java
  11. 267
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  12. 20
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePaneWithMapZoom.java
  13. 66
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  14. 64
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  15. 184
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  16. 36
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java
  17. 156
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java
  18. 50
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  19. 65
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  20. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  21. 7
      designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java
  22. 52
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java
  23. 39
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java
  24. 130
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java
  25. 116
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  26. 203
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java
  27. 170
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java
  28. 93
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java
  29. 25
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java
  30. 39
      designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java
  31. 30
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java
  32. 2
      designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java
  33. 71
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  34. 40
      designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java
  35. 84
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java
  36. 177
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java
  37. 121
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java
  38. 34
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java
  39. 23
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java
  40. 29
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java
  41. 40
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java
  42. 14
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java
  43. 64
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java
  44. 71
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java
  45. 36
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java
  46. 77
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java
  47. 48
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java
  48. 14
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java
  49. 26
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java
  50. 104
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java
  51. 100
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java
  52. 41
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java
  53. 122
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java
  54. 69
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java
  55. 18
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java
  56. 110
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java
  57. 24
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java
  58. 170
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java
  59. 176
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java
  60. 25
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java
  61. 224
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java
  62. 16
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java
  63. 5
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartLineMapConditionPane.java
  64. 25
      designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java
  65. 23
      designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java
  66. 2
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java
  67. 12
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java
  68. 36
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java
  69. 23
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractIndependentVanChartUI.java
  70. 130
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java
  71. 36
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java

25
designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java

@ -3,8 +3,6 @@ package com.fr.design.chartx;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.CustomChartDataDefinition;
import com.fr.design.chartx.fields.diff.FunnelCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.FunnelDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.GaugeCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.GaugeDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
@ -14,9 +12,12 @@ import com.fr.design.chartx.fields.diff.ScatterDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.ibutton.UITabGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
@ -102,7 +103,25 @@ public class CustomChartDataPane extends ChartDataPane {
case DIFFERENT_PIE:
case POINTER_180:
case POINTER_360:
return new SingleDataPane(new FunnelDataSetFieldsPane(), new FunnelCellDataFieldsPane());
return new SingleDataPane(new SingleCategoryDataSetFieldsPane() {
@Override
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
UIComboBox[] comboBoxes = super.filedComboBoxes();
for (UIComboBox comboBox : comboBoxes) {
comboBox.setEnabled(false);
}
}
}, new SingleCategoryCellDataFieldsPane() {
@Override
protected TinyFormulaPane[] formulaPanes() {
TinyFormulaPane[] tinyFormulaPanes = super.formulaPanes();
for (TinyFormulaPane tinyFormulaPane : tinyFormulaPanes) {
GUICoreUtils.setEnabled(tinyFormulaPane, false);
}
return tinyFormulaPanes;
}
});
default:
if (StringUtils.equals(CustomStyle.CUSTOM.toString(), plot.getCustomType())){
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());

2
designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java

@ -32,6 +32,8 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
new Component[]{createMarkerPane()},
new Component[]{createAreaFillColorPane()},
new Component[]{createStackedAndAxisPane()},
//大数据模式 恢复用注释。下面1行删除。
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};

58
designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java

@ -3,12 +3,6 @@ package com.fr.van.chart.bubble;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.ScatterDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
@ -19,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa
import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
@ -103,6 +98,24 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
VanChartOtherPane otherPane = new VanChartOtherPane() {
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithOutSort() {
//图表缩放新设计 恢复用注释。删除下面两个方法 getNameArray getValueArray。
protected String[] getNameArray() {
Plot plot = chart.getPlot();
if (plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
}
return super.getNameArray();
}
protected String[] getValueArray() {
Plot plot = chart.getPlot();
if (plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
return super.getValueArray();
}
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
@ -122,20 +135,21 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
return new VanChartBubbleConditionPane(plot);
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
VanChartBubblePlot plot = null;
if (getVanChart() != null) {
plot = getVanChart().getPlot();
}
if (plot != null && plot.isForceBubble()) {
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
}
return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane());
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// VanChartBubblePlot plot = null;
// if (getVanChart() != null) {
// plot = getVanChart().getPlot();
// }
// if (plot != null && plot.isForceBubble()) {
// return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
// }
// return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane());
// }
// };
// }
}

10
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java

@ -6,7 +6,6 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
@ -15,6 +14,7 @@ import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.bubble.BubbleIndependentVanChart;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
@ -123,7 +123,13 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
*/
@Override
protected void resetChartAttr4SamePlot(Chart chart) {
((VanChart) chart).setZoomAttribute(new ZoomAttribute());
//图表缩放新设计 恢复用注释。下面2行删除。
VanChartZoom vanChartZoom = new VanChartZoom();
((VanChart) chart).setVanChartZoom(vanChartZoom);
//图表缩放新设计 恢复用注释。下面一行取消注释。
//((VanChart) chart).setZoomAttribute(new ZoomAttribute());
//重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart) chart);
}

5
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java

@ -6,6 +6,7 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.van.chart.bubble.component.VanChartBubblePane;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
@ -42,6 +43,10 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
new Component[]{null}
};
if (!((VanChartBubblePlot) plot).isForceBubble()) {
components[3] = new Component[]{createLargeDataModelPane()};
}
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
return contentPane;
}

6
designer-chart/src/main/java/com/fr/van/chart/custom/CustomIndependentVanChartInterface.java

@ -1,6 +1,5 @@
package com.fr.van.chart.custom;
import com.fr.design.chartx.CustomChartDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -74,6 +73,9 @@ public class CustomIndependentVanChartInterface extends AbstractIndependentVanCh
}
public ChartDataPane getChartDataPane(AttributeChangeListener listener){
return new CustomChartDataPane(listener);
//图表数据结构 恢复用注释。下面1行删除。
return new VanChartCustomDataPane(listener);
//图表数据结构 恢复用注释。取消注释。
//return new CustomChartDataPane(listener);
}
}

16
designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java

@ -369,11 +369,19 @@ public class PlotFactory {
return formatPane;
}
/**
* 判断是否为大数据模式
*/
//大数据模式 恢复用注释。取消注释。
// public static boolean largeDataModel(Plot plot) {
// return plot != null && plot.convertDataProcessor().getMark() == LargeDataModel.MARK;
// }
//大数据模式 恢复用注释。删除下面2个方法 largeDataModel lineMapLargeModel。
public static boolean largeDataModel(Plot plot) {
return plot != null && plot.convertDataProcessor().getMark() == LargeDataModel.MARK;
return plot != null && plot.getDataProcessor().getMark() == LargeDataModel.MARK;
}
public static boolean lineMapLargeModel(Plot plot) {
return plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getLineMapDataProcessor().getMark() == LargeDataModel.MARK;
}
}

43
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.designer.component;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
@ -12,6 +13,8 @@ import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle;
import com.fr.plugin.chart.type.LineType;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
@ -27,6 +30,9 @@ import java.util.Arrays;
public class VanChartLineTypePane extends BasicPane {
private static final long serialVersionUID = -6581862503009962973L;
//线型支持虚线 恢复用注释。下面1行删除。
protected LineComboBox lineWidth;//线型
private LineTypeComboBox lineTypeComboBox;//线型
private UISpinner lineWidthSpinner;//线宽
protected UIButtonGroup<LineStyle> lineStyle;//形态
@ -36,6 +42,8 @@ public class VanChartLineTypePane extends BasicPane {
private JPanel lineStylePane;
public VanChartLineTypePane() {
//线型支持虚线 恢复用注释。下面1行删除。
lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
JPanel typeAndWidthPane = createTypeAndWidthPane();
@ -59,7 +67,8 @@ public class VanChartLineTypePane extends BasicPane {
lineStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout(0, 6));
this.add(typeAndWidthPane, BorderLayout.NORTH);
//线型支持虚线 恢复用注释。取消注释。
//this.add(typeAndWidthPane, BorderLayout.NORTH);
this.add(lineStylePane, BorderLayout.CENTER);
}
@ -108,6 +117,12 @@ public class VanChartLineTypePane extends BasicPane {
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
//线型支持虚线 恢复用注释。下面5行删除。
new Component[]{null, null},
new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidth)
},
lineStyleComponent,
nullValueBreakComponent
};
@ -126,10 +141,16 @@ public class VanChartLineTypePane extends BasicPane {
}
public void checkLarge(boolean large) {
//线型支持虚线 恢复用注释。下面4行删除。
if (large) {
lineTypeComboBox.setSelectedItem(LineType.NONE);
}
lineTypeComboBox.setEnabled(!large);
lineWidth.setSelectedLineStyle(Constants.LINE_NONE);
}
lineWidth.setEnabled(!large);
//线型支持虚线 恢复用注释。取消注释。
// if (large) {
// lineTypeComboBox.setSelectedItem(LineType.NONE);
// }
// lineTypeComboBox.setEnabled(!large);
lineStyle.setEnabled(!large);
}
@ -141,8 +162,11 @@ public class VanChartLineTypePane extends BasicPane {
if (line == null) {
line = initVanChartAttrLine();
}
lineTypeComboBox.setSelectedItem(line.getLineType());
lineWidthSpinner.setValue(line.getLineWidth());
//线型支持虚线 恢复用注释。下面1行删除。
lineWidth.setSelectedLineStyle(line.getLineWidth());
//线型支持虚线 恢复用注释。取消注释。
// lineTypeComboBox.setSelectedItem(line.getLineType());
// lineWidthSpinner.setValue(line.getLineWidth());
lineStyle.setSelectedItem(line.getLineStyle());
nullValueBreak.setSelectedIndex(line.isNullValueBreak() ? 0 : 1);
}
@ -153,8 +177,11 @@ public class VanChartLineTypePane extends BasicPane {
public VanChartAttrLine update() {
VanChartAttrLine line = new VanChartAttrLine();
line.setLineType((LineType) lineTypeComboBox.getSelectedItem());
line.setLineWidth(lineWidthSpinner.getValue());
//线型支持虚线 恢复用注释。下面1行删除。
line.setLineWidth(lineWidth.getSelectedLineStyle());
//线型支持虚线 恢复用注释。取消注释。
// line.setLineType((LineType) lineTypeComboBox.getSelectedItem());
// line.setLineWidth(lineWidthSpinner.getValue());
line.setLineStyle(lineStyle.getSelectedItem());
line.setNullValueBreak(nullValueBreak.getSelectedIndex() == 0);
return line;

6
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java

@ -1,5 +1,8 @@
package com.fr.van.chart.designer.component;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
/**
@ -11,6 +14,9 @@ public class VanChartLineWidthPane extends VanChartLineTypePane {
@Override
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
//线型支持虚线 恢复用注释。下面2行删除。
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
nullValueBreakComponent
};
}

72
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java

@ -1,8 +1,10 @@
package com.fr.van.chart.designer.component;
import com.fr.chart.base.AttrColor;
import com.fr.chart.base.AttrLineStyle;
import com.fr.chart.base.LineStyleInfo;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
@ -15,6 +17,7 @@ import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.TrendLineType;
import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -33,8 +36,12 @@ public class VanChartTrendLinePane extends BasicPane{
private UITextField trendLineName;
private ColorSelectBox trendLineColor;
private LineTypeComboBox trendLineStyle;//线型
private UISpinner lineWidthSpinner;//线宽
//线型支持虚线 恢复用注释。下面1行删除。
private LineComboBox trendLineStyle;//线型
//线型支持虚线 恢复用注释。取消注释。
// private LineTypeComboBox trendLineStyle;//线型
// private UISpinner lineWidthSpinner;//线宽
private UIComboBox trendLineType;//趋势线函数类型
private UISpinner prePeriod;
@ -51,11 +58,15 @@ public class VanChartTrendLinePane extends BasicPane{
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p, p, p, p, p, p};
double[] col = {f, e};
trendLineName = new UITextField();
trendLineColor = new ColorSelectBox(100);
trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
//线型支持虚线 恢复用注释。下面1行删除。
trendLineStyle = new LineComboBox(VanChartConstants.ALERT_LINE_STYLE);
//线型支持虚线 恢复用注释。取消注释。
// trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
// lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
trendLineType = new UIComboBox(TYPES);
prePeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
afterPeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
@ -71,26 +82,42 @@ public class VanChartTrendLinePane extends BasicPane{
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Period"));
label.setVerticalAlignment(SwingConstants.TOP);
//线型支持虚线 恢复用注释。开始删除。
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName},
new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(trendLineStyle)
}
};
Component[][] componentsMayHide = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)},
},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType},
new Component[]{label, periodPane}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p,p,p}, col);
trendLineHidePane = TableLayout4VanChartHelper.createGapTableLayoutPane(componentsMayHide, new double[]{p,p,p,p}, col);
//线型支持虚线 恢复用注释。结束删除。
//线型支持虚线 恢复用注释。取消注释。
// Component[][] components = new Component[][]{
// new Component[]{null, null},
// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName},
// new Component[]{
// FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
// UIComponentUtils.wrapWithBorderLayoutPane(trendLineStyle)
// }
// };
//
// Component[][] componentsMayHide = new Component[][]{
// new Component[]{
// FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")),
// UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)},
// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor},
// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType},
// new Component[]{label, periodPane}
// };
// trendLineHidePane = TableLayout4VanChartHelper.createGapTableLayoutPane(componentsMayHide, row, col);
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
trendLineStyle.addActionListener(new ActionListener() {
@Override
@ -102,7 +129,8 @@ public class VanChartTrendLinePane extends BasicPane{
checkHidePaneVisible();
this.add(panel, BorderLayout.CENTER);
this.add(trendLineHidePane, BorderLayout.SOUTH);
//线型支持虚线 恢复用注释。取消注释。
//this.add(trendLineHidePane, BorderLayout.SOUTH);
}
protected String title4PopupWindow(){
@ -115,8 +143,11 @@ public class VanChartTrendLinePane extends BasicPane{
trendLineName.setText(trendLine.getTrendLineName());
LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo();
trendLineColor.setSelectObject(lineStyleInfo.getAttrLineColor().getSeriesColor());
trendLineStyle.setSelectedItem(lineStyleInfo.getAttrLineStyle().getLineType());
lineWidthSpinner.setValue(lineStyleInfo.getAttrLineStyle().getLineWidth());
//线型支持虚线 恢复用注释。下面1行删除。
trendLineStyle.setSelectedLineStyle(lineStyleInfo.getAttrLineStyle().getLineStyle());
//线型支持虚线 恢复用注释。取消注释。
// trendLineStyle.setSelectedItem(lineStyleInfo.getAttrLineStyle().getLineType());
// lineWidthSpinner.setValue(lineStyleInfo.getAttrLineStyle().getLineWidth());
trendLineType.setSelectedItem(trendLine.getTrendLineType());
prePeriod.setValue(trendLine.getPrePeriod());
afterPeriod.setValue(trendLine.getAfterPeriod());
@ -128,8 +159,11 @@ public class VanChartTrendLinePane extends BasicPane{
trendLine.setTrendLineName(trendLineName.getText());
LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo();
lineStyleInfo.getAttrLineStyle().setLineWidth(lineWidthSpinner.getValue());
lineStyleInfo.getAttrLineStyle().setLineType((LineType) trendLineStyle.getSelectedItem());
//线型支持虚线 恢复用注释。下面1行删除。
lineStyleInfo.setAttrLineStyle(new AttrLineStyle(trendLineStyle.getSelectedLineStyle()));
//线型支持虚线 恢复用注释。取消注释。
// lineStyleInfo.getAttrLineStyle().setLineWidth(lineWidthSpinner.getValue());
// lineStyleInfo.getAttrLineStyle().setLineType((LineType) trendLineStyle.getSelectedItem());
lineStyleInfo.setAttrLineColor(new AttrColor(trendLineColor.getSelectObject()));
trendLine.setTrendLineType((TrendLineType) trendLineType.getSelectedItem());

267
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java

@ -1,18 +1,19 @@
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.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.formula.TinyFormulaPane;
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;
@ -23,17 +24,23 @@ 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.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartConstants;
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;
@ -60,7 +67,18 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private AutoRefreshPane autoRefreshPane;
private ZoomPane zoomPane;
//图表缩放新设计 恢复用注释。删除下面八行代码。
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;
private JPanel largeModeThresholdNumberPane;
@ -100,7 +118,8 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
Component[][] components = new Component[][]{
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null},
new Component[]{createLargeDataModePane(), 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},
@ -111,49 +130,180 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
private JPanel createLargeDataModePane() {
if (!isCurrentChartSupportLargeDataMode()) {
//大数据模式 恢复用注释。取消注释。
// private JPanel createLargeDataModePane() {
// if (!isCurrentChartSupportLargeDataMode()) {
// return null;
// }
// largeDataMode = new UIComboBox(new LargeDataModeType[]{LargeDataModeType.CLOSE, LargeDataModeType.OPEN_BEYOND_THRESHOLD});
// largeModeThresholdNumber = new UISpinner(0, Integer.MAX_VALUE, 100, chart.getPlot().getLargeDataAttribute().getLargeModeThresholdNumber());
//
// largeDataMode.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// checkLargeDataMode();
// }
// });
//
// 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};
//
//
// 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 createZoomPane(double[] row, double[] col, VanChartPlot plot) {
//图表缩放新设计 恢复用注释。取消注释。
// zoomPane = createZoomPane();
// if (zoomPane == null) {
// return null;
// }
// return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane);
//图表缩放新设计 恢复用注释。删除下面方法体所有代码。
if (!plot.isSupportZoomDirection()) {
return null;
}
largeDataMode = new UIComboBox(new LargeDataModeType[]{LargeDataModeType.CLOSE, LargeDataModeType.OPEN_BEYOND_THRESHOLD});
largeModeThresholdNumber = new UISpinner(0, Integer.MAX_VALUE, 100, chart.getPlot().getLargeDataAttribute().getLargeModeThresholdNumber());
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.addActionListener(new ActionListener() {
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() {
@Override
public void actionPerformed(ActionEvent e) {
checkLargeDataMode();
checkZoomPane();
}
});
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}
};
//图表缩放新设计 恢复用注释。删除下面八个方法getzoomTypePane createZoomPaneContent
// checkZoomEnabled getNameArray getValueArray checkZoomPane populateChartZoom updateChartZoom。
protected JPanel getzoomTypePane(UIButtonGroup zoomType) {
return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction"), zoomType);
}
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);
}
panel.add(zoomTypePane, BorderLayout.SOUTH);
return panel;
}
private void checkZoomEnabled() {
if (zoomWidget != null && axisRotation != null) {
if (axisRotation.getSelectedIndex() == 0) {
//只有开启坐标轴翻转,才需要将缩放控件强制关闭。
zoomWidget.setSelectedIndex(1);
}
checkZoomPane();
zoomWidget.setEnabled(axisRotation.getSelectedIndex() == 1);
}
}
double[] row = {TableLayout.PREFERRED}, col = {TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
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")};
}
JPanel contentPane = new JPanel(new BorderLayout(0, 6));
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_X, VanChartConstants.ZOOM_TYPE_Y
, VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
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);
private void checkZoomPane() {
boolean zoomWidgetEnabled = zoomWidget.getSelectedIndex() == 0;
changeEnablePane.setVisible(zoomWidgetEnabled);
zoomType.setEnabled(!zoomWidgetEnabled);
}
protected boolean isCurrentChartSupportLargeDataMode() {
return false;
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()));
}
zoomType.setSelectedItem(zoom.getZoomType());
}
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) {
zoomPane = createZoomPane();
if (zoomPane == null) {
return null;
private void updateChartZoom(VanChart chart) {
VanChartZoom zoom = chart.getVanChartZoom();
if (zoom == null) {
zoom = new VanChartZoom();
chart.setVanChartZoom(zoom);
}
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane);
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());
}
protected ZoomPane createZoomPane() {
@ -167,6 +317,14 @@ 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}
@ -257,7 +415,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
private void resetCustomCondition(ConditionCollection conditionCollection) {
public static void resetCustomCondition(ConditionCollection conditionCollection) {
for (int i = 0, len = conditionCollection.getConditionAttrSize(); i < len; i++) {
ConditionAttr conditionAttr = conditionCollection.getConditionAttr(i);
conditionAttr.remove(AttrLabel.class);
@ -285,8 +443,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
reLayoutContentPane(plot);
}
if (zoomPane != null) {
zoomPane.populateBean(this.chart.getZoomAttribute());
//图表缩放新设计 恢复用注释。下面3行取消注释。
// if (zoomPane != null) {
// zoomPane.populateBean(this.chart.getZoomAttribute());
// }
//图表缩放新设计 恢复用注释。删除下面三行代码。
if (plot.isSupportZoomDirection()) {//支持缩放方向=方向+控件
populateChartZoom((VanChart) chart);
checkZoomPane();
}
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) {
@ -299,6 +464,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
populateAutoRefresh(this.chart);
populateHyperlink(plot);
//图表缩放新设计 恢复用注释。删除下面一行代码。
checkZoomEnabled();
}
@ -315,12 +483,13 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
private void populateLargeMode(Plot plot) {
if (largeDataMode != null) {
LargeDataAttribute attribute = plot.getLargeDataAttribute();
largeDataMode.setSelectedItem(attribute.getLargeDataModeType());
largeModeThresholdNumber.setValue(attribute.getLargeModeThresholdNumber());
}
//大数据模式 恢复用注释。取消注释。
// if (largeDataMode != null) {
// LargeDataAttribute attribute = plot.getLargeDataAttribute();
//
// largeDataMode.setSelectedItem(attribute.getLargeDataModeType());
// largeModeThresholdNumber.setValue(attribute.getLargeModeThresholdNumber());
// }
}
private void populateChartAxisRotation(VanChartPlot plot) {
@ -359,8 +528,13 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
VanChart vanChart = (VanChart) chart;
VanChartPlot plot = chart.getPlot();
if (zoomPane != null) {
vanChart.setZoomAttribute(zoomPane.updateBean());
//图表缩放新设计 恢复用注释。下面3行取消注释。
// if (zoomPane != null) {
// vanChart.setZoomAttribute(zoomPane.updateBean());
// }
//图表缩放新设计 恢复用注释。下面3行删除。
if (plot.isSupportZoomDirection()) {
updateChartZoom((VanChart) chart);
}
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) {
@ -406,12 +580,13 @@ 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);
}
//大数据模式 恢复用注释。取消注释。
// 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) {

20
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePaneWithMapZoom.java

@ -1,15 +1,27 @@
package com.fr.van.chart.designer.other;
import com.fr.van.chart.designer.other.zoom.MapZoomPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* Created by mengao on 2017/4/7.
*/
public class VanChartInteractivePaneWithMapZoom extends VanChartInteractivePaneWithOutSort {
//图表缩放新设计 恢复用注释。删除下面方法 createZoomPaneContent。
@Override
protected ZoomPane createZoomPane() {
return new MapZoomPane();
protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, JPanel changeEnablePane, JPanel zoomTypePane, VanChartPlot plot) {
JPanel panel = new JPanel(new BorderLayout(0, 4));
panel.add(zoomWidgetPane, BorderLayout.NORTH);
panel.add(zoomGesturePane, BorderLayout.CENTER);
return panel;
}
//图表缩放新设计 恢复用注释。取消注释。
// @Override
// protected ZoomPane createZoomPane() {
// return new MapZoomPane();
// }
}

66
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -8,11 +8,11 @@ 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.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.stable.Constants;
@ -20,8 +20,8 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@ -55,7 +55,13 @@ public class VanChartPlotLegendPane extends BasicPane {
protected UIToggleButton customFloatPositionButton;
protected VanChartFloatPositionPane customFloatPositionPane;
private LimitPane limitPane;
//区域显示策略 恢复用注释。下面4行删除。
protected UIButtonGroup<Integer> limitSize;
protected UISpinner maxProportion;
private UILabel limitSizeTitle;
private JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
//高亮显示的按钮
protected UIButtonGroup<Boolean> highlightButton;
@ -228,8 +234,31 @@ public class VanChartPlotLegendPane extends BasicPane {
}
protected JPanel createDisplayStrategy(){
limitPane = new LimitPane(false);
return limitPane;
//区域显示策略 恢复用注释。开始删除。
maxProportion = new UISpinner(0, 100, 1, 30);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
limitSizeTitle = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"));
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return panel;
//区域显示策略 恢复用注释。结束删除。
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane(false);
// return limitPane;
}
private JPanel createHighlightPane(){
@ -255,8 +284,19 @@ public class VanChartPlotLegendPane extends BasicPane {
//检查显示策略界面是否可用
protected void checkDisplayStrategyUse() {
GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
limitPane.checkMaxProPortionUse();
//区域显示策略 恢复用注释。下面2行删除。
limitSize.setEnabled(!customFloatPositionButton.isSelected());
checkMaxProPortionUse();
//区域显示策略 恢复用注释。取消注释。
// GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
// limitPane.checkMaxProPortionUse();
}
//区域显示策略 恢复用注释。删除下面方法。
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
}
protected void checkBoxUse() {
@ -287,7 +327,11 @@ public class VanChartPlotLegendPane extends BasicPane {
legend.setPosition(-1);
}
legend.setFloating(customFloatPositionButton.isSelected());
legend.setLimitAttribute(limitPane.updateBean());
//区域显示策略 恢复用注释。下面2行删除。
legend.setLimitSize(limitSize.getSelectedIndex() == 0);
legend.setMaxHeight(maxProportion.getValue());
//区域显示策略 恢复用注释。取消注释。
//legend.setLimitAttribute(limitPane.updateBean());
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
if(highlightButton != null && highlightButton.getSelectedItem() != null){
@ -307,7 +351,11 @@ public class VanChartPlotLegendPane extends BasicPane {
customFloatPositionButton.setSelected(legend.isFloating());
customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY());
limitPane.populateBean(legend.getLimitAttribute());
//区域显示策略 恢复用注释。下面2行删除。
limitSize.setSelectedIndex(legend.isLimitSize() ? 0 : 1);
maxProportion.setValue(legend.getMaxHeight());
//区域显示策略 恢复用注释。取消注释。
//limitPane.populateBean(legend.getLimitAttribute());
if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight());
}

64
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -11,11 +11,11 @@ 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.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartTitle;
import com.fr.plugin.chart.vanchart.VanChart;
@ -26,8 +26,8 @@ import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
@ -60,7 +60,12 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private UIToggleButton customFloatPositionButton;
private VanChartFloatPositionPane customFloatPositionPane;
private LimitPane limitPane;
//区域显示策略 恢复用注释。下面3行删除。
private UIButtonGroup<Integer> limitSize;
private UISpinner maxProportion;
private JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
protected VanChartStylePane parent;
@ -169,8 +174,31 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
}
private JPanel createDisplayStrategy(){
limitPane = new LimitPane();
return limitPane;
//区域显示策略 恢复用注释。开始删除。
maxProportion = new UISpinner(0, 100, 1, 30);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
//区域显示策略 恢复用注释。结束删除。
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane();
// return limitPane;
}
private void initPositionListener(){
@ -232,10 +260,20 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
//检查显示策略界面是否可用
private void checkDisplayStrategyUse() {
GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
limitPane.checkMaxProPortionUse();
//区域显示策略 恢复用注释。下面2行删除。
limitSize.setEnabled(!customFloatPositionButton.isSelected());
checkMaxProPortionUse();
//区域显示策略 恢复用注释。取消注释。
// GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
// limitPane.checkMaxProPortionUse();
}
//区域显示策略 恢复用注释。删除下面方法。
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
}
/**
* 弹出框的界面标题
@ -278,7 +316,11 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
customFloatPositionButton.setSelected(title.isFloating());
customFloatPositionPane.setFloatPosition_x(title.getFloatPercentX());
customFloatPositionPane.setFloatPosition_y(title.getFloatPercentY());
limitPane.populateBean(title.getLimitAttribute());
//区域显示策略 恢复用注释。下面2行删除。
limitSize.setSelectedIndex(title.isLimitSize() ? 0 : 1);
maxProportion.setValue(title.getMaxHeight());
//区域显示策略 恢复用注释。取消注释。
//limitPane.populateBean(title.getLimitAttribute());
checkAllUse();
}
@ -311,7 +353,11 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
}
title.setUseHtml(useHtml.isSelected());
title.setFloating(customFloatPositionButton.isSelected());
title.setLimitAttribute(limitPane.updateBean());
//区域显示策略 恢复用注释。下面2行删除。
title.setLimitSize(limitSize.getSelectedIndex() == 0);
title.setMaxHeight(maxProportion.getValue());
//区域显示策略 恢复用注释。取消注释。
//title.setLimitAttribute(limitPane.updateBean());
title.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
title.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
textAttrPane.update(textAttr);

184
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -13,6 +13,7 @@ import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
@ -33,7 +34,6 @@ import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.component.LimitPane;
import javax.swing.BorderFactory;
import javax.swing.Icon;
@ -64,9 +64,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected ChartTextAttrPane labelTextAttrPane;
protected UINumberDragPane labelTextRotation;
//轴标签缩略间隔显示 恢复用注释。下面6行删除。
protected UITextField labelGapValue;
private UIButtonGroup<OverlapHandleType> overlapHandleTypeGroup;
protected UIButtonGroup<Integer> labelGapStyle;
protected UISpinner labelGapValue;
//轴标签缩略间隔显示 恢复用注释。取消注释。
//protected UISpinner labelGapValue;
protected JPanel labelPanel;
private JPanel labelGapStylePane;
@ -80,7 +84,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UIButtonGroup<Integer> position;
protected UIButtonGroup<Boolean> reversed;
private LimitPane limitPane;
//区域显示策略 恢复用注释。下面3行删除。
protected UIButtonGroup<Integer> axisLimitSize;
protected UISpinner maxProportion;
protected JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
protected UIButtonGroup valueFormatStyle;
protected FormatPane valueFormat;
@ -172,22 +181,32 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
protected JPanel createLabelPane(double[] row, double[] col){
double p = TableLayout.PREFERRED;
showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")});
labelTextAttrPane = getChartTextAttrPane();
JPanel rotationPane = createLabelRotationPane(col);
JPanel overlapPane = createLabelOverlapPane();
labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX);
labelGapStyle = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fixed")});
labelGapValue = new UITextField();
Component[][] gapComponents = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")),
UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle},
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col);
labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
JPanel gapPanel = new JPanel(new BorderLayout());
gapPanel.add(panel, BorderLayout.CENTER);
gapPanel.add(labelGapValuePane, BorderLayout.SOUTH);
Component[][] components = new Component[][]{
new Component[]{labelTextAttrPane, null},
new Component[]{rotationPane, null},
new Component[]{overlapPane, null},
new Component[]{gapPanel, null},
};
JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel);
labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, col);
labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
showLabel.addActionListener(new ActionListener() {
@Override
@ -195,12 +214,48 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
checkLabelPane();
}
});
labelGapStyle.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkLabelGapValuePane();
}
});
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(showLabelPane, BorderLayout.NORTH);
jPanel.add(labelPanel, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel);
}
// protected JPanel createLabelPane(double[] row, double[] col){
// double p = TableLayout.PREFERRED;
// showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")});
// labelTextAttrPane = getChartTextAttrPane();
//
// JPanel rotationPane = createLabelRotationPane(col);
// JPanel overlapPane = createLabelOverlapPane();
//
//
// Component[][] components = new Component[][]{
// new Component[]{labelTextAttrPane, null},
// new Component[]{rotationPane, null},
// new Component[]{overlapPane, null},
// };
//
// JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel);
// labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, col);
// labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
// showLabel.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// checkLabelPane();
// }
// });
// JPanel jPanel = new JPanel(new BorderLayout());
// jPanel.add(showLabelPane, BorderLayout.NORTH);
// jPanel.add(labelPanel, BorderLayout.CENTER);
// return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel);
// }
private JPanel createLabelRotationPane(double[] col) {
labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX);
@ -218,7 +273,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
labelGapStyle = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")});
labelGapStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_Interval"), labelGapStyle, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
labelGapValue = new UISpinner(0, Integer.MAX_VALUE, 1, 1);
//轴标签缩略间隔显示 恢复用注释。取消注释。
//labelGapValue = new UISpinner(0, Integer.MAX_VALUE, 1, 1);
labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(StringUtils.EMPTY, labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
JPanel panel = new JPanel(new BorderLayout(0, 0));
@ -327,8 +383,29 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
protected JPanel createDisplayStrategy(){
limitPane = new LimitPane();
return limitPane;
//区域显示策略 恢复用注释。删除到return,即除了注释的代码都删除。
maxProportion = new UISpinner(0, 100, 1, 30);
axisLimitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), axisLimitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
axisLimitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane();
// return limitPane;
}
protected JPanel createValueStylePane(){
@ -385,8 +462,20 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected void checkAllUse() {
checkCardPane();
checkLabelPane();
if (limitPane != null){
limitPane.checkMaxProPortionUse();
//区域显示策略 恢复用注释。删除下面一行。
checkMaxProPortionUse();
//区域显示策略 恢复用注释。取消注释。
// if (limitPane != null){
// limitPane.checkMaxProPortionUse();
// }
}
//区域显示策略 恢复用注释。删除此方法。
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
if (maxProportionPane != null && axisLimitSize != null) {
maxProportionPane.setVisible(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled());
}
}
@ -408,7 +497,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
labelPanel.setVisible(enabled);
}
if(enabled){
checkLabelGapAndStylePane();
//轴标签缩略间隔显示 恢复用注释。下面1行删除。
checkLabelGapValuePane();
//轴标签缩略间隔显示 恢复用注释。取消注释。
//checkLabelGapAndStylePane();
}
}
}
@ -425,9 +517,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected void checkLabelGapValuePane() {
if (labelGapValuePane != null && labelGapStyle != null) {
boolean visible = labelGapStyle.getSelectedIndex() == 1;
if (overlapHandleTypeGroup != null) {
visible = visible && overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL;
}
//轴标签缩略间隔显示 恢复用注释。取消注释。
// if (overlapHandleTypeGroup != null) {
// visible = visible && overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL;
// }
labelGapValuePane.setVisible(visible);
}
}
@ -511,14 +604,18 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
if(labelTextRotation != null){
labelTextRotation.populateBean((double)labelTextAttr.getRotation());
}
if (overlapHandleTypeGroup != null) {
overlapHandleTypeGroup.setSelectedItem(axis.getOverlapHandleType());
}
//轴标签缩略间隔显示 恢复用注释。取消注释。
// if (overlapHandleTypeGroup != null) {
// overlapHandleTypeGroup.setSelectedItem(axis.getOverlapHandleType());
// }
if(labelGapStyle != null){
labelGapStyle.setSelectedIndex(axis.isAutoLabelGap() ? 0 : 1);
}
if(labelGapValue != null){
labelGapValue.setValue(axis.getIntervalNumber());
//轴标签缩略间隔显示 恢复用注释。下面1行删除。
labelGapValue.setText(axis.getLabelNumber().getContent());
//轴标签缩略间隔显示 恢复用注释。取消注释。
//labelGapValue.setValue(axis.getIntervalNumber());
}
}
@ -553,9 +650,18 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略
private void populateDisplayStrategy(VanChartAxis axis) {
if (limitPane != null) {
limitPane.populateBean(axis.getLimitAttribute());
//区域显示策略 恢复用注释。下面6行删除。
if (axisLimitSize != null) {
axisLimitSize.setSelectedIndex(axis.isLimitSize() ? 0 : 1);
}
if (maxProportion != null) {
maxProportion.setValue(axis.getMaxHeight());
}
//区域显示策略 恢复用注释。取消注释。
// if (limitPane != null) {
// limitPane.populateBean(axis.getLimitAttribute());
// }
}
//格式
@ -630,14 +736,22 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
if(labelTextRotation != null){
labelTextAttr.setRotation(labelTextRotation.updateBean().intValue());
}
if (overlapHandleTypeGroup != null) {
axis.setOverlapHandleType(overlapHandleTypeGroup.getSelectedItem());
}
//轴标签缩略间隔显示 恢复用注释。取消注释。
// if (overlapHandleTypeGroup != null) {
// axis.setOverlapHandleType(overlapHandleTypeGroup.getSelectedItem());
// }
if(labelGapStyle != null){
axis.setAutoLabelGap(labelGapStyle.getSelectedIndex() == 0);
}
if(labelGapValue != null){
axis.setIntervalNumber((int) labelGapValue.getValue());
//轴标签缩略间隔显示 恢复用注释。下面5行删除。
if (axis.isAutoLabelGap()) {
axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build("1"));
} else {
axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build(labelGapValue.getText()));
}
//轴标签缩略间隔显示 恢复用注释。取消注释。
//axis.setIntervalNumber((int) labelGapValue.getValue());
}
}
@ -669,9 +783,17 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//显示策略
private void updateDisplayStrategy(VanChartAxis axis){
if (limitPane != null) {
axis.setLimitAttribute(limitPane.updateBean());
//区域显示策略 恢复用注释。下面6行删除。
if (axisLimitSize != null) {
axis.setLimitSize(axisLimitSize.getSelectedIndex() == 0);
}
if (maxProportion != null) {
axis.setMaxHeight(maxProportion.getValue());
}
//区域显示策略 恢复用注释。取消注释。
// if (limitPane != null) {
// axis.setLimitAttribute(limitPane.updateBean());
// }
}
protected void updateFormat(VanChartAxis axis) {

36
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java

@ -5,9 +5,9 @@ import com.fr.base.Utils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
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.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
@ -18,10 +18,9 @@ import com.fr.general.FRFont;
import com.fr.general.GeneralUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.type.LineType;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.van.chart.designer.component.LineTypeComboBox;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
@ -42,8 +41,11 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
private static final long serialVersionUID = -1208941770684286439L;
private UIButtonGroup alertAxis;
protected TinyFormulaPane alertValue;
protected LineTypeComboBox alertLineStyle;//线型
private UISpinner lineWidthSpinner;//线宽
//线型支持虚线 恢复用注释。下面1行删除。
protected LineComboBox alertLineStyle;
//线型支持虚线 恢复用注释。取消注释。
// protected LineTypeComboBox alertLineStyle;//线型
// private UISpinner lineWidthSpinner;//线宽
protected ColorSelectBox alertLineColor;
private UIButtonGroup alertTextPosition;
@ -64,8 +66,11 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
//設置大小,防止文本過長導致界面“變形”
alertValue.setPreferredSize(new Dimension(VALUE_WD, HT));
alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.NORMAL, LineType.DASH});
lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
//线型支持虚线 恢复用注释。下面1行删除。
alertLineStyle = new LineComboBox(VanChartConstants.ALERT_LINE_STYLE);
//线型支持虚线 恢复用注释。取消注释。
// alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.NORMAL, LineType.DASH});
// lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
alertLineColor = new ColorSelectBox(100);
alertTextPosition = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Top"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")});
alertText = new TinyFormulaPane();
@ -108,7 +113,8 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),alertAxis},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")),alertValue},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),alertLineStyle},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidthSpinner},
//线型支持虚线 恢复用注释。取消注释。
//new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidthSpinner},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),alertLineColor},
};
}
@ -157,8 +163,11 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
checkPositionPane();
alertValue.populateBean(Utils.objectToString(chartAlertValue.getAlertValueFormula()));
alertLineStyle.setSelectedItem(chartAlertValue.getLineStyle().getLineType());
lineWidthSpinner.setValue(chartAlertValue.getLineStyle().getLineWidth());
//线型支持虚线 恢复用注释。下面1行删除。
alertLineStyle.setSelectedLineStyle(chartAlertValue.getLineStyle().getLineStyle());
//线型支持虚线 恢复用注释。取消注释。
// alertLineStyle.setSelectedItem(chartAlertValue.getLineStyle().getLineType());
// lineWidthSpinner.setValue(chartAlertValue.getLineStyle().getLineWidth());
alertLineColor.setSelectObject(chartAlertValue.getLineColor().getSeriesColor());
if(VanChartAttrHelper.isXAxis(chartAlertValue.getAxisName())){
@ -182,8 +191,11 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
chartAlertValue.setAlertValueFormula(BaseFormula.createFormulaBuilder().build(alertValue.updateBean()));
chartAlertValue.getLineColor().setSeriesColor(alertLineColor.getSelectObject());
chartAlertValue.getLineStyle().setLineType((LineType) alertLineStyle.getSelectedItem());
chartAlertValue.getLineStyle().setLineWidth(lineWidthSpinner.getValue());
//线型支持虚线 恢复用注释。下面1行删除。
chartAlertValue.getLineStyle().setLineStyle(alertLineStyle.getSelectedLineStyle());
//线型支持虚线 恢复用注释。取消注释。
// chartAlertValue.getLineStyle().setLineType((LineType) alertLineStyle.getSelectedItem());
// chartAlertValue.getLineStyle().setLineWidth(lineWidthSpinner.getValue());
String contentString = alertText.updateBean();
Object contentObj;

156
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java

@ -11,9 +11,7 @@ import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.LineTypeComboBox;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -22,6 +20,7 @@ import java.awt.CardLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;
/**
* 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线
@ -41,10 +40,11 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private ColorSelectBox verticalColorBackground;
protected BackgroundListControlPane customIntervalBackground;
private LineTypeComboBox horizonLineType;//横向线型
private LineTypeComboBox verticalLineType;//纵向线型
private JPanel horizontalColorPane;
private JPanel verticalColorPane;
//线型支持虚线 恢复用注释。取消注释。
// private LineTypeComboBox horizonLineType;//横向线型
// private LineTypeComboBox verticalLineType;//纵向线型
// private JPanel horizontalColorPane;
// private JPanel verticalColorPane;
public VanChartAxisAreaPane() {
initComponents();
@ -53,8 +53,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
protected void initComponents() {
horizontalGridLine = new ColorSelectBox(100);
verticalGridLine = new ColorSelectBox(100);
horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
//线型支持虚线 恢复用注释。取消注释。
// horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
// verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -73,58 +74,78 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
this.add(panel, BorderLayout.CENTER);
}
//线型支持虚线 恢复用注释。删除下面方法。
protected JPanel createGridLinePane() {
Component[][] upComponent = new Component[][]{
new Component[]{null, null},
new Component[]{null, horizontalGridLine}
};
horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent);
Component[][] downComponent = new Component[][]{
horizontalGridLine = new ColorSelectBox(100);
verticalGridLine = new ColorSelectBox(100);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{null, verticalGridLine}
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal")), horizontalGridLine},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical")), verticalGridLine},
};
verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent);
horizonLineType.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (horizontalGridLine == null || horizonLineType == null){
return;
}
horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE);
}
});
verticalLineType.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (verticalGridLine == null || verticalLineType == null){
return;
}
verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = new double[components.length];
Arrays.fill(row, p);
double[] col = {f, e};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel);
}
});
checkColorBoxVisible();
JPanel horizonLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), horizonLineType);
JPanel horizontal = new JPanel(new BorderLayout());
horizontal.add(horizonLineTypePane, BorderLayout.NORTH);
horizontal.add(horizontalColorPane, BorderLayout.CENTER);
JPanel verticalLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), verticalLineType);
JPanel vertical = new JPanel(new BorderLayout());
vertical.add(verticalLineTypePane, BorderLayout.NORTH);
vertical.add(verticalColorPane, BorderLayout.CENTER);
JPanel panel = new JPanel(new BorderLayout(0, 4));
panel.add(horizontal, BorderLayout.NORTH);
panel.add(vertical, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel);
}
//线型支持虚线 恢复用注释。取消注释。
// protected JPanel createGridLinePane() {
//
// Component[][] upComponent = new Component[][]{
// new Component[]{null, null},
// new Component[]{null, horizontalGridLine}
// };
// horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent);
//
// Component[][] downComponent = new Component[][]{
// new Component[]{null,null},
// new Component[]{null, verticalGridLine}
// };
// verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent);
//
// horizonLineType.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// if (horizontalGridLine == null || horizonLineType == null){
// return;
// }
// horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE);
// }
// });
//
// verticalLineType.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// if (verticalGridLine == null || verticalLineType == null){
// return;
// }
// verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE);
// }
// });
//
// checkColorBoxVisible();
//
// JPanel horizonLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), horizonLineType);
// JPanel horizontal = new JPanel(new BorderLayout());
// horizontal.add(horizonLineTypePane, BorderLayout.NORTH);
// horizontal.add(horizontalColorPane, BorderLayout.CENTER);
//
// JPanel verticalLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), verticalLineType);
// JPanel vertical = new JPanel(new BorderLayout());
// vertical.add(verticalLineTypePane, BorderLayout.NORTH);
// vertical.add(verticalColorPane, BorderLayout.CENTER);
//
// JPanel panel = new JPanel(new BorderLayout(0, 4));
// panel.add(horizontal, BorderLayout.NORTH);
// panel.add(vertical, BorderLayout.CENTER);
//
// return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel);
// }
protected JPanel createAlertLinePane() {
alertLine = getAlertLinePane();
@ -208,8 +229,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private void populateGridLine(VanChartRectanglePlot rectanglePlot) {
horizontalGridLine.setSelectObject(rectanglePlot.getDefaultYAxis().getMainGridColor());
verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor());
horizonLineType.setSelectedItem(rectanglePlot.getDefaultYAxis().getGridLineType());
verticalLineType.setSelectedItem(rectanglePlot.getDefaultXAxis().getGridLineType());
//线型支持虚线 恢复用注释。取消注释。
// horizonLineType.setSelectedItem(rectanglePlot.getDefaultYAxis().getGridLineType());
// verticalLineType.setSelectedItem(rectanglePlot.getDefaultXAxis().getGridLineType());
}
@ -234,8 +256,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private void updateGirdLine(VanChartRectanglePlot rectanglePlot) {
rectanglePlot.getDefaultYAxis().setMainGridColor(horizontalGridLine.getSelectObject());
rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject());
rectanglePlot.getDefaultYAxis().setGridLineType((LineType)horizonLineType.getSelectedItem());
rectanglePlot.getDefaultXAxis().setGridLineType((LineType)verticalLineType.getSelectedItem());
//线型支持虚线 恢复用注释。取消注释。
// rectanglePlot.getDefaultYAxis().setGridLineType((LineType)horizonLineType.getSelectedItem());
// rectanglePlot.getDefaultXAxis().setGridLineType((LineType)verticalLineType.getSelectedItem());
}
/**
@ -255,12 +278,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
}
private void checkColorBoxVisible() {
if (horizontalColorPane != null && horizonLineType != null){
horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE);
}
if (verticalColorPane != null && verticalLineType != null){
verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE);
}
//线型支持虚线 恢复用注释。取消注释。
// if (horizontalColorPane != null && horizonLineType != null){
// horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE);
// }
//
// if (verticalColorPane != null && verticalLineType != null){
// verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE);
// }
}
}

50
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -15,7 +15,6 @@ import com.fr.design.style.color.ColorSelectBox;
import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot;
import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.OverlapHandleType;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -42,6 +41,8 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
protected UIButtonGroup<Integer> position;
//标签的自动调整 恢复用注释。下面1行删除。
protected UIButtonGroup<Boolean> autoAdjust;
private UIButtonGroup<Boolean> allowOverlap;
private UIComboBox overlapHandleType;
@ -124,6 +125,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
position = new UIButtonGroup<Integer>(names, values);
autoAdjust = new UIButtonGroup<Boolean>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
allowOverlap = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"),
Toolkit.i18nText("Fine-Design_Chart_NO")}, new Boolean[]{true, false});
@ -143,7 +145,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
panel.add(tractionLinePane, BorderLayout.SOUTH);
initPositionListener();
} else if(PlotFactory.plotAutoAdjustLabelPosition(plot)){
panel.add(createOverlapLabelPane(), BorderLayout.SOUTH);
//标签的自动调整 恢复用注释。下面1行删除。
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH);
//标签的自动调整 恢复用注释。取消注释。
//panel.add(createOverlapLabelPane(), BorderLayout.SOUTH);
}
return panel;
}
@ -244,9 +249,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
private void checkOverlap() {
if (overlapHandleType != null && allowOverlap != null) {
overlapHandleType.setVisible(!allowOverlap.getSelectedItem());
}
//标签的自动调整 恢复用注释。取消注释。
// if (overlapHandleType != null && allowOverlap != null) {
// overlapHandleType.setVisible(!allowOverlap.getSelectedItem());
// }
}
private void checkStyleUse() {
@ -270,12 +276,17 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
if(tractionLine != null){
tractionLine.setSelected(detail.isShowGuidLine());
}
if (allowOverlap != null) {
allowOverlap.setSelectedItem(detail.isAllowOverlap());
}
if (overlapHandleType != null) {
overlapHandleType.setSelectedIndex(detail.getOverlapHandleType() == OverlapHandleType.HIDE ? 0 : 1);
}
//标签的自动调整 恢复用注释。下面3行删除。
if (autoAdjust != null) {
autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1);
}
//标签的自动调整 恢复用注释。取消注释。
// if (allowOverlap != null) {
// allowOverlap.setSelectedItem(detail.isAllowOverlap());
// }
// if (overlapHandleType != null) {
// overlapHandleType.setSelectedIndex(detail.getOverlapHandleType() == OverlapHandleType.HIDE ? 0 : 1);
// }
style.setSelectedIndex(detail.isCustom() ? 1 : 0);
textFontPane.populate(detail.getTextAttr());
@ -297,13 +308,16 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
position.setSelectedItem(detail.getPosition());
}
if (allowOverlap != null) {
detail.setAllowOverlap(allowOverlap.getSelectedItem());
}
if (overlapHandleType != null) {
detail.setOverlapHandleType(overlapHandleType.getSelectedIndex() == 0 ? OverlapHandleType.HIDE : OverlapHandleType.ADJUST);
}
//标签的自动调整 恢复用注释。下面1行删除。
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem());
//标签的自动调整 恢复用注释。取消注释。
// if (allowOverlap != null) {
// detail.setAllowOverlap(allowOverlap.getSelectedItem());
// }
//
// if (overlapHandleType != null) {
// detail.setOverlapHandleType(overlapHandleType.getSelectedIndex() == 0 ? OverlapHandleType.HIDE : OverlapHandleType.ADJUST);
// }
if(tractionLine != null){
detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE);

65
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -1,12 +1,15 @@
package com.fr.van.chart.designer.style.series;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.base.chart.chartdata.model.LargeDataModel;
import com.fr.base.chart.chartdata.model.NormalDataModel;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane;
@ -15,13 +18,10 @@ import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.attr.radius.VanChartRadiusPlot;
import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.van.chart.custom.style.VanChartCustomStylePane;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -32,11 +32,14 @@ import com.fr.van.chart.designer.component.VanChartLineTypePane;
import com.fr.van.chart.designer.component.VanChartMarkerPane;
import com.fr.van.chart.designer.component.VanChartTrendLinePane;
import com.fr.van.chart.designer.component.border.VanChartBorderPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.pie.RadiusCardLayoutPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
/**
@ -67,6 +70,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
private RadiusCardLayoutPane radiusPane;//半径设置界面
private JPanel radiusPaneWithTitle;
//大数据模式 恢复用注释。下面1行删除。
private UIButtonGroup<DataProcessor> largeDataModelGroup;//大数据模式
protected JPanel contentPane;
public VanChartAbstractPlotSeriesPane(ChartStylePane parent, Plot plot) {
@ -160,6 +166,47 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle;
}
//大数据模式 恢复用注释。删除下面4个方法 createLargeDataModelPane checkLarge createLargeDataModelPane createLargeDataModelGroup。
protected JPanel createLargeDataModelPane() {
largeDataModelGroup = createLargeDataModelGroup();
largeDataModelGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup);
return createLargeDataModelPane(panel);
}
protected void checkLarge() {
if (largeModel(plot)) {
AttrLabel attrLabel = ((VanChartPlot) plot).getAttrLabelFromConditionCollection();
if (attrLabel == null) {
attrLabel = ((VanChartPlot) this.plot).getDefaultAttrLabel();
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
defaultAttr.addDataSeriesCondition(attrLabel);
}
attrLabel.setEnable(false);
VanChartInteractivePane.resetCustomCondition(plot.getConditionCollection());
}
checkCompsEnabledWithLarge(plot);
}
protected JPanel createLargeDataModelPane(JPanel jPanel) {
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel);
return panel;
}
protected UIButtonGroup<DataProcessor> createLargeDataModelGroup() {
String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")};
DataProcessor[] values = new DataProcessor[]{new LargeDataModel(), new NormalDataModel()};
return new UIButtonGroup<DataProcessor>(strings, values);
}
protected void checkCompsEnabledWithLarge(Plot plot) {
if (markerPane != null) {
markerPane.checkLargePlot(largeModel(plot));
@ -222,6 +269,11 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
stylePane.populateBean(plot.getPlotStyle());
}
//大数据模式 恢复用注释。下面3行删除。
if (largeDataModelGroup != null) {
largeDataModelGroup.setSelectedItem(plot.getDataProcessor());
}
if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
if (rectanglePlot.isCustomChart()) {
@ -274,6 +326,11 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
plot.setPlotStyle(stylePane.updateBean());
}
//大数据模式 恢复用注释。下面3行删除。
if (largeDataModelGroup != null) {
plot.setDataProcessor(largeDataModelGroup.getSelectedItem());
}
if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
if (rectanglePlot.isCustomChart()) {

7
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -7,7 +7,6 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chart.chartglyph.DataSheet;
import com.fr.chartx.attr.ZoomAttribute;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
@ -22,6 +21,7 @@ import com.fr.js.NameJavaScriptGroup;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.JPanel;
@ -132,7 +132,10 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Cha
protected void resetChartAttr(Chart chart, Plot newPlot){
chart.setPlot(newPlot);
if(newPlot.isSupportZoomDirection() && !newPlot.isSupportZoomCategoryAxis()){
((VanChart) chart).setZoomAttribute(new ZoomAttribute());
//图表缩放新设计 恢复用注释。下面一行删除。
((VanChart) chart).setVanChartZoom(new VanChartZoom());
//图表缩放新设计 恢复用注释。下面一行取消注释。
// ((VanChart) chart).setZoomAttribute(new ZoomAttribute());
}
//重置工具栏选项
((VanChart)chart).setVanChartTools(createVanChartTools());

7
designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java

@ -1,6 +1,5 @@
package com.fr.van.chart.drillmap;
import com.fr.design.chartx.data.drillMap.DrillMapChartDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -8,6 +7,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.drillmap.designer.data.VanChartDrillMapDataPane;
import com.fr.van.chart.drillmap.designer.other.VanChartDrillMapOtherPane;
import com.fr.van.chart.drillmap.designer.type.VanChartDrillMapPlotPane;
import com.fr.van.chart.map.VanMapChartTypeUI;
@ -61,7 +61,10 @@ public class VanDrillMapChartTypeUI extends VanMapChartTypeUI {
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new DrillMapChartDataPane(listener);
//图表数据结构 恢复用注释。下面1行删除。
return new VanChartDrillMapDataPane(listener);
//图表数据结构 恢复用注释。取消注释。
//return new DrillMapChartDataPane(listener);
}
/**

52
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java

@ -0,0 +1,52 @@
package com.fr.van.chart.drillmap.designer.data;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.DataContentsPane;
import javax.swing.JPanel;
/**
* Created by Mitisky on 16/6/20.
*/
public class VanChartDrillMapContentsPane extends DataContentsPane {
private VanChartMapLayerAndDataTabPane layerAndDataTabPane;
private AttributeChangeListener listener;
private ChartDataPane parent;
public VanChartDrillMapContentsPane(AttributeChangeListener listener, ChartDataPane parent) {
this.listener = listener;
this.parent = parent;
initAll();
}
/**
* 设置是否关联单元格数据.
*
* @param supportCellData
*/
@Override
public void setSupportCellData(boolean supportCellData) {
layerAndDataTabPane.setSupportCellData(supportCellData);
}
@Override
public void populate(ChartCollection collection) {
layerAndDataTabPane.populateBean(collection);
}
@Override
public void update(ChartCollection collection) {
layerAndDataTabPane.updateBean(collection);
}
@Override
protected JPanel createContentPane() {
layerAndDataTabPane = new VanChartMapLayerAndDataTabPane(this.listener, this.parent);
return layerAndDataTabPane;
}
}

39
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java

@ -0,0 +1,39 @@
package com.fr.van.chart.drillmap.designer.data;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* Created by Mitisky on 16/6/20.
*/
public class VanChartDrillMapDataPane extends ChartDataPane {
public VanChartDrillMapDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected JPanel createContentPane() {
contentsPane = new VanChartDrillMapContentsPane(listener, VanChartDrillMapDataPane.this);
return contentsPane;
}
//编辑内置数据集会stateChange,会调用这里
@Override
protected void repeatLayout(ChartCollection collection) {
if (contentsPane != null) {
this.remove(contentsPane);
}
this.setLayout(new BorderLayout(0, 0));
contentsPane = new VanChartDrillMapContentsPane(listener, VanChartDrillMapDataPane.this);
contentsPane.setSupportCellData(isSupportCellData());
this.add(contentsPane, BorderLayout.CENTER);
}
}

130
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java

@ -0,0 +1,130 @@
package com.fr.van.chart.drillmap.designer.data;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.general.ComparatorUtils;
import com.fr.van.chart.drillmap.designer.data.comp.DrillMapDataPane;
import com.fr.van.chart.drillmap.designer.data.comp.DrillMapLayerPane;
import com.fr.van.chart.map.designer.data.MapDataPaneHelper;
import java.awt.CardLayout;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Mitisky on 16/6/20.
* 钻取层级和数据界面切换的界面
*/
public class VanChartMapLayerAndDataTabPane extends MultiTabPane<ChartCollection> {
private DrillMapLayerPane layerPane;
private DrillMapDataPane dataPane;
private ChartCollection chartCollection;
public VanChartMapLayerAndDataTabPane(AttributeChangeListener listener, ChartDataPane parent) {
cardLayout = new CardLayout();
layerPane = new DrillMapLayerPane();
dataPane = new DrillMapDataPane(listener, parent);
paneList = initPaneList();
initComponents();
}
private void initComponents() {
super.relayoutWhenListChange();
}
protected void tabChanged() {
if (getSelectedIndex() == 0) {
return;
}
if (chartCollection == null) {
return;
}
if (!ComparatorUtils.equals(MapDataPaneHelper.getDrillMapLayerMapTypeList(chartCollection), dataPane.getCurrentMapTypeList())) {
dataPane.populateBean(chartCollection);
}
}
/**
* 当List中的界面变化时, 重新布局
*/
public void relayoutWhenListChange() {
}
@Override
protected List<BasicPane> initPaneList() {
List<BasicPane> paneList = new ArrayList<BasicPane>();
if (layerPane != null) {
paneList.add(layerPane);
}
if (dataPane != null) {
paneList.add(dataPane);
}
return paneList;
}
@Override
public void populateBean(ChartCollection ob) {
chartCollection = ob;
layerPane.populateBean(ob);
dataPane.populateBean(ob);
}
/**
* Update.
*/
@Override
public ChartCollection updateBean() {
return null;
}
@Override
public void updateBean(ChartCollection ob) {
layerPane.updateBean(ob);
dataPane.updateBean(ob);
}
/**
* 设置是否关联单元格数据.
*
* @param supportCellData
*/
public void setSupportCellData(boolean supportCellData) {
dataPane.setSupportCellData(supportCellData);
}
/**
* 是否是指定类型
*
* @param ob 对象
* @return 是否是指定类型
*/
@Override
public boolean accept(Object ob) {
return false;
}
/**
* title应该是一个属性不只是对话框的标题时用到与其他组件结合时也会用得到
*
* @return 绥化狂标题
*/
@Override
public String title4PopupWindow() {
return null;
}
/**
* 重置
*/
@Override
public void reset() {
}
}

116
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java

@ -0,0 +1,116 @@
package com.fr.van.chart.drillmap.designer.data.comp;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.map.designer.data.MapDataPaneHelper;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Mitisky on 16/6/20.
* 钻取地图数据配置界面中 和钻取层级平级的数据界面
*/
public class DrillMapDataPane extends BasicBeanPane<ChartCollection> {
private UIComboBoxPane<ChartCollection> dataDefinitionType;//数据定义方式:底层数据汇总/各层级分别指定
private SingleLayerDataDefinitionPane bottomDataDefinitionPane;//底层数据汇总方式定义钻取地图数据
private EachLayerDataDefinitionPane eachLayerDataDefinitionPane;//各层级分别指定
private ChartDataPane parent;
public DrillMapDataPane(final AttributeChangeListener listener, final ChartDataPane parent) {
this.parent = parent;
bottomDataDefinitionPane = new SingleLayerDataDefinitionPane(listener, parent);
eachLayerDataDefinitionPane = new EachLayerDataDefinitionPane(listener, parent);
dataDefinitionType = new UIComboBoxPane<ChartCollection>() {
@Override
protected List<FurtherBasicBeanPane<? extends ChartCollection>> initPaneList() {
List<FurtherBasicBeanPane<? extends ChartCollection>> paneList = new ArrayList<FurtherBasicBeanPane<? extends ChartCollection>>();
paneList.add(bottomDataDefinitionPane);
paneList.add(eachLayerDataDefinitionPane);
return paneList;
}
@Override
protected String title4PopupWindow() {
return null;
}
};
this.setLayout(new BorderLayout());
this.add(dataDefinitionType, BorderLayout.CENTER);
}
public List<MapType> getCurrentMapTypeList() {
return eachLayerDataDefinitionPane.getCurrentMapTypeList();
}
/**
* 设置是否关联单元格数据.
*
* @param supportCellData
*/
public void setSupportCellData(boolean supportCellData) {
bottomDataDefinitionPane.setSupportCellData(supportCellData);
eachLayerDataDefinitionPane.setSupportCellData(supportCellData);
}
/**
* Populate.
*
* @param ob
*/
@Override
public void populateBean(ChartCollection ob) {
dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1);
ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob);
bottomDataDefinitionPane.populateBean(bottomDataChartCollection);
eachLayerDataDefinitionPane.populateBean(ob);
parent.initAllListeners();
}
/**
* Update.
*/
@Override
public ChartCollection updateBean() {
return null;
}
@Override
public void updateBean(ChartCollection ob) {
DrillMapDefinition drillMapDefinition = MapDataPaneHelper.getDrillMapDefinition(ob);
if (drillMapDefinition == null) {
drillMapDefinition = new DrillMapDefinition();
ob.getSelectedChart().setFilterDefinition(drillMapDefinition);
}
if (dataDefinitionType.getSelectedIndex() == 0) {
drillMapDefinition.setFromBottomData(true);
ChartCollection temp = new ChartCollection(new Chart());
bottomDataDefinitionPane.updateBean(temp);
drillMapDefinition.setBottomDataDefinition(temp.getSelectedChart().getFilterDefinition());
} else {
drillMapDefinition.setFromBottomData(false);
eachLayerDataDefinitionPane.updateBean(ob);
}
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Data");
}
}

203
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java

@ -0,0 +1,203 @@
package com.fr.van.chart.drillmap.designer.data.comp;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.drillmap.DrillMapHelper;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper;
import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Created by Mitisky on 16/6/20.
* 钻取地图数据配置界面--钻取层级界面
*/
public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
private static final String[] CUSTOM_MAP_TYPES = new String[]{MapType.AREA.getLocaleString(), MapType.POINT.getLocaleString()};
private static final String[] AREA_MAP_TYPES = new String[]{MapType.AREA.getLocaleString()};
private static final String[] POINT_MAP_TYPES = new String[]{MapType.POINT.getLocaleString()};
private static final java.util.Map<MapType, String[]> TEMP = new HashMap<MapType, String[]>();
static {
TEMP.put(MapType.AREA, AREA_MAP_TYPES);
TEMP.put(MapType.POINT, POINT_MAP_TYPES);
TEMP.put(MapType.CUSTOM, CUSTOM_MAP_TYPES);
}
private MapDataTree mapDataTree;
private Component[][] detailComps;
private int depth;
private MapType oldMapType;
private String oldGeoUrl;
@Override
protected void layoutContentPane() {
leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(leftcontentPane);
}
@Override
protected JPanel createContentPane() {
if (mapDataTree == null) {
mapDataTree = new MapDataTree(CompatibleGeoJSONTreeHelper.getRootNodeWithoutPara(oldGeoUrl));
mapDataTree.setRootVisible(true);
}
JPanel mapDataTreePanel = new JPanel(new BorderLayout());
mapDataTreePanel.add(mapDataTree);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel)},
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane())}
};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout());
panel.add(contentPane, BorderLayout.CENTER);
return panel;
}
private JPanel createTitlePane (String title, JPanel panel) {
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0));
jPanel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
return jPanel;
}
private JPanel createLayerDetailPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, p, p};
double[] rowSize = new double[depth + 1];
detailComps = new Component[depth + 1][3];
rowSize[0] = p;
detailComps[0] = new Component[]{
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Descriptor")),
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")),
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Map_Type"))
};
for (int i = 0; i < depth; i++) {
rowSize[i + 1] = p;
int d = i + 1;
UILabel label = new UILabel(String.format("%s%d%s", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Article"), d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Layer")));
UIComboBox level = new UIComboBox(VanChartMapSourceChoosePane.ZOOM_LEVELS);
level.setEnabled(i != 0);
UIComboBox type = new UIComboBox(TEMP.get(oldMapType));
detailComps[i + 1] = new Component[]{label, level, type};
}
return TableLayoutHelper.createGapTableLayoutPane(detailComps, rowSize, columnSize, 10, 6);
}
/**
* Populate.
*
* @param ob
*/
@Override
public void populateBean(ChartCollection ob) {
VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob);
if (drillMapPlot != null) {
java.util.List<ZoomLevel> levelList = drillMapPlot.getLayerLevelList();
java.util.List<MapType> mapTypeList = drillMapPlot.getLayerMapTypeList();
if (detailComps == null || drillMapPlot.getMapType() != oldMapType || !ComparatorUtils.equals(drillMapPlot.getGeoUrl(), oldGeoUrl)) {
oldMapType = drillMapPlot.getMapType();
oldGeoUrl = drillMapPlot.getGeoUrl();
DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(oldGeoUrl);
if (root != null) {
mapDataTree.changeRootNode(root);
depth = root.getDepth() + 1;//根节点也算一层
}
this.remove(leftcontentPane);
layoutContentPane();
}
//根据层级初始属性,一切以json那边读到的层级为准
int levelSize = levelList.size();
for (int i = levelSize; i < depth; i++) {
levelList.add(ZoomLevel.AUTO);
}
MapType mapType = drillMapPlot.getMapType() == MapType.POINT ? MapType.POINT : MapType.AREA;
int typeSize = mapTypeList.size();
for (int j = typeSize; j < depth; j++) {
mapTypeList.add(mapType);
}
for (int i = 0; i < depth; i++) {
Component[] components = detailComps[i + 1];
if (components != null) {
UIComboBox level = (UIComboBox) components[1];
UIComboBox type = (UIComboBox) components[2];
if (level != null) {
level.setSelectedItem(levelList.get(i));
}
if (type != null) {
type.setSelectedItem(mapTypeList.get(i).getLocaleString());
}
}
}
}
}
/**
* Update.
*/
@Override
public ChartCollection updateBean() {
return null;
}
@Override
public void updateBean(ChartCollection ob) {
VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob);
if (drillMapPlot != null && detailComps != null) {
java.util.List<ZoomLevel> levelList = new ArrayList<ZoomLevel>();
java.util.List<MapType> mapTypeList = new ArrayList<MapType>();
for (Component[] com : detailComps) {
if (com[1] instanceof UIComboBox && com[2] instanceof UIComboBox) {
UIComboBox level = (UIComboBox) com[1];
UIComboBox type = (UIComboBox) com[2];
levelList.add((ZoomLevel) level.getSelectedItem());
if (type.getSelectedItem() != null) {
mapTypeList.add(MapType.parseLocale(type.getSelectedItem().toString()));
}
}
}
drillMapPlot.setLayerLevelList(levelList);
drillMapPlot.setLayerMapTypeList(mapTypeList);
}
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Drill_Level");
}
}

170
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java

@ -0,0 +1,170 @@
package com.fr.van.chart.drillmap.designer.data.comp;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.drillmap.DrillMapHelper;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper;
import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.map.designer.data.MapDataPaneHelper;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.CardLayout;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Mitisky on 16/6/20.
* 各层级分别指定的界面
*/
public class EachLayerDataDefinitionPane extends MultiTabPane<ChartCollection> {
private AttributeChangeListener listener;
private ChartDataPane parent;
private int depth;
private String oldGeoUrl;
private List<MapType> oldMapList;
public EachLayerDataDefinitionPane(AttributeChangeListener listener, ChartDataPane parent) {
this.listener = listener;
this.parent = parent;
cardLayout = new CardLayout();
}
private void initComponents() {
super.relayoutWhenListChange();
}
/**
* 当List中的界面变化时, 重新布局
*/
public void relayoutWhenListChange() {
}
public List<MapType> getCurrentMapTypeList() {
return oldMapList;
}
@Override
protected List<BasicPane> initPaneList() {
List<BasicPane> paneList = new ArrayList<BasicPane>();
for (int i = 1; i < depth + 1; i++) {
String tile = String.format("%s%d%s", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Article"), i, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Layer"));
SingleLayerDataDefinitionPane pane = new SingleLayerDataDefinitionPane(tile, this.listener, this.parent);
pane.setSupportCellData(parent.isSupportCellData());
paneList.add(pane);
}
return paneList;
}
@Override
public void populateBean(ChartCollection ob) {
VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob);
if (drillMapPlot == null) {
return;
}
if (!ComparatorUtils.equals(oldGeoUrl, drillMapPlot.getGeoUrl())) {
oldGeoUrl = drillMapPlot.getGeoUrl();
DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(oldGeoUrl);
if (root == null) {
return;
}
depth = root.getDepth() + 1;//根节点也算一层
paneList = initPaneList();
this.removeAll();
initComponents();
}
oldMapList = drillMapPlot.getLayerMapTypeList();
populatePaneList(ob);
}
private void populatePaneList(ChartCollection chartCollection) {
for (int i = 0, len = paneList.size(); i < len; i++) {
BasicPane basicPane = paneList.get(i);
MapType mapType = oldMapList.get(i);
if (basicPane instanceof SingleLayerDataDefinitionPane) {
ChartCollection clone = MapDataPaneHelper.getLayerChartCollection(chartCollection, i, mapType);
((SingleLayerDataDefinitionPane) basicPane).populateBean(clone);
}
}
}
/**
* Update.
*/
@Override
public ChartCollection updateBean() {
return null;
}
@Override
public void updateBean(ChartCollection ob) {
DrillMapDefinition drillMapDefinition = MapDataPaneHelper.getDrillMapDefinition(ob);
List<TopDefinitionProvider> eachLayerDataDefinitionList = new ArrayList<TopDefinitionProvider>();
for (BasicPane basicPane : paneList) {
if (basicPane instanceof SingleLayerDataDefinitionPane) {
ChartCollection temp = new ChartCollection(new Chart());
((SingleLayerDataDefinitionPane) basicPane).updateBean(temp);
eachLayerDataDefinitionList.add(temp.getSelectedChart().getFilterDefinition());
}
}
drillMapDefinition.setEachLayerDataDefinitionList(eachLayerDataDefinitionList);
}
/**
* 是否是指定类型
*
* @param ob 对象
* @return 是否是指定类型
*/
@Override
public boolean accept(Object ob) {
return false;
}
/**
* title应该是一个属性不只是对话框的标题时用到与其他组件结合时也会用得到
*
* @return 绥化狂标题
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Each_Layer_Data_Special");
}
/**
* 重置
*/
@Override
public void reset() {
}
/**
* 设置是否关联单元格数据.
*
* @param supportCellData
*/
public void setSupportCellData(boolean supportCellData) {
if (paneList == null) {
return;
}
for (BasicPane basicPane : paneList) {
if (basicPane instanceof SingleLayerDataDefinitionPane) {
((SingleLayerDataDefinitionPane) basicPane).setSupportCellData(supportCellData);
}
}
}
}

93
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java

@ -0,0 +1,93 @@
package com.fr.van.chart.drillmap.designer.data.comp;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane;
import java.awt.BorderLayout;
/**
* Created by Mitisky on 16/6/21.
* 各层级分别指定中 单层区域地图数据配置 以及 底层数据汇总方式的界面
*/
public class SingleLayerDataDefinitionPane extends FurtherBasicBeanPane<ChartCollection> {
private String title;
private NormalChartDataPane normalChartDataPane;
//底层数据汇总
public SingleLayerDataDefinitionPane(AttributeChangeListener listener, ChartDataPane parent) {
this(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Bottom_Data_Sum"), listener, parent);
}
public SingleLayerDataDefinitionPane(String title, AttributeChangeListener listener, ChartDataPane parent) {
this.title = title;
normalChartDataPane = new NormalChartDataPane(listener, parent);
this.setLayout(new BorderLayout());
this.add(normalChartDataPane, BorderLayout.CENTER);
}
/**
* 设置是否关联单元格数据.
*
* @param supportCellData
*/
public void setSupportCellData(boolean supportCellData) {
normalChartDataPane.setSupportCellData(supportCellData);
}
/**
* 是否是指定类型
*
* @param ob 对象
* @return 是否是指定类型
*/
@Override
public boolean accept(Object ob) {
return false;
}
/**
* title应该是一个属性不只是对话框的标题时用到与其他组件结合时也会用得到
*
* @return 绥化狂标题
*/
@Override
public String title4PopupWindow() {
return title;
}
/**
* 重置
*/
@Override
public void reset() {
}
/**
* Populate.
*
* @param ob
*/
@Override
public void populateBean(ChartCollection ob) {
normalChartDataPane.populate(ob);
}
@Override
public void updateBean(ChartCollection ob) {
normalChartDataPane.update(ob);
}
/**
* Update.
*/
@Override
public ChartCollection updateBean() {
return null;
}
}

25
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java

@ -3,10 +3,6 @@ package com.fr.van.chart.funnel.designer;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.FunnelCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.FunnelDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
@ -94,14 +90,15 @@ public class FunnelIndependentVanChartInterface extends AbstractIndependentVanCh
return "com/fr/design/images/form/toolbar/funnel.png";
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new FunnelDataSetFieldsPane(), new FunnelCellDataFieldsPane());
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new FunnelDataSetFieldsPane(), new FunnelCellDataFieldsPane());
// }
// };
//
// }
}

39
designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java

@ -2,12 +2,6 @@ package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.GaugeCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.GaugeDataSetFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -115,20 +109,21 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha
return new VanChartGaugeSeriesPane(parent, plot);
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
VanChartGaugePlot gaugePlot = null;
if (getVanChart() != null) {
gaugePlot = getVanChart().getPlot();
}
if (gaugePlot != null && !gaugePlot.isMultiPointer()) {
return new SingleDataPane(new GaugeDataSetFieldsPane(), new GaugeCellDataFieldsPane());
}
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// VanChartGaugePlot gaugePlot = null;
// if (getVanChart() != null) {
// gaugePlot = getVanChart().getPlot();
// }
// if (gaugePlot != null && !gaugePlot.isMultiPointer()) {
// return new SingleDataPane(new GaugeDataSetFieldsPane(), new GaugeCellDataFieldsPane());
// }
// return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
// }
// };
// }
}

30
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java

@ -3,15 +3,10 @@ package com.fr.van.chart.heatmap.designer;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.PointMapCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.PointMapDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom;
@ -61,18 +56,25 @@ public class VanHeatMapChartTypeUI extends VanMapChartTypeUI {
return new VanChartHeatMapTypePane();
}
//图表数据结构 恢复用注释。删除下面方法。
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
PointMapDataSetFieldsPane pointMapDataSetFieldsPane = new PointMapDataSetFieldsPane();
pointMapDataSetFieldsPane.setChart(getVanChart());
return new SingleDataPane(pointMapDataSetFieldsPane, new PointMapCellDataFieldsPane());
}
};
protected boolean areaPlot(Plot plot) {
return false;
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// PointMapDataSetFieldsPane pointMapDataSetFieldsPane = new PointMapDataSetFieldsPane();
// pointMapDataSetFieldsPane.setChart(getVanChart());
// return new SingleDataPane(pointMapDataSetFieldsPane, new PointMapCellDataFieldsPane());
// }
// };
// }
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartHeatMapSeriesPane(parent, plot);
}

2
designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java

@ -29,6 +29,8 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane {
new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()},
new Component[]{createStackedAndAxisPane()},
//大数据模式 恢复用注释。下面1行删除。
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};

71
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.map;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -19,6 +20,7 @@ import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.attr.AttrMapLabel;
import com.fr.plugin.chart.map.line.condition.AttrCurve;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.type.MapMarkerType;
@ -27,6 +29,7 @@ import com.fr.van.chart.bubble.component.VanChartBubblePane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.border.VanChartBorderWithAlphaPane;
import com.fr.van.chart.designer.component.marker.VanChartImageMarkerPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import com.fr.van.chart.designer.style.series.VanChartEffectPane;
import com.fr.van.chart.map.designer.style.series.VanChartMapScatterMarkerPane;
@ -77,12 +80,63 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
private VanChartCurvePane curvePane;
private VanChartLineMapEffectPane lineMapEffectPane;
//大数据模式 恢复用注释。下面1行删除。
private UIButtonGroup<DataProcessor> lineMapLargeDataModelGroup;//大数据模式
private MapType mapType = MapType.AREA;
public VanChartMapSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
//大数据模式 恢复用注释。删除下面4个方法 checkLarge lineMapLargeModel checkLineMapLarge createLineMapLargeDataModelPane。
@Override
protected void checkLarge() {
if (largeModel(plot)) {
if (plot instanceof VanChartMapPlot) {
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
AttrMapLabel attrMapLabel = defaultAttr.getExisted(AttrMapLabel.class);
if (attrMapLabel == null) {
attrMapLabel = new AttrMapLabel();
defaultAttr.addDataSeriesCondition(attrMapLabel);
}
attrMapLabel.getPointLabel().setEnable(false);
VanChartInteractivePane.resetCustomCondition(((VanChartMapPlot) plot).getPointConditionCollection());
}
}
checkPointCompsEnabledWithLarge(plot);
}
private boolean lineMapLargeModel() {
return lineMapLargeDataModelGroup != null && lineMapLargeDataModelGroup.getSelectedIndex() == 0;
}
private void checkLineMapLarge() {
if (lineMapLargeModel()) {
if (plot instanceof VanChartMapPlot) {
VanChartInteractivePane.resetCustomCondition(((VanChartMapPlot) plot).getLineConditionCollection());
}
}
checkLineCompsEnabledWithLarge(plot);
}
private JPanel createLineMapLargeDataModelPane() {
lineMapLargeDataModelGroup = createLargeDataModelGroup();
lineMapLargeDataModelGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLineMapLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup);
return createLargeDataModelPane(panel);
}
protected void checkCompsEnabledWithLarge(Plot plot) {
checkPointCompsEnabledWithLarge(plot);
checkLineCompsEnabledWithLarge(plot);
@ -96,7 +150,10 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
private void checkLineCompsEnabledWithLarge(Plot plot) {
if (lineMapEffectPane != null) {
GUICoreUtils.setEnabled(lineMapEffectPane, !largeModel(plot));
//大数据模式 恢复用注释。下面1行删除。
GUICoreUtils.setEnabled(lineMapEffectPane, !lineMapLargeModel());
//大数据模式 恢复用注释。取消注释。
//GUICoreUtils.setEnabled(lineMapEffectPane, !largeModel(plot));
}
}
@ -158,6 +215,8 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), createPointAlphaPane())},
new Component[]{createMarkerComPane()},
//大数据模式 恢复用注释。下面1行删除。
new Component[]{createLargeDataModelPane()},
new Component[]{createPointEffectPane()},
};
@ -174,6 +233,8 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{
new Component[]{createCurvePane()},
//大数据模式 恢复用注释。下面1行删除。
new Component[]{createLineMapLargeDataModelPane()},
new Component[]{createAnimationPane()}
};
@ -331,6 +392,10 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
if (nullValueColorBox != null) {
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor());
}
//大数据模式 恢复用注释。下面3行删除。
if (lineMapLargeDataModelGroup != null) {
lineMapLargeDataModelGroup.setSelectedItem(((VanChartMapPlot) plot).getLineMapDataProcessor());
}
}
super.populateBean(plot);
}
@ -343,6 +408,10 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
if (nullValueColorBox != null) {
((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject());
}
//大数据模式 恢复用注释。下面3行删除。
if (lineMapLargeDataModelGroup != null) {
((VanChartMapPlot) plot).setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem());
}
}
super.updateBean(plot);
}

40
designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java

@ -2,16 +2,26 @@ package com.fr.van.chart.map;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.data.map.MapChartDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.map.designer.data.VanChartMapDataPane;
import com.fr.van.chart.map.designer.data.contentpane.report.VanAreaMapPlotReportDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.report.VanLineMapPlotReportDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.report.VanPointMapPlotReportDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanAreaMapPlotTableDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanLineMapPlotTableDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
import com.fr.van.chart.map.designer.other.VanChartMapOtherPane;
import com.fr.van.chart.map.designer.other.condition.pane.VanChartMapConditionPane;
import com.fr.van.chart.map.designer.style.VanChartMapStylePane;
@ -60,8 +70,34 @@ public class VanMapChartTypeUI extends AbstractIndependentVanChartUI {
return new VanChartMapPlotPane();
}
//图表数据结构 恢复用注释。取消注释。
// public ChartDataPane getChartDataPane(AttributeChangeListener listener){
// return new MapChartDataPane(listener);
// }
//图表数据结构 恢复用注释。删除下面5个方法 getTableDataSourcePane getReportDataSourcePane getChartDataPane areaPlot linePlot。
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return areaPlot(plot) ? new VanAreaMapPlotTableDataContentPane(parent)
: linePlot(plot) ? new VanLineMapPlotTableDataContentPane(parent)
: new VanPointMapPlotTableDataContentPane(parent);
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return areaPlot(plot) ? new VanAreaMapPlotReportDataContentPane(parent)
: linePlot(plot) ? new VanLineMapPlotReportDataContentPane(parent)
: new VanPointMapPlotReportDataContentPane(parent);
}
public ChartDataPane getChartDataPane(AttributeChangeListener listener){
return new MapChartDataPane(listener);
return new VanChartMapDataPane(listener);
}
protected boolean areaPlot(Plot plot) {
return plot != null && plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getMapType() == MapType.AREA;
}
protected boolean linePlot(Plot plot) {
return plot != null && plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getMapType() == MapType.LINE;
}
/**

84
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java

@ -0,0 +1,84 @@
package com.fr.van.chart.map.designer.data;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.DataContentsPane;
import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane;
import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane;
import javax.swing.JPanel;
/**
* Created by Mitisky on 16/5/17.
*/
public class CustomMapChartDataContentsPane extends DataContentsPane {
private NormalChartDataPane areaMapChartDataPane;
private NormalChartDataPane pointMapChartDataPane;
private NormalChartDataPane lineMapChartDataPane;
private AttributeChangeListener listener;
private ChartDataPane parent;
public CustomMapChartDataContentsPane(AttributeChangeListener listener, ChartDataPane parent) {
this.listener = listener;
this.parent = parent;
initAll();
}
@Override
public void setSupportCellData(boolean supportCellData) {
areaMapChartDataPane.setSupportCellData(supportCellData);
pointMapChartDataPane.setSupportCellData(supportCellData);
lineMapChartDataPane.setSupportCellData(supportCellData);
}
@Override
public void populate(ChartCollection collection) {
populateAreaMap(collection);
populatePointMap(collection);
populateLineMap(collection);
}
@Override
public void update(ChartCollection collection) {
updatePointMap(collection);
updateAreaMap(collection);
updateLineMap(collection);
}
public void populatePointMap(ChartCollection collection) {
pointMapChartDataPane.populate(collection);
}
public void populateLineMap(ChartCollection collection) {
lineMapChartDataPane.populate(collection);
}
public void updatePointMap(ChartCollection collection) {
pointMapChartDataPane.update(collection);
}
public void populateAreaMap(ChartCollection collection) {
areaMapChartDataPane.populate(collection);
}
public void updateAreaMap(ChartCollection collection) {
areaMapChartDataPane.update(collection);
}
public void updateLineMap(ChartCollection collection) {
lineMapChartDataPane.update(collection);
}
@Override
protected JPanel createContentPane() {
areaMapChartDataPane = new NormalChartDataPane(listener, parent);
pointMapChartDataPane = new NormalChartDataPane(listener, parent);
lineMapChartDataPane = new NormalChartDataPane(listener, parent);
return new VanMapAreaPointAndLineGroupPane(areaMapChartDataPane, pointMapChartDataPane, lineMapChartDataPane);
}
}

177
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java

@ -0,0 +1,177 @@
package com.fr.van.chart.map.designer.data;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.VanMapDefinition;
import com.fr.plugin.chart.type.MapType;
import java.util.List;
/**
* Created by shine on 2017/8/8.
*/
public class MapDataPaneHelper {
public static ChartCollection getPointMapChartCollection(ChartCollection chartCollection) {
try {
ChartCollection cloneCollection = (ChartCollection) chartCollection.clone();
Chart chart = cloneCollection.getSelectedChart();
TopDefinitionProvider definition = chart.getFilterDefinition();
if (definition != null && definition instanceof VanMapDefinition) {
chart.setFilterDefinition(((VanMapDefinition) definition).getPointDefinition());
}
Plot plot = chart.getPlot();
if (plot != null && plot instanceof VanChartMapPlot) {
((VanChartMapPlot) plot).setMapType(MapType.POINT);
}
return cloneCollection;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return chartCollection;
}
}
public static ChartCollection getLineMapChartCollection(ChartCollection chartCollection) {
try {
ChartCollection cloneCollection = (ChartCollection) chartCollection.clone();
Chart chart = cloneCollection.getSelectedChart();
TopDefinitionProvider definition = chart.getFilterDefinition();
if (definition != null && definition instanceof VanMapDefinition) {
chart.setFilterDefinition(((VanMapDefinition) definition).getLineDefinition());
}
Plot plot = chart.getPlot();
if (plot != null && plot instanceof VanChartMapPlot) {
((VanChartMapPlot) plot).setMapType(MapType.LINE);
}
return cloneCollection;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return chartCollection;
}
}
public static ChartCollection getAreaMapChartCollection(ChartCollection chartCollection) {
try {
ChartCollection cloneCollection = (ChartCollection) chartCollection.clone();
Chart chart = cloneCollection.getSelectedChart();
TopDefinitionProvider definition = chart.getFilterDefinition();
if (definition != null && definition instanceof VanMapDefinition) {
chart.setFilterDefinition(((VanMapDefinition) definition).getAreaDefinition());
}
Plot plot = chart.getPlot();
if (plot != null && plot instanceof VanChartMapPlot) {
((VanChartMapPlot) plot).setMapType(MapType.AREA);
}
return cloneCollection;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return chartCollection;
}
}
public static ChartCollection getBottomDataDrillMapChartCollection(ChartCollection chartCollection) {
try {
ChartCollection cloneCollection = (ChartCollection) chartCollection.clone();
Chart chart = cloneCollection.getSelectedChart();
TopDefinitionProvider definition = chart.getFilterDefinition();
if (definition != null && definition instanceof DrillMapDefinition) {
chart.setFilterDefinition(((DrillMapDefinition) definition).getBottomDataDefinition());
}
Plot plot = chart.getPlot();
if (plot != null && plot instanceof VanChartDrillMapPlot) {
List<MapType> list = ((VanChartDrillMapPlot) plot).getLayerMapTypeList();
MapType mapType = (list != null && list.size() > 0) ? list.get(list.size() - 1) : MapType.AREA;
((VanChartMapPlot) plot).setMapType(mapType);
}
return cloneCollection;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return chartCollection;
}
}
public static ChartCollection getLayerChartCollection(ChartCollection chartCollection, int level, MapType mapType) {
if (mapType == null) {
mapType = MapType.AREA;
}
try {
ChartCollection cloneCollection = (ChartCollection) chartCollection.clone();
Chart chart = cloneCollection.getSelectedChart();
TopDefinitionProvider definition = chart.getFilterDefinition();
if (definition != null && definition instanceof DrillMapDefinition) {
List<TopDefinitionProvider> list = ((DrillMapDefinition) definition).getEachLayerDataDefinitionList();
if (list.size() > level) {
chart.setFilterDefinition(list.get(level));
}
}
Plot plot = chart.getPlot();
if (plot != null && plot instanceof VanChartMapPlot) {
((VanChartMapPlot) plot).setMapType(mapType);
}
return cloneCollection;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return chartCollection;
}
}
public static boolean isFromBottomData(ChartCollection chartCollection) {
DrillMapDefinition drillMapDefinition = getDrillMapDefinition(chartCollection);
return drillMapDefinition == null || drillMapDefinition.isFromBottomData();
}
public static DrillMapDefinition getDrillMapDefinition(ChartCollection chartCollection) {
if (chartCollection != null) {
Chart chart = chartCollection.getSelectedChart();
if (chart != null) {
TopDefinitionProvider definitionProvider = chart.getFilterDefinition();
if (definitionProvider instanceof DrillMapDefinition) {
return (DrillMapDefinition) definitionProvider;
}
}
}
return null;
}
public static List<MapType> getDrillMapLayerMapTypeList(ChartCollection chartCollection) {
if (chartCollection != null) {
Chart chart = chartCollection.getSelectedChart();
if (chart != null) {
Plot plot = chart.getPlot();
if (plot instanceof VanChartDrillMapPlot) {
return ((VanChartDrillMapPlot) plot).getLayerMapTypeList();
}
}
}
return null;
}
public static MapType getPlotMapType(ChartCollection chartCollection) {
Plot plot = chartCollection.getSelectedChart().getPlot();
return getPlotMapType(plot);
}
public static MapType getPlotMapType(Plot plot) {
if (plot != null && plot instanceof VanChartMapPlot) {
return ((VanChartMapPlot) plot).getMapType();
}
return MapType.AREA;
}
}

121
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java

@ -0,0 +1,121 @@
package com.fr.van.chart.map.designer.data;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane;
import com.fr.plugin.chart.map.data.VanMapDefinition;
import com.fr.plugin.chart.type.MapType;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* Created by Mitisky on 16/5/16.
*/
public class VanChartMapDataPane extends ChartDataPane {
MapType mapType = MapType.AREA;
public VanChartMapDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected JPanel createContentPane() {
contentsPane = new NormalChartDataPane(listener, VanChartMapDataPane.this);
return contentsPane;
}
protected void repeatLayout(ChartCollection collection) {
if (contentsPane != null) {
this.remove(contentsPane);
}
this.setLayout(new BorderLayout(0, 0));
switch (mapType) {
case CUSTOM:
contentsPane = new CustomMapChartDataContentsPane(listener, VanChartMapDataPane.this);
break;
default:
contentsPane = new NormalChartDataPane(listener, VanChartMapDataPane.this);
break;
}
contentsPane.setSupportCellData(isSupportCellData());
this.add(contentsPane, BorderLayout.CENTER);
}
/**
* 更新界面 数据内容
*/
public void populate(ChartCollection collection) {
mapType = MapDataPaneHelper.getPlotMapType(collection);
repeatLayout(collection);
switch (mapType) {
case AREA:
ChartCollection areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection);
contentsPane.populate(areaClone);
break;
case POINT:
ChartCollection pointClone = MapDataPaneHelper.getPointMapChartCollection(collection);
contentsPane.populate(pointClone);
break;
case LINE:
ChartCollection lineClone = MapDataPaneHelper.getLineMapChartCollection(collection);
contentsPane.populate(lineClone);
break;
case CUSTOM:
ChartCollection areaClone1 = MapDataPaneHelper.getAreaMapChartCollection(collection);
ChartCollection pointClone1 = MapDataPaneHelper.getPointMapChartCollection(collection);
ChartCollection lineClone1 = MapDataPaneHelper.getLineMapChartCollection(collection);
((CustomMapChartDataContentsPane) contentsPane).populateAreaMap(areaClone1);
((CustomMapChartDataContentsPane) contentsPane).populatePointMap(pointClone1);
((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone1);
}
}
/**
* 保存 数据界面内容
*/
public void update(ChartCollection collection) {
if (contentsPane != null) {
VanMapDefinition vanMapDefinition = new VanMapDefinition();
ChartCollection pointClone = MapDataPaneHelper.getPointMapChartCollection(collection);
ChartCollection areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection);
ChartCollection lineClone = MapDataPaneHelper.getLineMapChartCollection(collection);
switch (mapType) {
case AREA:
contentsPane.update(areaClone);
pointClone.getSelectedChart().setFilterDefinition(null);
lineClone.getSelectedChart().setFilterDefinition(null);
break;
case POINT:
contentsPane.update(pointClone);
areaClone.getSelectedChart().setFilterDefinition(null);
lineClone.getSelectedChart().setFilterDefinition(null);
break;
case LINE:
contentsPane.update(lineClone);
areaClone.getSelectedChart().setFilterDefinition(null);
pointClone.getSelectedChart().setFilterDefinition(null);
break;
case CUSTOM:
((CustomMapChartDataContentsPane) contentsPane).updateAreaMap(areaClone);
((CustomMapChartDataContentsPane) contentsPane).updatePointMap(pointClone);
((CustomMapChartDataContentsPane) contentsPane).updateLineMap(lineClone);
break;
}
vanMapDefinition.setAreaDefinition(areaClone.getSelectedChart().getFilterDefinition());
vanMapDefinition.setPointDefinition(pointClone.getSelectedChart().getFilterDefinition());
vanMapDefinition.setLineDefinition(lineClone.getSelectedChart().getFilterDefinition());
collection.getSelectedChart().setFilterDefinition(vanMapDefinition);
}
}
}

34
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java

@ -0,0 +1,34 @@
package com.fr.van.chart.map.designer.data.component;
/**
* Created by hufan on 2016/12/23.
*/
public class LongitudeLatitudeAndArea {
private Object longitude;
private Object latitude;
private Object area;
public Object getLongitude() {
return longitude;
}
public void setLongitude(Object longitude) {
this.longitude = longitude;
}
public Object getLatitude() {
return latitude;
}
public void setLatitude(Object latitude) {
this.latitude = latitude;
}
public Object getArea() {
return area;
}
public void setArea(Object area) {
this.area = area;
}
}

23
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java

@ -0,0 +1,23 @@
package com.fr.van.chart.map.designer.data.component;
import com.fr.chart.chartdata.MoreNameCDDefinition;
import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldNamePane;
import com.fr.plugin.chart.map.data.VanMapMoreNameCDDefinition;
import java.awt.Component;
/**
* Created by Mitisky on 16/5/17.
*/
public class SeriesNameUseFieldNamePaneWithOutFilter extends SeriesNameUseFieldNamePane {
@Override
protected Component[][] getUseComponent() {
return getUseComponentWithOutFilter();
}
@Override
protected MoreNameCDDefinition createMoreNameCDDefinition() {
return new VanMapMoreNameCDDefinition();
}
}

29
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java

@ -0,0 +1,29 @@
package com.fr.van.chart.map.designer.data.component;
import com.fr.chart.chartdata.OneValueCDDefinition;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldValuePane;
import com.fr.plugin.chart.map.data.VanMapOneValueCDDefinition;
import java.awt.Component;
/**
* Created by Mitisky on 16/5/16.
*/
public class SeriesNameUseFieldValuePaneWithOutFilter extends SeriesNameUseFieldValuePane {
@Override
protected Component[][] getUseComponent(UILabel Label1, UILabel Label2, UILabel Label3) {
return getUseComponentWithOutFilter(Label1, Label2, Label3);
}
@Override
protected Component[][] getUseComponentWithOutSummary(UILabel Label1, UILabel Label2, UILabel Label3) {
return getUseComponentWithOutFilterAndSummary(Label1, Label2, Label3);
}
@Override
protected OneValueCDDefinition createOneValueCDDefinition() {
return new VanMapOneValueCDDefinition();
}
}

40
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java

@ -0,0 +1,40 @@
package com.fr.van.chart.map.designer.data.component;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldNamePane;
import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldValuePane;
import com.fr.design.mainframe.chart.gui.data.table.SeriesTypeUseComboxPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* Created by Mitisky on 16/5/16.
*/
public class SeriesTypeUseComboxPaneWithOutFilter extends SeriesTypeUseComboxPane {
public SeriesTypeUseComboxPaneWithOutFilter(ChartDataPane parent, Plot initplot) {
super(parent, initplot);
}
protected void initLayout() {
super.initLayout();
this.add(new JPanel(), BorderLayout.SOUTH);
}
protected void initComponents() {
super.initComponents();
this.setSelectedIndex(1);
}
@Override
protected SeriesNameUseFieldValuePane createValuePane() {
return new SeriesNameUseFieldValuePaneWithOutFilter();
}
@Override
protected SeriesNameUseFieldNamePane createNamePane() {
return new SeriesNameUseFieldNamePaneWithOutFilter();
}
}

14
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java

@ -0,0 +1,14 @@
package com.fr.van.chart.map.designer.data.component.report;
import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import javax.swing.JPanel;
/**
* Created by hufan on 2016/12/21.
*/
public abstract class AbstractLongLatAreaPane extends JPanel {
public abstract void populate(VanMapReportDefinition vanMapReportDefinition);
public abstract void update(VanMapReportDefinition vanMapReportDefinition);
}

64
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java

@ -0,0 +1,64 @@
package com.fr.van.chart.map.designer.data.component.report;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* Created by hufan on 2016/12/21.
*/
public class AreaPane extends AbstractReportDataContentPane {
protected TinyFormulaPane areaName;
public AreaPane() {
JPanel panel = createContentPane();
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
}
protected JPanel createContentPane() {
areaName = new TinyFormulaPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p};
Component[][] components = getComponent();
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), areaName}
};
}
@Override
protected String[] columnNames() {
return new String[0];
}
public void populate(LongitudeLatitudeAndArea longLatArea) {
if (longLatArea.getArea() != null) {
areaName.getUITextField().setText(longLatArea.getArea().toString());
}
}
public LongitudeLatitudeAndArea update() {
LongitudeLatitudeAndArea longLatArea = new LongitudeLatitudeAndArea();
longLatArea.setArea(canBeFormula(areaName.getUITextField().getText()));
return longLatArea;
}
@Override
public void populateBean(ChartCollection ob) {
}
}

71
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java

@ -0,0 +1,71 @@
package com.fr.van.chart.map.designer.data.component.report;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* Created by hufan on 2016/12/22.
*/
public class LineMapAreaPane extends PointMapAreaPane {
private static final int V_GAP = 10;
protected AreaPane endAreaPane;
protected JPanel createContentPane() {
initAreaPane();
initEndAreaPane();
JPanel content = new JPanel(new BorderLayout(0, V_GAP));
content.add(areaPane, BorderLayout.NORTH);
content.add(endAreaPane, BorderLayout.CENTER);
return content;
}
protected void initEndAreaPane() {
endAreaPane = new AreaPane() {
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), areaName}
};
}
};
}
@Override
protected void initAreaPane() {
areaPane = new AreaPane() {
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), areaName}
};
}
};
}
@Override
public void populate(VanMapReportDefinition vanMapReportDefinition) {
super.populate(vanMapReportDefinition);
LongitudeLatitudeAndArea endLongLatArea = new LongitudeLatitudeAndArea();
endLongLatArea.setArea(vanMapReportDefinition.getEndAreaName());
endLongLatArea.setLongitude(vanMapReportDefinition.getEndLongitude());
endLongLatArea.setLatitude(vanMapReportDefinition.getEndLatitude());
endAreaPane.populate(endLongLatArea);
}
@Override
public void update(VanMapReportDefinition vanMapReportDefinition) {
super.update(vanMapReportDefinition);
LongitudeLatitudeAndArea endLongLatArea = endAreaPane.update();
vanMapReportDefinition.setEndAreaName(endLongLatArea.getArea() == null ? null : endLongLatArea.getArea().toString());
vanMapReportDefinition.setEndLongitude(endLongLatArea.getLongitude() == null ? null : endLongLatArea.getLongitude().toString());
vanMapReportDefinition.setEndLatitude(endLongLatArea.getLatitude() == null ? null : endLongLatArea.getLatitude().toString());
}
}

36
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java

@ -0,0 +1,36 @@
package com.fr.van.chart.map.designer.data.component.report;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import java.awt.Component;
/**
* Created by hufan on 2016/12/22.
*/
public class LineMapLongLatAreaPane extends LineMapAreaPane {
protected void initEndAreaPane() {
endAreaPane = new LongLatAreaPane() {
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Longitude")), longitude},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Latitude")), latitude},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), areaName}
};
}
};
}
protected void initAreaPane() {
areaPane = new LongLatAreaPane() {
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Longitude")), longitude},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Latitude")), latitude},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), areaName}
};
}
};
}
}

77
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java

@ -0,0 +1,77 @@
package com.fr.van.chart.map.designer.data.component.report;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* Created by hufan on 2016/12/21.
*/
public class LongLatAreaPane extends AreaPane {
protected TinyFormulaPane longitude;
protected TinyFormulaPane latitude;
public LongLatAreaPane() {
JPanel panel = createContentPane();
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
}
@Override
protected JPanel createContentPane() {
areaName = new TinyFormulaPane();
longitude = new TinyFormulaPane();
latitude = new TinyFormulaPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p, p, p};
Component[][] components = getComponent();
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6);
}
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitude},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitude},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), areaName}
};
}
@Override
public void populateBean(ChartCollection ob) {
}
@Override
protected String[] columnNames() {
return new String[0];
}
@Override
public void populate(LongitudeLatitudeAndArea longLatArea) {
super.populate(longLatArea);
if (longLatArea.getLongitude() != null) {
longitude.getUITextField().setText(longLatArea.getLongitude().toString());
}
if (longLatArea.getLatitude() != null) {
latitude.getUITextField().setText(longLatArea.getLatitude().toString());
}
}
@Override
public LongitudeLatitudeAndArea update() {
LongitudeLatitudeAndArea longLatArea = super.update();
longLatArea.setLongitude(canBeFormula(longitude.getUITextField().getText()));
longLatArea.setLatitude(canBeFormula(latitude.getUITextField().getText()));
return longLatArea;
}
}

48
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java

@ -0,0 +1,48 @@
package com.fr.van.chart.map.designer.data.component.report;
import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* Created by hufan on 2016/12/23.
*/
public class PointMapAreaPane extends AbstractLongLatAreaPane {
protected AreaPane areaPane;
public PointMapAreaPane() {
JPanel contentPane = createContentPane();
this.setLayout(new BorderLayout());
this.add(contentPane, BorderLayout.CENTER);
}
protected JPanel createContentPane() {
initAreaPane();
JPanel content = new JPanel(new BorderLayout());
content.add(areaPane, BorderLayout.CENTER);
return content;
}
protected void initAreaPane() {
areaPane = new AreaPane();
}
@Override
public void populate(VanMapReportDefinition vanMapReportDefinition) {
LongitudeLatitudeAndArea longLatArea = new LongitudeLatitudeAndArea();
longLatArea.setArea(vanMapReportDefinition.getCategoryName());
longLatArea.setLongitude(vanMapReportDefinition.getLongitude());
longLatArea.setLatitude(vanMapReportDefinition.getLatitude());
areaPane.populate(longLatArea);
}
@Override
public void update(VanMapReportDefinition vanMapReportDefinition) {
LongitudeLatitudeAndArea longLatArea = areaPane.update();
vanMapReportDefinition.setCategoryName(longLatArea.getArea() == null ? null : longLatArea.getArea().toString());
vanMapReportDefinition.setLongitude(longLatArea.getLongitude() == null ? null : longLatArea.getLongitude().toString());
vanMapReportDefinition.setLatitude(longLatArea.getLatitude() == null ? null : longLatArea.getLatitude().toString());
}
}

14
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java

@ -0,0 +1,14 @@
package com.fr.van.chart.map.designer.data.component.report;
/**
* Created by hufan on 2016/12/23.
*/
public class PointMapLongLatAreaPane extends PointMapAreaPane {
public PointMapLongLatAreaPane() {
super();
}
protected void initAreaPane() {
areaPane = new LongLatAreaPane();
}
}

26
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java

@ -0,0 +1,26 @@
package com.fr.van.chart.map.designer.data.component.table;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import javax.swing.JPanel;
import java.util.List;
/**
* Created by hufan on 2016/12/21.
*/
public abstract class AbstractLongLatAreaPane extends JPanel {
public abstract boolean isSelectedItem();
public abstract void populate(VanMapTableDefinitionProvider mapTableDefinitionProvider);
public abstract void update(VanMapTableDefinitionProvider mapTableDefinitionProvider);
public abstract void refreshBoxListWithSelectTableData(List list);
public abstract void checkBoxUse(boolean hasUse);
public abstract void clearAllBoxList();
}

104
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java

@ -0,0 +1,104 @@
package com.fr.van.chart.map.designer.data.component.table;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
/**
* Created by hufan on 2016/12/21.
*/
public class AreaPane extends AbstractTableDataContentPane {
protected VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane listener;
protected UIComboBox areaNameCom;
public AreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
this.listener = parentPane;
this.setLayout(new BorderLayout());
JPanel panel = createAreaNamePane();
this.add(panel, BorderLayout.CENTER);
}
@Override
public void updateBean(ChartCollection ob) {
}
public void checkBoxUse(boolean hasUse) {
areaNameCom.setEnabled(hasUse);
}
protected JPanel createAreaNamePane() {
initAreaNameCom();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p};
Component[][] components = getComponent();
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6);
}
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), areaNameCom}
};
}
protected void initAreaNameCom() {
areaNameCom = new UIComboBox();
areaNameCom.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
listener.fireCheckSeriesUse(areaNameCom.getSelectedItem() != null);
makeToolTipUse(areaNameCom);
}
});
}
protected void makeToolTipUse(UIComboBox comBox) {
if (comBox.getSelectedItem() != null) {
comBox.setToolTipText(comBox.getSelectedItem().toString());
} else {
comBox.setToolTipText(null);
}
}
@Override
public void refreshBoxListWithSelectTableData(List list) {
refreshBoxItems(areaNameCom, list);
}
public boolean isSelectedItem() {
return areaNameCom.getSelectedItem() != null;
}
public void populate(LongitudeLatitudeAndArea longLatArea) {
if (longLatArea.getArea() != null) {
areaNameCom.setSelectedItem(longLatArea.getArea());
}
}
public LongitudeLatitudeAndArea update() {
LongitudeLatitudeAndArea longLatArea = new LongitudeLatitudeAndArea();
longLatArea.setArea(areaNameCom.getSelectedItem());
return longLatArea;
}
@Override
public void clearAllBoxList() {
clearBoxItems(areaNameCom);
}
}

100
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java

@ -0,0 +1,100 @@
package com.fr.van.chart.map.designer.data.component.table;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.List;
/**
* Created by hufan on 2016/12/21.
*/
public class LineMapAreaPane extends PointMapAreaPane {
private static final int V_GAP = 10;
protected AreaPane endAreaPane;
public LineMapAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
super(parentPane);
}
protected JPanel createContentPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
initAreaPane(parentPane);
initEndAreaPane(parentPane);
JPanel content = new JPanel(new BorderLayout(0, V_GAP));
content.add(areaPane, BorderLayout.NORTH);
content.add(endAreaPane, BorderLayout.CENTER);
return content;
}
protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
areaPane = new AreaPane(parentPane) {
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), areaNameCom}
};
}
};
}
protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
endAreaPane = new AreaPane(parentPane) {
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), areaNameCom}
};
}
};
}
@Override
public void refreshBoxListWithSelectTableData(List list) {
super.refreshBoxListWithSelectTableData(list);
endAreaPane.refreshBoxListWithSelectTableData(list);
}
@Override
public boolean isSelectedItem() {
return super.isSelectedItem()
&& endAreaPane.isSelectedItem();
}
@Override
public void populate(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
super.populate(mapTableDefinitionProvider);
LongitudeLatitudeAndArea endLongLatArea = new LongitudeLatitudeAndArea();
endLongLatArea.setArea(mapTableDefinitionProvider.getEndAreaName());
endLongLatArea.setLongitude(mapTableDefinitionProvider.getEndLongitude());
endLongLatArea.setLatitude(mapTableDefinitionProvider.getEndLatitude());
endAreaPane.populate(endLongLatArea);
}
@Override
public void update(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
super.update(mapTableDefinitionProvider);
LongitudeLatitudeAndArea endLongLatArea = endAreaPane.update();
mapTableDefinitionProvider.setEndAreaName(endLongLatArea.getArea() == null ? null : endLongLatArea.getArea().toString());
mapTableDefinitionProvider.setEndLongitude(endLongLatArea.getLongitude() == null ? null : endLongLatArea.getLongitude().toString());
mapTableDefinitionProvider.setEndLatitude(endLongLatArea.getLatitude() == null ? null : endLongLatArea.getLatitude().toString());
}
@Override
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
endAreaPane.checkBoxUse(hasUse);
}
@Override
public void clearAllBoxList() {
super.clearAllBoxList();
endAreaPane.clearAllBoxList();
}
}

41
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java

@ -0,0 +1,41 @@
package com.fr.van.chart.map.designer.data.component.table;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
import java.awt.Component;
/**
* Created by hufan on 2016/12/21.
*/
public class LineMapLongLatAreaPane extends LineMapAreaPane {
public LineMapLongLatAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
super(parentPane);
}
protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
endAreaPane = new LongLatAreaPane(parentPane) {
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Longitude")), longitudeCom},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Latitude")), latitudeCom},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), areaNameCom}
};
}
};
}
protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
areaPane = new LongLatAreaPane(parentPane) {
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Longitude")), longitudeCom},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Latitude")), latitudeCom},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), areaNameCom}
};
}
};
}
}

122
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java

@ -0,0 +1,122 @@
package com.fr.van.chart.map.designer.data.component.table;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
import javax.swing.JPanel;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
/**
* Created by hufan on 2016/12/21.
*/
public class LongLatAreaPane extends AreaPane {
protected UIComboBox longitudeCom;
protected UIComboBox latitudeCom;
public LongLatAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
super(parentPane);
}
@Override
protected JPanel createAreaNamePane() {
initAreaNameCom();
initLongitudeCom();
initLatitudeCom();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p, p, p};
Component[][] components = getComponent();
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6);
}
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitudeCom},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitudeCom},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), areaNameCom}
};
}
public void refreshBoxListWithSelectTableData(List list) {
super.refreshBoxListWithSelectTableData(list);
refreshBoxItems(longitudeCom, list);
refreshBoxItems(latitudeCom, list);
}
protected void initLatitudeCom() {
latitudeCom = new UIComboBox();
latitudeCom.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
listener.fireCheckSeriesUse(latitudeCom.getSelectedItem() != null);
makeToolTipUse(latitudeCom);
}
});
}
@Override
public void populate(LongitudeLatitudeAndArea longLatArea) {
super.populate(longLatArea);
if (longLatArea.getLongitude() != null) {
longitudeCom.setSelectedItem(longLatArea.getLongitude());
}
if (longLatArea.getLatitude() != null) {
latitudeCom.setSelectedItem(longLatArea.getLatitude());
}
}
@Override
public LongitudeLatitudeAndArea update() {
LongitudeLatitudeAndArea longitudeLatitudeAndArea = super.update();
longitudeLatitudeAndArea.setLatitude(latitudeCom.getSelectedItem());
longitudeLatitudeAndArea.setLongitude(longitudeCom.getSelectedItem());
return longitudeLatitudeAndArea;
}
@Override
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
longitudeCom.setEnabled(hasUse);
latitudeCom.setEnabled(hasUse);
}
public void clearAllBoxList() {
super.clearAllBoxList();
clearBoxItems(longitudeCom);
clearBoxItems(latitudeCom);
}
protected void initLongitudeCom() {
longitudeCom = new UIComboBox();
longitudeCom.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
listener.fireCheckSeriesUse(longitudeCom.getSelectedItem() != null);
makeToolTipUse(longitudeCom);
}
});
}
@Override
protected String title4PopupWindow() {
return null;
}
public boolean isSelectedItem() {
return super.isSelectedItem()
&& longitudeCom.getSelectedItem() != null
&& latitudeCom.getSelectedItem() != null;
}
}

69
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java

@ -0,0 +1,69 @@
package com.fr.van.chart.map.designer.data.component.table;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.List;
/**
* Created by hufan on 2016/12/23.
*/
public class PointMapAreaPane extends AbstractLongLatAreaPane {
protected AreaPane areaPane;
public PointMapAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
JPanel contentPane = createContentPane(parentPane);
this.setLayout(new BorderLayout());
this.add(contentPane, BorderLayout.CENTER);
}
protected JPanel createContentPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
initAreaPane(parentPane);
JPanel content = new JPanel(new BorderLayout());
content.add(areaPane, BorderLayout.CENTER);
return content;
}
protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
areaPane = new AreaPane(parentPane);
}
public void refreshBoxListWithSelectTableData(List list) {
areaPane.refreshBoxListWithSelectTableData(list);
}
@Override
public void checkBoxUse(boolean hasUse) {
areaPane.checkBoxUse(hasUse);
}
@Override
public void clearAllBoxList() {
areaPane.clearAllBoxList();
}
@Override
public boolean isSelectedItem() {
return areaPane.isSelectedItem();
}
@Override
public void populate(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
LongitudeLatitudeAndArea longLatArea = new LongitudeLatitudeAndArea();
longLatArea.setArea(mapTableDefinitionProvider.getCategoryName());
longLatArea.setLongitude(mapTableDefinitionProvider.getLongitude());
longLatArea.setLatitude(mapTableDefinitionProvider.getLatitude());
areaPane.populate(longLatArea);
}
@Override
public void update(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
LongitudeLatitudeAndArea longLatArea = areaPane.update();
mapTableDefinitionProvider.setCategoryName(longLatArea.getArea() == null ? null : longLatArea.getArea().toString());
mapTableDefinitionProvider.setLongitude(longLatArea.getLongitude() == null ? null : longLatArea.getLongitude().toString());
mapTableDefinitionProvider.setLatitude(longLatArea.getLatitude() == null ? null : longLatArea.getLatitude().toString());
}
}

18
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java

@ -0,0 +1,18 @@
package com.fr.van.chart.map.designer.data.component.table;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
/**
* Created by hufan on 2016/12/23.
*/
public class PointMapLongLatAreaPane extends PointMapAreaPane {
public PointMapLongLatAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
super(parentPane);
}
protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
areaPane = new LongLatAreaPane(parentPane);
}
}

110
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java

@ -0,0 +1,110 @@
package com.fr.van.chart.map.designer.data.contentpane.report;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.List;
/**
* Created by Mitisky on 16/5/16.
*/
public class VanAreaMapPlotReportDataContentPane extends AbstractReportDataContentPane {
protected TinyFormulaPane areaName;
public VanAreaMapPlotReportDataContentPane(ChartDataPane parent) {
initEveryPane();
initAreaName();
JPanel panel = getContent();
panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
this.add(panel, "0,0,2,0");
}
protected void initAreaName() {
areaName = new TinyFormulaPane() {
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(4, 0));
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name"));
label.setPreferredSize(new Dimension(75, 20));
this.add(label, BorderLayout.WEST);
formulaTextField.setPreferredSize(new Dimension(100, 20));
this.add(formulaTextField, BorderLayout.CENTER);
this.add(formulaTextFieldButton, BorderLayout.EAST);
}
};
}
protected JPanel getContent() {
return getFormulaPane();
}
protected JPanel getFormulaPane() {
return areaName;
}
@Override
protected String[] columnNames() {
return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Value")
};
}
public void populateBean(ChartCollection collection) {
TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition();
if (topDefinitionProvider instanceof VanMapReportDefinition) {
VanMapReportDefinition mapReportDefinition = (VanMapReportDefinition) topDefinitionProvider;
populateDefinition(mapReportDefinition);
}
}
protected void populateDefinition(VanMapReportDefinition mapReportDefinition) {
if (mapReportDefinition.getCategoryName() != null) {
areaName.getUITextField().setText(mapReportDefinition.getCategoryName().toString());
}
if (mapReportDefinition.getSeriesSize() > 0) {
seriesPane.populateBean(mapReportDefinition.getEntryList());
}
}
public void updateBean(ChartCollection collection) {
collection.getSelectedChart().setFilterDefinition(new VanMapReportDefinition());
TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition();
if (topDefinitionProvider instanceof VanMapReportDefinition) {
VanMapReportDefinition mapReportDefinition = (VanMapReportDefinition) topDefinitionProvider;
updateDefinition(mapReportDefinition);
}
}
protected void updateDefinition(VanMapReportDefinition mapReportDefinition) {
mapReportDefinition.setCategoryName(canBeFormula(areaName.getUITextField().getText()));
mapReportDefinition.setLatitude(null);
mapReportDefinition.setLongitude(null);
List<Object[]> list = seriesPane.updateBean();
for (Object[] o : list) {
SeriesDefinition sd = new SeriesDefinition();
sd.setSeriesName(canBeFormula(o[0]));
sd.setValue(canBeFormula(o[1]));
mapReportDefinition.addSeriesValue(sd);
}
}
}

24
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java

@ -0,0 +1,24 @@
package com.fr.van.chart.map.designer.data.contentpane.report;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.van.chart.map.designer.data.component.report.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.report.LineMapAreaPane;
import com.fr.van.chart.map.designer.data.component.report.LineMapLongLatAreaPane;
/**
* Created by hufan on 2016/12/15.
*/
public class VanLineMapPlotReportDataContentPane extends VanPointMapPlotReportDataContentPane {
public VanLineMapPlotReportDataContentPane(ChartDataPane parent) {
super(parent);
}
protected AbstractLongLatAreaPane getAreaPane() {
return new LineMapAreaPane();
}
protected AbstractLongLatAreaPane getLongLatAreaPane() {
return new LineMapLongLatAreaPane();
}
}

170
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java

@ -0,0 +1,170 @@
package com.fr.van.chart.map.designer.data.contentpane.report;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import com.fr.van.chart.map.designer.data.component.report.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.report.PointMapAreaPane;
import com.fr.van.chart.map.designer.data.component.report.PointMapLongLatAreaPane;
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;
/**
* Created by Mitisky on 16/5/17.
*/
public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDataContentPane {
private LongLatReportFormulaPane longLatReportFormulaPane;
public VanPointMapPlotReportDataContentPane(ChartDataPane parent) {
super(parent);
}
@Override
protected JPanel getContent() {
longLatReportFormulaPane = new LongLatReportFormulaPane();
JPanel content = new JPanel(new BorderLayout(0, 4));
content.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 0));
content.add(longLatReportFormulaPane, BorderLayout.CENTER);
return content;
}
@Override
protected void populateDefinition(VanMapReportDefinition mapReportDefinition) {
super.populateDefinition(mapReportDefinition);
longLatReportFormulaPane.populateBean(mapReportDefinition);
}
@Override
protected void updateDefinition(VanMapReportDefinition mapReportDefinition) {
super.updateDefinition(mapReportDefinition);
longLatReportFormulaPane.updateBean(mapReportDefinition);
}
//================================public class===================================
public class LongLatReportFormulaPane extends BasicBeanPane<VanMapReportDefinition> {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
private UIButtonGroup<Integer> locationType;
private JPanel centerPane;
private AbstractLongLatAreaPane areaPane;
private AbstractLongLatAreaPane longLatAreaPane;
public LongLatReportFormulaPane() {
this.setLayout(new BorderLayout(0, 5));
centerPane = new JPanel(new CardLayout()) {
@Override
public Dimension getPreferredSize() {
if (locationType.getSelectedIndex() == 0) {
return areaPane.getPreferredSize();
} else {
return longLatAreaPane.getPreferredSize();
}
}
};
locationType = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Location_With_Area_Name"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Location_With_LongAndLat")});
locationType.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkCenterPane();
}
});
longLatAreaPane = getLongLatAreaPane();
areaPane = getAreaPane();
centerPane.add(areaPane, "area");
centerPane.add(longLatAreaPane, "longLat");
locationType.setSelectedIndex(0);
double[] columnSize = {p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Geographic")), locationType},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6);
this.add(panel, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
}
private void checkCenterPane() {
CardLayout cardLayout = (CardLayout) centerPane.getLayout();
if (locationType.getSelectedIndex() == 0) {
cardLayout.show(centerPane, "area");
} else {
cardLayout.show(centerPane, "longLat");
}
}
public void populateBean(VanMapReportDefinition mapReportDefinition) {
locationType.setSelectedIndex(mapReportDefinition.isUseAreaName() ? 0 : 1);
if (locationType.getSelectedIndex() == 0) {
areaPane.populate(mapReportDefinition);
} else {
longLatAreaPane.populate(mapReportDefinition);
}
checkCenterPane();
}
public void updateBean(VanMapReportDefinition mapReportDefinition) {
boolean useAreaName = locationType.getSelectedIndex() == 0;
mapReportDefinition.setUseAreaName(useAreaName);
if (useAreaName) {
areaPane.update(mapReportDefinition);
} else {
longLatAreaPane.update(mapReportDefinition);
}
checkCenterPane();
}
/**
* Update.
*/
@Override
public VanMapReportDefinition updateBean() {
return null;
}
@Override
protected String title4PopupWindow() {
return null;
}
}
protected AbstractLongLatAreaPane getAreaPane() {
return new PointMapAreaPane();
}
protected AbstractLongLatAreaPane getLongLatAreaPane() {
return new PointMapLongLatAreaPane();
}
}

176
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java

@ -0,0 +1,176 @@
package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
/**
* Created by Mitisky on 16/5/16.
*/
public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContentPane {
private UIComboBox areaNameCom;
protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane;
public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) {
this.setLayout(new BorderLayout(0, 4));
initAreaNameCom();
JPanel areaNamePane = createAreaNamePane();
JSeparator jSeparator = new JSeparator();
areaNamePane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
jSeparator.setPreferredSize(new Dimension(246, 2));
this.add(areaNamePane, BorderLayout.NORTH);
this.add(jSeparator, BorderLayout.CENTER);
seriesTypeUseComboxPane = new SeriesTypeUseComboxPaneWithOutFilter(parent, new VanChartMapPlot());
this.add(seriesTypeUseComboxPane, BorderLayout.SOUTH);
}
protected void initAreaNameCom() {
areaNameCom = new UIComboBox();
areaNameCom.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
checkSeriseUse(areaNameCom.getSelectedItem() != null);
makeToolTipUse(areaNameCom);
}
});
}
protected JPanel createAreaNamePane() {
UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name"));
label.setPreferredSize(new Dimension(80, 20));
areaNameCom.setPreferredSize(new Dimension(100, 20));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{label, areaNameCom},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
protected void makeToolTipUse(UIComboBox comBox) {
if (comBox.getSelectedItem() != null) {
comBox.setToolTipText(comBox.getSelectedItem().toString());
} else {
comBox.setToolTipText(null);
}
}
/**
* 检查 某些Box是否可用
*
* @param hasUse 是否使用.
*/
public void checkBoxUse(boolean hasUse) {
checkAreaName(hasUse);
checkSeriseUse(hasUse);
}
protected void checkAreaName(boolean hasUse) {
areaNameCom.setEnabled(hasUse);
}
protected void checkSeriseUse(boolean hasUse) {
if (seriesTypeUseComboxPane != null) {
seriesTypeUseComboxPane.checkUseBox(hasUse && isAreaSelectedItem());
}
}
protected boolean isAreaSelectedItem() {
return areaNameCom.getSelectedItem() != null;
}
protected void refreshBoxListWithSelectTableData(java.util.List list) {
refreshAreaName(list);
seriesTypeUseComboxPane.refreshBoxListWithSelectTableData(list);
}
protected void refreshAreaName(List list) {
refreshBoxItems(areaNameCom, list);
}
/**
* 清空所有的box设置
*/
public void clearAllBoxList() {
clearAreaName();
seriesTypeUseComboxPane.clearAllBoxList();
}
protected void clearAreaName() {
clearBoxItems(areaNameCom);
}
/**
* 保存界面内容到ChartCollection
*/
public void updateBean(ChartCollection collection) {
seriesTypeUseComboxPane.updateBean(collection);
TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition();
if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) {
VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider;
updateDefinition(mapTableDefinitionProvider);
}
}
protected void updateDefinition(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
Object o = areaNameCom.getSelectedItem();
mapTableDefinitionProvider.setCategoryName(o == null ? null : o.toString());
}
/**
* 根据ChartCollection 更新界面
*/
public void populateBean(ChartCollection collection) {
seriesTypeUseComboxPane.populateBean(collection, this.isNeedSummaryCaculateMethod());
TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition();
if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) {
VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider;
populateDefinition(mapTableDefinitionProvider);
}
}
protected void populateDefinition(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
if (mapTableDefinitionProvider.getCategoryName() != null) {
areaNameCom.setSelectedItem(mapTableDefinitionProvider.getCategoryName());
}
}
/**
* 重新布局整个面板
*/
public void redoLayoutPane() {
seriesTypeUseComboxPane.relayoutPane(this.isNeedSummaryCaculateMethod());
}
}

25
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java

@ -0,0 +1,25 @@
package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.table.LineMapAreaPane;
import com.fr.van.chart.map.designer.data.component.table.LineMapLongLatAreaPane;
/**
* Created by hufan on 2016/12/15.
*/
public class VanLineMapPlotTableDataContentPane extends VanPointMapPlotTableDataContentPane {
public VanLineMapPlotTableDataContentPane(ChartDataPane parent) {
super(parent);
}
protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new LineMapAreaPane(longLatAreaTableComboPane);
}
protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new LineMapLongLatAreaPane(longLatAreaTableComboPane);
}
}

224
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java

@ -0,0 +1,224 @@
package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane;
import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane;
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;
import java.util.List;
/**
* Created by Mitisky on 16/5/17.
*/
public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableDataContentPane {
private static final int LEFT_GAP = 19;
private static final int V_GAP = 15;
//改控件相当于面积图的区域名控件
private LongLatAreaTableComboPane longLatTableComboPane;
public VanPointMapPlotTableDataContentPane(ChartDataPane parent) {
super(parent);
}
protected void initAreaNameCom() {
longLatTableComboPane = new LongLatAreaTableComboPane();
}
protected JPanel createAreaNamePane() {
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0, LEFT_GAP, V_GAP, 0));
panel.add(longLatTableComboPane, BorderLayout.CENTER);
return panel;
}
@Override
protected void refreshAreaName(List list) {
longLatTableComboPane.refreshBoxListWithSelectTableData(list);
}
@Override
protected void checkAreaName(boolean hasUse) {
longLatTableComboPane.checkBoxUse(hasUse);
}
protected boolean isAreaSelectedItem() {
return longLatTableComboPane.isSelectedItem();
}
@Override
protected void clearAreaName() {
longLatTableComboPane.clearAllBoxList();
}
@Override
protected void updateDefinition(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
longLatTableComboPane.updateBean(mapTableDefinitionProvider);
}
@Override
protected void populateDefinition(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
longLatTableComboPane.populateBean(mapTableDefinitionProvider);
}
public class LongLatAreaTableComboPane extends BasicBeanPane<VanMapTableDefinitionProvider> {
private UIButtonGroup<Integer> locationType;
private JPanel centerPane;
private AbstractLongLatAreaPane longLatAreaPane;
private AbstractLongLatAreaPane areaNamePane;
public LongLatAreaTableComboPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
this.setLayout(new BorderLayout(0, 5));
centerPane = new JPanel(new CardLayout()) {
@Override
public Dimension getPreferredSize() {
if (locationType.getSelectedIndex() == 0) {
return new Dimension(180, (int) areaNamePane.getPreferredSize().getHeight());
} else {
return new Dimension(180, (int) longLatAreaPane.getPreferredSize().getHeight());
}
}
};
locationType = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Location_With_Area_Name"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Location_With_LongAndLat")});
locationType.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkCenterPane();
}
});
longLatAreaPane = createLongLatAreaPane(this);
areaNamePane = createAreaPane(this);
centerPane.add(areaNamePane, "area");
centerPane.add(longLatAreaPane, "longLat");
locationType.setSelectedIndex(0);
double[] columnSize = {p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Geographic")), locationType},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 30, 6);
this.add(panel, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
}
public void fireCheckSeriesUse(boolean hasUse) {
checkSeriseUse(hasUse);
}
private void checkCenterPane() {
CardLayout cardLayout = (CardLayout) centerPane.getLayout();
if (locationType.getSelectedIndex() == 0) {
cardLayout.show(centerPane, "area");
} else {
cardLayout.show(centerPane, "longLat");
}
fireCheckSeriesUse(true);
}
protected void refreshBoxListWithSelectTableData(List list) {
areaNamePane.refreshBoxListWithSelectTableData(list);
longLatAreaPane.refreshBoxListWithSelectTableData(list);
}
/**
* 检查 某些Box是否可用
*
* @param hasUse 是否使用.
*/
public void checkBoxUse(boolean hasUse) {
areaNamePane.checkBoxUse(hasUse);
longLatAreaPane.checkBoxUse(hasUse);
}
/**
* 清空所有的box设置
*/
public void clearAllBoxList() {
areaNamePane.clearAllBoxList();
longLatAreaPane.clearAllBoxList();
}
@Override
public void populateBean(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
locationType.setSelectedIndex(mapTableDefinitionProvider.isUseAreaName() ? 0 : 1);
if (locationType.getSelectedIndex() == 0) {
areaNamePane.populate(mapTableDefinitionProvider);
} else {
longLatAreaPane.populate(mapTableDefinitionProvider);
}
checkCenterPane();
}
public void updateBean(VanMapTableDefinitionProvider mapTableDefinitionProvider) {
boolean useAreaName = locationType.getSelectedIndex() == 0;
mapTableDefinitionProvider.setUseAreaName(useAreaName);
if (useAreaName) {
areaNamePane.update(mapTableDefinitionProvider);
} else {
longLatAreaPane.update(mapTableDefinitionProvider);
}
checkCenterPane();
}
@Override
public VanMapTableDefinitionProvider updateBean() {
return null;
}
@Override
protected String title4PopupWindow() {
return "longAndLat";
}
public boolean isSelectedItem() {
if (locationType.getSelectedIndex() == 0) {
return areaNamePane.isSelectedItem();
} else {
return longLatAreaPane.isSelectedItem();
}
}
}
protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new PointMapAreaPane(longLatAreaTableComboPane);
}
protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new PointMapLongLatAreaPane(longLatAreaTableComboPane);
}
}

16
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java

@ -4,6 +4,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.other.AutoRefreshPane;
import com.fr.van.chart.designer.other.AutoRefreshPaneWithoutTooltip;
@ -34,6 +35,21 @@ public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZo
hyperlinkPane.updateBean(plot);
}
//大数据模式 恢复用注释。删除下面方法。
@Override
protected boolean largeModel(Plot plot) {
if (plot instanceof VanChartMapPlot) {
VanChartMapPlot mapPlot = (VanChartMapPlot) plot;
switch (mapPlot.getMapType()) {
case LINE:
return PlotFactory.lineMapLargeModel(mapPlot);
default:
return PlotFactory.largeDataModel(mapPlot);
}
}
return false;
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
if (this.chart == null || this.chart.getPlot() == null) {

5
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartLineMapConditionPane.java

@ -46,7 +46,10 @@ public class VanChartLineMapConditionPane extends DataSeriesConditionPane {
classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this));
classPaneMap.put(AttrCurve.class, new VanChartCurveConditionPane(this));
classPaneMap.put(AttrTooltip.class, new VanChartLineMapTooltipConditionPane(this, plot));
if (!PlotFactory.largeDataModel(plot)) {
//大数据模式 恢复用注释。下面1行删除。
if (!PlotFactory.lineMapLargeModel(plot)) {
//大数据模式 恢复用注释。取消注释。
//if (!PlotFactory.largeDataModel(plot)) {
classPaneMap.put(AttrLineEffect.class, new VanChartLineEffectConditionPane(this, EffectHelper.getLineMapDefaultLineEffect()));
}
}

25
designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java

@ -2,14 +2,8 @@ package com.fr.van.chart.multilayer;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.MultiPieCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiPieDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.multilayer.other.VanChartMultiPieConditionPane;
@ -42,15 +36,16 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan
};
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new MultiPieDataSetFieldsPane(), new MultiPieCellDataFieldsPane());
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new MultiPieDataSetFieldsPane(), new MultiPieCellDataFieldsPane());
// }
// };
// }
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartMultiPieSeriesPane(parent, plot);

23
designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java

@ -4,10 +4,6 @@ package com.fr.van.chart.scatter;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.ScatterDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
@ -108,13 +104,14 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
return new VanChartScatterConditionPane(plot);
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane());
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane());
// }
// };
// }
}

2
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

@ -39,6 +39,8 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane {
new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()},
new Component[]{createStackedAndAxisPane()},
//大数据模式 恢复用注释。下面1行删除。
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};

12
designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java

@ -1,9 +1,11 @@
package com.fr.van.chart.scatter.component;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle;
import com.fr.plugin.chart.type.LineType;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.component.VanChartLineTypePane;
import java.awt.Component;
@ -23,6 +25,9 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane {
@Override
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
//线型支持虚线 恢复用注释。下面2行删除。
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
lineStyleComponent
};
}
@ -31,7 +36,10 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane {
protected VanChartAttrLine initVanChartAttrLine() {
VanChartAttrLine attrLine = new VanChartAttrLine();
//默认为无线型,且默認空值不斷開
attrLine.setLineType(LineType.NONE);
//线型支持虚线 恢复用注释。下面1行删除。
attrLine.setLineWidth(Constants.LINE_NONE);
//线型支持虚线 恢复用注释。取消注释。
//attrLine.setLineType(LineType.NONE);
attrLine.setNullValueBreak(false);
return attrLine;
}

36
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java

@ -3,10 +3,6 @@ package com.fr.van.chart.structure.desinger;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.StructureDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
@ -16,6 +12,7 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
@ -88,6 +85,18 @@ public class VanStructureChartTypeUI extends AbstractIndependentVanChartUI {
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithOutSort(){
//图表缩放新设计 恢复用注释。删除下面两个方法 getNameArray getValueArray。
@Override
protected String[] getNameArray() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
}
@Override
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
@Override
protected ZoomPane createZoomPane() {
return new ZoomPaneWithOutMode();
@ -103,13 +112,14 @@ public class VanStructureChartTypeUI extends AbstractIndependentVanChartUI {
return new VanChartStructureConditionPane(plot);
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane());
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane());
// }
// };
// }
}

23
designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractIndependentVanChartUI.java

@ -2,10 +2,6 @@ package com.fr.van.chart.vanchart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.fun.impl.AbstractIndependentChartUIWithAPILevel;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.SingleCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.SingleCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
@ -51,13 +47,14 @@ public abstract class AbstractIndependentVanChartUI extends AbstractIndependentC
return CURRENT_API_LEVEL;
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane());
// }
// };
// }
}

130
designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java

@ -1,33 +1,14 @@
package com.fr.van.chart.vanchart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane;
import com.fr.general.ComparatorUtils;
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.column.VanChartColumnPlot;
import com.fr.plugin.chart.type.AxisType;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.data.VanChartMoreCateReportDataContentPane;
import com.fr.van.chart.designer.data.VanChartMoreCateTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
/**
* Created by mengao on 2017/7/6.
@ -49,60 +30,63 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen
return new VanChartMoreCateReportDataContentPane(parent);
}
@Override
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePane() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
MultiCategoryDataSetFieldsPane multiCategoryDataSetFieldsPane;
MultiCategoryCellDataFieldsPane multiCategoryCellDataFieldsPane;
@Override
protected SingleDataPane createSingleDataPane() {
multiCategoryDataSetFieldsPane = new MultiCategoryDataSetFieldsPane();
multiCategoryCellDataFieldsPane = new MultiCategoryCellDataFieldsPane();
return new SingleDataPane(multiCategoryDataSetFieldsPane, multiCategoryCellDataFieldsPane);
}
@Override
public void populate(ChartCollection collection) {
super.populate(collection);
VanChart vanChart = this.getVanChart();
if (vanChart == null) {
return;
}
//图表缩放新设计 恢复用注释。取消注释。
// @Override
// public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
//
// VanChartStylePane stylePane = new VanChartStylePane(listener);
// VanChartOtherPane otherPane = new VanChartOtherPane() {
// @Override
// protected BasicBeanPane<Chart> createInteractivePane() {
// return new VanChartInteractivePane() {
// @Override
// protected ZoomPane createZoomPane() {
// return new ZoomPane();
// }
//
// @Override
// protected boolean isCurrentChartSupportLargeDataMode() {
// return true;
// }
// };
// }
// };
// return new AbstractChartAttrPane[]{stylePane, otherPane};
// }
VanChartRectanglePlot plot = vanChart.getPlot();
VanChartAxis axis = plot.getDefaultXAxis();
if (plot instanceof VanChartColumnPlot
&& ((VanChartColumnPlot) plot).isBar()) {
axis = plot.getDefaultYAxis();
}
multiCategoryDataSetFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY));
multiCategoryCellDataFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY));
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// MultiCategoryDataSetFieldsPane multiCategoryDataSetFieldsPane;
// MultiCategoryCellDataFieldsPane multiCategoryCellDataFieldsPane;
//
// @Override
// protected SingleDataPane createSingleDataPane() {
// multiCategoryDataSetFieldsPane = new MultiCategoryDataSetFieldsPane();
// multiCategoryCellDataFieldsPane = new MultiCategoryCellDataFieldsPane();
// return new SingleDataPane(multiCategoryDataSetFieldsPane, multiCategoryCellDataFieldsPane);
// }
//
// @Override
// public void populate(ChartCollection collection) {
// super.populate(collection);
// VanChart vanChart = this.getVanChart();
// if (vanChart == null) {
// return;
// }
//
// VanChartRectanglePlot plot = vanChart.getPlot();
// VanChartAxis axis = plot.getDefaultXAxis();
// if (plot instanceof VanChartColumnPlot
// && ((VanChartColumnPlot) plot).isBar()) {
// axis = plot.getDefaultYAxis();
// }
//
// multiCategoryDataSetFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY));
// multiCategoryCellDataFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY));
// }
// };
// }
}

36
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java

@ -3,10 +3,6 @@ package com.fr.van.chart.wordcloud.designer;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chartx.AbstractVanSingleDataPane;
import com.fr.design.chartx.fields.diff.WordCloudCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.WordCloudDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
@ -17,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
@ -102,6 +99,18 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithOutSort(){
//图表缩放新设计 恢复用注释。删除下面两个方法 getNameArray getValueArray。
@Override
protected String[] getNameArray() {
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_Axis"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")};
}
@Override
protected String[] getValueArray() {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
@Override
protected ZoomPane createZoomPane() {
return new ZoomPaneWithOutMode();
@ -112,13 +121,14 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
@Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new AbstractVanSingleDataPane(listener) {
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new WordCloudDataSetFieldsPane(), new WordCloudCellDataFieldsPane());
}
};
}
//图表数据结构 恢复用注释。取消注释。
// @Override
// public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
// return new AbstractVanSingleDataPane(listener) {
// @Override
// protected SingleDataPane createSingleDataPane() {
// return new SingleDataPane(new WordCloudDataSetFieldsPane(), new WordCloudCellDataFieldsPane());
// }
// };
// }
}

Loading…
Cancel
Save