Browse Source

Merge pull request #6976 in DESIGN/design from release/11.0 to feature/x

* commit 'f9f5997fc165278666f3e60f4f4172338528ee9b':
  CHART-22060 fix:fvs.cpt.chart 渲染使用的默认配色和配置界面默认不同 同fvs.chart指定配色
  REPORT-60163 公式编辑器优化2.0 1.优化错误提示 2.修改埋点逻辑
  REPORT-63524 【组件可更新提醒】组件复用-埋点,现在设计器端弹出可更新弹窗时没有触发埋点记录
  REPORT-63192 【组件可更新提醒】组件复用-设计器端生成组件弹窗的类型改为必填
  REPORT-63310 已保存的无边框tab块在绝对布局内调整组件大小后,自动生成了默认黑色边框 & REPORT-59963 调整Tab块样式会导致Tab标题背景色重置
feature/x
superman 3 years ago
parent
commit
daa03c8561
  1. 16
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  2. 9
      designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedCharFunction.java
  3. 38
      designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedTokenFunction.java
  4. 96
      designer-base/src/main/java/com/fr/design/formula/exception/function/TranslateTokenUtils.java
  5. 10
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  6. 12
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  7. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  8. 43
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java
  9. 66
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  10. 15
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  11. 16
      designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java
  12. 12
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java

16
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -341,7 +341,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
@Override @Override
public void focusGained(FocusEvent e) { public void focusGained(FocusEvent e) {
// 获得焦点时 安装 // 获得焦点时 安装
installAutoCompletion(); if (autoCompletion == null && autoCompletionCheck.isSelected()) {
installAutoCompletion();
}
} }
@Override @Override
@ -405,13 +407,11 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
} }
private void installAutoCompletion() { private void installAutoCompletion() {
if (autoCompletion == null && autoCompletionCheck.isSelected()) { CompletionProvider provider = createCompletionProvider();
CompletionProvider provider = createCompletionProvider(); autoCompletion = new FormulaPaneAutoCompletion(provider);
autoCompletion = new FormulaPaneAutoCompletion(provider); autoCompletion.setListCellRenderer(new CompletionCellRenderer());
autoCompletion.setListCellRenderer(new CompletionCellRenderer()); autoCompletion.install(formulaTextArea);
autoCompletion.install(formulaTextArea); autoCompletion.installVariableTree(variableTreeAndDescriptionArea);
autoCompletion.installVariableTree(variableTreeAndDescriptionArea);
}
} }

9
designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedCharFunction.java

@ -35,10 +35,6 @@ public class MismatchedCharFunction implements Function<Exception, FormulaCheckR
case 1: case 1:
sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": "); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ");
appendCharName(sb, charException.expecting); appendCharName(sb, charException.expecting);
sb.append(FormulaCheckConstants.COMMON)
.append(FormulaCheckConstants.BLANK)
.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"));
appendCharName(sb, charException.foundChar);
break; break;
case 2: case 2:
sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting_Anything") + ": ") sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting_Anything") + ": ")
@ -58,8 +54,6 @@ public class MismatchedCharFunction implements Function<Exception, FormulaCheckR
appendCharName(sb, charException.expecting); appendCharName(sb, charException.expecting);
sb.append(".."); sb.append("..");
appendCharName(sb, charException.upper); appendCharName(sb, charException.upper);
sb.append(", ").append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"));
appendCharName(sb, charException.foundChar);
break; break;
case 5: case 5:
case 6: case 6:
@ -71,9 +65,6 @@ public class MismatchedCharFunction implements Function<Exception, FormulaCheckR
for (int i = 0; i < elems.length; ++i) { for (int i = 0; i < elems.length; ++i) {
appendCharName(sb, elems[i]); appendCharName(sb, elems[i]);
} }
sb.append("), ").append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"));
appendCharName(sb, charException.foundChar);
break; break;
default: default:
sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_Char")); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_Char"));

38
designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedTokenFunction.java

