diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java index 51fe2f816a..30ff6c8911 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java @@ -3,6 +3,9 @@ package com.fr.design.mainframe.chart.mode; import com.fr.common.annotations.Open; import com.fr.design.base.mode.DesignModeContext; +import java.util.HashSet; +import java.util.Set; + /** * @author shine * @version 10.0 @@ -13,6 +16,19 @@ public class ChartEditContext { private static ChartEditMode current = ChartEditMode.NORMAL; + private static final Set features = new HashSet<>(); + + /** + * 功能点枚举 + */ + public enum DuchampFeature { + SUPPORT_REPORT_DATA + } + + /** + * 切换图表编辑模式 + * @param mode 图表编辑模式 + */ public static void switchTo(ChartEditMode mode) { current = mode; } @@ -33,4 +49,28 @@ public class ChartEditContext { public static boolean supportTheme() { return !DesignModeContext.isDuchampMode(); } + + /** + * 注册功能点 + */ + public static void addDuchampFeature(DuchampFeature feature) { + features.add(feature); + } + + /** + * 移除功能点 + */ + public static void removeDuchampFeature(DuchampFeature feature) { + features.remove(feature); + } + + /** + * 当前模式下是否支持单元格数据来源 + */ + public static boolean supportReportData() { + if (normalMode()) { + return true; + } + return features.contains(DuchampFeature.SUPPORT_REPORT_DATA); + } } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index 86f7e4da87..ba1701710e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -68,7 +68,7 @@ public class NormalChartDataPane extends DataContentsPane { label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); northPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,8)); - if (ChartEditContext.normalMode()) { + if (ChartEditContext.supportReportData()) { this.add(northPane, BorderLayout.NORTH); } this.add(cardPane, BorderLayout.CENTER);