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. 54
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

54
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<FurtherBasicBeanPane<? extends Chart>> paneList) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
List<Integer> 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<Integer> priorityList = new ArrayList<Integer>();
List<Integer> 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<Integer> getPriorityInOrder() {
List<Integer> priorityList = new ArrayList<Integer>();
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) {

Loading…
Cancel
Save