Browse Source

feat:其他组合图不需要类型界面,自定义组合图需要

feature/big-screen
shine 3 years ago
parent
commit
e574e8af63
  1. 14
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  2. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java
  3. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  4. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  5. 22
      designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java

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

@ -181,7 +181,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
paneList = new ArrayList<AbstractChartAttrPane>(); paneList = new ArrayList<AbstractChartAttrPane>();
String chartID = currentChart.getID(); String chartID = currentChart.getID();
addTypePane(chartID); addTypePane(currentChart);
boolean isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID); boolean isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID);
@ -215,13 +215,19 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
return chartDataPane; return chartDataPane;
} }
protected void addTypePane(String id) { protected void addTypePane(ChartProvider chart) {
AbstractChartTypePane pane = ChartTypeInterfaceManager.getInstance().getPlotTypePane(id); if (visibleTypePane(chart)) {
if (pane != null && !ChartTypeInterfaceManager.TYPE_PANE_DEFAULT_TITLE.equals(pane.title4PopupWindow())) {
paneList.add(typePane); paneList.add(typePane);
} }
} }
private boolean visibleTypePane(ChartProvider chart) {
AbstractChartTypePane pane = ChartTypeInterfaceManager.getInstance().getPlotTypePane(chart.getID());
return pane != null
&& !ChartTypeInterfaceManager.TYPE_PANE_DEFAULT_TITLE.equals(pane.title4PopupWindow())
&& pane.visible(chart);
}
protected void setSelectedTab() { protected void setSelectedTab() {
} }

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPopAttrPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPopAttrPane;
@ -48,7 +49,7 @@ public class ChartHyperEditPane extends ChartEditPane {
return dataPane; return dataPane;
} }
protected void addTypePane(String id) { protected void addTypePane(ChartProvider chart) {
paneList.add(attrPane); paneList.add(attrPane);
paneList.add(typePane); paneList.add(typePane);
} }

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

@ -162,7 +162,7 @@ public class ChartTypePane extends AbstractChartAttrPane {
for (String id : chartIDs) { for (String id : chartIDs) {
AbstractChartTypePane pane = ChartTypeInterfaceManager.getInstance().getPlotTypePane(id); AbstractChartTypePane pane = ChartTypeInterfaceManager.getInstance().getPlotTypePane(id);
if (AssistUtils.equals(pane.title4PopupWindow(), ChartTypeInterfaceManager.TYPE_PANE_DEFAULT_TITLE)) { if (pane == null || AssistUtils.equals(pane.title4PopupWindow(), ChartTypeInterfaceManager.TYPE_PANE_DEFAULT_TITLE)) {
continue; continue;
} }
pane.reLayout(id); pane.reLayout(id);

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -217,6 +217,10 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
return plotID; return plotID;
} }
public boolean visible(ChartProvider chart) {
return true;
}
/** /**
* @param ob 对象 * @param ob 对象
* @return * @return

22
designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java

@ -3,9 +3,11 @@ package com.fr.van.chart.custom;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.base.DataSeriesCondition;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.attr.ChartProvider;
import com.fr.chartx.data.AbstractDataDefinition; import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.CustomChartDataDefinition; import com.fr.chartx.data.CustomChartDataDefinition;
@ -56,17 +58,27 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
//自定义和自动版面的容器,cardLayOut布局 //自定义和自动版面的容器,cardLayOut布局
private JPanel contentPane; private JPanel contentPane;
public String title4PopupWindow() { @Override
//todo:check下组合图类 public boolean visible(ChartProvider chart) {
return ChartEditContext.duchampMode() ? ChartTypeInterfaceManager.TYPE_PANE_DEFAULT_TITLE : super.title4PopupWindow(); if (ChartEditContext.duchampMode() && chart instanceof VanChart) {
} Plot plot = ((VanChart) chart).getPlot();
if (plot instanceof VanChartCustomPlot) {
CustomStyle customStyle = ((VanChartCustomPlot) plot).getCustomStyle();
return customStyle == CustomStyle.CUSTOM;
}
}
return super.visible(chart);
}
protected Component[][] getPaneComponents(JPanel typePane) { protected Component[][] getPaneComponents(JPanel typePane) {
initContent(); initContent();
return new Component[][]{ return ChartEditContext.duchampMode() ? new Component[][]{
new Component[]{contentPane},
new Component[]{buttonPane},
}: new Component[][]{
new Component[]{typePane}, new Component[]{typePane},
new Component[]{stylePane}, new Component[]{stylePane},
new Component[]{contentPane}, new Component[]{contentPane},

Loading…
Cancel
Save