From e10d823db90dea0b3ce84b7b1aa6001834c99bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 22 Oct 2021 16:41:17 +0800 Subject: [PATCH 01/45] =?UTF-8?q?REPORT-61301=20=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=8E=A8=E8=8D=90-mac=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E6=97=B6=EF=BC=8C=E5=9B=BA=E5=AE=9A=E5=B8=83=E5=B1=80?= =?UTF-8?q?/=E9=9D=9E=E5=9B=BA=E5=AE=9A=E5=B8=83=E5=B1=80=E7=9A=84?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=A3=98=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormArea.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index e08c1c652d..b3e35873f3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe; -import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEvent; @@ -11,23 +10,22 @@ import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.fit.DesignerUIModeConfig; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonUI; -import com.fr.design.gui.imenu.UIPopupMenu; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.share.ui.base.PopupMenuItem; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.design.utils.gui.GUIPaintUtils; -import com.fr.form.fit.NewFormMarkAttr; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.share.ui.base.PopupMenuItem; import com.fr.design.scrollruler.BaseRuler; import com.fr.design.scrollruler.HorizontalRuler; import com.fr.design.scrollruler.RulerLayout; import com.fr.design.scrollruler.ScrollRulerComponent; import com.fr.design.scrollruler.VerticalRuler; import com.fr.design.utils.ComponentUtils; +import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.LayoutUtils; +import com.fr.form.fit.NewFormMarkAttr; import com.fr.form.main.mobile.FormMobileAttr; import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBorderLayout; @@ -35,7 +33,6 @@ import com.fr.form.ui.container.WFitLayout; import com.fr.general.IOUtils; import com.fr.stable.AssistUtils; - import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.BorderFactory; @@ -65,7 +62,6 @@ import java.awt.event.FocusEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseWheelEvent; -import java.awt.event.MouseWheelListener; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; @@ -214,7 +210,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - GUICoreUtils.showPopupMenu(popupMenu, fixLayoutSwitchButton, 0, -59); + popupMenu.show(fixLayoutSwitchButton, 0, -59); } }); button.setVisible(!isAbsoluteBodyLayout()); From 0f4e9ca654a5b6754540b1a25fe2cb4a21e2e1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 22 Oct 2021 17:28:09 +0800 Subject: [PATCH 02/45] =?UTF-8?q?REPORT-60538=20=E8=8B=B1=E6=97=A5?= =?UTF-8?q?=E9=9F=A9=E7=8E=AF=E5=A2=83=E6=9C=AA=E5=B1=8F=E8=94=BD=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=BB=84=E4=BB=B6=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormWidgetDetailPane.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index f2268c86cf..fd5b7305cb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ilable.UILabel; @@ -10,6 +11,7 @@ import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; +import com.fr.general.GeneralContext; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -23,6 +25,7 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.util.ArrayList; import java.util.List; +import java.util.Locale; /** * Created with IntelliJ IDEA. @@ -173,7 +176,14 @@ public class FormWidgetDetailPane extends FormDockView{ private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - paneList.add(OnlineWidgetRepoPane.getInstance()); + if (isAddOnlineWidgetRepoPane()) { + paneList.add(OnlineWidgetRepoPane.getInstance()); + } + } + + private boolean isAddOnlineWidgetRepoPane() { + Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); + return locale != null && GeneralContext.isChineseEnv(); } } From 02c5a3cacf9ab597cdc69606dfcf05d6eac466e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 22 Oct 2021 17:33:41 +0800 Subject: [PATCH 03/45] REPORT-60538 --- .../com/fr/design/mainframe/FormWidgetDetailPane.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index fd5b7305cb..da14659b66 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ilable.UILabel; @@ -25,7 +24,6 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.util.ArrayList; import java.util.List; -import java.util.Locale; /** * Created with IntelliJ IDEA. @@ -176,14 +174,8 @@ public class FormWidgetDetailPane extends FormDockView{ private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - if (isAddOnlineWidgetRepoPane()) { + if (GeneralContext.isChineseEnv()) { paneList.add(OnlineWidgetRepoPane.getInstance()); } } - - private boolean isAddOnlineWidgetRepoPane() { - Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); - return locale != null && GeneralContext.isChineseEnv(); - } - } From e6557295c6d35e678f53922cc98277b541c69d90 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 25 Oct 2021 09:50:50 +0800 Subject: [PATCH 04/45] =?UTF-8?q?REPORT-59682=20=E5=9F=8B=E7=82=B9?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/report/fit/menupane/ReportFitAttrAction.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index c1dd3afd6e..ba37ea18b7 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -70,11 +70,15 @@ public class ReportFitAttrAction extends JTemplateAction { UIDialog dialog = attrPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { - wbTpl.setReportFitAttr(attrPane.updateBean()); - jwb.fireTargetModified(); + fireEditingOk(jwb, wbTpl, attrPane.updateBean(), fitAttr); } }, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.templatePane.dialog")); dialog.setVisible(true); } + private void fireEditingOk(final JTemplate jwb, final FitProvider wbTpl, ReportFitAttr newReportFitAttr, ReportFitAttr oldReportFitAttr) { + wbTpl.setReportFitAttr(newReportFitAttr); + jwb.fireTargetModified(); + } + } From f9d27e98452dd8470e9f49e2306d695b591abffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:17:33 +0800 Subject: [PATCH 05/45] =?UTF-8?q?REPORT-57521=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=97=B6websocket=E6=96=AD=E5=BC=80=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/toast/DesignerToastMsgUtil.java | 20 +++++-- .../mainframe/toast/ToastMsgDialog.java | 9 ++- .../mainframe/socketio/DesignerSocketIO.java | 58 ++++++++++++++----- 3 files changed, 66 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java b/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java index 4e69c34c56..300f8537e2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java @@ -6,17 +6,17 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.Constants; -import java.awt.Dialog; -import java.awt.Frame; -import java.awt.Window; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JEditorPane; import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; +import java.awt.Dialog; import java.awt.Dimension; import java.awt.Font; +import java.awt.Frame; +import java.awt.Window; /** * Created by kerry on 5/6/21 @@ -31,6 +31,13 @@ public class DesignerToastMsgUtil { } + public static ToastMsgDialog createPromptDialog(String text) { + return createDialog(PROMPT_ICON, toastPane(text), DesignerContext.getDesignerFrame()); + } + + public static ToastMsgDialog createPromptDialog(JPanel contentPane) { + return createDialog(PROMPT_ICON, contentPane, DesignerContext.getDesignerFrame()); + } public static void toastPrompt(JPanel contendPane) { toastPane(PROMPT_ICON, contendPane, DesignerContext.getDesignerFrame()); @@ -69,6 +76,11 @@ public class DesignerToastMsgUtil { } private static void toastPane(Icon icon, JPanel contendPane, Window parent) { + ToastMsgDialog dialog = createDialog(icon, contendPane, parent); + dialog.setVisible(true); + } + + private static ToastMsgDialog createDialog(Icon icon, JPanel contendPane, Window parent) { JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UILabel uiLabel = new UILabel(icon); uiLabel.setVerticalAlignment(SwingConstants.TOP); @@ -83,7 +95,7 @@ public class DesignerToastMsgUtil { } else { dialog = new ToastMsgDialog((Frame) parent, pane); } - dialog.setVisible(true); + return dialog; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java index 00f4f95ead..69865c7059 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java @@ -5,8 +5,8 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.mainframe.DesignerContext; import com.fr.module.ModuleContext; -import java.awt.Dialog; import javax.swing.JPanel; +import java.awt.Dialog; import java.awt.Dimension; import java.awt.Frame; import java.awt.Point; @@ -24,6 +24,7 @@ public class ToastMsgDialog extends UIDialog { private ScheduledExecutorService TIMER; private int hide_height = 0; private JPanel contentPane; + private boolean show = false; public ToastMsgDialog(Frame parent, JPanel panel) { super(parent); @@ -65,6 +66,7 @@ public class ToastMsgDialog extends UIDialog { public void display(JPanel outerJPanel) { + show = true; outerJPanel.setLocation(0, -hide_height); ScheduledExecutorService TIP_TOOL_TIMER = createToastScheduleExecutorService(); TIP_TOOL_TIMER.scheduleAtFixedRate(new Runnable() { @@ -98,6 +100,7 @@ public class ToastMsgDialog extends UIDialog { TIP_TOOL_TIMER.shutdown(); ToastMsgDialog.this.setVisible(false); ToastMsgDialog.this.dispose(); + ToastMsgDialog.this.show = false; } outerJPanel.setLocation(point.x, point.y - 5); Dimension dimension = ToastMsgDialog.this.getSize(); @@ -159,5 +162,7 @@ public class ToastMsgDialog extends UIDialog { super.dispose(); } - + public boolean isShow() { + return show; + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index fba15b0432..e6c3a24fe4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -3,15 +3,19 @@ package com.fr.design.mainframe.socketio; import com.fr.config.RemoteConfigEvent; import com.fr.decision.webservice.utils.DecisionServiceConstants; import com.fr.design.DesignerEnvManager; -import com.fr.design.EnvChangeEntrance; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfoContext; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.DesignerContext; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.loghandler.DesignerLogger; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.design.mainframe.toast.ToastMsgDialog; import com.fr.design.ui.util.UIUtil; +import com.fr.design.utils.BrowseUtils; import com.fr.event.EventDispatcher; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; @@ -29,20 +33,24 @@ import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnectionInfo; -import com.fr.workspace.server.socket.SocketInfoOperator; import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; +import javax.net.ssl.SSLContext; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseEvent; import java.io.File; import java.io.FileInputStream; -import java.security.KeyStore; -import java.util.Arrays; -import javax.net.ssl.SSLContext; -import javax.swing.*; import java.io.IOException; import java.net.URI; import java.net.URL; +import java.security.KeyStore; +import java.util.Arrays; import java.util.Timer; import java.util.TimerTask; @@ -54,6 +62,7 @@ public class DesignerSocketIO { Disconnecting } + private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("help.websocket", "https://help.fanruan.com/finereport/doc-view-2512.html"); private static final String HTTPS = "https"; private static final String HTTP = "http"; private static Socket socket = null; @@ -66,6 +75,7 @@ public class DesignerSocketIO { private static int count; // 当前webSocket选择的协议 private static String currentProtocol; + private static ToastMsgDialog dialog = null; public static void close() { @@ -185,6 +195,7 @@ public class DesignerSocketIO { private static final Emitter.Listener failRetry = new Emitter.Listener() { @Override public void call(Object... args) { + showConnectionLostDialog(); printLog(args, PrintEventLogImpl.WARN, "failed args: {}"); status = Status.Disconnecting; socket.close(); @@ -251,13 +262,13 @@ public class DesignerSocketIO { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - FineJOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - UIManager.getString("OptionPane.messageDialogTitle"), - JOptionPane.ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); - EnvChangeEntrance.getInstance().chooseEnv(); + if (dialog == null) { + dialog = DesignerToastMsgUtil.createPromptDialog(createDialogContent()); + } + + if (!dialog.isShow()) { + dialog.setVisible(true); + } } }); } catch (Exception e) { @@ -265,6 +276,23 @@ public class DesignerSocketIO { } } + private static JPanel createDialogContent() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_WebSocket_Lost_Tip")), BorderLayout.WEST); + UILabel hyperLinkLabel = new UILabel(Toolkit.i18nText("Fine-Design_WebSocket_Lost_Tip_HyperLink_Text")); + hyperLinkLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + BrowseUtils.browser(WEBSOCKET_HELP_DOC); + } + }); + hyperLinkLabel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0)); + hyperLinkLabel.setForeground(Color.BLUE); + hyperLinkLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + jPanel.add(hyperLinkLabel, BorderLayout.CENTER); + return jPanel; + } + //配置变更监听器 private static final Emitter.Listener modifyConfig = new Emitter.Listener() { @Override From c8eafd75e8723d738795371a0f4ea4996ac98690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:19:31 +0800 Subject: [PATCH 06/45] =?UTF-8?q?REPORT-60538=20=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index da14659b66..be32dc922a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -10,7 +10,6 @@ import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; -import com.fr.general.GeneralContext; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -174,8 +173,6 @@ public class FormWidgetDetailPane extends FormDockView{ private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - if (GeneralContext.isChineseEnv()) { - paneList.add(OnlineWidgetRepoPane.getInstance()); - } + paneList.add(OnlineWidgetRepoPane.getInstance()); } } From e3eac1175c6ec3a79255901e2dbe12365210bb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:20:07 +0800 Subject: [PATCH 07/45] =?UTF-8?q?REPORT-60538=20=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/FormWidgetDetailPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index be32dc922a..d17071f10a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -175,4 +175,5 @@ public class FormWidgetDetailPane extends FormDockView{ paneList.add(LocalWidgetRepoPane.getInstance()); paneList.add(OnlineWidgetRepoPane.getInstance()); } + } From 5db55bd0c726286ae572b4d739775b5bf1e0a03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:22:01 +0800 Subject: [PATCH 08/45] =?UTF-8?q?REPORT-60538=20=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index d17071f10a..a82d6d74df 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -175,5 +175,5 @@ public class FormWidgetDetailPane extends FormDockView{ paneList.add(LocalWidgetRepoPane.getInstance()); paneList.add(OnlineWidgetRepoPane.getInstance()); } - -} + +} \ No newline at end of file From 340700014bc3c7f5bf8f7837c51a703e97f75316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 28 Oct 2021 10:27:15 +0800 Subject: [PATCH 09/45] =?UTF-8?q?REPORT-57521=20=E7=AA=81=E7=84=B6?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E5=B7=B2=E7=BB=8F=E6=9C=89=E5=85=B3=E4=BA=8E?= =?UTF-8?q?websocket=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/socketio/DesignerSocketIO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e6c3a24fe4..a6edb04083 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -62,7 +62,7 @@ public class DesignerSocketIO { Disconnecting } - private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("help.websocket", "https://help.fanruan.com/finereport/doc-view-2512.html"); + private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("websocketConnect", "https://help.fanruan.com/finereport/doc-view-2512.html"); private static final String HTTPS = "https"; private static final String HTTP = "http"; private static Socket socket = null; From 65a21b3de274ca339558a36e9d8d83d0c912cf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 29 Oct 2021 14:05:18 +0800 Subject: [PATCH 10/45] =?UTF-8?q?REPORT-58584=20FR11-=E4=BA=8C=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92-=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=A0=8F-=E6=9C=8D=E5=8A=A1=E5=99=A8-=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86-=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E9=87=8D=E5=90=8D=E6=97=B6=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/WidgetConfigPane.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java index 0a981a90fa..78fd57d5da 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java @@ -1,24 +1,55 @@ package com.fr.design.widget; +import com.fr.base.Parameter; +import com.fr.base.ParameterConfig; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.core.WidgetConstants; +import com.fr.design.i18n.Toolkit; import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.WidgetConfig; import com.fr.form.ui.WidgetInfoConfig; +import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; +import com.fr.stable.StringUtils; +import com.fr.stable.core.PropertyChangeAdapter; +import javax.swing.SwingUtilities; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.List; +import static javax.swing.JOptionPane.WARNING_MESSAGE; + /** * Widget配置面板 */ public class WidgetConfigPane extends JListControlPane { + public WidgetConfigPane() { + this.addEditingListener(new PropertyChangeAdapter() { + public void propertyChange() { + Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); + String[] allListNames = nameableList.getAllNames(); + allListNames[editingIndex] = StringUtils.EMPTY; + String tempName = getEditingName(); + if (!ComparatorUtils.equals(tempName, selectedName) + && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { + nameableList.stopEditing(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WidgetConfigPane.this), + Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), + Toolkit.i18nText("Fine-Design_Basic_Alert"), + WARNING_MESSAGE); + setIllegalIndex(editingIndex); + } + } + }); + } + /** * 创建用户自定义widget组件 * From 82bf9d3b2579ff0483011eb9d921153ac45dec77 Mon Sep 17 00:00:00 2001 From: "Fly.Li" Date: Fri, 29 Oct 2021 14:25:49 +0800 Subject: [PATCH 11/45] =?UTF-8?q?REPORT-61671=EF=BC=9A=E6=96=B0=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=8A=A5=E8=A1=A8=E7=9A=84=E6=8A=A5=E8=A1=A8=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E5=B1=9E=E6=80=A7=E9=BB=98=E8=AE=A4=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=96=B0=E5=BC=95=E6=93=8E=E6=97=B6=EF=BC=8C=E6=96=B0=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E9=80=89=E9=A1=B9=E4=B8=8B=E6=96=B9=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=87=BA=E7=8E=B0=E5=9B=BA=E5=AE=9A=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/report/ReportEnginePane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java index c2a959094a..6d1f2ef0a0 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java @@ -104,6 +104,7 @@ public class ReportEnginePane extends BasicBeanPane { engineSettingPane.setBounds(0, 0, 570, 240); createEngineXSettingPane(); createLineEngineSettingPane(); + outLineEngineSettingPane.setVisible(false); engineSettingPane.add(outEngineXSettingPane, JLayeredPane.DEFAULT_LAYER); engineSettingPane.add(outLineEngineSettingPane, JLayeredPane.DEFAULT_LAYER); engineSettingPane.moveToFront(outEngineXSettingPane); From 91523213fdcfdd34b4097b1515c106cbcaf24f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 29 Oct 2021 14:31:17 +0800 Subject: [PATCH 12/45] REPORT-58584 --- .../gui/controlpane/JListControlPane.java | 33 +++++++++++++++++++ .../design/parameter/ParameterArrayPane.java | 24 +------------- .../fr/design/widget/WidgetConfigPane.java | 24 ++------------ 3 files changed, 36 insertions(+), 45 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 82cba758b7..8401ffad5c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -1,10 +1,14 @@ package com.fr.design.gui.controlpane; +import com.fr.base.Parameter; +import com.fr.base.ParameterConfig; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ModNameActionListener; +import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.event.Listener; import com.fr.general.ComparatorUtils; @@ -12,6 +16,7 @@ import com.fr.general.IOUtils; import com.fr.invoke.Reflect; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; +import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.DefaultListCellRenderer; @@ -23,12 +28,16 @@ import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import java.util.Arrays; import java.util.Collection; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import java.util.List; + +import static javax.swing.JOptionPane.WARNING_MESSAGE; public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider { private static final String LIST_NAME = "JControl_List"; @@ -424,4 +433,28 @@ public abstract class JListControlPane extends JControlPane implements ListContr } + public void showTipWithIllegalName(String tip) { + Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); + String[] allListNames = nameableList.getAllNames(); + allListNames[editingIndex] = StringUtils.EMPTY; + String tempName = getEditingName(); + if (StringUtils.isEmpty(tempName)) { + nameableList.stopEditing(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), + Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); + setIllegalIndex(editingIndex); + return; + } + + if (!ComparatorUtils.equals(tempName, selectedName) + && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { + nameableList.stopEditing(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), + tip, + Toolkit.i18nText("Fine-Design_Basic_Alert"), + WARNING_MESSAGE); + setIllegalIndex(editingIndex); + } + } + } diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index 2703a2a2b8..c5c7a12c9a 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -1,21 +1,15 @@ package com.fr.design.parameter; import com.fr.base.Parameter; -import com.fr.base.ParameterConfig; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableSelfCreator; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.i18n.Toolkit; -import com.fr.general.ComparatorUtils; import com.fr.stable.Nameable; -import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; -import javax.swing.*; import java.util.Arrays; -import java.util.List; public class ParameterArrayPane extends JListControlPane { @@ -29,23 +23,7 @@ public class ParameterArrayPane extends JListControlPane { this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue()); this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { - Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); - String[] allListNames = nameableList.getAllNames(); - allListNames[editingIndex] = StringUtils.EMPTY; - String tempName = getEditingName(); - if (StringUtils.isEmpty(tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); - setIllegalIndex(editingIndex); - return; - } - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), - Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); - setIllegalIndex(editingIndex); - } + showTipWithIllegalName(Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); } }); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java index 78fd57d5da..9ec4a1caf7 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java @@ -1,8 +1,5 @@ package com.fr.design.widget; -import com.fr.base.Parameter; -import com.fr.base.ParameterConfig; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; @@ -11,41 +8,24 @@ import com.fr.design.i18n.Toolkit; import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.WidgetConfig; import com.fr.form.ui.WidgetInfoConfig; -import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; -import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; -import javax.swing.SwingUtilities; import java.util.ArrayList; -import java.util.Arrays; import java.util.Iterator; import java.util.List; -import static javax.swing.JOptionPane.WARNING_MESSAGE; - /** * Widget配置面板 */ public class WidgetConfigPane extends JListControlPane { public WidgetConfigPane() { + super(); this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { - Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); - String[] allListNames = nameableList.getAllNames(); - allListNames[editingIndex] = StringUtils.EMPTY; - String tempName = getEditingName(); - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WidgetConfigPane.this), - Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), - Toolkit.i18nText("Fine-Design_Basic_Alert"), - WARNING_MESSAGE); - setIllegalIndex(editingIndex); - } + showTipWithIllegalName(Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure")); } }); } From 84d58cae82af6d5d9a0d06d07b6af056825fa898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 29 Oct 2021 15:32:04 +0800 Subject: [PATCH 13/45] REPORT-58584 --- .../data/datapane/TableDataPaneListPane.java | 55 +++++++++---------- .../datapane/connect/ConnectionListPane.java | 38 +++++-------- .../gui/controlpane/JListControlPane.java | 53 ++++++++++++------ .../design/parameter/ParameterArrayPane.java | 18 +++++- .../fr/design/widget/WidgetConfigPane.java | 9 ++- 5 files changed, 98 insertions(+), 75 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index a16c16e24d..07d7abfb72 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -9,7 +9,6 @@ import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.FineJOptionPane; -import com.fr.design.gui.NameInspector; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.ilist.ListModelElement; @@ -25,18 +24,18 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; - import com.fr.third.org.apache.commons.collections4.MapUtils; import com.fr.workspace.WorkContext; -import javax.swing.*; + +import javax.swing.DefaultListModel; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; /** * TableDataList Pane. @@ -52,15 +51,12 @@ public class TableDataPaneListPane extends JListControlPane implements TableData @Override public void propertyChange() { isNamePermitted = true; - String tempName = getEditingName(); - if (ComparatorUtils.equals(tempName, selectedName)) { - //说明双击之后又取消了,啥也不用做 + if (!checkName()) { + isNamePermitted = false; return; } - Set allDSNames = DesignTableDataManager.getGlobalDataSet().keySet(); - String[] allListNames = nameableList.getAllNames(); - allListNames[editingIndex] = StringUtils.EMPTY; + String tempName = getEditingName(); Object editingType = getEditingType(); if (!BasicTableDataUtils.checkName(tempName)) { @@ -70,35 +66,36 @@ public class TableDataPaneListPane extends JListControlPane implements TableData return; } - if (StringUtils.isEmpty(tempName)) { - isNamePermitted = false; - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), - Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"), - Toolkit.i18nText("Fine-Design_Report_Alert"), - JOptionPane.WARNING_MESSAGE); - setIllegalIndex(editingIndex); - return; - } - boolean isRepeated = isNameRepeated(new Collection[]{allDSNames, Arrays.asList(allListNames)}, tempName); - if (isRepeated) { - isNamePermitted = false; - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", tempName)); - setIllegalIndex(editingIndex); - } else if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) { + if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) { isNamePermitted = false; nameableList.stopEditing(); FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Stored_Procedure_Name_Tips")); setIllegalIndex(editingIndex); + return; } + if (nameableList.getSelectedValue() instanceof ListModelElement) { - rename(selectedName, isRepeated ? NameInspector.ILLEGAL_NAME_HOLDER : tempName); + rename(selectedName, tempName); } } }); } + @Override + public String getEmptyNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"); + } + + @Override + public String getDuplicatedNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", getEditingName()); + } + + @Override + public Collection getExtraItemsToCheckNameRepeat() { + return DesignTableDataManager.getGlobalDataSet().keySet(); + } + @Override public void rename(String oldName, String newName) { //如果a改成了b,b又被改成了c,就认为是a改成了c 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 4ce851295d..5792af06d8 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 @@ -7,7 +7,6 @@ import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.design.ExtraDesignClassManager; import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.fun.ConnectionProvider; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; @@ -15,21 +14,18 @@ import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.i18n.Toolkit; import com.fr.event.EventDispatcher; import com.fr.file.ConnectionConfig; -import com.fr.general.ComparatorUtils; +import com.fr.file.ConnectionOperator; import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; - import com.fr.third.org.apache.commons.collections4.MapUtils; import com.fr.workspace.WorkContext; -import com.fr.file.ConnectionOperator; + import java.awt.Window; -import javax.swing.*; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -48,32 +44,24 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { isNamePermitted = true; - String[] allListNames = nameableList.getAllNames(); - allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; - String tempName = getEditingName(); - if (StringUtils.isEmpty(tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name")); - setIllegalIndex(editingIndex); + if (!checkName()) { isNamePermitted = false; return; } - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(allListNames)}, tempName)) { - isNamePermitted = false; - nameableList.stopEditing(); - String message = Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", tempName); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message); - setIllegalIndex(editingIndex); - } - if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) { - rename(selectedName, tempName); - } - + rename(selectedName, getEditingName()); } }); } + @Override + public String getEmptyNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name"); + } + + @Override + public String getDuplicatedNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", getEditingName()); + } protected void rename(String oldName, String newName) { //如果a改成了b,b又被改成了c,就认为是a改成了c diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 8401ffad5c..ee05422caa 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -1,7 +1,5 @@ package com.fr.design.gui.controlpane; -import com.fr.base.Parameter; -import com.fr.base.ParameterConfig; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.icontainer.UIScrollPane; @@ -28,14 +26,14 @@ import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.util.Arrays; -import java.util.Collection; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import static javax.swing.JOptionPane.WARNING_MESSAGE; @@ -433,28 +431,47 @@ public abstract class JListControlPane extends JControlPane implements ListContr } - public void showTipWithIllegalName(String tip) { - Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); - String[] allListNames = nameableList.getAllNames(); - allListNames[editingIndex] = StringUtils.EMPTY; + public boolean checkName() { String tempName = getEditingName(); + if (ComparatorUtils.equals(tempName, selectedName)) { + return false; + } + if (StringUtils.isEmpty(tempName)) { nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), - Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); + showWarningDialog(getEmptyNameTip()); setIllegalIndex(editingIndex); - return; + return false; } - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { + String[] allListNames = nameableList.getAllNames(); + allListNames[editingIndex] = StringUtils.EMPTY; + if (isNameRepeated(new Collection[]{getExtraItemsToCheckNameRepeat(), Arrays.asList(allListNames)}, tempName)) { nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), - tip, - Toolkit.i18nText("Fine-Design_Basic_Alert"), - WARNING_MESSAGE); + showWarningDialog(getDuplicatedNameTip()); setIllegalIndex(editingIndex); + return false; } + return true; + } + + public String getEmptyNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Not_Null_Des"); + } + + public String getDuplicatedNameTip() { + return StringUtils.EMPTY; + } + + public Collection getExtraItemsToCheckNameRepeat() { + return new ArrayList(); + } + + private void showWarningDialog(String tip) { + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), + tip, + Toolkit.i18nText("Fine-Design_Basic_Alert"), + WARNING_MESSAGE); } } diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index c5c7a12c9a..22211acff1 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -1,6 +1,7 @@ package com.fr.design.parameter; import com.fr.base.Parameter; +import com.fr.base.ParameterConfig; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableSelfCreator; @@ -10,6 +11,7 @@ import com.fr.stable.Nameable; import com.fr.stable.core.PropertyChangeAdapter; import java.util.Arrays; +import java.util.Collection; public class ParameterArrayPane extends JListControlPane { @@ -23,11 +25,25 @@ public class ParameterArrayPane extends JListControlPane { this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue()); this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { - showTipWithIllegalName(Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); + checkName(); } }); } + @Override + public String getEmptyNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name"); + } + + @Override + public String getDuplicatedNameTip() { + return Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name"); + } + + @Override + public Collection getExtraItemsToCheckNameRepeat() { + return Arrays.asList(ParameterConfig.getInstance().getGlobalParameters()); + } @Override protected String title4PopupWindow() { diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java index 9ec4a1caf7..c2d7be0e16 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java @@ -25,12 +25,17 @@ public class WidgetConfigPane extends JListControlPane { super(); this.addEditingListener(new PropertyChangeAdapter() { public void propertyChange() { - showTipWithIllegalName(Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure")); + checkName(); } }); } - /** + @Override + public String getDuplicatedNameTip() { + return Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"); + } + + /** * 创建用户自定义widget组件 * * @return 组件面板 From 13e54b514ebd25548e19dd8280592d704cde4c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 29 Oct 2021 16:05:10 +0800 Subject: [PATCH 14/45] =?UTF-8?q?REPORT-58584=20FR11-=E4=BA=8C=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92-=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=A0=8F-=E6=9C=8D=E5=8A=A1=E5=99=A8-=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86-=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E9=87=8D=E5=90=8D=E6=97=B6=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/widget/WidgetConfigPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java index c2d7be0e16..bc6764b91f 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java @@ -32,7 +32,7 @@ public class WidgetConfigPane extends JListControlPane { @Override public String getDuplicatedNameTip() { - return Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"); + return Toolkit.i18nText("Fine_Design_Predefine_Widget_Name_Duplicated"); } /** From a2f3e8bc4a9fcfda7493cecba75ec82a78e0a141 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 1 Nov 2021 10:53:13 +0800 Subject: [PATCH 15/45] =?UTF-8?q?REPORT-61846=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E8=B6=8A=E6=9D=83=E6=BC=8F=E6=B4=9E=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index c342cc3910..4ea26c2d63 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -12,6 +12,7 @@ import com.fr.base.theme.ThemedTemplate; import com.fr.base.vcs.DesignerMode; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; +import com.fr.decision.config.FSConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; @@ -1486,16 +1487,16 @@ public abstract class JTemplate> * 设置新引擎后,有不支持的功能时,设计器中模板的标题需要加上“兼容模式”或者“不支持分页引擎”来提示用户 * */ private String compatibilityTip() { - if (!CptAndCptxCompatibilityUtil.isEngineXEnable(this.getTarget(), getEditingFILE().getPath())){ + if (!CptAndCptxCompatibilityUtil.isEngineXEnable(this.getTarget(), getEditingFILE().getPath())) { return StringUtils.EMPTY; } String path = this.getEditingFILE().getPath(); CptxMetadata metadata = CptxFileUtils.getMetadata(path); //是否是兼容模式,兼容模式下,设置了新引擎的cpt和cptx的后缀不同 if (metadata != null && metadata.isForceCpt()) { - if (path.endsWith(".cptx")){ + if (path.endsWith(".cptx")) { return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Compatibility_Mode"); - } else if (path.endsWith(".cpt")){ + } else if (path.endsWith(".cpt")) { return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Paging_Engine_Not_Work"); } } @@ -1592,8 +1593,7 @@ public abstract class JTemplate> } private boolean saveRealFile() throws Exception { - JTemplateAuthorityChecker jTemplateAuthorityChecker = new JTemplateAuthorityChecker(this); - if (jTemplateAuthorityChecker.isAuthority()) { + if (checkJTemplateAuthority()) { FILE editingFILE = this.getEditingFILE(); if (editingFILE == null || editingFILE instanceof MemFILE) { return false; @@ -1601,6 +1601,18 @@ public abstract class JTemplate> export(); this.editingFILE = editingFILE; return true; + } else { + return false; + } + } + + private boolean checkJTemplateAuthority() { + if (!FSConfig.getInstance().getAuthorizeAttr().isDataConnectionAuthority()) { + return true; + } + JTemplateAuthorityChecker jTemplateAuthorityChecker = new JTemplateAuthorityChecker(this); + if (jTemplateAuthorityChecker.isAuthority()) { + return true; } else { jTemplateAuthorityChecker.showAuthorityFailPromptDialog(); return false; @@ -1641,7 +1653,7 @@ public abstract class JTemplate> @Override public void run() { boolean isChangedFile = !JTemplate.this.saved; - if (isChangedFile){ + if (isChangedFile) { CptCompileUtil.compile(JTemplate.this); } callBackForSave(); @@ -1708,7 +1720,7 @@ public abstract class JTemplate> * 2.在这三种情况下:1.cptx文件另存为cpt文件 2.cptx另存为cptx文件 3.设置了新引擎的cpt文件另存为cpt文件, * 因为文件的编译目录改变了,需要重新预编译,因此设置jTemplate的保存状态为false * */ - if (CptAndCptxCompatibilityUtil.needRecompile(oldName, this)){ + if (CptAndCptxCompatibilityUtil.needRecompile(oldName, this)) { this.saved = false; } result = this.saveRealFile(); From 26538246838569335588524e45cd805dec939223 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 2 Nov 2021 19:22:54 +0800 Subject: [PATCH 16/45] =?UTF-8?q?REPORT-61606=20pc=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E5=B1=9E=E6=80=A7=E4=B8=AD=E2=80=9C=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E2=80=9D=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/report/fit/AdaptiveFrmFitAttrModel.java | 2 +- .../src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/report/fit/AdaptiveFrmFitAttrModel.java b/designer-base/src/main/java/com/fr/design/report/fit/AdaptiveFrmFitAttrModel.java index 2196b1d403..9e60c6cc84 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/AdaptiveFrmFitAttrModel.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/AdaptiveFrmFitAttrModel.java @@ -26,7 +26,7 @@ public class AdaptiveFrmFitAttrModel extends AbstractFitAttrModelProvider { @Override public String getModelName() { - return Toolkit.i18nText("Fine-Design_New_Decision_Report"); + return Toolkit.i18nText("Fine-Design_Basic_Decision_Report"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java b/designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java index 258dfbf49c..c4bdaf6de2 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java @@ -12,7 +12,7 @@ public class FrmFitAttrModel implements FitAttrModel { @Override public String getModelName() { - return Toolkit.i18nText("Fine-Design_Basic_Decision_Report"); + return Toolkit.i18nText("Fine-Design_Old_Decision_Report"); } @Override From 0eebd17018f9f2f69ee500f5288cba9ca2860558 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 2 Nov 2021 09:38:33 +0800 Subject: [PATCH 17/45] =?UTF-8?q?REPORT-61900=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E3=80=91=E4=B8=BB=E9=A2=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=8F=B3=E4=B8=8B=E8=A7=92?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=94=B9=E6=88=90=E5=85=B3=E9=97=AD=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E4=B8=8D=E6=98=AF=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 修改国际化文本 【改动思路】 同上 --- .../design/mainframe/theme/TemplateThemeGridPagesPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java index bfef5179a8..36e962c6af 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java @@ -139,7 +139,7 @@ public class TemplateThemeGridPagesPane extends JPanel { public UIButton[] createRightButtons() { UIButton[] buttons = new UIButton[] {}; buttons = ArrayUtils.addAll(buttons, createExtraButtons()); - buttons = ArrayUtils.addAll(buttons, createCompleteButton()); + buttons = ArrayUtils.addAll(buttons, createCloseButton()); return buttons; } @@ -180,8 +180,8 @@ public class TemplateThemeGridPagesPane extends JPanel { return uiButtonList.toArray(new UIButton[]{}); } - private UIButton createCompleteButton() { - UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Complete")); + private UIButton createCloseButton() { + UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Close")); button.setName(COMPLETE_BUTTON); button.addActionListener(new ActionListener() { @Override From 3a444419d16a0e618c420aba42b5c1e0e2f0e56d Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 3 Nov 2021 15:57:10 +0800 Subject: [PATCH 18/45] =?UTF-8?q?CHART-21570=20=E5=A4=A7=E5=B1=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E9=80=82=E9=85=8D11.0=20=E5=9B=BE=E8=A1=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=B2=A1=E6=9C=89=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icombobox/ColorSchemeComboBox.java | 42 ++++++++++--------- .../chart/mode/ChartEditContext.java | 9 ++++ .../mainframe/chart/mode/ChartEditMode.java | 0 .../style/ColorSelectBoxWithThemeStyle.java | 20 ++++----- .../component/VanChartLabelContentPane.java | 5 ++- .../style/VanChartPlotLegendPane.java | 3 +- .../designer/style/VanChartTitlePane.java | 6 ++- .../style/axis/VanChartBaseAxisPane.java | 14 ++++++- .../gauge/VanChartGaugeDetailAxisPane.java | 3 +- .../VanChartAreaBackgroundPane.java | 3 +- .../datasheet/VanChartDataSheetPane.java | 5 ++- .../VanChartScatterLabelContentPane.java | 4 +- 12 files changed, 72 insertions(+), 42 deletions(-) rename {designer-chart => designer-base}/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java (73%) rename {designer-chart => designer-base}/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java (100%) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java index f8816a1844..e6ea1e2e7b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java @@ -8,17 +8,12 @@ import com.fr.cert.token.lang.Collections; import com.fr.chart.base.ChartConstants; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.GeneralUtils; import javax.swing.DefaultComboBoxModel; import javax.swing.JLabel; import javax.swing.JList; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; @@ -27,6 +22,12 @@ import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.LinearGradientPaint; import java.awt.geom.Rectangle2D; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author Bjorn @@ -69,21 +70,22 @@ public class ColorSchemeComboBox extends UIComboBox { Iterator names = config.names(); if (preDefined) { - ColorInfo colorInfo = new ColorInfo(); - List list = new ArrayList<>(); - colorInfo.setColors(list); - TemplateTheme templateTheme = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme(); - ThemedChartSeriesColor themedChartSeriesColor = templateTheme.getChartStyle().getThemedChartSeriesColor(); - if (themedChartSeriesColor.isCombineColor()) { - colorInfo.setGradient(false); - list.addAll(templateTheme.getColorScheme().getColors()); - } else { - colorInfo.setGradient(true); - list.add(themedChartSeriesColor.getBeginColor()); - list.add(themedChartSeriesColor.getEndColor()); + if (ChartEditContext.supportTheme()) { + ColorInfo colorInfo = new ColorInfo(); + List list = new ArrayList<>(); + colorInfo.setColors(list); + TemplateTheme templateTheme = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme(); + ThemedChartSeriesColor themedChartSeriesColor = templateTheme.getChartStyle().getThemedChartSeriesColor(); + if (themedChartSeriesColor.isCombineColor()) { + colorInfo.setGradient(false); + list.addAll(templateTheme.getColorScheme().getColors()); + } else { + colorInfo.setGradient(true); + list.add(themedChartSeriesColor.getBeginColor()); + list.add(themedChartSeriesColor.getEndColor()); + } + colorSchemes.put(Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"), colorInfo); } - colorSchemes.put(Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"), colorInfo); - } else { //添加默认的方案和第一个方案 String defaultName = config.getCurrentStyle(); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java similarity index 73% rename from designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java rename to designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java index 23616a482a..56345aeda9 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java @@ -23,4 +23,13 @@ public class ChartEditContext { public static boolean normalMode() { return current == ChartEditMode.NORMAL; } + + /** + * 是否支持 主题样式 设置 + * + * @return duchamp大屏模板模式 不支持 + */ + public static boolean supportTheme() { + return !duchampMode(); + } } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java similarity index 100% rename from designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java rename to designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java index bee92e04c4..db59476792 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java @@ -5,7 +5,7 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.style.color.ColorSelectBox; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -39,18 +39,16 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane { } private void initContent() { - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color"), SwingConstants.LEFT); - Component[][] components = { + Component[][] components = ChartEditContext.supportTheme() ? new Component[][]{ new Component[]{text, preButton}, new Component[]{null, colorSelectBox}, + } : new Component[][]{ + new Component[]{text, colorSelectBox} }; - JPanel gapTableLayoutPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + + JPanel gapTableLayoutPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components); this.setLayout(new BorderLayout()); this.add(gapTableLayoutPane, BorderLayout.CENTER); } @@ -66,7 +64,7 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane { private void checkPreButton() { colorSelectBox.setVisible(preButton.getSelectedIndex() == CUSTOM); - this.setPreferredSize(preButton.getSelectedIndex() == CUSTOM ? new Dimension(0, 55) : new Dimension(0, 23)); + this.setPreferredSize(ChartEditContext.supportTheme() && preButton.getSelectedIndex() == CUSTOM ? new Dimension(0, 55) : new Dimension(0, 23)); } public String title4PopupWindow() { @@ -74,14 +72,14 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane { } public void populate(ColorWithThemeStyle colorWithPreStyle) { - preButton.setSelectedIndex(colorWithPreStyle.isThemed() ? PREDEFINED_STYLE : CUSTOM); + preButton.setSelectedIndex(ChartEditContext.supportTheme() && colorWithPreStyle.isThemed() ? PREDEFINED_STYLE : CUSTOM); colorSelectBox.setSelectObject(colorWithPreStyle.getColor()); checkPreButton(); } public ColorWithThemeStyle update() { ColorWithThemeStyle colorWithPreStyle = new ColorWithThemeStyle(); - colorWithPreStyle.setThemed(preButton.getSelectedIndex() == PREDEFINED_STYLE); + colorWithPreStyle.setThemed(ChartEditContext.supportTheme() && preButton.getSelectedIndex() == PREDEFINED_STYLE); colorWithPreStyle.setColor(colorSelectBox.getSelectObject()); return colorWithPreStyle; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java index 8133771f94..06c0640819 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.component; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.type.TextAlign; import com.fr.van.chart.designer.style.VanChartStylePane; @@ -25,7 +26,7 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { } public JPanel createCommonStylePane() { - if (isInCondition()) { + if (isInCondition() || !ChartEditContext.supportTheme()) { return super.createCommonStylePane(); } setTextAttrPane(new ChartTextAttrPaneWithThemeStyle()); @@ -37,7 +38,7 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { } public void updateTextAttr(AttrTooltipContent attrTooltipContent) { - if (isInCondition()) { + if (isInCondition() || !ChartEditContext.supportTheme()) { super.updateTextAttr(attrTooltipContent); return; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java index f51d1d689a..3543edb5c9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java @@ -16,6 +16,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.type.LayoutType; @@ -288,7 +289,7 @@ public class VanChartPlotLegendPane extends BasicPane { } private JPanel createTitleStylePane() { - textAttrPane = new ChartTextAttrPaneWithThemeStyle(); + textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index fd5e37890b..87d6fbfda7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -17,8 +17,10 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartTitle; import com.fr.plugin.chart.vanchart.VanChart; @@ -57,7 +59,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { private JPanel titlePane; private TinyFormulaPane titleContent; - private ChartTextAttrPaneWithThemeStyle textAttrPane; + private ChartTextAttrPane textAttrPane; private UIButtonGroup alignmentPane; private VanChartBackgroundWithOutShadowWithRadiusPane backgroundPane; private UIToggleButton useHtml; @@ -188,7 +190,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { } private JPanel createTitleStylePane() { - textAttrPane = new ChartTextAttrPaneWithThemeStyle(); + textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index f945a19699..aff9d64c30 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -22,6 +22,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithThemeStyle; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -380,10 +381,21 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected ChartTextAttrPane getChartTextAttrPane() { - return new ChartTextAttrPaneWithThemeStyle() { + return ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() { protected double getEdithAreaWidth() { return TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; } + } : new ChartTextAttrPane() { + @Override + protected JPanel getContentPane(JPanel buttonPane) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); + } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java index 18fadeb985..91de3ed359 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java @@ -9,6 +9,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.style.color.ColorSelectBox; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis; @@ -103,7 +104,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { if (isMulti(gaugeStyle)) { return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR); } else { - return new ChartTextAttrPaneWithThemeStyle(); + return ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java index 6f65af6e15..e6eb8c6131 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java @@ -8,6 +8,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundPane; @@ -49,7 +50,7 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane { } protected VanChartBorderPane createBorderPanePane() { - return new VanChartBorderPaneWithPreStyle(); + return ChartEditContext.supportTheme() ? new VanChartBorderPaneWithPreStyle() : new VanChartBorderPane(); } protected ChartTextAttrPane createChartTextAttrPane() { - return new ChartTextAttrPaneWithThemeStyle(); + return ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane(); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java index 364b3d1feb..85bbc3c5a2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java @@ -1,6 +1,8 @@ package com.fr.van.chart.scatter; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel; @@ -28,7 +30,7 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont if (isInCondition()) { return super.createCommonStylePane(); } - setTextAttrPane(new ChartTextAttrPaneWithThemeStyle()); + setTextAttrPane(ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane()); JPanel stylePanel = new JPanel(new BorderLayout()); stylePanel.add(getTextAttrPane(), BorderLayout.CENTER); From 08cb30cc2e950f5241850378330faa4a4f30e54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 3 Nov 2021 15:58:13 +0800 Subject: [PATCH 19/45] =?UTF-8?q?REPORT-57521=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=97=B6websocket=E6=96=AD=E5=BC=80=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 56 ++++++++++++++++++- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index a6edb04083..197265cccc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -3,11 +3,14 @@ package com.fr.design.mainframe.socketio; import com.fr.config.RemoteConfigEvent; import com.fr.decision.webservice.utils.DecisionServiceConstants; import com.fr.design.DesignerEnvManager; +import com.fr.design.EnvChangeEntrance; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfoContext; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.loghandler.DesignerLogger; import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.mainframe.toast.DesignerToastMsgUtil; @@ -21,10 +24,16 @@ import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; +import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; +import com.fr.third.org.apache.http.client.config.RequestConfig; +import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; +import com.fr.third.org.apache.http.client.methods.HttpGet; import com.fr.third.org.apache.http.conn.ssl.NoopHostnameVerifier; import com.fr.third.org.apache.http.conn.ssl.TrustSelfSignedStrategy; +import com.fr.third.org.apache.http.impl.client.CloseableHttpClient; +import com.fr.third.org.apache.http.impl.client.HttpClients; import com.fr.third.org.apache.http.ssl.SSLContexts; import com.fr.web.WebSocketConfig; import com.fr.web.socketio.WebSocketProtocol; @@ -39,7 +48,9 @@ import io.socket.emitter.Emitter; import javax.net.ssl.SSLContext; import javax.swing.BorderFactory; +import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.UIManager; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; @@ -195,11 +206,12 @@ public class DesignerSocketIO { private static final Emitter.Listener failRetry = new Emitter.Listener() { @Override public void call(Object... args) { - showConnectionLostDialog(); + showSocketDisconnectToast(); printLog(args, PrintEventLogImpl.WARN, "failed args: {}"); status = Status.Disconnecting; socket.close(); count++; + System.out.println("失败重连第" + count + "次"); createSocket(); } }; @@ -245,7 +257,7 @@ public class DesignerSocketIO { */ printLog(objects, PrintEventLogImpl.ERROR, "disConnected args: {}"); if (status != Status.Disconnecting) { - showConnectionLostDialog(); + dealWithSocketDisconnect(); } status = Status.Disconnected; } finally { @@ -257,7 +269,15 @@ public class DesignerSocketIO { } }; - private static void showConnectionLostDialog() { + private static void dealWithSocketDisconnect() { + if (checkRPCConnect()) { + showSocketDisconnectToast(); + } else { + showRPCDisconnectDialog(); + } + } + + private static void showSocketDisconnectToast() { try { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override @@ -293,6 +313,36 @@ public class DesignerSocketIO { return jPanel; } + private static void showRPCDisconnectDialog() { + FineJOptionPane.showMessageDialog( + DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), + UIManager.getString("OptionPane.messageDialogTitle"), + JOptionPane.ERROR_MESSAGE, + UIManager.getIcon("OptionPane.errorIcon")); + EnvChangeEntrance.getInstance().chooseEnv(); + } + + private static boolean checkRPCConnect() { + CloseableHttpClient httpclient = HttpClients.createDefault(); + WorkspaceConnectionInfo info = getConnectionInfo(); + HttpGet httpGet = new HttpGet(StableUtils.pathJoin(info.getUrl(), WorkspaceConstants.CONTROLLER_PREFIX, WorkspaceConstants.VT)); + RequestConfig requestConfig = RequestConfig + .custom() + .setConnectTimeout(5000) + .setConnectionRequestTimeout(5000) + .setSocketTimeout(5000) + .build(); + httpGet.setConfig(requestConfig); + try { + CloseableHttpResponse response = httpclient.execute(httpGet); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + return false; + } + return true; + } + //配置变更监听器 private static final Emitter.Listener modifyConfig = new Emitter.Listener() { @Override From f2110f83ca6296d7b76354e48a1eb11dfef96984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 3 Nov 2021 16:01:20 +0800 Subject: [PATCH 20/45] REPORT-57521 --- .../java/com/fr/design/mainframe/socketio/DesignerSocketIO.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 197265cccc..e87adf5c29 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -211,7 +211,6 @@ public class DesignerSocketIO { status = Status.Disconnecting; socket.close(); count++; - System.out.println("失败重连第" + count + "次"); createSocket(); } }; From 3e2795fc1b95bd63360d4a7300618f73751c40e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 3 Nov 2021 16:03:23 +0800 Subject: [PATCH 21/45] =?UTF-8?q?REPORT-57521=20=E5=8E=BB=E6=8E=89websocke?= =?UTF-8?q?t=E6=96=AD=E5=BC=80=E6=8F=90=E7=A4=BA=E5=BB=B6=E8=BF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e87adf5c29..c34758b923 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -63,7 +63,6 @@ import java.net.URL; import java.security.KeyStore; import java.util.Arrays; import java.util.Timer; -import java.util.TimerTask; public class DesignerSocketIO { @@ -245,26 +244,20 @@ public class DesignerSocketIO { @Override public void call(Object... objects) { FineLoggerFactory.getLogger().info("start disConnectHintTimer"); - disConnectHintTimer = new Timer(); - disConnectHintTimer.schedule(new TimerTask() { - @Override - public void run() { - try { - /* - * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, - * socket 只用推日志和通知配置变更 - */ - printLog(objects, PrintEventLogImpl.ERROR, "disConnected args: {}"); - if (status != Status.Disconnecting) { - dealWithSocketDisconnect(); - } - status = Status.Disconnected; - } finally { - disConnectHintTimer.cancel(); - disConnectHintTimer = null; - } + try { + /* + * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, + * socket 只用推日志和通知配置变更 + */ + printLog(objects, PrintEventLogImpl.ERROR, "disConnected args: {}"); + if (status != Status.Disconnecting) { + dealWithSocketDisconnect(); } - }, disConnectHintTimerDelay); + status = Status.Disconnected; + } finally { + disConnectHintTimer.cancel(); + disConnectHintTimer = null; + } } }; From e30fe7238111fc7ebf4bad28584a4082c739829e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 3 Nov 2021 16:04:24 +0800 Subject: [PATCH 22/45] REPORT-57521 --- .../mainframe/socketio/DesignerSocketIO.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index c34758b923..e85358894b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -244,20 +244,15 @@ public class DesignerSocketIO { @Override public void call(Object... objects) { FineLoggerFactory.getLogger().info("start disConnectHintTimer"); - try { - /* - * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, - * socket 只用推日志和通知配置变更 - */ - printLog(objects, PrintEventLogImpl.ERROR, "disConnected args: {}"); - if (status != Status.Disconnecting) { - dealWithSocketDisconnect(); - } - status = Status.Disconnected; - } finally { - disConnectHintTimer.cancel(); - disConnectHintTimer = null; + /* + * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, + * socket 只用推日志和通知配置变更 + */ + printLog(objects, PrintEventLogImpl.ERROR, "disConnected args: {}"); + if (status != Status.Disconnecting) { + dealWithSocketDisconnect(); } + status = Status.Disconnected; } }; From 08146bcc02163b8c1f0f087eb660568821c3e735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 3 Nov 2021 16:06:13 +0800 Subject: [PATCH 23/45] REPORT-57521 --- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e85358894b..61b5c54c38 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -79,6 +79,7 @@ public class DesignerSocketIO { private static Status status = Status.Disconnected; private static Timer disConnectHintTimer = null; private static long disConnectHintTimerDelay = 3000; + private static final int TIMEOUT = 5000; //维护一个当前工作环境的uri列表 private static String[] uri; //维护一个关于uri列表的计数器 @@ -316,9 +317,8 @@ public class DesignerSocketIO { HttpGet httpGet = new HttpGet(StableUtils.pathJoin(info.getUrl(), WorkspaceConstants.CONTROLLER_PREFIX, WorkspaceConstants.VT)); RequestConfig requestConfig = RequestConfig .custom() - .setConnectTimeout(5000) - .setConnectionRequestTimeout(5000) - .setSocketTimeout(5000) + .setConnectTimeout(TIMEOUT) + .setConnectionRequestTimeout(TIMEOUT) .build(); httpGet.setConfig(requestConfig); try { From 1f78cadeeba88faa4aac5f6f94bf5d3d2f3e42f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 3 Nov 2021 16:57:05 +0800 Subject: [PATCH 24/45] =?UTF-8?q?REPORT-57521=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E7=9A=84=E4=BB=A3=E7=A0=81=E6=94=BE=E5=88=B0?= =?UTF-8?q?edt=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 61b5c54c38..5916b4f32f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -302,13 +302,18 @@ public class DesignerSocketIO { } private static void showRPCDisconnectDialog() { - FineJOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - UIManager.getString("OptionPane.messageDialogTitle"), - JOptionPane.ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); - EnvChangeEntrance.getInstance().chooseEnv(); + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + FineJOptionPane.showMessageDialog( + DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), + UIManager.getString("OptionPane.messageDialogTitle"), + JOptionPane.ERROR_MESSAGE, + UIManager.getIcon("OptionPane.errorIcon")); + EnvChangeEntrance.getInstance().chooseEnv(); + } + }); } private static boolean checkRPCConnect() { From aae1f0cfb141f8ee446d8ba7f26e0777af19c1ff Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Thu, 4 Nov 2021 15:16:59 +0800 Subject: [PATCH 25/45] =?UTF-8?q?REPORT-61708=20FR11=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6=E6=9B=B4=E6=96=B0=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/util/InstallComponentHelper.java | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java index b66c2458c7..7644fbdfe9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java @@ -19,9 +19,10 @@ import java.io.InputStream; * @Date: 2020/12/4 */ public class InstallComponentHelper { - private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components"; - private static final String[] PRE_INSTALL_COMPONENTS = new String[]{ + private static String sharePath = ComponentPath.SHARE_PATH.path(); + + private static final String[] OLD_PRE_INSTALL_COMPONENTS = new String[]{ "单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu", "分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu", "红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu", @@ -29,12 +30,24 @@ public class InstallComponentHelper { "三列指标卡.61a83d18-a162-4dc3-aa57-3b954edaf82e.reu", "透明按钮切换图表.e373e13a-3da0-4c29-91bc-9ae804241023.reu" }; + private static final String[] PRE_INSTALL_COMPONENTS = new String[]{ + "三色指标卡-酷炫蓝.d96f451f-c74c-45df-b056-0906b42870c7.reu", + "刻度槽型仪表盘-酷炫蓝.982ba9a3-f38b-48df-a7ae-80fcce0d74d1.reu", + "大屏标题-酷炫蓝.35f08184-2339-4a7d-9a6a-ea5bacc6829a.reu", + "柱形折线组合图-酷炫蓝.b7d66ba1-2a51-4640-a50e-2869694b748a.reu", + "渐变柱形图-酷炫蓝.786a4e7a-22d5-4f55-a857-42e3ddd54b70.reu", + "环形饼图-酷炫蓝.c9258ee9-7dee-4f56-aa2e-31b9fd7de818.reu" + }; public static void installPreComponent() { - if (needPreInstallComponent()) { + String[] components = WorkContext.getWorkResource().list(sharePath, new ReuFilter()); + String[] dirs = WorkContext.getWorkResource().list(sharePath, new DirFilter()); + if (needPreInstallComponent(components, dirs)) { + installShareComponents(PRE_INSTALL_PATH, PRE_INSTALL_COMPONENTS); + } else if (needReplaceOldComponent(components, dirs)) { + clearOldComponent(OLD_PRE_INSTALL_COMPONENTS); installShareComponents(PRE_INSTALL_PATH, PRE_INSTALL_COMPONENTS); } - } public static void installShareComponents(String resourcePath, String[] components) { @@ -42,18 +55,36 @@ public class InstallComponentHelper { try { InputStream inputStream = InstallComponentHelper.class.getResourceAsStream(StableUtils.pathJoin(resourcePath, componentPath)); byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream); - WorkContext.getWorkResource().write(StableUtils.pathJoin(ComponentPath.SHARE_PATH.path(), componentPath), data); + WorkContext.getWorkResource().write(StableUtils.pathJoin(sharePath, componentPath), data); } catch (Exception e) { FineLoggerFactory.getLogger().error("install Component filed" + e.getMessage(), e); } } } - private static boolean needPreInstallComponent() { + private static boolean needReplaceOldComponent(String[] components, String[] dirs) { + if ((dirs != null && ArrayUtils.isNotEmpty(dirs)) || (components != null && components.length != 6)) { + return false; + } + for (String componentPath : components) { + if (!ArrayUtils.contains(OLD_PRE_INSTALL_COMPONENTS, componentPath)) { + return false; + } + } + return true; + } + + private static void clearOldComponent(String[] components) { + for(String componentPath : components) { + WorkContext.getWorkResource().delete(StableUtils.pathJoin(sharePath, componentPath)); + } + } + + private static boolean needPreInstallComponent(String[] components, String[] dirs) { try { //老用户或者组件库里已有组件,不预装组件 SnapChat snapChat = SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT); - return !snapChat.hasRead() && !hasComponentInstalled(); + return !snapChat.hasRead() && !hasComponentInstalled(components, dirs); } catch (Throwable e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -63,10 +94,7 @@ public class InstallComponentHelper { /** * 判断是否已有组件被安装 */ - private static boolean hasComponentInstalled() { - String sharePath = ComponentPath.SHARE_PATH.path(); - String[] components = WorkContext.getWorkResource().list(sharePath, new ReuFilter()); - String[] dirs = WorkContext.getWorkResource().list(sharePath, new DirFilter()); + private static boolean hasComponentInstalled(String[] components, String[] dirs) { return components != null && ArrayUtils.isNotEmpty(components) || (dirs != null && ArrayUtils.isNotEmpty(dirs)); } From 73a5ccf767cfdc9f1d78ec0d283a9f2b176b3766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 4 Nov 2021 16:30:40 +0800 Subject: [PATCH 26/45] =?UTF-8?q?REPORT-59744=20=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=E6=89=8B=E5=8A=A8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E4=BB=A5=E5=90=8E=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E5=A4=84=E4=BD=8D=E7=BD=AE=E5=81=8F=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/poly/group/PolyBoundsGroup.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/poly/group/PolyBoundsGroup.java b/designer-realize/src/main/java/com/fr/poly/group/PolyBoundsGroup.java index aadeb01785..599a14f44e 100644 --- a/designer-realize/src/main/java/com/fr/poly/group/PolyBoundsGroup.java +++ b/designer-realize/src/main/java/com/fr/poly/group/PolyBoundsGroup.java @@ -52,7 +52,7 @@ public class PolyBoundsGroup implements GroupModel { @Override public Object getValue(int row, int column) { UnitRectangle ur = block.getBounds(); - Rectangle r = ur.toRectangle(resolution); + Rectangle r = ur.toRoundRectangle(resolution); if (column == 0) { switch (row) { case 0: @@ -83,7 +83,7 @@ public class PolyBoundsGroup implements GroupModel { if (column == 1) { int v = value == null ? 0 : ((Number) value).intValue(); UnitRectangle ur = block.getBounds(); - Rectangle r = ur.toRectangle(resolution); + Rectangle r = ur.toRoundRectangle(resolution); switch (row) { case 0: r.x = v; From c30b210e38afa552c1d1efae0c120960607a82dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 4 Nov 2021 20:23:30 +0800 Subject: [PATCH 27/45] =?UTF-8?q?REPORT-61618=20=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=94=9F=E6=88=90=E6=97=B6=E5=B8=A6=E2=80=9C?= =?UTF-8?q?-=E2=80=9D=EF=BC=8C=E5=AF=BC=E8=87=B4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=85=AC=E5=BC=8F=E5=A4=B1=E6=95=88@Jaimme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/data/BasicTableDataUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java index 57c7e23a13..c711a1999d 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java @@ -11,7 +11,7 @@ import com.fr.stable.StringUtils; * Created by hades on 2020/4/27 */ public abstract class BasicTableDataUtils { - private static final String SEPARATOR = "-"; + private static final String SEPARATOR = "_"; private static final int LEN = 2; From 452531bd0c0c66565a82b377745669cf2c1a125d Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Fri, 5 Nov 2021 11:42:43 +0800 Subject: [PATCH 28/45] =?UTF-8?q?REPORT-58836=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=AF=BC=E5=87=BA=E4=BA=8C=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascript/ExportJavaScriptPane.java | 950 ++++++++++++++---- 1 file changed, 758 insertions(+), 192 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index 460e838c51..6c2e46e985 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -3,6 +3,7 @@ package com.fr.design.javascript; import com.fr.base.BaseFormula; import com.fr.base.Parameter; import com.fr.base.extension.FileExtension; +import com.fr.design.border.UITitledBorder; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; @@ -15,6 +16,10 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itableeditorpane.ParameterTableModel; +import com.fr.design.gui.itableeditorpane.UITableEditAction; +import com.fr.design.gui.itableeditorpane.UITableEditorPane; +import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.hyperlink.AbstractHyperLinkPane; @@ -23,32 +28,40 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.scrollruler.ModLineBorder; import com.fr.file.filetree.IOFileNodeFilter; import com.fr.general.GeneralUtils; import com.fr.js.ExportJavaScript; +import com.fr.js.SingleJavaScript; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import javax.swing.AbstractButton; +import javax.swing.AbstractCellEditor; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.DefaultComboBoxModel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.JTable; import javax.swing.SwingUtilities; +import javax.swing.event.CellEditorListener; +import javax.swing.event.ChangeEvent; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -59,21 +72,20 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane EXPORT_TYPES_MAP = new HashMap<>(); - private static final String CURRENT_TEMPLATE = "current"; - private static final String DEFAULT_FILENAME = "default"; - + private static final Map FILENAME_TYPE_MAP = new HashMap<>(); + private static final Map PARAMETER_TYPE_MAP = new HashMap<>(); + private static final String DEFAULT = "default"; + private static final String CUSTOM = "custom"; + private static final String CURRENT_TEMPLATE = "cur"; + private static final String OTHER_TEMPLATE = "other"; + private static final UILabel EMPTY_LABEL = new UILabel(); static { EXPORT_TYPES_MAP.put(ExportJavaScript.EXPORT_PDF, Toolkit.i18nText("Fine-Design_Basic_Export_JS_PDF")); @@ -82,135 +94,703 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane" + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Title_Tip_Front") + "\\/:*?\"<>|" + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Title_Tip_Back") + ""); + fileNameTipLabel.setVisible(false); + fileNameRadioGroup.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (defaultNameRadio.isSelected()) { + fileNameFormulaEditor.setVisible(false); + fileNameFormulaEditor.setEnabled(false); + fileNameTipLabel.setVisible(false); + } else { + fileNameFormulaEditor.setVisible(true); + fileNameFormulaEditor.setEnabled(true); + fileNameTipLabel.setVisible(true); + } + } + }); + Component[][] components = new Component[][]{{nameLabel, defaultNameRadio, customNameRadio, fileNameFormulaEditor}}; + JPanel fileNameRadioPane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{p, p, p, p}); + + JPanel fileNameTipPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + fileNameTipPane.add(fileNameTipLabel); + + JPanel fileNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + fileNamePane.add(fileNameRadioPane, BorderLayout.NORTH); + fileNamePane.add(fileNameTipPane, BorderLayout.CENTER); + fileNameTipPane.setBorder(BorderFactory.createEmptyBorder(5, 2, 5, 2)); + fileNamePane.setBorder(BorderFactory.createEmptyBorder(5, 2, 5, 2)); + return fileNamePane; + } + public void updateSingleJavaScript(SingleJavaScript js){ + js.setTemplatePath(DEFAULT); + js.setExportType(GeneralUtils.objectToString(exportTypeComboBox.getSelectedItem())); + js.setDefaultFileName(defaultNameRadio.isSelected()); + js.setFileName(getFileName()); + js.setExtendParameters(extendParametersCheckBox.isSelected()); + if (extendParametersCheckBox.isSelected()) { + js.setParameters(null); + } else { + if (parameterViewPane != null) { + List parameterList = parameterViewPane.update(); + if (!parameterList.isEmpty()) { + Parameter[] parameters = new Parameter[parameterList.size()]; + parameterList.toArray(parameters); + js.setParameters(parameters); + } + } + } + } + public void populateSingleJavaScript(SingleJavaScript js){ + exportTypeComboBox.setSelectedItem(js.getExportType()); + fileNameRadioGroup.selectIndexButton(js.isDefaultFileName() ? 0 : 1); + if (!js.isDefaultFileName()) { + fileNameFormulaEditor.setEnabled(true); + fileNameFormulaEditor.setVisible(true); + fileNameTipLabel.setVisible(true); + fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build(js.getFileName())); + } else { + fileNameFormulaEditor.setVisible(false); + fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build()); + } + if (js.isExtendParameters()) { + extendParametersCheckBox.setSelected(true); + } else { + extendParametersCheckBox.setSelected(false); + if (this.parameterViewPane != null) { + List parameterList = this.parameterViewPane.update(); + parameterList.clear(); + ParameterProvider[] parameters = js.getParameters(); + this.parameterViewPane.populate(parameters); + } + } + } + private JPanel initExportTypePane() { + UILabel typeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Type") + ":"); + exportTypeComboBox = getComboBoxWithModel(new String[]{ExportJavaScript.EXPORT_PDF, ExportJavaScript.EXPORT_EXCEL_PAGE, ExportJavaScript.EXPORT_EXCEL_SIMPLE, ExportJavaScript.EXPORT_EXCEL_SHEET, ExportJavaScript.EXPORT_WORD, ExportJavaScript.EXPORT_IMAGE} + , EXPORT_TYPES_MAP); + Component[][] components = new Component[][]{{typeLabel, exportTypeComboBox}}; + + JPanel exportTypePane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{p, p}); + exportTypePane.setBorder(BorderFactory.createEmptyBorder(5, 2, 5, 2)); + return exportTypePane; + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Basic_Export_JS_Setting"); + } + } - private void initComponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Toolkit.i18nText("Fine-Design_Basic_Export_JS_Setting"))); + // 其他模板 + class OtherTemplatePane extends BasicPane { - //导出模板+导出方式+导出文件名 - JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + private UITableEditorPane editorPane; - //导出模板 - JPanel chooseTemplatePane = initChooseTemplatePane(); - northPane.add(chooseTemplatePane, BorderLayout.NORTH); + public OtherTemplatePane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(UITitledBorder.createBorderWithTitle(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Other"))); - //导出方式 - JPanel exportTypePane = initExportTypePane(); - northPane.add(exportTypePane, BorderLayout.CENTER); + editorPane = new UITableEditorPane<>(new ExportJSTableModel()); + editorPane.setHeaderResizing(false); - //导出文件名 - JPanel fileNamePane = initFileNamePane(); - northPane.add(fileNamePane, BorderLayout.SOUTH); + this.add(editorPane, BorderLayout.CENTER); + } - //参数 - JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - JPanel paramsPane = initParamsPane(); - centerPane.add(paramsPane); + public void reset() { + editorPane.populate(new SingleJavaScript[0]); + } + public void updateExportJavaScript(ExportJavaScript exportJavaScript){ + List javaScripts = editorPane.update(); + for (SingleJavaScript js : javaScripts) { + exportJavaScript.addOtherTemplateJS(js); + } + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Basic_Export_JS_Setting"); + } - this.add(northPane, BorderLayout.NORTH); - this.add(centerPane, BorderLayout.CENTER); } - private JPanel initParamsPane() { - extendParametersCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Extends_Report_Parameters")); - extendParametersCheckBox.setSelected(true); - parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); - parameterViewPane.setVisible(false); - parameterViewPane.addTableEditorListener(new TableModelListener() { - public void tableChanged(TableModelEvent e) { - List list = parameterViewPane.update(); - HashSet tempSet = new HashSet<>(); - for (int i = 0; i < list.size(); i++) { - if (StringUtils.isEmpty(list.get(i).getName())) { - continue; + class ExportJSTableModel extends UITableModelAdapter { + + private static final long serialVersionUID = -3697206557955735642L; + + public ExportJSTableModel() { + super(new String[]{ + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_File"), + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Type"), + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Filename"), + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Filename_Custom"), + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Parameters_Setting"), + StringUtils.EMPTY}); + this.setColumnClass(new Class[]{ + ExportTemplateChooser.class, + ExportTypeCombobox.class, + FileNameCombobox.class, + FileNameFormulaEditor.class, + ParameterCombobox.class, + ParameterSettingButton.class + }); + this.setDefaultEditor(ExportTemplateChooser.class, new ExportTemplateChooser()); + this.setDefaultRenderer(ExportTemplateChooser.class, new ExportTemplateChooser()); + this.setDefaultEditor(ExportTypeCombobox.class, new ExportTypeCombobox()); + this.setDefaultEditor(FileNameCombobox.class, new FileNameCombobox()); + this.setDefaultEditor(FileNameFormulaEditor.class, new FileNameFormulaEditor()); + this.setDefaultEditor(ParameterCombobox.class, new ParameterCombobox()); + this.setDefaultEditor(ParameterSettingButton.class, new ParameterSettingButton()); + this.setDefaultRenderer(ParameterSettingButton.class, new ParameterSettingButton()); + this.createTable().getColumnModel().getColumn(2).setMaxWidth(60); + this.createTable().getColumnModel().getColumn(4).setMaxWidth(60); + this.createTable().getColumnModel().getColumn(5).setMaxWidth(50); + } + + @Override + public UITableEditAction[] createAction() { + return new UITableEditAction[]{new AddJSAction(), new DeleteAction()}; + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + SingleJavaScript js = this.getList().get(rowIndex); + switch (columnIndex) { + case 0: + return js.getTemplatePath(); + case 1: + return EXPORT_TYPES_MAP.get(js.getExportType()); + case 2: + return js.isDefaultFileName() ? Toolkit.i18nText("Fine-Design_Basic_Export_JS_Filename_Default") : Toolkit.i18nText("Fine-Design_Basic_Export_JS_Custom"); + case 3: + return js.getFileName(); + case 4: + return js.isExtendParameters() ? Toolkit.i18nText("Fine-Design_Basic_Export_JS_Extend_Parameters") : Toolkit.i18nText("Fine-Design_Basic_Export_JS_Custom"); + case 5: + return js.getParameters(); + } + return null; + } + + @Override + public boolean isCellEditable(int row, int col) { + if (col == 3) { + // 命名详情 + return this.getList().get(row) != null && !this.getList().get(row).isDefaultFileName(); + } + return true; + } + + private class AddJSAction extends AddTableRowAction { + + public AddJSAction() { + + } + + @Override + public void actionPerformed(ActionEvent e) { + super.actionPerformed(e); + if (otherTemplatePane.editorPane.getTableModel().getList().size() <= 50) { + addJS(); + } else { + FineJOptionPane.showMessageDialog(otherTemplatePane, Toolkit.i18nText("Fine-Design_Basic_Export_JS_Batch_Export_Limit")); + } + } + } + + private void addJS() { + SingleJavaScript js = new SingleJavaScript(); + addRow(js); + fireTableDataChanged(); + table.getSelectionModel().setSelectionInterval(table.getRowCount() - 1, table.getRowCount() - 1); + } + + // 导出文件选择 + class ExportTemplateChooser extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + + private static final long serialVersionUID = -9112506131272704717L; + private JPanel reportletNamePane; + private UITextField reportPathTextField; + private UIButton browserButton; + + public ExportTemplateChooser() { + // 路径输入框 + reportPathTextField = new UITextField(8); + reportPathTextField.setEnabled(false); + + // 选择路径按钮 + browserButton = new UIButton("..."); + browserButton.setVisible(true); + + Component[][] templateChooserComponent = {{reportPathTextField, browserButton}}; + double[] rowSize = {TableLayout.PREFERRED}; + double[] columnSize = {TableLayout.FILL, 22}; + reportletNamePane = TableLayoutHelper.createCommonTableLayoutPane(templateChooserComponent, rowSize, columnSize, 0); + + browserButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + final ReportletPane reportletPane = new ReportletPane(); + reportletPane.setSelectedReportletPath(reportPathTextField.getText()); + BasicDialog reportletDialog = reportletPane.showWindow(SwingUtilities.getWindowAncestor(ExportJavaScriptPane.this)); + + reportletDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + reportPathTextField.setText(reportletPane.getSelectedReportletPath()); + } + }); + reportletDialog.setVisible(true); } - if (tempSet.contains(list.get(i).toString())) { - list.remove(i); - FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Duplicate_Name") + "!"); - return; + }); + this.addCellEditorListener(new CellEditorListener() { + + @Override + public void editingCanceled(ChangeEvent e) { + } - tempSet.add(list.get(i).toString()); + + @Override + public void editingStopped(ChangeEvent e) { + if (table.getSelectedRow() == -1) { + return; + } + SingleJavaScript js = getList().get(table.getSelectedRow()); + String value = StringUtils.trimToNull(reportPathTextField.getText()); + js.setTemplatePath(value); + js.setCurrentTemplate(false); + fireTableDataChanged(); + } + }); + + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + reportPathTextField.setText((String) value); + return reportletNamePane; + } + + @Override + public Object getCellEditorValue() { + return reportPathTextField.getText(); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + reportPathTextField.setText((String) value); + return reportletNamePane; + } + } + + // 导出方式下拉框 + class ExportTypeCombobox extends AbstractCellEditor implements TableCellEditor { + + private static final long serialVersionUID = -6564079764032351372L; + + private UIComboBox exportTypeComboBox; + + public ExportTypeCombobox() { + exportTypeComboBox = getComboBoxWithModel(new String[]{ExportJavaScript.EXPORT_PDF, ExportJavaScript.EXPORT_EXCEL_PAGE, ExportJavaScript.EXPORT_EXCEL_SIMPLE, ExportJavaScript.EXPORT_EXCEL_SHEET, ExportJavaScript.EXPORT_WORD, ExportJavaScript.EXPORT_IMAGE} + , EXPORT_TYPES_MAP); + this.addCellEditorListener(new CellEditorListener() { + + @Override + public void editingCanceled(ChangeEvent e) { + + } + + @Override + public void editingStopped(ChangeEvent e) { + if (table.getSelectedRow() == -1) { + return; + } + SingleJavaScript js = getList().get(table.getSelectedRow()); + Object ob = exportTypeComboBox.getSelectedItem(); + if (ob != null) { + String value = ob.toString(); + js.setExportType(value); + } + fireTableDataChanged(); + } + }); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + exportTypeComboBox.setSelectedItem(getList().get(row).getExportType()); + return exportTypeComboBox; + } + + @Override + public Object getCellEditorValue() { + Object ob = exportTypeComboBox.getSelectedItem(); + if (ob != null) { + return ob.toString(); } + return ExportJavaScript.EXPORT_PDF; } - }); - extendParametersCheckBox.addItemListener(new ItemListener() { + } + + // 命名方式下拉框 + class FileNameCombobox extends AbstractCellEditor implements TableCellEditor { + + private static final long serialVersionUID = 1829005772744444269L; + private UIComboBox fileNameComboBox; + + public FileNameCombobox() { + fileNameComboBox = getComboBoxWithModel(new String[]{DEFAULT, CUSTOM}, FILENAME_TYPE_MAP); + fileNameComboBox.addItemListener(e -> { + if (e.getStateChange() == ItemEvent.SELECTED) { + final int row = table.getSelectedRow(); + if (row == -1) { + return; + } + SingleJavaScript js = getList().get(row); + Object ob = fileNameComboBox.getSelectedItem(); + if (ob != null) { + String value = ob.toString(); + js.setDefaultFileName(StringUtils.equals(value, DEFAULT)); + if (js.isDefaultFileName()) { + js.setFileName(StringUtils.EMPTY); + } + } + table.repaint(); + } + }); + this.addCellEditorListener(new CellEditorListener() { + + @Override + public void editingCanceled(ChangeEvent e) { + + } + + @Override + public void editingStopped(ChangeEvent e) { + fireTableDataChanged(); + } + }); + } + @Override - public void itemStateChanged(ItemEvent e) { - parameterViewPane.setVisible(e.getStateChange() == ItemEvent.DESELECTED); + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + fileNameComboBox.setSelectedItem(getList().get(row).isDefaultFileName() ? DEFAULT : CUSTOM); + return fileNameComboBox; } - }); - JPanel paramsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - paramsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Toolkit.i18nText("Fine-Design_Basic_Parameters"))); - paramsPane.add(extendParametersCheckBox, BorderLayout.NORTH); - JPanel dynamicPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); - dynamicPaneWrapper.add(parameterViewPane); - paramsPane.add(dynamicPaneWrapper, BorderLayout.CENTER); - return paramsPane; - } - private JPanel initFileNamePane() { - UILabel nameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Filename") + ":"); - fileNameRadioGroup = new ExportRadioGroup(); - defaultNameRadio = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Filename_Default")); - defaultNameRadio.setSelected(true); - customNameRadio = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Filename_Custom")); - addRadioToGroup(fileNameRadioGroup, defaultNameRadio, customNameRadio); - fileNameFormulaEditor = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula")); - fileNameFormulaEditor.setEnabled(false); - fileNameRadioGroup.addActionListener(new ActionListener() { @Override - public void actionPerformed(ActionEvent e) { - if (defaultNameRadio.isSelected()) { - fileNameFormulaEditor.setEnabled(false); + public Object getCellEditorValue() { + return fileNameComboBox.getSelectedItem().toString(); + } + } + + // 命名方式公式框 + class FileNameFormulaEditor extends AbstractCellEditor implements TableCellEditor { + + private static final long serialVersionUID = 7120075192535645493L; + private FormulaEditor fileNameFormulaEditor; + + public FileNameFormulaEditor() { + fileNameFormulaEditor = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula")); + this.addCellEditorListener(new CellEditorListener() { + + @Override + public void editingCanceled(ChangeEvent e) { + + } + + @Override + public void editingStopped(ChangeEvent e) { + if (table.getSelectedRow() == -1) { + return; + } + SingleJavaScript js = getList().get(table.getSelectedRow()); + String value = fileNameFormulaEditor.getUITextField().getText(); + js.setFileName(value); + fireTableDataChanged(); + } + }); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + if (value != null) { + fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build(value)); } else { - fileNameFormulaEditor.setEnabled(true); + fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build()); } + return fileNameFormulaEditor; + } + + @Override + public Object getCellEditorValue() { + return fileNameFormulaEditor.getUITextField().getText(); + } + + public FormulaEditor getFileNameEditor() { + return fileNameFormulaEditor; + } + } + + //参数设置下拉框 + class ParameterCombobox extends AbstractCellEditor implements TableCellEditor { + + private static final long serialVersionUID = 2630964402770993584L; + private UIComboBox parameterSetting; + + public ParameterCombobox() { + parameterSetting = getComboBoxWithModel(new String[]{DEFAULT, CUSTOM}, PARAMETER_TYPE_MAP); + parameterSetting.addItemListener(e -> { + if (e.getStateChange() == ItemEvent.SELECTED) { + final int row = table.getSelectedRow(); + if (row == -1) { + return; + } + SingleJavaScript js = getList().get(row); + Object ob = parameterSetting.getSelectedItem(); + if (ob != null) { + String value = ob.toString(); + js.setExtendParameters(StringUtils.equals(value, DEFAULT)); + } + // 单纯为了刷新表格,使某些联动生效 + table.repaint(); + } + }); + this.addCellEditorListener(new CellEditorListener() { + + @Override + public void editingCanceled(ChangeEvent e) { + + } + + @Override + public void editingStopped(ChangeEvent e) { + // 这里重新触发是为了触发某些编辑后事件 + fireTableDataChanged(); + } + }); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + parameterSetting.setSelectedItem(getList().get(row).isExtendParameters() ? DEFAULT : CUSTOM); + return parameterSetting; } - }); - Component[][] components = new Component[][]{{nameLabel, defaultNameRadio, customNameRadio, fileNameFormulaEditor}}; - JPanel fileNameRadioPane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{p, p, p, p}); - - JPanel fileNameTipPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - UILabel fileNameTipLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Title_Tip_Front") + "\\/:*?\"<>|" + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Title_Tip_Back") + ""); - fileNameTipPane.add(fileNameTipLabel); - - JPanel fileNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - fileNamePane.add(fileNameRadioPane, BorderLayout.NORTH); - fileNamePane.add(fileNameTipPane, BorderLayout.CENTER); - fileNameTipPane.setBorder(BorderFactory.createEmptyBorder(5,2,5,2)); - fileNamePane.setBorder(BorderFactory.createEmptyBorder(5,2,5,2)); - return fileNamePane; - } - private JPanel initExportTypePane() { - UILabel typeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Type") + ":"); - exportTypeComboBox = new UIComboBox(new DefaultComboBoxModel()); - DefaultComboBoxModel comboBoxModel = (DefaultComboBoxModel) exportTypeComboBox.getModel(); - String[] allExportTypes = new String[]{ExportJavaScript.EXPORT_PDF, ExportJavaScript.EXPORT_EXCEL_PAGE, ExportJavaScript.EXPORT_EXCEL_SIMPLE, ExportJavaScript.EXPORT_EXCEL_SHEET, ExportJavaScript.EXPORT_WORD, ExportJavaScript.EXPORT_IMAGE}; - for (int i = 0; i < allExportTypes.length; i++) { - comboBoxModel.addElement(allExportTypes[i]); + @Override + public Object getCellEditorValue() { + return parameterSetting.getSelectedItem().toString(); + } } - this.exportTypeComboBox.setRenderer(new UIComboBoxRenderer() { + + // 参数设置按钮 + class ParameterSettingButton extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + + private static final long serialVersionUID = 4021592871993049137L; + private UIButton paraButton; + private ParameterSettingPane paraSettingPane; + ParameterProvider[] parameterArr; + + public ParameterSettingButton() { + paraSettingPane = new ParameterSettingPane(); + paraButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_Set")); + paraButton.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + BasicDialog dialog = paraSettingPane.showWindow(SwingUtilities.getWindowAncestor(ExportJavaScriptPane.this)); + dialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + List parameterList = paraSettingPane.getParameterList(); + parameterArr = parameterList.toArray(new Parameter[parameterList.size()]); + } + }); + dialog.setVisible(true); + } + + }); + this.addCellEditorListener(new CellEditorListener() { + + @Override + public void editingCanceled(ChangeEvent e) { + + } + + @Override + public void editingStopped(ChangeEvent e) { + if (table.getSelectedRow() == -1) { + return; + } + SingleJavaScript js = getList().get(table.getSelectedRow()); + if (parameterArr != null) { + js.setParameters(parameterArr); + } + parameterArr = null; + fireTableDataChanged(); + } + }); + + } @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value instanceof String) { - this.setText(EXPORT_TYPES_MAP.get(value)); + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + if (getList().get(row) == null || getList().get(row).isExtendParameters()) { + return EMPTY_LABEL; } - return this; + ParameterProvider[] providers = (ParameterProvider[]) value; + if (providers != null) { + paraSettingPane.refresh(new ArrayList<>(Arrays.asList(providers))); + } + return paraButton; + } + + @Override + public Object getCellEditorValue() { + return paraSettingPane.getParameterList(); } - }); - Component[][] components = new Component[][]{{typeLabel, exportTypeComboBox}}; - JPanel exportTypePane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{p, p}); - exportTypePane.setBorder(BorderFactory.createEmptyBorder(5,2,5,2)); - return exportTypePane; + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + if (getList().get(row) == null || getList().get(row).isExtendParameters()) { + return EMPTY_LABEL; + } + return paraButton; + } + } + + // 参数设置弹出框 + class ParameterSettingPane extends BasicPane { + + private ReportletParameterViewPane parameterViewPane; + + public ParameterSettingPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + parameterViewPane = new ReportletParameterViewPane(ParameterTableModel.NO_CHART_USE, getValueEditorPane(), getValueEditorPane()); + addListener(parameterViewPane); + this.add(parameterViewPane); + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Basic_Export_JS_Parameters_Setting"); + } + + public List getParameterList() { + return parameterViewPane.update(); + } + + public void refresh(List list) { + parameterViewPane.update(list); + } + + } + + } + + public ExportJavaScriptPane() { + initComponents(); + } + + private void initComponents() { + JPanel totalPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + totalPanel.setBorder(UITitledBorder.createBorderWithTitle(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Setting"))); + + // 导出模板 + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel chooseTemplatePane = initChooseTemplatePane(); + northPane.add(chooseTemplatePane, BorderLayout.NORTH); + + // 默认当前模板 + currentTemplatePane = new CurrentTemplatePane(); + otherTemplatePane = new OtherTemplatePane(); + templatePanel = FRGUIPaneFactory.createCardLayout_S_Pane(); + card = new CardLayout(); + templatePanel.setLayout(card); + templatePanel.add(CURRENT_TEMPLATE, currentTemplatePane); + templatePanel.add(OTHER_TEMPLATE, otherTemplatePane); + + totalPanel.add(northPane, BorderLayout.NORTH); + totalPanel.add(templatePanel, BorderLayout.CENTER); + + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(totalPanel); } private JPanel initChooseTemplatePane() { @@ -220,51 +800,28 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane parameterList = this.parameterViewPane.update(); - parameterList.clear(); - ParameterProvider[] parameters = ob.getParameters(); - this.parameterViewPane.populate(parameters); - } + currentTemplatePane.populateSingleJavaScript(ob.getCurrentTemplateJavaScript()); + + OtherTemplatePane pane = (OtherTemplatePane) this.templatePanel.getComponent(1); + pane.editorPane.populate(ob.getJsListForOtherTemplates().toArray(new SingleJavaScript[ob.getJsListForOtherTemplates().size()])); } @Override @@ -309,32 +848,59 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane parameterList = this.parameterViewPane.update(); - if (!parameterList.isEmpty()) { - Parameter[] parameters = new Parameter[parameterList.size()]; - parameterList.toArray(parameters); - exportJavaScript.setParameters(parameters); - } - } - } + boolean selected = currentTemplateRadio.isSelected(); + exportJavaScript.setCurrentTemplate(selected); + SingleJavaScript js = new SingleJavaScript(); + js.setCurrentTemplate(selected); + currentTemplatePane.updateSingleJavaScript(js); + exportJavaScript.addCurrentTemplateJS(js); - private String getTemplatePath() { - return currentTemplateRadio.isSelected() ? CURRENT_TEMPLATE : reportPathTextField.getText(); + otherTemplatePane.updateExportJavaScript(exportJavaScript); } private String getFileName() { - return defaultNameRadio.isSelected() ? DEFAULT_FILENAME : fileNameFormulaEditor.getUITextField().getText(); + return currentTemplatePane.defaultNameRadio.isSelected() ? DEFAULT : currentTemplatePane.fileNameFormulaEditor.getUITextField().getText(); } + private UIComboBox getComboBoxWithModel(String[] itemTextArr, Map itemTextDic) { + UIComboBox comboBox = new UIComboBox(new DefaultComboBoxModel()); + DefaultComboBoxModel comboBoxModel = (DefaultComboBoxModel) comboBox.getModel(); + for (int i = 0; i < itemTextArr.length; i++) { + comboBoxModel.addElement(itemTextArr[i]); + } + comboBox.setRenderer(new UIComboBoxRenderer() { + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + if (value instanceof String) { + this.setText(itemTextDic.get(value)); + } + return this; + } + }); + return comboBox; + } + + private void addListener(ReportletParameterViewPane paraPane) { + paraPane.addTableEditorListener(new TableModelListener() { + public void tableChanged(TableModelEvent e) { + List list = paraPane.update(); + HashSet tempSet = new HashSet<>(); + for (int i = 0; i < list.size(); i++) { + if (StringUtils.isEmpty(list.get(i).getName())) { + continue; + } + if (tempSet.contains(list.get(i).toString())) { + list.remove(i); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Parameter_Duplicate_Name") + "!"); + return; + } + tempSet.add(list.get(i).toString()); + } + } + }); + } @Override public boolean accept(Object ob) { From f988f5ab2b622f255b1a0a8d0d4e8cbe478b29ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 5 Nov 2021 17:59:39 +0800 Subject: [PATCH 29/45] =?UTF-8?q?REPORT-60528=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E5=9C=A8=E5=BC=B9=E7=AA=97=E6=8F=90=E7=A4=BA?= =?UTF-8?q?tablayout=E9=AB=98=E5=BA=A6=E6=9C=89=E9=97=AE=E9=A2=98=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E5=88=A4=E6=96=AD=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/FRCardMainBorderLayoutAdapter.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java index 726c397060..dd9e03c8db 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java @@ -64,21 +64,18 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter { private boolean isBeyondMinConstraint(int minConstraint, int value) { if (minConstraint > value) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); - if (container.getBackupBound() != null) { - // 手动拖动导致变矮的场景 - container.setSize(container.getBackupBound().getSize()); - } else { - // 自适应布局平分高度导致变矮的场景 + JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + if (jt != null && jt.getUndoManager().canUndo()) { + // 自适应布局平分高度导致变矮的场景,优先做撤销 UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - if (jt != null) { - jt.undo(); - } + jt.undo(); } }); - + } else if (container.getBackupBound() != null) { + // 手动拖动导致变矮的场景 + container.setSize(container.getBackupBound().getSize()); } return true; } else { From 6635b86a64401b2557244a3a36c2dc2d9a3d7840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 8 Nov 2021 14:11:29 +0800 Subject: [PATCH 30/45] =?UTF-8?q?REPORT-57521=20=E5=9B=9E=E9=80=80?= =?UTF-8?q?=E4=BB=A3=E7=A0=81-=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E6=97=B6websocket=E6=96=AD=E5=BC=80=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/toast/DesignerToastMsgUtil.java | 16 +- .../mainframe/toast/ToastMsgDialog.java | 9 +- .../mainframe/socketio/DesignerSocketIO.java | 142 +++++------------- 3 files changed, 40 insertions(+), 127 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java b/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java index 300f8537e2..d7e83dc2e5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java @@ -31,13 +31,6 @@ public class DesignerToastMsgUtil { } - public static ToastMsgDialog createPromptDialog(String text) { - return createDialog(PROMPT_ICON, toastPane(text), DesignerContext.getDesignerFrame()); - } - - public static ToastMsgDialog createPromptDialog(JPanel contentPane) { - return createDialog(PROMPT_ICON, contentPane, DesignerContext.getDesignerFrame()); - } public static void toastPrompt(JPanel contendPane) { toastPane(PROMPT_ICON, contendPane, DesignerContext.getDesignerFrame()); @@ -76,11 +69,6 @@ public class DesignerToastMsgUtil { } private static void toastPane(Icon icon, JPanel contendPane, Window parent) { - ToastMsgDialog dialog = createDialog(icon, contendPane, parent); - dialog.setVisible(true); - } - - private static ToastMsgDialog createDialog(Icon icon, JPanel contendPane, Window parent) { JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UILabel uiLabel = new UILabel(icon); uiLabel.setVerticalAlignment(SwingConstants.TOP); @@ -95,7 +83,7 @@ public class DesignerToastMsgUtil { } else { dialog = new ToastMsgDialog((Frame) parent, pane); } - return dialog; + dialog.setVisible(true); } @@ -130,4 +118,4 @@ public class DesignerToastMsgUtil { .toString(); } -} +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java index 69865c7059..c3f9b096d5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java @@ -24,7 +24,6 @@ public class ToastMsgDialog extends UIDialog { private ScheduledExecutorService TIMER; private int hide_height = 0; private JPanel contentPane; - private boolean show = false; public ToastMsgDialog(Frame parent, JPanel panel) { super(parent); @@ -66,7 +65,6 @@ public class ToastMsgDialog extends UIDialog { public void display(JPanel outerJPanel) { - show = true; outerJPanel.setLocation(0, -hide_height); ScheduledExecutorService TIP_TOOL_TIMER = createToastScheduleExecutorService(); TIP_TOOL_TIMER.scheduleAtFixedRate(new Runnable() { @@ -100,7 +98,6 @@ public class ToastMsgDialog extends UIDialog { TIP_TOOL_TIMER.shutdown(); ToastMsgDialog.this.setVisible(false); ToastMsgDialog.this.dispose(); - ToastMsgDialog.this.show = false; } outerJPanel.setLocation(point.x, point.y - 5); Dimension dimension = ToastMsgDialog.this.getSize(); @@ -162,7 +159,5 @@ public class ToastMsgDialog extends UIDialog { super.dispose(); } - public boolean isShow() { - return show; - } -} + +} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 5916b4f32f..eeba97ae46 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -7,33 +7,20 @@ import com.fr.design.EnvChangeEntrance; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfoContext; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.loghandler.DesignerLogger; -import com.fr.design.mainframe.share.ui.base.MouseClickListener; -import com.fr.design.mainframe.toast.DesignerToastMsgUtil; -import com.fr.design.mainframe.toast.ToastMsgDialog; import com.fr.design.ui.util.UIUtil; -import com.fr.design.utils.BrowseUtils; import com.fr.event.EventDispatcher; -import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; -import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; -import com.fr.third.org.apache.http.client.config.RequestConfig; -import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; -import com.fr.third.org.apache.http.client.methods.HttpGet; import com.fr.third.org.apache.http.conn.ssl.NoopHostnameVerifier; import com.fr.third.org.apache.http.conn.ssl.TrustSelfSignedStrategy; -import com.fr.third.org.apache.http.impl.client.CloseableHttpClient; -import com.fr.third.org.apache.http.impl.client.HttpClients; import com.fr.third.org.apache.http.ssl.SSLContexts; import com.fr.web.WebSocketConfig; import com.fr.web.socketio.WebSocketProtocol; @@ -42,27 +29,22 @@ import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.server.socket.SocketInfoOperator; import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; -import javax.net.ssl.SSLContext; -import javax.swing.BorderFactory; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.UIManager; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.event.MouseEvent; import java.io.File; import java.io.FileInputStream; +import java.security.KeyStore; +import java.util.Arrays; +import javax.net.ssl.SSLContext; +import javax.swing.*; import java.io.IOException; import java.net.URI; import java.net.URL; -import java.security.KeyStore; -import java.util.Arrays; import java.util.Timer; +import java.util.TimerTask; public class DesignerSocketIO { @@ -72,21 +54,18 @@ public class DesignerSocketIO { Disconnecting } - private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("websocketConnect", "https://help.fanruan.com/finereport/doc-view-2512.html"); private static final String HTTPS = "https"; private static final String HTTP = "http"; private static Socket socket = null; private static Status status = Status.Disconnected; private static Timer disConnectHintTimer = null; private static long disConnectHintTimerDelay = 3000; - private static final int TIMEOUT = 5000; //维护一个当前工作环境的uri列表 private static String[] uri; //维护一个关于uri列表的计数器 private static int count; // 当前webSocket选择的协议 private static String currentProtocol; - private static ToastMsgDialog dialog = null; public static void close() { @@ -153,7 +132,7 @@ public class DesignerSocketIO { String certPath = connection.getCertPath(); String certSecretKey = connection.getCertSecretKey(); if (StringUtils.isBlank(certPath) || StringUtils.isBlank(certSecretKey)) { - return SSLContexts.createDefault(); + return SSLContexts.createDefault(); } KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); try (FileInputStream keystore = new FileInputStream(new File(certPath))) { @@ -206,7 +185,6 @@ public class DesignerSocketIO { private static final Emitter.Listener failRetry = new Emitter.Listener() { @Override public void call(Object... args) { - showSocketDisconnectToast(); printLog(args, PrintEventLogImpl.WARN, "failed args: {}"); status = Status.Disconnecting; socket.close(); @@ -245,38 +223,41 @@ public class DesignerSocketIO { @Override public void call(Object... objects) { FineLoggerFactory.getLogger().info("start disConnectHintTimer"); - /* - * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, - * socket 只用推日志和通知配置变更 - */ - printLog(objects, PrintEventLogImpl.ERROR, "disConnected args: {}"); - if (status != Status.Disconnecting) { - dealWithSocketDisconnect(); - } - status = Status.Disconnected; + disConnectHintTimer = new Timer(); + disConnectHintTimer.schedule(new TimerTask() { + @Override + public void run() { + try { + /* + * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, + * socket 只用推日志和通知配置变更 + */ + printLog(objects, PrintEventLogImpl.ERROR, "disConnected args: {}"); + if (status != Status.Disconnecting) { + showConnectionLostDialog(); + } + status = Status.Disconnected; + } finally { + disConnectHintTimer.cancel(); + disConnectHintTimer = null; + } + } + }, disConnectHintTimerDelay); } }; - private static void dealWithSocketDisconnect() { - if (checkRPCConnect()) { - showSocketDisconnectToast(); - } else { - showRPCDisconnectDialog(); - } - } - - private static void showSocketDisconnectToast() { + private static void showConnectionLostDialog() { try { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - if (dialog == null) { - dialog = DesignerToastMsgUtil.createPromptDialog(createDialogContent()); - } - - if (!dialog.isShow()) { - dialog.setVisible(true); - } + FineJOptionPane.showMessageDialog( + DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), + UIManager.getString("OptionPane.messageDialogTitle"), + JOptionPane.ERROR_MESSAGE, + UIManager.getIcon("OptionPane.errorIcon")); + EnvChangeEntrance.getInstance().chooseEnv(); } }); } catch (Exception e) { @@ -284,57 +265,6 @@ public class DesignerSocketIO { } } - private static JPanel createDialogContent() { - JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_WebSocket_Lost_Tip")), BorderLayout.WEST); - UILabel hyperLinkLabel = new UILabel(Toolkit.i18nText("Fine-Design_WebSocket_Lost_Tip_HyperLink_Text")); - hyperLinkLabel.addMouseListener(new MouseClickListener() { - @Override - public void mouseClicked(MouseEvent e) { - BrowseUtils.browser(WEBSOCKET_HELP_DOC); - } - }); - hyperLinkLabel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0)); - hyperLinkLabel.setForeground(Color.BLUE); - hyperLinkLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - jPanel.add(hyperLinkLabel, BorderLayout.CENTER); - return jPanel; - } - - private static void showRPCDisconnectDialog() { - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - FineJOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - UIManager.getString("OptionPane.messageDialogTitle"), - JOptionPane.ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); - EnvChangeEntrance.getInstance().chooseEnv(); - } - }); - } - - private static boolean checkRPCConnect() { - CloseableHttpClient httpclient = HttpClients.createDefault(); - WorkspaceConnectionInfo info = getConnectionInfo(); - HttpGet httpGet = new HttpGet(StableUtils.pathJoin(info.getUrl(), WorkspaceConstants.CONTROLLER_PREFIX, WorkspaceConstants.VT)); - RequestConfig requestConfig = RequestConfig - .custom() - .setConnectTimeout(TIMEOUT) - .setConnectionRequestTimeout(TIMEOUT) - .build(); - httpGet.setConfig(requestConfig); - try { - CloseableHttpResponse response = httpclient.execute(httpGet); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e, e.getMessage()); - return false; - } - return true; - } - //配置变更监听器 private static final Emitter.Listener modifyConfig = new Emitter.Listener() { @Override @@ -387,4 +317,4 @@ public class DesignerSocketIO { }; } -} +} \ No newline at end of file From 18c54e860643006865d3ea19690577b17a6bc502 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 4 Nov 2021 21:05:08 +0800 Subject: [PATCH 31/45] =?UTF-8?q?REPORT-61410=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=A2=84=E8=A7=88=E6=97=B6=E5=8F=AF=E5=A4=8D=E5=88=B6?= =?UTF-8?q?-=E8=A1=A8=E5=A4=B4=E5=A4=8D=E5=88=B6=E9=97=AE=E9=A2=98=20&&=20?= =?UTF-8?q?REPORT-61409=20=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E5=A4=8D=E5=88=B6-=E8=B5=8B=E5=80=BC?= =?UTF-8?q?=E7=A9=BA=E5=80=BC=E6=97=B6=E6=98=BE=E7=A4=BA=E6=88=90Null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/CopyableJTable.java | 51 ++++++++++++------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java index eb8d188a1f..a452a4d371 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java @@ -106,6 +106,7 @@ public class CopyableJTable extends SortableJTable { self.updateEndPoint(-1, column); self.refreshTable(); } + self.requestFocusInWindow(); } private int getColumn(MouseEvent e) { @@ -249,26 +250,9 @@ public class CopyableJTable extends SortableJTable { FineLoggerFactory.getLogger().info("copy cell value"); java.util.List> table = new ArrayList<>(); if ((startRow != endRow || startCol != endCol) && Math.min(startCol, endCol) > -1) { - for (int i = Math.min(startRow, endRow); i <= Math.max(startRow, endRow); i++) { - table.add(new ArrayList<>()); - for (int j = Math.min(startCol, endCol); j <= Math.max(startCol, endCol); j++) { - Object text = this.getTableValue(i, j); - table.get(table.size() - 1).add(text); - } - } + copyAreaData(table); } else if (pointList.size() > 0) { - Collections.sort(pointList, Comparator.comparing(Point::getX).thenComparing(Point::getY)); - int startRow = pointList.get(0).x; - int currentRow = startRow; - table.add(new ArrayList<>()); - for (Point point : pointList) { - while (currentRow < point.x) { - table.add(new ArrayList<>()); - currentRow++; - } - Object text = this.getTableValue(point.x, point.y); - table.get(table.size() - 1).add(text); - } + copyPointsData(table); } Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard(); @@ -276,6 +260,35 @@ public class CopyableJTable extends SortableJTable { clip.setContents(tText, null); } + private void copyAreaData(java.util.List> table) { + for (int i = Math.min(startRow, endRow); i <= Math.max(startRow, endRow); i++) { + table.add(new ArrayList<>()); + for (int j = Math.min(startCol, endCol); j <= Math.max(startCol, endCol); j++) { + Object text = this.getTableValue(i, j); + if (text != null) { + table.get(table.size() - 1).add(text); + } + } + } + } + + private void copyPointsData(java.util.List> table) { + Collections.sort(pointList, Comparator.comparing(Point::getX).thenComparing(Point::getY)); + int startRow = pointList.get(0).x; + int currentRow = startRow; + table.add(new ArrayList<>()); + for (Point point : pointList) { + while (currentRow < point.x) { + table.add(new ArrayList<>()); + currentRow++; + } + Object text = this.getTableValue(point.x, point.y); + if (text != null) { + table.get(table.size() - 1).add(text); + } + } + } + private Object getTableValue(int row, int col) { Object value = null; if (col > -1) { From 290226dbfc0ee5934e8b95ae72c4f83d5091cf26 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 9 Nov 2021 18:39:41 +0800 Subject: [PATCH 32/45] REPORT-61736 release/11.0->final/11.0 --- .../com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java | 2 ++ 1 file changed, 2 insertions(+) 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 452deb5c8d..fc4b8e3682 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 @@ -163,6 +163,8 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { try { latch.await(); } catch (InterruptedException ignore) { + } finally { + setShowDialogState(false); } return selectedFiles.length > 0 ? JFileChooser.APPROVE_OPTION : JFileChooser.CANCEL_OPTION; } From 18865d49d7f4759d98fbbc2a5fcfe13ecee06b52 Mon Sep 17 00:00:00 2001 From: shine Date: Fri, 5 Nov 2021 16:57:54 +0800 Subject: [PATCH 33/45] =?UTF-8?q?CHART-21737=20fix:=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=AD=E7=9A=84=E5=9B=BE=E8=A1=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=20=E8=AE=BE=E7=BD=AE=E7=AC=AC=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/component/VanChartFillStylePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java index 42e33b89ca..3f7374c34d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java @@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerBean; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.predefined.ui.detail.ColorFillStylePane; import com.fr.design.utils.gui.GUICoreUtils; @@ -63,7 +64,7 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe } public void updateBean(AttrFillStyle attrFillStyle) { - if (getStyleSelectBox().getSelectedIndex() == 0) { + if (getStyleSelectBox().getSelectedIndex() == 0 && ChartEditContext.supportTheme()) { attrFillStyle.setThemed(true); return; } From eeac554bd4713f870722c338c7327983827aca1e Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 8 Nov 2021 14:46:51 +0800 Subject: [PATCH 34/45] =?UTF-8?q?CHART-21570=20=E9=80=82=E9=85=8D11.0=20?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF=E4=B8=AD=E7=9A=84cpt?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20=E4=B8=8D=E6=94=AF=E6=8C=81=E8=B7=9F?= =?UTF-8?q?=E9=9A=8F=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/gui/AdjustWorkBookDefaultStyleUtils.java | 11 +++++++++++ .../mainframe/cell/settingpane/style/StylePane.java | 6 +++++- .../java/com/fr/design/report/ReportStylePane.java | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java index abae997e39..aa2178ece0 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java @@ -43,4 +43,15 @@ public class AdjustWorkBookDefaultStyleUtils { return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color; } + /** + * cpt模板是否支持跟随主题选项 + * 单元格样式 + * 悬浮元素样式 + * 纸张背景入口大屏模板屏蔽掉了 忽略 + * @return 大屏模板中cpt组件不支持 + */ + public static boolean supportTheme() { + return !DesignModeContext.isDuchampMode(); + } + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java index bad6e6b6a6..84c0c12b43 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java @@ -13,6 +13,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; @@ -38,6 +39,7 @@ public class StylePane extends BasicPane implements UIObserver { public static final int DEFAULT_SELECTED_INDEX = 0; private final UIButtonGroup followingThemeButtonGroup; + private JPanel followingThemePane; private final CustomStylePane customStylePane; private final ThemedCellStyleListPane themedCellStyleListPane; private final CardLayout cardLayout; @@ -64,7 +66,7 @@ public class StylePane extends BasicPane implements UIObserver { private void initializePane() { setLayout(new BorderLayout(0, IntervalConstants.INTERVAL_L1)); - add(createFollowingThemePane(), BorderLayout.NORTH); + add(followingThemePane = createFollowingThemePane(), BorderLayout.NORTH); contentPane = createTabbedContentPane(); add(contentPane, BorderLayout.CENTER); } @@ -226,6 +228,8 @@ public class StylePane extends BasicPane implements UIObserver { setSelectedIndex(1); customStylePane.populateBean(style); } + //单元格配置界面是单例 所以直接在populate的时候把跟随主题的按钮组设置不可见 + followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme()); } private void fireStateChanged() { diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java index fc4b5a116c..e16af5e3d3 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java @@ -27,6 +27,7 @@ import com.fr.design.style.BorderUtils; import com.fr.design.style.FRFontPane; import com.fr.design.style.FormatPane; import com.fr.design.style.background.BackgroundPane; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.general.FRFont; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; @@ -66,6 +67,7 @@ public class ReportStylePane extends BasicPane { private final CellStylePreviewPane previewArea; private final UIButtonGroup followingThemeButtonGroup; + private JPanel followingThemePane; private final CustomFloatStyleSettingPane customStylePane; private final ThemedFloatStyleSettingPane themedFloatStyleSettingPane; private final CardLayout cardLayout; @@ -106,7 +108,7 @@ public class ReportStylePane extends BasicPane { add(createPreviewPane(), BorderLayout.NORTH); JPanel settingContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); - JPanel followingThemePane = createFollowingThemePane(); + followingThemePane = createFollowingThemePane(); followingThemePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0)); settingContainer.add(followingThemePane, BorderLayout.NORTH); settingContainer.add(contentPane, BorderLayout.CENTER); @@ -319,6 +321,8 @@ public class ReportStylePane extends BasicPane { setSelectedIndex(1); customStylePane.populateBean(style); } + + followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme()); } public void updatePreviewArea() { From 83f0dd7f00bd94646fe53fc1be80f39b923b414c Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 8 Nov 2021 15:00:24 +0800 Subject: [PATCH 35/45] =?UTF-8?q?CHART-21570=20=E5=A4=A7=E5=B1=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=20cpt=E7=BB=84=E4=BB=B6=E4=B8=AD=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E4=B9=9F=E4=B8=8D=E6=94=AF=E6=8C=81=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/mode/ChartEditContext.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java index 56345aeda9..51fe2f816a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.chart.mode; import com.fr.common.annotations.Open; +import com.fr.design.base.mode.DesignModeContext; /** * @author shine @@ -27,9 +28,9 @@ public class ChartEditContext { /** * 是否支持 主题样式 设置 * - * @return duchamp大屏模板模式 不支持 + * @return duchamp大屏模板模式 不支持 图表组件&cpt组件中的图表 都不支持 */ public static boolean supportTheme() { - return !duchampMode(); + return !DesignModeContext.isDuchampMode(); } } From cf0ae930be36c5034b896b4eaefcdd2ebdb51453 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 8 Nov 2021 19:56:48 +0800 Subject: [PATCH 36/45] =?UTF-8?q?CHART-21570=20=E5=A4=A7=E5=B1=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E7=9A=84=E5=9B=BE=E8=A1=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chart/ChartTypePane.java | 10 ++++++++-- .../type/AbstractVanChartTypePane.java | 4 ++++ .../chart/map/designer/type/GisLayerPane.java | 19 +++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index d31cd32088..0337fff442 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -11,8 +11,10 @@ import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.vanchart.VanChart; import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; @@ -23,10 +25,10 @@ import javax.swing.JSplitPane; import javax.swing.ListCellRenderer; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; import java.awt.Color; import java.awt.Component; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent { private static final long serialVersionUID = -1175602484968520546L; @@ -153,6 +155,10 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven } } + if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { + ((VanChart) chart4Update).setThemeAutoCustom(); + } + update(chart4Update); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 9cf9165547..04f48c7321 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -24,6 +24,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.Background; import com.fr.js.NameJavaScriptGroup; import com.fr.log.FineLoggerFactory; @@ -152,6 +153,9 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane { refreshZoomLevel(); @@ -236,9 +237,19 @@ public class GisLayerPane extends JPanel implements UIObserver { } public void resetGisLayer(VanChartMapPlot mapPlot) { - GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer(); - mapPlot.setGisLayer(defaultGisLayer); - populate(defaultGisLayer); + + if (ChartEditContext.supportTheme()) { + GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer(); + mapPlot.setGisLayer(defaultGisLayer); + populate(defaultGisLayer); + } else { + GaoDeGisType gaoDeGisType = mapPlot.getDefaultGisLayerType(); + + mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API); + mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName()); + mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType); + populate(mapPlot.getGisLayer()); + } } public void populate(GisLayer layer) { From fc40344d1d6321ea3835b74840517e5348e593f3 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 8 Nov 2021 19:59:14 +0800 Subject: [PATCH 37/45] update --- .../src/main/java/com/fr/design/chart/ChartTypePane.java | 2 +- .../fr/van/chart/designer/type/AbstractVanChartTypePane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index 0337fff442..968117156d 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -156,7 +156,7 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven } if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { - ((VanChart) chart4Update).setThemeAutoCustom(); + ((VanChart) chart4Update).setAutoThemeCustom(); } update(chart4Update); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 04f48c7321..3456dd0be8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -154,7 +154,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane Date: Tue, 9 Nov 2021 14:23:13 +0800 Subject: [PATCH 38/45] =?UTF-8?q?CHART-21805=20fix:cpt=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=9B=BE=E8=A1=A8=20=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E4=B8=AD=E6=9C=89=E7=9A=84=E5=B1=9E=E6=80=A7=20=E4=B8=8D?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E5=B1=9E=E6=80=A7=20=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=88=90=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/chart/ChartTypePane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index 968117156d..748a64069b 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -156,6 +156,9 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven } if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { + //主题中有的属性 不跟随属性 全部设置成自定义 + ((VanChart) chart4Update).setThemeCustom(); + //主题中没有的 根据主题深浅色自动 的属性 全部设置成自定义 ((VanChart) chart4Update).setAutoThemeCustom(); } From 1cecadcf284bab1d7a2b22a7432058f143f4e572 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 9 Nov 2021 20:45:26 +0800 Subject: [PATCH 39/45] =?UTF-8?q?CHART-21570=20fix:fvs.cpt.chart=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/chart/ChartTypePane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index 748a64069b..ffa1d5002c 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -156,10 +156,10 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven } if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { - //主题中有的属性 不跟随属性 全部设置成自定义 + //主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义 ((VanChart) chart4Update).setThemeCustom(); - //主题中没有的 根据主题深浅色自动 的属性 全部设置成自定义 - ((VanChart) chart4Update).setAutoThemeCustom(); +// //主题中没有的 根据主题深浅色自动 的属性 默认自动 +// ((VanChart) chart4Update).setAutoThemeCustom(); } update(chart4Update); From 9e8e2ea32b53d36ec63b874f6bdc8e7c7e21f103 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 9 Nov 2021 21:01:17 +0800 Subject: [PATCH 40/45] =?UTF-8?q?CHART-21570=20fix:fvs.cpt.chart=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../type/AbstractVanChartTypePane.java | 6 +++--- .../chart/map/designer/type/GisLayerPane.java | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 3456dd0be8..72c3c8e030 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -153,9 +153,9 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane Date: Tue, 9 Nov 2021 21:02:26 +0800 Subject: [PATCH 41/45] =?UTF-8?q?CHART-21570=20fix:fvs.cpt.chart=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/van/chart/map/designer/type/GisLayerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java index 43a770beae..5d0a6c21fd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java @@ -85,7 +85,7 @@ public class GisLayerPane extends JPanel implements UIObserver { private JPanel createGISLayerPane() { gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"), Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); - gisButton.setSelectedIndex(ChartEditContext.supportTheme() ? 0 : 1); + gisButton.setSelectedIndex(0); gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems()); gisButton.addActionListener(event -> { refreshZoomLevel(); From 4c56250c782ef501858df40b780b18f6dc48302a Mon Sep 17 00:00:00 2001 From: eason Date: Tue, 9 Nov 2021 10:09:29 +0800 Subject: [PATCH 42/45] =?UTF-8?q?CHART-21786:=E4=B8=8D=E9=99=90=E5=88=B6?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=A0=87=E8=AE=B0=E7=82=B9=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/component/marker/VanChartImageMarkerPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java index d28354bdb7..3d6c85f4ec 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java @@ -31,8 +31,8 @@ public class VanChartImageMarkerPane extends BasicBeanPane { public VanChartImageMarkerPane() { imageBackgroundPane = new ImageBackgroundQuickPane(false); imageBackgroundPane.setPreferredSize(getImageBackgroundPreferredSize(imageBackgroundPane.getPreferredSize())); - width = new UISpinnerWithPx(0, 100, 0.5, 30); - height = new UISpinnerWithPx(0, 100, 0.5, 30); + width = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30); + height = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; From 740c525977aeeaa44ac320ffa911ed07c283f5bc Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 10 Nov 2021 16:31:19 +0800 Subject: [PATCH 43/45] =?UTF-8?q?CHART-21829=20fix:fvs.cpt.chart=20?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=88=87=E6=8D=A2=20=E4=B9=9F=E8=A6=81?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=9B=BE=E8=A1=A8=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/ChartTypeButtonPane.java | 7 +++++++ .../chart/designer/type/AbstractVanChartTypePane.java | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 7260fe581c..cadf577eb1 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -18,6 +18,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.vanchart.VanChart; @@ -154,6 +155,12 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen addButton.addActionListener((e) -> { String name = getNewChartName(); ChartProvider chart = getChangeStateNewChart(); + if (!ChartEditContext.supportTheme() && chart instanceof VanChart) { + //主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义 + ((VanChart) chart).setThemeCustom(); +// //主题中没有的 根据主题深浅色自动 的属性 默认自动 +// ((VanChart) chart4Update).setAutoThemeCustom(); + } checkInForm(chart); addNewChart(chart, name, editingCollection.getChartCount()); }); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 72c3c8e030..2d7d738fe1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -152,10 +152,13 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane Date: Thu, 11 Nov 2021 17:03:58 +0800 Subject: [PATCH 44/45] =?UTF-8?q?CHART-21844=20fix:=E6=8A=98=E7=BA=BF?= =?UTF-8?q?=E9=9B=B7=E8=BE=BE=E5=9B=BE=E5=88=87=E6=8D=A2=E5=88=B0=E5=A0=86?= =?UTF-8?q?=E7=A7=AF=E9=9B=B7=E8=BE=BE=E5=9B=BE&=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=9B=BE=E6=96=B0=E5=A2=9E=E5=9B=BE=E8=A1=A8=20=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E4=B9=9F=E8=A6=81=E5=85=A8=E9=83=A8=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=88=90=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartCustomPlotSelectPane.java | 18 +++++++++++++++++- .../type/AbstractVanChartTypePane.java | 6 ++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java index 8f7b9557d0..2df3cc5af0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java @@ -1,12 +1,13 @@ package com.fr.van.chart.custom.component; +import com.fr.chart.base.ChartThemeStyleProvider; import com.fr.chart.chartattr.Chart; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; - import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.custom.CustomPlotFactory; @@ -264,6 +265,13 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane { //设置公共属性 setCommonAttr(vanChartPlot, customPlot); + if (!ChartEditContext.supportTheme()) { + //主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义 + setThemeCustom(vanChartPlot); +// //主题中没有的 根据主题深浅色自动 的属性 默认自动 +// ((VanChart) chart4Update).setAutoThemeCustom(); + } + newCustomPlotList.add(vanChartPlot); } } @@ -271,6 +279,14 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane { customPlot.setCustomPlotList(newCustomPlotList); } + private void setThemeCustom(VanChartPlot customPlot) { + List chartThemeStyleProviders = new ArrayList<>(); + customPlot.getChartPreStyleProvider(chartThemeStyleProviders); + for (ChartThemeStyleProvider chartThemeStyleProvider : chartThemeStyleProviders) { + chartThemeStyleProvider.setThemeCustom(); + } + } + private void setCommonAttr(VanChartPlot vanChartPlot, VanChartCustomPlot customPlot) { //坐标轴公共属性 dealAxisAttr(vanChartPlot, customPlot); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 2d7d738fe1..0d50ad084d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -145,6 +145,12 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane Date: Thu, 11 Nov 2021 17:30:48 +0800 Subject: [PATCH 45/45] =?UTF-8?q?CHART-21844=20fix:=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E7=AA=97=E5=9B=BE=E8=A1=A8=20=E5=B1=9E=E6=80=A7=E4=B9=9F?= =?UTF-8?q?=E8=A6=81=E5=85=A8=E9=83=A8=E8=AE=BE=E7=BD=AE=E6=88=90=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SeriesCondition/impl/ChartHyperPoplinkPane.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java index 3372880dda..855f4cbbc8 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java @@ -12,8 +12,10 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.ChartHyperEditPane; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.vanchart.VanChart; import java.util.HashMap; import java.awt.BorderLayout; @@ -70,7 +72,14 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane