From c63e6468ec4e6b9156891d49415d3379328bb251 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 29 Oct 2020 17:29:49 +0800 Subject: [PATCH 01/12] =?UTF-8?q?REPORT-40971=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E9=80=89=E6=8B=A9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=97=EF=BC=8C=E9=80=89=E9=A1=B9=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE=E9=9B=86=E4=BC=9A=E6=98=AF?= =?UTF-8?q?=E5=88=AB=E7=9A=84=E6=A8=A1=E6=9D=BF=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../condition/ObjectLiteConditionPane.java | 2 +- .../design/editor/ValueEditorPaneFactory.java | 38 ++++++++++++++++++- .../editor/editor/ColumnSelectedEditor.java | 8 +++- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java b/designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java index b863717f6..c39d5b744 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java @@ -77,7 +77,7 @@ public class ObjectLiteConditionPane extends LiteConditionPane } }); - conditionValuePane = ValueEditorPaneFactory.createAllValueEditorPane(); + conditionValuePane = ValueEditorPaneFactory.createAllValueEditorPaneWithGlobalListener(); Component[][] components = { { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConditionB_Operator") + ":"), new UILabel() }, { conditionOPComboBox, conditionValuePane } }; diff --git a/designer-base/src/main/java/com/fr/design/editor/ValueEditorPaneFactory.java b/designer-base/src/main/java/com/fr/design/editor/ValueEditorPaneFactory.java index 71959b72d..462292099 100644 --- a/designer-base/src/main/java/com/fr/design/editor/ValueEditorPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/editor/ValueEditorPaneFactory.java @@ -19,17 +19,18 @@ import com.fr.design.editor.editor.TextEditor; import com.fr.design.editor.editor.WidgetNameEditor; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.ParameterTableModel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import java.awt.BorderLayout; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import javax.swing.JPanel; public class ValueEditorPaneFactory { @@ -155,6 +156,16 @@ public class ValueEditorPaneFactory { return createValueEditorPane(allEditors(), StringUtils.EMPTY, StringUtils.EMPTY); } + /** + * 带有所有编辑器的ValueEditorPane + * 同时需要注册全局监听的编辑器注册下监听 + * + * @return 值编辑器面板 + */ + public static ValueEditorPane createAllValueEditorPaneWithGlobalListener() { + return createValueEditorPane(allEditorsWithGlobalListener(), StringUtils.EMPTY, StringUtils.EMPTY); + } + /** * 创建不带公式面板的pane * @@ -359,6 +370,29 @@ public class ValueEditorPaneFactory { }; } + /** + * 所有类型的编辑器 + * 同时注册需要的监听 + * + * @return 值编辑器 + */ + public static Editor[] allEditorsWithGlobalListener() { + FormulaEditor formulaEditor = new FormulaEditor(Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); + ColumnSelectedEditor columnSelectedEditor = new ColumnSelectedEditor(); + columnSelectedEditor.registerDSChangeListener(); + return new Editor[]{ + new TextEditor(), + new IntegerEditor(), + new DoubleEditor(), + new DateEditor(true, Toolkit.i18nText("Fine-Design_Basic_Date")), + new BooleanEditor(), + formulaEditor, + new ParameterEditor(), + new ColumnRowEditor(Toolkit.i18nText("Fine-Design_Basic_Cell")), + columnSelectedEditor, + }; + } + /** * 不带公式编辑器 * diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java index ade55ae8b..5260ce175 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -3,6 +3,7 @@ package com.fr.design.editor.editor; import com.fr.design.data.DesignTableDataManager; import com.fr.data.SimpleDSColumn; import com.fr.design.data.datapane.TableDataComboBox; +import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.layout.FRGUIPaneFactory; @@ -22,7 +23,7 @@ import java.util.regex.Pattern; * @author zhou * @since 2012-3-29下午6:05:08 */ -public class ColumnSelectedEditor extends Editor { +public class ColumnSelectedEditor extends Editor implements Prepare4DataSourceChange { TableDataComboBox tableDataComboBox; private UIComboBox columnNameComboBox; protected String[] columnNames; @@ -107,4 +108,9 @@ public class ColumnSelectedEditor extends Editor { tableDataComboBox.setSelectedItem(null); columnNameComboBox.setSelectedItem(null); } + + @Override + public void registerDSChangeListener() { + tableDataComboBox.registerGlobalDSChangeListener(); + } } From 7a046976134ef767de578d2134d7c835028acf6a Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 30 Oct 2020 17:45:48 +0800 Subject: [PATCH 02/12] =?UTF-8?q?REPORT-42470=20=E5=81=87=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 05830dfd0..f48bd579f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -779,10 +779,10 @@ public class JWorkBook extends JTemplate { DesignModuleFactory.getFormHierarchyPane().refreshRoot(); } } else { - reportComposite.setSelectedIndex(u.getSelectedReportIndex()); u.getSelectedEditingState().revert(); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); } + reportComposite.setSelectedIndex(u.getSelectedReportIndex()); this.undoState = u; } else { //参数面板 From 683503e4c9e4037492a557e2e428ec0753c31343 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 2 Nov 2020 11:30:57 +0800 Subject: [PATCH 03/12] =?UTF-8?q?REPORT-42470=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=8B=E4=BD=8D=E7=BD=AE=20=E4=BF=9D=E8=AF=81=E5=8E=9F?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index f48bd579f..7cc0ca283 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -776,13 +776,14 @@ public class JWorkBook extends JTemplate { if (hasParameterPane()) { parameterPane.populate(u.getApplyTarget()); setAutoHeightForCenterPane(); + reportComposite.setSelectedIndex(u.getSelectedReportIndex()); DesignModuleFactory.getFormHierarchyPane().refreshRoot(); } } else { + reportComposite.setSelectedIndex(u.getSelectedReportIndex()); u.getSelectedEditingState().revert(); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); } - reportComposite.setSelectedIndex(u.getSelectedReportIndex()); this.undoState = u; } else { //参数面板 From a827dfefaa41a1834d831d49128000ffd74d413b Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 3 Nov 2020 09:58:08 +0800 Subject: [PATCH 04/12] =?UTF-8?q?REPORT-42540=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=96=B0=E5=A2=9Esheet=E7=9A=84=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E7=8E=87=E9=80=BB=E8=BE=91=E7=A1=AE=E8=AE=A4=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E6=94=B9=E8=BF=99=E4=B8=AA=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?REPORT-37950=E5=8F=AA=E5=85=B3=E6=B3=A8=E4=BA=86=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E6=9D=A1=E5=8F=AF=E4=BB=A5=E5=8D=95=E7=8B=AC=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E6=AF=8F=E4=B8=AAsheet=EF=BC=8C=E6=B2=A1=E6=B3=A8?= =?UTF-8?q?=E6=84=8F=E6=96=B0=E5=A2=9Esheet=E7=9A=84=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E6=9D=A1=E5=88=9D=E5=80=BC=E9=97=AE=E9=A2=98=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E4=B8=8E=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E7=A1=AE=E8=AE=A4=E5=90=8E=EF=BC=8C=E5=B0=86=E6=AF=8F?= =?UTF-8?q?=E4=B8=AA=E6=96=B0=E5=A2=9Esheet=E7=9A=84=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E5=88=9D=E5=80=BC=E8=AE=BE=E7=BD=AE=E4=B8=BA100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/ReportComponentComposite.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 66fed7afe..260d236e3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -5,6 +5,7 @@ import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.designer.EditingState; import com.fr.design.event.RemoveListener; import com.fr.design.event.TargetModifiedListener; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.icontainer.UIModeControlContainer; import com.fr.design.layout.FRGUIPaneFactory; @@ -18,8 +19,6 @@ import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.util.ArrayList; @@ -85,7 +84,7 @@ public class ReportComponentComposite extends JComponent implements RemoveListen value = value > MAX ? MAX : value; value = value < MIN ? MIN : value; int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND); - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().setScale(resolution); } }; @@ -119,8 +118,12 @@ public class ReportComponentComposite extends JComponent implements RemoveListen templateStateList.add(null); } centerCardPane.editingComponet.setSelection(centerCardPane.editingComponet.getDefaultSelectElement()); - // Yvan: REPORT-37950 普通报表-多sheet-报表块缩放失效 - //jSliderContainer = JFormSliderPane.getInstance(); + // 这里jSliderContainer有可能为null,做个判断 + if (jSliderContainer == null) { + jSliderContainer = JFormSliderPane.getInstance(); + } + // 为新建的sheet的缩放条初始值置为100 + jSliderContainer.setShowValue(HUND); } if (centerCardPane.editingComponet.elementCasePane == null) { @@ -206,8 +209,9 @@ public class ReportComponentComposite extends JComponent implements RemoveListen hbarContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); hbarContainer.add(centerCardPane.editingComponet.getHorizontalScrollBar()); JPanel southPane = new JPanel(new BorderLayout()); - jSliderContainer = JFormSliderPane.getInstance(); - + if (jSliderContainer == null) { + jSliderContainer = JFormSliderPane.getInstance(); + } southPane.add(hbarContainer, BorderLayout.NORTH); southPane.add(sheetNameTab, BorderLayout.CENTER); southPane.add(jSliderContainer, BorderLayout.EAST); From d04c3e3bfd4f0a16f220d53377e423399fed2e23 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 3 Nov 2020 14:04:32 +0800 Subject: [PATCH 05/12] =?UTF-8?q?REPORT-42540=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ReportComponentComposite.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 260d236e3..9377c619a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -6,7 +6,6 @@ import com.fr.design.designer.EditingState; import com.fr.design.event.RemoveListener; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.icontainer.UIModeControlContainer; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.grid.Grid; @@ -84,7 +83,10 @@ public class ReportComponentComposite extends JComponent implements RemoveListen value = value > MAX ? MAX : value; value = value < MIN ? MIN : value; int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND); - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().setScale(resolution); + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template != null) { + template.setScale(resolution); + } } }; From 671b2b21d85aa1748b0285c21e6b6865f2b747fe Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 3 Nov 2020 15:22:07 +0800 Subject: [PATCH 06/12] =?UTF-8?q?REPORT-42639=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=B9=B3=E5=8F=B0=E5=AF=86=E7=A0=81-?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=BF=9C=E7=A8=8B=E6=9D=83=E9=99=90=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=88=87=E6=8D=A2=E7=9B=AE=E5=BD=95=EF=BC=8C?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E5=86=85=E5=AE=B9=E4=B8=8D=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=9C=89=E2=80=98=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 382709c92..f5bfdfeeb 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -193,7 +193,9 @@ public class EnvChangeEntrance { UIManager.getIcon("OptionPane.errorIcon"))); } else { strategy.showTip(() -> FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), - new MessageWithLink(result.getText(), Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Modify_PassWord"), info.getUrl() + RemoteWorkspaceURL.SYSTEM_LOGIN_PATH), + result.isVerifyResult() + ? new MessageWithLink(result.getText(), Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Modify_PassWord"), info.getUrl() + RemoteWorkspaceURL.SYSTEM_LOGIN_PATH) + : result.getText(), Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"))); From be7653fc5c91bd8ee79d135de42bebe46abb93d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 4 Nov 2020 10:18:04 +0800 Subject: [PATCH 07/12] =?UTF-8?q?REPORT-41858=20=E8=A2=AB=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=8C=89=E9=92=AE=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../predefined/ui/PredefinedStyleBlock.java | 1 + .../ui/preview/PredefinedStylePreviewPane.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java index 89c35b9a9..67b369a6c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java @@ -96,6 +96,7 @@ public class PredefinedStyleBlock extends JPanel { private void initPane(boolean supportEdit) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); PredefinedStylePreviewPane content = new PredefinedStylePreviewPane(0.387, 0.384); + content.setParent(this); content.setPreferredSize(new Dimension(200, 180)); UILabel label = new UILabel(previewObject.getStyleName()); label.setToolTipText(previewObject.getStyleName()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java index b876d723f..5d03d0e2f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java @@ -39,6 +39,8 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen private int COLUMN_CHART_WIDTH = 517; private int COLUMN_CHART_HEIGHT = 300; + private JPanel parent; + public PredefinedStylePreviewPane() { this(1.0, 1.0); } @@ -53,6 +55,10 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen this.add(this.elementCasePreview); } + public void setParent(JPanel parent) { + this.parent = parent; + } + private JPanel initChartPreViewPane() { columnChartPane = new ChartPreStylePreView(initVanColumnChart()); columnChartPane.setPreferredSize(new Dimension(COLUMN_CHART_WIDTH, COLUMN_CHART_HEIGHT)); @@ -142,6 +148,10 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen @Override public void callback() { - this.repaint(); + if (parent != null) { + parent.repaint(); + } else { + this.repaint(); + } } } From f951f5756fae5f11900a52a34ee00d51c02e1f2a Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 4 Nov 2020 16:49:13 +0800 Subject: [PATCH 08/12] =?UTF-8?q?REPORT-35149=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 13 ++ .../com/fr/design/mainframe/JTemplate.java | 33 ++++- .../ui/PredefinedStyleEditPane.java | 19 ++- .../ui/PredefinedStyleSettingPane.java | 9 +- .../ui/ReportPredefinedStylePane.java | 6 +- .../ui/ServerPredefinedStylePane.java | 18 ++- .../ui/detail/CellStyleListControlPane.java | 21 +++ .../ui/detail/background/ImageDetailPane.java | 2 +- .../cell/CustomPredefinedStylePane.java | 12 ++ .../ui/preview/ComponentPreviewPane.java | 46 +++---- .../ui/preview/ElementCasePreview.java | 130 ++++++++++++++---- .../preview/PredefinedStylePreviewPane.java | 2 +- .../mainframe/toolbar/ToolBarMenuDock.java | 19 +-- .../design/notification/SnapChatAllTypes.java | 8 +- .../xpane/FormPredefinedBackgroundPane.java | 12 +- .../PredefinedComponentStyleSettingPane.java | 14 +- .../java/com/fr/design/mainframe/JForm.java | 1 + .../com/fr/design/mainframe/JWorkBook.java | 22 ++- .../fr/design/mainframe/SheetNameTabPane.java | 16 ++- .../cell/settingpane/CellStylePane.java | 5 +- .../style/CellPredefinedStyleSettingPane.java | 39 ++++-- .../ReportPredefinedBackgroundPane.java | 10 +- 22 files changed, 339 insertions(+), 118 deletions(-) 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 ba1cce556..b099b851b 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 @@ -22,6 +22,7 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FilenameUtils; +import javax.swing.SwingUtilities; import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Collections; @@ -427,4 +428,16 @@ public class HistoryTemplateListCache implements CallbackEvent { jt.refreshResource(); } } + + /** + * 重绘当前模板 + */ + public void repaintCurrentEditingTemplate(){ + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + getCurrentEditingTemplate().repaint(); + } + }); + } } 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 9810842dc..f501f5ab0 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 @@ -51,6 +51,7 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; +import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; @@ -84,10 +85,12 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.undo.UndoManager; import java.awt.Dimension; import java.awt.FontMetrics; +import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -120,6 +123,7 @@ public abstract class JTemplate> private PreviewProvider previewType; protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); public int resolution = ScreenResolution.getScreenResolution(); + private UIButton predefinedBtn; private PluginEventListener pluginListener; @@ -570,6 +574,16 @@ public abstract class JTemplate> protected abstract void applyUndoState(U u); + protected void refreshPredefinedState() { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + JTemplate.this.predefinedBtn.setText(getTemplatePredefinedStyle()); + setPredefinedButtonSize(predefinedBtn); + } + }); + } + /** * 停止编辑, 判断保存属性 * */ @@ -1323,7 +1337,7 @@ public abstract class JTemplate> for (DesignerFrameUpButtonProvider provider : providers) { uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState())); } - UIButton predefinedBtn = createPreDefinedButton(); + predefinedBtn = createPreDefinedButton(); if (predefinedBtn != null) { uiButtons = ArrayUtils.addAll(uiButtons, new UIButton[]{predefinedBtn}); } @@ -1341,7 +1355,7 @@ public abstract class JTemplate> @Override public void actionPerformed(ActionEvent e) { DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); - ReportPredefinedStylePane stylePane = new ReportPredefinedStylePane(JTemplate.this, preferenceButton); + ReportPredefinedStylePane stylePane = new ReportPredefinedStylePane(JTemplate.this); ReportPredefinedStyleDialog dialog = new ReportPredefinedStyleDialog(designerFrame, stylePane); PredefinedStyleInfoCollector.getInstance().collectClickNumber(); dialog.setVisible(true); @@ -1360,12 +1374,17 @@ public abstract class JTemplate> predefinedBtn.setPreferredSize(new Dimension(Math.min(metrics.stringWidth(text) + PREDEFINED_ICON_WIDTH, 100), 20)); } - public void resetPredefinedStyle(String styleName, UIButton predefinedBtn) { + public void resetPredefinedStyle(String styleName) { this.getTarget().setPredefinedStyleName(styleName, true); - predefinedBtn.setText(getTemplatePredefinedStyle()); - setPredefinedButtonSize(predefinedBtn); - this.fireTargetModified(); - this.repaint(); + refreshPredefinedState(); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + JTemplate.this.fireTargetModified(); + JTemplate.this.repaint(); + } + }); + } public String getTemplatePredefinedStyle(){ diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java index 2a7b5592c..6556fb904 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java @@ -12,6 +12,7 @@ import com.fr.config.predefined.PredefinedStyle; import com.fr.config.predefined.PredefinedStyleConfig; import com.fr.config.ServerPreferenceConfig; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.UITabbedPane; @@ -25,10 +26,13 @@ import com.fr.design.mainframe.predefined.ui.detail.PredefinedBackgroundSettingP import com.fr.design.mainframe.predefined.ui.detail.ComponentStyleSettingPane; import com.fr.design.mainframe.predefined.ui.detail.CellStyleListControlPane; import com.fr.design.mainframe.predefined.ui.preview.PredefinedStylePreviewPane; +import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import com.fr.transaction.Configurations; +import com.fr.transaction.WorkerFacade; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -185,6 +189,12 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); jPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); this.cellStyleSettingPane = new CellStyleListControlPane(); + this.cellStyleSettingPane.registerAttrChangeListener(new AttributeChangeListener() { + @Override + public void attributeChange() { + valueChangeAction(); + } + }); jPanel.add(this.cellStyleSettingPane); return jPanel; } @@ -288,7 +298,7 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { if (!saveStyle(previewObject)) { return false; } - DesignUtils.refreshDesignerFrame(); + HistoryTemplateListCache.getInstance().repaintCurrentEditingTemplate(); return true; } @@ -302,7 +312,12 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { } config.add(previewObject); PredefinedStyleConfig sortedConfig = resortConfigStyles(previewObject, config); - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig); + Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { + @Override + public void run() { + ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig); + } + }); selectPane.refreshPane(); return true; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java index 758f8e013..bd849414f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java @@ -9,7 +9,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane; - import javax.swing.ButtonGroup; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -68,6 +67,7 @@ public abstract class PredefinedStyleSettingPane extends AbstractAttrNoScroll predefinedRadioBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + populateCustomPane(); tabbedPane.show(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined")); } }); @@ -125,6 +125,13 @@ public abstract class PredefinedStyleSettingPane extends AbstractAttrNoScroll return template.getTemplatePredefinedStyle(); } + + /** + * 用于在切换到预定义样式后重置自定义样式的设置 + */ + protected abstract void populateCustomPane(); + + /** * 展示数据 * diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java index 4f2c8b603..45d2ca9fe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java @@ -16,11 +16,9 @@ import java.awt.FlowLayout; public class ReportPredefinedStylePane extends BasicPane { private PredefinedStyleSelectPane selectPane; private JTemplate currentTemplate; - private UIButton preferenceBtn; - public ReportPredefinedStylePane(JTemplate jTemplate, UIButton preferenceButton) { + public ReportPredefinedStylePane(JTemplate jTemplate) { this.currentTemplate = jTemplate; - this.preferenceBtn = preferenceButton; initPane(); } @@ -38,7 +36,7 @@ public class ReportPredefinedStylePane extends BasicPane { public void update() { PredefinedStyle style = selectPane.update(); if (style != null) { - currentTemplate.resetPredefinedStyle(style.getStyleName(), preferenceBtn); + currentTemplate.resetPredefinedStyle(style.getStyleName()); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java index 76b2a3b60..739c927b8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java @@ -21,6 +21,8 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.ToolBarDef; import com.fr.design.utils.DesignUtils; import com.fr.stable.StringUtils; +import com.fr.transaction.Configurations; +import com.fr.transaction.WorkerFacade; import javax.swing.BorderFactory; import javax.swing.JOptionPane; @@ -138,8 +140,12 @@ public class ServerPredefinedStylePane extends BasicPane { if (style != null) { PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); config.setDefaultPredefinedStyle(style.getStyleName()); - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); - DesignUtils.refreshDesignerFrame(); + Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { + @Override + public void run() { + ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); + } + }); } } @@ -201,8 +207,12 @@ public class ServerPredefinedStylePane extends BasicPane { private void removeStyle(String name) { PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); config.removeStyle(name); - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); - DesignUtils.refreshDesignerFrame(); + Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { + @Override + public void run() { + ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); + } + }); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleListControlPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleListControlPane.java index b5b28ae6a..3c966c3c4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleListControlPane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ModNameActionListener; import com.fr.design.gui.style.AlignmentPane; @@ -24,6 +25,7 @@ import com.fr.design.mainframe.predefined.ui.detail.cell.CustomPredefinedStylePa import com.fr.design.menu.ShortCut; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; +import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -49,6 +51,9 @@ import java.util.List; */ public class CellStyleListControlPane extends JListControlPane { private boolean namePermitted = true; + private AttributeChangeListener attributeChangeListener; + + public CellStyleListControlPane() { super(); @@ -73,6 +78,13 @@ public class CellStyleListControlPane extends JListControlPane { }); } + + + public void registerAttrChangeListener(AttributeChangeListener listener){ + this.attributeChangeListener = listener; + } + + private void showTipDialogAndReset(String content, int index) { nameableList.stopEditing(); @@ -98,6 +110,15 @@ public class CellStyleListControlPane extends JListControlPane { PredefinedCellStyle.class, CustomPredefinedStylePane.class)}; } + @Override + public BasicBeanPane createPaneByCreators(NameableCreator creator) { + CustomPredefinedStylePane stylePane = (CustomPredefinedStylePane) super.createPaneByCreators(creator); + stylePane.registerAttrChangeListener(attributeChangeListener); + return stylePane; + } + + + @Override protected String title4PopupWindow() { return StringUtils.EMPTY; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java index 0a605d4e5..5873755f5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java @@ -98,7 +98,7 @@ public class ImageDetailPane extends AbstractBackgroundDetailPane private PredefinedCellStyle cellStyle; private PreviewArea previewArea; private boolean populating; + private AttributeChangeListener attributeChangeListener; public CustomPredefinedStylePane() { @@ -49,6 +50,16 @@ public class CustomPredefinedStylePane extends MultiTabPane tabPane.setLayout(new GridLayout(1, 3, 0, 0)); } + public void registerAttrChangeListener(AttributeChangeListener listener){ + this.attributeChangeListener = listener; + } + + private void fireAttrChangeListener() { + if (this.attributeChangeListener != null) { + this.attributeChangeListener.attributeChange(); + } + } + /** * @return */ @@ -141,6 +152,7 @@ public class CustomPredefinedStylePane extends MultiTabPane if (cellStyle != null) { previewArea.preview(cellStyle.getStyle()); } + fireAttrChangeListener(); } }); BasicScrollPane basicScrollPane = new AttrScrollPane() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ComponentPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ComponentPreviewPane.java index 0fffe2ff4..1c829c0ee 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ComponentPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ComponentPreviewPane.java @@ -8,6 +8,7 @@ import com.fr.general.Background; import com.fr.general.FRFont; import com.fr.general.act.BorderPacker; import com.fr.general.act.TitlePacker; +import com.fr.stable.Constants; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -24,7 +25,7 @@ import java.awt.geom.Rectangle2D; */ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane { private PredefinedStyle style = new PredefinedStyle(); - private static final int SMALL_GAP = 5; + private static final int SMALL_GAP = 10; private static final int GAP = 10; private JPanel contentPane; private TitlePreviewPane titlePane; @@ -53,23 +54,16 @@ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane { this.style = style; } - - @Override - public void paint(Graphics g) { - paintContent(g); - - - } - - public void paintContent(Graphics g) { + public void paintComponents(Graphics g) { BorderPacker borderStyle = style.getComponentStyle().getBorderStyle(); updateBorders(g, borderStyle); paintTitle(g, borderStyle.getTitle()); - paintContentPane(g,borderStyle); + paintContentPane(g, borderStyle); + super.paintComponents(g); } private void paintContentPane(Graphics g, BorderPacker borderStyle) { @@ -79,18 +73,15 @@ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane { if (borderStyle.getBackground() != null) { borderStyle.getBackground().paint(clipg, clipg.getClipBounds()); } - this.contentPane.paint(clipg); clipg.dispose(); - } private void paintTitle(Graphics g, TitlePacker titlePacker) { - FRFont font = titlePacker.getFrFont(); Background background = titlePacker.getBackground(); if (background != null) { background.paint(g, new Rectangle2D.Double(10, 5, this.titlePane.getWidth(), this.titlePane.getHeight())); } - titlePane.setFontObject(font); + titlePane.setTitleObject(titlePacker); titlePane.paintComponent(g); } @@ -103,6 +94,7 @@ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane { private class TitlePreviewPane extends JPanel { private FRFont frFont = null; + private int titlePosition = Constants.LEFT; public TitlePreviewPane() { this.setBackground(null); @@ -127,19 +119,23 @@ public abstract class ComponentPreviewPane extends StyleSettingPreviewPane { } else { g2d.setColor(new Color(237, 237, 237)); } - g2d.setFont(frFont.applySize(14).applyResolutionNP(96)); - int startY = 0; - startY = (d.height + fm.getHeight()) / 2; - drawTabBack(g2d, startY); - } - - private void drawTabBack(Graphics2D g2d, int startY) { + g2d.setFont(frFont.applyResolutionNP(96)); String paintText = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Predefined_Preview_Title_Text"); - GraphHelper.drawString(g2d, paintText, GAP, 32); + int startY = 0, startX = 0; + startX = (d.width - fm.stringWidth(paintText)) / 2; + startY = (d.height - fm.getHeight()) / 2 + fm.getAscent(); + if (this.titlePosition == Constants.LEFT) { + startX = GAP; + } else if (this.titlePosition == Constants.RIGHT) { + startX = d.width - fm.stringWidth(paintText) - GAP - fm.getMaxAdvance(); + } + GraphHelper.drawString(g2d, paintText, startX, startY); + } - public void setFontObject(FRFont font) { - this.frFont = font; + public void setTitleObject(TitlePacker titlePacker) { + this.frFont = titlePacker.getFrFont(); + this.titlePosition = titlePacker.getPosition(); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java index 1e25c01d0..6aaa9416b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java @@ -1,21 +1,32 @@ package com.fr.design.mainframe.predefined.ui.preview; +import com.fr.base.ScreenResolution; +import com.fr.base.Style; +import com.fr.config.predefined.PredefinedCellStyle; +import com.fr.config.predefined.PredefinedCellStyleConfig; +import com.fr.config.predefined.PredefinedStyle; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; +import com.fr.third.javax.annotation.Nonnull; +import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JSeparator; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; /** * Created by kerry on 2020-09-04 @@ -23,6 +34,7 @@ import java.awt.Dimension; public class ElementCasePreview extends ComponentPreviewPane { private static final List PREVIEW_DATA_LIST = new ArrayList<>(); private static final String BLANK_CHAR = " "; + private List gridRowPanes; static { readPreviewData(); @@ -44,56 +56,122 @@ public class ElementCasePreview extends ComponentPreviewPane { } } + @Override protected JPanel createContentPane() { - + gridRowPanes = new ArrayList<>(); JPanel jPanel = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); jPanel.setOpaque(false); jPanel.setBackground(null); - FRFont font = FRFont.getInstance(); - font = font.applySize(11); - FRFont titleFont = font.applySize(14).applyForeground(Color.decode("#63B2EE")); - FRFont endFont = font.applySize(11).applyForeground(Color.decode("#1B97FF")); for (int i = 0; i < PREVIEW_DATA_LIST.size(); i++) { - FRFont frFont = font; + GridRowPane gridRowPane = new GridRowPane(PREVIEW_DATA_LIST.get(i), Style.DEFAULT_STYLE); + gridRowPanes.add(gridRowPane); + jPanel.add(gridRowPane); + } + return jPanel; + } + + + public void refresh(PredefinedStyle style) { + super.refresh(style); + PredefinedCellStyleConfig cellStyleConfig = style.getCellStyleConfig(); + for (int i = 0; i < gridRowPanes.size(); i++) { + Style renderStyle = getMainContentStyle(cellStyleConfig); if (i == 0) { - frFont = titleFont; + renderStyle = getReportHeaderStyle(cellStyleConfig); } if (i == PREVIEW_DATA_LIST.size() - 1) { - frFont = endFont; + renderStyle = getHighLightStyle(cellStyleConfig); } - jPanel.add(new GridRowPane(frFont, PREVIEW_DATA_LIST.get(i))); - + gridRowPanes.get(i).preview(renderStyle); } + } - return jPanel; + + private Style getReportHeaderStyle(PredefinedCellStyleConfig config) { + return getCellStyle(config, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); + } + + private Style getMainContentStyle(PredefinedCellStyleConfig config) { + return getCellStyle(config, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); + } + + private Style getHighLightStyle(PredefinedCellStyleConfig config) { + return getCellStyle(config, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); + } + + @Nonnull + private Style getCellStyle(PredefinedCellStyleConfig config, String styleName) { + PredefinedCellStyle cellStyle = config.getStyle(styleName); + if (cellStyle == null) { + return Style.DEFAULT_STYLE; + } + return cellStyle.getStyle(); } + class GridRowPane extends JPanel { - public GridRowPane(FRFont frFont, String[] data) { + private List gridPreviews = new ArrayList<>(); + + public GridRowPane(String[] data, Style style) { this.setOpaque(false); this.setBackground(null); this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel panel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(4, 20, 10); + JPanel panel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(4, 0, 0); panel.setOpaque(false); panel.setBackground(null); for (String text : data) { - panel.add(createLabel(text, frFont)); + GridPreview gridPreview = new GridPreview(text); + gridPreviews.add(gridPreview); + panel.add(gridPreview); } this.add(panel, BorderLayout.CENTER); - JSeparator jSeparator = new JSeparator(); - jSeparator.setPreferredSize(new Dimension(246, 2)); - this.add(jSeparator, BorderLayout.SOUTH); + preview(style); + } + + public void preview(Style style) { + for (GridPreview grid : gridPreviews) { + grid.preview(style); + } + } + } + + + private static class GridPreview extends JComponent { + + private Style style = Style.DEFAULT_STYLE; + private String value; + + public GridPreview(String value) { + this.value = value; + setPreferredSize(new Dimension(125, 30)); } - private UILabel createLabel(String text, FRFont frFont) { - UILabel label = new UILabel(text); - label.setFont(frFont); - label.setForeground(frFont.getForeground()); - label.setBackground(null); - return label; + public void preview(Style style) { + this.style = style; } + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + int resolution = ScreenResolution.getScreenResolution(); + + if (style == Style.DEFAULT_STYLE) { + Style.paintContent(g2d, value, style, getWidth() - 3, getHeight() - 3, resolution); + return; + } + + Style.paintBackground(g2d, style, getWidth(), getHeight()); + + Style.paintContent(g2d, value, style, getWidth() - 3, getHeight() - 3, resolution); + + Style.paintBorder(g2d, style, getWidth() , getHeight() ); + } + + + @Override + public Dimension getMinimumSize() { + return getPreferredSize(); + } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java index 5d03d0e2f..b0a7ab4b3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java @@ -120,7 +120,7 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen this.columnChartPane.paintComponent(g); g.translate(0, COLUMN_CHART_HEIGHT); - this.elementCasePreview.paintContent(g); + this.elementCasePreview.paintComponents(g); g.translate(0, -COLUMN_CHART_HEIGHT); // 恢复双缓冲 ComponentUtils.resetBuffer(dbcomponents); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 42d1d3862..894ebe1c1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -54,7 +54,9 @@ import com.fr.design.mainframe.ToolBarNewTemplatePane; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; +import com.fr.design.menu.SnapChatMenuDef; import com.fr.design.menu.ToolBarDef; +import com.fr.design.notification.SnapChatAllTypes; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.remote.action.RemoteDesignAuthManagerAction; import com.fr.design.update.actions.SoftwareUpdateAction; @@ -72,7 +74,6 @@ import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventType; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.start.OemHandler; import com.fr.workspace.WorkContext; @@ -468,7 +469,9 @@ public abstract class ToolBarMenuDock { } protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) { - MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S'); + + MenuDef menuDef = new SnapChatMenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S', + SnapChatAllTypes.Menu.SERVER); if (!DesignerMode.isAuthorityEditing()) { menuDef.addShortCut( @@ -563,12 +566,12 @@ public abstract class ToolBarMenuDock { * @return 社区菜单的子菜单 */ public ShortCut[] createCommunityShortCuts() { - + final java.util.List shortCuts = new ArrayList(); shortCuts.add(new BBSAction()); - + shortCuts.add(SeparatorDef.DEFAULT); - + shortCuts.add(new VideoAction()); LocaleCenter.buildAction(new LocaleAction() { @Override @@ -578,7 +581,7 @@ public abstract class ToolBarMenuDock { }, SupportLocaleImpl.TUTORIAL_COMMUNITY); shortCuts.add(new QuestionAction()); shortCuts.add(new TechSolutionAction()); - + shortCuts.add(SeparatorDef.DEFAULT); LocaleCenter.buildAction(new LocaleAction() { @@ -608,9 +611,9 @@ public abstract class ToolBarMenuDock { shortCuts.add(new TechSupportAction()); } }, SupportLocaleImpl.TECH_SUPPORT_COMMUNITY); - + shortCuts.add(SeparatorDef.DEFAULT); - + shortCuts.add(new CenterAction()); shortCuts.add(new SignAction()); LocaleCenter.buildAction(new LocaleAction() { diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java index 34e73d983..94779d9d7 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java @@ -12,7 +12,13 @@ public abstract class SnapChatAllTypes { /** * 社区按钮 */ - BBS("BBS"); + BBS("BBS"), + + /** + * 服务器按钮 + */ + SERVER("SERVER"); + private static final String SIGN = "0001"; diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java index 58787a19d..c862ac76d 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java @@ -63,13 +63,21 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane implements BaseJForm { private int resolution = ScreenResolution.getScreenResolution(); public JWorkBook() { - super(new WorkBook(new WorkSheet()), DEFAULT_WB_FILE_PREFIX); - initPredefinedInfo(); + super(new WorkBook(createPredefinedWorkSheet()), DEFAULT_WB_FILE_PREFIX); populateReportParameterAttr(); } - private void initPredefinedInfo() { - WorkBook workBook = this.getTarget(); - for (int i = 0; i < workBook.getReportCount(); i++) { - Report report = workBook.getReport(i); - if (report != null) { - NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY); - ((ReportSettings) report.getReportSettings()).setNameBackground(initBackground); - } - } + private static WorkSheet createPredefinedWorkSheet() { + WorkSheet sheet = new WorkSheet(); + NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY); + ((ReportSettings) sheet.getReportSettings()).setNameBackground(initBackground); + return sheet; } + public JWorkBook(WorkBookX workBookX) { super(new WorkBookAdapter(workBookX), DEFAULT_WBX_FILE_PREFIX); populateReportParameterAttr(); @@ -794,6 +787,7 @@ public class JWorkBook extends JTemplate { } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } + refreshPredefinedState(); } private void applyAll(WorkBookUndoState u) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index ead1cf2f1..bfe525eb7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -38,6 +38,7 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; +import com.fr.form.ui.NameBackground; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; @@ -45,7 +46,9 @@ import com.fr.main.impl.WorkBook; import com.fr.poly.PolyDesigner; import com.fr.report.poly.PolyWorkSheet; import com.fr.report.report.TemplateReport; +import com.fr.report.stable.ReportSettings; import com.fr.report.worksheet.WorkSheet; +import com.fr.stable.StringUtils; /** * NameTabPane of sheets @@ -847,11 +850,18 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse protected abstract String getTemplateReportType(); } + private void initPredefinedInfo(TemplateReport report){ + NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY); + ((ReportSettings) report.getReportSettings()).setNameBackground(initBackground); + } + protected class GridReportInsertAction extends SheetInsertAction { @Override protected TemplateReport newTemplateReport() { - return new WorkSheet(); + WorkSheet workSheet = new WorkSheet(); + initPredefinedInfo(workSheet); + return workSheet; } @Override @@ -863,7 +873,9 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse protected class PolyReportInsertAction extends SheetInsertAction { @Override protected TemplateReport newTemplateReport() { - return new PolyWorkSheet(); + PolyWorkSheet polyWorkSheet = new PolyWorkSheet(); + initPredefinedInfo(polyWorkSheet); + return polyWorkSheet; } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index 1fd08a761..98311cd99 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -43,19 +43,18 @@ public class CellStylePane extends AbstractCellAttrPane { @Override public String getIconPath() { -// return "com/fr/design/images/m_format/cell.png"; return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style"); } @Override public void updateBean(TemplateCellElement cellElement) { - cellElement.setStyle(stylePane.updateBean()); + cellElement.setStyle(stylePane.updateStyle()); } @Override public void updateBeans() { - NameStyle s = stylePane.updateBean(); + Style s = stylePane.updateStyle(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); int cellRectangleCount = cs.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java index a8efff6b9..6a111b781 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java @@ -16,7 +16,6 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.style.AbstractBasicStylePane; import com.fr.design.gui.style.AlignmentPane; -import com.fr.design.gui.style.BackgroundPane; import com.fr.design.gui.style.BorderPane; import com.fr.design.gui.style.FormatPane; import com.fr.design.layout.FRGUIPaneFactory; @@ -29,6 +28,7 @@ import com.fr.design.style.BorderUtils; import com.fr.predefined.PredefinedPatternStyleManager; import com.fr.stable.Constants; import com.fr.stable.StringUtils; +import com.fr.third.javax.annotation.Nonnull; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -85,9 +85,7 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane allStyle = config.getAllStyles(); this.applicationFormat.clearBoxItems(); @@ -103,6 +101,13 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane { @@ -132,7 +146,6 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane Date: Wed, 4 Nov 2020 17:10:20 +0800 Subject: [PATCH 09/12] =?UTF-8?q?REPORT-42604=20=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=BF=9E=E8=BF=9C=E7=A8=8B=E7=9B=AE=E5=BD=95=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=20=E6=A0=A1=E9=AA=8C=E5=A4=B1=E8=B4=A5=20=E6=9C=AA?= =?UTF-8?q?=E6=9C=89=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 4 ++-- .../com/fr/start/module/DesignerWorkspaceProvider.java | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index f5bfdfeeb..15fc6f1d3 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -182,7 +182,7 @@ public class EnvChangeEntrance { return true; } - private void handleWorkspaceCheckException(WorkspaceCheckException e, PopTipStrategy strategy, WorkspaceConnectionInfo info) { + public void handleWorkspaceCheckException(WorkspaceCheckException e, PopTipStrategy strategy, WorkspaceConnectionInfo info) { TestConnectionResult result = TestConnectionResult.parseByException(e); FineLoggerFactory.getLogger().error(e.getMessage(), e); if (ComparatorUtils.equals(result, TestConnectionResult.AUTH_FAILED)) { @@ -493,7 +493,7 @@ public class EnvChangeEntrance { /** * 提示显示策略 */ - enum PopTipStrategy { + public enum PopTipStrategy { /** * 切换失败,就马上提示失败,不关闭选择列表对话框 diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index e0fc4dfe9..43ae6ddcd 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -16,6 +16,7 @@ import com.fr.stable.StringUtils; import com.fr.value.NotNullLazyValue; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; +import com.fr.workspace.engine.exception.WorkspaceCheckException; import org.jetbrains.annotations.NotNull; @@ -43,10 +44,10 @@ public class DesignerWorkspaceProvider extends Activator { if (startupArgs.getValue().isDemo()) { DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); } else { + String workspacePath; + DesignerWorkspaceInfo workspaceInfo = null; try { String current = DesignerEnvManager.getEnvManager().getCurEnvName(); - String workspacePath; - DesignerWorkspaceInfo workspaceInfo; if (StringUtils.isNotEmpty(workspacePath = System.getProperty(SPECIFY_WORKSPACE))) { workspaceInfo = LocalDesignerWorkspaceInfo.create(StringUtils.EMPTY, workspacePath); } else { @@ -73,6 +74,10 @@ public class DesignerWorkspaceProvider extends Activator { } } catch (Throwable e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + if (e.getCause() instanceof WorkspaceCheckException && workspaceInfo != null) { + WorkspaceCheckException exception = (WorkspaceCheckException) e.getCause(); + EnvChangeEntrance.getInstance().handleWorkspaceCheckException(exception, EnvChangeEntrance.PopTipStrategy.LATER, workspaceInfo.getConnection()); + } EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); } } From a4c3b7b9cc0fa65310b8f51a7c2f59f3f09dda8d Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 4 Nov 2020 17:16:43 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 6 ++++-- .../mainframe/predefined/ui/preview/ElementCasePreview.java | 6 ------ .../predefined/ui/preview/PredefinedStylePreviewPane.java | 4 ++-- .../com/fr/design/mainframe/predefined/previewData | 3 +-- 4 files changed, 7 insertions(+), 12 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 f501f5ab0..2c1b15177 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 @@ -578,8 +578,10 @@ public abstract class JTemplate> UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - JTemplate.this.predefinedBtn.setText(getTemplatePredefinedStyle()); - setPredefinedButtonSize(predefinedBtn); + if(predefinedBtn != null){ + JTemplate.this.predefinedBtn.setText(getTemplatePredefinedStyle()); + setPredefinedButtonSize(predefinedBtn); + } } }); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java index 6aaa9416b..a7ec75e89 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java @@ -5,19 +5,13 @@ import com.fr.base.Style; import com.fr.config.predefined.PredefinedCellStyle; import com.fr.config.predefined.PredefinedCellStyleConfig; import com.fr.config.predefined.PredefinedStyle; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nonnull; - import javax.swing.JComponent; import javax.swing.JPanel; -import javax.swing.JSeparator; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java index b0a7ab4b3..5b6d20049 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java @@ -37,7 +37,7 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen private ChartPreStylePreView columnChartPane; private int COLUMN_CHART_WIDTH = 517; - private int COLUMN_CHART_HEIGHT = 300; + private int COLUMN_CHART_HEIGHT = 290; private JPanel parent; @@ -51,7 +51,7 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen this.setBackground(Color.WHITE); this.elementCasePreview = new ElementCasePreview(); this.add(initChartPreViewPane()); - this.elementCasePreview.setPreferredSize(new Dimension(517, 190)); + this.elementCasePreview.setPreferredSize(new Dimension(517, 200)); this.add(this.elementCasePreview); } diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/predefined/previewData b/designer-base/src/main/resources/com/fr/design/mainframe/predefined/previewData index 263e85a73..cfcf502f3 100644 --- a/designer-base/src/main/resources/com/fr/design/mainframe/predefined/previewData +++ b/designer-base/src/main/resources/com/fr/design/mainframe/predefined/previewData @@ -2,5 +2,4 @@ 南通市 324,646 324,646 100% 合肥市 248,938 348,938 140% 邵阳市 248,938 348,938 140% -苏州市 248,938 348,938 140% -合计 1,071,460 1,371,460 128% \ No newline at end of file +合计 1,071,460 1,371,460 128% From d3d19e4899dcd06772e030cdf4bce2ecc75a105e Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 4 Nov 2020 17:23:27 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/HistoryTemplateListCache.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 b099b851b..763ffcd1f 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 @@ -13,6 +13,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplateFactory; import com.fr.design.mainframe.JVirtualTemplate; import com.fr.design.module.DesignModuleFactory; +import com.fr.design.ui.util.UIUtil; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.file.StashedFILE; @@ -433,7 +434,7 @@ public class HistoryTemplateListCache implements CallbackEvent { * 重绘当前模板 */ public void repaintCurrentEditingTemplate(){ - SwingUtilities.invokeLater(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { getCurrentEditingTemplate().repaint(); From 6dd9eb4f9fda46a28b8f10f6a44e6793d683045b Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 4 Nov 2020 17:24:52 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E7=94=A8uiutil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 4 +--- 1 file changed, 1 insertion(+), 3 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 2c1b15177..406ab878e 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 @@ -85,12 +85,10 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.SwingConstants; -import javax.swing.SwingUtilities; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.undo.UndoManager; import java.awt.Dimension; import java.awt.FontMetrics; -import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -1379,7 +1377,7 @@ public abstract class JTemplate> public void resetPredefinedStyle(String styleName) { this.getTarget().setPredefinedStyleName(styleName, true); refreshPredefinedState(); - SwingUtilities.invokeLater(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { JTemplate.this.fireTargetModified();