|
|
@ -3,6 +3,9 @@ package com.fr.design.mainframe.chart.mode; |
|
|
|
import com.fr.common.annotations.Open; |
|
|
|
import com.fr.common.annotations.Open; |
|
|
|
import com.fr.design.base.mode.DesignModeContext; |
|
|
|
import com.fr.design.base.mode.DesignModeContext; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashSet; |
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author shine |
|
|
|
* @author shine |
|
|
|
* @version 10.0 |
|
|
|
* @version 10.0 |
|
|
@ -13,6 +16,19 @@ public class ChartEditContext { |
|
|
|
|
|
|
|
|
|
|
|
private static ChartEditMode current = ChartEditMode.NORMAL; |
|
|
|
private static ChartEditMode current = ChartEditMode.NORMAL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final Set<DuchampFeature> features = new HashSet<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 功能点枚举 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public enum DuchampFeature { |
|
|
|
|
|
|
|
SUPPORT_REPORT_DATA |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 切换图表编辑模式 |
|
|
|
|
|
|
|
* @param mode 图表编辑模式 |
|
|
|
|
|
|
|
*/ |
|
|
|
public static void switchTo(ChartEditMode mode) { |
|
|
|
public static void switchTo(ChartEditMode mode) { |
|
|
|
current = mode; |
|
|
|
current = mode; |
|
|
|
} |
|
|
|
} |
|
|
@ -33,4 +49,28 @@ public class ChartEditContext { |
|
|
|
public static boolean supportTheme() { |
|
|
|
public static boolean supportTheme() { |
|
|
|
return !DesignModeContext.isDuchampMode(); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|