From a992039144f20522d64e707de1da6ec46e4bed2c Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 17 Nov 2021 17:20:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-62554=20=E5=86=8D=E6=89=93=E5=BC=80?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=A8=A1=E6=9D=BF=E4=BC=9A=E7=A9=BA?= =?UTF-8?q?=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/app/FormApp.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 286890303e..29f56d143c 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 @@ -73,15 +73,13 @@ class FormApp extends AbstractAppProvider { @Override public JTemplate call() throws Exception { OpenResult result = worker.getResult(); - return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class); + return getJForm(result.getBaseBook(), tplFile, result.getRef()); } }); worker.start(tplFile.getPath()); OpenResult result = worker.getResult(); if (result != null) { - return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class); + return getJForm(result.getBaseBook(), tplFile, result.getRef()); } return emptyForm; } else { @@ -90,6 +88,16 @@ class FormApp extends AbstractAppProvider { } } + @Nullable + private JForm getJForm(Form form, FILE file, Parameter[] parameters) { + try { + return new JForm(form, file, parameters); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + return null; + } + } + @Nullable private Form getForm(FILE tplFile) { ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN); From 15341520dd5dc7688629ec3dbf603b9404d55fca Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 18 Nov 2021 17:33:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CHART-21785=20cpt=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E8=83=8C=E6=99=AF=E5=92=8C=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=A2=9C=E8=89=B2=E8=83=8C=E6=99=AF=E4=B8=80?= =?UTF-8?q?=E6=A0=B7=20design?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/gui/AdjustWorkBookDefaultStyleUtils.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java index abae997e39..760fc3c808 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java @@ -18,6 +18,16 @@ public class AdjustWorkBookDefaultStyleUtils { private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43); private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110); + private static Color currentStoryBack = null; + + public static void setCurrentStoryBack(Color color) { + currentStoryBack = color; + } + + private static Color getCurrentStoryBack() { + return currentStoryBack == null ? TEMPLATE_BACKGROUND : currentStoryBack; + } + public static void adjustCellElement(CellElement cellElement) { if (DesignModeContext.isDuchampMode()) { Style style = cellElement.getStyle(); @@ -33,14 +43,14 @@ public class AdjustWorkBookDefaultStyleUtils { public static void adjustFloatElement(FloatElement floatElement) { if (DesignModeContext.isDuchampMode()) { Style style = floatElement.getStyle(); - style = style.deriveBackground(ColorBackground.getInstance(TEMPLATE_BACKGROUND)); + style = style.deriveBackground(ColorBackground.getInstance(getCurrentStoryBack())); style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE)); floatElement.setStyle(style); } } public static Color adjustBack(Color color) { - return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color; + return DesignModeContext.isDuchampMode() ? getCurrentStoryBack() : color; } }