Browse Source

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

final/10.0
zheng 6 years ago
parent
commit
63c78fb7e7
  1. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  2. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java
  3. 4
      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

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

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

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

4
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.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import java.awt.*; import java.awt.BorderLayout;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
@ -43,7 +43,9 @@ public class ChartsEditPane extends ChartEditPane {
dataPane4SupportCell = createChartDataPane(plotID); dataPane4SupportCell = createChartDataPane(plotID);
chartsConfigPane = ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID); chartsConfigPane = ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID);
if (dataPane4SupportCell != null) {
paneList.add(dataPane4SupportCell); paneList.add(dataPane4SupportCell);
}
paneList.add(chartsConfigPane); paneList.add(chartsConfigPane);
createTabsPane(); 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 setType(T chart, int index) {
} }
protected void populate(T chart) {
}
protected void update(T chart) {
}
@Override @Override
public void populateBean(Chart chart) { public void populateBean(Chart chart) {
if (getTypeIconPath().length > 0) { if (getTypeIconPath().length > 0) {
@ -36,10 +42,13 @@ public class ExtendedTypePane<T extends AbstractChart> extends AbstractChartType
typeDemo.get(getTypeIndex((T) chart)).isPressing = true; typeDemo.get(getTypeIndex((T) chart)).isPressing = true;
checkDemosBackground(); checkDemosBackground();
} }
populate((T) chart);
} }
@Override @Override
public void updateBean(Chart chart) { public void updateBean(Chart chart) {
update((T) chart);
if (getTypeIconPath().length > 0) { if (getTypeIconPath().length > 0) {
for (int index = 0, len = typeDemo.size(); index < len; index++) { for (int index = 0, len = typeDemo.size(); index < len; index++) {
if (typeDemo.get(index).isPressing) { if (typeDemo.get(index).isPressing) {

Loading…
Cancel
Save