From a992039144f20522d64e707de1da6ec46e4bed2c Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 17 Nov 2021 17:20:27 +0800 Subject: [PATCH 1/4] =?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 286890303..29f56d143 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/4] =?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 abae997e3..760fc3c80 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; } } From 1b52c54a85171a2e46e2170096c9f66264023d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 19 Nov 2021 14:35:48 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-62275=20tab=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=92=A4=E9=94=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JTemplate.java | 10 ++++++++++ .../layout/FRCardMainBorderLayoutAdapter.java | 13 ++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index d8bc7fb48..f1f72b48c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -581,6 +581,16 @@ public abstract class JTemplate> fireSuperTargetModified(); } + public void undoToCurrent() { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + BaseUndoState current = JTemplate.this.getUndoState(); + current.applyState(); + } + }); + } + /** * 模板更新 */ diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java index dd9e03c8d..7e30b9840 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java @@ -65,17 +65,8 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter { if (minConstraint > value) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - if (jt != null && jt.getUndoManager().canUndo()) { - // 自适应布局平分高度导致变矮的场景,优先做撤销 - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - jt.undo(); - } - }); - } else if (container.getBackupBound() != null) { - // 手动拖动导致变矮的场景 - container.setSize(container.getBackupBound().getSize()); + if (jt != null) { + jt.undoToCurrent(); } return true; } else { From ccaa4cf79a164a7bc61facc7d9ef7cbf96b3856b Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 19 Nov 2021 14:51:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?CHART-22020=20=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E5=A4=A7=E5=B1=8F=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?-=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=90=AF=E5=8A=A8=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8-=E6=8F=92=E4=BB=B6=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8Creportlets=E6=A0=B9?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=98=BE=E7=A4=BA=E4=B8=8D=E4=BA=86FVS?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=8F=AA=E6=9C=89=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E7=9A=84=E5=88=B7=E6=96=B0=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=89=8D=E8=83=BD=E5=87=BA=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/DesignerFrameFileDealerPane.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 2925e03a8..a33aa91d5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -34,6 +34,7 @@ import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; +import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.event.Event; @@ -101,6 +102,23 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt return context.contain(PluginModule.ExtraDesign, ShortCut.TEMPLATE_TREE); } }); + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + @Override + public void on(PluginEvent event) { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + DesignerFrameFileDealerPane.getInstance().refresh(); + DesignerFrameFileDealerPane.getInstance().stateChange(); + } + }); + } + }, new PluginFilter() { + @Override + public boolean accept(PluginContext context) { + return context.contain(PluginModule.ExtraDesign, App.MARK_STRING); + } + }); } private List otherToolbarStateChangeListeners = new ArrayList<>();