From 7890ad0d1b8c1a524066f5b88fb0a50e07976fe5 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 9 Sep 2021 09:54:18 +0800 Subject: [PATCH 01/12] =?UTF-8?q?REPORT-59097=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E6=82=AC=E6=B5=AE=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E9=BB=98=E8=AE=A4=E6=A0=B7=E5=BC=8F=EF=BC=8C=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=98=AF=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 设计器创建的悬浮元素样式均为当前模版主题中的"默认"样式 【改动思路】 同标题 --- .../utils/DefaultThemedFloatElement.java | 41 +++++++++++++++++++ .../actions/insert/flot/ChartFloatAction.java | 3 +- .../insert/flot/FormulaFloatAction.java | 3 +- .../actions/insert/flot/ImageFloatAction.java | 3 +- .../insert/flot/TextBoxFloatAction.java | 3 +- 5 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java new file mode 100644 index 000000000..e1e2e4c15 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java @@ -0,0 +1,41 @@ +package com.fr.design.mainframe.theme.utils; + +import com.fr.base.NameStyle; +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.settings.ThemedCellStyle; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.JTemplate; +import com.fr.report.cell.FloatElement; +import com.fr.stable.unit.UNIT; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/9 + */ +public class DefaultThemedFloatElement { + public static FloatElement createInstance() { + return themingFloatElement(new FloatElement()); + } + + public static FloatElement createInstance(Object value) { + return themingFloatElement(new FloatElement(value)); + } + + public static FloatElement createInstance(UNIT leftDistance, UNIT topDistance, UNIT width, UNIT height, Object value) { + return themingFloatElement(new FloatElement(leftDistance, topDistance, width, height, value)); + } + + private static FloatElement themingFloatElement(FloatElement floatElement) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template != null) { + TemplateTheme theme = template.getTemplateTheme(); + ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default(); + if (themedCellStyle != null) { + NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle()); + floatElement.setStyle(nameStyle); + } + } + return floatElement; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java index 67fcaae59..58292bbf2 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java @@ -13,6 +13,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement; import com.fr.design.menu.MenuKeySet; import com.fr.design.module.DesignModuleFactory; import com.fr.grid.Grid; @@ -90,7 +91,7 @@ public class ChartFloatAction extends ElementCaseAction { public void doOk() { isRecordNeeded = true; FloatElement newFloatElement; - newFloatElement = new FloatElement(chartDialog.getChartCollection()); + newFloatElement = DefaultThemedFloatElement.createInstance(chartDialog.getChartCollection()); newFloatElement.setWidth(new OLDPIX(BaseChartCollection.CHART_DEFAULT_WIDTH)); newFloatElement.setHeight(new OLDPIX(BaseChartCollection.CHART_DEFAULT_HEIGHT)); diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java index 9cbd7e876..dbd9d4be6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java @@ -14,6 +14,7 @@ import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement; import com.fr.design.menu.MenuKeySet; import com.fr.grid.Grid; @@ -99,7 +100,7 @@ public class FormulaFloatAction extends ElementCaseAction { } reportPane.stopEditing(); - final FloatElement floatElement = new FloatElement(); + final FloatElement floatElement = DefaultThemedFloatElement.createInstance(); final UIFormula formulaPane = FormulaFactory.createFormulaPane(); formulaPane.populate(BaseFormula.createFormulaBuilder().build()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java index e514c88df..7eb9146ea 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java @@ -12,6 +12,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement; import com.fr.design.menu.MenuKeySet; import com.fr.design.report.SelectImagePane; @@ -73,7 +74,7 @@ public class ImageFloatAction extends ElementCaseAction { reportPane.stopEditing(); - final FloatElement floatElement = new FloatElement(); + final FloatElement floatElement = DefaultThemedFloatElement.createInstance(); final SelectImagePane selectImagePane = new SelectImagePane(); selectImagePane.populate(floatElement); diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java index 82aa17f2d..26aad41e2 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java @@ -6,6 +6,7 @@ package com.fr.design.actions.insert.flot; import com.fr.base.DynamicUnitList; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement; import com.fr.design.menu.MenuKeySet; import com.fr.grid.Grid; @@ -59,7 +60,7 @@ public class TextBoxFloatAction extends AbstractShapeAction { if (jws == null) { return; } - FloatElement floatElement = new FloatElement("Text"); + FloatElement floatElement = DefaultThemedFloatElement.createInstance("Text"); this.startDraw(floatElement); doWithDrawingFloatElement(); } From 990885a22ee4a9178a69ee8bea10238061fe99d9 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Sep 2021 14:19:30 +0800 Subject: [PATCH 02/12] =?UTF-8?q?REPORT-59063=20CRM=20=E5=86=85=E5=AD=98?= =?UTF-8?q?=E9=87=8C=E6=8A=A5=E8=A1=A8=E5=9D=97=E7=BC=A9=E7=95=A5=E5=9B=BE?= =?UTF-8?q?=E5=8D=A0=E7=94=A8=E5=86=85=E5=AD=98=E5=A4=AA=E5=A4=A7=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/app/FormApp.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java index f28e2c984..286890303 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java @@ -21,6 +21,8 @@ import com.fr.form.main.Form; import com.fr.form.ui.container.WBorderLayout; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.report.util.ReadXmlType; +import com.fr.report.util.ReadXmlTypeLocalManager; import com.fr.stable.Constants; import com.fr.stable.bridge.StableFactory; import org.jetbrains.annotations.Nullable; @@ -90,13 +92,16 @@ class FormApp extends AbstractAppProvider { @Nullable private Form getForm(FILE tplFile) { + ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN); Form form = asIOFile(tplFile); + ReadXmlTypeLocalManager.remove(); if (form != null) { DesignerAppUtils.dealWithTemplateIOError(tplFile.getPath()); } return form; } + @Override public Form asIOFile(FILE file) { From 80af035ce63bd01f092556ce21ec0386d9c2226a Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 9 Sep 2021 15:43:34 +0800 Subject: [PATCH 03/12] =?UTF-8?q?REPORT-51919=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E5=A4=8D=E7=94=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=80=82=E9=85=8D=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 创建复用组件时新增适用于复用组件模版主题的字段,值为当前模版的主题名称 2. 使用复用组件时,仅复用组件内元素设置了跟随主题,且复用组件适用的模版主题名称与 当前模版名称相同时,才设置主题样式 【改动思路】 同标题 --- .../designer/creator/XCreatorUtils.java | 36 +++++++++++++++++++ .../com/fr/design/mainframe/FormDesigner.java | 36 ------------------- .../share/generate/task/ComponentCreator.java | 10 ++++++ .../share/ui/block/LocalWidgetBlock.java | 3 +- .../share/ui/block/OnlineWidgetBlock.java | 9 ++++- .../share/util/ShareComponentUtils.java | 16 +++++++++ 6 files changed, 72 insertions(+), 38 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 945d3bfdd..6e44ad196 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -3,6 +3,11 @@ */ package com.fr.design.designer.creator; +import com.fr.base.theme.FineColorManager; +import com.fr.base.theme.FormTheme; +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.TemplateThemeAware; +import com.fr.base.theme.TemplateThemeCompatible; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.creator.cardlayout.XCardAddButton; import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; @@ -11,11 +16,15 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fun.ChartWidgetOptionProvider; import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.fun.ParameterWidgetOptionProvider; +import com.fr.design.mainframe.JTemplate; import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.LayoutUtils; +import com.fr.form.main.Form; +import com.fr.form.main.WidgetGather; import com.fr.form.parameter.FormSubmitButton; import com.fr.form.ui.Button; import com.fr.form.ui.CardAddButton; @@ -216,6 +225,16 @@ public class XCreatorUtils { return xClazz; } + public static XCreator createThemedXCreator(Widget widget) { + XCreator creator = createXCreator(widget); + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + TemplateTheme theme = template.getTemplateTheme(); + if (theme instanceof FormTheme) { + setupTemplateTheme(creator, (FormTheme) theme, TemplateThemeCompatible.NONE); + } + return creator; + } + /** * 创建creator * @@ -356,4 +375,21 @@ public class XCreatorUtils { } return null; } + + public static void setupTemplateTheme(XCreator container, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) { + FineColorManager.traverse(container.toData(), new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible)); + + Form.traversalWidget(container.toData(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + TemplateThemeAware themedWidget = (TemplateThemeAware) widget; + themedWidget.onTemplateUsingThemeChange(currentTemplateUsingTheme, compatible); + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, TemplateThemeAware.class); + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 636f1f548..cbe9e87e6 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1195,9 +1195,6 @@ public class FormDesigner extends TargetComponent
implements TreeSelection * @param xCreator 组件 */ public void startDraggingBean(XCreator xCreator) { - - // 新疆的图表块和报表块默认主题化 - addThemeToDroppedNewWidget(xCreator); // 根据所选择的组件的BeanInfo生成相应的AddingModel // AddingModel和StateModel不一样,适合当前选择的组件相关的 addingModel = new AddingModel(this, xCreator); @@ -1862,37 +1859,4 @@ public class FormDesigner extends TargetComponent implements TreeSelection public FormSpacingLineDrawer getSpacingLineDrawer() { return spacingLineDrawer; } - - private void addThemeToDroppedNewWidget(XCreator addingXCreator) { - JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (template == null) { - return; - } - TemplateTheme theme = template.getTemplateTheme(); - if (!(theme instanceof FormTheme)) { - return; - } - FormTheme formTheme = (FormTheme) theme; - - Form.traversalWidget(addingXCreator.toData(), new WidgetGather() { - @Override - public void dealWith(Widget widget) { - if (widget instanceof AbstractBorderStyleWidget) { - AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) widget; - if (!styleWidget.supportThemed()) { - return; - } - - boolean followingTheme = (!addingXCreator.isShared()) || styleWidget.isBorderStyleFollowingTheme(); - styleWidget.setBorderStyleFollowingTheme(followingTheme); - if (followingTheme) { - styleWidget.onTemplateUsingThemeChange(formTheme, TemplateThemeCompatible.NONE); - } - } - } - @Override - public boolean dealWithAllCards() { return true; } - }, AbstractBorderStyleWidget.class); - addingXCreator.rebuid(); - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java index b14229df6..126660665 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.share.generate.task; import com.fr.base.TableData; import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.base.iofile.attr.SharableAttrMark; +import com.fr.base.theme.TemplateTheme; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.share.generate.impl.AbstractComponentCreatorProcessor; @@ -39,6 +40,8 @@ public class ComponentCreator extends AbstractComponentCreatorProcessor { @Override public ComponentReuBean create(JTemplate jt, Map paraMap, Widget widget, DefaultSharableWidget info) throws Exception { + // 适用于共享组件的模版主题 + setSuitableTemplateThemeName(jt, info); // 遍历判断是否存在共享组件 checkOriginStatus(widget, info); @@ -56,6 +59,13 @@ public class ComponentCreator extends AbstractComponentCreatorProcessor { return new ComponentReuBean(generatePath, editor, info); } + private void setSuitableTemplateThemeName(JTemplate jt, DefaultSharableWidget info) { + TemplateTheme theme = jt.getTemplateTheme(); + if (theme != null) { + info.setSuitableTemplateThemeName(theme.getName()); + } + } + protected void checkOriginStatus(Widget widget, final DefaultSharableWidget info) { Form.traversalWidget(widget, new WidgetGatherAdapter() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java index 911ff7b77..d92755502 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java @@ -211,7 +211,8 @@ public class LocalWidgetBlock extends PreviewWidgetBlock creatorSource.setWidgetID(UUID.randomUUID().toString()); ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); //tab布局WCardMainBorderLayout通过反射出来的大小是960*480 - XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, no.getBindInfo()); + String suitableTemplateThemeName = no.getWidget().getSuitableTemplateThemeName(); + XCreator xCreator = ShareComponentUtils.createThemedXCreator(creatorSource, suitableTemplateThemeName, shareId, no.getBindInfo()); WidgetToolBarPane.getTarget().startDraggingBean(xCreator); lastPressEvent = null; this.setBorder(null); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java index b8cb0e678..8ad419b03 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -12,6 +12,7 @@ import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.WidgetToolBarPane; import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.form.share.DefaultSharableWidget; import com.fr.form.share.group.DefaultShareGroup; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; @@ -143,7 +144,13 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(shareId); //tab布局WCardMainBorderLayout通过反射出来的大小是960*480 - XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, bindInfo); + XCreator xCreator; + if (bindInfo instanceof DefaultSharableWidget) { + String suitableTemplateThemeName = ((DefaultSharableWidget) bindInfo).getSuitableTemplateThemeName(); + xCreator = ShareComponentUtils.createThemedXCreator(creatorSource, suitableTemplateThemeName, shareId, bindInfo); + } else { + xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, bindInfo); + } WidgetToolBarPane.getTarget().startDraggingBean(xCreator); lastPressEvent = null; this.setBorder(null); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java index 80162a406..72418b86b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java @@ -2,6 +2,9 @@ package com.fr.design.mainframe.share.util; import com.fr.base.io.IOFile; import com.fr.base.iofile.attr.ExtendSharableAttrMark; +import com.fr.base.theme.FormTheme; +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.TemplateThemeCompatible; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; @@ -50,6 +53,19 @@ public class ShareComponentUtils { return xCreator; } + public static XCreator createThemedXCreator(Widget creatorSource, String suitableTemplateThemeName, String shareId, SharableWidgetProvider provider) { + XCreator creator = createXCreator(creatorSource, shareId, provider); + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + TemplateTheme theme = template.getTemplateTheme(); + if (theme instanceof FormTheme) { + boolean isCurrentUsingThemeSuitSharedComponent = StringUtils.isNotEmpty(theme.getName()) && + StringUtils.isNotEmpty(suitableTemplateThemeName) && + StringUtils.equals(theme.getName(), suitableTemplateThemeName); + XCreatorUtils.setupTemplateTheme(creator, (FormTheme) theme, isCurrentUsingThemeSuitSharedComponent ? TemplateThemeCompatible.NONE : TemplateThemeCompatible.ABSENT); + } + return creator; + } + /** * 检查readme.txt文件 */ From f1f0904388b55826b3f2cf21f65450dcfb9c4c19 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Sep 2021 17:13:40 +0800 Subject: [PATCH 04/12] =?UTF-8?q?REPORT-58207=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8E=9F=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97-mac=E6=8F=92=E5=85=A5=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=97=B6=E4=BC=9A=E5=87=BA=E7=8E=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8=E5=BC=B9=E7=AA=97=E8=A2=AB?= =?UTF-8?q?=E9=81=AE=E7=9B=96=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java index 8be467810..58693d09a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java @@ -67,6 +67,7 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { fileChooserParent = DesignerContext.getDesignerFrame(); } Stage stage = showCoverStage(fileChooserParent); + stage.setAlwaysOnTop(true); try { if (fileSelectionMode == FileSelectionMode.FILE || fileSelectionMode == FileSelectionMode.MULTIPLE_FILE) { FileChooser fileChooser = new FileChooser(); From aebb0df1ce7aee3860f8f3eb2ce21628e73f30f6 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Sep 2021 17:17:25 +0800 Subject: [PATCH 05/12] =?UTF-8?q?REPORT-58207=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8E=9F=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97-mac=E6=8F=92=E5=85=A5=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=97=B6=E4=BC=9A=E5=87=BA=E7=8E=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8=E5=BC=B9=E7=AA=97=E8=A2=AB?= =?UTF-8?q?=E9=81=AE=E7=9B=96=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java index 58693d09a..452deb5c8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java @@ -67,7 +67,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { fileChooserParent = DesignerContext.getDesignerFrame(); } Stage stage = showCoverStage(fileChooserParent); - stage.setAlwaysOnTop(true); + if (stage != null) { + stage.setAlwaysOnTop(true); + } try { if (fileSelectionMode == FileSelectionMode.FILE || fileSelectionMode == FileSelectionMode.MULTIPLE_FILE) { FileChooser fileChooser = new FileChooser(); From 8feffddfc00ecc852037a11920a92dfe471b4093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 10 Sep 2021 11:59:07 +0800 Subject: [PATCH 06/12] =?UTF-8?q?REPORT-59237=20=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=A4=E6=96=AD=E7=BB=98=E5=88=B6=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E7=BA=BF=E7=9A=84=E5=9C=B0=E6=96=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/FormSpacingLineDrawer.java | 33 ++++--------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index 1ed4c6cca..005a750c4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -137,43 +137,22 @@ public class FormSpacingLineDrawer { GraphDrawHelper.drawString(g2d, text, labelX, labelY); } - private boolean isSelectedParaComponent() { - return designer.getParaComponent() == selectedCreator; - } - - private boolean isSelectedRootComponent() { - return designer.isRoot(selectedCreator); - } - - private boolean isSelectedForm() { - return selectedCreator.getParent() == null; - } - private boolean isNeedExtendedLine(AbstractFormParallelLine[] nearestSides) { return nearestSides[0].isVerticalCenterLineBeforeTheParallelLine(nearestSides[1]) || nearestSides[0].isVerticalCenterLineBehindTheParallelLine(nearestSides[1]); } - private boolean isSelectedRootPane() { - // form、body、para这三个选中了,都不要画任何间距线 - return isSelectedForm() || isSelectedRootComponent() || isSelectedParaComponent(); - } - // 当前组件是否在参数面板里面 - private boolean isCompInBody(XCreator creator) { + private boolean isComponentInBody(XCreator creator) { XLayoutContainer container = XCreatorUtils.getHotspotContainer(creator); return container != null && !container.acceptType(XWParameterLayout.class); } - private boolean isSelectedCompInBody() { - return isCompInBody(selectedCreator); - } - - private boolean isHoveredCompInBody() { - return isCompInBody(hoverCreator); + private boolean isSelectedComponentInBody() { + return isComponentInBody(selectedCreator); } - private boolean isCompInBody() { - return isSelectedCompInBody() && isHoveredCompInBody(); + private boolean isHoveredComponentInBody() { + return isComponentInBody(hoverCreator); } private boolean isBodyAbsoluteLayout() { @@ -185,7 +164,7 @@ public class FormSpacingLineDrawer { } private boolean isDrawSpacingLine() { - return isInAbsoluteLayout() && !isSelectedRootPane() && isCompInBody(); + return isInAbsoluteLayout() && isSelectedComponentInBody() && isHoveredComponentInBody(); } private AbstractFormParallelLine[] getNearestHorizontalSide() { From cdf36ae6c31887b9228850ebe266452f597eb9ca Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Sep 2021 14:15:41 +0800 Subject: [PATCH 07/12] =?UTF-8?q?REPORT-58991=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85-=E6=A8=A1=E6=9D=BF=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E5=8F=AF=E6=BB=9A=E5=8A=A8-=E7=82=B9=E5=87=BB=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=BC=96=E8=BE=91-=E4=B8=8D=E5=9C=A8=E8=A7=86?= =?UTF-8?q?=E7=BA=BF=E5=86=85=E7=9A=84=E7=BB=84=E4=BB=B6=EF=BC=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=94=81=E5=AE=9A=E4=BD=8D=E7=BD=AE=E6=9C=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/designer/creator/XCreator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index e82528558..87a1926cb 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -787,7 +787,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo int formDesignerWidth = designer.getWidth(); int formDesignerHeight = designer.getHeight(); // 不超过可绘制区域 - int extraX = Math.min(creatorRightX, formDesignerWidth); + int extraX = creatorRightX < 0 ? 0 : Math.min(creatorRightX, formDesignerWidth); int extraY = creatorRightY < 0 ? 0 : Math.min(creatorRightY, formDesignerHeight); if (designer.isFormParaDesigner() && extraY + this.getHeight() >= formDesignerHeight) { From 1f031e4b7247431044d4e9110e9e4ecf6b175a94 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 10 Sep 2021 14:22:03 +0800 Subject: [PATCH 08/12] =?UTF-8?q?REPORT-57898=20=E3=80=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E3=80=91=E8=BF=9B=E5=85=A5=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=97=B6=E6=89=93=E5=BC=80frm/?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF/=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E5=86=8D=E5=9B=9E=E5=88=B0=E5=8E=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/base/mode/DesignModeContext.java | 11 +++++- .../com/fr/design/base/mode/DesignerMode.java | 20 +++++++++-- .../design/file/HistoryTemplateListCache.java | 7 ++-- .../fr/design/mainframe/DesignerFrame.java | 13 +++++-- .../roleAuthority/RolesEditedSourceOP.java | 35 ++++++++++--------- 5 files changed, 60 insertions(+), 26 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java b/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java index 1352833e6..8bb586271 100644 --- a/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java +++ b/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java @@ -10,7 +10,15 @@ public class DesignModeContext { private static DesignerMode mode = DesignerMode.NORMAL; public static void switchTo(DesignerMode mode) { - DesignModeContext.mode = mode; + changeMode(DesignModeContext.mode, mode); + } + + private static void changeMode(DesignerMode oldMode, DesignerMode newMode) { + if (oldMode != newMode) { + DesignModeContext.mode = newMode; + oldMode.closeMode(); + newMode.openMode(); + } } public static DesignerMode getMode() { @@ -40,6 +48,7 @@ public class DesignModeContext { * @return 是否为权限编辑 */ public static boolean isAuthorityEditing() { + //System.out.println("isAuthorityEditing:"+(mode == AUTHORITY)); return mode == AUTHORITY; } diff --git a/designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java b/designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java index d3dc1e5f4..3ca798f2f 100644 --- a/designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java +++ b/designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java @@ -1,9 +1,25 @@ package com.fr.design.base.mode; + +import com.fr.design.mainframe.DesignerContext; + public enum DesignerMode { NORMAL, BAN_COPY_AND_CUT, VCS, - AUTHORITY, - DUCHAMP + AUTHORITY { + @Override + public void closeMode() { + DesignerContext.getDesignerFrame().closeAuthorityMode(); + } + }, + DUCHAMP; + + public void openMode() { + + } + + public void closeMode() { + } + } diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index f7d4d1f57..52fb1bcfa 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -4,6 +4,7 @@ import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.io.BaseBook; import com.fr.design.DesignerEnvManager; import com.fr.design.base.mode.DesignModeContext; +import com.fr.design.base.mode.DesignerMode; import com.fr.design.data.DesignTableDataManager; import com.fr.design.file.filter.ClassFilter; import com.fr.design.i18n.Toolkit; @@ -69,7 +70,7 @@ public class HistoryTemplateListCache implements CallbackEvent { DesignTableDataManager.closeTemplate(selected); //直接关闭模板的时候(当且仅当设计器tab上只剩一个模板)退出权限编辑 if (DesignModeContext.isAuthorityEditing() && historyList.size() <= 1) { - DesignerContext.getDesignerFrame().closeAuthorityEditing(); + DesignModeContext.switchTo(DesignerMode.NORMAL); } if (contains(selected) == -1) { return; @@ -430,13 +431,13 @@ public class HistoryTemplateListCache implements CallbackEvent { */ @Deprecated public void reloadCurrentTemplate() { - reloadAllEditingTemplate(); + reloadAllEditingTemplate(); } /** * 重绘当前模板 */ - public void repaintCurrentEditingTemplate(){ + public void repaintCurrentEditingTemplate() { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index bacf1d5b3..8c9c3afdf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -9,6 +9,7 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.base.mode.DesignModeContext; +import com.fr.design.base.mode.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; @@ -219,7 +220,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta @Override public void mouseReleased(MouseEvent e) { if (DesignModeContext.isAuthorityEditing()) { - closeAuthorityEditing(); + DesignModeContext.switchTo(DesignerMode.NORMAL); } } @@ -299,8 +300,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().doResize(); } + @Deprecated public void closeAuthorityEditing() { - DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL); + DesignModeContext.switchTo(DesignerMode.NORMAL); + } + + public void closeAuthorityMode() { WestRegionContainerPane.getInstance().replaceDownPane( TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); @@ -312,6 +317,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this); } + /** * 注册app. * @@ -982,6 +988,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @date 2014-10-14-下午6:31:05 */ private void openFile(FILE tplFile) { + DesignModeContext.switchTo(DesignerMode.NORMAL); //切换文件后清空FixedPopupPane面板 EastRegionContainerPane.getInstance().clearCurrentPopupPane(); if (tplFile != null) { @@ -1038,7 +1045,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jt != null) { + if (jt != null) { DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); } diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java b/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java index a21cd20e7..60025e032 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java @@ -18,21 +18,22 @@ import java.util.Map; */ public class RolesEditedSourceOP extends RoleSourceOP { - protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map map) { - List roleList = new ArrayList(); - Iterator> entryIt = map.entrySet().iterator(); - while (entryIt.hasNext()) { - Map.Entry entry = entryIt.next(); - RoleDataWrapper t = entry.getValue(); - - JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget(); - - ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet())); - for (ExpandMutableTreeNode expandMutableTreeNode : expand) { - roleList.add(expandMutableTreeNode); - } - } - return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); - } + protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map map) { + List roleList = new ArrayList(); + Iterator> entryIt = map.entrySet().iterator(); + while (entryIt.hasNext()) { + Map.Entry entry = entryIt.next(); + RoleDataWrapper t = entry.getValue(); + + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jt.getTarget() instanceof PrivilegeEditedRoleProvider) { + PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget(); + ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet())); + for (ExpandMutableTreeNode expandMutableTreeNode : expand) { + roleList.add(expandMutableTreeNode); + } + } + } + return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); + } } \ No newline at end of file From c7991b85406af1f28374b77d497e5e1709e32ccc Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 10 Sep 2021 14:41:20 +0800 Subject: [PATCH 09/12] =?UTF-8?q?REPORT-57898=20=E3=80=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E3=80=91=E8=BF=9B=E5=85=A5=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=97=B6=E6=89=93=E5=BC=80frm/?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF/=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E5=86=8D=E5=9B=9E=E5=88=B0=E5=8E=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 8c9c3afdf..798441c53 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -802,6 +802,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @param jt 添加的模板. */ public void addAndActivateJTemplate(JTemplate jt) { + DesignModeContext.switchTo(DesignerMode.NORMAL); JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (currentEditingTemplate != null) { currentEditingTemplate.stopEditing(); @@ -988,7 +989,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @date 2014-10-14-下午6:31:05 */ private void openFile(FILE tplFile) { - DesignModeContext.switchTo(DesignerMode.NORMAL); //切换文件后清空FixedPopupPane面板 EastRegionContainerPane.getInstance().clearCurrentPopupPane(); if (tplFile != null) { From eb2ea8eccf54c9979f0fa01270bcd7b8b55a9849 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 10 Sep 2021 16:50:21 +0800 Subject: [PATCH 10/12] =?UTF-8?q?REPORT-57898=20=E3=80=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E3=80=91=E8=BF=9B=E5=85=A5=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=97=B6=E6=89=93=E5=BC=80frm/?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF/=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E5=86=8D=E5=9B=9E=E5=88=B0=E5=8E=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/base/mode/DesignModeContext.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java b/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java index 8bb586271..8cf38d00f 100644 --- a/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java +++ b/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java @@ -48,7 +48,6 @@ public class DesignModeContext { * @return 是否为权限编辑 */ public static boolean isAuthorityEditing() { - //System.out.println("isAuthorityEditing:"+(mode == AUTHORITY)); return mode == AUTHORITY; } From 3d75cedccf47a1cb78b6992373a5369535df6be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 10 Sep 2021 17:20:18 +0800 Subject: [PATCH 11/12] =?UTF-8?q?CHART-20674=20=E5=88=86=E7=B1=BB=E8=BD=B4?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=8D=E5=BD=B1=E5=93=8D=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/axis/VanChartAxisScrollPaneWithTypeSelect.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java index ef042e0f2..15154de28 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java @@ -1,9 +1,10 @@ package com.fr.van.chart.designer.style.axis; +import com.fr.chart.base.ColorWithThemeStyle; import com.fr.chart.chartattr.Axis; -import com.fr.design.i18n.Toolkit; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -16,9 +17,9 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.BorderFactory; import javax.swing.JPanel; -import java.awt.BorderLayout; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; /** * 带有坐标轴类型选择控件。可选类型:分类、时间、数值 @@ -98,11 +99,13 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll public VanChartAxis update(VanChartAxis axis) { int index = axisTypePane.getSelectedIndex(); + ColorWithThemeStyle mainGridColorWithPreStyle = axis.getMainGridColorWithPreStyle(); if(ComparatorUtils.equals(index, AxisType.AXIS_CATEGORY.ordinal())){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){ textAxisPane.updateBean(axis); } else { axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); + axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle); textAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){ @@ -110,6 +113,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll timeAxisPane.updateBean(axis); } else { axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); + axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle); timeAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){ @@ -117,6 +121,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll valueAxisPane.updateBean(axis); } else { axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); + axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle); valueAxisPane.updateBean(axis); } } From d22b67acf03b7e835e3370b07a5f0a0acff043f4 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 10 Sep 2021 18:04:26 +0800 Subject: [PATCH 12/12] =?UTF-8?q?REPORT-59010=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E4=B8=BB=E9=A2=98=E9=85=8D=E8=89=B2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=BB=86=E8=8A=82=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E6=B8=90=E5=8F=98=E8=89=B2=E6=B2=A1=E6=9C=89=E6=94=B9?= =?UTF-8?q?=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/theme/TemplateThemeProfilePane.java | 7 +++---- .../java/com/fr/design/style/color/ColorSelectDialog.java | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index 9f8841f02..01a13ea98 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -1,11 +1,11 @@ package com.fr.design.mainframe.theme; +import com.fr.base.theme.FineColorFlushUtils; import com.fr.base.theme.FineColorManager; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemeThumbnail; import com.fr.base.theme.settings.ThemedCellStyleList; -import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.base.theme.settings.ThemedColorScheme; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.FineJOptionPane; @@ -31,9 +31,6 @@ import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.transaction.CallBackAdaptor; -import com.fr.transaction.Configurations; -import com.fr.transaction.WorkerFacade; - import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JDialog; @@ -317,12 +314,14 @@ public abstract class TemplateThemeProfilePane extends FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); T theme = updateBean(); + FineColorFlushUtils.replaceCacheObject(theme, replaceByColorScheme); FineColorManager.traverse(theme, replaceByColorScheme); populateBean4CustomEditors(theme); //图表渐变色 chartStyleSettingPane.populateGradientBar(colors); themePreviewPane.refresh(theme); + this.repaint(); } public void populateBean(T theme) { diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java index 56bc9aa65..23dcf8cc3 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java @@ -1,6 +1,7 @@ package com.fr.design.style.color; import com.fr.base.chart.BaseChartCollection; +import com.fr.design.DesignerEnvManager; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.utils.gui.GUICoreUtils; @@ -101,7 +102,9 @@ public class ColorSelectDialog extends MiddleChartDialog{ ok.setActionCommand("OK"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - seletePane.setColor(okListener.getColor()); + Color color = okListener.getColor(); + seletePane.setColor(color); + DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color); doOK(); } });