Browse Source

CHART-2802 图表接口 可以没有数据配置面板&&类型面板可以加组件

final/10.0
zheng 6 years ago
parent
commit
63c78fb7e7
  1. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  2. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java
  3. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartsEditPane.java
  4. 9
      designer-chart/src/main/java/com/fr/extended/chart/ExtendedTypePane.java

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java

@ -21,7 +21,6 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -154,7 +153,9 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
this.isDefaultPane = true;
}else{
ChartDataPane chartDataPane = createChartDataPane(plotID);
paneList.add(chartDataPane);
if (chartDataPane != null) {
paneList.add(chartDataPane);
}
AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(plotID, listener);
for(int i = 0; i < otherPaneList.length; i++){
otherPaneList[i].addAttributeChangeListener(listener);
@ -169,7 +170,9 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
protected ChartDataPane createChartDataPane(String plotID) {
ChartDataPane chartDataPane = ChartTypeInterfaceManager.getInstance().getChartDataPane(plotID, listener);
chartDataPane.setSupportCellData(dataPane4SupportCell.isSupportCellData());
if (chartDataPane != null) {
chartDataPane.setSupportCellData(dataPane4SupportCell.isSupportCellData());
}
return chartDataPane;
}

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java

@ -42,7 +42,9 @@ public class ChartHyperEditPane extends ChartEditPane {
@Override
protected ChartDataPane createChartDataPane(String plotID) {
ChartDataPane dataPane = ChartTypeInterfaceManager.getInstance().getChartDataPane(plotID, listener);
dataPane.setSupportCellData(false);
if (dataPane != null) {
dataPane.setSupportCellData(false);
}
return dataPane;
}

6
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartsEditPane.java

@ -4,7 +4,7 @@ import com.fr.chart.chartattr.Chart;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import java.awt.*;
import java.awt.BorderLayout;
import java.util.ArrayList;
/**
@ -43,7 +43,9 @@ public class ChartsEditPane extends ChartEditPane {
dataPane4SupportCell = createChartDataPane(plotID);
chartsConfigPane = ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID);
paneList.add(dataPane4SupportCell);
if (dataPane4SupportCell != null) {
paneList.add(dataPane4SupportCell);
}
paneList.add(chartsConfigPane);
createTabsPane();

9
designer-chart/src/main/java/com/fr/extended/chart/ExtendedTypePane.java

@ -27,6 +27,12 @@ public class ExtendedTypePane<T extends AbstractChart> extends AbstractChartType
protected void setType(T chart, int index) {
}
protected void populate(T chart) {
}
protected void update(T chart) {
}
@Override
public void populateBean(Chart chart) {
if (getTypeIconPath().length > 0) {
@ -36,10 +42,13 @@ public class ExtendedTypePane<T extends AbstractChart> extends AbstractChartType
typeDemo.get(getTypeIndex((T) chart)).isPressing = true;
checkDemosBackground();
}
populate((T) chart);
}
@Override
public void updateBean(Chart chart) {
update((T) chart);
if (getTypeIconPath().length > 0) {
for (int index = 0, len = typeDemo.size(); index < len; index++) {
if (typeDemo.get(index).isPressing) {

Loading…
Cancel
Save