@ -40,11 +40,7 @@ public class MismatchedTokenFunction implements Function<Exception, FormulaCheck
switch (exception.mismatchType) { switch (exception.mismatchType) {
case 1: case 1:
sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ") sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ")
.append(tokenName(exception.expecting, exception)) .append(tokenName(exception.expecting, exception));
.append(", ")
.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"))
.append(FormulaCheckConstants.BLANK + FormulaCheckConstants.SINGLE_QUOTES)
.append(tokenText).append("'");
break; break;
case 2: case 2:
sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting_Anything") + ": ") sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting_Anything") + ": ")
@ -59,9 +55,7 @@ public class MismatchedTokenFunction implements Function<Exception, FormulaCheck
.append(": ") .append(": ")
.append(tokenName(exception.expecting, exception)) .append(tokenName(exception.expecting, exception))
.append("..") .append("..")
.append(tokenName(exception.upper, exception)) .append(tokenName(exception.upper, exception));
.append(", ").append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"))
.append("'").append(tokenText).append("'");
break; break;
case 4: case 4:
sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ") sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ")
@ -71,12 +65,7 @@ public class MismatchedTokenFunction implements Function<Exception, FormulaCheck
.append(": ") .append(": ")
.append(tokenName(exception.expecting, exception)) .append(tokenName(exception.expecting, exception))
.append("..") .append("..")
.append(tokenName(exception.upper, exception)) .append(tokenName(exception.upper, exception));
.append(",").
append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"))
.append(" '")
.append(tokenText)
.append("'");
break; break;
case 5: case 5:
case 6: case 6:
@ -90,11 +79,6 @@ public class MismatchedTokenFunction implements Function<Exception, FormulaCheck
sb.append(tokenName(elms[i], exception)); sb.append(tokenName(elms[i], exception));
} }
sb.append("),")
.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"))
.append("'")
.append(tokenText)
.append("'");
break; break;
default: default:
sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_Token")); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_Token"));
@ -108,24 +92,10 @@ public class MismatchedTokenFunction implements Function<Exception, FormulaCheck
return "<Set of tokens>"; return "<Set of tokens>";
} else { } else {
String[] tokenNames = (String[]) getFieldValue(exception, "tokenNames"); String[] tokenNames = (String[]) getFieldValue(exception, "tokenNames");
return tokenType >= 0 && tokenType < tokenNames.length ? translateToken(tokenNames[tokenType]) : "<" + tokenType + ">"; return tokenType >= 0 && tokenType < tokenNames.length ? TranslateTokenUtils.translateToken(tokenNames[tokenType]) : "<" + tokenType + ">";
} }
} }
private String translateToken(String token) {
switch (token) {
case ("RPAREN"):
return ")";
case ("LPAREN"):
return "(";
case ("COMMA"):
return ",";
case ("COLON"):
return ":";
default:
return token;
}
}
private Object getFieldValue(Object object, String fieldName) { private Object getFieldValue(Object object, String fieldName) {
try { try {

96
designer-base/src/main/java/com/fr/design/formula/exception/function/TranslateTokenUtils.java

@ -0,0 +1,96 @@
package com.fr.design.formula.exception.function;
import com.fr.design.i18n.Toolkit;
/**
* @author Hoky
* @date 2021/11/30
*/
public class TranslateTokenUtils {
public static String translateToken(String token) {
switch (token) {
case ("RPAREN"):
return ")";
case ("LPAREN"):
return "(";
case ("COMMA"):
return ",";
case ("COLON"):
return ":";
case ("EOF"):
return Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_EOF");
case ("DOT"):
return ".";
case ("FLOT_NUM"):
return Toolkit.i18nText("Fine-Design_Basic_Formula_Float_Number");
case ("LOR"):
return "||";
case ("LAND"):
return "&&";
case ("EQUAL"):
return "=";
case ("EQUAL2"):
return "=";
case ("NOT_EQUAL"):
return "!=";
case ("NOT_EQUAL2"):
return "!=";
case ("GE"):
return ">=";
case ("LE"):
return "<=";
case ("LT"):
return "<";
case ("PLUS"):
return "+";
case ("MINUS"):
return "-";
case ("STAR"):
return "*";
case ("DIV"):
return "/";
case ("MOD"):
return "%";
case ("POWER"):
return "^";
case ("LNOT"):
return "!";
case ("WAVE"):
return "~";
case ("LBRACK"):
return "[";
case ("SEMI"):
return ";";
case ("RBRACK"):
return "]";
case ("LCURLY"):
return "{";
case ("RCURLY"):
return "}";
case ("DCOLON"):
return ";";
case ("INT_NUM"):
return Toolkit.i18nText("Fine-Design_Basic_Formula_Integer");
case ("CR_ADRESS"):
return "\n";
case ("SHARP"):
return "#";
case ("AT"):
return "@";
case ("QUESTION"):
return "?";
case ("BOR"):
return "||";
case ("BAND"):
return "&&";
case ("Char"):
return Toolkit.i18nText("Fine-Design_Basic_Formula_Character");
case ("DIGIT"):
return Toolkit.i18nText("Fine-Design_Basic_Formula_Digital");
case ("XDIGIT"):
return Toolkit.i18nText("Fine-Design_Basic_Formula_Hexadecimal_Digital");
default:
return token;
}
}
}

10
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -11,10 +11,9 @@ import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
@ -155,12 +154,7 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
} }
} }
if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { DefaultStyleHelper4Van.checkChartDefaultStyle4Duchamp(chart4Update);
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) chart4Update).setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
update(chart4Update); update(chart4Update);
} }

