From bfd07764cdaf48ed219ed08b87ae84cd070ac81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 3 Sep 2021 18:58:01 +0800 Subject: [PATCH 01/16] =?UTF-8?q?REPORT-57722=20=E7=9C=8B=E7=9C=8B?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E9=97=B4=E8=B7=9D=E7=BA=BF=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E6=96=B9=E6=9C=89=E6=B2=A1=E6=9C=89=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=9A=84=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/XCreator.java | 28 ++++++++++ .../creator/XWAbsoluteBodyLayout.java | 13 +++++ .../designer/creator/XWParameterLayout.java | 5 ++ .../mainframe/FormSpacingLineDrawer.java | 53 +++---------------- 4 files changed, 52 insertions(+), 47 deletions(-) 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 55b9c191f..3ead13c05 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 @@ -68,6 +68,9 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo protected Widget data; protected JComponent editor; protected CoverReportPane coverPanel; + + protected boolean inAbsoluteBodyLayout; + // XCreator加入到某些XLayoutContainer中时,能调整宽度或者高度 private int[] directions; private Rectangle backupBound; @@ -887,4 +890,29 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } return ((XCreator) this.getParent()).getLevel() + 1; } + + public boolean isAbleDrawSpacingLine() { + return !isBody() && !isParameter() && !isInPara() && isInAbsoluteBodyLayout(); + } + + public boolean isBody() { + return false; + } + + public boolean isParameter() { + return false; + } + + public boolean isInPara() { + XLayoutContainer container = XCreatorUtils.getHotspotContainer(this); + return container != null && container.acceptType(XWParameterLayout.class); + } + + public boolean isInAbsoluteBodyLayout() { + return inAbsoluteBodyLayout; + } + + public void setInAbsoluteBodyLayout(boolean inAbsoluteBodyLayout) { + this.inAbsoluteBodyLayout = inAbsoluteBodyLayout; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index aa5612c09..40786a6d5 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -12,6 +12,7 @@ import com.fr.stable.core.PropertyChangeAdapter; import java.awt.Component; import java.awt.Dimension; +import java.awt.event.ContainerEvent; import java.beans.IntrospectionException; /** @@ -135,4 +136,16 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { return false; } + @Override + public void componentAdded(ContainerEvent e) { + super.componentAdded(e); + XWidgetCreator creator = (XWidgetCreator) e.getChild(); + creator.setInAbsoluteBodyLayout(true); + } + + @Override + public boolean isBody() { + return true; + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java index fc01aefaa..9fa256f8a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java @@ -260,4 +260,9 @@ public class XWParameterLayout extends XWAbsoluteLayout { public boolean isTopable() { return false; } + + @Override + public boolean isParameter() { + return true; + } } 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 540c707d4..d78290810 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 @@ -5,9 +5,6 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XElementCase; import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWParameterLayout; -import com.fr.design.form.parameter.FormParaDesigner; -import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.utils.ComponentUtils; import com.fr.stable.Constants; import com.fr.stable.GraphDrawHelper; @@ -48,6 +45,10 @@ public class FormSpacingLineDrawer { } public void draw(Graphics g) { + if (!isMouseMoveEvent) { + return; + } + if (!isDrawSpacingLine()) { return; } @@ -136,55 +137,13 @@ public class FormSpacingLineDrawer { GraphDrawHelper.drawString(g2d, text, labelX, labelY); } - private boolean isSelectedParaComponent() { - return designer.getParaComponent() == designer.getSelectionModel().getSelection().getSelectedCreator(); - } - - private boolean isSelectedRootComponent() { - return designer.isRoot(designer.getSelectionModel().getSelection().getSelectedCreator()); - } - - private boolean isSelectedForm() { - return designer.getSelectionModel().getSelection().getSelectedCreator().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 isCompInPara(XCreator creator) { - XLayoutContainer container = XCreatorUtils.getHotspotContainer(creator); - - boolean xCreatorAccept = creator.acceptType(XWParameterLayout.class); - boolean containerAccept = container != null && container.acceptType(XWParameterLayout.class); - - return xCreatorAccept || containerAccept; - } - - private boolean isBodyAbsoluteLayout() { - return !(designer instanceof FormParaDesigner) && FormDesignerUtils.isBodyAbsolute(designer); - } - - private boolean isSelectedCompInPara() { - return isCompInPara(designer.getSelectionModel().getSelection().getSelectedCreator()); - } - - private boolean isHoveredCompInPara() { - return isCompInPara(hoverCreator); - } - - private boolean isSelectedCompOrHoveredCompInPara() { - return isSelectedCompInPara() || isHoveredCompInPara(); - } - private boolean isDrawSpacingLine() { - return isBodyAbsoluteLayout() && !isSelectedRootPane() && hoverCreator != null && !isSelectedCompOrHoveredCompInPara() && isMouseMoveEvent; + XCreator selectedCreator = designer.getSelectionModel().getSelection().getSelectedCreator(); + return hoverCreator != null && selectedCreator != null && hoverCreator.isAbleDrawSpacingLine() && selectedCreator.isAbleDrawSpacingLine(); } private AbstractFormParallelLine[] getNearestHorizontalSide() { From 77fad47b9d56d5baea924c2ad05627c7f7271399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 3 Sep 2021 19:00:56 +0800 Subject: [PATCH 02/16] =?UTF-8?q?REPORT-57722=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC?= 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 1e588c5c7..8b33d7532 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 @@ -69,7 +69,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo protected JComponent editor; protected CoverReportPane coverPanel; - protected boolean inAbsoluteBodyLayout; + protected boolean inAbsoluteBodyLayout = false; // XCreator加入到某些XLayoutContainer中时,能调整宽度或者高度 private int[] directions; From 02b949608e628de3f0b05e7ea7ee4217b9a12e4b Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 3 Sep 2021 17:42:34 +0800 Subject: [PATCH 03/16] =?UTF-8?q?CHART-20568=20[=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=AA=8C=E6=94=B6]=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E9=A1=B5=E9=9D=A2=E5=9B=BE=E8=A1=A8=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=AC=BC=E7=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 刷新页面触发了进入编辑模式的图表不停截图重绘,目前修复方式是与撤销回退的 一样的处理方式,退出图表编辑状态 【改动思路】 同上 --- .../src/main/java/com/fr/design/mainframe/JForm.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 9d03edbc0..0d4fc318b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -1203,10 +1203,20 @@ public class JForm extends JTemplate implements BaseJForm Date: Fri, 3 Sep 2021 18:58:10 +0800 Subject: [PATCH 04/16] =?UTF-8?q?REPORT-58698=20=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2-=E4=B8=BB=E9=A2=98=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 修改主题管理界面/主题选择界面的尺寸计算方式 2. 修复初始时不显示主题标记的问题 【改动思路】 同上 --- .../design/mainframe/theme/TemplateThemeBlock.java | 12 ++++++++---- .../mainframe/theme/TemplateThemeListPane.java | 7 +++++-- .../mainframe/theme/TemplateThemeManagePane.java | 7 +++---- .../theme/dialog/TemplateThemeManageDialog.java | 11 ++++++++--- .../theme/dialog/TemplateThemeUsingDialog.java | 4 ++-- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java index 7fcfd7310..543df64eb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java @@ -37,8 +37,9 @@ import java.awt.event.MouseEvent; * Created by Starryi on 2021/8/13 */ public class TemplateThemeBlock extends JPanel { - public static final int HEIGHT = 150; - public static final int THUMBNAIL_HEIGHT = 125; + public static final int INFO_HEIGHT = 30; + public static final int CONTENT_WIDTH = ThemeThumbnail.WIDTH; + public static final int CONTENT_HEIGHT = ThemeThumbnail.HEIGHT + INFO_HEIGHT; private static final Color HOVERING_BORDER_COLOR = new Color(65, 155, 249); private final String name; @@ -97,13 +98,14 @@ public class TemplateThemeBlock extends JPanel { private void initializePane() { setLayout(FRGUIPaneFactory.createBorderLayout()); - setPreferredSize(new Dimension(getPreferredSize().width, HEIGHT)); + setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT)); setBackground(Color.WHITE); thumbnailPane.setBackground(Color.WHITE); - thumbnailPane.setPreferredSize(new Dimension(getPreferredSize().width, THUMBNAIL_HEIGHT)); + thumbnailPane.setPreferredSize(new Dimension(ThemeThumbnail.WIDTH, ThemeThumbnail.HEIGHT)); JPanel infoPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + infoPane.setPreferredSize(new Dimension(CONTENT_WIDTH, INFO_HEIGHT)); infoPane.setBackground(Color.WHITE); infoPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L7,0,IntervalConstants.INTERVAL_L7)); @@ -129,6 +131,8 @@ public class TemplateThemeBlock extends JPanel { } } thumbnailPane.setThumbnail(image); + invalidate(); + repaint(); } public T getTheme() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java index 493033512..ad60ad581 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.theme; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; +import com.fr.base.theme.settings.ThemeThumbnail; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.ChangeEvent; @@ -29,7 +30,9 @@ import java.util.Map; public class TemplateThemeListPane extends BasicPane { public static final int BLOCK_COUNT_ROW_LINE = 3; public static final int BLOCK_GAP = IntervalConstants.INTERVAL_L1; - public static final int CONTENT_WIDTH = 630; + public static final int CONTENT_WIDTH = TemplateThemeBlock.CONTENT_WIDTH * BLOCK_COUNT_ROW_LINE + BLOCK_GAP * (BLOCK_COUNT_ROW_LINE - 1) + 10; + public static final int BLOCK_ROWS_PER_PAGE = 3; + public static final int CONTENT_HEIGHT = TemplateThemeBlock.CONTENT_HEIGHT * BLOCK_ROWS_PER_PAGE + BLOCK_GAP * (BLOCK_ROWS_PER_PAGE + 1); public static final int ASYNC_FETCH_THEME_THREAD_COUNT = 10; private final AsyncThemeFetcher asyncThemeFetcher; @@ -59,7 +62,7 @@ public class TemplateThemeListPane extends BasicPane { private void initializePane() { setLayout(FRGUIPaneFactory.createBorderLayout()); - setPreferredSize(new Dimension(CONTENT_WIDTH, getPreferredSize().height)); + setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT)); contentListPane.setBorder(BorderFactory.createEmptyBorder(BLOCK_GAP, 0, BLOCK_GAP, 0)); contentListPane.setLayout(new GridLayout(0, BLOCK_COUNT_ROW_LINE, BLOCK_GAP, BLOCK_GAP)); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java index bf93c6345..be9dec160 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java @@ -17,15 +17,12 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.icon.IconPathConstants; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog; -import com.fr.design.mainframe.theme.edit.CellStyleListEditPane; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ToolBarDef; import com.fr.general.IOUtils; 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.JOptionPane; @@ -55,6 +52,8 @@ import static com.fr.design.i18n.Toolkit.i18nText; * Created by Starryi on 2021/8/13 */ public class TemplateThemeManagePane extends BasicPane { + public static final int CONTENT_WIDTH = TemplateThemeListPane.CONTENT_WIDTH + 10; + public static final int CONTENT_HEIGHT = TemplateThemeListPane.CONTENT_HEIGHT + 37; private final RemoveThemeAction removeAction; private final UIButton setTheme4NewTemplateButton; @@ -94,6 +93,7 @@ public class TemplateThemeManagePane extends BasicPane private void initializePane() { setLayout(FRGUIPaneFactory.createBorderLayout()); setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5)); + setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT)); add(createActionsContainer(), BorderLayout.NORTH); @@ -102,7 +102,6 @@ public class TemplateThemeManagePane extends BasicPane nextContainer.add(new JSeparator(), BorderLayout.NORTH); - themeListPane.setPreferredSize(new Dimension(themeListPane.getPreferredSize().width, 490)); themeListPane.setSelectedChangeListener(new ChangeListener() { @Override public void fireChanged(ChangeEvent event) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeManageDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeManageDialog.java index 31762e72e..f306fcacf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeManageDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeManageDialog.java @@ -10,11 +10,13 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.theme.TemplateThemeListPane; import com.fr.design.mainframe.theme.TemplateThemeManagePane; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; +import java.awt.Dimension; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -25,13 +27,12 @@ import java.awt.event.ActionListener; * Created by Starryi on 2021/8/13 */ public class TemplateThemeManageDialog extends TemplateThemeDialog { - public static final int CONTENT_WIDTH = 660; - public static final int CONTENT_HEIGHT = 570; private final TemplateThemeManageDialogContentPane contentPane; public TemplateThemeManageDialog(Window parent) { - super(parent, Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Title"), CONTENT_WIDTH, CONTENT_HEIGHT); + super(parent, Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Title"), + TemplateThemeManageDialogContentPane.CONTENT_WIDTH, TemplateThemeManageDialogContentPane.CONTENT_HEIGHT); contentPane = new TemplateThemeManageDialogContentPane(); setContentPane(createDialogContentPane(contentPane, new UIButton[]{ createCompleteButton() })); @@ -55,12 +56,16 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog { } public static class TemplateThemeManageDialogContentPane extends JPanel { + public static final int CONTENT_WIDTH = TemplateThemeManagePane.CONTENT_WIDTH + 24; + public static final int CONTENT_HEIGHT = TemplateThemeManagePane.CONTENT_HEIGHT + 40; + private final TemplateThemeManagePane formThemesManagerPane; private final TemplateThemeManagePane reportThemesManagerPane; public TemplateThemeManageDialogContentPane() { setLayout(FRGUIPaneFactory.createBorderLayout()); setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); + setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT)); UITabbedPane tabbedPane = new UITabbedPane(); add(tabbedPane, BorderLayout.NORTH); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java index e4f4b5fd2..9c9f9220e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java @@ -27,8 +27,8 @@ import java.awt.event.ActionListener; */ public class TemplateThemeUsingDialog extends TemplateThemeDialog { - public static final int CONTENT_WIDTH = 660; - public static final int CONTENT_HEIGHT = 515; + public static final int CONTENT_WIDTH = TemplateThemeListPane.CONTENT_WIDTH + 42; + public static final int CONTENT_HEIGHT = TemplateThemeListPane.CONTENT_HEIGHT + 23; private final TemplateThemeListPane themeListPane; private final ThemedTemplate currentTemplate; From cff5c393ad26bb750d2254f172ffc252aca5597a Mon Sep 17 00:00:00 2001 From: Starryi Date: Sat, 4 Sep 2021 12:39:47 +0800 Subject: [PATCH 05/16] =?UTF-8?q?REPORT-58698=20=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2-=E4=B8=BB=E9=A2=98=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 内置主题缩略图尺寸修改,以配合后续的主题预览界面优化 【改动思路】 同上 --- .../design/mainframe/theme/TemplateThemePreviewPane.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java index fab425fbe..9fb072b11 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java @@ -41,17 +41,9 @@ public abstract class TemplateThemePreviewPane extends int thumbnailWidth = ThemeThumbnail.WIDTH; int thumbnailHeight = ThemeThumbnail.HEIGHT; - float thumbnailAspect = 1.0F * thumbnailWidth / thumbnailHeight; int width = getWidth(); int height = getHeight(); - float aspect = 1.0F * width / height; - - if (thumbnailAspect > aspect) { - height = (int) (width / thumbnailAspect); - } else { - width = (int) (height * thumbnailAspect); - } try { // 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image, From c3a54163953f8c0b2cc29f8d831775715a36de37 Mon Sep 17 00:00:00 2001 From: Starryi Date: Sat, 4 Sep 2021 14:17:07 +0800 Subject: [PATCH 06/16] =?UTF-8?q?REPORT-58503=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E9=A2=84=E8=A7=88=E5=8C=BA?= =?UTF-8?q?ui=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 单元格样式预览显示透明块 【改动思路】 同上 --- .../java/com/fr/design/cell/CellStylePreviewPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java index af4bc8a9b..393f217ce 100644 --- a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java @@ -3,13 +3,13 @@ package com.fr.design.cell; import com.fr.base.NameStyle; import com.fr.base.ScreenResolution; import com.fr.base.Style; +import com.fr.general.IOUtils; import javax.swing.JPanel; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.Toolkit; +import java.awt.image.BufferedImage; /** * @author Starryi @@ -18,7 +18,7 @@ import java.awt.Toolkit; */ public class CellStylePreviewPane extends JPanel { - private static final Image transparentBackgroundImage = Toolkit.getDefaultToolkit().createImage(CellStylePreviewPane.class.getResource("/com/fr/design/images/transparent_background.png")); + private static final BufferedImage transparentBackgroundImage = IOUtils.readImage("/com/fr/design/images/transparent_background.png"); private final float transparentBackgroundWidth; private final float transparentBackgroundHeight; private String paintText = "Report"; @@ -38,7 +38,7 @@ public class CellStylePreviewPane extends JPanel { } @Override - public void paintComponent(Graphics g) { + public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; int resolution = ScreenResolution.getScreenResolution(); From 6d2f45cd04d5f40babadcf7ae428afde767f563c Mon Sep 17 00:00:00 2001 From: Starryi Date: Sat, 4 Sep 2021 15:49:15 +0800 Subject: [PATCH 07/16] =?UTF-8?q?REPORT-58589=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=BE=88=E5=A4=9A=E6=97=B6=EF=BC=8C=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E9=80=89=E6=8B=A9=E6=A0=B7=E5=BC=8F=E4=BB=A5=E5=90=8E?= =?UTF-8?q?=E4=BC=9A=E6=A6=82=E7=8E=87=E9=81=87=E5=88=B0=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=80=89=E4=B8=AD=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 偶尔会出现点击手势回调在选中前执行,导致获取到的被选中样式是错误的。 使用新的列表项选中监听方法 【改动思路】 同上 --- .../style/ThemedCellStyleListPane.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java index eb6f5484e..53fe811db 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java @@ -22,11 +22,11 @@ import javax.swing.JPanel; import javax.swing.ListCellRenderer; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; import java.io.Serializable; import java.util.List; @@ -44,21 +44,17 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane imp styleList.setCellRenderer(new RadioButtonListCellRenderer()); styleList.setOpaque(false); styleList.setBackground(null); - setLayout(FRGUIPaneFactory.createBorderLayout()); - add(styleList, BorderLayout.CENTER); - setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER)); - - styleList.addMouseListener(new MouseAdapter() { + styleList.addListSelectionListener(new ListSelectionListener() { @Override - public void mouseClicked(MouseEvent e) { - int clickedNumber = e.getClickCount(); - if (clickedNumber == 1) { - if (changeListener != null) { - changeListener.stateChanged(new ChangeEvent(styleList)); - } + public void valueChanged(ListSelectionEvent e) { + if (changeListener != null) { + changeListener.stateChanged(new ChangeEvent(styleList)); } } }); + setLayout(FRGUIPaneFactory.createBorderLayout()); + add(styleList, BorderLayout.CENTER); + setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER)); DesignerContext.setDesignerBean("predefinedStyle", this); } From d61cf5a4c4c73188949405edbdd0feb9a2486af7 Mon Sep 17 00:00:00 2001 From: Starryi Date: Sat, 4 Sep 2021 20:25:38 +0800 Subject: [PATCH 08/16] =?UTF-8?q?REPORT-58403=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E7=BB=84=E4=BB=B6=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A1=86=E6=A0=87=E9=A2=98=E9=83=A8=E5=88=86?= =?UTF-8?q?=EF=BC=8C=E9=97=B4=E8=B7=9D=E6=9C=89=E7=82=B9=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 去除多余的视图容器 【改动思路】 同上 --- .../design/gui/style/ComponentTitleStylePane.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java index b7499fc14..8f9a8503d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java @@ -303,13 +303,16 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { return; } JPanel container = this; - for (JComponent component: components) { + for (int i = 0; i < components.length; i++) { + JComponent component = components[i]; if (component != null) { container.add(component, BorderLayout.NORTH); - JPanel nextContainer = new JPanel(FRGUIPaneFactory.createBorderLayout()); - nextContainer.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); - container.add(nextContainer, BorderLayout.CENTER); - container = nextContainer; + component.setBorder(BorderFactory.createEmptyBorder(i == 0 ? 0 : IntervalConstants.INTERVAL_L1, 0, 0, 0)); + if (i < components.length - 1) { + JPanel nextContainer = new JPanel(FRGUIPaneFactory.createBorderLayout()); + container.add(nextContainer, BorderLayout.CENTER); + container = nextContainer; + } } } } From c093b92a20a311c981af115b5a12b6656a770e01 Mon Sep 17 00:00:00 2001 From: Starryi Date: Sat, 4 Sep 2021 21:37:51 +0800 Subject: [PATCH 09/16] =?UTF-8?q?REPORT-58902=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E6=89=93=E5=BC=80frm?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=9A=84=E6=97=B6=E5=80=99=E7=BC=96=E8=BE=91?= =?UTF-8?q?cpt=E7=9A=84=E4=B8=BB=E9=A2=98=EF=BC=8C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=90=8E=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E6=98=AF=E5=8D=95=E5=85=83=E6=A0=BC=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 仅当前正在编辑模版所使用的主题发生变化才需要重绘 设计器画布及属性面板等  【改动思路】 同上 --- .../java/com/fr/design/mainframe/JForm.java | 31 ++++++++++--------- .../com/fr/design/mainframe/JWorkBook.java | 11 ++++--- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 0d4fc318b..784a3b690 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -39,6 +39,7 @@ import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fun.FormAdaptiveConfigUIProcessor; import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PropertyItemPaneProvider; @@ -1199,24 +1200,26 @@ public class JForm extends JTemplate implements BaseJForm { getTarget().setTemplateTheme(newTheme, compatible); - fireTargetModified(shouldCreateUndoState); - reportComposite.setSelectedIndex(reportComposite.getSelectedIndex()); - TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); - DesignerContext.getDesignerFrame().resetToolkitByPlus(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() == this) { + fireTargetModified(shouldCreateUndoState); + reportComposite.setSelectedIndex(reportComposite.getSelectedIndex()); + TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); + DesignerContext.getDesignerFrame().resetToolkitByPlus(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + } super.setTemplateTheme(newTheme, compatible); } From 4a9edcecac827336e3feca70bcd125ec49e9972d Mon Sep 17 00:00:00 2001 From: Starryi Date: Sat, 4 Sep 2021 21:53:04 +0800 Subject: [PATCH 10/16] =?UTF-8?q?REPORT-58397=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=A1=BA=E5=BA=8F?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 改变顺序需要刷新列表界面 【改动思路】 同上 --- .../com/fr/design/mainframe/theme/TemplateThemeListPane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java index ad60ad581..fca01386c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java @@ -176,7 +176,10 @@ public class TemplateThemeListPane extends BasicPane { } case UPDATE: { if (existingBlock != null) { + fillContentListPane(); asyncFetchTheme(themeName); + validate(); + repaint(); } break; } From a40589755a7fc8de955ca7be33d8fbb6ff738531 Mon Sep 17 00:00:00 2001 From: Starryi Date: Sun, 5 Sep 2021 15:17:57 +0800 Subject: [PATCH 11/16] =?UTF-8?q?REPORT-58901=20FR11-=E4=BA=8C=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92-=E9=9D=9E=E4=B8=AD=E6=96=87=20=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E6=97=B6=E9=97=AA=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 国际化翻译还未进行,导致使用的内置主题国际化名称为空,进而 获取相关主题的时候无法找到 2.主题单元格样式也存在类似的问题,国际化只能在主题启动时进行, 在使用时就不能使用国际化key获取特定样式,否则切换应用语言的 情况下,将无法获取到该特定单元格样式 3. 删除主题单元格中没用的字段 【改动思路】 同上 --- .../theme/edit/CellStyleListEditPane.java | 16 ++++++++++------ .../ecpreview/AbstractECPreviewPane.java | 19 ++++++++----------- .../DefaultThemedTemplateCellElementCase.java | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java index b8fc31b6d..6b12c37d4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java @@ -229,7 +229,7 @@ public class CellStyleListEditPane extends JListControlPane { if (selectModel != null) { NameObject selectNameObject = (NameObject) selectModel.wrapper; ThemedCellStyle cellStyle = (ThemedCellStyle) (selectNameObject.getObject()); - this.shortCut.setEnabled(cellStyle.isRemovable() && !cellStyle.isDefault4New()); + this.shortCut.setEnabled(cellStyle.isRemovable() && !cellStyle.isUse4Default()); } else { this.shortCut.setEnabled(false); } @@ -266,9 +266,13 @@ public class CellStyleListEditPane extends JListControlPane { cellStyle.setName(menuName); cellStyle.setStyle(Style.getInstance()); cellStyle.setRemovable(true); - cellStyle.setImmutable(true); - cellStyle.setDefault4Absent(false); - cellStyle.setDefault4New(false); + cellStyle.setUse4Default(false); + cellStyle.setUse4BigTitle(false); + cellStyle.setUse4SmallTitle(false); + cellStyle.setUse4Header(false); + cellStyle.setUse4MainText(false); + cellStyle.setUse4SupportInfo(false); + cellStyle.setUse4HighlightText(false); return new NameObject(helper.createUnrepeatedName(this.menuName()), cellStyle); } @@ -285,7 +289,7 @@ public class CellStyleListEditPane extends JListControlPane { } public boolean acceptNameObject(Object ob) { - return !((ThemedCellStyle) ob).isDefault4New(); + return !((ThemedCellStyle) ob).isUse4Default(); } } @@ -297,7 +301,7 @@ public class CellStyleListEditPane extends JListControlPane { @Override public boolean acceptNameObject(Object ob) { - return ((ThemedCellStyle) ob).isDefault4New(); + return ((ThemedCellStyle) ob).isUse4Default(); } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java index cf9822aba..715c3f250 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java @@ -4,38 +4,35 @@ import com.fr.base.Style; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyle; import com.fr.base.theme.settings.ThemedCellStyleList; -import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.theme.preview.ThemePreviewed; import com.fr.design.mainframe.theme.preview.UINoOpaquePanel; import com.fr.design.mainframe.theme.preview.ecpreview.cell.AbstractPreviewCell; -import com.fr.design.mainframe.theme.preview.ecpreview.cell.PreviewCell; -import javax.swing.JPanel; import java.util.List; public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements ThemePreviewed { protected Style getReportHeaderStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); + return getCellStyle(cellStyleList.getUse4Header()); } protected Style getMainContentStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); + return getCellStyle(cellStyleList.getUse4MainText()); } protected Style getHighLightStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); + return getCellStyle(cellStyleList.getUse4HighlightText()); } protected Style getSmallTitleStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Small_Title")); + return getCellStyle(cellStyleList.getUse4SmallTitle()); } - private Style getCellStyle(ThemedCellStyleList cellStyleList, String styleName) { - ThemedCellStyle cellStyle = cellStyleList.find(styleName); - if (cellStyle == null) { + private Style getCellStyle(ThemedCellStyle themedCellStyle) { + if (themedCellStyle == null) { return Style.DEFAULT_STYLE; } - return cellStyle.getStyle(); + Style style = themedCellStyle.getStyle(); + return style != null ? style : Style.DEFAULT_STYLE; } protected void refresh(List list, Style style) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java index 67d8c0b2a..67be5cc9a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java @@ -34,7 +34,7 @@ public class DefaultThemedTemplateCellElementCase { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (template != null) { TemplateTheme theme = template.getTemplateTheme(); - ThemedCellStyle themedCellStyle = theme.getCellStyleList().getDefaultCellStyle4New(); + ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default(); if (themedCellStyle != null) { NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle()); cellElement.setStyle(nameStyle); From 417c65a18ed8ab4f516fa7b7f8d6d26f39474b71 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 6 Sep 2021 10:21:40 +0800 Subject: [PATCH 12/16] =?UTF-8?q?REPORT-58036=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E5=8F=91=E5=B8=83=E5=89=8D?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=B5=8B=E8=AF=95=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E9=9C=80=E8=A6=81=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 主题导出功能在11.0正式版中以插件的形式发布 【改动思路】 同上 --- .../dialog/TemplateThemeProfileDialog.java | 72 ------------------- 1 file changed, 72 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java index a1db7f565..7974097b5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java @@ -4,15 +4,7 @@ import com.fr.base.theme.TemplateTheme; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.theme.TemplateThemeProfilePane; -import com.fr.file.FILE; -import com.fr.file.FILEChooserPane; -import com.fr.file.FileFILE; -import com.fr.file.filter.ChooseFileFilter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.ListSet; -import com.fr.stable.xml.XMLPrintWriter; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -21,10 +13,6 @@ import java.awt.Dimension; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; import java.util.List; /** @@ -47,9 +35,6 @@ public class TemplateThemeProfileDialog extends Templat content.add(profilePane, BorderLayout.CENTER); setContentPane(createDialogContentPane(content, new UIButton[]{ - // 用于视觉设计师导出内置主题文件,发布前关闭 - // 后续由产品经理决定是否开启此功能 - createExportButton(profilePane), profilePane.createSaveButton(), profilePane.createSaveAsButton(this), createCancelButton() @@ -58,63 +43,6 @@ public class TemplateThemeProfileDialog extends Templat currentVisibleProfilePane = profilePane; } - private void exportTheme(T theme) { - FILEChooserPane fileChooser = FILEChooserPane.getInstance(true, true, new ChooseFileFilter() { - @Override - public boolean accept(FILE f) { - return f.isDirectory(); - } - - @Override - public String getDescription() { - return "export theme to xml"; - } - - @Override - public boolean containsExtension(String extension) { - return true; - } - - @Override - public String toString() { - return getDescription(); - } - }); - fileChooser.setCurrentDirectory(new FileFILE(new File("~/"))); - fileChooser.setFileNameTextField(theme.getName(), ".xml"); - FILE exportedFile = null; - - int result = fileChooser.showSaveDialog(DesignerContext.getDesignerFrame(), ".xml"); - if (result == FILEChooserPane.JOPTIONPANE_OK_OPTION || result == FILEChooserPane.OK_OPTION) { - exportedFile = fileChooser.getSelectedFILE(); - } - if (exportedFile == null) { - return; - } - - try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(exportedFile.getPath()))) { - XMLPrintWriter writer = XMLPrintWriter.create(bos); - theme.writeXML(writer); - writer.flush(); - writer.close(); - } catch (IOException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - public UIButton createExportButton(TemplateThemeProfilePane profilePane) { - UIButton exportButton = new UIButton(); - exportButton.setText(Toolkit.i18nText("Fine-Design_Basic_Export")); - exportButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - T theme = profilePane.updateBean(); - theme.getImageIdList().setIdList(new ListSet<>()); - exportTheme(theme); - } - }); - return exportButton; - } - private UIButton createCancelButton() { UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); button.addActionListener(new ActionListener() { From a5e44c538743761610591e133fb0177145b7330e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Sep 2021 10:42:29 +0800 Subject: [PATCH 13/16] =?UTF-8?q?REPORT-57722=20=E7=9C=8B=E7=9C=8B?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E9=97=B4=E8=B7=9D=E7=BA=BF=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E6=96=B9=E6=9C=89=E6=B2=A1=E6=9C=89=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=9A=84=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/XCreator.java | 28 --------- .../creator/XWAbsoluteBodyLayout.java | 13 ---- .../designer/creator/XWParameterLayout.java | 5 -- .../mainframe/FormSpacingLineDrawer.java | 60 ++++++++++++++++--- 4 files changed, 51 insertions(+), 55 deletions(-) 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 8b33d7532..e82528558 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 @@ -68,9 +68,6 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo protected Widget data; protected JComponent editor; protected CoverReportPane coverPanel; - - protected boolean inAbsoluteBodyLayout = false; - // XCreator加入到某些XLayoutContainer中时,能调整宽度或者高度 private int[] directions; private Rectangle backupBound; @@ -897,29 +894,4 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } return ((XCreator) this.getParent()).getLevel() + 1; } - - public boolean isAbleDrawSpacingLine() { - return !isBody() && !isParameter() && !isInPara() && isInAbsoluteBodyLayout(); - } - - public boolean isBody() { - return false; - } - - public boolean isParameter() { - return false; - } - - public boolean isInPara() { - XLayoutContainer container = XCreatorUtils.getHotspotContainer(this); - return container != null && container.acceptType(XWParameterLayout.class); - } - - public boolean isInAbsoluteBodyLayout() { - return inAbsoluteBodyLayout; - } - - public void setInAbsoluteBodyLayout(boolean inAbsoluteBodyLayout) { - this.inAbsoluteBodyLayout = inAbsoluteBodyLayout; - } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index 40786a6d5..aa5612c09 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -12,7 +12,6 @@ import com.fr.stable.core.PropertyChangeAdapter; import java.awt.Component; import java.awt.Dimension; -import java.awt.event.ContainerEvent; import java.beans.IntrospectionException; /** @@ -136,16 +135,4 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { return false; } - @Override - public void componentAdded(ContainerEvent e) { - super.componentAdded(e); - XWidgetCreator creator = (XWidgetCreator) e.getChild(); - creator.setInAbsoluteBodyLayout(true); - } - - @Override - public boolean isBody() { - return true; - } - } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java index 9fa256f8a..fc01aefaa 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java @@ -260,9 +260,4 @@ public class XWParameterLayout extends XWAbsoluteLayout { public boolean isTopable() { return false; } - - @Override - public boolean isParameter() { - return true; - } } 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 d78290810..1ed4c6cca 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 @@ -5,6 +5,9 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XElementCase; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.form.parameter.FormParaDesigner; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.utils.ComponentUtils; import com.fr.stable.Constants; import com.fr.stable.GraphDrawHelper; @@ -28,6 +31,7 @@ public class FormSpacingLineDrawer { private FormDesigner designer; private XCreator hoverCreator = null; + private XCreator selectedCreator = null; private Rectangle selectedRec; private Rectangle hoveredRec; private boolean isMouseMoveEvent = false; @@ -37,15 +41,15 @@ public class FormSpacingLineDrawer { } public void updateMouseEvent(MouseEvent e, boolean isMouseMoveEvent) { - XCreator creator = designer.getSelectionModel().getSelection().getSelectedCreator(); - if (creator != null) { + selectedCreator = designer.getSelectionModel().getSelection().getSelectedCreator(); + if (selectedCreator != null) { this.hoverCreator = getHoverComponentAt(e.getX(), e.getY()); } this.isMouseMoveEvent = isMouseMoveEvent; } public void draw(Graphics g) { - if (!isMouseMoveEvent) { + if (!isMouseMoveEvent || selectedCreator == null || hoverCreator == null) { return; } @@ -53,10 +57,6 @@ public class FormSpacingLineDrawer { return; } - if (!hoverCreator.isParentAbsolute()) { - return; - } - this.selectedRec = designer.getSelectionModel().getSelection().getRelativeBounds(); this.hoveredRec = ComponentUtils.getRelativeBounds(hoverCreator); @@ -137,13 +137,55 @@ 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) { + 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 isCompInBody() { + return isSelectedCompInBody() && isHoveredCompInBody(); + } + + private boolean isBodyAbsoluteLayout() { + return !(designer instanceof FormParaDesigner) && FormDesignerUtils.isBodyAbsolute(designer); + } + + private boolean isInAbsoluteLayout() { + return isBodyAbsoluteLayout() && hoverCreator.isParentAbsolute() && selectedCreator.isParentAbsolute(); + } + private boolean isDrawSpacingLine() { - XCreator selectedCreator = designer.getSelectionModel().getSelection().getSelectedCreator(); - return hoverCreator != null && selectedCreator != null && hoverCreator.isAbleDrawSpacingLine() && selectedCreator.isAbleDrawSpacingLine(); + return isInAbsoluteLayout() && !isSelectedRootPane() && isCompInBody(); } private AbstractFormParallelLine[] getNearestHorizontalSide() { From 97f1902490a11f5816b755c6e6968f4025da7c20 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 6 Sep 2021 10:53:41 +0800 Subject: [PATCH 14/16] =?UTF-8?q?REPORT-58513=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E8=A1=A8=E5=8D=95=E4=BF=9D=E5=AD=98-=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E6=96=B0=E5=BC=95=E6=93=8E=E8=BD=AC=E5=8C=96?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8F=98=E4=B8=BA=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/itoolbar/UIToolbar.java | 22 ++++++++++++++++++- .../mainframe/CenterRegionContainerPane.java | 8 +++++-- .../fr/design/mainframe/DesignerFrame.java | 6 ++++- .../fr/design/mainframe/DesktopCardPane.java | 2 +- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java b/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java index 347dd768f..7d5dd1a7e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java +++ b/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java @@ -2,13 +2,18 @@ package com.fr.design.gui.itoolbar; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.JTemplate; + import java.awt.Component; import java.awt.FlowLayout; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; import javax.swing.JToolBar; public class UIToolbar extends JToolBar { + Map componentState = new HashMap<>(); + public UIToolbar() { this(FlowLayout.LEFT); } @@ -36,11 +41,26 @@ public class UIToolbar extends JToolBar { } public void refreshUIToolBar() { + refreshUIToolBar(false); + } + + public void refreshUIToolBar(boolean forbid) { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (template != null) { for (int i = 0; i < getComponentCount(); i++) { Component component = getComponents()[i]; - component.setEnabled(template.checkEnable()); + if (forbid) { + componentState.put(component, component.isEnabled()); + component.setEnabled(false); + } else { + Boolean enable = componentState.get(component); + if (enable != null) { + component.setEnabled(enable); + componentState.remove(component); + } else { + component.setEnabled(template.checkEnable()); + } + } } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index 36507cf37..3ba7d3841 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -268,10 +268,14 @@ public class CenterRegionContainerPane extends JPanel { } protected void refreshUIToolBar() { + refreshUIToolBar(false); + } + + protected void refreshUIToolBar(boolean forbid) { if (toolbarComponent instanceof UIToolbar) { - ((UIToolbar ) toolbarComponent).refreshUIToolBar(); + ((UIToolbar) toolbarComponent).refreshUIToolBar(); } - combineUp.refreshUIToolBar(); + combineUp.refreshUIToolBar(forbid); getToolBarMenuDock().updateEnable(); } 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 786deb892..3e769b1ac 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 @@ -366,7 +366,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } public void refreshUIToolBar() { - CenterRegionContainerPane.getInstance().refreshUIToolBar(); + refreshUIToolBar(false); + } + + public void refreshUIToolBar(boolean forbid) { + CenterRegionContainerPane.getInstance().refreshUIToolBar(forbid); } /** diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java index 0e26ff3de..47354c540 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java @@ -122,7 +122,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener public void showCover() { transparentPane.start(); layeredPane.moveToFront(transparentPane); - DesignerContext.getDesignerFrame().refreshUIToolBar(); + DesignerContext.getDesignerFrame().refreshUIToolBar(true); EastRegionContainerPane.getInstance().updateAllPropertyPane(); JComponent downPane = WestRegionContainerPane.getInstance().getDownPane(); if (downPane instanceof BasicTableDataTreePane) { From 68a65cfee901c93de486c22f298ed00c9816e0ae Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 6 Sep 2021 15:35:28 +0800 Subject: [PATCH 15/16] =?UTF-8?q?REPORT-58513=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E8=A1=A8=E5=8D=95=E4=BF=9D=E5=AD=98-=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E6=96=B0=E5=BC=95=E6=93=8E=E8=BD=AC=E5=8C=96?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8F=98=E4=B8=BA=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/itoolbar/UIToolbar.java | 30 +++++++------------ .../mainframe/CenterRegionContainerPane.java | 19 ++++++------ .../fr/design/mainframe/DesignerFrame.java | 11 +------ .../fr/design/mainframe/DesktopCardPane.java | 27 +++++++++++++++-- .../com/fr/design/worker/save/SaveWorker.java | 1 - 5 files changed, 46 insertions(+), 42 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java b/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java index 7d5dd1a7e..73f8adab5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java +++ b/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java @@ -40,28 +40,18 @@ public class UIToolbar extends JToolBar { } } - public void refreshUIToolBar() { - refreshUIToolBar(false); + public Map getComponentState() { + Map componentState = new HashMap<>(); + for (int i = 0; i < getComponentCount(); i++) { + Component component = getComponent(i); + componentState.put(component, component.isEnabled()); + } + return componentState; } - public void refreshUIToolBar(boolean forbid) { - JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (template != null) { - for (int i = 0; i < getComponentCount(); i++) { - Component component = getComponents()[i]; - if (forbid) { - componentState.put(component, component.isEnabled()); - component.setEnabled(false); - } else { - Boolean enable = componentState.get(component); - if (enable != null) { - component.setEnabled(enable); - componentState.remove(component); - } else { - component.setEnabled(template.checkEnable()); - } - } - } + public static void resetComponentState(Map componentState) { + for (Component component : componentState.keySet()) { + component.setEnabled(componentState.get(component)); } } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index 3ba7d3841..d31b5ede0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -19,10 +19,14 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.border.MatteBorder; import java.awt.BorderLayout; +import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Insets; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + /** * @author shine @@ -96,7 +100,7 @@ public class CenterRegionContainerPane extends JPanel { } - private ToolBarMenuDock getToolBarMenuDock() { + public ToolBarMenuDock getToolBarMenuDock() { return DesignerContext.getDesignerFrame().getToolBarMenuDock(); } @@ -267,16 +271,13 @@ public class CenterRegionContainerPane extends JPanel { return centerTemplateCardPane; } - protected void refreshUIToolBar() { - refreshUIToolBar(false); - } - - protected void refreshUIToolBar(boolean forbid) { + public Map getToolbarComponentState() { + Map toolbarComponentState = new HashMap<>(); if (toolbarComponent instanceof UIToolbar) { - ((UIToolbar) toolbarComponent).refreshUIToolBar(); + toolbarComponentState.putAll(((UIToolbar) toolbarComponent).getComponentState()); } - combineUp.refreshUIToolBar(forbid); - getToolBarMenuDock().updateEnable(); + toolbarComponentState.putAll(combineUp.getComponentState()); + return toolbarComponentState; } } 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 3e769b1ac..ae67275be 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 @@ -361,18 +361,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } public DesktopCardPane getCenterTemplateCardPane() { - return CenterRegionContainerPane.getInstance().getCenterTemplateCardPane(); } - public void refreshUIToolBar() { - refreshUIToolBar(false); - } - - public void refreshUIToolBar(boolean forbid) { - CenterRegionContainerPane.getInstance().refreshUIToolBar(forbid); - } - /** * 初始menuPane的方法 方便OEM时修改该组件 */ @@ -1044,7 +1035,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/mainframe/DesktopCardPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java index 47354c540..0c10ac2e1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java @@ -10,11 +10,14 @@ import com.fr.design.data.BasicTableDataTreePane; import com.fr.design.dialog.BasicPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; +import com.fr.design.gui.itoolbar.UIToolbar; import javax.swing.JComponent; import javax.swing.JLayeredPane; import java.awt.BorderLayout; import java.awt.Component; +import java.util.HashMap; +import java.util.Map; /** @@ -33,6 +36,9 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener private TransparentPane transparentPane = new TransparentPane(); private OpenLoadingPane loadingPane = new OpenLoadingPane(); private OpenFailedPane failedPane = new OpenFailedPane(); + + Map backUpToolbarComponentState = new HashMap<>(); + private JLayeredPane layeredPane = new JLayeredPane() { @Override public void doLayout() { @@ -103,7 +109,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener } private void showOpenStatus() { - DesignerContext.getDesignerFrame().refreshUIToolBar(); + forbidToolBar(); DesignerFrameFileDealerPane.getInstance().stateChange(); EastRegionContainerPane.getInstance().updateAllPropertyPane(); JComponent downPane = WestRegionContainerPane.getInstance().getDownPane(); @@ -120,9 +126,9 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener } public void showCover() { + forbidToolBar(); transparentPane.start(); layeredPane.moveToFront(transparentPane); - DesignerContext.getDesignerFrame().refreshUIToolBar(true); EastRegionContainerPane.getInstance().updateAllPropertyPane(); JComponent downPane = WestRegionContainerPane.getInstance().getDownPane(); if (downPane instanceof BasicTableDataTreePane) { @@ -132,6 +138,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener } public void hideCover() { + recoverToolBar(); transparentPane.stop(); layeredPane.moveToFront(component); EastRegionContainerPane.getInstance().updateAllPropertyPane(); @@ -142,6 +149,22 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener } } + private void forbidToolBar() { + CenterRegionContainerPane centerRegionContainerPane = CenterRegionContainerPane.getInstance(); + backUpToolbarComponentState = centerRegionContainerPane.getToolbarComponentState(); + for (Component component : backUpToolbarComponentState.keySet()) { + component.setEnabled(false); + } + centerRegionContainerPane.getToolBarMenuDock().updateEnable(); + } + + private void recoverToolBar() { + UIToolbar.resetComponentState(backUpToolbarComponentState); + backUpToolbarComponentState.clear(); + CenterRegionContainerPane centerRegionContainerPane = CenterRegionContainerPane.getInstance(); + centerRegionContainerPane.getToolBarMenuDock().updateEnable(); + } + protected JTemplate getSelectedJTemplate() { return component; } diff --git a/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java b/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java index f47a4f88e..51a79bbad 100644 --- a/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java +++ b/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java @@ -70,7 +70,6 @@ public class SaveWorker extends SwingWorker { this.template.setSaving(false); // 恢复界面 if (slowly && ComparatorUtils.equals(this.template.getName(), HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getName())) { - DesignerContext.getDesignerFrame().refreshUIToolBar(); DesignerContext.getDesignerFrame().getCenterTemplateCardPane().hideCover(); } DesignerFrameFileDealerPane.getInstance().stateChange(); From fcf7f54abf1c54b6fc1e00adece8a6fabccf9088 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 6 Sep 2021 15:36:26 +0800 Subject: [PATCH 16/16] =?UTF-8?q?REPORT-58513=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E8=A1=A8=E5=8D=95=E4=BF=9D=E5=AD=98-=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E6=96=B0=E5=BC=95=E6=93=8E=E8=BD=AC=E5=8C=96?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8F=98=E4=B8=BA=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java b/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java index 73f8adab5..709fdece7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java +++ b/designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java @@ -12,8 +12,6 @@ import javax.swing.JToolBar; public class UIToolbar extends JToolBar { - Map componentState = new HashMap<>(); - public UIToolbar() { this(FlowLayout.LEFT); }