From b17db5669e40d5f224e834d075a226649a83bc00 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 21 Oct 2016 10:56:12 +0800 Subject: [PATCH] ct --- .../PlotSeries/MapDefiAreaNamePane.java | 54 ++++++++----------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java b/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java index 3892493b4..ca8d3a67d 100644 --- a/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java +++ b/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java @@ -1,42 +1,32 @@ package com.fr.design.chart.series.PlotSeries; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.swing.AbstractCellEditor; -import javax.swing.JPanel; -import javax.swing.JTable; -import javax.swing.SwingConstants; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.TableCellEditor; - +import com.fr.base.Utils; import com.fr.chart.base.MapSvgAttr; import com.fr.chart.base.MapSvgXMLHelper; -import com.fr.base.Utils; -import com.fr.design.data.DesignTableDataManager; -import com.fr.data.TableDataSource; -import com.fr.data.core.DataCoreUtils; -import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.data.tabledata.wrapper.TableDataWrapper; +import com.fr.design.editor.ValueEditorPane; +import com.fr.design.editor.ValueEditorPaneFactory; +import com.fr.design.editor.editor.Editor; +import com.fr.design.editor.editor.TextEditor; import com.fr.design.gui.icombobox.FilterComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.UIArrayTableModel; import com.fr.design.gui.itableeditorpane.UITableEditorPane; -import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.gui.xcombox.ComboBoxUseEditor; -import com.fr.design.editor.editor.Editor; -import com.fr.design.editor.editor.TextEditor; +import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; import com.fr.general.Inter; +import javax.swing.*; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.TableCellEditor; +import java.awt.*; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + /** * 地图, 定义区域名. * @@ -89,7 +79,7 @@ public class MapDefiAreaNamePane extends BasicBeanPane implements Abstrc tableDataBox.setPreferredSize(new Dimension(200, 20)); northPane.add(tableDataBox); - columnBox = new FilterComboBox(); + columnBox = new FilterComboBox<>(); columnBox.setPreferredSize(new Dimension(40, 20)); columnBox.addItemListener(columnChange); @@ -113,12 +103,10 @@ public class MapDefiAreaNamePane extends BasicBeanPane implements Abstrc String columnName = Utils.objectToString(columnBox.getSelectedItem()); TableDataWrapper tableDataWrappe = tableDataBox.getTableDataWrapper(); - TableDataSource source = DesignTableDataManager.getEditingTableDataSource(); - if (tableDataWrappe == null || source == null) { - return; - } - initNames = DataCoreUtils.getColValuesInData(source, tableDataWrappe.getTableDataName(), columnName); + List list = MapCustomPane.getColValuesInData(tableDataWrappe, columnName); + + initNames = list.toArray(initNames); if (tableEditorModel != null) { tableEditorModel.stopCellEditing();// 只是用来刷新列表的combox