Browse Source

切换结构设计

master
Fangjie Hu 8 years ago
parent
commit
3a52b25401
  1. 4
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  2. 14
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  3. 7
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

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

@ -78,7 +78,9 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
GeneralContext.addPluginReadListener(new PluginReadListener() { GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override @Override
public void success() { public void success() {
ChartTypeInterfaceManager.getInstance().readDefault(); if (chartTypeInterfaces.size() == 0) {
ChartTypeInterfaceManager.getInstance().readDefault();
}
//重新注册designModuleFactory //重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
} }

14
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -108,9 +108,15 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
indexList.add(button); indexList.add(button);
if (editingCollection != null) { if (editingCollection != null) {
Chart[] barChart = ColumnIndependentChart.columnChartTypes; //这个地方应该判断是clone VanChart还是clone Chart
Chart[] clonedChart = null;
if (editingCollection.getState() == SwitchState.NEW) {
}else {
clonedChart = ColumnIndependentChart.columnChartTypes;
}
try { try {
Chart newChart = (Chart) barChart[0].clone(); Chart newChart = (Chart) clonedChart[0].clone();
editingCollection.addNamedChart(name, newChart); editingCollection.addNamedChart(name, newChart);
editingCollection.addFunctionRecord(newChart); editingCollection.addFunctionRecord(newChart);
} catch (CloneNotSupportedException e1) { } catch (CloneNotSupportedException e1) {
@ -275,9 +281,9 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
//新建一个collection //新建一个collection
if(editingCollection != null && editingCollection.getChartCount() == 1){ if(editingCollection != null && editingCollection.getChartCount() == 1){
//vanChart 不支持图表切换 目前 //vanChart 不支持图表切换 目前
if(!ComparatorUtils.equals(editingCollection.getSelectedChart().getClass(), Chart.class)){ /*if(!ComparatorUtils.equals(editingCollection.getSelectedChart().getClass(), Chart.class)){
addButton.setVisible(false); addButton.setVisible(false);
} }*/
} }
} }

7
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -118,6 +118,8 @@ public class ChartTypePane extends AbstractChartAttrPane{
//这一步会替换plot //这一步会替换plot
((AbstractChartTypePane) cards.get(fcb.getRelatedSelectedIndex())).updateBean(chart); ((AbstractChartTypePane) cards.get(fcb.getRelatedSelectedIndex())).updateBean(chart);
String chartID = chart.getChartID();
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
if(plot != null){ if(plot != null){
@ -199,10 +201,11 @@ public class ChartTypePane extends AbstractChartAttrPane{
jcb.addItem(cards.get(i).title4PopupWindow()); jcb.addItem(cards.get(i).title4PopupWindow());
} }
} }
//重构完成
fcb.setItemEvenType(ItemEvenType.DEFAULT);
//重置选择项 //重置选择项
fcb.setRelatedSelectedIndex(relativeIndex); fcb.setRelatedSelectedIndex(relativeIndex);
//重构完成
fcb.setItemEvenType(ItemEvenType.DEFAULT);
} }
@Override @Override

Loading…
Cancel
Save