From ee5af8c8a1f0fe60f6dfbd4eafa8291c9aea797e Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 24 Jul 2018 17:50:08 +0800 Subject: [PATCH] CHART-2499 910 --- .../BubblePlotChartConditionPane.java | 15 +- .../SeriesCondition/ChartConditionPane.java | 149 ++++++++++++++++-- .../GanttPlotChartConditionPane.java | 11 +- .../MapPlotChartConditionPane.java | 12 +- .../PiePlotChartConditionPane.java | 13 +- .../XYPlotChartConditionPane.java | 15 +- .../chart/area/VanChartAreaConditionPane.java | 14 +- .../VanChartBubbleConditionSelectionPane.java | 15 +- .../column/VanChartColumnConditionPane.java | 14 +- .../series/VanChartSeriesConditionPane.java | 14 +- .../other/VanChartFunnelConditionPane.java | 10 +- .../other/VanChartGanttConditionPane.java | 16 +- .../chart/line/VanChartLineConditionPane.java | 14 +- ...VanChartLineMapConditionSelectionPane.java | 14 +- .../VanChartMapConditionSelectionPane.java | 12 +- ...anChartMultiPieConditionSelectionPane.java | 16 +- .../other/VanChartStructureConditionPane.java | 13 +- .../other/VanChartWordCloudConditionPane.java | 10 +- 18 files changed, 200 insertions(+), 177 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/BubblePlotChartConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/BubblePlotChartConditionPane.java index 294c8aa4a9..fe9d8d1955 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/BubblePlotChartConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/BubblePlotChartConditionPane.java @@ -4,7 +4,7 @@ package com.fr.design.chart.series.SeriesCondition; -import com.fr.chart.base.ChartConstants; +import com.fr.plugin.chart.type.ConditionKeyType; /** * 气泡图 条件显示 参数 控制界面. @@ -13,15 +13,8 @@ import com.fr.chart.base.ChartConstants; */ public class BubblePlotChartConditionPane extends ChartConditionPane{ - /** - * 界面条件序号 列表 - * @return 返回条件列表. - */ - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE - }; + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.NORMAL2_CONDITION_KEY_TYPES; } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ChartConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ChartConditionPane.java index 8cb889e83c..d08478a4b5 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ChartConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ChartConditionPane.java @@ -1,25 +1,150 @@ package com.fr.design.chart.series.SeriesCondition; -import com.fr.chart.base.ChartConstants; -import com.fr.design.condition.DSColumnLiteConditionPane; +import com.fr.chart.chartattr.ChartCommonCondition; +import com.fr.data.condition.CommonCondition; +import com.fr.data.core.Compare; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.condition.LiteConditionPane; +import com.fr.design.editor.ValueEditorPane; +import com.fr.design.editor.ValueEditorPaneFactory; +import com.fr.design.formula.CustomVariableResolver; +import com.fr.design.formula.VariableResolver; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icombobox.UIComboBoxRenderer; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; +import com.fr.plugin.chart.type.ConditionKeyType; +import com.fr.stable.StringUtils; -public class ChartConditionPane extends DSColumnLiteConditionPane { +import javax.swing.DefaultComboBoxModel; +import javax.swing.JList; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; + +public class ChartConditionPane extends LiteConditionPane { public ChartConditionPane() { super(); conditonTypePane.setVisible(false); + } + + @Override + protected VariableResolver variableResolver4FormulaPane() { + return new CustomVariableResolver(new String[]{}, false); + } - populateColumns(columns2Populate()); + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.NORMAL_CONDITION_KEY_TYPES; } - public String[] columns2Populate() { - return new String[]{ - ChartConstants.CATEGORY_INDEX, - ChartConstants.CATEGORY_NAME, - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE - }; + @Override + protected BasicBeanPane createUnFormulaConditionPane() { + return new CommonConditionPane(); + } + + + private class CommonConditionPane extends BasicBeanPane { + + private UIComboBox conditionKeyComboBox; + private UIComboBox conditionOPComboBox; + private ValueEditorPane conditionValuePane; + + public CommonConditionPane() { + initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + conditionKeyComboBox = new UIComboBox(conditionKeyTypes()); + conditionOPComboBox = new UIComboBox(new DefaultComboBoxModel()); + DefaultComboBoxModel opComboBoxModel = (DefaultComboBoxModel) conditionOPComboBox.getModel(); + int[] allOperators = Compare.getAllOperators(); + for (int i = 0; i < allOperators.length; i++) { + opComboBoxModel.addElement(new Integer(allOperators[i])); + } + this.conditionOPComboBox.setRenderer(new UIComboBoxRenderer() { + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + if (value instanceof Integer) { + this.setText(Compare.operator2String(((Integer) value).intValue())); + } + + return this; + } + }); + conditionValuePane = ValueEditorPaneFactory.createAllValueEditorPane(); + conditionKeyComboBox.setPreferredSize(new Dimension(175, conditionKeyComboBox.getPreferredSize().height)); + conditionOPComboBox.setPreferredSize(new Dimension(80, 20)); + Component[][] components = { + {new UILabel(Inter.getLocText("Utils-Available_Columns") + ":"), new UILabel(Inter.getLocText("FR-ConditionB_Operator") + ":"), + new UILabel()}, {conditionKeyComboBox, conditionOPComboBox, conditionValuePane}}; + + double p = TableLayout.PREFERRED; + double rowSize[] = {p, p}; + double columnSize[] = {p, p, TableLayout.FILL}; + + JPanel leftPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + this.add(leftPanel, BorderLayout.CENTER); + + } + + @Override + public void populateBean(CommonCondition condition) { + String selectionColumn = condition.getColumnName(); + ConditionKeyType type = ConditionKeyType.find(selectionColumn); + if (type != null) { + conditionKeyComboBox.setSelectedItem(type); + } else {//兼容 + for (ConditionKeyType temp : conditionKeyTypes()) { + if (ComparatorUtils.equals(selectionColumn, temp.toString())) { + conditionKeyComboBox.setSelectedItem(temp); + } + } + } + + Compare compare = condition.getCompare(); + + if (compare == null) { + return; + } + conditionOPComboBox.setSelectedItem(new Integer(compare.getOp())); + + Object value = compare.getValue(); + + conditionValuePane.populate(value); + + } + + @Override + public CommonCondition updateBean() { + Object value = conditionValuePane.update(); + + int index = conditionKeyComboBox.getSelectedIndex(); + ConditionKeyType conditionKeyType = conditionKeyTypes()[index]; + String name = conditionKeyType.getStringType(); + + return new ChartCommonCondition(name, index, new Compare( + ((Integer) conditionOPComboBox.getSelectedItem()).intValue(), value)); + } + + @Override + protected String title4PopupWindow() { + return StringUtils.EMPTY; + } + + @Override + public void checkValid() throws Exception { + conditionOPComboBox.setSelectedIndex(0); + conditionValuePane.populate(StringUtils.EMPTY); + } } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/GanttPlotChartConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/GanttPlotChartConditionPane.java index cecbf010f0..e0acb9e342 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/GanttPlotChartConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/GanttPlotChartConditionPane.java @@ -1,6 +1,6 @@ package com.fr.design.chart.series.SeriesCondition; -import com.fr.chart.base.ChartConstants; +import com.fr.plugin.chart.type.ConditionKeyType; /** * Created by IntelliJ IDEA. @@ -11,11 +11,8 @@ import com.fr.chart.base.ChartConstants; */ public class GanttPlotChartConditionPane extends ChartConditionPane { - public String[] columns2Populate() { - return new String[]{ - ChartConstants.PROJECT_ID, - ChartConstants.STEP_INDEX, - ChartConstants.STEP_NAME - }; + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.OLD_GANTT_CONDITION_KEY_TYPES; } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/MapPlotChartConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/MapPlotChartConditionPane.java index 81b02e982b..69379369bf 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/MapPlotChartConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/MapPlotChartConditionPane.java @@ -1,6 +1,6 @@ package com.fr.design.chart.series.SeriesCondition; -import com.fr.chart.base.ChartConstants; +import com.fr.plugin.chart.type.ConditionKeyType; /** * 地图的条件 参数下拉. @@ -9,10 +9,8 @@ import com.fr.chart.base.ChartConstants; */ public class MapPlotChartConditionPane extends ChartConditionPane { - public String[] columns2Populate() { - return new String[]{ - ChartConstants.AREA_NAME, - ChartConstants.AREA_VALUE - }; - } + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.OLD_MAP_CONDITION_KEY_TYPES; + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/PiePlotChartConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/PiePlotChartConditionPane.java index 295f3bd5c6..04d0cc0dc3 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/PiePlotChartConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/PiePlotChartConditionPane.java @@ -1,6 +1,6 @@ package com.fr.design.chart.series.SeriesCondition; -import com.fr.chart.base.ChartConstants; +import com.fr.plugin.chart.type.ConditionKeyType; /** @@ -10,11 +10,8 @@ import com.fr.chart.base.ChartConstants; */ public class PiePlotChartConditionPane extends ChartConditionPane { - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE - }; - } + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.NORMAL2_CONDITION_KEY_TYPES; + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/XYPlotChartConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/XYPlotChartConditionPane.java index 7692ecd8a2..dd8959bb6a 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/XYPlotChartConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/XYPlotChartConditionPane.java @@ -4,7 +4,7 @@ package com.fr.design.chart.series.SeriesCondition; -import com.fr.chart.base.ChartConstants; +import com.fr.plugin.chart.type.ConditionKeyType; /** * 散点图 条件属性 显示参数 界面. @@ -13,15 +13,8 @@ import com.fr.chart.base.ChartConstants; */ public class XYPlotChartConditionPane extends ChartConditionPane { - /** - * 界面条件序号 列表 - * @return 返回条件列表. - */ - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE - }; + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.NORMAL2_CONDITION_KEY_TYPES; } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java index d09ab3d856..c2de07ada9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java @@ -1,7 +1,6 @@ package com.fr.van.chart.area; import com.fr.chart.base.AttrBackground; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Plot; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; @@ -15,7 +14,7 @@ import com.fr.plugin.chart.base.AttrTooltip; 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.glyph.VanChartMultiCategoryDataPoint; +import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.other.condition.item.VanChartAreaFillColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartDataSheetContentPane; @@ -74,15 +73,8 @@ public class VanChartAreaConditionPane extends DataSeriesConditionPane { protected ChartConditionPane createListConditionPane() { return new ChartConditionPane(){ @Override - public String[] columns2Populate() { - return new String[]{ - ChartConstants.CATEGORY_INDEX, - ChartConstants.CATEGORY_NAME, - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE, - VanChartMultiCategoryDataPoint.CATEGORY_ARRAY, - }; + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.CATEGORY_ARRAY_CONDITION_KEY_TYPES; } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionSelectionPane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionSelectionPane.java index 961b04f080..f79fed9e0c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionSelectionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionSelectionPane.java @@ -1,22 +1,15 @@ package com.fr.van.chart.bubble; -import com.fr.chart.base.ChartConstants; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; -import com.fr.plugin.chart.scatter.VanChartScatterDataPoint; +import com.fr.plugin.chart.type.ConditionKeyType; /** * Created by Mitisky on 16/3/31. */ public class VanChartBubbleConditionSelectionPane extends ChartConditionPane { - - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - VanChartScatterDataPoint.X, - VanChartScatterDataPoint.Y, - ChartConstants.VALUE - }; + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.BUBBLE_CONDITION_KEY_TYPES; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java index c40bcbc702..cb1aa4e867 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java @@ -3,7 +3,6 @@ package com.fr.van.chart.column; import com.fr.chart.base.AttrAlpha; import com.fr.chart.base.AttrBackground; import com.fr.chart.base.AttrBorder; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Plot; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; @@ -17,7 +16,7 @@ import com.fr.plugin.chart.base.AttrSeriesImageBackground; import com.fr.plugin.chart.base.AttrTooltip; import com.fr.plugin.chart.base.VanChartAttrTrendLine; import com.fr.plugin.chart.column.VanChartColumnPlot; -import com.fr.plugin.chart.glyph.VanChartMultiCategoryDataPoint; +import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.other.condition.item.VanChartDataSheetContentPane; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartFloatColorConditionPane; @@ -71,15 +70,8 @@ public class VanChartColumnConditionPane extends DataSeriesConditionPane{ protected ChartConditionPane createListConditionPane() { return new ChartConditionPane(){ @Override - public String[] columns2Populate() { - return new String[]{ - ChartConstants.CATEGORY_INDEX, - ChartConstants.CATEGORY_NAME, - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE, - VanChartMultiCategoryDataPoint.CATEGORY_ARRAY, - }; + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.CATEGORY_ARRAY_CONDITION_KEY_TYPES; } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartSeriesConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartSeriesConditionPane.java index 09781dbc17..95ebddbc95 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartSeriesConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartSeriesConditionPane.java @@ -1,21 +1,15 @@ package com.fr.van.chart.designer.style.series; -import com.fr.chart.base.ChartConstants; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; +import com.fr.plugin.chart.type.ConditionKeyType; /** * 只对系列进行设置 */ public class VanChartSeriesConditionPane extends ChartConditionPane { - /** - * 只对系列进行设置 - * @return 系列值,系列名 - */ - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME - }; + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.SERIES_CONDITION_KEY_TYPES; } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/other/VanChartFunnelConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/other/VanChartFunnelConditionPane.java index c74c8f945a..896e3c194f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/other/VanChartFunnelConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/other/VanChartFunnelConditionPane.java @@ -3,7 +3,6 @@ package com.fr.van.chart.funnel.designer.other; import com.fr.chart.base.AttrAlpha; import com.fr.chart.base.AttrBackground; import com.fr.chart.base.AttrBorder; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Plot; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; @@ -15,6 +14,7 @@ import com.fr.plugin.chart.base.AttrFloatColor; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrTooltip; import com.fr.plugin.chart.funnel.VanChartFunnelPlot; +import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartFloatColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; @@ -42,12 +42,8 @@ public class VanChartFunnelConditionPane extends DataSeriesConditionPane { protected ChartConditionPane createListConditionPane() { return new ChartConditionPane(){ @Override - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE - }; + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.NORMAL2_CONDITION_KEY_TYPES; } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java index 05eca86c23..42428c6317 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java @@ -2,17 +2,16 @@ package com.fr.van.chart.gantt.designer.other; import com.fr.chart.base.AttrAlpha; import com.fr.chart.base.AttrBackground; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Plot; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane; import com.fr.plugin.chart.base.AttrTooltip; -import com.fr.plugin.chart.gantt.VanChartGanttDataPoint; import com.fr.plugin.chart.gantt.VanChartGanttPlot; import com.fr.plugin.chart.gantt.attr.AttrGanttLabel; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltip; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; +import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; @@ -68,17 +67,8 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { protected ChartConditionPane createListConditionPane() { return new ChartConditionPane(){ @Override - public String[] columns2Populate() { - return new String[]{ - VanChartGanttDataPoint.PROJECT_NAME, - VanChartGanttDataPoint.PROJECT_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.SERIES_INDEX, - VanChartGanttDataPoint.START_TIME, - VanChartGanttDataPoint.END_TIME, - VanChartGanttDataPoint.PROGRESS, - VanChartGanttDataPoint.LINK_ID - }; + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.Gantt_CONDITION_KEY_TYPES; } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineConditionPane.java index 70717ee683..6424b3a19c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineConditionPane.java @@ -1,7 +1,6 @@ package com.fr.van.chart.line; import com.fr.chart.base.AttrBackground; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Plot; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; @@ -13,8 +12,8 @@ import com.fr.plugin.chart.base.AttrTooltip; 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.glyph.VanChartMultiCategoryDataPoint; import com.fr.plugin.chart.line.VanChartLinePlot; +import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.other.condition.item.VanChartDataSheetContentPane; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; @@ -72,15 +71,8 @@ public class VanChartLineConditionPane extends DataSeriesConditionPane { protected ChartConditionPane createListConditionPane() { return new ChartConditionPane(){ @Override - public String[] columns2Populate() { - return new String[]{ - ChartConstants.CATEGORY_INDEX, - ChartConstants.CATEGORY_NAME, - ChartConstants.SERIES_INDEX, - ChartConstants.SERIES_NAME, - ChartConstants.VALUE, - VanChartMultiCategoryDataPoint.CATEGORY_ARRAY, - }; + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.CATEGORY_ARRAY_CONDITION_KEY_TYPES; } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/VanChartLineMapConditionSelectionPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/VanChartLineMapConditionSelectionPane.java index 7fcae8ffb4..0ab4b7192e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/VanChartLineMapConditionSelectionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/VanChartLineMapConditionSelectionPane.java @@ -1,21 +1,15 @@ package com.fr.van.chart.map.designer.other.condition; -import com.fr.chart.base.ChartConstants; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; -import com.fr.plugin.chart.map.VanChartMapDataPoint; +import com.fr.plugin.chart.type.ConditionKeyType; /** * Created by hufan on 2016/12/26. */ public class VanChartLineMapConditionSelectionPane extends ChartConditionPane { - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_NAME, - ChartConstants.SERIES_INDEX, - VanChartMapDataPoint.START_AREA_NAME, - VanChartMapDataPoint.END_AREA_NAME, - ChartConstants.VALUE - }; + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.LINE_MAP_CONDITION_KEY_TYPES; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/VanChartMapConditionSelectionPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/VanChartMapConditionSelectionPane.java index 570f2f94f7..3aa295de94 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/VanChartMapConditionSelectionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/VanChartMapConditionSelectionPane.java @@ -1,19 +1,15 @@ package com.fr.van.chart.map.designer.other.condition; -import com.fr.chart.base.ChartConstants; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; -import com.fr.plugin.chart.map.VanChartMapDataPoint; +import com.fr.plugin.chart.type.ConditionKeyType; /** * Created by Mitisky on 16/6/1. */ public class VanChartMapConditionSelectionPane extends ChartConditionPane { - public String[] columns2Populate() { - return new String[]{ - ChartConstants.SERIES_NAME, - VanChartMapDataPoint.AREA_NAME, - ChartConstants.VALUE - }; + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.MAP_CONDITION_KEY_TYPES; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/other/VanChartMultiPieConditionSelectionPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/other/VanChartMultiPieConditionSelectionPane.java index 92d3c6ad6d..574ed764d8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/other/VanChartMultiPieConditionSelectionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/other/VanChartMultiPieConditionSelectionPane.java @@ -1,23 +1,15 @@ package com.fr.van.chart.multilayer.other; -import com.fr.chart.base.ChartConstants; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; -import com.fr.general.Inter; -import com.fr.plugin.chart.multilayer.VanChartMultiPieDataPoint; +import com.fr.plugin.chart.type.ConditionKeyType; /** * Created by Fangjie on 2016/6/16. */ public class VanChartMultiPieConditionSelectionPane extends ChartConditionPane { - public static final String LEVEL_NAME = Inter.getLocText("Plugin-ChartF_Level_Name"); - public static final String LEVEL_ORDER = Inter.getLocText("Plugin-ChartF_Level_Order"); - - public String[] columns2Populate() { - return new String[]{ - VanChartMultiPieDataPoint.LEVEL_ORDER, - VanChartMultiPieDataPoint.LEVEL_NAME, - ChartConstants.VALUE - }; + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.MULTI_PIE_CONDITION_KEY_TYPES; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java index ef1a79f162..7fac3034b7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java @@ -1,7 +1,6 @@ package com.fr.van.chart.structure.desinger.other; import com.fr.chart.base.AttrBackground; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Plot; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; @@ -9,8 +8,8 @@ import com.fr.plugin.chart.base.AttrFloatColor; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrNode; import com.fr.plugin.chart.base.AttrTooltip; -import com.fr.plugin.chart.structure.VanChartStructureDataPoint; import com.fr.plugin.chart.structure.VanChartStructurePlot; +import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.other.condition.item.VanChartFloatColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; @@ -38,14 +37,8 @@ public class VanChartStructureConditionPane extends DataSeriesConditionPane { protected ChartConditionPane createListConditionPane() { return new ChartConditionPane(){ @Override - public String[] columns2Populate() { - return new String[]{ - VanChartStructureDataPoint.NODEID, - VanChartStructureDataPoint.PARENTID, - VanChartStructureDataPoint.SERIESNAME, - VanChartStructureDataPoint.NODENAME, - ChartConstants.VALUE - }; + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.STRUCTURE_CONDITION_KEY_TYPES; } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/other/VanChartWordCloudConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/other/VanChartWordCloudConditionPane.java index d391bf5e58..b954781f85 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/other/VanChartWordCloudConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/other/VanChartWordCloudConditionPane.java @@ -7,8 +7,8 @@ import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; import com.fr.plugin.chart.attr.EffectHelper; import com.fr.plugin.chart.base.AttrEffect; import com.fr.plugin.chart.base.AttrTooltip; +import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; -import com.fr.plugin.chart.wordcloud.WordCloudDataPoint; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; @@ -34,12 +34,8 @@ public class VanChartWordCloudConditionPane extends DataSeriesConditionPane { protected ChartConditionPane createListConditionPane() { return new ChartConditionPane(){ @Override - public String[] columns2Populate() { - return new String[]{ - WordCloudDataPoint.WORDNAME, - WordCloudDataPoint.WORDNAMEINDEX, - WordCloudDataPoint.WORDVALUE - }; + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.WORD_CLOUD_CONDITION_KEY_TYPES; } }; }