diff --git a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java index 50cdf00cf9..fff7f31224 100644 --- a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java @@ -9,8 +9,7 @@ import java.util.logging.Level; import javax.swing.*; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.actions.core.ActionFactory; + import com.fr.design.constants.UIConstants; import com.fr.design.DesignerEnvManager; import com.fr.design.data.DesignTableDataManager; diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 2af5af799b..aae009dc42 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -222,16 +222,16 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh return ChartTypeManager.getInstance().containsPlot(plotID); } + /** * 把所有的pane加到list里 * * @param paneList pane容器 */ public void addPlotTypePaneList(List> paneList) { - Iterator iterator = chartTypeInterfaces.entrySet().iterator(); - while (iterator.hasNext()) { - Map.Entry entry = (Map.Entry) iterator.next(); - String priority = (String) entry.getKey(); + List priorityList = getPriorityInOrder(); + for (int i = 0; i < priorityList.size(); i++){ + String priority = String.valueOf(priorityList.get(i)); Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator(); while (chartUIIterator.hasNext()) { Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next(); @@ -276,32 +276,40 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh } private String[] getTitle4PopupWindow(){ - List priorityList = new ArrayList(); + List priorityList = getPriorityInOrder(); + + if (priorityList.size() == 0){ + return new String[0]; + } + int size = 0; - if (chartTypeInterfaces != null){ + //获取总得图表格式 + for (int i = 0; i < priorityList.size(); i++) { + size += getChartSize(String.valueOf(priorityList.get(i))); + } + String[] names = new String[size]; + + int index = 0; + for (int i = 0; i < priorityList.size(); i++){ + String priority = String.valueOf(priorityList.get(i)); + Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator(); + index = fetchNames(chartUI, names, index); + } + + return names; + } + + private List getPriorityInOrder() { + List priorityList = new ArrayList(); + if (chartTypeInterfaces != null) { Iterator iterator = chartTypeInterfaces.entrySet().iterator(); - while (iterator.hasNext()){ + while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String priority = (String) entry.getKey(); priorityList.add(Integer.valueOf(priority)); - size += getChartSize(priority); } - String[] names = new String[size]; - - priorityList = ChartTypeManager.orderInPriority(priorityList); - - int index = 0; - - for (int i = 0; i < priorityList.size(); i++){ - String priority = String.valueOf(priorityList.get(i)); - Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator(); - index = fetchNames(chartUI, names, index); - } - - return names; } - - return new String[0]; + return ChartTypeManager.orderInPriority(priorityList); } private int fetchNames(Iterator chartUI, String[] names, int index) {