From f8e8663b846879f4180883009843ca9d9a297452 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 27 Jun 2022 17:34:51 +0800 Subject: [PATCH 01/17] =?UTF-8?q?REPORT-74595=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=85=8D=E7=BD=AE=20EnvDetectConfig=20=E8=A7=84?= =?UTF-8?q?=E8=8C=83=20=E8=B0=83=E6=95=B4=E5=86=99=E5=85=A5=E6=97=B6?= =?UTF-8?q?=E6=9C=BA=E4=B8=BA=E9=BB=98=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/env/detect/base/EnvDetectorConfig.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/detect/base/EnvDetectorConfig.java b/designer-base/src/main/java/com/fr/env/detect/base/EnvDetectorConfig.java index caafdbe464..eda399efad 100644 --- a/designer-base/src/main/java/com/fr/env/detect/base/EnvDetectorConfig.java +++ b/designer-base/src/main/java/com/fr/env/detect/base/EnvDetectorConfig.java @@ -1,6 +1,5 @@ package com.fr.env.detect.base; -import com.fr.design.DesignerEnvManager; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLable; import com.fr.stable.xml.XMLableReader; @@ -29,12 +28,6 @@ public class EnvDetectorConfig implements XMLable { public void setEnabled(boolean enabled) { this.enabled = enabled; - save(); - } - - private void save() { - - DesignerEnvManager.getEnvManager(false).saveXMLFile(); } @Override From 20263221397b09e7a07ec19599b7b7c3fc1975e0 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 28 Jun 2022 10:01:40 +0800 Subject: [PATCH 02/17] =?UTF-8?q?REPORT-74411=20=E6=8F=92=E4=BB=B6-?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E6=9C=BA=E5=88=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96-=E5=BD=93=E6=9C=AC=E5=9C=B0=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=86=85=E7=BD=AE=E6=8F=92=E4=BB=B6=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E5=B9=B3=E5=8F=B0=E8=BF=98=E6=98=AF=E4=BC=9A?= =?UTF-8?q?=E6=94=B6=E5=88=B0=E5=86=85=E7=BD=AE=E9=80=9A=E7=9F=A5=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AF=B9=E6=B6=88=E6=81=AF=E5=81=9A=E5=88=A4=E7=A9=BA?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911.?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=BD=93=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=86=85=E7=BD=AE=E6=8F=92=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=EF=BC=9B2.=E8=B0=83=E4=B8=80=E4=B8=8B=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=AD=E7=9A=84=E9=97=B4=E9=9A=94=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/plugin/remind/PluginErrorDesignReminder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/plugin/remind/PluginErrorDesignReminder.java b/designer-base/src/main/java/com/fr/design/plugin/remind/PluginErrorDesignReminder.java index b95f2dd4e5..7128fcc283 100644 --- a/designer-base/src/main/java/com/fr/design/plugin/remind/PluginErrorDesignReminder.java +++ b/designer-base/src/main/java/com/fr/design/plugin/remind/PluginErrorDesignReminder.java @@ -9,6 +9,7 @@ import com.fr.plugin.error.PluginErrorRemindHandler; import com.fr.plugin.error.PluginErrorReminder; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.collections.CollectionUtils; import com.fr.workspace.WorkContext; import javax.swing.SwingUtilities; @@ -64,7 +65,7 @@ public class PluginErrorDesignReminder implements PluginErrorReminder { } // 获取失效插件名称列表 List embedPluginNames = PluginErrorRemindHandler.getInvalidateEmbedPluginNames(); - if (embedPluginNames.size() > 0) { + if (!CollectionUtils.isEmpty(embedPluginNames)) { // 构建消息 String message = generateMessageContent(embedPluginNames); Notification notification = generateNotification(message, embedPluginNames); From b4be5db14d691b643f238d1acaec2448eb203cf9 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 28 Jun 2022 20:56:49 +0800 Subject: [PATCH 03/17] =?UTF-8?q?REPORT-74500=20=E3=80=90FVS=E3=80=91?= =?UTF-8?q?=E6=89=93=E5=BC=80fvs=E7=9A=84=E6=97=B6=E5=80=99=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=9B=BD=E9=99=85=E5=8C=96=E5=B9=B6=E9=87=8D=E5=90=AF?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/start/server/FineEmbedServer.java | 12 +++++++++++- .../java/com/fr/start/module/DesignerStartup.java | 2 +- .../module/optimized/TenantDBAdapter4Designer.java | 6 ++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java index e977884427..e70804c4dc 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java @@ -7,11 +7,17 @@ import com.fr.module.ModuleContext; * Created by juhaoyu on 2018/6/6. */ public abstract class FineEmbedServer { + + /** + * 是否正在启动中 + */ + private static volatile boolean onStarting = false; public synchronized static void start() { - + onStarting = true; EventDispatcher.fire(EmbedServerEvent.BeforeStart); ModuleContext.getModule(FineEmbedServerActivator.class).start(); + onStarting = false; EventDispatcher.fire(EmbedServerEvent.AfterStart); } @@ -26,4 +32,8 @@ public abstract class FineEmbedServer { return ModuleContext.getModule(FineEmbedServerActivator.class).isRunning(); } + + public static boolean isOnStarting() { + return onStarting; + } } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 4149753f72..fd8bd93079 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -125,7 +125,7 @@ public class DesignerStartup extends Activator { @Override public void on(Event event, Null param) { // 有可能被插件之类的 强制启动了 判断下 - if (FineEmbedServer.isRunning()) { + if (FineEmbedServer.isRunning() || FineEmbedServer.isOnStarting()) { return; } startEmbeddedServer(); diff --git a/designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java b/designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java index ad2485d690..9321a56a97 100644 --- a/designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java +++ b/designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java @@ -4,6 +4,7 @@ import com.fr.config.dao.DaoSelectorFactory; import com.fr.config.dao.swicter.DaoSwitcher; import com.fr.design.DesignerEnvManager; import com.fr.event.Event; +import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; import com.fr.exit.ConfigToPropMigrator; @@ -25,6 +26,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter { @Override public void on(Event event, Null param) { TenantDBAdapter4Designer.super.start(); + afterStart(); } }); @@ -32,7 +34,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter { @Override public void on(Event event, Null param) { if (DaoSelectorFactory.getDaoSelector().useCacheDao()) { - beforeEmbedServerStart(); + EventDispatcher.fire(LazyStartupEvent.INSTANCE); } } }); @@ -42,7 +44,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter { } } - private void beforeEmbedServerStart() { + private void afterStart() { DesignerEnvManager.getEnvManager().setPropertiesUsable(false); DaoSwitcher.executeSwitch(); ConfigToPropMigrator.getInstance().deletePropertiesCache(); From b8f17c6c08d558622a1262f94f6d6846a7ba5cc4 Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 29 Jun 2022 10:19:54 +0800 Subject: [PATCH 04/17] =?UTF-8?q?REPORT-74664=20=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=96=B0=E6=A8=A1=E5=BC=8F=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E8=80=81=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 NewFormAttrMark没有保存到实际的form对象中 【改动思路】 同上 --- designer-form/src/main/java/com/fr/design/fit/NewJForm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/fit/NewJForm.java b/designer-form/src/main/java/com/fr/design/fit/NewJForm.java index 660a5c483e..314097bcf1 100644 --- a/designer-form/src/main/java/com/fr/design/fit/NewJForm.java +++ b/designer-form/src/main/java/com/fr/design/fit/NewJForm.java @@ -55,7 +55,7 @@ public class NewJForm extends JForm { public NewJForm(Form form) { super(form); //新建的模板都要加上新表单标志attr - form.addAttrMark(NewFormMarkAttr.createNewFormAttr()); + getTarget().addAttrMark(NewFormMarkAttr.createNewFormAttr()); init(); } From 611a5358905e21841f2e52ce7ddcdcbfe16c4cdb Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 29 Jun 2022 14:25:08 +0800 Subject: [PATCH 05/17] =?UTF-8?q?KERNEL-11406=20=20FRM=E5=92=8CFVS?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E8=A1=A8=E6=A0=BC=E6=94=AF=E6=8C=81=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E8=B0=83=E6=95=B4=E8=A1=8C=E9=AB=98=E5=88=97=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/DesignerUIModeConfig.java | 23 +++++++ .../fit/common/NewUIModeAutoChangeLine.java | 20 ------ .../fit/common/NewUIModeRotationDraw.java | 69 ------------------- .../fit/NewUIModeCellElementPainter.java | 2 +- .../src/main/java/com/fr/grid/GridUtils.java | 3 +- 5 files changed, 26 insertions(+), 91 deletions(-) delete mode 100644 designer-form/src/main/java/com/fr/design/fit/common/NewUIModeAutoChangeLine.java delete mode 100644 designer-form/src/main/java/com/fr/design/fit/common/NewUIModeRotationDraw.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java index 1e072d956a..400f698185 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java @@ -1,8 +1,11 @@ package com.fr.design.mainframe; +import com.fr.base.AutoChangeLineProvider; +import com.fr.base.DefaultAutoChangeLine; import com.fr.base.ScreenResolution; import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.unit.UnitConvertUtil; +import com.fr.form.fit.NewUIModeAutoChangeLine; import com.fr.general.ComparatorUtils; import com.fr.stable.Constants; @@ -58,6 +61,14 @@ public class DesignerUIModeConfig { return mode.parseLengthUNIT(unitType); } + /** + * 获取不同模式下的换行逻辑 + * @return AutoChangeLineProvider + */ + public AutoChangeLineProvider getAutoChangeLineStrategy() { + return mode.getAutoChangeLineStrategy(); + } + /** * 获取不同模式下的屏幕分辨率 * @@ -75,6 +86,11 @@ public class DesignerUIModeConfig { return UnitConvertUtil.parseLengthUNIT(unitType); } + @Override + public AutoChangeLineProvider getAutoChangeLineStrategy() { + return new DefaultAutoChangeLine(); + } + @Override protected int getScreenResolution() { return ScreenResolution.getScreenResolution(); @@ -87,6 +103,11 @@ public class DesignerUIModeConfig { return new PXReportLengthUNIT(); } + @Override + public AutoChangeLineProvider getAutoChangeLineStrategy() { + return new NewUIModeAutoChangeLine(); + } + @Override protected int getScreenResolution() { return Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION; @@ -96,6 +117,8 @@ public class DesignerUIModeConfig { protected abstract ReportLengthUNITProvider parseLengthUNIT(int unitType); + public abstract AutoChangeLineProvider getAutoChangeLineStrategy(); + protected abstract int getScreenResolution(); diff --git a/designer-form/src/main/java/com/fr/design/fit/common/NewUIModeAutoChangeLine.java b/designer-form/src/main/java/com/fr/design/fit/common/NewUIModeAutoChangeLine.java deleted file mode 100644 index 0037c738d8..0000000000 --- a/designer-form/src/main/java/com/fr/design/fit/common/NewUIModeAutoChangeLine.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fr.design.fit.common; - -import com.fr.base.DefaultAutoChangeLine; -import com.fr.base.Style; -import com.fr.stable.unit.UNIT; - -import java.awt.Font; -import java.util.List; - -public class NewUIModeAutoChangeLine extends DefaultAutoChangeLine { - @Override - public List textAutoChangeLine(String text, Font font, Style style, UNIT unitWidth, int resolution) { - return autoChangeLine(text, font, style, unitWidth, resolution); - } - - protected double calculateShowWidth(double paintWidth, Style style, int resolution) { - return paintWidth - style.getPaddingLeft() - style.getPaddingRight() - style.getBorderLeftWidth(); - } - -} diff --git a/designer-form/src/main/java/com/fr/design/fit/common/NewUIModeRotationDraw.java b/designer-form/src/main/java/com/fr/design/fit/common/NewUIModeRotationDraw.java deleted file mode 100644 index 3e0b06721e..0000000000 --- a/designer-form/src/main/java/com/fr/design/fit/common/NewUIModeRotationDraw.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.fr.design.fit.common; - -import com.fr.base.BaseUtils; -import com.fr.base.DefaultRotationTextDrawProvider; -import com.fr.base.GraphHelper; -import com.fr.base.Style; -import com.fr.design.mainframe.PX; -import com.fr.stable.Constants; - -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics2D; -import java.util.List; - -public class NewUIModeRotationDraw extends DefaultRotationTextDrawProvider { - @Override - public void drawRotationText(Graphics2D g2d, String text, Style style, Font rfont, int width, int height, int horizontalAlignment, int resolution) { - FontMetrics cellFM = GraphHelper.getFontMetrics(rfont); - List lineTextList = BaseUtils.getLineTextList(text, style, rfont, height, width, resolution, new NewUIModeAutoChangeLine()); - drawRotationText(g2d, lineTextList, style, cellFM, width, height, horizontalAlignment, resolution); - } - - - protected int calculateTextWidth(int width, Style style) { - return width - style.getPaddingRight(); - } - - protected double calculateTextX(Style style, int width, int textWidth, int horizontalAlignment, int resolution) { - double textX = padding2PixExcludeRight(style.getPaddingLeft(), resolution); - if (horizontalAlignment == Constants.CENTER) { - textX += (width - textWidth - textX) / 2f; - } else if (horizontalAlignment == Constants.RIGHT) { - textX = width - style.getPaddingRight() - textWidth; - } - return textX; - } - - protected int toPXWithResolution(double pt, int resolution) { - return (int) PX.toPixWithResolution(pt, resolution); - } - - protected double padding2PixExcludeRight(int padding, int resolution) { - return PX.toPixWithResolution(padding, resolution); - } - - protected int calculateTextY(Style style, int height, int textHeight, int textAscent, List lineTextList, int resolution) { - // 计算Y的高度. - int textY = 0; - int textAllHeight = textHeight * lineTextList.size(); - double spacingBefore = toPXWithResolution(style.getSpacingBefore(), resolution); - double spacingAfter = toPXWithResolution(style.getSpacingAfter(), resolution); - double lineSpacing = toPXWithResolution(style.getLineSpacing(), resolution); - textAllHeight += spacingBefore + spacingAfter + lineSpacing * lineTextList.size(); - if (style.getVerticalAlignment() == Constants.TOP) { - } else if (style.getVerticalAlignment() == Constants.CENTER) { - if (height > textAllHeight) {// 如果所有文本的高度小于当前可以绘区域的高度,就从0开始画字符. - textY = (height - textAllHeight) / 2; - } - } else if (style.getVerticalAlignment() == Constants.BOTTOM) { - if (height > textAllHeight) { - textY = height - textAllHeight; - } - } - textY += textAscent;// 在绘画的时候,必须添加Ascent的高度. - textY += spacingBefore + lineSpacing;//james:加上"段前间距"+“行间距” - return textY; - } - -} diff --git a/designer-realize/src/main/java/com/fr/design/fit/NewUIModeCellElementPainter.java b/designer-realize/src/main/java/com/fr/design/fit/NewUIModeCellElementPainter.java index 4f1e883674..c0b1ca65e6 100644 --- a/designer-realize/src/main/java/com/fr/design/fit/NewUIModeCellElementPainter.java +++ b/designer-realize/src/main/java/com/fr/design/fit/NewUIModeCellElementPainter.java @@ -1,6 +1,6 @@ package com.fr.design.fit; -import com.fr.design.fit.common.NewUIModeRotationDraw; +import com.fr.form.fit.NewUIModeRotationDraw; import com.fr.grid.CellElementPainter; import com.fr.report.cell.TemplateCellElement; import com.fr.report.core.PaintUtils; diff --git a/designer-realize/src/main/java/com/fr/grid/GridUtils.java b/designer-realize/src/main/java/com/fr/grid/GridUtils.java index 21b032265f..03d125075c 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUtils.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUtils.java @@ -448,7 +448,8 @@ public class GridUtils { int editElementcolumn = editCellElement.getColumn(); UNIT preferredHeight = PaintUtils.analyzeCellElementPreferredHeight( editCellElement, - columnWidthList.getRangeValue(editElementcolumn, editElementcolumn + editCellElement.getColumnSpan())); + columnWidthList.getRangeValue(editElementcolumn, editElementcolumn + editCellElement.getColumnSpan()), + DesignerUIModeConfig.getInstance().getAutoChangeLineStrategy()); if (editCellElement.getRowSpan() == 1) { rowHeightList.set(editCellElement.getRow(), UNIT.max(preferredHeight, rowHeightList.get(editCellElement.getRow()))); From bd045355629f7a907c7ec7cf0244f1dc5fac71dd Mon Sep 17 00:00:00 2001 From: rinoux Date: Wed, 29 Jun 2022 18:36:55 +0800 Subject: [PATCH 06/17] =?UTF-8?q?REPORT-74603=20=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=BC=8F=E6=95=B0=E6=8D=AE=E5=BA=93=E7=9A=84=E9=99=90=E5=88=B6?= =?UTF-8?q?=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/connect/ConnectionListPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index e4deae04ba..93f2938556 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fr.base.TemplateUtils; import com.fr.config.RemoteConfigEvent; import com.fr.data.core.db.JDBCSecurityChecker; import com.fr.data.impl.Connection; @@ -201,7 +202,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh Connection connection = connectionBean.getConnection(); if (connection instanceof JDBCDatabaseConnection) { try { - JDBCSecurityChecker.checkURL(((JDBCDatabaseConnection) connection).getURL()); + JDBCSecurityChecker.checkURL(TemplateUtils.render(((JDBCDatabaseConnection) connection).getURL())); JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery()); } catch (SQLException e) { throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); From 4a9fa255d14677502d2c288ecaa27aec74fe79be Mon Sep 17 00:00:00 2001 From: rinoux Date: Thu, 30 Jun 2022 16:25:05 +0800 Subject: [PATCH 07/17] =?UTF-8?q?REPORT-74603=20=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=BC=8F=E6=95=B0=E6=8D=AE=E5=BA=93=E7=9A=84=E9=99=90=E5=88=B6?= =?UTF-8?q?=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/connect/ConnectionListPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index e4deae04ba..93f2938556 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fr.base.TemplateUtils; import com.fr.config.RemoteConfigEvent; import com.fr.data.core.db.JDBCSecurityChecker; import com.fr.data.impl.Connection; @@ -201,7 +202,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh Connection connection = connectionBean.getConnection(); if (connection instanceof JDBCDatabaseConnection) { try { - JDBCSecurityChecker.checkURL(((JDBCDatabaseConnection) connection).getURL()); + JDBCSecurityChecker.checkURL(TemplateUtils.render(((JDBCDatabaseConnection) connection).getURL())); JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery()); } catch (SQLException e) { throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); From b75c879c5768dc3fa7c73c46522c4a85f24b737a Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" Date: Thu, 30 Jun 2022 20:11:06 +0800 Subject: [PATCH 08/17] =?UTF-8?q?REPORT-72384=20&&=20REPORT-72443=201?= =?UTF-8?q?=E3=80=81=E4=B8=8B=E6=8B=89=E6=A0=91=E4=BC=98=E5=8C=96V2=202?= =?UTF-8?q?=E3=80=81=E6=8E=A7=E4=BB=B6=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=86=85=E7=BD=AEV2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ibutton/UIButtonGroup.java | 2 +- .../com/fr/design/gui/ibutton/UITabGroup.java | 2 +- .../TreeAttrChangeListener.java | 7 ++ .../itree/refreshabletree/TreeRootPane.java | 50 +++++++-- ...ckBoxDictPane.java => ReturnTypePane.java} | 91 +++++++-------- .../ui/designer/CheckBoxGroupDefinePane.java | 20 ++-- .../ui/designer/ComboCheckBoxDefinePane.java | 20 ++-- .../ui/designer/TreeEditorDefinePane.java | 68 +++--------- .../widget/ui/CheckBoxGroupDefinePane.java | 26 ++--- .../widget/ui/ComboCheckBoxDefinePane.java | 20 ++-- .../ui/TreeComboBoxEditorDefinePane.java | 104 ++++++++++-------- .../widget/ui/TreeEditorDefinePane.java | 17 ++- 12 files changed, 223 insertions(+), 204 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeAttrChangeListener.java rename designer-base/src/main/java/com/fr/design/widget/component/{CheckBoxDictPane.java => ReturnTypePane.java} (50%) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java index a9b97d2698..bd2e8b2afb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -296,7 +296,7 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver, UIOb return selectedIndex; } - protected void setSelectedIndex(int newSelectedIndex, boolean fireChanged) { + public void setSelectedIndex(int newSelectedIndex, boolean fireChanged) { if (selectedIndex != newSelectedIndex) { selectedIndex = newSelectedIndex; for (int i = 0; i < labelButtonList.size(); i++) { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java index d772591047..12ca005249 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java @@ -63,7 +63,7 @@ public class UITabGroup extends UIButtonGroup { } @Override - protected void setSelectedIndex(int newSelectedIndex, boolean fireChanged) { + public void setSelectedIndex(int newSelectedIndex, boolean fireChanged) { super.setSelectedIndex(newSelectedIndex, false); tabChanged(newSelectedIndex); } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeAttrChangeListener.java b/designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeAttrChangeListener.java new file mode 100644 index 0000000000..c31cfe5295 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeAttrChangeListener.java @@ -0,0 +1,7 @@ +package com.fr.design.gui.itree.refreshabletree; + +import com.fr.data.impl.TreeAttr; + +public interface TreeAttrChangeListener { + void doChange(TreeAttr treeAttr); +} diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java b/designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java index a848b06d69..691749fac6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java @@ -10,21 +10,24 @@ import javax.swing.BoxLayout; import javax.swing.JPanel; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.List; public class TreeRootPane extends BasicPane { + private final List listeners = new ArrayList<>(); + // 是否支持多选(checkBoxTree) //private JCheckBox multipleSelection; - private UICheckBox checkTypeCheckBox; + private final UICheckBox checkTypeCheckBox; // richer:加载的方式,支持异步加载和完全加载 - private UICheckBox loadTypeCheckBox; + private final UICheckBox loadTypeCheckBox; - private UICheckBox layerTypeCheckBox; + private final UICheckBox layerTypeCheckBox; - private UICheckBox returnFullPathCheckBox; + private final UICheckBox returnFullPathCheckBox; public TreeRootPane() { this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); @@ -41,13 +44,6 @@ public class TreeRootPane extends BasicPane { checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); loadTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async")); loadTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - loadTypeCheckBox.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - UICheckBox checkBox = (UICheckBox) e.getSource(); - doLoadTypeChange(checkBox.isSelected()); - } - }); loadTypePane.add(loadTypeCheckBox); this.add(loadTypePane); @@ -63,11 +59,27 @@ public class TreeRootPane extends BasicPane { checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Return_Full_Path"))); returnFullPathCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + addCheckBoxListener(); this.add(returnFullPathPane); } + private void addCheckBoxListener() { + loadTypeCheckBox.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + UICheckBox checkBox = (UICheckBox) e.getSource(); + doLoadTypeChange(checkBox.isSelected()); + } + }); + + checkTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener()); + loadTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener()); + layerTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener()); + returnFullPathCheckBox.addActionListener(event->fireTreeAttrChangeListener()); + } + private void doLoadTypeChange(Boolean selected) { //给埋点插件提供一个方法,埋埋点用 } @@ -82,6 +94,7 @@ public class TreeRootPane extends BasicPane { loadTypeCheckBox.setSelected(treeAttr.isAjax()); layerTypeCheckBox.setSelected(treeAttr.isSelectLeafOnly()); returnFullPathCheckBox.setSelected(treeAttr.isReturnFullPath()); + fireTreeAttrChangeListener(); } public TreeAttr update() { @@ -93,4 +106,17 @@ public class TreeRootPane extends BasicPane { return treeAttr; } + + public void addTreeAttrChangeListener(TreeAttrChangeListener listener) { + listeners.add(listener); + } + + public void fireTreeAttrChangeListener() { + TreeAttr treeAttr = new TreeAttr(); + treeAttr.setMultipleSelection(checkTypeCheckBox.isSelected()); + treeAttr.setAjax(loadTypeCheckBox.isSelected()); + treeAttr.setSelectLeafOnly(layerTypeCheckBox.isSelected()); + treeAttr.setReturnFullPath(returnFullPathCheckBox.isSelected()); + listeners.forEach(listener -> listener.doChange(treeAttr)); + } } diff --git a/designer-base/src/main/java/com/fr/design/widget/component/CheckBoxDictPane.java b/designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java similarity index 50% rename from designer-base/src/main/java/com/fr/design/widget/component/CheckBoxDictPane.java rename to designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java index 9a76352f94..4f3b93a539 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/CheckBoxDictPane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java @@ -1,32 +1,29 @@ package com.fr.design.widget.component; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; - -import javax.swing.*; - import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryConstants; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; -import com.fr.form.ui.CheckBoxGroup; -import com.fr.form.ui.ComboCheckBox; +import com.fr.form.ui.ReturnTypeProvider; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; + +public class ReturnTypePane extends JPanel { -public class CheckBoxDictPane extends JPanel { - - private DictionaryComboBox delimiterComboBox; - private UIButtonGroup returnTypeComboBox; - private DictionaryComboBox startComboBox; - private DictionaryComboBox endComboBox; - private JPanel returnStringPane; - - public CheckBoxDictPane() { + private final DictionaryComboBox delimiterComboBox; + private final UIButtonGroup returnTypeComboBox; + private final DictionaryComboBox startComboBox; + private final DictionaryComboBox endComboBox; + private final JPanel returnStringPane; + + public ReturnTypePane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays); delimiterComboBox.setEditable(true); @@ -36,18 +33,13 @@ public class CheckBoxDictPane extends JPanel { endComboBox.setEditable(true); Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delimiter")), delimiterComboBox}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_Start_Symbol")),startComboBox}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_End_Symbol")),endComboBox} + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_Start_Symbol")), startComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_End_Symbol")), endComboBox} }; returnStringPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1); returnTypeComboBox = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Array"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")}); - returnTypeComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkVisible(returnTypeComboBox.getSelectedIndex()); - } - }); + returnTypeComboBox.addActionListener(e -> checkVisible(returnTypeComboBox.getSelectedIndex())); JPanel headPane = TableLayoutHelper.createGapTableLayoutPane( new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -57,34 +49,33 @@ public class CheckBoxDictPane extends JPanel { this.add(jPanel); } - public void checkVisible(int selectIndex){ - returnStringPane.setVisible(selectIndex == 1); + public void setReturnType(ReturnType returnType) { + int selectIndex = returnType == ReturnType.ARRAY ? 0 : 1; + returnTypeComboBox.setSelectedIndex(selectIndex,true); + checkVisible(selectIndex); } - public void populate(ComboCheckBox comboCheckBox) { - this.delimiterComboBox.setSelectedItem(comboCheckBox.getDelimiter()); - this.returnTypeComboBox.setSelectedIndex(comboCheckBox.isReturnString() ? 1 : 0); - this.startComboBox.setSelectedItem(comboCheckBox.getStartSymbol()); - this.endComboBox.setSelectedItem(comboCheckBox.getEndSymbol()); - checkVisible(this.returnTypeComboBox.getSelectedIndex()); + public void checkVisible(int selectIndex) { + returnStringPane.setVisible(selectIndex == 1); } - public void update(ComboCheckBox comboCheckBox) { - comboCheckBox.setDelimiter((String)this.delimiterComboBox.getSelectedItem()); - comboCheckBox.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0); - comboCheckBox.setStartSymbol((String)this.startComboBox.getSelectedItem()); - comboCheckBox.setEndSymbol((String)this.endComboBox.getSelectedItem()); + + public void update(ReturnTypeProvider returnTypeProvider) { + returnTypeProvider.setDelimiter((String) this.delimiterComboBox.getSelectedItem()); + returnTypeProvider.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0); + returnTypeProvider.setStartSymbol((String) this.startComboBox.getSelectedItem()); + returnTypeProvider.setEndSymbol((String) this.endComboBox.getSelectedItem()); } - public void populate(CheckBoxGroup checkBoxGroup) { - this.delimiterComboBox.setSelectedItem(checkBoxGroup.getDelimiter()); - this.returnTypeComboBox.setSelectedIndex(checkBoxGroup.isReturnString() ? 1 : 0); - this.startComboBox.setSelectedItem(checkBoxGroup.getStartSymbol()); - this.endComboBox.setSelectedItem(checkBoxGroup.getEndSymbol()); + + public void populate(ReturnTypeProvider returnTypeProvider) { + this.delimiterComboBox.setSelectedItem(returnTypeProvider.getDelimiter()); + this.returnTypeComboBox.setSelectedIndex(returnTypeProvider.isReturnString() ? 1 : 0); + this.startComboBox.setSelectedItem(returnTypeProvider.getStartSymbol()); + this.endComboBox.setSelectedItem(returnTypeProvider.getEndSymbol()); checkVisible(this.returnTypeComboBox.getSelectedIndex()); } - public void update(CheckBoxGroup checkBoxGroup) { - checkBoxGroup.setDelimiter((String)this.delimiterComboBox.getSelectedItem()); - checkBoxGroup.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0); - checkBoxGroup.setStartSymbol((String)this.startComboBox.getSelectedItem()); - checkBoxGroup.setEndSymbol((String)this.endComboBox.getSelectedItem()); + + public enum ReturnType { + STRING, + ARRAY } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java index 74819ae452..579001b555 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java @@ -7,7 +7,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.present.dict.DictionaryPane; -import com.fr.design.widget.component.CheckBoxDictPane; +import com.fr.design.widget.component.ReturnTypePane; import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane; import com.fr.form.ui.CheckBoxGroup; @@ -17,7 +17,7 @@ import java.awt.*; public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane { private DictionaryPane dictPane; - private CheckBoxDictPane checkBoxDictPane; + private ReturnTypePane returnTypePane; private UICheckBox checkbox; public CheckBoxGroupDefinePane(XCreator xCreator) { @@ -40,12 +40,12 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane { - private UICheckBox supportTagCheckBox; - private CheckBoxDictPane checkBoxDictPane; - private UITextField waterMarkDictPane; - private UICheckBox removeRepeatCheckBox; + private UICheckBox supportTagCheckBox; + private ReturnTypePane returnTypePane; + private UITextField waterMarkDictPane; + private UICheckBox removeRepeatCheckBox; public ComboCheckBoxDefinePane(XCreator xCreator) { super(xCreator); @@ -40,13 +40,13 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane public JPanel createOtherPane(){ supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true); supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - checkBoxDictPane = new CheckBoxDictPane(); + returnTypePane = new ReturnTypePane(); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{supportTagCheckBox, null }, - new Component[]{checkBoxDictPane, null}, + new Component[]{returnTypePane, null}, }; double[] rowSize = {p, p}; double[] columnSize = {p, f}; @@ -56,7 +56,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane } protected void populateSubDictionaryEditorBean(ComboCheckBox ob){ - this.checkBoxDictPane.populate(ob); + this.returnTypePane.populate(ob); waterMarkDictPane.setText(ob.getWaterMark()); formWidgetValuePane.populate(ob); this.supportTagCheckBox.setSelected(ob.isSupportTag()); @@ -65,7 +65,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane protected ComboCheckBox updateSubDictionaryEditorBean(){ ComboCheckBox combo = (ComboCheckBox) creator.toData(); - checkBoxDictPane.update(combo); + returnTypePane.update(combo); formWidgetValuePane.update(combo); combo.setWaterMark(waterMarkDictPane.getText()); combo.setSupportTag(this.supportTagCheckBox.isSelected()); @@ -77,7 +77,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane public DataCreatorUI dataUI() { return null; } - + @Override public String title4PopupWindow() { return "ComboCheckBox"; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java index 9746c605d5..13049e4c95 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java @@ -1,78 +1,50 @@ package com.fr.design.widget.ui.designer; import com.fr.design.data.DataCreatorUI; -import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; -import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.TreeRootPane; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; +import com.fr.design.widget.component.ReturnTypePane; import com.fr.form.ui.TreeEditor; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.awt.BorderLayout; import java.awt.Component; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; /* * richer:tree editor */ public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane { + private ReturnTypePane returnTypePane; protected TreeRootPane treeRootPane; - private UICheckBox mutiSelect; - private UICheckBox loadAsync; - private UICheckBox returnLeaf; - private UICheckBox returnPath; private AccessibleTreeModelEditor accessibleTreeModelEditor; public TreeEditorDefinePane(XCreator xCreator) { super(xCreator); - treeRootPane = new TreeRootPane(); } public JPanel createOtherPane() { - mutiSelect = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Mutiple_Selection_Or_Not")); - mutiSelect.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - - loadAsync = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async")); - loadAsync.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - loadAsync.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - UICheckBox checkBox = (UICheckBox) e.getSource(); - doLoadTypeChange(checkBox.isSelected()); + treeRootPane = new TreeRootPane(); + returnTypePane = new ReturnTypePane(); + JPanel panel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + panel.add(treeRootPane, BorderLayout.NORTH); + returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + panel.add(returnTypePane, BorderLayout.CENTER); + treeRootPane.addTreeAttrChangeListener(treeAttr -> { + boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath(); + returnTypePane.setVisible(showReturnTypePane); + if (!showReturnTypePane) { + returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY); } }); - returnLeaf = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Return_Leaf")); - returnLeaf.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - - returnPath = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Return_Path")); - returnPath.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - Component[][] components = new Component[][]{ - new Component[]{mutiSelect}, - new Component[]{loadAsync}, - new Component[]{returnLeaf}, - new Component[]{returnPath} - }; - double[] rowSize = {p, p, p, p}; - double[] columnSize = {p}; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); return panel; } - private void doLoadTypeChange(Boolean selected) { - //给埋点插件提供一个方法,埋埋点用 - } - @Override public String title4PopupWindow() { return "tree"; @@ -89,10 +61,7 @@ public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane { - CheckBoxDictPane checkBoxDictPane; + private ReturnTypePane returnTypePane; private UICheckBox checkbox; private ButtonGroupDictPane buttonGroupDictPane; @@ -28,25 +28,25 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane { - private CheckBoxDictPane checkBoxDictPane; + private ReturnTypePane returnTypePane; private AccessibleDictionaryEditor dictPane; - private UICheckBox supportTagCheckBox; + private UICheckBox supportTagCheckBox; public ComboCheckBoxDefinePane() { super.initComponents(); @@ -28,7 +28,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane { - protected AccessibleTreeModelEditor treeSettingPane; - protected TreeRootPane treeRootPane; + protected AccessibleTreeModelEditor treeSettingPane; - public TreeComboBoxEditorDefinePane() { - this.initComponents(); - } + private ReturnTypePane returnTypePane; + protected TreeRootPane treeRootPane; + public TreeComboBoxEditorDefinePane() { + this.initComponents(); + } - @Override - protected JPanel setForthContentPane() { - JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane(); - content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - treeRootPane = new TreeRootPane(); - content.add(treeRootPane, BorderLayout.NORTH); - return content; - } - @Override - protected JPanel setFirstContentPane() { - treeSettingPane = new AccessibleTreeModelEditor(); - JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - JPanel north = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Create_Tree")), treeSettingPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1); - north.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); - JPanel center = super.setFirstContentPane(); - jPanel.add(north, BorderLayout.NORTH); - jPanel.add(center, BorderLayout.CENTER); - return jPanel; - } + @Override + protected JPanel setForthContentPane() { + JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane(); + treeRootPane = new TreeRootPane(); + returnTypePane = new ReturnTypePane(); + content.add(treeRootPane, BorderLayout.NORTH); + returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + content.add(returnTypePane, BorderLayout.CENTER); + treeRootPane.addTreeAttrChangeListener(treeAttr -> { + boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath(); + returnTypePane.setVisible(showReturnTypePane); + if (!showReturnTypePane) { + returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY); + } + }); + content.add(treeRootPane, BorderLayout.NORTH); + return content; + } + @Override + protected JPanel setFirstContentPane() { + treeSettingPane = new AccessibleTreeModelEditor(); + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel north = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Create_Tree")), treeSettingPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1); + north.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + JPanel center = super.setFirstContentPane(); + jPanel.add(north, BorderLayout.NORTH); + jPanel.add(center, BorderLayout.CENTER); + return jPanel; + } - @Override - protected String title4PopupWindow() { - return "treecombobox"; - } + @Override + protected String title4PopupWindow() { + return "treecombobox"; + } - @Override - protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) { - treeSettingPane.setValue(e.getBuildModelConfig()); - treeRootPane.populate(e.getTreeAttr()); - } + @Override + protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) { + treeSettingPane.setValue(e.getBuildModelConfig()); + treeRootPane.populate(e.getTreeAttr()); + returnTypePane.populate(e); + } - @Override - protected TreeComboBoxEditor updateSubCustomWritableRepeatEditorBean() { - TreeComboBoxEditor editor = new TreeComboBoxEditor(); - editor.setBuildModelConfig(treeSettingPane.getValue()); - editor.setTreeAttr(treeRootPane.update()); - return editor; - } + @Override + protected TreeComboBoxEditor updateSubCustomWritableRepeatEditorBean() { + TreeComboBoxEditor editor = new TreeComboBoxEditor(); + editor.setBuildModelConfig(treeSettingPane.getValue()); + editor.setTreeAttr(treeRootPane.update()); + returnTypePane.update(editor); + return editor; + } - @Override - public DataCreatorUI dataUI() { - return null; - } + @Override + public DataCreatorUI dataUI() { + return null; + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java index 89e54cdc8d..086ef88837 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java @@ -8,6 +8,7 @@ import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; +import com.fr.design.widget.component.ReturnTypePane; import com.fr.form.ui.TreeEditor; @@ -19,6 +20,8 @@ import java.awt.*; * richer:tree editor */ public class TreeEditorDefinePane extends FieldEditorDefinePane { + private ReturnTypePane returnTypePane; + protected TreeRootPane treeRootPane; private AccessibleTreeModelEditor accessibleTreeModelEditor; @@ -32,6 +35,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { protected void populateSubFieldEditorBean(TreeEditor e) { this.accessibleTreeModelEditor.setValue(e.getBuildModelConfig()); treeRootPane.populate(e.getTreeAttr()); + returnTypePane.populate(e); if (this.removeRepeatCheckBox != null) { this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); } @@ -42,6 +46,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { TreeEditor editor = new TreeEditor(); editor.setBuildModelConfig(accessibleTreeModelEditor.getValue()); editor.setTreeAttr(treeRootPane.update()); + returnTypePane.update(editor); if (this.removeRepeatCheckBox != null) { editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected()); } @@ -75,9 +80,19 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { protected JPanel setThirdContentPane() { JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane(); - content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); treeRootPane = new TreeRootPane(); + returnTypePane = new ReturnTypePane(); content.add(treeRootPane, BorderLayout.NORTH); + returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + content.add(returnTypePane, BorderLayout.CENTER); + treeRootPane.addTreeAttrChangeListener(treeAttr -> { + boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath(); + returnTypePane.setVisible(showReturnTypePane); + if (!showReturnTypePane) { + returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY); + } + }); + //content.add(treeRootPane, BorderLayout.NORTH); return content; } From cdaa29cd4339bb0b33615a803425c5c84197f6fe Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 5 Jul 2022 17:19:07 +0800 Subject: [PATCH 09/17] =?UTF-8?q?REPORT-75174=20FR11=E6=96=B0=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94-PC=E7=AB=AF=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=8A=A5=E8=A1=A8=E5=9D=97=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=EF=BC=8C=E6=8A=A5=E8=A1=A8=E5=9D=97?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7Pc=E6=B5=8F=E8=A7=88=E5=99=A8=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E8=AE=BE=E7=BD=AE=E9=A1=B9=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=8F=8C=E5=90=91=E8=87=AA=E9=80=82=E5=BA=94=EF=BC=8C=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E6=96=B0=E6=A8=A1=E5=BC=8F=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=8F=98=E4=B8=BA=E4=B8=8D=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XCreatorUtils.java | 24 ++++++++++++++++--- .../design/designer/creator/XElementCase.java | 10 +------- .../design/fit/common/AdaptiveSwitchUtil.java | 23 ++++++++++++++++++ 3 files changed, 45 insertions(+), 12 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 395521a7fa..eb1f3497a3 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 @@ -4,9 +4,6 @@ package com.fr.design.designer.creator; import com.fr.base.chart.BaseChartCollection; -import com.fr.base.theme.FineColorFlushUtils; -import com.fr.base.theme.FineColorGather; -import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateTheme; @@ -82,6 +79,9 @@ import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; +import com.fr.report.fit.FitProvider; +import com.fr.report.fit.ReportFitAttr; +import com.fr.report.fit.ReportFitConfig; import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nonnull; import java.util.Set; @@ -486,4 +486,22 @@ public class XCreatorUtils { } } + + public static ReportFitAttr getElementCaseEditorReportFitAttr(ElementCaseEditor editor, FitProvider wbTpl) { + //这边获取到的全局要考虑到服务器的配置 + ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr(); + return getElementCaseEditorReportFitAttr(editor, fitAttr); + } + + public static ReportFitAttr getElementCaseEditorReportFitAttr(ElementCaseEditor editor, ReportFitAttr fitAttr) { + //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) + if (editor.getFitStateInPC() == 0) { + editor.setReportFitAttr(null); + } + ReportFitAttr reportFit = editor.getReportFitAttr(); + if (fitAttr != null) { + reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; + } + return editor.getReportFitAttr() == null ? fitAttr : reportFit; + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index 2f4a699379..6b452bd08d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -131,15 +131,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme //这边获取到的全局要考虑到服务器的配置 ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr(); ElementCaseEditor editor = this.toData(); - //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) - if (editor.getFitStateInPC() == 0) { - editor.setReportFitAttr(null); - } - ReportFitAttr reportFit = editor.getReportFitAttr(); - if (fitAttr != null) { - reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; - } - ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; + ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, fitAttr); BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); if (editor.getReportFitAttr() == null) { diff --git a/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java b/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java index 031d698498..062ffa1504 100644 --- a/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java +++ b/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java @@ -1,6 +1,7 @@ package com.fr.design.fit.common; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.fit.NewJForm; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -11,6 +12,7 @@ import com.fr.file.MemFILE; import com.fr.form.fit.NewFormMarkAttr; import com.fr.form.main.Form; import com.fr.form.main.WidgetGather; +import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; @@ -94,15 +96,36 @@ public class AdaptiveSwitchUtil { } //如果是从旧的设计模板转化为新的设计模式,并且不是全局配置的模板。则更新新模板的Pc端自适应属性 if (newJForm.getTarget().getReportFitAttr() != null && newJForm.isNewJFrom()) { + //兼容处理老模式下报表块自适应属性设置为跟随报表整体自适应 + compatibleProcessECReportFitAttr(newJForm.getTarget()); //修改自适应属性 newJForm.getTarget().setReportFitAttr(shiftReportFitAttr(oldForm, newJForm.getTarget().getReportFitAttr().isFitFont())); //修改绝对布局中的缩放属性 processAbsoluteLayoutCompatible(newJForm.getTarget()); + } TemplateTool.saveForm(newJForm); return newJForm; } + private static void compatibleProcessECReportFitAttr(Form form) { + Form.traversalWidget(form.getContainer(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + ElementCaseEditor editor = (ElementCaseEditor) widget; + ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, form); + if (reportFitAttr.fitStateInPC() != 0) { + editor.setReportFitAttr(reportFitAttr); + } + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, ElementCaseEditor.class); + } + private static void processAbsoluteLayoutCompatible(Form form) { Form.traversalWidget(form.getContainer(), new WidgetGather() { From cb91ff9c60a0a16febe8d27950d0f050d435e183 Mon Sep 17 00:00:00 2001 From: Yann Date: Thu, 7 Jul 2022 14:57:18 +0800 Subject: [PATCH 10/17] =?UTF-8?q?REPORT-74775=20=E3=80=90=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E3=80=91=E5=86=85=E7=BD=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=A2=84=E8=A7=88=E6=95=B0=E6=8D=AE=EF=BC=8C=E5=A4=9A?= =?UTF-8?q?=E5=88=97=E6=83=85=E5=86=B5=EF=BC=8C=E6=98=BE=E7=A4=BA=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/EmbeddedTableDataPane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java index 8b47b222d6..731816243e 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java @@ -65,6 +65,9 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane Date: Thu, 7 Jul 2022 16:24:18 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E6=8A=BD=E6=95=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4=E9=9A=94=E9=99=90?= =?UTF-8?q?=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C=E4=B8=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/ESDStrategyConfigPane.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index 1fd840ac78..091e18231e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -15,6 +15,7 @@ import com.fr.esd.util.ESDUtils; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import com.fr.third.org.quartz.CronExpression; import javax.swing.AbstractAction; import javax.swing.JPanel; @@ -25,9 +26,11 @@ import java.awt.Desktop; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URI; +import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Date; /** * @author rinoux @@ -36,7 +39,6 @@ import java.util.List; */ public class ESDStrategyConfigPane extends BasicBeanPane { private static final String CRON_HELP_URL = "http://help.fanruan.com/finereport/doc-view-693.html"; - private UIRadioButton selectAutoUpdate; private UIRadioButton selectBySchema; private UICheckBox shouldEvolve; @@ -131,8 +133,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane { ob = StrategyConfigHelper.createStrategyConfig(true, false, true); } this.strategyConfig = ob; - - this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.valueOf(ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE)); + this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.format("%.0f", ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE)); this.schemaTime.setText(StringUtils.join(",", ob.getUpdateSchema().toArray(new String[0]))); this.shouldEvolve.setSelected(ob.shouldEvolve()); this.selectBySchema.setSelected(ob.isScheduleBySchema()); @@ -177,11 +178,22 @@ public class ESDStrategyConfigPane extends BasicBeanPane { if (ESDUtils.checkUpdateTimeSchema(text)) { if (ESDUtils.isCronExpression(text)) { + // 判断后两次更新时间间隔,如果小于1分钟就显示错误 + CronExpression cron = new CronExpression(text); + Date next1 = cron.getNextValidTimeAfter(new Date()); + Date next2 = cron.getNextValidTimeAfter(next1); + if (next2.getTime() - next1.getTime() < CacheConstants.MILLIS_OF_MINUTE) { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); + this.schemaTimeCheckTips.setVisible(true); + throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); + } + schemaTimes.add(text); } else { Collections.addAll(schemaTimes, text.split(",")); } } else { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format")); this.schemaTimeCheckTips.setVisible(true); throw new IllegalArgumentException("[ESD]Update schema time format error."); } @@ -202,6 +214,8 @@ public class ESDStrategyConfigPane extends BasicBeanPane { } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + } catch (ParseException e) { + throw new RuntimeException(e); } } @@ -211,7 +225,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane { private boolean checkUpdateInterval(String intervalValue) { try { - return !StringUtils.isEmpty(intervalValue) && !(Double.parseDouble(intervalValue) <= 0); + return !StringUtils.isEmpty(intervalValue) && !(Integer.parseInt(intervalValue) <= 0); } catch (NumberFormatException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } From 247e752bc81e643e64f4a699c224fd3651a82f29 Mon Sep 17 00:00:00 2001 From: Num73 <2788852163@qq.com> Date: Thu, 7 Jul 2022 16:54:50 +0800 Subject: [PATCH 12/17] =?UTF-8?q?KERNEL-11853=20=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E9=99=90=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/ESDStrategyConfigPane.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index 1fd840ac78..091e18231e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -15,6 +15,7 @@ import com.fr.esd.util.ESDUtils; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import com.fr.third.org.quartz.CronExpression; import javax.swing.AbstractAction; import javax.swing.JPanel; @@ -25,9 +26,11 @@ import java.awt.Desktop; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URI; +import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Date; /** * @author rinoux @@ -36,7 +39,6 @@ import java.util.List; */ public class ESDStrategyConfigPane extends BasicBeanPane { private static final String CRON_HELP_URL = "http://help.fanruan.com/finereport/doc-view-693.html"; - private UIRadioButton selectAutoUpdate; private UIRadioButton selectBySchema; private UICheckBox shouldEvolve; @@ -131,8 +133,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane { ob = StrategyConfigHelper.createStrategyConfig(true, false, true); } this.strategyConfig = ob; - - this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.valueOf(ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE)); + this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.format("%.0f", ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE)); this.schemaTime.setText(StringUtils.join(",", ob.getUpdateSchema().toArray(new String[0]))); this.shouldEvolve.setSelected(ob.shouldEvolve()); this.selectBySchema.setSelected(ob.isScheduleBySchema()); @@ -177,11 +178,22 @@ public class ESDStrategyConfigPane extends BasicBeanPane { if (ESDUtils.checkUpdateTimeSchema(text)) { if (ESDUtils.isCronExpression(text)) { + // 判断后两次更新时间间隔,如果小于1分钟就显示错误 + CronExpression cron = new CronExpression(text); + Date next1 = cron.getNextValidTimeAfter(new Date()); + Date next2 = cron.getNextValidTimeAfter(next1); + if (next2.getTime() - next1.getTime() < CacheConstants.MILLIS_OF_MINUTE) { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); + this.schemaTimeCheckTips.setVisible(true); + throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); + } + schemaTimes.add(text); } else { Collections.addAll(schemaTimes, text.split(",")); } } else { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format")); this.schemaTimeCheckTips.setVisible(true); throw new IllegalArgumentException("[ESD]Update schema time format error."); } @@ -202,6 +214,8 @@ public class ESDStrategyConfigPane extends BasicBeanPane { } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + } catch (ParseException e) { + throw new RuntimeException(e); } } @@ -211,7 +225,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane { private boolean checkUpdateInterval(String intervalValue) { try { - return !StringUtils.isEmpty(intervalValue) && !(Double.parseDouble(intervalValue) <= 0); + return !StringUtils.isEmpty(intervalValue) && !(Integer.parseInt(intervalValue) <= 0); } catch (NumberFormatException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } From 833b53133d697b5d4f9138bae5fa163810617981 Mon Sep 17 00:00:00 2001 From: Maximus <2788852163@qq.com> Date: Thu, 7 Jul 2022 19:44:07 +0800 Subject: [PATCH 13/17] =?UTF-8?q?KERNEL-11853=20=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E9=99=90=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/ESDStrategyConfigPane.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index 091e18231e..a94db304b3 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -188,7 +188,14 @@ public class ESDStrategyConfigPane extends BasicBeanPane { throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); } - schemaTimes.add(text); + if (checkCornTimeInterval(text)) { + schemaTimes.add(text); + } else { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); + this.schemaTimeCheckTips.setVisible(true); + throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); + } + } else { Collections.addAll(schemaTimes, text.split(",")); } @@ -233,6 +240,17 @@ public class ESDStrategyConfigPane extends BasicBeanPane { return false; } + private boolean checkCornTimeInterval (String cronText) { + // 判断后两次更新时间间隔,如果小于1分钟就返回false + try { + CronExpression cron = new CronExpression(cronText); + Date next1 = cron.getNextValidTimeAfter(new Date()); + Date next2 = cron.getNextValidTimeAfter(next1); + return next2.getTime() - next1.getTime() >= CacheConstants.MILLIS_OF_MINUTE; + } catch (ParseException e) { + throw new RuntimeException(e); + } + } protected String title4PopupWindow() { return InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Strategy_Config_Title"); From b012cbac5796b5f6e6040e04977a9776783dfb5e Mon Sep 17 00:00:00 2001 From: Maximus <2788852163@qq.com> Date: Thu, 7 Jul 2022 19:55:25 +0800 Subject: [PATCH 14/17] =?UTF-8?q?KERNEL-11853=20=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E9=99=90=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/ESDStrategyConfigPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index a94db304b3..e4fd53cec7 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -247,9 +247,10 @@ public class ESDStrategyConfigPane extends BasicBeanPane { Date next1 = cron.getNextValidTimeAfter(new Date()); Date next2 = cron.getNextValidTimeAfter(next1); return next2.getTime() - next1.getTime() >= CacheConstants.MILLIS_OF_MINUTE; - } catch (ParseException e) { - throw new RuntimeException(e); + } catch (ParseException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } + return false; } protected String title4PopupWindow() { From 4aec6e5b8d2187dd7b24026c77fa050feb69df3a Mon Sep 17 00:00:00 2001 From: Maximus <2788852163@qq.com> Date: Fri, 8 Jul 2022 09:51:35 +0800 Subject: [PATCH 15/17] =?UTF-8?q?KERNEL-11853=20=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E9=99=90=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/ESDStrategyConfigPane.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index e4fd53cec7..39b4ecb00f 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -178,16 +178,6 @@ public class ESDStrategyConfigPane extends BasicBeanPane { if (ESDUtils.checkUpdateTimeSchema(text)) { if (ESDUtils.isCronExpression(text)) { - // 判断后两次更新时间间隔,如果小于1分钟就显示错误 - CronExpression cron = new CronExpression(text); - Date next1 = cron.getNextValidTimeAfter(new Date()); - Date next2 = cron.getNextValidTimeAfter(next1); - if (next2.getTime() - next1.getTime() < CacheConstants.MILLIS_OF_MINUTE) { - this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); - this.schemaTimeCheckTips.setVisible(true); - throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); - } - if (checkCornTimeInterval(text)) { schemaTimes.add(text); } else { @@ -221,8 +211,6 @@ public class ESDStrategyConfigPane extends BasicBeanPane { } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - } catch (ParseException e) { - throw new RuntimeException(e); } } From 8d441237c0a33e291fba097752e0a7e3cab9285e Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Fri, 8 Jul 2022 10:10:17 +0800 Subject: [PATCH 16/17] =?UTF-8?q?REPORT-74118=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E6=95=B0=E6=8D=AE=E6=BA=90=E8=80=81=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0=E6=95=B0=E6=8D=AE=E9=9B=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=B9=B6=E6=B7=BB=E5=8A=A0=E5=A4=9A=E5=88=86=E7=B1=BB?= =?UTF-8?q?=EF=BC=8C=E5=A4=9A=E5=88=86=E7=B1=BB=E4=B8=8D=E5=8F=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/data/VanChartMoreCateTableDataContentPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java index dcf160aec1..4d9f0aa61f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java @@ -22,13 +22,14 @@ public class VanChartMoreCateTableDataContentPane extends CategoryPlotMoreCateTa @Override public void populateBean(ChartCollection collection) { super.populateBean(collection); - VanChartRectanglePlot plot = (VanChartRectanglePlot) collection.getSelectedChart().getPlot(); + VanChartRectanglePlot plot = collection.getSelectedChart().getPlot(); isSupportMultiCategory = plot.isSupportMultiCategory(); checkBoxList(isSupportMultiCategory); } protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) { super.updateMoreCate(normal, plot); + isSupportMultiCategory = ((VanChartRectanglePlot) plot).isSupportMultiCategory(); ((VanChartPlot) plot).setCategoryNum(getBoxList().size() + 1); if (!getBoxList().isEmpty()) { plot.getDataSheet().setVisible(false); From fa538f3d78e12fb3af1ad65b72552009e284e886 Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 11 Jul 2022 13:49:53 +0800 Subject: [PATCH 17/17] =?UTF-8?q?REPORT-72354=20=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BC=98=E5=8C=96=E4=BA=8C=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 74 +++++++++++ .../com/fr/design/report/ImageExportPane.java | 119 ++++++------------ .../fr/start/module/DesignerActivator.java | 11 +- 3 files changed, 121 insertions(+), 83 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 9f15abee71..15f731b779 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UINoThemeColorButton; +import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIDictionaryComboBox; @@ -26,6 +27,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iprogressbar.UIProgressBarUI; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.jdk.JdkVersion; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; @@ -42,8 +44,10 @@ import com.fr.general.FRFont; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.log.Log4jConfig; +import com.fr.io.attr.ImageExportAttr; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; +import com.fr.report.ReportConfigManager; import com.fr.stable.Constants; import com.fr.stable.os.OperatingSystem; import com.fr.third.apache.logging.log4j.Level; @@ -55,6 +59,8 @@ import com.fr.workspace.server.vcs.git.config.GcConfig; import javax.swing.BorderFactory; import javax.swing.BoxLayout; +import javax.swing.ButtonGroup; +import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JOptionPane; @@ -190,6 +196,14 @@ public class PreferencePane extends BasicPane { private Timer gcProgressTimer; private UIButton gcOkButton = new UIButton(i18nText("Fine-Design_Report_OK")); + private UIRadioButton previewResolutionBtnS; + private UIRadioButton previewResolutionBtnM; + + private UIRadioButton previewRenderSpeed; + private UIRadioButton previewRenderQuality; + private static final int DPI_SCALE_S = 1; + private static final int DPI_SCALE_M = 2; + public PreferencePane() { this.initComponents(); } @@ -274,6 +288,7 @@ public class PreferencePane extends BasicPane { JPanel imageCompressPanel = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Template_Preview_Performance")); imageCompressPanelCheckBox = new UICheckBox(i18nText("Fine-Design_Image_Compress")); imageCompressPanel.add(imageCompressPanelCheckBox); + imageCompressPanel.add(createImageExportSettingPane()); advancePane.add(imageCompressPanel); JPanel designerStartupOption = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Startup_Option")); @@ -282,6 +297,34 @@ public class PreferencePane extends BasicPane { advancePane.add(designerStartupOption); } + private JPanel createImageExportSettingPane() { + previewResolutionBtnS = new UIRadioButton(i18nText("Fine-Design_Image_Export_SD"), true); + previewResolutionBtnM = new UIRadioButton(i18nText("Fine-Design_Image_Export_HD")); + ButtonGroup previewResolutionBtnGroup = new ButtonGroup(); + previewResolutionBtnGroup.add(previewResolutionBtnS); + previewResolutionBtnGroup.add(previewResolutionBtnM); + + previewRenderSpeed = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Speed_Priority")); + previewRenderQuality = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Quality_First")); + ButtonGroup previewRenderGroup = new ButtonGroup(); + previewRenderGroup.add(previewRenderQuality); + previewRenderGroup.add(previewRenderSpeed); + JPanel imageExportSettingPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JComponent[][] templateComps = { + {new UILabel(Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce") + ":"), this.previewResolutionBtnS, this.previewResolutionBtnM}, + {new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.previewRenderQuality, this.previewRenderSpeed}, + }; + imageExportSettingPane.add( + TableLayoutHelper.createGapTableLayoutPane( + templateComps, + new double[]{TableLayout.FILL, TableLayout.FILL}, + new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, + 20, 0), + BorderLayout.CENTER); + imageExportSettingPane.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0)); + return imageExportSettingPane; + } + private void createVcsSettingPane(JPanel generalPane) { JPanel vcsPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title")); generalPane.add(vcsPane); @@ -757,6 +800,25 @@ public class PreferencePane extends BasicPane { this.startWithEmptyFile.setSelected(designerEnvManager.isStartWithEmptyFile()); this.imageCompressPanelCheckBox.setSelected(designerEnvManager.isImageCompress()); + + ImageExportAttr attr = ReportConfigManager.getProviderInstance().getImageExportAttr(); + if (attr.getPreviewRenderQuality() == ImageExportAttr.RENDER_SPEED) { + previewRenderSpeed.setSelected(true); + } else { + previewRenderQuality.setSelected(true); + } + + if (attr.getPreviewResolutionScale() == DPI_SCALE_S) { + previewResolutionBtnS.setSelected(true); + } else { + previewResolutionBtnM.setSelected(true); + } + boolean enabled = WorkContext.getCurrent().isLocal() || WorkContext.getCurrent().isRoot(); + previewRenderSpeed.setEnabled(enabled); + previewRenderQuality.setEnabled(enabled); + previewResolutionBtnS.setEnabled(enabled); + previewResolutionBtnM.setEnabled(enabled); + this.cloudAnalyticsDelayCheckBox.setSelected(designerEnvManager.isCloudAnalyticsDelay()); } @@ -883,6 +945,18 @@ public class PreferencePane extends BasicPane { } }); + ImageExportAttr attr = ReportConfigManager.getProviderInstance().getImageExportAttr(); + if (previewRenderSpeed.isSelected()) { + attr.setPreviewRenderQuality(ImageExportAttr.RENDER_SPEED); + } else { + attr.setPreviewRenderQuality(ImageExportAttr.RENDER_QUALITY); + } + if (previewResolutionBtnS.isSelected()) { + attr.setPreviewResolutionScale(DPI_SCALE_S); + } else { + attr.setPreviewResolutionScale(DPI_SCALE_M); + } + } // 如果语言设置改变了,则显示重启对话框 diff --git a/designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java b/designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java index d32c006a65..b8d6167335 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java @@ -9,8 +9,9 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.io.attr.ImageExportAttr; import com.fr.io.attr.ReportExportAttr; -import com.fr.report.ReportConfigManager; +import java.awt.Color; +import javax.swing.AbstractButton; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.JComponent; @@ -35,33 +36,26 @@ public class ImageExportPane extends AbstractExportPane { private UIRadioButton globalFormatJpg; private UIRadioButton globalFormatPng; - private UIRadioButton previewResolutionBtnS; - private UIRadioButton previewResolutionBtnM; - - private UIRadioButton previewRenderSpeed; - private UIRadioButton previewRenderQuality; + private UIRadioButton templateThumbnail; + private UIRadioButton templatePaging; private static final int RESOLUTION_S = 96; private static final int RESOLUTION_M = 192; private static final int RESOLUTION_L = 300; - private static final int DPI_SCALE_S = 1; - private static final int DPI_SCALE_M = 2; - private static final int GAP = 20; - public static final String GLOBAL_CONF = Toolkit.i18nText("Fine-Design_Image_Export_Global_Configuration"); - - - private ReportExportAttr reportExportAttr; + public static final String GLOBAL_CONF = Toolkit.i18nText("Fine-Design_Image_Export_Setting"); public ImageExportPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); JPanel globalTitlePane = FRGUIPaneFactory.createTitledBorderPane(GLOBAL_CONF); - JPanel previewSetting = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Preview")); + JPanel tipsTitlePane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Advice")); + UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips")); + tipLabel.setForeground(Color.RED); + tipsTitlePane.add(tipLabel); this.add(globalTitlePane, BorderLayout.NORTH); - this.add(previewSetting, BorderLayout.CENTER); initGlobalSettings(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -69,6 +63,7 @@ public class ImageExportPane extends AbstractExportPane { {new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":"), this.globalResolutionBtnS, this.globalResolutionBtnM, this.globalResolutionBtnL}, {new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":"), this.globalFormatJpg, null, this.globalFormatPng}, {new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.globalRenderQuality, null, this.globalRenderSpeed}, + {new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":"), this.templateThumbnail, null, this.templatePaging} }; centerPane.add( TableLayoutHelper.createCommonTableLayoutPane( @@ -77,23 +72,8 @@ public class ImageExportPane extends AbstractExportPane { new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, GAP), BorderLayout.CENTER); + centerPane.add(tipsTitlePane,BorderLayout.SOUTH); globalTitlePane.add(centerPane, BorderLayout.CENTER); - JPanel templateCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - JComponent[][] templateComps = { - {new UILabel(Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce") + ":"), this.previewResolutionBtnS, this.previewResolutionBtnM}, - {new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.previewRenderQuality, this.previewRenderSpeed}, - }; - templateCenterPane.add( - TableLayoutHelper.createCommonTableLayoutPane( - templateComps, - new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, - new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, - GAP), - BorderLayout.CENTER); - - previewSetting.add(templateCenterPane, BorderLayout.CENTER); - - } @@ -101,36 +81,29 @@ public class ImageExportPane extends AbstractExportPane { globalResolutionBtnS = new UIRadioButton("96dpi", true); globalResolutionBtnM = new UIRadioButton("192dpi"); globalResolutionBtnL = new UIRadioButton("300dpi"); - ButtonGroup globalResolutionBtnGroup = new ButtonGroup(); - globalResolutionBtnGroup.add(globalResolutionBtnS); - globalResolutionBtnGroup.add(globalResolutionBtnM); - globalResolutionBtnGroup.add(globalResolutionBtnL); + wrapButtonsInButtonGroup(globalResolutionBtnS, globalResolutionBtnM, globalResolutionBtnL); globalFormatJpg = new UIRadioButton("jpg", true); globalFormatPng = new UIRadioButton("png"); - ButtonGroup globalFormatGroup = new ButtonGroup(); - globalFormatGroup.add(globalFormatJpg); - globalFormatGroup.add(globalFormatPng); + wrapButtonsInButtonGroup(globalFormatJpg, globalFormatPng); globalRenderQuality = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Quality_First"), true); globalRenderSpeed = new UIRadioButton(Toolkit.i18nText(("Fine-Design_Image_Export_Speed_Priority"))); - ButtonGroup globalRenderGroup = new ButtonGroup(); - globalRenderGroup.add(globalRenderQuality); - globalRenderGroup.add(globalRenderSpeed); - - previewResolutionBtnS = new UIRadioButton("100%", true); - previewResolutionBtnM = new UIRadioButton("200%"); - ButtonGroup previewResolutionBtnGroup = new ButtonGroup(); - previewResolutionBtnGroup.add(previewResolutionBtnS); - previewResolutionBtnGroup.add(previewResolutionBtnM); - - previewRenderSpeed = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Speed_Priority")); - previewRenderQuality = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Quality_First")); - ButtonGroup previewRenderGroup = new ButtonGroup(); - previewRenderGroup.add(previewRenderQuality); - previewRenderGroup.add(previewRenderSpeed); + wrapButtonsInButtonGroup(globalRenderQuality, globalRenderSpeed); + + templateThumbnail = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Thumbnail")); + templatePaging = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Paging")); + wrapButtonsInButtonGroup(templateThumbnail, templatePaging); } + private void wrapButtonsInButtonGroup(AbstractButton... buttons) { + if (buttons != null) { + ButtonGroup buttonGroup = new ButtonGroup(); + for (AbstractButton button : buttons) { + buttonGroup.add(button); + } + } + } /** * 展示界面 @@ -150,10 +123,6 @@ public class ImageExportPane extends AbstractExportPane { updateBean(); } - private ImageExportAttr getGlobalImageExportAttr() { - return ReportConfigManager.getProviderInstance().getImageExportAttr(); - } - /** * 标题 * @@ -166,7 +135,11 @@ public class ImageExportPane extends AbstractExportPane { @Override public void populateBean(Object exportAttr) { - ImageExportAttr attr = getGlobalImageExportAttr(); + ReportExportAttr reportExportAttr = (ReportExportAttr) exportAttr; + ImageExportAttr attr = reportExportAttr.getImageExportAttr(); + if (attr == null) { + attr = new ImageExportAttr(); + } switch (attr.getResolution()) { case 192: globalResolutionBtnM.setSelected(true); @@ -187,24 +160,17 @@ public class ImageExportPane extends AbstractExportPane { } else { globalRenderQuality.setSelected(true); } - - if (attr.getPreviewRenderQuality() == ImageExportAttr.RENDER_SPEED) { - previewRenderSpeed.setSelected(true); - } else { - previewRenderQuality.setSelected(true); - } - - if (attr.getPreviewResolutionScale() == DPI_SCALE_S) { - previewResolutionBtnS.setSelected(true); + if (attr.isPaging()) { + templatePaging.setSelected(true); } else { - previewResolutionBtnM.setSelected(true); + templateThumbnail.setSelected(true); } - } @Override public void updateBean(Object exportAttr) { - ImageExportAttr attr = getGlobalImageExportAttr(); + ReportExportAttr reportExportAttr = (ReportExportAttr) exportAttr; + ImageExportAttr attr = new ImageExportAttr(); if (globalResolutionBtnS.isSelected()) { attr.setResolution(RESOLUTION_S); } else if (globalResolutionBtnM.isSelected()) { @@ -222,17 +188,8 @@ public class ImageExportPane extends AbstractExportPane { } else { attr.setRenderQuality(ImageExportAttr.RENDER_QUALITY); } - - if (previewRenderSpeed.isSelected()) { - attr.setPreviewRenderQuality(ImageExportAttr.RENDER_SPEED); - } else { - attr.setPreviewRenderQuality(ImageExportAttr.RENDER_QUALITY); - } - if (previewResolutionBtnS.isSelected()) { - attr.setPreviewResolutionScale(DPI_SCALE_S); - } else { - attr.setPreviewResolutionScale(DPI_SCALE_M); - } + attr.setPaging(templatePaging.isSelected()); + reportExportAttr.setImageExportAttr(attr); } @Override diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 02152beb17..53ef2525e7 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -102,6 +102,8 @@ import com.fr.log.FineLoggerFactory; import com.fr.log.LogHandler; import com.fr.module.Activator; import com.fr.module.extension.Prepare; +import com.fr.plugin.beforeload.embed.DefaultPluginEmbedInfo; +import com.fr.plugin.beforeload.embed.PluginEmbedInfo; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; @@ -154,7 +156,7 @@ import javax.swing.SwingWorker; public class DesignerActivator extends Activator implements Prepare { private LogHandler logHandler = null; - + private static final String PLUGIN_EXPORT_IMAGE_SETTING = "com.fr.plugin.exportimagesettings.v11"; private final Once pushUpdateTask = new Once(new Runnable() { @Override public void run() { @@ -521,8 +523,13 @@ public class DesignerActivator extends Activator implements Prepare { }.execute(); } }); + prepareDefaultEmbedPluginInfo(); } - + + private void prepareDefaultEmbedPluginInfo() { + addMutable(PluginEmbedInfo.KEY, DefaultPluginEmbedInfo.create(PLUGIN_EXPORT_IMAGE_SETTING)); + } + private void startLoginAuthServer() { OptimizeUtil.open(() -> {