Browse Source

悬浮元素图表切换

master
Fangjie Hu 8 years ago
parent
commit
d1ba1a7e4c
  1. 3
      designer_base/src/com/fr/design/file/HistoryTemplateListPane.java
  2. 54
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

3
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;

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