diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 06e74b39ca..5d54adff73 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -278,6 +278,14 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr } return name; } + + public String getTitle4PopupWindow(String plotID) { + IndependentChartUIProvider provider = getChartTypeInterface(plotID); + if (provider != null) { + return provider.getPlotTypeTitle4PopupWindow(); + } + return StringUtils.EMPTY; + } /** * 获取指定图表的标题 diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index da79f2691b..5248fb08b1 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -1,8 +1,8 @@ package com.fr.design.mainframe.chart.gui.data; import com.fr.base.TableData; +import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.chartattr.Plot; import com.fr.chart.chartdata.TableDataDefinition; import com.fr.chart.chartdata.TopDefinition; import com.fr.data.impl.NameTableData; @@ -14,9 +14,9 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; - -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import java.awt.BorderLayout; +import java.awt.Dimension; public class TableDataPane extends FurtherBasicBeanPane{ private static final long serialVersionUID = 4740461028440155147L; @@ -72,8 +72,8 @@ public class TableDataPane extends FurtherBasicBeanPane{ } } - protected AbstractTableDataContentPane getContentPane(Plot plot) { - return ChartTypeInterfaceManager.getInstance().getTableDataSourcePane(plot, parent); + protected AbstractTableDataContentPane getContentPane(Chart chart) { + return ChartTypeInterfaceManager.getInstance().getTableDataSourcePane(chart.getPlot(), parent); } /** @@ -106,7 +106,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ * @param collection 图表属性的集合 */ public void refreshContentPane(ChartCollection collection) { - refreshContentPane(getContentPane(collection.getSelectedChart().getPlot())); + refreshContentPane(getContentPane(collection.getSelectedChart())); } protected void refreshContentPane(AbstractTableDataContentPane contentPane) { diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java index c633fa755f..9e4a84f038 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java @@ -58,17 +58,20 @@ public abstract class AbstractExtendedChartReportDataPane extends this.listener = listener; } + protected void setChart(Chart chart) { + if (chart instanceof AbstractChart) { + this.chart = (T) chart; + } + } + + protected T getChart() { + return this.chart; + } + + protected AttributeChangeListener getListener() { + return this.listener; + } + @Override protected JPanel createContentPane() { @@ -95,8 +109,11 @@ public abstract class AbstractExtendedStylePane extends if (collection != null) { Chart chart = collection.getSelectedChart(); - if (chart != null && chart instanceof AbstractChart){ - this.chart = (T)chart; + if (chart != null) { + setChart(chart); + } + + if (this.chart != null) { paneList.get(tabPane.getSelectedIndex()).populateBean(this.chart); } @@ -109,8 +126,11 @@ public abstract class AbstractExtendedStylePane extends if (collection != null) { Chart chart = collection.getSelectedChart(); - if (chart != null && chart instanceof AbstractChart){ - this.chart = (T)chart; + if (chart != null) { + setChart(chart); + } + + if (this.chart != null) { paneList.get(tabPane.getSelectedIndex()).updateBean(this.chart); } diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java index e2e3e67c4b..a92e100e53 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java @@ -9,7 +9,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.PaneTitleConstants; - import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; @@ -28,29 +27,42 @@ public class ExtendedOtherPane extends AbstractChartAttrPane { private UISpinner autoRefreshTime; private JPanel contentPane; + protected AbstractChart getAbstractChart(Chart chart) { + if (chart != null && chart instanceof AbstractChart) { + return (AbstractChart) chart; + } + return null; + } + @Override public void populate(ChartCollection collection) { - if (collection != null) { - Chart chart = collection.getSelectedChart(); - if (chart != null && chart instanceof AbstractChart) { - hyperLinkPane.populateBean((AbstractChart) chart); - autoRefreshTime.setValue(((AbstractChart) chart).getAutoRefreshTime()); - refreshEnabled.setSelectedIndex(((AbstractChart) chart).isRefreshEnabled() ? 0 : 1); - checkRefreshEnable(); - } + if (collection == null || collection.getSelectedChart() == null) { + return; + } + + AbstractChart chart = getAbstractChart(collection.getSelectedChart()); + + if (chart != null) { + hyperLinkPane.populateBean(chart); + autoRefreshTime.setValue(chart.getAutoRefreshTime()); + refreshEnabled.setSelectedIndex(chart.isRefreshEnabled() ? 0 : 1); + checkRefreshEnable(); } } @Override public void update(ChartCollection collection) { - if (collection != null) { - Chart chart = collection.getSelectedChart(); - if (chart != null && chart instanceof AbstractChart) { - hyperLinkPane.updateBean((AbstractChart) chart); - ((AbstractChart) chart).setAutoRefreshTime(autoRefreshTime.getValue()); - ((AbstractChart) chart).setRefreshEnabled(refreshEnabled.getSelectedIndex() == 0); - } + if (collection == null || collection.getSelectedChart() == null) { + return; + } + + AbstractChart chart = getAbstractChart(collection.getSelectedChart()); + + if (chart != null) { + hyperLinkPane.updateBean(chart); + chart.setAutoRefreshTime(autoRefreshTime.getValue()); + chart.setRefreshEnabled(refreshEnabled.getSelectedIndex() == 0); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataPane.java index 992d13d54e..56e2381312 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataPane.java @@ -1,6 +1,6 @@ package com.fr.van.chart.gantt.designer.data.link; -import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartattr.Chart; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.TableDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; @@ -14,7 +14,7 @@ public class GanttLinkTableDataPane extends TableDataPane { } @Override - protected AbstractTableDataContentPane getContentPane(Plot plot) { + protected AbstractTableDataContentPane getContentPane(Chart chart) { return new GanttLinkTableDataContentPane(); } }