diff --git a/designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java b/designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java index 4b09de8562..0839c14767 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java @@ -51,7 +51,7 @@ public class FineUIAction extends UpdateAction { BasicDialog dialog = pane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { - + // Do nothing } }); dialog.setVisible(true); diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindDialog.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindDialog.java index fe894437d7..e2d7b63c9f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindDialog.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindDialog.java @@ -31,7 +31,7 @@ public class RemindDialog extends UIDialog { @Override public void checkValid() throws Exception { - + // Do nothing } public RemindPane getRemindPane() { diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java index 7591c2af3d..1d8d99266e 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java @@ -114,6 +114,7 @@ public class RemindPane extends JPanel { @Override public void removeLayoutComponent(Component comp) { + // Do nothing } @Override @@ -139,6 +140,7 @@ public class RemindPane extends JPanel { @Override public void addLayoutComponent(String name, Component comp) { + // Do nothing } }; } diff --git a/designer-base/src/main/java/com/fr/design/condition/ContinuousTreeSelectionModel.java b/designer-base/src/main/java/com/fr/design/condition/ContinuousTreeSelectionModel.java index 69d3a51aa8..8e83255cf3 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ContinuousTreeSelectionModel.java +++ b/designer-base/src/main/java/com/fr/design/condition/ContinuousTreeSelectionModel.java @@ -16,8 +16,6 @@ import com.fr.design.utils.gui.GUICoreUtils; * 一个层次连续节点. */ public class ContinuousTreeSelectionModel extends DefaultTreeSelectionModel { - public ContinuousTreeSelectionModel() { - } public void addSelectionPaths(TreePath[] paths) { if (paths == null || paths.length == 0) { diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java index 313ca0e2f7..45b3ac6a2a 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java @@ -272,10 +272,12 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp */ @Override public void editingCanceled(ChangeEvent e) { + // Do nothing } @Override public void editingStopped(ChangeEvent e) { + // Do nothing } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 028f71363b..28ac24e712 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -103,10 +103,12 @@ public class ChoosePane extends BasicBeanPane implements Refresha @Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + // Do nothing } @Override public void popupMenuCanceled(PopupMenuEvent e) { + // Do nothing } }; @@ -114,10 +116,12 @@ public class ChoosePane extends BasicBeanPane implements Refresha private PopupMenuListener listener = new PopupMenuListener() { @Override public void popupMenuCanceled(PopupMenuEvent e) { + // Do nothing } @Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + // Do nothing } @Override @@ -199,6 +203,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha } protected void addFocusListener() { + // Do nothing } @SuppressWarnings("unchecked") @@ -492,6 +497,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha } protected void failedToFindTable() { + // Do nothing } protected String getTableName() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java index 0ca42c0f92..14d0431e25 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java @@ -75,6 +75,7 @@ public class ChoosePaneSupportFormula extends ChoosePane { } protected void addFocusListener() { + // Do nothing } /** diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 59880cc4ef..4d656a76e7 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -255,6 +255,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData } protected void checkRepeatedDSName(List exsitTableDataNameList) { + // Do nothing } /** diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java index 6be5657bbd..575ba43f5b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java @@ -140,8 +140,6 @@ public class PreviewTableModel extends AbstractTableModel { * 就是由于预览的JTable在不停的getRowCount来显示数据. */ private static class ErrorResultSet extends AbstractDataModel { - public ErrorResultSet() { - } public int getRowCount() { return 0; @@ -160,6 +158,7 @@ public class PreviewTableModel extends AbstractTableModel { } public void release() throws Exception { + // Do nothing } } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java index 1cb7cd35cd..3336596591 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java @@ -62,7 +62,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel { editor = ValueEditorPaneFactory.createStoreProcedValueEditorPane(); editor.getMenu().addPopupMenuListener(new PopupMenuListener() { public void popupMenuWillBecomeVisible(PopupMenuEvent e) { - + // Do nothing } public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/fun/MultiStyleUIConfigProvider.java b/designer-base/src/main/java/com/fr/design/fun/MultiStyleUIConfigProvider.java new file mode 100644 index 0000000000..d00138effb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/MultiStyleUIConfigProvider.java @@ -0,0 +1,23 @@ +package com.fr.design.fun; + +import com.fr.common.annotations.Open; +import com.fr.stable.fun.mark.Mutable; + +import java.util.List; + +/** + * Created by kerry on 2019-11-11 + */ +@Open +public interface MultiStyleUIConfigProvider extends Mutable { + String XML_TAG = "MultiStyleUIConfigProvider"; + + int CURRENT_LEVEL = 1; + + /** + * 获取配置项list + * + * @return 配置项list + */ + List getConfigList(); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/StyleUIConfigProvider.java b/designer-base/src/main/java/com/fr/design/fun/StyleUIConfigProvider.java new file mode 100644 index 0000000000..a28d276df2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/StyleUIConfigProvider.java @@ -0,0 +1,39 @@ +package com.fr.design.fun; + +import com.fr.base.Style; +import com.fr.common.annotations.Open; +import com.fr.stable.fun.mark.Mutable; + +import javax.swing.JComponent; +import javax.swing.event.ChangeListener; + +/** + * Created by kerry on 2019-11-11 + */ +@Open +public interface StyleUIConfigProvider extends Mutable { + String XML_TAG = "CustomStyleUIConfigProvider"; + + int CURRENT_LEVEL = 1; + + /** + * @return 配置名 + */ + String configName(); + + /** + * @param changeListener 需要添加的listener + * @return 对应的component + */ + JComponent uiComponent(ChangeListener changeListener); + + /** + * @return 更新后的样式 + */ + Style updateConfig(); + + /** + * @param style 待渲染的样式 + */ + void populateConfig(Style style); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMultiStyleUIConfigProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMultiStyleUIConfigProvider.java new file mode 100644 index 0000000000..260d4099bf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMultiStyleUIConfigProvider.java @@ -0,0 +1,26 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.StyleUIConfigProvider; +import com.fr.design.fun.MultiStyleUIConfigProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by kerry on 2019-11-11 + */ +@API(level = MultiStyleUIConfigProvider.CURRENT_LEVEL) +public abstract class AbstractMultiStyleUIConfigProvider extends AbstractProvider implements MultiStyleUIConfigProvider { + @Override + public List getConfigList() { + return new ArrayList(); + } + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractStyleUIConfigProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractStyleUIConfigProvider.java new file mode 100644 index 0000000000..e3388feaf7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractStyleUIConfigProvider.java @@ -0,0 +1,41 @@ +package com.fr.design.fun.impl; + +import com.fr.base.Style; +import com.fr.design.fun.StyleUIConfigProvider; +import com.fr.stable.StringUtils; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +import javax.swing.JComponent; +import javax.swing.event.ChangeListener; + +/** + * Created by kerry on 2019-11-11 + */ +@API(level = StyleUIConfigProvider.CURRENT_LEVEL) +public class AbstractStyleUIConfigProvider extends AbstractProvider implements StyleUIConfigProvider { + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String configName() { + return StringUtils.EMPTY; + } + + @Override + public JComponent uiComponent(ChangeListener changeListener) { + return null; + } + + @Override + public Style updateConfig() { + return null; + } + + @Override + public void populateConfig(Style style) { + + } +} diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 317d17bdb0..4eb7258348 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -82,13 +82,13 @@ import com.fr.van.chart.bar.BarIndependentVanChartInterface; import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface; import com.fr.van.chart.column.VanColumnChartTypeUI; import com.fr.van.chart.custom.CustomIndependentVanChartInterface; -import com.fr.van.chart.drillmap.DrillMapIndependentVanChartInterface; +import com.fr.van.chart.drillmap.VanDrillMapChartTypeUI; import com.fr.van.chart.funnel.designer.FunnelIndependentVanChartInterface; import com.fr.van.chart.gantt.designer.GanttIndependentVanChartInterface; import com.fr.van.chart.gauge.GaugeIndependentVanChartInterface; -import com.fr.van.chart.heatmap.designer.HeatMapIndependentVanChartInterface; +import com.fr.van.chart.heatmap.designer.VanHeatMapChartTypeUI; import com.fr.van.chart.line.LineIndependentVanChartInterface; -import com.fr.van.chart.map.MapIndependentVanChartInterface; +import com.fr.van.chart.map.VanMapChartTypeUI; import com.fr.van.chart.multilayer.MultiPieIndependentVanChartInterface; import com.fr.van.chart.pie.PieIndependentVanChartInterface; import com.fr.van.chart.radar.RadarIndependentVanChartInterface; @@ -192,11 +192,11 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr addChartTypeInterface(VAN_CHART_PRIORITY, VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID, new BubbleIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID, new CustomIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMultiPiePlot.VAN_CHART_MULTILAYER_PLOT_ID, new MultiPieIndependentVanChartInterface()); - addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMapPlot.VAN_CHART_MAP_ID, new MapIndependentVanChartInterface()); - addChartTypeInterface(VAN_CHART_PRIORITY, VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new DrillMapIndependentVanChartInterface()); + addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMapPlot.VAN_CHART_MAP_ID, new VanMapChartTypeUI()); + addChartTypeInterface(VAN_CHART_PRIORITY, VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new VanDrillMapChartTypeUI()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartTreeMapPlot.VAN_CHART_TREE_MAP_PLOT_ID, new TreeMapIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartFunnelPlot.VAN_CHART_FUNNEL_PLOT_ID, new FunnelIndependentVanChartInterface()); - addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface()); + addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new VanHeatMapChartTypeUI()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new VanStructureChartTypeUI()); diff --git a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java index b8690f8df6..d072905e60 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java @@ -13,6 +13,12 @@ import java.awt.BorderLayout; */ public abstract class AbstractChartDataPane extends ChartDataPane { + private VanChart vanChart; + + protected VanChart getVanChart() { + return vanChart; + } + public AbstractChartDataPane(AttributeChangeListener listener) { super(listener); } @@ -26,15 +32,15 @@ public abstract class AbstractChartDataPane { - - private AbstractVanSingleDataPane dataPane; - private AbstractVanSingleDataPane linkPane; - - @Override - protected JPanel createContentPane() { - dataPane = new AbstractVanSingleDataPane(listener) { - @Override - protected SingleDataPane createSingleDataPane() { - return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); - } - }; - linkPane = new AbstractVanSingleDataPane(listener) { - @Override - protected SingleDataPane createSingleDataPane() { - return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); - } - }; - return new VanChartGroupPane(new String[]{"data", "link"}, new JPanel[]{dataPane, linkPane}) { - }; - } - - public GanttChartDataPane(AttributeChangeListener listener) { - super(listener); - } - - @Override - public void populate(GanttChartDataDefinition ganttChartDataDefinition) { - dataPane.populate(ganttChartDataDefinition.getDataDefinition()); - linkPane.populate(ganttChartDataDefinition.getLinkDefinition()); - } - - @Override - public GanttChartDataDefinition update() { - return null; - } -} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/CellDataSeriesXYValueCorrelationPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/CellDataSeriesXYValueCorrelationPane.java index 06a02154e8..d14d59473c 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/CellDataSeriesXYValueCorrelationPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/CellDataSeriesXYValueCorrelationPane.java @@ -37,7 +37,7 @@ public class CellDataSeriesXYValueCorrelationPane extends AbstractCorrelationPan field.getSeriesName().getFieldName(), field.getXField().getFieldName(), field.getYField().getFieldName(), - field.getValueField().getFieldName() + field.getSizeField().getFieldName() }; result.add(array); } @@ -57,7 +57,7 @@ public class CellDataSeriesXYValueCorrelationPane extends AbstractCorrelationPan bubbleColumnField.setSeriesName(series); bubbleColumnField.setXField(xField); bubbleColumnField.setYField(yField); - bubbleColumnField.setValueField(value); + bubbleColumnField.setSizeField(value); bubbleColumnFieldList.add(bubbleColumnField); } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapChartDataPane.java new file mode 100644 index 0000000000..ae52b401de --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapChartDataPane.java @@ -0,0 +1,76 @@ +package com.fr.design.chartx.data.drillMap; + +import com.fr.chartx.data.DrillMapChartDataDefinition; +import com.fr.design.chartx.AbstractChartDataPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; +import com.fr.van.chart.map.designer.VanChartGroupPane; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class DrillMapChartDataPane extends AbstractChartDataPane { + private DrillMapLayerPane layerPane; + private DrillMapDataPane dataPane; + + public DrillMapChartDataPane(AttributeChangeListener listener) { + super(listener); + } + + private VanChartDrillMapPlot getDrillMapPlot() { + if (getVanChart() != null) { + return getVanChart().getPlot(); + } + return null; + } + + @Override + protected JPanel createContentPane() { + VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); + if (drillMapPlot == null) { + return new JPanel(); + } + + layerPane = new DrillMapLayerPane(drillMapPlot); + dataPane = new DrillMapDataPane(drillMapPlot); + return new VanChartGroupPane(new String[]{Toolkit.i18nText("Fine-Design_Chart_Map_Drill_Level"), Toolkit.i18nText("Fine-Design_Chart_Use_Data")}, + new JPanel[]{layerPane, dataPane}) { + @Override + protected void tabChanged(int index) { + if (index == 0) { + return; + } + dataPane.fireMapTypeChanged(); + } + }; + } + + + @Override + protected void populate(DrillMapChartDataDefinition drillMapChartDataDefinition) { + if (drillMapChartDataDefinition == null) { + return; + } + VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); + + layerPane.populateBean(drillMapPlot); + dataPane.populateBean(drillMapChartDataDefinition); + } + + @Override + protected DrillMapChartDataDefinition update() { + VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); + + layerPane.updateBean(drillMapPlot); + + DrillMapChartDataDefinition definition = new DrillMapChartDataDefinition(); + dataPane.updateBean(definition); + + return definition; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapDataPane.java new file mode 100644 index 0000000000..8cd2367db0 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapDataPane.java @@ -0,0 +1,120 @@ +package com.fr.design.chartx.data.drillMap; + +import com.fr.chartx.data.DrillMapChartDataDefinition; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chartx.fields.diff.AreaMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.AreaMapDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; +import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; + +import java.awt.BorderLayout; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Mitisky on 16/6/20. + * 钻取地图数据配置界面中 和钻取层级平级的数据界面 + */ +public class DrillMapDataPane extends BasicBeanPane { + private UIComboBoxPane dataDefinitionType;//数据定义方式:底层数据汇总/各层级分别指定 + + private SingleDataPane bottomDataPane;//底层数据汇总方式定义钻取地图数据 + + private EachLayerDataDefinitionPane eachLayerDataDefinitionPane;//各层级分别指定 + + public DrillMapDataPane(VanChartDrillMapPlot drillMapPlot) { + bottomDataPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); + eachLayerDataDefinitionPane = new EachLayerDataDefinitionPane(drillMapPlot); + + dataDefinitionType = new UIComboBoxPane() { + @Override + protected List> initPaneList() { + + List> paneList = new ArrayList>(); + paneList.add(new BottomLayerDataDefinitionPane()); + paneList.add(eachLayerDataDefinitionPane); + return paneList; + } + + @Override + protected String title4PopupWindow() { + return null; + } + }; + + this.setLayout(new BorderLayout()); + this.add(dataDefinitionType, BorderLayout.CENTER); + } + + public void fireMapTypeChanged() { + eachLayerDataDefinitionPane.fireMapTypeChanged(); + } + + @Override + public void populateBean(DrillMapChartDataDefinition ob) { + + dataDefinitionType.setSelectedIndex(ob.isFromBottomData() ? 0 : 1); + + bottomDataPane.populateBean(ob.getBottomDataDefinition()); + eachLayerDataDefinitionPane.populateBean(ob); + } + + /** + * Update. + */ + @Override + public DrillMapChartDataDefinition updateBean() { + return null; + } + + @Override + public void updateBean(DrillMapChartDataDefinition drillMapDefinition) { + if (dataDefinitionType.getSelectedIndex() == 0) { + drillMapDefinition.setFromBottomData(true); + drillMapDefinition.setBottomDataDefinition(bottomDataPane.updateBean()); + } else { + drillMapDefinition.setFromBottomData(false); + eachLayerDataDefinitionPane.updateBean(drillMapDefinition); + } + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Use_Data"); + } + + private class BottomLayerDataDefinitionPane extends FurtherBasicBeanPane { + + private BottomLayerDataDefinitionPane() { + this.setLayout(new BorderLayout()); + this.add(bottomDataPane, BorderLayout.CENTER); + } + + @Override + public boolean accept(Object ob) { + return false; + } + + @Override + public void reset() { + + } + + @Override + public void populateBean(DrillMapChartDataDefinition ob) { + } + + @Override + public DrillMapChartDataDefinition updateBean() { + return null; + } + + @Override + public String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Bottom_Data_Sum"); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java similarity index 66% rename from designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java rename to designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java index 6fd6ecabbc..b12bf385a0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java @@ -1,19 +1,18 @@ -package com.fr.van.chart.drillmap.designer.data.comp; +package com.fr.design.chartx.data.drillMap; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.dialog.BasicScrollPane; +import com.fr.chartx.TwoTuple; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; 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.drillmap.designer.data.comp.MapDataTree; import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; import javax.swing.BorderFactory; @@ -28,7 +27,7 @@ import java.util.HashMap; * Created by Mitisky on 16/6/20. * 钻取地图数据配置界面--钻取层级界面 */ -public class DrillMapLayerPane extends BasicScrollPane { +public class DrillMapLayerPane extends BasicBeanPane { 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()}; @@ -44,25 +43,65 @@ public class DrillMapLayerPane extends BasicScrollPane { 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); + public DrillMapLayerPane(VanChartDrillMapPlot drillMapPlot) { + + initMapTypeAndZoom(drillMapPlot); + + JPanel contentPane = createContentPane(drillMapPlot); + + this.setLayout(new BorderLayout()); + this.add(contentPane, BorderLayout.CENTER); } - @Override - protected JPanel createContentPane() { + private void initMapTypeAndZoom(VanChartDrillMapPlot drillMapPlot) { + + if (drillMapPlot != null) { + + int depth = getRootAndDepth(drillMapPlot).getSecond(); + + java.util.List levelList = drillMapPlot.getLayerLevelList(); + java.util.List mapTypeList = drillMapPlot.getLayerMapTypeList(); + + //根据层级初始属性,一切以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); + } + } + } + + public static TwoTuple getRootAndDepth(VanChartDrillMapPlot drillMapPlot) { + int depth = 1; + + DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(drillMapPlot.getGeoUrl()); + if (root != null) { + depth = root.getDepth() + 1;//根节点也算一层 + } + + return new TwoTuple<>(root, depth); + } + + private JPanel createContentPane(VanChartDrillMapPlot drillMapPlot) { + if (drillMapPlot == null) { + return new JPanel(); + } + + DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(drillMapPlot.getGeoUrl()); if (mapDataTree == null) { - mapDataTree = new MapDataTree(CompatibleGeoJSONTreeHelper.getRootNodeWithoutPara(oldGeoUrl)); + mapDataTree = new MapDataTree(root); mapDataTree.setRootVisible(true); + } else { + mapDataTree.changeRootNode(root); } + JPanel mapDataTreePanel = new JPanel(new BorderLayout()); mapDataTreePanel.add(mapDataTree); @@ -71,8 +110,8 @@ public class DrillMapLayerPane extends BasicScrollPane { 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())} + new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel)}, + new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane(drillMapPlot))} }; JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -88,7 +127,10 @@ public class DrillMapLayerPane extends BasicScrollPane { return jPanel; } - private JPanel createLayerDetailPane() { + private JPanel createLayerDetailPane(VanChartDrillMapPlot drillMapPlot) { + int depth = getRootAndDepth(drillMapPlot).getSecond(); + String[] items = TEMP.get(drillMapPlot.getMapType()); + double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f, p, p}; @@ -96,62 +138,31 @@ public class DrillMapLayerPane extends BasicScrollPane { 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")) + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Descriptor")), + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")), + new UILabel(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"))); + UILabel label = new UILabel(String.format("%s%d%s", Toolkit.i18nText("Fine-Design_Chart_Index_Article"), d, 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)); + UIComboBox type = new UIComboBox(items); 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); + public void populateBean(VanChartDrillMapPlot drillMapPlot) { if (drillMapPlot != null) { java.util.List levelList = drillMapPlot.getLayerLevelList(); java.util.List 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++) { + for (int i = 0; i < levelList.size(); i++) { Component[] components = detailComps[i + 1]; if (components != null) { UIComboBox level = (UIComboBox) components[1]; @@ -171,13 +182,12 @@ public class DrillMapLayerPane extends BasicScrollPane { * Update. */ @Override - public ChartCollection updateBean() { + public VanChartDrillMapPlot updateBean() { return null; } @Override - public void updateBean(ChartCollection ob) { - VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob); + public void updateBean(VanChartDrillMapPlot drillMapPlot) { if (drillMapPlot != null && detailComps != null) { java.util.List levelList = new ArrayList(); java.util.List mapTypeList = new ArrayList(); @@ -198,6 +208,6 @@ public class DrillMapLayerPane extends BasicScrollPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Drill_Level"); + return Toolkit.i18nText("Fine-Design_Chart_Map_Drill_Level"); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java new file mode 100644 index 0000000000..39e7d94515 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java @@ -0,0 +1,128 @@ +package com.fr.design.chartx.data.drillMap; + +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.DrillMapChartDataDefinition; +import com.fr.design.chartx.fields.diff.AreaMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.AreaMapDataSetFieldsPane; +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.dialog.BasicPane; +import com.fr.design.dialog.MultiTabPane; +import com.fr.design.i18n.Toolkit; +import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; +import com.fr.plugin.chart.type.MapType; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Mitisky on 16/6/20. + * 各层级分别指定的界面 + */ +public class EachLayerDataDefinitionPane extends MultiTabPane { + + private List oldTypeList; + private VanChartDrillMapPlot plot; + + public EachLayerDataDefinitionPane(VanChartDrillMapPlot drillMapPlot) { + this.plot = drillMapPlot; + initComps(); + } + + private void initComps() { + paneList = initPaneList(this.plot); + super.relayoutWhenListChange(); + } + + public void fireMapTypeChanged() { + if (!ComparatorUtils.equals(plot.getLayerMapTypeList(), oldTypeList)) { + initComps(); + } + } + + protected List initPaneList(VanChartDrillMapPlot drillMapPlot) { + List paneList = new ArrayList(); + + oldTypeList = drillMapPlot.getLayerMapTypeList(); + int depth = DrillMapLayerPane.getRootAndDepth(drillMapPlot).getSecond(); + + for (int i = 0; i < depth; i++) { + final String title = String.format("%s%d%s", Toolkit.i18nText("Fine-Design_Chart_Index_Article"), i, Toolkit.i18nText("Fine-Design_Chart_Index_Layer")); + MapType mapType = oldTypeList.get(i); + + SingleDataPane pane = mapType == MapType.AREA ? new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()) { + @Override + protected String title4PopupWindow() { + return title; + } + } : new SingleDataPane(new PointMapDataSetFieldsPane(), new PointMapCellDataFieldsPane()) { + @Override + protected String title4PopupWindow() { + return title; + } + }; + + paneList.add(pane); + } + + return paneList; + } + + @Override + public void relayoutWhenListChange() { + } + + @Override + protected List initPaneList() { + return new ArrayList(); + } + + @Override + public void populateBean(DrillMapChartDataDefinition drillMapChartDataDefinition) { + List eachLayerDataDefinitionList = drillMapChartDataDefinition.getEachLayerDataDefinitionList(); + + if (eachLayerDataDefinitionList == null || eachLayerDataDefinitionList.size() == 0) { + return; + } + + for (int i = 0, len = paneList.size(); i < len; i++) { + BasicPane basicPane = paneList.get(i); + if (basicPane instanceof SingleDataPane) { + ((SingleDataPane) basicPane).populateBean(eachLayerDataDefinitionList.get(i)); + } + } + } + + @Override + public DrillMapChartDataDefinition updateBean() { + return null; + } + + @Override + public void updateBean(DrillMapChartDataDefinition drillMapDefinition) { + List eachLayerDataDefinitionList = new ArrayList(); + for (BasicPane basicPane : paneList) { + if (basicPane instanceof SingleDataPane) { + eachLayerDataDefinitionList.add(((SingleDataPane) basicPane).updateBean()); + } + } + drillMapDefinition.setEachLayerDataDefinitionList(eachLayerDataDefinitionList); + } + + @Override + public boolean accept(Object ob) { + return false; + } + + @Override + public String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Each_Layer_Data_Special"); + } + + @Override + public void reset() { + } + +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java new file mode 100644 index 0000000000..384c3cb8f2 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java @@ -0,0 +1,111 @@ +package com.fr.design.chartx.data.map; + +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.ChartDataPane; + +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +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.Arrays; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public abstract class AbstractAreaLngLatPane extends JPanel { + private JPanel centerPane; + private UIButtonGroup locationType; + + private JPanel areaPane; + private JPanel lngLatAreaPane; + + protected abstract JPanel createAreaPane(); + + protected abstract JPanel createAreaLngLatPane(); + + public AbstractAreaLngLatPane() { + centerPane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (locationType.getSelectedIndex() == 0) { + return areaPane.getPreferredSize(); + } else { + return lngLatAreaPane.getPreferredSize(); + } + } + }; + + locationType = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Location_With_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Location_With_LongAndLat")}); + locationType.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + checkCenterPane(); + } + }); + + lngLatAreaPane = createAreaLngLatPane(); + areaPane = createAreaPane(); + + centerPane.add(areaPane, "area"); + centerPane.add(lngLatAreaPane, "longLat"); + + locationType.setSelectedIndex(0); + + this.setLayout(new BorderLayout(0, 6)); + this.add(locationType, 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 populate(boolean useAreaName) { + locationType.setSelectedIndex(useAreaName ? 0 : 1); + + checkCenterPane(); + } + + public boolean update() { + return locationType.getSelectedIndex() == 0; + } + + protected JPanel createPane(String[] labels, JComponent... fieldComponents) { + + int len = Math.min(labels.length, fieldComponents.length); + + if (len == 0) { + return new JPanel(); + } + + Component[][] components = new Component[len][2]; + for (int i = 0; i < len; i++) { + components[i] = new Component[]{new UILabel(labels[i], SwingConstants.LEFT), fieldComponents[i]}; + } + double p = TableLayout.PREFERRED; + double[] columnSize = {ChartDataPane.LABEL_WIDTH, 122}; + double[] rowSize = new double[len]; + Arrays.fill(rowSize, p); + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 6); + } + +} + diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithComboBox.java new file mode 100644 index 0000000000..13a271e813 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithComboBox.java @@ -0,0 +1,106 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.field.diff.LineMapColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class LineMapAreaLngLatPaneWithComboBox extends LineMapAreaLngLatPaneWithTinyFormula { + private UIComboBox fromArea_tab0; + private UIComboBox toArea_tab0; + + private UIComboBox fromArea_tab1; + private UIComboBox fromLng_tab1; + private UIComboBox fromLat_tab1; + private UIComboBox toArea_tab1; + private UIComboBox toLng_tab1; + private UIComboBox toLat_tab1; + + + @Override + protected JPanel createAreaPane() { + if (fromArea_tab0 == null) { + fromArea_tab0 = new UIComboBox(); + toArea_tab0 = new UIComboBox(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")}, + fromArea_tab0, toArea_tab0 + ); + } + + @Override + protected JPanel createAreaLngLatPane() { + if (fromArea_tab1 == null) { + fromArea_tab1 = new UIComboBox(); + fromLng_tab1 = new UIComboBox(); + fromLat_tab1 = new UIComboBox(); + toArea_tab1 = new UIComboBox(); + toLng_tab1 = new UIComboBox(); + toLat_tab1 = new UIComboBox(); + } + return createPane( + new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Start_Longitude"), + Toolkit.i18nText("Fine-Design_Chart_Start_Latitude"), + Toolkit.i18nText("Fine-Design_Chart_End_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_End_Longitude"), + Toolkit.i18nText("Fine-Design_Chart_End_Latitude")}, + fromArea_tab1, + fromLng_tab1, + fromLat_tab1, + toArea_tab1, + toLng_tab1, + toLat_tab1); + } + + protected void populateTab0(LineMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.populateField(fromArea_tab0, fieldCollection.getFromAreaName()); + AbstractDataSetFieldsPane.populateField(toArea_tab0, fieldCollection.getToAreaName()); + } + + protected void updateTab0(LineMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.updateField(fromArea_tab0, fieldCollection.getFromAreaName()); + AbstractDataSetFieldsPane.updateField(toArea_tab0, fieldCollection.getToAreaName()); + } + + protected void populateTab1(LineMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.populateField(fromArea_tab1, fieldCollection.getFromAreaName()); + AbstractDataSetFieldsPane.populateField(toArea_tab1, fieldCollection.getToAreaName()); + AbstractDataSetFieldsPane.populateField(fromLng_tab1, fieldCollection.getFromLng()); + AbstractDataSetFieldsPane.populateField(toLng_tab1, fieldCollection.getToLng()); + AbstractDataSetFieldsPane.populateField(fromLat_tab1, fieldCollection.getFromLat()); + AbstractDataSetFieldsPane.populateField(toLat_tab1, fieldCollection.getToLat()); + } + + protected void updateTab1(LineMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.updateField(fromArea_tab1, fieldCollection.getFromAreaName()); + AbstractDataSetFieldsPane.updateField(toArea_tab1, fieldCollection.getToAreaName()); + AbstractDataSetFieldsPane.updateField(fromLng_tab1, fieldCollection.getFromLng()); + AbstractDataSetFieldsPane.updateField(toLng_tab1, fieldCollection.getToLng()); + AbstractDataSetFieldsPane.updateField(fromLat_tab1, fieldCollection.getFromLat()); + AbstractDataSetFieldsPane.updateField(toLat_tab1, fieldCollection.getToLat()); + } + + public UIComboBox[] allFieldComboBox() { + return new UIComboBox[]{ + fromArea_tab0, + toArea_tab0, + fromArea_tab1, + fromLng_tab1, + fromLat_tab1, + toArea_tab1, + toLng_tab1, + toLat_tab1 + }; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithTinyFormula.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithTinyFormula.java new file mode 100644 index 0000000000..2fb37fee55 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithTinyFormula.java @@ -0,0 +1,113 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.field.diff.LineMapColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; +import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; + + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class LineMapAreaLngLatPaneWithTinyFormula extends AbstractAreaLngLatPane { + private TinyFormulaPane fromArea_tab0; + private TinyFormulaPane toArea_tab0; + + private TinyFormulaPane fromArea_tab1; + private TinyFormulaPane fromLng_tab1; + private TinyFormulaPane fromLat_tab1; + private TinyFormulaPane toArea_tab1; + private TinyFormulaPane toLng_tab1; + private TinyFormulaPane toLat_tab1; + + + @Override + protected JPanel createAreaPane() { + if (fromArea_tab0 == null) { + fromArea_tab0 = new TinyFormulaPane(); + toArea_tab0 = new TinyFormulaPane(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")}, + fromArea_tab0, toArea_tab0 + ); + } + + @Override + protected JPanel createAreaLngLatPane() { + if (fromArea_tab1 == null) { + fromArea_tab1 = new TinyFormulaPane(); + fromLng_tab1 = new TinyFormulaPane(); + fromLat_tab1 = new TinyFormulaPane(); + toArea_tab1 = new TinyFormulaPane(); + toLng_tab1 = new TinyFormulaPane(); + toLat_tab1 = new TinyFormulaPane(); + } + return createPane( + new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Start_Longitude"), + Toolkit.i18nText("Fine-Design_Chart_Start_Latitude"), + Toolkit.i18nText("Fine-Design_Chart_End_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_End_Longitude"), + Toolkit.i18nText("Fine-Design_Chart_End_Latitude")}, + fromArea_tab1, + fromLng_tab1, + fromLat_tab1, + toArea_tab1, + toLng_tab1, + toLat_tab1); + } + + protected void populateTab0(LineMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.populateField(fromArea_tab0, fieldCollection.getFromAreaName()); + AbstractCellDataFieldsPane.populateField(toArea_tab0, fieldCollection.getToAreaName()); + } + + protected void updateTab0(LineMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.updateField(fromArea_tab0, fieldCollection.getFromAreaName()); + AbstractCellDataFieldsPane.updateField(toArea_tab0, fieldCollection.getToAreaName()); + } + + protected void populateTab1(LineMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.populateField(fromArea_tab1, fieldCollection.getFromAreaName()); + AbstractCellDataFieldsPane.populateField(toArea_tab1, fieldCollection.getToAreaName()); + AbstractCellDataFieldsPane.populateField(fromLng_tab1, fieldCollection.getFromLng()); + AbstractCellDataFieldsPane.populateField(toLng_tab1, fieldCollection.getToLng()); + AbstractCellDataFieldsPane.populateField(fromLat_tab1, fieldCollection.getFromLat()); + AbstractCellDataFieldsPane.populateField(toLat_tab1, fieldCollection.getToLat()); + } + + protected void updateTab1(LineMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.updateField(fromArea_tab1, fieldCollection.getFromAreaName()); + AbstractCellDataFieldsPane.updateField(toArea_tab1, fieldCollection.getToAreaName()); + AbstractCellDataFieldsPane.updateField(fromLng_tab1, fieldCollection.getFromLng()); + AbstractCellDataFieldsPane.updateField(toLng_tab1, fieldCollection.getToLng()); + AbstractCellDataFieldsPane.updateField(fromLat_tab1, fieldCollection.getFromLat()); + AbstractCellDataFieldsPane.updateField(toLat_tab1, fieldCollection.getToLat()); + } + + public void populate(LineMapColumnFieldCollection fieldCollection) { + super.populate(fieldCollection.isUseAreaName()); + if (fieldCollection.isUseAreaName()) { + populateTab0(fieldCollection); + } else { + populateTab1(fieldCollection); + } + } + + public void update(LineMapColumnFieldCollection fieldCollection) { + fieldCollection.setUseAreaName(super.update()); + if (fieldCollection.isUseAreaName()) { + updateTab0(fieldCollection); + } else { + updateTab1(fieldCollection); + } + } +} + diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java new file mode 100644 index 0000000000..a31f159024 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java @@ -0,0 +1,93 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.MapChartDataDefinition; +import com.fr.design.chartx.AbstractChartDataPane; +import com.fr.design.chartx.fields.diff.AreaMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.AreaMapDataSetFieldsPane; +import com.fr.design.chartx.fields.diff.LineMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.LineMapDataSetFieldsPane; +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.gui.frpane.AttributeChangeListener; +import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.type.MapType; +import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/12 + */ +public class MapChartDataPane extends AbstractChartDataPane { + + private SingleDataPane areaPane; + private SingleDataPane pointPane; + private SingleDataPane linePane; + + public MapChartDataPane(AttributeChangeListener listener) { + super(listener); + } + + @Override + protected JPanel createContentPane() { + MapType mapType = MapType.AREA; + if (this.getVanChart() != null) { + VanChartMapPlot mapPlot = this.getVanChart().getPlot(); + mapType = mapPlot == null ? mapType : mapPlot.getMapType(); + } + switch (mapType) { + case AREA: + areaPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); + return areaPane; + case POINT: + pointPane = new SingleDataPane(new PointMapDataSetFieldsPane(), new PointMapCellDataFieldsPane()); + return pointPane; + case LINE: + linePane = new SingleDataPane(new LineMapDataSetFieldsPane(), new LineMapCellDataFieldsPane()); + return linePane; + case CUSTOM: + areaPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); + pointPane = new SingleDataPane(new PointMapDataSetFieldsPane(), new PointMapCellDataFieldsPane()); + linePane = new SingleDataPane(new LineMapDataSetFieldsPane(), new LineMapCellDataFieldsPane()); + return new VanMapAreaPointAndLineGroupPane(areaPane, pointPane, linePane); + default: + areaPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); + return areaPane; + } + } + + @Override + protected void populate(MapChartDataDefinition mapChartDataDefinition) { + if (mapChartDataDefinition == null) { + return; + } + if (areaPane != null) { + areaPane.populateBean(mapChartDataDefinition.getAreaMapDataDefinition()); + } + if (pointPane != null) { + pointPane.populateBean(mapChartDataDefinition.getPointMapDataDefinition()); + } + if (linePane != null) { + linePane.populateBean(mapChartDataDefinition.getLineMapDataDefinition()); + } + + } + + @Override + protected MapChartDataDefinition update() { + MapChartDataDefinition mapChartDataDefinition = new MapChartDataDefinition(); + if (areaPane != null) { + mapChartDataDefinition.setAreaMapDataDefinition(areaPane.updateBean()); + } + if (pointPane != null) { + mapChartDataDefinition.setPointMapDataDefinition(pointPane.updateBean()); + } + if (linePane != null) { + mapChartDataDefinition.setLineMapDataDefinition(linePane.updateBean()); + } + return mapChartDataDefinition; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithComboBox.java new file mode 100644 index 0000000000..4acc2611f0 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithComboBox.java @@ -0,0 +1,71 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.field.diff.PointMapColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class PointMapAreaLngLatPaneWithComboBox extends PointMapAreaLngLatPaneWithTinyFormula { + private UIComboBox area_tab0; + + private UIComboBox area_tab1; + private UIComboBox lng_tab1; + private UIComboBox lat_tab1; + + @Override + protected JPanel createAreaPane() { + if (area_tab0 == null) { + area_tab0 = new UIComboBox(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name")}, + area_tab0 + ); + } + + @Override + protected JPanel createAreaLngLatPane() { + if (area_tab1 == null) { + area_tab1 = new UIComboBox(); + lng_tab1 = new UIComboBox(); + lat_tab1 = new UIComboBox(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name"), Toolkit.i18nText("Fine-Design_Chart_Longitude"), Toolkit.i18nText("Fine-Design_Chart_Latitude")}, + area_tab1, lng_tab1, lat_tab1 + ); + } + + protected void populateTab0(PointMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.populateField(area_tab0, fieldCollection.getAreaName()); + } + + protected void updateTab0(PointMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.updateField(area_tab0, fieldCollection.getAreaName()); + } + + protected void populateTab1(PointMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.populateField(area_tab1, fieldCollection.getAreaName()); + AbstractDataSetFieldsPane.populateField(lng_tab1, fieldCollection.getLng()); + AbstractDataSetFieldsPane.populateField(lat_tab1, fieldCollection.getLat()); + } + + protected void updateTab1(PointMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.updateField(area_tab1, fieldCollection.getAreaName()); + AbstractDataSetFieldsPane.updateField(lng_tab1, fieldCollection.getLng()); + AbstractDataSetFieldsPane.updateField(lat_tab1, fieldCollection.getLat()); + } + + public UIComboBox[] allFieldComboBox() { + return new UIComboBox[]{ + area_tab0, area_tab1, lng_tab1, lat_tab1 + }; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithTinyFormula.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithTinyFormula.java new file mode 100644 index 0000000000..6da5a1b383 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithTinyFormula.java @@ -0,0 +1,84 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.field.diff.PointMapColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; +import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class PointMapAreaLngLatPaneWithTinyFormula extends AbstractAreaLngLatPane { + private TinyFormulaPane area_tab0; + + private TinyFormulaPane area_tab1; + private TinyFormulaPane lng_tab1; + private TinyFormulaPane lat_tab1; + + + @Override + protected JPanel createAreaPane() { + if (area_tab0 == null) { + area_tab0 = new TinyFormulaPane(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name")}, + area_tab0 + ); + } + + @Override + protected JPanel createAreaLngLatPane() { + if (area_tab1 == null) { + area_tab1 = new TinyFormulaPane(); + lng_tab1 = new TinyFormulaPane(); + lat_tab1 = new TinyFormulaPane(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name"), Toolkit.i18nText("Fine-Design_Chart_Longitude"), Toolkit.i18nText("Fine-Design_Chart_Latitude")}, + area_tab1, lng_tab1, lat_tab1 + ); + } + + protected void populateTab0(PointMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.populateField(area_tab0, fieldCollection.getAreaName()); + } + + protected void updateTab0(PointMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.updateField(area_tab0, fieldCollection.getAreaName()); + } + + protected void populateTab1(PointMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.populateField(area_tab1, fieldCollection.getAreaName()); + AbstractCellDataFieldsPane.populateField(lng_tab1, fieldCollection.getLng()); + AbstractCellDataFieldsPane.populateField(lat_tab1, fieldCollection.getLat()); + } + + protected void updateTab1(PointMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.updateField(area_tab1, fieldCollection.getAreaName()); + AbstractCellDataFieldsPane.updateField(lng_tab1, fieldCollection.getLng()); + AbstractCellDataFieldsPane.updateField(lat_tab1, fieldCollection.getLat()); + } + + public void populate(PointMapColumnFieldCollection fieldCollection) { + super.populate(fieldCollection.isUseAreaName()); + if (fieldCollection.isUseAreaName()) { + populateTab0(fieldCollection); + } else { + populateTab1(fieldCollection); + } + } + + public void update(PointMapColumnFieldCollection fieldCollection) { + fieldCollection.setUseAreaName(super.update()); + if (fieldCollection.isUseAreaName()) { + updateTab0(fieldCollection); + } else { + updateTab1(fieldCollection); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java index 1ad328f0fd..82cc89a62c 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java @@ -17,10 +17,10 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.util.Arrays; -import java.util.List; import java.awt.BorderLayout; import java.awt.Component; +import java.util.Arrays; +import java.util.List; import static com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper.refreshBoxItems; @@ -37,7 +37,7 @@ public abstract class AbstractDataSetFieldsPane { + private TinyFormulaPane areaName; + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Area_Name") + }; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + return new TinyFormulaPane[]{ + createAreaName() + }; + } + + private TinyFormulaPane createAreaName() { + if (areaName == null) { + areaName = new TinyFormulaPane(); + } + return areaName; + } + + @Override + public void populateBean(AreaMapColumnFieldCollection ob) { + populateField(areaName, ob.getAreaName()); + populateSeriesValuePane(ob); + } + + @Override + public AreaMapColumnFieldCollection updateBean() { + AreaMapColumnFieldCollection fieldCollection = new AreaMapColumnFieldCollection(); + updateField(areaName, fieldCollection.getAreaName()); + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapDataSetFieldsPane.java new file mode 100644 index 0000000000..2d8bba01a1 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapDataSetFieldsPane.java @@ -0,0 +1,50 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.AreaMapColumnFieldCollection; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/7 + */ +public class AreaMapDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane { + + private UIComboBox areaName; + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Area_Name") + }; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + return new UIComboBox[]{ + createAreaName() + }; + } + + private UIComboBox createAreaName() { + if (areaName == null) { + areaName = new UIComboBox(); + } + return areaName; + } + + @Override + public void populateBean(AreaMapColumnFieldCollection ob) { + populateField(areaName, ob.getAreaName()); + populateSeriesValuePane(ob); + } + + @Override + public AreaMapColumnFieldCollection updateBean() { + AreaMapColumnFieldCollection fieldCollection = new AreaMapColumnFieldCollection(); + updateField(areaName, fieldCollection.getAreaName()); + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapCellDataFieldsPane.java new file mode 100644 index 0000000000..7a321f0bec --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapCellDataFieldsPane.java @@ -0,0 +1,64 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.LineMapColumnFieldCollection; +import com.fr.design.chartx.data.map.LineMapAreaLngLatPaneWithTinyFormula; +import com.fr.design.formula.TinyFormulaPane; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/11 + */ +public class LineMapCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesValuePane { + + private LineMapAreaLngLatPaneWithTinyFormula areaLngLatPane; + + private TinyFormulaPane lineName; + + @Override + protected JPanel createNorthPane() { + if (areaLngLatPane == null) { + areaLngLatPane = new LineMapAreaLngLatPaneWithTinyFormula(); + } + return areaLngLatPane; + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + "lineName" + }; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + if (lineName == null) { + lineName = new TinyFormulaPane(); + } + return new TinyFormulaPane[]{ + lineName + }; + } + + @Override + public void populateBean(LineMapColumnFieldCollection ob) { + areaLngLatPane.populate(ob); + + populateField(lineName, ob.getLineName()); + + populateSeriesValuePane(ob); + } + + @Override + public LineMapColumnFieldCollection updateBean() { + LineMapColumnFieldCollection fieldCollection = new LineMapColumnFieldCollection(); + areaLngLatPane.update(fieldCollection); + + updateField(lineName, fieldCollection.getLineName()); + + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapDataSetFieldsPane.java new file mode 100644 index 0000000000..24220b9930 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapDataSetFieldsPane.java @@ -0,0 +1,61 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.LineMapColumnFieldCollection; +import com.fr.design.chartx.data.map.LineMapAreaLngLatPaneWithComboBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.third.jodd.util.ArraysUtil; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/11 + */ +public class LineMapDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane { + private LineMapAreaLngLatPaneWithComboBox areaLngLatPane; + + private UIComboBox lineName; + + @Override + protected JPanel createNorthPane() { + if (areaLngLatPane == null) { + areaLngLatPane = new LineMapAreaLngLatPaneWithComboBox(); + } + return areaLngLatPane; + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + "lineName" + }; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + if (lineName == null) { + lineName = new UIComboBox(); + } + UIComboBox[] result = areaLngLatPane.allFieldComboBox(); + return ArraysUtil.join(new UIComboBox[]{ + lineName + }, result); + } + + @Override + public void populateBean(LineMapColumnFieldCollection ob) { + areaLngLatPane.populate(ob); + populateField(lineName, ob.getLineName()); + populateSeriesValuePane(ob); + } + + @Override + public LineMapColumnFieldCollection updateBean() { + LineMapColumnFieldCollection columnFieldCollection = new LineMapColumnFieldCollection(); + areaLngLatPane.update(columnFieldCollection); + updateField(lineName, columnFieldCollection.getLineName()); + updateSeriesValuePane(columnFieldCollection); + return columnFieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapCellDataFieldsPane.java new file mode 100644 index 0000000000..4b701fb714 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapCellDataFieldsPane.java @@ -0,0 +1,48 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.PointMapColumnFieldCollection; +import com.fr.design.chartx.data.map.PointMapAreaLngLatPaneWithTinyFormula; +import com.fr.design.formula.TinyFormulaPane; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/8 + */ +public class PointMapCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesValuePane { + private PointMapAreaLngLatPaneWithTinyFormula areaLngLatPane; + + @Override + protected JPanel createNorthPane() { + if (areaLngLatPane == null) { + areaLngLatPane = new PointMapAreaLngLatPaneWithTinyFormula(); + } + return areaLngLatPane; + } + + @Override + protected String[] fieldLabels() { + return new String[0]; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + return new TinyFormulaPane[0]; + } + + @Override + public void populateBean(PointMapColumnFieldCollection ob) { + areaLngLatPane.populate(ob); + populateSeriesValuePane(ob); + } + + @Override + public PointMapColumnFieldCollection updateBean() { + PointMapColumnFieldCollection fieldCollection = new PointMapColumnFieldCollection(); + areaLngLatPane.update(fieldCollection); + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapDataSetFieldsPane.java new file mode 100644 index 0000000000..1771637abb --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapDataSetFieldsPane.java @@ -0,0 +1,51 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.PointMapColumnFieldCollection; +import com.fr.design.chartx.data.map.PointMapAreaLngLatPaneWithComboBox; +import com.fr.design.gui.icombobox.UIComboBox; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/8 + */ +public class PointMapDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane { + private PointMapAreaLngLatPaneWithComboBox areaLngLatPane; + + @Override + protected JPanel createNorthPane() { + if (areaLngLatPane == null) { + areaLngLatPane = new PointMapAreaLngLatPaneWithComboBox(); + } + return areaLngLatPane; + } + + @Override + protected String[] fieldLabels() { + return new String[0]; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + if (areaLngLatPane == null) { + areaLngLatPane = new PointMapAreaLngLatPaneWithComboBox(); + } + return areaLngLatPane.allFieldComboBox(); + } + + @Override + public void populateBean(PointMapColumnFieldCollection ob) { + areaLngLatPane.populate(ob); + populateSeriesValuePane(ob); + } + + @Override + public PointMapColumnFieldCollection updateBean() { + PointMapColumnFieldCollection fieldCollection = new PointMapColumnFieldCollection(); + areaLngLatPane.update(fieldCollection); + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java index 79765cccb3..fbf044af15 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/ScatterDataSetFieldsPane.java @@ -22,7 +22,7 @@ public class ScatterDataSetFieldsPane extends AbstractDataSetFieldsPane { @Override public void populateBean(CellDataDefinition ob) { - cellDataFieldsPane.populateBean(ob.getColumnFieldCollection()); + + Type dataType = ((ParameterizedType) cellDataFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0]; + if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) { + cellDataFieldsPane.populateBean(ob.getColumnFieldCollection()); + } } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java index 98394c31a0..91d1a06881 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java @@ -11,9 +11,12 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.stable.AssistUtils; import java.awt.BorderLayout; import java.awt.Dimension; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; import java.util.List; /** @@ -101,8 +104,11 @@ public class DataSetPane extends FurtherBasicBeanPane { checkBoxUse(); tableDataPane.populateBean(ob.getNameTableData()); + Type dataType = ((ParameterizedType) dataSetFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0]; + if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) { + dataSetFieldsPane.populateBean(ob.getColumnFieldCollection()); + } - dataSetFieldsPane.populateBean(ob.getColumnFieldCollection()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java index c648c09c73..a00423ad7f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java @@ -1,11 +1,14 @@ package com.fr.van.chart.bubble; 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.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; @@ -18,6 +21,7 @@ import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContent import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.plugin.chart.bubble.VanChartBubblePlot; +import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.bubble.data.VanChartBubblePlotTableDataContentPane; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; import com.fr.van.chart.designer.other.VanChartOtherPane; @@ -123,8 +127,27 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { + + VanChartBubblePlot plot; + + @Override + public void populate(ChartCollection collection) { + if (collection == null) { + return; + } + VanChart chart = collection.getSelectedChartProvider(VanChart.class); + if (chart == null) { + return; + } + plot = chart.getPlot(); + super.populate(collection); + } + @Override protected SingleDataPane createSingleDataPane() { + if (plot != null && plot.isForceBubble()) { + return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()); + } return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane()); } }; diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/CustomIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/custom/CustomIndependentVanChartInterface.java index ffb44ca326..8982af7ab0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/CustomIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/CustomIndependentVanChartInterface.java @@ -1,5 +1,6 @@ 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; @@ -73,6 +74,6 @@ public class CustomIndependentVanChartInterface extends AbstractIndependentVanCh } public ChartDataPane getChartDataPane(AttributeChangeListener listener){ - return new VanChartCustomDataPane(listener); + return new CustomChartDataPane(listener); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 1d7c7c8c91..0949dbf6eb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -385,6 +385,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected void checkAllUse() { checkCardPane(); checkLabelPane(); + limitPane.checkMaxProPortionUse(); } protected void checkCardPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java similarity index 89% rename from designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java rename to designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java index f74706b9ad..08ec91b22e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java @@ -1,5 +1,6 @@ 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; @@ -7,16 +8,15 @@ 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.MapIndependentVanChartInterface; +import com.fr.van.chart.map.VanMapChartTypeUI; import com.fr.van.chart.map.designer.style.VanChartMapStylePane; /** * Created by Mitisky on 16/6/20. */ -public class DrillMapIndependentVanChartInterface extends MapIndependentVanChartInterface { +public class VanDrillMapChartTypeUI extends VanMapChartTypeUI { @Override public String getName() { return Toolkit.i18nText("Fine-Design_Chart_Drill_Map"); @@ -61,7 +61,7 @@ public class DrillMapIndependentVanChartInterface extends MapIndependentVanChart @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { - return new VanChartDrillMapDataPane(listener); + return new DrillMapChartDataPane(listener); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java deleted file mode 100644 index 1ce0dc300d..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java +++ /dev/null @@ -1,52 +0,0 @@ -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; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java deleted file mode 100644 index d4543c8a8a..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java +++ /dev/null @@ -1,39 +0,0 @@ -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); - } - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java deleted file mode 100644 index bbb07acd69..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java +++ /dev/null @@ -1,130 +0,0 @@ -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 { - - 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 initPaneList() { - List paneList = new ArrayList(); - - 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() { - - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java deleted file mode 100644 index 4f5ab5e21d..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java +++ /dev/null @@ -1,117 +0,0 @@ -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.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Mitisky on 16/6/20. - * 钻取地图数据配置界面中 和钻取层级平级的数据界面 - */ -public class DrillMapDataPane extends BasicBeanPane { - private UIComboBoxPane 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() { - @Override - protected List> initPaneList() { - - List> paneList = new ArrayList>(); - 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 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"); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java deleted file mode 100644 index 3a688dcfb7..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java +++ /dev/null @@ -1,171 +0,0 @@ -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.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Mitisky on 16/6/20. - * 各层级分别指定的界面 - */ -public class EachLayerDataDefinitionPane extends MultiTabPane { - private AttributeChangeListener listener; - private ChartDataPane parent; - private int depth; - private String oldGeoUrl; - private List 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 getCurrentMapTypeList() { - return oldMapList; - } - - @Override - protected List initPaneList() { - List paneList = new ArrayList(); - - 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 eachLayerDataDefinitionList = new ArrayList(); - 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); - } - } - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java deleted file mode 100644 index 5ec0e1f4a4..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java +++ /dev/null @@ -1,94 +0,0 @@ -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 { - 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; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java index af4aa2c8ff..d19ea6a466 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java @@ -1,7 +1,14 @@ package com.fr.van.chart.gauge; +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.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; @@ -15,6 +22,7 @@ import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContent import com.fr.design.mainframe.chart.gui.data.table.MeterPlotTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.plugin.chart.gauge.VanChartGaugePlot; +import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.custom.component.CategoryCustomPlotTableDataContentPane; import com.fr.van.chart.custom.component.MeterCustomPlotReportDataContentPane; import com.fr.van.chart.custom.component.MeterCustomPlotTableDataContentPane; @@ -107,4 +115,34 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ return new VanChartGaugeSeriesPane(parent, plot); } + + @Override + public ChartDataPane getChartDataPane(AttributeChangeListener listener) { + return new AbstractVanSingleDataPane(listener) { + + VanChartGaugePlot gaugePlot; + + @Override + public void populate(ChartCollection collection) { + if (collection == null) { + return; + } + VanChart chart = collection.getSelectedChartProvider(VanChart.class); + if (chart == null) { + return; + } + gaugePlot = chart.getPlot(); + + super.populate(collection); + } + + @Override + protected SingleDataPane createSingleDataPane() { + if (gaugePlot != null && !gaugePlot.isMultiPointer()) { + return new SingleDataPane(new GaugeDataSetFieldsPane(), new GaugeCellDataFieldsPane()); + } + return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()); + } + }; + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java similarity index 78% rename from designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java rename to designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java index 16f9fbc9fa..90926a106b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java @@ -3,10 +3,15 @@ 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; @@ -15,13 +20,13 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.heatmap.designer.other.VanChartHeatMapConditionPane; import com.fr.van.chart.heatmap.designer.style.VanChartHeatMapSeriesPane; import com.fr.van.chart.heatmap.designer.type.VanChartHeatMapTypePane; -import com.fr.van.chart.map.MapIndependentVanChartInterface; +import com.fr.van.chart.map.VanMapChartTypeUI; import com.fr.van.chart.map.designer.style.VanChartMapStylePane; /** * Created by Mitisky on 16/10/20. */ -public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartInterface { +public class VanHeatMapChartTypeUI extends VanMapChartTypeUI { /** * 图标路径 @@ -57,8 +62,13 @@ public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartI } @Override - protected boolean areaPlot(Plot plot) { - return false; + public ChartDataPane getChartDataPane(AttributeChangeListener listener) { + return new AbstractVanSingleDataPane(listener) { + @Override + protected SingleDataPane createSingleDataPane() { + return new SingleDataPane(new PointMapDataSetFieldsPane(), new PointMapCellDataFieldsPane()); + } + }; } public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java similarity index 59% rename from designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java rename to designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java index 76deff2d3f..2981e6e4ee 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java @@ -2,26 +2,16 @@ 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; @@ -31,7 +21,7 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; /** * Created by Mitisky on 16/5/4. */ -public class MapIndependentVanChartInterface extends AbstractIndependentVanChartUI { +public class VanMapChartTypeUI extends AbstractIndependentVanChartUI { @Override public String getName() { @@ -70,28 +60,8 @@ public class MapIndependentVanChartInterface extends AbstractIndependentVanChart return new VanChartMapPlotPane(); } - 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 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; + return new MapChartDataPane(listener); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java index d086a70314..bc84b001d9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java @@ -35,6 +35,7 @@ public abstract class VanChartGroupPane extends JPanel{ @Override public void stateChanged(ChangeEvent e) { cardLayout.show(centerPane, nameList[buttonGroup.getSelectedIndex()]); + tabChanged(buttonGroup.getSelectedIndex()); } }); buttonGroup.setBorder(getButtonGroupBorder()); @@ -43,6 +44,9 @@ public abstract class VanChartGroupPane extends JPanel{ this.add(centerPane, BorderLayout.CENTER); } + protected void tabChanged(int index) { + } + protected Border getButtonGroupBorder () { return null; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java deleted file mode 100644 index 4cfb35d704..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java +++ /dev/null @@ -1,84 +0,0 @@ -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); - } - - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java deleted file mode 100644 index 158f9dbf1b..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java +++ /dev/null @@ -1,177 +0,0 @@ -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 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 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 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; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java deleted file mode 100644 index 5ebe14ed0a..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java +++ /dev/null @@ -1,121 +0,0 @@ -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); - } - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java deleted file mode 100644 index ac365cab5e..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java +++ /dev/null @@ -1,34 +0,0 @@ -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; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java deleted file mode 100644 index 99df746459..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java +++ /dev/null @@ -1,23 +0,0 @@ -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(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java deleted file mode 100644 index c1e1c97559..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java +++ /dev/null @@ -1,29 +0,0 @@ -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(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java deleted file mode 100644 index db545b9d45..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java +++ /dev/null @@ -1,40 +0,0 @@ -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(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java deleted file mode 100644 index 2415e99bc8..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java +++ /dev/null @@ -1,13 +0,0 @@ -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); -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java deleted file mode 100644 index 8517e64fb8..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java +++ /dev/null @@ -1,65 +0,0 @@ -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) { - - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java deleted file mode 100644 index 79a4a433ca..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java +++ /dev/null @@ -1,71 +0,0 @@ -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()); - - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java deleted file mode 100644 index f8fc771828..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java +++ /dev/null @@ -1,37 +0,0 @@ -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} - }; - } - }; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java deleted file mode 100644 index f03cda28ac..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java +++ /dev/null @@ -1,78 +0,0 @@ -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; - } - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java deleted file mode 100644 index 29cb4930a9..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java +++ /dev/null @@ -1,47 +0,0 @@ -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()); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java deleted file mode 100644 index a4919d0474..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java +++ /dev/null @@ -1,14 +0,0 @@ -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(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java deleted file mode 100644 index 585b42de1c..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java +++ /dev/null @@ -1,26 +0,0 @@ -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(); - - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java deleted file mode 100644 index d765ed425f..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java +++ /dev/null @@ -1,104 +0,0 @@ -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); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java deleted file mode 100644 index 4d2f2d86ce..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java +++ /dev/null @@ -1,100 +0,0 @@ -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(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java deleted file mode 100644 index bb0f7a5bbe..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java +++ /dev/null @@ -1,42 +0,0 @@ -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} - }; - } - }; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java deleted file mode 100644 index 68e71f7e3e..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java +++ /dev/null @@ -1,123 +0,0 @@ -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; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java deleted file mode 100644 index a6974be4b1..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java +++ /dev/null @@ -1,69 +0,0 @@ -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()); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java deleted file mode 100644 index 93a9e833d2..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java +++ /dev/null @@ -1,18 +0,0 @@ -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); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java deleted file mode 100644 index 3de16e047a..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java +++ /dev/null @@ -1,111 +0,0 @@ -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 list = seriesPane.updateBean(); - for (Object[] o : list) { - SeriesDefinition sd = new SeriesDefinition(); - - sd.setSeriesName(canBeFormula(o[0])); - sd.setValue(canBeFormula(o[1])); - mapReportDefinition.addSeriesValue(sd); - } - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java deleted file mode 100644 index f28d212365..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java +++ /dev/null @@ -1,24 +0,0 @@ -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(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java deleted file mode 100644 index 3f82744eab..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java +++ /dev/null @@ -1,171 +0,0 @@ -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 { - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - private UIButtonGroup 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(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(); - } - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java deleted file mode 100644 index 331b7a843c..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java +++ /dev/null @@ -1,177 +0,0 @@ -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()); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java deleted file mode 100644 index de2b9ded6a..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java +++ /dev/null @@ -1,25 +0,0 @@ -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); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java deleted file mode 100644 index 40ea3fe3a3..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java +++ /dev/null @@ -1,225 +0,0 @@ -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 { - private UIButtonGroup 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(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); - } - -} diff --git a/designer-realize/src/main/java/com/fr/design/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/style/StylePane.java index 7fd8db07d4..928cd04d15 100644 --- a/designer-realize/src/main/java/com/fr/design/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/style/StylePane.java @@ -8,7 +8,10 @@ import com.fr.base.NameStyle; import com.fr.base.ScreenResolution; import com.fr.base.Style; import com.fr.base.core.StyleUtils; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.StyleUIConfigProvider; +import com.fr.design.fun.MultiStyleUIConfigProvider; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; @@ -18,6 +21,7 @@ import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections; import com.fr.report.cell.CellElement; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.FloatElement; @@ -38,6 +42,8 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; +import java.util.List; +import java.util.Set; /** * Style Pane. @@ -48,6 +54,7 @@ public class StylePane extends BasicBeanPane