12
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -12,14 +12,13 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.ChartHyperEditPane; import com.fr.design.mainframe.chart.ChartHyperEditPane;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.config.DefaultStyleHelper4Van;
import java.util.HashMap;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.util.HashMap;
/** /**
* 类说明: 图表超链 -- 弹出 悬浮窗. * 类说明: 图表超链 -- 弹出 悬浮窗.
@ -73,12 +72,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
if (chart != null) { if (chart != null) {
try { try {
ChartProvider clone = (ChartProvider) chart.clone(); ChartProvider clone = (ChartProvider) chart.clone();
if (!ChartEditContext.supportTheme() && clone instanceof VanChart) { DefaultStyleHelper4Van.checkChartDefaultStyle4Duchamp(clone);
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) clone).setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
cc.addChart(clone); cc.addChart(clone);
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -18,11 +18,11 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane; import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
@ -155,12 +155,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
addButton.addActionListener((e) -> { addButton.addActionListener((e) -> {
String name = getNewChartName(); String name = getNewChartName();
ChartProvider chart = getChangeStateNewChart(); ChartProvider chart = getChangeStateNewChart();
if (!ChartEditContext.supportTheme() && chart instanceof VanChart) { DefaultStyleHelper4Van.checkChartDefaultStyle4Duchamp(chart);
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) chart).setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
checkInForm(chart); checkInForm(chart);
addNewChart(chart, name, editingCollection.getChartCount()); addNewChart(chart, name, editingCollection.getChartCount());
}); });

43
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java

@ -64,28 +64,39 @@ public class DefaultStyleConstants {
static final Background BACK = null; static final Background BACK = null;
//新特新
public static String COLOR_NAME_1;
//经典高亮
private static String COLOR_NAME_2;
static {
try {
COLOR_NAME_1 = CodeUtils.cjkDecode("\u65b0\u7279\u6027");
COLOR_NAME_2 = CodeUtils.cjkDecode("\u7ecf\u5178\u9ad8\u4eae");
} catch (Exception e) {
e.printStackTrace();
}
}
static String COLORS = null; static String COLORS = null;
static { static {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
try {
DefaultStyleConstants.COLORS = CodeUtils.cjkDecode("\u7ecf\u5178\u9ad8\u4eae"); COLORS = COLOR_NAME_2;
// 没有经典高亮, 用新特性 // 没有经典高亮, 用新特性
if (config.getPreStyle(DefaultStyleConstants.COLORS) == null) { if (config.getPreStyle(COLORS) == null) {
DefaultStyleConstants.COLORS = CodeUtils.cjkDecode("\u65b0\u7279\u6027"); COLORS = COLOR_NAME_1;
} }
// 没有新特性, 用第一个配色 // 没有新特性, 用第一个配色
if (config.getPreStyle(DefaultStyleConstants.COLORS) == null) { if (config.getPreStyle(COLORS) == null) {
if (config.names().hasNext()) { if (config.names().hasNext()) {
String name = GeneralUtils.objectToString(config.names().next()); String name = GeneralUtils.objectToString(config.names().next());
if (config.getPreStyle(name) != null) { if (config.getPreStyle(name) != null) {
DefaultStyleConstants.COLORS = name; COLORS = name;
}
} }
} }
} catch (Exception e) {
e.printStackTrace();
} }
} }
} }

66
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -1,11 +1,14 @@
package com.fr.van.chart.config; package com.fr.van.chart.config;
import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig;
import com.fr.chart.base.AttrBorder; import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
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.DataSheet; import com.fr.chart.chartglyph.DataSheet;
import com.fr.chartx.attr.ChartProvider;
import com.fr.config.predefined.ColorFillStyle; import com.fr.config.predefined.ColorFillStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.PiePlot4VanChart;
@ -19,6 +22,7 @@ import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.plugin.chart.vanchart.VanChart;
/** /**
* @author shine * @author shine
@ -28,8 +32,27 @@ import com.fr.plugin.chart.type.GaugeStyle;
*/ */
public class DefaultStyleHelper4Van { public class DefaultStyleHelper4Van {
private static boolean duchampMode() {
try {
return ChartEditContext.duchampMode();
} catch (Throwable e) {
//tomcat预览 默认数据的图表
return true;
}
}
public static void checkChartDefaultStyle4Duchamp(ChartProvider chartProvider) {
if (!ChartEditContext.supportTheme() && chartProvider instanceof VanChart) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) chartProvider).setThemeCustom();
dealChartColor((VanChart) chartProvider);
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
}
public static void dealVanPlot4Custom(VanChartPlot plot, CustomPlotType customPlotType) { public static void dealVanPlot4Custom(VanChartPlot plot, CustomPlotType customPlotType) {
if (!ChartEditContext.duchampMode()) { if (!duchampMode()) {
return; return;
} }
dealVanPlotCommonAttr(plot); dealVanPlotCommonAttr(plot);
@ -60,7 +83,7 @@ public class DefaultStyleHelper4Van {
} }
public static VanChartAxis dealAxisDefault(VanChartAxis axis) { public static VanChartAxis dealAxisDefault(VanChartAxis axis) {
if (!ChartEditContext.duchampMode()) { if (!duchampMode()) {
return axis; return axis;
} }
axis.getTitle().getTextAttr().setFRFont(DefaultStyleConstants.AXIS_TITLE); axis.getTitle().getTextAttr().setFRFont(DefaultStyleConstants.AXIS_TITLE);
@ -71,28 +94,20 @@ public class DefaultStyleHelper4Van {
} }
public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) { public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) {
if (!ChartEditContext.duchampMode()) { if (!duchampMode()) {
return; return;
} }
vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT); vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT);
} }
static void dealVanPlotCommonAttr(Plot plot) { static void dealVanPlotCommonAttr(Plot plot) {
if (!ChartEditContext.duchampMode()) { if (!duchampMode()) {
return; return;
} }
if (plot instanceof VanChartPlot) { if (plot instanceof VanChartPlot) {
VanChartPlot vanChartPlot = (VanChartPlot) plot; VanChartPlot vanChartPlot = (VanChartPlot) plot;
ColorFillStyle colorFillStyle = new ColorFillStyle(); dealChartColor(vanChartPlot);
colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC);
colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS);
AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle();
if (plotFillStyle == null) {
plotFillStyle = new AttrFillStyle();
vanChartPlot.setPlotFillStyle(plotFillStyle);
}
plotFillStyle.setColorFillStyle(colorFillStyle);
if (vanChartPlot.getLegend() != null) { if (vanChartPlot.getLegend() != null) {
vanChartPlot.getLegend().setFRFont(DefaultStyleConstants.LEGEND); vanChartPlot.getLegend().setFRFont(DefaultStyleConstants.LEGEND);
@ -118,6 +133,31 @@ public class DefaultStyleHelper4Van {
} }
private static void dealChartColor(VanChart vanChart) {
dealChartColor(vanChart.getPlot());
}
private static void dealChartColor(VanChartPlot vanChartPlot) {
ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance();
Object preStyle = manager.getPreStyle(DefaultStyleConstants.COLORS);
if (preStyle instanceof ChartColorMatching) {
ColorFillStyle colorFillStyle = new ColorFillStyle();
//default是默认的意思,为服务器默认配色方案
//acc为多个颜色组合
//gradient为渐变颜色
colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC);
colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS);
colorFillStyle.setColorList(((ChartColorMatching) preStyle).getColorList());
AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle();
if (plotFillStyle == null) {
plotFillStyle = new AttrFillStyle();
vanChartPlot.setPlotFillStyle(plotFillStyle);
}
plotFillStyle.setColorFillStyle(colorFillStyle);
}
}
private static void dealBorder(VanChartPlot vanChartPlot) { private static void dealBorder(VanChartPlot vanChartPlot) {
ConditionAttr defaultAttr = vanChartPlot.getConditionCollection().getDefaultAttr(); ConditionAttr defaultAttr = vanChartPlot.getConditionCollection().getDefaultAttr();
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class); AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);

15
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -32,6 +32,7 @@ import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom; import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -145,12 +146,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
chart.setPlot(cloneOldPlot2New(oldPlot, newPlot)); chart.setPlot(cloneOldPlot2New(oldPlot, newPlot));
resetChartAttr4SamePlot(chart); resetChartAttr4SamePlot(chart);
ChartInfoCollector.getInstance().updateChartMiniType(chart); ChartInfoCollector.getInstance().updateChartMiniType(chart);
if (!ChartEditContext.supportTheme()) { DefaultStyleHelper4Van.checkChartDefaultStyle4Duchamp(chart);
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
chart.setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
} else if (!samePlot) { } else if (!samePlot) {
//不同的图表类型切換 //不同的图表类型切換
resetChartAttr(chart, newPlot); resetChartAttr(chart, newPlot);
@ -158,12 +154,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
newPlot.setCategoryNum(oldPlot.getCategoryNum()); newPlot.setCategoryNum(oldPlot.getCategoryNum());
//切换类型埋点 //切换类型埋点
ChartInfoCollector.getInstance().updateChartTypeTime(chart, oldPlot.getPlotID()); ChartInfoCollector.getInstance().updateChartTypeTime(chart, oldPlot.getPlotID());
if (!ChartEditContext.supportTheme()) { DefaultStyleHelper4Van.checkChartDefaultStyle4Duchamp(chart);
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
chart.setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
} }
if (!ChartEditContext.supportTheme()) { if (!ChartEditContext.supportTheme()) {
chart.setAutoThemeCustom(); chart.setAutoThemeCustom();

16
designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java

@ -23,6 +23,22 @@ public class CardTagLayoutStylePane extends LayoutStylePane {
return super.createNamedIntegralStylePane(isRootLayout, false); return super.createNamedIntegralStylePane(isRootLayout, false);
} }
private LayoutBorderStyle backupStyleFromPopulating = new LayoutBorderStyle();
@Override
public void populateBean(LayoutBorderStyle style) {
this.backupStyleFromPopulating = style;
super.populateBean(style);
}
@Override
public LayoutBorderStyle updateBean() {
LayoutBorderStyle style = super.updateBean();
style.setTitle(backupStyleFromPopulating.getTitle());
style.setType(backupStyleFromPopulating.getType());
return style;
}
@Override @Override
public void populateBean(LayoutBorderStyle style) { public void populateBean(LayoutBorderStyle style) {
this.backupStyleFromPopulating = style; this.backupStyleFromPopulating = style;

12
designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java

@ -393,15 +393,19 @@ public class LocalWidgetRepoPane extends BasicPane {
public void onFetchedAfter(boolean success, Map<String, OnlineShareWidget> remoteLatestWidgets) { public void onFetchedAfter(boolean success, Map<String, OnlineShareWidget> remoteLatestWidgets) {
if (success) { if (success) {
List<SharableWidgetProvider> updatableWidgetProviders = LocalWidgetRepoUpdater.getInstance().getUpdatableWidgetProviders(); List<SharableWidgetProvider> updatableWidgetProviders = LocalWidgetRepoUpdater.getInstance().getUpdatableWidgetProviders();
updateTipPane.setVisible(updatableWidgetProviders.size() > 0); onRemoteWidgetUpdatesChanged(updatableWidgetProviders.size() > 0);
if (updatableWidgetProviders.size() > 0) {
refreshAllGroupPane(GroupPane.GroupCreateStrategy.DEFAULT);
}
} }
} }
}); });
} }
public void onRemoteWidgetUpdatesChanged(boolean hasUpdates) {
updateTipPane.setVisible(hasUpdates);
if (hasUpdates) {
refreshAllGroupPane(GroupPane.GroupCreateStrategy.DEFAULT);
}
}
public void doQuitUpdateComponents() { public void doQuitUpdateComponents() {
LocalWidgetRepoUpdater updater = LocalWidgetRepoUpdater.getInstance(); LocalWidgetRepoUpdater updater = LocalWidgetRepoUpdater.getInstance();
updater.clearUpdate(); updater.clearUpdate();

Loading…
Cancel
Save