Browse Source

feat:对接扩展图表

feature/big-screen
shine 3 years ago
parent
commit
1a2d4acb63
  1. 32
      designer-chart/src/main/java/com/fr/design/chart/fun/ChartTypeUIProvider.java
  2. 1
      designer-chart/src/main/java/com/fr/design/chart/fun/IndependentChartUIProvider.java
  3. 58
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java
  4. 1
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java
  5. 38
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/DefaultChartTypePane.java
  6. 13
      designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractDataPane.java
  7. 5
      designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractOtherPane.java

32
designer-chart/src/main/java/com/fr/design/chart/fun/ChartTypeUIProvider.java

@ -89,7 +89,9 @@ public interface ChartTypeUIProvider extends Level {
//todo:把下面这些接口删除
@Deprecated
boolean needChartChangePane();
default boolean needChartChangePane() {
return false;
}
/**
* 数据集数据源的界面
@ -97,7 +99,9 @@ public interface ChartTypeUIProvider extends Level {
* @return 数据集数据源的界面
*/
@Deprecated
AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent);
default AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
/**
@ -106,7 +110,9 @@ public interface ChartTypeUIProvider extends Level {
* @return 单元格数据源的界面
*/
@Deprecated
AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent);
default AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
/**
* 条件属性界面
@ -114,7 +120,9 @@ public interface ChartTypeUIProvider extends Level {
* @return 条件属性界面
*/
@Deprecated
ConditionAttributesPane getPlotConditionPane(Plot plot);
default ConditionAttributesPane getPlotConditionPane(Plot plot) {
return null;
}
/**
* 系列界面
@ -122,7 +130,9 @@ public interface ChartTypeUIProvider extends Level {
* @return 系列界面
*/
@Deprecated
BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot);
default BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return null;
}
/**
* 是否使用默认的界面为了避免界面来回切换
@ -130,12 +140,18 @@ public interface ChartTypeUIProvider extends Level {
* @return 是否使用默认的界面
*/
@Deprecated
boolean isUseDefaultPane();
default boolean isUseDefaultPane() {
return false;
}
@Deprecated
ChartEditPane getChartEditPane(String plotID);
default ChartEditPane getChartEditPane(String plotID) {
return new ChartEditPane();
}
@Deprecated
ChartsConfigPane getChartConfigPane(String plotID);
default ChartsConfigPane getChartConfigPane(String plotID) {
return null;
}
}

1
designer-chart/src/main/java/com/fr/design/chart/fun/IndependentChartUIProvider.java

@ -6,6 +6,7 @@ import com.fr.common.annotations.Compatible;
* Created by shine on 2019/09/05.
*/
@Compatible
@Deprecated
public interface IndependentChartUIProvider extends ChartTypeUIProvider {
}

58
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java

@ -1,18 +1,9 @@
package com.fr.design.chart.fun.impl;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chartx.impl.AbstractDataPane;
import com.fr.design.chartx.impl.AbstractOtherPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
@ -24,13 +15,15 @@ import com.fr.stable.fun.mark.API;
public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider {
@Override
public abstract AbstractChartTypePane getPlotTypePane();
public AbstractChartTypePane getPlotTypePane() {
return new DefaultChartTypePane();
}
@Override
public abstract AbstractDataPane getChartDataPane(AttributeChangeListener listener);
@Override
public abstract AbstractOtherPane[] getAttrPaneArray(AttributeChangeListener listener);
public abstract AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener);
@Override
public String[] getSubName() {
@ -46,45 +39,4 @@ public abstract class AbstractChartTypeUI extends AbstractProvider implements Ch
public String mark4Provider() {
return getClass().getName();
}
@Override
public boolean needChartChangePane() {
return false;
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
@Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return null;
}
@Override
public boolean isUseDefaultPane() {
return false;
}
@Override
public ChartEditPane getChartEditPane(String plotID) {
return new ChartEditPane();
}
@Override
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return null;
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return null;
}
@Override
public ChartsConfigPane getChartConfigPane(String plotID) {
return null;
}
}

1
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java

@ -17,6 +17,7 @@ import com.fr.stable.StableUtils;
/**
* Created by Mitisky on 16/3/7.
*/
@Deprecated
public abstract class AbstractIndependentChartUIWithAPILevel implements ChartTypeUIProvider {
//这个不能改,是做兼容用的
//2016.10.14-11.24号的8.0jar因为改了这个为3,不会提示5.26号之前的插件更新

38
designer-chart/src/main/java/com/fr/design/chart/fun/impl/DefaultChartTypePane.java

@ -0,0 +1,38 @@
package com.fr.design.chart.fun.impl;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
/**
* @author shine
* @version 10.0
* Created by shine on 2020/7/8
*/
public class DefaultChartTypePane<T extends ChartProvider> extends AbstractChartTypePane<T> {
@Override
protected String[] getTypeIconPath() {
return ChartTypeInterfaceManager.getInstance().getDemoImagePath(this.getPlotID());
}
@Override
protected String[] getTypeTipName() {
return ChartTypeInterfaceManager.getInstance().getSubName(this.getPlotID());
}
public ChartProvider getDefaultChart() {
return ChartTypeManager.getInstance().getChartTypes(this.getPlotID())[0];
}
public String title4PopupWindow() {
return ChartTypeInterfaceManager.getInstance().getName(this.getPlotID());
}
@Override
public void populateBean(T ob) {
}
}

13
designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractDataPane.java

@ -45,12 +45,16 @@ public abstract class AbstractDataPane extends ChartDataPane {
ChartDataDefinitionProvider dataDefinition = chart.getChartDataDefinition();
singleDataPane.populateBean((AbstractDataDefinition) dataDefinition);
populate(dataDefinition);
this.initAllListeners();
this.validate();
}
protected void populate(ChartDataDefinitionProvider dataDefinition) {
singleDataPane.populateBean((AbstractDataDefinition) dataDefinition);
}
@Override
public void update(ChartCollection collection) {
@ -62,6 +66,11 @@ public abstract class AbstractDataPane extends ChartDataPane {
return;
}
chart.setChartDataDefinition(singleDataPane.updateBean());
chart.setChartDataDefinition(update());
}
protected ChartDataDefinitionProvider update() {
return singleDataPane.updateBean();
}
}

5
designer-chart/src/main/java/com/fr/design/chartx/impl/AbstractOtherPane.java

@ -3,6 +3,7 @@ package com.fr.design.chartx.impl;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.impl.AbstractChartWithData;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
/**
* Created by shine on 2019/09/04.
@ -13,6 +14,10 @@ public abstract class AbstractOtherPane<T extends AbstractChartWithData> extends
protected abstract void update(T chart);
public String title4PopupWindow() {
return PaneTitleConstants.CHART_OTHER_TITLE;
}
@Override
public void populate(ChartCollection collection) {
if (collection == null) {

Loading…
Cancel
Save