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() {
@Override
public void success() {
ChartTypeInterfaceManager.getInstance().readDefault();
if (chartTypeInterfaces.size() == 0) {
ChartTypeInterfaceManager.getInstance().readDefault();
}
//重新注册designModuleFactory
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);
if (editingCollection != null) {
Chart[] barChart = ColumnIndependentChart.columnChartTypes;
//这个地方应该判断是clone VanChart还是clone Chart
Chart[] clonedChart = null;
if (editingCollection.getState() == SwitchState.NEW) {
}else {
clonedChart = ColumnIndependentChart.columnChartTypes;
}
try {
Chart newChart = (Chart) barChart[0].clone();
Chart newChart = (Chart) clonedChart[0].clone();
editingCollection.addNamedChart(name, newChart);
editingCollection.addFunctionRecord(newChart);
} catch (CloneNotSupportedException e1) {
@ -275,9 +281,9 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
//新建一个collection
if(editingCollection != null && editingCollection.getChartCount() == 1){
//vanChart 不支持图表切换 目前
if(!ComparatorUtils.equals(editingCollection.getSelectedChart().getClass(), Chart.class)){
/*if(!ComparatorUtils.equals(editingCollection.getSelectedChart().getClass(), Chart.class)){
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
((AbstractChartTypePane) cards.get(fcb.getRelatedSelectedIndex())).updateBean(chart);
String chartID = chart.getChartID();
Plot plot = chart.getPlot();
if(plot != null){
@ -199,10 +201,11 @@ public class ChartTypePane extends AbstractChartAttrPane{
jcb.addItem(cards.get(i).title4PopupWindow());
}
}
//重构完成
fcb.setItemEvenType(ItemEvenType.DEFAULT);
//重置选择项
fcb.setRelatedSelectedIndex(relativeIndex);
//重构完成
fcb.setItemEvenType(ItemEvenType.DEFAULT);
}
@Override

Loading…
Cancel
Save