|
|
@ -68,8 +68,13 @@ public class ChartTypePane extends AbstractChartAttrPane{ |
|
|
|
|
|
|
|
|
|
|
|
buttonPane = new ChartTypeButtonPane(this); |
|
|
|
buttonPane = new ChartTypeButtonPane(this); |
|
|
|
content.add(buttonPane, BorderLayout.NORTH); |
|
|
|
content.add(buttonPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
chartTypePane = new ComboBoxPane(); |
|
|
|
if (editingCollection != null) { |
|
|
|
|
|
|
|
relayoutChartTypePane(editingCollection); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
chartTypePane = new ComboBoxPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BasicScrollPane scrollPane = new BasicScrollPane() { |
|
|
|
BasicScrollPane scrollPane = new BasicScrollPane() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected JPanel createContentPane() { |
|
|
|
protected JPanel createContentPane() { |
|
|
@ -192,7 +197,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void reactor(ChartCollection collection){ |
|
|
|
public void relayout(ChartCollection collection){ |
|
|
|
//重构需要重构下拉框选项和cardNames
|
|
|
|
//重构需要重构下拉框选项和cardNames
|
|
|
|
Chart chart = collection.getSelectedChart(); |
|
|
|
Chart chart = collection.getSelectedChart(); |
|
|
|
String chartID = chart.getPriority(); |
|
|
|
String chartID = chart.getPriority(); |
|
|
@ -278,9 +283,9 @@ public class ChartTypePane extends AbstractChartAttrPane{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void reactorChartTypePane(ChartCollection collection){ |
|
|
|
public void relayoutChartTypePane(ChartCollection collection){ |
|
|
|
if (needReactor(collection)) { |
|
|
|
if (needRelayout(collection)) { |
|
|
|
chartTypePane.reactor(collection); |
|
|
|
chartTypePane.relayout(collection); |
|
|
|
//设置面板切换状态
|
|
|
|
//设置面板切换状态
|
|
|
|
updatePaneState(collection); |
|
|
|
updatePaneState(collection); |
|
|
|
} |
|
|
|
} |
|
|
@ -292,7 +297,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO: 2016/11/17 因为现在populate面板时会重新构造面板,所以每次都需要重构
|
|
|
|
// TODO: 2016/11/17 因为现在populate面板时会重新构造面板,所以每次都需要重构
|
|
|
|
private boolean needReactor(ChartCollection collection) { |
|
|
|
private boolean needRelayout(ChartCollection collection) { |
|
|
|
/*return paneState.getChartID() != collection.getRepresentChartID() || paneState.getPaneState() != collection.getState();*/ |
|
|
|
/*return paneState.getChartID() != collection.getRepresentChartID() || paneState.getPaneState() != collection.getState();*/ |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -301,14 +306,14 @@ public class ChartTypePane extends AbstractChartAttrPane{ |
|
|
|
* 更新界面属性 用于展示 |
|
|
|
* 更新界面属性 用于展示 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void populate(ChartCollection collection) { |
|
|
|
public void populate(ChartCollection collection) { |
|
|
|
|
|
|
|
editingCollection = collection; |
|
|
|
|
|
|
|
|
|
|
|
Chart chart = collection.getSelectedChart(); |
|
|
|
Chart chart = collection.getSelectedChart(); |
|
|
|
this.remove(leftContentPane); |
|
|
|
this.remove(leftContentPane); |
|
|
|
initContentPane(); |
|
|
|
initContentPane(); |
|
|
|
|
|
|
|
|
|
|
|
buttonPane.populateBean(collection); |
|
|
|
buttonPane.populateBean(collection); |
|
|
|
chartTypePane.populateBean(chart); |
|
|
|
chartTypePane.populateBean(chart); |
|
|
|
//remove面板之后,就需要重构下拉框
|
|
|
|
|
|
|
|
reactorChartTypePane(collection); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.initAllListeners(); |
|
|
|
this.initAllListeners(); |
|
|
|
} |
|
|
|
} |
|
|
|