Browse Source

Merge pull request #461 in BA/design from ~XIAOHU/design:dev to dev

* commit '1ffd0ecd7c06c589b91c30f748032d96aec48904':
  悬浮元素图表切换
master
superman 8 years ago
parent
commit
a82f83da91
  1. 40
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

40
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -222,16 +222,16 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
return ChartTypeManager.getInstance().containsPlot(plotID); return ChartTypeManager.getInstance().containsPlot(plotID);
} }
/** /**
* 把所有的pane加到list里 * 把所有的pane加到list里
* *
* @param paneList pane容器 * @param paneList pane容器
*/ */
public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) { public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); List<Integer> priorityList = getPriorityInOrder();
while (iterator.hasNext()) { for (int i = 0; i < priorityList.size(); i++){
Map.Entry entry = (Map.Entry) iterator.next(); String priority = String.valueOf(priorityList.get(i));
String priority = (String) entry.getKey();
Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator(); Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator();
while (chartUIIterator.hasNext()) { while (chartUIIterator.hasNext()) {
Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next(); Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next();
@ -276,22 +276,20 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
} }
private String[] getTitle4PopupWindow(){ private String[] getTitle4PopupWindow(){
List<Integer> priorityList = new ArrayList<Integer>(); List<Integer> priorityList = getPriorityInOrder();
if (priorityList.size() == 0){
return new String[0];
}
int size = 0; int size = 0;
if (chartTypeInterfaces != null){ //获取总得图表格式
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); for (int i = 0; i < priorityList.size(); i++) {
while (iterator.hasNext()){ size += getChartSize(String.valueOf(priorityList.get(i)));
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]; String[] names = new String[size];
priorityList = ChartTypeManager.orderInPriority(priorityList);
int index = 0; int index = 0;
for (int i = 0; i < priorityList.size(); i++){ for (int i = 0; i < priorityList.size(); i++){
String priority = String.valueOf(priorityList.get(i)); String priority = String.valueOf(priorityList.get(i));
Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator(); Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator();
@ -301,7 +299,17 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
return names; return names;
} }
return new String[0]; private List<Integer> getPriorityInOrder() {
List<Integer> priorityList = new ArrayList<Integer>();
if (chartTypeInterfaces != null) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
priorityList.add(Integer.valueOf(priority));
}
}
return ChartTypeManager.orderInPriority(priorityList);
} }
private int fetchNames(Iterator chartUI, String[] names, int index) { private int fetchNames(Iterator chartUI, String[] names, int index) {

Loading…
Cancel
Save