Browse Source

CHART-10710 兼容 性能插件使用 cc.getChart

feature/big-screen
shine 5 years ago
parent
commit
5002c3eb1b
  1. 2
      designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java
  2. 2
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  3. 10
      designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java
  4. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  5. 12
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  6. 16
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

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

@ -12,7 +12,7 @@ public abstract class ChartCommonWizardPane extends ChartWizardPane {
return;
}
populate(cc.getSelectedChartProvider());
populate(cc.getSelectedChart(ChartProvider.class));
}
public abstract void populate(ChartProvider chart);

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

@ -123,7 +123,7 @@ public class ChartTypePane extends ChartCommonWizardPane {
return;
}
ChartProvider chart4Update = cc.getSelectedChartProvider();
ChartProvider chart4Update = cc.getSelectedChart(ChartProvider.class);
if (chart4Update == null) {
String plotID = this.chartIDs[mainTypeList.getSelectedIndex()];
ChartProvider chart = ChartTypeManager.getInstance().getCharts(plotID)[iconViewList.getSelectedIndex()];

10
designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java

@ -6,6 +6,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
@ -14,11 +15,12 @@ import com.fr.design.gui.frpane.UITitlePanel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.stable.StableUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JComponent;
import java.awt.BorderLayout;
public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
@ -91,7 +93,7 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
* @param ePane 面板
*/
public void populateChartPropertyPane(ChartCollection collection, TargetComponent<?> ePane) {
addChartEditPane(collection.getSelectedChartProvider().getID());
addChartEditPane(collection.getSelectedChart(ChartProvider.class).getID());
setSupportCellData(true);
this.container.setEPane(ePane);
chartEditPane.populate(collection);

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

@ -230,7 +230,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
return;
}
ChartProvider chartProvider = collection.getSelectedChartProvider();
ChartProvider chartProvider = collection.getSelectedChart(ChartProvider.class);
if (checkNeedsReLayout(chartProvider)) {
String chartID = chartProvider.getID();
if ("WaferChipChart".equals(chartID) || "BoxPlotChart".equals(chartID)) {

12
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -176,7 +176,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
* @return
*/
public ChartProvider getChangeStateNewChart() {
ChartProvider chart = editingCollection.getSelectedChartProvider();
ChartProvider chart = editingCollection.getSelectedChart(ChartProvider.class);
String chartID = chart.getID();
String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID);
return ChartTypeManager.getInstanceWithCheck().getFirstChart(priority);
@ -199,7 +199,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
}
private boolean supportChange() {
return supportChangeConfigChartClassSet.contains(editingCollection.getSelectedChartProvider().getClass());
return supportChangeConfigChartClassSet.contains(editingCollection.getSelectedChart(ChartProvider.class).getClass());
}
ActionListener configListener = new ActionListener() {
@ -354,9 +354,9 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
}
private void checkConfigButtonVisible() {
addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChartProvider().getID()));
addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChart(ChartProvider.class).getID()));
//新建一个collection
if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChartProvider() != null) {
if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChart(ChartProvider.class) != null) {
//Chart 不支持图表切换
configButton.setVisible(supportChange());
}
@ -484,7 +484,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private void deleteAButton() {
//先重构属性,在重构面板,否则面板在重构过程中,会重新将属性中的切换图表加到indexList中,导致面板无法删除
//记录改变前的plotID
String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChartProvider().getID();
String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart(ChartProvider.class).getID();
if (editingCollection != null) {
int count = editingCollection.getChartCount();
for (int i = 0; i < count; i++) {
@ -564,7 +564,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
if (isEnabled()) {
noSelected();
//记录改变前的plotID
String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChartProvider().getID();
String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart(ChartProvider.class).getID();
changeCollectionSelected(getButtonName());
setSelectedWithFireListener(true);
fireSelectedChanged();

16
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -19,15 +19,15 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/**
* 图表 属性表, 类型选择 界面.
@ -208,7 +208,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
//处理办法:这边除了重构 下拉项选项和cardNames 还需要把cards重构下(不需要init pane,只需要我需要的拿出来就好了)
private void relayout(ChartCollection collection){
//重构需要重构下拉框选项和cardNames
ChartProvider chart = collection.getSelectedChartProvider();
ChartProvider chart = collection.getSelectedChart(ChartProvider.class);
String chartID = chart.getID();
String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID);
boolean enabledChart = ChartTypeManager.enabledChart(chartID);
@ -294,7 +294,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
* @param collection
*/
public void reLayoutEditPane(String lastPlotID, ChartCollection collection){
ChartProvider chart = collection.getSelectedChartProvider();
ChartProvider chart = collection.getSelectedChart(ChartProvider.class);
String plotID = chart.getID();
boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){
@ -315,7 +315,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
public void populate(ChartCollection collection) {
editingCollection = collection;
ChartProvider chart = collection.getSelectedChartProvider();
ChartProvider chart = collection.getSelectedChart(ChartProvider.class);
this.remove(leftContentPane);
initContentPane();
@ -333,7 +333,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
public void update(ChartCollection collection) {
editingCollection = collection;
buttonPane.update(collection);// 内部操作时 已经做过处理.
ChartProvider chart = collection.getSelectedChartProvider();
ChartProvider chart = collection.getSelectedChart(ChartProvider.class);
chartTypeComBox.updateBean(chart);
}

Loading…
Cancel
Save