Browse Source

优化代码

master
mengao 7 years ago
parent
commit
a869bef323
  1. 14
      designer/src/com/fr/quickeditor/ChartQuickEditor.java
  2. 3
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java

14
designer/src/com/fr/quickeditor/ChartQuickEditor.java

@ -2,8 +2,10 @@ package com.fr.quickeditor;
import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.ThirdChart;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
@ -19,7 +21,7 @@ import java.awt.*;
public class ChartQuickEditor extends QuickEditor<TargetComponent>{
// kunsnat: editingPropertyPane初始化 避开设计器启动, 在用到的时候再初始化.
//private BaseChartPropertyPane editingPropertyPane = null;
private static boolean lastChartType =false;
public ChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
@ -46,10 +48,20 @@ public class ChartQuickEditor extends QuickEditor<TargetComponent>{
element = ((ElementCasePane)tc).getEditingElementCase().getFloatElement(fs.getSelectedFloatName());
}
collection = (BaseChartCollection) element.getValue();
boolean chartType = false;
if (((ChartCollection) collection).getSelectedChart() instanceof ThirdChart) {
chartType = true;
}
if (chartType != lastChartType) {
ChartPropertyPane.clear();
}
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.addChartEditPane(((ChartCollection)collection).getSelectedChart().getPlot().getPlotID());
editingPropertyPane.setSupportCellData(true);
if (((ChartCollection) collection).getSelectedChart() instanceof ThirdChart) {
lastChartType = true;
}
}
editingPropertyPane.populateChartPropertyPane(collection, tc);
}

3
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java

@ -21,7 +21,6 @@ import com.fr.general.ComparatorUtils;
*/
public abstract class AbstractIndependentChartUI4Custom implements IndependentChartUIProvider {
int CURRENT_API_LEVEL = 100000;
@Override
public AbstractChartTypePane getPlotTypePane() {
return new PiePlotPane();
@ -85,7 +84,7 @@ public abstract class AbstractIndependentChartUI4Custom implements IndependentCh
}
@Override
public int currentAPILevel() {
return CURRENT_API_LEVEL;
return Integer.MAX_VALUE;
}
}

Loading…
Cancel
Save