diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index c60f1abbd..f51755f87 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/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(); String chartID = currentChart.getID(); - addTypePane(chartID); + addTypePane(currentChart); boolean isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID); @@ -215,13 +215,19 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare return chartDataPane; } - protected void addTypePane(String id) { - AbstractChartTypePane pane = ChartTypeInterfaceManager.getInstance().getPlotTypePane(id); - if (pane != null && !ChartTypeInterfaceManager.TYPE_PANE_DEFAULT_TITLE.equals(pane.title4PopupWindow())) { + protected void addTypePane(ChartProvider chart) { + if (visibleTypePane(chart)) { 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() { } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java index fcad48088..fdfa6a3c3 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartHyperEditPane.java +++ b/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.web.ChartHyperPoplink; +import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPopAttrPane; @@ -48,7 +49,7 @@ public class ChartHyperEditPane extends ChartEditPane { return dataPane; } - protected void addTypePane(String id) { + protected void addTypePane(ChartProvider chart) { paneList.add(attrPane); paneList.add(typePane); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 5137901ee..cbbae3022 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/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) { 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; } pane.reLayout(id); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java index 4f3f02510..cde6e8fd6 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java @@ -217,6 +217,10 @@ public abstract class AbstractChartTypePane extends Fur return plotID; } + public boolean visible(ChartProvider chart) { + return true; + } + /** * @param ob 对象 * @return diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java index b69813d67..c3dcf7390 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/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.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; +import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.chartx.data.CustomChartDataDefinition; @@ -56,17 +58,27 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { //自定义和自动版面的容器,cardLayOut布局 private JPanel contentPane; - public String title4PopupWindow() { - //todo:check下组合图类 - return ChartEditContext.duchampMode() ? ChartTypeInterfaceManager.TYPE_PANE_DEFAULT_TITLE : super.title4PopupWindow(); - } + @Override + public boolean visible(ChartProvider chart) { + 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) { initContent(); - return new Component[][]{ + return ChartEditContext.duchampMode() ? new Component[][]{ + new Component[]{contentPane}, + new Component[]{buttonPane}, + }: new Component[][]{ new Component[]{typePane}, new Component[]{stylePane}, new Component[]{contentPane},