From 5c7c4bd888fdaf105ef70af64b056430e7d12bf7 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 27 Aug 2021 11:00:23 +0800 Subject: [PATCH 01/23] =?UTF-8?q?REPORT-58136=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=97=A0=E6=B3=95=E6=96=B0=E5=BB=BA=E5=86=B3?= =?UTF-8?q?=E7=AD=96=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/JTemplateNameHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java index 4e201a5ef..607c91aef 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java @@ -53,6 +53,9 @@ public class JTemplateNameHelper { * @Date 2021/4/9 11:13 **/ private static Integer getFileNameIndex(String prefix, String fileName) { + if (fileName.length() <= prefix.length()) { + return null; + } char[] chars = new char[fileName.length()]; int i = 0; for (; i < fileName.length(); i++) { From c210b8387adf9935622806ae5dbdf2dbcf3e94fc Mon Sep 17 00:00:00 2001 From: vito Date: Mon, 6 Sep 2021 14:16:59 +0800 Subject: [PATCH 02/23] =?UTF-8?q?REPORT-58799=E3=80=90=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E3=80=91=E6=A8=A1=E7=89=88=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=8F=90=E7=A4=BA=E6=97=A0=E6=B3=95=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/app/DesignerAppUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java index 437458c9a..218ee4728 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java @@ -27,6 +27,7 @@ import com.fr.third.guava.cache.CacheBuilder; import com.fr.third.guava.collect.Multimap; import com.fr.workspace.WorkContext; +import javax.swing.SwingUtilities; import java.time.Duration; import java.util.Collection; import java.util.Map; @@ -183,7 +184,7 @@ public class DesignerAppUtils { // 试图获取多行读取错误提示并缓存待处理列表 String detail = dealWithErrorDetailMultiLineAndCache(path); if (detail.length() > 0) { - UIUtil.invokeLaterIfNeeded(() -> { + SwingUtilities.invokeLater(() -> { if (WorkContext.getCurrent().isLocal()) { UIExpandDialog.Builder() .owner(DesignerContext.getDesignerFrame()) From b8ccf0865e0ce908b4a922fed8a536bffa79c69c Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 1 Sep 2021 11:28:13 +0800 Subject: [PATCH 03/23] =?UTF-8?q?REPORT-58200=20=E5=88=9D=E6=AC=A1?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E7=9A=8410.0=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E6=88=B7=E7=9B=AE=E5=BD=95=E4=B8=8B=E4=BC=9A?= =?UTF-8?q?=E7=94=9F=E6=88=90.finereport80=E7=BC=93=E5=AD=98=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index effd32b14..717faebe1 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -403,9 +403,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } File envHome = new File(userHome + File.separator + "." + ProductConstants.APP_NAME + version); - if (!envHome.exists()) { - StableUtils.mkdirs(envHome); - } return envHome.getAbsolutePath(); } From 8804789738b514c02ce8afaf6aaaee3bf9cda878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 6 Sep 2021 17:38:56 +0800 Subject: [PATCH 04/23] =?UTF-8?q?CHART-20498=20=E4=B8=BB=E9=A2=98=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E6=8E=A7=E4=BB=B6=E9=80=89=E4=B8=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/style/color/ColorControlWindow.java | 13 +++++++++++-- .../chart/gui/style/series/UIColorPickerPane.java | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java index 7fccbfde2..b84173f1d 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java @@ -62,19 +62,28 @@ public abstract class ColorControlWindow extends JPopupMenu { } protected void initSelectionPopupPane(boolean isSupportTransparent) { - selectionPopupPane = new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor()); + selectionPopupPane = createColorSelectionPopupPane(isSupportTransparent); this.add(selectionPopupPane, BorderLayout.CENTER); } + protected ColorSelectionPopupPane createColorSelectionPopupPane(boolean isSupportTransparent) { + return new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor()); + } + protected boolean supportThemeColor(){ return true; } - class ColorSelectionPopupPane extends NewColorSelectPane { + protected class ColorSelectionPopupPane extends NewColorSelectPane { private static final long serialVersionUID = 7822856562329146354L; public ColorSelectionPopupPane(boolean isSupportTransparent, boolean isSupportThemeColor) { + this(isSupportTransparent, isSupportThemeColor, null); + } + + public ColorSelectionPopupPane(boolean isSupportTransparent, boolean isSupportThemeColor, Color color) { super(isSupportTransparent, isSupportThemeColor); + this.setColor(color); this.addChangeListener(new ChangeListener() { @Override diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index 6529efce0..736ae5b3f 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -370,6 +370,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { ColorRecButton.this.repaint(); } + @Override + protected ColorSelectionPopupPane createColorSelectionPopupPane(boolean isSupportTransparent) { + return new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor(), ColorRecButton.this.color); + } + }; } From 9d23edf0e1102635db099774d1ac449129701cd4 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 6 Sep 2021 19:46:49 +0800 Subject: [PATCH 05/23] =?UTF-8?q?REPORT-58705=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E6=9C=80=E8=BF=91=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E9=A2=9C=E8=89=B2=E8=BF=98=E4=BF=9D=E7=95=99=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=89=B2=E5=9D=90=E6=A0=87=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/preview/ReportThemePreviewPane.java | 6 ++- .../ecpreview/AbstractECPreviewPane.java | 3 ++ .../ecpreview/ECReportPreviewPane.java | 39 ++++++++++++------- .../ecpreview/cell/CornerPreviewCell.java | 4 +- .../background/gradient/GradientBar.java | 1 + .../com/fr/design/style/color/ColorCell.java | 5 +++ .../style/color/NewColorSelectPane.java | 4 +- 7 files changed, 40 insertions(+), 22 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java index e4b4ee7a9..4ceec636d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java @@ -22,6 +22,7 @@ import com.fr.plugin.chart.vanchart.VanChart; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; @@ -40,11 +41,12 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane { + protected Style getReportBigTitleStyle(ThemedCellStyleList cellStyleList) { + return getCellStyle(cellStyleList.getUse4BigTitle()); + } protected Style getReportHeaderStyle(ThemedCellStyleList cellStyleList) { return getCellStyle(cellStyleList.getUse4Header()); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java index 4274950cf..231233196 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.theme.preview.ecpreview; import com.fr.base.theme.ReportTheme; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyleList; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.preview.ThemePreviewed; import com.fr.design.mainframe.theme.preview.UINoOpaquePanel; @@ -21,6 +22,7 @@ import java.util.ArrayList; import java.util.List; public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreviewed { + private List headerTitleCellList = new ArrayList<>(); private List headerCellList = new ArrayList<>(); private List titleCellList = new ArrayList<>(); private List contentCellList = new ArrayList<>(); @@ -56,20 +58,26 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview private JPanel createNorthPane() { JPanel northPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); - CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{"产品", "数据", "统计维度"}, new Point2D[]{new Point(132, 75), new Point(189, 53)}); - cornerCell.setPreferredSize(new Dimension(189, 75)); + AbstractPreviewCell bigTitleCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Big_Title")); + bigTitleCell.setPreferredSize(new Dimension(615, 46)); + headerTitleCellList.add(bigTitleCell); + northPane.add(bigTitleCell, BorderLayout.NORTH); + CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Product"), + Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Data"), Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Statistical_Dimension")}, + new Point2D[]{new Point(159, 71), new Point(226, 49)}); + cornerCell.setPreferredSize(new Dimension(226, 71)); headerCellList.add(cornerCell); northPane.add(cornerCell, BorderLayout.WEST); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); northPane.add(centerPane, BorderLayout.CENTER); - PreviewCell cell = new PreviewCell("按地区统计"); + PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Statistical_By_Area")); titleCellList.add(cell); cell.setPreferredSize(new Dimension(308, 38)); centerPane.add(cell, BorderLayout.NORTH); JPanel eastSouthPane = new UINoOpaquePanel(new GridLayout()); - PreviewCell cell1 = new PreviewCell("华东"); - PreviewCell cell2 = new PreviewCell("华南"); - PreviewCell cell3 = new PreviewCell("小计"); + PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_East_China")); + PreviewCell cell2 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_South_China")); + PreviewCell cell3 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Subtotal")); headerCellList.add(cell1); headerCellList.add(cell2); headerCellList.add(cell3); @@ -84,24 +92,24 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); JPanel westPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); centerPane.add(westPane, BorderLayout.WEST); - PreviewCell cell1 = new PreviewCell("饮料"); + PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Drink")); titleCellList.add(cell1); - cell1.setPreferredSize(new Dimension(94, 183)); + cell1.setPreferredSize(new Dimension(112, 153)); westPane.add(cell1, BorderLayout.WEST); - JPanel gridPane = new UINoOpaquePanel(new GridLayout(6, 1)); - for (int i = 0; i < 6; i++) { - PreviewCell cell = new PreviewCell("苹果汁"); - cell.setPreferredSize(new Dimension(95, 31)); + JPanel gridPane = new UINoOpaquePanel(new GridLayout(5, 1)); + for (int i = 0; i < 5; i++) { + PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Apple_Juice")); + cell.setPreferredSize(new Dimension(114, 31)); headerCellList.add(cell); gridPane.add(cell); } westPane.add(gridPane, BorderLayout.CENTER); - JPanel innerCenterPane = new UINoOpaquePanel(new GridLayout(6, 3)); + JPanel innerCenterPane = new UINoOpaquePanel(new GridLayout(5, 3)); centerPane.add(innerCenterPane, BorderLayout.CENTER); - for (int i = 0; i < 18; i++) { + for (int i = 0; i < 15; i++) { PreviewCell cell = new PreviewCell("35600"); - cell.setPreferredSize(new Dimension(102, 31)); + cell.setPreferredSize(new Dimension(123, 31)); if ((i + 1) % 3 == 0) { highLightCellList.add(cell); } else { @@ -117,6 +125,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview @Override public void refresh(TemplateTheme theme) { ThemedCellStyleList cellStyleConfig = theme.getCellStyleList(); + refresh(headerTitleCellList, getReportBigTitleStyle(cellStyleConfig)); refresh(headerCellList, getReportHeaderStyle(cellStyleConfig)); refresh(contentCellList, getMainContentStyle(cellStyleConfig)); refresh(titleCellList, getSmallTitleStyle(cellStyleConfig)); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/CornerPreviewCell.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/CornerPreviewCell.java index 00cb90774..c82ea9fa9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/CornerPreviewCell.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/CornerPreviewCell.java @@ -21,8 +21,8 @@ public class CornerPreviewCell extends AbstractPreviewCell { FRFont frFont = style.getFRFont(); g2d.setPaint(frFont.getForeground()); g2d.drawString(values[0], 23, 53); - GraphDrawHelper.drawRotatedString(g2d, values[1], 104, 50, 30); - g2d.drawString(values[2], 128, 23); + GraphDrawHelper.drawRotatedString(g2d, values[1], 128, 50, 30); + g2d.drawString(values[2], 150, 23); //画分割线 for (int i = 0; i < point2DS.length; i++) { g2d.draw(new Line2D.Double(0, 0, point2DS[i].getX(), point2DS[i].getY())); //画线 diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index aac5c837a..97a19f464 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -146,6 +146,7 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, return false; } }; + colorPane.setColor(getColor()); colorPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { hidePopupMenu(); diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorCell.java b/designer-base/src/main/java/com/fr/design/style/color/ColorCell.java index 3e5636dc3..4cc3e41ce 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorCell.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorCell.java @@ -10,6 +10,7 @@ import java.awt.event.MouseEvent; import javax.swing.JComponent; +import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.general.ComparatorUtils; @@ -100,6 +101,10 @@ public class ColorCell extends JComponent implements ColorSelectable { if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) { colorSelectable.setColor(this.getColor()); colorSelectable.colorSetted(this); + if (this.getColor() != null) { + int rgb = this.getColor().getRGB(); + DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(new Color(rgb)); + } } if (e != null) { diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index 7c471abcd..f38e69a8b 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -332,9 +332,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { changeListener.stateChanged(evt); } } - if (color != null) { - DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color.getColor()); - } + this.repaint(); } From 58a2121afb277b989d1da24b28e32727433eb1bd Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 7 Sep 2021 15:10:00 +0800 Subject: [PATCH 06/23] =?UTF-8?q?REPORT-58211=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E8=83=8C=E6=99=AF=E6=B8=90=E5=8F=98=E8=89=B2?= =?UTF-8?q?=EF=BC=8C=E5=8F=B3=E8=BE=B9=E6=8C=89=E9=92=AE=E4=B8=8D=E5=A5=BD?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/theme/TemplateThemeProfilePane.java | 2 +- .../mainframe/theme/dialog/TemplateThemeProfileDialog.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index 9e63e2240..a19b1c2b8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -71,7 +71,7 @@ public abstract class TemplateThemeProfilePane extends public static final int PREVIEW_PANE_WIDTH = LEFT_TITLE_PANE_WIDTH - 10; public static final int PREVIEW_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT - TITLE_BORDER_FONT - 16; - public static final int RIGHT_PANE_WIDTH = 352; + public static final int RIGHT_PANE_WIDTH = 362; public static final int RIGHT_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT; public static final int COLOR_SCHEME_TITLE_PANE_WIDTH = 298; public static final int COLOR_SCHEME_TITLE_PANE_HEIGHT = 174 + TITLE_BORDER_FONT / 2; 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 7974097b5..0ddabe076 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 @@ -24,7 +24,7 @@ public class TemplateThemeProfileDialog extends Templat private static final int PADDING_VERTICAL = 4; public static TemplateThemeProfilePane currentVisibleProfilePane; - public static final int CONTENT_WIDTH = 1000; + public static final int CONTENT_WIDTH = 1010; public static final int CONTENT_HEIGHT = 542; public TemplateThemeProfileDialog(Window parent, TemplateThemeProfilePane profilePane) { From 64c33589da5a5aca6d74fa70848abd5d3851d4c6 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 7 Sep 2021 19:06:54 +0800 Subject: [PATCH 07/23] =?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/TemplateThemeManageDialog.java | 57 +++++++++++++++--- .../dialog/TemplateThemeProfileDialog.java | 58 ++++++++++++++----- .../AbstractThemeManageActionProvider.java | 23 ++++++++ .../AbstractThemeProfileActionProvider.java | 23 ++++++++ .../provider/ThemeManageActionProvider.java | 28 +++++++++ .../provider/ThemeProfileActionProvider.java | 27 +++++++++ 6 files changed, 191 insertions(+), 25 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeManageActionProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeProfileActionProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeManageActionProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeProfileActionProvider.java 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 f306fcacf..0049092a0 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 @@ -1,17 +1,20 @@ package com.fr.design.mainframe.theme.dialog; import com.fr.base.theme.FormTheme; +import com.fr.base.theme.FormThemeConfig; import com.fr.base.theme.ReportTheme; +import com.fr.base.theme.ReportThemeConfig; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.UITabbedPane; 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 com.fr.design.mainframe.theme.provider.ThemeManageActionProvider; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -20,6 +23,9 @@ import java.awt.Dimension; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; /** * @author Starryi @@ -35,7 +41,37 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog { TemplateThemeManageDialogContentPane.CONTENT_WIDTH, TemplateThemeManageDialogContentPane.CONTENT_HEIGHT); contentPane = new TemplateThemeManageDialogContentPane(); - setContentPane(createDialogContentPane(contentPane, new UIButton[]{ createCompleteButton() })); + setContentPane(createDialogContentPane(contentPane, createActionButtons())); + } + + @Override + public void exit(){ + contentPane.exit(); + super.exit(); + } + + private UIButton[] createActionButtons() { + List uiButtonList = new ArrayList<>(); + + Set providers = ExtraDesignClassManager.getInstance().getArray(ThemeManageActionProvider.MARK_STRING); + for (ThemeManageActionProvider provider : providers) { + uiButtonList.add(provider.createButton(new ThemeManageActionProvider.ThemeManageActionContext() { + + @Override + public TemplateThemeDialog getDialog() { + return TemplateThemeManageDialog.this; + } + + @Override + public TemplateThemeConfig getConfig() { + return contentPane.getConfig(); + } + })); + } + + uiButtonList.add(createCompleteButton()); + + return uiButtonList.toArray(new UIButton[]{}); } private UIButton createCompleteButton() { @@ -49,16 +85,11 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog { return button; } - @Override - public void exit(){ - contentPane.exit(); - super.exit(); - } - 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 UITabbedPane tabbedPane; private final TemplateThemeManagePane formThemesManagerPane; private final TemplateThemeManagePane reportThemesManagerPane; @@ -67,7 +98,7 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog { setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT)); - UITabbedPane tabbedPane = new UITabbedPane(); + tabbedPane = new UITabbedPane(); add(tabbedPane, BorderLayout.NORTH); formThemesManagerPane = TemplateThemeManagePane.createFormThemesManagerPane(); @@ -88,6 +119,14 @@ public class TemplateThemeManageDialog extends TemplateThemeDialog { } } + public TemplateThemeConfig getConfig() { + if (tabbedPane.getSelectedIndex() == 0) { + return FormThemeConfig.getInstance(); + } else { + return ReportThemeConfig.getInstance(); + } + } + public void exit() { formThemesManagerPane.stopListenThemeConfig(); formThemesManagerPane.stopAsyncFetchTheme(); 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 0ddabe076..3a6a9d383 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 @@ -1,10 +1,12 @@ package com.fr.design.mainframe.theme.dialog; import com.fr.base.theme.TemplateTheme; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.TemplateThemeProfilePane; +import com.fr.design.mainframe.theme.provider.ThemeProfileActionProvider; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -13,7 +15,9 @@ import java.awt.Dimension; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * @author Starryi @@ -34,26 +38,11 @@ public class TemplateThemeProfileDialog extends Templat content.setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT)); content.add(profilePane, BorderLayout.CENTER); - setContentPane(createDialogContentPane(content, new UIButton[]{ - profilePane.createSaveButton(), - profilePane.createSaveAsButton(this), - createCancelButton() - })); + setContentPane(createDialogContentPane(content, createActionButtons(profilePane))); currentVisibleProfilePane = profilePane; } - private UIButton createCancelButton() { - UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); - button.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - exit(); - } - }); - return button; - } - @Override public void exit() { currentVisibleProfilePane = null; @@ -74,4 +63,41 @@ public class TemplateThemeProfileDialog extends Templat protected int getPaddingVertical(){ return PADDING_VERTICAL; } + + + private UIButton[] createActionButtons(final TemplateThemeProfilePane profilePane) { + List uiButtonList = new ArrayList<>(); + + Set providers = ExtraDesignClassManager.getInstance().getArray(ThemeProfileActionProvider.MARK_STRING); + for (ThemeProfileActionProvider provider : providers) { + uiButtonList.add(provider.createButton(new ThemeProfileActionProvider.ThemeProfileActionContext() { + @Override + public TemplateThemeDialog getDialog() { + return TemplateThemeProfileDialog.this; + } + + @Override + public TemplateThemeProfilePane getProfilePane() { + return profilePane; + } + })); + } + + uiButtonList.add(profilePane.createSaveButton()); + uiButtonList.add(profilePane.createSaveAsButton(TemplateThemeProfileDialog.this)); + uiButtonList.add(createCancelButton()); + + return uiButtonList.toArray(new UIButton[]{}); + } + + private UIButton createCancelButton() { + UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); + button.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + exit(); + } + }); + return button; + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeManageActionProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeManageActionProvider.java new file mode 100644 index 000000000..6d9744693 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeManageActionProvider.java @@ -0,0 +1,23 @@ +package com.fr.design.mainframe.theme.provider; + +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/7 + */ +@API(level = ThemeManageActionProvider.CURRENT_LEVEL) +public abstract class AbstractThemeManageActionProvider extends AbstractProvider implements ThemeManageActionProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeProfileActionProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeProfileActionProvider.java new file mode 100644 index 000000000..0ff446e80 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/AbstractThemeProfileActionProvider.java @@ -0,0 +1,23 @@ +package com.fr.design.mainframe.theme.provider; + +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/7 + */ +@API(level = ThemeProfileActionProvider.CURRENT_LEVEL) +public abstract class AbstractThemeProfileActionProvider extends AbstractProvider implements ThemeProfileActionProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeManageActionProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeManageActionProvider.java new file mode 100644 index 000000000..fd9f452f5 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeManageActionProvider.java @@ -0,0 +1,28 @@ +package com.fr.design.mainframe.theme.provider; + +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.TemplateThemeConfig; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.mainframe.theme.dialog.TemplateThemeDialog; +import com.fr.stable.fun.mark.Mutable; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/7 + */ +public interface ThemeManageActionProvider extends Mutable { + + String MARK_STRING = "ThemeManageActionProvider"; + + int CURRENT_LEVEL = 1; + + UIButton createButton(ThemeManageActionContext context); + + interface ThemeManageActionContext { + + TemplateThemeDialog getDialog(); + + TemplateThemeConfig getConfig(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeProfileActionProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeProfileActionProvider.java new file mode 100644 index 000000000..cabf0a13a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/provider/ThemeProfileActionProvider.java @@ -0,0 +1,27 @@ +package com.fr.design.mainframe.theme.provider; + +import com.fr.base.theme.TemplateTheme; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.mainframe.theme.TemplateThemeProfilePane; +import com.fr.design.mainframe.theme.dialog.TemplateThemeDialog; +import com.fr.stable.fun.mark.Mutable; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/7 + */ +public interface ThemeProfileActionProvider extends Mutable { + + String MARK_STRING = "ThemeProfileActionProvider"; + + int CURRENT_LEVEL = 1; + + UIButton createButton(ThemeProfileActionContext context); + + interface ThemeProfileActionContext { + TemplateThemeDialog getDialog(); + + TemplateThemeProfilePane getProfilePane(); + } +} From 787c8e70b1ffaebf4fb59866c5e035d73a55132b Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 8 Sep 2021 16:52:44 +0800 Subject: [PATCH 08/23] =?UTF-8?q?REPORT-59077=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E9=85=8D=E8=89=B2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AF=B9=E4=BF=9D=E5=AD=98=E6=8C=89=E9=92=AE=E6=9C=89?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=EF=BC=8C=E5=8F=AF=E8=83=BD=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=86=85=E7=BD=AE=E4=B8=BB=E9=A2=98=E8=A2=AB=E5=88=A0=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 主题配色编辑时需要刷新主题编辑面板以响应配色 变化,刷新是通过populateBean完成的,但同时 该方法会导致保存按钮和名称编辑框的状态被重置。 配色编辑希望更新的实际上只包括扩展色面板以及 下方的自定义编辑面板,如背景/单元格/组件样式 等 【改动思路】 同标题 --- .../mainframe/theme/FormThemeProfilePane.java | 11 ++-------- .../theme/ReportThemeProfilePane.java | 10 ++------- .../theme/TemplateThemeProfilePane.java | 21 +++++++++++-------- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java index ef99423be..f34f8a27f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java @@ -59,17 +59,10 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { } @Override - public void populateBean(FormTheme theme) { - super.populateBean(theme); - - isPopulating = true; - + public void populateBean4CustomEditors(FormTheme theme) { + super.populateBean4CustomEditors(theme); formBodyStyleSettingPane.populateBean(theme.getBodyStyle()); componentStyleSettingPane.populateBean(theme.getComponentStyle()); - - themePreviewPane.refresh(theme); - - isPopulating = false; } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java index 5a1bff3c0..1158a8eb5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java @@ -35,15 +35,9 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane extends T theme = updateBean(); FineColorManager.traverse(theme, replaceByColorScheme); - populateBean(theme); - + populateBean4CustomEditors(theme); //图表渐变色 chartStyleSettingPane.populateGradientBar(colors); + + themePreviewPane.refresh(theme); } public void populateBean(T theme) { - try { - this.theme = (T) theme.clone(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + this.theme = theme; isPopulating = true; String name = theme.getName(); @@ -345,14 +342,20 @@ public abstract class TemplateThemeProfilePane extends saveAsButton.setEnabled(!currentIsNewTheme); } - cellStyleSettingPane.populateBean(theme.getCellStyleList()); colorListPane.populate(theme.getColorScheme().getColors()); colorListExtendedPane.populate(colorListPane.update()); - chartStyleSettingPane.populateBean(theme.getChartStyle()); + + populateBean4CustomEditors(theme); + themePreviewPane.refresh(theme); isPopulating = false; } + protected void populateBean4CustomEditors(T theme) { + cellStyleSettingPane.populateBean(theme.getCellStyleList()); + chartStyleSettingPane.populateBean(theme.getChartStyle()); + } + public T updateBean() { if (theme == null) { theme = config.createNewTheme(); From 48d4c2ab9f0116574e24db8be39f7cf625075879 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Sep 2021 09:39:35 +0800 Subject: [PATCH 09/23] =?UTF-8?q?REPORT-58592=20=E6=97=A5=E8=AF=AD?= =?UTF-8?q?=E7=89=88=E8=AE=BE=E8=AE=A1=E5=99=A8=20=E5=BC=95=E7=94=A8css?= =?UTF-8?q?=E5=92=8CJavaScript=E7=9A=84=E9=80=89=E6=8B=A9=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/design/i18n/dimension_en.properties | 3 ++- .../resources/com/fr/design/i18n/dimension_ja_JP.properties | 3 ++- .../resources/com/fr/design/i18n/dimension_ko_KR.properties | 3 ++- .../resources/com/fr/design/i18n/dimension_zh.properties | 3 ++- .../resources/com/fr/design/i18n/dimension_zh_TW.properties | 3 ++- .../src/main/java/com/fr/design/webattr/WebCssPane.java | 3 ++- .../src/main/java/com/fr/design/webattr/WebJsPane.java | 5 +++-- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index dd33c6a6a..ef851ffe3 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -6,4 +6,5 @@ com.fr.design.report.ReportColumnsPane=800*600 com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.design.version.check.dialog=490*95 com.fr.design.version.detail.label=750*30 -com.fr.design.version.detail.dialog=900*500 \ No newline at end of file +com.fr.design.version.detail.dialog=900*500 +com.fr.design.web.pane.text.field=450*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index b67a913e7..379c25744 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -5,4 +5,5 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280 com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.design.version.check.dialog=430*95 com.fr.design.version.detail.label=650*30 -com.fr.design.version.detail.dialog=800*500 \ No newline at end of file +com.fr.design.version.detail.dialog=800*500 +com.fr.design.web.pane.text.field=400*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 862580eed..62ee87a7c 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -5,4 +5,5 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280 com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.design.version.check.dialog=450*95 com.fr.design.version.detail.label=700*30 -com.fr.design.version.detail.dialog=850*500 \ No newline at end of file +com.fr.design.version.detail.dialog=850*500 +com.fr.design.web.pane.text.field=450*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index 5a325b16b..fff64947d 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -6,4 +6,5 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 com.fr.env.RemoteEnvPane.dialog=308*132 com.fr.design.version.check.dialog=230*95 com.fr.design.version.detail.label=450*30 -com.fr.design.version.detail.dialog=600*500 \ No newline at end of file +com.fr.design.version.detail.dialog=600*500 +com.fr.design.web.pane.text.field=450*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 1be37f9c7..4b2de3f02 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -5,4 +5,5 @@ com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 com.fr.env.RemoteEnvPane.dialog=308*132 com.fr.design.version.check.dialog=230*95 com.fr.design.version.detail.label=450*30 -com.fr.design.version.detail.dialog=600*500 \ No newline at end of file +com.fr.design.version.detail.dialog=600*500 +com.fr.design.web.pane.text.field=450*20 \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java index 9ebbf875f..7dcd3e21b 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java @@ -5,6 +5,7 @@ import com.fr.design.gui.frpane.EditingStringListPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.mainframe.DesignerContext; import com.fr.design.widget.FRWidgetFactory; import com.fr.file.FILE; @@ -38,7 +39,7 @@ public class WebCssPane extends BasicPane { JPanel outnorth = new JPanel(new BorderLayout(0, 5)); JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT,8,0)); localText = new UITextField(); - localText.setPreferredSize(new Dimension(450, 20)); + localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field")); localText.setEditable(false); chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection")); chooseFile.setPreferredSize(new Dimension(75, 23)); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java index b2934b10e..7b371802b 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java @@ -7,6 +7,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.mainframe.DesignerContext; import com.fr.design.widget.FRWidgetFactory; import com.fr.file.FILE; @@ -66,8 +67,8 @@ public class WebJsPane extends BasicPane { localText = new UITextField(); localText.setEditable(false); urlText = new UITextField(); - localText.setPreferredSize(new Dimension(450, 20)); - urlText.setPreferredSize(new Dimension(450, 20)); + localText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field")); + urlText.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.web.pane.text.field")); urlText.addKeyListener(urlTextListener); urlText.setEnabled(false); chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Selection")); From 2bfab3ce67865f948c180fc83367d42d2ca0a80d Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Sep 2021 09:46:24 +0800 Subject: [PATCH 10/23] =?UTF-8?q?REPORT-58592=20=E6=97=A5=E8=AF=AD?= =?UTF-8?q?=E7=89=88=E8=AE=BE=E8=AE=A1=E5=99=A8=20=E5=BC=95=E7=94=A8css?= =?UTF-8?q?=E5=92=8CJavaScript=E7=9A=84=E9=80=89=E6=8B=A9=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/JTemplateNameHelper.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java index 607c91aef..4e201a5ef 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateNameHelper.java @@ -53,9 +53,6 @@ public class JTemplateNameHelper { * @Date 2021/4/9 11:13 **/ private static Integer getFileNameIndex(String prefix, String fileName) { - if (fileName.length() <= prefix.length()) { - return null; - } char[] chars = new char[fileName.length()]; int i = 0; for (; i < fileName.length(); i++) { From 7890ad0d1b8c1a524066f5b88fb0a50e07976fe5 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 9 Sep 2021 09:54:18 +0800 Subject: [PATCH 11/23] =?UTF-8?q?REPORT-59097=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E6=82=AC=E6=B5=AE=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E9=BB=98=E8=AE=A4=E6=A0=B7=E5=BC=8F=EF=BC=8C=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=98=AF=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 设计器创建的悬浮元素样式均为当前模版主题中的"默认"样式 【改动思路】 同标题 --- .../utils/DefaultThemedFloatElement.java | 41 +++++++++++++++++++ .../actions/insert/flot/ChartFloatAction.java | 3 +- .../insert/flot/FormulaFloatAction.java | 3 +- .../actions/insert/flot/ImageFloatAction.java | 3 +- .../insert/flot/TextBoxFloatAction.java | 3 +- 5 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java new file mode 100644 index 000000000..e1e2e4c15 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedFloatElement.java @@ -0,0 +1,41 @@ +package com.fr.design.mainframe.theme.utils; + +import com.fr.base.NameStyle; +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.settings.ThemedCellStyle; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.JTemplate; +import com.fr.report.cell.FloatElement; +import com.fr.stable.unit.UNIT; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/9 + */ +public class DefaultThemedFloatElement { + public static FloatElement createInstance() { + return themingFloatElement(new FloatElement()); + } + + public static FloatElement createInstance(Object value) { + return themingFloatElement(new FloatElement(value)); + } + + public static FloatElement createInstance(UNIT leftDistance, UNIT topDistance, UNIT width, UNIT height, Object value) { + return themingFloatElement(new FloatElement(leftDistance, topDistance, width, height, value)); + } + + private static FloatElement themingFloatElement(FloatElement floatElement) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template != null) { + TemplateTheme theme = template.getTemplateTheme(); + ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default(); + if (themedCellStyle != null) { + NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle()); + floatElement.setStyle(nameStyle); + } + } + return floatElement; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java index 67fcaae59..58292bbf2 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java @@ -13,6 +13,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement; import com.fr.design.menu.MenuKeySet; import com.fr.design.module.DesignModuleFactory; import com.fr.grid.Grid; @@ -90,7 +91,7 @@ public class ChartFloatAction extends ElementCaseAction { public void doOk() { isRecordNeeded = true; FloatElement newFloatElement; - newFloatElement = new FloatElement(chartDialog.getChartCollection()); + newFloatElement = DefaultThemedFloatElement.createInstance(chartDialog.getChartCollection()); newFloatElement.setWidth(new OLDPIX(BaseChartCollection.CHART_DEFAULT_WIDTH)); newFloatElement.setHeight(new OLDPIX(BaseChartCollection.CHART_DEFAULT_HEIGHT)); diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java index 9cbd7e876..dbd9d4be6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/FormulaFloatAction.java @@ -14,6 +14,7 @@ import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement; import com.fr.design.menu.MenuKeySet; import com.fr.grid.Grid; @@ -99,7 +100,7 @@ public class FormulaFloatAction extends ElementCaseAction { } reportPane.stopEditing(); - final FloatElement floatElement = new FloatElement(); + final FloatElement floatElement = DefaultThemedFloatElement.createInstance(); final UIFormula formulaPane = FormulaFactory.createFormulaPane(); formulaPane.populate(BaseFormula.createFormulaBuilder().build()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java index e514c88df..7eb9146ea 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ImageFloatAction.java @@ -12,6 +12,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement; import com.fr.design.menu.MenuKeySet; import com.fr.design.report.SelectImagePane; @@ -73,7 +74,7 @@ public class ImageFloatAction extends ElementCaseAction { reportPane.stopEditing(); - final FloatElement floatElement = new FloatElement(); + final FloatElement floatElement = DefaultThemedFloatElement.createInstance(); final SelectImagePane selectImagePane = new SelectImagePane(); selectImagePane.populate(floatElement); diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java index 82aa17f2d..26aad41e2 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/TextBoxFloatAction.java @@ -6,6 +6,7 @@ package com.fr.design.actions.insert.flot; import com.fr.base.DynamicUnitList; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedFloatElement; import com.fr.design.menu.MenuKeySet; import com.fr.grid.Grid; @@ -59,7 +60,7 @@ public class TextBoxFloatAction extends AbstractShapeAction { if (jws == null) { return; } - FloatElement floatElement = new FloatElement("Text"); + FloatElement floatElement = DefaultThemedFloatElement.createInstance("Text"); this.startDraw(floatElement); doWithDrawingFloatElement(); } From 990885a22ee4a9178a69ee8bea10238061fe99d9 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Sep 2021 14:19:30 +0800 Subject: [PATCH 12/23] =?UTF-8?q?REPORT-59063=20CRM=20=E5=86=85=E5=AD=98?= =?UTF-8?q?=E9=87=8C=E6=8A=A5=E8=A1=A8=E5=9D=97=E7=BC=A9=E7=95=A5=E5=9B=BE?= =?UTF-8?q?=E5=8D=A0=E7=94=A8=E5=86=85=E5=AD=98=E5=A4=AA=E5=A4=A7=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/app/FormApp.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java index f28e2c984..286890303 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java @@ -21,6 +21,8 @@ import com.fr.form.main.Form; import com.fr.form.ui.container.WBorderLayout; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.report.util.ReadXmlType; +import com.fr.report.util.ReadXmlTypeLocalManager; import com.fr.stable.Constants; import com.fr.stable.bridge.StableFactory; import org.jetbrains.annotations.Nullable; @@ -90,13 +92,16 @@ class FormApp extends AbstractAppProvider { @Nullable private Form getForm(FILE tplFile) { + ReadXmlTypeLocalManager.setReadXmlType(ReadXmlType.DESIGN); Form form = asIOFile(tplFile); + ReadXmlTypeLocalManager.remove(); if (form != null) { DesignerAppUtils.dealWithTemplateIOError(tplFile.getPath()); } return form; } + @Override public Form asIOFile(FILE file) { From 80af035ce63bd01f092556ce21ec0386d9c2226a Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 9 Sep 2021 15:43:34 +0800 Subject: [PATCH 13/23] =?UTF-8?q?REPORT-51919=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E5=A4=8D=E7=94=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=80=82=E9=85=8D=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 创建复用组件时新增适用于复用组件模版主题的字段,值为当前模版的主题名称 2. 使用复用组件时,仅复用组件内元素设置了跟随主题,且复用组件适用的模版主题名称与 当前模版名称相同时,才设置主题样式 【改动思路】 同标题 --- .../designer/creator/XCreatorUtils.java | 36 +++++++++++++++++++ .../com/fr/design/mainframe/FormDesigner.java | 36 ------------------- .../share/generate/task/ComponentCreator.java | 10 ++++++ .../share/ui/block/LocalWidgetBlock.java | 3 +- .../share/ui/block/OnlineWidgetBlock.java | 9 ++++- .../share/util/ShareComponentUtils.java | 16 +++++++++ 6 files changed, 72 insertions(+), 38 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 945d3bfdd..6e44ad196 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -3,6 +3,11 @@ */ package com.fr.design.designer.creator; +import com.fr.base.theme.FineColorManager; +import com.fr.base.theme.FormTheme; +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.TemplateThemeAware; +import com.fr.base.theme.TemplateThemeCompatible; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.creator.cardlayout.XCardAddButton; import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; @@ -11,11 +16,15 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fun.ChartWidgetOptionProvider; import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.fun.ParameterWidgetOptionProvider; +import com.fr.design.mainframe.JTemplate; import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.LayoutUtils; +import com.fr.form.main.Form; +import com.fr.form.main.WidgetGather; import com.fr.form.parameter.FormSubmitButton; import com.fr.form.ui.Button; import com.fr.form.ui.CardAddButton; @@ -216,6 +225,16 @@ public class XCreatorUtils { return xClazz; } + public static XCreator createThemedXCreator(Widget widget) { + XCreator creator = createXCreator(widget); + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + TemplateTheme theme = template.getTemplateTheme(); + if (theme instanceof FormTheme) { + setupTemplateTheme(creator, (FormTheme) theme, TemplateThemeCompatible.NONE); + } + return creator; + } + /** * 创建creator * @@ -356,4 +375,21 @@ public class XCreatorUtils { } return null; } + + public static void setupTemplateTheme(XCreator container, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) { + FineColorManager.traverse(container.toData(), new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible)); + + Form.traversalWidget(container.toData(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + TemplateThemeAware themedWidget = (TemplateThemeAware) widget; + themedWidget.onTemplateUsingThemeChange(currentTemplateUsingTheme, compatible); + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, TemplateThemeAware.class); + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 636f1f548..cbe9e87e6 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1195,9 +1195,6 @@ public class FormDesigner extends TargetComponent
implements TreeSelection * @param xCreator 组件 */ public void startDraggingBean(XCreator xCreator) { - - // 新疆的图表块和报表块默认主题化 - addThemeToDroppedNewWidget(xCreator); // 根据所选择的组件的BeanInfo生成相应的AddingModel // AddingModel和StateModel不一样,适合当前选择的组件相关的 addingModel = new AddingModel(this, xCreator); @@ -1862,37 +1859,4 @@ public class FormDesigner extends TargetComponent implements TreeSelection public FormSpacingLineDrawer getSpacingLineDrawer() { return spacingLineDrawer; } - - private void addThemeToDroppedNewWidget(XCreator addingXCreator) { - JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (template == null) { - return; - } - TemplateTheme theme = template.getTemplateTheme(); - if (!(theme instanceof FormTheme)) { - return; - } - FormTheme formTheme = (FormTheme) theme; - - Form.traversalWidget(addingXCreator.toData(), new WidgetGather() { - @Override - public void dealWith(Widget widget) { - if (widget instanceof AbstractBorderStyleWidget) { - AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) widget; - if (!styleWidget.supportThemed()) { - return; - } - - boolean followingTheme = (!addingXCreator.isShared()) || styleWidget.isBorderStyleFollowingTheme(); - styleWidget.setBorderStyleFollowingTheme(followingTheme); - if (followingTheme) { - styleWidget.onTemplateUsingThemeChange(formTheme, TemplateThemeCompatible.NONE); - } - } - } - @Override - public boolean dealWithAllCards() { return true; } - }, AbstractBorderStyleWidget.class); - addingXCreator.rebuid(); - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java index b14229df6..126660665 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.share.generate.task; import com.fr.base.TableData; import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.base.iofile.attr.SharableAttrMark; +import com.fr.base.theme.TemplateTheme; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.share.generate.impl.AbstractComponentCreatorProcessor; @@ -39,6 +40,8 @@ public class ComponentCreator extends AbstractComponentCreatorProcessor { @Override public ComponentReuBean create(JTemplate jt, Map paraMap, Widget widget, DefaultSharableWidget info) throws Exception { + // 适用于共享组件的模版主题 + setSuitableTemplateThemeName(jt, info); // 遍历判断是否存在共享组件 checkOriginStatus(widget, info); @@ -56,6 +59,13 @@ public class ComponentCreator extends AbstractComponentCreatorProcessor { return new ComponentReuBean(generatePath, editor, info); } + private void setSuitableTemplateThemeName(JTemplate jt, DefaultSharableWidget info) { + TemplateTheme theme = jt.getTemplateTheme(); + if (theme != null) { + info.setSuitableTemplateThemeName(theme.getName()); + } + } + protected void checkOriginStatus(Widget widget, final DefaultSharableWidget info) { Form.traversalWidget(widget, new WidgetGatherAdapter() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java index 911ff7b77..d92755502 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java @@ -211,7 +211,8 @@ public class LocalWidgetBlock extends PreviewWidgetBlock creatorSource.setWidgetID(UUID.randomUUID().toString()); ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); //tab布局WCardMainBorderLayout通过反射出来的大小是960*480 - XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, no.getBindInfo()); + String suitableTemplateThemeName = no.getWidget().getSuitableTemplateThemeName(); + XCreator xCreator = ShareComponentUtils.createThemedXCreator(creatorSource, suitableTemplateThemeName, shareId, no.getBindInfo()); WidgetToolBarPane.getTarget().startDraggingBean(xCreator); lastPressEvent = null; this.setBorder(null); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java index b8cb0e678..8ad419b03 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -12,6 +12,7 @@ import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.WidgetToolBarPane; import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.form.share.DefaultSharableWidget; import com.fr.form.share.group.DefaultShareGroup; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; @@ -143,7 +144,13 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(shareId); //tab布局WCardMainBorderLayout通过反射出来的大小是960*480 - XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, bindInfo); + XCreator xCreator; + if (bindInfo instanceof DefaultSharableWidget) { + String suitableTemplateThemeName = ((DefaultSharableWidget) bindInfo).getSuitableTemplateThemeName(); + xCreator = ShareComponentUtils.createThemedXCreator(creatorSource, suitableTemplateThemeName, shareId, bindInfo); + } else { + xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, bindInfo); + } WidgetToolBarPane.getTarget().startDraggingBean(xCreator); lastPressEvent = null; this.setBorder(null); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java index 80162a406..72418b86b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java @@ -2,6 +2,9 @@ package com.fr.design.mainframe.share.util; import com.fr.base.io.IOFile; import com.fr.base.iofile.attr.ExtendSharableAttrMark; +import com.fr.base.theme.FormTheme; +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.TemplateThemeCompatible; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; @@ -50,6 +53,19 @@ public class ShareComponentUtils { return xCreator; } + public static XCreator createThemedXCreator(Widget creatorSource, String suitableTemplateThemeName, String shareId, SharableWidgetProvider provider) { + XCreator creator = createXCreator(creatorSource, shareId, provider); + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + TemplateTheme theme = template.getTemplateTheme(); + if (theme instanceof FormTheme) { + boolean isCurrentUsingThemeSuitSharedComponent = StringUtils.isNotEmpty(theme.getName()) && + StringUtils.isNotEmpty(suitableTemplateThemeName) && + StringUtils.equals(theme.getName(), suitableTemplateThemeName); + XCreatorUtils.setupTemplateTheme(creator, (FormTheme) theme, isCurrentUsingThemeSuitSharedComponent ? TemplateThemeCompatible.NONE : TemplateThemeCompatible.ABSENT); + } + return creator; + } + /** * 检查readme.txt文件 */ From 9d18ca41d0ed8eec58250746eacc8af92583e9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 9 Sep 2021 16:14:20 +0800 Subject: [PATCH 14/23] =?UTF-8?q?CHART-20619=20=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=B8=90=E5=8F=98=E8=89=B2=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E5=99=A8=E6=8E=A7=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/background/gradient/FixedGradientBarNoTheme.java | 2 +- .../main/java/com/fr/design/module/ChartPreFillStylePane.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarNoTheme.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarNoTheme.java index f3393366d..d45bd62f7 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarNoTheme.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarNoTheme.java @@ -23,7 +23,7 @@ public class FixedGradientBarNoTheme extends FixedGradientBar { protected void clickButton(int select) { ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE); Color selectColor = getList().get(select).getColorInner() == null ? Color.WHITE : getList().get(select).getColorInner(); - ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, FixedGradientBarNoTheme.this); + ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, FixedGradientBarNoTheme.this, true); Color color = FixedGradientBarNoTheme.this.getColor(); if (color != null) { DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 8091a78eb..4cc8466fd 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -8,6 +8,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.background.gradient.FixedGradientBarNoTheme; import com.fr.design.style.color.ColorAdjustPane; import com.fr.design.style.background.gradient.FixedGradientBar; @@ -58,7 +59,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { changeColorSetPane = new JPanel(cardLayout = new CardLayout()); changeColorSetPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); - changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 150), "gradient"); + changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 150), "gradient"); changeColorSetPane.add(colorAdjustPane = new ColorAdjustPane(), "acc"); cardLayout.show(changeColorSetPane, "acc"); customPane.add(changeColorSetPane, BorderLayout.CENTER); From f1f0904388b55826b3f2cf21f65450dcfb9c4c19 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Sep 2021 17:13:40 +0800 Subject: [PATCH 15/23] =?UTF-8?q?REPORT-58207=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8E=9F=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97-mac=E6=8F=92=E5=85=A5=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=97=B6=E4=BC=9A=E5=87=BA=E7=8E=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8=E5=BC=B9=E7=AA=97=E8=A2=AB?= =?UTF-8?q?=E9=81=AE=E7=9B=96=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java index 8be467810..58693d09a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java @@ -67,6 +67,7 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { fileChooserParent = DesignerContext.getDesignerFrame(); } Stage stage = showCoverStage(fileChooserParent); + stage.setAlwaysOnTop(true); try { if (fileSelectionMode == FileSelectionMode.FILE || fileSelectionMode == FileSelectionMode.MULTIPLE_FILE) { FileChooser fileChooser = new FileChooser(); From aebb0df1ce7aee3860f8f3eb2ce21628e73f30f6 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 9 Sep 2021 17:17:25 +0800 Subject: [PATCH 16/23] =?UTF-8?q?REPORT-58207=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8E=9F=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97-mac=E6=8F=92=E5=85=A5=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=97=B6=E4=BC=9A=E5=87=BA=E7=8E=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8=E5=BC=B9=E7=AA=97=E8=A2=AB?= =?UTF-8?q?=E9=81=AE=E7=9B=96=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java index 58693d09a..452deb5c8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java @@ -67,7 +67,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { fileChooserParent = DesignerContext.getDesignerFrame(); } Stage stage = showCoverStage(fileChooserParent); - stage.setAlwaysOnTop(true); + if (stage != null) { + stage.setAlwaysOnTop(true); + } try { if (fileSelectionMode == FileSelectionMode.FILE || fileSelectionMode == FileSelectionMode.MULTIPLE_FILE) { FileChooser fileChooser = new FileChooser(); From 8feffddfc00ecc852037a11920a92dfe471b4093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 10 Sep 2021 11:59:07 +0800 Subject: [PATCH 17/23] =?UTF-8?q?REPORT-59237=20=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=A4=E6=96=AD=E7=BB=98=E5=88=B6=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E7=BA=BF=E7=9A=84=E5=9C=B0=E6=96=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/FormSpacingLineDrawer.java | 33 ++++--------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index 1ed4c6cca..005a750c4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -137,43 +137,22 @@ public class FormSpacingLineDrawer { GraphDrawHelper.drawString(g2d, text, labelX, labelY); } - private boolean isSelectedParaComponent() { - return designer.getParaComponent() == selectedCreator; - } - - private boolean isSelectedRootComponent() { - return designer.isRoot(selectedCreator); - } - - private boolean isSelectedForm() { - return selectedCreator.getParent() == null; - } - private boolean isNeedExtendedLine(AbstractFormParallelLine[] nearestSides) { return nearestSides[0].isVerticalCenterLineBeforeTheParallelLine(nearestSides[1]) || nearestSides[0].isVerticalCenterLineBehindTheParallelLine(nearestSides[1]); } - private boolean isSelectedRootPane() { - // form、body、para这三个选中了,都不要画任何间距线 - return isSelectedForm() || isSelectedRootComponent() || isSelectedParaComponent(); - } - // 当前组件是否在参数面板里面 - private boolean isCompInBody(XCreator creator) { + private boolean isComponentInBody(XCreator creator) { XLayoutContainer container = XCreatorUtils.getHotspotContainer(creator); return container != null && !container.acceptType(XWParameterLayout.class); } - private boolean isSelectedCompInBody() { - return isCompInBody(selectedCreator); - } - - private boolean isHoveredCompInBody() { - return isCompInBody(hoverCreator); + private boolean isSelectedComponentInBody() { + return isComponentInBody(selectedCreator); } - private boolean isCompInBody() { - return isSelectedCompInBody() && isHoveredCompInBody(); + private boolean isHoveredComponentInBody() { + return isComponentInBody(hoverCreator); } private boolean isBodyAbsoluteLayout() { @@ -185,7 +164,7 @@ public class FormSpacingLineDrawer { } private boolean isDrawSpacingLine() { - return isInAbsoluteLayout() && !isSelectedRootPane() && isCompInBody(); + return isInAbsoluteLayout() && isSelectedComponentInBody() && isHoveredComponentInBody(); } private AbstractFormParallelLine[] getNearestHorizontalSide() { From cdf36ae6c31887b9228850ebe266452f597eb9ca Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Sep 2021 14:15:41 +0800 Subject: [PATCH 18/23] =?UTF-8?q?REPORT-58991=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85-=E6=A8=A1=E6=9D=BF=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E5=8F=AF=E6=BB=9A=E5=8A=A8-=E7=82=B9=E5=87=BB=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=BC=96=E8=BE=91-=E4=B8=8D=E5=9C=A8=E8=A7=86?= =?UTF-8?q?=E7=BA=BF=E5=86=85=E7=9A=84=E7=BB=84=E4=BB=B6=EF=BC=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=94=81=E5=AE=9A=E4=BD=8D=E7=BD=AE=E6=9C=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/designer/creator/XCreator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index e82528558..87a1926cb 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -787,7 +787,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo int formDesignerWidth = designer.getWidth(); int formDesignerHeight = designer.getHeight(); // 不超过可绘制区域 - int extraX = Math.min(creatorRightX, formDesignerWidth); + int extraX = creatorRightX < 0 ? 0 : Math.min(creatorRightX, formDesignerWidth); int extraY = creatorRightY < 0 ? 0 : Math.min(creatorRightY, formDesignerHeight); if (designer.isFormParaDesigner() && extraY + this.getHeight() >= formDesignerHeight) { From 1f031e4b7247431044d4e9110e9e4ecf6b175a94 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 10 Sep 2021 14:22:03 +0800 Subject: [PATCH 19/23] =?UTF-8?q?REPORT-57898=20=E3=80=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E3=80=91=E8=BF=9B=E5=85=A5=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=97=B6=E6=89=93=E5=BC=80frm/?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF/=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E5=86=8D=E5=9B=9E=E5=88=B0=E5=8E=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/base/mode/DesignModeContext.java | 11 +++++- .../com/fr/design/base/mode/DesignerMode.java | 20 +++++++++-- .../design/file/HistoryTemplateListCache.java | 7 ++-- .../fr/design/mainframe/DesignerFrame.java | 13 +++++-- .../roleAuthority/RolesEditedSourceOP.java | 35 ++++++++++--------- 5 files changed, 60 insertions(+), 26 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java b/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java index 1352833e6..8bb586271 100644 --- a/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java +++ b/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java @@ -10,7 +10,15 @@ public class DesignModeContext { private static DesignerMode mode = DesignerMode.NORMAL; public static void switchTo(DesignerMode mode) { - DesignModeContext.mode = mode; + changeMode(DesignModeContext.mode, mode); + } + + private static void changeMode(DesignerMode oldMode, DesignerMode newMode) { + if (oldMode != newMode) { + DesignModeContext.mode = newMode; + oldMode.closeMode(); + newMode.openMode(); + } } public static DesignerMode getMode() { @@ -40,6 +48,7 @@ public class DesignModeContext { * @return 是否为权限编辑 */ public static boolean isAuthorityEditing() { + //System.out.println("isAuthorityEditing:"+(mode == AUTHORITY)); return mode == AUTHORITY; } diff --git a/designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java b/designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java index d3dc1e5f4..3ca798f2f 100644 --- a/designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java +++ b/designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java @@ -1,9 +1,25 @@ package com.fr.design.base.mode; + +import com.fr.design.mainframe.DesignerContext; + public enum DesignerMode { NORMAL, BAN_COPY_AND_CUT, VCS, - AUTHORITY, - DUCHAMP + AUTHORITY { + @Override + public void closeMode() { + DesignerContext.getDesignerFrame().closeAuthorityMode(); + } + }, + DUCHAMP; + + public void openMode() { + + } + + public void closeMode() { + } + } diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index f7d4d1f57..52fb1bcfa 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -4,6 +4,7 @@ import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.io.BaseBook; import com.fr.design.DesignerEnvManager; import com.fr.design.base.mode.DesignModeContext; +import com.fr.design.base.mode.DesignerMode; import com.fr.design.data.DesignTableDataManager; import com.fr.design.file.filter.ClassFilter; import com.fr.design.i18n.Toolkit; @@ -69,7 +70,7 @@ public class HistoryTemplateListCache implements CallbackEvent { DesignTableDataManager.closeTemplate(selected); //直接关闭模板的时候(当且仅当设计器tab上只剩一个模板)退出权限编辑 if (DesignModeContext.isAuthorityEditing() && historyList.size() <= 1) { - DesignerContext.getDesignerFrame().closeAuthorityEditing(); + DesignModeContext.switchTo(DesignerMode.NORMAL); } if (contains(selected) == -1) { return; @@ -430,13 +431,13 @@ public class HistoryTemplateListCache implements CallbackEvent { */ @Deprecated public void reloadCurrentTemplate() { - reloadAllEditingTemplate(); + reloadAllEditingTemplate(); } /** * 重绘当前模板 */ - public void repaintCurrentEditingTemplate(){ + public void repaintCurrentEditingTemplate() { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index bacf1d5b3..8c9c3afdf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -9,6 +9,7 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.base.mode.DesignModeContext; +import com.fr.design.base.mode.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; @@ -219,7 +220,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta @Override public void mouseReleased(MouseEvent e) { if (DesignModeContext.isAuthorityEditing()) { - closeAuthorityEditing(); + DesignModeContext.switchTo(DesignerMode.NORMAL); } } @@ -299,8 +300,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().doResize(); } + @Deprecated public void closeAuthorityEditing() { - DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL); + DesignModeContext.switchTo(DesignerMode.NORMAL); + } + + public void closeAuthorityMode() { WestRegionContainerPane.getInstance().replaceDownPane( TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); @@ -312,6 +317,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this); } + /** * 注册app. * @@ -982,6 +988,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @date 2014-10-14-下午6:31:05 */ private void openFile(FILE tplFile) { + DesignModeContext.switchTo(DesignerMode.NORMAL); //切换文件后清空FixedPopupPane面板 EastRegionContainerPane.getInstance().clearCurrentPopupPane(); if (tplFile != null) { @@ -1038,7 +1045,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jt != null) { + if (jt != null) { DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); } diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java b/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java index a21cd20e7..60025e032 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java @@ -18,21 +18,22 @@ import java.util.Map; */ public class RolesEditedSourceOP extends RoleSourceOP { - protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map map) { - List roleList = new ArrayList(); - Iterator> entryIt = map.entrySet().iterator(); - while (entryIt.hasNext()) { - Map.Entry entry = entryIt.next(); - RoleDataWrapper t = entry.getValue(); - - JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget(); - - ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet())); - for (ExpandMutableTreeNode expandMutableTreeNode : expand) { - roleList.add(expandMutableTreeNode); - } - } - return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); - } + protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map map) { + List roleList = new ArrayList(); + Iterator> entryIt = map.entrySet().iterator(); + while (entryIt.hasNext()) { + Map.Entry entry = entryIt.next(); + RoleDataWrapper t = entry.getValue(); + + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jt.getTarget() instanceof PrivilegeEditedRoleProvider) { + PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget(); + ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet())); + for (ExpandMutableTreeNode expandMutableTreeNode : expand) { + roleList.add(expandMutableTreeNode); + } + } + } + return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); + } } \ No newline at end of file From c7991b85406af1f28374b77d497e5e1709e32ccc Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 10 Sep 2021 14:41:20 +0800 Subject: [PATCH 20/23] =?UTF-8?q?REPORT-57898=20=E3=80=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E3=80=91=E8=BF=9B=E5=85=A5=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=97=B6=E6=89=93=E5=BC=80frm/?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF/=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E5=86=8D=E5=9B=9E=E5=88=B0=E5=8E=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 8c9c3afdf..798441c53 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -802,6 +802,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @param jt 添加的模板. */ public void addAndActivateJTemplate(JTemplate jt) { + DesignModeContext.switchTo(DesignerMode.NORMAL); JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (currentEditingTemplate != null) { currentEditingTemplate.stopEditing(); @@ -988,7 +989,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @date 2014-10-14-下午6:31:05 */ private void openFile(FILE tplFile) { - DesignModeContext.switchTo(DesignerMode.NORMAL); //切换文件后清空FixedPopupPane面板 EastRegionContainerPane.getInstance().clearCurrentPopupPane(); if (tplFile != null) { From eb2ea8eccf54c9979f0fa01270bcd7b8b55a9849 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 10 Sep 2021 16:50:21 +0800 Subject: [PATCH 21/23] =?UTF-8?q?REPORT-57898=20=E3=80=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E3=80=91=E8=BF=9B=E5=85=A5=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=97=B6=E6=89=93=E5=BC=80frm/?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF/=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E5=86=8D=E5=9B=9E=E5=88=B0=E5=8E=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/base/mode/DesignModeContext.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java b/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java index 8bb586271..8cf38d00f 100644 --- a/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java +++ b/designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java @@ -48,7 +48,6 @@ public class DesignModeContext { * @return 是否为权限编辑 */ public static boolean isAuthorityEditing() { - //System.out.println("isAuthorityEditing:"+(mode == AUTHORITY)); return mode == AUTHORITY; } From 3d75cedccf47a1cb78b6992373a5369535df6be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 10 Sep 2021 17:20:18 +0800 Subject: [PATCH 22/23] =?UTF-8?q?CHART-20674=20=E5=88=86=E7=B1=BB=E8=BD=B4?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=8D=E5=BD=B1=E5=93=8D=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/axis/VanChartAxisScrollPaneWithTypeSelect.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java index ef042e0f2..15154de28 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java @@ -1,9 +1,10 @@ package com.fr.van.chart.designer.style.axis; +import com.fr.chart.base.ColorWithThemeStyle; import com.fr.chart.chartattr.Axis; -import com.fr.design.i18n.Toolkit; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -16,9 +17,9 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.BorderFactory; import javax.swing.JPanel; -import java.awt.BorderLayout; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; /** * 带有坐标轴类型选择控件。可选类型:分类、时间、数值 @@ -98,11 +99,13 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll public VanChartAxis update(VanChartAxis axis) { int index = axisTypePane.getSelectedIndex(); + ColorWithThemeStyle mainGridColorWithPreStyle = axis.getMainGridColorWithPreStyle(); if(ComparatorUtils.equals(index, AxisType.AXIS_CATEGORY.ordinal())){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){ textAxisPane.updateBean(axis); } else { axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); + axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle); textAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){ @@ -110,6 +113,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll timeAxisPane.updateBean(axis); } else { axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); + axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle); timeAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){ @@ -117,6 +121,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll valueAxisPane.updateBean(axis); } else { axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); + axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle); valueAxisPane.updateBean(axis); } } From d22b67acf03b7e835e3370b07a5f0a0acff043f4 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 10 Sep 2021 18:04:26 +0800 Subject: [PATCH 23/23] =?UTF-8?q?REPORT-59010=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E4=B8=BB=E9=A2=98=E9=85=8D=E8=89=B2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=BB=86=E8=8A=82=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E6=B8=90=E5=8F=98=E8=89=B2=E6=B2=A1=E6=9C=89=E6=94=B9?= =?UTF-8?q?=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/theme/TemplateThemeProfilePane.java | 7 +++---- .../java/com/fr/design/style/color/ColorSelectDialog.java | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index 9f8841f02..01a13ea98 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -1,11 +1,11 @@ package com.fr.design.mainframe.theme; +import com.fr.base.theme.FineColorFlushUtils; import com.fr.base.theme.FineColorManager; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemeThumbnail; import com.fr.base.theme.settings.ThemedCellStyleList; -import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.base.theme.settings.ThemedColorScheme; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.FineJOptionPane; @@ -31,9 +31,6 @@ import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.transaction.CallBackAdaptor; -import com.fr.transaction.Configurations; -import com.fr.transaction.WorkerFacade; - import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JDialog; @@ -317,12 +314,14 @@ public abstract class TemplateThemeProfilePane extends FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); T theme = updateBean(); + FineColorFlushUtils.replaceCacheObject(theme, replaceByColorScheme); FineColorManager.traverse(theme, replaceByColorScheme); populateBean4CustomEditors(theme); //图表渐变色 chartStyleSettingPane.populateGradientBar(colors); themePreviewPane.refresh(theme); + this.repaint(); } public void populateBean(T theme) { diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java index 56bc9aa65..23dcf8cc3 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java @@ -1,6 +1,7 @@ package com.fr.design.style.color; import com.fr.base.chart.BaseChartCollection; +import com.fr.design.DesignerEnvManager; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.utils.gui.GUICoreUtils; @@ -101,7 +102,9 @@ public class ColorSelectDialog extends MiddleChartDialog{ ok.setActionCommand("OK"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - seletePane.setColor(okListener.getColor()); + Color color = okListener.getColor(); + seletePane.setColor(color); + DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color); doOK(); } });