From e574e8af635bf0d2c333b05b21dc01244ac63aea Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 29 Jun 2021 17:42:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=85=B6=E4=BB=96=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=9B=BE=E4=B8=8D=E9=9C=80=E8=A6=81=E7=B1=BB=E5=9E=8B=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=9B=BE=E9=9C=80=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/ChartEditPane.java | 14 ++++++++---- .../mainframe/chart/ChartHyperEditPane.java | 3 ++- .../mainframe/chart/gui/ChartTypePane.java | 2 +- .../chart/gui/type/AbstractChartTypePane.java | 4 ++++ .../chart/custom/VanChartCustomPlotPane.java | 22 ++++++++++++++----- 5 files changed, 34 insertions(+), 11 deletions(-) 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},