Browse Source

Merge pull request #411 in DESIGN/design from ~ZHENG/c-design:release/10.0 to release/10.0

* commit 'ad60c51a7e046cbb3fc32c8ec4706ffe1bb5eb63':
  CHART-2802 大屏插件 接口扩展
final/10.0
zheng 6 years ago
parent
commit
24dc0b6f2a
  1. 8
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  2. 14
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  3. 13
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java
  4. 18
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java
  5. 28
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedStylePane.java
  6. 40
      designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java
  7. 4
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataPane.java

8
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -279,6 +279,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;
}
/**
* 获取指定图表的标题
*/

14
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<ChartCollection>{
private static final long serialVersionUID = 4740461028440155147L;
@ -72,8 +72,8 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
}
}
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<ChartCollection>{
* @param collection 图表属性的集合
*/
public void refreshContentPane(ChartCollection collection) {
refreshContentPane(getContentPane(collection.getSelectedChart().getPlot()));
refreshContentPane(getContentPane(collection.getSelectedChart()));
}
protected void refreshContentPane(AbstractTableDataContentPane contentPane) {

13
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java

@ -58,19 +58,22 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
protected abstract T update();
public void populateBean(ChartCollection collection) {
if (collection == null || collection.getSelectedChart() == null) {
return;
}
if (collection != null) {
Chart chart = collection.getSelectedChart();
if (chart != null && chart instanceof AbstractChart) {
AbstractDataConfig dataConfig = ((AbstractChart) chart).getDataConfig();
if (chart.getFilterDefinition() instanceof ExtendedReportDataSet) {
ExtendedReportDataSet dataSet = (ExtendedReportDataSet) chart.getFilterDefinition();
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) {
populate((T) dataConfig);
}
}
}
}
@Override
public void updateBean(ChartCollection ob) {

18
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java

@ -84,20 +84,26 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
@Override
public void populateBean(ChartCollection collection) {
if (collection == null || collection.getSelectedChart() == null) {
return;
}
if (collection != null) {
Chart chart = collection.getSelectedChart();
if (chart != null && chart instanceof AbstractChart) {
AbstractDataConfig dataConfig = ((AbstractChart) chart).getDataConfig();
if (chart.getFilterDefinition() instanceof ExtendedTableDataSet) {
ExtendedTableDataSet dataSet = (ExtendedTableDataSet) chart.getFilterDefinition();
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) {
populate((T) dataConfig);
}
if (hasFunction() && chart.getFilterDefinition() instanceof ExtendedTableDataSet) {
ExtendedTableDataSet dataSet = (ExtendedTableDataSet) chart.getFilterDefinition();
if (hasFunction()) {
function.populateBean((AbstractDataFunction) dataSet.getDataFunction());
}
}
}
}

28
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedStylePane.java

@ -38,6 +38,20 @@ public abstract class AbstractExtendedStylePane<T extends AbstractChart> 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<T extends AbstractChart> 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<T extends AbstractChart> 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);
}

40
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);
}
}

4
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();
}
}

Loading…
Cancel
Save