From 2a947ac8256f736ec57e6f2c48f649e5ceb9056a Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 3 Dec 2020 17:25:12 +0800 Subject: [PATCH 001/104] =?UTF-8?q?REPORT-44581=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=96=AD=E5=BC=80=E5=90=8Emac=E9=80=89?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E5=90=AF=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=98=AF=E4=B8=80=E4=B8=AA=E9=A1=B6=E5=B1=82?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=EF=BC=8C=E5=AE=A2=E6=88=B7=E5=9C=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=BF=9D=E5=AD=98=E6=93=8D=E4=BD=9C=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8Ctomcat=E7=AA=81=E7=84=B6=E6=96=AD=E5=BC=80?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E8=A7=A6=E5=8F=91"=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5"=E7=9A=84=E6=8F=90=E7=A4=BA=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=EF=BC=8C=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97=E4=BC=9A?= =?UTF-8?q?=E8=A2=AB"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E7=BB=99=E8=A6=86=E7=9B=96=E6=8E=89=EF=BC=8C=E8=A1=A8?= =?UTF-8?q?=E7=8E=B0=E4=B8=BA=E9=80=89=E4=B8=8D=E5=88=B0=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E7=94=A8=E4=B8=80=E4=B8=AA=E9=A1=B6=E5=B1=82?= =?UTF-8?q?=E7=9A=84=E7=A9=BAdialog=E4=BD=9C=E4=B8=BA"=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5"=E5=BC=B9=E7=AA=97=E7=9A=84=E7=88=B6?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=EF=BC=8C=E4=BD=86=E6=98=AF=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E4=BA=86=E6=8F=90=E7=A4=BA=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E4=BC=9A=E8=B7=B3=E5=87=BA"=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E4=BB=8D=E7=84=B6=E4=BC=9A=E8=A2=AB"?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E8=A6=86=E7=9B=96=EF=BC=8C=E6=89=80=E4=BB=A5=E5=B0=86"?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"?= =?UTF-8?q?=E4=B9=9F=E4=BF=AE=E6=94=B9=E4=B8=BA=E9=A1=B6=E5=B1=82=E5=BC=B9?= =?UTF-8?q?=E7=AA=97(=E5=B7=B2=E7=BB=8F=E6=B5=8B=E8=AF=95=E8=BF=87"?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9A=84=E4=BA=8C=E7=BA=A7=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=B9=B6=E4=B8=8D=E4=BC=9A=E5=9B=A0=E4=B8=BA"=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"=E5=8F=98?= =?UTF-8?q?=E6=88=90=E9=A1=B6=E5=B1=82=E5=BC=B9=E7=AA=97=E8=80=8C=E8=A2=AB?= =?UTF-8?q?=E8=A6=86=E7=9B=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 1 + .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 0ddb749269..1c05b23a5c 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -430,6 +430,7 @@ public class EnvChangeEntrance { // todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口 } }); + envListDialog.setAlwaysOnTop(true); envListDialog.setVisible(true); } 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 33b3b80f7d..48b6eec563 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 @@ -175,12 +175,16 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { + JDialog jDialog = new JDialog(); + jDialog.setAlwaysOnTop(true); + jDialog.setVisible(false); FineJOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), + jDialog, Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + jDialog.dispose(); EnvChangeEntrance.getInstance().chooseEnv(); } }); From 41940d0d812d939daf1df8158ad77762942f5d02 Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 7 Dec 2020 17:27:58 +0800 Subject: [PATCH 002/104] =?UTF-8?q?REPORT-44596=20=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A0=91=E6=8E=A7=E4=BB=B6-=E6=80=A5=E9=80=9F=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E4=BE=9D=E8=B5=96=E5=B1=82=E6=95=B0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/frpane/tree/layer/config/LayerDependenceSettingPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java index 2c0612e024..b3ad1e179a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java @@ -142,6 +142,7 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener { this.model.clear(); this.model.addAll(dependenceList); + this.model.fireTableDataChanged(); } From 972e7f8cd64a5de44a911f4e41223e80c7117265 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 14:49:20 +0800 Subject: [PATCH 003/104] =?UTF-8?q?REPORT-44581=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=96=AD=E5=BC=80=E5=90=8Emac=E9=80=89?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E5=90=AF=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=98=AF=E4=B8=80=E4=B8=AA=E9=A1=B6=E5=B1=82?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=EF=BC=8C=E5=AE=A2=E6=88=B7=E5=9C=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=BF=9D=E5=AD=98=E6=93=8D=E4=BD=9C=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E8=BF=9C=E7=A8=8B=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E7=AA=81=E7=84=B6=E6=96=AD=E5=BC=80=EF=BC=8C=E4=BC=9A=E8=A7=A6?= =?UTF-8?q?=E5=8F=91"=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5"=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97=EF=BC=8C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E4=BC=9A=E8=A2=AB"=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BF=9D=E5=AD=98"=E7=95=8C=E9=9D=A2=E7=BB=99=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E6=8E=89=EF=BC=8C=E8=A1=A8=E7=8E=B0=E4=B8=BA=E9=80=89?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=BD=93=E5=89=8D=E7=88=B6=E7=AA=97=E5=8F=A3=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E4=B8=BA"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF=E7=9A=84?= =?UTF-8?q?=E8=AF=9D=E5=B0=B1=E4=BD=9C=E4=B8=BA"=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5"=E5=BC=B9=E7=AA=97=E7=9A=84=E7=88=B6?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=EF=BC=8C=E8=80=8C=E5=9B=A0=E4=B8=BA=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E4=BA=86=E6=8F=90=E7=A4=BA=E5=A4=B1=E8=B4=A5=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E4=BC=9A=E8=B7=B3=E5=87=BA"=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E4=BB=8D=E7=84=B6=E4=BC=9A=E8=A2=AB"=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=9D=E5=AD=98"=E7=95=8C=E9=9D=A2=E8=A6=86?= =?UTF-8?q?=E7=9B=96=EF=BC=8C=E6=89=80=E4=BB=A5=E5=9C=A8"=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"=E7=95=8C?= =?UTF-8?q?=E9=9D=A2EnvChangeEntrance=E4=B8=AD=E5=A2=9E=E5=8A=A0=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E5=8F=AF=E4=BB=A5=E4=BC=A0=E5=85=A5=E7=88=B6?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=B0=86?= =?UTF-8?q?"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E4=BC=A0=E5=85=A5?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=E7=88=B6=E7=AA=97=E5=8F=A3=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E6=A0=B7=E4=B8=A4=E4=B8=AA=E7=95=8C=E9=9D=A2=E9=83=BD=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=A2=AB"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 8 ++++++-- .../main/java/com/fr/file/FILEChooserPane.java | 8 ++++++++ .../mainframe/socketio/DesignerSocketIO.java | 15 +++++++++------ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 1c05b23a5c..67e4ed905f 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -51,6 +51,7 @@ import com.fr.workspace.engine.rpc.WorkspaceProxyPool; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; +import java.awt.Window; import java.lang.reflect.Method; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -411,8 +412,12 @@ public class EnvChangeEntrance { } public void chooseEnv(final String envName) { + chooseEnv(envName, SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); + } + + public void chooseEnv(final String envName, Window window) { final EnvListPane envListPane = new EnvListPane(); - final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); + final BasicDialog envListDialog = envListPane.showWindow(window); envListPane.populateEnvManager(envName); envListDialog.addDialogActionListener(new DialogActionAdapter() { @@ -430,7 +435,6 @@ public class EnvChangeEntrance { // todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口 } }); - envListDialog.setAlwaysOnTop(true); envListDialog.setVisible(true); } diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 43c3f43ad8..382732dd97 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -1774,4 +1774,12 @@ public class FILEChooserPane extends BasicPane { } } } + + public boolean isDialogVisible() { + return dialog != null && dialog.isVisible(); + } + + public UIDialog getDialog() { + return dialog; + } } 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 48b6eec563..19754bfc4a 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 @@ -12,6 +12,7 @@ import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; +import com.fr.file.FILEChooserPane; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; @@ -27,6 +28,7 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; +import java.awt.Window; import java.util.Arrays; import javax.swing.*; import java.io.IOException; @@ -175,17 +177,18 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { - JDialog jDialog = new JDialog(); - jDialog.setAlwaysOnTop(true); - jDialog.setVisible(false); + // 因为有可能在文件保存界面的时候,弹出连接失败弹窗,为了避免二级弹窗问题,这边对父窗口做个判断 + boolean isFileChooserPaneExist = FILEChooserPane.getInstance().isDialogVisible(); + Window window = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : DesignerContext.getDesignerFrame(); FineJOptionPane.showMessageDialog( - jDialog, + window, Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); - jDialog.dispose(); - EnvChangeEntrance.getInstance().chooseEnv(); + // 紧接着弹出的选择工作环境的窗口也判断一下父窗口,否则会被文件保存界面覆盖掉 + Window window1 = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()); + EnvChangeEntrance.getInstance().chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName(), window1); } }); } catch (Exception e) { From ee982bc994f8a359fd894514e13a699d00f5e4f3 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 14 Dec 2020 16:41:55 +0800 Subject: [PATCH 004/104] merge code --- .../com/fr/design/DesignerEnvManager.java | 39 +- .../gui/icontainer/UIResizableContainer.java | 32 +- .../fr/design/mainframe/DesignerFrame.java | 4 +- .../mainframe/WestRegionContainerPane.java | 2 +- .../write/submit/DBManipulationPane.java | 1736 +++++++++-------- .../label/VanChartPlotLabelDetailPane.java | 11 +- .../submit/SmartInsertDBManipulationPane.java | 4 +- 7 files changed, 924 insertions(+), 904 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 44c0eba841..791d679b30 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -141,8 +141,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private int eastRegionToolPaneY = 300; private int eastRegionContainerWidth = 260; + private int westRegionToolPaneY = 300; private int westRegionContainerWidth = 240; - private double westRegionToolPaneYRate = 0.5; private String encryptionKey; private String jdkHome; @@ -240,7 +240,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String installHome = StableUtils.getInstallHome(); //这里不判断路径是.的情况,放在checkValid方法里面,重新选 if (installHome != null) { - String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); + String name = Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); String envPath = designerEnvManager.getDefaultenvPath(installHome); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); designerEnvManager.setCurEnvName(name); @@ -304,8 +304,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH); String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log"); - if (!new java.io.File(fileName).exists()) { - StableUtils.makesureFileExist(new java.io.File(fileName)); + if (!new File(fileName).exists()) { + StableUtils.makesureFileExist(new File(fileName)); } Handler handler = new FileHandler(fileName, true); @@ -440,12 +440,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.lastOpenFilePath = lastOpenFilePath; } + /** - * 获取西面板的上子面板的高度占容器总高度的比例 + * 得到西面板的上下子面板的高度区分 + * * @return */ - public double getLastWestRegionToolPaneYRate() { - return westRegionToolPaneYRate; + public int getLastWestRegionToolPaneY() { + return this.westRegionToolPaneY; } /** @@ -458,11 +460,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } /** - * 设置关闭设计器前,西面板的上子面板的高度占容器总高度的比例 - * @param westRegionToolPaneYRate + * 设置西面板的上下子面板的高度区分 + * + * @param toolPaneY */ - public void setLastWestRegionToolPaneYRate(double westRegionToolPaneYRate) { - this.westRegionToolPaneYRate = westRegionToolPaneYRate; + public void setLastWestRegionToolPaneY(int toolPaneY) { + this.westRegionToolPaneY = toolPaneY; } /** @@ -526,7 +529,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { return env; } } - String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); + String name = Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath); this.putEnv(name, newDefaultEnv); return newDefaultEnv; @@ -549,7 +552,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } } } - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); + return Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); } @@ -1607,8 +1610,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private void readLastWestRegionLayout(XMLableReader reader) { String tmpVal; - if ((tmpVal = reader.getAttrAsString("toolPaneYRate", null)) != null) { - this.setLastWestRegionToolPaneYRate(Double.parseDouble(tmpVal)); + if ((tmpVal = reader.getAttrAsString("toolPaneY", null)) != null) { + this.setLastWestRegionToolPaneY(Integer.parseInt(tmpVal)); } if ((tmpVal = reader.getAttrAsString("containerWidth", null)) != null) { this.setLastWestRegionContainerWidth(Integer.parseInt(tmpVal)); @@ -1640,7 +1643,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) { // marks:兼容6.1的 // marks:设置默认的目录. - String curReportServerName = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); + String curReportServerName = Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal); this.putEnv(curReportServerName, reportServer); @@ -1931,8 +1934,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private void writeLastWestRegionLayout(XMLPrintWriter writer) { writer.startTAG("LastWestRegionLayout"); - if (this.getLastWestRegionToolPaneYRate() >= 0) { - writer.attr("toolPaneYRate", this.getLastWestRegionToolPaneYRate()); + if (this.getLastWestRegionToolPaneY() >= 0) { + writer.attr("toolPaneY ", this.getLastWestRegionToolPaneY()); } if (this.getLastWestRegionContainerWidth() >= 0) { writer.attr("containerWidth", this.getLastWestRegionContainerWidth()); diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index b489504857..f3f45768f3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -44,7 +44,6 @@ public class UIResizableContainer extends JPanel { private boolean isDownPaneVisible = true ; private int paraHeight; private int parentHeight = -1; - private double toolPaneYRate; public UIResizableContainer(int direction) { this(new JPanel(), new JPanel(), direction); @@ -157,20 +156,12 @@ public class UIResizableContainer extends JPanel { return this.toolPaneY; } - /** - * 获取上子面板高度占容器总高度的比例 - * @return - */ - public double getToolPaneYRate() { - return toolPaneYRate; - } - /** * 设置关闭设计器前最新的上子面板的高度比例 - * @param toolPaneYRate + * @param toolPaneY */ - public void setLastToolPaneYRate(double toolPaneYRate) { - this.toolPaneYRate = toolPaneYRate; + public void setLastToolPaneY(int toolPaneY) { + this.toolPaneY = toolPaneY; } /** @@ -248,9 +239,10 @@ public class UIResizableContainer extends JPanel { if (parentHeight == -1) { // 初始化下parentheight,存一下当前的父容器height parentHeight = parent.getHeight(); - } else if (parentHeight != parent.getHeight() && parent.getHeight() > 0) { - // parentHeight与父容器height不等时,代表用户调整分辨率或者dpi或者容器高度发生变化了,此时调整toolPaneY - toolPaneY = Math.min((int) (parent.getHeight() * toolPaneYRate), (parent.getHeight() - toolPaneHeight)); + } + if (parentHeight != parent.getHeight() && (parent.getHeight() - toolPaneHeight) >= 0) { + // 调整toolPaneY,保证至少水平的拖拽条horizontToolPane不丢失 + toolPaneY = Math.min(toolPaneY, parent.getHeight() - toolPaneHeight); parentHeight = parent.getHeight(); } } @@ -376,7 +368,6 @@ public class UIResizableContainer extends JPanel { toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y; toolPaneY = toolPaneY < 0 ? 0 : toolPaneY; toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight() : toolPaneY - getParameterPaneHeight(); - adjustToolPaneYRate(); refreshContainer(); } }); @@ -398,10 +389,8 @@ public class UIResizableContainer extends JPanel { public void mouseClicked(MouseEvent e) { if (e.getX() <= ARROW_RANGE) { toolPaneY = 0; - UIResizableContainer.this.adjustToolPaneYRate(); } else if (e.getX() >= getWidth() - ARROW_RANGE) { toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight(); - UIResizableContainer.this.adjustToolPaneYRate(); } else { return; } @@ -562,11 +551,4 @@ public class UIResizableContainer extends JPanel { jf.setSize(500, 500); jf.setVisible(true); } - - /** - * 当toolPaneY发生变化时,也需要调整toolPaneYRate - */ - private void adjustToolPaneYRate() { - this.toolPaneYRate = ((double) toolPaneY) / this.getHeight(); - } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index a5eafa0c07..490b4e7e99 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1170,8 +1170,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); } - DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneYRate( - WestRegionContainerPane.getInstance().getToolPaneYRate()); + DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY( + WestRegionContainerPane.getInstance().getToolPaneY()); DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth( WestRegionContainerPane.getInstance().getContainerWidth()); DesignerEnvManager.getEnvManager().setLastEastRegionToolPaneY( diff --git a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java index 358fba411e..004fbd55a3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java @@ -24,7 +24,7 @@ public class WestRegionContainerPane extends UIResizableContainer { public static final WestRegionContainerPane getInstance() { if (THIS == null) { THIS = new WestRegionContainerPane(); - THIS.setLastToolPaneYRate(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneYRate()); + THIS.setLastToolPaneY(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneY()); THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth()); } return THIS; diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index ccf01dd5e8..46b11d2a89 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -53,7 +53,6 @@ import javax.swing.BorderFactory; import javax.swing.DefaultCellEditor; import javax.swing.DefaultComboBoxModel; import javax.swing.Icon; -import javax.swing.JFrame; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -74,6 +73,7 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.Image; +import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; @@ -92,136 +92,133 @@ public class DBManipulationPane extends BasicBeanPane { private static final Image ICODS_IMAGE = BaseUtils.readImage("/com/fr/web/core/css/images/icons.png"); private static final Icon HEIP_ICON = BaseUtils.createIcon(ICODS_IMAGE, 193, 1, 14, 14); private static final int DEFAULT_RETURN_VALUE = 4; - public KeyColumnNameValueTable keyColumnValuesTable; - private UIComboBox columnsComboBox; // 用于编辑ColumnName的Editor + public KeyColumnNameValueTable keyColumnValuesTable; + private UIComboBox columnsComboBox; // 用于编辑ColumnName的Editor private UICheckBox UpdateCheckBox; private JPanel checkBoxUpdatePane; - /* - * 记录当前选取的DS & Table对应的ColumnName[] - * alex:以前每当tableNameComboBox改变就刷新columnsComboBox,这样每输入一个文字就会刷一遍,很不好 - */ - private ColumnName[] currentColumnNames = null; + /* + * 记录当前选取的DS & Table对应的ColumnName[] + * alex:以前每当tableNameComboBox改变就刷新columnsComboBox,这样每输入一个文字就会刷一遍,很不好 + */ + private ColumnName[] currentColumnNames = null; - // 支持公式输入的数据表选择面板 - private ChoosePaneSupportFormula chooseTable; + // 支持公式输入的数据表选择面板 + private ChoosePaneSupportFormula chooseTable; - private UIComboBox dmlConfigComboBox = null; + private UIComboBox dmlConfigComboBox = null; - // 提交事件 - private NameSubmitJob[] jobs = null; + // 提交事件 + private NameSubmitJob[] jobs = null; - // 提交条件 - private Condition condition = null; + // 提交条件 + private Condition condition = null; - private JTree conditionsTree; + private JTree conditionsTree; - private Editor[] v_Types; + private Editor[] v_Types; - protected JavaScriptActionPane parentPane; + protected JavaScriptActionPane parentPane; - private int keyColumnWidth = 100; - private int resizeColumnCount = 4; - private int btnWidth = 110; - private int btnHeight = 20; private String subMitName; - private static final String[] DML_CONFIG_TYPES = new String[] { + private static final String[] DML_CONFIG_TYPES = new String[]{ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Smart_Submit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Delete_Submit"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Insert_Submit"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Insert_Submit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Update_Submit")}; - /** - * 无单元格。没有智能添加单元格等按钮 - * 有单元格的参见其子类SmartInsertDBManipulationPane - */ - public DBManipulationPane() { - this(ValueEditorPaneFactory.extendedCellGroupEditors()); - } + /** + * 无单元格。没有智能添加单元格等按钮 + * 有单元格的参见其子类SmartInsertDBManipulationPane + */ + public DBManipulationPane() { + this(ValueEditorPaneFactory.extendedCellGroupEditors()); + } - public DBManipulationPane(Editor[] v_Types) { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.v_Types = v_Types; + public DBManipulationPane(Editor[] v_Types) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.v_Types = v_Types; - JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.add(northPane, BorderLayout.NORTH); + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.add(northPane, BorderLayout.NORTH); - dmlConfigComboBox = new UIComboBox(DML_CONFIG_TYPES); + dmlConfigComboBox = new UIComboBox(DML_CONFIG_TYPES); - JPanel typePane = GUICoreUtils.createFlowPane(new Component[] { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type") + ":"), dmlConfigComboBox }, - FlowLayout.LEFT, 10); - typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))); - northPane.add(typePane, BorderLayout.NORTH); + JPanel typePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type") + ":"), dmlConfigComboBox}, + FlowLayout.LEFT, 10); + typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))); + northPane.add(typePane, BorderLayout.NORTH); - chooseTable = new ChoosePaneSupportFormula(); - chooseTable.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table"))); - chooseTable.setTableNameComboBoxPopSize(160, 320); + chooseTable = new ChoosePaneSupportFormula(); + chooseTable.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table"))); + chooseTable.setTableNameComboBoxPopSize(160, 320); - northPane.add(chooseTable, BorderLayout.CENTER); + northPane.add(chooseTable, BorderLayout.CENTER); - // peter:编辑的TablePane - JPanel editTablePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.add(editTablePane, BorderLayout.CENTER); - editTablePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))); + // peter:编辑的TablePane + JPanel editTablePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.add(editTablePane, BorderLayout.CENTER); + editTablePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))); - keyColumnValuesTable = new KeyColumnNameValueTable(); - editTablePane.add(new JScrollPane(this.keyColumnValuesTable), BorderLayout.CENTER); - keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - keyColumnValuesTable.setPreferredScrollableViewportSize(new Dimension(280, 180)); - keyColumnValuesTable.setShowHorizontalLines(true); + keyColumnValuesTable = new KeyColumnNameValueTable(); + editTablePane.add(new JScrollPane(this.keyColumnValuesTable), BorderLayout.CENTER); + keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + keyColumnValuesTable.setPreferredScrollableViewportSize(new Dimension(280, 180)); + keyColumnValuesTable.setShowHorizontalLines(true); - initJTableColumn(); + initJTableColumn(); - addButtons(editTablePane); + addButtons(editTablePane); - addBottomPane(); + addBottomPane(); - addListeners(); - } + addListeners(); + } - public void setSubMitName(String subMitName){ + public void setSubMitName(String subMitName) { this.subMitName = subMitName; } - public String getSubMitName(){ + public String getSubMitName() { return this.subMitName; } - private void addButtons(JPanel editTablePane) { - // alex:添加操作按钮 - UpdateAction[] actions = this.getActions(); - if (actions != null && actions.length > 0) { - JPanel controlBtnPane = new JPanel(new GridLayout(actions.length + 1, 1, 4, 4)); - editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.EAST); + private void addButtons(JPanel editTablePane) { + // alex:添加操作按钮 + UpdateAction[] actions = this.getActions(); + if (actions != null && actions.length > 0) { + JPanel controlBtnPane = new JPanel(new GridLayout(actions.length + 1, 1, 4, 4)); + editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.EAST); - for (int i = 0; i < actions.length; i++) { - controlBtnPane.add(new UIButton(actions[i])); - } + for (UpdateAction action : actions) { + controlBtnPane.add(new UIButton(action)); + } checkBoxUpdatePane = new JPanel(new BorderLayout(0, 0)); - checkBoxUpdatePane.setPreferredSize(new Dimension(120,20)); + checkBoxUpdatePane.setPreferredSize(new Dimension(120, 20)); controlBtnPane.add(checkBoxUpdatePane); UpdateCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_NotChange_Unmodified")); - UIButton helpButton = new UIButton(HEIP_ICON); + UIButton helpButton = new UIButton(HEIP_ICON); helpButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Help")); helpButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - FormatExplanationPane formatExplanation = new FormatExplanationPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Help"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Help"), 12f); + FormatExplanationPane formatExplanation = new FormatExplanationPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Help"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Help"), 12f); BasicDialog dlg = formatExplanation.showMediumWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), - new DialogActionAdapter(){}); + new DialogActionAdapter() { + }); dlg.setVisible(true); } }); helpButton.set4ToolbarButton(); - checkBoxUpdatePane.add(UpdateCheckBox,BorderLayout.WEST); - checkBoxUpdatePane.add(helpButton,BorderLayout.EAST); - } - } - - protected void updateUpdateCheckBoxEnable(){ - KeyColumnTableModel model = (KeyColumnTableModel)keyColumnValuesTable.getModel(); - if (model.getRowCount() == 0){ + checkBoxUpdatePane.add(UpdateCheckBox, BorderLayout.WEST); + checkBoxUpdatePane.add(helpButton, BorderLayout.EAST); + } + } + + protected void updateUpdateCheckBoxEnable() { + KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); + if (model.getRowCount() == 0) { setUpdateCheckBoxEnable(false); UpdateCheckBox.setSelected(true); return; @@ -230,9 +227,8 @@ public class DBManipulationPane extends BasicBeanPane { for (int i = 0; i < model.getRowCount(); i++) { columnObjects.add(model.getKeyColumnNameValue(i).cv.getObj()); } - for (int i = 0;i < columnObjects.size();i++){ - Object ob = columnObjects.get(i) ; - if (!( ob instanceof ColumnRow || ob instanceof ColumnRowGroup)){ + for (Object ob : columnObjects) { + if (!(ob instanceof ColumnRow || ob instanceof ColumnRowGroup)) { setUpdateCheckBoxEnable(false); UpdateCheckBox.setSelected(false); return; @@ -241,236 +237,241 @@ public class DBManipulationPane extends BasicBeanPane { setUpdateCheckBoxEnable(true); } - private void setUpdateCheckBoxEnable( boolean b){ + private void setUpdateCheckBoxEnable(boolean b) { UpdateCheckBox.setEnabled(b); } - private void addBottomPane() { - JPanel eventPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - eventPane.add(addEventButton()); + private void addBottomPane() { + JPanel eventPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + eventPane.add(addEventButton()); - JPanel conditionPane = this.createConditionPane(); + JPanel conditionPane = this.createConditionPane(); - JPanel btPane =new JPanel( FRGUIPaneFactory.createBorderLayout()); - btPane.add(eventPane,BorderLayout.CENTER); - btPane.add(conditionPane,BorderLayout.NORTH); - this.add(btPane, BorderLayout.SOUTH); - } + JPanel btPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); + btPane.add(eventPane, BorderLayout.CENTER); + btPane.add(conditionPane, BorderLayout.NORTH); + this.add(btPane, BorderLayout.SOUTH); + } - private UIButton addEventButton() { - UIButton addSubmitEventButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Event")); - addSubmitEventButton.addActionListener(new ActionListener() { + private UIButton addEventButton() { + UIButton addSubmitEventButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Event")); + addSubmitEventButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - final SubmitJobListPane jobsPane = createSubmitJobListPane(); + @Override + public void actionPerformed(ActionEvent e) { + final SubmitJobListPane jobsPane = createSubmitJobListPane(); - jobsPane.populate(jobs); - BasicDialog dialog = jobsPane.showWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { - @Override - public void doOk() { - super.doOk(); - jobs = jobsPane.updateDBManipulation(); - } - }); - dialog.setVisible(true); - } + jobsPane.populate(jobs); + BasicDialog dialog = jobsPane.showWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { + @Override + public void doOk() { + super.doOk(); + jobs = jobsPane.updateDBManipulation(); + } + }); + dialog.setVisible(true); + } - }); - return addSubmitEventButton; - } + }); + return addSubmitEventButton; + } - private JPanel createConditionPane() { - JPanel conditionPane = new JPanel(); - conditionPane.setPreferredSize(createConditionPanePreferredSize()); + private JPanel createConditionPane() { + JPanel conditionPane = new JPanel(); + conditionPane.setPreferredSize(createConditionPanePreferredSize()); setBorderAndLayout(conditionPane); - conditionsTree = new JTree(new DefaultTreeModel(new ExpandMutableTreeNode())); - conditionsTree.setRootVisible(false); - conditionsTree.setShowsRootHandles(true); - conditionsTree.setBackground(UIConstants.NORMAL_BACKGROUND); - conditionsTree.setForeground(UIConstants.NORMAL_BACKGROUND); - DefaultTreeCellRenderer cr = (DefaultTreeCellRenderer) conditionsTree.getCellRenderer(); - cr.setForeground(UIConstants.NORMAL_BACKGROUND); - JScrollPane jp = new JScrollPane(conditionsTree); - addComponent(conditionPane,jp); - - UIButton addSubmitConditionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition")); - addSubmitConditionButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - final DSColumnLiteConditionPane conditionPane = new DSColumnLiteConditionPane() { - @Override - protected boolean isNeedDoWithCondition(Condition liteCondition) { - return liteCondition != null; - } - }; - String[] columns = chooseTable.currentColumnNames(); - if (columns != null && columns.length > 0) { - conditionPane.populateColumns(chooseTable.currentColumnNames()); - } - - conditionPane.populateBean(condition); - BasicDialog dialog = conditionPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { - @Override - public void doOk() { - super.doOk(); - condition = conditionPane.updateBean(); - refreshConditionList(); - } - }); - dialog.setVisible(true); - } - }); - - JPanel controlBtnPane = new JPanel(new GridLayout(1, 1, 4, 4)); + conditionsTree = new JTree(new DefaultTreeModel(new ExpandMutableTreeNode())); + conditionsTree.setRootVisible(false); + conditionsTree.setShowsRootHandles(true); + conditionsTree.setBackground(UIConstants.NORMAL_BACKGROUND); + conditionsTree.setForeground(UIConstants.NORMAL_BACKGROUND); + DefaultTreeCellRenderer cr = (DefaultTreeCellRenderer) conditionsTree.getCellRenderer(); + cr.setForeground(UIConstants.NORMAL_BACKGROUND); + JScrollPane jp = new JScrollPane(conditionsTree); + addComponent(conditionPane, jp); + + UIButton addSubmitConditionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition")); + addSubmitConditionButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + final DSColumnLiteConditionPane conditionPane = new DSColumnLiteConditionPane() { + @Override + protected boolean isNeedDoWithCondition(Condition liteCondition) { + return liteCondition != null; + } + }; + String[] columns = chooseTable.currentColumnNames(); + if (columns != null && columns.length > 0) { + conditionPane.populateColumns(chooseTable.currentColumnNames()); + } + + conditionPane.populateBean(condition); + BasicDialog dialog = conditionPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + super.doOk(); + condition = conditionPane.updateBean(); + refreshConditionList(); + } + }); + dialog.setVisible(true); + } + }); + + JPanel controlBtnPane = new JPanel(new GridLayout(1, 1, 4, 4)); controlBtnPane.setPreferredSize(createControlBtnPanePreferredSize()); - conditionPane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH),setControlBtnPanePosition()); - controlBtnPane.add(addSubmitConditionButton); + conditionPane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), setControlBtnPanePosition()); + controlBtnPane.add(addSubmitConditionButton); - return conditionPane; - } + return conditionPane; + } - protected void setBorderAndLayout(JPanel jPanel){ + protected void setBorderAndLayout(JPanel jPanel) { jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); jPanel.setBorder(BorderFactory.createTitledBorder( - new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition"))); + new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition"))); } - protected void addComponent(JPanel mainPane,JScrollPane addPane){ - mainPane.add(addPane,BorderLayout.CENTER); + protected void addComponent(JPanel mainPane, JScrollPane addPane) { + mainPane.add(addPane, BorderLayout.CENTER); } - protected Dimension createConditionPanePreferredSize(){ + protected Dimension createConditionPanePreferredSize() { return new Dimension(454, 80); } - protected Dimension createControlBtnPanePreferredSize(){ + protected Dimension createControlBtnPanePreferredSize() { return new Dimension(110, 20); } - protected String setControlBtnPanePosition(){ - return BorderLayout.EAST; + protected String setControlBtnPanePosition() { + return BorderLayout.EAST; + } + + private void refreshConditionList() { + DefaultTreeModel defaultTreeModel = (DefaultTreeModel) conditionsTree.getModel(); + ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) defaultTreeModel.getRoot(); + rootTreeNode.setUserObject(new JoinCondition(DataConstants.AND, new ListCondition())); + rootTreeNode.removeAllChildren(); + Condition liteCondition = this.condition == null ? new ListCondition() : this.condition; + if (liteCondition instanceof ListCondition) { + ListCondition listCondition = (ListCondition) liteCondition; + int joinConditionCount = listCondition.getJoinConditionCount(); + for (int i = 0; i < joinConditionCount; i++) { + addLiteConditionToListCondition(rootTreeNode, listCondition.getJoinCondition(i)); + } + } else { + ExpandMutableTreeNode newTreeNode = new ExpandMutableTreeNode(new JoinCondition(DataConstants.AND, liteCondition)); + rootTreeNode.add(newTreeNode); + } + defaultTreeModel.reload(rootTreeNode); + rootTreeNode.expandCurrentTreeNode(conditionsTree); + } + + private void addLiteConditionToListCondition(ExpandMutableTreeNode parentTreeNode, JoinCondition joinCondition) { + ExpandMutableTreeNode newTreeNode = new ExpandMutableTreeNode(joinCondition); + parentTreeNode.add(newTreeNode); + Condition liteCondition = joinCondition.getCondition(); + if (liteCondition instanceof ListCondition) { + ListCondition listCondition = (ListCondition) liteCondition; + int joinConditionCount = listCondition.getJoinConditionCount(); + for (int i = 0; i < joinConditionCount; i++) { + addLiteConditionToListCondition(newTreeNode, listCondition.getJoinCondition(i)); + } + } + } + + private void addListeners() { + dmlConfigComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + Object ob = e.getItem(); + if ((ComparatorUtils.equals(ob, DML_CONFIG_TYPES[0])) || ComparatorUtils.equals(ob, DML_CONFIG_TYPES[3])) { + checkBoxUpdatePane.setVisible(true); + } else if ((ComparatorUtils.equals(ob, DML_CONFIG_TYPES[1])) || ComparatorUtils.equals(ob, DML_CONFIG_TYPES[2])) { + checkBoxUpdatePane.setVisible(false); + } + } + } + }); + + /* + * 当DS & Table改变时要刷新ColumnsComboBox.model,不能用ItemListener, + * 因为tableNameComboBox是可以编辑的,每写一个文字就要连,太频繁了 + * 也不能在tableNameComboBox.focusLost事件时,好像没用 + */ + keyColumnValuesTable.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(FocusEvent e) { + refreshColumnsComboBox(); + } + + }); + } + + protected UpdateAction[] getActions() { + return new UpdateAction[]{new SmartAddFieldsAction(), new AddFieldAction(), new RemoveFieldAction()}; + } + + protected SubmitJobListPane createSubmitJobListPane() { + return new SubmitJobListPane(); + } + + public void setParentJavaScriptActionPane(JavaScriptActionPane jsPane) { + this.parentPane = jsPane; + } + + @Override + protected String title4PopupWindow() { + return "DB"; } - private void refreshConditionList() { - DefaultTreeModel defaultTreeModel = (DefaultTreeModel) conditionsTree.getModel(); - ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) defaultTreeModel.getRoot(); - rootTreeNode.setUserObject(new JoinCondition(DataConstants.AND, new ListCondition())); - rootTreeNode.removeAllChildren(); - Condition liteCondition = this.condition == null ? new ListCondition() : this.condition; - if (liteCondition instanceof ListCondition) { - ListCondition listCondition = (ListCondition) liteCondition; - int joinConditionCount = listCondition.getJoinConditionCount(); - for (int i = 0; i < joinConditionCount; i++) { - addLiteConditionToListCondition(rootTreeNode, listCondition.getJoinCondition(i)); - } - } else { - ExpandMutableTreeNode newTreeNode = new ExpandMutableTreeNode(new JoinCondition(DataConstants.AND, liteCondition)); - rootTreeNode.add(newTreeNode); - } - defaultTreeModel.reload(rootTreeNode); - rootTreeNode.expandCurrentTreeNode(conditionsTree); - } - - private void addLiteConditionToListCondition(ExpandMutableTreeNode parentTreeNode, JoinCondition joinCondition) { - ExpandMutableTreeNode newTreeNode = new ExpandMutableTreeNode(joinCondition); - parentTreeNode.add(newTreeNode); - Condition liteCondition = joinCondition.getCondition(); - if (liteCondition instanceof ListCondition) { - ListCondition listCondition = (ListCondition) liteCondition; - int joinConditionCount = listCondition.getJoinConditionCount(); - for (int i = 0; i < joinConditionCount; i++) { - addLiteConditionToListCondition(newTreeNode, listCondition.getJoinCondition(i)); - } - } - } - - private void addListeners() { - dmlConfigComboBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { - Object ob = e.getItem(); - if ((ComparatorUtils.equals(ob, DML_CONFIG_TYPES[0])) || ComparatorUtils.equals(ob, DML_CONFIG_TYPES[3])) { - checkBoxUpdatePane.setVisible(true); - } else if ((ComparatorUtils.equals(ob, DML_CONFIG_TYPES[1])) || ComparatorUtils.equals(ob, DML_CONFIG_TYPES[2])) { - checkBoxUpdatePane.setVisible(false); - } - } - } - }); - - /* - * 当DS & Table改变时要刷新ColumnsComboBox.model,不能用ItemListener, - * 因为tableNameComboBox是可以编辑的,每写一个文字就要连,太频繁了 - * 也不能在tableNameComboBox.focusLost事件时,好像没用 - */ - keyColumnValuesTable.addFocusListener(new FocusAdapter() { - - public void focusGained(FocusEvent e) { - refreshColumnsComboBox(); - } - - }); - } - - protected UpdateAction[] getActions() { - return new UpdateAction[] { new SmartAddFieldsAction(), new AddFieldAction(), new RemoveFieldAction() }; - } - - protected SubmitJobListPane createSubmitJobListPane() { - return new SubmitJobListPane(); - } - - public void setParentJavaScriptActionPane(JavaScriptActionPane jsPane) { - this.parentPane = jsPane; - } - - @Override - protected String title4PopupWindow() { - return "DB"; - } - - protected class SmartAddFieldsAction extends UpdateAction { - public SmartAddFieldsAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields")); - } - - public void actionPerformed(ActionEvent evt) { - - BasicPane bPane = new BasicPane() { - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields"); - } - }; - bPane.setLayout(FRGUIPaneFactory.createBorderLayout()); - - final CheckBoxList list = new CheckBoxList(currentColumnNames(), CheckBoxList.SelectedState.ALL, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Chart_Field_Name")) { - public String value2Text(Object value) { - if (value instanceof ColumnName) { - return ((ColumnName)value).name; - } - - return super.value2Text(value); - } - }; - bPane.add(new JScrollPane(list), BorderLayout.CENTER); - - BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { - public void doOk() { - addFields(list); + protected class SmartAddFieldsAction extends UpdateAction { + public SmartAddFieldsAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + + BasicPane bPane = new BasicPane() { + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields"); + } + }; + bPane.setLayout(FRGUIPaneFactory.createBorderLayout()); + + final CheckBoxList list = new CheckBoxList(currentColumnNames(), CheckBoxList.SelectedState.ALL, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Chart_Field_Name")) { + @Override + public String value2Text(Object value) { + if (value instanceof ColumnName) { + return ((ColumnName) value).name; + } + + return super.value2Text(value); + } + }; + bPane.add(new JScrollPane(list), BorderLayout.CENTER); + + BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { + @Override + public void doOk() { + addFields(list); updateUpdateCheckBoxEnable(); - } - }); - dlg.setVisible(true); - } - } - - private void addFields (CheckBoxList list) { - KeyColumnTableModel model = (KeyColumnTableModel)keyColumnValuesTable.getModel(); + } + }); + dlg.setVisible(true); + } + } + + private void addFields(CheckBoxList list) { + KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); List keyColumnNameValueList = new ArrayList(); keyColumnNameValueList.clear(); for (int i = 0; i < model.getRowCount(); i++) { @@ -481,28 +482,28 @@ public class DBManipulationPane extends BasicBeanPane { // Richie:用了存储新的KeyColumnNameValue的List. List newKeyColumnNameValueList = new ArrayList(); if (!keyColumnNameValueList.isEmpty()) { - for (int i = 0; i < selected.length; i++) { + for (Object o : selected) { // Richie:先填上空的. - newKeyColumnNameValueList.add(new KeyColumnNameValue(false, (ColumnName)selected[i], new ColumnValue(""), false)); + newKeyColumnNameValueList.add(new KeyColumnNameValue(false, (ColumnName) o, new ColumnValue(""), false)); } } // Richie:初始化 int returnValue = DEFAULT_RETURN_VALUE; int coverNumber = 0; - if (!keyColumnNameValueList.isEmpty()) { - //如果存在先前项,设置状态为5 - returnValue = 5 ; - } + if (!keyColumnNameValueList.isEmpty()) { + //如果存在先前项,设置状态为5 + returnValue = 5; + } for (int i = 0; i < selected.length; i++) { if (returnValue == 0 || returnValue == 3) { break; } - for (int j = 0; j < keyColumnNameValueList.size(); j++) { - if (ComparatorUtils.equals(selected[i], keyColumnNameValueList.get(j).cn)) { - Object[] options = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Covered_All"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Yes"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_None") }; + for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { + if (ComparatorUtils.equals(selected[i], keyColumnNameValue.cn)) { + Object[] options = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Covered_All"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Yes"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_None")}; returnValue = JOptionPane.showOptionDialog(DBManipulationPane.this, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_Tips", keyColumnNameValueList.get(j).cn.name), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_Tips", keyColumnNameValue.cn.name), "", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]); // Richie:全部覆盖 if (returnValue == 0) { @@ -514,7 +515,7 @@ public class DBManipulationPane extends BasicBeanPane { } else if (returnValue == 2) { coverNumber = i; newKeyColumnNameValueList.remove(i); - newKeyColumnNameValueList.add(i, keyColumnNameValueList.get(j)); + newKeyColumnNameValueList.add(i, keyColumnNameValue); // Richie:全部不覆盖 } else if (returnValue == 3) { coverNumber = i; @@ -526,7 +527,7 @@ public class DBManipulationPane extends BasicBeanPane { checkTableModel(returnValue, coverNumber, model, selected, keyColumnNameValueList, newKeyColumnNameValueList); } - private void checkTableModel (int returnValue, int coverNumber, KeyColumnTableModel model, Object[] selected, List keyColumnNameValueList, List newKeyColumnNameValueList) { + private void checkTableModel(int returnValue, int coverNumber, KeyColumnTableModel model, Object[] selected, List keyColumnNameValueList, List newKeyColumnNameValueList) { if (returnValue == 0) { model.removeAllKeyColumnNameValue(); // Richie:全部覆盖,按selected的长度添加默认的行 @@ -538,10 +539,10 @@ public class DBManipulationPane extends BasicBeanPane { model.removeAllKeyColumnNameValue(); // Richie:全部不覆盖,已经存在的就保留,不存在的添加默认行 for (int i = coverNumber; i < selected.length; i++) { - for (int j = 0; j < keyColumnNameValueList.size(); j++) { - if (ComparatorUtils.equals(selected[i], keyColumnNameValueList.get(j).cn)) { + for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { + if (ComparatorUtils.equals(selected[i], keyColumnNameValue.cn)) { newKeyColumnNameValueList.remove(i); - newKeyColumnNameValueList.add(i, keyColumnNameValueList.get(j)); + newKeyColumnNameValueList.add(i, keyColumnNameValue); } } @@ -552,610 +553,637 @@ public class DBManipulationPane extends BasicBeanPane { } } else if (returnValue == 1 || returnValue == 2) { - for (int i = 0; i < selected.length; i++) { - model.addKeyColumnNameValue(newKeyColumnNameValueList.get(i)); - } - } else if (returnValue == 5){ - //新选项和原来没有重复项的情况,产品确认:只做全量增加,原有的清除 - for (int i = 0; i < selected.length; i++) { - model.addKeyColumnNameValue(newKeyColumnNameValueList.get(i)); - } - } + for (int i = 0; i < selected.length; i++) { + model.addKeyColumnNameValue(newKeyColumnNameValueList.get(i)); + } + } else if (returnValue == 5) { + //新选项和原来没有重复项的情况,产品确认:只做全量增加,原有的清除 + for (int i = 0; i < selected.length; i++) { + model.addKeyColumnNameValue(newKeyColumnNameValueList.get(i)); + } + } // Richie:初始化 if (keyColumnNameValueList.isEmpty()) { model.removeAllKeyColumnNameValue(); - for (int i = 0; i < selected.length; i++) { - model.addKeyColumnNameValue(new KeyColumnNameValue(false, (ColumnName)selected[i], new ColumnValue(""), false)); + for (Object o : selected) { + model.addKeyColumnNameValue(new KeyColumnNameValue(false, (ColumnName) o, new ColumnValue(""), false)); } } - + model.fireTableDataChanged(); keyColumnValuesTable.validate(); } - protected class AddFieldAction extends UpdateAction { - public AddFieldAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Add_Field")); - } + protected class AddFieldAction extends UpdateAction { + public AddFieldAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Add_Field")); + } - public void actionPerformed(ActionEvent e) { + @Override + public void actionPerformed(ActionEvent e) { - KeyColumnTableModel model = (KeyColumnTableModel)keyColumnValuesTable.getModel(); + KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); - model.addKeyColumnNameValue(new KeyColumnNameValue(false, new ColumnName(""), new ColumnValue(""), false)); + model.addKeyColumnNameValue(new KeyColumnNameValue(false, new ColumnName(""), new ColumnValue(""), false)); updateUpdateCheckBoxEnable(); - model.fireTableDataChanged(); - - keyColumnValuesTable.getSelectionModel().setSelectionInterval(model.getRowCount() - 1, model.getRowCount() - 1); - } - } - - protected class RemoveFieldAction extends UpdateAction { - public RemoveFieldAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Remove_Field")); - } - - public void actionPerformed(ActionEvent evt) { - // DBManipulationPane target = this.getDBManipulationPane(); - - int[] selectedRows = keyColumnValuesTable.getSelectedRows(); - if (selectedRows == null || selectedRows.length == 0) { - return; - } - - int returnVal = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(DBManipulationPane.this), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_sure_remove_item") + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Remove"), JOptionPane.OK_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE); - if (returnVal == JOptionPane.OK_OPTION) { - KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel)keyColumnValuesTable.getModel(); - - // 把selectedRows从小到大排个序,先删大的再删小的 - java.util.Arrays.sort(selectedRows); - for (int i = selectedRows.length - 1; i >= 0; i--) { - keyColumnNameValueTableModel.removeKeyColumnNameValue(selectedRows[i]); - } + model.fireTableDataChanged(); + + keyColumnValuesTable.getSelectionModel().setSelectionInterval(model.getRowCount() - 1, model.getRowCount() - 1); + } + } + + protected class RemoveFieldAction extends UpdateAction { + public RemoveFieldAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Remove_Field")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + // DBManipulationPane target = this.getDBManipulationPane(); + + int[] selectedRows = keyColumnValuesTable.getSelectedRows(); + if (selectedRows == null || selectedRows.length == 0) { + return; + } + + int returnVal = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(DBManipulationPane.this), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_sure_remove_item") + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Remove"), JOptionPane.OK_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE); + if (returnVal == JOptionPane.OK_OPTION) { + KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel) keyColumnValuesTable.getModel(); + + // 把selectedRows从小到大排个序,先删大的再删小的 + java.util.Arrays.sort(selectedRows); + for (int i = selectedRows.length - 1; i >= 0; i--) { + keyColumnNameValueTableModel.removeKeyColumnNameValue(selectedRows[i]); + } updateUpdateCheckBoxEnable(); - keyColumnNameValueTableModel.fireTableDataChanged(); - - // select other one. - if (keyColumnNameValueTableModel.getRowCount() > selectedRows[0]) { - keyColumnValuesTable.getSelectionModel().setSelectionInterval(selectedRows[0], selectedRows[0]); - } else if (keyColumnNameValueTableModel.getRowCount() > 0) { - keyColumnValuesTable.getSelectionModel().setSelectionInterval(0, 0); - } - } - } - } - - /* - * 刷新columnsComboBox - */ - private void refreshColumnsComboBox() { - DefaultComboBoxModel model = (DefaultComboBoxModel)this.columnsComboBox.getModel(); - model.removeAllElements(); - - ColumnName[] columnNames = currentColumnNames(); - for (int i = 0; i < columnNames.length; i++) { - model.addElement(columnNames[i]); - } - } - - // 得到当前的ColumnName[] - private ColumnName[] currentColumnNames() { - // ben:清除原有的 - if (currentColumnNames != null) { - currentColumnNames = null; - } - String[] colNames = this.chooseTable.currentColumnNames(); - int len = colNames.length; - currentColumnNames = new ColumnName[len]; - for (int i = 0; i < len; i++) { - currentColumnNames[i] = new ColumnName(colNames[i]); - } - return currentColumnNames; - } - - /* - * 设置JTable的Column - */ - private void initJTableColumn() { - TableColumn column0 = this.keyColumnValuesTable.getColumnModel().getColumn(0); - column0.setMaxWidth(50); - - TableColumn column1 = this.keyColumnValuesTable.getColumnModel().getColumn(1); - column1.setCellRenderer(new ColumnNameTableCellRenderer()); - - TableColumn column2 = this.keyColumnValuesTable.getColumnModel().getColumn(2); - column2.setCellRenderer(new ColumnValueTableCellRenderer()); - - // 设置column1的editor - columnsComboBox = new UIComboBox(new DefaultComboBoxModel()); - columnsComboBox.setRenderer(new UIComboBoxRenderer() { - - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof ColumnName) { - this.setText(((ColumnName)value).name); - } - - return this; - } - - }); - column1.setCellEditor(new DefaultCellEditor(columnsComboBox) { - public boolean stopCellEditing() { - if (super.stopCellEditing()) { - return true; - } - - return false; - } - }); - ((DefaultCellEditor)column1.getCellEditor()).setClickCountToStart(2); - - //设置Column 2的Editor - column2.setCellEditor(new ColumnValueEditor()); - } - - public void populateBean(DBManipulation dbManipulation) { - if (dbManipulation == null) { - dbManipulation = new DBManipulation(); - } + keyColumnNameValueTableModel.fireTableDataChanged(); + + // select other one. + if (keyColumnNameValueTableModel.getRowCount() > selectedRows[0]) { + keyColumnValuesTable.getSelectionModel().setSelectionInterval(selectedRows[0], selectedRows[0]); + } else if (keyColumnNameValueTableModel.getRowCount() > 0) { + keyColumnValuesTable.getSelectionModel().setSelectionInterval(0, 0); + } + } + } + } + + /* + * 刷新columnsComboBox + */ + private void refreshColumnsComboBox() { + DefaultComboBoxModel model = (DefaultComboBoxModel) this.columnsComboBox.getModel(); + model.removeAllElements(); + + ColumnName[] columnNames = currentColumnNames(); + for (ColumnName columnName : columnNames) { + model.addElement(columnName); + } + } + + // 得到当前的ColumnName[] + private ColumnName[] currentColumnNames() { + // ben:清除原有的 + if (currentColumnNames != null) { + currentColumnNames = null; + } + String[] colNames = this.chooseTable.currentColumnNames(); + int len = colNames.length; + currentColumnNames = new ColumnName[len]; + for (int i = 0; i < len; i++) { + currentColumnNames[i] = new ColumnName(colNames[i]); + } + return currentColumnNames; + } + + /* + * 设置JTable的Column + */ + private void initJTableColumn() { + TableColumn column0 = this.keyColumnValuesTable.getColumnModel().getColumn(0); + column0.setMaxWidth(50); + + TableColumn column1 = this.keyColumnValuesTable.getColumnModel().getColumn(1); + column1.setCellRenderer(new ColumnNameTableCellRenderer()); + + TableColumn column2 = this.keyColumnValuesTable.getColumnModel().getColumn(2); + column2.setCellRenderer(new ColumnValueTableCellRenderer()); + + // 设置column1的editor + columnsComboBox = new UIComboBox(new DefaultComboBoxModel()); + columnsComboBox.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 ColumnName) { + this.setText(((ColumnName) value).name); + } + + return this; + } + + }); + column1.setCellEditor(new DefaultCellEditor(columnsComboBox) { + @Override + public boolean stopCellEditing() { + return super.stopCellEditing(); + } + }); + ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2); + + //设置Column 2的Editor + column2.setCellEditor(new ColumnValueEditor()); + } + + @Override + public void populateBean(DBManipulation dbManipulation) { + if (dbManipulation == null) { + dbManipulation = new DBManipulation(); + } subMitName = dbManipulation.getName(); - DMLConfig dmlConfig = dbManipulation.getDmlConfig(); - - if (dmlConfig != null) { - if (dmlConfig instanceof IntelliDMLConfig) { - dmlConfigComboBox.setSelectedIndex(0); - } else if (dmlConfig instanceof DeleteConfig) { - dmlConfigComboBox.setSelectedIndex(1); - } else if (dmlConfig instanceof InsertConfig) { - dmlConfigComboBox.setSelectedIndex(2); - } else if (dmlConfig instanceof UpdateConfig) { - dmlConfigComboBox.setSelectedIndex(3); - } else { - dmlConfigComboBox.setSelectedIndex(0); - } - jobs = new NameSubmitJob[dmlConfig.getSubmitJobCount()]; - for (int i = 0; i < jobs.length; i++) { - jobs[i] = dmlConfig.getNameSubmitJob(i); - } - condition = dmlConfig.getCondition(); + DMLConfig dmlConfig = dbManipulation.getDmlConfig(); + + if (dmlConfig != null) { + if (dmlConfig instanceof IntelliDMLConfig) { + dmlConfigComboBox.setSelectedIndex(0); + } else if (dmlConfig instanceof DeleteConfig) { + dmlConfigComboBox.setSelectedIndex(1); + } else if (dmlConfig instanceof InsertConfig) { + dmlConfigComboBox.setSelectedIndex(2); + } else if (dmlConfig instanceof UpdateConfig) { + dmlConfigComboBox.setSelectedIndex(3); + } else { + dmlConfigComboBox.setSelectedIndex(0); + } + jobs = new NameSubmitJob[dmlConfig.getSubmitJobCount()]; + for (int i = 0; i < jobs.length; i++) { + jobs[i] = dmlConfig.getNameSubmitJob(i); + } + condition = dmlConfig.getCondition(); UpdateCheckBox.setSelected(dmlConfig.isUpdateSelected()); - } else { - jobs = null; - condition = null; - dmlConfigComboBox.setSelectedIndex(0); + } else { + jobs = null; + condition = null; + dmlConfigComboBox.setSelectedIndex(0); UpdateCheckBox.setSelected(false); - } + } - String schema = null; - String tableName = null; + String schema = null; + String tableName = null; Table table = null; - if (dmlConfig != null && dmlConfig.getOriTable() != null) { + if (dmlConfig != null && dmlConfig.getOriTable() != null) { table = dmlConfig.getOriTable(); if (table != null) { schema = table.getSchema(); tableName = table.getName(); } } - chooseTable.populateBean(new DataBaseItems(dbManipulation.getDBName(), schema, tableName)); + chooseTable.populateBean(new DataBaseItems(dbManipulation.getDBName(), schema, tableName)); - populateKeyColumnValueTable(dmlConfig); + populateKeyColumnValueTable(dmlConfig); updateUpdateCheckBoxEnable(); - refreshConditionList(); - } - - private void populateKeyColumnValueTable(DMLConfig dmlConfig) { - KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel)this.keyColumnValuesTable.getModel(); - keyColumnNameValueTableModel.removeAllKeyColumnNameValue(); - - if (dmlConfig != null) { - boolean acceptPara = false; - for (int i = 0; i < v_Types.length; i++) { - if (v_Types[i].accept(new Parameter())) { - acceptPara = true; - break; - } - } - for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) { - ColumnConfig column = dmlConfig.getColumnConfig(i); - String columnName = column.getColumnName(); - if (!acceptPara && column.getColumnValue() instanceof Parameter) { - // 表单中,将以前的参数转换为公式 - column.setColumnValue(BaseFormula.createFormulaBuilder().build(((Parameter)column.getColumnValue()).getName())); - } - - KeyColumnNameValue newColumnNameValue = new KeyColumnNameValue(column.isKey(), new ColumnName(columnName), new ColumnValue(column.getColumnValue()), - column.isSkipUnmodified()); - keyColumnNameValueTableModel.addKeyColumnNameValue(newColumnNameValue); - } - } - keyColumnNameValueTableModel.fireTableDataChanged(); - - // 选择第一个 - if (keyColumnNameValueTableModel.getRowCount() > 0) { - keyColumnValuesTable.getSelectionModel().setSelectionInterval(0, 0); - } - } - - public DBManipulation updateBean() { - DataBaseItems para = chooseTable.updateBean(true); - DBManipulation dbMani = new DBManipulation(); - dbMani.setName(subMitName); - dbMani.setDBName(para.getDatabaseName()); + refreshConditionList(); + } + + private void populateKeyColumnValueTable(DMLConfig dmlConfig) { + KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel) this.keyColumnValuesTable.getModel(); + keyColumnNameValueTableModel.removeAllKeyColumnNameValue(); + + if (dmlConfig != null) { + boolean acceptPara = false; + for (int i = 0; i < v_Types.length; i++) { + if (v_Types[i].accept(new Parameter())) { + acceptPara = true; + break; + } + } + for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) { + ColumnConfig column = dmlConfig.getColumnConfig(i); + String columnName = column.getColumnName(); + if (!acceptPara && column.getColumnValue() instanceof Parameter) { + // 表单中,将以前的参数转换为公式 + column.setColumnValue(BaseFormula.createFormulaBuilder().build(((Parameter) column.getColumnValue()).getName())); + } - DMLConfig dmlConfig = new IntelliDMLConfig(); - if (dmlConfigComboBox.getSelectedIndex() == 1) { - dmlConfig = new DeleteConfig(); - } else if (dmlConfigComboBox.getSelectedIndex() == 2) { - dmlConfig = new InsertConfig(); - } else if (dmlConfigComboBox.getSelectedIndex() == 3) { - dmlConfig = new UpdateConfig(); - } + KeyColumnNameValue newColumnNameValue = new KeyColumnNameValue(column.isKey(), new ColumnName(columnName), new ColumnValue(column.getColumnValue()), + column.isSkipUnmodified()); + keyColumnNameValueTableModel.addKeyColumnNameValue(newColumnNameValue); + } + } + keyColumnNameValueTableModel.fireTableDataChanged(); + + // 选择第一个 + if (keyColumnNameValueTableModel.getRowCount() > 0) { + keyColumnValuesTable.getSelectionModel().setSelectionInterval(0, 0); + } + } + + @Override + public DBManipulation updateBean() { + DataBaseItems para = chooseTable.updateBean(true); + DBManipulation dbMani = new DBManipulation(); + dbMani.setName(subMitName); + dbMani.setDBName(para.getDatabaseName()); + + DMLConfig dmlConfig = new IntelliDMLConfig(); + if (dmlConfigComboBox.getSelectedIndex() == 1) { + dmlConfig = new DeleteConfig(); + } else if (dmlConfigComboBox.getSelectedIndex() == 2) { + dmlConfig = new InsertConfig(); + } else if (dmlConfigComboBox.getSelectedIndex() == 3) { + dmlConfig = new UpdateConfig(); + } - dbMani.setDmlConfig(dmlConfig); + dbMani.setDmlConfig(dmlConfig); - dmlConfig.setTable(new Table(para.getSchemaName(), para.getTableName())); + dmlConfig.setTable(new Table(para.getSchemaName(), para.getTableName())); - KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel)this.keyColumnValuesTable.getModel(); - int rowCount = keyColumnNameValueTableModel.keyColumnNameValueList.size(); - for (int i = 0; i < rowCount; i++) { - KeyColumnNameValue newKeyColumnNameValue = keyColumnNameValueTableModel.keyColumnNameValueList.get(i); - // peter:先添加key column name. + KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel) this.keyColumnValuesTable.getModel(); + int rowCount = keyColumnNameValueTableModel.keyColumnNameValueList.size(); + for (int i = 0; i < rowCount; i++) { + KeyColumnNameValue newKeyColumnNameValue = keyColumnNameValueTableModel.keyColumnNameValueList.get(i); + // peter:先添加key column name. - dmlConfig.addColumnConfig(new ColumnConfig(newKeyColumnNameValue.cn.name, newKeyColumnNameValue.cv.obj, newKeyColumnNameValue.isKey,false)); - } + dmlConfig.addColumnConfig(new ColumnConfig(newKeyColumnNameValue.cn.name, newKeyColumnNameValue.cv.obj, newKeyColumnNameValue.isKey, false)); + } dmlConfig.setUpdateSelected(UpdateCheckBox.isSelected()); - if (jobs != null) { - for (int i = 0; i < jobs.length; i++) { - dmlConfig.addSubmitJob(jobs[i]); - } - } - dmlConfig.setCondition(condition); - - return dbMani; - } - - protected class ValuePane extends BasicBeanPane { - ValueEditorPane vPane; - - public ValuePane() { - this(v_Types); - } - - public ValuePane(Editor[] types) { - vPane = new ValueEditorPane(types); - this.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 45)); - this.add(vPane); - vPane.setPreferredSize(new Dimension(220, 25)); - } - - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Values_Editor"); - } - - public void populateBean(Object object) { - vPane.populate(object); - } - - @Override - public Object updateBean() { - return vPane.update(); - } - - } - - /* - * alex:ColumnValue的编辑器,弹出对话框来编辑...个人觉得不大好 - */ - protected class ColumnValueEditor extends AbstractCellEditor implements TableCellEditor { - /** The Swing component being edited. */ - private UILabel textLabel; - private ValuePane vPane; - private BasicDialog vPaneDLG; - - protected ColumnValueEditor() { - this(v_Types); - } - - protected ColumnValueEditor(Editor[] types) { - textLabel = new UILabel(); - textLabel.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - vPaneDLG.setAlwaysOnTop(true); - vPaneDLG.setVisible(true); - - } - }); - - vPane = new ValuePane(types); - vPaneDLG = vPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { - public void doOk() { - fireEditingStopped(); // Make the renderer - // reappear. + if (jobs != null) { + for (NameSubmitJob job : jobs) { + dmlConfig.addSubmitJob(job); + } + } + dmlConfig.setCondition(condition); + + return dbMani; + } + + protected class ValuePane extends BasicBeanPane { + ValueEditorPane vPane; + + public ValuePane() { + this(v_Types); + } + + public ValuePane(Editor[] types) { + vPane = new ValueEditorPane(types); + this.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 45)); + this.add(vPane); + vPane.setPreferredSize(new Dimension(220, 25)); + } + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Values_Editor"); + } + + @Override + public void populateBean(Object object) { + vPane.populate(object); + } + + @Override + public Object updateBean() { + return vPane.update(); + } + + } + + /* + * alex:ColumnValue的编辑器,弹出对话框来编辑...个人觉得不大好 + */ + protected class ColumnValueEditor extends AbstractCellEditor implements TableCellEditor { + /** + * The Swing component being edited. + */ + private final UILabel textLabel; + private final ValuePane vPane; + + protected ColumnValueEditor() { + this(v_Types); + } + + /** + * 列值编辑器 + * + * @param types 编辑器类型 + */ + protected ColumnValueEditor(Editor[] types) { + textLabel = new UILabel(); + DialogActionAdapter adapter = new DialogActionAdapter() { + @Override + public void doOk() { + fireEditingStopped(); // Make the renderer + // reappear. updateUpdateCheckBoxEnable(); - } - - public void doCancel() { - fireEditingCanceled(); - } - }); - } - - /* - * 双击以编辑 - */ - public boolean isCellEditable(EventObject anEvent) { - if (anEvent instanceof MouseEvent) { - return ((MouseEvent)anEvent).getClickCount() >= 2; - } - return true; - } - - public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { - if (value instanceof ColumnValue) { - vPane.populateBean(((ColumnValue)value).obj); - - if (((ColumnValue)value).obj != null) { - textLabel.setText(((ColumnValue)value).obj.toString()); - } else { - textLabel.setText(""); - } - } - - return textLabel; - } - - public Object getCellEditorValue() { - return new ColumnValue(vPane.updateBean()); - } - } - - public static class ColumnName { - public String name; - - public ColumnName(String name) { - this.name = name; - } - - public boolean equals(Object obj) { - if (!(obj instanceof ColumnName)) { - return false; - } - - return ComparatorUtils.equals(this.name, ((ColumnName)obj).name); - } - - @Override - protected ColumnName clone() throws CloneNotSupportedException { - return new ColumnName(name); - } - } - - public static class ColumnValue { - public Object obj; - - public ColumnValue(Object obj) { - this.obj = obj; - } - - public Object getObj(){ + } + + @Override + public void doCancel() { + fireEditingCanceled(); + } + }; + textLabel.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + Window window = e.getComponent() == null + ? DesignerContext.getDesignerFrame() + : SwingUtilities.getWindowAncestor(e.getComponent()); + vPane.showSmallWindow(window, adapter) + .setVisible(true); + } + }); + vPane = new ValuePane(types); + } + + /* + * 双击以编辑 + */ + @Override + public boolean isCellEditable(EventObject anEvent) { + if (anEvent instanceof MouseEvent) { + return ((MouseEvent) anEvent).getClickCount() >= 2; + } + return true; + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + if (value instanceof ColumnValue) { + vPane.populateBean(((ColumnValue) value).obj); + + if (((ColumnValue) value).obj != null) { + textLabel.setText(((ColumnValue) value).obj.toString()); + } else { + textLabel.setText(""); + } + } + + return textLabel; + } + + @Override + public Object getCellEditorValue() { + return new ColumnValue(vPane.updateBean()); + } + } + + public static class ColumnName { + public String name; + + public ColumnName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ColumnName)) { + return false; + } + + return ComparatorUtils.equals(this.name, ((ColumnName) obj).name); + } + + @Override + protected ColumnName clone() throws CloneNotSupportedException { + return new ColumnName(name); + } + } + + public static class ColumnValue { + public Object obj; + + public ColumnValue(Object obj) { + this.obj = obj; + } + + public Object getObj() { return obj; } - public boolean equals(Object obj) { - if (!(obj instanceof ColumnValue)) { - return false; - } + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ColumnValue)) { + return false; + } - return ComparatorUtils.equals(this.obj, ((ColumnValue)obj).obj); - } + return ComparatorUtils.equals(this.obj, ((ColumnValue) obj).obj); + } - @Override - protected ColumnValue clone() throws CloneNotSupportedException { - return new ColumnValue(obj); - } - } + @Override + protected ColumnValue clone() throws CloneNotSupportedException { + return new ColumnValue(obj); + } + } - protected static class KeyColumnNameValueTable extends JTable { + protected static class KeyColumnNameValueTable extends JTable { - public KeyColumnNameValueTable() { - super(new KeyColumnValueTableModel(null)); - } + public KeyColumnNameValueTable() { + super(new KeyColumnValueTableModel(null)); + } - public KeyColumnTableModel getTableModel4SmartAddCell() { - KeyColumnTableModel clonedTableModel = null; - try { - //智能添加的时候修改clone的配置,不修改原配置,点击确认后覆盖原配置 - clonedTableModel = ((KeyColumnValueTableModel) this.getModel()).clone(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - return new KeyColumnValueTableModel(clonedTableModel); - } + public KeyColumnTableModel getTableModel4SmartAddCell() { + KeyColumnTableModel clonedTableModel = null; + try { + //智能添加的时候修改clone的配置,不修改原配置,点击确认后覆盖原配置 + clonedTableModel = ((KeyColumnValueTableModel) this.getModel()).clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return new KeyColumnValueTableModel(clonedTableModel); + } - } + } - protected abstract static class KeyColumnTableModel extends AbstractTableModel { + protected abstract static class KeyColumnTableModel extends AbstractTableModel { public static final String RAW_KEY = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_RWA_Key"); public static final String COLUMN = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Column"); - public static final String VALUE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"); - - public static final String[] COLUMN_NAMES = new String[]{RAW_KEY, COLUMN, VALUE}; - - protected List keyColumnNameValueList = new ArrayList<>(); - - public KeyColumnTableModel(KeyColumnTableModel model) { - if (model != null) { - this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); - } - } - - public String getColumnName(int col) { - return COLUMN_NAMES[col]; - } - - public int getColumnCount() { - return COLUMN_NAMES.length; - } - - public int getRowCount() { - return keyColumnNameValueList.size(); - } - - public void addKeyColumnNameValue(KeyColumnNameValue keyColumnNameValue) { - this.keyColumnNameValueList.add(keyColumnNameValue); - } - - public void removeKeyColumnNameValue(int index) { - this.keyColumnNameValueList.remove(index); - } - - public KeyColumnNameValue getKeyColumnNameValue(int index) { - return this.keyColumnNameValueList.get(index); - } - - public void removeAllKeyColumnNameValue() { - this.keyColumnNameValueList.clear(); - } - - public void refreshNameValueList(KeyColumnTableModel model) { - if (model != null) { - this.keyColumnNameValueList.clear(); - this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); - } - } - } - - protected static class KeyColumnValueTableModel extends KeyColumnTableModel implements Cloneable{ - - public KeyColumnValueTableModel(KeyColumnTableModel model) { - super(model); - } - - public Object getValueAt(int row, int col) { - KeyColumnNameValue knv = keyColumnNameValueList.get(row); - - switch (col) { - case 0: - return knv.isKey; - case 1: - return knv.cn; - case 2: - return knv.cv; - } - return null; - } - - public void setValueAt(Object value, int row, int col) { - KeyColumnNameValue knv = keyColumnNameValueList.get(row); - - if (col == 0 && value instanceof Boolean) { - knv.isKey = ((Boolean)value).booleanValue(); - } else if (col == 1 && value instanceof ColumnName) { - knv.cn = (ColumnName)value; - } else if (col == 2 && value instanceof ColumnValue) { - knv.cv = (ColumnValue)value; - } - } - - public Class getColumnClass(int c) { - switch (c) { - case 0: - return Boolean.class; - case 1: - return ColumnName.class; - case 2: - return ColumnValue.class; - } - return String.class; - } - - public boolean isCellEditable(int row, int col) { - return true; - } - - @Override - protected KeyColumnValueTableModel clone() throws CloneNotSupportedException { - KeyColumnValueTableModel cloned = (KeyColumnValueTableModel) super.clone(); - cloned.keyColumnNameValueList = new ArrayList<>(); - for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { - cloned.keyColumnNameValueList.add(keyColumnNameValue.clone()); - } - return cloned; - } - } - - - - public static class KeyColumnNameValue { - private boolean isKey = false; - private ColumnName cn; - public ColumnValue cv; - - public KeyColumnNameValue(boolean isKey, ColumnName cn, ColumnValue cv, boolean skip) { - this.isKey = isKey; - this.cn = cn; - this.cv = cv; - } - - /** - * 字符串 - * - * @return 字符串z - */ - public String toString() { - return (isKey ? "* " : "") + cn + ":" + cv; - } - - @Override - protected KeyColumnNameValue clone() throws CloneNotSupportedException { - return new KeyColumnNameValue(isKey, cn.clone(), cv.clone(), false); - } - } - - /* - * ColumnNameTableCellRenderer - */ - public class ColumnNameTableCellRenderer extends DefaultTableCellRenderer { - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - - if (value instanceof ColumnName) { - this.setText(((ColumnName)value).name); - } - - return this; - } - } - - /* - * ColumnValueTableCellRenderer - */ - private class ColumnValueTableCellRenderer extends DefaultTableCellRenderer { - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - - if (value instanceof ColumnValue) { - if (((ColumnValue)value).obj != null) { - if (((ColumnValue)value).obj instanceof Date) { - this.setText(DateUtils.DATEFORMAT2.format(((ColumnValue)value).obj)); - } else { - this.setText(((ColumnValue)value).obj.toString()); - } - } else { - this.setText(""); - } - } - - return this; - } - } + public static final String VALUE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"); + + public static final String[] COLUMN_NAMES = new String[]{RAW_KEY, COLUMN, VALUE}; + + protected List keyColumnNameValueList = new ArrayList<>(); + + public KeyColumnTableModel(KeyColumnTableModel model) { + if (model != null) { + this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); + } + } + + @Override + public String getColumnName(int col) { + return COLUMN_NAMES[col]; + } + + @Override + public int getColumnCount() { + return COLUMN_NAMES.length; + } + + @Override + public int getRowCount() { + return keyColumnNameValueList.size(); + } + + public void addKeyColumnNameValue(KeyColumnNameValue keyColumnNameValue) { + this.keyColumnNameValueList.add(keyColumnNameValue); + } + + public void removeKeyColumnNameValue(int index) { + this.keyColumnNameValueList.remove(index); + } + + public KeyColumnNameValue getKeyColumnNameValue(int index) { + return this.keyColumnNameValueList.get(index); + } + + public void removeAllKeyColumnNameValue() { + this.keyColumnNameValueList.clear(); + } + + public void refreshNameValueList(KeyColumnTableModel model) { + if (model != null) { + this.keyColumnNameValueList.clear(); + this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); + } + } + } + + protected static class KeyColumnValueTableModel extends KeyColumnTableModel implements Cloneable { + + public KeyColumnValueTableModel(KeyColumnTableModel model) { + super(model); + } + + @Override + public Object getValueAt(int row, int col) { + KeyColumnNameValue knv = keyColumnNameValueList.get(row); + + switch (col) { + case 0: + return knv.isKey; + case 1: + return knv.cn; + case 2: + return knv.cv; + } + return null; + } + + @Override + public void setValueAt(Object value, int row, int col) { + KeyColumnNameValue knv = keyColumnNameValueList.get(row); + + if (col == 0 && value instanceof Boolean) { + knv.isKey = ((Boolean) value).booleanValue(); + } else if (col == 1 && value instanceof ColumnName) { + knv.cn = (ColumnName) value; + } else if (col == 2 && value instanceof ColumnValue) { + knv.cv = (ColumnValue) value; + } + } + + @Override + public Class getColumnClass(int c) { + switch (c) { + case 0: + return Boolean.class; + case 1: + return ColumnName.class; + case 2: + return ColumnValue.class; + } + return String.class; + } + + @Override + public boolean isCellEditable(int row, int col) { + return true; + } + + @Override + protected KeyColumnValueTableModel clone() throws CloneNotSupportedException { + KeyColumnValueTableModel cloned = (KeyColumnValueTableModel) super.clone(); + cloned.keyColumnNameValueList = new ArrayList<>(); + for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { + cloned.keyColumnNameValueList.add(keyColumnNameValue.clone()); + } + return cloned; + } + } + + + public static class KeyColumnNameValue { + private boolean isKey = false; + private ColumnName cn; + public ColumnValue cv; + + public KeyColumnNameValue(boolean isKey, ColumnName cn, ColumnValue cv, boolean skip) { + this.isKey = isKey; + this.cn = cn; + this.cv = cv; + } + + /** + * 字符串 + * + * @return 字符串z + */ + @Override + public String toString() { + return (isKey ? "* " : "") + cn + ":" + cv; + } + + @Override + protected KeyColumnNameValue clone() throws CloneNotSupportedException { + return new KeyColumnNameValue(isKey, cn.clone(), cv.clone(), false); + } + } + + /* + * ColumnNameTableCellRenderer + */ + public static class ColumnNameTableCellRenderer extends DefaultTableCellRenderer { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + + if (value instanceof ColumnName) { + this.setText(((ColumnName) value).name); + } + + return this; + } + } + + /* + * ColumnValueTableCellRenderer + */ + private static class ColumnValueTableCellRenderer extends DefaultTableCellRenderer { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + + if (value instanceof ColumnValue) { + if (((ColumnValue) value).obj != null) { + if (((ColumnValue) value).obj instanceof Date) { + this.setText(DateUtils.DATEFORMAT2.format(((ColumnValue) value).obj)); + } else { + this.setText(((ColumnValue) value).obj.toString()); + } + } else { + this.setText(""); + } + } + + return this; + } + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 5a8af100d4..5466489634 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -122,8 +122,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return new Component[][]{ new Component[]{dataLabelContentPane, null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, - new Component[]{createLabelBorderPane(), null}, - new Component[]{createLabelBackgroundPane(), null} + new Component[]{createBorderAndBackgroundPane(), null}, }; } @@ -138,6 +137,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { }; } + private JPanel createBorderAndBackgroundPane() { + JPanel jPanel = new JPanel(); + jPanel.setLayout(new BorderLayout(0, 5)); + jPanel.add(createLabelBorderPane(), BorderLayout.NORTH); + jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER); + return jPanel; + } + private JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index a430faeec1..d306bb1793 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -456,7 +456,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { newAdd.clear(); for (int i = 0; i < cs; i++) { for (int j = 0; j < rs; j++) { - TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j ); + TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j); if (cellElement != null && ((i + c) != 0 || (r + j) != 0)) { String value = cellElement.toString(); if (!newAdd.contains(value) && !allColumnRow.contains(value)) { @@ -512,7 +512,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { private SmartJTablePaneAction a = new AbstractSmartJTablePaneAction(this, SmartInsertDBManipulationPane.this) { @Override public void doOk() { - ((KeyColumnTableModel)keyColumnValuesTable.getModel()).refreshNameValueList((KeyColumnTableModel)model); + ((KeyColumnTableModel) keyColumnValuesTable.getModel()).refreshNameValueList((KeyColumnTableModel) model); } @Override From 8a63306c395142faaa35345a238be4495f84d6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 15 Dec 2020 10:04:51 +0800 Subject: [PATCH 005/104] =?UTF-8?q?CHART-15835=20=20=E9=A5=BC=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=94=B9=E4=B8=BA=E5=80=BC=E6=A0=87=E7=AD=BE?= =?UTF-8?q?+=E5=88=86=E7=B1=BB=E6=A0=87=E7=AD=BE=E7=BB=84=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/PlotFactory.java | 3 + .../border/VanChartBorderWithShapePane.java | 6 +- .../SummaryValueFormatPaneWithCheckBox.java | 23 ++++ ...SummaryValueFormatPaneWithoutCheckBox.java | 23 ++++ .../VanChartPieCategoryLabelDetailPane.java | 68 +++++++++ .../style/label/VanChartPiePlotLabelPane.java | 61 ++++++++ .../VanChartPieValueLabelDetailPane.java | 72 ++++++++++ .../label/VanChartPlotLabelDetailPane.java | 17 ++- .../style/label/VanChartPlotLabelPane.java | 4 + .../VanChartPieCategoryLabelContentPane.java | 130 ++++++++++++++++++ .../VanChartPieValueLabelContentPane.java | 79 +++++++++++ 11 files changed, 483 insertions(+), 3 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithoutCheckBox.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryLabelContentPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueLabelContentPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index 46126d277a..ab46f55262 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -35,6 +35,7 @@ import com.fr.van.chart.designer.style.VanChartRangeLegendPane; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanLegendPaneWidthOutHighlight; import com.fr.van.chart.designer.style.label.VanChartGaugePlotLabelPane; +import com.fr.van.chart.designer.style.label.VanChartPiePlotLabelPane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane; @@ -209,6 +210,8 @@ public class PlotFactory { public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) { if (plot instanceof VanChartGaugePlot) { return new VanChartGaugePlotLabelPane(plot, stylePane); + } else if (plot instanceof PiePlot4VanChart) { + return new VanChartPiePlotLabelPane(plot, stylePane, inCondition); } return new VanChartPlotLabelPane(plot, stylePane, inCondition); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java index f764c9baab..f40a51f123 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java @@ -46,6 +46,10 @@ public class VanChartBorderWithShapePane extends BasicPane { createBorderPane(); } + public LineComboBox getLineTypeBox() { + return lineTypeBox; + } + private void initComponents() { lineTypeBox = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); lineColorButton = new UIButtonGroup<>(new String[]{ @@ -106,7 +110,7 @@ public class VanChartBorderWithShapePane extends BasicPane { borderRadius.setEnabled(borderShape.getSelectedIndex() == RECTANGULAR_INDEX || borderShape.getSelectedIndex() == DIALOG_INDEX); } - private JPanel createLineTypePane() { + protected JPanel createLineTypePane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithCheckBox.java new file mode 100644 index 0000000000..8d088827f0 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithCheckBox.java @@ -0,0 +1,23 @@ +package com.fr.van.chart.designer.component.format; + +import com.fr.design.i18n.Toolkit; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-10 + */ +public class SummaryValueFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { + + public SummaryValueFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + @Override + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Use_Summary_Value"); + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithoutCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithoutCheckBox.java new file mode 100644 index 0000000000..400af6b7f8 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/SummaryValueFormatPaneWithoutCheckBox.java @@ -0,0 +1,23 @@ +package com.fr.van.chart.designer.component.format; + +import com.fr.design.i18n.Toolkit; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-10 + */ +public class SummaryValueFormatPaneWithoutCheckBox extends VanChartFormatPaneWithoutCheckBox { + + public SummaryValueFormatPaneWithoutCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Use_Summary_Value"); + } +} + diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java new file mode 100644 index 0000000000..bf13ca4453 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java @@ -0,0 +1,68 @@ +package com.fr.van.chart.designer.style.label; + +import com.fr.chart.chartattr.Plot; +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.layout.TableLayoutHelper; +import com.fr.stable.Constants; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.pie.style.VanChartPieCategoryLabelContentPane; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-09 + */ +public class VanChartPieCategoryLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartPieCategoryLabelDetailPane(Plot plot, VanChartStylePane parent, boolean inCondition) { + super(plot, parent, inCondition); + } + + protected void initToolTipContentPane(Plot plot) { + setDataLabelContentPane(new VanChartPieCategoryLabelContentPane(getParentPane(), this, isInCondition())); + } + + protected JPanel createLabelPositionPane(String title, Plot plot) { + String[] positionName = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom"), + Toolkit.i18nText("Fine-Design_Form_Center"), + Toolkit.i18nText("Fine-Design_Chart_Axis_Top") + }; + + Integer[] positionValue = new Integer[]{Constants.BOTTOM, Constants.CENTER, Constants.TOP}; + + UIButtonGroup position = new UIButtonGroup<>(positionName, positionValue); + setPosition(position); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] row = {p, p}; + double[] col = {f, e}; + + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), position}, + }; + + return TableLayoutHelper.createTableLayoutPane(components, row, col); + } + + protected void checkPositionPane(String title) { + + } + + protected JPanel createLabelBorderPane() { + return null; + } + + protected JPanel createLabelBackgroundPane() { + return null; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java new file mode 100644 index 0000000000..ac24b99510 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java @@ -0,0 +1,61 @@ +package com.fr.van.chart.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.base.AttrLabelDetail; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-09 + */ +public class VanChartPiePlotLabelPane extends VanChartPlotLabelPane { + + private VanChartPlotLabelDetailPane pieCategoryLabelPane; + + public VanChartPiePlotLabelPane(Plot plot, VanChartStylePane parent, boolean inCondition) { + super(plot, parent, inCondition); + } + + protected void createLabelPane() { + setLabelPane(new JPanel(new BorderLayout(0, 4))); + setLabelDetailPane(new VanChartPieValueLabelDetailPane(getPlot(), getParentPane(), isInCondition())); + JPanel valuePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Label"), getLabelDetailPane()); + getLabelPane().add(valuePane, BorderLayout.NORTH); + + if (!isInCondition()) { + pieCategoryLabelPane = new VanChartPieCategoryLabelDetailPane(getPlot(), getParentPane(), isInCondition()); + JPanel categoryPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Category_Label"), pieCategoryLabelPane); + getLabelPane().add(categoryPane, BorderLayout.CENTER); + } + } + + public void populate(AttrLabel attrLabel) { + if (attrLabel == null) { + attrLabel = ((VanChartPlot) this.getPlot()).getDefaultAttrLabel(); + } + super.populate(attrLabel); + if (pieCategoryLabelPane != null) { + AttrLabelDetail labelDetail = attrLabel.getSecondLabelDetail(); + pieCategoryLabelPane.populate(labelDetail); + } + } + + public AttrLabel update() { + AttrLabel attrLabel = super.update(); + if (pieCategoryLabelPane != null) { + AttrLabelDetail labelDetail = attrLabel.getSecondLabelDetail(); + pieCategoryLabelPane.update(labelDetail); + } else { + attrLabel.setSecondLabelDetail(null); + } + return attrLabel; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java new file mode 100644 index 0000000000..707f6f5fd8 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java @@ -0,0 +1,72 @@ +package com.fr.van.chart.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.design.widget.FRWidgetFactory; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; +import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.pie.style.VanChartPieValueLabelContentPane; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-09 + */ +public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartPieValueLabelDetailPane(Plot plot, VanChartStylePane parent, boolean inCondition) { + super(plot, parent, inCondition); + } + + protected void initToolTipContentPane(Plot plot) { + setDataLabelContentPane(new VanChartPieValueLabelContentPane(getParentPane(), this, isInCondition())); + } + + protected JPanel getLabelLayoutPane(JPanel panel, String title) { + return panel; + } + + protected JPanel createLabelBorderPane() { + VanChartBorderWithShapePane borderPane = new VanChartBorderWithShapePane() { + @Override + protected JPanel createLineTypePane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + double[] columnSize = {f, e}; + double[] rowSize = {p}; + + Component[][] components = new Component[][]{ + new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Border")), + UIComponentUtils.wrapWithBorderLayoutPane(getLineTypeBox())}}; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + } + }; + setBorderPane(borderPane); + return borderPane; + } + + protected JPanel createLabelBackgroundPane() { + VanChartBackgroundWithOutImagePane backgroundPane = new VanChartBackgroundWithOutImagePane() { + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_Background")), typeComboBox}, + new Component[]{null, centerPane}, + new Component[]{getTransparentLabel(), transparent}, + }; + } + }; + setBackgroundPane(backgroundPane); + return backgroundPane; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 5466489634..0e6071b557 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -83,6 +83,19 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return parent; } + public void setPosition(UIButtonGroup position) { + this.position = position; + } + + public void setBorderPane(VanChartBorderWithShapePane borderPane) { + this.borderPane = borderPane; + } + + public void setBackgroundPane(VanChartBackgroundWithOutImagePane backgroundPane) { + this.backgroundPane = backgroundPane; + } + + protected void initLabelDetailPane(Plot plot) { this.setLayout(new BorderLayout()); initToolTipContentPane(plot); @@ -145,14 +158,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return jPanel; } - private JPanel createLabelBorderPane() { + protected JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); return borderPaneWithTitle; } - private JPanel createLabelBackgroundPane() { + protected JPanel createLabelBackgroundPane() { backgroundPane = new VanChartBackgroundWithOutImagePane() { protected Component[][] getPaneComponents() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java index 71ad599fda..4aed8c30a9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java @@ -44,6 +44,10 @@ public class VanChartPlotLabelPane extends BasicPane { addComponents(); } + public boolean isInCondition() { + return inCondition; + } + public VanChartPlotLabelDetailPane getLabelDetailPane() { return labelDetailPane; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryLabelContentPane.java new file mode 100644 index 0000000000..e5b55d7491 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryLabelContentPane.java @@ -0,0 +1,130 @@ +package com.fr.van.chart.pie.style; + +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.AttrTooltipRichText; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.pie.attr.PieCategoryLabelContent; +import com.fr.van.chart.designer.component.VanChartLabelContentPane; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.format.SummaryValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SummaryValueFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-10 + */ +public class VanChartPieCategoryLabelContentPane extends VanChartLabelContentPane { + + private SummaryValueFormatPaneWithCheckBox summaryValueFormatPane; + + private SummaryValueFormatPaneWithoutCheckBox richTextSummaryValueFormatPane; + + public VanChartPieCategoryLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); + } + + @Override + protected JPanel getLabelContentPane(JPanel contentPane) { + return contentPane; + } + + @Override + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setCategoryNameFormatPane(new CategoryNameFormatPaneWithCheckBox(parent, showOnPane)); + summaryValueFormatPane = new SummaryValueFormatPaneWithCheckBox(parent, showOnPane); + } + + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); + richTextSummaryValueFormatPane = new SummaryValueFormatPaneWithoutCheckBox(parent, showOnPane); + } + + @Override + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{getCategoryNameFormatPane(), null}, + new Component[]{summaryValueFormatPane, null}, + }; + } + + @Override + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{getRichTextCategoryNameFormatPane(), null}, + new Component[]{richTextSummaryValueFormatPane, null}, + }; + } + + @Override + protected double[] getRowSize(double p) { + return new double[]{p, p}; + } + + public JPanel createCommonStylePane() { + setTextAttrPane(new ChartTextAttrPane()); + return getTextAttrPane(); + } + + @Override + protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { + PieCategoryLabelContent pieCategoryLabelContent = (PieCategoryLabelContent) attrTooltipContent; + super.populateFormatPane(pieCategoryLabelContent); + summaryValueFormatPane.populate(pieCategoryLabelContent.getSummaryValueFormat()); + } + + protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { + PieCategoryLabelContent pieCategoryLabelContent = (PieCategoryLabelContent) attrTooltipContent; + VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ + getRichTextCategoryNameFormatPane(), + richTextSummaryValueFormatPane + }; + + AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ + pieCategoryLabelContent.getRichTextCategoryFormat(), + pieCategoryLabelContent.getRichTextSummaryValueFormat() + }; + + setRichTextAttr(new AttrTooltipRichText()); + populateRichTextFormat(formatPaneGroup, formatGroup); + populateRichText(pieCategoryLabelContent.getRichTextAttr()); + + checkRichEditorState(pieCategoryLabelContent); + } + + @Override + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { + PieCategoryLabelContent pieCategoryLabelContent = (PieCategoryLabelContent) attrTooltipContent; + super.updateFormatPane(pieCategoryLabelContent); + summaryValueFormatPane.update(pieCategoryLabelContent.getSummaryValueFormat()); + } + + protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { + PieCategoryLabelContent pieCategoryLabelContent = (PieCategoryLabelContent) attrTooltipContent; + super.updateRichEditor(pieCategoryLabelContent); + richTextSummaryValueFormatPane.update(pieCategoryLabelContent.getRichTextSummaryValueFormat()); + } + + @Override + public void setDirty(boolean isDirty) { + getCategoryNameFormatPane().setDirty(isDirty); + summaryValueFormatPane.setDirty(isDirty); + } + + @Override + public boolean isDirty() { + return getCategoryNameFormatPane().isDirty() || summaryValueFormatPane.isDirty(); + } + + protected AttrTooltipContent createAttrTooltip() { + return new PieCategoryLabelContent(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueLabelContentPane.java new file mode 100644 index 0000000000..ddc6e66313 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueLabelContentPane.java @@ -0,0 +1,79 @@ +package com.fr.van.chart.pie.style; + +import com.fr.van.chart.designer.component.VanChartLabelContentPane; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-09 + */ +public class VanChartPieValueLabelContentPane extends VanChartLabelContentPane { + + public VanChartPieValueLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); + } + + @Override + protected JPanel getLabelContentPane(JPanel contentPane) { + return contentPane; + } + + @Override + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setSeriesNameFormatPane(new SeriesNameFormatPaneWithCheckBox(parent, showOnPane)); + setValueFormatPane(new ValueFormatPaneWithCheckBox(parent, showOnPane)); + setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); + } + + @Override + protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { + setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); + setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); + setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + } + + @Override + protected double[] getRowSize(double p) { + return new double[]{p, p, p}; + } + + @Override + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{getSeriesNameFormatPane(), null}, + new Component[]{getValueFormatPane(), null}, + new Component[]{getPercentFormatPane(), null}, + }; + } + + @Override + protected Component[][] getRichTextComponents() { + return new Component[][]{ + new Component[]{getRichTextSeriesNameFormatPane(), null}, + new Component[]{getRichTextValueFormatPane(), null}, + new Component[]{getRichTextPercentFormatPane(), null} + }; + } + + @Override + public void setDirty(boolean isDirty) { + getSeriesNameFormatPane().setDirty(isDirty); + getValueFormatPane().setDirty(isDirty); + getPercentFormatPane().setDirty(isDirty); + } + + @Override + public boolean isDirty() { + return getSeriesNameFormatPane().isDirty() || getValueFormatPane().isDirty() || getPercentFormatPane().isDirty(); + } +} From ab4f4465686579f917794a628389495c2eed5dcd Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Dec 2020 11:37:09 +0800 Subject: [PATCH 006/104] =?UTF-8?q?KERNEL-6224=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=93=8D=E4=BD=9C=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 13 ++++++++++++- .../fr/design/mainframe/JTemplateEvent.java | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java 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 6c6de287e6..316f48fc36 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 @@ -49,6 +49,7 @@ import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; +import com.fr.event.EventDispatcher; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; import com.fr.file.MemFILE; @@ -107,7 +108,6 @@ public abstract class JTemplate> private DesignModelAdapter designModel; private PreviewProvider previewType; protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); - public int resolution = ScreenResolution.getScreenResolution(); private PluginEventListener pluginListener; @@ -125,6 +125,7 @@ public abstract class JTemplate> public JTemplate(T t, FILE file, boolean isNewFile) { super(t); + beforeInit(); // 判断是否切换设计器状态到禁止拷贝剪切 if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) { DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.BAN_COPY_AND_CUT); @@ -301,6 +302,13 @@ public abstract class JTemplate> } + /** + * 模板初始化之前 + */ + private void beforeInit() { + EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_INIT, this); + } + /** * 模板关闭时 */ @@ -309,6 +317,7 @@ public abstract class JTemplate> PluginListenerRegistration.getInstance().stopListen(this.pluginListener); } + /** * 刷新内部资源 * @@ -1083,6 +1092,7 @@ public abstract class JTemplate> * 激活已存在的模板 */ public void activeOldJTemplate() { + EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); DesignerContext.getDesignerFrame().activateJTemplate(this); } @@ -1090,6 +1100,7 @@ public abstract class JTemplate> * 激活新的模板 */ public void activeNewJTemplate() { + EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); DesignerContext.getDesignerFrame().addAndActivateJTemplate(this); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java new file mode 100644 index 0000000000..d60d064743 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java @@ -0,0 +1,19 @@ +package com.fr.design.mainframe; + +import com.fr.event.Event; + +/** + * Created by kerry on 2020-12-11 + */ +public enum JTemplateEvent implements Event { + /** + * 模板初始化之前 + */ + BEFORE_TEMPLATE_INIT, + + /** + * 模板激活之前 + */ + BEFORE_TEMPLATE_ACTIVE + +} From 0d92fd4e9d3bfe39f68696f0e30ca7064f527c99 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Dec 2020 11:40:29 +0800 Subject: [PATCH 007/104] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormDesignerUI.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index a21a2efad5..cdec956ed5 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -49,7 +49,6 @@ public class FormDesignerUI extends ComponentUI { private FormDesigner designer; private SelectionModel selectionModel; private Rectangle2D.Double back_or_selection_rect = new Rectangle2D.Double(0, 0, 0, 0); - private float time; public FormDesignerUI() { } @@ -71,7 +70,6 @@ public class FormDesignerUI extends ComponentUI { @Override public void paint(final Graphics g, JComponent c) { XCreator rootComponent = designer.getRootComponent(); - this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution(); AffineTransform at = new AffineTransform(); if (rootComponent.getParent() != null) { at.translate(designer.getPaintX(), designer.getPaintY()); From 454e69707bd76de4df30f9f813b74575d0123ba5 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Dec 2020 11:43:33 +0800 Subject: [PATCH 008/104] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8imp?= =?UTF-8?q?ort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormDesignerUI.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index cdec956ed5..7c3e86a572 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fr.base.GraphHelper; -import com.fr.base.ScreenResolution; import com.fr.base.Utils; import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.base.vcs.DesignerMode; From 981f025d40d6eb91beec3ab7504545d99c79c55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 15 Dec 2020 14:09:14 +0800 Subject: [PATCH 009/104] fix --- .../style/label/VanChartPieCategoryLabelDetailPane.java | 6 +----- .../designer/style/label/VanChartPlotLabelDetailPane.java | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java index bf13ca4453..4c28c78b08 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java @@ -58,11 +58,7 @@ public class VanChartPieCategoryLabelDetailPane extends VanChartPlotLabelDetailP } - protected JPanel createLabelBorderPane() { - return null; - } - - protected JPanel createLabelBackgroundPane() { + protected JPanel createBorderAndBackgroundPane() { return null; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 0e6071b557..20ce7452b9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -150,7 +150,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { }; } - private JPanel createBorderAndBackgroundPane() { + protected JPanel createBorderAndBackgroundPane() { JPanel jPanel = new JPanel(); jPanel.setLayout(new BorderLayout(0, 5)); jPanel.add(createLabelBorderPane(), BorderLayout.NORTH); @@ -158,14 +158,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return jPanel; } - protected JPanel createLabelBorderPane() { + private JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); return borderPaneWithTitle; } - protected JPanel createLabelBackgroundPane() { + private JPanel createLabelBackgroundPane() { backgroundPane = new VanChartBackgroundWithOutImagePane() { protected Component[][] getPaneComponents() { From 941a3837e700de9bb7c042316d3004b2f6c4719d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 8 Dec 2020 18:48:02 +0800 Subject: [PATCH 010/104] =?UTF-8?q?CHART-17249=20=E9=AB=98=E5=BE=B7?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/drillMap/DrillMapLayerPane.java | 4 +- .../designer/data/comp/DrillMapLayerPane.java | 4 +- .../type/VanChartDrillMapPlotPane.java | 16 +- .../type/VanChartHeatMapSourceChoosePane.java | 15 - .../type/VanChartHeatMapTypePane.java | 24 +- .../chart/map/designer/type/GeoUrlPane.java | 258 +++++++ .../chart/map/designer/type/GisLayerPane.java | 303 ++++++++ .../map/designer/type/MapStatusPane.java | 167 ++++ .../map/designer/type/TileLayerPane.java | 51 ++ .../designer/type/VanChartMapPlotPane.java | 1 - .../type/VanChartMapSourceChoosePane.java | 714 ++---------------- .../chart/map/designer/type/WMSLayerPane.java | 165 ++++ 12 files changed, 1022 insertions(+), 700 deletions(-) delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapSourceChoosePane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java index 1102f7a64e..8c62d6e725 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java @@ -14,7 +14,7 @@ import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree; -import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; +import com.fr.van.chart.map.designer.type.MapStatusPane; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -154,7 +154,7 @@ public class DrillMapLayerPane extends BasicBeanPane { rowSize[i + 1] = p; int d = i + 1; UILabel label = new UILabel(String.format("%s%d%s", Toolkit.i18nText("Fine-Design_Chart_Index_Article"), d, Toolkit.i18nText("Fine-Design_Chart_Index_Layer"))); - UIComboBox level = new UIComboBox(VanChartMapSourceChoosePane.ZOOM_LEVELS); + UIComboBox level = new UIComboBox(MapStatusPane.ZOOM_LEVELS); level.setEnabled(i != 0); UIComboBox type = new UIComboBox(items); detailComps[i + 1] = new Component[]{label, level, type}; diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java index 0c6fcc1e4c..7497559916 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java @@ -14,7 +14,7 @@ import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; +import com.fr.van.chart.map.designer.type.MapStatusPane; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -105,7 +105,7 @@ public class DrillMapLayerPane extends BasicScrollPane { rowSize[i + 1] = p; int d = i + 1; UILabel label = new UILabel(String.format("%s%d%s", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Article"), d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Layer"))); - UIComboBox level = new UIComboBox(VanChartMapSourceChoosePane.ZOOM_LEVELS); + UIComboBox level = new UIComboBox(MapStatusPane.ZOOM_LEVELS); level.setEnabled(i != 0); UIComboBox type = new UIComboBox(TEMP.get(oldMapType)); detailComps[i + 1] = new Component[]{label, level, type}; diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java index c4a803134b..48f8b2434c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java @@ -8,11 +8,14 @@ import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChart; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; +import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; +import com.fr.van.chart.map.designer.type.GeoUrlPane; import com.fr.van.chart.map.designer.type.VanChartMapPlotPane; import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; +import javax.swing.tree.TreeNode; import java.util.ArrayList; /** @@ -30,10 +33,15 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane { @Override protected VanChartMapSourceChoosePane createSourceChoosePane() { - return new VanChartMapSourceChoosePane(){ + return new VanChartMapSourceChoosePane() { @Override - protected boolean supportParam(){ - return false; + protected void initGeoUrlPane() { + setGeoUrlPane(new GeoUrlPane() { + @Override + protected TreeNode getRootNode() { + return GEOJSONTreeHelper.getInstance().getRootNodeWithoutPara(); + } + }); } }; } @@ -59,7 +67,7 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane { protected void resetAttr(Plot plot) { super.resetAttr(plot); - if(plot instanceof VanChartDrillMapPlot) { + if (plot instanceof VanChartDrillMapPlot) { resetLayerTypeAndZoomLevel((VanChartDrillMapPlot) plot); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapSourceChoosePane.java deleted file mode 100644 index 3eaec5f59d..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapSourceChoosePane.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.fr.van.chart.heatmap.designer.type; - -import com.fr.design.gui.ilable.UILabel; - -import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; - -/** - * Created by Mitisky on 16/10/20. - */ -public class VanChartHeatMapSourceChoosePane extends VanChartMapSourceChoosePane { - @Override - protected UILabel createSourceTitleLabel() { - return new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Area_And_Point")); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java index 8f4a72de2a..32529591eb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java @@ -3,6 +3,8 @@ package com.fr.van.chart.heatmap.designer.type; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chartx.data.ChartDataDefinitionProvider; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.attr.plot.VanChartPlot; @@ -11,6 +13,7 @@ import com.fr.plugin.chart.heatmap.HeatMapIndependentVanChart; import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.plugin.chart.vanchart.VanChart; +import com.fr.van.chart.map.designer.type.GeoUrlPane; import com.fr.van.chart.map.designer.type.VanChartMapPlotPane; import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; @@ -27,18 +30,27 @@ public class VanChartHeatMapTypePane extends VanChartMapPlotPane { @Override protected VanChartMapSourceChoosePane createSourceChoosePane() { - return new VanChartHeatMapSourceChoosePane(); + return new VanChartMapSourceChoosePane() { + @Override + protected void initGeoUrlPane() { + setGeoUrlPane(new GeoUrlPane() { + @Override + protected UILabel createSourceTitleLabel() { + return new UILabel(Toolkit.i18nText("Fine-Design_Chart_Map_Area_And_Point")); + } + }); + } + }; } //适用一种图表只有一种类型的 public void populateBean(VanChart chart) { typeDemo.get(0).isPressing = true; - VanChartHeatMapPlot plot = (VanChartHeatMapPlot)chart.getPlot(); + VanChartHeatMapPlot plot = (VanChartHeatMapPlot) chart.getPlot(); populateSourcePane(plot); boolean enabled = !CompatibleGEOJSONHelper.isDeprecated(plot.getGeoUrl()); GUICoreUtils.setEnabled(this.getTypePane(), enabled); - GUICoreUtils.setEnabled(this.getSourceChoosePane().getSourceComboBox(), enabled); checkDemosBackground(); } @@ -53,13 +65,13 @@ public class VanChartHeatMapTypePane extends VanChartMapPlotPane { return tools; } - protected Plot getSelectedClonedPlot(){ + protected Plot getSelectedClonedPlot() { Chart chart = getDefaultChart(); - VanChartHeatMapPlot newPlot = (VanChartHeatMapPlot)chart.getPlot(); + VanChartHeatMapPlot newPlot = (VanChartHeatMapPlot) chart.getPlot(); Plot cloned = null; try { - cloned = (Plot)newPlot.clone(); + cloned = (Plot) newPlot.clone(); } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java new file mode 100644 index 0000000000..c69297fa86 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java @@ -0,0 +1,258 @@ +package com.fr.van.chart.map.designer.type; + +import com.fr.base.Parameter; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icombobox.FRTreeComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; +import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; +import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; +import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; +import com.fr.plugin.chart.type.MapType; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree; +import com.fr.workspace.WorkContext; + +import javax.swing.JPanel; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.TreeNode; +import javax.swing.tree.TreePath; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-07 + */ +public class GeoUrlPane extends JPanel implements UIObserver { + + private UILabel sourceTitleLabel; + private FRTreeComboBox sourceComboBox; + private MapDataTree mapDataTree; + private TreePath selectTreePath; + + private UIObserverListener listener; + + private String[] oldParams; + + public GeoUrlPane() { + initComps(); + } + + private void initComps() { + this.setLayout(new BorderLayout()); + this.add(createMapSourcesPane(), BorderLayout.CENTER); + } + + + @Override + public void registerChangeListener(UIObserverListener listener) { + this.listener = listener; + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } + + private JPanel createMapSourcesPane() { + + mapDataTree = new MapDataTree(this.getRootNode()); + mapDataTree.setEditable(false); + mapDataTree.selectDefaultTreeNode(); + sourceComboBox = new FRTreeComboBox(mapDataTree, mapDataTree.getCellRenderer()) { + //搜索 + protected void dealSamePath(TreePath parent, TreeNode node, UITextField textField) { + String searchText = textField.getText(); + GeoUrlPane.this.mapDataTree.search(searchText); + } + + //选中 tree---combobox + public void setSelectedItem(Object o) { + TreePath oldPath = mapDataTree.getSelectionPath(); + Object oldText = getSelectedItem(); + if (o != null && o instanceof TreePath) { + selectTreePath = (TreePath) o; + this.tree.setSelectionPath(selectTreePath); + this.getModel().setSelectedItem(pathToString(selectTreePath)); + if (ComparatorUtils.equals(oldText, getSelectedItem()) && !ComparatorUtils.equals(oldPath, selectTreePath)) { + //point的江苏省切换到area的江苏省 + listener.doChange(); + } + } else if (o instanceof String) {//list里面没有 + selectTreePath = null; + this.tree.setSelectionPath(null); + this.getModel().setSelectedItem(ChartGEOJSONHelper.getPresentNameWithPath((String) o)); + } + } + + @Override + protected String pathToString(TreePath path) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent(); + //不显示后缀 + return ChartGEOJSONHelper.getPresentNameWithPath(node.toString()); + } + + @Override + protected boolean customSelectable(DefaultMutableTreeNode node) { + return GEOJSONTreeHelper.isSelectableTreeNode(node); + } + }; + sourceComboBox.setEditable(true); + sourceComboBox.setOnlyLeafSelectable(false); + sourceComboBox.addPopupMenuListener(popupMenuListener); + sourceTitleLabel = createSourceTitleLabel(); + + + boolean hasRefreshButton = !WorkContext.getCurrent().isLocal(); + UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/control/refresh.png")); + button.setToolTipText(Toolkit.i18nText("Fine-Design_Chart_Update_Remote_Map_JSON")); + button.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + GEOJSONHelper.reset(); + GEOJSONHelper.getInstance(); + } + }); + + double p = TableLayout.PREFERRED; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double f = TableLayout.FILL; + double[] rowSize = {p, p}; + double[] columnSize = hasRefreshButton ? new double[]{d + 10, e - 20, 20} : new double[]{f, e}; + + Component[] comps = hasRefreshButton + ? new Component[]{sourceTitleLabel, sourceComboBox, button} + : new Component[]{sourceTitleLabel, sourceComboBox}; + + double hGap = hasRefreshButton ? 0 : TableLayout4VanChartHelper.COMPONENT_INTERVAL; + Component[][] components = new Component[][]{ + new Component[]{null, null}, + comps, + }; + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, hGap, LayoutConstants.VGAP_LARGE); + } + + protected UILabel createSourceTitleLabel() { + return new UILabel(Toolkit.i18nText("Fine-Design_Chart_Map_Area")); + } + + protected TreeNode getRootNode() { + return GEOJSONTreeHelper.getInstance().getRootNodeWithPara(); + } + + private String[] getParamsName() { + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + + if (jTemplate == null) { + return new String[0]; + } + + Parameter[] parameters = jTemplate.getJTemplateParameters(); + + int len = parameters.length; + String[] names = new String[len]; + + for (int i = 0; i < len; i++) { + names[i] = parameters[i].getName(); + } + + return names; + } + + private PopupMenuListener popupMenuListener = new PopupMenuListener() { + public void popupMenuCanceled(PopupMenuEvent e) { + } + + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + } + + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + + GEOJSONTreeHelper.reset(); + mapDataTree.changeRootNode(GeoUrlPane.this.getRootNode()); + GEOJSONTreeHelper.getInstance().updateParamRootNode(GeoUrlPane.this.getParamsName()); + + if (selectTreePath != null) { + mapDataTree.setSelectNodePath(CompatibleGEOJSONHelper.completeJSONName(selectTreePath.getLastPathComponent().toString())); + selectTreePath = mapDataTree.getSelectionPath(); + } + + mapDataTree.updateUI();//因为服务器那边可能随时编辑,所以这边要重画 + mapDataTree.setSelectionPath(selectTreePath); + mapDataTree.scrollPathToVisible(selectTreePath); + } + }; + + public void populate(VanChartMapPlot mapPlot) { + resetComponentValue(mapPlot, false); + String geoUrl = mapPlot.getGeoUrl(); + mapDataTree.setSelectNodePath(geoUrl); + selectTreePath = mapDataTree.getSelectionPath(); + + if (selectTreePath == null) {//此url当前环境没有 + sourceComboBox.setSelectedItem(geoUrl); + } else { + sourceComboBox.setSelectedItem(selectTreePath); + } + boolean enabled = !CompatibleGEOJSONHelper.isDeprecated(mapPlot.getGeoUrl()); + GUICoreUtils.setEnabled(sourceComboBox, enabled); + } + + public String update() { + return mapDataTree.getSelectNodeJSONPath(); + } + + protected void resetComponentValue(VanChartMapPlot mapPlot, boolean samePlotChange) { + MapType mapType = mapPlot.getMapType(); + + //获取最新的参数 + String[] params = getParamsName(); + + if (!ComparatorUtils.equals(oldParams, params)) { + oldParams = params; + GEOJSONTreeHelper.getInstance().updateParamRootNode(params); + } + + mapDataTree.changeRootNode(this.getRootNode()); + if (samePlotChange) { + String nodePath = ChartGEOJSONHelper.getDefaultJSONURL(); + mapPlot.setGeoUrl(nodePath); + mapDataTree.setSelectNodePath(nodePath); + selectTreePath = mapDataTree.getSelectionPath(); + sourceComboBox.setSelectedItem(selectTreePath); + } + switch (mapType) { + case CUSTOM: + sourceTitleLabel.setText(Toolkit.i18nText("Fine-Design_Chart_Map_Area_And_Point")); + break; + case POINT: + sourceTitleLabel.setText(Toolkit.i18nText("Fine-Design_Chart_Map_Point")); + break; + case LINE: + sourceTitleLabel.setText(Toolkit.i18nText("Fine-Design_Chart_Map_Point")); + break; + default: + sourceTitleLabel.setText(Toolkit.i18nText("Fine-Design_Chart_Map_Area")); + } + } +} 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 new file mode 100644 index 0000000000..406b896104 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java @@ -0,0 +1,303 @@ +package com.fr.van.chart.map.designer.type; + +import com.fr.base.Utils; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.base.GisLayer; +import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.server.MapLayerConfigManager; +import com.fr.plugin.chart.type.GISLayerType; +import com.fr.plugin.chart.type.GaoDeGisType; +import com.fr.plugin.chart.type.ZoomLevel; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.BorderFactory; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JPanel; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ItemEvent; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-07 + */ +public class GisLayerPane extends JPanel implements UIObserver { + + private UIButtonGroup gisButton; + private JPanel layerPaneCheckPane; + private UIComboBox gisGaoDeLayer; + private UIComboBox gisLayer; + private JPanel layerCardPane; + + private WMSLayerPane wmsLayerPane; + private TileLayerPane tileLayerPane; + + private UIComboBox zoomLevel; + + private String[] layers = MapLayerConfigManager.getLayerItems(); + + public GisLayerPane() { + initComps(); + } + + private void initComps() { + this.setLayout(new BorderLayout()); + this.add(createGISLayerPane(), BorderLayout.CENTER); + } + + @Override + public void registerChangeListener(UIObserverListener listener) { + this.wmsLayerPane.registerChangeListener(listener); + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } + + public void registerZoomLevel(UIComboBox zoomLevel) { + this.zoomLevel = zoomLevel; + } + + private boolean isStandardGis() { + return gisButton.getSelectedIndex() == 0; + } + + + private JPanel createGISLayerPane() { + gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); + gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems()); + gisButton.addActionListener(event -> { + refreshZoomLevel(); + checkLayerCardPane(); + }); + + gisGaoDeLayer.addItemListener(event -> refreshZoomLevel()); + + initCustomGISLayerPane(); + initLayerCardPane(); + + layerPaneCheckPane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (isStandardGis()) { + return gisGaoDeLayer.getPreferredSize(); + } else { + return gisLayer.getPreferredSize(); + } + } + }; + layerPaneCheckPane.add(gisGaoDeLayer, "standard"); + layerPaneCheckPane.add(gisLayer, "custom"); + + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] row = {p, p, p}; + double[] col = {f, e}; + + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gis_Layer")), gisButton}, + new Component[]{null, layerPaneCheckPane}, + new Component[]{layerCardPane, null}, + }; + + JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); + panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + return panel; + } + + private void initLayerCardPane() { + tileLayerPane = new TileLayerPane(); + wmsLayerPane = new WMSLayerPane(); + + layerCardPane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (isStandardGis()) { + return new Dimension(0, 0); + } + String itemName = Utils.objectToString(gisLayer.getSelectedItem()); + if (MapLayerConfigManager.isCustomLayer(itemName)) { + return tileLayerPane.getPreferredSize(); + } else if (MapLayerConfigManager.isCustomWmsLayer(itemName)) { + return wmsLayerPane.getPreferredSize(); + } + return new Dimension(0, 0); + } + }; + + for (String itemName : layers) { + JPanel pane = new JPanel(); + if (MapLayerConfigManager.isCustomLayer(itemName)) { + pane = tileLayerPane; + } else if (MapLayerConfigManager.isCustomWmsLayer(itemName)) { + pane = wmsLayerPane; + } + layerCardPane.add(pane, itemName); + } + } + + private void initCustomGISLayerPane() { + gisLayer = new UIComboBox(layers); + + gisLayer.addItemListener(e -> + { + if (e.getStateChange() == ItemEvent.SELECTED) { + checkCustomLayerCardPane(); + } + refreshZoomLevel(); + } + ); + + gisLayer.addPopupMenuListener(new PopupMenuListener() { + public void popupMenuCanceled(PopupMenuEvent e) { + } + + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + } + + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + + String selected = Utils.objectToString(gisLayer.getSelectedItem()); + ZoomLevel zoomSelected = (ZoomLevel) zoomLevel.getSelectedItem(); + + gisLayer.setModel(new DefaultComboBoxModel(MapLayerConfigManager.getLayerItems())); + + gisLayer.setSelectedItem(selected); + zoomLevel.setSelectedItem(zoomSelected); + } + }); + } + + private void refreshZoomLevel() { + //gis图层不同,对应的缩放等级不同。 + ZoomLevel[] levels; + if (isStandardGis()) { + if (gisGaoDeLayer.getSelectedIndex() == gisGaoDeLayer.getItemCount() - 1) { + levels = MapStatusPane.ZOOM_LEVELS; + } else { + levels = MapStatusPane.GAODE_ZOOM_LEVELS; + } + } else { + if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Toolkit.i18nText("Fine-Design_Chart_Layer_Blue"))) { + levels = MapStatusPane.BLUE_ZOOM_LEVELS; + } else if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Toolkit.i18nText("Fine-Design_Chart_Layer_GaoDe"))) { + levels = MapStatusPane.GAODE_ZOOM_LEVELS; + } else { + levels = MapStatusPane.ZOOM_LEVELS; + } + } + zoomLevel.setModel(new DefaultComboBoxModel(levels)); + } + + + private void checkLayerCardPane() { + CardLayout cardLayout = (CardLayout) layerPaneCheckPane.getLayout(); + cardLayout.show(layerPaneCheckPane, isStandardGis() ? "standard" : "custom"); + } + + private void checkCustomLayerCardPane() { + CardLayout cardLayout = (CardLayout) layerCardPane.getLayout(); + cardLayout.show(layerCardPane, Utils.objectToString(gisLayer.getSelectedItem())); + } + + public void resetGisLayer(VanChartMapPlot mapPlot) { + //TODO Bjorn 地图gis图层自动逻辑 + /* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO); + mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/ + + 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) { + switch (layer.getGisLayerType()) { + case GAO_DE_API: + case LAYER_NULL: + populateStandardGis(layer); + break; + default: + populateCustomGis(layer); + } + refreshZoomLevel(); + + checkCustomLayerCardPane(); + checkLayerCardPane(); + } + + private void populateStandardGis(GisLayer layer) { + gisButton.setSelectedIndex(0); + if (layer.getGisLayerType() == GISLayerType.LAYER_NULL) { + gisGaoDeLayer.setSelectedIndex(gisGaoDeLayer.getItemCount() - 1); + } else { + gisGaoDeLayer.setSelectedItem(layer.getGaoDeGisType().getTypeName()); + } + } + + private void populateCustomGis(GisLayer layer) { + gisButton.setSelectedIndex(1); + gisLayer.setSelectedItem(layer.getShowItemName()); + + switch (layer.getGisLayerType()) { + case CUSTOM_WMS_LAYER: + wmsLayerPane.populate(layer); + break; + case CUSTOM_TILE_LAYER: + tileLayerPane.populate(layer); + break; + } + } + + public void update(GisLayer layer) { + if (isStandardGis()) { + updateStandardGis(layer); + } else { + updateCustomGis(layer); + } + } + + private void updateStandardGis(GisLayer layer) { + String layerName = Utils.objectToString(gisGaoDeLayer.getSelectedItem()); + layer.setLayerName(layerName); + if (gisGaoDeLayer.getSelectedIndex() == gisGaoDeLayer.getItemCount() - 1) { + layer.setGisLayerType(MapLayerConfigManager.getGisLayerType(layerName)); + } else { + layer.setGisLayerType(GISLayerType.GAO_DE_API); + layer.setGaoDeGisType(GaoDeGisType.parseByLocaleName(layerName)); + } + } + + private void updateCustomGis(GisLayer layer) { + String layerName = Utils.objectToString(gisLayer.getSelectedItem()); + layer.setLayerName(layerName); + layer.setGisLayerType(MapLayerConfigManager.getGisLayerType(layerName)); + + switch (layer.getGisLayerType()) { + case CUSTOM_WMS_LAYER: + wmsLayerPane.update(layer); + break; + case CUSTOM_TILE_LAYER: + tileLayerPane.update(layer); + break; + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java new file mode 100644 index 0000000000..668a9b7745 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java @@ -0,0 +1,167 @@ +package com.fr.van.chart.map.designer.type; + +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.plugin.chart.base.ViewCenter; +import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.type.ZoomLevel; +import com.fr.stable.ArrayUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-07 + */ +public class MapStatusPane extends JPanel { + + public static final ZoomLevel[] ZOOM_LEVELS = new ZoomLevel[]{ + ZoomLevel.AUTO, + ZoomLevel.ZERO, ZoomLevel.ZEROPOINTFIVE, + ZoomLevel.ONE, ZoomLevel.ONEPOINTFIVE, + ZoomLevel.TWO, ZoomLevel.TWOPOINTFIVE, + ZoomLevel.THREE, ZoomLevel.THREEPOINTFIVE, + ZoomLevel.FOUR, ZoomLevel.FOURPOINTFIVE, + ZoomLevel.FIVE, ZoomLevel.FIVEPOINTFIVE, + ZoomLevel.SIX, ZoomLevel.SIXPOINTFIVE, + ZoomLevel.SEVEN, ZoomLevel.SEVENPOINTFIVE, + ZoomLevel.EIGHT, ZoomLevel.EIGHTPOINTFIVE, + ZoomLevel.NINE, ZoomLevel.NINEPOINTFIVE, + ZoomLevel.TEN, ZoomLevel.TENPOINTFIVE, + ZoomLevel.ELEVEN, ZoomLevel.ELEVENTPOINTFIVE, + ZoomLevel.TWELVE, ZoomLevel.TWELVEPOINTFIVE, + ZoomLevel.THIRTEEN, ZoomLevel.THIRTEENPOINTFIVE, + ZoomLevel.FOURTEEN, ZoomLevel.FOURTEENPOINTFIVE, + ZoomLevel.FIFTEEN, ZoomLevel.FIFTEENPOINTFIVE, + ZoomLevel.SIXTEEN, ZoomLevel.SIXTEENPOINTFIVE, + ZoomLevel.SEVENTEEN, ZoomLevel.SEVENTEENPOINTFIVE, + ZoomLevel.EIGHTEEN + }; + //深蓝和高德地图下拉框层级 + public static final ZoomLevel[] BLUE_ZOOM_LEVELS = ArrayUtils.subarray(ZOOM_LEVELS, 0, 34); + public static final ZoomLevel[] GAODE_ZOOM_LEVELS = ArrayUtils.addAll(new ZoomLevel[]{ZoomLevel.AUTO}, (ZoomLevel[]) ArrayUtils.subarray(ZOOM_LEVELS, 7, 38)); + private static final String AUTO_CENTER_STRING = Toolkit.i18nText("Fine-Design_Chart_Automatic"); + private static final String CUSTOM_CENTER_STRING = Toolkit.i18nText("Fine-Design_Chart_Custom"); + + + private JPanel levelAndCenterPane; + private JPanel longAndLatPane; + + private UIComboBox zoomLevel; + private UIButtonGroup viewCenterCom; + private UISpinner longitude; + private UISpinner latitude; + + public MapStatusPane() { + initComps(); + } + + public UIComboBox getZoomLevel() { + return zoomLevel; + } + + private void initComps() { + zoomLevel = new UIComboBox(ZOOM_LEVELS); + viewCenterCom = new UIButtonGroup(new String[]{AUTO_CENTER_STRING, CUSTOM_CENTER_STRING}); + longitude = new UISpinner(-Double.MAX_VALUE, Double.MAX_VALUE, 1, 0.0); + latitude = new UISpinner(-Double.MAX_VALUE, Double.MAX_VALUE, 1, 0.0); + + double p = TableLayout.PREFERRED; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double[] rowSize = {p, p, p}; + double[] columnSize = {d, e}; + double[] column = {d, s}; + + Component[][] comps = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")), zoomLevel}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_View_Center")), viewCenterCom}, + }; + levelAndCenterPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, columnSize); + + Component[][] longAndLatComps = new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitude}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitude} + }; + longAndLatPane = TableLayout4VanChartHelper.createGapTableLayoutPane(longAndLatComps, rowSize, column); + longAndLatPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); + longAndLatPane.setVisible(false); + + this.setLayout(new BorderLayout(0, 6)); + + this.add(levelAndCenterPane, BorderLayout.NORTH); + this.add(longAndLatPane, BorderLayout.CENTER); + + viewCenterCom.addActionListener(event -> + longAndLatPane.setVisible(!isAutoViewCenter())); + } + + @Override + public Dimension getPreferredSize() { + if (longAndLatPane.isVisible()) { + return super.getPreferredSize(); + } else { + return levelAndCenterPane.getPreferredSize(); + } + } + + private boolean isAutoViewCenter() { + return viewCenterCom.getSelectedIndex() == 0; + } + + + public void resetViewCenter(VanChartMapPlot mapPlot) { + mapPlot.setViewCenter(new ViewCenter()); + viewCenterCom.setSelectedIndex(0); + longitude.setValue(0); + latitude.setValue(0); + longAndLatPane.setVisible(false); + } + + public void resetZoomLevel(VanChartMapPlot mapPlot) { + mapPlot.setZoomLevel(ZoomLevel.AUTO); + zoomLevel.setSelectedItem(mapPlot.getZoomLevel()); + } + + public void populate(VanChartMapPlot mapPlot) { + zoomLevel.setSelectedItem(mapPlot.getZoomLevel()); + + ViewCenter viewCenter = mapPlot.getViewCenter(); + if (viewCenter.isAuto()) { + viewCenterCom.setSelectedIndex(0); + longitude.setValue(0); + latitude.setValue(0); + } else { + viewCenterCom.setSelectedIndex(1); + longitude.setValue(viewCenter.getLongitude()); + latitude.setValue(viewCenter.getLatitude()); + } + + longAndLatPane.setVisible(!isAutoViewCenter()); + } + + public void update(VanChartMapPlot mapPlot) { + mapPlot.setZoomLevel((ZoomLevel) zoomLevel.getSelectedItem()); + + ViewCenter viewCenter = mapPlot.getViewCenter(); + if (isAutoViewCenter()) { + viewCenter.setAuto(true); + } else { + viewCenter.setAuto(false); + viewCenter.setLongitude(longitude.getValue()); + viewCenter.setLatitude(latitude.getValue()); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java new file mode 100644 index 0000000000..4101fbd9d5 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java @@ -0,0 +1,51 @@ +package com.fr.van.chart.map.designer.type; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextarea.UITextArea; +import com.fr.design.layout.TableLayout; +import com.fr.plugin.chart.base.GisLayer; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-07 + */ +public class TileLayerPane extends JPanel { + + private UITextArea customTileLayer; + private UITextArea attribution; + + + public TileLayerPane() { + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p}; + double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH - 3}; + + customTileLayer = new UITextArea(); + attribution = new UITextArea(); + Component[][] comps = new Component[][]{ + new Component[]{new UILabel("url"), customTileLayer}, + new Component[]{new UILabel("Attribution"), attribution} + }; + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE); + panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); + + this.setLayout(new BorderLayout()); + this.add(panel, BorderLayout.CENTER); + } + + public void populate(GisLayer layer) { + customTileLayer.setText(layer.getCustomTileLayer()); + attribution.setText(layer.getAttribution()); + } + + public void update(GisLayer layer) { + layer.setCustomTileLayer(customTileLayer.getText()); + layer.setAttribution(attribution.getText()); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java index a4356be870..a5e26427b3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java @@ -78,7 +78,6 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { boolean enabled = !CompatibleGEOJSONHelper.isDeprecated(plot.getGeoUrl()); GUICoreUtils.setEnabled(this.getTypePane(), enabled); - GUICoreUtils.setEnabled(this.sourceChoosePane.getSourceComboBox(), enabled); checkDemosBackground(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index bbe9d7dd44..5be437619c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -1,739 +1,113 @@ package com.fr.van.chart.map.designer.type; -import com.fr.base.Parameter; -import com.fr.base.Utils; -import com.fr.decision.webservice.v10.map.WMSFactory; -import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; -import com.fr.design.constants.LayoutConstants; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; -import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.icombobox.FRTreeComboBox; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.gui.itextarea.UITextArea; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.JTemplate; -import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; -import com.fr.general.http.HttpClient; -import com.fr.plugin.chart.base.GisLayer; -import com.fr.plugin.chart.base.ViewCenter; import com.fr.plugin.chart.map.VanChartMapPlot; -import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; -import com.fr.plugin.chart.map.layer.WMSLayer; -import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; -import com.fr.plugin.chart.map.server.MapLayerConfigManager; -import com.fr.plugin.chart.type.GISLayerType; -import com.fr.plugin.chart.type.MapType; -import com.fr.plugin.chart.type.ZoomLevel; -import com.fr.stable.ArrayUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree; -import com.fr.workspace.WorkContext; import javax.swing.BorderFactory; -import javax.swing.DefaultComboBoxModel; import javax.swing.JPanel; -import javax.swing.SwingConstants; -import javax.swing.SwingWorker; -import javax.swing.event.PopupMenuEvent; -import javax.swing.event.PopupMenuListener; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.TreeNode; -import javax.swing.tree.TreePath; -import java.util.ArrayList; -import java.util.List; 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.MouseEvent; -import java.awt.event.MouseListener; /** * Created by Mitisky on 16/5/11. * 地图类型选择面板,关于json资源路径/gis图层等设置面板 */ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { - private static final double[] COLUMN_SIZE = {48, TableLayout.FILL, TableLayout.PREFERRED}; - public static final ZoomLevel[] ZOOM_LEVELS = new ZoomLevel[]{ - ZoomLevel.AUTO, - ZoomLevel.ZERO, ZoomLevel.ZEROPOINTFIVE, - ZoomLevel.ONE, ZoomLevel.ONEPOINTFIVE, - ZoomLevel.TWO, ZoomLevel.TWOPOINTFIVE, - ZoomLevel.THREE, ZoomLevel.THREEPOINTFIVE, - ZoomLevel.FOUR, ZoomLevel.FOURPOINTFIVE, - ZoomLevel.FIVE, ZoomLevel.FIVEPOINTFIVE, - ZoomLevel.SIX, ZoomLevel.SIXPOINTFIVE, - ZoomLevel.SEVEN, ZoomLevel.SEVENPOINTFIVE, - ZoomLevel.EIGHT, ZoomLevel.EIGHTPOINTFIVE, - ZoomLevel.NINE, ZoomLevel.NINEPOINTFIVE, - ZoomLevel.TEN, ZoomLevel.TENPOINTFIVE, - ZoomLevel.ELEVEN, ZoomLevel.ELEVENTPOINTFIVE, - ZoomLevel.TWELVE, ZoomLevel.TWELVEPOINTFIVE, - ZoomLevel.THIRTEEN, ZoomLevel.THIRTEENPOINTFIVE, - ZoomLevel.FOURTEEN, ZoomLevel.FOURTEENPOINTFIVE, - ZoomLevel.FIFTEEN, ZoomLevel.FIFTEENPOINTFIVE, - ZoomLevel.SIXTEEN, ZoomLevel.SIXTEENPOINTFIVE, - ZoomLevel.SEVENTEEN, ZoomLevel.SEVENTEENPOINTFIVE, - ZoomLevel.EIGHTEEN - }; - //深蓝和高德地图下拉框层级 - private static final ZoomLevel[] BLUE_ZOOM_LEVELS =(ZoomLevel[]) ArrayUtils.subarray(ZOOM_LEVELS, 0, 34); - private static final ZoomLevel[] GAODE_ZOOM_LEVELS =ArrayUtils.addAll(new ZoomLevel[]{ZoomLevel.AUTO}, (ZoomLevel[])ArrayUtils.subarray(ZOOM_LEVELS, 7, 38)); - private static final String AUTO_CENTER_STRING = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"); - private static final String CUSTOM_CENTER_STRING = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom"); - private UILabel sourceTitleLabel; - private FRTreeComboBox sourceComboBox; - private MapDataTree mapDataTree; - private TreePath selectTreePath; + private GeoUrlPane geoUrlPane; - private UIComboBox gisLayer; - private JPanel layerCardPane; + private GisLayerPane gisLayerPane; - private UITextArea wmsUrl; - private UIButton connectButton; - private JPanel wmsLayerPane; - - private java.util.List wmsLayerCheckBoxs = new ArrayList(); - - private UITextArea customTileLayer; - private UITextArea attribution; - - private UIComboBox zoomLevel; - private UIButtonGroup viewCenterCom; - private JPanel longAndLatPane; - private UISpinner longitude; - private UISpinner latitude; - - private String[] oldParams; - - private UIObserverListener listener; - private String[] layers = MapLayerConfigManager.getLayerItems(); - /** - * 给组件登记一个观察者监听事件 - * - * @param listener 观察者监听事件 - */ - @Override - public void registerChangeListener(UIObserverListener listener) { - this.listener = listener; - } - - /** - * 组件是否需要响应添加的观察者事件 - * - * @return 如果需要响应观察者事件则返回true,否则返回false - */ - @Override - public boolean shouldResponseChangeListener() { - return true; - } + private MapStatusPane mapStatusPane; public VanChartMapSourceChoosePane() { + initGeoUrlPane(); + initMapStatusPane(); + initGisLayerPane(); + this.setLayout(new BorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10,5,0,0)); + this.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); double p = TableLayout.PREFERRED; double[] columnSize = {230}; - double[] rowSize = {p,p,p,p,p,p,p,p}; + double[] rowSize = {p, p, p, p, p, p, p, p}; JPanel panel = new JPanel(new BorderLayout()); - panel.add(createMapSourcesPane(), BorderLayout.NORTH); - panel.add(createGISLayerPane(), BorderLayout.CENTER); - JPanel BasePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), panel); + panel.add(geoUrlPane, BorderLayout.NORTH); + panel.add(gisLayerPane, BorderLayout.CENTER); + JPanel basePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Report_Basic"), panel); + + JPanel mapStatusPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Map_Init_Status"), mapStatusPane); Component[][] comps = new Component[][]{ - new Component[]{BasePane}, - new Component[]{createMapInitStatusPane()} + new Component[]{basePane}, + new Component[]{mapStatusPaneWithTitle} }; - JPanel contentPane = TableLayoutHelper.createTableLayoutPane(comps,rowSize,columnSize); + JPanel contentPane = TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize); this.add(contentPane, BorderLayout.CENTER); } - protected boolean supportParam(){ - return true; - } - - protected TreeNode getRootNode() { - return supportParam() ? GEOJSONTreeHelper.getInstance().getRootNodeWithPara() : GEOJSONTreeHelper.getInstance().getRootNodeWithoutPara(); + public void setGeoUrlPane(GeoUrlPane geoUrlPane) { + this.geoUrlPane = geoUrlPane; } - protected UILabel createSourceTitleLabel() { - return new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Area")); - } - - private JPanel createMapSourcesPane() { - mapDataTree = new MapDataTree(this.getRootNode()); - mapDataTree.setEditable(false); - mapDataTree.selectDefaultTreeNode(); - sourceComboBox = new FRTreeComboBox(mapDataTree, mapDataTree.getCellRenderer()){ - //搜索 - protected void dealSamePath(TreePath parent, TreeNode node, UITextField textField){ - String searchText = textField.getText(); - VanChartMapSourceChoosePane.this.mapDataTree.search(searchText); - } - - //选中 tree---combobox - public void setSelectedItem(Object o) { - TreePath oldPath = mapDataTree.getSelectionPath(); - Object oldText = getSelectedItem(); - if(o != null && o instanceof TreePath){ - selectTreePath =(TreePath)o; - this.tree.setSelectionPath(selectTreePath); - this.getModel().setSelectedItem(pathToString(selectTreePath)); - if(ComparatorUtils.equals(oldText, getSelectedItem()) && !ComparatorUtils.equals(oldPath, selectTreePath)) { - //point的江苏省切换到area的江苏省 - listener.doChange(); - } - } else if(o instanceof String){//list里面没有 - selectTreePath = null; - this.tree.setSelectionPath(null); - this.getModel().setSelectedItem(ChartGEOJSONHelper.getPresentNameWithPath((String) o)); - } - } - - @Override - protected String pathToString(TreePath path) { - DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent(); - //不显示后缀 - return ChartGEOJSONHelper.getPresentNameWithPath(node.toString()); - } - - @Override - protected boolean customSelectable(DefaultMutableTreeNode node){ - return GEOJSONTreeHelper.isSelectableTreeNode(node); - } - }; - sourceComboBox.setEditable(true); - sourceComboBox.setOnlyLeafSelectable(false); - sourceComboBox.addPopupMenuListener(popupMenuListener); - - sourceTitleLabel = createSourceTitleLabel(); - - boolean hasRefreshButton = !WorkContext.getCurrent().isLocal(); - - UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/control/refresh.png")); - button.setToolTipText(Toolkit.i18nText("Fine-Design_Chart_Update_Remote_Map_JSON")); - button.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - GEOJSONHelper.reset(); - GEOJSONHelper.getInstance(); - } - }); - - - double p = TableLayout.PREFERRED; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] rowSize = {p, p}; - - double[] columnSize = hasRefreshButton ? new double[]{d + 10, e - 20, 20} : new double[]{d, e}; - Component[] comps = hasRefreshButton ? new Component[]{sourceTitleLabel, sourceComboBox, button} : new Component[]{sourceTitleLabel, sourceComboBox}; - double hGap = hasRefreshButton ? 0 : TableLayout4VanChartHelper.COMPONENT_INTERVAL; - Component[][] components = new Component[][]{ - new Component[]{null,null}, - comps, - - }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, hGap, LayoutConstants.VGAP_LARGE); - } - - private JPanel createGISLayerPane() { - JPanel panel = new JPanel(new BorderLayout(0, 8)); - - gisLayer = new UIComboBox(layers); - - gisLayer.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - refreshZoomLevel(); - } - }); - - gisLayer.addPopupMenuListener(new PopupMenuListener() { - public void popupMenuCanceled(PopupMenuEvent e) { - } - - public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { - } - - public void popupMenuWillBecomeVisible(PopupMenuEvent e) { - - String selected = Utils.objectToString(gisLayer.getSelectedItem()); - ZoomLevel zoomSelected = (ZoomLevel) zoomLevel.getSelectedItem(); - - gisLayer.setModel(new DefaultComboBoxModel(MapLayerConfigManager.getLayerItems())); - - gisLayer.setSelectedItem(selected); - zoomLevel.setSelectedItem(zoomSelected); - } - }); - - - gisLayer.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { - checkLayerCardPane(); - } - } - }); - - final JPanel tileLyaerPane = createCustomTileLayer(); - final JPanel wmsLayerPane = createWMSPanel(); - - layerCardPane = new JPanel(new CardLayout()){ - @Override - public Dimension getPreferredSize() { - String itemName = Utils.objectToString(gisLayer.getSelectedItem()); - if (MapLayerConfigManager.isCustomLayer(itemName)) { - return tileLyaerPane.getPreferredSize(); - } else if (MapLayerConfigManager.isCustomWmsLayer(itemName)) { - return wmsLayerPane.getPreferredSize(); - } - return new Dimension(0,0); - } - }; - - for(String itemName : layers){ - JPanel pane = new JPanel(); - if (MapLayerConfigManager.isCustomLayer(itemName)) { - pane = tileLyaerPane; - } else if (MapLayerConfigManager.isCustomWmsLayer(itemName)) { - pane = wmsLayerPane; - } - - layerCardPane.add(pane, itemName); - } - - JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gis_Layer"), gisLayer); - - panel.add(panel1, BorderLayout.CENTER); - panel.add(layerCardPane, BorderLayout.SOUTH); - - return panel; - } - - private void refreshZoomLevel(){ - //gis图层不同,对应的缩放等级不同。 - ZoomLevel[] levels; - if (ComparatorUtils.equals(gisLayer.getSelectedItem(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Blue"))) { - levels = BLUE_ZOOM_LEVELS; - } else if (ComparatorUtils.equals(gisLayer.getSelectedItem(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_GaoDe"))) { - levels = GAODE_ZOOM_LEVELS; - } else { - levels = ZOOM_LEVELS; - } - zoomLevel.setModel(new DefaultComboBoxModel(levels)); - } - - - private JPanel createCustomTileLayer() { - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p}; - double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH-3}; - - customTileLayer = new UITextArea(); - attribution = new UITextArea(); - Component[][] comps = new Component[][]{ - new Component[]{new UILabel("url"), customTileLayer}, - new Component[]{new UILabel("Attribution"), attribution} - }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE); - panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); - return panel; - } - - private JPanel createWMSPanel() { - - final double p = TableLayout.PREFERRED; - double[] rowSize = {p}; - double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84,44}; - - - wmsUrl = new UITextArea(); - connectButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); - - Component[][] comps = new Component[][]{ - new Component[]{new UILabel("url"), wmsUrl, connectButton} - }; - JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE); - northPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); - JPanel wmsPanel = new JPanel(new BorderLayout(0, 4)); - wmsLayerPane = new JPanel(new BorderLayout()); - resetWMSLayerPane(new ArrayList()); - wmsPanel.add(northPane, BorderLayout.NORTH); - wmsPanel.add(wmsLayerPane, BorderLayout.CENTER); - - connectButton.addActionListener(actionListener); - - addMouseListener(); - - return wmsPanel; - } - - ActionListener actionListener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - - new SwingWorker() { - private java.util.List list = new ArrayList<>(); - - @Override - protected Void doInBackground() throws Exception { - HttpClient httpClient = new HttpClient(wmsUrl.getText() + "service=WMS&request=GetCapabilities"); - httpClient.asGet(); - - if (!httpClient.isServerAlive()) { - return null; - } - - String res = httpClient.getResponseText(); - List layers = WMSFactory.readLayers(res); - list.clear(); - for (String layer : layers) { - list.add(new WMSLayer(layer, false)); - } - return null; - } - - @Override - protected void done() { - connectButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); - if(list != null && list.size() > 0) { - resetWMSLayerPane(list); - } else { - FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Invalid_WMS")); - } - } - }.execute(); - } - }; - - private void addMouseListener() { - connectButton.addMouseListener(new MouseListener() { - @Override - public void mouseClicked(MouseEvent e) { - - } - - @Override - public void mousePressed(MouseEvent e) { - connectButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Connecting_WMP")); - } - - @Override - public void mouseReleased(MouseEvent e) { - - } - - @Override - public void mouseEntered(MouseEvent e) { - - } - - @Override - public void mouseExited(MouseEvent e) { - - } - }); + @Override + public void registerChangeListener(UIObserverListener listener) { + geoUrlPane.registerChangeListener(listener); + gisLayerPane.registerChangeListener(listener); } - private void resetWMSLayerPane(java.util.List wmsLayers) { - - int size = wmsLayers.size(); - double[] rowSize = new double[size]; - Component[][] comps = new Component[size][2]; - wmsLayerCheckBoxs.clear(); - wmsLayerPane.removeAll(); - for(int i =0; i < size; i++){ - rowSize[i] = TableLayout.PREFERRED; - comps[i][0] = i == 0 ? new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_WMS_Layers"), SwingConstants.RIGHT) : null; - WMSLayer layer = wmsLayers.get(i); - UICheckBox checkBox = new UICheckBox(layer.getLayer()); - checkBox.registerChangeListener(listener); - checkBox.setToolTipText(layer.getLayer()); - checkBox.setSelected(layer.isSelected()); - comps[i][1] = checkBox; - wmsLayerCheckBoxs.add(checkBox); - } - - wmsLayerPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps,rowSize, COLUMN_SIZE,0), BorderLayout.CENTER); - - VanChartMapSourceChoosePane.this.updateUI(); + @Override + public boolean shouldResponseChangeListener() { + return true; } - private JPanel createMapInitStatusPane() { - zoomLevel = new UIComboBox(ZOOM_LEVELS); - viewCenterCom = new UIButtonGroup(new String[]{AUTO_CENTER_STRING, CUSTOM_CENTER_STRING}); - longitude = new UISpinner(-Double.MAX_VALUE,Double.MAX_VALUE,1,0.0); - latitude = new UISpinner(-Double.MAX_VALUE,Double.MAX_VALUE,1,0.0); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; - double[] rowSize = {p,p,p}; - double[] columnSize = {d, e}; - double[] column = {d, s}; - - Component[][] comps = new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")), zoomLevel}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_View_Center")), viewCenterCom}, - }; - final JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps,rowSize,columnSize); - - Component[][] longAndLatComps = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitude}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitude} - }; - longAndLatPane =TableLayout4VanChartHelper.createGapTableLayoutPane(longAndLatComps,rowSize,column); - longAndLatPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); - longAndLatPane.setVisible(false); - - JPanel contentPane = new JPanel(new BorderLayout(0, 6)){ - - @Override - public Dimension getPreferredSize() { - if(longAndLatPane.isVisible()) { - return super.getPreferredSize(); - } else { - return northPane.getPreferredSize(); - } - } - }; - contentPane.add(northPane, BorderLayout.NORTH); - contentPane.add(longAndLatPane, BorderLayout.CENTER); - - viewCenterCom.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - longAndLatPane.setVisible(!isAutoViewCenter()); - } - }); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Init_Status"), contentPane); + protected void initGeoUrlPane() { + geoUrlPane = new GeoUrlPane(); } - private boolean isAutoViewCenter() { - return viewCenterCom.getSelectedIndex()==0; + private void initGisLayerPane() { + gisLayerPane = new GisLayerPane(); + gisLayerPane.registerZoomLevel(mapStatusPane.getZoomLevel()); } - private PopupMenuListener popupMenuListener = new PopupMenuListener() { - public void popupMenuCanceled(PopupMenuEvent e) { - } - - public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { - } - - public void popupMenuWillBecomeVisible(PopupMenuEvent e) { - - GEOJSONTreeHelper.reset(); - mapDataTree.changeRootNode(VanChartMapSourceChoosePane.this.getRootNode()); - GEOJSONTreeHelper.getInstance().updateParamRootNode(VanChartMapSourceChoosePane.this.getParams()); - - if(selectTreePath != null){ - mapDataTree.setSelectNodePath(CompatibleGEOJSONHelper.completeJSONName(selectTreePath.getLastPathComponent().toString())); - selectTreePath = mapDataTree.getSelectionPath(); - } - - mapDataTree.updateUI();//因为服务器那边可能随时编辑,所以这边要重画 - mapDataTree.setSelectionPath(selectTreePath); - mapDataTree.scrollPathToVisible(selectTreePath); - } - }; - - private void checkLayerCardPane() { - CardLayout cardLayout = (CardLayout) layerCardPane.getLayout(); - cardLayout.show(layerCardPane, Utils.objectToString(gisLayer.getSelectedItem())); + private void initMapStatusPane() { + mapStatusPane = new MapStatusPane(); } public void resetComponentValue(VanChartMapPlot mapPlot) { - resetComponentValue(mapPlot, true); + geoUrlPane.resetComponentValue(mapPlot, true); //重置图层属性 - resetGisLayer(mapPlot); + gisLayerPane.resetGisLayer(mapPlot); //重置缩放等级 - resetZoomLevel(mapPlot); + mapStatusPane.resetZoomLevel(mapPlot); //重置中心点位置 - resetViewCenter(mapPlot); + mapStatusPane.resetViewCenter(mapPlot); } - protected void resetComponentValue(VanChartMapPlot mapPlot, boolean samePlotChange) { - MapType mapType = mapPlot.getMapType(); - - //获取最新的参数 - String[] params = getParams(); - - if (!ComparatorUtils.equals(oldParams, params)){ - oldParams = params; - GEOJSONTreeHelper.getInstance().updateParamRootNode(params); - } - - mapDataTree.changeRootNode(this.getRootNode()); - if(samePlotChange) { - String nodePath = ChartGEOJSONHelper.getDefaultJSONURL(); - mapPlot.setGeoUrl(nodePath); - mapDataTree.setSelectNodePath(nodePath); - selectTreePath = mapDataTree.getSelectionPath(); - sourceComboBox.setSelectedItem(selectTreePath); - } - switch (mapType){ - case CUSTOM: - sourceTitleLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Area_And_Point")); - break; - case POINT: - sourceTitleLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Point")); - break; - case LINE: - sourceTitleLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Point")); - break; - default: - sourceTitleLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Area")); - } - - } - - private String[] getParams() { - JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - if (jTemplate == null){ - return new String[0]; - } - - return getParamsName((jTemplate.getJTemplateParameters())); - } - - private String[] getParamsName(Parameter[] parameters) { - String[] names = new String[parameters.length]; - for (int i = 0; i < parameters.length; i++){ - names[i] = parameters[i].getName(); - } - return names; - } - - private void resetViewCenter(VanChartMapPlot mapPlot) { - mapPlot.setViewCenter(new ViewCenter()); - viewCenterCom.setSelectedIndex(0); - longitude.setValue(0); - latitude.setValue(0); - longAndLatPane.setVisible(false); - } - - private void resetZoomLevel(VanChartMapPlot mapPlot) { - mapPlot.setZoomLevel(ZoomLevel.AUTO); - zoomLevel.setSelectedItem(mapPlot.getZoomLevel()); - } - - private void resetGisLayer(VanChartMapPlot mapPlot) { - //TODO Bjorn 地图gis图层自动逻辑 - /* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO); - mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/ - - String layerName = mapPlot.getDefaultGisLayerName(); - - mapPlot.getGisLayer().setGisLayerType(GISLayerType.PREDEFINED_LAYER); - mapPlot.getGisLayer().setLayerName(layerName); - gisLayer.setSelectedItem(mapPlot.getGisLayer().getShowItemName()); - } public void populateBean(VanChartMapPlot mapPlot) { - resetComponentValue(mapPlot, false); - - mapDataTree.setSelectNodePath(mapPlot.getGeoUrl()); - selectTreePath = mapDataTree.getSelectionPath(); - - if(selectTreePath == null){//此url当前环境没有 - sourceComboBox.setSelectedItem(mapPlot.getGeoUrl()); - } else { - sourceComboBox.setSelectedItem(selectTreePath); - } - - GisLayer layer = mapPlot.getGisLayer(); - gisLayer.setSelectedItem(layer.getShowItemName()); - - wmsUrl.setText(layer.getWmsUrl()); - resetWMSLayerPane(layer.getWmsLayers()); - customTileLayer.setText(layer.getCustomTileLayer()); - attribution.setText(layer.getAttribution()); - - refreshZoomLevel(); - zoomLevel.setSelectedItem(mapPlot.getZoomLevel()); - - ViewCenter viewCenter = mapPlot.getViewCenter(); - if(viewCenter.isAuto()){ - viewCenterCom.setSelectedIndex(0); - longitude.setValue(0); - latitude.setValue(0); - } else { - viewCenterCom.setSelectedIndex(1); - longitude.setValue(viewCenter.getLongitude()); - latitude.setValue(viewCenter.getLatitude()); - } - - longAndLatPane.setVisible(!isAutoViewCenter()); - - checkLayerCardPane(); + geoUrlPane.populate(mapPlot); + gisLayerPane.populate(mapPlot.getGisLayer()); + mapStatusPane.populate(mapPlot); } public void updateBean(VanChartMapPlot mapPlot) { - if(!CompatibleGEOJSONHelper.isDeprecated(mapPlot.getGeoUrl())){ - mapPlot.setGeoUrl(mapDataTree.getSelectNodeJSONPath()); - } - - GisLayer layer = mapPlot.getGisLayer(); - String layerName = Utils.objectToString(gisLayer.getSelectedItem()); - - layer.setLayerName(layerName); - layer.setGisLayerType(MapLayerConfigManager.getGisLayerType(layerName)); - - switch (layer.getGisLayerType()){ - case CUSTOM_WMS_LAYER: - layer.setWmsUrl(wmsUrl.getText()); - layer.setWmsLayers(new ArrayList()); - for(UICheckBox checkBox : wmsLayerCheckBoxs){ - layer.addWmsLayer(new WMSLayer(checkBox.getText(), checkBox.isSelected())); - } - break; - case CUSTOM_TILE_LAYER: - layer.setCustomTileLayer(customTileLayer.getText()); - layer.setAttribution(attribution.getText()); - break; + if (!CompatibleGEOJSONHelper.isDeprecated(mapPlot.getGeoUrl())) { + mapPlot.setGeoUrl(geoUrlPane.update()); } - mapPlot.setZoomLevel((ZoomLevel) zoomLevel.getSelectedItem()); - - ViewCenter viewCenter = mapPlot.getViewCenter(); - if(isAutoViewCenter()){ - viewCenter.setAuto(true); - } else { - viewCenter.setAuto(false); - viewCenter.setLongitude(longitude.getValue()); - viewCenter.setLatitude(latitude.getValue()); - } - } - - public UIComboBox getSourceComboBox(){ - return this.sourceComboBox; + gisLayerPane.update(mapPlot.getGisLayer()); + mapStatusPane.update(mapPlot); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java new file mode 100644 index 0000000000..19afd688f6 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java @@ -0,0 +1,165 @@ +package com.fr.van.chart.map.designer.type; + +import com.fr.decision.webservice.v10.map.WMSFactory; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextarea.UITextArea; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.http.HttpClient; +import com.fr.plugin.chart.base.GisLayer; +import com.fr.plugin.chart.map.layer.WMSLayer; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import javax.swing.SwingWorker; +import java.util.ArrayList; +import java.util.List; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-12-07 + */ +public class WMSLayerPane extends JPanel implements UIObserver { + private static final double[] COLUMN_SIZE = {48, TableLayout.FILL, TableLayout.PREFERRED}; + + private UITextArea wmsUrl; + private UIButton connectButton; + private JPanel wmsLayerPane; + + private List wmsLayerCheckBoxs = new ArrayList<>(); + + private UIObserverListener listener; + + @Override + public void registerChangeListener(UIObserverListener listener) { + this.listener = listener; + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } + + + public WMSLayerPane() { + final double p = TableLayout.PREFERRED; + double[] rowSize = {p}; + double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 44}; + + + wmsUrl = new UITextArea(); + connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); + + Component[][] comps = new Component[][]{ + new Component[]{new UILabel("url"), wmsUrl, connectButton} + }; + JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE); + northPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); + + wmsLayerPane = new JPanel(new BorderLayout()); + resetWMSLayerPane(new ArrayList<>()); + + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); + this.add(wmsLayerPane, BorderLayout.CENTER); + addListener(); + } + + private void addListener() { + connectButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + + new SwingWorker() { + private java.util.List list = new ArrayList<>(); + + @Override + protected Void doInBackground() { + HttpClient httpClient = new HttpClient(wmsUrl.getText() + "service=WMS&request=GetCapabilities"); + httpClient.asGet(); + + if (!httpClient.isServerAlive()) { + return null; + } + + String res = httpClient.getResponseText(); + List layers = WMSFactory.readLayers(res); + list.clear(); + for (String layer : layers) { + list.add(new WMSLayer(layer, false)); + } + return null; + } + + @Override + protected void done() { + connectButton.setText(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); + if (list != null && list.size() > 0) { + resetWMSLayerPane(list); + } else { + FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Chart_Invalid_WMS")); + } + } + }.execute(); + } + }); + + connectButton.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + connectButton.setText(Toolkit.i18nText("Fine-Design_Chart_Connecting_WMP")); + } + }); + } + + private void resetWMSLayerPane(java.util.List wmsLayers) { + int size = wmsLayers.size(); + double[] rowSize = new double[size]; + Component[][] comps = new Component[size][2]; + wmsLayerCheckBoxs.clear(); + wmsLayerPane.removeAll(); + for (int i = 0; i < size; i++) { + rowSize[i] = TableLayout.PREFERRED; + comps[i][0] = i == 0 ? new UILabel(Toolkit.i18nText("Fine-Design_Chart_WMS_Layers"), SwingConstants.RIGHT) : null; + WMSLayer layer = wmsLayers.get(i); + UICheckBox checkBox = new UICheckBox(layer.getLayer()); + checkBox.registerChangeListener(listener); + checkBox.setToolTipText(layer.getLayer()); + checkBox.setSelected(layer.isSelected()); + comps[i][1] = checkBox; + wmsLayerCheckBoxs.add(checkBox); + } + + wmsLayerPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps, rowSize, COLUMN_SIZE, 0), BorderLayout.CENTER); + + updateUI(); + } + + public void populate(GisLayer layer) { + wmsUrl.setText(layer.getWmsUrl()); + resetWMSLayerPane(layer.getWmsLayers()); + } + + public void update(GisLayer layer) { + layer.setWmsUrl(wmsUrl.getText()); + layer.setWmsLayers(new ArrayList<>()); + for (UICheckBox checkBox : wmsLayerCheckBoxs) { + layer.addWmsLayer(new WMSLayer(checkBox.getText(), checkBox.isSelected())); + } + } +} + From 0bb145cb4122d202ce5e3fed895b393d870f5b1a Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Dec 2020 16:06:16 +0800 Subject: [PATCH 011/104] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/JTemplate.java | 12 ++++++++++-- .../com/fr/design/mainframe/JVirtualTemplate.java | 3 +++ 2 files changed, 13 insertions(+), 2 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 316f48fc36..eb191383f9 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 @@ -309,6 +309,13 @@ public abstract class JTemplate> EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_INIT, this); } + /** + * 模板激活之前之前 + */ + protected void beforeActive() { + EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); + } + /** * 模板关闭时 */ @@ -1085,6 +1092,7 @@ public abstract class JTemplate> * 激活指定的template */ public void activeJTemplate(int index, JTemplate jt) { + beforeActive(); DesignerContext.getDesignerFrame().activateJTemplate(this); } @@ -1092,7 +1100,7 @@ public abstract class JTemplate> * 激活已存在的模板 */ public void activeOldJTemplate() { - EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); + beforeActive(); DesignerContext.getDesignerFrame().activateJTemplate(this); } @@ -1100,7 +1108,7 @@ public abstract class JTemplate> * 激活新的模板 */ public void activeNewJTemplate() { - EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); + beforeActive(); DesignerContext.getDesignerFrame().addAndActivateJTemplate(this); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java index 64a10c88f2..911c0dc17a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java @@ -208,6 +208,7 @@ public class JVirtualTemplate extends JTemplate { @Override public void activeJTemplate(int index, JTemplate jt) { + beforeActive(); List> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); historyList.set(index, jt); DesignerContext.getDesignerFrame().addAndActivateJTemplate(jt); @@ -217,11 +218,13 @@ public class JVirtualTemplate extends JTemplate { @Override public void activeOldJTemplate() { + beforeActive(); DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE()); } @Override public void activeNewJTemplate() { + beforeActive(); DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE()); } From 676980d1230f91d5e3ab0c2e304a37b03cc2168b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 15 Dec 2020 17:27:02 +0800 Subject: [PATCH 012/104] =?UTF-8?q?CHART-15835=20=20=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/label/VanChartPlotLabelDetailPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 20ce7452b9..624e6c879e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -158,14 +158,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return jPanel; } - private JPanel createLabelBorderPane() { + protected JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); return borderPaneWithTitle; } - private JPanel createLabelBackgroundPane() { + protected JPanel createLabelBackgroundPane() { backgroundPane = new VanChartBackgroundWithOutImagePane() { protected Component[][] getPaneComponents() { From 5e9cc42c95e3f3a3da13de9b6b0d47fc511b6fba Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 15 Dec 2020 17:45:25 +0800 Subject: [PATCH 013/104] =?UTF-8?q?REPORT-45015=20=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7-=E6=95=B0=E5=AD=97=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/component/NumberEditorValidatePane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java index 72a199a5b2..ab4f7e4e2b 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java @@ -150,6 +150,7 @@ public class NumberEditorValidatePane extends JPanel { setMaxListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); if (setMaxValueCheckBox.isSelected()) { maxValueSpinner.setEnabled(true); Double value = (double) 0; @@ -171,6 +172,7 @@ public class NumberEditorValidatePane extends JPanel { setMinListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); if (setMinValueCheckBox.isSelected()) { minValueSpinner.setEnabled(true); Double value = (double) 0; From 5a95835d2ac6cc5a709fef12ad27d7ccaa30345a Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 17 Dec 2020 11:39:13 +0800 Subject: [PATCH 014/104] =?UTF-8?q?REPORT-44785=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86-=E6=95=B0=E6=8D=AE=E5=BA=93=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86-=E8=A7=86=E5=9B=BE=E4=B8=8D=E8=83=BD=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/gui/ilist/TableViewList.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java index cccf64e26d..73da78151b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java @@ -106,6 +106,13 @@ public class TableViewList extends UIList { if (!status) { throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); } + String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); + schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas; + for (String schema : schemas) { + DataCoreUtils.refreshTables(datasource, TableProcedure.TABLE, schema); + DataCoreUtils.refreshTables(datasource, TableProcedure.VIEW, schema); + DataCoreUtils.refreshTables(datasource, TableProcedure.PROCEDURE, schema); + } return processDataInAnotherThread(databaseName, searchFilter, typesFilter); } From f692c2a5e2b26d2654e6ccdae39f9de3503dcf86 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 17 Dec 2020 15:35:34 +0800 Subject: [PATCH 015/104] =?UTF-8?q?REPORT-45402=20=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E5=AE=89=E8=A3=85=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=B7=B2=E7=BB=8F=E5=AE=89=E8=A3=85=E4=BD=8E?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84=E6=8F=92=E4=BB=B6=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=90=A6=E4=B8=8D=E6=9B=B4=E6=96=B0=EF=BC=8C=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E4=BC=9A=E6=9B=B4=E6=96=B0=E5=B7=B2=E5=AE=89=E8=A3=85=E7=9A=84?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/extra/exe/callback/InstallOnlineCallback.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index f597180e87..dce9a25ce2 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -51,12 +51,13 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + jsCallback.execute("success"); return; } PluginMarker pluginMarker = result.getCurrentTask().getMarker(); PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); - }else { + } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); FineJOptionPane.showMessageDialog(null, pluginInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); From 25fd375c88e25af5f73ff3a3dce64916d79d134c Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 21 Dec 2020 15:29:02 +0800 Subject: [PATCH 016/104] =?UTF-8?q?REPORT-43744=20=E3=80=9010.0.13?= =?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=8Ejar=E5=8C=85=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 19 +++ .../fr/design/extra/PluginOperateUtils.java | 43 +++-- .../java/com/fr/design/extra/PluginUtils.java | 3 +- .../exe/callback/InstallFromDiskCallback.java | 17 +- .../exe/callback/InstallOnlineCallback.java | 16 +- .../exe/callback/ModifyStatusCallback.java | 14 +- .../exe/callback/UninstallPluginCallback.java | 19 ++- .../exe/callback/UpdateFromDiskCallback.java | 22 +-- .../exe/callback/UpdateOnlineCallback.java | 12 +- .../com/fr/env/PluginErrorRemindDialog.java | 108 ++++++++++++ .../com/fr/design/EnvChangeEntranceTest.java | 62 +++++-- .../design/extra/PluginOperateUtilsTest.java | 155 ++++++++++++++++++ .../com/fr/design/extra/PluginUtilsTest.java | 23 +++ .../manager/impl/PluginSearchManager.java | 3 +- .../module/DesignerWorkspaceProvider.java | 1 + .../manager/impl/PluginSearchManagerTest.java | 25 +++ 16 files changed, 476 insertions(+), 66 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java create mode 100644 designer-base/src/test/java/com/fr/design/extra/PluginOperateUtilsTest.java create mode 100644 designer-base/src/test/java/com/fr/design/extra/PluginUtilsTest.java create mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 0ddb749269..ed67299f6d 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -1,6 +1,7 @@ package com.fr.design; import com.fr.common.report.ReportState; +import com.fr.decision.webservice.v10.plugin.helper.PluginErrorRemindHandler; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -35,6 +36,7 @@ import com.fr.process.engine.core.FineProcessContext; import com.fr.rpc.Result; import com.fr.stable.AssistUtils; import com.fr.stable.StringUtils; +import com.fr.env.PluginErrorRemindDialog; import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContextCallback; @@ -144,6 +146,7 @@ public class EnvChangeEntrance { template.refreshToolArea(); } showServiceDialog(selectedEnv); + pluginErrorRemind(selectedEnv); } catch (WorkspaceAuthException | RegistEditionException e) { // String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed"); // String title = Toolkit.i18nText("Fine-Design_Basic_Lic_Does_Not_Support_Remote"); @@ -297,6 +300,22 @@ public class EnvChangeEntrance { } } + /** + * 插件启动错误信息提示 + * @param selectedEnv 选择的工作环境 + */ + public void pluginErrorRemind(DesignerWorkspaceInfo selectedEnv) { + if (selectedEnv.getType() == DesignerWorkspaceType.Remote) { + return; + } + + String content = PluginErrorRemindHandler.pluginErrorContent(); + if (StringUtils.isNotEmpty(content)) { + PluginErrorRemindDialog dialog = new PluginErrorRemindDialog(DesignerContext.getDesignerFrame(), content); + dialog.setVisible(true); + } + } + /** * 判断是否需要做版本验证,判断依据为 * 1、选择的环境为远程环境 diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java index 801b4e369a..46683e0a05 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java @@ -18,6 +18,7 @@ import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginMarker; +import com.fr.plugin.context.PluginMarkerAdapter; import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginControllerHelper; import com.fr.plugin.manage.control.PluginTask; @@ -26,7 +27,8 @@ import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.view.PluginView; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; import java.io.File; import java.net.HttpURLConnection; import java.util.List; @@ -38,11 +40,23 @@ import java.util.List; public class PluginOperateUtils { public static void installPluginOnline(final PluginMarker pluginMarker, JSCallback jsCallback) { + PluginMarker marker = updateMarker2Online(pluginMarker); //下载插件 - PluginTask pluginTask = PluginTask.installTask(pluginMarker); + PluginTask pluginTask = PluginTask.installTask(marker); PluginControllerHelper.installOnline(pluginMarker, new InstallOnlineCallback(pluginTask, jsCallback)); } + public static PluginMarker updateMarker2Online(PluginMarker pluginMarker) { + try { + JSONObject latestPluginInfo = PluginUtils.getLatestPluginInfo(pluginMarker.getPluginID()); + String pluginName = latestPluginInfo.getString("name"); + return PluginMarkerAdapter.create(pluginMarker, pluginName); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return pluginMarker; + } + public static void installPluginFromDisk(File zipFile, JSCallback jsCallback) { PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback)); } @@ -57,10 +71,11 @@ public class PluginOperateUtils { public static void updatePluginOnline(PluginMarker pluginMarker, JSCallback jsCallback) { try { JSONObject latestPluginInfo = PluginUtils.getLatestPluginInfo(pluginMarker.getPluginID()); - String latestPluginVersion = (String) latestPluginInfo.get("version"); - PluginMarker toPluginMarker = PluginMarker.create(pluginMarker.getPluginID(), latestPluginVersion); + String latestPluginVersion = latestPluginInfo.getString("version"); + String pluginName = latestPluginInfo.getString("name"); + PluginMarker toPluginMarker = PluginMarkerAdapter.create(pluginMarker.getPluginID(), latestPluginVersion, pluginName); //当前已经安装的相同ID插件marker - PluginMarker currentMarker = PluginUtils.getInstalledPluginMarkerByID(pluginMarker.getPluginID()); + PluginMarker currentMarker = PluginMarkerAdapter.create(PluginUtils.getInstalledPluginMarkerByID(pluginMarker.getPluginID()), pluginName); PluginTask pluginTask = PluginTask.updateTask(currentMarker, toPluginMarker); PluginControllerHelper.updateOnline(currentMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback)); } catch (Exception e) { @@ -203,16 +218,22 @@ public class PluginOperateUtils { continue; } PluginMarker pluginMarker = pluginTask.getToMarker(); - PluginContext pluginContext = PluginManager.getContext(pluginMarker); - if (pluginContext != null) { - pluginInfo.append(pluginContext.getName()).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode())); - } else { - pluginInfo.append(pluginMarker.getPluginID()).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode())); - } + PluginContext pluginContext = PluginManager.getContext(pluginMarker.getPluginID()); + pluginInfo.append(getPluginName(pluginContext, pluginMarker)).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode())); } return pluginInfo.toString(); } + private static String getPluginName(PluginContext pluginContext, PluginMarker pluginMarker) { + if (pluginContext != null) { + return pluginContext.getName(); + } + else if (pluginMarker instanceof PluginMarkerAdapter) { + return ((PluginMarkerAdapter) pluginMarker).getPluginName(); + } + return pluginMarker == null ? null : pluginMarker.getPluginID(); + } + public static String getSwitchedInfo(PluginTaskResult result) { StringBuilder pluginInfo = new StringBuilder(); List pluginTaskResults = result.asList(); diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java index bec02a200e..81f4769616 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java @@ -10,6 +10,7 @@ import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.PluginVerifyException; import com.fr.plugin.basic.version.Version; +import com.fr.plugin.basic.version.VersionCompatibleType; import com.fr.plugin.basic.version.VersionIntervalFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginMarker; @@ -248,7 +249,7 @@ public class PluginUtils { } private static boolean isCompatibleCurrentEnv(String envVersion) { - return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion()); + return VersionCompatibleType.isSupported(VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion())); } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index 19bd89ef10..14a6de9421 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -3,7 +3,7 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; -import com.fr.design.extra.PluginUtils; +import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; @@ -12,7 +12,7 @@ import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.*; +import javax.swing.JOptionPane; import java.io.File; import java.util.List; @@ -41,8 +41,9 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { if (result.isSuccess()) { String switchedInfo = PluginOperateUtils.getSwitchedInfo(result); jsCallback.execute("success"); - FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo); - FineJOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo); + String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo; + FineLoggerFactory.getLogger().info(successInfo); + FineJOptionPane.showMessageDialog(null, successInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { int rv = JOptionPane.showOptionDialog( null, @@ -66,8 +67,8 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ int rv = JOptionPane.showOptionDialog( null, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, @@ -80,8 +81,8 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); - FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); - FineJOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed"), JOptionPane.ERROR_MESSAGE); + FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index f597180e87..38c1bc7802 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -3,6 +3,7 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; +import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; @@ -11,7 +12,7 @@ import com.fr.plugin.manage.control.AbstractDealPreTaskCallback; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.*; +import javax.swing.JOptionPane; /** @@ -38,13 +39,14 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { if (result.isSuccess()) { String switchedInfo = PluginOperateUtils.getSwitchedInfo(result); jsCallback.execute("success"); - FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo); - FineJOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo); + String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo; + FineLoggerFactory.getLogger().info(successInfo); + FineJOptionPane.showMessageDialog(null, successInfo); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ int rv = JOptionPane.showOptionDialog( null, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, @@ -58,8 +60,8 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); }else { jsCallback.execute("failed"); - FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java index c48a47faeb..8015e00fbd 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java @@ -2,12 +2,14 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; -import com.fr.design.extra.PluginUtils; +import com.fr.design.extra.PluginOperateUtils; +import com.fr.design.i18n.Toolkit; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.manage.control.PluginTaskCallback; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.*; +import javax.swing.JOptionPane; /** * Created by ibm on 2017/5/27. @@ -22,12 +24,16 @@ public class ModifyStatusCallback implements PluginTaskCallback{ } @Override public void done(PluginTaskResult result) { + String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { jsCallback.execute("success"); - String modifyMessage = isActive ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate"); + String modifyMessage = isActive ? + pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") : + pluginInfo + Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate"); + FineLoggerFactory.getLogger().info(modifyMessage); FineJOptionPane.showMessageDialog(null, modifyMessage); } else { - FineJOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java index b3773ef6f9..bfa921125d 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java @@ -2,7 +2,8 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; -import com.fr.design.extra.PluginUtils; +import com.fr.design.extra.PluginOperateUtils; +import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; @@ -10,7 +11,7 @@ import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.*; +import javax.swing.JOptionPane; /** * Created by ibm on 2017/5/27. @@ -25,15 +26,17 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { @Override public void done(PluginTaskResult result) { + String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { jsCallback.execute("success"); - FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Success")); - FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Success")); + String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Success"); + FineLoggerFactory.getLogger().info(successInfo); + FineJOptionPane.showMessageDialog(null, successInfo); }else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) { int rv = JOptionPane.showOptionDialog( null, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, @@ -46,8 +49,8 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); } else { jsCallback.execute("failed"); - FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed")); - FineJOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed")); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java index 7cced40f0b..551d944888 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java @@ -3,7 +3,7 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; -import com.fr.design.extra.PluginUtils; +import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; @@ -12,7 +12,7 @@ import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.*; +import javax.swing.JOptionPane; import java.io.File; import java.util.List; @@ -37,15 +37,17 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { @Override public void done(PluginTaskResult result) { + String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { jsCallback.execute("success"); - FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success")); - FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success")); + String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success"); + FineLoggerFactory.getLogger().info(successInfo); + FineJOptionPane.showMessageDialog(null, successInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { int rv = JOptionPane.showOptionDialog( null, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, @@ -64,8 +66,8 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { } else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){ int rv = JOptionPane.showOptionDialog( null, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"), + Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, @@ -78,8 +80,8 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); - FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); - FineJOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java index 69998a3169..deeed74974 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java @@ -3,13 +3,14 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; +import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; import com.fr.plugin.manage.control.AbstractDealPreTaskCallback; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.*; +import javax.swing.JOptionPane; /** * Created by ibm on 2017/5/26. @@ -33,12 +34,13 @@ public class UpdateOnlineCallback extends AbstractDealPreTaskCallback { String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { jsCallback.execute("success"); - FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success")); - FineJOptionPane.showMessageDialog(null,pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success")); + String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success"); + FineLoggerFactory.getLogger().info(successInfo); + FineJOptionPane.showMessageDialog(null, successInfo); } else { jsCallback.execute("failed"); - FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java b/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java new file mode 100644 index 0000000000..3654cca2d9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java @@ -0,0 +1,108 @@ +package com.fr.env; + +import com.fr.design.actions.server.PluginManagerAction; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.FRFont; +import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Locale; + +/** + * 插件启动失败提示窗 + */ +public class PluginErrorRemindDialog extends JDialog implements ActionListener { + + public PluginErrorRemindDialog(Frame parent, String areaText) { + super(parent, true); + //上面的标签面板 + JPanel topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + JPanel imagePanel = new JPanel(); + Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning5.png"); + + JLabel imageLabel = new JLabel(); + imageLabel.setIcon(icon); + imagePanel.add(imageLabel); + imagePanel.setPreferredSize(new Dimension(130, 100)); + + JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); + + JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Title")); + label.setFont(FRFont.getInstance().applySize(18).applyStyle(1)); + label.setPreferredSize(new Dimension(650, 100)); + + verticalPanel.add(label); + + topPanel.add(imagePanel, BorderLayout.WEST); + topPanel.add(verticalPanel, BorderLayout.CENTER); + topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); + + //中间的文本域面板 + JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + centerPanel.setPreferredSize(new Dimension(480, 320)); + + JTextArea checkArea = new JTextArea(areaText); + checkArea.setEnabled(false); + centerPanel.add(checkArea, BorderLayout.CENTER); + + UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Not_Deal_With")); + UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With")); + + cancelButton.addActionListener(this); + okButton.addActionListener(new PluginManagerActionAdapter(this)); + + // 按钮 + JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + buttonPanel.add(cancelButton); + buttonPanel.add(okButton); + + + this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")); + this.setResizable(false); + + this.add(topPanel, BorderLayout.NORTH); + this.add(centerPanel, BorderLayout.CENTER); + this.add(buttonPanel, BorderLayout.SOUTH); + this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 750 : 600, 500)); + + GUICoreUtils.centerWindow(this); + } + + @Override + public void actionPerformed(ActionEvent e) { + this.dispose(); + } + + private static class PluginManagerActionAdapter extends PluginManagerAction { + + private JDialog jDialog; + + public PluginManagerActionAdapter(JDialog jDialog) { + this.jDialog = jDialog; + } + + @Override + public void actionPerformed(ActionEvent e) { + this.jDialog.dispose(); + super.actionPerformed(e); + } + } + +} diff --git a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java index d9d6e44844..7f53d05ded 100644 --- a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java +++ b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java @@ -1,10 +1,12 @@ package com.fr.design; +import com.fr.decision.webservice.v10.plugin.helper.PluginErrorRemindHandler; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.env.CheckServiceDialog; +import com.fr.env.PluginErrorRemindDialog; import com.fr.invoke.Reflect; import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; @@ -16,13 +18,19 @@ import org.powermock.api.easymock.PowerMock; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; +import java.awt.Frame; + /** * @author: Maksim * @Date: Created in 2020/3/5 * @Description: */ @RunWith(PowerMockRunner.class) -@PrepareForTest({FunctionalHttpRequest.class,EnvChangeEntrance.class,CheckServiceDialog.class, DesignerEnvManager.class}) +@PrepareForTest({FunctionalHttpRequest.class, + EnvChangeEntrance.class, + CheckServiceDialog.class, + DesignerEnvManager.class, + PluginErrorRemindHandler.class}) public class EnvChangeEntranceTest { @Test @@ -44,17 +52,15 @@ public class EnvChangeEntranceTest { EasyMock.expect(request.getServerBranch()).andReturn(remoteBranch); CheckServiceDialog dialog = EasyMock.mock(CheckServiceDialog.class); - PowerMock.expectNew(CheckServiceDialog.class, EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject()).andReturn(dialog); + PowerMock.expectNew(CheckServiceDialog.class, EasyMock.anyObject(Frame.class), EasyMock.anyString(), EasyMock.anyString(), EasyMock.anyString()).andReturn(dialog); - EasyMock.replay(request); - EasyMock.replay(selectedEnv); - EasyMock.replay(connectionInfo); + EasyMock.replay(request, selectedEnv, connectionInfo); PowerMock.replayAll(); entrance.showServiceDialog(selectedEnv); - Assert.assertTrue(true); + }catch (Exception e){ - Assert.assertTrue(false); + Assert.fail(); } } @@ -94,10 +100,44 @@ public class EnvChangeEntranceTest { DesignerWorkspaceInfo info3 = LocalDesignerWorkspaceInfo.create("name", "path"); DesignerWorkspaceInfo info4 = null; - Assert.assertFalse((boolean) Reflect.on(entrance).call("isNotRememberPwd", info1).get()); - Assert.assertTrue((boolean) Reflect.on(entrance).call("isNotRememberPwd", info2).get()); - Assert.assertFalse((boolean) Reflect.on(entrance).call("isNotRememberPwd", info3).get()); - Assert.assertFalse((boolean) Reflect.on(entrance).call("isNotRememberPwd", info4).get()); + Assert.assertFalse(Reflect.on(entrance).call("isNotRememberPwd", info1).get()); + Assert.assertTrue(Reflect.on(entrance).call("isNotRememberPwd", info2).get()); + Assert.assertFalse(Reflect.on(entrance).call("isNotRememberPwd", info3).get()); + Assert.assertFalse(Reflect.on(entrance).call("isNotRememberPwd", info4).get()); } + @Test + public void testPluginErrorRemind() throws Exception { + + try { + DesignerWorkspaceInfo selectedEnv = EasyMock.mock(DesignerWorkspaceInfo.class); + EasyMock.expect(selectedEnv.getType()).andReturn(DesignerWorkspaceType.Remote).once(); + EasyMock.expect(selectedEnv.getType()).andReturn(DesignerWorkspaceType.Local).times(2); + + PowerMock.mockStatic(PluginErrorRemindHandler.class); + EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("").once(); + EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("111").once(); + + PluginErrorRemindDialog dialog = EasyMock.mock(PluginErrorRemindDialog.class); + PowerMock.expectNew(PluginErrorRemindDialog.class, EasyMock.anyObject(Frame.class), EasyMock.anyString()).andReturn(dialog).once(); + + dialog.setVisible(true); + EasyMock.expectLastCall(); + + EasyMock.replay(selectedEnv, dialog); + PowerMock.replayAll(); + + EnvChangeEntrance entrance = EnvChangeEntrance.getInstance(); + + entrance.pluginErrorRemind(selectedEnv); + entrance.pluginErrorRemind(selectedEnv); + entrance.pluginErrorRemind(selectedEnv); + + + EasyMock.verify(selectedEnv, dialog); + PowerMock.verifyAll(); + } catch (Exception e) { + Assert.fail(); + } + } } \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/extra/PluginOperateUtilsTest.java b/designer-base/src/test/java/com/fr/design/extra/PluginOperateUtilsTest.java new file mode 100644 index 0000000000..887cde43e0 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/extra/PluginOperateUtilsTest.java @@ -0,0 +1,155 @@ +package com.fr.design.extra; + +import com.fr.invoke.Reflect; +import com.fr.json.JSONObject; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.context.PluginMarker; +import com.fr.plugin.context.PluginMarkerAdapter; +import com.fr.plugin.error.PluginErrorCode; +import com.fr.plugin.manage.PluginManager; +import com.fr.plugin.manage.control.PluginTask; +import com.fr.plugin.manage.control.PluginTaskResult; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.api.easymock.PowerMock; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Lucian.Chen + * @version 10.0 + * Created by Lucian.Chen on 2020/12/17 + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest({PluginManager.class, PluginUtils.class}) +public class PluginOperateUtilsTest { + + @Test + public void testGetSuccessInfo() { + PluginTaskResult pluginTaskResult = EasyMock.mock(PluginTaskResult.class); + PluginTaskResult pluginTaskResult1 = EasyMock.mock(PluginTaskResult.class); + PluginTaskResult pluginTaskResult2 = EasyMock.mock(PluginTaskResult.class); + + List pluginTaskResults1 = new ArrayList<>(); + pluginTaskResults1.add(pluginTaskResult1); + List pluginTaskResults2 = new ArrayList<>(); + pluginTaskResults2.add(pluginTaskResult1); + pluginTaskResults2.add(pluginTaskResult2); + + PluginMarker pluginMarker1 = PluginMarker.create("plugin-1", "1.0"); + PluginMarker pluginMarker2 = PluginMarkerAdapter.create("plugin-2", "2.0", "name-2"); + PluginTask pluginTask1 = PluginTask.installTask(pluginMarker1); + PluginTask pluginTask2 = PluginTask.installTask(pluginMarker2); + + EasyMock.expect(pluginTaskResult.asList()).andReturn(pluginTaskResults1).times(2); + EasyMock.expect(pluginTaskResult.asList()).andReturn(pluginTaskResults2).times(2); + EasyMock.expect(pluginTaskResult1.getCurrentTask()).andReturn(pluginTask1).anyTimes(); + EasyMock.expect(pluginTaskResult2.getCurrentTask()).andReturn(pluginTask2).anyTimes(); + + EasyMock.expect(pluginTaskResult1.errorCode()).andReturn(PluginErrorCode.BelowSystem).anyTimes(); + EasyMock.expect(pluginTaskResult2.errorCode()).andReturn(PluginErrorCode.BeyondSystem).anyTimes(); + + PluginContext plugin1 = EasyMock.mock(PluginContext.class); + PluginContext plugin2 = EasyMock.mock(PluginContext.class); + EasyMock.expect(plugin1.getName()).andReturn("context-1").anyTimes(); + EasyMock.expect(plugin2.getName()).andReturn("context-2").anyTimes(); + PowerMock.mockStatic(PluginManager.class); + EasyMock.expect(PluginManager.getContext(pluginMarker1.getPluginID())) + .andReturn(plugin1).once().andReturn(null).once().andReturn(plugin1).once().andReturn(null).once(); + EasyMock.expect(PluginManager.getContext(pluginMarker2.getPluginID())) + .andReturn(plugin2).once().andReturn(null).once(); + + EasyMock.replay(pluginTaskResult, pluginTaskResult1, pluginTaskResult2, plugin1, plugin2); + PowerMock.replayAll(); + + // 1个 + Assert.assertEquals(PluginOperateUtils.getSuccessInfo(pluginTaskResult), "context-1Fine-Core_Plugin_Error_BelowSystem"); + Assert.assertEquals(PluginOperateUtils.getSuccessInfo(pluginTaskResult), "plugin-1Fine-Core_Plugin_Error_BelowSystem"); + + + // 2个 + Assert.assertEquals(PluginOperateUtils.getSuccessInfo(pluginTaskResult), "context-1Fine-Core_Plugin_Error_BelowSystem\ncontext-2Fine-Core_Plugin_Error_BeyondSystem"); + Assert.assertEquals(PluginOperateUtils.getSuccessInfo(pluginTaskResult), "plugin-1Fine-Core_Plugin_Error_BelowSystem\nname-2Fine-Core_Plugin_Error_BeyondSystem"); + + EasyMock.verify(pluginTaskResult, pluginTaskResult1, pluginTaskResult2, plugin1, plugin2); + PowerMock.verifyAll(); + + } + + + @Test + public void testGetPluginName() { + PluginContext pluginContext = EasyMock.mock(PluginContext.class); + EasyMock.expect(pluginContext.getName()).andReturn("pluginContext").once(); + + PluginMarker pluginMarker1 = PluginMarker.create("id-1", "1"); + PluginMarker pluginMarker2 = PluginMarkerAdapter.create("id-2", "2", "name-2"); + + EasyMock.replay(pluginContext); + + Assert.assertNull(Reflect.on(PluginOperateUtils.class).call("getPluginName", null, null).get()); + Assert.assertEquals(Reflect.on(PluginOperateUtils.class).call("getPluginName", pluginContext, pluginMarker1).get(), "pluginContext"); + Assert.assertEquals(Reflect.on(PluginOperateUtils.class).call("getPluginName", null, pluginMarker1).get(), "id-1"); + Assert.assertEquals(Reflect.on(PluginOperateUtils.class).call("getPluginName", null, pluginMarker2).get(), "name-2"); + + EasyMock.verify(pluginContext); + } + + @Test + public void testUpdateMarker2Online() { + + try { + PluginMarker pluginMarker = PluginMarker.create("plugin-1", "1.0"); + String pluginJson = "{\"id\": plugin-1,\"name\": \"图表(新特性)\",\"version\": \"8.6.16\"}"; + JSONObject object = new JSONObject(pluginJson); + + PowerMock.mockStatic(PluginUtils.class); + EasyMock.expect(PluginUtils.getLatestPluginInfo("plugin-1")).andReturn(object).once(); + EasyMock.expect(PluginUtils.getLatestPluginInfo("plugin-1")).andThrow(new NullPointerException()).once(); + + PowerMock.replayAll(); + + PluginMarker marker1 = PluginOperateUtils.updateMarker2Online(pluginMarker); + PluginMarker marker2 = PluginOperateUtils.updateMarker2Online(pluginMarker); + + Assert.assertTrue(marker1 instanceof PluginMarkerAdapter); + Assert.assertEquals(marker1.getPluginID(), "plugin-1"); + Assert.assertEquals(marker1.getVersion(), "1.0"); + Assert.assertEquals(((PluginMarkerAdapter) marker1).getPluginName(), "图表(新特性)"); + Assert.assertEquals(marker2, pluginMarker); + + PowerMock.verifyAll(); + } catch (Exception e) { + Assert.fail(); + } + + } + + + @Test + public void testUpdatePluginOnline() { + try { + PluginMarker pluginMarker = PluginMarker.create("plugin-1", "1.0"); + String pluginJson = "{\"id\": plugin-1,\"name\": \"图表(新特性)\",\"version\": \"8.6.16\"}"; + JSONObject object = new JSONObject(pluginJson); + + PowerMock.mockStatic(PluginUtils.class); + EasyMock.expect(PluginUtils.getLatestPluginInfo("plugin-1")).andReturn(object).once(); + EasyMock.expect(PluginUtils.getInstalledPluginMarkerByID("plugin-1")).andReturn(pluginMarker).once(); + + PowerMock.replayAll(); + + PluginOperateUtils.updatePluginOnline(pluginMarker, null); + + PowerMock.verifyAll(); + } catch (Exception e) { + Assert.fail(); + } + } + +} diff --git a/designer-base/src/test/java/com/fr/design/extra/PluginUtilsTest.java b/designer-base/src/test/java/com/fr/design/extra/PluginUtilsTest.java new file mode 100644 index 0000000000..bbb809ebfe --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/extra/PluginUtilsTest.java @@ -0,0 +1,23 @@ +package com.fr.design.extra; + +import com.fr.invoke.Reflect; +import org.junit.Assert; +import org.junit.Test; + +/** + * @author Lucian.Chen + * @version 10.0 + * Created by Lucian.Chen on 2020/12/18 + */ +public class PluginUtilsTest { + + @Test + public void testIsCompatibleCurrentEnv() { + Assert.assertFalse(Reflect.on(PluginUtils.class).call("isCompatibleCurrentEnv", "~9.0").get()); + Assert.assertTrue(Reflect.on(PluginUtils.class).call("isCompatibleCurrentEnv", "9.0").get()); + Assert.assertTrue(Reflect.on(PluginUtils.class).call("isCompatibleCurrentEnv", "9~").get()); + Assert.assertTrue(Reflect.on(PluginUtils.class).call("isCompatibleCurrentEnv", "10").get()); + Assert.assertFalse(Reflect.on(PluginUtils.class).call("isCompatibleCurrentEnv", "11").get()); + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index a902d0e00c..8efc5323e5 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -15,6 +15,7 @@ import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.basic.version.Version; +import com.fr.plugin.basic.version.VersionCompatibleType; import com.fr.plugin.basic.version.VersionIntervalFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; @@ -44,7 +45,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } private static boolean isCompatibleCurrentEnv(String envVersion) { - return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion()); + return VersionCompatibleType.isSupported(VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion())); } private static PluginModel getPluginModel(JSONObject object, boolean isFromCloud) { diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index 420f0f2b65..14bb23b18d 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -71,6 +71,7 @@ public class DesignerWorkspaceProvider extends Activator { } catch (Exception e) { FineLoggerFactory.getLogger().warn("Check Service Failed"); } + EnvChangeEntrance.getInstance().pluginErrorRemind(selectEnv); } }); } diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java new file mode 100644 index 0000000000..f4c9c1b7a2 --- /dev/null +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java @@ -0,0 +1,25 @@ +package com.fr.design.mainframe.alphafine.search.manager.impl; + + +import com.fr.invoke.Reflect; +import org.junit.Assert; +import org.junit.Test; + +/** + * @author Lucian.Chen + * @version 10.0 + * Created by Lucian.Chen on 2020/12/17 + */ +public class PluginSearchManagerTest { + + @Test + public void testIsCompatibleCurrentEnv() { + + Assert.assertFalse(Reflect.on(PluginSearchManager.class).call("isCompatibleCurrentEnv", "~9.0").get()); + Assert.assertTrue(Reflect.on(PluginSearchManager.class).call("isCompatibleCurrentEnv", "9.0").get()); + Assert.assertTrue(Reflect.on(PluginSearchManager.class).call("isCompatibleCurrentEnv", "9~").get()); + Assert.assertTrue(Reflect.on(PluginSearchManager.class).call("isCompatibleCurrentEnv", "10").get()); + Assert.assertFalse(Reflect.on(PluginSearchManager.class).call("isCompatibleCurrentEnv", "11").get()); + } + +} From 563617b9a3b2dba5b656cbf7a1e2f83704157c41 Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 21 Dec 2020 15:50:53 +0800 Subject: [PATCH 017/104] =?UTF-8?q?REPORT-43744=20=E3=80=9010.0.13?= =?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=8Ejar=E5=8C=85=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/PluginUtils.java | 4 ++-- .../alphafine/search/manager/impl/PluginSearchManager.java | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java index 81f4769616..7fa050f607 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java @@ -10,7 +10,7 @@ import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.PluginVerifyException; import com.fr.plugin.basic.version.Version; -import com.fr.plugin.basic.version.VersionCompatibleType; +import com.fr.plugin.basic.version.VersionIntervalType; import com.fr.plugin.basic.version.VersionIntervalFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginMarker; @@ -249,7 +249,7 @@ public class PluginUtils { } private static boolean isCompatibleCurrentEnv(String envVersion) { - return VersionCompatibleType.isSupported(VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion())); + return VersionIntervalType.isSupported(VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion())); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 8efc5323e5..fbc3ce57b0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -11,16 +11,14 @@ import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvi import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; -import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.basic.version.Version; -import com.fr.plugin.basic.version.VersionCompatibleType; +import com.fr.plugin.basic.version.VersionIntervalType; import com.fr.plugin.basic.version.VersionIntervalFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; -import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; @@ -45,7 +43,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } private static boolean isCompatibleCurrentEnv(String envVersion) { - return VersionCompatibleType.isSupported(VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion())); + return VersionIntervalType.isSupported(VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion())); } private static PluginModel getPluginModel(JSONObject object, boolean isFromCloud) { From 3d15e4b6fd17720ad81abe2ab3c3ab44c6649de6 Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 21 Dec 2020 17:40:29 +0800 Subject: [PATCH 018/104] =?UTF-8?q?REPORT-43744=20=E3=80=9010.0.13?= =?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=8Ejar=E5=8C=85=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/PluginUtils.java | 2 +- .../alphafine/search/manager/impl/PluginSearchManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java index 7fa050f607..ed7253bad2 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java @@ -249,7 +249,7 @@ public class PluginUtils { } private static boolean isCompatibleCurrentEnv(String envVersion) { - return VersionIntervalType.isSupported(VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion())); + return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index fbc3ce57b0..31a1b18ed9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -43,7 +43,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } private static boolean isCompatibleCurrentEnv(String envVersion) { - return VersionIntervalType.isSupported(VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion())); + return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion()); } private static PluginModel getPluginModel(JSONObject object, boolean isFromCloud) { From 9b9fd7a297748f88e4547dd85b06a3ebda411d11 Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 21 Dec 2020 17:57:16 +0800 Subject: [PATCH 019/104] =?UTF-8?q?REPORT-43744=20=E3=80=9010.0.13?= =?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=8Ejar=E5=8C=85=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exe/callback/InstallFromDiskCallback.java | 19 +++++++++---------- .../exe/callback/InstallOnlineCallback.java | 12 +++++------- .../exe/callback/UninstallPluginCallback.java | 12 +++++------- .../exe/callback/UpdateFromDiskCallback.java | 19 +++++++++---------- .../exe/callback/UpdateOnlineCallback.java | 4 +--- 5 files changed, 29 insertions(+), 37 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index 14a6de9421..81e76fa451 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -12,7 +12,6 @@ import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; import java.io.File; import java.util.List; @@ -45,17 +44,17 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } List pluginTasks = result.getPreTasks(); @@ -65,24 +64,24 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { } PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback)); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index 0fd43c43b5..c7059f50d5 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -12,8 +12,6 @@ import com.fr.plugin.manage.control.AbstractDealPreTaskCallback; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; - /** * Created by ibm on 2017/5/26. @@ -43,17 +41,17 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { jsCallback.execute("success"); return; } @@ -62,7 +60,7 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java index bfa921125d..df3839427d 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java @@ -11,8 +11,6 @@ import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; - /** * Created by ibm on 2017/5/27. */ @@ -33,24 +31,24 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); }else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) { - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java index 551d944888..e5396d35ce 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java @@ -12,7 +12,6 @@ import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; import java.io.File; import java.util.List; @@ -44,17 +43,17 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } List pluginTasks = result.getPreTasks(); @@ -64,24 +63,24 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { } PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback)); } else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){ - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java index deeed74974..8dbad6a541 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java @@ -10,8 +10,6 @@ import com.fr.plugin.manage.control.AbstractDealPreTaskCallback; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; - /** * Created by ibm on 2017/5/26. */ @@ -40,7 +38,7 @@ public class UpdateOnlineCallback extends AbstractDealPreTaskCallback { } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } } From 74f382550f2e841622881b74d2c2d8d9a0749724 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 21 Dec 2020 23:31:52 +0800 Subject: [PATCH 020/104] =?UTF-8?q?CHART-17494=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=82=B9=E5=9C=B0=E5=9B=BE=E6=A0=87=E8=AE=B0=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/map/VanChartMapSeriesPane.java | 154 ++++++++++++++---- .../VanChartMapConditionAttrContentPane.java | 3 + .../VanChartAnchorMarkerConditionPane.java | 42 +++++ .../VanChartAnchorPointMapConditionPane.java | 26 +++ .../series/VanChartMapAnchorMarkerPane.java | 64 ++++++++ 5 files changed, 253 insertions(+), 36 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/item/VanChartAnchorMarkerConditionPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartAnchorPointMapConditionPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java index 00a847e2ec..62b5bb489d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java @@ -37,6 +37,7 @@ import com.fr.van.chart.designer.component.marker.VanChartImageMarkerPane; import com.fr.van.chart.designer.other.VanChartInteractivePane; import com.fr.van.chart.designer.style.series.VanChartColorValueSeriesPane; import com.fr.van.chart.designer.style.series.VanChartEffectPane; +import com.fr.van.chart.map.designer.style.series.VanChartMapAnchorMarkerPane; import com.fr.van.chart.map.designer.style.series.VanChartMapScatterMarkerPane; import com.fr.van.chart.map.line.VanChartCurvePane; import com.fr.van.chart.map.line.VanChartLineMapEffectPane; @@ -61,16 +62,24 @@ import java.awt.event.ItemListener; * 地图-系列界面 */ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { - private static final String AREA_STRING = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Region"); - private static final String POINT_STRING = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Point"); - private static final String LINE_STRING = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Flow"); + private static final String AREA_STRING = Toolkit.i18nText("Fine-Design_Chart_Region"); + private static final String POINT_STRING = Toolkit.i18nText("Fine-Design_Chart_Point"); + private static final String LINE_STRING = Toolkit.i18nText("Fine-Design_Chart_Flow"); - private static final String[] MARKER_TYPES = new String[]{MapMarkerType.DEFAULT.toLocalString(), + private static final String[] MARKER_TYPES = new String[]{MapMarkerType.ANCHOR.toLocalString(), MapMarkerType.COMMON.toLocalString(), MapMarkerType.BUBBLE.toLocalString(), MapMarkerType.IMAGE.toLocalString()}; - private static final String[] LARGE_MARKER_TYPES = new String[]{MapMarkerType.DEFAULT.toLocalString(), + private static final String[] LARGE_MARKER_TYPES = new String[]{MapMarkerType.ANCHOR.toLocalString(), MapMarkerType.COMMON.toLocalString(), MapMarkerType.BUBBLE.toLocalString()}; + private static final String[] COMPATIBLE_MARKER_TYPES = new String[]{MapMarkerType.DEFAULT.toLocalString(), + MapMarkerType.ANCHOR.toLocalString(), MapMarkerType.COMMON.toLocalString(), + MapMarkerType.BUBBLE.toLocalString(), MapMarkerType.IMAGE.toLocalString()}; + + private static final String[] COMPATIBLE_LARGE_MARKER_TYPES = new String[]{MapMarkerType.DEFAULT.toLocalString(), + MapMarkerType.ANCHOR.toLocalString(), MapMarkerType.COMMON.toLocalString(), + MapMarkerType.BUBBLE.toLocalString()}; + //custom private UIButtonGroup areaPointAndLineGroup; @@ -85,9 +94,15 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { //point private UIComboBox markerTypeCom; + + private VanChartMapAnchorMarkerPane anchorMarkerPane; private VanChartMapScatterMarkerPane commonMarkerPane; private VanChartBubblePane bubblePane; private VanChartImageMarkerPane imageMarkerPane; + + private CardLayout markerTypeLayout; + private JPanel markerContentPane; + private UINumberDragPane pointAlphaPane; private VanChartEffectPane pointEffectPane; @@ -147,7 +162,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { checkLineMapLarge(); } }); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup); return createLargeDataModelPane(panel); } @@ -162,14 +177,11 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { if (pointEffectPane != null) { GUICoreUtils.setEnabled(pointEffectPane, !largeModel); } - if (markerTypeCom != null) { - Object selectedItem = markerTypeCom.getSelectedItem(); - markerTypeCom.setModel(new DefaultComboBoxModel(largeModel ? LARGE_MARKER_TYPES : MARKER_TYPES)); - if (ComparatorUtils.equals(MapMarkerType.IMAGE.toLocalString(), selectedItem) && largeModel) { - markerTypeCom.setSelectedItem(MapMarkerType.COMMON.toLocalString()); - } else { - markerTypeCom.setSelectedItem(selectedItem); - } + + checkMarkerComboboxModel((VanChartMapPlot) plot); + + if (largeModel) { + checkLargeModelPlotSelectedItem(); } } @@ -182,6 +194,61 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } } + private void checkMarkerComboboxModel(VanChartMapPlot plot) { + if (markerTypeCom == null) { + return; + } + + if (shouldRefreshComboboxModel(plot)) { + + refreshMarkerTypeComboboxModel(plot); + + markerTypeCom.setSelectedItem(plot.getMapMarkerType().toLocalString()); + if (markerTypeLayout != null && markerContentPane != null) { + markerTypeLayout.show(markerContentPane, plot.getMapMarkerType().toLocalString()); + } + } + } + + private void checkLargeModelPlotSelectedItem() { + MapMarkerType selectedType = (MapMarkerType) markerTypeCom.getSelectedItem(); + + if (ComparatorUtils.equals(MapMarkerType.IMAGE.toLocalString(), selectedType)) { + markerTypeCom.setSelectedItem(MapMarkerType.COMMON.toLocalString()); + } else { + markerTypeCom.setSelectedItem(selectedType); + } + } + + private boolean shouldRefreshComboboxModel(VanChartMapPlot plot) { + MapMarkerType selectedType = plot.getMapMarkerType(); + DefaultComboBoxModel model = (DefaultComboBoxModel) markerTypeCom.getModel(); + + if (selectedType == MapMarkerType.DEFAULT) { + return model.getIndexOf(MapMarkerType.DEFAULT.toLocalString()) < 0; + } + + return model.getIndexOf(MapMarkerType.DEFAULT.toLocalString()) > -1; + } + + private void refreshMarkerTypeComboboxModel(VanChartMapPlot plot) { + if (largeModel(plot)) { + + if (plot.getMapMarkerType() == MapMarkerType.DEFAULT) { + markerTypeCom.setModel(new DefaultComboBoxModel<>(COMPATIBLE_LARGE_MARKER_TYPES)); + } else { + markerTypeCom.setModel(new DefaultComboBoxModel<>(LARGE_MARKER_TYPES)); + } + } else { + + if (plot.getMapMarkerType() == MapMarkerType.DEFAULT) { + markerTypeCom.setModel(new DefaultComboBoxModel<>(COMPATIBLE_MARKER_TYPES)); + } else { + markerTypeCom.setModel(new DefaultComboBoxModel<>(MARKER_TYPES)); + } + } + } + @Override protected JPanel getContentPane(boolean custom) { JPanel panel = new JPanel(new BorderLayout()); @@ -272,7 +339,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { Component[][] components = new Component[][]{ new Component[]{getColorPane(MapType.AREA)}, - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)}, }; return TableLayoutHelper.createTableLayoutPane(components, row, col); @@ -357,28 +424,29 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { private Component createCurvePane() { curvePane = new VanChartCurvePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane); } private Component createAnimationPane() { lineMapEffectPane = new VanChartLineMapEffectPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), lineMapEffectPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Animation"), lineMapEffectPane); } //不透明度 private JPanel createPointAlphaPane() { pointAlphaPane = new UINumberDragPane(0, 100); - return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha"), pointAlphaPane); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), pointAlphaPane); } private JPanel createPointEffectPane() { pointEffectPane = new VanChartEffectPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), pointEffectPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Animation"), pointEffectPane); } private JPanel createMarkerComPane() { - markerTypeCom = new UIComboBox(MARKER_TYPES); + markerTypeCom = new UIComboBox(COMPATIBLE_MARKER_TYPES); + anchorMarkerPane = new VanChartMapAnchorMarkerPane(); commonMarkerPane = new VanChartMapScatterMarkerPane(); commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); bubblePane = new VanChartBubblePane() { @@ -396,31 +464,34 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { }; imageMarkerPane = new VanChartImageMarkerPane(); - final JPanel[] panes = new JPanel[]{new JPanel(), commonMarkerPane, bubblePane, imageMarkerPane}; - final CardLayout cardLayout = new CardLayout(); - final JPanel cardPane = new JPanel(cardLayout) { + final JPanel[] panes = new JPanel[]{new JPanel(), anchorMarkerPane, commonMarkerPane, bubblePane, imageMarkerPane}; + + markerTypeLayout = new CardLayout(); + markerContentPane = new JPanel(markerTypeLayout) { @Override public Dimension getPreferredSize() { - return panes[markerTypeCom.getSelectedIndex()].getPreferredSize(); + int index = MapMarkerType.parse((String) markerTypeCom.getSelectedItem()).ordinal(); + + return panes[index].getPreferredSize(); } }; - for (int i = 0, len = MARKER_TYPES.length; i < len; i++) { - cardPane.add(panes[i], MARKER_TYPES[i]); + for (int i = 0, len = COMPATIBLE_MARKER_TYPES.length; i < len; i++) { + markerContentPane.add(panes[i], COMPATIBLE_MARKER_TYPES[i]); } markerTypeCom.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { - cardLayout.show(cardPane, MARKER_TYPES[markerTypeCom.getSelectedIndex()]); + markerTypeLayout.show(markerContentPane, (String) markerTypeCom.getSelectedItem()); } }); - JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Point_Style"), markerTypeCom); + JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Point_Style"), markerTypeCom); JPanel markerPane = new JPanel(new BorderLayout(0, 6)); markerPane.add(northPane, BorderLayout.NORTH); - markerPane.add(cardPane, BorderLayout.CENTER); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); + markerPane.add(markerContentPane, BorderLayout.CENTER); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); } private JPanel createCustomPane(Plot plot) { @@ -500,8 +571,9 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } public void populateBean(Plot plot) { - if (plot != null && plot instanceof VanChartMapPlot) { + if (plot instanceof VanChartMapPlot) { if (markerTypeCom != null) { + checkMarkerComboboxModel(((VanChartMapPlot) plot)); markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString()); } if (nullValueColorBox != null) { @@ -524,9 +596,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } public void updateBean(Plot plot) { - if (plot != null && plot instanceof VanChartMapPlot) { + if (plot instanceof VanChartMapPlot) { if (markerTypeCom != null) { - ((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parseInt(markerTypeCom.getSelectedIndex())); + ((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parse((String) markerTypeCom.getSelectedItem())); + checkMarkerComboboxModel((VanChartMapPlot) plot); } if (nullValueColorBox != null) { //TODO Bjorn 地图空值背景自动 @@ -587,6 +660,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class); + + if (anchorMarkerPane != null) { + anchorMarkerPane.populateBean(attrMarker); + } if (commonMarkerPane != null) { commonMarkerPane.populateBean(attrMarker); } @@ -669,11 +746,16 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class); defaultAttr.remove(attrBubble); if (markerTypeCom != null) { - if (markerTypeCom.getSelectedIndex() == 1) { + String selected = (String) markerTypeCom.getSelectedItem(); + MapMarkerType markerType = MapMarkerType.parse(selected); + + if (markerType == MapMarkerType.ANCHOR) { + defaultAttr.addDataSeriesCondition(anchorMarkerPane.updateBean()); + } else if (markerType == MapMarkerType.COMMON) { defaultAttr.addDataSeriesCondition(commonMarkerPane.updateBean()); - } else if (markerTypeCom.getSelectedIndex() == 2) { + } else if (markerType == MapMarkerType.BUBBLE) { defaultAttr.addDataSeriesCondition(bubblePane.updateBean()); - } else if (markerTypeCom.getSelectedIndex() == 3) { + } else if (markerType == MapMarkerType.IMAGE) { defaultAttr.addDataSeriesCondition(imageMarkerPane.updateBean()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapConditionAttrContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapConditionAttrContentPane.java index a29a6dd03f..b659aee193 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapConditionAttrContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapConditionAttrContentPane.java @@ -9,6 +9,7 @@ import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.designer.other.VanChartConditionAttrContentPane; import com.fr.van.chart.map.designer.VanMapAreaAndPointGroupPane; import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; +import com.fr.van.chart.map.designer.other.condition.pane.VanChartAnchorPointMapConditionPane; import com.fr.van.chart.map.designer.other.condition.pane.VanChartBubblePointMapConditionPane; import com.fr.van.chart.map.designer.other.condition.pane.VanChartCommonPointMapConditionPane; import com.fr.van.chart.map.designer.other.condition.pane.VanChartDefaultPointMapConditionPane; @@ -99,6 +100,8 @@ public class VanChartMapConditionAttrContentPane extends VanChartConditionAttrCo private Class getPointMapConditionClassPane(VanChartMapPlot plot) { MapMarkerType mapMarkerType = plot.getMapMarkerType(); switch (mapMarkerType){ + case ANCHOR: + return VanChartAnchorPointMapConditionPane.class; case COMMON: return VanChartCommonPointMapConditionPane.class; case BUBBLE: diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/item/VanChartAnchorMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/item/VanChartAnchorMarkerConditionPane.java new file mode 100644 index 0000000000..fd8dc9669d --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/item/VanChartAnchorMarkerConditionPane.java @@ -0,0 +1,42 @@ +package com.fr.van.chart.map.designer.other.condition.item; + +import com.fr.chart.base.DataSeriesCondition; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.VanChartAttrMarker; +import com.fr.van.chart.designer.other.condition.item.AbstractNormalMultiLineConditionPane; +import com.fr.van.chart.map.designer.style.series.VanChartMapAnchorMarkerPane; + +import javax.swing.JPanel; + +public class VanChartAnchorMarkerConditionPane extends AbstractNormalMultiLineConditionPane { + private VanChartMapAnchorMarkerPane anchorMarkerPane; + + public VanChartAnchorMarkerConditionPane(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + protected String getItemLabelString() { + return Toolkit.i18nText("Fine-Design_Chart_Marker"); + } + + protected JPanel initContentPane() { + anchorMarkerPane = new VanChartMapAnchorMarkerPane(); + return anchorMarkerPane; + } + + public String nameForPopupMenuItem() { + return Toolkit.i18nText("Fine-Design_Chart_Marker"); + } + + public void populate(DataSeriesCondition condition) { + if (condition instanceof VanChartAttrMarker) { + anchorMarkerPane.populateBean((VanChartAttrMarker) condition); + } + } + + public DataSeriesCondition update() { + return anchorMarkerPane.updateBean(); + } +} + diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartAnchorPointMapConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartAnchorPointMapConditionPane.java new file mode 100644 index 0000000000..aba352a2dc --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartAnchorPointMapConditionPane.java @@ -0,0 +1,26 @@ +package com.fr.van.chart.map.designer.other.condition.pane; + +import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.attr.EffectHelper; +import com.fr.plugin.chart.base.AttrEffect; +import com.fr.plugin.chart.base.AttrFloatColor; +import com.fr.plugin.chart.base.VanChartAttrMarker; +import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; +import com.fr.van.chart.designer.other.condition.item.VanChartFloatColorConditionPane; +import com.fr.van.chart.map.designer.other.condition.item.VanChartAnchorMarkerConditionPane; + +public class VanChartAnchorPointMapConditionPane extends VanChartMapConditionPane { + + public VanChartAnchorPointMapConditionPane(Plot plot) { + super(plot); + } + + protected void addDiffAction() { + classPaneMap.put(VanChartAttrMarker.class, new VanChartAnchorMarkerConditionPane(this)); + if (addLabelOrEffectAction()) { + addLabelAction(); + classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this)); + classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getScatterPlotDefaultEffect())); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java new file mode 100644 index 0000000000..b6f43aa210 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java @@ -0,0 +1,64 @@ +package com.fr.van.chart.map.designer.style.series; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.plugin.chart.base.VanChartAttrMarker; +import com.fr.plugin.chart.marker.type.MarkerType; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; + +public class VanChartMapAnchorMarkerPane extends BasicBeanPane { + + private UISpinner anchorSize; + + public VanChartMapAnchorMarkerPane() { + anchorSize = new UISpinner(0, Double.MAX_VALUE, 0.1, 12); + + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Size")), anchorSize} + }; + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double[] row = {p}; + double[] col = {f, e}; + + JPanel content = TableLayoutHelper.createTableLayoutPane(components, row, col); + content.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); + + this.setLayout(new BorderLayout()); + this.add(content, BorderLayout.CENTER); + } + + public void populateBean(VanChartAttrMarker marker) { + if (marker == null) { + marker = new VanChartAttrMarker(); + } + + marker.setCommon(false); + + this.anchorSize.setValue(marker.getAnchorSize()); + } + + public VanChartAttrMarker updateBean() { + VanChartAttrMarker marker = new VanChartAttrMarker(); + + marker.setCommon(false); + marker.setMarkerType(MarkerType.MARKER_AUTO); + marker.setAnchorSize(this.anchorSize.getValue()); + + return marker; + } + + protected String title4PopupWindow() { + return "anchorMarker"; + } +} From b3e8ee29d5a79e13705d6510cc545c3739b45d3c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Dec 2020 10:19:04 +0800 Subject: [PATCH 021/104] =?UTF-8?q?=E4=BF=AE=E6=94=B9populate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/series/VanChartMapAnchorMarkerPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java index b6f43aa210..458de4a188 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java @@ -41,10 +41,10 @@ public class VanChartMapAnchorMarkerPane extends BasicBeanPane Date: Tue, 22 Dec 2020 11:17:28 +0800 Subject: [PATCH 022/104] =?UTF-8?q?=E6=A2=B3=E7=90=86=E5=A4=A7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A8=A1=E5=BC=8F=E4=B8=AD=E7=9A=84=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/map/VanChartMapSeriesPane.java | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java index 62b5bb489d..db257de3dd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java @@ -178,10 +178,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { GUICoreUtils.setEnabled(pointEffectPane, !largeModel); } - checkMarkerComboboxModel((VanChartMapPlot) plot); - + VanChartMapPlot mapPlot = (VanChartMapPlot) plot; + refreshMarkerComboboxModel(mapPlot); if (largeModel) { - checkLargeModelPlotSelectedItem(); + checkLargeModelPlotSelectedItem(mapPlot); } } @@ -194,33 +194,21 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } } - private void checkMarkerComboboxModel(VanChartMapPlot plot) { - if (markerTypeCom == null) { - return; - } - - if (shouldRefreshComboboxModel(plot)) { - - refreshMarkerTypeComboboxModel(plot); - - markerTypeCom.setSelectedItem(plot.getMapMarkerType().toLocalString()); - if (markerTypeLayout != null && markerContentPane != null) { - markerTypeLayout.show(markerContentPane, plot.getMapMarkerType().toLocalString()); - } - } - } - - private void checkLargeModelPlotSelectedItem() { - MapMarkerType selectedType = (MapMarkerType) markerTypeCom.getSelectedItem(); + private void checkLargeModelPlotSelectedItem(VanChartMapPlot plot) { + String selected = plot.getMapMarkerType().toLocalString(); - if (ComparatorUtils.equals(MapMarkerType.IMAGE.toLocalString(), selectedType)) { + if (ComparatorUtils.equals(MapMarkerType.IMAGE.toLocalString(), selected)) { markerTypeCom.setSelectedItem(MapMarkerType.COMMON.toLocalString()); } else { - markerTypeCom.setSelectedItem(selectedType); + markerTypeCom.setSelectedItem(selected); } } private boolean shouldRefreshComboboxModel(VanChartMapPlot plot) { + if (markerTypeCom == null) { + return false; + } + MapMarkerType selectedType = plot.getMapMarkerType(); DefaultComboBoxModel model = (DefaultComboBoxModel) markerTypeCom.getModel(); @@ -231,7 +219,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { return model.getIndexOf(MapMarkerType.DEFAULT.toLocalString()) > -1; } - private void refreshMarkerTypeComboboxModel(VanChartMapPlot plot) { + private void refreshMarkerComboboxModel(VanChartMapPlot plot) { if (largeModel(plot)) { if (plot.getMapMarkerType() == MapMarkerType.DEFAULT) { @@ -247,6 +235,13 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { markerTypeCom.setModel(new DefaultComboBoxModel<>(MARKER_TYPES)); } } + + String selected = plot.getMapMarkerType().toLocalString(); + + markerTypeCom.setSelectedItem(selected); + if (markerTypeLayout != null && markerContentPane != null) { + markerTypeLayout.show(markerContentPane, selected); + } } @Override @@ -572,9 +567,15 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { public void populateBean(Plot plot) { if (plot instanceof VanChartMapPlot) { + VanChartMapPlot mapPlot = (VanChartMapPlot) plot; + if (markerTypeCom != null) { - checkMarkerComboboxModel(((VanChartMapPlot) plot)); - markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString()); + + if (shouldRefreshComboboxModel(mapPlot)) { + refreshMarkerComboboxModel(mapPlot); + } + + markerTypeCom.setSelectedItem(mapPlot.getMapMarkerType().toLocalString()); } if (nullValueColorBox != null) { //TODO Bjorn 地图空值背景自动 @@ -585,11 +586,11 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); checkNullValueButton();*/ - nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); + nullValueColorBox.setSelectObject(mapPlot.getNullValueColor()); } //大数据模式 恢复用注释。下面3行删除。 if (lineMapLargeDataModelGroup != null) { - lineMapLargeDataModelGroup.setSelectedItem(((VanChartMapPlot) plot).getLineMapDataProcessor()); + lineMapLargeDataModelGroup.setSelectedItem(mapPlot.getLineMapDataProcessor()); } } super.populateBean(plot); @@ -597,18 +598,23 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { public void updateBean(Plot plot) { if (plot instanceof VanChartMapPlot) { + VanChartMapPlot mapPlot = (VanChartMapPlot) plot; + if (markerTypeCom != null) { - ((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parse((String) markerTypeCom.getSelectedItem())); - checkMarkerComboboxModel((VanChartMapPlot) plot); + mapPlot.setMapMarkerType(MapMarkerType.parse((String) markerTypeCom.getSelectedItem())); + + if (shouldRefreshComboboxModel(mapPlot)) { + refreshMarkerComboboxModel(mapPlot); + } } if (nullValueColorBox != null) { //TODO Bjorn 地图空值背景自动 //((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0); - ((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject()); + mapPlot.setNullValueColor(nullValueColorBox.getSelectObject()); } //大数据模式 恢复用注释。下面3行删除。 if (lineMapLargeDataModelGroup != null) { - ((VanChartMapPlot) plot).setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem()); + mapPlot.setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem()); } } super.updateBean(plot); From bb555ecedcfbd94eb0f7cdbdb10410204717f4b8 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 22 Dec 2020 15:54:06 +0800 Subject: [PATCH 023/104] =?UTF-8?q?REPORT-45558=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=9F=8B=E7=82=B9=E3=80=91process=E8=A1=A8reuseCmptLi?= =?UTF-8?q?st=E5=AD=97=E6=AE=B5=E5=87=86=E7=A1=AE=E6=80=A7=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/info/JFormProcessInfo.java | 45 +++++++++++++------ .../template/info/JFormProcessInfoTest.java | 33 ++++++++++++-- 2 files changed, 61 insertions(+), 17 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index 180215a247..c8d52dae70 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -10,7 +10,10 @@ import com.fr.form.main.WidgetUtil; import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditorProvider; +import com.fr.form.ui.LayoutBorderStyle; +import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WLayout; @@ -18,7 +21,6 @@ import com.fr.general.ComparatorUtils; import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.report.cell.DefaultTemplateCellElement; - import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -94,23 +96,40 @@ public class JFormProcessInfo extends TemplateProcessInfo
{ private boolean hasTestECReport() { ElementCaseEditorProvider[] elementCaseEditorProviders = this.template.getElementCases(); for (ElementCaseEditorProvider elementCaseEditorProvider : elementCaseEditorProviders) { - FormElementCaseProvider elementCase = elementCaseEditorProvider.getElementCase(); - Iterator it = elementCase.cellIterator(); - if (!it.hasNext()) { + if (isTestECReport(elementCaseEditorProvider)) { return true; } - while (it.hasNext()) { - DefaultTemplateCellElement ce = (DefaultTemplateCellElement) it.next(); - Object value = ce.getValue(); - if (isTestCell(value, ce.getStyle())) { - return true; - } - } - } return false; } + private boolean isTestECReport(ElementCaseEditorProvider elementCaseEditorProvider) { + FormElementCaseProvider elementCase = elementCaseEditorProvider.getElementCase(); + if (!isTestElementCaseEditor((ElementCaseEditor) elementCaseEditorProvider)) { + return false; + } + Iterator it = elementCase.cellIterator(); + if (!it.hasNext()) { + return true; + } + while (it.hasNext()) { + DefaultTemplateCellElement ce = (DefaultTemplateCellElement) it.next(); + Object value = ce.getValue(); + if (!isTestCell(value, ce.getStyle())) { + return false; + } + } + return true; + } + + private boolean isTestElementCaseEditor(ElementCaseEditor editor) { + return editor.getToolBars().length == 0 && editor.getListenerSize() == 0 + && ComparatorUtils.equals(editor.getBorderStyle(), new LayoutBorderStyle()) + && ComparatorUtils.equals(editor.getMargin(), new PaddingMargin()) + && editor.getBackground() == null; + + } + private boolean hasTestChart() { final boolean[] hasTestChart = {false}; Form.traversalWidget(this.template.getContainer(), new WidgetGather() { @@ -226,7 +245,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { private void addComponentRemoveInfo(JSONObject jsonObject) { String componentID = jsonObject.getString("componentID"); - if (componentID == null){ + if (componentID == null) { return; } JSONObject info = componentProcessInfoMap.get(componentID); diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java index 663be87581..04327d354b 100644 --- a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.template.info; +import com.fr.base.background.ColorBackground; import com.fr.chart.chartattr.ChartCollection; import com.fr.form.main.Form; import com.fr.form.ui.CardSwitchButton; @@ -21,6 +22,8 @@ import com.fr.report.worksheet.FormElementCase; import org.junit.Assert; import org.junit.Test; +import java.awt.Color; + /** * Created by kerry on 2020-05-08 */ @@ -35,14 +38,36 @@ public class JFormProcessInfoTest { wFitLayout.addWidget(editor); form.setContainer(wFitLayout); JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); - boolean result1 = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); - Assert.assertTrue(result1); + boolean result = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); + Assert.assertTrue(result); elementCase.addCellElement(new DefaultTemplateCellElement()); - boolean result2 = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); - Assert.assertTrue(result2); + result = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); + Assert.assertTrue(result); + + DefaultTemplateCellElement templateCellElement = new DefaultTemplateCellElement(); + templateCellElement.setValue(123); + + elementCase.addCellElement(templateCellElement); + result = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); + Assert.assertFalse(result); + + elementCase.removeCellElement(templateCellElement); + result = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); + Assert.assertTrue(result); + + editor.setBackground(ColorBackground.getInstance(Color.WHITE)); + result = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); + Assert.assertFalse(result); + + + editor.setBackground(null); + result = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); + Assert.assertTrue(result); } + + @Test public void testHasTestChart() { Form form = new Form(); From 8eec120925afadc3200340e0a86dc18984ef23c5 Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 22 Dec 2020 17:28:49 +0800 Subject: [PATCH 024/104] =?UTF-8?q?REPORT-43744=20=E3=80=9010.0.13?= =?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=8Ejar=E5=8C=85=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/PluginOperateUtils.java | 2 +- .../test/java/com/fr/design/extra/PluginOperateUtilsTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java index 46683e0a05..499254aeb7 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java @@ -231,7 +231,7 @@ public class PluginOperateUtils { else if (pluginMarker instanceof PluginMarkerAdapter) { return ((PluginMarkerAdapter) pluginMarker).getPluginName(); } - return pluginMarker == null ? null : pluginMarker.getPluginID(); + return pluginMarker == null ? StringUtils.EMPTY : pluginMarker.getPluginID(); } public static String getSwitchedInfo(PluginTaskResult result) { diff --git a/designer-base/src/test/java/com/fr/design/extra/PluginOperateUtilsTest.java b/designer-base/src/test/java/com/fr/design/extra/PluginOperateUtilsTest.java index 887cde43e0..bc81cb2c36 100644 --- a/designer-base/src/test/java/com/fr/design/extra/PluginOperateUtilsTest.java +++ b/designer-base/src/test/java/com/fr/design/extra/PluginOperateUtilsTest.java @@ -92,7 +92,7 @@ public class PluginOperateUtilsTest { EasyMock.replay(pluginContext); - Assert.assertNull(Reflect.on(PluginOperateUtils.class).call("getPluginName", null, null).get()); + Assert.assertEquals(Reflect.on(PluginOperateUtils.class).call("getPluginName", null, null).get(), ""); Assert.assertEquals(Reflect.on(PluginOperateUtils.class).call("getPluginName", pluginContext, pluginMarker1).get(), "pluginContext"); Assert.assertEquals(Reflect.on(PluginOperateUtils.class).call("getPluginName", null, pluginMarker1).get(), "id-1"); Assert.assertEquals(Reflect.on(PluginOperateUtils.class).call("getPluginName", null, pluginMarker2).get(), "name-2"); From 25de90af700a821b76bd0a44e4b1e3810802aa98 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Dec 2020 21:28:58 +0800 Subject: [PATCH 025/104] =?UTF-8?q?=E6=A0=87=E8=AE=B0=E7=82=B9=E5=85=BC?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/designer/style/series/VanChartMapAnchorMarkerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java index 458de4a188..d4c1f477bd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java @@ -19,7 +19,7 @@ public class VanChartMapAnchorMarkerPane extends BasicBeanPane Date: Wed, 23 Dec 2020 13:38:26 +0800 Subject: [PATCH 026/104] =?UTF-8?q?REPORT-44644=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A5=E5=8F=A3=E5=BC=80=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/TemplateTreePane.java | 14 +++++- .../fr/design/fun/LocalResourceProvider.java | 43 +++++++++++++++++++ .../fun/TemplateTreeDefineProcessor.java | 19 ++++++++ .../impl/AbstractLocalResourceProvider.java | 23 ++++++++++ .../AbstractTemplateTreeDefineProcessor.java | 24 +++++++++++ .../DesignerFrameFileDealerPane.java | 36 +++++++++++++++- 6 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/TemplateTreeDefineProcessor.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractLocalResourceProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateTreeDefineProcessor.java diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 5041cc34a3..8c731e1f0b 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -4,7 +4,9 @@ package com.fr.design.file; import com.fr.base.FRContext; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.fun.TemplateTreeDefineProcessor; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; @@ -27,8 +29,8 @@ import com.fr.workspace.server.lock.TplOperator; import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; -import javax.swing.UIManager; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; @@ -87,6 +89,16 @@ public class TemplateTreePane extends JPanel implements FileOperations { } } + @Override + public void mouseClicked(MouseEvent e) { + if (SwingUtilities.isRightMouseButton(e)) { + TemplateTreeDefineProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TemplateTreeDefineProcessor.XML_TAG); + if (processor != null) { + processor.rightClickAction(e); + } + } + } + @Override public void mouseReleased(MouseEvent e) { if (toolBarStateChangeListener != null) { diff --git a/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java b/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java new file mode 100644 index 0000000000..482acd941f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java @@ -0,0 +1,43 @@ +package com.fr.design.fun; + +import com.fr.file.filetree.FileNodes; +import com.fr.stable.fun.mark.Immutable; +import com.fr.workspace.resource.WorkResource; +import com.fr.workspace.server.lock.TplOperator; + +/** + * 本地资源操作插件接口 + * + * @author hades + * @version 10.0 + * Created by hades on 2020/12/22 + */ +public interface LocalResourceProvider extends Immutable { + + String XML_TAG = "LocalResourceProvider"; + + int CURRENT_LEVEL = 1; + + /** + * eg: FineWorkResource + * + * @return 目录/文件的操作方式 + */ + WorkResource createResource(); + + + /** + * eg: LocalFileNodes + * + * @return 构建目录树的方式 + */ + FileNodes createFileNodes(); + + /** + * eg:LocalTplOperator + * + * 模板操作 关闭/打开等操作 + */ + TplOperator createTplOperator(); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/TemplateTreeDefineProcessor.java b/designer-base/src/main/java/com/fr/design/fun/TemplateTreeDefineProcessor.java new file mode 100644 index 0000000000..cfa5bcecbe --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/TemplateTreeDefineProcessor.java @@ -0,0 +1,19 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.mark.Immutable; +import java.awt.event.MouseEvent; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/14 + */ +public interface TemplateTreeDefineProcessor extends Immutable { + + String XML_TAG = "TemplateTreeDefineProcessor"; + + int CURRENT_LEVEL = 1; + + void rightClickAction(MouseEvent mouseEvent); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractLocalResourceProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractLocalResourceProvider.java new file mode 100644 index 0000000000..ebefc2ba69 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractLocalResourceProvider.java @@ -0,0 +1,23 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.LocalResourceProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/22 + */ +@API(level = LocalResourceProvider.CURRENT_LEVEL) +public abstract class AbstractLocalResourceProvider implements LocalResourceProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateTreeDefineProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateTreeDefineProcessor.java new file mode 100644 index 0000000000..eba101aada --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateTreeDefineProcessor.java @@ -0,0 +1,24 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.TemplateTreeDefineProcessor; +import com.fr.stable.fun.mark.API; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/21 + */ +@API(level = TemplateTreeDefineProcessor.CURRENT_LEVEL) +public abstract class AbstractTemplateTreeDefineProcessor implements TemplateTreeDefineProcessor { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 4f59032dca..e019e31b4f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -17,8 +17,8 @@ import com.fr.design.file.FileToolbarStateChangeListener; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; -import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.file.TemplateTreePane; +import com.fr.design.fun.LocalResourceProvider; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuHighLight; @@ -34,10 +34,13 @@ import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; +import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; +import com.fr.file.filetree.FileNodes; +import com.fr.file.filetree.LocalFileNodes; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; @@ -46,6 +49,8 @@ import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; +import com.fr.plugin.observer.PluginEventType; +import com.fr.plugin.observer.PluginListenerRegistration; import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -53,6 +58,11 @@ import com.fr.stable.project.ProjectConstants; import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.workspace.WorkContext; +import com.fr.workspace.engine.base.FineObjectPool; +import com.fr.workspace.engine.resource.FineWorkResource; +import com.fr.workspace.resource.WorkResource; +import com.fr.workspace.server.lock.LocalTplOperator; +import com.fr.workspace.server.lock.TplOperator; import javax.swing.BorderFactory; import javax.swing.JDialog; import javax.swing.JOptionPane; @@ -98,6 +108,30 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt return context.contain(PluginModule.ExtraDesign, ShortCut.TEMPLATE_TREE); } }); + PluginFilter filter = pluginContext -> pluginContext.contain(PluginModule.ExtraDesign, LocalResourceProvider.XML_TAG); + + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterStop, new PluginEventListener() { + @Override + public void on(PluginEvent event) { + FineObjectPool.getInstance().getLocalPool().put(WorkResource.class, FineWorkResource.getInstance()); + FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, new LocalFileNodes()); + FineObjectPool.getInstance().getLocalPool().put(TplOperator.class, new LocalTplOperator()); + UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); + } + }, filter); + + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, new PluginEventListener() { + @Override + public void on(PluginEvent event) { + LocalResourceProvider provider = ExtraDesignClassManager.getInstance().getSingle(LocalResourceProvider.XML_TAG); + if (provider != null) { + FineObjectPool.getInstance().getLocalPool().put(WorkResource.class, provider.createResource()); + FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, provider.createFileNodes()); + FineObjectPool.getInstance().getLocalPool().put(TplOperator.class, provider.createTplOperator()); + UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); + } + } + }, filter); } private List otherToolbarStateChangeListeners = new ArrayList<>(); From b48bf4fb84682061a4338ab8239bc29ede0178d3 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 23 Dec 2020 17:04:32 +0800 Subject: [PATCH 027/104] =?UTF-8?q?REPORT-44644=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A5=E5=8F=A3=E5=BC=80=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/MutilTempalteTabPane.java | 4 +- .../com/fr/design/file/ResourceManager.java | 67 +++++++++++++++++++ .../com/fr/design/file/ResourceOperation.java | 62 +++++++++++++++++ .../com/fr/design/file/TemplateTreePane.java | 6 +- .../file/impl/DefaultResourceOperation.java | 48 +++++++++++++ .../fr/design/fun/LocalResourceProvider.java | 17 ++--- .../DesignerFrameFileDealerPane.java | 24 ------- .../com/fr/design/mainframe/JTemplate.java | 3 +- .../main/java/com/fr/file/FileNodeFILE.java | 16 ++--- 9 files changed, 193 insertions(+), 54 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/file/ResourceManager.java create mode 100644 designer-base/src/main/java/com/fr/design/file/ResourceOperation.java create mode 100644 designer-base/src/main/java/com/fr/design/file/impl/DefaultResourceOperation.java diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 69aee1b50e..4a4a4f734b 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -18,8 +18,6 @@ import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.third.javax.annotation.Nonnull; -import com.fr.workspace.WorkContext; -import com.fr.workspace.server.lock.TplOperator; import javax.swing.BorderFactory; import javax.swing.ButtonModel; @@ -707,7 +705,7 @@ public class MutilTempalteTabPane extends JComponent { // 只有是环境内的文件,才执行释放锁 if (file != null && file.isEnvFile()) { // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(file.getPath()); + ResourceManager.getInstance().getOperation().closeTpl(file.getPath()); } } diff --git a/designer-base/src/main/java/com/fr/design/file/ResourceManager.java b/designer-base/src/main/java/com/fr/design/file/ResourceManager.java new file mode 100644 index 0000000000..5fe6896e91 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/file/ResourceManager.java @@ -0,0 +1,67 @@ +package com.fr.design.file; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.file.impl.DefaultResourceOperation; +import com.fr.design.fun.LocalResourceProvider; +import com.fr.design.mainframe.DesignerFrameFileDealerPane; +import com.fr.design.ui.util.UIUtil; +import com.fr.file.filetree.FileNodes; +import com.fr.file.filetree.LocalFileNodes; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; +import com.fr.plugin.observer.PluginEventType; +import com.fr.plugin.observer.PluginListenerRegistration; +import com.fr.workspace.WorkContext; +import com.fr.workspace.engine.base.FineObjectPool; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/23 + */ +public class ResourceManager { + + private static final ResourceManager INSTANCE = new ResourceManager(); + + private ResourceOperation operation = new DefaultResourceOperation(); + + private ResourceManager() { + PluginFilter filter = pluginContext -> pluginContext.contain(PluginModule.ExtraDesign, LocalResourceProvider.XML_TAG); + + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterStop, new PluginEventListener() { + @Override + public void on(PluginEvent event) { + registerOperation(new DefaultResourceOperation()); + FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, new LocalFileNodes()); + UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); + } + }, filter); + + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, new PluginEventListener() { + @Override + public void on(PluginEvent event) { + LocalResourceProvider provider = ExtraDesignClassManager.getInstance().getSingle(LocalResourceProvider.XML_TAG); + if (provider != null && WorkContext.getCurrent().isLocal()) { + registerOperation(provider.createResourceOperation()); + FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, provider.createFileNodes()); + UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); + } + } + }, filter); + } + + public static ResourceManager getInstance() { + return INSTANCE; + } + + private void registerOperation(ResourceOperation operation) { + this.operation = operation; + } + + public ResourceOperation getOperation() { + return this.operation; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/file/ResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/ResourceOperation.java new file mode 100644 index 0000000000..29834cf60c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/file/ResourceOperation.java @@ -0,0 +1,62 @@ +package com.fr.design.file; + +import com.fr.common.annotations.Open; +import com.fr.file.FILE; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/23 + */ +@Open +public interface ResourceOperation { + + /** + * 读取模板 + * @param path + * @return + * @throws Exception + */ + InputStream readTpl(String path) throws Exception; + + /** + * 保存模板 + * @param file + * @return + * @throws Exception + */ + OutputStream saveTpl(FILE file) throws Exception; + + /** + * 删除某个目录/某个模板 + * @param file + * @return + */ + boolean delete(FILE file); + + /** + * 关闭模板 + * @param path + * @return + */ + boolean closeTpl(String path); + + /** + * 重命名模板/路径 + * @param from + * @param to + * @return + */ + boolean rename(String from, String to); + + /** + * 创建工作目录 + * @param path + * @return + */ + boolean mkdir(String path); + + +} diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 8c731e1f0b..d6b50ab7c2 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -194,7 +194,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { @Override public boolean mkdir(String path) { - return WorkContext.getWorkResource().createDirectory(path); + return ResourceManager.getInstance().getOperation().mkdir(path); } /** @@ -337,7 +337,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { if (node instanceof FileNode) { FileNodeFILE nodeFILE = new FileNodeFILE((FileNode) node); if (nodeFILE.exists()) { - if (WorkContext.getCurrent().get(TplOperator.class).delete(nodeFILE.getPath())) { + if (ResourceManager.getInstance().getOperation().delete(nodeFILE)) { HistoryTemplateListCache.getInstance().deleteFile(nodeFILE); } else { success = false; @@ -439,7 +439,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { try { // 接收的是WEB-INF下的路径 - return WorkContext.getCurrent().get(TplOperator.class).rename(from, to); + return ResourceManager.getInstance().getOperation().rename(from, to); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; diff --git a/designer-base/src/main/java/com/fr/design/file/impl/DefaultResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/impl/DefaultResourceOperation.java new file mode 100644 index 0000000000..b065203195 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/file/impl/DefaultResourceOperation.java @@ -0,0 +1,48 @@ +package com.fr.design.file.impl; + +import com.fr.design.file.ResourceOperation; +import com.fr.file.FILE; +import com.fr.workspace.WorkContext; +import com.fr.workspace.server.lock.TplOperator; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/23 + */ +public class DefaultResourceOperation implements ResourceOperation { + + @Override + public InputStream readTpl(String path) throws Exception { + return new ByteArrayInputStream(WorkContext.getCurrent().get(TplOperator.class).readAndLockFile(path)); + } + + @Override + public OutputStream saveTpl(FILE file) throws Exception { + return file.asOutputStream(); + } + + @Override + public boolean closeTpl(String path) { + return WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(path); + } + + @Override + public boolean delete(FILE file) { + return WorkContext.getCurrent().get(TplOperator.class).delete(file.getPath()); + } + + @Override + public boolean rename(String from, String to) { + return WorkContext.getCurrent().get(TplOperator.class).rename(from, to); + } + + @Override + public boolean mkdir(String path) { + return WorkContext.getWorkResource().createDirectory(path); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java b/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java index 482acd941f..afc8ad545b 100644 --- a/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java @@ -1,9 +1,8 @@ package com.fr.design.fun; +import com.fr.design.file.ResourceOperation; import com.fr.file.filetree.FileNodes; import com.fr.stable.fun.mark.Immutable; -import com.fr.workspace.resource.WorkResource; -import com.fr.workspace.server.lock.TplOperator; /** * 本地资源操作插件接口 @@ -19,12 +18,11 @@ public interface LocalResourceProvider extends Immutable { int CURRENT_LEVEL = 1; /** - * eg: FineWorkResource + * eg: DefaultResourceOperation * - * @return 目录/文件的操作方式 + * @return 目录/模板的各种操作 */ - WorkResource createResource(); - + ResourceOperation createResourceOperation(); /** * eg: LocalFileNodes @@ -33,11 +31,4 @@ public interface LocalResourceProvider extends Immutable { */ FileNodes createFileNodes(); - /** - * eg:LocalTplOperator - * - * 模板操作 关闭/打开等操作 - */ - TplOperator createTplOperator(); - } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index e019e31b4f..50c61cda26 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -108,30 +108,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt return context.contain(PluginModule.ExtraDesign, ShortCut.TEMPLATE_TREE); } }); - PluginFilter filter = pluginContext -> pluginContext.contain(PluginModule.ExtraDesign, LocalResourceProvider.XML_TAG); - - PluginListenerRegistration.getInstance().listen(PluginEventType.AfterStop, new PluginEventListener() { - @Override - public void on(PluginEvent event) { - FineObjectPool.getInstance().getLocalPool().put(WorkResource.class, FineWorkResource.getInstance()); - FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, new LocalFileNodes()); - FineObjectPool.getInstance().getLocalPool().put(TplOperator.class, new LocalTplOperator()); - UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); - } - }, filter); - - PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, new PluginEventListener() { - @Override - public void on(PluginEvent event) { - LocalResourceProvider provider = ExtraDesignClassManager.getInstance().getSingle(LocalResourceProvider.XML_TAG); - if (provider != null) { - FineObjectPool.getInstance().getLocalPool().put(WorkResource.class, provider.createResource()); - FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, provider.createFileNodes()); - FineObjectPool.getInstance().getLocalPool().put(TplOperator.class, provider.createTplOperator()); - UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); - } - } - }, filter); } private List otherToolbarStateChangeListeners = new ArrayList<>(); 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 eb191383f9..929519b184 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 @@ -24,6 +24,7 @@ import com.fr.design.designer.TargetComponent; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.InformationWarnPane; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.ResourceManager; import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerFrameUpButtonProvider; import com.fr.design.fun.MenuHandler; @@ -813,7 +814,7 @@ public abstract class JTemplate> return false; } try { - this.getTarget().export(editingFILE.asOutputStream()); + this.getTarget().export(ResourceManager.getInstance().getOperation().saveTpl(editingFILE)); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE); diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index b033d229b9..4b388be365 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -2,6 +2,7 @@ package com.fr.file; import com.fr.base.BaseUtils; import com.fr.base.FRContext; +import com.fr.design.file.ResourceManager; import com.fr.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.file.NodeAuthProcessor; @@ -22,10 +23,8 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.WorkspaceEvent; import com.fr.workspace.resource.WorkResourceTempRenameStream; -import com.fr.workspace.server.lock.TplOperator; import javax.swing.*; -import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; @@ -379,14 +378,11 @@ public class FileNodeFILE implements FILE { if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) { return null; } - InputStream in = new ByteArrayInputStream( - WorkContext.getCurrent().get(TplOperator.class).readAndLockFile( - StableUtils.pathJoin( - ProjectConstants.REPORTLETS_NAME, - envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1) - ) - ) - ); + InputStream in = ResourceManager.getInstance().getOperation().readTpl( + StableUtils.pathJoin( + ProjectConstants.REPORTLETS_NAME, + envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1) + )); return envPath.endsWith(".cpt") || envPath.endsWith(".frm") ? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(FineEncryptUtils.decode(in))) : in; From 1454cc104f42f93e3a2a747e6792a2166e8122b7 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 23 Dec 2020 17:28:19 +0800 Subject: [PATCH 028/104] =?UTF-8?q?REPORT-40684=20=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E8=BE=85=E5=8A=A9=E7=BA=BF=E6=97=B6=E6=8F=90?= =?UTF-8?q?=E5=89=8D=E9=80=82=E9=85=8D=E5=90=88=E5=B9=B6=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=EF=BC=8C=E5=8E=BB=E9=99=A4=E5=90=88=E5=B9=B6=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E4=BD=BF=E7=94=A8=E8=83=8C=E6=99=AF=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E8=BE=85=E5=8A=A9=E7=BA=BF=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/GridUI.java | 331 ++++++++++++------ 1 file changed, 233 insertions(+), 98 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 5f5476511b..711ecee832 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -49,6 +49,7 @@ import com.fr.stable.script.CalculatorUtils; import com.fr.stable.unit.FU; import com.fr.stable.AssistUtils; import com.fr.third.antlr.ANTLRException; +import com.fr.third.guava.collect.HashMultimap; import javax.swing.JComponent; import javax.swing.UIManager; @@ -73,6 +74,7 @@ import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Objects; public class GridUI extends ComponentUI { @@ -91,6 +93,7 @@ public class GridUI extends ComponentUI { protected List paintCellElementList = new ArrayList(); protected List paintCellElementRectangleList = new ArrayList(); protected List paginateLineList = new ArrayList(); // 分页线 + protected HashMultimap mergeCellElementTable = HashMultimap.create(); // 为了画白色的背景. protected static Background WHITE_Backgorund = ColorBackground.getInstance(Color.WHITE); // CellElementPainter @@ -247,7 +250,7 @@ public class GridUI extends ComponentUI { - reportSettings.getFooterHeight().toPixD(resolution); } - private void paintGridLine(Graphics g, Grid grid, double realWidth, double realHeight, + private void paintGridLine(Graphics g, Grid grid, TemplateElementCase report, double realWidth, double realHeight, int resolution) { Graphics2D g2d = (Graphics2D) g; @@ -257,22 +260,51 @@ public class GridUI extends ComponentUI { // 分页线 paginateLineList.clear(); + // 合并单元格 + mergeCellElementTable.clear(); boolean isShowVerticalPaginateLine = grid.getPaginateLineShowType() == Grid.MULTIPLE_PAGINATE_LINE; boolean isShowHorizontalPaginateLine = grid.getPaginateLineShowType() != Grid.NO_PAGINATE_LINE; - new DrawVerticalLineHelper(grid.getVerticalBeginValue(), verticalEndValue, - grid.isShowGridLine(), isShowVerticalPaginateLine, rowHeightList, paperPaintHeight, - paginateLineList, realWidth, resolution).iterateStart2End(g2d); + Iterator cells = report.intersect(grid.getHorizontalBeginValue(), grid.getVerticalBeginValue(), + horizontalEndValue - grid.getHorizontalBeginValue(), verticalEndValue - grid.getVerticalBeginValue()); + while (cells.hasNext()) { + TemplateCellElement cellElement = (TemplateCellElement) cells.next(); + if (cellElement == null) { + continue; + } + int columnSpan = cellElement.getColumnSpan(); + int rowSpan = cellElement.getRowSpan(); + if (columnSpan > 1 || rowSpan > 1) { + for (int c = 0; c < columnSpan - 1; c++) { + for (int r = 0; r < rowSpan; r++) { + mergeCellElementTable.put(CellPosition.value(cellElement.getRow() + r, cellElement.getColumn() + c), CellPosition.RIGHT); + } + } + for (int r = 0; r < rowSpan - 1; r++) { + for (int c = 0; c < columnSpan; c++) { + mergeCellElementTable.put(CellPosition.value(cellElement.getRow() + r, cellElement.getColumn() + c), CellPosition.BOTTOM); + } + } + } + } + GridRange gridRange = GridRange.range(grid.getHorizontalBeginValue(), horizontalEndValue, grid.getVerticalBeginValue(), verticalEndValue) + .rangeList(rowHeightList, columnWidthList) + .realSize(realWidth, realHeight); + + new DrawVerticalLineHelper(gridRange, grid.isShowGridLine(), + isShowVerticalPaginateLine, paperPaintHeight, + paginateLineList, resolution).iterateStart2End(g2d); - new DrawHorizontalLineHelper(grid.getHorizontalBeginValue(), horizontalEndValue, - grid.isShowGridLine(), isShowHorizontalPaginateLine, columnWidthList, paperPaintWidth, - paginateLineList, realHeight, resolution).iterateStart2End(g2d); + new DrawHorizontalLineHelper(gridRange, grid.isShowGridLine(), + isShowHorizontalPaginateLine, paperPaintWidth, + paginateLineList, resolution).iterateStart2End(g2d); } /** * 最后处理 */ + @Override public void finalize() { try { super.finalize(); @@ -285,80 +317,34 @@ public class GridUI extends ComponentUI { } private static abstract class DrawLineHelper { - private int startIndex; - private int endIndex; + protected GridRange gridRange; - private boolean showGridLine; - private boolean showPaginateLine; + protected boolean showGridLine; + protected boolean showPaginateLine; - private DynamicUnitList sizeList; - private double paperPaintSize; + protected double paperPaintSize; - private List paginateLineList; + protected List paginateLineList; Line2D tmpLine2D = new Line2D.Double(0, 0, 0, 0); - private int resolution; + protected int resolution; - private static final double THRESHOLD = 1.0E-4D; + protected static final double THRESHOLD = 1.0E-4D; - DrawLineHelper(int startIndex, int endIndex, boolean showGridLine, - boolean showPaginateLine, DynamicUnitList sizeList, double paperPaintSize, + DrawLineHelper(GridRange gridRange, boolean showGridLine, + boolean showPaginateLine, double paperPaintSize, List paginateLineList, int resolution) { - this.startIndex = startIndex; - this.endIndex = endIndex; + this.gridRange = gridRange; this.showGridLine = showGridLine; this.showPaginateLine = showPaginateLine; - this.sizeList = sizeList; this.paperPaintSize = paperPaintSize; this.paginateLineList = paginateLineList; this.resolution = resolution; } - protected void iterateStart2End(Graphics2D g2d) { - float tmpSize = 0, paperSumSize = 0, sumSize = 0; - for (int i = 0; i <= endIndex; i++) { - // denny: 开始 - if (i == 0) { - i = startIndex; - - // denny: 增加从0到Grid左边被hide的列宽 - for (int k = 0; k < startIndex; k++) { - tmpSize = sizeList.get(k).toPixF(resolution); - - paperSumSize += tmpSize; - if (paperSumSize >= paperPaintSize) { - paperSumSize = tmpSize; - } - } - } - - // adjust height. - tmpSize = sizeList.get(i).toPixF(resolution); - paperSumSize += tmpSize; - - if (showGridLine) {// paint line. - setLine2D((int) sumSize); - g2d.draw(tmpLine2D); - } - - // paint paper margin line. - if (showPaginateLine && paperSumSize - paperPaintSize > THRESHOLD) { - paginateLineList.add(getPaginateLine2D((int) sumSize)); - paperSumSize = tmpSize; - } - - sumSize += tmpSize; - } - - // paint 最后一个横线.. - if (showGridLine) { - drawLastLine(g2d, (int) sumSize); - } - } - - protected abstract void setLine2D(int sumSize); + protected abstract void iterateStart2End(Graphics2D g2d); protected abstract Line2D.Double getPaginateLine2D(int sumSize); @@ -366,14 +352,12 @@ public class GridUI extends ComponentUI { } private class DrawVerticalLineHelper extends DrawLineHelper { - private double realWidth; - DrawVerticalLineHelper(int startIndex, int endIndex, boolean showGridLine, - boolean showPaginateLine, DynamicUnitList unitSizeList, double paperPaintSize, - List paginateLineList, double realWidth, int resolution) { - super(startIndex, endIndex, showGridLine, showPaginateLine, unitSizeList, + DrawVerticalLineHelper(GridRange gridRange, boolean showGridLine, + boolean showPaginateLine, double paperPaintSize, + List paginateLineList, int resolution) { + super(gridRange, showGridLine, showPaginateLine, paperPaintSize, paginateLineList, resolution); - this.realWidth = realWidth; } @Override @@ -382,25 +366,58 @@ public class GridUI extends ComponentUI { } @Override - protected void setLine2D(int sumHeight) { - tmpLine2D.setLine(0, sumHeight, realWidth, sumHeight); + protected void drawLastLine(Graphics2D g2d, int sumHeight) { + GraphHelper.drawLine(g2d, 0, sumHeight, gridRange.realWidth, sumHeight); } @Override - protected void drawLastLine(Graphics2D g2d, int sumHeight) { - GraphHelper.drawLine(g2d, 0, sumHeight, realWidth, sumHeight); + protected void iterateStart2End(Graphics2D g2d) { + float rowHeight, paperYAxisSumSize = 0, yAxisSumSize = 0; + for (int i = 0; i <= gridRange.yEndIndex; i++) { + if (i == 0) { + i = gridRange.yBeginIndex; + for (int k = 0; k < gridRange.yBeginIndex; k++) { + rowHeight = gridRange.rowHeightList.get(k).toPixF(resolution); + + paperYAxisSumSize += rowHeight; + if (paperYAxisSumSize >= paperPaintSize) { + paperYAxisSumSize = rowHeight; + } + } + } + rowHeight = gridRange.rowHeightList.get(i).toPixF(resolution); + paperYAxisSumSize += rowHeight; + if (showGridLine) { + float columnWidth, xAxisSumSize = 0; + for (int j = gridRange.xBeginIndex; j <= gridRange.xEndIndex; j++) { + columnWidth = gridRange.columnWidthList.get(j).toPixF(resolution); + if (!mergeCellElementTable.get(CellPosition.value(i - 1, j)).contains(CellPosition.BOTTOM)) { + tmpLine2D.setLine(xAxisSumSize, yAxisSumSize, xAxisSumSize + columnWidth, yAxisSumSize); + g2d.draw(tmpLine2D); + } + xAxisSumSize += columnWidth; + } + } + if (showPaginateLine && paperYAxisSumSize - paperPaintSize > THRESHOLD) { + paginateLineList.add(getPaginateLine2D((int) yAxisSumSize)); + paperYAxisSumSize = rowHeight; + } + yAxisSumSize += rowHeight; + } + // paint 最后一个横线.. + if (showGridLine) { + drawLastLine(g2d, (int) yAxisSumSize); + } } } private class DrawHorizontalLineHelper extends DrawLineHelper { - private double realHeight; - DrawHorizontalLineHelper(int startIndex, int endIndex, boolean showGridLine, - boolean showPaginateLine, DynamicUnitList unitSizeList, double paperPaintSize, - List paginateLineList, double realHeight, int resolution) { - super(startIndex, endIndex, showGridLine, showPaginateLine, unitSizeList, + DrawHorizontalLineHelper(GridRange gridRange, boolean showGridLine, + boolean showPaginateLine, double paperPaintSize, + List paginateLineList, int resolution) { + super(gridRange, showGridLine, showPaginateLine, paperPaintSize, paginateLineList, resolution); - this.realHeight = realHeight; } @Override @@ -409,13 +426,47 @@ public class GridUI extends ComponentUI { } @Override - protected void setLine2D(int sumWidth) { - tmpLine2D.setLine(sumWidth, 0, sumWidth, realHeight); + protected void drawLastLine(Graphics2D g2d, int sumWidth) { + GraphHelper.drawLine(g2d, sumWidth, 0, sumWidth, gridRange.realHeight); } @Override - protected void drawLastLine(Graphics2D g2d, int sumWidth) { - GraphHelper.drawLine(g2d, sumWidth, 0, sumWidth, realHeight); + protected void iterateStart2End(Graphics2D g2d) { + float columnWidth, paperXAxisSumSize = 0, xAxisSumSize = 0; + for (int i = 0; i <= gridRange.xEndIndex; i++) { + if (i == 0) { + i = gridRange.xBeginIndex; + for (int k = 0; k < gridRange.xBeginIndex; k++) { + columnWidth = gridRange.columnWidthList.get(k).toPixF(resolution); + paperXAxisSumSize += columnWidth; + if (paperXAxisSumSize >= paperPaintSize) { + paperXAxisSumSize = columnWidth; + } + } + } + columnWidth = gridRange.columnWidthList.get(i).toPixF(resolution); + paperXAxisSumSize += columnWidth; + if (showGridLine) { + float rowHeight, yAxisSumSize = 0; + for (int j = gridRange.yBeginIndex; j <= gridRange.yEndIndex; j++) { + rowHeight = gridRange.rowHeightList.get(j).toPixF(resolution); + if (!mergeCellElementTable.get(CellPosition.value(j, i - 1)).contains(CellPosition.RIGHT)) { + tmpLine2D.setLine(xAxisSumSize, yAxisSumSize, xAxisSumSize, yAxisSumSize + rowHeight); + g2d.draw(tmpLine2D); + } + yAxisSumSize += rowHeight; + } + } + if (showPaginateLine && paperXAxisSumSize - paperPaintSize > THRESHOLD) { + paginateLineList.add(getPaginateLine2D((int) xAxisSumSize)); + paperXAxisSumSize = columnWidth; + } + xAxisSumSize += columnWidth; + } + // paint 最后一个横线.. + if (showGridLine) { + drawLastLine(g2d, (int) xAxisSumSize); + } } } @@ -482,18 +533,6 @@ public class GridUI extends ComponentUI { // peter:tmpRectangle2D_3只是一个临时的Rectangle2D,由于后面不少地方需要用到这个矩形 this.cell_back_rect.setRect(0, 0, this.tmpRectangle.getWidth() - 1, this.tmpRectangle.getHeight() - 1.5); - // peter:对于合并的单元格,需要先白色的背景来清除背景. - if (tmpCellElement.getColumnSpan() > 1 || tmpCellElement.getRowSpan() > 1) { - // REPORT-23492 要看下是否设置了纸张背景 如果设置了按照背景来画 - ReportSettingsProvider reportSettings = getReportSettings(report); - Background currentBackground = reportSettings.getBackground(); - if (currentBackground != null) { - currentBackground.paint(g2d, this.cell_back_rect); - } else { - WHITE_Backgorund.paint(g2d, this.cell_back_rect); - } - //daniel:上面这里就有问题了啊....报表的背景在这个之前画的 会覆盖报表背景....不过只是设计器中看到预览浏览没问题 - } // peter:将这个元素添加到需要paint的元素列表当中去,留着画边框线.. paintCellElementList.add(tmpCellElement); paintCellElementRectangleList.add(this.tmpRectangle.clone()); @@ -1093,8 +1132,7 @@ public class GridUI extends ComponentUI { this.paintBackground(g2d, grid, elementCase, resolution); // 画Grid Line - this.paintGridLine(g2d, grid, realWidth, realHeight, resolution); - + this.paintGridLine(g2d, grid, elementCase, realWidth, realHeight, resolution); // peter:添上线程的支持,有时候,paint元素的时候,可能会有元素被删除了. // 需要先清除画Border需要的元素. paintCellElementList.clear(); @@ -1277,4 +1315,101 @@ public class GridUI extends ComponentUI { paginateLineList.add(new Line2D.Double(0, sumHeight, width, sumHeight)); } } + + /** + * 描述单元格位置的POJO + */ + private static class CellPosition { + public final static int TOP = 0; + public static final int LEFT = 1; + public final static int BOTTOM = 2; + public static final int RIGHT = 4; + public int x; + public int y; + + public CellPosition(int x, int y) { + this.x = x; + this.y = y; + } + + public static CellPosition value(int x, int y) { + return new CellPosition(x, y); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CellPosition that = (CellPosition) o; + return x == that.x && y == that.y; + } + + @Override + public int hashCode() { + return Objects.hash(x, y); + } + } + + /** + * 描述表格范围的POJO + * x轴为水平方向,对应的宽度表为列宽列表 + * y轴为垂直方向,对应的宽度表为行高列表 + */ + private static class GridRange { + + public int xBeginIndex; + public int xEndIndex; + public int yBeginIndex; + public int yEndIndex; + double realWidth; + double realHeight; + /** + * 行高列表,对应y方向线段 + */ + public DynamicUnitList rowHeightList; + + /** + * 列宽列表,对应x方向线段 + */ + public DynamicUnitList columnWidthList; + + public GridRange(int xBeginIndex, int xEndIndex, int yBeginIndex, int yEndIndex) { + this.xBeginIndex = xBeginIndex; + this.xEndIndex = xEndIndex; + this.yBeginIndex = yBeginIndex; + this.yEndIndex = yEndIndex; + } + + /** + * 设置行高列宽列表 + * + * @param rowHeightList 行高列表 + * @param columnWidthList 列宽列表 + */ + public GridRange rangeList(DynamicUnitList rowHeightList, DynamicUnitList columnWidthList) { + this.rowHeightList = rowHeightList; + this.columnWidthList = columnWidthList; + return this; + } + + /** + * 设置表格真实宽高 + * + * @param realWidth 宽度 + * @param realHeight 高度 + */ + public GridRange realSize(double realWidth, double realHeight) { + this.realWidth = realWidth; + this.realHeight = realHeight; + return this; + } + + public static GridRange range(int xBeginIndex, int xEndIndex, int yBeginIndex, int yEndIndex) { + return new GridRange(xBeginIndex, xEndIndex, yBeginIndex, yEndIndex); + } + } } From c9def50757e53e37103732e90de2d94b618d236d Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 23 Dec 2020 17:45:29 +0800 Subject: [PATCH 029/104] =?UTF-8?q?REPORT-44644=20fix=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 15 +++++++++++- .../fr/design/file/MutilTempalteTabPane.java | 2 +- ....java => TemplateFileResourceManager.java} | 24 +++++++------------ ...ava => TemplateFileResourceOperation.java} | 12 ++++++---- .../com/fr/design/file/TemplateTreePane.java | 7 +++--- ...DefaultTemplateFileResourceOperation.java} | 10 ++++---- .../fr/design/fun/LocalResourceProvider.java | 4 ++-- .../DesignerFrameFileDealerPane.java | 12 ---------- .../com/fr/design/mainframe/JTemplate.java | 5 ++-- .../main/java/com/fr/file/FileNodeFILE.java | 4 ++-- 10 files changed, 45 insertions(+), 50 deletions(-) rename designer-base/src/main/java/com/fr/design/file/{ResourceManager.java => TemplateFileResourceManager.java} (77%) rename designer-base/src/main/java/com/fr/design/file/{ResourceOperation.java => TemplateFileResourceOperation.java} (74%) rename designer-base/src/main/java/com/fr/design/file/impl/{DefaultResourceOperation.java => DefaultTemplateFileResourceOperation.java} (75%) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 763ffcd1ff..154caa32be 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -23,6 +23,7 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FilenameUtils; +import java.util.LinkedHashMap; import javax.swing.SwingUtilities; import java.io.ByteArrayOutputStream; import java.util.ArrayList; @@ -44,6 +45,9 @@ public class HistoryTemplateListCache implements CallbackEvent { private List> historyList; private JTemplate editingTemplate; + // 插件stop时的已经打开的模板xml byte缓存 插件重新run时 重新加载 + private final Map cacheMap = new LinkedHashMap<>(); + public static HistoryTemplateListCache getInstance() { return Holder.INSTANCE; } @@ -74,7 +78,11 @@ public class HistoryTemplateListCache implements CallbackEvent { selected.fireJTemplateClosed(); selected.stopEditing(); try { - historyList.remove(contains(selected)); + int index = contains(selected); + historyList.remove(index); + if (stashFILEMap != null) { + stashFILEMap.remove(index); + } selected.getEditingFILE().closeTemplate(); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Closed_Warn_Text", selected.getEditingFILE().getName())); MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); @@ -422,6 +430,7 @@ public class HistoryTemplateListCache implements CallbackEvent { /** * 重新载入当前模板,刷新数据/对象 */ + @Deprecated public void reloadCurrentTemplate() { JTemplate jt = getCurrentEditingTemplate(); boolean access = jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); @@ -441,4 +450,8 @@ public class HistoryTemplateListCache implements CallbackEvent { } }); } + + public void stashByName() { + + } } diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 4a4a4f734b..3ad4c401a1 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -705,7 +705,7 @@ public class MutilTempalteTabPane extends JComponent { // 只有是环境内的文件,才执行释放锁 if (file != null && file.isEnvFile()) { // release lock - ResourceManager.getInstance().getOperation().closeTpl(file.getPath()); + TemplateFileResourceManager.getOperation().closeTemplate(file.getPath()); } } diff --git a/designer-base/src/main/java/com/fr/design/file/ResourceManager.java b/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceManager.java similarity index 77% rename from designer-base/src/main/java/com/fr/design/file/ResourceManager.java rename to designer-base/src/main/java/com/fr/design/file/TemplateFileResourceManager.java index 5fe6896e91..7755847324 100644 --- a/designer-base/src/main/java/com/fr/design/file/ResourceManager.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceManager.java @@ -1,7 +1,7 @@ package com.fr.design.file; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.file.impl.DefaultResourceOperation; +import com.fr.design.file.impl.DefaultTemplateFileResourceOperation; import com.fr.design.fun.LocalResourceProvider; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.ui.util.UIUtil; @@ -21,19 +21,17 @@ import com.fr.workspace.engine.base.FineObjectPool; * @version 10.0 * Created by hades on 2020/12/23 */ -public class ResourceManager { +public class TemplateFileResourceManager { - private static final ResourceManager INSTANCE = new ResourceManager(); + private static TemplateFileResourceOperation OPERATION = new DefaultTemplateFileResourceOperation(); - private ResourceOperation operation = new DefaultResourceOperation(); - - private ResourceManager() { + private TemplateFileResourceManager() { PluginFilter filter = pluginContext -> pluginContext.contain(PluginModule.ExtraDesign, LocalResourceProvider.XML_TAG); PluginListenerRegistration.getInstance().listen(PluginEventType.AfterStop, new PluginEventListener() { @Override public void on(PluginEvent event) { - registerOperation(new DefaultResourceOperation()); + registerOperation(new DefaultTemplateFileResourceOperation()); FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, new LocalFileNodes()); UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); } @@ -52,16 +50,12 @@ public class ResourceManager { }, filter); } - public static ResourceManager getInstance() { - return INSTANCE; - } - - private void registerOperation(ResourceOperation operation) { - this.operation = operation; + private static void registerOperation(TemplateFileResourceOperation operation) { + OPERATION = operation; } - public ResourceOperation getOperation() { - return this.operation; + public static TemplateFileResourceOperation getOperation() { + return OPERATION; } } diff --git a/designer-base/src/main/java/com/fr/design/file/ResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java similarity index 74% rename from designer-base/src/main/java/com/fr/design/file/ResourceOperation.java rename to designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java index 29834cf60c..5b1ba9c893 100644 --- a/designer-base/src/main/java/com/fr/design/file/ResourceOperation.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java @@ -6,12 +6,14 @@ import java.io.InputStream; import java.io.OutputStream; /** + * 模板资源操作,可操作模板及模板目录 + * * @author hades * @version 10.0 * Created by hades on 2020/12/23 */ @Open -public interface ResourceOperation { +public interface TemplateFileResourceOperation { /** * 读取模板 @@ -19,7 +21,7 @@ public interface ResourceOperation { * @return * @throws Exception */ - InputStream readTpl(String path) throws Exception; + InputStream readTemplate(String path) throws Exception; /** * 保存模板 @@ -27,7 +29,7 @@ public interface ResourceOperation { * @return * @throws Exception */ - OutputStream saveTpl(FILE file) throws Exception; + OutputStream saveTemplate(FILE file) throws Exception; /** * 删除某个目录/某个模板 @@ -41,7 +43,7 @@ public interface ResourceOperation { * @param path * @return */ - boolean closeTpl(String path); + boolean closeTemplate(String path); /** * 重命名模板/路径 @@ -52,7 +54,7 @@ public interface ResourceOperation { boolean rename(String from, String to); /** - * 创建工作目录 + * 创建目录 * @param path * @return */ diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index d6b50ab7c2..f54fd8eeb4 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -25,7 +25,6 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; -import com.fr.workspace.server.lock.TplOperator; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -194,7 +193,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { @Override public boolean mkdir(String path) { - return ResourceManager.getInstance().getOperation().mkdir(path); + return TemplateFileResourceManager.getOperation().mkdir(path); } /** @@ -337,7 +336,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { if (node instanceof FileNode) { FileNodeFILE nodeFILE = new FileNodeFILE((FileNode) node); if (nodeFILE.exists()) { - if (ResourceManager.getInstance().getOperation().delete(nodeFILE)) { + if (TemplateFileResourceManager.getOperation().delete(nodeFILE)) { HistoryTemplateListCache.getInstance().deleteFile(nodeFILE); } else { success = false; @@ -439,7 +438,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { try { // 接收的是WEB-INF下的路径 - return ResourceManager.getInstance().getOperation().rename(from, to); + return TemplateFileResourceManager.getOperation().rename(from, to); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; diff --git a/designer-base/src/main/java/com/fr/design/file/impl/DefaultResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java similarity index 75% rename from designer-base/src/main/java/com/fr/design/file/impl/DefaultResourceOperation.java rename to designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java index b065203195..e72d78fca0 100644 --- a/designer-base/src/main/java/com/fr/design/file/impl/DefaultResourceOperation.java +++ b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java @@ -1,6 +1,6 @@ package com.fr.design.file.impl; -import com.fr.design.file.ResourceOperation; +import com.fr.design.file.TemplateFileResourceOperation; import com.fr.file.FILE; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; @@ -13,20 +13,20 @@ import java.io.OutputStream; * @version 10.0 * Created by hades on 2020/12/23 */ -public class DefaultResourceOperation implements ResourceOperation { +public class DefaultTemplateFileResourceOperation implements TemplateFileResourceOperation { @Override - public InputStream readTpl(String path) throws Exception { + public InputStream readTemplate(String path) throws Exception { return new ByteArrayInputStream(WorkContext.getCurrent().get(TplOperator.class).readAndLockFile(path)); } @Override - public OutputStream saveTpl(FILE file) throws Exception { + public OutputStream saveTemplate(FILE file) throws Exception { return file.asOutputStream(); } @Override - public boolean closeTpl(String path) { + public boolean closeTemplate(String path) { return WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(path); } diff --git a/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java b/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java index afc8ad545b..51b36d9161 100644 --- a/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java @@ -1,6 +1,6 @@ package com.fr.design.fun; -import com.fr.design.file.ResourceOperation; +import com.fr.design.file.TemplateFileResourceOperation; import com.fr.file.filetree.FileNodes; import com.fr.stable.fun.mark.Immutable; @@ -22,7 +22,7 @@ public interface LocalResourceProvider extends Immutable { * * @return 目录/模板的各种操作 */ - ResourceOperation createResourceOperation(); + TemplateFileResourceOperation createResourceOperation(); /** * eg: LocalFileNodes diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 50c61cda26..83120e4fb0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -18,7 +18,6 @@ import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.TemplateTreePane; -import com.fr.design.fun.LocalResourceProvider; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuHighLight; @@ -34,13 +33,10 @@ import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; -import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; -import com.fr.file.filetree.FileNodes; -import com.fr.file.filetree.LocalFileNodes; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; @@ -49,8 +45,6 @@ import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; -import com.fr.plugin.observer.PluginEventType; -import com.fr.plugin.observer.PluginListenerRegistration; import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -58,17 +52,11 @@ import com.fr.stable.project.ProjectConstants; import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.workspace.WorkContext; -import com.fr.workspace.engine.base.FineObjectPool; -import com.fr.workspace.engine.resource.FineWorkResource; -import com.fr.workspace.resource.WorkResource; -import com.fr.workspace.server.lock.LocalTplOperator; -import com.fr.workspace.server.lock.TplOperator; import javax.swing.BorderFactory; import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.SwingConstants; -import javax.swing.UIManager; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.BorderLayout; 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 929519b184..dbf61e8b59 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 @@ -3,7 +3,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.Parameter; -import com.fr.base.ScreenResolution; import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; @@ -24,7 +23,7 @@ import com.fr.design.designer.TargetComponent; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.InformationWarnPane; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.ResourceManager; +import com.fr.design.file.TemplateFileResourceManager; import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerFrameUpButtonProvider; import com.fr.design.fun.MenuHandler; @@ -814,7 +813,7 @@ public abstract class JTemplate> return false; } try { - this.getTarget().export(ResourceManager.getInstance().getOperation().saveTpl(editingFILE)); + this.getTarget().export(TemplateFileResourceManager.getOperation().saveTemplate(editingFILE)); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE); diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index 4b388be365..ac109606f9 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -2,7 +2,7 @@ package com.fr.file; import com.fr.base.BaseUtils; import com.fr.base.FRContext; -import com.fr.design.file.ResourceManager; +import com.fr.design.file.TemplateFileResourceManager; import com.fr.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.file.NodeAuthProcessor; @@ -378,7 +378,7 @@ public class FileNodeFILE implements FILE { if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) { return null; } - InputStream in = ResourceManager.getInstance().getOperation().readTpl( + InputStream in = TemplateFileResourceManager.getOperation().readTemplate( StableUtils.pathJoin( ProjectConstants.REPORTLETS_NAME, envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1) From 60cd56fc1343bc91e2cd1c40ff0ecae45ebba626 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 23 Dec 2020 17:54:01 +0800 Subject: [PATCH 030/104] =?UTF-8?q?REPORT-44644=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/TemplateFileResourceOperation.java | 9 ++++++++- .../file/impl/DefaultTemplateFileResourceOperation.java | 5 +++++ .../src/main/java/com/fr/file/FileNodeFILE.java | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java index 5b1ba9c893..f3e813c92d 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java @@ -46,13 +46,20 @@ public interface TemplateFileResourceOperation { boolean closeTemplate(String path); /** - * 重命名模板/路径 + * 重命名模板/目录 * @param from * @param to * @return */ boolean rename(String from, String to); + /** + * 模板/目录是否存在 + * @param path + * @return + */ + boolean exist(String path); + /** * 创建目录 * @param path diff --git a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java index e72d78fca0..88a3f85645 100644 --- a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java +++ b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java @@ -40,6 +40,11 @@ public class DefaultTemplateFileResourceOperation implements TemplateFileResourc return WorkContext.getCurrent().get(TplOperator.class).rename(from, to); } + @Override + public boolean exist(String path) { + return WorkContext.getWorkResource().exist(path); + } + @Override public boolean mkdir(String path) { return WorkContext.getWorkResource().createDirectory(path); diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index ac109606f9..3e8178b2d7 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -323,7 +323,7 @@ public class FileNodeFILE implements FILE { } try { - return WorkContext.getWorkResource().exist(node.getEnvPath()); + return TemplateFileResourceManager.getOperation().exist(node.getEnvPath()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; From 8ff603736dd99190aaa05cdbc436f285db502f10 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 23 Dec 2020 19:20:42 +0800 Subject: [PATCH 031/104] =?UTF-8?q?REPORT-44644=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 9 +-------- .../fr/design/file/MutilTempalteTabPane.java | 2 +- ...ceOperation.java => TemplateResource.java} | 2 +- ...ager.java => TemplateResourceManager.java} | 19 ++++++++++++------- .../com/fr/design/file/TemplateTreePane.java | 6 +++--- ...ion.java => AbstractTemplateResource.java} | 5 +++-- .../file/impl/DefaultTemplateResource.java | 10 ++++++++++ .../fr/design/fun/LocalResourceProvider.java | 4 ++-- .../com/fr/design/mainframe/JTemplate.java | 4 ++-- .../main/java/com/fr/file/FileNodeFILE.java | 6 +++--- 10 files changed, 38 insertions(+), 29 deletions(-) rename designer-base/src/main/java/com/fr/design/file/{TemplateFileResourceOperation.java => TemplateResource.java} (96%) rename designer-base/src/main/java/com/fr/design/file/{TemplateFileResourceManager.java => TemplateResourceManager.java} (79%) rename designer-base/src/main/java/com/fr/design/file/impl/{DefaultTemplateFileResourceOperation.java => AbstractTemplateResource.java} (90%) create mode 100644 designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 154caa32be..ba4a88c4c8 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -45,9 +45,6 @@ public class HistoryTemplateListCache implements CallbackEvent { private List> historyList; private JTemplate editingTemplate; - // 插件stop时的已经打开的模板xml byte缓存 插件重新run时 重新加载 - private final Map cacheMap = new LinkedHashMap<>(); - public static HistoryTemplateListCache getInstance() { return Holder.INSTANCE; } @@ -78,11 +75,7 @@ public class HistoryTemplateListCache implements CallbackEvent { selected.fireJTemplateClosed(); selected.stopEditing(); try { - int index = contains(selected); - historyList.remove(index); - if (stashFILEMap != null) { - stashFILEMap.remove(index); - } + historyList.remove(contains(selected)); selected.getEditingFILE().closeTemplate(); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Closed_Warn_Text", selected.getEditingFILE().getName())); MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 3ad4c401a1..269918448a 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -705,7 +705,7 @@ public class MutilTempalteTabPane extends JComponent { // 只有是环境内的文件,才执行释放锁 if (file != null && file.isEnvFile()) { // release lock - TemplateFileResourceManager.getOperation().closeTemplate(file.getPath()); + TemplateResourceManager.getResource().closeTemplate(file.getPath()); } } diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/TemplateResource.java similarity index 96% rename from designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java rename to designer-base/src/main/java/com/fr/design/file/TemplateResource.java index f3e813c92d..f394822d6b 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateResource.java @@ -13,7 +13,7 @@ import java.io.OutputStream; * Created by hades on 2020/12/23 */ @Open -public interface TemplateFileResourceOperation { +public interface TemplateResource { /** * 读取模板 diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceManager.java b/designer-base/src/main/java/com/fr/design/file/TemplateResourceManager.java similarity index 79% rename from designer-base/src/main/java/com/fr/design/file/TemplateFileResourceManager.java rename to designer-base/src/main/java/com/fr/design/file/TemplateResourceManager.java index 7755847324..384b1a3e1e 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceManager.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateResourceManager.java @@ -1,7 +1,7 @@ package com.fr.design.file; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.file.impl.DefaultTemplateFileResourceOperation; +import com.fr.design.file.impl.DefaultTemplateResource; import com.fr.design.fun.LocalResourceProvider; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.ui.util.UIUtil; @@ -21,17 +21,19 @@ import com.fr.workspace.engine.base.FineObjectPool; * @version 10.0 * Created by hades on 2020/12/23 */ -public class TemplateFileResourceManager { +public class TemplateResourceManager { - private static TemplateFileResourceOperation OPERATION = new DefaultTemplateFileResourceOperation(); + private static final TemplateResource DEFAULT_OPERATION = new DefaultTemplateResource(); - private TemplateFileResourceManager() { + private static TemplateResource OPERATION = DEFAULT_OPERATION; + + static { PluginFilter filter = pluginContext -> pluginContext.contain(PluginModule.ExtraDesign, LocalResourceProvider.XML_TAG); PluginListenerRegistration.getInstance().listen(PluginEventType.AfterStop, new PluginEventListener() { @Override public void on(PluginEvent event) { - registerOperation(new DefaultTemplateFileResourceOperation()); + registerOperation(new DefaultTemplateResource()); FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, new LocalFileNodes()); UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); } @@ -50,11 +52,14 @@ public class TemplateFileResourceManager { }, filter); } - private static void registerOperation(TemplateFileResourceOperation operation) { + private static void registerOperation(TemplateResource operation) { OPERATION = operation; } - public static TemplateFileResourceOperation getOperation() { + public static TemplateResource getResource() { + if (OPERATION == null) { + return DEFAULT_OPERATION; + } return OPERATION; } diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index f54fd8eeb4..0fc3ca7281 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -193,7 +193,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { @Override public boolean mkdir(String path) { - return TemplateFileResourceManager.getOperation().mkdir(path); + return TemplateResourceManager.getResource().mkdir(path); } /** @@ -336,7 +336,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { if (node instanceof FileNode) { FileNodeFILE nodeFILE = new FileNodeFILE((FileNode) node); if (nodeFILE.exists()) { - if (TemplateFileResourceManager.getOperation().delete(nodeFILE)) { + if (TemplateResourceManager.getResource().delete(nodeFILE)) { HistoryTemplateListCache.getInstance().deleteFile(nodeFILE); } else { success = false; @@ -438,7 +438,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { try { // 接收的是WEB-INF下的路径 - return TemplateFileResourceManager.getOperation().rename(from, to); + return TemplateResourceManager.getResource().rename(from, to); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; diff --git a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java similarity index 90% rename from designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java rename to designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java index 88a3f85645..acf785dd46 100644 --- a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java +++ b/designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java @@ -1,6 +1,7 @@ package com.fr.design.file.impl; -import com.fr.design.file.TemplateFileResourceOperation; + +import com.fr.design.file.TemplateResource; import com.fr.file.FILE; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; @@ -13,7 +14,7 @@ import java.io.OutputStream; * @version 10.0 * Created by hades on 2020/12/23 */ -public class DefaultTemplateFileResourceOperation implements TemplateFileResourceOperation { +public class AbstractTemplateResource implements TemplateResource { @Override public InputStream readTemplate(String path) throws Exception { diff --git a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java new file mode 100644 index 0000000000..125f1a9f31 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java @@ -0,0 +1,10 @@ +package com.fr.design.file.impl; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/23 + */ +public class DefaultTemplateResource extends AbstractTemplateResource { + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java b/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java index 51b36d9161..56a98a2359 100644 --- a/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java @@ -1,6 +1,6 @@ package com.fr.design.fun; -import com.fr.design.file.TemplateFileResourceOperation; +import com.fr.design.file.TemplateResource; import com.fr.file.filetree.FileNodes; import com.fr.stable.fun.mark.Immutable; @@ -22,7 +22,7 @@ public interface LocalResourceProvider extends Immutable { * * @return 目录/模板的各种操作 */ - TemplateFileResourceOperation createResourceOperation(); + TemplateResource createResourceOperation(); /** * eg: LocalFileNodes 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 dbf61e8b59..5cfd7a13d4 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 @@ -23,7 +23,7 @@ import com.fr.design.designer.TargetComponent; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.InformationWarnPane; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.file.TemplateFileResourceManager; +import com.fr.design.file.TemplateResourceManager; import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerFrameUpButtonProvider; import com.fr.design.fun.MenuHandler; @@ -813,7 +813,7 @@ public abstract class JTemplate> return false; } try { - this.getTarget().export(TemplateFileResourceManager.getOperation().saveTemplate(editingFILE)); + this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(editingFILE)); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE); diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index 3e8178b2d7..d096faf8a7 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -2,7 +2,7 @@ package com.fr.file; import com.fr.base.BaseUtils; import com.fr.base.FRContext; -import com.fr.design.file.TemplateFileResourceManager; +import com.fr.design.file.TemplateResourceManager; import com.fr.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.file.NodeAuthProcessor; @@ -323,7 +323,7 @@ public class FileNodeFILE implements FILE { } try { - return TemplateFileResourceManager.getOperation().exist(node.getEnvPath()); + return TemplateResourceManager.getResource().exist(node.getEnvPath()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; @@ -378,7 +378,7 @@ public class FileNodeFILE implements FILE { if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) { return null; } - InputStream in = TemplateFileResourceManager.getOperation().readTemplate( + InputStream in = TemplateResourceManager.getResource().readTemplate( StableUtils.pathJoin( ProjectConstants.REPORTLETS_NAME, envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1) From 88c455a958c885ec1f6125139a9a050166de3672 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 23 Dec 2020 19:22:47 +0800 Subject: [PATCH 032/104] =?UTF-8?q?REPORT-44644=20fix=E6=97=A0=E7=94=A8imp?= =?UTF-8?q?ort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/file/HistoryTemplateListCache.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index ba4a88c4c8..7b13c94a07 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -2,7 +2,6 @@ package com.fr.design.file; import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.io.BaseBook; -import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.data.DesignTableDataManager; @@ -23,8 +22,6 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FilenameUtils; -import java.util.LinkedHashMap; -import javax.swing.SwingUtilities; import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Collections; @@ -423,7 +420,6 @@ public class HistoryTemplateListCache implements CallbackEvent { /** * 重新载入当前模板,刷新数据/对象 */ - @Deprecated public void reloadCurrentTemplate() { JTemplate jt = getCurrentEditingTemplate(); boolean access = jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); @@ -444,7 +440,4 @@ public class HistoryTemplateListCache implements CallbackEvent { }); } - public void stashByName() { - - } } From d9a770f847fa6d88d350f870080fec6904f2e8d5 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 24 Dec 2020 10:23:14 +0800 Subject: [PATCH 033/104] =?UTF-8?q?REPORT-44644=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A5=E5=8F=A3=E5=BC=80=E6=94=BE=20fix=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E5=B1=82=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/impl/AbstractTemplateResource.java | 37 +--------------- .../file/impl/DefaultTemplateResource.java | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 36 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java b/designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java index acf785dd46..cb76792a13 100644 --- a/designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java +++ b/designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java @@ -14,41 +14,6 @@ import java.io.OutputStream; * @version 10.0 * Created by hades on 2020/12/23 */ -public class AbstractTemplateResource implements TemplateResource { - - @Override - public InputStream readTemplate(String path) throws Exception { - return new ByteArrayInputStream(WorkContext.getCurrent().get(TplOperator.class).readAndLockFile(path)); - } - - @Override - public OutputStream saveTemplate(FILE file) throws Exception { - return file.asOutputStream(); - } - - @Override - public boolean closeTemplate(String path) { - return WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(path); - } - - @Override - public boolean delete(FILE file) { - return WorkContext.getCurrent().get(TplOperator.class).delete(file.getPath()); - } - - @Override - public boolean rename(String from, String to) { - return WorkContext.getCurrent().get(TplOperator.class).rename(from, to); - } - - @Override - public boolean exist(String path) { - return WorkContext.getWorkResource().exist(path); - } - - @Override - public boolean mkdir(String path) { - return WorkContext.getWorkResource().createDirectory(path); - } +public abstract class AbstractTemplateResource implements TemplateResource { } diff --git a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java index 125f1a9f31..8c54cc8cc3 100644 --- a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java +++ b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java @@ -1,5 +1,12 @@ package com.fr.design.file.impl; +import com.fr.file.FILE; +import com.fr.workspace.WorkContext; +import com.fr.workspace.server.lock.TplOperator; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; + /** * @author hades * @version 10.0 @@ -7,4 +14,39 @@ package com.fr.design.file.impl; */ public class DefaultTemplateResource extends AbstractTemplateResource { + @Override + public InputStream readTemplate(String path) throws Exception { + return new ByteArrayInputStream(WorkContext.getCurrent().get(TplOperator.class).readAndLockFile(path)); + } + + @Override + public OutputStream saveTemplate(FILE file) throws Exception { + return file.asOutputStream(); + } + + @Override + public boolean closeTemplate(String path) { + return WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(path); + } + + @Override + public boolean delete(FILE file) { + return WorkContext.getCurrent().get(TplOperator.class).delete(file.getPath()); + } + + @Override + public boolean rename(String from, String to) { + return WorkContext.getCurrent().get(TplOperator.class).rename(from, to); + } + + @Override + public boolean exist(String path) { + return WorkContext.getWorkResource().exist(path); + } + + @Override + public boolean mkdir(String path) { + return WorkContext.getWorkResource().createDirectory(path); + } + } From acab6692f6f1ba426156af2f23f74fc45dd6f72b Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 24 Dec 2020 11:02:27 +0800 Subject: [PATCH 034/104] =?UTF-8?q?REPORT-45460=20=E5=B8=86=E8=BD=AF?= =?UTF-8?q?=E5=B8=82=E5=9C=BA=E5=9B=BD=E9=99=85=E5=8C=96=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/extra/PluginOperateUtils.java | 7 +++++++ .../design/extra/exe/GetPluginFromStoreExecutor.java | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java index 801b4e369a..d868735252 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java @@ -128,6 +128,10 @@ public class PluginOperateUtils { } public static void dealParams(StringBuilder url, String category, String seller, String fee, String scope) { + dealParams(url, category, seller, fee, StringUtils.EMPTY); + } + + public static void dealParams(StringBuilder url, String category, String seller, String fee, String scope, String language) { if (StringUtils.isNotBlank(category)) { url.append("cid=").append(category.split("-")[1]); } else { @@ -169,6 +173,9 @@ public class PluginOperateUtils { url.append("&scope=").append(StringUtils.EMPTY); } } + if (StringUtils.isNotBlank(language)) { + url.append("&language=").append(language.split("-")[1]); + } } public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) { diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java b/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java index 3bf7b2cb32..b3d66d510e 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java @@ -21,19 +21,26 @@ public class GetPluginFromStoreExecutor implements Executor { private String seller; private String fee; private String scope; + private String language; public GetPluginFromStoreExecutor(JSONObject info) { this.category = info.optString("categories"); this.fee = info.optString("fee"); this.seller = info.optString("seller"); this.scope = info.optString("scope"); + this.language = info.optString("language"); } public GetPluginFromStoreExecutor(String category, String seller, String fee, String scope) { + this(category, seller, fee, scope, StringUtils.EMPTY); + } + + public GetPluginFromStoreExecutor(String category, String seller, String fee, String scope, String language) { this.category = category; this.seller = seller; this.fee = fee; this.scope = scope; + this.language = language; } @Override @@ -53,7 +60,7 @@ public class GetPluginFromStoreExecutor implements Executor { @Override public void run(Process process) { String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist"); - boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope); + boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope) & StringUtils.isEmpty(language); if (getRecommend) { result = PluginOperateUtils.getRecommendPlugins(); return; @@ -62,7 +69,7 @@ public class GetPluginFromStoreExecutor implements Executor { if (StringUtils.isNotBlank(plistUrl)) { StringBuilder url = new StringBuilder(); url.append(plistUrl).append("?"); - PluginOperateUtils.dealParams(url, category, seller, fee, scope); + PluginOperateUtils.dealParams(url, category, seller, fee, scope, language); try { HttpClient httpClient = new HttpClient(url.toString()); httpClient.asGet(); From f12138626871ed9f050a8015806fda664b01960e Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 25 Dec 2020 09:21:53 +0800 Subject: [PATCH 035/104] =?UTF-8?q?KERNEL-6380=20=E5=9C=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=8F=92=E4=BB=B6=E5=88=87=E6=8D=A2=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E9=9C=80=E8=A6=81=E6=9C=89=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E5=88=B7=E6=96=B0=E7=BC=93=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/PluginRefreshManager.java | 73 +++++++++++++++++++ .../data/datapane/TableDataTreePane.java | 34 --------- .../design/file/HistoryTemplateListCache.java | 27 +++++++ .../design/gui/frpane/HyperlinkGroupPane.java | 1 - .../com/fr/design/mainframe/JTemplate.java | 18 +++-- .../start/module/DesignerInitActivator.java | 2 + .../module/DesignerWorkspaceActivator.java | 4 +- 7 files changed, 118 insertions(+), 41 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/PluginRefreshManager.java diff --git a/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java b/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java new file mode 100644 index 0000000000..67442bb06a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java @@ -0,0 +1,73 @@ +package com.fr.design; + +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.fun.HyperlinkProvider; +import com.fr.design.fun.TableDataDefineProvider; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; +import com.fr.plugin.observer.PluginEventType; +import com.fr.plugin.observer.PluginListenerRegistration; +import com.fr.stable.fun.IOFileAttrMark; +import java.util.HashSet; +import java.util.Set; + +/** + * + * @author hades + * @version 10.0 + * Created by hades on 2020/12/17 + */ +public class PluginRefreshManager { + + + private static final PluginRefreshManager INSTANCE = new PluginRefreshManager(); + + private final Set context = new HashSet<>(); + + private final PluginEventListener pluginAfterRunEventListener = new PluginEventListener() { + @Override + public void on(PluginEvent event) { + // 重新载入模板xml内容 到 Workbook/Form对象中 + HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); + } + }; + + private final PluginFilter pluginFilter = pluginContext -> { + for (String xmlTag : context) { + if (pluginContext.contain(xmlTag)) { + return true; + } + } + return false; + }; + + + public static PluginRefreshManager getInstance() { + return INSTANCE; + } + + public void load() { + context.add(IOFileAttrMark.MARK_STRING); + context.add(TableDataDefineProvider.XML_TAG); + context.add(HyperlinkProvider.XML_TAG); + } + + private PluginRefreshManager() { + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener, this.pluginFilter); + } + + public void registerItem(String xmlTag) { + context.add(xmlTag); + } + + public void removePluginListener() { + PluginListenerRegistration.getInstance().stopListen(this.pluginAfterRunEventListener); + + } + + public void addPluginListener() { + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener, this.pluginFilter); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index a2cc5b7d28..f1a3cf336c 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -18,8 +18,6 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; -import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.fun.TableDataDefineProvider; import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icontainer.UIScrollPane; @@ -28,7 +26,6 @@ import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.icon.IconPathConstants; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ToolBarDef; @@ -98,9 +95,6 @@ public class TableDataTreePane extends BasicTableDataTreePane { createAddMenuDef(); - // 创建插件监听 - createPluginListener(); - editAction = new EditAction(); removeAction = new RemoveAction(); previewTableDataAction = new PreviewTableDataAction(dataTree); @@ -160,34 +154,6 @@ public class TableDataTreePane extends BasicTableDataTreePane { return context.contain(PluginModule.ExtraDesign); } }); - - //监听数据集插件 - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - @Override - public void on(PluginEvent event) { - //REPORT-25577 - //如果数据集插件禁用或启用。需要清空当前模板中的缓存 - reloadCurrTemplate(); - } - - private void reloadCurrTemplate() { - JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (accept(jt)) { - jt.refreshResource(); - } - } - - private boolean accept(JTemplate jt) { - - return jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); - } - }, new PluginFilter() { - @Override - public boolean accept(PluginContext pluginContext) { - - return pluginContext.contain(TableDataDefineProvider.XML_TAG); - } - }); } diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 7b13c94a07..05b2a24f67 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -420,6 +420,7 @@ public class HistoryTemplateListCache implements CallbackEvent { /** * 重新载入当前模板,刷新数据/对象 */ + @Deprecated public void reloadCurrentTemplate() { JTemplate jt = getCurrentEditingTemplate(); boolean access = jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); @@ -440,4 +441,30 @@ public class HistoryTemplateListCache implements CallbackEvent { }); } + /** + * 插件安装后/启用 重新加载模板资源 + */ + public void reloadAllEditingTemplate() { + FineLoggerFactory.getLogger().info("Plugin env Change reload all template started"); + int size = historyList.size(); + for (int i = 0; i < size; i++) { + JTemplate template = historyList.get(i); + FILE file = template.getEditingFILE(); + try { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + BaseBook target = template.getTarget(); + if (target != null) { + FineLoggerFactory.getLogger().info("{} is being reloaded", template.getName()); + target.export(outputStream); + FILE stashedFile = new StashedFILE(file, outputStream.toByteArray()); + template.refreshResource(stashedFile); + } + // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + FineLoggerFactory.getLogger().info("Plugin env Change reload all template ended"); + } + } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java index 8405ce09ea..0a8e4769a9 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java @@ -46,7 +46,6 @@ public abstract class HyperlinkGroupPane extends UIListControlPane { @Override public void on(PluginEvent event) { refreshNameableCreator(createNameableCreators()); - HistoryTemplateListCache.getInstance().reloadCurrentTemplate(); } }, new PluginFilter() { 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 5cfd7a13d4..87bcd23f5e 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 @@ -47,6 +47,7 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; +import com.fr.design.ui.util.UIUtil; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.event.EventDispatcher; @@ -332,16 +333,23 @@ public abstract class JTemplate> * CenterPane 负责监听改动。 * 所以需要同步处理 */ + @Deprecated public void refreshResource() { + refreshResource(this.editingFILE); + } + + public void refreshResource(FILE file) { try { - this.template = JTemplateFactory.asIOFile(this.editingFILE); + this.template = JTemplateFactory.asIOFile(file); setTarget(this.template); - // 先移除旧的。 - removeCenterPane(); - // 加入新的 - addCenterPane(); + UIUtil.invokeLaterIfNeeded(() -> { + // 先移除旧的。 + removeCenterPane(); + // 加入新的 + addCenterPane(); + }); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java index 1eeb5a6a3a..5ca7efdd6b 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java @@ -1,5 +1,6 @@ package com.fr.start.module; +import com.fr.design.PluginRefreshManager; import com.fr.module.Activator; import com.fr.start.DesignerInitial; @@ -15,6 +16,7 @@ public class DesignerInitActivator extends Activator { @Override public void start() { + PluginRefreshManager.getInstance().load(); DesignerInitial.init(findSingleton(StartupArgs.class).get()); } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java index f5231eafeb..1842ea7622 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java @@ -1,6 +1,7 @@ package com.fr.start.module; import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.PluginRefreshManager; import com.fr.design.file.HistoryTemplateListCache; import com.fr.event.Event; import com.fr.event.Listener; @@ -50,7 +51,7 @@ public class DesignerWorkspaceActivator extends Activator { @Override public void on(Event event, Workspace workspace) { - + PluginRefreshManager.getInstance().removePluginListener(); HistoryTemplateListCache.getInstance().stash(); } }); @@ -62,6 +63,7 @@ public class DesignerWorkspaceActivator extends Activator { public void on(Event event, Workspace workspace) { HistoryTemplateListCache.getInstance().load(); + PluginRefreshManager.getInstance().addPluginListener(); } }); } From 7697ec5fa790e0967e67c5cb5d156335234d5533 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Dec 2020 15:27:24 +0800 Subject: [PATCH 036/104] =?UTF-8?q?REPORT-44803=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=8B=96=E5=8A=A8=E7=BB=84=E4=BB=B6=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=8F=B3=E4=BE=A7=E4=B8=8D=E8=83=BD=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=A7=E5=B0=8F--=E6=9D=A5=E6=BA=90?= =?UTF-8?q?=E3=80=90=E5=AE=A2=E6=88=B7=E9=9C=80=E6=B1=82=20508884=E3=80=91?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E7=9A=84frm=E7=BC=A9=E6=94=BE=E7=9A=84?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E2=80=94=E2=80=94REPORT-37353=EF=BC=8C?= =?UTF-8?q?=E6=8A=8A=E5=BD=93=E5=89=8D=E7=9A=84=E5=83=8F=E7=B4=A0=E5=80=BC?= =?UTF-8?q?=E7=BB=99=E8=AE=BE=E7=BD=AE=E6=88=90=E4=BA=86=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84x=E3=80=81y=E5=80=BC=EF=BC=8C=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E5=BD=93=E6=8B=96=E5=8A=A8=E7=BB=84=E4=BB=B6=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8Cx?= =?UTF-8?q?=E3=80=81y=E4=B8=8D=E5=8F=98=EF=BC=8C=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E4=B9=9F=E4=B8=8D=E4=BC=9A=E5=8F=98=E5=8A=A8=EF=BC=8C=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E6=B2=A1=E6=9C=89=E5=8A=A0=E4=B8=8A=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=AE=BD=E9=AB=98=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E4=B8=BAx=E3=80=81y=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=BD=E9=AB=98?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 9 ++------- .../main/java/com/fr/file/FILEChooserPane.java | 8 -------- .../com/fr/design/mainframe/FormDesignerUI.java | 4 ++-- .../mainframe/socketio/DesignerSocketIO.java | 16 +++++----------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 67e4ed905f..a1e0c48316 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -51,7 +51,6 @@ import com.fr.workspace.engine.rpc.WorkspaceProxyPool; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; -import java.awt.Window; import java.lang.reflect.Method; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -59,10 +58,10 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; -import java.util.HashSet; import static javax.swing.JOptionPane.ERROR_MESSAGE; import static javax.swing.JOptionPane.QUESTION_MESSAGE; @@ -412,12 +411,8 @@ public class EnvChangeEntrance { } public void chooseEnv(final String envName) { - chooseEnv(envName, SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); - } - - public void chooseEnv(final String envName, Window window) { final EnvListPane envListPane = new EnvListPane(); - final BasicDialog envListDialog = envListPane.showWindow(window); + final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); envListPane.populateEnvManager(envName); envListDialog.addDialogActionListener(new DialogActionAdapter() { diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 382732dd97..43c3f43ad8 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -1774,12 +1774,4 @@ public class FILEChooserPane extends BasicPane { } } } - - public boolean isDialogVisible() { - return dialog != null && dialog.isVisible(); - } - - public UIDialog getDialog() { - return dialog; - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index a21a2efad5..8f731d8114 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -183,12 +183,12 @@ public class FormDesignerUI extends ComponentUI { x1 = 0; x2 = 6; y2 = y1 = bounds.y - designer.getVerticalScaleValue() + (k == 1 ? 0 : bounds.height); - text = Utils.objectToString(bounds.y); + text = Utils.objectToString(y1 + designer.getVerticalScaleValue()); } else { y1 = 0; y2 = 6; x1 = x2 = bounds.x - designer.getHorizontalScaleValue()+ (k == 3 ? 0 : bounds.width); - text = Utils.objectToString(bounds.x); + text = Utils.objectToString(x1 + designer.getHorizontalScaleValue()); } text += com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel"); g2d.setColor(XCreatorConstants.RESIZE_BOX_BORDER_COLOR); 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 19754bfc4a..512ea41c43 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 @@ -12,7 +12,6 @@ import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; -import com.fr.file.FILEChooserPane; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; @@ -28,12 +27,12 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; -import java.awt.Window; -import java.util.Arrays; -import javax.swing.*; +import javax.swing.JOptionPane; +import javax.swing.UIManager; import java.io.IOException; import java.net.URI; import java.net.URL; +import java.util.Arrays; public class DesignerSocketIO { @@ -177,18 +176,13 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { - // 因为有可能在文件保存界面的时候,弹出连接失败弹窗,为了避免二级弹窗问题,这边对父窗口做个判断 - boolean isFileChooserPaneExist = FILEChooserPane.getInstance().isDialogVisible(); - Window window = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : DesignerContext.getDesignerFrame(); FineJOptionPane.showMessageDialog( - window, + DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); - // 紧接着弹出的选择工作环境的窗口也判断一下父窗口,否则会被文件保存界面覆盖掉 - Window window1 = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()); - EnvChangeEntrance.getInstance().chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName(), window1); + EnvChangeEntrance.getInstance().chooseEnv(); } }); } catch (Exception e) { From 5cbbe6a541f7bb93bea24e2b2e570b4c6d7ff7fd Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Dec 2020 15:34:42 +0800 Subject: [PATCH 037/104] =?UTF-8?q?REPORT-44803=20=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E4=B8=8B=E4=B9=8B=E5=89=8D=E5=85=B3=E9=97=AD=E7=9A=84pr?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=B7=B2=E6=94=B9=E5=8A=A8=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 2 +- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index a1e0c48316..0ddb749269 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -58,10 +58,10 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.HashSet; import static javax.swing.JOptionPane.ERROR_MESSAGE; import static javax.swing.JOptionPane.QUESTION_MESSAGE; 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 512ea41c43..33b3b80f7d 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 @@ -27,12 +27,11 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; -import javax.swing.JOptionPane; -import javax.swing.UIManager; +import java.util.Arrays; +import javax.swing.*; import java.io.IOException; import java.net.URI; import java.net.URL; -import java.util.Arrays; public class DesignerSocketIO { From 6246ac593d6632dcf2ab5ed243f225ad62482bff Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 28 Dec 2020 10:40:38 +0800 Subject: [PATCH 038/104] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E7=82=B9=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/designer/style/series/VanChartMapAnchorMarkerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java index d4c1f477bd..745c3a79a8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java @@ -22,7 +22,7 @@ public class VanChartMapAnchorMarkerPane extends BasicBeanPane Date: Mon, 28 Dec 2020 14:13:08 +0800 Subject: [PATCH 039/104] =?UTF-8?q?REPORT-45473=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=91=BD=E5=90=8D=E8=B6=85=E8=BF=8716=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E6=97=B6=EF=BC=8C=E5=85=B3=E8=81=94=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E4=B8=AD=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=90=8D=E7=A7=B0=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=98=AF=E8=B0=83=E7=94=A8=E4=BB=A3=E8=A1=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D=E7=A7=B0=E7=9A=84UILabel?= =?UTF-8?q?=E7=9A=84getPreferredSize()=E8=8E=B7=E5=8F=96width=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E8=B7=9F=E5=B8=B8=E9=87=8F143=E5=8E=BB?= =?UTF-8?q?=E6=AF=94=E8=BE=83=EF=BC=8C=E5=A6=82=E6=9E=9C=E8=B6=85=E8=BF=87?= =?UTF-8?q?=E4=BA=86143=EF=BC=8C=E5=B0=B1=E5=B0=86=E5=85=B6=E4=B8=AD?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=87=8F=E7=9F=AD=E5=87=A0=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=EF=BC=8C=E5=8A=A0=E4=B8=8A"..."=EF=BC=8C=E7=84=B6?= =?UTF-8?q?=E5=90=8E=E5=BE=AA=E7=8E=AF=E6=8E=A5=E7=9D=80=E6=AF=94=E8=BE=83?= =?UTF-8?q?=E3=80=82=E6=AD=A4=E6=97=B6UILabel=E8=BF=98=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=A2=AB=E6=B7=BB=E5=8A=A0=E5=88=B0panel=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=BD=93=E8=8E=B7=E5=8F=96=E5=88=B0=E7=9A=84width=E6=AF=94?= =?UTF-8?q?=E8=BE=83=E8=B4=B4=E8=BF=91143=E6=97=B6=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B9=8B=E5=90=8E=E7=94=B1=E4=BA=8E=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=8F=98=E5=8C=96=E5=AF=BC=E8=87=B4=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E8=B6=85=E5=87=BA143=EF=BC=8C=E8=A1=A8=E7=8E=B0=E4=B8=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E5=B0=86143=E7=BC=A9=E5=B0=8F=E4=B8=BA130?= =?UTF-8?q?=EF=BC=8C=E5=B7=AE=E4=B8=8D=E5=A4=9A=E6=98=AF=E7=BC=A9=E5=B0=8F?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=B8=AA=E6=B1=89=E5=AD=97=E6=88=96=E8=80=85?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=AD=97=E6=AF=8D=E5=9C=A8UILabel=E4=B8=AD?= =?UTF-8?q?=E5=8D=A0=E7=9A=84=E5=AE=BD=E5=BA=A6=EF=BC=8C=E6=9B=B4=E5=AE=B9?= =?UTF-8?q?=E6=98=93=E8=A7=A6=E5=8F=91=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BB=A5=E5=87=8F=E7=9F=AD=E5=AD=97=E7=AC=A6=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0"..."=EF=BC=8C=E8=BF=99=E6=A0=B7UILabel?= =?UTF-8?q?=E8=A2=AB=E6=B7=BB=E5=8A=A0=E5=88=B0panel=E4=B8=AD=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E5=AD=98=E5=9C=A8=E7=BB=86=E5=BE=AE=E5=8F=98=E5=8C=96?= =?UTF-8?q?=E4=B9=9F=E4=B8=8D=E4=BC=9A=E8=B6=85=E8=BF=87=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E7=9A=84143=EF=BC=8C=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=8F=AF=E4=BB=A5=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/MultiTDTableDataPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java index 571e13d447..4a153bfaac 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java @@ -41,7 +41,7 @@ import java.util.Map.Entry; public class MultiTDTableDataPane extends AbstractTableDataPane { - private static final int MAX_LENTH_OF_DATASET = 143; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...” + private static final int MAX_LENTH_OF_DATASET = 130; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...” private static final int MIN_BAR_NUMBER = 10; private static final int SUB_LENGTH = 4; private JPanel centerPanel; From 3520a202a8a8791b55a7c4716efd8d8772eac813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 28 Dec 2020 15:15:21 +0800 Subject: [PATCH 040/104] CHART-17573 && CHART-17567 && CHART-17434 bugfix --- .../com/fr/design/chart/ChartSwingUtils.java | 2 +- .../van/chart/map/VanChartMapSeriesPane.java | 18 ++++++++++---- .../style/label/VanChartMapLabelPane.java | 24 ++++++++----------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartSwingUtils.java b/designer-chart/src/main/java/com/fr/design/chart/ChartSwingUtils.java index b5b0576913..41e1753f7b 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartSwingUtils.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartSwingUtils.java @@ -31,7 +31,7 @@ public class ChartSwingUtils { }); textField.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { - if(box.isSelected()) { + if(box.isSelected() && !e.isControlDown()) { e.consume(); showFormulaPane(textField, null); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java index 29111b4b58..8f5a3d1783 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java @@ -17,6 +17,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralUtils; import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.base.AttrBorderWithAlpha; import com.fr.plugin.chart.base.AttrEffect; @@ -30,6 +31,7 @@ import com.fr.plugin.chart.map.line.condition.AttrCurve; import com.fr.plugin.chart.map.line.condition.AttrLineEffect; import com.fr.plugin.chart.type.MapMarkerType; import com.fr.plugin.chart.type.MapType; +import com.fr.stable.StringUtils; import com.fr.van.chart.bubble.component.VanChartBubblePane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.border.VanChartBorderWithAlphaPane; @@ -173,22 +175,29 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } private void checkPointCompsEnabledWithLarge(Plot plot) { - boolean largeModel = largeModel(plot); - if (pointEffectPane != null) { - GUICoreUtils.setEnabled(pointEffectPane, !largeModel); - } + checkPointEffectPane(plot); if (markerTypeCom == null) { return; } VanChartMapPlot mapPlot = (VanChartMapPlot) plot; + boolean largeModel = largeModel(plot); refreshMarkerComboboxModel(mapPlot); if (largeModel) { checkLargeModelPlotSelectedItem(mapPlot); } } + private void checkPointEffectPane(Plot plot) { + if (pointEffectPane != null) { + boolean largeModel = largeModel(plot); + boolean imageMark = markerTypeCom == null ? false : + StringUtils.equals(MapMarkerType.IMAGE.toLocalString(), GeneralUtils.objectToString(markerTypeCom.getSelectedItem())); + GUICoreUtils.setEnabled(pointEffectPane, !largeModel && !imageMark); + } + } + private void checkLineCompsEnabledWithLarge(Plot plot) { if (lineMapEffectPane != null) { //大数据模式 恢复用注释。下面1行删除。 @@ -483,6 +492,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { @Override public void itemStateChanged(ItemEvent e) { markerTypeLayout.show(markerContentPane, (String) markerTypeCom.getSelectedItem()); + checkPointEffectPane(plot); } }); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java index 6d22d97001..80dc9ef0b1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java @@ -39,18 +39,14 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { if (mapPlot == null) { return contentPane; } - switch (mapPlot.getAllLayersMapType()){ + switch (mapPlot.getAllLayersMapType()) { case POINT: pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); contentPane.add(pointLabelPane, BorderLayout.NORTH); break; case CUSTOM: - areaLabelPane = createAreaMapPlotLabelPane(); - pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); - contentPane.add(new VanMapAreaAndPointGroupPane(areaLabelPane, pointLabelPane), BorderLayout.NORTH); - break; case DRILL_CUSTOM: - areaLabelPane = new VanChartPlotLabelPane(mapPlot, parent); + areaLabelPane = createAreaMapPlotLabelPane(); pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); contentPane.add(new VanMapAreaAndPointGroupPane(areaLabelPane, pointLabelPane), BorderLayout.NORTH); break; @@ -64,7 +60,7 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { } private VanChartPlotLabelPane createAreaMapPlotLabelPane() { - return new VanChartPlotLabelPane(mapPlot, parent){ + return new VanChartPlotLabelPane(mapPlot, parent) { @Override protected boolean checkEnabled4Large() { return false; @@ -75,7 +71,7 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { @Override public void populateBean(Chart chart) { Plot plot = chart.getPlot(); - if(plot instanceof VanChartMapPlot){ + if (plot instanceof VanChartMapPlot) { mapPlot = (VanChartMapPlot) plot; } @@ -85,11 +81,11 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { parent.initAllListeners(); } - AttrMapLabel attrMapLabel = (AttrMapLabel)plot.getConditionCollection().getDefaultAttr().getExisted(AttrMapLabel.class); - if(attrMapLabel == null){ + AttrMapLabel attrMapLabel = (AttrMapLabel) plot.getConditionCollection().getDefaultAttr().getExisted(AttrMapLabel.class); + if (attrMapLabel == null) { attrMapLabel = new AttrMapLabel(); } - if(pointLabelPane != null){ + if (pointLabelPane != null) { pointLabelPane.populate(attrMapLabel.getPointLabel()); } if (areaLabelPane != null) { @@ -103,17 +99,17 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { return; } ConditionAttr defaultAttr = chart.getPlot().getConditionCollection().getDefaultAttr(); - AttrMapLabel attrMapLabel = (AttrMapLabel)defaultAttr.getExisted(AttrMapLabel.class); + AttrMapLabel attrMapLabel = (AttrMapLabel) defaultAttr.getExisted(AttrMapLabel.class); if (attrMapLabel != null) { defaultAttr.remove(attrMapLabel); } else { attrMapLabel = new AttrMapLabel(); } - if(areaLabelPane != null){ + if (areaLabelPane != null) { attrMapLabel.setAreaLabel(areaLabelPane.update()); } - if(pointLabelPane != null){ + if (pointLabelPane != null) { attrMapLabel.setPointLabel(pointLabelPane.update()); } From bf63fbf211ca9054e06f5acb2257609951e5929a Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 28 Dec 2020 15:22:53 +0800 Subject: [PATCH 041/104] =?UTF-8?q?REPORT-45880=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=81=A2=E5=A4=8D=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=90=8E=E6=96=87=E6=9C=AC=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/selection/CellSelection.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index 4c90be3c5a..30d7e20783 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -573,6 +573,11 @@ public class CellSelection extends Selection { for (int i = 0; i < removeElementList.size(); i++) { CellElement element = removeElementList.get(i); element.setValue(null); + CellGUIAttr cellGUIAttr = element.getCellGUIAttr(); + cellGUIAttr.setShowAsDefault(true); + cellGUIAttr.setShowAsHTML(false); + cellGUIAttr.setShowAsDownload(false); + cellGUIAttr.setShowAsImage(false); } break; From b7051b4470167277a4907a362b876e36059b59ec Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 28 Dec 2020 16:10:31 +0800 Subject: [PATCH 042/104] =?UTF-8?q?REPORT-45880=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=81=A2=E5=A4=8D=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=90=8E=E6=96=87=E6=9C=AC=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/grid/selection/CellSelection.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index 30d7e20783..da8788bb93 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -573,11 +573,7 @@ public class CellSelection extends Selection { for (int i = 0; i < removeElementList.size(); i++) { CellElement element = removeElementList.get(i); element.setValue(null); - CellGUIAttr cellGUIAttr = element.getCellGUIAttr(); - cellGUIAttr.setShowAsDefault(true); - cellGUIAttr.setShowAsHTML(false); - cellGUIAttr.setShowAsDownload(false); - cellGUIAttr.setShowAsImage(false); + setDefault(element); } break; @@ -593,6 +589,15 @@ public class CellSelection extends Selection { return true; } + //设置显示内容为default + private void setDefault(CellElement element) { + CellGUIAttr cellGUIAttr = element.getCellGUIAttr(); + cellGUIAttr.setShowAsDefault(true); + cellGUIAttr.setShowAsHTML(false); + cellGUIAttr.setShowAsDownload(false); + cellGUIAttr.setShowAsImage(false); + } + @Override public int[] getSelectedColumns() { From 9175e0258dd7e4a5f1e587dedd4e63f4212dbb61 Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 28 Dec 2020 17:38:12 +0800 Subject: [PATCH 043/104] =?UTF-8?q?REPORT-45880=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=81=A2=E5=A4=8D=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=90=8E=E6=96=87=E6=9C=AC=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/grid/selection/CellSelection.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index da8788bb93..7f5d86ef1f 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -592,10 +592,12 @@ public class CellSelection extends Selection { //设置显示内容为default private void setDefault(CellElement element) { CellGUIAttr cellGUIAttr = element.getCellGUIAttr(); - cellGUIAttr.setShowAsDefault(true); - cellGUIAttr.setShowAsHTML(false); - cellGUIAttr.setShowAsDownload(false); - cellGUIAttr.setShowAsImage(false); + if (cellGUIAttr != null) { + cellGUIAttr.setShowAsDefault(true); + cellGUIAttr.setShowAsHTML(false); + cellGUIAttr.setShowAsDownload(false); + cellGUIAttr.setShowAsImage(false); + } } From 1bfb44b088ef206f140a2cfcc053cceabc156dad Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 29 Dec 2020 09:25:37 +0800 Subject: [PATCH 044/104] =?UTF-8?q?KERNEL-6380=20=E5=9C=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=8F=92=E4=BB=B6=E5=88=87=E6=8D=A2=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E9=9C=80=E8=A6=81=E6=9C=89=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E5=88=B7=E6=96=B0=E7=BC=93=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/base/ClassHelper.java | 174 ++++++++++++++++++ .../com/fr/design/PluginRefreshManager.java | 51 +++-- .../data/datapane/TableDataTreePane.java | 2 + .../design/file/HistoryTemplateListCache.java | 97 +++++----- .../com/fr/design/mainframe/JTemplate.java | 2 - .../java/com/fr/base/ClassHelperTest.java | 28 +++ 6 files changed, 300 insertions(+), 54 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/base/ClassHelper.java create mode 100644 designer-base/src/test/java/com/fr/base/ClassHelperTest.java diff --git a/designer-base/src/main/java/com/fr/base/ClassHelper.java b/designer-base/src/main/java/com/fr/base/ClassHelper.java new file mode 100644 index 0000000000..00ff7f9eb4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/ClassHelper.java @@ -0,0 +1,174 @@ +package com.fr.base; + +import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import org.jetbrains.annotations.Nullable; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/28 + */ +public class ClassHelper { + + private static final Set primClasses = new HashSet<>(); + + private static final Set classLoaders = new HashSet<>(); + + private static final Map map = new HashMap<>(); + + private static final Set data = new HashSet<>(); + + private static final String PLUGIN_CLASS_CLASSLOADER= "com.fr.plugin.engine.core.PluginClassLoader"; + + static { + primClasses.add("boolean"); + primClasses.add("byte"); + primClasses.add("char"); + primClasses.add("short"); + primClasses.add("int"); + primClasses.add("long"); + primClasses.add("float"); + primClasses.add("double"); + primClasses.add("void"); + primClasses.add("java.lang.Boolean"); + primClasses.add("java.lang.Byte"); + primClasses.add("java.lang.Character"); + primClasses.add("java.lang.Short"); + primClasses.add("java.lang.Integer"); + primClasses.add("java.lang.Long"); + primClasses.add("java.lang.FLOAT"); + primClasses.add("java.lang.DOUBLE"); + primClasses.add("java.lang.Void"); + primClasses.add("java.lang.String"); + primClasses.add("java.awt.image.BufferedImage"); + } + + + /** + * 获取当前对象字段中由插件加载出类的classloader + * + * @param o + * @return + */ + @Nullable + public static Set getPluginClassLoaders(Object o) { + try { + collectClassloader(o); + Set result = new HashSet<>(classLoaders); + data.clear(); + classLoaders.clear(); + map.clear(); + return result; + } catch (Throwable e) { + FineLoggerFactory.getLogger().warn(e.getMessage(), e); + data.clear(); + classLoaders.clear(); + map.clear(); + return null; + } + } + + private static void collectClassloader(Object o) { + if (o == null) { + return; + } + Field[] fields; + Class aclass = o.getClass(); + + String className = aclass.getName(); + + if (map.containsKey(className)) { + fields = map.get(className); + } else { + fields = fields(aclass, o); + map.put(className, fields); + } + + if (aclass.isArray()) { + for (int i = 0, len = Array.getLength(o); i < len; i++) { + Object arrayOb = Array.get(o, i); + if (arrayOb != null) { + Class arrayObClass = arrayOb.getClass(); + String name = arrayObClass.getName(); + if (primClasses.contains(name)) { + return; + } + data.add(arrayOb); + ClassLoader loader = arrayObClass.getClassLoader(); + if (loader != null && ComparatorUtils.equals(loader.getClass().getName(), PLUGIN_CLASS_CLASSLOADER)) { + classLoaders.add(loader); + } + } else { + continue; + } + collectClassloader(arrayOb); + } + } + + if (fields.length == 0) { + return; + } + + for (Field field : fields) { + if (!field.isAccessible()) { + field.setAccessible(true); + } + Object ob = null; + try { + ob = field.get(o); + + if (ob == null) { + continue; + } + Class clazz = ob.getClass(); + String name = clazz.getName(); + + if (primClasses.contains(name)) { + continue; + } + + if (!data.contains(ob)) { + data.add(ob); + ClassLoader loader = clazz.getClassLoader(); + if (loader != null && ComparatorUtils.equals(loader.getClass().getName(), PLUGIN_CLASS_CLASSLOADER)) { + classLoaders.add(loader); + } + collectClassloader(ob); + } + + } catch (Throwable e) { + FineLoggerFactory.getLogger().warn(e.getMessage(), e); + } + } + } + + + + private static Field[] fields(Class clazz, Object o) { + + Class t = clazz; + Set result = new HashSet<>(); + + do { + for (Field field : t.getDeclaredFields()) { + if (clazz != o ^ Modifier.isStatic(field.getModifiers())) { + result.add(field); + } + } + + t = t.getSuperclass(); + } + while (t != null); + + return result.toArray(new Field[0]); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java b/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java index 67442bb06a..6ccf1f1906 100644 --- a/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java +++ b/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java @@ -1,14 +1,13 @@ package com.fr.design; +import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fun.HyperlinkProvider; import com.fr.design.fun.TableDataDefineProvider; -import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventType; import com.fr.plugin.observer.PluginListenerRegistration; -import com.fr.stable.fun.IOFileAttrMark; import java.util.HashSet; import java.util.Set; @@ -28,18 +27,33 @@ public class PluginRefreshManager { private final PluginEventListener pluginAfterRunEventListener = new PluginEventListener() { @Override public void on(PluginEvent event) { + boolean mustReload = false; + // 兼容之前版本特性 + for (String tag : context) { + if (event.getContext().contain(tag)) { + mustReload = true; + break; + } + } // 重新载入模板xml内容 到 Workbook/Form对象中 - HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); + HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(mustReload); } }; - private final PluginFilter pluginFilter = pluginContext -> { - for (String xmlTag : context) { - if (pluginContext.contain(xmlTag)) { - return true; + private final PluginEventListener pluginBeforeStopEventListener = new PluginEventListener() { + @Override + public void on(PluginEvent event) { + boolean canCal = true; + for (String tag : context) { + if (event.getContext().contain(tag)) { + canCal = false; + break; + } + } + if (canCal) { + HistoryTemplateListCache.getInstance().calNeedReloadTemplate(event.getContext()); } } - return false; }; @@ -48,13 +62,26 @@ public class PluginRefreshManager { } public void load() { - context.add(IOFileAttrMark.MARK_STRING); context.add(TableDataDefineProvider.XML_TAG); context.add(HyperlinkProvider.XML_TAG); } private PluginRefreshManager() { - PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener, this.pluginFilter); + PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, new PluginEventListener() { + @Override + public void on(PluginEvent event) { + removePluginListener(); + } + }); + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, new PluginEventListener() { + @Override + public void on(PluginEvent event) { + addPluginListener(); + if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { + HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(true); + } + } + }); } public void registerItem(String xmlTag) { @@ -63,11 +90,13 @@ public class PluginRefreshManager { public void removePluginListener() { PluginListenerRegistration.getInstance().stopListen(this.pluginAfterRunEventListener); + PluginListenerRegistration.getInstance().stopListen(this.pluginBeforeStopEventListener); } public void addPluginListener() { - PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener, this.pluginFilter); + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener); + PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeStop, this.pluginBeforeStopEventListener); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index f1a3cf336c..ca587c3dab 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -94,6 +94,8 @@ public class TableDataTreePane extends BasicTableDataTreePane { addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH); createAddMenuDef(); + // 创建插件监听 + createPluginListener(); editAction = new EditAction(); removeAction = new RemoveAction(); diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 05b2a24f67..242d1d5c1f 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -1,5 +1,6 @@ package com.fr.design.file; +import com.fr.base.ClassHelper; import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.io.BaseBook; import com.fr.design.DesignerEnvManager; @@ -18,6 +19,8 @@ import com.fr.file.FileNodeFILE; import com.fr.file.StashedFILE; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.manage.PluginManager; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FilenameUtils; @@ -29,6 +32,7 @@ import java.util.HashMap; import java.util.List; import java.util.ListIterator; import java.util.Map; +import java.util.Set; /** * 历史模板缓存 @@ -42,6 +46,8 @@ public class HistoryTemplateListCache implements CallbackEvent { private List> historyList; private JTemplate editingTemplate; + private Map templateNeedReloadMap = new HashMap<>(); + public static HistoryTemplateListCache getInstance() { return Holder.INSTANCE; } @@ -72,6 +78,9 @@ public class HistoryTemplateListCache implements CallbackEvent { selected.fireJTemplateClosed(); selected.stopEditing(); try { + if (!templateNeedReloadMap.isEmpty()) { + templateNeedReloadMap.remove(selected.getEditingFILE().getName()); + } historyList.remove(contains(selected)); selected.getEditingFILE().closeTemplate(); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Closed_Warn_Text", selected.getEditingFILE().getName())); @@ -370,7 +379,6 @@ public class HistoryTemplateListCache implements CallbackEvent { */ public void load() { FineLoggerFactory.getLogger().info("Env Change Template Loading..."); - JTemplate currentTemplate = null; if (stashFILEMap != null && stashFILEMap.size() != 0) { int size = historyList.size(); for (int i = 0; i < size; i++) { @@ -381,32 +389,14 @@ public class HistoryTemplateListCache implements CallbackEvent { if (stashedFile == null) { continue; } - JTemplate template = JTemplateFactory.createJTemplate(stashedFile); - if (template != null) { - historyList.set(i, template); - // 替换当前正在编辑的模板,使用添加并激活的方式,以便使用统一的入口来处理监听事件 - if (isCurrentEditingFile(template.getPath())) { - currentTemplate = template; - } - } else { - // 当模板为空时 说明是一个新建的未保存模板 但是内存中保存了该模板 可以从中获取 - JTemplate jt = historyList.get(i); - // 另外如果该模板是正在编辑的模板,需要要激活 - if (jt != null && isCurrentEditingFile(jt.getPath())) { - currentTemplate = jt; - } - } + FineLoggerFactory.getLogger().info("{} is being reloaded", stashedFile.getName()); + JTemplate template = historyList.get(i); + template.refreshResource(stashedFile); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - // 最后加载当前正在编辑的模板 以保证数据集刷新正常 - if (currentTemplate != null) { - loadCurrentTemplate(currentTemplate); - } stashFILEMap.clear(); - MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); - MutilTempalteTabPane.getInstance().repaint(); } FineLoggerFactory.getLogger().info("Env Change Template Loaded."); } @@ -422,11 +412,7 @@ public class HistoryTemplateListCache implements CallbackEvent { */ @Deprecated public void reloadCurrentTemplate() { - JTemplate jt = getCurrentEditingTemplate(); - boolean access = jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); - if (access) { - jt.refreshResource(); - } + reloadAllEditingTemplate(true); } /** @@ -444,27 +430,56 @@ public class HistoryTemplateListCache implements CallbackEvent { /** * 插件安装后/启用 重新加载模板资源 */ - public void reloadAllEditingTemplate() { - FineLoggerFactory.getLogger().info("Plugin env Change reload all template started"); + public void reloadAllEditingTemplate(boolean mustReload) { + FineLoggerFactory.getLogger().info("Plugin env change reload all template started"); + long start = System.currentTimeMillis(); int size = historyList.size(); for (int i = 0; i < size; i++) { JTemplate template = historyList.get(i); FILE file = template.getEditingFILE(); - try { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - BaseBook target = template.getTarget(); - if (target != null) { - FineLoggerFactory.getLogger().info("{} is being reloaded", template.getName()); - target.export(outputStream); - FILE stashedFile = new StashedFILE(file, outputStream.toByteArray()); - template.refreshResource(stashedFile); + Boolean value = templateNeedReloadMap.get(file.getName()); + boolean needReload = mustReload || (value != null && value); + if (needReload) { + try { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + BaseBook target = template.getTarget(); + if (target != null) { + FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); + target.export(outputStream); + FILE stashedFile = new StashedFILE(file, outputStream.toByteArray()); + template.refreshResource(stashedFile); + } + // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } - // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - FineLoggerFactory.getLogger().info("Plugin env Change reload all template ended"); + templateNeedReloadMap.clear(); + FineLoggerFactory.getLogger().info("Plugin env change reload all template ended"); + FineLoggerFactory.getLogger().debug("Reload all template spend: {} ms", (System.currentTimeMillis() - start)); + } + + public void calNeedReloadTemplate(PluginContext context) { + for (JTemplate template : historyList) { + BaseBook baseBook = template.getTarget(); + if (baseBook != null) { + String name = template.getEditingFILE().getName(); + long start = System.currentTimeMillis(); + Set set = ClassHelper.getPluginClassLoaders(baseBook); + FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); + if (set != null) { + for (ClassLoader classLoader : set) { + PluginContext pluginContext = PluginManager.getContext(classLoader); + if (pluginContext != null && ComparatorUtils.equals(context.getName(), pluginContext.getName())) { + templateNeedReloadMap.put(name, true); + } + } + } else { + templateNeedReloadMap.put(name, true); + } + } + } } } 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 87bcd23f5e..d80d9f07ad 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 @@ -344,12 +344,10 @@ public abstract class JTemplate> this.template = JTemplateFactory.asIOFile(file); setTarget(this.template); - UIUtil.invokeLaterIfNeeded(() -> { // 先移除旧的。 removeCenterPane(); // 加入新的 addCenterPane(); - }); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } diff --git a/designer-base/src/test/java/com/fr/base/ClassHelperTest.java b/designer-base/src/test/java/com/fr/base/ClassHelperTest.java new file mode 100644 index 0000000000..ae0facfcf9 --- /dev/null +++ b/designer-base/src/test/java/com/fr/base/ClassHelperTest.java @@ -0,0 +1,28 @@ +package com.fr.base; + +import com.fr.form.main.Form; +import com.fr.main.impl.WorkBook; +import java.util.Set; +import junit.framework.TestCase; +import org.junit.Assert; + + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/28 + */ +public class ClassHelperTest extends TestCase { + + + public void testGetPluginClassLoaders() { + WorkBook workBook = new WorkBook(); + Set set = ClassHelper.getPluginClassLoaders(workBook); + Assert.assertEquals(0, set.size()); + Form form = new Form(); + Set set1 = ClassHelper.getPluginClassLoaders(form); + Assert.assertEquals(0, set1.size()); + + } + +} \ No newline at end of file From 6871224633f0ae45ea61d3878969e08fb38beade Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 29 Dec 2020 09:29:50 +0800 Subject: [PATCH 045/104] =?UTF-8?q?KERNEL-6380=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 d80d9f07ad..f540cdbc64 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 @@ -344,10 +344,10 @@ public abstract class JTemplate> this.template = JTemplateFactory.asIOFile(file); setTarget(this.template); - // 先移除旧的。 - removeCenterPane(); - // 加入新的 - addCenterPane(); + // 先移除旧的。 + removeCenterPane(); + // 加入新的 + addCenterPane(); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } From 9a157b8281b115fffb87cc41a067a8b54382ee8a Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 29 Dec 2020 13:04:45 +0800 Subject: [PATCH 046/104] =?UTF-8?q?KERNEL-6380=20=E5=9C=A8=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=8F=92=E4=BB=B6=E5=88=87=E6=8D=A2=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E9=9C=80=E8=A6=81=E6=9C=89=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E5=88=B7=E6=96=B0=E7=BC=93=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/base/ClassHelper.java | 174 ------------------ .../design/file/HistoryTemplateListCache.java | 6 +- .../java/com/fr/base/ClassHelperTest.java | 11 +- 3 files changed, 9 insertions(+), 182 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/base/ClassHelper.java diff --git a/designer-base/src/main/java/com/fr/base/ClassHelper.java b/designer-base/src/main/java/com/fr/base/ClassHelper.java deleted file mode 100644 index 00ff7f9eb4..0000000000 --- a/designer-base/src/main/java/com/fr/base/ClassHelper.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.fr.base; - -import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import org.jetbrains.annotations.Nullable; - -/** - * @author hades - * @version 10.0 - * Created by hades on 2020/12/28 - */ -public class ClassHelper { - - private static final Set primClasses = new HashSet<>(); - - private static final Set classLoaders = new HashSet<>(); - - private static final Map map = new HashMap<>(); - - private static final Set data = new HashSet<>(); - - private static final String PLUGIN_CLASS_CLASSLOADER= "com.fr.plugin.engine.core.PluginClassLoader"; - - static { - primClasses.add("boolean"); - primClasses.add("byte"); - primClasses.add("char"); - primClasses.add("short"); - primClasses.add("int"); - primClasses.add("long"); - primClasses.add("float"); - primClasses.add("double"); - primClasses.add("void"); - primClasses.add("java.lang.Boolean"); - primClasses.add("java.lang.Byte"); - primClasses.add("java.lang.Character"); - primClasses.add("java.lang.Short"); - primClasses.add("java.lang.Integer"); - primClasses.add("java.lang.Long"); - primClasses.add("java.lang.FLOAT"); - primClasses.add("java.lang.DOUBLE"); - primClasses.add("java.lang.Void"); - primClasses.add("java.lang.String"); - primClasses.add("java.awt.image.BufferedImage"); - } - - - /** - * 获取当前对象字段中由插件加载出类的classloader - * - * @param o - * @return - */ - @Nullable - public static Set getPluginClassLoaders(Object o) { - try { - collectClassloader(o); - Set result = new HashSet<>(classLoaders); - data.clear(); - classLoaders.clear(); - map.clear(); - return result; - } catch (Throwable e) { - FineLoggerFactory.getLogger().warn(e.getMessage(), e); - data.clear(); - classLoaders.clear(); - map.clear(); - return null; - } - } - - private static void collectClassloader(Object o) { - if (o == null) { - return; - } - Field[] fields; - Class aclass = o.getClass(); - - String className = aclass.getName(); - - if (map.containsKey(className)) { - fields = map.get(className); - } else { - fields = fields(aclass, o); - map.put(className, fields); - } - - if (aclass.isArray()) { - for (int i = 0, len = Array.getLength(o); i < len; i++) { - Object arrayOb = Array.get(o, i); - if (arrayOb != null) { - Class arrayObClass = arrayOb.getClass(); - String name = arrayObClass.getName(); - if (primClasses.contains(name)) { - return; - } - data.add(arrayOb); - ClassLoader loader = arrayObClass.getClassLoader(); - if (loader != null && ComparatorUtils.equals(loader.getClass().getName(), PLUGIN_CLASS_CLASSLOADER)) { - classLoaders.add(loader); - } - } else { - continue; - } - collectClassloader(arrayOb); - } - } - - if (fields.length == 0) { - return; - } - - for (Field field : fields) { - if (!field.isAccessible()) { - field.setAccessible(true); - } - Object ob = null; - try { - ob = field.get(o); - - if (ob == null) { - continue; - } - Class clazz = ob.getClass(); - String name = clazz.getName(); - - if (primClasses.contains(name)) { - continue; - } - - if (!data.contains(ob)) { - data.add(ob); - ClassLoader loader = clazz.getClassLoader(); - if (loader != null && ComparatorUtils.equals(loader.getClass().getName(), PLUGIN_CLASS_CLASSLOADER)) { - classLoaders.add(loader); - } - collectClassloader(ob); - } - - } catch (Throwable e) { - FineLoggerFactory.getLogger().warn(e.getMessage(), e); - } - } - } - - - - private static Field[] fields(Class clazz, Object o) { - - Class t = clazz; - Set result = new HashSet<>(); - - do { - for (Field field : t.getDeclaredFields()) { - if (clazz != o ^ Modifier.isStatic(field.getModifiers())) { - result.add(field); - } - } - - t = t.getSuperclass(); - } - while (t != null); - - return result.toArray(new Field[0]); - } - -} diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 242d1d5c1f..88f64a4d5d 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -1,6 +1,5 @@ package com.fr.design.file; -import com.fr.base.ClassHelper; import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.io.BaseBook; import com.fr.design.DesignerEnvManager; @@ -18,6 +17,7 @@ import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.file.StashedFILE; import com.fr.general.ComparatorUtils; +import com.fr.invoke.ClassHelper; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.manage.PluginManager; @@ -457,7 +457,7 @@ public class HistoryTemplateListCache implements CallbackEvent { } templateNeedReloadMap.clear(); FineLoggerFactory.getLogger().info("Plugin env change reload all template ended"); - FineLoggerFactory.getLogger().debug("Reload all template spend: {} ms", (System.currentTimeMillis() - start)); + FineLoggerFactory.getLogger().info("Reload all template spend: {} ms", (System.currentTimeMillis() - start)); } public void calNeedReloadTemplate(PluginContext context) { @@ -466,7 +466,7 @@ public class HistoryTemplateListCache implements CallbackEvent { if (baseBook != null) { String name = template.getEditingFILE().getName(); long start = System.currentTimeMillis(); - Set set = ClassHelper.getPluginClassLoaders(baseBook); + Set set = ClassHelper.getClassLoaders(baseBook); FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); if (set != null) { for (ClassLoader classLoader : set) { diff --git a/designer-base/src/test/java/com/fr/base/ClassHelperTest.java b/designer-base/src/test/java/com/fr/base/ClassHelperTest.java index ae0facfcf9..c77bb7b67c 100644 --- a/designer-base/src/test/java/com/fr/base/ClassHelperTest.java +++ b/designer-base/src/test/java/com/fr/base/ClassHelperTest.java @@ -1,6 +1,7 @@ package com.fr.base; import com.fr.form.main.Form; +import com.fr.invoke.ClassHelper; import com.fr.main.impl.WorkBook; import java.util.Set; import junit.framework.TestCase; @@ -15,13 +16,13 @@ import org.junit.Assert; public class ClassHelperTest extends TestCase { - public void testGetPluginClassLoaders() { + public void testGetClassLoaders() { WorkBook workBook = new WorkBook(); - Set set = ClassHelper.getPluginClassLoaders(workBook); - Assert.assertEquals(0, set.size()); + Set set = ClassHelper.getClassLoaders(workBook); + Assert.assertFalse(set.isEmpty()); Form form = new Form(); - Set set1 = ClassHelper.getPluginClassLoaders(form); - Assert.assertEquals(0, set1.size()); + Set set1 = ClassHelper.getClassLoaders(form); + Assert.assertFalse(set1.isEmpty()); } From 2f68f0db7c323a482b3a79a56dcb4780fa4f5b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 29 Dec 2020 13:54:48 +0800 Subject: [PATCH 047/104] =?UTF-8?q?CHART-17661=20=E5=A4=9A=E5=B1=82?= =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/PlotFactory.java | 19 +++++++++++++++---- .../label/VanChartGaugePlotLabelPane.java | 4 ++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index ab46f55262..0f9db09fab 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -166,6 +166,12 @@ public class PlotFactory { tooltipContentMap.put(VanChartStructurePlot.class, VanChartStructureTooltipContentPane.class); } + private static Map, Class> labelMap = new HashMap<>(); + + static { + labelMap.put(PiePlot4VanChart.class, VanChartPiePlotLabelPane.class); + labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class); + } /** * 监控刷新 自动数据点提示Map @@ -208,10 +214,15 @@ public class PlotFactory { } public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) { - if (plot instanceof VanChartGaugePlot) { - return new VanChartGaugePlotLabelPane(plot, stylePane); - } else if (plot instanceof PiePlot4VanChart) { - return new VanChartPiePlotLabelPane(plot, stylePane, inCondition); + Class key = plot.getClass(); + if (labelMap.containsKey(key)) { + try { + Class cl = labelMap.get(key); + Constructor constructor = cl.getConstructor(Plot.class, VanChartStylePane.class, boolean.class); + return constructor.newInstance(plot, stylePane, inCondition); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } } return new VanChartPlotLabelPane(plot, stylePane, inCondition); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java index 9bc21a0446..5861bb0c22 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java @@ -25,8 +25,8 @@ public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { private VanChartPlotLabelDetailPane gaugeValueLabelPane; - public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); + public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent, boolean inCondition) { + super(plot, parent, inCondition); } protected void createLabelPane() { From 0e29ea19399e1e8acfcce8332ff374a4f3897a65 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 29 Dec 2020 15:40:43 +0800 Subject: [PATCH 048/104] =?UTF-8?q?REPORT-44733=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E9=99=84=E4=BB=B6=E8=A1=A8=E5=8D=95=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E4=BC=9A=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XWAbsoluteLayout.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index da268b0e6c..b1a8a936b9 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -569,6 +569,33 @@ public class XWAbsoluteLayout extends XLayoutContainer { } } + /** + * 重新调整子组件宽度 + * @param width 宽度 + * @param actualSize 是否按照实际大小计算 + */ + public void recalculateChildWidth(int width, boolean actualSize){ + int componentCont = getComponentCount(); + for (int i = 0; i < componentCont; i++) { + XCreator creator = (XCreator) getComponent(i); + creator.recalculateChildWidth(width, actualSize); + } + } + + /** + * 重新调整子组件高度 + * @param height 高度 + * @param actualSize 是否按照实际大小计算 + */ + public void recalculateChildHeight(int height, boolean actualSize){ + int componentCont = getComponentCount(); + for (int i = 0; i < componentCont; i++) { + XCreator creator = (XCreator) getComponent(i); + creator.recalculateChildHeight(height, actualSize); + } + } + + /** * body大小手动调整的时候 * 按照比例调整组件的高度 From bb3689ec67f3703fdc370307c895b5cfe6505215 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 29 Dec 2020 15:55:33 +0800 Subject: [PATCH 049/104] override --- .../java/com/fr/design/designer/creator/XWAbsoluteLayout.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index b1a8a936b9..97c6b406a3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -574,6 +574,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { * @param width 宽度 * @param actualSize 是否按照实际大小计算 */ + @Override public void recalculateChildWidth(int width, boolean actualSize){ int componentCont = getComponentCount(); for (int i = 0; i < componentCont; i++) { @@ -587,6 +588,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { * @param height 高度 * @param actualSize 是否按照实际大小计算 */ + @Override public void recalculateChildHeight(int height, boolean actualSize){ int componentCont = getComponentCount(); for (int i = 0; i < componentCont; i++) { From 2cc7b374fb39998a9da303f6f87670181fc1fe20 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 29 Dec 2020 16:18:46 +0800 Subject: [PATCH 050/104] =?UTF-8?q?REPORT-42240=20=E3=80=9010.0.13?= =?UTF-8?q?=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8C=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=EF=BC=88=E8=A1=A8=E5=8D=95=E3=80=81=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=89=E4=BC=98=E5=8C=96=20=20feature->release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 36 +++++++++++-- .../mainframe/widget/BasicPropertyPane.java | 9 +++- .../com/fr/design/preview/FormPreview.java | 3 +- .../fit/menupane/ReportFitAttrAction.java | 5 +- .../widget/WidgetBoundsPaneFactory.java | 54 ++++++++++++++----- .../ui/FormBasicWidgetPropertyPane.java | 11 +++- .../component/WidgetAbsoluteBoundPane.java | 2 +- .../ui/BasicWidgetPropertySettingPane.java | 15 +++--- 8 files changed, 105 insertions(+), 30 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 0703216eba..4c908940a1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -18,6 +18,7 @@ import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.general.FRFont; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; import com.fr.plugin.injectable.PluginModule; @@ -100,14 +101,29 @@ public class EastRegionContainerPane extends UIEastResizableContainer { REPORT, // 报表 REPORT_PARA, // 报表参数面板 REPORT_FLOAT, // 报表悬浮元素 - FORM, // 表单 + FORM(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 表单 FORM_REPORT, // 表单报表块 POLY, // 聚合报表 POLY_REPORT, // 聚合报表-报表块 - POLY_CHART, // 聚合报表-图表块 + POLY_CHART(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 聚合报表-图表块 AUTHORITY_EDITION, // 权限编辑 - AUTHORITY_EDITION_DISABLED // 权限编辑 + AUTHORITY_EDITION_DISABLED; // 权限编辑 + + private String title; + + PropertyMode() { + this.title = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Settings"); + } + + PropertyMode(String title) { + this.title = title; + } + + public String getTitle() { + return this.title; + } } + private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板) @@ -400,6 +416,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private void updatePropertyItemMap() { for (PropertyItem item : propertyItemMap.values()) { item.updateStatus(); + item.updateTitle(); } } @@ -734,6 +751,19 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } } + public void updateTitle() { + try { + if (StringUtils.equals(KEY_WIDGET_SETTINGS, name)) { + title = currentMode.getTitle(); + button.setToolTipText(title); + UILabel uiLabel = (UILabel) ((BorderLayout) popupToolPane.contentPane.getLayout()).getLayoutComponent(BorderLayout.WEST); + uiLabel.setText(title); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage()); + } + } + public void reAddContentArea() { propertyPanel.add(contentArea, BorderLayout.CENTER); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java index 099684a81a..23cc188edb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java @@ -4,6 +4,7 @@ import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -56,20 +57,24 @@ public class BasicPropertyPane extends BasicPane { } } }; - widgetName.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic")); + widgetName.setGlobalName(Toolkit.i18nText("Fine-Design_Report_Basic")); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Name")), widgetName}, + new Component[]{new UILabel(obtainBasicName()), widgetName}, }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); this.add(panel, BorderLayout.NORTH); } + public String obtainBasicName(){ + return Toolkit.i18nText("Fine-Design_Basic_Component_Name"); + } + public UITextField getWidgetNameField() { return widgetName; } diff --git a/designer-base/src/main/java/com/fr/design/preview/FormPreview.java b/designer-base/src/main/java/com/fr/design/preview/FormPreview.java index 8522d67734..178779f518 100644 --- a/designer-base/src/main/java/com/fr/design/preview/FormPreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/FormPreview.java @@ -1,6 +1,7 @@ package com.fr.design.preview; import com.fr.design.fun.impl.AbstractPreviewProvider; +import com.fr.design.i18n.Toolkit; /** @@ -12,7 +13,7 @@ public class FormPreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Form_Preview"); + return Toolkit.i18nText("Fine-Design_Form_M_PC_Preview"); } @Override 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 c24125059c..06770c1b4b 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 @@ -4,6 +4,7 @@ import com.fr.design.actions.JTemplateAction; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.UIDialog; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; @@ -26,7 +27,7 @@ public class ReportFitAttrAction extends JTemplateAction { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Template"); + return Toolkit.i18nText("Fine-Designer_PC_Fit_Attr"); } @Override @@ -42,7 +43,7 @@ public class ReportFitAttrAction extends JTemplateAction { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Elementcase"); + return Toolkit.i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java b/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java index c4c840227c..9b6e7b5c83 100644 --- a/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java @@ -4,6 +4,7 @@ import com.fr.design.designer.IntervalConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -18,6 +19,30 @@ import java.awt.Component; * Created by plough on 2017/8/7. */ public class WidgetBoundsPaneFactory { + + public enum NameAttribute { + //默认的名称 + DEFAULT(Toolkit.i18nText("Fine-Design_Basic_Component_Position"), Toolkit.i18nText("Fine-Design_Basic_Component_Size")), + //控件对应的名称 + WIDGET(Toolkit.i18nText("Fine-Design_Basic_Widget_Position"), Toolkit.i18nText("Fine-Design_Basic_Widget_Size")); + + private String positionName; + private String sizeName; + + NameAttribute(String positionName, String sizeName) { + this.positionName = positionName; + this.sizeName = sizeName; + } + + public String getPositionName() { + return positionName; + } + + public String getSizeName() { + return sizeName; + } + } + private static final int RIGHT_PANE_WIDTH = 145; public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { @@ -25,8 +50,8 @@ public class WidgetBoundsPaneFactory { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Size")), createRightPane(width, height)}, - new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, + new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size")), createRightPane(width, height)}, + new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, }; double[] rowSize = {p, p}; double[] columnSize = {f, RIGHT_PANE_WIDTH}; @@ -34,9 +59,10 @@ public class WidgetBoundsPaneFactory { final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); boundsPane.add(panel); - return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); } - public static JPanel createRightPane(Component com1, Component com2){ + + public static JPanel createRightPane(Component com1, Component com2) { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p}; @@ -48,17 +74,17 @@ public class WidgetBoundsPaneFactory { return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L1); } - public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { + public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height, NameAttribute nameAttribute) { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] northComponents = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Position")), createRightPane(x, y)}, - new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER))}, + new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getPositionName()), createRightPane(x, y)}, + new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER))}, }; Component[][] centerComponents = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Size")), createRightPane(width, height)}, - new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, + new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()), createRightPane(width, height)}, + new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, }; double[] rowSize = {p, p}; double[] columnSize = {f, RIGHT_PANE_WIDTH}; @@ -70,7 +96,11 @@ public class WidgetBoundsPaneFactory { centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); boundsPane.add(northPanel, BorderLayout.NORTH); boundsPane.add(centerPanel, BorderLayout.CENTER); - return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 230, 24, boundsPane); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 230, 24, boundsPane); + } + + public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { + return createAbsoluteBoundsPane(x, y, width, height, NameAttribute.DEFAULT); } @@ -79,7 +109,7 @@ public class WidgetBoundsPaneFactory { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Size")), width}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size")), width}, }; double[] rowSize = {p}; double[] columnSize = {p, f}; @@ -87,6 +117,6 @@ public class WidgetBoundsPaneFactory { final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); boundsPane.add(panel); - return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java index 138434d306..27d55ac28c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java @@ -1,9 +1,12 @@ package com.fr.design.mainframe.widget.ui; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.form.ui.Widget; import javax.swing.BorderFactory; +import java.awt.Component; /** * Created by ibm on 2017/7/26. @@ -16,13 +19,17 @@ public class FormBasicWidgetPropertyPane extends BasicSetVisiblePropertyPane { } public UICheckBox createOtherConfig() { - enableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enabled"), true); - enableCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic")); + enableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Enabled"), true); + enableCheckBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_Basic")); enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); return enableCheckBox; } + public String obtainBasicName(){ + return Toolkit.i18nText("Fine-Design_Basic_Widget_Name"); + } + @Override public String title4PopupWindow() { return "basicProperty"; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index 7ddff022f9..5604ef4be7 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -34,7 +34,7 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { y.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); width.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); height.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); - this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height)); + this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, WidgetBoundsPaneFactory.NameAttribute.WIDGET)); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java index 8b520f3183..5bd91d038d 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java @@ -4,6 +4,7 @@ import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.dialog.BasicPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.NoneWidget; @@ -22,19 +23,19 @@ public class BasicWidgetPropertySettingPane extends BasicPane { private UICheckBox enableCheckBox; private UICheckBox visibleCheckBox; private Widget widget; - + public BasicWidgetPropertySettingPane() { this.setLayout(new BorderLayout()); - enableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Enabled"), true); + enableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Enabled"), true); enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); - visibleCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible"), true); + visibleCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Form_Widget_Visible"), true); visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); widgetNameComboBox = new ParameterTreeComboBox(); widgetNameComboBox.refreshTree(); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form-Widget_Name")), widgetNameComboBox}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Name")), widgetNameComboBox}, new Component[]{enableCheckBox, null}, new Component[]{visibleCheckBox, null}, }; @@ -47,12 +48,12 @@ public class BasicWidgetPropertySettingPane extends BasicPane { this.add(pane, BorderLayout.CENTER); } - + @Override protected String title4PopupWindow() { return "property"; } - + public void populate(Widget widget){ //:jackie if(widget instanceof NoneWidget){ @@ -67,7 +68,7 @@ public class BasicWidgetPropertySettingPane extends BasicPane { visibleCheckBox.setSelected(this.widget.isVisible()); } } - + public void update(Widget widget){ if(this.widget == null) return ; From 4c3e72d82d32bbd68b3aeb129776040cab3ac683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 29 Dec 2020 17:06:51 +0800 Subject: [PATCH 051/104] =?UTF-8?q?CHART-17357=20=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=9B=BE=E5=8F=AA=E6=9C=89=E4=B8=80=E4=B8=AA=E5=9B=BE=E5=BD=A2?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E7=95=99=E7=99=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/custom/VanChartCustomDataPane.java | 7 +++++++ .../VanChartCustomPlotDataContentsTabPane.java | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java index ec15e4cf98..47e6488fd6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java @@ -6,6 +6,7 @@ import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.plugin.chart.custom.VanChartCustomPlot; +import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -19,6 +20,12 @@ public class VanChartCustomDataPane extends ChartDataPane { super(listener); } + protected void initContentPane() { + leftContentPane = createContentPane(); + leftContentPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, original)); + this.add(leftContentPane, BorderLayout.CENTER); + } + @Override protected JPanel createContentPane() { JPanel content = new JPanel(new BorderLayout()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java index 6d7d24bf96..30d23c1873 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java @@ -12,11 +12,13 @@ import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.van.chart.custom.component.VanChartCustomPlotTabPane; import com.fr.van.chart.custom.component.VanChartDataPane; +import javax.swing.BorderFactory; import javax.swing.JPanel; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.awt.BorderLayout; /** * Created by Fangjie on 2016/4/29. @@ -37,6 +39,20 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab this.supportCellData = supportCellData; } + @Override + protected void initLayout() { + JPanel tabPanel = new JPanel(new BorderLayout()); + if (NameArray.length > 1) { + tabPanel.setBorder(BorderFactory.createMatteBorder(10, 0, 0, 0, getBackground())); + } else { + tabPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, getBackground())); + } + tabPanel.add(tabPane, BorderLayout.CENTER); + this.setLayout(new BorderLayout(0, 0)); + this.add(tabPanel, BorderLayout.NORTH); + this.add(centerPane, BorderLayout.CENTER); + } + @Override protected void initTabTitle() { From 2f039cdcd6666bf60798fe56d573c563061812a3 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Tue, 29 Dec 2020 17:24:25 +0800 Subject: [PATCH 052/104] =?UTF-8?q?REPORT-46102=20=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=94=B9=E8=BF=9B=EF=BC=8C=E6=B0=B4=E5=8D=B0=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E7=9B=B4=E6=8E=A5=E8=BE=93=E5=85=A5=E6=96=87?= =?UTF-8?q?=E5=AD=97=EF=BC=8C=E5=BF=85=E9=A1=BB=E5=9C=A8=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=BC=8F=E9=9D=A2=E6=9D=BF=E4=B8=8B=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/editor/FormulaEditor.java | 4 ++++ .../java/com/fr/design/report/WatermarkPane.java | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/FormulaEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/FormulaEditor.java index 77ac976bcf..b8dc5ad8fe 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/FormulaEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/FormulaEditor.java @@ -99,6 +99,10 @@ public class FormulaEditor extends Editor { return formula; } + public UITextField getUITextField() { + return currentTextField; + } + /** * Return the value of the CellEditor. */ diff --git a/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java b/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java index 07ec40bfee..588e4601d0 100644 --- a/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java +++ b/designer-base/src/main/java/com/fr/design/report/WatermarkPane.java @@ -1,14 +1,16 @@ package com.fr.design.report; +import com.fr.base.BaseFormula; import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.design.dialog.BasicPane; -import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.editor.editor.FormulaEditor; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UnsignedIntUISpinner; import com.fr.design.gui.style.FRFontPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -50,7 +52,7 @@ public class WatermarkPane extends BasicPane { // 水印预览面板 private WatermarkPreviewPane watermarkPreviewPane; // 文字 - private TinyFormulaPane formulaPane; + private FormulaEditor formulaPane; // 字号 private UIComboBox fontSizeComboBox; //横向间距 @@ -119,16 +121,16 @@ public class WatermarkPane extends BasicPane { return watermark; } - public TinyFormulaPane getFormulaPane() { + public FormulaEditor getFormulaPane() { return formulaPane; } - public void setFormulaPane(TinyFormulaPane formulaPane) { + public void setFormulaPane(FormulaEditor formulaPane) { this.formulaPane = formulaPane; } protected UIScrollPane initRightPane() { - formulaPane = new TinyFormulaPane(); + formulaPane = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula")); fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES); fontSizeComboBox.setEditable(true); horizontalGapSpinner = new UnsignedIntUISpinner(100, Integer.MAX_VALUE, 1, 200); @@ -228,7 +230,7 @@ public class WatermarkPane extends BasicPane { } private void populateFourmula(String formula) { - this.formulaPane.populateBean(formula); + this.formulaPane.setValue(BaseFormula.createFormulaBuilder().build(formula)); this.formulaPane.getUITextField().getDocument() .addDocumentListener(new DocumentListener() { @Override From 7d64006f2db9e1416848f524b7d5233e0ca947e5 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Fri, 4 Dec 2020 12:11:46 +0800 Subject: [PATCH 053/104] =?UTF-8?q?KERNEL-6154=20GeneralXMLTools=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/module/DesignerActivator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 3f1aa26636..495252e38f 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -99,6 +99,7 @@ import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.painter.BiasTextPainter; import com.fr.report.cell.painter.CellImagePainter; import com.fr.stable.ArrayUtils; +import com.fr.stable.EssentialUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.bridge.StableFactory; import com.fr.stable.os.support.OSBasedAction; @@ -191,8 +192,8 @@ public class DesignerActivator extends Activator { justStartModules4Designer(); CalculatorProviderContext.setValueConverter(valueConverter()); - GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); - GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); + EssentialUtils.Object_Tokenizer = startXMLReadObjectTokenizer(); + EssentialUtils.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); addAdapterForPlate(); designerRegister(); From 6442a43639cadc24dde7d7d1828fdf8472dae83e Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Dec 2020 15:44:29 +0800 Subject: [PATCH 054/104] =?UTF-8?q?KERNEL-6380=20=E8=A7=A3=E8=80=A6=20?= =?UTF-8?q?=E4=BB=85=E5=A4=84=E7=90=86=E6=8F=92=E4=BB=B6afterRun=E7=94=9F?= =?UTF-8?q?=E5=91=BD=E5=91=A8=E6=9C=9F=20+=20=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...er.java => PluginClassRefreshManager.java} | 38 +++---------- .../design/file/HistoryTemplateListCache.java | 57 ++++++++++--------- .../start/module/DesignerInitActivator.java | 4 +- 3 files changed, 38 insertions(+), 61 deletions(-) rename designer-base/src/main/java/com/fr/design/{PluginRefreshManager.java => PluginClassRefreshManager.java} (65%) diff --git a/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java similarity index 65% rename from designer-base/src/main/java/com/fr/design/PluginRefreshManager.java rename to designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java index 6ccf1f1906..22f791f4fd 100644 --- a/designer-base/src/main/java/com/fr/design/PluginRefreshManager.java +++ b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java @@ -17,47 +17,30 @@ import java.util.Set; * @version 10.0 * Created by hades on 2020/12/17 */ -public class PluginRefreshManager { +public class PluginClassRefreshManager { - private static final PluginRefreshManager INSTANCE = new PluginRefreshManager(); + private static final PluginClassRefreshManager INSTANCE = new PluginClassRefreshManager(); private final Set context = new HashSet<>(); private final PluginEventListener pluginAfterRunEventListener = new PluginEventListener() { @Override public void on(PluginEvent event) { - boolean mustReload = false; // 兼容之前版本特性 for (String tag : context) { if (event.getContext().contain(tag)) { - mustReload = true; + HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); break; } } // 重新载入模板xml内容 到 Workbook/Form对象中 - HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(mustReload); - } - }; - - private final PluginEventListener pluginBeforeStopEventListener = new PluginEventListener() { - @Override - public void on(PluginEvent event) { - boolean canCal = true; - for (String tag : context) { - if (event.getContext().contain(tag)) { - canCal = false; - break; - } - } - if (canCal) { - HistoryTemplateListCache.getInstance().calNeedReloadTemplate(event.getContext()); - } + HistoryTemplateListCache.getInstance().reloadAllEditingTemplateByPlugin(event.getContext()); } }; - public static PluginRefreshManager getInstance() { + public static PluginClassRefreshManager getInstance() { return INSTANCE; } @@ -66,7 +49,7 @@ public class PluginRefreshManager { context.add(HyperlinkProvider.XML_TAG); } - private PluginRefreshManager() { + private PluginClassRefreshManager() { PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, new PluginEventListener() { @Override public void on(PluginEvent event) { @@ -78,25 +61,18 @@ public class PluginRefreshManager { public void on(PluginEvent event) { addPluginListener(); if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { - HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(true); + HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); } } }); } - public void registerItem(String xmlTag) { - context.add(xmlTag); - } - public void removePluginListener() { PluginListenerRegistration.getInstance().stopListen(this.pluginAfterRunEventListener); - PluginListenerRegistration.getInstance().stopListen(this.pluginBeforeStopEventListener); - } public void addPluginListener() { PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener); - PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeStop, this.pluginBeforeStopEventListener); } } diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 88f64a4d5d..5184c7d0d5 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -46,8 +46,6 @@ public class HistoryTemplateListCache implements CallbackEvent { private List> historyList; private JTemplate editingTemplate; - private Map templateNeedReloadMap = new HashMap<>(); - public static HistoryTemplateListCache getInstance() { return Holder.INSTANCE; } @@ -78,9 +76,6 @@ public class HistoryTemplateListCache implements CallbackEvent { selected.fireJTemplateClosed(); selected.stopEditing(); try { - if (!templateNeedReloadMap.isEmpty()) { - templateNeedReloadMap.remove(selected.getEditingFILE().getName()); - } historyList.remove(contains(selected)); selected.getEditingFILE().closeTemplate(); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Closed_Warn_Text", selected.getEditingFILE().getName())); @@ -412,7 +407,7 @@ public class HistoryTemplateListCache implements CallbackEvent { */ @Deprecated public void reloadCurrentTemplate() { - reloadAllEditingTemplate(true); + reloadAllEditingTemplate(); } /** @@ -430,15 +425,14 @@ public class HistoryTemplateListCache implements CallbackEvent { /** * 插件安装后/启用 重新加载模板资源 */ - public void reloadAllEditingTemplate(boolean mustReload) { + private void _reloadAllEditingTemplate(PluginContext context) { FineLoggerFactory.getLogger().info("Plugin env change reload all template started"); long start = System.currentTimeMillis(); int size = historyList.size(); for (int i = 0; i < size; i++) { JTemplate template = historyList.get(i); FILE file = template.getEditingFILE(); - Boolean value = templateNeedReloadMap.get(file.getName()); - boolean needReload = mustReload || (value != null && value); + boolean needReload = context == null || needReloadTemplate(context, template); if (needReload) { try { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); @@ -455,31 +449,38 @@ public class HistoryTemplateListCache implements CallbackEvent { } } } - templateNeedReloadMap.clear(); FineLoggerFactory.getLogger().info("Plugin env change reload all template ended"); FineLoggerFactory.getLogger().info("Reload all template spend: {} ms", (System.currentTimeMillis() - start)); } - public void calNeedReloadTemplate(PluginContext context) { - for (JTemplate template : historyList) { - BaseBook baseBook = template.getTarget(); - if (baseBook != null) { - String name = template.getEditingFILE().getName(); - long start = System.currentTimeMillis(); - Set set = ClassHelper.getClassLoaders(baseBook); - FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); - if (set != null) { - for (ClassLoader classLoader : set) { - PluginContext pluginContext = PluginManager.getContext(classLoader); - if (pluginContext != null && ComparatorUtils.equals(context.getName(), pluginContext.getName())) { - templateNeedReloadMap.put(name, true); - } - } - } else { - templateNeedReloadMap.put(name, true); - } + + public void reloadAllEditingTemplateByPlugin(PluginContext context) { + _reloadAllEditingTemplate(context); + } + + public void reloadAllEditingTemplate() { + _reloadAllEditingTemplate(null); + } + + private boolean needReloadTemplate(PluginContext context, JTemplate template) { + BaseBook baseBook = template.getTarget(); + if (baseBook != null) { + String name = template.getEditingFILE().getName(); + String pluginId = context.getID(); + long start = System.currentTimeMillis(); + Set set = ClassHelper.getClassLoaders(baseBook); + FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); + if (set != null) { + for (ClassLoader classLoader : set) { + if (PluginManager.isBeforeLoadBy(classLoader, pluginId)) { + return true; + } + } + } else { + return true; } } + return false; } } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java index 5ca7efdd6b..ebea410bba 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java @@ -1,6 +1,6 @@ package com.fr.start.module; -import com.fr.design.PluginRefreshManager; +import com.fr.design.PluginClassRefreshManager; import com.fr.module.Activator; import com.fr.start.DesignerInitial; @@ -16,7 +16,7 @@ public class DesignerInitActivator extends Activator { @Override public void start() { - PluginRefreshManager.getInstance().load(); + PluginClassRefreshManager.getInstance().load(); DesignerInitial.init(findSingleton(StartupArgs.class).get()); } From 11046865fc26ec0b7c0ed3b490dc3965e997fb88 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Dec 2020 16:15:03 +0800 Subject: [PATCH 055/104] =?UTF-8?q?KERNEL-6380=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=8B=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/HistoryTemplateListCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 5184c7d0d5..afb056ba1c 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -472,7 +472,7 @@ public class HistoryTemplateListCache implements CallbackEvent { FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); if (set != null) { for (ClassLoader classLoader : set) { - if (PluginManager.isBeforeLoadBy(classLoader, pluginId)) { + if (ComparatorUtils.equals(pluginId, PluginManager.findPluginId(classLoader))) { return true; } } From 26e54fb4bf79070c457c28c81ba072bfa785e548 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Dec 2020 16:42:15 +0800 Subject: [PATCH 056/104] =?UTF-8?q?KERNEL-6380=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/HistoryTemplateListCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index afb056ba1c..1a14144175 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -472,7 +472,7 @@ public class HistoryTemplateListCache implements CallbackEvent { FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); if (set != null) { for (ClassLoader classLoader : set) { - if (ComparatorUtils.equals(pluginId, PluginManager.findPluginId(classLoader))) { + if (ComparatorUtils.equals(pluginId, PluginManager.detectLeakingPlugin(classLoader))) { return true; } } From c634b2fe1d1234ed3f778127f8571994e6c0c2ff Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Dec 2020 17:00:16 +0800 Subject: [PATCH 057/104] =?UTF-8?q?KERNEL-6380=20=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/HistoryTemplateListCache.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 1a14144175..06bfd3cf74 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -453,11 +453,17 @@ public class HistoryTemplateListCache implements CallbackEvent { FineLoggerFactory.getLogger().info("Reload all template spend: {} ms", (System.currentTimeMillis() - start)); } - + /** + * 根据具体插件来刷新模板 + * @param context + */ public void reloadAllEditingTemplateByPlugin(PluginContext context) { _reloadAllEditingTemplate(context); } + /** + * 直接刷新所以模板 + */ public void reloadAllEditingTemplate() { _reloadAllEditingTemplate(null); } @@ -477,6 +483,7 @@ public class HistoryTemplateListCache implements CallbackEvent { } } } else { + // set为null说明 检测classloader 这里返回true直接刷新 兜底行为 return true; } } From ea708f0f74e6d127379b405ebc4abaa3ce8057a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 30 Dec 2020 18:00:54 +0800 Subject: [PATCH 058/104] =?UTF-8?q?CHART-17633=20=E5=9C=B0=E5=9B=BEgis?= =?UTF-8?q?=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/map/designer/type/VanChartMapPlotPane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java index a5e26427b3..9b5636e402 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java @@ -2,9 +2,11 @@ package com.fr.van.chart.map.designer.type; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.chartx.data.MapChartDataDefinition; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.attr.plot.VanChartPlot; @@ -100,6 +102,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { if (!isSamePlot() || (typeChanged && isSamePlot())) { resetAttr(plot); } + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.MAP, chart.getBuryingPointMapConfig()); } } /** From 8e34fc7c12c1d4220e89794d62d6047913339281 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 31 Dec 2020 09:34:10 +0800 Subject: [PATCH 059/104] =?UTF-8?q?KERNEL-6380=20=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=8B=E8=BF=94=E5=9B=9E=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/PluginClassRefreshManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java index 22f791f4fd..711dd29759 100644 --- a/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java +++ b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java @@ -31,7 +31,7 @@ public class PluginClassRefreshManager { for (String tag : context) { if (event.getContext().contain(tag)) { HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); - break; + return; } } // 重新载入模板xml内容 到 Workbook/Form对象中 From 0d600b351a06f6dbc4d8e3ca9a9f8b4799abafff Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 31 Dec 2020 10:52:12 +0800 Subject: [PATCH 060/104] =?UTF-8?q?REPORT-45775=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E5=8F=AF=E4=BB=A5=E5=A4=8D=E5=88=B6=E5=88=B0=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF--?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E3=80=90=E5=AE=A2=E6=88=B7=E9=9C=80=E6=B1=82?= =?UTF-8?q?=20510651=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/beans/models/SelectionModel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index 0f673e30ae..f6c74986e0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -397,8 +397,10 @@ public class SelectionModel { boolean absoluteCanvas = selectionXCreator.getClass().equals(XWAbsoluteLayout.class); //选中的是否是相对布局编辑器本身 boolean relativeEditor = selectionXCreator.getClass().equals(XWFitLayout.class); + //选中的参数面板编辑器本身 + boolean parameterEditor = selectionXCreator.getClass().equals(XWParameterLayout.class); - return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor); + return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor || parameterEditor); } else { return false; } From a726e01b01d47c62a668f73141ab8a13053c00b2 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 31 Dec 2020 11:02:58 +0800 Subject: [PATCH 061/104] =?UTF-8?q?REPORT-46268=20frm=E4=B8=AD=E9=80=94?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=A8=A1=E6=9D=BF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E8=AF=86=E5=88=AB=E4=B8=8D=E5=88=B0=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=B8=AD=E7=9A=84=E5=8F=82=E6=95=B0=E6=98=AF?= =?UTF-8?q?=E4=BB=8EDesignModelAdapter=E4=B8=AD=E6=8B=BF=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E6=98=AFfrm=E8=A1=A8=E5=8D=95=E5=9C=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E6=A8=A1=E6=9D=BF=E5=8F=82=E6=95=B0=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E6=B2=A1=E6=9C=89=E9=80=9A=E7=9F=A5DesignModelAdapter?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8F=82=E6=95=B0=EF=BC=8C=E6=9C=80=E5=88=9D?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=8F=82=E6=95=B0p1=E8=83=BD?= =?UTF-8?q?=E6=8B=BF=E5=88=B0=E7=9A=84=E5=8E=9F=E5=9B=A0=E6=98=AF=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BA=86=E6=A8=A1=E6=9D=BF=E5=8F=82=E6=95=B0=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=9C=89=E4=B8=AA=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=9A=84=E6=93=8D=E4=BD=9C=EF=BC=8C=E8=80=8C=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=BA=86=E6=95=B0=E6=8D=AE=E9=9B=86=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E4=BC=9A=E6=9B=B4=E6=96=B0DesignModelAdapter=E4=B8=AD=E5=AD=98?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0=EF=BC=8C=E6=89=80=E4=BB=A5=E8=A1=A8?= =?UTF-8?q?=E7=8E=B0=E4=B8=BA=E5=8F=AA=E8=83=BD=E7=9C=8B=E5=88=B0p1=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=9C=A8?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=9A=84TemplateParameterAction=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=9F=A5DesignModelAdapter=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=8F=82=E6=95=B0=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/TemplateParameterAction.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java index bd747444e3..c32c059d44 100644 --- a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java @@ -2,7 +2,7 @@ package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.base.Parameter; -import com.fr.design.actions.JTemplateAction; +import com.fr.design.DesignModelAdapter; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.JForm; @@ -10,7 +10,7 @@ import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; import com.fr.form.main.Form; -import javax.swing.*; +import javax.swing.SwingUtilities; import java.awt.event.ActionEvent; /** @@ -51,6 +51,8 @@ public class TemplateParameterAction extends JTemplateAction { jwb.fireTargetModified(); jwb.getFormDesign().setParameterArray(parameters); jwb.getFormDesign().refreshParameter(); + DesignModelAdapter.getCurrentModelAdapter().fireTargetModified(); + DesignModelAdapter.getCurrentModelAdapter().parameterChanged(); } }); parameterArrayDialog.setVisible(true); From b3f7b37a935d7b9f6d16f1adfc298305caeda82c Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 31 Dec 2020 15:50:36 +0800 Subject: [PATCH 062/104] =?UTF-8?q?REPORT-46268=20frm=E4=B8=AD=E9=80=94?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=A8=A1=E6=9D=BF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E8=AF=86=E5=88=AB=E4=B8=8D=E5=88=B0=20=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E5=89=8D=E9=9D=A2=E7=9A=84jwb=E7=9A=84=E5=87=A0?= =?UTF-8?q?=E4=B8=AA=E6=9B=B4=E6=96=B0=E6=93=8D=E4=BD=9C=E5=85=B6=E5=AE=9E?= =?UTF-8?q?=E8=B7=9FDesignModelAdapter=E7=9A=84fireTargetModified()?= =?UTF-8?q?=E5=92=8CparameterChanged()=E9=87=8D=E5=A4=8D=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94parameterChanged()=E4=B8=AD=E6=AF=94=E4=B8=8A?= =?UTF-8?q?=E9=9D=A2=E7=9A=84jwb=E7=9A=84=E6=93=8D=E4=BD=9C=E8=BF=98?= =?UTF-8?q?=E5=A4=9A=E4=BA=86=E4=B8=AA=E6=9B=B4=E6=96=B0ParameterPropertyP?= =?UTF-8?q?ane=EF=BC=8Cdebug=E4=BA=86=E4=B8=8B=E5=8F=91=E7=8E=B0=E8=BF=99?= =?UTF-8?q?=E4=B9=9F=E6=98=AF=E4=B8=AA=E5=BF=85=E8=A6=81=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=8D=E9=9A=8F=E7=9D=80=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BC=9A=E9=80=A0=E6=88=90=E4=B8=80=E4=BA=9B=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BD=86=E6=98=AF=E8=BF=98=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=B5=8B=E5=87=BA=E6=9D=A5=EF=BC=8C=E6=89=80?= =?UTF-8?q?=E4=BB=A5=E5=85=B6=E5=AE=9E=E8=BF=99=E9=87=8C=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E5=B0=B1=E6=98=AF=E5=85=A8=E9=87=8F=E6=9B=B4=E6=96=B0=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=85=B3=E4=BA=8Ehades=E8=AF=B4=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=8F=82=E6=95=B0=E6=9B=B4=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=84=9F=E8=A7=89=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E5=86=8D=E6=8F=90=E4=B8=AA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E7=BB=9F=E4=B8=80=E5=9C=A8DesignModelAdapter.getCurre?= =?UTF-8?q?ntModelAdapter().parameterChanged()=E6=96=B9=E6=B3=95=E4=B8=AD?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/TemplateParameterAction.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java index c32c059d44..99e432eee1 100644 --- a/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/TemplateParameterAction.java @@ -48,9 +48,6 @@ public class TemplateParameterAction extends JTemplateAction { for (int i = 0; i < parameters.length; i++) { wbTpl.addParameter(parameters[i]); } - jwb.fireTargetModified(); - jwb.getFormDesign().setParameterArray(parameters); - jwb.getFormDesign().refreshParameter(); DesignModelAdapter.getCurrentModelAdapter().fireTargetModified(); DesignModelAdapter.getCurrentModelAdapter().parameterChanged(); } From cd0a4f9bcab4464eacb041d0ad641658899c347b Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 4 Jan 2021 09:37:45 +0800 Subject: [PATCH 063/104] =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/creator/XWAbsoluteLayout.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 97c6b406a3..9d70b7f0a2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -576,8 +576,8 @@ public class XWAbsoluteLayout extends XLayoutContainer { */ @Override public void recalculateChildWidth(int width, boolean actualSize){ - int componentCont = getComponentCount(); - for (int i = 0; i < componentCont; i++) { + int componentCount = getComponentCount(); + for (int i = 0; i < componentCount; i++) { XCreator creator = (XCreator) getComponent(i); creator.recalculateChildWidth(width, actualSize); } @@ -590,8 +590,8 @@ public class XWAbsoluteLayout extends XLayoutContainer { */ @Override public void recalculateChildHeight(int height, boolean actualSize){ - int componentCont = getComponentCount(); - for (int i = 0; i < componentCont; i++) { + int componentCount = getComponentCount(); + for (int i = 0; i < componentCount; i++) { XCreator creator = (XCreator) getComponent(i); creator.recalculateChildHeight(height, actualSize); } From 01f5e64443a53f50465830abda0233b1438ef341 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 4 Jan 2021 10:36:30 +0800 Subject: [PATCH 064/104] =?UTF-8?q?KERNEL-6380=20=E6=BC=8F=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/start/module/DesignerWorkspaceActivator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java index 1842ea7622..7154de982f 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java @@ -1,7 +1,7 @@ package com.fr.start.module; import com.fr.concurrent.NamedThreadFactory; -import com.fr.design.PluginRefreshManager; +import com.fr.design.PluginClassRefreshManager; import com.fr.design.file.HistoryTemplateListCache; import com.fr.event.Event; import com.fr.event.Listener; @@ -51,7 +51,7 @@ public class DesignerWorkspaceActivator extends Activator { @Override public void on(Event event, Workspace workspace) { - PluginRefreshManager.getInstance().removePluginListener(); + PluginClassRefreshManager.getInstance().removePluginListener(); HistoryTemplateListCache.getInstance().stash(); } }); @@ -63,7 +63,7 @@ public class DesignerWorkspaceActivator extends Activator { public void on(Event event, Workspace workspace) { HistoryTemplateListCache.getInstance().load(); - PluginRefreshManager.getInstance().addPluginListener(); + PluginClassRefreshManager.getInstance().addPluginListener(); } }); } From 2d174d469fa74fd5cf5f35a0a83d5a3b4cf9a76a Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 4 Jan 2021 13:50:52 +0800 Subject: [PATCH 065/104] =?UTF-8?q?REPORT-46421=20=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E5=90=8E=20=E6=B8=85=E7=A9=BA=E4=B8=8B?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/component/NumberEditorValidatePane.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java index ab4f7e4e2b..d77e1e9000 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java @@ -150,7 +150,7 @@ public class NumberEditorValidatePane extends JPanel { setMaxListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); + refreshErrorMsgTip(); if (setMaxValueCheckBox.isSelected()) { maxValueSpinner.setEnabled(true); Double value = (double) 0; @@ -172,7 +172,7 @@ public class NumberEditorValidatePane extends JPanel { setMinListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); + refreshErrorMsgTip(); if (setMinValueCheckBox.isSelected()) { minValueSpinner.setEnabled(true); Double value = (double) 0; @@ -220,6 +220,14 @@ public class NumberEditorValidatePane extends JPanel { }; } + private void refreshErrorMsgTip() { + boolean visible = setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected(); + errorMsgTextFieldPane.setVisible(visible); + if (!visible) { + errorMsgTextField.setText(StringUtils.EMPTY); + } + } + public void populate(NumberEditor e) { allowDecimalsCheckBox.setSelected(e.isAllowDecimals()); if (e.isAllowDecimals()) { From 125386cc2fe6fd914daa6884962052b6e56006b1 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Mon, 4 Jan 2021 14:22:31 +0800 Subject: [PATCH 066/104] =?UTF-8?q?REPORT-45895=20war=E5=8C=85=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=20=E5=87=BD=E6=95=B0=E7=94=9F=E6=88=902=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/itree/filetree/EnvFileTree.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java index 435d5a465a..e6b2c99d4b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -201,7 +201,8 @@ public class EnvFileTree extends RefreshableJTree { if (filter != null) { java.util.List tList = new ArrayList(); for (int i = 0; i < resFns.length; i++) { - if (filter.accept(resFns[i])) { + // war包部署下会生成两份classes目录,需要去重一下 + if (filter.accept(resFns[i]) && !tList.contains(resFns[i])) { tList.add(resFns[i]); } } From 16c43c8a77dc2992500105f80812693a2191516b Mon Sep 17 00:00:00 2001 From: Lanlan Date: Mon, 4 Jan 2021 16:19:28 +0800 Subject: [PATCH 067/104] =?UTF-8?q?=E6=94=B9=E7=94=A8TreeSet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/EnvFileTree.java | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java index e6b2c99d4b..461cc1d011 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -13,6 +13,9 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.workspace.WorkContext; +import java.util.Comparator; +import java.util.Set; +import java.util.TreeSet; import javax.swing.BorderFactory; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; @@ -21,7 +24,6 @@ import javax.swing.tree.TreePath; import java.awt.Color; import java.awt.Component; import java.io.File; -import java.util.ArrayList; import java.util.Arrays; /* @@ -199,15 +201,33 @@ public class EnvFileTree extends RefreshableJTree { // 用FileNodeFilter过滤一下 if (filter != null) { - java.util.List tList = new ArrayList(); + Set tSet = new TreeSet(new Comparator() { + private boolean isNull(FileNode node) { + return node == null || node.getName() == null; + } + + @Override + public int compare(FileNode o1, FileNode o2) { + if (isNull(o1) && !isNull(o2)) { + return 1; + } + if (!isNull(o1) && isNull(o2)) { + return -1; + } + if (isNull(o1) && isNull(o2)) { + return 0; + } + return o1.getName().compareTo(o2.getName()); + } + }); for (int i = 0; i < resFns.length; i++) { // war包部署下会生成两份classes目录,需要去重一下 - if (filter.accept(resFns[i]) && !tList.contains(resFns[i])) { - tList.add(resFns[i]); + if (filter.accept(resFns[i])) { + tSet.add(resFns[i]); } } - resFns = tList.toArray(new FileNode[tList.size()]); + resFns = tSet.toArray(new FileNode[tSet.size()]); } Arrays.sort(resFns, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); From bce740a3929954afbf1217ba2f3d4fe9ab03023b Mon Sep 17 00:00:00 2001 From: Lanlan Date: Mon, 4 Jan 2021 16:53:53 +0800 Subject: [PATCH 068/104] =?UTF-8?q?=E6=94=B9=E7=94=A8HashMap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/EnvFileTree.java | 34 ++++--------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java index 461cc1d011..f3771a0f90 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -13,9 +13,8 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.workspace.WorkContext; -import java.util.Comparator; -import java.util.Set; -import java.util.TreeSet; +import java.util.HashMap; +import java.util.Map; import javax.swing.BorderFactory; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; @@ -201,33 +200,14 @@ public class EnvFileTree extends RefreshableJTree { // 用FileNodeFilter过滤一下 if (filter != null) { - Set tSet = new TreeSet(new Comparator() { - private boolean isNull(FileNode node) { - return node == null || node.getName() == null; - } - - @Override - public int compare(FileNode o1, FileNode o2) { - if (isNull(o1) && !isNull(o2)) { - return 1; - } - if (!isNull(o1) && isNull(o2)) { - return -1; - } - if (isNull(o1) && isNull(o2)) { - return 0; - } - return o1.getName().compareTo(o2.getName()); - } - }); - for (int i = 0; i < resFns.length; i++) { + Map fileNodes = new HashMap<>(); + for (FileNode fileNode : resFns) { // war包部署下会生成两份classes目录,需要去重一下 - if (filter.accept(resFns[i])) { - tSet.add(resFns[i]); + if (filter.accept(fileNode)) { + fileNodes.put(fileNode.getName(), fileNode); } } - - resFns = tSet.toArray(new FileNode[tSet.size()]); + resFns = fileNodes.values().toArray(new FileNode[fileNodes.size()]); } Arrays.sort(resFns, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); From 0c3ea0927ee77cdeb49e78e6c3cb17e4582c3fc1 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 4 Jan 2021 18:25:39 +0800 Subject: [PATCH 069/104] =?UTF-8?q?REPORT-42238=20=E3=80=9010.0.13?= =?UTF-8?q?=E3=80=91JDK11=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96=20?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E6=8F=90=E4=BA=A4=E5=88=B0release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/data/BasicTableDataTreePane.java | 4 ++-- .../java/com/fr/design/data/datapane/TableDataTreePane.java | 4 ++-- .../design/actions/cell/style/ReportFontForegroundAction.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java index 5ba801ca89..83740f6853 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java @@ -398,7 +398,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp public PreviewTableDataAction(TableDataTree dataTree) { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); this.setMnemonic('p'); - this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.PREVIEW_ICON_PATH)); + this.setSmallIcon("/com/fr/design/images/m_file/preview"); this.dataTree = dataTree; } @@ -437,7 +437,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp public ConnectionTableAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Define_Data_Connection")); this.setMnemonic('D'); - this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_CONNECTION_ICON_PATH)); + this.setSmallIcon("/com/fr/design/images/m_web/connection"); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index ca587c3dab..2298fc8333 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -247,7 +247,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { public EditAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); this.setMnemonic('E'); - this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_EDIT_ICON_PATH)); + this.setSmallIcon("/com/fr/design/images/control/edit"); } public void actionPerformed(ActionEvent e) { @@ -265,7 +265,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { public RemoveAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); this.setMnemonic('R'); - this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_REMOVE_ICON_PATH)); + this.setSmallIcon("/com/fr/design/images/control/remove"); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontForegroundAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontForegroundAction.java index 1a50b3f53b..94f1e9f7ba 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontForegroundAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontForegroundAction.java @@ -63,4 +63,4 @@ public class ReportFontForegroundAction extends AbstractStyleAction implements C return (JComponent) object; } -} \ No newline at end of file +} From 47eb0a732c6b68912e08cfc30249eb679a729dc9 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 4 Jan 2021 18:52:53 +0800 Subject: [PATCH 070/104] =?UTF-8?q?REPORT-42238=20JDK11=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=9B=BE=E6=A0=87=E6=A8=A1=E7=B3=8A=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=8D=95=E7=8B=AC=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=88=B0release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/base/svg/IconUtils.java | 105 ++++++++++ .../main/java/com/fr/base/svg/SVGIcon.java | 82 ++++++++ .../main/java/com/fr/base/svg/SVGLoader.java | 92 +++++++++ .../java/com/fr/base/svg/SVGTranscoder.java | 181 ++++++++++++++++++ .../com/fr/base/svg/SystemScaleUtils.java | 96 ++++++++++ .../actions/AllowAuthorityEditAction.java | 6 +- .../actions/ExitAuthorityEditAction.java | 4 +- .../design/actions/TableDataSourceAction.java | 7 +- .../com/fr/design/actions/UpdateAction.java | 56 +++++- .../design/actions/community/BBSAction.java | 8 +- .../design/actions/community/BugAction.java | 9 +- .../actions/community/BugNeedAction.java | 4 +- .../actions/community/CenterAction.java | 4 +- .../actions/community/FacebookFansAction.java | 5 +- .../design/actions/community/NeedAction.java | 4 +- .../actions/community/QuestionAction.java | 4 +- .../design/actions/community/SignAction.java | 5 +- .../actions/community/TechSolutionAction.java | 4 +- .../design/actions/community/VideoAction.java | 5 +- .../fr/design/actions/edit/CopyAction.java | 5 +- .../com/fr/design/actions/edit/CutAction.java | 5 +- .../fr/design/actions/edit/PasteAction.java | 5 +- .../fr/design/actions/edit/RedoAction.java | 5 +- .../fr/design/actions/edit/UndoAction.java | 7 +- .../actions/file/OpenTemplateAction.java | 8 +- .../actions/file/SaveAsTemplateAction.java | 6 +- .../actions/file/SaveTemplateAction.java | 5 +- .../design/actions/file/SwitchExistEnv.java | 10 +- .../design/actions/help/TutorialAction.java | 4 +- .../fr/design/actions/help/WebDemoAction.java | 6 +- .../help/alphafine/AlphaFineAction.java | 4 +- .../actions/server/ConnectionListAction.java | 6 +- .../actions/server/FunctionManagerAction.java | 8 +- .../actions/server/GlobalParameterAction.java | 6 +- .../actions/server/GlobalTableDataAction.java | 8 +- .../actions/server/PlatformManagerAction.java | 6 +- .../actions/server/PluginManagerAction.java | 6 +- .../com/fr/design/constants/UIConstants.java | 2 + .../data/datapane/sqlpane/SQLEditPane.java | 2 +- .../com/fr/design/gui/core/WidgetOption.java | 31 +-- .../design/gui/core/WidgetOptionFactory.java | 8 +- .../com/fr/design/gui/ibutton/UIButton.java | 11 +- .../com/fr/design/icon/IconPathConstants.java | 2 +- .../DesignerFrameFileDealerPane.java | 12 +- .../mainframe/EastRegionContainerPane.java | 18 +- .../main/java/com/fr/design/menu/MenuDef.java | 20 +- .../action/RemoteDesignAuthManagerAction.java | 4 +- .../fit/menupane/ReportFitAttrAction.java | 4 +- .../roleAuthority/ReportAndFSManagePane.java | 4 +- .../style/color/UIToolbarColorButton.java | 7 +- .../update/actions/SoftwareUpdateAction.java | 4 +- .../images/FileDealerPaneIcon/new_folder.png | Bin 0 -> 288 bytes .../images/FileDealerPaneIcon/refresh.png | Bin 0 -> 530 bytes .../images/FileDealerPaneIcon/remove.png | Bin 0 -> 167 bytes .../images/FileDealerPaneIcon/rename.png | Bin 0 -> 433 bytes .../images/FileDealerPaneIcon/vcs_list.png | Bin 0 -> 286 bytes .../images/FileDealerPaneIcon/view_folder.png | Bin 0 -> 208 bytes .../com/fr/design/images/bbs/bbs_normal.svg | 7 + .../com/fr/design/images/bbs/bug_normal.svg | 7 + .../fr/design/images/bbs/center_normal.svg | 7 + .../fr/design/images/bbs/facebook_normal.svg | 9 + .../com/fr/design/images/bbs/help_normal.svg | 7 + .../com/fr/design/images/bbs/need_normal.svg | 7 + .../fr/design/images/bbs/question_normal.svg | 7 + .../com/fr/design/images/bbs/sign_normal.svg | 7 + .../fr/design/images/bbs/solution_normal.svg | 7 + .../com/fr/design/images/bbs/video_normal.svg | 7 + .../buttonicon/absolute_layout_normal.svg | 7 + .../buttonicon/card_layout_16_normal.svg | 7 + .../images/buttonicon/new_form3_normal.svg | 8 + .../images/buttonicon/newcpts_normal.svg | 11 ++ .../design/images/buttonicon/open_normal.svg | 7 + .../propertiestab/authorityedit_disabled.svg | 8 + .../propertiestab/authorityedit_normal.svg | 7 + .../propertiestab/authorityedit_selected.svg | 7 + .../propertiestab/cellattr_disabled.svg | 7 + .../propertiestab/cellattr_normal.svg | 7 + .../propertiestab/cellattr_selected.svg | 7 + .../propertiestab/cellelement_disabled.svg | 7 + .../propertiestab/cellelement_normal.svg | 7 + .../propertiestab/cellelement_selected.svg | 7 + .../propertiestab/conditionattr_disabled.svg | 7 + .../propertiestab/conditionattr_normal.svg | 7 + .../propertiestab/conditionattr_selected.svg | 7 + .../configuredroles_disabled.svg | 7 + .../propertiestab/configuredroles_normal.svg | 7 + .../configuredroles_selected.svg | 7 + .../propertiestab/floatelement_disabled.svg | 7 + .../propertiestab/floatelement_normal.svg | 7 + .../propertiestab/floatelement_selected.svg | 8 + .../propertiestab/hyperlink_disabled.svg | 7 + .../propertiestab/hyperlink_normal.svg | 7 + .../propertiestab/hyperlink_selected.svg | 7 + .../propertiestab/widgetlib_disabled.svg | 7 + .../propertiestab/widgetlib_normal.svg | 7 + .../propertiestab/widgetlib_selected.svg | 7 + .../propertiestab/widgetsettings_disabled.svg | 7 + .../propertiestab/widgetsettings_normal.svg | 7 + .../propertiestab/widgetsettings_selected.svg | 7 + .../images/buttonicon/redo_disabled.svg | 7 + .../design/images/buttonicon/redo_normal.svg | 7 + .../images/buttonicon/report_16_normal.svg | 10 + .../images/buttonicon/save_disabled.svg | 12 ++ .../design/images/buttonicon/save_normal.svg | 12 ++ .../images/buttonicon/undo_disabled.svg | 7 + .../design/images/buttonicon/undo_normal.svg | 7 + .../buttonicon/widget/button_16_normal.svg | 7 + .../widget/button_group_16_normal.svg | 7 + .../buttonicon/widget/check_box_16_normal.svg | 7 + .../widget/checkbox_group_16_normal.svg | 7 + .../buttonicon/widget/combo_box_16_normal.svg | 7 + .../widget/combo_check_16_normal.svg | 7 + .../widget/comboboxtree16_normal.svg | 7 + .../buttonicon/widget/date_16_normal.svg | 7 + .../buttonicon/widget/label_16_normal.svg | 7 + .../widget/number_field_16_normal.svg | 7 + .../widget/password_field_16_normal.svg | 8 + .../buttonicon/widget/text_area_16_normal.svg | 7 + .../widget/text_field_16_normal.svg | 7 + .../buttonicon/widget/tree_16_normal.svg | 7 + .../design/images/chart/ChartType_normal.svg | 9 + .../data/bind/distanceconnect_normal.svg | 10 + .../images/data/bind/localconnect_normal.svg | 8 + .../data/dock/serverdatabase_normal.svg | 13 ++ .../data/source/dataDictionary_normal.svg | 7 + .../fr/design/images/edit/redo_disabled.svg | 7 + .../com/fr/design/images/edit/redo_normal.svg | 7 + .../fr/design/images/edit/undo_disabled.svg | 7 + .../com/fr/design/images/edit/undo_normal.svg | 7 + .../design/images/expand/cellAttr_normal.svg | 7 + .../images/gui/color/background_normal.svg | 8 + .../images/gui/color/foreground_normal.svg | 7 + .../com/fr/design/images/gui/popup_normal.svg | 7 + .../fr/design/images/m_edit/copy_disabled.svg | 7 + .../fr/design/images/m_edit/copy_normal.svg | 10 + .../fr/design/images/m_edit/cut_disabled.svg | 9 + .../fr/design/images/m_edit/cut_normal.svg | 10 + .../images/m_edit/formatBrush_normal.svg | 9 + .../design/images/m_edit/merge_disabled.svg | 11 ++ .../fr/design/images/m_edit/merge_normal.svg | 11 ++ .../design/images/m_edit/paste_disabled.svg | 10 + .../fr/design/images/m_edit/paste_normal.svg | 11 ++ .../fr/design/images/m_edit/redo_disabled.svg | 7 + .../fr/design/images/m_edit/redo_normal.svg | 7 + .../fr/design/images/m_edit/undo_disabled.svg | 7 + .../fr/design/images/m_edit/undo_normal.svg | 7 + .../design/images/m_edit/unmerge_disabled.svg | 10 + .../design/images/m_edit/unmerge_normal.svg | 8 + .../fr/design/images/m_file/export_normal.svg | 8 + .../images/m_file/formExport_normal.svg | 11 ++ .../design/images/m_file/pageSetup_normal.svg | 7 + .../images/m_file/repeatAndFrozen_normal.svg | 7 + .../fr/design/images/m_file/saveAs_normal.svg | 7 + .../fr/design/images/m_file/save_disabled.svg | 11 ++ .../fr/design/images/m_file/save_normal.svg | 11 ++ .../fr/design/images/m_file/switch_normal.svg | 7 + .../images/m_format/cellAttr_normal.svg | 7 + .../images/m_format/cellstyle/bold_normal.svg | 7 + .../m_format/cellstyle/bold_selected.svg | 7 + .../m_format/cellstyle/h_center_normal.svg | 7 + .../m_format/cellstyle/h_center_selected.svg | 7 + .../m_format/cellstyle/h_left_normal.svg | 7 + .../m_format/cellstyle/h_left_selected.svg | 7 + .../m_format/cellstyle/h_right_normal.svg | 7 + .../m_format/cellstyle/h_right_selected.svg | 7 + .../m_format/cellstyle/italic_normal.svg | 9 + .../m_format/cellstyle/italic_selected.svg | 9 + .../m_format/cellstyle/underline_normal.svg | 7 + .../m_format/cellstyle/underline_selected.svg | 7 + .../images/m_format/highlight_normal.svg | 7 + .../images/m_format/modified_normal.svg | 7 + .../images/m_format/noborder_normal.svg | 7 + .../fr/design/images/m_help/demo_normal.svg | 7 + .../design/images/m_insert/bias_disabled.svg | 7 + .../fr/design/images/m_insert/bias_normal.svg | 7 + .../images/m_insert/bindColumn_disabled.svg | 7 + .../images/m_insert/bindColumn_normal.svg | 7 + .../fr/design/images/m_insert/cell_normal.svg | 7 + .../design/images/m_insert/chart_disabled.svg | 7 + .../design/images/m_insert/chart_normal.svg | 7 + .../images/m_insert/floatPop_normal.svg | 9 + .../design/images/m_insert/float_normal.svg | 7 + .../images/m_insert/formula_disabled.svg | 7 + .../design/images/m_insert/formula_normal.svg | 7 + .../images/m_insert/hyperLink_normal.svg | 7 + .../design/images/m_insert/image_disabled.svg | 12 ++ .../design/images/m_insert/image_normal.svg | 10 + .../images/m_insert/insertColumn_normal.svg | 13 ++ .../images/m_insert/insertRow_normal.svg | 14 ++ .../images/m_insert/richtext_disabled.svg | 7 + .../images/m_insert/richtext_normal.svg | 7 + .../images/m_insert/subReport_disabled.svg | 12 ++ .../images/m_insert/subReport_normal.svg | 10 + .../design/images/m_insert/text_disabled.svg | 7 + .../fr/design/images/m_insert/text_normal.svg | 7 + .../m_report/allow_authority_edit_normal.svg | 8 + .../images/m_report/background_normal.svg | 10 + .../images/m_report/delete_disabled.svg | 7 + .../design/images/m_report/delete_normal.svg | 7 + .../m_report/exit_authority_edit_normal.svg | 7 + .../design/images/m_report/footer_normal.svg | 7 + .../design/images/m_report/header_normal.svg | 7 + .../images/m_report/linearAttr_normal.svg | 7 + .../design/images/m_report/mobile_normal.svg | 7 + .../fr/design/images/m_report/p_normal.svg | 7 + .../m_report/reportEngineAttr_normal.svg | 14 ++ .../m_report/reportWriteAttr_normal.svg | 11 ++ .../images/m_report/watermark_normal.svg | 7 + .../m_report/webreportattribute_normal.svg | 8 + .../design/images/m_web/datasource_normal.svg | 9 + .../fr/design/images/m_web/edit_normal.svg | 8 + .../design/images/m_web/function_normal.svg | 7 + .../fr/design/images/m_web/style_normal.svg | 7 + .../fr/design/images/reportfit/fit_normal.svg | 7 + .../images/server/platform_16_16_normal.svg | 8 + .../fr/design/images/server/plugin_normal.svg | 8 + .../images/sheet/add_polysheet_normal.svg | 16 ++ .../images/sheet/next_page_disabled.svg | 7 + .../design/images/sheet/next_page_normal.svg | 7 + .../design/images/sheet/polysheet_normal.svg | 9 + .../design/images/sheet/pre_page_disabled.svg | 7 + .../design/images/sheet/pre_page_normal.svg | 7 + .../images/update/update_new_normal.svg | 7 + ...e_Design_Auth_Manager_normal@1x_normal.svg | 9 + .../java/com/fr/base/svg/IconUtilsTest.java | 41 ++++ .../fr/design/module/ChartPreStyleAction.java | 6 +- .../map/server/ChartMapEditorAction.java | 4 +- .../van/chart/map/images/mapData_normal.svg | 8 + .../com/fr/design/actions/NewFormAction.java | 6 +- .../designer/beans/actions/CopyAction.java | 6 +- .../designer/beans/actions/CutAction.java | 6 +- .../beans/actions/FormDeleteAction.java | 4 +- .../designer/beans/actions/PasteAction.java | 5 +- .../form/parameter/FormParaTargetMode.java | 7 +- .../fr/design/gui/core/FormWidgetOption.java | 15 +- .../com/fr/design/mainframe/FormParaPane.java | 16 +- .../design/mainframe/FormParaWidgetPane.java | 3 +- .../fr/design/mainframe/FormTargetMode.java | 9 +- .../java/com/fr/design/mainframe/JForm.java | 2 +- .../actions/cell/CellAttributeAction.java | 6 +- .../actions/cell/CellExpandAttrAction.java | 6 +- .../actions/cell/CellWidgetAttrAction.java | 6 +- .../cell/ConditionAttributesAction.java | 6 +- .../design/actions/cell/EditCellAction.java | 9 +- .../actions/cell/GlobalStyleMenuDef.java | 2 +- .../actions/cell/UIToolbarBorderButton.java | 23 +-- .../actions/cell/style/AlignmentAction.java | 8 +- .../cell/style/ReportFontBoldAction.java | 6 +- .../style/ReportFontForegroundAction.java | 5 +- .../cell/style/ReportFontItalicAction.java | 4 +- .../cell/style/ReportFontUnderlineAction.java | 6 +- .../cell/style/StyleBackgroundAction.java | 11 +- .../actions/columnrow/InsertColumnAction.java | 6 +- .../actions/columnrow/InsertRowAction.java | 6 +- .../fr/design/actions/edit/DeleteAction.java | 9 +- .../design/actions/edit/HyperlinkAction.java | 6 +- .../actions/edit/merge/MergeCellAction.java | 6 +- .../actions/edit/merge/UnmergeCellAction.java | 6 +- .../file/newReport/NewPolyReportAction.java | 11 +- .../file/newReport/NewWorkBookAction.java | 5 +- .../actions/insert/cell/BiasCellAction.java | 4 +- .../actions/insert/cell/ChartCellAction.java | 4 +- .../insert/cell/DSColumnCellAction.java | 6 +- .../insert/cell/FormulaCellAction.java | 4 +- .../insert/cell/GeneralCellAction.java | 4 +- .../actions/insert/cell/ImageCellAction.java | 4 +- .../insert/cell/RichTextCellAction.java | 5 +- .../insert/cell/SubReportCellAction.java | 5 +- .../actions/insert/flot/ChartFloatAction.java | 4 +- .../insert/flot/FormulaFloatAction.java | 4 +- .../actions/insert/flot/ImageFloatAction.java | 4 +- .../insert/flot/TextBoxFloatAction.java | 3 +- .../report/ReportBackgroundAction.java | 6 +- .../actions/report/ReportColumnsAction.java | 7 +- .../report/ReportEngineAttrAction.java | 7 +- .../report/ReportExportAttrAction.java | 9 +- .../actions/report/ReportFooterAction.java | 7 +- .../actions/report/ReportHeaderAction.java | 7 +- .../report/ReportMobileAttrAction.java | 4 +- .../actions/report/ReportPageAttrAction.java | 4 +- .../actions/report/ReportPageSetupAction.java | 9 +- .../actions/report/ReportParameterAction.java | 6 +- .../report/ReportPrintSettingAction.java | 6 +- .../actions/report/ReportWatermarkAction.java | 5 +- .../actions/report/ReportWebAttrAction.java | 9 +- .../actions/report/ReportWriteAttrAction.java | 7 +- .../server/ServerConfigManagerAction.java | 6 +- .../actions/server/StyleListAction.java | 7 +- .../actions/server/WidgetManagerAction.java | 4 +- .../utils/DeprecatedActionManager.java | 4 +- .../fr/design/mainframe/ElementCasePane.java | 4 +- .../mainframe/ElementCasePaneDelegate.java | 2 +- .../design/mainframe/FormatBrushAction.java | 4 +- .../com/fr/design/mainframe/JWorkBook.java | 2 +- .../fr/design/mainframe/SheetNameTabPane.java | 18 +- .../fr/poly/actions/DeleteBlockAction.java | 4 +- .../cellquick/CellDSColumnEditor.java | 3 +- .../cellquick/CellRichTextEditor.java | 3 +- .../cellquick/CellSubReportEditor.java | 3 +- .../main/java/com/fr/start/MainDesigner.java | 8 +- .../com/fr/start/preload/ImagePreLoader.java | 137 ++++++++++++- .../alphafine/images/smallsearch_normal.svg | 7 + 302 files changed, 2515 insertions(+), 372 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/base/svg/IconUtils.java create mode 100644 designer-base/src/main/java/com/fr/base/svg/SVGIcon.java create mode 100644 designer-base/src/main/java/com/fr/base/svg/SVGLoader.java create mode 100644 designer-base/src/main/java/com/fr/base/svg/SVGTranscoder.java create mode 100644 designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/bbs_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/bug_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/center_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/facebook_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/help_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/need_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/question_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/sign_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/solution_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/video_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/absolute_layout_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/new_form3_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/newcpts_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/open_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/redo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/redo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/report_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/save_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/save_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/undo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/undo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/button_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/button_group_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/check_box_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/checkbox_group_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_box_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_check_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/date_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/label_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/number_field_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/password_field_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/text_area_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/text_field_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/tree_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/chart/ChartType_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/data/bind/distanceconnect_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/data/bind/localconnect_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/data/dock/serverdatabase_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/data/source/dataDictionary_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/edit/redo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/edit/redo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/edit/undo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/edit/undo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/expand/cellAttr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/gui/color/background_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/gui/color/foreground_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/gui/popup_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/copy_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/copy_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/cut_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/cut_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/formatBrush_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/merge_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/merge_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/paste_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/paste_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/redo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/redo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/undo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/undo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/unmerge_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/unmerge_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/export_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/formExport_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/pageSetup_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/saveAs_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/save_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/save_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/switch_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellAttr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/bold_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/bold_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_center_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_center_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_left_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_left_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_right_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_right_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/italic_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/italic_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/underline_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/underline_selected.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/highlight_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/modified_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/noborder_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_help/demo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/bias_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/bias_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/bindColumn_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/bindColumn_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/cell_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/chart_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/chart_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/floatPop_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/float_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/formula_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/formula_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/hyperLink_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/image_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/image_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/insertColumn_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/insertRow_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/richtext_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/richtext_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/subReport_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/subReport_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/text_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/text_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/allow_authority_edit_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/background_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/delete_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/delete_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/exit_authority_edit_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/footer_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/header_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/linearAttr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/mobile_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/p_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/reportEngineAttr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/reportWriteAttr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/watermark_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/webreportattribute_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/datasource_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/edit_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/function_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/style_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit/fit_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/server/platform_16_16_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/server/plugin_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/sheet/add_polysheet_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/sheet/next_page_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/sheet/next_page_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/sheet/polysheet_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/sheet/pre_page_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/sheet/pre_page_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/update/update_new_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/remote/images/icon_Remote_Design_Auth_Manager_normal@1x_normal.svg create mode 100644 designer-base/src/test/java/com/fr/base/svg/IconUtilsTest.java create mode 100644 designer-chart/src/main/resources/com/fr/van/chart/map/images/mapData_normal.svg create mode 100644 designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch_normal.svg diff --git a/designer-base/src/main/java/com/fr/base/svg/IconUtils.java b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java new file mode 100644 index 0000000000..119471dcee --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java @@ -0,0 +1,105 @@ +package com.fr.base.svg; + +import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; + +import javax.swing.Icon; +import javax.swing.ImageIcon; + +/** + * 主要是用来读取svgIcon的工具类 + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020/12/23 + */ +public class IconUtils { + + private static final String ICON_SUFFIX_SVG = ".svg"; + private static final String ICON_SUFFIX_PNG = ".png"; + private static final String ICON_SUFFIX_GIF = ".gif"; + private static final String SUFFIX_SEPARATOR = "."; + + public static final String ICON_TYPE_NORMAL= "_normal.svg"; + public static final String ICON_TYPE_DISABLED= "_disabled.svg"; + public static final String ICON_TYPE_PRESSED= "_pressed.svg"; + + + /** + * 可以读取SVG图标或者普通图标,并且可以读取不带扩展名的文件 + * 不带扩展名时以svg优先、其次png,最后gif + * @param resource 图片路径 + * @return 图标 + */ + public static Icon readIcon(String resource) { + // 判断是否有.XXX文件后缀 + if (resource.contains(SUFFIX_SEPARATOR)) { + // 判断是否以.svg结尾 + if (resource.endsWith(ICON_SUFFIX_SVG)) { + return SVGIcon.readSVGIcon(resource); + } + return IOUtils.readIcon(resource); + } + // 文件无后缀时 + return readNoSuffixResource(resource, ICON_TYPE_NORMAL); + } + + /** + * 尝试读取不带扩展名的图标,svg优先,其次png,最后gif,都没读到就打印错误日志,返回空白Icon + * @param resource 图片路径 + * @param svgIconType 针对svg来说的图标类型 + * 取值为:ICON_TYPE_NORMAL、ICON_TYPE_DISABLED、ICON_TYPE_PRESSED + * @return 图标 + */ + private static Icon readNoSuffixResource(String resource, String svgIconType) { + String svgPath = resource + svgIconType; + if (IOUtils.readResource(svgPath) != null) { + return SVGIcon.readSVGIcon(svgPath); + } + String pngPath = resource + ICON_SUFFIX_PNG; + if (IOUtils.readResource(pngPath) != null) { + return IOUtils.readIcon(pngPath); + } + String gifPath = resource + ICON_SUFFIX_GIF; + if (IOUtils.readResource(gifPath) != null) { + return IOUtils.readIcon(gifPath); + } + FineLoggerFactory.getLogger().error("File not exists:{}", resource); + return new ImageIcon(); + } + + /** + * 读取指定类型的svgIcon + * @param resource + * @param svgIconType + * @return + */ + public static Icon readSVGIcon(String resource, String svgIconType) { + // 判断下是否有后缀 + if (!resource.contains(SUFFIX_SEPARATOR)) { + return readNoSuffixResource(resource, svgIconType); + } + // 如果是".png"后缀,就替换为传入的svgIconType,然后读取图标 + if (resource.endsWith(ICON_SUFFIX_PNG)) { + return readSpecifiedTypeIcon(resource, ICON_SUFFIX_PNG, svgIconType); + } + // 如果是"_XXXXXX.svg"后缀 + if (resource.endsWith(ICON_TYPE_NORMAL)) { + return readSpecifiedTypeIcon(resource, ICON_TYPE_NORMAL, svgIconType); + } + if (resource.endsWith(ICON_TYPE_DISABLED)) { + return readSpecifiedTypeIcon(resource, ICON_TYPE_DISABLED, svgIconType); + } + if (resource.endsWith(ICON_TYPE_PRESSED)) { + return readSpecifiedTypeIcon(resource, ICON_TYPE_PRESSED, svgIconType); + } + return readIcon(resource); + } + + private static Icon readSpecifiedTypeIcon(String resource, String oldSuffix, String newSuffix) { + String iconPath = resource.replace(oldSuffix, newSuffix); + if (IOUtils.readResource(iconPath) != null) { + return SVGIcon.readSVGIcon(iconPath); + } + return readIcon(resource); + } +} diff --git a/designer-base/src/main/java/com/fr/base/svg/SVGIcon.java b/designer-base/src/main/java/com/fr/base/svg/SVGIcon.java new file mode 100644 index 0000000000..aebb22ae14 --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/svg/SVGIcon.java @@ -0,0 +1,82 @@ +package com.fr.base.svg; + +import com.fr.general.IOUtils; + +import javax.swing.Icon; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; + +/** + * SVG转化而来的Icon + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020/12/17 + */ +public class SVGIcon implements Icon { + + private BufferedImage image; + + private static final boolean HI_DPI_SURPORT = SystemScaleUtils.isJreHiDPIEnabled(); + + public static final float SYSTEM_SCALE = SystemScaleUtils.sysScale(); + + private static final String ICON_PREFIX = "/"; + + public SVGIcon(BufferedImage image) { + this.image = image; + } + + @Override + public void paintIcon(Component c, Graphics g, int x, int y) { + if (HI_DPI_SURPORT) { + Graphics2D graphics = (Graphics2D) g.create(x, y, image.getWidth(null), image.getHeight(null)); + float scale = SYSTEM_SCALE; + graphics.scale(1 / scale, 1 / scale); + graphics.drawImage(image, 0, 0, null); + graphics.scale(1.0D, 1.0D); + graphics.dispose(); + } else { + g.drawImage(image, x, y, null); + } + } + + @Override + public int getIconWidth() { + return HI_DPI_SURPORT ? (int) (image.getWidth() / SYSTEM_SCALE) : image.getWidth(); + } + + @Override + public int getIconHeight() { + return HI_DPI_SURPORT ? (int) (image.getHeight() / SYSTEM_SCALE) : image.getHeight(); + } + + /** + * 读取高清图标 + * @param url + * @return + */ + public static Icon readSVGIcon(String url) { + if (!url.startsWith(ICON_PREFIX)) { + url = ICON_PREFIX + url; + } + BufferedImage image = (BufferedImage) SVGLoader.load(url); + return image == null ? IOUtils.readIcon(url) : new SVGIcon(image); + } + + /** + * 读取指定尺寸的图标 + * @param url 资源路径 + * @param width 宽度 + * @param height 高度 + * @return + */ + public static Icon readSVGIcon(String url, float width, float height) { + if (!url.startsWith(ICON_PREFIX)) { + url = ICON_PREFIX + url; + } + BufferedImage image = (BufferedImage) SVGLoader.load(url, width, height); + return image == null ? IOUtils.readIcon(url) : new SVGIcon(image); + } +} diff --git a/designer-base/src/main/java/com/fr/base/svg/SVGLoader.java b/designer-base/src/main/java/com/fr/base/svg/SVGLoader.java new file mode 100644 index 0000000000..3c0b7a0363 --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/svg/SVGLoader.java @@ -0,0 +1,92 @@ +package com.fr.base.svg; + +import com.fr.general.IOUtils; +import org.apache.batik.transcoder.TranscoderException; +import org.apache.batik.transcoder.TranscoderInput; +import org.apache.xmlgraphics.java2d.Dimension2DDouble; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.awt.Image; +import java.io.IOException; +import java.net.URL; + +/** + * SVG图标加载器 + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020/12/17 + */ +public class SVGLoader { + public static final int ICON_DEFAULT_SIZE = 16; + + public SVGLoader() { + } + + @Nullable + public static Image load(@NotNull String url) { + try { + URL resource = IOUtils.getResource(url, SVGLoader.class); + if (resource == null) { + return null; + } + return load(resource, SVGIcon.SYSTEM_SCALE); + } catch (IOException ignore) { + return null; + } + } + + @Nullable + public static Image load(@NotNull URL url) throws IOException { + return load(url, SVGIcon.SYSTEM_SCALE); + } + + @Nullable + public static Image load(@NotNull URL url, double scale) throws IOException { + try { + String svgUri = url.toString(); + TranscoderInput input = new TranscoderInput(svgUri); + return SVGTranscoder.createImage(scale, input).getImage(); + } catch (TranscoderException ignore) { + return null; + } + } + + @Nullable + public static Image load(@NotNull URL url, double scale, Dimension2DDouble dimension) throws IOException { + try { + String svgUri = url.toString(); + TranscoderInput input = new TranscoderInput(svgUri); + return SVGTranscoder.createImage(scale, input, + (float) (dimension.getWidth() * scale), (float) (dimension.getHeight() * scale)).getImage(); + } catch (TranscoderException ignore) { + return null; + } + } + + + @Nullable + public static Image load(@NotNull URL url, double scale, double overriddenWidth, double overriddenHeight) throws IOException { + try { + String svgUri = url.toString(); + TranscoderInput input = new TranscoderInput(svgUri); + return SVGTranscoder.createImage(scale, input, (float) (overriddenWidth * scale), (float) (overriddenHeight * scale)).getImage(); + } catch (TranscoderException ignore) { + return null; + } + } + + @Nullable + public static Image load(@NotNull String url, float width, float height) { + try { + URL resource = IOUtils.getResource(url, SVGLoader.class); + if (resource == null) { + return null; + } + TranscoderInput input = new TranscoderInput(resource.toString()); + return SVGTranscoder.createImage(SVGIcon.SYSTEM_SCALE, input, -1, -1, width, height).getImage(); + } catch (TranscoderException ignore) { + return null; + } + } +} diff --git a/designer-base/src/main/java/com/fr/base/svg/SVGTranscoder.java b/designer-base/src/main/java/com/fr/base/svg/SVGTranscoder.java new file mode 100644 index 0000000000..dd47bc5757 --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/svg/SVGTranscoder.java @@ -0,0 +1,181 @@ +package com.fr.base.svg; + +import com.fr.stable.AssistUtils; +import com.fr.value.AtomicNotNullLazyValue; +import org.apache.batik.anim.dom.SAXSVGDocumentFactory; +import org.apache.batik.anim.dom.SVGOMDocument; +import org.apache.batik.bridge.BridgeContext; +import org.apache.batik.bridge.UserAgent; +import org.apache.batik.transcoder.SVGAbstractTranscoder; +import org.apache.batik.transcoder.TranscoderException; +import org.apache.batik.transcoder.TranscoderInput; +import org.apache.batik.transcoder.TranscoderOutput; +import org.apache.batik.transcoder.image.ImageTranscoder; +import org.apache.batik.util.XMLResourceDescriptor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.w3c.dom.Element; +import org.w3c.dom.svg.SVGDocument; + +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Rectangle; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.StringReader; + +/** + * 可以根据某个缩放倍数scale,将SVG图片转化为Image对象 + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020/12/17 + */ +public class SVGTranscoder extends ImageTranscoder { + + private static final float DEFAULT_VALUE = -1.0F; + public static final float ICON_DEFAULT_SIZE = 16F; + private float origDocWidth; + private float origDocHeight; + @Nullable + private BufferedImage image; + private final double scale; + + @NotNull + private static AtomicNotNullLazyValue iconMaxSize = new AtomicNotNullLazyValue() { + @NotNull + @Override + protected Double compute() { + double maxSize = Double.MAX_VALUE; + if (!GraphicsEnvironment.isHeadless()) { + GraphicsDevice defaultScreenDevice = GraphicsEnvironment + .getLocalGraphicsEnvironment() + .getDefaultScreenDevice(); + Rectangle bounds = defaultScreenDevice.getDefaultConfiguration().getBounds(); + AffineTransform tx = defaultScreenDevice + .getDefaultConfiguration() + .getDefaultTransform(); + maxSize = Math.max(bounds.width * tx.getScaleX(), bounds.height * tx.getScaleY()); + } + return maxSize; + } + }; + + public SVGTranscoder(double scale) { + this.scale = scale; + this.width = ICON_DEFAULT_SIZE; + this.height = ICON_DEFAULT_SIZE; + } + + public SVGTranscoder(double scale, float width, float height) { + this.scale = scale; + this.width = width; + this.height = height; + } + + public final float getOrigDocWidth() { + return this.origDocWidth; + } + + public final void setOrigDocWidth(float origDocWidth) { + this.origDocWidth = origDocWidth; + } + + public final float getOrigDocHeight() { + return this.origDocHeight; + } + + public final void setOrigDocHeight(float origDocHeight) { + this.origDocHeight = origDocHeight; + } + + public static double getIconMaxSize() { + return iconMaxSize.getValue(); + } + + @Nullable + public final BufferedImage getImage() { + return this.image; + } + + @NotNull + public static SVGTranscoder createImage(double scale, @NotNull TranscoderInput input) throws TranscoderException { + return createImage(scale, input, -1, -1); + } + + @NotNull + public static SVGTranscoder createImage(double scale, @NotNull TranscoderInput input, float overriddenWidth, float overriddenHeight) throws TranscoderException { + return createImage(scale, input, overriddenWidth, overriddenHeight, ICON_DEFAULT_SIZE, ICON_DEFAULT_SIZE); + } + + @NotNull + public static SVGTranscoder createImage(double scale, @NotNull TranscoderInput input, float overriddenWidth, float overriddenHeight, float width, float height) throws TranscoderException { + SVGTranscoder transcoder = new SVGTranscoder(scale, width, height); + if (!AssistUtils.equals(overriddenWidth, DEFAULT_VALUE)) { + transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_WIDTH, overriddenWidth); + } + + if (!AssistUtils.equals(overriddenHeight, DEFAULT_VALUE)) { + transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_HEIGHT, overriddenHeight); + } + + double iconMaxSize = SVGTranscoder.iconMaxSize.getValue(); + transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_WIDTH, (float) iconMaxSize); + transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_HEIGHT, (float) iconMaxSize); + transcoder.transcode(input, null); + return transcoder; + } + + private static SVGDocument createFallbackPlaceholder() { + try { + String fallbackIcon = "\n" + + " \n" + + " \n" + + " \n" + + "\n"; + + SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(XMLResourceDescriptor.getXMLParserClassName()); + return (SVGDocument) factory.createDocument(null, new StringReader(fallbackIcon)); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + + @Override + protected void setImageSize(float docWidth, float docHeight) { + super.setImageSize((float) (docWidth * this.scale), (float) (docHeight * this.scale)); + this.origDocWidth = docWidth; + this.origDocHeight = docHeight; + } + + @Override + @NotNull + public BufferedImage createImage(int width, int height) { + return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); + } + + @Override + public void writeImage(@NotNull BufferedImage image, @Nullable TranscoderOutput output) { + this.image = image; + } + + @Override + @NotNull + protected UserAgent createUserAgent() { + return new SVGAbstractTranscoderUserAgent() { + @Override + @NotNull + public SVGDocument getBrokenLinkDocument(@NotNull Element e, @NotNull String url, @NotNull String message) { + return createFallbackPlaceholder(); + } + }; + } + + /** + * 开放访问权限 + */ + @Override + public BridgeContext createBridgeContext(SVGOMDocument doc) { + return super.createBridgeContext(doc); + } +} diff --git a/designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java b/designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java new file mode 100644 index 0000000000..ee289b4c8a --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java @@ -0,0 +1,96 @@ +package com.fr.base.svg; + +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StableUtils; +import com.fr.stable.os.OperatingSystem; +import org.jetbrains.annotations.NotNull; + +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.lang.reflect.Method; +import java.util.concurrent.atomic.AtomicReference; + +/** + * 获取系统Scale相关的工具类 + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020/12/17 + */ +public class SystemScaleUtils { + + private static final AtomicReference JRE_HIDPI = new AtomicReference<>(); + + private static final String HI_DPI = "hidpi"; + + /** + * 判断是否支持高清 + * @return + */ + public static boolean isJreHiDPIEnabled() { + if (JRE_HIDPI.get() != null) { + return JRE_HIDPI.get(); + } + if (OperatingSystem.isMacos()) { + // 如果是mac os系统,直接返回true + return true; + } + if (OperatingSystem.isWindows() && StableUtils.getMajorJavaVersion() <= 8) { + // 如果是jdk8 + Windows系统,直接返回false + return false; + } + synchronized (JRE_HIDPI) { + if (JRE_HIDPI.get() != null) { + return JRE_HIDPI.get(); + } + boolean result = false; + if (getBooleanProperty(HI_DPI, true)) { + try { + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + Class sunGraphicsEnvironmentClass = Class.forName("sun.java2d.SunGraphicsEnvironment"); + if (sunGraphicsEnvironmentClass.isInstance(ge)) { + try { + Method method = sunGraphicsEnvironmentClass.getDeclaredMethod("isUIScaleEnabled"); + method.setAccessible(true); + result = (Boolean)method.invoke(ge); + } + catch (NoSuchMethodException e) { + FineLoggerFactory.getLogger().error(e.getMessage()); + } + } + } + catch (Throwable ignore) { + } + } + JRE_HIDPI.set(result); + return result; + } + } + + public static boolean getBooleanProperty(@NotNull final String key, final boolean defaultValue) { + final String value = System.getProperty(key); + return value == null ? defaultValue : Boolean.parseBoolean(value); + } + + /** + * 获取系统Scale + * @return + */ + public static float sysScale() { + float scale = 1.0f; + // 先判断是否支持高清,不支持代表此时是Windows + jdk8 的设计器,返回的scale值为1.0 + if (isJreHiDPIEnabled()) { + // 获取屏幕图形设备对象 + GraphicsDevice graphicsDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); + if (graphicsDevice != null) { + // 获取图形配置对象 + GraphicsConfiguration configuration = graphicsDevice.getDefaultConfiguration(); + if (configuration != null && configuration.getDevice().getType() != GraphicsDevice.TYPE_PRINTER) { + // 获取屏幕缩放率,mac下固定为2,Windows+jdk11则将得到用户设置的dpi值 + scale = (float) configuration.getDefaultTransform().getScaleX(); + } + } + } + return scale; + } +} diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java index 507632c72a..1a0509d267 100644 --- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; @@ -22,7 +22,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction { this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); + this.setSmallIcon("/com/fr/design/images/m_report/allow_authority_edit"); } /** @@ -78,4 +78,4 @@ public class AllowAuthorityEditAction extends TemplateComponentAction { } } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java index 44bd365a25..77ae198d0f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.DesignModelAdapter; @@ -19,7 +19,7 @@ public class ExitAuthorityEditAction extends TemplateComponentAction { public ExitAuthorityEditAction(TargetComponent t) { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Authority_Edit_Status_Exit")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit.png")); + this.setSmallIcon("/com/fr/design/images/m_report/exit_authority_edit"); } diff --git a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java index a0ca4d9558..2903b12a12 100644 --- a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java @@ -1,8 +1,7 @@ package com.fr.design.actions; import javax.swing.SwingUtilities; - -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.data.TableDataSource; import com.fr.design.data.datapane.ReportTableDataPane; @@ -27,7 +26,7 @@ public class TableDataSourceAction extends TemplateComponentAction map) { DesignTableDataManager.fireDSChanged(map); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java index 4fd7e6c42b..1fc6e14440 100644 --- a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java @@ -6,6 +6,8 @@ package com.fr.design.actions; import com.fr.base.NameStyle; import com.fr.base.ScreenResolution; import com.fr.base.Style; +import com.fr.base.svg.SVGIcon; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.core.ActionFactory; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; @@ -78,6 +80,16 @@ public abstract class UpdateAction extends ShortCut implements Action { private String searchText = StringUtils.EMPTY; + /** + * 按钮在按压状态的图标key + */ + public static final String PRESSED_ICON = "pressedIcon"; + + /** + * 按钮在灰化状态的图标key + */ + public static final String DISABLED_ICON = "disabledIcon"; + /** @@ -162,6 +174,19 @@ public abstract class UpdateAction extends ShortCut implements Action { this.putValue(Action.SMALL_ICON, smallIcon); } + /** + * 使用传入资源url的方式设置Icon,可以自动设置对应的"_normal.svg"、"_disabled.svg" + * 但是要保证文件名的统一,例如a.png对应a_normal.svg、a_disabled.svg + * 如果a_disabled.svg或者a_pressed.svg缺失,则不会被设置成灰化状态或者按压状态图标 + * 如果a_normal.svg缺失,则会读到a.png,这也就不是一个SVGIcon了 + * 如果连 a.png 也不存在,那么这个action的图标就是空白的 + * @param resource + */ + public void setSmallIcon(String resource) { + this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource)); + this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED)); + } + public void setSmallIcon(Icon[] smallIcon, boolean white) { this.putValue(Action.SMALL_ICON, smallIcon); } @@ -251,6 +276,14 @@ public abstract class UpdateAction extends ShortCut implements Action { } + public void setPressedIcon(Icon pressedIcon) { + this.putValue(UpdateAction.PRESSED_ICON, pressedIcon); + } + + public void setDisabledIcon(Icon disabledIcon) { + this.putValue(UpdateAction.DISABLED_ICON, disabledIcon); + } + @Override public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { @@ -271,6 +304,8 @@ public abstract class UpdateAction extends ShortCut implements Action { UIMenuItem menuItem = new UIMenuItem(this); // 设置名字用作单元测 menuItem.setName(getName()); + setPressedIcon4Button(menuItem); + setDisabledIcon4Button(menuItem); object = menuItem; this.putValue(UIMenuItem.class.getName(), object); @@ -282,6 +317,8 @@ public abstract class UpdateAction extends ShortCut implements Action { UIMenuEastAttrItem menuItem = new UIMenuEastAttrItem(this); // 设置名字用作单元测 menuItem.setName(getName()); + setPressedIcon4Button(menuItem); + setDisabledIcon4Button(menuItem); this.putValue(UIMenuItem.class.getName(), menuItem); return menuItem; } @@ -307,6 +344,8 @@ public abstract class UpdateAction extends ShortCut implements Action { } button.setIcon((Icon) this.getValue(Action.SMALL_ICON)); + setPressedIcon4Button(button); + setDisabledIcon4Button(button); button.addActionListener(this); button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW); @@ -454,6 +493,8 @@ public abstract class UpdateAction extends ShortCut implements Action { object = new UseMenuItem(this); this.putValue(UseMenuItem.class.getName(), object); } + setPressedIcon4Button((UseMenuItem) object); + setDisabledIcon4Button((UseMenuItem) object); return (UseMenuItem) object; } @@ -594,4 +635,17 @@ public abstract class UpdateAction extends ShortCut implements Action { shortPinyin.append(PinyinHelper.getShortPinyin(title)).append(separator); } -} \ No newline at end of file + private void setPressedIcon4Button(AbstractButton button) { + Icon pressedIcon = (Icon) this.getValue(UpdateAction.PRESSED_ICON); + if (pressedIcon != null && pressedIcon instanceof SVGIcon) { + button.setPressedIcon(pressedIcon); + } + } + + private void setDisabledIcon4Button(AbstractButton button) { + Icon disabledIcon = (Icon) this.getValue(UpdateAction.DISABLED_ICON); + if (disabledIcon != null && disabledIcon instanceof SVGIcon) { + button.setDisabledIcon(disabledIcon); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java index 98ad28c9c2..05a1d2b20c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; @@ -13,15 +13,15 @@ import java.awt.event.ActionEvent; public class BBSAction extends UpdateAction { - + public BBSAction() { this.setMenuKeySet(BBS); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/bbs.png")); - + this.setSmallIcon("/com/fr/design/images/bbs/bbs"); + } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index d9c75321d6..cebaa6956b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; @@ -17,8 +17,7 @@ public class BugAction extends UpdateAction { this.setMenuKeySet(BUG); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/bug.png")); - + this.setSmallIcon("/com/fr/design/images/bbs/bug"); } @Override @@ -29,7 +28,7 @@ public void actionPerformed(ActionEvent arg0) } public static final MenuKeySet BUG = new MenuKeySet() { - + @Override public String getMenuName() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bug"); @@ -43,7 +42,7 @@ public void actionPerformed(ActionEvent arg0) @Override public char getMnemonic() { - + return 'U'; } }; diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java index 17ee23b530..74646ef922 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.locale.impl.BugNeedMark; import com.fr.design.menu.MenuKeySet; @@ -20,7 +20,7 @@ public class BugNeedAction extends UpdateAction { this.setMenuKeySet(BugAndNeed); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png")); + this.setSmallIcon("/com/fr/design/images/bbs/need"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java index 3ba97c0fc5..64288b9c91 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; @@ -17,7 +17,7 @@ public class CenterAction extends UpAction{ this.setMenuKeySet(CENTER); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/center.png")); + this.setSmallIcon("/com/fr/design/images/bbs/center"); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java b/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java index 9ab799bccd..192d921faf 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java @@ -1,10 +1,9 @@ package com.fr.design.actions.community; +import com.fr.base.svg.IconUtils; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.general.IOUtils; - import javax.swing.KeyStroke; import java.awt.event.ActionEvent; @@ -14,7 +13,7 @@ public class FacebookFansAction extends UpAction { this.setMenuKeySet(FACEBOOKFANS); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/facebook.png")); + this.setSmallIcon("/com/fr/design/images/bbs/facebook"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index c604e51d07..61834547f8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; @@ -18,7 +18,7 @@ public class NeedAction extends UpdateAction this.setMenuKeySet(NEED); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png")); + this.setSmallIcon("/com/fr/design/images/bbs/need"); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java index 9a19ef4cc9..94234b1bcf 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; @@ -16,7 +16,7 @@ public class QuestionAction extends UpdateAction { this.setMenuKeySet(QUESTIONS); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/question.png")); + this.setSmallIcon("/com/fr/design/images/bbs/question"); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java index c08619b23b..4944ecc3c1 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; @@ -19,8 +19,7 @@ public class SignAction extends UpdateAction this.setMenuKeySet(SIGN); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/sign.png")); - + this.setSmallIcon("/com/fr/design/images/bbs/sign"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java index a099216094..740ca23871 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.community; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; @@ -21,7 +21,7 @@ public class TechSolutionAction extends UpdateAction{ this.setMenuKeySet(TSO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/solution.png")); + this.setSmallIcon("/com/fr/design/images/bbs/solution"); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index f3cb21bc70..62ccf845ef 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -1,10 +1,10 @@ package com.fr.design.actions.community; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.locale.impl.VideoMark; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; -import com.fr.general.IOUtils; import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; @@ -20,8 +20,7 @@ public class VideoAction extends UpdateAction this.setMenuKeySet(VIDEO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/video.png")); - + this.setSmallIcon("/com/fr/design/images/bbs/video"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java index a311773745..65f1361762 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java @@ -3,7 +3,6 @@ */ package com.fr.design.actions.edit; -import com.fr.base.BaseUtils; import com.fr.design.actions.TemplateComponentAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.TargetComponent; @@ -22,7 +21,7 @@ public class CopyAction extends TemplateComponentAction { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy")); this.setMnemonic('C'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); + this.setSmallIcon("/com/fr/design/images/m_edit/copy"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); } @@ -32,4 +31,4 @@ public class CopyAction extends TemplateComponentAction { DesignModeContext.doCopy(getEditingComponent()); return false; } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java index c03d5d3de0..4da98d733d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java @@ -3,7 +3,6 @@ */ package com.fr.design.actions.edit; -import com.fr.base.BaseUtils; import com.fr.design.actions.TemplateComponentAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.TargetComponent; @@ -26,7 +25,7 @@ public class CutAction extends TemplateComponentAction { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); this.setMnemonic('T'); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); + this.setSmallIcon("/com/fr/design/images/m_edit/cut"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); } @@ -35,4 +34,4 @@ public class CutAction extends TemplateComponentAction { public boolean executeActionReturnUndoRecordNeeded() { return DesignModeContext.doCut(getEditingComponent()); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java index 6c8a9a5150..22093acb7a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java @@ -3,7 +3,6 @@ */ package com.fr.design.actions.edit; -import com.fr.base.BaseUtils; import com.fr.design.actions.TemplateComponentAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.TargetComponent; @@ -25,7 +24,7 @@ public class PasteAction extends TemplateComponentAction { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste")); this.setMnemonic('P'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); + this.setSmallIcon("/com/fr/design/images/m_edit/paste"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); } @@ -33,4 +32,4 @@ public class PasteAction extends TemplateComponentAction { public boolean executeActionReturnUndoRecordNeeded() { return DesignModeContext.doPaste(getEditingComponent()); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/RedoAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/RedoAction.java index 2d4c99d29e..abfd9c045c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/RedoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/RedoAction.java @@ -5,7 +5,6 @@ package com.fr.design.actions.edit; import java.awt.event.ActionEvent; -import com.fr.base.BaseUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.TemplateComponentActionInterface; import com.fr.design.actions.UpdateAction; @@ -23,7 +22,7 @@ public class RedoAction extends UpdateAction implements TemplateComponentActionI this.setMenuKeySet(KeySetUtils.REDO); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/redo.png")); + this.setSmallIcon("com/fr/design/images/m_edit/redo"); this.setAccelerator(getMenuKeySet().getKeyStroke()); } @@ -56,4 +55,4 @@ public class RedoAction extends UpdateAction implements TemplateComponentActionI } } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/UndoAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/UndoAction.java index d775ff9551..ff337620c9 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/UndoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/UndoAction.java @@ -5,7 +5,6 @@ package com.fr.design.actions.edit; import java.awt.event.ActionEvent; -import com.fr.base.BaseUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.TemplateComponentActionInterface; import com.fr.design.actions.UpdateAction; @@ -23,10 +22,10 @@ public class UndoAction extends UpdateAction implements TemplateComponentActionI this.setMenuKeySet(KeySetUtils.UNDO); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/undo.png")); + this.setSmallIcon("/com/fr/design/images/m_edit/undo"); this.setAccelerator(getMenuKeySet().getKeyStroke()); } - + @Override public JTemplate getEditingComponent() { return t; @@ -57,4 +56,4 @@ public class UndoAction extends UpdateAction implements TemplateComponentActionI } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/file/OpenTemplateAction.java b/designer-base/src/main/java/com/fr/design/actions/file/OpenTemplateAction.java index 091fb112a5..699119fe50 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/OpenTemplateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/OpenTemplateAction.java @@ -5,7 +5,7 @@ package com.fr.design.actions.file; import java.awt.event.ActionEvent; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.KeySetUtils; @@ -17,12 +17,12 @@ import com.fr.file.FILEChooserPane; * Open Template. */ public class OpenTemplateAction extends UpdateAction { - + public OpenTemplateAction() { this.setMenuKeySet(KeySetUtils.OPEN_TEMPLATE); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/open.png")); + this.setSmallIcon("/com/fr/design/images/buttonicon/open"); this.setAccelerator(getMenuKeySet().getKeyStroke()); } @@ -42,4 +42,4 @@ public class OpenTemplateAction extends UpdateAction { DesignerContext.getDesignerFrame().openTemplate(file); } } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java b/designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java index 5d2ab15705..a60b397628 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java @@ -5,7 +5,7 @@ package com.fr.design.actions.file; import java.awt.event.ActionEvent; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.JTemplateAction; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; @@ -20,7 +20,7 @@ public class SaveAsTemplateAction extends JTemplateAction> { this.setMenuKeySet(KeySetUtils.SAVE_AS_TEMPLATE); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/saveAs.png")); + this.setSmallIcon("/com/fr/design/images/m_file/saveAs"); } /** @@ -45,4 +45,4 @@ public class SaveAsTemplateAction extends JTemplateAction> { // 另存为按钮应该一直可用使用 this.setEnabled(true); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java b/designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java index de2cf1e427..920f5b41ae 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java @@ -5,7 +5,6 @@ package com.fr.design.actions.file; import java.awt.event.ActionEvent; -import com.fr.base.BaseUtils; import com.fr.design.actions.JTemplateAction; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; @@ -21,7 +20,7 @@ public class SaveTemplateAction extends JTemplateAction> { this.setMenuKeySet(KeySetUtils.SAVE_TEMPLATE); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/save.png")); + this.setSmallIcon("/com/fr/design/images/m_file/save"); this.setAccelerator(getMenuKeySet().getKeyStroke()); } @@ -42,4 +41,4 @@ public class SaveTemplateAction extends JTemplateAction> { this.setEnabled(!this.getEditingComponent().isSaved()); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index 1e222dd26c..bc88f72fd0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java @@ -1,6 +1,6 @@ package com.fr.design.actions.file; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.EnvChangeEntrance; import com.fr.design.actions.UpdateAction; @@ -21,11 +21,11 @@ public class SwitchExistEnv extends MenuDef { initMenuDef(); } - private void initMenuDef() { + private void initMenuDef() { Iterator nameIt = DesignerEnvManager.getEnvManager().getEnvNameIterator(); while (nameIt.hasNext()) { String name = nameIt.next(); - this.setIconPath("com/fr/design/images/m_file/switch.png"); + this.setIconPath("com/fr/design/images/m_file/switch"); this.addShortCut(new GetExistEnvAction(name)); } this.addShortCut(SeparatorDef.DEFAULT); @@ -42,11 +42,11 @@ public class SwitchExistEnv extends MenuDef { DesignerWorkspaceInfo env = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); switch (env.getType()) { case Local: { - this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/data/bind/localconnect.png")); + this.setSmallIcon("com/fr/design/images/data/bind/localconnect"); break; } case Remote: { - this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/data/bind/distanceconnect.png")); + this.setSmallIcon("com/fr/design/images/data/bind/distanceconnect"); break; } } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java index 5de31eb311..af0ea605f3 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java @@ -1,10 +1,10 @@ package com.fr.design.actions.help; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; -import com.fr.general.IOUtils; import com.fr.general.http.HttpToolbox; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; @@ -28,7 +28,7 @@ public class TutorialAction extends UpdateAction { this.setMenuKeySet(HELP_TUTORIAL); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/help.png")); + this.setSmallIcon("/com/fr/design/images/bbs/help"); this.setAccelerator(getMenuKeySet().getKeyStroke()); } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/WebDemoAction.java b/designer-base/src/main/java/com/fr/design/actions/help/WebDemoAction.java index 613982abdf..53ef796b34 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/WebDemoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/WebDemoAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.help; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; @@ -16,7 +16,7 @@ public class WebDemoAction extends UpdateAction { this.setMenuKeySet(PRODUCT_DEMO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_help/demo.png")); + this.setSmallIcon("/com/fr/design/images/m_help/demo"); } /** @@ -45,4 +45,4 @@ public class WebDemoAction extends UpdateAction { } }; -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineAction.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineAction.java index f78d341a53..3dc951578a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineAction.java @@ -1,5 +1,6 @@ package com.fr.design.actions.help.alphafine; +import com.fr.base.svg.SVGIcon; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; @@ -8,7 +9,6 @@ import com.fr.design.dialog.DialogActionListener; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.menu.MenuKeySet; -import com.fr.general.IOUtils; import javax.swing.KeyStroke; import java.awt.event.ActionEvent; @@ -21,7 +21,7 @@ public class AlphaFineAction extends UpdateAction { this.setMenuKeySet(ALPHAFINE); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png")); + this.setSmallIcon("com/fr/design/mainframe/alphafine/images/smallsearch"); this.generateAndSetSearchText(AlphaFineConfigPane.class.getName()); } diff --git a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java index 50ecd0ea6d..820de79e5e 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java @@ -1,5 +1,6 @@ package com.fr.design.actions.server; +import com.fr.base.svg.IconUtils; import com.fr.data.impl.Connection; import com.fr.design.actions.UpdateAction; import com.fr.design.data.datapane.connect.ConnectionShowPane; @@ -11,7 +12,6 @@ import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.design.os.impl.DatabaseDialogAction; import com.fr.file.ConnectionConfig; -import com.fr.general.IOUtils; import javax.swing.*; import java.awt.event.ActionEvent; @@ -26,7 +26,7 @@ public class ConnectionListAction extends UpdateAction { this.setMenuKeySet(DEFINE_DATA_CONNECTION); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/connection.png")); + this.setSmallIcon("/com/fr/design/images/m_web/connection"); this.generateAndSetSearchText(DatabaseConnectionPane.JDBC.class.getName()); } @@ -96,4 +96,4 @@ public class ConnectionListAction extends UpdateAction { public void update() { this.setEnabled(true); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java b/designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java index bbc324ffda..d7f1cdbb7a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java @@ -4,6 +4,7 @@ package com.fr.design.actions.server; +import com.fr.base.svg.IconUtils; import com.fr.config.Configuration; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; @@ -12,7 +13,6 @@ import com.fr.design.formula.FunctionManagerPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.MenuKeySet; import com.fr.file.FunctionConfig; -import com.fr.general.IOUtils; import com.fr.transaction.Configurations; import com.fr.transaction.Worker; @@ -29,7 +29,7 @@ public class FunctionManagerAction extends UpdateAction { this.setMenuKeySet(FUNCTION_MANAGER); this.setName(getMenuKeySet().getMenuKeySetName()+"..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/function.png")); + this.setSmallIcon("/com/fr/design/images/m_web/function"); this.generateAndSetSearchText(FunctionManagerPane.class.getName()); } @@ -63,7 +63,7 @@ public class FunctionManagerAction extends UpdateAction { functionManagerPane.populate(mirror); functionManagerDialog.setVisible(true); } - + public void update() { this.setEnabled(true); } @@ -84,4 +84,4 @@ public class FunctionManagerAction extends UpdateAction { return null; } }; -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java index c546129e95..d3f035972c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java @@ -3,8 +3,8 @@ */ package com.fr.design.actions.server; -import com.fr.base.BaseUtils; import com.fr.base.ParameterConfig; +import com.fr.base.svg.IconUtils; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.actions.UpdateAction; @@ -31,7 +31,7 @@ public class GlobalParameterAction extends UpdateAction { this.setMenuKeySet(GLOBAL_PARAMETER); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.png")); + this.setSmallIcon("/com/fr/design/images/m_report/p"); } /** @@ -91,4 +91,4 @@ public class GlobalParameterAction extends UpdateAction { return null; } }; -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java index 627a862fb6..468fb1f98d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java @@ -3,8 +3,8 @@ */ package com.fr.design.actions.server; -import com.fr.base.BaseUtils; import com.fr.base.TableData; +import com.fr.base.svg.IconUtils; import com.fr.design.DesignModelAdapter; import com.fr.design.actions.UpdateAction; import com.fr.design.data.DesignTableDataManager; @@ -40,7 +40,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS this.setMenuKeySet(SERVER_TABLEDATA); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/dock/serverdatabase.png")); + this.setSmallIcon("/com/fr/design/images/data/dock/serverdatabase"); } public static final MenuKeySet SERVER_TABLEDATA = new MenuKeySet() { @@ -70,7 +70,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS final TableDataConfig tableDataConfig = TableDataConfig.getInstance(); final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { public void complete() { - + TableDataConfig mirror = tableDataConfig.mirror(); populate(mirror); } @@ -166,4 +166,4 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS public void fireDSChanged(Map map) { DesignTableDataManager.fireDSChanged(map); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java b/designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java index 5f364303a7..f62327ad9a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.server; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.DesignUtils; @@ -14,7 +14,7 @@ public class PlatformManagerAction extends UpdateAction { this.setMenuKeySet(PLATEFORM_MANAGER); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/server/platform_16_16.png")); + this.setSmallIcon("/com/fr/design/images/server/platform_16_16"); } /** @@ -41,4 +41,4 @@ public class PlatformManagerAction extends UpdateAction { return null; } }; -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java b/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java index d000dbbbb0..bb9339568c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java @@ -1,9 +1,9 @@ package com.fr.design.actions.server; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.design.os.impl.PMDialogAction; -import com.fr.general.IOUtils; import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; @@ -20,7 +20,7 @@ public class PluginManagerAction extends UpdateAction { this.setMenuKeySet(PLUGIN_MANAGER); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/server/plugin.png")); + this.setSmallIcon("/com/fr/design/images/server/plugin"); } @Override public void actionPerformed(ActionEvent e) { @@ -45,4 +45,4 @@ public class PluginManagerAction extends UpdateAction { return null; } }; -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index 93dc57a8f4..8887f79866 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -3,6 +3,7 @@ */ package com.fr.design.constants; +import com.fr.base.svg.IconUtils; import com.fr.general.IOUtils; import com.fr.stable.Constants; @@ -179,6 +180,7 @@ public interface UIConstants { public static final Icon YES_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/yes.png"); public static final Icon CHOOSEN_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/select_item.png"); public static final Icon PRE_WIDGET_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/prewidget.png"); + public static final Icon PRE_WIDGET_NORMAL_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/prewidget"); public static final Icon EDIT_NORMAL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/editn.png"); public static final Icon EDIT_PRESSED_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/editp.png"); public static final Icon HIDE_NORMAL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/hiden.png"); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java index 3241e0588b..1cba4df966 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java @@ -1 +1 @@ -package com.fr.design.data.datapane.sqlpane; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.Point; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetContext; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FineLoggerFactory.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file +package com.fr.design.data.datapane.sqlpane; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.Point; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetContext; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FineLoggerFactory.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java index e3bf61e9dc..71289376a0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java +++ b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java @@ -1,6 +1,7 @@ package com.fr.design.gui.core; import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.form.ui.*; import com.fr.general.ComparatorUtils; @@ -127,27 +128,27 @@ public abstract class WidgetOption implements Serializable { } public static final WidgetOption DATEEDITOR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Date"), - BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/date_16.png"), + "/com/fr/design/images/buttonicon/widget/date_16", DateEditor.class); public static final WidgetOption TREE = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_View_Tree"), - BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/tree_16.png"), TreeEditor.class); + "/com/fr/design/images/buttonicon/widget/tree_16", TreeEditor.class); - public static final WidgetOption TREECOMBOBOX = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_ComboBox"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/comboboxtree.png"), + public static final WidgetOption TREECOMBOBOX = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_ComboBox"), "/com/fr/design/images/buttonicon/widget/comboboxtree16", TreeComboBoxEditor.class); public static final WidgetOption CHECKBOXGROUP = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox_Group"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/checkbox_group_16.png"), CheckBoxGroup.class); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox_Group"), "/com/fr/design/images/buttonicon/widget/checkbox_group_16", CheckBoxGroup.class); public static final WidgetOption RADIOGROUP = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Radio_Group"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_group_16.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Radio_Group"), "/com/fr/design/images/buttonicon/widget/button_group_16", RadioGroup.class); public static final WidgetOption NUMBEREDITOR = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Number"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/number_field_16.png"), NumberEditor.class); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Number"), "/com/fr/design/images/buttonicon/widget/number_field_16", NumberEditor.class); public static final WidgetOption LABEL = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Label"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/label_16.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Label"), "/com/fr/design/images/buttonicon/widget/label_16", Label.class); public static final WidgetOption BUTTON = WidgetOptionFactory.createByWidgetClass( @@ -155,23 +156,23 @@ public abstract class WidgetOption implements Serializable { Button.class); public static final WidgetOption FREEBUTTON = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Button"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_16.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Button"), "/com/fr/design/images/buttonicon/widget/button_16", FreeButton.class); public static final WidgetOption MULTI_FILEEDITOR = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_File"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/files_up.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_File"), "/com/fr/design/images/buttonicon/widget/files_up", MultiFileEditor.class); public static final WidgetOption COMBOBOX = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Box"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/combo_box_16.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Box"), "/com/fr/design/images/buttonicon/widget/combo_box_16", ComboBox.class); public static final WidgetOption COMBOCHECKBOX = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Checkbox"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/combo_check_16.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Checkbox"), "/com/fr/design/images/buttonicon/widget/combo_check_16", ComboCheckBox.class); public static final WidgetOption CHECKBOX = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/check_box_16.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox"), "/com/fr/design/images/buttonicon/widget/check_box_16", CheckBox.class); public static final WidgetOption LIST = WidgetOptionFactory.createByWidgetClass( @@ -181,16 +182,16 @@ public abstract class WidgetOption implements Serializable { public static final WidgetOption TEXTEDITOR = WidgetOptionFactory.createByWidgetClass( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Text") - , BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/text_field_16.png"), + , "/com/fr/design/images/buttonicon/widget/text_field_16", TextEditor.class); public static final WidgetOption TEXTAREA = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Textarea"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/text_area_16.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Textarea"), "/com/fr/design/images/buttonicon/widget/text_area_16", TextArea.class); public static final WidgetOption PASSWORD = WidgetOptionFactory.createByWidgetClass( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Password"), - BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/password_field_16.png"), Password.class); + "/com/fr/design/images/buttonicon/widget/password_field_16", Password.class); public static final WidgetOption IFRAMEDITOR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Form_Iframe"), BaseUtils.readIcon("/com/fr/web/images/form/resources/iframe_16.png"), IframeEditor.class); diff --git a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOptionFactory.java b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOptionFactory.java index 0266d9eb97..e9ba427880 100644 --- a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOptionFactory.java +++ b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOptionFactory.java @@ -1,6 +1,7 @@ package com.fr.design.gui.core; import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.form.ui.Widget; import javax.swing.*; @@ -14,4 +15,9 @@ public class WidgetOptionFactory { public static WidgetOption createByWidgetClass(String optionName, Icon optionIcon, Class widgetClass) { return new CustomWidgetOption(optionName, optionIcon, widgetClass); } -} \ No newline at end of file + + public static WidgetOption createByWidgetClass(String optionName, String resource, Class widgetClass) { + Icon optionIcon = IconUtils.readIcon(resource); + return new CustomWidgetOption(optionName, optionIcon, widgetClass); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java index 32f20ad563..335397d908 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java @@ -3,6 +3,7 @@ package com.fr.design.gui.ibutton; import com.fr.base.BaseUtils; import com.fr.base.CellBorderStyle; import com.fr.base.GraphHelper; +import com.fr.base.svg.IconUtils; import com.fr.design.constants.UIConstants; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; @@ -97,6 +98,14 @@ public class UIButton extends JButton implements UIObserver, UITextComponent { initListener(); } + public UIButton(String resource, boolean needSetDisabledIcon) { + super(IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_NORMAL)); + if (needSetDisabledIcon) { + this.setDisabledIcon(IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED)); + } + init(); + } + protected void initListener() { if (shouldResponseChangeListener()) { this.addActionListener(new ActionListener() { @@ -388,4 +397,4 @@ public class UIButton extends JButton implements UIObserver, UITextComponent { public boolean shouldResponseChangeListener() { return true; } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java b/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java index e01aa5251a..e3802161b1 100644 --- a/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java +++ b/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java @@ -26,7 +26,7 @@ public class IconPathConstants { public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png"; public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png"; - public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/tab/remove.png"; + public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/remove.png"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 83120e4fb0..d2771cd491 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -316,7 +316,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public NewFolderAction() { this.setName(KeySetUtils.NEW_FOLDER.getMenuKeySetName()); - this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/icon_NewFolderIcon_normal.png")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/new_folder"); } @Override @@ -342,7 +342,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private class VcsAction extends UpdateAction { public VcsAction() { - this.setSmallIcon(VcsHelper.VCS_LIST_PNG); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/vcs_list"); } @Override @@ -424,7 +424,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public ShowInExplorerAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Show_In_Containing_Folder")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/view_folder.png")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/view_folder"); } @Override @@ -441,7 +441,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public RefreshTreeAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh")); - this.setSmallIcon(UIConstants.REFRESH_ICON); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/refresh"); } @Override @@ -459,7 +459,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public RenameAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Rename")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/source/rename.png")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/rename"); } @Override @@ -498,7 +498,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public DelFileAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Remove")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/source/delete.png")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/remove"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 4c908940a1..76422555fd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1,7 +1,8 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.base.FRContext; + +import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -701,9 +702,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { // 完整icon路径为 ICON_BASE_DIR + btnIconName + iconSuffix private static final String ICON_BASE_DIR = "/com/fr/design/images/buttonicon/propertiestab/"; - private static final String ICON_SUFFIX_NORMAL = "_normal.png"; - private static final String ICON_SUFFIX_DISABLED = "_disabled.png"; - private static final String ICON_SUFFIX_SELECTED = "_selected.png"; + private static final String ICON_SUFFIX_NORMAL = "_normal.svg"; + private static final String ICON_SUFFIX_DISABLED = "_disabled.svg"; + private static final String ICON_SUFFIX_SELECTED = "_selected.svg"; + private static final int ICON_WIDTH = 18; + private static final int ICON_HEIGHT = 18; private String btnIconName; private String iconBaseDir; private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一 @@ -888,7 +891,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void resetButtonIcon() { if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) { iconSuffix = ICON_SUFFIX_NORMAL; - button.setIcon(BaseUtils.readIcon(getBtnIconUrl())); + button.setIcon(IconUtils.readIcon(getBtnIconUrl())); button.setBackground(originBtnBackground); button.setOpaque(false); } @@ -897,7 +900,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void setTabButtonSelected() { resetPropertyIcons(); iconSuffix = ICON_SUFFIX_SELECTED; - button.setIcon(BaseUtils.readIcon(getBtnIconUrl())); + button.setIcon(IconUtils.readIcon(getBtnIconUrl())); button.setBackground(selectedBtnBackground); button.setOpaque(true); selectedItem = this; @@ -908,7 +911,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private void initButton() { - button = new UIButton(BaseUtils.readIcon(getBtnIconUrl())) { + button = new UIButton(IconUtils.readIcon(getBtnIconUrl())) { public Dimension getPreferredSize() { return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT); } @@ -921,6 +924,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } } }; + button.setDisabledIcon(IconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED)); button.set4LargeToolbarButton(); button.setUI(new UIButtonUI() { @Override diff --git a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java index 10f9944947..f2ed81394b 100644 --- a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java @@ -1,6 +1,6 @@ package com.fr.design.menu; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.*; import com.fr.design.gui.iscrollbar.UIScrollBar; @@ -141,7 +141,7 @@ public class MenuDef extends ShortCut { addShortCut(i); } } - + public void addShortCut(ShortCut shortCut) { this.shortcutList.add(shortCut); } @@ -166,7 +166,7 @@ public class MenuDef extends ShortCut { public UIButton createUIButton() { if (createdButton == null) { if (iconPath != null) { - createdButton = new UIButton(BaseUtils.readIcon(iconPath)); + createdButton = new UIButton(IconUtils.readIcon(iconPath)); createdButton.set4ToolbarButton(); } else { createdButton = new UIButton(name); @@ -194,7 +194,7 @@ public class MenuDef extends ShortCut { createdJMenu = createJMenu0(); createdJMenu.setMnemonic(this.getMnemonic()); if (this.iconPath != null) { - createdJMenu.setIcon(BaseUtils.readIcon(this.iconPath)); + createdJMenu.setIcon(IconUtils.readIcon(iconPath)); } MenuListener menuListener = createMenuListener(); createdJMenu.addMenuListener(menuListener); @@ -206,9 +206,9 @@ public class MenuDef extends ShortCut { return createdJMenu; } - + protected UIMenu createJMenu0() { - + UIMenu createdJMenu; if (hasScrollSubMenu) { createdJMenu = new UIScrollMenu(this.getName()); @@ -219,7 +219,7 @@ public class MenuDef extends ShortCut { } return createdJMenu; } - + protected ContainerListener getContainerListener() { return null; } @@ -389,9 +389,9 @@ public class MenuDef extends ShortCut { public void intoJToolBar(JToolBar toolBar) { toolBar.add(this.createUIButton()); } - + protected MenuListener createMenuListener() { - + return menuDefListener; } @@ -456,4 +456,4 @@ public class MenuDef extends ShortCut { } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java b/designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java index f48cb12edf..30112dc7a3 100644 --- a/designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java +++ b/designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java @@ -1,6 +1,6 @@ package com.fr.design.remote.action; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -27,7 +27,7 @@ public class RemoteDesignAuthManagerAction extends UpdateAction { public RemoteDesignAuthManagerAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Authority_Manager")); // 远程设计权限管理 - this.setSmallIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Remote_Design_Auth_Manager_normal@1x.png")); + this.setSmallIcon("com/fr/design/remote/images/icon_Remote_Design_Auth_Manager_normal@1x"); } 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 06770c1b4b..ae0cfd2b65 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 @@ -1,5 +1,6 @@ package com.fr.design.report.fit.menupane; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.JTemplateAction; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; @@ -8,7 +9,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; -import com.fr.general.IOUtils; import com.fr.report.fit.FitProvider; import com.fr.report.fit.ReportFitAttr; @@ -66,7 +66,7 @@ public class ReportFitAttrAction extends JTemplateAction { } this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/reportfit/fit.png")); + this.setSmallIcon("/com/fr/design/images/reportfit/fit"); } /** diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java b/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java index 65f66290ec..f393b1a09c 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java @@ -181,7 +181,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo } private void initbuttonGroup() { - + Icon[] iconArray = new Icon[]{BaseUtils.readIcon("/com/fr/web/images/platform/demo.png")}; String[] textArray = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name")}; buttonGroup = new UIHeadGroup(iconArray, textArray) { @@ -254,7 +254,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo public RefreshAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh")); - this.setSmallIcon(UIConstants.REFRESH_ICON); + this.setSmallIcon("/com/fr/design/images/buttonicon/refresh"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java index 9066b4a901..9a8640f627 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java +++ b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java @@ -3,7 +3,8 @@ */ package com.fr.design.style.color; -import com.fr.base.BaseUtils; + +import com.fr.base.svg.IconUtils; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButton; @@ -34,7 +35,7 @@ public class UIToolbarColorButton extends UICombinationButton implements PopupHi private UIObserverListener uiObserverListener; public UIToolbarColorButton(Icon icon) { - super(new UIColorButton(icon), new UIButton(BaseUtils.readIcon("/com/fr/design/images/gui/popup.gif"))); + super(new UIColorButton(icon), new UIButton(IconUtils.readIcon("/com/fr/design/images/gui/popup"))); getLeftButton().setEventBanned(true); getRightButton().addFocusListener(new FocusListener() { @@ -244,4 +245,4 @@ public class UIToolbarColorButton extends UICombinationButton implements PopupHi public boolean shouldResponseChangeListener() { return true; } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/update/actions/SoftwareUpdateAction.java b/designer-base/src/main/java/com/fr/design/update/actions/SoftwareUpdateAction.java index d65d8fec58..2b768d995b 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/SoftwareUpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/SoftwareUpdateAction.java @@ -1,6 +1,6 @@ package com.fr.design.update.actions; -import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.os.impl.UpdateDialogAction; import com.fr.stable.os.support.OSBasedAction; @@ -15,7 +15,7 @@ public class SoftwareUpdateAction extends UpdateAction { public SoftwareUpdateAction() { setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_UpdateAndUpgrade")); - setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update/update_new.png")); + setSmallIcon("/com/fr/design/images/update/update_new"); } diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..9ea75fc6d857fef4e30a72519a4afd56ac7d0759 GIT binary patch literal 288 zcmV+*0pI?KP)Px#+DSw~R5%gEQZWv~Fbs4MVnN~&NHDM_p?`o*d;oU-!9REbQ$B&n3KD#!jd9YZ zL{^Iw7P8d7JD;680RKK>Xn>+9W_9gOhd_UWW_n3Ypv)08z%4pKh|E)B%07QE@ZUiymM#>D+As)0WaWr ztQm14H_tYZQa{rs*#@+cg*TuTh9~fYLE8Vz7E)O=cGKD8@dwfyc?I1ENXzPx$%t=H+R5%g6QZYyyQ5gQ;<(i5hVhE)sp%Ii&P!}(O++o4NC8(1myHh7o5ZCHx z=^_$3b}VQ>hwPd~tvNC{h(oE3LWqPQxHWh2p5JTx9|=O}ApPOp_uv12-}nA^_lW*? zq*AG^WHR}c_tiP+M8mK~g=oJg@+>JSB!p-PL5I4o=N-qL0QU{^HBK0@!xE8mE~U3F zr5J+vT1px7Jh=h!5Add#tFX%eqpgGZ1)^_6eep`g9-p6|o5SvTtbOnYv4)k9!#{#$ zS@BlO*(4GNwq0I?iBzOwu@nNJ{#y)CAuj(Qk#B(UHc<3}L4BFUid3nTnmEExE|>GC zEffk5PYh6)#h9mv8aEmL8u}uxEA(Bl%PV}e@14zm$$bNm@38#e(@UIAr$;iG%uB`b z4KU^jk$h(u3;n&srfH73Zu_FqXyTr97)YsY<9$Gg`c5wc$7$!$cXeIcRlER`>-E}A zEEau%o3|Q`MqVcpiQ{Uu`iuL9F%ynN!h3knXqs3nm&+y96Y9Z{&1M5vSJjXB8!M>Y z<49+q{6zj1AKAn)HT2eO+y2a&E(0zahB+yO`vKx<2-QWpMSi4d^a-4Q2+n{ literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png new file mode 100644 index 0000000000000000000000000000000000000000..6fb2baac51ead86742e20545aa0a62413be50b12 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|5K|k5|2~(;g&RwlQDDH z6mGYiaof(gobd%$;YW8~2X4ulg}lLC>)IYUq%_XtS$r|Kq4RPN8^beAv5Lrm+Yvy^ O7(8A5T-G@yGywp$2|2L< literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png new file mode 100644 index 0000000000000000000000000000000000000000..5c244dd5d48b170673b7027067115be464b40e92 GIT binary patch literal 433 zcmV;i0Z#sjP)Px$Ye_^wR5%f}Qaw+@Fc7tykJ5z=u@trJWWk_>pbWr&VdbYFR{jPv5h5Z|1Ys#V zkzgttLxY+Gb1$teD?=oNI4SY-^WDqyT^RdgaI@a`{mm@PK7}}t;Pd>6D-Qc02&P!g z&;mjnUUAOOMx%|B#iE=eX*hJZm&+=alHKO{;{^#9W-;MOD}b*w&G&yu00IZ}>Uc4phw4jy1|IO`Up4$(SLcLsq%N`??4XXCnV-hdJ4 z$qKFB+JQ;_7Hh>Qinhw~>zM>*bl-CbQD3fU@#qTsNs@ekGebK-6RDWG-8RpI?X`6e z9L|tq7AtH6pg}aom>R~-F}kiJ)?P&q;zd4vnygHB%WHVnfFdAXsHPLZgm05!+4cl)Z9ZIy?;DNytk b|J&IQ*9Ev-ia$+h00000NkvXXu0mjf!mPe( literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png new file mode 100644 index 0000000000000000000000000000000000000000..df6cd02de67c069a372e1342661652a8c9673956 GIT binary patch literal 286 zcmV+(0pb3MP)Px#*hxe|R5%f(Qtc7KAPfbsW9Sq_ox!??Lv;|H!IMs*dte_nxfn|2PW~kCgFph# z)mI3VMEwH7RuiKAlf`0dL9jDNy_E%U8wM$*E$1A;iNSmSVu2$#4}em-0)!YJJ2tjO zqGPX}Aso&b6VYk4zg2N6AzkS5Iu}Fr4ogR9uJhjYnm~DQd`un`14MK+Sq42gtt0){&T49(8_T?t=RJO_5M$2~~aNTjdU#-}JWy~$+B~QMA7BFG^`?QXH9-_QN k{;t1ffX|1*w%FhJ4RGa2%S^h7EC2ui07*qoM6N<$f~l)@dH?_b literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..4d16dc7aea783ce693256d5f013d9de8f7f5c8da GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|x;$MRLo5WB zPQJ+7pupo2{n)L9>-$m76tyjCzUQ_n3jTP>SpNP;V@Bb|jw|kDKe9mmQ z&9`%I6z%!cB;Leu<(k2)SNHcSHg750`2D6G!-Y8qbux?@-Z-fr`XE!vkg`@efMJ1U zbK>q-3=YgNp$qH}dL?;ohw9fZQ;)a(@ckd#bS`~OzPrbrfv#fkboFyt=akR{02Z)O ANdN!< literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/bbs_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/bbs_normal.svg new file mode 100644 index 0000000000..ae72bfa4db --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/bbs_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/首页_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/bug_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/bug_normal.svg new file mode 100644 index 0000000000..5212ea9b91 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/bug_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/bug反馈_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/center_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/center_normal.svg new file mode 100644 index 0000000000..659f84062a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/center_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/活动中心_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/facebook_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/facebook_normal.svg new file mode 100644 index 0000000000..3e229e01ae --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/facebook_normal.svg @@ -0,0 +1,9 @@ + + + icon_facebook粉丝圈_normal + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/help_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/help_normal.svg new file mode 100644 index 0000000000..56473312bf --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/help_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/帮助文档_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/need_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/need_normal.svg new file mode 100644 index 0000000000..04bccffda3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/need_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/需求反馈_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/question_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/question_normal.svg new file mode 100644 index 0000000000..27005769cc --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/question_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/问题求助_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/sign_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/sign_normal.svg new file mode 100644 index 0000000000..4054250809 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/sign_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/报表工程师认证_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/solution_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/solution_normal.svg new file mode 100644 index 0000000000..ce4e0789bb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/solution_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/技术方案_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/video_normal.svg b/designer-base/src/main/resources/com/fr/design/images/bbs/video_normal.svg new file mode 100644 index 0000000000..659581e0dc --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/bbs/video_normal.svg @@ -0,0 +1,7 @@ + + + icon/社区/视频教程_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/absolute_layout_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/absolute_layout_normal.svg new file mode 100644 index 0000000000..55c093fb42 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/absolute_layout_normal.svg @@ -0,0 +1,7 @@ + + + icon_绝对画薄块_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg new file mode 100644 index 0000000000..8df1897cd1 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_tab块_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/new_form3_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/new_form3_normal.svg new file mode 100644 index 0000000000..41fa6afa64 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/new_form3_normal.svg @@ -0,0 +1,8 @@ + + + icon_新建表单_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/newcpts_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/newcpts_normal.svg new file mode 100644 index 0000000000..587d4963b5 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/newcpts_normal.svg @@ -0,0 +1,11 @@ + + + icon_标签栏_工作簿_normal + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/open_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/open_normal.svg new file mode 100644 index 0000000000..68f2cb3d14 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/open_normal.svg @@ -0,0 +1,7 @@ + + + icon_导入文件_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_disabled.svg new file mode 100644 index 0000000000..7df1acf348 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_disabled.svg @@ -0,0 +1,8 @@ + + + icon_属性_权限编辑_disabled + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_normal.svg new file mode 100644 index 0000000000..b7000e6f96 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_权限编辑_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_selected.svg new file mode 100644 index 0000000000..e70df0a896 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/authorityedit_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_权限编辑_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_disabled.svg new file mode 100644 index 0000000000..bf79dfdbf6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_单元格属性_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_normal.svg new file mode 100644 index 0000000000..ca05aca236 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_单元格属性_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_selected.svg new file mode 100644 index 0000000000..bf0af1df1a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellattr_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_单元格属性_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_disabled.svg new file mode 100644 index 0000000000..f839505353 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_单元格元素_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_normal.svg new file mode 100644 index 0000000000..32256c90fb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_单元格元素_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_selected.svg new file mode 100644 index 0000000000..e5c0423676 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/cellelement_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_单元格元素_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_disabled.svg new file mode 100644 index 0000000000..a7d31cd63e --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_条件属性_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_normal.svg new file mode 100644 index 0000000000..48655aa194 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_条件属性_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_selected.svg new file mode 100644 index 0000000000..8d8e798466 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/conditionattr_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_条件属性_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_disabled.svg new file mode 100644 index 0000000000..61a2c84fea --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_配置角色_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_normal.svg new file mode 100644 index 0000000000..972f102b1d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_配置角色_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_selected.svg new file mode 100644 index 0000000000..74eef28bb3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/configuredroles_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_配置角色_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_disabled.svg new file mode 100644 index 0000000000..edf86bce7d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_悬浮元素_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_normal.svg new file mode 100644 index 0000000000..c98ec8852e --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_悬浮元素_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_selected.svg new file mode 100644 index 0000000000..517c3c1aa3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/floatelement_selected.svg @@ -0,0 +1,8 @@ + + + icon_属性_悬浮元素_selected + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_disabled.svg new file mode 100644 index 0000000000..56c05df4cf --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_超级链接_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_normal.svg new file mode 100644 index 0000000000..9d50a6616d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_超级链接_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_selected.svg new file mode 100644 index 0000000000..1c3dd78f7f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/hyperlink_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_超级链接_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_disabled.svg new file mode 100644 index 0000000000..4e5ad7a64d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_组件库_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_normal.svg new file mode 100644 index 0000000000..a5848ed13c --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_组件库_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_selected.svg new file mode 100644 index 0000000000..48dc61a997 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetlib_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_组件库_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_disabled.svg new file mode 100644 index 0000000000..e461edef65 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_控件设置_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_normal.svg new file mode 100644 index 0000000000..9f7c629ad1 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_控件设置_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_selected.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_selected.svg new file mode 100644 index 0000000000..fe17b80623 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/propertiestab/widgetsettings_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_控件设置_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/redo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/redo_disabled.svg new file mode 100644 index 0000000000..ae600230cd --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/redo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_重做_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/redo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/redo_normal.svg new file mode 100644 index 0000000000..8c26e8925f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/redo_normal.svg @@ -0,0 +1,7 @@ + + + icon_重做_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/report_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/report_16_normal.svg new file mode 100644 index 0000000000..2fef231c44 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/report_16_normal.svg @@ -0,0 +1,10 @@ + + + icon_报表块_normal + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/save_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/save_disabled.svg new file mode 100644 index 0000000000..99087a805b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/save_disabled.svg @@ -0,0 +1,12 @@ + + + icon_保存_disabled + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/save_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/save_normal.svg new file mode 100644 index 0000000000..f1caf5d1e7 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/save_normal.svg @@ -0,0 +1,12 @@ + + + icon_保存_normal + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/undo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/undo_disabled.svg new file mode 100644 index 0000000000..24c5cd7c93 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/undo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_撤销_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/undo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/undo_normal.svg new file mode 100644 index 0000000000..d36032371a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/undo_normal.svg @@ -0,0 +1,7 @@ + + + icon_撤销_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/button_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/button_16_normal.svg new file mode 100644 index 0000000000..0075e9b27d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/button_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_按钮_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/button_group_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/button_group_16_normal.svg new file mode 100644 index 0000000000..847399b276 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/button_group_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_单选框组_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/check_box_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/check_box_16_normal.svg new file mode 100644 index 0000000000..9018cbd653 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/check_box_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_复选框_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/checkbox_group_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/checkbox_group_16_normal.svg new file mode 100644 index 0000000000..18cdfb342d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/checkbox_group_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_复选框组_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_box_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_box_16_normal.svg new file mode 100644 index 0000000000..cbb7c39068 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_box_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_下拉框_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_check_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_check_16_normal.svg new file mode 100644 index 0000000000..3c5cf474c3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_check_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_下拉复选框_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg new file mode 100644 index 0000000000..8c32ce6a68 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_下拉树_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/date_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/date_16_normal.svg new file mode 100644 index 0000000000..0c77109219 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/date_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_日期_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/label_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/label_16_normal.svg new file mode 100644 index 0000000000..eab538ae95 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/label_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_标签_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/number_field_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/number_field_16_normal.svg new file mode 100644 index 0000000000..171842baa8 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/number_field_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_数字_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/password_field_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/password_field_16_normal.svg new file mode 100644 index 0000000000..6a0c47b4b3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/password_field_16_normal.svg @@ -0,0 +1,8 @@ + + + icon_控件_密码_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/text_area_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/text_area_16_normal.svg new file mode 100644 index 0000000000..b576394acf --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/text_area_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_文本域_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/text_field_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/text_field_16_normal.svg new file mode 100644 index 0000000000..04d51b5b2d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/text_field_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_文本框_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/tree_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/tree_16_normal.svg new file mode 100644 index 0000000000..342e0fa963 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/tree_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_控件_目录树_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/chart/ChartType_normal.svg b/designer-base/src/main/resources/com/fr/design/images/chart/ChartType_normal.svg new file mode 100644 index 0000000000..a58a7e161d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/chart/ChartType_normal.svg @@ -0,0 +1,9 @@ + + + icon_图表预定义配色_normal + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/data/bind/distanceconnect_normal.svg b/designer-base/src/main/resources/com/fr/design/images/data/bind/distanceconnect_normal.svg new file mode 100644 index 0000000000..93bcbdb40c --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/data/bind/distanceconnect_normal.svg @@ -0,0 +1,10 @@ + + + icon_distanceconnect_normal + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/data/bind/localconnect_normal.svg b/designer-base/src/main/resources/com/fr/design/images/data/bind/localconnect_normal.svg new file mode 100644 index 0000000000..d5a4717d24 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/data/bind/localconnect_normal.svg @@ -0,0 +1,8 @@ + + + icon_HomeFolderIcon_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/data/dock/serverdatabase_normal.svg b/designer-base/src/main/resources/com/fr/design/images/data/dock/serverdatabase_normal.svg new file mode 100644 index 0000000000..5822e894e7 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/data/dock/serverdatabase_normal.svg @@ -0,0 +1,13 @@ + + + icon_服务器数据集_normal + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/data/source/dataDictionary_normal.svg b/designer-base/src/main/resources/com/fr/design/images/data/source/dataDictionary_normal.svg new file mode 100644 index 0000000000..7885f3e34b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/data/source/dataDictionary_normal.svg @@ -0,0 +1,7 @@ + + + icon_形态_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/edit/redo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/edit/redo_disabled.svg new file mode 100644 index 0000000000..ae600230cd --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/edit/redo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_重做_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/edit/redo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/edit/redo_normal.svg new file mode 100644 index 0000000000..b15749b41d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/edit/redo_normal.svg @@ -0,0 +1,7 @@ + + + icon_重做_下拉列表用 + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/edit/undo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/edit/undo_disabled.svg new file mode 100644 index 0000000000..24c5cd7c93 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/edit/undo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_撤销_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/edit/undo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/edit/undo_normal.svg new file mode 100644 index 0000000000..0e49c799e6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/edit/undo_normal.svg @@ -0,0 +1,7 @@ + + + icon_撤销_下拉列表用 + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/expand/cellAttr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/expand/cellAttr_normal.svg new file mode 100644 index 0000000000..fb0a350ddb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/expand/cellAttr_normal.svg @@ -0,0 +1,7 @@ + + + icon_扩展_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/gui/color/background_normal.svg b/designer-base/src/main/resources/com/fr/design/images/gui/color/background_normal.svg new file mode 100644 index 0000000000..c4714560ce --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/gui/color/background_normal.svg @@ -0,0 +1,8 @@ + + + icon_文本背景色_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/gui/color/foreground_normal.svg b/designer-base/src/main/resources/com/fr/design/images/gui/color/foreground_normal.svg new file mode 100644 index 0000000000..0eaa40e93a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/gui/color/foreground_normal.svg @@ -0,0 +1,7 @@ + + + icon_文本前景色_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/gui/popup_normal.svg b/designer-base/src/main/resources/com/fr/design/images/gui/popup_normal.svg new file mode 100644 index 0000000000..6d64eb7a70 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/gui/popup_normal.svg @@ -0,0 +1,7 @@ + + + icon_组件分隔_箭头下_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/copy_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/copy_disabled.svg new file mode 100644 index 0000000000..05585d3abd --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/copy_disabled.svg @@ -0,0 +1,7 @@ + + + icon_复制_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/copy_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/copy_normal.svg new file mode 100644 index 0000000000..7e45e69356 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/copy_normal.svg @@ -0,0 +1,10 @@ + + + icon_复制_normal + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/cut_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/cut_disabled.svg new file mode 100644 index 0000000000..6f469f8e63 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/cut_disabled.svg @@ -0,0 +1,9 @@ + + + icon_剪切_disabled + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/cut_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/cut_normal.svg new file mode 100644 index 0000000000..485201206b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/cut_normal.svg @@ -0,0 +1,10 @@ + + + icon_剪切_normal + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/formatBrush_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/formatBrush_normal.svg new file mode 100644 index 0000000000..f02c9cb616 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/formatBrush_normal.svg @@ -0,0 +1,9 @@ + + + icon_格式刷_normal + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/merge_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/merge_disabled.svg new file mode 100644 index 0000000000..a54f56a5bc --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/merge_disabled.svg @@ -0,0 +1,11 @@ + + + icon_合并单元格_disabled + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/merge_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/merge_normal.svg new file mode 100644 index 0000000000..ad75844975 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/merge_normal.svg @@ -0,0 +1,11 @@ + + + icon_合并单元格_normal + + + + a + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/paste_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/paste_disabled.svg new file mode 100644 index 0000000000..778257c33d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/paste_disabled.svg @@ -0,0 +1,10 @@ + + + icon_粘贴_disabled + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/paste_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/paste_normal.svg new file mode 100644 index 0000000000..3a2f314044 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/paste_normal.svg @@ -0,0 +1,11 @@ + + + icon_粘贴_normal + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_disabled.svg new file mode 100644 index 0000000000..ae600230cd --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_重做_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_normal.svg new file mode 100644 index 0000000000..b15749b41d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_normal.svg @@ -0,0 +1,7 @@ + + + icon_重做_下拉列表用 + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_disabled.svg new file mode 100644 index 0000000000..24c5cd7c93 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_撤销_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_normal.svg new file mode 100644 index 0000000000..0e49c799e6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_normal.svg @@ -0,0 +1,7 @@ + + + icon_撤销_下拉列表用 + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/unmerge_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/unmerge_disabled.svg new file mode 100644 index 0000000000..bb9f7a22f6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/unmerge_disabled.svg @@ -0,0 +1,10 @@ + + + icon_拆分单元格_disabled + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/unmerge_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/unmerge_normal.svg new file mode 100644 index 0000000000..3af2c0ff3d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/unmerge_normal.svg @@ -0,0 +1,8 @@ + + + icon_拆分单元格_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/export_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/export_normal.svg new file mode 100644 index 0000000000..8b0d7ba9d1 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/export_normal.svg @@ -0,0 +1,8 @@ + + + icon_服务器工具栏_输出_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/formExport_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/formExport_normal.svg new file mode 100644 index 0000000000..7f28a5105b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/formExport_normal.svg @@ -0,0 +1,11 @@ + + + icon_新建聚合报表_normal + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/pageSetup_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/pageSetup_normal.svg new file mode 100644 index 0000000000..f09c3aeadb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/pageSetup_normal.svg @@ -0,0 +1,7 @@ + + + icon_页面设置_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen_normal.svg new file mode 100644 index 0000000000..116063de60 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen_normal.svg @@ -0,0 +1,7 @@ + + + icon_重复与冻结设置_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/saveAs_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/saveAs_normal.svg new file mode 100644 index 0000000000..8b50d562fe --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/saveAs_normal.svg @@ -0,0 +1,7 @@ + + + icon_另存为_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/save_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/save_disabled.svg new file mode 100644 index 0000000000..c5f6ea3a2a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/save_disabled.svg @@ -0,0 +1,11 @@ + + + icon_save_disable + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/save_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/save_normal.svg new file mode 100644 index 0000000000..03da5de8f6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/save_normal.svg @@ -0,0 +1,11 @@ + + + icon_save_normal + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/switch_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/switch_normal.svg new file mode 100644 index 0000000000..17d5d0dda3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/switch_normal.svg @@ -0,0 +1,7 @@ + + + icon_切换工作目录_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellAttr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellAttr_normal.svg new file mode 100644 index 0000000000..8348b9703a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellAttr_normal.svg @@ -0,0 +1,7 @@ + + + icon_其他属性_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/bold_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/bold_normal.svg new file mode 100644 index 0000000000..fa9d660221 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/bold_normal.svg @@ -0,0 +1,7 @@ + + + icon_文本工具_加粗_nomal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/bold_selected.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/bold_selected.svg new file mode 100644 index 0000000000..638fadc32c --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/bold_selected.svg @@ -0,0 +1,7 @@ + + + icon_文本工具_加粗_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_center_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_center_normal.svg new file mode 100644 index 0000000000..46c7848030 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_center_normal.svg @@ -0,0 +1,7 @@ + + + icon_对齐 居中对齐_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_center_selected.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_center_selected.svg new file mode 100644 index 0000000000..ca87172041 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_center_selected.svg @@ -0,0 +1,7 @@ + + + icon_对齐 居中对齐_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_left_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_left_normal.svg new file mode 100644 index 0000000000..480e12e8c1 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_left_normal.svg @@ -0,0 +1,7 @@ + + + icon_对齐 左对齐_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_left_selected.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_left_selected.svg new file mode 100644 index 0000000000..b859a9ac96 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_left_selected.svg @@ -0,0 +1,7 @@ + + + icon_对齐 左对齐_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_right_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_right_normal.svg new file mode 100644 index 0000000000..9707e270d9 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_right_normal.svg @@ -0,0 +1,7 @@ + + + icon_对齐 右对齐_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_right_selected.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_right_selected.svg new file mode 100644 index 0000000000..f2ca4708cb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/h_right_selected.svg @@ -0,0 +1,7 @@ + + + icon_对齐 右对齐_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/italic_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/italic_normal.svg new file mode 100644 index 0000000000..97ed4dd1ae --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/italic_normal.svg @@ -0,0 +1,9 @@ + + + icon_文本工具_斜体_normal + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/italic_selected.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/italic_selected.svg new file mode 100644 index 0000000000..1a84fd6da9 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/italic_selected.svg @@ -0,0 +1,9 @@ + + + icon_文本工具_斜体_selected + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/underline_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/underline_normal.svg new file mode 100644 index 0000000000..51a6fd7837 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/underline_normal.svg @@ -0,0 +1,7 @@ + + + icon_文本工具_下划线_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/underline_selected.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/underline_selected.svg new file mode 100644 index 0000000000..ccaafc40a6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellstyle/underline_selected.svg @@ -0,0 +1,7 @@ + + + icon_文本工具_下划线_selected + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/highlight_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/highlight_normal.svg new file mode 100644 index 0000000000..48655aa194 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/highlight_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_条件属性_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/modified_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/modified_normal.svg new file mode 100644 index 0000000000..57f397dabf --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/modified_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_控件设置_下拉列表用_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/noborder_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/noborder_normal.svg new file mode 100644 index 0000000000..4f583e6967 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/noborder_normal.svg @@ -0,0 +1,7 @@ + + + icon_边框_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_help/demo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_help/demo_normal.svg new file mode 100644 index 0000000000..b9755a908d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_help/demo_normal.svg @@ -0,0 +1,7 @@ + + + icon_产品演示_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/bias_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/bias_disabled.svg new file mode 100644 index 0000000000..bc8c7ac44d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/bias_disabled.svg @@ -0,0 +1,7 @@ + + + icon_斜线_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/bias_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/bias_normal.svg new file mode 100644 index 0000000000..e20ec42eb0 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/bias_normal.svg @@ -0,0 +1,7 @@ + + + icon_斜线_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/bindColumn_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/bindColumn_disabled.svg new file mode 100644 index 0000000000..6c80b82afb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/bindColumn_disabled.svg @@ -0,0 +1,7 @@ + + + icon_插入数据列_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/bindColumn_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/bindColumn_normal.svg new file mode 100644 index 0000000000..ea35ccb27f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/bindColumn_normal.svg @@ -0,0 +1,7 @@ + + + icon_插入数据列_nomal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/cell_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/cell_normal.svg new file mode 100644 index 0000000000..a2d91db47d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/cell_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_单元格元素_下拉列表用_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/chart_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/chart_disabled.svg new file mode 100644 index 0000000000..b2b724c64c --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/chart_disabled.svg @@ -0,0 +1,7 @@ + + + icon_图表_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/chart_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/chart_normal.svg new file mode 100644 index 0000000000..59fc97567f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/chart_normal.svg @@ -0,0 +1,7 @@ + + + icon_图表_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/floatPop_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/floatPop_normal.svg new file mode 100644 index 0000000000..95806104dc --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/floatPop_normal.svg @@ -0,0 +1,9 @@ + + + icon_悬浮元素&三角_normal + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/float_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/float_normal.svg new file mode 100644 index 0000000000..b2204b711e --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/float_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_悬浮元素_下拉列表用_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/formula_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/formula_disabled.svg new file mode 100644 index 0000000000..18eb078e73 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/formula_disabled.svg @@ -0,0 +1,7 @@ + + + icon_公式_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/formula_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/formula_normal.svg new file mode 100644 index 0000000000..981ec11b45 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/formula_normal.svg @@ -0,0 +1,7 @@ + + + icon_公式_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/hyperLink_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/hyperLink_normal.svg new file mode 100644 index 0000000000..9d50a6616d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/hyperLink_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_超级链接_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/image_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/image_disabled.svg new file mode 100644 index 0000000000..b18058f59c --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/image_disabled.svg @@ -0,0 +1,12 @@ + + + icon_图片__disabled + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/image_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/image_normal.svg new file mode 100644 index 0000000000..19eb761998 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/image_normal.svg @@ -0,0 +1,10 @@ + + + icon_图片_normal + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/insertColumn_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/insertColumn_normal.svg new file mode 100644 index 0000000000..a1b3065268 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/insertColumn_normal.svg @@ -0,0 +1,13 @@ + + + icon_列_normal + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/insertRow_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/insertRow_normal.svg new file mode 100644 index 0000000000..9a2e37e271 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/insertRow_normal.svg @@ -0,0 +1,14 @@ + + + icon_行_normal + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/richtext_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/richtext_disabled.svg new file mode 100644 index 0000000000..916c433033 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/richtext_disabled.svg @@ -0,0 +1,7 @@ + + + icon_富文本_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/richtext_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/richtext_normal.svg new file mode 100644 index 0000000000..3665dd01e1 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/richtext_normal.svg @@ -0,0 +1,7 @@ + + + icon_富文本_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/subReport_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/subReport_disabled.svg new file mode 100644 index 0000000000..14ee3f16c3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/subReport_disabled.svg @@ -0,0 +1,12 @@ + + + icon_子报表_disabled + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/subReport_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/subReport_normal.svg new file mode 100644 index 0000000000..d06985a528 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/subReport_normal.svg @@ -0,0 +1,10 @@ + + + icon_子报表_normal + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/text_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/text_disabled.svg new file mode 100644 index 0000000000..a25d12a706 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/text_disabled.svg @@ -0,0 +1,7 @@ + + + icon_普通文本_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/text_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/text_normal.svg new file mode 100644 index 0000000000..bf3b0c6879 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/text_normal.svg @@ -0,0 +1,7 @@ + + + icon_普通文本_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/allow_authority_edit_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/allow_authority_edit_normal.svg new file mode 100644 index 0000000000..ac662cd61f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/allow_authority_edit_normal.svg @@ -0,0 +1,8 @@ + + + icon_进入权限编辑_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/background_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/background_normal.svg new file mode 100644 index 0000000000..aa95ad94f0 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/background_normal.svg @@ -0,0 +1,10 @@ + + + icon_纸张背景_normal + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/delete_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/delete_disabled.svg new file mode 100644 index 0000000000..fa76d8b95b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/delete_disabled.svg @@ -0,0 +1,7 @@ + + + icon_关闭_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/delete_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/delete_normal.svg new file mode 100644 index 0000000000..74ff5ab385 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/delete_normal.svg @@ -0,0 +1,7 @@ + + + icon_关闭_red + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/exit_authority_edit_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/exit_authority_edit_normal.svg new file mode 100644 index 0000000000..a3d57dde95 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/exit_authority_edit_normal.svg @@ -0,0 +1,7 @@ + + + icon_退出权限编辑_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/footer_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/footer_normal.svg new file mode 100644 index 0000000000..32d3e1553b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/footer_normal.svg @@ -0,0 +1,7 @@ + + + icon_页脚_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/header_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/header_normal.svg new file mode 100644 index 0000000000..c51df52e8f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/header_normal.svg @@ -0,0 +1,7 @@ + + + icon_页眉_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/linearAttr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/linearAttr_normal.svg new file mode 100644 index 0000000000..2f04689766 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/linearAttr_normal.svg @@ -0,0 +1,7 @@ + + + icon_报表分栏_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/mobile_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/mobile_normal.svg new file mode 100644 index 0000000000..6b21d092b3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/mobile_normal.svg @@ -0,0 +1,7 @@ + + + icon_移动端属性_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/p_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/p_normal.svg new file mode 100644 index 0000000000..11f81ebe39 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/p_normal.svg @@ -0,0 +1,7 @@ + + + icon_参数 模板参数_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/reportEngineAttr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/reportEngineAttr_normal.svg new file mode 100644 index 0000000000..6490eb9c3e --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/reportEngineAttr_normal.svg @@ -0,0 +1,14 @@ + + + icon_报表引擎属性_normal + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/reportWriteAttr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/reportWriteAttr_normal.svg new file mode 100644 index 0000000000..4e7443f778 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/reportWriteAttr_normal.svg @@ -0,0 +1,11 @@ + + + icon_报表填报属性_normal + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/watermark_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/watermark_normal.svg new file mode 100644 index 0000000000..a3c0cf5154 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/watermark_normal.svg @@ -0,0 +1,7 @@ + + + icon_水印_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/webreportattribute_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/webreportattribute_normal.svg new file mode 100644 index 0000000000..ed6b252af1 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/webreportattribute_normal.svg @@ -0,0 +1,8 @@ + + + icon_模板web属性_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/datasource_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/datasource_normal.svg new file mode 100644 index 0000000000..1e16b5ecfc --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/datasource_normal.svg @@ -0,0 +1,9 @@ + + + icon_模板数据集_normal + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/edit_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/edit_normal.svg new file mode 100644 index 0000000000..b3f329e95f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/edit_normal.svg @@ -0,0 +1,8 @@ + + + icon_服务器配置_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/function_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/function_normal.svg new file mode 100644 index 0000000000..f8bdbd3835 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/function_normal.svg @@ -0,0 +1,7 @@ + + + icon_函数管理器_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/style_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/style_normal.svg new file mode 100644 index 0000000000..9e20fc208d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/style_normal.svg @@ -0,0 +1,7 @@ + + + icon_样式_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit/fit_normal.svg b/designer-base/src/main/resources/com/fr/design/images/reportfit/fit_normal.svg new file mode 100644 index 0000000000..bc44c9dc2f --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/reportfit/fit_normal.svg @@ -0,0 +1,7 @@ + + + icon_模板自适应属性_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/server/platform_16_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/server/platform_16_16_normal.svg new file mode 100644 index 0000000000..f691c42deb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/server/platform_16_16_normal.svg @@ -0,0 +1,8 @@ + + + icon_报表平台管理_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/server/plugin_normal.svg b/designer-base/src/main/resources/com/fr/design/images/server/plugin_normal.svg new file mode 100644 index 0000000000..8b5cd823b5 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/server/plugin_normal.svg @@ -0,0 +1,8 @@ + + + icon_插件管理_normal + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/sheet/add_polysheet_normal.svg b/designer-base/src/main/resources/com/fr/design/images/sheet/add_polysheet_normal.svg new file mode 100644 index 0000000000..adf5ee4131 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/sheet/add_polysheet_normal.svg @@ -0,0 +1,16 @@ + + + icon_sheet_添加数据集_normal + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/sheet/next_page_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/sheet/next_page_disabled.svg new file mode 100644 index 0000000000..2b3f4621da --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/sheet/next_page_disabled.svg @@ -0,0 +1,7 @@ + + + icon_sheet_下一页_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/sheet/next_page_normal.svg b/designer-base/src/main/resources/com/fr/design/images/sheet/next_page_normal.svg new file mode 100644 index 0000000000..588a01a499 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/sheet/next_page_normal.svg @@ -0,0 +1,7 @@ + + + icon_sheet_下一页_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/sheet/polysheet_normal.svg b/designer-base/src/main/resources/com/fr/design/images/sheet/polysheet_normal.svg new file mode 100644 index 0000000000..85674ff032 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/sheet/polysheet_normal.svg @@ -0,0 +1,9 @@ + + + icon_sheet_normal + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/sheet/pre_page_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/sheet/pre_page_disabled.svg new file mode 100644 index 0000000000..6be01cb530 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/sheet/pre_page_disabled.svg @@ -0,0 +1,7 @@ + + + icon_sheet_上一页_disabled + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/sheet/pre_page_normal.svg b/designer-base/src/main/resources/com/fr/design/images/sheet/pre_page_normal.svg new file mode 100644 index 0000000000..9a04977d79 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/sheet/pre_page_normal.svg @@ -0,0 +1,7 @@ + + + icon_sheet_上一页_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/update/update_new_normal.svg b/designer-base/src/main/resources/com/fr/design/images/update/update_new_normal.svg new file mode 100644 index 0000000000..1ebd7fc6f0 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/update/update_new_normal.svg @@ -0,0 +1,7 @@ + + + icon_更新升级_normal + + + + diff --git a/designer-base/src/main/resources/com/fr/design/remote/images/icon_Remote_Design_Auth_Manager_normal@1x_normal.svg b/designer-base/src/main/resources/com/fr/design/remote/images/icon_Remote_Design_Auth_Manager_normal@1x_normal.svg new file mode 100644 index 0000000000..879af48ed8 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/remote/images/icon_Remote_Design_Auth_Manager_normal@1x_normal.svg @@ -0,0 +1,9 @@ + + + icon_远程设计权限管理_normal + + + + + + diff --git a/designer-base/src/test/java/com/fr/base/svg/IconUtilsTest.java b/designer-base/src/test/java/com/fr/base/svg/IconUtilsTest.java new file mode 100644 index 0000000000..a1979db1dc --- /dev/null +++ b/designer-base/src/test/java/com/fr/base/svg/IconUtilsTest.java @@ -0,0 +1,41 @@ +package com.fr.base.svg; + +import com.fr.cert.token.lang.Assert; +import junit.framework.TestCase; + +import javax.swing.Icon; +import javax.swing.ImageIcon; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020/12/25 + */ +public class IconUtilsTest extends TestCase { + + public void testReadIcon() { + String resource = "com/fr/design/images/m_edit/copy.png"; + + Icon pngIcon = IconUtils.readIcon(resource); + assertTrue(pngIcon instanceof ImageIcon); + + resource = "com/fr/design/images/m_edit/copy_normal.svg"; + Icon suffixIcon = IconUtils.readIcon(resource); + assertTrue(suffixIcon instanceof SVGIcon); + + resource = "com/fr/design/images/m_edit/copy"; + Icon noSuffixIcon = IconUtils.readIcon(resource); + assertTrue(noSuffixIcon instanceof SVGIcon); + } + + public void testReadSVGIcon() { + String resource = "com/fr/design/images/m_edit/copy.png"; + + Icon suffixIcon = IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_NORMAL); + assertTrue(suffixIcon instanceof SVGIcon); + + resource = "com/fr/design/images/m_edit/copy"; + Icon noSuffixIcon = IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_NORMAL); + assertTrue(noSuffixIcon instanceof SVGIcon); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java index 5d7a9e67d7..61b9a8c4f5 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java @@ -1,6 +1,7 @@ package com.fr.design.module; import com.fr.base.ChartPreStyleConfig; +import com.fr.base.svg.IconUtils; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; @@ -8,7 +9,6 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.menu.MenuKeySet; -import com.fr.general.IOUtils; import com.fr.module.ModuleContext; import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; @@ -33,7 +33,7 @@ public class ChartPreStyleAction extends UpdateAction { this.setMenuKeySet(CHART_DEFAULT_STYLE); this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/chart/ChartType.png")); + this.setSmallIcon("com/fr/design/images/chart/ChartType"); this.generateAndSetSearchText(ChartPreStyleManagerPane.class.getName()); } @@ -101,4 +101,4 @@ public class ChartPreStyleAction extends UpdateAction { return null; } }; -} \ No newline at end of file +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java b/designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java index dc64adef11..e9b0373a83 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java @@ -1,10 +1,10 @@ package com.fr.van.chart.map.server; import com.fr.base.ServerConfig; +import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; import com.fr.general.GeneralContext; -import com.fr.general.IOUtils; import com.fr.start.ServerStarter; import com.fr.workspace.WorkContext; @@ -17,7 +17,7 @@ import java.awt.event.ActionEvent; public class ChartMapEditorAction extends UpdateAction { public ChartMapEditorAction(){ - this.setSmallIcon(IOUtils.readIcon("/com/fr/van/chart/map/images/mapData.png")); + this.setSmallIcon("/com/fr/van/chart/map/images/mapData"); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Data")); } diff --git a/designer-chart/src/main/resources/com/fr/van/chart/map/images/mapData_normal.svg b/designer-chart/src/main/resources/com/fr/van/chart/map/images/mapData_normal.svg new file mode 100644 index 0000000000..bbf7baac79 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/van/chart/map/images/mapData_normal.svg @@ -0,0 +1,8 @@ + + + icon_地图数据_normal + + + + + diff --git a/designer-form/src/main/java/com/fr/design/actions/NewFormAction.java b/designer-form/src/main/java/com/fr/design/actions/NewFormAction.java index 8004b739f2..c867be8d24 100644 --- a/designer-form/src/main/java/com/fr/design/actions/NewFormAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/NewFormAction.java @@ -1,7 +1,7 @@ package com.fr.design.actions; -import com.fr.base.BaseUtils; -import com.fr.design.actions.UpdateAction; + +import com.fr.base.svg.IconUtils; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -21,7 +21,7 @@ public class NewFormAction extends UpdateAction { this.setMenuKeySet(NEW_FORM); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/new_form3.png")); + this.setSmallIcon("/com/fr/design/images/buttonicon/new_form3"); this.setAccelerator(getMenuKeySet().getKeyStroke()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java index 47f7e3924c..c577a86939 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java @@ -1,6 +1,6 @@ package com.fr.design.designer.beans.actions; -import com.fr.base.BaseUtils; + import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.beans.actions.behavior.ComponentEnable; import com.fr.design.mainframe.FormDesigner; @@ -16,7 +16,7 @@ public class CopyAction extends FormWidgetEditAction { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy")); this.setMnemonic('C'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); + this.setSmallIcon("/com/fr/design/images/m_edit/copy"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); setUpdateBehavior(new ComponentEnable()); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); @@ -27,4 +27,4 @@ public class CopyAction extends FormWidgetEditAction { DesignModeContext.doCopy(getEditingComponent()); return false; } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java index 421cae2e6e..e93eebd729 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java @@ -1,6 +1,6 @@ package com.fr.design.designer.beans.actions; -import com.fr.base.BaseUtils; + import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.beans.actions.behavior.ComponentEnable; import com.fr.design.mainframe.FormDesigner; @@ -16,7 +16,7 @@ public class CutAction extends FormWidgetEditAction { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); this.setMnemonic('T'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); + this.setSmallIcon("/com/fr/design/images/m_edit/cut"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); this.setUpdateBehavior(new ComponentEnable()); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); @@ -26,4 +26,4 @@ public class CutAction extends FormWidgetEditAction { public boolean executeActionReturnUndoRecordNeeded() { return DesignModeContext.doCut(getEditingComponent()); } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java index 7492f8cc8b..5f9a59de5f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java @@ -7,7 +7,7 @@ import java.awt.event.KeyEvent; import javax.swing.*; -import com.fr.base.BaseUtils; + import com.fr.design.designer.beans.actions.behavior.ComponentEnable; import com.fr.design.mainframe.FormDesigner; @@ -24,7 +24,7 @@ public class FormDeleteAction extends FormWidgetEditAction { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")); this.setMnemonic('D'); // Richie:删除菜单图标 - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/delete.png")); + this.setSmallIcon("/com/fr/design/images/m_report/delete"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0)); this.setUpdateBehavior(new ComponentEnable()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java index c02295f0f0..ef35097b21 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java @@ -1,6 +1,5 @@ package com.fr.design.designer.beans.actions; -import com.fr.base.BaseUtils; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.mainframe.FormDesigner; @@ -15,7 +14,7 @@ public class PasteAction extends FormWidgetEditAction { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste")); this.setMnemonic('P'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); + this.setSmallIcon("/com/fr/design/images/m_edit/paste"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); } @@ -29,4 +28,4 @@ public class PasteAction extends FormWidgetEditAction { this.setEnabled(true); } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaTargetMode.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaTargetMode.java index d39e5620ec..72c7b8bfd1 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaTargetMode.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaTargetMode.java @@ -1,6 +1,7 @@ package com.fr.design.form.parameter; -import com.fr.base.BaseUtils; + +import com.fr.base.svg.IconUtils; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.properties.WidgetPropertyTable; import com.fr.design.gui.core.WidgetOption; @@ -27,7 +28,7 @@ public class FormParaTargetMode extends FormDesignerModeForSpecial predifinedwidgeList = new ArrayList(); private UIButton predefineButton; @@ -48,25 +48,25 @@ public class FormParaPane extends JPanel { private FormDesigner designer; - + static { GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - + @Override public void on(PluginEvent event) { - + THIS = null; } }, new PluginFilter() { - + @Override public boolean accept(PluginContext context) { - + return context.contain(PluginModule.ExtraDesign); } }); } - + public static final FormParaPane getInstance(FormDesigner designer) { if(THIS == null) { THIS = new FormParaPane(); @@ -82,7 +82,7 @@ public class FormParaPane extends JPanel { public FormParaPane() { - predefineButton = new UIButton(UIConstants.PRE_WIDGET_ICON) { + predefineButton = new UIButton(UIConstants.PRE_WIDGET_NORMAL_ICON) { @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index 27e765f3f1..ddd78c13f6 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEditListener; @@ -373,7 +374,7 @@ public class FormParaWidgetPane extends JPanel { private class paraButton extends ToolBarButton { public paraButton(WidgetOption no) { super(no); - this.setDisabledIcon(BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_parameter2.png")); + this.setDisabledIcon(IconUtils.readIcon("/com/fr/web/images/form/resources/layout_parameter2_disabled.svg")); if (designer != null) { this.setEnabled(designer.getParaComponent() == null); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormTargetMode.java b/designer-form/src/main/java/com/fr/design/mainframe/FormTargetMode.java index f80ce94ebd..948796f494 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormTargetMode.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormTargetMode.java @@ -2,7 +2,8 @@ package com.fr.design.mainframe; import java.util.ArrayList; -import com.fr.base.BaseUtils; + +import com.fr.base.svg.IconUtils; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOptionFactory; import com.fr.design.gui.itable.PropertyGroup; @@ -22,7 +23,7 @@ public class FormTargetMode extends FormDesignerModeForSpecial { public WidgetOption[] getPredefinedWidgetOptions() { return new WidgetOption[]{ WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query_Button"), - BaseUtils.readIcon("/com/fr/web/images/form/resources/preview_16.png"), FormSubmitButton.class)}; + "/com/fr/web/images/form/resources/preview_16", FormSubmitButton.class)}; } public ArrayList createRootDesignerPropertyGroup() { @@ -38,9 +39,9 @@ public class FormTargetMode extends FormDesignerModeForSpecial { public int getMinDesignHeight() { return getTarget().getTarget().getContainer().getMinDesignSize().height; } - + @Override public int getMinDesignWidth() { return getTarget().getTarget().getContainer().getMinDesignSize().width; } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 43aa58d9b9..b39dc91889 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -247,7 +247,7 @@ public class JForm extends JTemplate implements BaseJForm { @@ -17,7 +18,7 @@ public class ReportEngineAttrAction extends ReportComponentAction { this.setMenuKeySet(KeySetUtils.REPORT_FOOTER); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/footer.png")); + this.setSmallIcon("/com/fr/design/images/m_report/footer"); } /** @@ -88,4 +89,4 @@ public class ReportFooterAction extends ReportComponentAction { } } } -} \ No newline at end of file +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java index 5ee5c9792f..c23ed10b53 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java @@ -3,7 +3,8 @@ */ package com.fr.design.actions.report; -import com.fr.base.BaseUtils; + +import com.fr.base.svg.IconUtils; import com.fr.design.actions.ReportComponentAction; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.headerfooter.EditHeaderPane; @@ -32,7 +33,7 @@ public class ReportHeaderAction extends ReportComponentAction { this.setMenuKeySet(KeySetUtils.REPORT_HEADER); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/header.png")); + this.setSmallIcon("/com/fr/design/images/m_report/header"); } /** @@ -90,4 +91,4 @@ public class ReportHeaderAction extends ReportComponentAction { } } } -} \ No newline at end of file +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java index a002f56e8a..b18c62b086 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -2,6 +2,7 @@ package com.fr.design.actions.report; import com.fr.base.PaperSize; import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.JWorkBookAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -10,7 +11,6 @@ import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.MenuKeySet; import com.fr.design.report.mobile.ReportMobileAttrPane; import com.fr.file.FILE; -import com.fr.general.IOUtils; import com.fr.intelli.record.Focus; import com.fr.main.TemplateWorkBook; @@ -35,7 +35,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ this.setMenuKeySet(REPORT_APP_ATTR); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_report/mobile.png")); + this.setSmallIcon("/com/fr/design/images/m_report/mobile"); this.generateAndSetSearchText(ReportMobileAttrPane.class.getName()); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java index 2b819a3987..9177f4d307 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java @@ -3,13 +3,13 @@ */ package com.fr.design.actions.report; +import com.fr.base.svg.IconUtils; import com.fr.design.actions.ReportComponentAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.WorkSheetDesigner; import com.fr.design.menu.KeySetUtils; import com.fr.design.report.freeze.RepeatAndFreezeSettingPane; -import com.fr.general.IOUtils; import com.fr.report.worksheet.WorkSheet; import javax.swing.SwingUtilities; @@ -27,7 +27,7 @@ public class ReportPageAttrAction extends ReportComponentAction extends Tar return false; } Object clipObject = getClipObject(); - //如果是悬浮元素,则不允许粘贴到表单 + //如果是悬浮元素,则不允许粘贴到表单 if (!DesignerContext.getDesignerFrame().getSelectedJTemplate().accept(clipObject)) { return false; } @@ -1330,7 +1330,7 @@ public abstract class ElementCasePane extends Tar MenuDef insertFloatMenu = new MenuDef(); insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName()); insertFloatMenu.setTooltip(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_T_Insert_Float")); - insertFloatMenu.setIconPath("/com/fr/design/images/m_insert/floatPop.png"); + insertFloatMenu.setIconPath("/com/fr/design/images/m_insert/floatPop"); UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, this); for (int i = 0; i < actions.length; i++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index 83a1c08501..44992a84b2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -182,7 +182,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { private void addInsertFloatMenuDef(MenuDef menuDef) { // 悬浮元素菜单 MenuDef subMenuDef = new MenuDef(KeySetUtils.INSERT_FLOAT.getMenuName()); - subMenuDef.setIconPath("/com/fr/design/images/m_insert/float.png"); + subMenuDef.setIconPath("/com/fr/design/images/m_insert/float_normal.svg"); menuDef.addShortCut(subMenuDef); UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, this); for (int i = 0; i < actions.length; i++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java b/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java index 76298161f0..9b89864b67 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.base.Style; + import com.fr.design.actions.ElementCaseAction; import com.fr.grid.selection.CellSelection; @@ -31,7 +31,7 @@ public class FormatBrushAction extends ElementCaseAction { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_FormatBrush")); this.setMnemonic('B'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/formatBrush.png")); + this.setSmallIcon("/com/fr/design/images/m_edit/formatBrush"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, DEFAULT_MODIFIER)); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 7fba013587..ff14d54f40 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -682,7 +682,7 @@ public class JWorkBook extends JTemplate { .addShortCut(new PageExcelExportAction(this), new ExcelExportAction(this), new PageToSheetExcelExportAction(this)); // Export - MenuDef MenuDef exportMenuDef = new MenuDef(KeySetUtils.EXPORT.getMenuName()); - exportMenuDef.setIconPath("/com/fr/design/images/m_file/export.png"); + exportMenuDef.setIconPath("/com/fr/design/images/m_file/export"); addShortCut(exportMenuDef, excelExportMenuDef); return exportMenuDef; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index ead1cf2f1e..7b6fbff6f8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -24,6 +24,8 @@ import javax.swing.UIManager; import com.fr.base.BaseUtils; import com.fr.base.GraphHelper; + +import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; @@ -57,14 +59,14 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private static final Color LINE_COLOR = new Color(0xababab); - private static final Icon ADD_WORK_SHEET = IOUtils.readIcon("com/fr/base/images/oem/addworksheet.png"); - protected static final Icon ADD_POLY_SHEET = IOUtils.readIcon("com/fr/design/images/sheet/addpolysheet.png"); - private static final Icon WORK_SHEET_ICON = IOUtils.readIcon("com/fr/base/images/oem/worksheet.png"); - private static final Icon POLY_SHEET_ICON = IOUtils.readIcon("com/fr/design/images/sheet/polysheet.png"); - private static final Icon LEFT_ICON = IOUtils.readIcon("com/fr/design/images/sheet/left_normal@1x.png"); - private static final Icon RIGHT_ICON = IOUtils.readIcon("com/fr/design/images/sheet/right_normal@1x.png"); - private static final Icon DISABLED_LEFT_ICON = IOUtils.readIcon("com/fr/design/images/sheet/left_hover@1x.png"); - private static final Icon DISABLED_RIGHT_ICON = IOUtils.readIcon("com/fr/design/images/sheet/right_hover@1x.png"); + private static final Icon ADD_WORK_SHEET = IconUtils.readIcon("com/fr/base/images/oem/add_worksheet"); + protected static final Icon ADD_POLY_SHEET = IconUtils.readIcon("com/fr/design/images/sheet/add_polysheet"); + private static final Icon WORK_SHEET_ICON = IconUtils.readIcon("com/fr/base/images/oem/worksheet"); + private static final Icon POLY_SHEET_ICON = IconUtils.readIcon("com/fr/design/images/sheet/polysheet"); + private static final Icon LEFT_ICON = IconUtils.readIcon("com/fr/design/images/sheet/pre_page"); + private static final Icon RIGHT_ICON = IconUtils.readIcon("com/fr/design/images/sheet/next_page"); + private static final Icon DISABLED_LEFT_ICON = IconUtils.readIcon("com/fr/design/images/sheet/pre_page_disabled.svg"); + private static final Icon DISABLED_RIGHT_ICON = IconUtils.readIcon("com/fr/design/images/sheet/next_page_disabled.svg"); private static final int NUM = 10; private static final int ICON_SEP_DISTANCE = 8; diff --git a/designer-realize/src/main/java/com/fr/poly/actions/DeleteBlockAction.java b/designer-realize/src/main/java/com/fr/poly/actions/DeleteBlockAction.java index 908e235a60..1acda00e68 100644 --- a/designer-realize/src/main/java/com/fr/poly/actions/DeleteBlockAction.java +++ b/designer-realize/src/main/java/com/fr/poly/actions/DeleteBlockAction.java @@ -8,7 +8,7 @@ import java.awt.event.KeyEvent; import javax.swing.KeyStroke; -import com.fr.base.BaseUtils; + import com.fr.base.vcs.DesignerMode; import com.fr.design.actions.TemplateComponentActionInterface; import com.fr.design.actions.UpdateAction; @@ -26,7 +26,7 @@ public class DeleteBlockAction extends UpdateAction implements TemplateComponent this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")); this.setMnemonic('D'); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/delete.png")); + this.setSmallIcon("/com/fr/design/images/m_report/delete"); } @Override diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index cfc0e9adb5..b2827a36ce 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -4,6 +4,7 @@ import com.fr.base.BaseFormula; import com.fr.design.actions.columnrow.DSColumnConditionAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.DSColumnCellAction; +import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dscolumn.DSColumnAdvancedPane; @@ -259,7 +260,7 @@ public class CellDSColumnEditor extends CellQuickEditor { condition.setEditingComponent(tc); } //丢掉icon,修改按钮名称为编辑 - condition.setSmallIcon(null); + condition.setSmallIcon(UIConstants.BLACK_ICON); condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); conditionUIButton = new UIButton(condition); Component[][] components = new Component[][]{ diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java index 438d440f65..a515c72047 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java @@ -2,6 +2,7 @@ package com.fr.quickeditor.cellquick; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.RichTextCellAction; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -47,7 +48,7 @@ public class CellRichTextEditor extends CellQuickEditor { protected void refreshDetails() { RichTextCellAction subReportCellAction = new RichTextCellAction(tc); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); - subReportCellAction.setSmallIcon(null); + subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON); richTextButton.setAction(subReportCellAction); } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java index 3f29b592a9..e6c3ddf82e 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java @@ -2,6 +2,7 @@ package com.fr.quickeditor.cellquick; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.SubReportCellAction; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -43,7 +44,7 @@ public class CellSubReportEditor extends CellQuickEditor { protected void refreshDetails() { SubReportCellAction subReportCellAction = new SubReportCellAction(tc); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); - subReportCellAction.setSmallIcon(null); + subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON); subReportButton.setAction(subReportCellAction); } diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index ff3aadd36b..a9a1ccbd15 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -1,6 +1,6 @@ package com.fr.start; -import com.fr.base.BaseUtils; + import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.file.WebPreviewUtils; @@ -222,7 +222,7 @@ public class MainDesigner extends BaseDesigner { private void createSaveButton() { - saveButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/save.png")); + saveButton = new UIButton("/com/fr/design/images/buttonicon/save.png", true); saveButton.setToolTipText(KeySetUtils.SAVE_TEMPLATE.getMenuKeySetName()); saveButton.set4ToolbarButton(); saveButton.addActionListener(new ActionListener() { @@ -238,7 +238,7 @@ public class MainDesigner extends BaseDesigner { private void createUndoButton() { - undo = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/undo.png")); + undo = new UIButton("/com/fr/design/images/buttonicon/undo.png", true); undo.setToolTipText(KeySetUtils.UNDO.getMenuKeySetName()); undo.set4ToolbarButton(); undo.addActionListener(new ActionListener() { @@ -253,7 +253,7 @@ public class MainDesigner extends BaseDesigner { } private void createRedoButton() { - redo = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/redo.png")); + redo = new UIButton("/com/fr/design/images/buttonicon/redo.png", true); redo.setToolTipText(KeySetUtils.REDO.getMenuKeySetName()); redo.set4ToolbarButton(); redo.addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java index 0c38d731e7..138e7df2bb 100644 --- a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java +++ b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java @@ -46,11 +46,13 @@ public class ImagePreLoader { private String[] preLoadImages = { "com/fr/design/images/m_file/formExport.png", - "com/fr/base/images/oem/cpt.png", + "com/fr/design/images/m_file/formExport_normal.svg", + "com/fr/base/images/oem/cpt.xpng", "com/fr/design/images/data/store_procedure.png", "/com/fr/design/images/m_file/preview.png", "com/fr/base/images/cell/blank.gif", "com/fr/design/images/data/dock/serverdatabase.png", + "com/fr/design/images/data/dock/serverdatabase_normal.svg", "/com/fr/design/images/data/dock/serverclasstabledata.png", "/com/fr/design/images/data/dock/serverdatatable.png", "/com/fr/design/images/data/file.png", @@ -73,6 +75,7 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/run24.png", "com/fr/design/images/buttonicon/runs.png", "com/fr/design/mainframe/alphafine/images/smallsearch.png", + "com/fr/design/mainframe/alphafine/images/smallsearch_normal.svg", "com/fr/design/images/buttonicon/pageb24.png", "com/fr/design/images/buttonicon/writeb24.png", "com/fr/design/images/buttonicon/anab24.png", @@ -81,6 +84,7 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/anas.png", "com/fr/design/images/buttonicon/refresh.png", "com/fr/design/images/gui/color/foreground.png", + "com/fr/design/images/gui/color/foreground_normal.svg", "com/fr/design/images/buttonicon/history.png", "com/fr/design/images/m_file/close.png", "com/fr/design/images/m_file/edit.png", @@ -94,8 +98,14 @@ public class ImagePreLoader { "com/fr/design/images/m_report/close_over.png", "com/fr/design/images/m_report/close_press.png", "com/fr/design/images/buttonicon/save.png", + "com/fr/design/images/buttonicon/save_normal.svg", + "com/fr/design/images/buttonicon/save_disabled.svg", "com/fr/design/images/buttonicon/undo.png", + "com/fr/design/images/buttonicon/undo_normal.svg", + "com/fr/design/images/buttonicon/undo_disabled.svg", "com/fr/design/images/buttonicon/redo.png", + "com/fr/design/images/buttonicon/redo_normal.svg", + "com/fr/design/images/buttonicon/redo_disabled.svg", "com/fr/design/images/buttonicon/additicon_grey.png", "com/fr/design/images/buttonicon/addicon.png", "com/fr/design/images/buttonicon/list_normal.png", @@ -104,6 +114,7 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/mouseoverclose icon.png", "com/fr/design/images/buttonicon/pressclose icon.png", "com/fr/design/images/buttonicon/open.png", + "com/fr/design/images/buttonicon/open_normal.svg", "com/fr/design/images/m_file/view_folder.png", "com/fr/design/images/data/source/rename.png", "com/fr/design/images/buttonicon/minus.png", @@ -117,6 +128,7 @@ public class ImagePreLoader { "com/fr/design/images/control/tab/remove.png", "com/fr/design/images/m_file/preview.png", "com/fr/design/images/m_web/connection.png", + "com/fr/design/images/m_web/connection_normal.svg", "com/fr/design/images/control/addPopup.png", "com/fr/design/images/buttonicon/propertiestab/cellelement_normal.png", "com/fr/design/images/buttonicon/propertiestab/cellattr_normal.png", @@ -130,15 +142,19 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/propertiestab/cellelement_selected.png", "com/fr/design/images/log/selectedall.png", "com/fr/design/images/m_edit/copy.png", + "com/fr/design/images/m_edit/copy_normal.svg", + "com/fr/design/images/m_edit/copy_disabled.svg", "com/fr/design/images/log/clear.png", "com/fr/design/images/log/clear.png", "com/fr/design/images/log/selectedall.png", "com/fr/design/images/log/setting.png", "com/fr/design/images/buttonicon/newcpts.png", + "com/fr/design/images/buttonicon/newcpts_normal.svg", "com/fr/base/images/oem/logo.png", "com/fr/design/images/data/bind/localconnect.png", "com/fr/design/images/gui/tab_add_normal.png", "com/fr/design/images/m_help/demo.png", + "com/fr/design/images/m_help/demo_normal.svg", "com/fr/design/images/gui/tab_add_hover.png", "com/fr/design/images/gui/tab_add_click.png", "com/fr/design/images/gui/tab_delete.png", @@ -149,6 +165,17 @@ public class ImagePreLoader { "com/fr/design/images/update.png", "com/fr/design/images/need.png", "com/fr/design/images/bug.png", + "/com/fr/design/images/bbs/video_normal.svg", + "/com/fr/design/images/bbs/help_normal.svg", + "/com/fr/design/images/bbs/bbs_normal.svg", + "/com/fr/design/images/bbs/question_normal.svg", + "/com/fr/design/images/bbs/solution_normal.svg", + "/com/fr/design/images/bbs/bug_normal.svg", + "/com/fr/design/images/bbs/need_normal.svg", + "/com/fr/design/images/bbs/center_normal.svg", + "/com/fr/design/images/bbs/sign_normal.svg", + "/com/fr/design/images/bbs/facebook_normal.svg", + "/com/fr/design/images/update/update_new_normal.svg", "com/fr/design/images/signature.png", "com/fr/design/images/m_file/switch.png", "com/fr/design/images/gui/blank.gif", @@ -167,13 +194,17 @@ public class ImagePreLoader { "com/fr/design/images/gui/frm.png", "com/fr/design/images/gui/cht.png", "com/fr/design/images/chart/ChartType.png", + "com/fr/design/images/chart/ChartType_normal.svg", "com/fr/van/chart/map/images/mapData.png", + "com/fr/van/chart/map/images/mapData_normal.svg", "com/fr/design/images/buttonicon/add.png", "com/fr/base/images/cell/control/remove.png", "com/fr/design/images/control/up.png", "com/fr/design/images/control/down.png", "com/fr/design/images/control/sortAsc.png", "com/fr/design/images/m_insert/formula.png", + "com/fr/design/images/m_insert/formula_normal.svg", + "com/fr/design/images/m_insert/formula_disabled.svg", "com/fr/design/images/calender/year_reduce.png", "com/fr/design/images/calender/year_reduce_hover.png", "com/fr/design/images/calender/year_reduce_click.png", @@ -189,27 +220,43 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/type_string.png", "com/fr/base/images/cell/control/add.png", "com/fr/design/images/expand/cellAttr.gif", + "com/fr/design/images/expand/cellAttr_normal.svg", "com/fr/design/images/expand/none16x16.png", "com/fr/design/images/expand/asc.png", "com/fr/design/images/expand/des.png", "com/fr/design/images/form/toolbar/pie.png", "com/fr/design/images/buttonicon/widget/date_16.png", + "com/fr/design/images/buttonicon/widget/date_16_normal.svg", "com/fr/design/images/buttonicon/widget/tree_16.png", + "com/fr/design/images/buttonicon/widget/tree_16_normal.svg", "com/fr/design/images/buttonicon/widget/comboboxtree.png", + "com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg", "com/fr/design/images/buttonicon/widget/checkbox_group_16.png", + "com/fr/design/images/buttonicon/widget/checkbox_group_16_normal.svg", "com/fr/design/images/buttonicon/widget/button_group_16.png", + "com/fr/design/images/buttonicon/widget/button_group_16_normal.svg", "com/fr/design/images/buttonicon/widget/number_field_16.png", + "com/fr/design/images/buttonicon/widget/number_field_16_normal.svg", "com/fr/design/images/buttonicon/widget/label_16.png", + "com/fr/design/images/buttonicon/widget/label_16_normal.svg", "com/fr/web/images/form/resources/button_16.png", "com/fr/design/images/buttonicon/widget/button_16.png", + "com/fr/design/images/buttonicon/widget/button_16_normal.svg", "com/fr/design/images/buttonicon/widget/files_up.png", + "com/fr/design/images/buttonicon/widget/files_up_normal.svg", "com/fr/design/images/buttonicon/widget/combo_box_16.png", + "com/fr/design/images/buttonicon/widget/combo_box_16_normal.svg", "com/fr/design/images/buttonicon/widget/combo_check_16.png", + "com/fr/design/images/buttonicon/widget/combo_check_16_normal.svg", "com/fr/design/images/buttonicon/widget/check_box_16.png", + "com/fr/design/images/buttonicon/widget/check_box_16_normal.svg", "com/fr/web/images/form/resources/list_16.png", "com/fr/design/images/buttonicon/widget/text_field_16.png", + "com/fr/design/images/buttonicon/widget/text_field_16_normal.svg", "com/fr/design/images/buttonicon/widget/text_area_16.png", + "com/fr/design/images/buttonicon/widget/text_area_16_normal.svg", "com/fr/design/images/buttonicon/widget/password_field_16.png", + "com/fr/design/images/buttonicon/widget/password_field_16_normal.svg", "com/fr/web/images/form/resources/iframe_16.png", "com/fr/design/images/form/toolbar/column.png", "com/fr/design/images/form/toolbar/bar.png", @@ -233,8 +280,14 @@ public class ImagePreLoader { "com/fr/web/images/form/forbid.png", "com/fr/web/images/form/resources/layout_absolute.png", "com/fr/design/images/m_edit/cut.png", + "com/fr/design/images/m_edit/cut_normal.svg", + "com/fr/design/images/m_edit/cut_disabled.svg", "com/fr/design/images/m_edit/paste.png", + "com/fr/design/images/m_edit/paste_normal.svg", + "com/fr/design/images/m_edit/paste_disabled.svg", "com/fr/design/images/m_report/delete.png", + "com/fr/design/images/m_report/delete_normal.svg", + "com/fr/design/images/m_report/delete_disabled.svg", "com/fr/design/images/toolbarbtn/parametersetting.png", "com/fr/base/images/oem/addworksheet.png", "com/fr/design/images/sheet/addpolysheet.png", @@ -249,6 +302,7 @@ public class ImagePreLoader { "com/fr/design/images/data/source/normalUp20.png", "com/fr/design/images/data/source/hoverUp20.png", "com/fr/design/images/m_edit/formatBrush.png", + "com/fr/design/images/m_edit/formatBrush_normal.svg", "com/fr/design/images/expand/none16x16_selected@1x.png", "com/fr/design/images/expand/vertical.png", "com/fr/design/images/expand/vertical_selected@1x.png", @@ -258,8 +312,14 @@ public class ImagePreLoader { "com/fr/design/images/expand/asc_selected.png", "com/fr/design/images/expand/des_selected.png", "com/fr/design/images/m_format/cellstyle/bold.png", + "com/fr/design/images/m_format/cellstyle/bold_normal.svg", + "com/fr/design/images/m_format/cellstyle/bold_selected.svg", "com/fr/design/images/m_format/cellstyle/italic.png", + "com/fr/design/images/m_format/cellstyle/italic_normal.svg", + "com/fr/design/images/m_format/cellstyle/italic_selected.svg", "com/fr/design/images/m_format/cellstyle/underline.png", + "com/fr/design/images/m_format/cellstyle/underline_normal.svg", + "com/fr/design/images/m_format/cellstyle/underline_selected.svg", "com/fr/design/images/m_format/cellstyle/strikethrough.png", "com/fr/design/images/m_format/cellstyle/shadow.png", "com/fr/design/images/m_format/cellstyle/sup.png", @@ -282,10 +342,16 @@ public class ImagePreLoader { "com/fr/design/images/m_format/cellstyle/in_white.png", "com/fr/design/images/m_format/cellstyle/h_left_normal.png", "com/fr/design/images/m_format/cellstyle/h_left_normal_white.png", + "com/fr/design/images/m_format/cellstyle/h_left_normal.svg", + "com/fr/design/images/m_format/cellstyle/h_left_selected.svg", "com/fr/design/images/m_format/cellstyle/h_center_normal.png", "com/fr/design/images/m_format/cellstyle/h_center_normal_white.png", + "com/fr/design/images/m_format/cellstyle/h_center_normal.svg", + "com/fr/design/images/m_format/cellstyle/h_center_selected.svg", "com/fr/design/images/m_format/cellstyle/h_right_normal.png", "com/fr/design/images/m_format/cellstyle/h_right_normal_white.png", + "com/fr/design/images/m_format/cellstyle/h_right_normal.svg", + "com/fr/design/images/m_format/cellstyle/h_right_selected.svg", "com/fr/design/images/m_format/cellstyle/h_s_normal.png", "com/fr/design/images/m_format/cellstyle/h_s_normal_white.png", "com/fr/design/images/m_format/cellstyle/defaultAlignment.png", @@ -299,8 +365,12 @@ public class ImagePreLoader { "com/fr/design/images/control/refresh.png", "com/fr/design/images/toolbarbtn/close.png", "com/fr/design/images/buttonicon/new_form3.png", + "com/fr/design/images/buttonicon/new_form3_normal.svg", "com/fr/design/images/m_file/save.png", + "com/fr/design/images/m_file/save_normal.svg", + "com/fr/design/images/m_file/save_disabled.svg", "com/fr/design/images/m_file/saveAs.png", + "com/fr/design/images/m_file/saveAs_normal.svg", "com/fr/design/images/m_edit/undo.png", "com/fr/design/images/m_edit/redo.png", "com/fr/design/images/m_file/excel.png", @@ -311,61 +381,104 @@ public class ImagePreLoader { "com/fr/design/images/m_file/text.png", "com/fr/design/images/m_web/datasource.png", "com/fr/design/images/m_report/webreportattribute.png", + "com/fr/design/images/m_report/webreportattribute_normal.svg", "com/fr/design/images/m_report/exportAttr.png", "com/fr/design/images/m_report/p.png", + "com/fr/design/images/m_report/p_normal.svg", "com/fr/design/images/m_report/mobile.png", + "com/fr/design/images/m_report/mobile_normal.svg", "com/fr/web/images/print.png", + "com/fr/web/images/print_normal.svg", "com/fr/design/images/m_report/watermark.png", + "com/fr/design/images/m_report/watermark_normal.svg", "com/fr/design/images/m_file/pageSetup.png", - "com/fr/design/images/m_file/repeatAndFrozen.png", + "com/fr/design/images/m_file/pageSetup_normal.svg", + "com/fr/design/images/m_file/repeatAndFrozen_normal.svg", "com/fr/design/images/m_report/header.png", + "com/fr/design/images/m_report/header_normal.svg", "com/fr/design/images/m_report/footer.png", + "com/fr/design/images/m_report/footer_normal.svg", "com/fr/design/images/m_report/background.png", + "com/fr/design/images/m_report/background_normal.svg", "com/fr/design/images/m_report/reportWriteAttr.png", + "com/fr/design/images/m_report/reportWriteAttr_normal.svg", "com/fr/design/images/m_report/linearAttr.png", + "com/fr/design/images/m_report/linearAttr_normal.svg", "com/fr/design/images/m_report/reportEngineAttr.png", + "com/fr/design/images/m_report/reportEngineAttr_normal.svg", "com/fr/design/images/m_report/allow_authority_edit.png", + "com/fr/design/images/m_report/allow_authority_edit_normal.svg", "com/fr/design/images/m_insert/bindColumn.png", + "com/fr/design/images/m_insert/bindColumn_normal.svg", + "com/fr/design/images/m_insert/bindColumn_disabled.svg", "com/fr/design/images/m_insert/text.png", + "com/fr/design/images/m_insert/text_normal.svg", + "com/fr/design/images/m_insert/text_disabled.svg", "com/fr/design/images/m_insert/richtext.png", + "com/fr/design/images/m_insert/richtext_normal.svg", + "com/fr/design/images/m_insert/richtext_disabled.svg", "com/fr/design/images/m_insert/chart.png", + "com/fr/design/images/m_insert/chart_normal.svg", + "com/fr/design/images/m_insert/chart_disabled.svg", "com/fr/design/images/m_insert/image.png", + "com/fr/design/images/m_insert/image_normal.svg", + "com/fr/design/images/m_insert/image_disabled.svg", "com/fr/design/images/m_insert/bias.png", + "/com/fr/design/images/m_insert/bias_normal.svg", + "/com/fr/design/images/m_insert/bias_disabled.svg", "com/fr/design/images/arrow/arrow_up.png", "com/fr/design/images/m_insert/subReport.png", + "com/fr/design/images/m_insert/subReport_normal.svg", + "com/fr/design/images/m_insert/subReport_disabled.svg", "com/fr/design/images/arrow/arrow_down.png", "com/fr/design/images/toolbarbtn/toolbarbtnsetting.png", "com/fr/design/images/control/addPopup.png", "com/fr/design/images/toolbarbtn/toolbarbtnclear.png", "com/fr/design/images/m_insert/insertRow.png", + "com/fr/design/images/m_insert/insertRow_normal.svg", "com/fr/design/images/m_insert/insertColumn.png", + "com/fr/design/images/m_insert/insertColumn_normal.svg", "com/fr/design/images/m_format/modified.png", + "com/fr/design/images/m_format/modified_normal.svg", "com/fr/design/images/m_format/highlight.png", + "com/fr/design/images/m_format/highlight_normal.svg", "com/fr/web/images/form/resources/preview_16.png", + "com/fr/web/images/form/resources/preview_16_normal.svg", "com/fr/web/images/save.png", "com/fr/design/images/m_insert/hyperLink.png", + "com/fr/design/images/m_insert/hyperLink_normal.svg", "com/fr/web/images/flashPrint.png", "com/fr/design/images/m_edit/merge.png", + "com/fr/design/images/m_edit/merge_normal.svg", + "com/fr/design/images/m_edit/merge_disabled.svg", "com/fr/web/images/appletPrint.png", "com/fr/design/images/m_edit/unmerge.png", + "com/fr/design/images/m_edit/unmerge_normal.svg", + "com/fr/design/images/m_edit/unmerge_disabled.svg", "com/fr/web/images/pdf.png", "com/fr/design/images/m_format/cellAttr.png", + "com/fr/design/images/m_format/cellAttr_normal.svg", "com/fr/web/images/pdfPrint.png", "com/fr/web/images/serverPrint.png", "com/fr/web/images/email.png", "com/fr/web/images/preview.png", "com/fr/design/images/server/platform_16_16.png", + "com/fr/design/images/server/platform_16_16_normal.svg", "com/fr/design/images/data/user_widget.png", "com/fr/design/images/server/plugin.png", + "com/fr/design/images/server/plugin_normal.svg", "com/fr/web/images/excel.png", "com/fr/design/images/m_web/function.png", + "com/fr/design/images/m_web/function_normal.svg", "com/fr/web/images/word.png", "com/fr/web/images/pageSetup.png", "com/fr/web/images/export.png", "com/fr/design/images/m_web/edit.png", + "com/fr/design/images/m_web/edit_normal.svg", "com/fr/web/images/pageNumber.png", "com/fr/web/images/first.png", "com/fr/design/images/m_web/style.png", + "com/fr/design/images/m_web/style_normal.svg", "com/fr/web/images/last.png", "com/fr/web/images/previous.png", "com/fr/web/images/next.png", @@ -375,22 +488,29 @@ public class ImagePreLoader { "com/fr/web/images/verify.png", "com/fr/web/images/save2.png", "com/fr/design/images/m_file/export.png", + "com/fr/design/images/m_file/export_normal.svg", "com/fr/web/images/showValue.png", "com/fr/web/images/pianyi.png", "com/fr/web/images/writeOffline.png", "com/fr/web/images/edit/stash.png", "com/fr/web/images/edit/clearstash.png", "com/fr/design/images/m_insert/cell.png", + "com/fr/design/images/m_insert/cell_normal.svg", "com/fr/design/images/m_insert/float.png", "com/fr/design/images/gui/color/background.png", + "com/fr/design/images/gui/color/background_normal.svg", "com/fr/design/images/m_format/cell.png", "com/fr/design/images/data/source/dataDictionary.png", + "com/fr/design/images/data/source/dataDictionary_normal.svg", "com/fr/design/images/m_format/cellstyle/bold_white.png", "com/fr/design/images/m_format/cellstyle/italic_white.png", "com/fr/design/images/m_format/cellstyle/underline_white.png", "com/fr/design/images/m_format/noboder.png", + "com/fr/design/images/m_format/noborder_normal.svg", "com/fr/design/images/gui/popup.gif", + "com/fr/design/images/gui/popup_normal.svg", "com/fr/design/images/m_insert/floatPop.png", + "com/fr/design/images/m_insert/floatPop_normal.svg", "com/fr/web/images/platform/demo.png", "com/fr/base/images/dialog/pagesetup/down.png", "com/fr/base/images/dialog/pagesetup/over.png", @@ -406,6 +526,17 @@ public class ImagePreLoader { "com/fr/design/images/condition/unBracket.png", "com/fr/design/images/buttonicon/user_search_normal.png", "com/fr/design/remote/images/icon_Member_normal@1x.png", - "/com/fr/design/images/buttonicon/add.png" + "/com/fr/design/images/buttonicon/add.png", + "com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg", + "com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg", + "com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg", + "com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg", + "com/fr/design/images/FileDealerPaneIcon/remove_normal.svg", + "com/fr/design/images/FileDealerPaneIcon/rename_normal.svg", + "com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg", + "com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg", + "com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg", + "com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg", + "com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg" }; } diff --git a/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch_normal.svg b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch_normal.svg new file mode 100644 index 0000000000..673548dfaf --- /dev/null +++ b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch_normal.svg @@ -0,0 +1,7 @@ + + + icon_搜索_normal + + + + From f0e3e6b681fd60fa29ac21ae5f4c97acaf99c79d Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 5 Jan 2021 10:07:57 +0800 Subject: [PATCH 071/104] =?UTF-8?q?REPORT-46347=20jdk11-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E5=9B=BE=E6=A0=87=E4=BC=98=E5=8C=96-tab?= =?UTF-8?q?=E5=9D=97=E5=9B=BE=E6=A0=87=E5=8F=98=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E7=BB=84=E5=90=8C=E5=AD=A6=E7=BB=99=E6=88=91=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E7=9A=84tab=E5=9D=97=E5=9B=BE=E6=A0=87=E6=98=AF=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E6=88=91=E6=B2=A1=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=B0=B1=E7=BB=99=E6=9B=BF=E6=8D=A2=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=E5=8E=9F=E6=9D=A5=E7=9A=84tab=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/images/buttonicon/card_layout_16_normal.svg | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg deleted file mode 100644 index 8df1897cd1..0000000000 --- a/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - icon_tab块_normal - - - - From e363a55a5412822fbb4cfa35289a2a9d297b448a Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 5 Jan 2021 10:11:20 +0800 Subject: [PATCH 072/104] =?UTF-8?q?REPORT-46347=20jdk11-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E5=9B=BE=E6=A0=87=E4=BC=98=E5=8C=96-tab?= =?UTF-8?q?=E5=9D=97=E5=9B=BE=E6=A0=87=E5=8F=98=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E7=BB=84=E5=90=8C=E5=AD=A6=E7=BB=99=E6=88=91=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E7=9A=84tab=E5=9D=97=E5=9B=BE=E6=A0=87=E6=98=AF=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E6=88=91=E6=B2=A1=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=B0=B1=E7=BB=99=E6=9B=BF=E6=8D=A2=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=E5=8E=9F=E6=9D=A5=E7=9A=84tab=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/images/buttonicon/card_layout_16_normal.svg | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg new file mode 100644 index 0000000000..95104065fb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg @@ -0,0 +1,7 @@ + + + icon_tab块_normal + + + + \ No newline at end of file From a0e4e344f67f3e5f00c35c8a6f6cee7763b39074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 5 Jan 2021 10:14:42 +0800 Subject: [PATCH 073/104] =?UTF-8?q?CHART-17758=20=E5=9F=8B=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=9D=E5=AD=98=E6=97=B6=E6=8C=89=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/info/ChartInfo.java | 19 ++++++++++++++++++- .../chart/info/ChartInfoCollector.java | 8 +++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java index 9025b98064..262ccc8778 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java @@ -19,6 +19,8 @@ import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; import com.fr.third.joda.time.DateTime; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Map; @@ -27,7 +29,7 @@ import java.util.Map; * @version 10.0 * Created by Bjorn on 2020-02-17 */ -public class ChartInfo extends AbstractPointInfo { +public class ChartInfo extends AbstractPointInfo implements Comparable { public static final String XML_TAG = "ChartInfo"; private static final String CHART_CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("chartinfo.consuming") + "/single"; private static final String CHART_FUNCTION_URL = CloudCenter.getInstance().acquireUrlByKind("chart.info.function") + "/single"; @@ -338,4 +340,19 @@ public class ChartInfo extends AbstractPointInfo { chartInfo.chartConfigInfo = chartConfigInfo.clone(); return chartInfo; } + + @Override + public int compareTo(ChartInfo chartInfo) { + DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + return format.parse(this.getCompareDate()).compareTo(format.parse(chartInfo.getCompareDate())); + } catch (Exception ex) { + return 1; + } + } + + private String getCompareDate() { + return StringUtils.isNotEmpty(chartConsumingMap.get(ATTR_CHART_PROPERTY_END_TIME)) ? + chartConsumingMap.get(ATTR_CHART_PROPERTY_END_TIME) : chartConsumingMap.get(ATTR_CHART_TYPE_TIME); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java index cd651fc6b3..1b34722e6f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java @@ -13,7 +13,10 @@ import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; import com.fr.third.joda.time.DateTime; +import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -269,7 +272,10 @@ public class ChartInfoCollector extends AbstractPointCollector { writer.end(); writer.startTAG(XML_CHART_INFO_LIST); - for (ChartInfo chartInfo : pointInfoMap.values()) { + + List list = new ArrayList<>(pointInfoMap.values()); + Collections.sort(list); + for (ChartInfo chartInfo : list) { chartInfo.writeXML(writer); } writer.end(); From 22ee76bd6435e7aa9941b85fbeb8ed9ff02dc699 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 5 Jan 2021 10:35:22 +0800 Subject: [PATCH 074/104] =?UTF-8?q?REPORT-44733=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=9B=9E=E9=80=80=EF=BC=8C=E6=94=B9=E5=8A=A8=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=85=B6=E4=BB=96=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=92=8C=E4=BA=A7=E5=93=81=E7=A1=AE=E8=AE=A4=E4=BA=86?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E5=85=B7=E4=BD=93=E9=80=BB=E8=BE=91=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E6=9C=AA=E5=AE=9A=EF=BC=8C=E5=90=8E=E7=BB=AD=E5=86=8D?= =?UTF-8?q?=E8=BF=AD=E4=BB=A3=E4=BB=BB=E5=8A=A1=E9=87=8C=E9=9D=A2=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XWAbsoluteLayout.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 9d70b7f0a2..da268b0e6c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -569,35 +569,6 @@ public class XWAbsoluteLayout extends XLayoutContainer { } } - /** - * 重新调整子组件宽度 - * @param width 宽度 - * @param actualSize 是否按照实际大小计算 - */ - @Override - public void recalculateChildWidth(int width, boolean actualSize){ - int componentCount = getComponentCount(); - for (int i = 0; i < componentCount; i++) { - XCreator creator = (XCreator) getComponent(i); - creator.recalculateChildWidth(width, actualSize); - } - } - - /** - * 重新调整子组件高度 - * @param height 高度 - * @param actualSize 是否按照实际大小计算 - */ - @Override - public void recalculateChildHeight(int height, boolean actualSize){ - int componentCount = getComponentCount(); - for (int i = 0; i < componentCount; i++) { - XCreator creator = (XCreator) getComponent(i); - creator.recalculateChildHeight(height, actualSize); - } - } - - /** * body大小手动调整的时候 * 按照比例调整组件的高度 From 064ac591acae802a42ca90160e693a665a89f1d6 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 5 Jan 2021 11:51:59 +0800 Subject: [PATCH 075/104] =?UTF-8?q?REPORT-45689=20=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/fun/MobileParamUIProvider.java | 37 +++++ .../impl/AbstractMobileParamUIProvider.java | 25 +++ .../DefaultMobileParamUIProvider.java | 33 ++++ .../provider/EmptyMobileParamUIProvider.java | 43 +++++ .../ui/DefaultMobileParamDefinePane.java | 42 +++++ .../mobile/ui/EmptyMobileParamDefinePane.java | 47 ++++++ .../mobile/ui/MobileParamDefinePane.java | 55 +++++++ .../mobile/ui/MobileParamSettingPane.java | 150 ++++++++++++++++++ .../widget/wrappers/MobileParamWrapper.java | 32 ++++ .../AccessibleMobileParamEditor.java | 48 ++++++ .../designer/mobile/ParaMobileDefinePane.java | 76 ++------- 11 files changed, 528 insertions(+), 60 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileParamUIProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/DefaultMobileParamUIProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/EmptyMobileParamUIProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileParamDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/EmptyMobileParamDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/MobileParamWrapper.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleMobileParamEditor.java diff --git a/designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java new file mode 100644 index 0000000000..a8d8acc4e0 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java @@ -0,0 +1,37 @@ +package com.fr.design.fun; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.form.ui.mobile.MobileParamStyle; +import com.fr.stable.fun.mark.Mutable; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/30 + */ + +public interface MobileParamUIProvider extends Mutable { + String XML_TAG = "MobileParamUIProvider"; + + int CURRENT_LEVEL = 1; + + + /** + * 扩展项的参数面板样式 + * @return + */ + Class classForMobileParamStyle(); + + /** + * 移动端参数面板中扩展项的面板 + * @return + */ + Class> classForMobileParamAppearance(); + + /** + * 扩展项的名称描述 + * @return + */ + String displayName(); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileParamUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileParamUIProvider.java new file mode 100644 index 0000000000..c31e74f7f5 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileParamUIProvider.java @@ -0,0 +1,25 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.MobileParamUIProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/12/30 + */ +@API(level = MobileParamUIProvider.CURRENT_LEVEL) +public abstract class AbstractMobileParamUIProvider extends AbstractProvider implements MobileParamUIProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/DefaultMobileParamUIProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/DefaultMobileParamUIProvider.java new file mode 100644 index 0000000000..3448ab202c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/DefaultMobileParamUIProvider.java @@ -0,0 +1,33 @@ +package com.fr.design.mainframe.mobile.provider; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.impl.AbstractMobileParamUIProvider; +import com.fr.design.mainframe.mobile.ui.DefaultMobileParamDefinePane; +import com.fr.form.ui.mobile.MobileParamStyle; +import com.fr.form.ui.mobile.impl.DefaultMobileParameterStyle; +import com.fr.locale.InterProviderFactory; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/4 + */ +public class DefaultMobileParamUIProvider extends AbstractMobileParamUIProvider { + + @Override + public Class classForMobileParamStyle() { + return DefaultMobileParameterStyle.class; + } + + @Override + public Class> classForMobileParamAppearance() { + return DefaultMobileParamDefinePane.class; + } + + @Override + public String displayName() { + return InterProviderFactory.getProvider().getLocText("Fine-Engine_Report_DEFAULT"); + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/EmptyMobileParamUIProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/EmptyMobileParamUIProvider.java new file mode 100644 index 0000000000..46ed13071f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/EmptyMobileParamUIProvider.java @@ -0,0 +1,43 @@ +package com.fr.design.mainframe.mobile.provider; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.impl.AbstractMobileParamUIProvider; +import com.fr.design.mainframe.mobile.ui.EmptyMobileParamDefinePane; +import com.fr.form.ui.mobile.MobileParamStyle; +import com.fr.report.fun.MobileParamStyleProvider; +import com.fr.report.mobile.EmptyMobileParamStyle; + +/** + * 作为MobileParamStyleProvider接口实现兼容转换层 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/1/4 + */ +public class EmptyMobileParamUIProvider extends AbstractMobileParamUIProvider { + + private MobileParamStyleProvider styleProvider; + + public EmptyMobileParamUIProvider(MobileParamStyleProvider styleProvider) { + this.styleProvider = styleProvider; + } + + @Override + public Class classForMobileParamStyle() { + return EmptyMobileParamStyle.class; + } + + @Override + public Class> classForMobileParamAppearance() { + return EmptyMobileParamDefinePane.class; + } + + @Override + public String displayName() { + return styleProvider.descriptor(); + } + + public MobileParamStyleProvider getStyleProvider() { + return styleProvider; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileParamDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileParamDefinePane.java new file mode 100644 index 0000000000..838e8f599e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileParamDefinePane.java @@ -0,0 +1,42 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.ui.mobile.MobileParamStyle; +import com.fr.form.ui.mobile.impl.DefaultMobileParameterStyle; +import java.awt.BorderLayout; +import javax.swing.JPanel; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/4 + */ +public class DefaultMobileParamDefinePane extends BasicBeanPane { + + public DefaultMobileParamDefinePane() { + initComponents(); + } + + private void initComponents() { + this.setLayout(new BorderLayout()); + JPanel centerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Set")); + this.add(centerPane); + } + + @Override + public void populateBean(MobileParamStyle ob) { + // do nothing + } + + @Override + public MobileParamStyle updateBean() { + return new DefaultMobileParameterStyle(); + } + + @Override + protected String title4PopupWindow() { + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/EmptyMobileParamDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/EmptyMobileParamDefinePane.java new file mode 100644 index 0000000000..b973d599a4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/EmptyMobileParamDefinePane.java @@ -0,0 +1,47 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.ui.mobile.MobileParamStyle; +import com.fr.report.fun.MobileParamStyleProvider; +import com.fr.report.mobile.EmptyMobileParamStyle; +import java.awt.BorderLayout; +import javax.swing.JPanel; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/4 + */ +public class EmptyMobileParamDefinePane extends BasicBeanPane { + + private final MobileParamStyleProvider styleProvider; + + public EmptyMobileParamDefinePane(MobileParamStyleProvider styleProvider) { + this.styleProvider = styleProvider; + initComponents(); + } + + private void initComponents() { + this.setLayout(new BorderLayout()); + JPanel centerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Set")); + this.add(centerPane); + } + + + @Override + public void populateBean(MobileParamStyle ob) { + + } + + @Override + public MobileParamStyle updateBean() { + return new EmptyMobileParamStyle(styleProvider); + } + + @Override + protected String title4PopupWindow() { + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamDefinePane.java new file mode 100644 index 0000000000..cd9ee22023 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamDefinePane.java @@ -0,0 +1,55 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.MobileParamUIProvider; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.mobile.provider.EmptyMobileParamUIProvider; +import com.fr.form.ui.mobile.MobileParamStyle; +import com.fr.general.ComparatorUtils; +import com.fr.invoke.Reflect; +import com.fr.report.mobile.EmptyMobileParamStyle; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/4 + */ +public class MobileParamDefinePane extends BasicBeanPane { + + private BasicBeanPane customBeanPane; + + public MobileParamDefinePane(MobileParamUIProvider provider) { + if (provider == null || provider.classForMobileParamAppearance() == null || provider.classForMobileParamAppearance() == null) { + return; + } + if (ComparatorUtils.equals(provider.classForMobileParamStyle(), EmptyMobileParamStyle.class)) { + EmptyMobileParamUIProvider emptyMobileParamUIProvider = (EmptyMobileParamUIProvider) provider; + this.customBeanPane = Reflect.on(provider.classForMobileParamAppearance()).create(emptyMobileParamUIProvider.getStyleProvider()).get(); + } else { + this.customBeanPane = Reflect.on(provider.classForMobileParamAppearance()).create().get(); + } + initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(customBeanPane); + } + + @Override + public void populateBean(MobileParamStyle ob) { + this.customBeanPane.populateBean(ob); + } + + @Override + public MobileParamStyle updateBean() { + + return this.customBeanPane.updateBean(); + + } + + @Override + protected String title4PopupWindow() { + return "MobileParamDefinePane"; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java new file mode 100644 index 0000000000..d2a358c192 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java @@ -0,0 +1,150 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.BasicPane; +import com.fr.design.fun.MobileParamUIProvider; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.mobile.provider.DefaultMobileParamUIProvider; +import com.fr.design.mainframe.mobile.provider.EmptyMobileParamUIProvider; +import com.fr.form.ui.container.WParameterLayout; +import com.fr.form.ui.mobile.MobileParamStyle; +import com.fr.general.ComparatorUtils; +import com.fr.report.ExtraReportClassManager; +import com.fr.report.fun.MobileParamStyleProvider; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import javax.swing.DefaultListCellRenderer; +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.JPanel; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/4 + */ +public class MobileParamSettingPane extends BasicPane { + + private DefaultListModel listModel; + private JPanel right; + private CardLayout card; + private JList paramStyleList; + + + private Map> map = new HashMap<>(); + + + public MobileParamSettingPane() { + initComponents(); + } + + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + listModel = new DefaultListModel<>(); + card = new CardLayout(); + right = FRGUIPaneFactory.createCardLayout_S_Pane(); + right.setLayout(card); + MobileParamUIProvider[] mobileParamUIProviders = getMobileParamUIProviders(); + for (MobileParamUIProvider provider : mobileParamUIProviders) { + addShowPane(provider); + } + initLeftPane(); + initRightPane(); + } + + private void initLeftPane() { + paramStyleList = new JList<>(listModel); + paramStyleList.setCellRenderer(new DefaultListCellRenderer() { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + if (value instanceof MobileParamStyle) { + MobileParamStyle style = (MobileParamStyle) value; + this.setText(style.toString()); + } + return this; + } + }); + paramStyleList.addListSelectionListener(e -> { + String selectedValue = (String) paramStyleList.getSelectedValue(); + card.show(right, selectedValue); + }); + JPanel leftPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + leftPane.add(paramStyleList); + leftPane.setPreferredSize(new Dimension(100, 500)); + this.add(leftPane, BorderLayout.WEST); + } + + private void initRightPane() { + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + JPanel attrConfPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + centerPane.setPreferredSize(new Dimension(500, 500)); + attrConfPane.add(right, BorderLayout.CENTER); + centerPane.add(attrConfPane, BorderLayout.CENTER); + this.add(centerPane, BorderLayout.CENTER); + } + + + public void populate(MobileParamStyle mobileParamStyle) { + if (mobileParamStyle != null) { + MobileParamUIProvider[] mobileParamUIProviders = getMobileParamUIProviders(); + for (int i = 0; i < mobileParamUIProviders.length; i++) { + MobileParamUIProvider provider = mobileParamUIProviders[i]; + if (ComparatorUtils.equals(mobileParamStyle.disPlayName(), provider.displayName())) { + String displayName = provider.displayName(); + paramStyleList.setSelectedIndex(i); + map.get(displayName).populateBean(mobileParamStyle); + card.show(right, displayName); + return; + } + } + } + paramStyleList.setSelectedIndex(0); + } + + private void addShowPane(MobileParamUIProvider provider) { + String displayName = provider.displayName(); + listModel.addElement(provider.displayName()); + BasicBeanPane paramStyleBasicBeanPane = new MobileParamDefinePane(provider); + right.add(displayName, paramStyleBasicBeanPane); + map.put(displayName, paramStyleBasicBeanPane); + } + + public MobileParamStyle update() { + return map.get(paramStyleList.getSelectedValue()).updateBean(); + } + + + @Override + protected String title4PopupWindow() { + return null; + } + + private MobileParamUIProvider[] getMobileParamUIProviders() { + Set paramUIProviders = ExtraDesignClassManager.getInstance().getArray(MobileParamUIProvider.XML_TAG); + List result = new ArrayList<>(); + result.add(new DefaultMobileParamUIProvider()); + result.addAll(paramUIProviders); + Set nameSets = paramUIProviders.stream().map(MobileParamUIProvider::displayName).collect(Collectors.toSet()); + // 兼容老接口 + Set paramStyleProviders = ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING); + + paramStyleProviders = paramStyleProviders.stream().filter(provider -> !nameSets.contains(provider.descriptor())).collect(Collectors.toSet()); + + for (MobileParamStyleProvider provider : paramStyleProviders) { + result.add(new EmptyMobileParamUIProvider(provider)); + } + + return result.toArray(new MobileParamUIProvider[0]); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/MobileParamWrapper.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/MobileParamWrapper.java new file mode 100644 index 0000000000..3ac8ff3768 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/MobileParamWrapper.java @@ -0,0 +1,32 @@ +package com.fr.design.mainframe.widget.wrappers; + +import com.fr.design.Exception.ValidationException; +import com.fr.design.designer.properties.Decoder; +import com.fr.design.designer.properties.Encoder; +import com.fr.locale.InterProviderFactory; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/4 + */ +public class MobileParamWrapper implements Encoder, Decoder { + + @Override + public Object decode(String txt) { + return null; + } + + @Override + public void validate(String txt) throws ValidationException { + // do nothing + } + + @Override + public String encode(Object v) { + if (v == null) { + return InterProviderFactory.getProvider().getLocText("Fine-Engine_Report_DEFAULT"); + } + return v.toString(); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleMobileParamEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleMobileParamEditor.java new file mode 100644 index 0000000000..94fa4607c3 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleMobileParamEditor.java @@ -0,0 +1,48 @@ +package com.fr.design.mainframe.widget.accessibles; + +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.mobile.ui.MobileParamSettingPane; +import com.fr.design.mainframe.widget.wrappers.MobileParamWrapper; +import com.fr.form.ui.container.WParameterLayout; +import com.fr.form.ui.mobile.MobileParamStyle; +import com.fr.report.mobile.EmptyMobileParamStyle; +import javax.swing.SwingUtilities; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/4 + */ +public class AccessibleMobileParamEditor extends UneditableAccessibleEditor { + + private MobileParamSettingPane mobileParamSettingPane; + + public AccessibleMobileParamEditor(MobileParamSettingPane mobileParamSettingPane) { + super(new MobileParamWrapper()); + this.mobileParamSettingPane = mobileParamSettingPane; + } + + @Override + protected void showEditorPane() { + mobileParamSettingPane.setPreferredSize(BasicDialog.MEDIUM); + BasicDialog dlg = mobileParamSettingPane.showWindow(SwingUtilities.getWindowAncestor(this)); + dlg.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + MobileParamStyle mobileParamStyle = mobileParamSettingPane.update(); + setValue(mobileParamStyle); + FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + WParameterLayout wParameterLayout = (WParameterLayout) formDesigner.getSelectionModel().getSelection().getSelectedCreator().toData(); + if (mobileParamStyle instanceof EmptyMobileParamStyle) { + wParameterLayout.setProvider(((EmptyMobileParamStyle) mobileParamStyle).getProvider()); + } + fireStateChanged(); + } + }); + mobileParamSettingPane.populate((MobileParamStyle) getValue()); + dlg.setVisible(true); + } +} diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index cf909618c4..1c1fe0150d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -5,11 +5,9 @@ import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.properties.PropertyTab; -import com.fr.design.designer.properties.items.Item; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.fun.ParameterExpandablePaneUIProvider; import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; @@ -17,25 +15,21 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.MobileWidgetListPane; import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.mobile.ui.MobileParamSettingPane; +import com.fr.design.mainframe.widget.accessibles.AccessibleMobileParamEditor; import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WSortLayout; +import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.general.CloudCenter; -import com.fr.general.ComparatorUtils; -import com.fr.general.SiteCenter; import com.fr.log.FineLoggerFactory; -import com.fr.report.ExtraReportClassManager; -import com.fr.report.fun.MobileParamStyleProvider; -import com.fr.report.mobile.DefaultMobileParamStyle; - +import com.fr.report.mobile.EmptyMobileParamStyle; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Cursor; import java.awt.Desktop; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.net.URI; @@ -47,10 +41,9 @@ import java.util.Set; public class ParaMobileDefinePane extends MobileWidgetDefinePane { private XCreator paraCreator; private FormDesigner designer; - private Item[] items; - private UIComboBox paramLocationComboBox; private AttributeChangeListener changeListener; private MobileWidgetListPane mobileWidgetListPane; + private AccessibleMobileParamEditor mobileParamEditor; public ParaMobileDefinePane(XCreator xCreator) { this.paraCreator = xCreator; @@ -81,18 +74,15 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { // 手机属性 private UIExpandablePane getMobilePropertyPane() { - paramLocationComboBox = getParamLocationComboBox(); + mobileParamEditor = new AccessibleMobileParamEditor(new MobileParamSettingPane()); UILabel tipLabel = getTipLabel(); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}}; - if (ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING).isEmpty()) { - ((WParameterLayout) (paraCreator.toData())).setProvider((MobileParamStyleProvider) ((Item) paramLocationComboBox.getItemAt(0)).getValue()); - } Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Parameter_Panel")), paramLocationComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Parameter_Panel")), mobileParamEditor}, new Component[]{tipLabel, null}, }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); @@ -102,18 +92,6 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile"), 280, 20, jPanel); } - private Item[] getItems() { - Set pluginCreators = ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING); - Item[] items = new Item[pluginCreators.size() + 1]; - MobileParamStyleProvider provider = new DefaultMobileParamStyle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")); - items[0] = new Item(provider.descriptor(), provider); - int i = 1; - for (MobileParamStyleProvider mobileParamStyleProvider : pluginCreators) { - items[i++] = new Item(mobileParamStyleProvider.descriptor(), mobileParamStyleProvider); - } - return items; - } - private UILabel getTipLabel() { UILabel tipLabel = new UILabel(); StringBuilder text = new StringBuilder(); @@ -156,21 +134,6 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { return tipLabel; } - private UIComboBox getParamLocationComboBox() { - items = getItems(); - - UIComboBox paramLocationComoBox = new UIComboBox(items); - paramLocationComoBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { - ((WParameterLayout) (paraCreator.toData())).setProvider((MobileParamStyleProvider) ((Item) e.getItem()).getValue()); - } - } - }); - return paramLocationComoBox; - } - // 控件顺序 private UIExpandablePane getMobileWidgetListPane() { mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); @@ -205,27 +168,20 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { // 设置监听 this.bindListeners2Widgets(); this.addAttributeChangeListener(changeListener); - int index = 0; - try { - MobileParamStyleProvider provider = ((WParameterLayout) paraCreator.toData()).getProvider(); - String currentQueryType = provider.createJSON().getString("queryType"); - for (int i = 0; i < items.length; i++) { - String existedQueryType = ((MobileParamStyleProvider) items[i].getValue()).createJSON().getString("queryType"); - if (ComparatorUtils.equals(existedQueryType, currentQueryType)) { - index = i; - break; - } - } - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - paramLocationComboBox.setSelectedIndex(index); - + WParameterLayout wParameterLayout = (WParameterLayout) paraCreator.toData(); + this.mobileParamEditor.setValue(wParameterLayout.getMobileParamStyle()); } @Override public void update() { mobileWidgetListPane.updateToDesigner(); + WParameterLayout wParameterLayout = (WParameterLayout) paraCreator.toData(); + MobileParamStyle mobileParamStyle = (MobileParamStyle) this.mobileParamEditor.getValue(); + if (mobileParamStyle instanceof EmptyMobileParamStyle) { + wParameterLayout.setProvider(((EmptyMobileParamStyle) mobileParamStyle).getProvider()); + } + wParameterLayout.setMobileParamStyle(mobileParamStyle); + designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); } } From ef5fe653ca0e8c3940d15dffcc966f27adf516b8 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 5 Jan 2021 14:07:31 +0800 Subject: [PATCH 076/104] =?UTF-8?q?REPORT-44577=20=E5=AF=B9=E4=BA=8E?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E5=9E=8B=E6=8F=92=E4=BB=B6=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=9C=A8=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E5=88=B0=E7=A9=BA=E7=9A=84=E5=AE=B9=E5=99=A8=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E6=B2=A1=E6=9C=89=E6=88=90=E5=8A=9F=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E5=88=B0=E5=AE=B9=E5=99=A8=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/FormWidgetOptionProvider.java | 8 +++++++ .../AbstractFormWidgetOptionProvider.java | 5 +++++ .../designer/beans/models/SelectionModel.java | 14 +++++++++++- .../design/mainframe/FormSelectionUtils.java | 22 +++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java index 9f033d6dc6..304b7d94a5 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java @@ -23,4 +23,12 @@ public interface FormWidgetOptionProvider extends ParameterWidgetOptionProvider */ void paste2Container(T t); + /** + * 往扩展容器本身中添加粘贴内容 + * @param r + * @param + * @param + */ + void formWidgetPaste(T t, R r, int x, int y); + } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java index 537a49d018..2e0633e870 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java @@ -30,4 +30,9 @@ public abstract class AbstractFormWidgetOptionProvider extends AbstractProvider public void paste2Container(T t) { // do nothing } + + @Override + public void formWidgetPaste(T t, R r, int x, int y) { + // do nothing + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index f6c74986e0..dc74087c40 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -399,8 +399,10 @@ public class SelectionModel { boolean relativeEditor = selectionXCreator.getClass().equals(XWFitLayout.class); //选中的参数面板编辑器本身 boolean parameterEditor = selectionXCreator.getClass().equals(XWParameterLayout.class); + // 选中的是扩展容器布局本身 + boolean extraEditor = isSelectedExtraEditor(selectionXCreator); - return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor || parameterEditor); + return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor || parameterEditor || extraEditor); } else { return false; } @@ -410,6 +412,16 @@ public class SelectionModel { } } + private boolean isSelectedExtraEditor(XCreator selectionXCreator) { + Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), selectionXCreator.getClass())) { + return true; + } + } + return false; + } + /** * 是否有组件被选择。如果所选组件是最底层容器,也视为无选择 * diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java index c310ee5780..2900650aa0 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.AbstractLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRTabFitLayoutAdapter; @@ -12,6 +13,7 @@ import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWScaleLayout; import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.utils.ComponentUtils; import com.fr.form.main.Form; import com.fr.form.ui.Widget; @@ -26,6 +28,7 @@ import java.awt.Toolkit; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Set; /** * 表单选中工具类 @@ -46,6 +49,8 @@ public class FormSelectionUtils { */ private static final String POSTFIX = "_c"; + private static FormWidgetOptionProvider optionProvider; + private FormSelectionUtils() { } @@ -64,10 +69,27 @@ public class FormSelectionUtils { //相对布局 relativePaste(designer, clipboard, adapter, x, y); return; + } else if (isExtraContainer(parent)) { + // 扩展布局 + optionProvider.formWidgetPaste(clipboard, adapter, x, y); + return; } Toolkit.getDefaultToolkit().beep(); } + private static boolean isExtraContainer(XLayoutContainer parent) { + if (parent != null) { + Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), parent.getClass())) { + optionProvider = provider; + return true; + } + } + } + return false; + } + public static void rebuildSelection(FormDesigner designer) { ArrayList newSelection = new ArrayList<>(); From 099c818a7e05e2ac03ee98052137698c1b907035 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 5 Jan 2021 14:10:27 +0800 Subject: [PATCH 077/104] =?UTF-8?q?REPORT-44577=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/fun/FormWidgetOptionProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java index 304b7d94a5..d1b64e2bd9 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java @@ -26,8 +26,8 @@ public interface FormWidgetOptionProvider extends ParameterWidgetOptionProvider /** * 往扩展容器本身中添加粘贴内容 * @param r - * @param - * @param + * @param 粘贴板选中的组件 + * @param 容器布局适配器 */ void formWidgetPaste(T t, R r, int x, int y); From 3fd24c84b31da1c055df2bcf7a04e8bad9f39df8 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 5 Jan 2021 14:38:55 +0800 Subject: [PATCH 078/104] =?UTF-8?q?REPORT-45689=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/widget/wrappers/MobileParamWrapper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/MobileParamWrapper.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/MobileParamWrapper.java index 3ac8ff3768..d4f2b8129e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/MobileParamWrapper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/MobileParamWrapper.java @@ -4,6 +4,7 @@ import com.fr.design.Exception.ValidationException; import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Encoder; import com.fr.locale.InterProviderFactory; +import org.jetbrains.annotations.Nullable; /** * @author hades @@ -12,6 +13,7 @@ import com.fr.locale.InterProviderFactory; */ public class MobileParamWrapper implements Encoder, Decoder { + @Nullable @Override public Object decode(String txt) { return null; From 7166140eefb0e2b7f1618b966c8c2ed3e38db94a Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 5 Jan 2021 14:45:34 +0800 Subject: [PATCH 079/104] =?UTF-8?q?REPORT-46495=20=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=AF=AD=E8=A8=80=E4=B8=BA=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E6=97=B6=E4=BC=9A=E6=98=BE=E7=A4=BA=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E7=9A=84=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/upm/UpmUtils.java | 2 + .../java/com/fr/design/upm/UpmUtilsTest.java | 57 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 designer-base/src/test/java/com/fr/design/upm/UpmUtilsTest.java diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmUtils.java b/designer-base/src/main/java/com/fr/design/upm/UpmUtils.java index d27b6721a4..e97a5826a1 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmUtils.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmUtils.java @@ -3,6 +3,7 @@ package com.fr.design.upm; import com.fr.common.annotations.Negative; import com.fr.config.ServerPreferenceConfig; import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; import com.fr.stable.StringUtils; import java.util.ArrayList; @@ -31,6 +32,7 @@ public class UpmUtils { Map map4Tpl = new HashMap<>(); map4Tpl.put("version", ServerPreferenceConfig.getInstance().getOptimizedUPMVersion()); map4Tpl.put("new_version", fetchLatestVersion()); + map4Tpl.put("language", GeneralContext.getLocale().toString()); return map4Tpl; } diff --git a/designer-base/src/test/java/com/fr/design/upm/UpmUtilsTest.java b/designer-base/src/test/java/com/fr/design/upm/UpmUtilsTest.java new file mode 100644 index 0000000000..31119d049c --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/upm/UpmUtilsTest.java @@ -0,0 +1,57 @@ +package com.fr.design.upm; + +import com.fr.config.ServerPreferenceConfig; +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.api.easymock.PowerMock; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; +import org.powermock.modules.junit4.PowerMockRunner; + +import java.util.Locale; +import java.util.Map; + +/** + * @author Lucian.Chen + * @version 10.0 + * Created by Lucian.Chen on 2021/1/5 + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest({ServerPreferenceConfig.class, CloudCenter.class}) +@SuppressStaticInitializationFor("com.fr.general.CloudCenter") +public class UpmUtilsTest { + + @Test + public void testRenderMap() { + + ServerPreferenceConfig serverPreferenceConfig = EasyMock.mock(ServerPreferenceConfig.class); + EasyMock.expect(serverPreferenceConfig.getOptimizedUPMVersion()).andReturn("1.0").anyTimes(); + PowerMock.mockStatic(ServerPreferenceConfig.class); + EasyMock.expect(ServerPreferenceConfig.getInstance()).andReturn(serverPreferenceConfig).anyTimes(); + + CloudCenter cloudCenter = EasyMock.mock(CloudCenter.class); + EasyMock.expect(cloudCenter.acquireUrlByKind("upm.script.version")).andReturn("2.0").anyTimes(); + PowerMock.mockStatic(CloudCenter.class); + EasyMock.expect(CloudCenter.getInstance()).andReturn(cloudCenter).anyTimes(); + + EasyMock.replay(serverPreferenceConfig, cloudCenter); + PowerMock.replayAll(); + + GeneralContext.setLocale(Locale.CHINA); + + Map map4Tpl = UpmUtils.renderMap(); + Assert.assertEquals(map4Tpl.size(), 3); + Assert.assertEquals(map4Tpl.get("version"), "1.0"); + Assert.assertEquals(map4Tpl.get("new_version"), "2.0"); + Assert.assertEquals(map4Tpl.get("language"), "zh_CN"); + + + EasyMock.verify(serverPreferenceConfig, cloudCenter); + PowerMock.verifyAll(); + + } +} From 50ec0a73e8c4df18694bbab96b8c9cd23bea5a28 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 5 Jan 2021 17:46:01 +0800 Subject: [PATCH 080/104] =?UTF-8?q?REPORT-46575=E3=80=9010.0.13=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91mac=E4=B8=8B=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=B1=95=E7=A4=BA=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/MutilTempalteTabPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 269918448a..99cd179169 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -11,6 +11,7 @@ import com.fr.design.gui.imenu.UIScrollPopUpMenu; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.file.FILE; @@ -35,7 +36,6 @@ import java.awt.AlphaComposite; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; -import java.awt.Font; import java.awt.GradientPaint; import java.awt.Graphics; import java.awt.Graphics2D; @@ -136,7 +136,7 @@ public class MutilTempalteTabPane extends JComponent { this.addMouseMotionListener(new MultiTemplateTabMouseMotionListener()); this.setBorder(null); this.setForeground(new Color(58, 56, 58)); - this.setFont(new Font(Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"), 0, 12)); + this.setFont(DesignUtils.getDefaultGUIFont().applySize(12)); openedTemplate = HistoryTemplateListCache.getInstance().getHistoryList(); selectedIndex = openedTemplate.size() - 1; AWTEventListener awt = new AWTEventListener() { From 281d36524db0ca84efe8f57c6fe03067e3cff7a6 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 6 Jan 2021 10:46:42 +0800 Subject: [PATCH 081/104] =?UTF-8?q?REPORT-46353=20jdk8-=E6=8F=92=E5=85=A5?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E6=96=87=E6=9C=AC=E5=9B=BE=E6=A0=87=E5=8F=98?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E4=BA=86=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D=E7=9A=84=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=B3=BB=E7=BB=9Fscale=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E6=98=AFjdk8=EF=BC=8Cmac=E4=B8=8B=E4=BC=9A=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=88=B01.0=EF=BC=8C=E7=84=B6=E5=90=8E=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E5=B0=B1=E6=B2=A1=E6=9C=89jdk11=E4=B8=8B=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=88=902.0=E9=82=A3=E4=B9=88=E6=B8=85=E6=99=B0=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=B8=8B=E6=98=AF=E4=B8=8D=E6=98=AFretina?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E8=BF=94=E5=9B=9E2.0=E7=9A=84scale=EF=BC=9B=E5=8F=A6?= =?UTF-8?q?=E5=A4=96=E5=8F=91=E7=8E=B0=E5=AE=9A=E4=B9=89=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E7=9A=84svg=E5=9B=BE=E7=89=87=E6=BC=8F?= =?UTF-8?q?=E4=BC=A0=E4=BA=86=EF=BC=8C=E4=B9=9F=E4=BC=A0=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/base/svg/SystemScaleUtils.java | 7 ++++++- .../com/fr/design/images/m_web/connection_normal.svg | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/connection_normal.svg diff --git a/designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java b/designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java index ee289b4c8a..4b79748065 100644 --- a/designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java +++ b/designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java @@ -1,5 +1,6 @@ package com.fr.base.svg; +import com.bulenkov.iconloader.util.UIUtil; import com.fr.log.FineLoggerFactory; import com.fr.stable.StableUtils; import com.fr.stable.os.OperatingSystem; @@ -77,6 +78,10 @@ public class SystemScaleUtils { * @return */ public static float sysScale() { + // 如果检测到是retina,直接返回2 + if (UIUtil.isRetina()) { + return 2.0f; + } float scale = 1.0f; // 先判断是否支持高清,不支持代表此时是Windows + jdk8 的设计器,返回的scale值为1.0 if (isJreHiDPIEnabled()) { @@ -86,7 +91,7 @@ public class SystemScaleUtils { // 获取图形配置对象 GraphicsConfiguration configuration = graphicsDevice.getDefaultConfiguration(); if (configuration != null && configuration.getDevice().getType() != GraphicsDevice.TYPE_PRINTER) { - // 获取屏幕缩放率,mac下固定为2,Windows+jdk11则将得到用户设置的dpi值 + // 获取屏幕缩放率,Windows+jdk11环境下会得到用户设置的dpi值 scale = (float) configuration.getDefaultTransform().getScaleX(); } } diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/connection_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/connection_normal.svg new file mode 100644 index 0000000000..7c865b45e0 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/connection_normal.svg @@ -0,0 +1,11 @@ + + + icon_定义数据连接_normal备份 + + + + + + + + \ No newline at end of file From 233015a79ab50237a1e05211b8499ad4dfe95541 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 6 Jan 2021 16:03:45 +0800 Subject: [PATCH 082/104] =?UTF-8?q?REPORT-46575=E3=80=9010.0.13=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E7=95=8C=E9=9D=A2=E7=BB=84=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81=E7=9A=84=E5=AD=97=E4=BD=93=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=BB=9F=E4=B8=80UI=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/date/CalendarNumberField.java | 22 +- .../fr/design/gui/date/UICalendarPanel.java | 123 ++--- .../com/fr/design/gui/date/UIDayLabel.java | 7 +- .../gui/itree/filetree/ReportletPane.java | 22 +- .../mainframe/EastRegionContainerPane.java | 5 +- .../com/fr/design/mainframe/JSliderPane.java | 10 +- .../fr/design/designer/creator/XButton.java | 435 +++++++++--------- .../widget/ui/designer/RadioDefinePane.java | 70 ++- .../com/fr/design/condition/FontPane.java | 10 +- .../alphafine/AlphaFineConstants.java | 9 +- .../alphafine/preview/NoResultPane.java | 12 +- .../design/mainframe/bbs/BBSLoginDialog.java | 18 +- .../fr/design/report/ReportColumnsPane.java | 5 +- .../com/fr/design/report/RichTextPane.java | 4 +- .../fr/design/widget/ui/RadioDefinePane.java | 68 ++- .../widget/ui/UserEditorDefinePane.java | 12 +- .../floatquick/FloatStringQuickEditor.java | 4 +- 17 files changed, 425 insertions(+), 411 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/date/CalendarNumberField.java b/designer-base/src/main/java/com/fr/design/gui/date/CalendarNumberField.java index 5a3fb62b50..1908751c6a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/CalendarNumberField.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/CalendarNumberField.java @@ -1,12 +1,14 @@ package com.fr.design.gui.date; import com.fr.design.gui.itextfield.UINumberField; - +import com.fr.design.utils.DesignUtils; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.PlainDocument; -import java.awt.*; +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.Toolkit; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; @@ -21,7 +23,7 @@ public class CalendarNumberField extends UINumberField { private static final int NUM_TEN = 10; - public CalendarNumberField( double maxValue) { + public CalendarNumberField(double maxValue) { super(2, 0, 0, maxValue); this.setBorderPainted(false); addFocusListener(new FocusAdapter() { @@ -30,12 +32,12 @@ public class CalendarNumberField extends UINumberField { setValue(getIntValue()); } }); - this.setFont(new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"),0,12)); + this.setFont(DesignUtils.getDefaultGUIFont()); } public void setValue(int value) { if (value < 0) { - value = (int)getMaxValue(); + value = (int) getMaxValue(); } if (value > getMaxValue()) { value = 0; @@ -43,7 +45,7 @@ public class CalendarNumberField extends UINumberField { this.setText(getValueText(value)); } - public int getIntValue () { + public int getIntValue() { if (this.getText().length() == 0) { return 0; } @@ -61,8 +63,7 @@ public class CalendarNumberField extends UINumberField { } - - public void setFieldDocument(){ + public void setFieldDocument() { setDocument(new NumberDocument()); } @@ -89,14 +90,15 @@ public class CalendarNumberField extends UINumberField { super.insertString(offset, s, a); } - private boolean isOverMaxOrMinValue( String strNew) { - return (Double.parseDouble(strNew)getMaxValue()); + private boolean isOverMaxOrMinValue(String strNew) { + return (Double.parseDouble(strNew) < getMinValue() || Double.parseDouble(strNew) > getMaxValue()); } } public Dimension getPreferredSize() { return new Dimension(24, 11); } + public boolean shouldResponseChangeListener() { return false; } diff --git a/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java b/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java index c21b740c43..fbbe38ce48 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java @@ -7,8 +7,8 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUIPaintUtils; - import com.fr.stable.Constants; import com.fr.stable.StringUtils; @@ -45,8 +45,8 @@ import java.util.Calendar; import java.util.Date; public class UICalendarPanel extends JPanel { - private static final Font FONT_SONG = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"),0,12); - private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"),0,12); + private static final Font FONT_UI = DesignUtils.getDefaultGUIFont().applySize(12); + private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"), Font.PLAIN, 12); private static final int WEEKDAY_COUNT = 7; private static final int TOTAL_DAYS_COUNT = 42; @@ -108,13 +108,13 @@ public class UICalendarPanel extends JPanel { } // << < yyyy/MM/dd > >> - private JPanel createNorthPane () { + private JPanel createNorthPane() { JPanel pNorth = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane(); pNorth.setBackground(new Color(0xFFFFFF)); pNorth.setPreferredSize(new Dimension(1, 22)); pNorth.add(Box.createHorizontalStrut(5)); - pNorth.add(createSkipButton(Calendar.YEAR, -1 , new Icon[] { + pNorth.add(createSkipButton(Calendar.YEAR, -1, new Icon[]{ BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce.png"), BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce_hover.png"), BaseUtils.readIcon("/com/fr/design/images/calender/year_reduce_click.png") @@ -130,7 +130,7 @@ public class UICalendarPanel extends JPanel { monthLabel = new UILabel("", UILabel.CENTER); monthLabel.setBackground(new Color(0xFFFFFF)); monthLabel.setForeground(new Color(0x000000)); - monthLabel.setFont(FONT_SONG); + monthLabel.setFont(FONT_UI); pNorth.add(Box.createHorizontalGlue()); pNorth.add(monthLabel); pNorth.add(Box.createHorizontalGlue()); @@ -144,7 +144,7 @@ public class UICalendarPanel extends JPanel { monthPlus.setHorizontalAlignment(SwingConstants.RIGHT); pNorth.add(monthPlus); pNorth.add(Box.createHorizontalStrut(11)); - pNorth.add(createSkipButton(Calendar.YEAR, 1 , new Icon[] { + pNorth.add(createSkipButton(Calendar.YEAR, 1, new Icon[]{ BaseUtils.readIcon("/com/fr/design/images/calender/year_add.png"), BaseUtils.readIcon("/com/fr/design/images/calender/year_add_hover.png"), BaseUtils.readIcon("/com/fr/design/images/calender/year_add_click.png") @@ -161,9 +161,9 @@ public class UICalendarPanel extends JPanel { pWeeks.setPreferredSize(new Dimension(216, 22)); pWeeks.setBackground(new Color(0xFFFFFF)); pWeeks.setOpaque(true); - String[] strWeeks = new String[] {StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Fri"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat") + String[] strWeeks = new String[]{StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Fri"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat") }; for (int i = 1; i <= WEEKDAY_COUNT; i++) { UILabel label = new UILabel(); @@ -197,32 +197,32 @@ public class UICalendarPanel extends JPanel { return pCenter; } - private JPanel createSouthPane () { + private JPanel createSouthPane() { JPanel sPane = new JPanel(); sPane.setPreferredSize(new Dimension(216, 30)); sPane.setBackground(Color.WHITE); sPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 6)); UILabel timeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Time") + ":"); - timeLabel.setBorder(BorderFactory.createEmptyBorder(0,9,0,5)); - timeLabel.setFont(FONT_SONG); + timeLabel.setBorder(BorderFactory.createEmptyBorder(0, 9, 0, 5)); + timeLabel.setFont(FONT_UI); sPane.add(timeLabel); hms = new HMSPane(); sPane.add(hms); UILabel gap = new UILabel(); - gap.setPreferredSize(new Dimension(26,1)); + gap.setPreferredSize(new Dimension(26, 1)); sPane.add(gap); UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")) { public Dimension getPreferredSize() { - return new Dimension(32,18); + return new Dimension(32, 18); } public Insets getInsets() { return new Insets(0, 0, 0, 0); } }; - okButton.setFont(FONT_SONG); + okButton.setFont(FONT_UI); okButton.setVerticalAlignment(SwingConstants.CENTER); okButton.addActionListener(new ActionListener() { @@ -248,11 +248,12 @@ public class UICalendarPanel extends JPanel { /** * 创建上一月,下一月,上一年,下一年"按钮" - * @param field int + * + * @param field int * @param amount int * @return UILabel */ - protected UILabel createSkipButton(final int field, final int amount,final Icon[] icons) { + protected UILabel createSkipButton(final int field, final int amount, final Icon[] icons) { if (icons.length != 3) { return new UILabel(); } @@ -274,11 +275,11 @@ public class UICalendarPanel extends JPanel { } public void mouseEntered(MouseEvent e) { - label.setIcon(icons[1]); + label.setIcon(icons[1]); } public void mouseExited(MouseEvent e) { - label.setIcon(icons[0]); + label.setIcon(icons[0]); } public void mousePressed(MouseEvent e) { @@ -311,7 +312,7 @@ public class UICalendarPanel extends JPanel { gp.setBorder(null); UIDayLabel label = new UIDayLabel(setupCalendar.getTime()); label.setHorizontalAlignment(SwingConstants.RIGHT); - label.setBorder(BorderFactory.createEmptyBorder(0,0,0,9)); + label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 9)); label.addMouseListener(dayBttListener); if ("1".equals(label.getText())) { isCurrentMonth = !isCurrentMonth; @@ -328,7 +329,7 @@ public class UICalendarPanel extends JPanel { days.setSelectedIndex(i); this.selectedDate = label.getDate(); this.calendar.setTime(this.selectedDate); - }else { + } else { gp.add(label, BorderLayout.CENTER); days.add(gp); } @@ -337,7 +338,7 @@ public class UICalendarPanel extends JPanel { } public void updateHMS() { - if (hms != null){ + if (hms != null) { hms.populate(this.calendar); hms.validate(); } @@ -388,9 +389,9 @@ public class UICalendarPanel extends JPanel { public void mousePressed(MouseEvent e) { if (isEnabled()) { UIDayLabel com = (UIDayLabel) e.getComponent(); - GradientPane gp = (GradientPane)com.getParent(); + GradientPane gp = (GradientPane) com.getParent(); if (days.selectedIndex != -1) { - ((GradientPane)days.getComponent(days.selectedIndex)).setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM)); + ((GradientPane) days.getComponent(days.selectedIndex)).setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM)); } gp.setGradientBackground(new GradientBackground(new Color(0x097BD9), new Color(0x41A3EE), GradientBackground.TOP2BOTTOM)); days.setSelectedIndex(gp.getIndex()); @@ -413,7 +414,7 @@ public class UICalendarPanel extends JPanel { public void mouseEntered(MouseEvent e) { if (isEnabled()) { JComponent com = (JComponent) e.getComponent(); - GradientPane gp = (GradientPane)com.getParent(); + GradientPane gp = (GradientPane) com.getParent(); if (gp.getIndex() == days.selectedIndex) { return; } @@ -426,7 +427,7 @@ public class UICalendarPanel extends JPanel { public void mouseExited(MouseEvent e) { if (isEnabled()) { JComponent com = (JComponent) e.getComponent(); - GradientPane gp = (GradientPane)com.getParent(); + GradientPane gp = (GradientPane) com.getParent(); if (gp.getIndex() != days.selectedIndex) { gp.setGradientBackground(new GradientBackground(new Color(0xFEFEFE), new Color(0xF3F2F3), GradientBackground.TOP2BOTTOM)); } @@ -489,7 +490,7 @@ public class UICalendarPanel extends JPanel { this.isGradientBackground = isGradientBackground; } - public void paint(Graphics g){ + public void paint(Graphics g) { super.paint(g); if (isGradientBackground && gradientBackground != null) { gradientBackground.paint(g, new Rectangle(this.getWidth(), this.getHeight())); @@ -509,7 +510,7 @@ public class UICalendarPanel extends JPanel { this.index = i; } - public int getIndex () { + public int getIndex() { return this.index; } @@ -530,12 +531,12 @@ public class UICalendarPanel extends JPanel { public DayPane() { floateIndex = -1; selectedIndex = -1; - this.setLayout(new GridLayout(6,7,1,1)); + this.setLayout(new GridLayout(6, 7, 1, 1)); this.setBackground(new Color(0xFFFFFF)); this.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 0, new Color(0xDADADA))); } - public void paint (Graphics g) { + public void paint(Graphics g) { super.paint(g); int width = 31; int height = 19; @@ -543,11 +544,11 @@ public class UICalendarPanel extends JPanel { g.setColor(new Color(0xDADADA)); int start_x = 30; int start_y = 19; - for (int i = 0; i < 6; i ++) { + for (int i = 0; i < 6; i++) { g.drawLine(start_x, 0, start_x, getHeight()); start_x += width; } - for (int i = 0; i < 5; i ++){ + for (int i = 0; i < 5; i++) { g.drawLine(0, start_y, getWidth(), start_y); start_y += height; } @@ -558,25 +559,25 @@ public class UICalendarPanel extends JPanel { } if (selectedIndex > -1) { g.setColor(selectedColor); - paintChindPane(g,selectedIndex); + paintChindPane(g, selectedIndex); } g.setColor(oldColor); } private void paintChindPane(Graphics g, int index) { - if (index%7 == 0 ) { - int y1 = index/7*19; - g.drawLine(0,y1,30,y1); - g.drawLine(0,y1 + 19, 30, y1 +19); - g.drawLine(30, y1, 30 ,y1 + 19); - }else if (index%7 == 6) { - int y1 = index/7*19; - g.drawLine(185,y1,216,y1); - g.drawLine(185,y1 + 19, 216, y1 +19); - g.drawLine(185, y1, 185 ,y1 + 19); + if (index % 7 == 0) { + int y1 = index / 7 * 19; + g.drawLine(0, y1, 30, y1); + g.drawLine(0, y1 + 19, 30, y1 + 19); + g.drawLine(30, y1, 30, y1 + 19); + } else if (index % 7 == 6) { + int y1 = index / 7 * 19; + g.drawLine(185, y1, 216, y1); + g.drawLine(185, y1 + 19, 216, y1 + 19); + g.drawLine(185, y1, 185, y1 + 19); } else { - int x1 = index%7*31 -1; - int y1 = index/7*19; + int x1 = index % 7 * 31 - 1; + int y1 = index / 7 * 19; g.drawRect(x1, y1, 31, 19); } } @@ -599,7 +600,7 @@ public class UICalendarPanel extends JPanel { } - private class HMSPane extends JPanel{ + private class HMSPane extends JPanel { private boolean isRolOver; private UIButton preButton; private UIButton nextButton; @@ -608,7 +609,7 @@ public class UICalendarPanel extends JPanel { private CalendarNumberField sField; private CalendarNumberField selectedNumberField; - public HMSPane () { + public HMSPane() { this.setPreferredSize(new Dimension(101, 18)); this.setLayout(new BorderLayout(0, 0)); this.setBackground(null); @@ -633,7 +634,7 @@ public class UICalendarPanel extends JPanel { } private void initComponents() { - JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT,0,2)); + JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 2)); jp.setBackground(null); jp.setBorder(null); @@ -649,13 +650,13 @@ public class UICalendarPanel extends JPanel { jp.add(sField); this.add(jp, BorderLayout.CENTER); - preButton = new UIButton(UIConstants.ARROW_UP_ICON){ + preButton = new UIButton(UIConstants.ARROW_UP_ICON) { public boolean shouldResponseChangeListener() { return false; } }; preButton.setRoundBorder(true, Constants.LEFT); - nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON){ + nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) { public boolean shouldResponseChangeListener() { return false; } @@ -673,7 +674,7 @@ public class UICalendarPanel extends JPanel { MouseAdapter backgroundAdapter = new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { - HMSPane.this.selectedNumberField = (CalendarNumberField)e.getComponent(); + HMSPane.this.selectedNumberField = (CalendarNumberField) e.getComponent(); } @Override @@ -710,17 +711,17 @@ public class UICalendarPanel extends JPanel { }); } - private UILabel createGapLabel () { + private UILabel createGapLabel() { UILabel uiLabel = new UILabel(":"); uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setBackground(null); uiLabel.setBorder(null); - uiLabel.setPreferredSize(new Dimension(6,10)); + uiLabel.setPreferredSize(new Dimension(6, 10)); return uiLabel; } public Insets getInsets() { - return new Insets(1,3,1,0); + return new Insets(1, 3, 1, 0); } public void paint(Graphics g) { @@ -729,7 +730,7 @@ public class UICalendarPanel extends JPanel { } public void paintBorder(Graphics g) { - Graphics2D g2d = (Graphics2D)g; + Graphics2D g2d = (Graphics2D) g; if (isRolOver) { Shape shape = new RoundRectangle2D.Double(1, 1, 86, 15, UIConstants.ARC, UIConstants.ARC); GUIPaintUtils.paintBorderShadow(g2d, 3, shape, UIConstants.HOVER_BLUE, Color.WHITE); @@ -738,7 +739,7 @@ public class UICalendarPanel extends JPanel { } } - public void populate(Calendar calendar){ + public void populate(Calendar calendar) { this.hField.setValue(calendar.get(Calendar.HOUR_OF_DAY)); this.mField.setValue(calendar.get(Calendar.MINUTE)); this.sField.setValue(calendar.get(Calendar.SECOND)); @@ -751,15 +752,15 @@ public class UICalendarPanel extends JPanel { } } - public static void main(String[] args){ + public static void main(String[] args) { JFrame frame = new JFrame(); UICalendarPanel calendarPanel = new UICalendarPanel(); final UITextField field = new UITextField(); field.setPreferredSize(new Dimension(120, 25)); - calendarPanel.addDateChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - Date selectedDate = (Date)e.getSource(); + calendarPanel.addDateChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + Date selectedDate = (Date) e.getSource(); SimpleDateFormat f = new SimpleDateFormat("yyyy/MM/dd"); field.setText(f.format(selectedDate)); } diff --git a/designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java b/designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java index 0ba64b3f64..06f30e1aef 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java @@ -1,14 +1,13 @@ package com.fr.design.gui.date; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.utils.DesignUtils; import java.awt.Dimension; -import java.awt.Font; import java.text.SimpleDateFormat; import java.util.Date; - public class UIDayLabel extends UILabel { private Date date = null; @@ -28,13 +27,13 @@ public class UIDayLabel extends UILabel { public UIDayLabel(Date date, boolean isSmallLabel) { setHorizontalAlignment(UILabel.CENTER); - setFont(new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"), 0, 12)); + setFont(DesignUtils.getDefaultGUIFont()); this.date = date; setPreferredSize(new Dimension(30, 18)); if (isSmallLabel) { setText(dayFormat.format(date)); } else { - setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Today")+":" + dateFormat.format(new Date())); + setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Today") + ":" + dateFormat.format(new Date())); } } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java index 7d12a013ed..3f5fff689b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java @@ -1,16 +1,18 @@ package com.fr.design.gui.itree.filetree; -import com.fr.base.FRContext; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.filetree.IOFileNodeFilter; - -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -32,7 +34,7 @@ public class ReportletPane extends BasicPane { textPane.setEditable(false); textPane.setLineWrap(true); - textPane.setFont(FRContext.getDefaultValues().getFRFont().deriveFont(Font.BOLD, 12)); + textPane.setFont(DesignUtils.getDefaultGUIFont().applyStyle(Font.BOLD)); textPane.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Schedule_The_Selected_File_Must_Be_End_With_Filter")); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -41,6 +43,7 @@ public class ReportletPane extends BasicPane { switchButton = new UIButton("switch"); centerPane.add(GUICoreUtils.createBorderPane(switchButton, BorderLayout.WEST), BorderLayout.NORTH); switchButton.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { switchCardPane(t_panel.isVisible()); } @@ -50,12 +53,12 @@ public class ReportletPane extends BasicPane { centerPane.add(cardPane, BorderLayout.CENTER); cardPane.setLayout(card = new CardLayout()); templateReportletTree = new TemplateFileTree(); - IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class",".frm",".form"}); + IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form"}); templateReportletTree.setFileNodeFilter(filter); cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); classReportletTree = new ClassFileTree(); cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS"); - + this.refreshEnv(); } @@ -75,8 +78,9 @@ public class ReportletPane extends BasicPane { /** * 检查是否符合规范 * - * @throws Exception 抛错 + * @throws Exception 抛错 */ + @Override public void checkValid() throws Exception { String path = this.getSelectedReportletPath(); if (path == null) { @@ -89,7 +93,7 @@ public class ReportletPane extends BasicPane { * 刷新Env */ public void refreshEnv() { - + this.templateReportletTree.refreshEnv(); this.classReportletTree.refreshEnv(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 76422555fd..66a77e1c2d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fr.base.FRContext; - import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; @@ -16,9 +15,9 @@ import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.menu.SnapChatUtil; import com.fr.design.notification.SnapChat; import com.fr.design.ui.util.UIUtil; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; -import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; @@ -1251,7 +1250,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { super.paint(g); Image button; g.setColor(new Color(69, 135, 255)); - g.setFont(FRFont.getInstance().applySize(14)); + g.setFont(DesignUtils.getDefaultGUIFont().applySize(14)); if (buttonType.equals(NO_BUTTON)) { return; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JSliderPane.java b/designer-base/src/main/java/com/fr/design/mainframe/JSliderPane.java index 487d18a565..0c17adcd4f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JSliderPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JSliderPane.java @@ -13,9 +13,9 @@ import com.fr.design.gui.ispinner.UISpinnerUI; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; - import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.JButton; @@ -37,7 +37,6 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.FlowLayout; -import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; @@ -60,7 +59,6 @@ public class JSliderPane extends JPanel { private static final double ONEPOINTEIGHT = 1.8; private static final int SIX = 6; private static final int TEN = 10; - private static final int FONT_SIZE = 12; private static final int SPINNER_WIDTH = 45; private static final int SPINNER_HEIGHT = 20; private static final int HALF_HUNDRED = 50; @@ -194,9 +192,9 @@ public class JSliderPane extends JPanel { fiveTenButton = new UIRadioButton("50%"); twoFiveButton = new UIRadioButton("25%"); selfAdaptButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Self_Adapt_Button")); - selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); + selfAdaptButton.setFont(DesignUtils.getDefaultGUIFont()); customButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Custom_Button")); - customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); + customButton.setFont(DesignUtils.getDefaultGUIFont()); twoHundredButton.addItemListener(radioButtonItemListener); oneHundredButton.addItemListener(radioButtonItemListener); sevenFiveButton.addItemListener(radioButtonItemListener); @@ -265,7 +263,7 @@ public class JSliderPane extends JPanel { JPanel spinnerPanel = new JPanel(new FlowLayout()); spinnerPanel.add(showValSpinner); UILabel percent = new UILabel("%"); - percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); + percent.setFont(DesignUtils.getDefaultGUIFont()); spinnerPanel.add(percent); spinnerPanel.setBackground(BACK_COLOR); return spinnerPanel; diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java index 9a627ab2c0..894a8ebdad 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java @@ -14,11 +14,11 @@ import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.mainframe.widget.editors.ShortCutTextEditor; import com.fr.design.mainframe.widget.renderer.FontCellRenderer; import com.fr.design.mainframe.widget.renderer.IconCellRenderer; +import com.fr.design.utils.DesignUtils; import com.fr.form.parameter.FormSubmitButton; import com.fr.form.ui.Button; import com.fr.form.ui.FreeButton; import com.fr.general.Background; - import com.fr.stable.ArrayUtils; import com.fr.stable.core.PropertyChangeAdapter; @@ -29,7 +29,6 @@ import java.awt.AlphaComposite; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; -import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; @@ -41,14 +40,13 @@ import java.beans.IntrospectionException; */ public class XButton extends XWidgetCreator { - public final static Background DEFAULTBG = new GradientBackground(new Color(247,247,247),new Color(210,210,210), GradientBackground.TOP2BOTTOM); - public final static Font DEFAULTFT = new Font("Song_TypeFace",0,12); + public final static Background DEFAULTBG = new GradientBackground(new Color(247, 247, 247), new Color(210, 210, 210), GradientBackground.TOP2BOTTOM); public final static Color DEFAULTFOREGROUNDCOLOR = Color.BLACK; - private Background bg; - private UILabel contentLabel; + private Background bg; + private UILabel contentLabel; public XButton(Button widget, Dimension initSize) { - this(new FreeButton(widget),initSize); + this(new FreeButton(widget), initSize); } public XButton(FreeButton widget, Dimension initSize) { @@ -56,143 +54,146 @@ public class XButton extends XWidgetCreator { } public XButton(FormSubmitButton widget, Dimension initSize) { - super(widget, initSize); + super(widget, initSize); } - public Background getContentBackground() { - return bg; - } + public Background getContentBackground() { + return bg; + } - public void setContentBackground(Background bg) { - this.bg = bg; - } + public void setContentBackground(Background bg) { + this.bg = bg; + } - public UILabel getContentLabel() { - return contentLabel; - } + public UILabel getContentLabel() { + return contentLabel; + } - public void setContentLabel(UILabel contentLabel) { - this.contentLabel = contentLabel; - } + public void setContentLabel(UILabel contentLabel) { + this.contentLabel = contentLabel; + } /** - *根据下拉框选择返回按钮样式的默认设置或自定义设置列表 - * @return 列表 - * @throws IntrospectionException 抛错 + * 根据下拉框选择返回按钮样式的默认设置或自定义设置列表 + * + * @return 列表 + * @throws IntrospectionException 抛错 */ - @Override - public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { - CRPropertyDescriptor[] crp = ((FreeButton) data).isCustomStyle() ? getisCustomStyle() : getisnotCustomStyle(); - - return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), crp); - } - - protected CRPropertyDescriptor creatNonListenerStyle(int i) throws IntrospectionException{ - CRPropertyDescriptor[] crPropertyDescriptors = { - new CRPropertyDescriptor("text", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("customStyle", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Style")).setEditorClass( - ButtonTypeEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("initialBackground", this.data.getClass()).setEditorClass( - ImgBackgroundEditor.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial")).putKeyValue( - XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("overBackground", this.data.getClass()).setEditorClass( - ImgBackgroundEditor.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over")).putKeyValue( - XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("clickBackground", this.data.getClass()).setEditorClass( - ImgBackgroundEditor.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Click")).putKeyValue( - XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("font", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FR_Font")) - .setEditorClass(FontEditor.class).setRendererClass(FontCellRenderer.class).putKeyValue( - XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("iconName", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")) - .setEditorClass(IconEditor.class).setRendererClass(IconCellRenderer.class).putKeyValue( - XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("hotkeys", this.data.getClass()) - .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") - .setEditorClass(ShortCutTextEditor.class) - - }; + @Override + public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { + CRPropertyDescriptor[] crp = ((FreeButton) data).isCustomStyle() ? getisCustomStyle() : getisnotCustomStyle(); + + return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), crp); + } + + protected CRPropertyDescriptor creatNonListenerStyle(int i) throws IntrospectionException { + CRPropertyDescriptor[] crPropertyDescriptors = { + new CRPropertyDescriptor("text", this.data.getClass()).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("customStyle", this.data.getClass()).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Style")).setEditorClass( + ButtonTypeEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("initialBackground", this.data.getClass()).setEditorClass( + ImgBackgroundEditor.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial")).putKeyValue( + XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("overBackground", this.data.getClass()).setEditorClass( + ImgBackgroundEditor.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over")).putKeyValue( + XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("clickBackground", this.data.getClass()).setEditorClass( + ImgBackgroundEditor.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Click")).putKeyValue( + XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("font", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FR_Font")) + .setEditorClass(FontEditor.class).setRendererClass(FontCellRenderer.class).putKeyValue( + XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("iconName", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")) + .setEditorClass(IconEditor.class).setRendererClass(IconCellRenderer.class).putKeyValue( + XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("hotkeys", this.data.getClass()) + .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + .setEditorClass(ShortCutTextEditor.class) + + }; return crPropertyDescriptors[i]; } - protected CRPropertyDescriptor[] getisCustomStyle() throws IntrospectionException{ - return new CRPropertyDescriptor[]{ - creatNonListenerStyle(0) .setPropertyChangeListener(new PropertyChangeAdapter() { - @Override - public void propertyChange() { - setButtonText(((FreeButton) data).getText()); - } - }), - - creatNonListenerStyle(1) .setPropertyChangeListener(new PropertyChangeAdapter() { - @Override - public void propertyChange() { - checkButonType(); - } - }), - creatNonListenerStyle(2).setPropertyChangeListener( - new PropertyChangeAdapter() { - @Override - public void propertyChange() { - bg = ((FreeButton) data).getInitialBackground(); - } - }), - creatNonListenerStyle(3), - creatNonListenerStyle(4), - creatNonListenerStyle(5) .setPropertyChangeListener( - new PropertyChangeAdapter() { - @Override - public void propertyChange() { - FreeButton button = (FreeButton) data; - if (button.getFont() != null) { - contentLabel.setFont(button.getFont().applyResolutionNP( - FontTransformUtil.getDesignerFontResolution())); - contentLabel.setForeground(button.getFont().getForeground()); - } - } - }), - creatNonListenerStyle(6), - creatNonListenerStyle(7) - - }; - } + + protected CRPropertyDescriptor[] getisCustomStyle() throws IntrospectionException { + return new CRPropertyDescriptor[]{ + creatNonListenerStyle(0).setPropertyChangeListener(new PropertyChangeAdapter() { + @Override + public void propertyChange() { + setButtonText(((FreeButton) data).getText()); + } + }), + + creatNonListenerStyle(1).setPropertyChangeListener(new PropertyChangeAdapter() { + @Override + public void propertyChange() { + checkButonType(); + } + }), + creatNonListenerStyle(2).setPropertyChangeListener( + new PropertyChangeAdapter() { + @Override + public void propertyChange() { + bg = ((FreeButton) data).getInitialBackground(); + } + }), + creatNonListenerStyle(3), + creatNonListenerStyle(4), + creatNonListenerStyle(5).setPropertyChangeListener( + new PropertyChangeAdapter() { + @Override + public void propertyChange() { + FreeButton button = (FreeButton) data; + if (button.getFont() != null) { + contentLabel.setFont(button.getFont().applyResolutionNP( + FontTransformUtil.getDesignerFontResolution())); + contentLabel.setForeground(button.getFont().getForeground()); + } + } + }), + creatNonListenerStyle(6), + creatNonListenerStyle(7) + + }; + } protected CRPropertyDescriptor[] getisnotCustomStyle() throws IntrospectionException { - return new CRPropertyDescriptor[]{ - new CRPropertyDescriptor("text", this.data.getClass()) - .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") - .setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - setButtonText(((FreeButton) data).getText()); - } - }), - new CRPropertyDescriptor("customStyle", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Style")).setEditorClass( - ButtonTypeEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") - .setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - checkButonType(); - } - }), - new CRPropertyDescriptor("iconName", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")) - .setEditorClass(IconEditor.class).setRendererClass(IconCellRenderer.class).putKeyValue( - XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("hotkeys", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") - .setEditorClass(ShortCutTextEditor.class) - - - }; + return new CRPropertyDescriptor[]{ + new CRPropertyDescriptor("text", this.data.getClass()) + .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + .setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + setButtonText(((FreeButton) data).getText()); + } + }), + new CRPropertyDescriptor("customStyle", this.data.getClass()).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Style")).setEditorClass( + ButtonTypeEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + .setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + checkButonType(); + } + }), + new CRPropertyDescriptor("iconName", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")) + .setEditorClass(IconEditor.class).setRendererClass(IconCellRenderer.class).putKeyValue( + XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("hotkeys", this.data.getClass()).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + .setEditorClass(ShortCutTextEditor.class) + + + }; } + @Override protected JComponent initEditor() { if (editor == null) { @@ -202,110 +203,114 @@ public class XButton extends XWidgetCreator { return editor; } - protected UILabel initContentLabel() { - return new UILabel(); - } + protected UILabel initContentLabel() { + return new UILabel(); + } - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); //不可见时,按钮.4f透明 - AlphaComposite composite = this.data.isVisible() ? (AlphaComposite)((Graphics2D)g).getComposite() : AlphaComposite.getInstance(AlphaComposite.SRC_OVER,HALF_OPACITY); - ((Graphics2D)g).setComposite(composite); - Dimension panelSize = (contentLabel).getSize(); - if(bg != null) { - bg.paint(g, new Rectangle2D.Double(0, 0, panelSize.getWidth(), panelSize.getHeight())); - } - } - - public void setButtonText(String text) { - contentLabel.setText(text); - } - - private void checkButonType() { - UILabel l = contentLabel; - FreeButton button = (FreeButton) data; - - if (!button.isCustomStyle()) { - l.setBorder(BorderFactory.createLineBorder(new Color(148, 148, 148))); - bg = DEFAULTBG; - contentLabel.setFont(DEFAULTFT); + AlphaComposite composite = this.data.isVisible() ? (AlphaComposite) ((Graphics2D) g).getComposite() : AlphaComposite.getInstance(AlphaComposite.SRC_OVER, HALF_OPACITY); + ((Graphics2D) g).setComposite(composite); + Dimension panelSize = (contentLabel).getSize(); + if (bg != null) { + bg.paint(g, new Rectangle2D.Double(0, 0, panelSize.getWidth(), panelSize.getHeight())); + } + } + + public void setButtonText(String text) { + contentLabel.setText(text); + } + + private void checkButonType() { + UILabel l = contentLabel; + FreeButton button = (FreeButton) data; + + if (!button.isCustomStyle()) { + l.setBorder(BorderFactory.createLineBorder(new Color(148, 148, 148))); + bg = DEFAULTBG; + contentLabel.setFont(DesignUtils.getDefaultGUIFont()); contentLabel.setForeground(DEFAULTFOREGROUNDCOLOR); editor.setLayout(new BorderLayout()); - editor.add(l, BorderLayout.CENTER); - } else { - l.setBorder(null); - editor.setLayout(new BorderLayout()); - editor.add(l,BorderLayout.CENTER); + editor.add(l, BorderLayout.CENTER); + } else { + l.setBorder(null); + editor.setLayout(new BorderLayout()); + editor.add(l, BorderLayout.CENTER); if (button.getFont() != null) { contentLabel.setFont(button.getFont().applyResolutionNP( - FontTransformUtil.getDesignerFontResolution())); + FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } - l.setBounds(0, 0, button.getButtonWidth() == 0 ? this.getWidth() : button.getButtonWidth(), button - .getButtonHeight() == 0 ? this.getHeight() : button.getButtonHeight()); - bg = button.getInitialBackground(); - } - } + l.setBounds(0, 0, button.getButtonWidth() == 0 ? this.getWidth() : button.getButtonWidth(), button + .getButtonHeight() == 0 ? this.getHeight() : button.getButtonHeight()); + bg = button.getInitialBackground(); + } + } @Override - protected void initXCreatorProperties() { - super.initXCreatorProperties(); - checkButonType(); - UILabel l = contentLabel; - FreeButton button = (FreeButton) data; - l.setText(button.getText()); - if (button.isCustomStyle() && button.getFont() != null) { - l.setFont(button.getFont().applyResolutionNP(FontTransformUtil.getDesignerFontResolution())); - l.setForeground(button.getFont().getForeground()); - } - - l.setVerticalAlignment(SwingConstants.CENTER); - l.setHorizontalAlignment(SwingConstants.CENTER); - if (button.getButtonHeight() > 0 && button.getButtonWidth() > 0) { - this.setSize(button.getButtonWidth(), button.getButtonHeight()); - l.setSize(button.getButtonWidth(), button.getButtonHeight()); - XLayoutContainer parent; - if ((parent = XCreatorUtils.getParentXLayoutContainer(this)) instanceof XWAbsoluteLayout) { - ((XWAbsoluteLayout) parent).toData().setBounds(toData(), getBounds()); - } - } - l.setEnabled(button.isEnabled()); - } + protected void initXCreatorProperties() { + super.initXCreatorProperties(); + checkButonType(); + UILabel l = contentLabel; + FreeButton button = (FreeButton) data; + l.setText(button.getText()); + if (button.isCustomStyle() && button.getFont() != null) { + l.setFont(button.getFont().applyResolutionNP(FontTransformUtil.getDesignerFontResolution())); + l.setForeground(button.getFont().getForeground()); + } + + l.setVerticalAlignment(SwingConstants.CENTER); + l.setHorizontalAlignment(SwingConstants.CENTER); + if (button.getButtonHeight() > 0 && button.getButtonWidth() > 0) { + this.setSize(button.getButtonWidth(), button.getButtonHeight()); + l.setSize(button.getButtonWidth(), button.getButtonHeight()); + XLayoutContainer parent; + if ((parent = XCreatorUtils.getParentXLayoutContainer(this)) instanceof XWAbsoluteLayout) { + ((XWAbsoluteLayout) parent).toData().setBounds(toData(), getBounds()); + } + } + l.setEnabled(button.isEnabled()); + } /** * 初始化按钮的Size - * @return 尺寸 + * + * @return 尺寸 */ - public Dimension initEditorSize() { - FreeButton button = (FreeButton) data; - if (checkbutton(button)) { - return new Dimension(button.getButtonWidth(), button.getButtonHeight()); - } - return super.initEditorSize(); - } - private boolean checkbutton(FreeButton button){ - return (button.isCustomStyle() && button.getButtonHeight() > 0 && button.getButtonWidth() > 0) ; + @Override + public Dimension initEditorSize() { + FreeButton button = (FreeButton) data; + if (checkbutton(button)) { + return new Dimension(button.getButtonWidth(), button.getButtonHeight()); + } + return super.initEditorSize(); + } + + private boolean checkbutton(FreeButton button) { + return (button.isCustomStyle() && button.getButtonHeight() > 0 && button.getButtonWidth() > 0); } + @Override protected String getIconName() { return "button_16.png"; } - /** - * data属性改变触发其他操作 - * - */ - public void firePropertyChange(){ - FreeButton button = (FreeButton) data; - setButtonText(button.getText()); - checkButonType(); - if (button.getFont() != null) { - contentLabel.setFont(button.getFont().applyResolutionNP( - FontTransformUtil.getDesignerFontResolution())); - contentLabel.setForeground(button.getFont().getForeground()); - } - - } + /** + * data属性改变触发其他操作 + */ + @Override + public void firePropertyChange() { + FreeButton button = (FreeButton) data; + setButtonText(button.getText()); + checkButonType(); + if (button.getFont() != null) { + contentLabel.setFont(button.getFont().applyResolutionNP( + FontTransformUtil.getDesignerFontResolution())); + contentLabel.setForeground(button.getFont().getForeground()); + } + + } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java index 140e294e08..aa4120d410 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java @@ -1,50 +1,48 @@ package com.fr.design.widget.ui.designer; -import com.fr.base.FRContext; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.form.ui.Radio; -import com.fr.general.FRFont; - -import javax.swing.*; -import java.awt.*; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Font; /** * @deprecated */ @Deprecated public class RadioDefinePane extends AbstractDataModify { - public RadioDefinePane(XCreator xCreator) { - super(xCreator); - iniComoponents(); - } - - private void iniComoponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - - UILabel infoLabel = new UILabel(); - FRFont frFont = FRContext.getDefaultValues().getFRFont(); - infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24)); - infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText( - "Fine-Design_Report_No_Editor_Property_Definition") + "."); - infoLabel.setHorizontalAlignment(SwingConstants.CENTER); - - this.add(infoLabel, BorderLayout.CENTER); - } - - @Override - public String title4PopupWindow() { - return "radio"; - } - - @Override - public void populateBean(Radio cellWidget) { - } - - @Override - public Radio updateBean() { - return (Radio)creator.toData(); - } + public RadioDefinePane(XCreator xCreator) { + super(xCreator); + iniComoponents(); + } + + private void iniComoponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + + UILabel infoLabel = new UILabel(); + infoLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(24).applyStyle(Font.BOLD)); + infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText( + "Fine-Design_Report_No_Editor_Property_Definition") + "."); + infoLabel.setHorizontalAlignment(SwingConstants.CENTER); + + this.add(infoLabel, BorderLayout.CENTER); + } + + @Override + public String title4PopupWindow() { + return "radio"; + } + + @Override + public void populateBean(Radio cellWidget) { + } + + @Override + public Radio updateBean() { + return (Radio) creator.toData(); + } } diff --git a/designer-realize/src/main/java/com/fr/design/condition/FontPane.java b/designer-realize/src/main/java/com/fr/design/condition/FontPane.java index 0049c9dd70..48fccc48b8 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/FontPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/FontPane.java @@ -7,13 +7,13 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.style.FRFontPane; import com.fr.design.style.FRFontPreviewArea; -import com.fr.general.FRFont; - +import com.fr.design.utils.DesignUtils; import com.fr.report.cell.cellattr.highlight.FRFontHighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightAction; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.SwingUtilities; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -60,7 +60,7 @@ public class FontPane extends ConditionAttrSingleConditionPane this.add(frFontPreviewPane); this.add(editFRFontButton); this.add(this.fontScopeComboBox); - this.frFontPreviewPane.setFontObject(FRFont.getInstance()); + this.frFontPreviewPane.setFontObject(DesignUtils.getDefaultGUIFont()); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java index 4cebe741ca..3946c9cbc2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine; import com.fr.base.extension.FileExtension; +import com.fr.design.utils.DesignUtils; import com.fr.general.CloudCenter; import java.awt.Color; @@ -73,15 +74,15 @@ public class AlphaFineConstants { public static final String HIGH_LIGHT_COLOR = "rgb(51,148,240)"; - public static final Font SMALL_FONT = new Font("Song_TypeFace", 0, 10); + public static final Font SMALL_FONT = DesignUtils.getDefaultGUIFont().applySize(10); - public static final Font MEDIUM_FONT = new Font("Song_TypeFace", 0, 12); + public static final Font MEDIUM_FONT = DesignUtils.getDefaultGUIFont().applySize(12); public static final Font MEDIUM_FONT_ANOTHER = new Font("HiraginoSansGB-W3", 0, 12); - public static final Font LARGE_FONT = new Font("Song_TypeFace", 0, 18); + public static final Font LARGE_FONT = DesignUtils.getDefaultGUIFont().applySize(18); - public static final Font GREATER_FONT = new Font("Song_TypeFace", 0, 20); + public static final Font GREATER_FONT = DesignUtils.getDefaultGUIFont().applySize(20); public static final String IMAGE_URL = "/com/fr/design/mainframe/alphafine/images/"; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java index 738ecf4efd..29a8c1e082 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java @@ -3,10 +3,14 @@ package com.fr.design.mainframe.alphafine.preview; import com.bulenkov.iconloader.IconLoader; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.alphafine.AlphaFineConstants; -import com.fr.general.FRFont; +import com.fr.design.utils.DesignUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; /** * Created by XiaXiang on 2017/8/14. @@ -23,7 +27,7 @@ public class NoResultPane extends JPanel { image.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0)); UILabel description = new UILabel(title); description.setForeground(AlphaFineConstants.MEDIUM_GRAY); - description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14)); + description.setFont(DesignUtils.getDefaultGUIFont().applySize(14)); description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0)); description.setHorizontalAlignment(SwingConstants.CENTER); add(image, BorderLayout.CENTER); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java index 82f8a84842..b37c048e92 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java @@ -8,16 +8,24 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.*; +import com.fr.general.CloudCenter; +import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpClient; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; -import javax.swing.*; - -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Desktop; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; @@ -37,7 +45,7 @@ public class BBSLoginDialog extends UIDialog { private static final int DIALOG_WIDTH = 400; private static final int DIALOG_HEIGHT = 200; - private static final Font DEFAULT_FONT = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, 0, 14); + private static final Font DEFAULT_FONT = DesignUtils.getDefaultGUIFont().applySize(14); private static final int TIME_OUT = 10000; private static final int BUTTON_WIDTH = 90; diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java index 4062e0dbe5..f1897e148e 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.IOUtils; @@ -32,7 +33,6 @@ import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; -import java.awt.Font; import java.awt.Graphics; import java.awt.GridLayout; import java.awt.event.ActionEvent; @@ -59,7 +59,6 @@ public class ReportColumnsPane extends BasicPane{ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Column") }; - private static final String FONT_NAME = "simsun"; private static final int FONT_SIZE = 14; private UIButtonGroup onOffButtonGroup; @@ -109,7 +108,7 @@ public class ReportColumnsPane extends BasicPane{ onOffButtonGroup.addActionListener(onOffListener); UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns")); - FRFont uiLableFont = FRFont.getInstance(FONT_NAME, Font.PLAIN, FONT_SIZE); + FRFont uiLableFont = DesignUtils.getDefaultGUIFont().applySize(FONT_SIZE); uiLabel.setFont(uiLableFont); uiLabel.setHorizontalAlignment(SwingConstants.CENTER); int uiLabelWidth = GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"), uiLableFont); diff --git a/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java b/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java index fa19c38f82..26acc77513 100644 --- a/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java @@ -1,12 +1,12 @@ package com.fr.design.report; import com.fr.base.BaseFormula; -import com.fr.base.FRContext; import com.fr.base.Style; import com.fr.design.cell.editor.RichTextToolBar; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; @@ -37,7 +37,7 @@ public class RichTextPane extends BasicPane { //12号字体有个奇怪的bug, 字体下部分渲染会截断一部分, 换其他字体没问题, 字体改大小也没问题. //直接弄个jtexarea放到jframe里也有同样问题, 不知道是字体渲染bug还是jdk问题 - public static final FRFont DEFAUL_FONT = FRContext.getDefaultValues().getFRFont().applySize(13); + public static final FRFont DEFAUL_FONT = DesignUtils.getDefaultGUIFont().applySize(13); private RichTextEditingPane textPane; //用于populate时动态更新按钮 diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java index 5de31c110c..7239a39c1c 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java @@ -1,48 +1,46 @@ package com.fr.design.widget.ui; -import com.fr.base.FRContext; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.form.ui.Radio; -import com.fr.general.FRFont; - -import javax.swing.*; -import java.awt.*; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Font; /** * @deprecated */ @Deprecated public class RadioDefinePane extends AbstractDataModify { - public RadioDefinePane() { - this.iniComoponents(); - } - - private void iniComoponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - - UILabel infoLabel = new UILabel(); - FRFont frFont = FRContext.getDefaultValues().getFRFont(); - infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24)); - infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText( - "Fine-Design_Report_No_Editor_Property_Definition") + "."); - infoLabel.setHorizontalAlignment(SwingConstants.CENTER); - - this.add(infoLabel, BorderLayout.CENTER); - } - - @Override - protected String title4PopupWindow() { - return "radio"; - } - - @Override - public void populateBean(Radio cellWidget) { - } - - @Override - public Radio updateBean() { - return new Radio(); - } + public RadioDefinePane() { + this.iniComoponents(); + } + + private void iniComoponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + + UILabel infoLabel = new UILabel(); + infoLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(24).applyStyle(Font.BOLD)); + infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText( + "Fine-Design_Report_No_Editor_Property_Definition") + "."); + infoLabel.setHorizontalAlignment(SwingConstants.CENTER); + + this.add(infoLabel, BorderLayout.CENTER); + } + + @Override + protected String title4PopupWindow() { + return "radio"; + } + + @Override + public void populateBean(Radio cellWidget) { + } + + @Override + public Radio updateBean() { + return new Radio(); + } } diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/UserEditorDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/UserEditorDefinePane.java index a9e5ee3d03..455bf0b125 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/UserEditorDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/UserEditorDefinePane.java @@ -1,14 +1,13 @@ package com.fr.design.widget.ui; -import com.fr.base.FRContext; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.DesignUtils; import com.fr.form.ui.NameWidget; -import com.fr.general.FRFont; - -import javax.swing.*; -import java.awt.*; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Font; public class UserEditorDefinePane extends AbstractDataModify { private NameWidget nWidget; @@ -20,8 +19,7 @@ public class UserEditorDefinePane extends AbstractDataModify { this.setLayout(FRGUIPaneFactory.createBorderLayout()); UILabel infoLabel = new UILabel(); - FRFont frFont = FRContext.getDefaultValues().getFRFont(); - infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24)); + infoLabel.setFont(DesignUtils.getDefaultGUIFont().applySize(24).applyStyle(Font.BOLD)); infoLabel.setText(com.fr.design.i18n.Toolkit.i18nText( "Fine-Design_Report_Widget_User_Defined_Editor") + "."); infoLabel.setHorizontalAlignment(SwingConstants.CENTER); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java index 3e3211259b..5dc4140883 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java @@ -8,6 +8,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.utils.DesignUtils; import com.fr.quickeditor.FloatQuickEditor; import com.fr.report.ReportHelper; import com.fr.stable.StringUtils; @@ -20,7 +21,6 @@ import javax.swing.event.DocumentListener; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; -import java.awt.Font; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -77,7 +77,7 @@ public class FloatStringQuickEditor extends FloatQuickEditor { } private void initTextField() { - stringTextField.setFont(new Font("Dialog", Font.PLAIN, 12)); + stringTextField.setFont(DesignUtils.getDefaultGUIFont()); stringTextField.setOpaque(true); stringTextField.setLineWrap(true); stringTextField.setWrapStyleWord(true); From eaf02997d2b46e896e2f325088c6ca10746db30f Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 7 Jan 2021 09:45:51 +0800 Subject: [PATCH 083/104] =?UTF-8?q?REPORT-32210=20release=E4=BC=A0?= =?UTF-8?q?=E4=B8=80=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/beans/LayoutAdapter.java | 15 +++++++++++++- .../layout/AbstractLayoutAdapter.java | 20 +++++++++++++++++-- .../layout/FRTabFitLayoutAdapter.java | 6 +++--- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java index c087d78fef..f10b877e27 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java @@ -42,6 +42,19 @@ public interface LayoutAdapter { */ boolean addBean(XCreator creator, int x, int y); + + /** + * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 + * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 + * + * @param creator 被添加的新组件 + * @param x 添加的位置x,该位置是相对于container的 + * @param y 添加的位置y,该位置是相对于container的 + * @param accept 是否添加新组件 + * @return 是否添加成功,成功返回true,否则false + */ + boolean addBean(XCreator creator, int x, int y, boolean accept); + /** * 返回该布局管理适配器的Painter,为容器提供放置位置的标识。 */ @@ -91,4 +104,4 @@ public interface LayoutAdapter { * @param initHeight 组件之前高度 */ void removeBean(XCreator creator, int initWidth, int initHeight); -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java index 493dd02aa2..d9fae2dd86 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java @@ -78,7 +78,23 @@ public abstract class AbstractLayoutAdapter implements LayoutAdapter { */ @Override public boolean addBean(XCreator creator, int x, int y) { - if (!accept(creator, x, y)) { + boolean accept = accept(creator, x, y); + return addBean(creator, x, y, accept); + } + + /** + * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 + * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 + * + * @param creator 被添加的新组件 + * @param x 添加的位置x,该位置是相对于container的 + * @param y 添加的位置y,该位置是相对于container的 + * @param accept 是否添加新组件 + * @return 是否添加成功,成功返回true,否则false + */ + @Override + public boolean addBean(XCreator creator, int x, int y, boolean accept) { + if (!accept) { return false; } addComp(creator, x, y); @@ -186,4 +202,4 @@ public abstract class AbstractLayoutAdapter implements LayoutAdapter { public XLayoutContainer getContainer() { return this.container; } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java index d5a680b611..2b33159e8b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java @@ -18,7 +18,8 @@ import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.ComparatorUtils; import com.fr.general.act.BorderPacker; -import java.awt.*; +import java.awt.Rectangle; + /** * tab布局tabFit适配器 @@ -73,8 +74,7 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter { y = adjustY(y, tabLayout); } //这时候应该要用计算后的父fit布局添加 - this.container.getLayoutAdapter().addBean(creator, x, y); - ((XWidgetCreator) creator).recalculateChildrenSize(); + this.container.getLayoutAdapter().addBean(creator, x, y, true); return true; } // 如果不在边缘,容器为本自适应布局,增加组件的位置就是相对于容器的位置 From 5c7f3aa79275259f37fd6560c0dc47bc78dc22f1 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 7 Jan 2021 12:11:25 +0800 Subject: [PATCH 084/104] =?UTF-8?q?REPORT-46683=20=E3=80=90=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=EF=BC=8C=E9=80=89=E4=B8=AD=E8=A1=A8=E5=B9=B6=E6=8B=96=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=BC=B9=E7=AA=97=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E4=BA=86=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D=E5=81=9A=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9A=84=E6=97=B6=E5=80=99=E9=87=8D=E8=BD=BD?= =?UTF-8?q?=E4=BA=86UpdateAction=E7=9A=84setSmallIcon=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E7=84=B6=E5=90=8E=E5=8E=9F=E5=85=88=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=E7=9A=84setSmallIcon(null)=E5=B0=B1=E4=BC=9A?= =?UTF-8?q?=E6=8A=A5=E9=94=99=EF=BC=8C=E5=BD=93=E6=97=B6=E6=83=B3=E9=94=99?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E4=BB=A5=E4=B8=BA=E4=B8=8D=E8=83=BD=E4=BC=A0?= =?UTF-8?q?null=EF=BC=8C=E5=B0=B1=E7=BB=99=E6=94=B9=E6=88=90=E4=BA=86UICon?= =?UTF-8?q?stant.BLACK=5FICON=EF=BC=8C=E5=85=B6=E5=AE=9E=E6=98=AF=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E9=87=8D=E8=BD=BD=E4=BA=86=E6=96=B9=E6=B3=95=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E4=BC=A0=E5=85=A5null=EF=BC=8Cjdk=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E8=B0=83=E7=94=A8=E5=93=AA=E4=B8=AA?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E7=84=B6=E5=90=8E=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=BA=9B=E5=9C=BA=E6=99=AF=E9=87=8C=E6=9C=AC?= =?UTF-8?q?=E6=9D=A5=E6=B2=A1=E5=9B=BE=E6=A0=87=EF=BC=8C=E5=8F=98=E6=88=90?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=B8=AA=E7=A9=BA=E7=99=BD=E7=9A=84=E5=8D=A0?= =?UTF-8?q?=E4=BD=8D=E5=9B=BE=E6=A0=87=EF=BC=8C=E5=9B=A0=E6=AD=A4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8F=91=E7=94=9F=E4=BA=86=E5=8F=98=E5=8C=96=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=8A=8A?= =?UTF-8?q?=E8=BF=AD=E4=BB=A3=E4=BB=BB=E5=8A=A1=E4=B8=AD=E7=94=B1null?= =?UTF-8?q?=E6=94=B9=E4=B8=BABLACK=5FICON=E7=9A=84=E5=9C=B0=E6=96=B9?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E9=80=80=E4=B8=BAnull=EF=BC=8C=E5=86=8D?= =?UTF-8?q?=E4=B8=BA=E8=BF=99=E4=B8=AAnull=E5=8A=A0=E4=B8=8A=E4=B8=AAIcon?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=8C=E4=BB=A5=E4=BE=BF=E4=BA=8E=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E6=96=B9=E6=B3=95=EF=BC=8C=E4=B8=94=E4=B8=8E=E6=AD=A4?= =?UTF-8?q?=E5=89=8D=E9=80=BB=E8=BE=91=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java | 2 +- .../java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java | 2 +- .../java/com/fr/quickeditor/cellquick/CellRichTextEditor.java | 3 ++- .../java/com/fr/quickeditor/cellquick/CellSubReportEditor.java | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java index 1cba4df966..3073a62db2 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java @@ -1 +1 @@ -package com.fr.design.data.datapane.sqlpane; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.Point; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetContext; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FineLoggerFactory.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file +package com.fr.design.data.datapane.sqlpane; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import javax.swing.Icon; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.Point; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetContext; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); this.setSmallIcon((Icon) null); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon((Icon) null); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon((Icon) null); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FineLoggerFactory.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index b2827a36ce..f9427a5a8f 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -260,7 +260,7 @@ public class CellDSColumnEditor extends CellQuickEditor { condition.setEditingComponent(tc); } //丢掉icon,修改按钮名称为编辑 - condition.setSmallIcon(UIConstants.BLACK_ICON); + condition.setSmallIcon((Icon) null); condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); conditionUIButton = new UIButton(condition); Component[][] components = new Component[][]{ diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java index a515c72047..0550e23ffc 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java @@ -9,6 +9,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.quickeditor.CellQuickEditor; +import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -48,7 +49,7 @@ public class CellRichTextEditor extends CellQuickEditor { protected void refreshDetails() { RichTextCellAction subReportCellAction = new RichTextCellAction(tc); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); - subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON); + subReportCellAction.setSmallIcon((Icon) null); richTextButton.setAction(subReportCellAction); } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java index e6c3ddf82e..3614c3be0d 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java @@ -9,6 +9,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.quickeditor.CellQuickEditor; +import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -44,7 +45,7 @@ public class CellSubReportEditor extends CellQuickEditor { protected void refreshDetails() { SubReportCellAction subReportCellAction = new SubReportCellAction(tc); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); - subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON); + subReportCellAction.setSmallIcon((Icon) null); subReportButton.setAction(subReportCellAction); } From 16b047f979e6b6d7756fadf4c59615742662e432 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 7 Jan 2021 14:06:25 +0800 Subject: [PATCH 085/104] =?UTF-8?q?REPORT-46683=20=E3=80=90=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=EF=BC=8C=E9=80=89=E4=B8=AD=E8=A1=A8=E5=B9=B6=E6=8B=96=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=BC=B9=E7=AA=97=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E4=BA=86=20SQLEitPane=E7=9A=84=E5=88=86=E9=9A=94?= =?UTF-8?q?=E7=AC=A6=E8=AF=AF=E4=BC=A0=E6=88=90CR=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BALF=E9=87=8D=E6=96=B0=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/sqlpane/SQLEditPane.java | 195 +++++++++++++++++- 1 file changed, 194 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java index 3073a62db2..fa928b05cd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java @@ -1 +1,194 @@ -package com.fr.design.data.datapane.sqlpane; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import javax.swing.Icon; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.Point; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetContext; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); this.setSmallIcon((Icon) null); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon((Icon) null); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon((Icon) null); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FineLoggerFactory.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file +package com.fr.design.data.datapane.sqlpane; + +import com.fr.data.core.DataCoreUtils; +import com.fr.data.core.db.TableProcedure; +import com.fr.design.actions.UpdateAction; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; +import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; + +import javax.swing.Icon; +import javax.swing.JPopupMenu; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import java.awt.Point; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetAdapter; +import java.awt.dnd.DropTargetContext; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.event.ActionEvent; + +/** + * Created by IntelliJ IDEA. + * Author : Richer + * Version: 7.0.3 + * Date: 13-5-2 + * Time: 上午11:09 + */ +public class SQLEditPane extends RSyntaxTextArea { + public static final boolean REQUEST_DROPTARGET = true; + public static final boolean UNREQUEST_DROPTARGET = false; + + public SQLEditPane() { + this(REQUEST_DROPTARGET); + } + + public SQLEditPane(boolean requestDroptarget) { + super(); + + setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); + + setAnimateBracketMatching(true); + setAntiAliasingEnabled(true); + setAutoIndentEnabled(true); + setCodeFoldingEnabled(true); + setUseSelectedTextColor(true); + setCloseCurlyBraces(true); + setBracketMatchingEnabled(true); + setAntiAliasingEnabled(true); + setCloseMarkupTags(true); + setLineWrap(true); + if (requestDroptarget) { + new SQLPaneDropTarget(this); + } + + } + + + private static class SQLPaneDropTarget extends DropTargetAdapter { + private TableProcedure sqlTable; + + public SQLPaneDropTarget(SQLEditPane sqlTextPane) { + new DropTarget(sqlTextPane, this); + } + + public void dragEnter(DropTargetDragEvent dtde) { + dtde.acceptDrag(dtde.getDropAction()); + } + + public void dragOver(DropTargetDragEvent dtde) { + dtde.acceptDrag(dtde.getDropAction()); + } + + public void drop(DropTargetDropEvent dtde) { + Point p = dtde.getLocation(); + DropTargetContext dtc = dtde.getDropTargetContext(); + SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); + + try { + Transferable tr = dtde.getTransferable(); + DataFlavor[] flavors = tr.getTransferDataFlavors(); + for (int i = 0; i < flavors.length; i++) { + if (!tr.isDataFlavorSupported(flavors[i])) { + continue; + } + dtde.acceptDrop(dtde.getDropAction()); + Object userObj = tr.getTransferData(flavors[i]); + + if (userObj instanceof TableProcedure) { + this.sqlTable = (TableProcedure) userObj; + + JPopupMenu popupMenu = new JPopupMenu(); + popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); + if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { + popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); + } else { + popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); + } + + GUICoreUtils.showPopupMenu(popupMenu, jTextPane, + (int) p.getX() + 1, (int) p.getY() + 1); + } + + dtde.dropComplete(true); + } + + dtde.rejectDrop(); + } catch (Exception e) { + dtde.rejectDrop(); + } + } + + class NameAction extends UpdateAction { + private SQLEditPane sqlTextPane; + private TableProcedure sqlTable; + + public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { + this.sqlTextPane = sqlTextPane; + this.sqlTable = sqlTable; + + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); + this.setMnemonic('N'); + this.setSmallIcon((Icon) null); + } + + public void actionPerformed(ActionEvent evt) { + if (sqlTable != null) { + insertStringTo(sqlTextPane, sqlTable.toString()); + } + + } + } + + class SelectAction extends UpdateAction { + private SQLEditPane sqlTextPane; + private TableProcedure sqlTable; + + public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { + this.sqlTextPane = sqlTextPane; + this.sqlTable = sqlTable; + + this.setName("SELECT *"); + this.setMnemonic('s'); + this.setSmallIcon((Icon) null); + } + + public void actionPerformed(ActionEvent evt) { + //daniel: 添加参数 + insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); + } + } + + class CallAction extends UpdateAction { + private SQLEditPane sqlTextPane; + private TableProcedure sqlTable; + + public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { + this.sqlTextPane = sqlTextPane; + this.sqlTable = sqlTable; + + this.setName("CALL PROCEDURE "); + this.setMnemonic('s'); + this.setSmallIcon((Icon) null); + } + + public void actionPerformed(ActionEvent evt) { + StringBuffer sBuf = new StringBuffer(); + sBuf.append("{call "); + if (sqlTable != null) { + sBuf.append(sqlTable.toString()).append("()"); + } + sBuf.append('}'); + + insertStringTo(sqlTextPane, sBuf.toString()); + } + } + + private void insertStringTo(SQLEditPane sqlTextPane, String str) { + Document document = sqlTextPane.getDocument(); + try { + document.insertString(sqlTextPane.getCaretPosition(), str, null); + } catch (BadLocationException badLocationException) { + FineLoggerFactory.getLogger().error(badLocationException.getMessage(), badLocationException); + } + + sqlTextPane.requestFocus(); + } + } +} From 24c771bd55849fbf350bcd2e6e8698fdc62d7a4d Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 7 Jan 2021 14:20:36 +0800 Subject: [PATCH 086/104] =?UTF-8?q?REPORT-46589=20=E6=8A=8A=E5=8D=95?= =?UTF-8?q?=E7=8B=AC=E8=BF=87=E6=BB=A4=E7=9A=84=E7=B1=BB=E6=8A=BD=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=20=E4=BB=A5=E8=BF=87=E6=BB=A4=E5=99=A8=E5=BD=A2?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 4 +-- .../fr/design/file/filter/ClassFilter.java | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 06bfd3cf74..f6b8f07d52 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -5,11 +5,11 @@ import com.fr.base.io.BaseBook; import com.fr.design.DesignerEnvManager; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.file.filter.ClassFilter; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; -import com.fr.design.mainframe.JTemplateFactory; import com.fr.design.mainframe.JVirtualTemplate; import com.fr.design.module.DesignModuleFactory; import com.fr.design.ui.util.UIUtil; @@ -474,7 +474,7 @@ public class HistoryTemplateListCache implements CallbackEvent { String name = template.getEditingFILE().getName(); String pluginId = context.getID(); long start = System.currentTimeMillis(); - Set set = ClassHelper.getClassLoaders(baseBook); + Set set = ClassHelper.getClassLoadersByFilter(baseBook, ClassFilter.getInstance()); FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); if (set != null) { for (ClassLoader classLoader : set) { diff --git a/designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java b/designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java new file mode 100644 index 0000000000..d89c546a98 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java @@ -0,0 +1,34 @@ +package com.fr.design.file.filter; + +import com.fr.stable.Filter; +import java.util.HashSet; +import java.util.Set; + +/** + * 过滤无需遍历的jdk class + * + * @author hades + * @version 10.0 + * Created by hades on 2021/1/7 + */ +public class ClassFilter implements Filter { + + + private static final Set FILTER_SET = new HashSet<>(); + + private static final Filter INSTANCE = new ClassFilter(); + + public static Filter getInstance() { + return INSTANCE; + } + + static { + FILTER_SET.add("java.awt.image.BufferedImage"); + FILTER_SET.add("sun.awt.AppContext"); + } + + @Override + public boolean accept(String s) { + return FILTER_SET.contains(s); + } +} From 1c836a495ecf67632ce873bef2731e4f560c81a2 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 7 Jan 2021 15:15:11 +0800 Subject: [PATCH 087/104] =?UTF-8?q?REPORT-46683=20=E3=80=90=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=EF=BC=8C=E9=80=89=E4=B8=AD=E8=A1=A8=E5=B9=B6=E6=8B=96=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=BC=B9=E7=AA=97=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E4=BA=86=20=E5=9C=A8UIConstants=E4=B8=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=AAEMPTY=5FICON=E4=BB=A3=E8=A1=A8?= =?UTF-8?q?=E6=97=A0=E5=9B=BE=E6=A0=87=EF=BC=8C=E7=84=B6=E5=90=8E=E5=9C=A8?= =?UTF-8?q?UpdateAction=E7=9A=84setSmallIcon=E6=96=B9=E6=B3=95=E4=B8=AD?= =?UTF-8?q?=E5=AF=B9=E4=BC=A0=E8=BF=87=E6=9D=A5=E7=9A=84=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=BF=9B=E8=A1=8C=E5=88=A4=E6=96=AD=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=B8=BA""=EF=BC=8C=E5=B0=B1=E6=8A=8Anull?= =?UTF-8?q?=E4=BD=9C=E4=B8=BAIcon=20=E7=9A=84Value=E5=80=BCput=E5=88=B0map?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E4=B8=8E=E4=B9=8B=E5=89=8D=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/actions/UpdateAction.java | 8 +++++++- .../main/java/com/fr/design/constants/UIConstants.java | 4 ++++ .../com/fr/design/data/datapane/sqlpane/SQLEditPane.java | 6 +++--- .../com/fr/quickeditor/cellquick/CellDSColumnEditor.java | 2 +- .../com/fr/quickeditor/cellquick/CellRichTextEditor.java | 2 +- .../com/fr/quickeditor/cellquick/CellSubReportEditor.java | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java index 1fc6e14440..bb4ba4cccc 100644 --- a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java @@ -180,9 +180,15 @@ public abstract class UpdateAction extends ShortCut implements Action { * 如果a_disabled.svg或者a_pressed.svg缺失,则不会被设置成灰化状态或者按压状态图标 * 如果a_normal.svg缺失,则会读到a.png,这也就不是一个SVGIcon了 * 如果连 a.png 也不存在,那么这个action的图标就是空白的 - * @param resource + * + * 如果想让这个Action没有图标,可以传入"" + * @param resource 图标资源路径 */ public void setSmallIcon(String resource) { + if (StringUtils.equals(resource, StringUtils.EMPTY)) { + this.putValue(Action.SMALL_ICON, null); + return; + } this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource)); this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED)); } diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index 8887f79866..fdc92a9371 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -4,11 +4,14 @@ package com.fr.design.constants; import com.fr.base.svg.IconUtils; +import com.fr.base.svg.SVGIcon; import com.fr.general.IOUtils; import com.fr.stable.Constants; +import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.Icon; +import javax.swing.ImageIcon; import javax.swing.border.Border; import java.awt.BasicStroke; import java.awt.Color; @@ -26,6 +29,7 @@ public interface UIConstants { public static final Icon CPT_ICON = IOUtils.readIcon("/com/fr/base/images/oem/cpt.png"); public static final Icon BLACK_ICON = IOUtils.readIcon("/com/fr/base/images/cell/blank.gif"); + public static final String EMPTY_ICON = StringUtils.EMPTY; public static final Image APPFIT_V0 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png"); public static final Image APPFIT_V1 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png"); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java index fa928b05cd..7f5d083004 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java @@ -125,7 +125,7 @@ public class SQLEditPane extends RSyntaxTextArea { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); - this.setSmallIcon((Icon) null); + this.setSmallIcon(UIConstants.EMPTY_ICON); } public void actionPerformed(ActionEvent evt) { @@ -146,7 +146,7 @@ public class SQLEditPane extends RSyntaxTextArea { this.setName("SELECT *"); this.setMnemonic('s'); - this.setSmallIcon((Icon) null); + this.setSmallIcon(UIConstants.EMPTY_ICON); } public void actionPerformed(ActionEvent evt) { @@ -165,7 +165,7 @@ public class SQLEditPane extends RSyntaxTextArea { this.setName("CALL PROCEDURE "); this.setMnemonic('s'); - this.setSmallIcon((Icon) null); + this.setSmallIcon(UIConstants.EMPTY_ICON); } public void actionPerformed(ActionEvent evt) { diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index f9427a5a8f..dc6b0490fd 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -260,7 +260,7 @@ public class CellDSColumnEditor extends CellQuickEditor { condition.setEditingComponent(tc); } //丢掉icon,修改按钮名称为编辑 - condition.setSmallIcon((Icon) null); + condition.setSmallIcon(UIConstants.EMPTY_ICON); condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); conditionUIButton = new UIButton(condition); Component[][] components = new Component[][]{ diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java index 0550e23ffc..efddda0adf 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java @@ -49,7 +49,7 @@ public class CellRichTextEditor extends CellQuickEditor { protected void refreshDetails() { RichTextCellAction subReportCellAction = new RichTextCellAction(tc); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); - subReportCellAction.setSmallIcon((Icon) null); + subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON); richTextButton.setAction(subReportCellAction); } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java index 3614c3be0d..d44380a5b8 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java @@ -45,7 +45,7 @@ public class CellSubReportEditor extends CellQuickEditor { protected void refreshDetails() { SubReportCellAction subReportCellAction = new SubReportCellAction(tc); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); - subReportCellAction.setSmallIcon((Icon) null); + subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON); subReportButton.setAction(subReportCellAction); } From 5ac5cfbba9dab5932733999aa2722cbe09018aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 7 Jan 2021 15:31:03 +0800 Subject: [PATCH 088/104] =?UTF-8?q?CHART-17805=20=E9=A5=BC=E5=9B=BE?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=BE=8E=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartPieValueLabelDetailPane.java | 21 +++++++++++++++++++ .../label/VanChartPlotLabelDetailPane.java | 6 ++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java index 707f6f5fd8..43f6da1e94 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java @@ -13,6 +13,7 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.pie.style.VanChartPieValueLabelContentPane; import javax.swing.JPanel; +import java.awt.BorderLayout; import java.awt.Component; /** @@ -34,6 +35,14 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane return panel; } + protected JPanel createBorderAndBackgroundPane() { + JPanel jPanel = new JPanel(); + jPanel.setLayout(new BorderLayout(0, 10)); + jPanel.add(createLabelBorderPane(), BorderLayout.NORTH); + jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER); + return jPanel; + } + protected JPanel createLabelBorderPane() { VanChartBorderWithShapePane borderPane = new VanChartBorderWithShapePane() { @Override @@ -58,6 +67,18 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane protected JPanel createLabelBackgroundPane() { VanChartBackgroundWithOutImagePane backgroundPane = new VanChartBackgroundWithOutImagePane() { + + @Override + protected JPanel initContentPanel() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; + return TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize); + } + + @Override protected Component[][] getPaneComponents() { return new Component[][]{ new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_Background")), typeComboBox}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 624e6c879e..0467fe3f5e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -23,6 +23,7 @@ import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutI import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; import com.fr.van.chart.designer.style.VanChartStylePane; +import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; @@ -242,6 +243,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if (plot.isSupportLeadLine()) { tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); tractionLinePane = TableLayout4VanChartHelper.createGapTableLayoutPane("", tractionLine); + tractionLinePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); panel.add(tractionLinePane, BorderLayout.SOUTH); initPositionListener(); } else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { @@ -350,7 +352,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private void checkPosition() { - tractionLine.setSelected(position.getSelectedItem() == Constants.OUTSIDE); + tractionLine.setSelected(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE); checkPositionEnabled(); } @@ -364,7 +366,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private void checkPositionEnabled() { - tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE); + tractionLinePane.setVisible(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE); } protected void checkPane() { From 39855d1feab4ba8f4926d5b3852f32eb4bb64369 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 7 Jan 2021 18:52:21 +0800 Subject: [PATCH 089/104] =?UTF-8?q?REPORT-46713=20&&=20REPORT-46469=20&&?= =?UTF-8?q?=20REPORT-46735=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E7=94=B1REPORT-44961=E4=B8=AD=E7=9A=84=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E5=BC=95=E8=B5=B7=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=91=E5=BC=95=E8=B5=B7=E4=BA=86=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E5=AE=A2=E6=88=B7bug=EF=BC=8C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=9C=A8=E6=98=8E=E5=A4=A9=E7=9A=84=E4=B8=AD=E9=97=B4=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=91=E5=B8=83=EF=BC=8C=E5=9B=A0=E6=AD=A4=E8=BF=98?= =?UTF-8?q?=E6=B2=A1=E4=BB=94=E7=BB=86=E6=8E=92=E6=9F=A5=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=EF=BC=8C=E6=9A=82=E6=97=B6=E5=85=88=E5=9B=9E=E9=80=80=E6=8E=89?= =?UTF-8?q?REPORT-44961=E4=B8=AD=E7=9A=84=E6=94=B9=E5=8A=A8=EF=BC=8C?= =?UTF-8?q?=E8=B5=B6=E4=B8=80=E4=B8=8B=E6=98=8E=E5=A4=A9=E7=9A=84=E5=8F=91?= =?UTF-8?q?=E5=B8=83=EF=BC=8C=E5=90=8E=E7=BB=AD=E7=BB=A7=E7=BB=AD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9REPORT-44961=E7=9A=84=E6=97=B6=E5=80=99=E5=86=8D?= =?UTF-8?q?=E6=8E=92=E6=9F=A5=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/present/dict/DictionaryPane.java | 4 - .../present/dict/TableDataDictPane.java | 93 +++++++------------ .../ui/designer/CheckBoxGroupDefinePane.java | 3 +- 3 files changed, 33 insertions(+), 67 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index 3f42732f19..94e4b3f0ff 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -27,10 +27,6 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr public DictionaryPane() { } - public DictionaryPane(boolean needTableDataChange) { - this.tableDataDictPane.setNeedTableDataChange(needTableDataChange); - } - @Override protected void initLayout() { this.setLayout(new BorderLayout(0, 4)); diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index 5eb6c28737..f0c291035d 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -64,7 +64,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane private ItemListener itemListener; private UIObserverListener uiObserverListener; private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); - private boolean needTableDataChange = true; public TableDataDictPane() { initBasicComponets(); @@ -72,14 +71,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane iniListener(); } - /** - * 设置为true后,一旦触发TableDataComboBox的itemChange,就会通过数据连接,更换当前数据字典的列名List - * @param needTableDataChange - */ - public void setNeedTableDataChange(boolean needTableDataChange) { - this.needTableDataChange = needTableDataChange; - } - public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -169,58 +160,38 @@ public class TableDataDictPane extends FurtherBasicBeanPane if (tableDataWrappe == null) { return; } - if (itemListener != null) { - itemListener.itemStateChanged(e); - localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); - } - if (isNeedTableDataChange()) { - changeColumnsName(); + List namelist = tableDataWrappe.calculateColumnNameList(); + String[] columnNames = null; + if (!namelist.isEmpty()) { + columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); + } else { + columnNames = new String[]{StringUtils.EMPTY}; } - } - - private void changeColumnsName() { - TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); - SwingWorker, Object> worker = new SwingWorker, Object>() { - @Override - protected List doInBackground() { - if (tableDataWrappe == null) { - return new ArrayList<>(); - } - return tableDataWrappe.calculateColumnNameList(); - } + // 实际值列名 + ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames); + actualColumnNameEditor.addItemListener(itemListener); + // 实际值列序号 + ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length); + actualColumnIndexEditor.addItemListener(itemListener); + keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]); - @Override - protected void done() { - try { - List namelist = get(); - String[] columnNames = null; - if (!namelist.isEmpty()) { - columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); - } else { - columnNames = new String[]{StringUtils.EMPTY}; - } - // 实际值列名 - ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames); - actualColumnNameEditor.addItemListener(itemListener); - // 实际值列序号 - ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length); - actualColumnIndexEditor.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]); - - localFormulaEditor.setEnabled(true); - // 显示值列名 - ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames); - displayColumnNameEditor.addItemListener(itemListener); - // 显示值列序号 - ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length); - displayColumnIndexEditor.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, localFormulaEditor}, columnNames[0]); - } catch (InterruptedException | ExecutionException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); + formulaEditor.setEnabled(true); + formulaEditor.addChangeListener(ee -> { + if (itemListener != null) { + itemListener.itemStateChanged(e); } - }; - worker.execute(); + }); + // 显示值列名 + ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames); + displayColumnNameEditor.addItemListener(itemListener); + // 显示值列序号 + ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length); + displayColumnIndexEditor.addItemListener(itemListener); + valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, formulaEditor}, columnNames[0]); + if (itemListener != null) { + itemListener.itemStateChanged(e); + } } @Override @@ -405,7 +376,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane tableDataNameComboBox.registerGlobalDSChangeListener(); } - public boolean isNeedTableDataChange() { - return needTableDataChange; - } +// public boolean isNeedTableDataChange() { +// return needTableDataChange; +// } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java index 022afc6105..74819ae452 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java @@ -28,8 +28,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane Date: Thu, 7 Jan 2021 18:55:30 +0800 Subject: [PATCH 090/104] =?UTF-8?q?REPORT-46713=20&&=20REPORT-46469=20&&?= =?UTF-8?q?=20REPORT-46735=20=E5=88=A0=E5=8E=BB=E6=B3=A8=E9=87=8A=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/present/dict/TableDataDictPane.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index f0c291035d..5ebd426593 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -375,8 +375,4 @@ public class TableDataDictPane extends FurtherBasicBeanPane public void registerDSChangeListener() { tableDataNameComboBox.registerGlobalDSChangeListener(); } - -// public boolean isNeedTableDataChange() { -// return needTableDataChange; -// } } From e94c199fa3582949800dd42e7ba650425f35eda2 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 8 Jan 2021 13:55:47 +0800 Subject: [PATCH 091/104] =?UTF-8?q?REPORT-45689=20=20=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/fun/MobileParamUIProvider.java | 2 +- .../design/widget/ui/designer/mobile/ParaMobileDefinePane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java index a8d8acc4e0..e76d24209d 100644 --- a/designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java @@ -26,7 +26,7 @@ public interface MobileParamUIProvider extends Mutable { * 移动端参数面板中扩展项的面板 * @return */ - Class> classForMobileParamAppearance(); + Class> classForMobileParamAppearance(); /** * 扩展项的名称描述 diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index 1c1fe0150d..906fa6e55e 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -82,7 +82,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Parameter_Panel")), mobileParamEditor}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Param_Style")), mobileParamEditor}, new Component[]{tipLabel, null}, }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); From cd5764193458b4fcef3766ad773a6428260c8377 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 8 Jan 2021 17:01:25 +0800 Subject: [PATCH 092/104] =?UTF-8?q?REPORT-46585=20=E5=9C=A8=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E6=96=B0=E5=BB=BA=E7=BC=96=E8=BE=91=E7=9A=84=E6=9C=AA?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=A8=A1=E6=9D=BF=E5=88=87=E6=8D=A2=E5=9B=9E?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E4=B8=8D=E8=83=BD=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 2 +- .../fr/design/mainframe/JTemplateFactory.java | 30 ++++++++++++------- 2 files changed, 21 insertions(+), 11 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 f540cdbc64..4007be8a31 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 @@ -341,7 +341,7 @@ public abstract class JTemplate> public void refreshResource(FILE file) { try { - this.template = JTemplateFactory.asIOFile(file); + this.template = JTemplateFactory.asIOFile(file, this.suffix()); setTarget(this.template); // 先移除旧的。 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java index 678b9bf841..5e75cc64be 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java @@ -3,11 +3,12 @@ package com.fr.design.mainframe; import com.fr.base.io.BaseBook; import com.fr.file.FILE; import com.fr.stable.CoreConstants; -import com.fr.third.javax.annotation.Nonnull; -import com.fr.third.javax.annotation.Nullable; +import com.fr.stable.StringUtils; import java.util.ArrayList; import java.util.List; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public final class JTemplateFactory { private static final List> ALL_APP = new ArrayList>(); @@ -21,8 +22,7 @@ public final class JTemplateFactory { * @param file 包含了模板名称,类型以及内容的文件 * @return 设计器编辑的模板对象 */ - @Nullable - public static JTemplate createJTemplate(@Nonnull FILE file) { + public static JTemplate createJTemplate(@NotNull FILE file) { String fileName = file.getName(); int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT); @@ -43,15 +43,19 @@ public final class JTemplateFactory { } return null; } - - public static T asIOFile(@Nonnull FILE file) { - - String fileName = file.getName(); - int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT); + + @Nullable + public static T asIOFile(@NotNull FILE file, String fileNameOrSuffix) { + + if (StringUtils.isEmpty(fileNameOrSuffix)) { + return null; + } + + int indexOfLastDot = fileNameOrSuffix.lastIndexOf(CoreConstants.DOT); if (indexOfLastDot < 0) { return null; } - String fileExtension = fileName.substring(indexOfLastDot + 1); + String fileExtension = fileNameOrSuffix.substring(indexOfLastDot + 1); for (App app : ALL_APP) { String[] defaultAppExtensions = app.defaultExtensions(); for (String defaultAppExtension : defaultAppExtensions) { @@ -66,6 +70,12 @@ public final class JTemplateFactory { return null; } + @Nullable + public static T asIOFile(@NotNull FILE file) { + return asIOFile(file, file.getName()); + } + + /** * 注册app. From c8474323c481fa73cbe5e2b2473a7912b4f6123c Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 11 Jan 2021 10:38:25 +0800 Subject: [PATCH 093/104] =?UTF-8?q?REPORT-46234=20=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8\=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BBpara=EF=BC=8C=E4=B8=8A=E6=96=B9?= =?UTF-8?q?=E6=98=AF=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E4=B8=8B=E6=96=B9=E6=98=AF=E7=BB=84=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 17 ++++++------- .../ui/WidgetBasicPropertyPaneFactory.java | 24 +++++++++++++++---- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 66a77e1c2d..8827d6a857 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -99,7 +99,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public enum PropertyMode { REPORT, // 报表 - REPORT_PARA, // 报表参数面板 + REPORT_PARA_WIDGET, //报表参数面板中的控件 + REPORT_PARA(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 报表参数面板 REPORT_FLOAT, // 报表悬浮元素 FORM(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 表单 FORM_REPORT, // 表单报表块 @@ -272,27 +273,27 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap = new LinkedHashMap<>(); // 有序map // 单元格元素 PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Element"), - "cellelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "cellelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 单元格属性 PropertyItem cellAttr = new PropertyItem(KEY_CELL_ATTR, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Attributes"), - "cellattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "cellattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 悬浮元素 PropertyItem floatElement = new PropertyItem(KEY_FLOAT_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Float_Element"), - "floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.POLY_REPORT}); // 控件设置 PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings"), - "widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, - new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.FORM, PropertyMode.POLY_REPORT, PropertyMode.POLY_CHART}); + "widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, + new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.FORM, PropertyMode.POLY_REPORT, PropertyMode.POLY_CHART}); // 条件属性 PropertyItem conditionAttr = new PropertyItem(KEY_CONDITION_ATTR, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), - "conditionattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "conditionattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 超级链接 PropertyItem hyperlink = new PropertyItem(KEY_HYPERLINK, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hyperlink"), - "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 组件库 PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"), diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/WidgetBasicPropertyPaneFactory.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/WidgetBasicPropertyPaneFactory.java index db98069094..a3a34a0619 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/WidgetBasicPropertyPaneFactory.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/WidgetBasicPropertyPaneFactory.java @@ -1,21 +1,37 @@ package com.fr.design.mainframe.widget.ui; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.mainframe.JForm; /** * Created by kerry on 2017/9/30. */ public class WidgetBasicPropertyPaneFactory { - public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator){ - if(xCreator.supportSetVisible() && xCreator.supportSetEnable()){ + public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator) { + freshPropertyMode(xCreator); + if (xCreator.supportSetVisible() && xCreator.supportSetEnable()) { return new FormBasicWidgetPropertyPane(); } - if(xCreator.supportSetVisible()){ + if (xCreator.supportSetVisible()) { return new BasicSetVisiblePropertyPane(); - }else{ + } else { return new FormBasicPropertyPane(); } } + + private static void freshPropertyMode(XCreator xCreator) { + if (!(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() instanceof JForm)) { + if (xCreator instanceof XWParameterLayout) { + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA); + } else { + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA_WIDGET); + } + } + } + } From 3d1027a73070f9fedff785f80c369e8ee47ff525 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 11 Jan 2021 11:38:11 +0800 Subject: [PATCH 094/104] =?UTF-8?q?REPORT-46679=20jdk11-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E5=9B=BE=E6=A0=87=E4=BC=98=E5=8C=96-?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=A0=91=E5=9B=BE=E6=A0=87=E9=83=BD=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=EF=BC=8C=E5=B0=A4=E5=85=B6=E6=98=AF=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91svg=E5=9B=BE=E6=A0=87=E6=BC=8F=E4=BC=A0?= =?UTF-8?q?=E5=88=B0release=E5=88=86=E6=94=AF=E4=BA=86=EF=BC=8C=E6=89=80?= =?UTF-8?q?=E4=BB=A5=E6=98=BE=E7=A4=BA=E7=9A=84=E6=98=AF=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84png=E5=9B=BE=EF=BC=8C=E6=AF=94=E8=BE=83=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91=E8=A1=A5=E5=85=85=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../images/FileDealerPaneIcon/new_folder_disabled.svg | 8 ++++++++ .../images/FileDealerPaneIcon/new_folder_normal.svg | 8 ++++++++ .../design/images/FileDealerPaneIcon/refresh_normal.svg | 7 +++++++ .../design/images/FileDealerPaneIcon/remove_disabled.svg | 7 +++++++ .../fr/design/images/FileDealerPaneIcon/remove_normal.svg | 7 +++++++ .../design/images/FileDealerPaneIcon/rename_disabled.svg | 7 +++++++ .../fr/design/images/FileDealerPaneIcon/rename_normal.svg | 7 +++++++ .../images/FileDealerPaneIcon/vcs_list_disabled.svg | 7 +++++++ .../design/images/FileDealerPaneIcon/vcs_list_normal.svg | 7 +++++++ .../images/FileDealerPaneIcon/view_folder_disabled.svg | 7 +++++++ .../images/FileDealerPaneIcon/view_folder_normal.svg | 7 +++++++ 11 files changed, 79 insertions(+) create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg new file mode 100644 index 0000000000..f3936e1539 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg @@ -0,0 +1,8 @@ + + + icon_NewFolderIcon_disable + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg new file mode 100644 index 0000000000..85f41e26a7 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg @@ -0,0 +1,8 @@ + + + icon_NewFolderIcon_normal + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg new file mode 100644 index 0000000000..4e3fd9c147 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg @@ -0,0 +1,7 @@ + + + icon_刷新_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg new file mode 100644 index 0000000000..1245fbd4e3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg @@ -0,0 +1,7 @@ + + + icon_删除_disabled + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg new file mode 100644 index 0000000000..69a3011faf --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg @@ -0,0 +1,7 @@ + + + icon_删除_normal copy + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg new file mode 100644 index 0000000000..953e12eaa9 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg @@ -0,0 +1,7 @@ + + + icon_重命名_disable + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg new file mode 100644 index 0000000000..a2c287789d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg @@ -0,0 +1,7 @@ + + + icon_重命名_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg new file mode 100644 index 0000000000..b88ee0998e --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg @@ -0,0 +1,7 @@ + + + icon_版本管理_disabled + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg new file mode 100644 index 0000000000..ebfca43899 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg @@ -0,0 +1,7 @@ + + + icon_版本管理_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg new file mode 100644 index 0000000000..376d372d41 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg @@ -0,0 +1,7 @@ + + + icon_打开文件_disable + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg new file mode 100644 index 0000000000..42ae6cbd3d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg @@ -0,0 +1,7 @@ + + + icon_所在文件夹_normal + + + + \ No newline at end of file From 4550d21f02c908e05311ef399e443a8cd15b072d Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 Jan 2021 14:20:29 +0800 Subject: [PATCH 095/104] =?UTF-8?q?REPORT-45689=20=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E7=A9=BA=E7=B1=BB=E5=9E=8B=20=E6=97=A0=E9=A1=BB=E5=A1=AB?= =?UTF-8?q?=E5=85=85=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/mobile/ui/MobileParamSettingPane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java index d2a358c192..7f1d270af5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java @@ -12,6 +12,7 @@ import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.general.ComparatorUtils; import com.fr.report.ExtraReportClassManager; import com.fr.report.fun.MobileParamStyleProvider; +import com.fr.report.mobile.EmptyMobileParamStyle; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -103,7 +104,10 @@ public class MobileParamSettingPane extends BasicPane { if (ComparatorUtils.equals(mobileParamStyle.disPlayName(), provider.displayName())) { String displayName = provider.displayName(); paramStyleList.setSelectedIndex(i); - map.get(displayName).populateBean(mobileParamStyle); + // 如果是兼容空类型 无须填充面板 + if (!(mobileParamStyle instanceof EmptyMobileParamStyle)) { + map.get(displayName).populateBean(mobileParamStyle); + } card.show(right, displayName); return; } From 22a581c1089ce1ac5ae785033f417ebaaf19a5fd Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 11 Jan 2021 17:28:17 +0800 Subject: [PATCH 096/104] REPORT-46574 & REPORT-46813 & REPORT-46550 --- .../java/com/fr/design/EnvChangeEntrance.java | 7 ++- .../com/fr/env/PluginErrorRemindDialog.java | 44 +++++++++------ .../warnings/icon_WarningIcon_normal.png | Bin 0 -> 1365 bytes .../warnings/icon_WarningIcon_normal@2x.png | Bin 0 -> 2762 bytes .../com/fr/design/EnvChangeEntranceTest.java | 26 +++++---- .../module/DesignerWorkspaceProvider.java | 11 +++- .../module/DesignerWorkspaceProviderTest.java | 50 ++++++++++++++++++ 7 files changed, 107 insertions(+), 31 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal@2x.png create mode 100644 designer-realize/src/test/java/com/fr/start/module/DesignerWorkspaceProviderTest.java diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index ed67299f6d..3e2b30fee2 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -146,7 +146,7 @@ public class EnvChangeEntrance { template.refreshToolArea(); } showServiceDialog(selectedEnv); - pluginErrorRemind(selectedEnv); + pluginErrorRemind(); } catch (WorkspaceAuthException | RegistEditionException e) { // String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed"); // String title = Toolkit.i18nText("Fine-Design_Basic_Lic_Does_Not_Support_Remote"); @@ -302,10 +302,9 @@ public class EnvChangeEntrance { /** * 插件启动错误信息提示 - * @param selectedEnv 选择的工作环境 */ - public void pluginErrorRemind(DesignerWorkspaceInfo selectedEnv) { - if (selectedEnv.getType() == DesignerWorkspaceType.Remote) { + public void pluginErrorRemind() { + if (!WorkContext.getCurrent().isLocal()) { return; } diff --git a/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java b/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java index 3654cca2d9..42dae0fa19 100644 --- a/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java +++ b/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java @@ -6,7 +6,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; -import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import javax.swing.BorderFactory; @@ -14,52 +13,65 @@ import javax.swing.Icon; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.JTextArea; +import javax.swing.JTextPane; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.StyleConstants; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Frame; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Locale; /** * 插件启动失败提示窗 */ public class PluginErrorRemindDialog extends JDialog implements ActionListener { - public PluginErrorRemindDialog(Frame parent, String areaText) { + private static final String SIM_HEI = "SimHei"; + + public PluginErrorRemindDialog(Frame parent, String text) { super(parent, true); //上面的标签面板 JPanel topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel imagePanel = new JPanel(); - Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning5.png"); + Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/icon_WarningIcon_normal.png"); JLabel imageLabel = new JLabel(); imageLabel.setIcon(icon); imagePanel.add(imageLabel); - imagePanel.setPreferredSize(new Dimension(130, 100)); + imagePanel.setPreferredSize(new Dimension(48, 48)); JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Title")); - label.setFont(FRFont.getInstance().applySize(18).applyStyle(1)); - label.setPreferredSize(new Dimension(650, 100)); + label.setFont(FRFont.getInstance().applySize(16).applyName(SIM_HEI)); + label.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); verticalPanel.add(label); topPanel.add(imagePanel, BorderLayout.WEST); topPanel.add(verticalPanel, BorderLayout.CENTER); - topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); + topPanel.setPreferredSize(new Dimension(600, 73)); + topPanel.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 20)); //中间的文本域面板 JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); - centerPanel.setPreferredSize(new Dimension(480, 320)); + centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + centerPanel.setPreferredSize(new Dimension(580, 269)); + + JTextPane textPane = new JTextPane(); + + SimpleAttributeSet attributeSet = new SimpleAttributeSet(); + StyleConstants.setFontFamily(attributeSet, SIM_HEI); + StyleConstants.setLineSpacing(attributeSet, 0.5f); + textPane.setParagraphAttributes(attributeSet, true); - JTextArea checkArea = new JTextArea(areaText); - checkArea.setEnabled(false); - centerPanel.add(checkArea, BorderLayout.CENTER); + textPane.setEditable(false); + textPane.setMargin(new Insets(10, 10, 10, 10)); + textPane.setText(text); + centerPanel.add(textPane, BorderLayout.CENTER); UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Not_Deal_With")); UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With")); @@ -69,7 +81,7 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener { // 按钮 JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); buttonPanel.add(cancelButton); buttonPanel.add(okButton); @@ -80,7 +92,7 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener { this.add(topPanel, BorderLayout.NORTH); this.add(centerPanel, BorderLayout.CENTER); this.add(buttonPanel, BorderLayout.SOUTH); - this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 750 : 600, 500)); + this.setSize(new Dimension(600, 400)); GUICoreUtils.centerWindow(this); } diff --git a/designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal.png b/designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..37dbe939b60d2020ad64d33cd9a51f7fbc02f24e GIT binary patch literal 1365 zcmV-b1*-aqP)I+S@$l@eSymtOPF{d8RwYxL3J5vhItA*e5e4p=U zp5M;znIT-^7hU20aTVbI?qDn(Um_0rSI{A;Jcs84JVY z6pF1FfV1jU%Rwi?Ka!axBoj@>?n)pk0yux-rgj57rA!lDLNgjFIiV{8urjGf82o;j z=KIo!c%jfbH;TfK4K8JQO>CnN?G8&{68KDc`*g zR5Q*C&~pIxH;YU8V>pGrf2;AjTUzBa#9_YLb;nJ}6(m=xkJe+MKfLq5*%m?^=?buA#6UtjH)1_(#Qpn#xC&!{J0j*kzfZd5qf2k$5Ki%+7sXDygI?W=K|6{SJ(Yfh)UztfBRg8&-P( zb}a*+>Ix&{#_koGQAbq#v04(q&ZZuB99|c;Dh(M2d73xP?pO>yeITq9B#9QwO}Tf9 zB^CwX&2`t?iK@d43=LiNy4xV8dp}NCJLdy`g&uX>eS1pI_l~0G?mr9pC<i?g@P_E+n)mY2(?z0KK0~8z~EGKR^R!;(+y~1jPOAUVyEQ zfRhg>Fffeswk5__J#VUq4@%snbZt`zpAKOY{_)5 zlFse8RNm78-u$3!C4SipV0@(>gyx-!Ej^M?qWeYumPyq7vE6^>Tx!(Lq@HlVZ&hmE z&5sEH66i@eoqPLV0K6?V#J1RdY~FA=0}$|sENB$X%AIz7_HQ9mPreSOr=u_*X9xQH z5x=2mozL_Gu&$1_9Q*)+5*0wKIt)`txQjI7P+teEjJlqIM`JA-u{Z(miL~)pAAq?< zJq5yz5!Z-Uj`6!P+ZcMj1G?J7j3Mz>j8>fpr-f$JT--uy7^^Kza8qx~zWy Xj(fI1j%-%800000NkvXXu0mjfh&Or{ literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal@2x.png b/designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..756a456566ea000a34429a55d8931c952dfa3298 GIT binary patch literal 2762 zcmV;*3N`hKP)VL1iRhg{8i0uZ6c<%g;9d}pX^0*A+x1yk+vmW%!{S6JJiQV8&Xp3JB@;s#8( zBn+Tb^$dyBPDFaZdRTNsbcE2Z!n(E>S%eTlC1HS*iti+VlMe#a_zL>-Pd^%)8TW7M!M9FYWQQPTyz5*E53#Ze&aQFePtuS z=m|X9xf9^*Nbs;dP^f81J&`Wzk+`S^(4mG=vh%eL0(igI?uaFi1CG6nMWfTNfNZ&z zh3yGKgqOt?ldG_5>v_*)pM;_sAXD+Lx&YttldGuN3^;xUi%KUuK(_gNf7ejEO_=GT z9gT}-09i}kCE;u*5nRmbVjqy0zX@>SM_5!kz8~c8{f&ST;SEtSrV>}|I?f6f5L7e+ z9Lso=h}QbeSIqqe;FKjSIvs5RdEhP=}p98J(I+ldn zxdq&g2U*xbL5TZeroAYbNMUy91~`rJPml}0DxAvD2(9vZ&}Q7kl5sm80=M%q7Ir8Q zg4UoX)4vWZG=xB?2GHI`74lT}MFN-_vmKA9?ko#_6fc0ZQJ~lFVKJPh#Q?7Q`)P>UHM*JpB`XOgNT~tz zyN0*P`MCNHOXE0n~19D3=9IN_i0GbyxnL>QdOd#kipimCo&m->F z6Y2Rumx2T~z)2Z55YW%qi3b33W&%NH0bbHW4R6pB_Ak6}`eFkaKs%R@k!Q~wCW6U9 zlHhVVGXW*D0A@mna8y)`nT{)Voncb?!2%hOZ8Yu%m+tf%+$)bW6Hqk^VCRN-cg(cE z&c^ov`Zj>JFTPwl=l{fAA>%i}o;=P>K-DaOn{R$Kjy~!GxO$JTn@_$Ca4h2qB5L3! zsshKE38AK{%Y5fXZ2bmt1uXsxgtVy>N0^ z&jt`}(45BIe*mI6UV{b2b7lgnX94`2@fqD*IuCJ!%jftoz_E6Vbap(9}U0Gl5WM0n7>z@$UjAOhdErKTL|Zm!NFQ z*a$$kbH$b87&C#eW&!M4G~5_V*mrR8?Dqg_Hr^*CbP&;KuJ}mAA>uh9U6(V?M8e)Yl)#V% z&{Ipt$v1O9s-R1KXQ7xloDAS>Y#h>ntYzE_ME-tiqPX#0a>L1he9nlQVx~Rlw~7Zf zAipqM$`=S=R7kz_B|F>qsE4~Z}N@}~{uzd;YN*rN%%*;I1_bTXTKz?C%03l8at zNwfMc67Oe#iiO!>dN6Da002$Hn?=I@QP2MLGJu+m@zSB(3Ykm7Y~o1OMu69aj+H$( zHuf?gYZ;q>=$4V%prX{>XOVcf0T=dmzCuJ}ijv3(4T6Yg#ON`X;mV!)A24(q5M+!pAmx&iX7j*9?>b?RT%QzAC+Te2g|JMOTJgJ*@ ze)-Y=4M@dbCjjO~q;e~RbRf6CT2E&3C(UjHvX=2&`JR7}wtC() { + @Override + public void on(Event event, Null aNull) { + EnvChangeEntrance.getInstance().pluginErrorRemind(); + } + }); } @Override diff --git a/designer-realize/src/test/java/com/fr/start/module/DesignerWorkspaceProviderTest.java b/designer-realize/src/test/java/com/fr/start/module/DesignerWorkspaceProviderTest.java new file mode 100644 index 0000000000..d058ee8de9 --- /dev/null +++ b/designer-realize/src/test/java/com/fr/start/module/DesignerWorkspaceProviderTest.java @@ -0,0 +1,50 @@ +package com.fr.start.module; + +import com.fr.design.constants.DesignerLaunchStatus; +import com.fr.event.EventDispatcher; +import com.fr.invoke.Reflect; +import com.fr.workspace.WorkContext; +import com.fr.workspace.Workspace; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.api.easymock.PowerMock; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +/** + * @author Lucian.Chen + * @version 10.0 + * Created by Lucian.Chen on 2021/1/7 + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest({WorkContext.class}) +public class DesignerWorkspaceProviderTest { + + @Test + public void testPluginErrorRemind() { + + try { + Workspace workspace = EasyMock.mock(Workspace.class); + EasyMock.expect(workspace.isLocal()).andReturn(false).once(); + PowerMock.mockStatic(WorkContext.class); + EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes(); + + EasyMock.replay(workspace); + PowerMock.replayAll(); + + DesignerWorkspaceProvider provider = new DesignerWorkspaceProvider(); + Reflect.on(provider).call("pluginErrorRemind"); + EventDispatcher.fire(DesignerLaunchStatus.STARTUP_COMPLETE); + + EasyMock.verify(workspace); + PowerMock.verifyAll(); + + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + + } +} From bd2e2eec65a75bfdde2f9c571412075b2d86a65b Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 Jan 2021 20:42:46 +0800 Subject: [PATCH 097/104] =?UTF-8?q?CHART-17822=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=95=8C=E9=9D=A2=E5=86=85=E7=9A=84=E5=9B=BE=E5=BD=A2?= =?UTF-8?q?=E4=B8=8D=E5=B0=8F=E5=BF=83=E5=88=87=E6=8D=A2=E5=88=B0=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E5=9B=BE=E5=BD=A2=E4=B8=94=E4=B8=8D=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E6=92=A4=E9=94=80=E9=94=AE=E6=B2=A1?= =?UTF-8?q?=E6=B3=95=E8=BF=94=E5=9B=9E=E5=88=B0=E5=88=87=E6=8D=A2=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JForm.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index b39dc91889..844649d40d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -97,6 +97,7 @@ import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import javax.swing.tree.TreePath; public class JForm extends JTemplate implements BaseJForm { private static final String FORM_CARD = "FORM"; @@ -623,6 +624,11 @@ public class JForm extends JTemplate implements BaseJForm Date: Tue, 12 Jan 2021 09:52:20 +0800 Subject: [PATCH 098/104] =?UTF-8?q?REPORT-45689=20=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JForm.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 844649d40d..d39de1d447 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -626,8 +626,12 @@ public class JForm extends JTemplate implements BaseJForm Date: Tue, 12 Jan 2021 10:17:12 +0800 Subject: [PATCH 099/104] =?UTF-8?q?REPORT-46285=20jdk11-=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=EF=BC=8C=E6=9C=89=E4=B8=80=E7=82=B9=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E7=BA=A2=E8=89=B2=E6=98=BE=E7=A4=BA=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E9=97=AE=E9=A2=98=E6=98=AF=E7=94=B1jdk=E5=B7=AE?= =?UTF-8?q?=E5=BC=82=E9=80=A0=E6=88=90=E7=9A=84=EF=BC=8C=E5=89=8D=E6=99=AF?= =?UTF-8?q?=E8=89=B2=E5=92=8C=E8=83=8C=E6=99=AF=E8=89=B2=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E9=83=BD=E6=98=AF=E7=94=B1=E4=B8=8A=E9=9D=A2=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E6=A0=87+=E4=B8=8B=E9=9D=A2=E7=9A=84=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E7=9F=A9=E5=BD=A2=E7=BB=84=E6=88=90=EF=BC=8C=E4=B8=8B=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=8F=96=E8=89=B2=E7=9F=A9=E5=BD=A2=E7=9A=84=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E7=94=B1=E6=95=B4=E4=B8=AA=E5=9B=BE=E6=A0=87=E7=9A=84?= =?UTF-8?q?=E5=AE=BD=E9=AB=98=E5=86=B3=E5=AE=9A=EF=BC=8C=E8=80=8C=E5=9C=A8?= =?UTF-8?q?jdk11=E4=B8=8B=EF=BC=8C=E6=8B=BF=E5=88=B0=E7=9A=84=E5=AE=BD?= =?UTF-8?q?=E9=AB=98=E4=B8=8Ejdk8=E4=B8=80=E6=A0=B7=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E6=9C=80=E7=BB=88=E7=BB=98=E5=88=B6=E5=87=BA=E6=9D=A5?= =?UTF-8?q?=E7=9A=84=E5=8F=96=E8=89=B2=E7=9F=A9=E5=BD=A2=E4=BC=9A=E5=BE=80?= =?UTF-8?q?=E5=B7=A6=E8=BE=B9=E5=81=8F=E7=A7=BB=E4=B8=80=E7=82=B9=EF=BC=8C?= =?UTF-8?q?=E5=A4=A7=E6=A6=82=E6=98=AF1px=EF=BC=8C=E8=80=8C=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2=E5=9B=BE=E6=A0=87=E4=B9=8B=E5=89=8D=E4=B8=8B?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E5=8F=96=E8=89=B2=E7=9F=A9=E5=BD=A2=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E4=B8=BA=E7=BA=A2=E8=89=B2=EF=BC=8C=E5=9C=A8=E5=81=8F?= =?UTF-8?q?=E7=A7=BB=E4=BA=86=E4=B9=8B=E5=90=8E=EF=BC=8C=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E5=BA=95=E4=B8=8B=E5=8F=96=E8=89=B2=E7=9F=A9=E5=BD=A2=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=AE=8C=E5=85=A8=E8=A6=86=E7=9B=96=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E7=BA=A2=E8=89=B2=EF=BC=8C=E6=89=80=E4=BB=A5=E6=BC=8F=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E7=82=B9=E5=87=BA=E6=9D=A5=EF=BC=8C=E8=A1=A8=E7=8E=B0?= =?UTF-8?q?=E4=B8=BA=E5=BC=82=E5=B8=B8=E7=9A=84=E7=BA=A2=E8=89=B2=E3=80=82?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91?= =?UTF-8?q?=E4=B8=8E=E4=BA=A7=E5=93=81=E7=A1=AE=E8=AE=A4=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=86=B3=E5=AE=9A=E5=85=88=E6=8A=8A=E8=83=8C=E6=99=AF=E8=89=B2?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=8F=96=E8=89=B2=E7=9F=A9=E5=BD=A2=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA=E9=80=8F=E6=98=8E=E8=89=B2=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E6=A0=B7=E5=B0=B1=E4=B8=8D=E4=BC=9A=E6=BC=8F=E5=87=BA=E4=B8=80?= =?UTF-8?q?=E7=82=B9=E7=BA=A2=E8=89=B2=EF=BC=8C=E8=80=8C=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E7=9F=A9=E5=BD=A2=E7=BB=98=E5=88=B6=E6=9C=89=E7=82=B9=E5=81=8F?= =?UTF-8?q?=E7=A7=BB=E7=9A=84=E9=97=AE=E9=A2=98=E9=9C=80=E8=A6=81=E5=8E=BB?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=8BUIColorButton=E7=9A=84UI=EF=BC=8C?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E5=9C=A8=E6=8D=A2=E5=AE=8C=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=90=8E=E5=86=8D=E7=BB=9F=E4=B8=80=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=AF=94=E8=BE=83=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/images/gui/color/background_normal.svg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/resources/com/fr/design/images/gui/color/background_normal.svg b/designer-base/src/main/resources/com/fr/design/images/gui/color/background_normal.svg index c4714560ce..577e8bd8a0 100644 --- a/designer-base/src/main/resources/com/fr/design/images/gui/color/background_normal.svg +++ b/designer-base/src/main/resources/com/fr/design/images/gui/color/background_normal.svg @@ -3,6 +3,5 @@ icon_文本背景色_normal - - + \ No newline at end of file From efa70cac0a51765ce8b98cd16105ce974168dacc Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 12 Jan 2021 11:14:58 +0800 Subject: [PATCH 100/104] =?UTF-8?q?REPORT-46585=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95=E6=97=B6=20=E5=85=88?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=90=8E=E6=B7=BB=E5=8A=A0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/PluginClassRefreshManager.java | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java index 711dd29759..3fa0266ed0 100644 --- a/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java +++ b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java @@ -39,6 +39,23 @@ public class PluginClassRefreshManager { } }; + private final PluginEventListener beforeAllPluginActive = new PluginEventListener() { + @Override + public void on(PluginEvent event) { + removePluginListener(); + } + }; + + private final PluginEventListener afterAllPluginsActive = new PluginEventListener() { + @Override + public void on(PluginEvent event) { + addPluginListener(); + if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { + HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); + } + } + }; + public static PluginClassRefreshManager getInstance() { return INSTANCE; @@ -50,29 +67,20 @@ public class PluginClassRefreshManager { } private PluginClassRefreshManager() { - PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, new PluginEventListener() { - @Override - public void on(PluginEvent event) { - removePluginListener(); - } - }); - PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, new PluginEventListener() { - @Override - public void on(PluginEvent event) { - addPluginListener(); - if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { - HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); - } - } - }); + PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, beforeAllPluginActive); + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, afterAllPluginsActive); } public void removePluginListener() { PluginListenerRegistration.getInstance().stopListen(this.pluginAfterRunEventListener); + PluginListenerRegistration.getInstance().stopListen(this.beforeAllPluginActive); + PluginListenerRegistration.getInstance().stopListen(this.afterAllPluginsActive); } public void addPluginListener() { PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener); + PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, beforeAllPluginActive); + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, afterAllPluginsActive); } } From fc501390c274dc90f2ce0d21fe8972e2b49e1a99 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 12 Jan 2021 11:28:05 +0800 Subject: [PATCH 101/104] =?UTF-8?q?REPORT-46585=20fix=20=E5=8D=95=E4=B8=AA?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=9B=91=E5=90=AC=E9=80=BB=E8=BE=91=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E4=B8=8E=E4=B9=8B=E5=89=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/PluginClassRefreshManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java index 3fa0266ed0..4ff6beda24 100644 --- a/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java +++ b/designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java @@ -42,14 +42,14 @@ public class PluginClassRefreshManager { private final PluginEventListener beforeAllPluginActive = new PluginEventListener() { @Override public void on(PluginEvent event) { - removePluginListener(); + PluginListenerRegistration.getInstance().stopListen(pluginAfterRunEventListener); } }; private final PluginEventListener afterAllPluginsActive = new PluginEventListener() { @Override public void on(PluginEvent event) { - addPluginListener(); + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, pluginAfterRunEventListener); if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); } From d0f99ed99010e0607d4def470c2db44a6d4c20f3 Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 12 Jan 2021 12:25:56 +0800 Subject: [PATCH 102/104] =?UTF-8?q?REPORT-46892=20=E3=80=90=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E5=88=87=E6=8D=A2=E5=88=B0=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=9C=89=E6=8F=92=E4=BB=B6=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=8D=E5=8C=B9=E9=85=8D=E6=97=B6=EF=BC=8C=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2=E4=BC=9A=E6=B6=88=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E6=AF=94=E8=BE=83=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 6 ++++-- .../java/com/fr/design/EnvChangeEntranceTest.java | 15 +++------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 3e2b30fee2..6de15517ac 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -310,8 +310,10 @@ public class EnvChangeEntrance { String content = PluginErrorRemindHandler.pluginErrorContent(); if (StringUtils.isNotEmpty(content)) { - PluginErrorRemindDialog dialog = new PluginErrorRemindDialog(DesignerContext.getDesignerFrame(), content); - dialog.setVisible(true); + SwingUtilities.invokeLater(() -> { + PluginErrorRemindDialog dialog = new PluginErrorRemindDialog(DesignerContext.getDesignerFrame(), content); + dialog.setVisible(true); + }); } } diff --git a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java index 6a78fe0c63..07a1d54f84 100644 --- a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java +++ b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java @@ -116,31 +116,22 @@ public class EnvChangeEntranceTest { Workspace workspace = EasyMock.mock(Workspace.class); EasyMock.expect(workspace.isLocal()).andReturn(false).once(); - EasyMock.expect(workspace.isLocal()).andReturn(true).times(2); + EasyMock.expect(workspace.isLocal()).andReturn(true).once(); PowerMock.mockStatic(WorkContext.class); EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes(); PowerMock.mockStatic(PluginErrorRemindHandler.class); EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("").once(); - EasyMock.expect(PluginErrorRemindHandler.pluginErrorContent()).andReturn("111").once(); - PluginErrorRemindDialog dialog = EasyMock.mock(PluginErrorRemindDialog.class); - PowerMock.expectNew(PluginErrorRemindDialog.class, EasyMock.anyObject(Frame.class), EasyMock.anyString()).andReturn(dialog).once(); - - dialog.setVisible(true); - EasyMock.expectLastCall(); - - EasyMock.replay(workspace, dialog); + EasyMock.replay(workspace); PowerMock.replayAll(); EnvChangeEntrance entrance = EnvChangeEntrance.getInstance(); entrance.pluginErrorRemind(); entrance.pluginErrorRemind(); - entrance.pluginErrorRemind(); - - EasyMock.verify(workspace, dialog); + EasyMock.verify(workspace); PowerMock.verifyAll(); } catch (Exception e) { Assert.fail(); From e323ac4dc0d78be90eeedda5fe9e7def6fcdbf26 Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 12 Jan 2021 14:36:28 +0800 Subject: [PATCH 103/104] =?UTF-8?q?REPORT-46584=20=E3=80=9010.0.13?= =?UTF-8?q?=E5=86=92=E7=83=9F=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8D=A1?= =?UTF-8?q?=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 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 4007be8a31..a47a6095de 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 @@ -47,7 +47,6 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; -import com.fr.design.ui.util.UIUtil; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.event.EventDispatcher; @@ -80,6 +79,7 @@ import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JOptionPane; +import javax.swing.SwingWorker; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.undo.UndoManager; import java.util.ArrayList; @@ -340,17 +340,34 @@ public abstract class JTemplate> public void refreshResource(FILE file) { - try { - this.template = JTemplateFactory.asIOFile(file, this.suffix()); - setTarget(this.template); - // 先移除旧的。 - removeCenterPane(); - // 加入新的 - addCenterPane(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + new SwingWorker() { + + @Override + protected Void doInBackground() throws Exception { + setTargetByFile(file); + return null; + } + + @Override + public void done() { + try { + get(); + // 先移除旧的。 + removeCenterPane(); + // 加入新的 + addCenterPane(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }.execute(); + + } + + private void setTargetByFile(FILE file) { + this.template = JTemplateFactory.asIOFile(file, this.suffix()); + setTarget(this.template); } private void addCenterPane() { From 380cf6ab675a00ca975ac90de0cd8e39cf525d9a Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 12 Jan 2021 15:25:39 +0800 Subject: [PATCH 104/104] =?UTF-8?q?REPORT-46892=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=9C=89=E6=8F=92=E4=BB=B6=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=8D=E5=8C=B9=E9=85=8D=E7=9B=AE=E5=BD=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/EnvChangeEntrance.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 6de15517ac..2b36bd45f1 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -310,9 +310,14 @@ public class EnvChangeEntrance { String content = PluginErrorRemindHandler.pluginErrorContent(); if (StringUtils.isNotEmpty(content)) { - SwingUtilities.invokeLater(() -> { - PluginErrorRemindDialog dialog = new PluginErrorRemindDialog(DesignerContext.getDesignerFrame(), content); - dialog.setVisible(true); + // 该操作需要在当前awt操作之后执行,使用SwingUtilities.invokeLater将其置于awt操作对列末尾 + // 若使用UIUtil.invokeLaterIfNeeded,会立即执行,影响其他UI操作 + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + PluginErrorRemindDialog dialog = new PluginErrorRemindDialog(DesignerContext.getDesignerFrame(), content); + dialog.setVisible(true); + } }); } }