From 2a947ac8256f736ec57e6f2c48f649e5ceb9056a Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 3 Dec 2020 17:25:12 +0800 Subject: [PATCH 001/111] =?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/111] =?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/111] =?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 5e9cc42c95e3f3a3da13de9b6b0d47fc511b6fba Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 15 Dec 2020 17:45:25 +0800 Subject: [PATCH 004/111] =?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 005/111] =?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 1454cc104f42f93e3a2a747e6792a2166e8122b7 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 23 Dec 2020 17:28:19 +0800 Subject: [PATCH 006/111] =?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 7697ec5fa790e0967e67c5cb5d156335234d5533 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Dec 2020 15:27:24 +0800 Subject: [PATCH 007/111] =?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 008/111] =?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 afa46632039de5a43bbbd5c62ccdee3e82681413 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 28 Dec 2020 14:13:08 +0800 Subject: [PATCH 009/111] =?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 bf63fbf211ca9054e06f5acb2257609951e5929a Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 28 Dec 2020 15:22:53 +0800 Subject: [PATCH 010/111] =?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 011/111] =?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 012/111] =?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 0e29ea19399e1e8acfcce8332ff374a4f3897a65 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 29 Dec 2020 15:40:43 +0800 Subject: [PATCH 013/111] =?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 014/111] 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 2f039cdcd6666bf60798fe56d573c563061812a3 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Tue, 29 Dec 2020 17:24:25 +0800 Subject: [PATCH 015/111] =?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 0d600b351a06f6dbc4d8e3ca9a9f8b4799abafff Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 31 Dec 2020 10:52:12 +0800 Subject: [PATCH 016/111] =?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 017/111] =?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 018/111] =?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 019/111] =?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 2d174d469fa74fd5cf5f35a0a83d5a3b4cf9a76a Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 4 Jan 2021 13:50:52 +0800 Subject: [PATCH 020/111] =?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 021/111] =?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 022/111] =?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 023/111] =?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 024/111] =?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 025/111] =?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 026/111] =?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 027/111] =?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 028/111] =?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 029/111] =?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 030/111] =?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 031/111] =?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 032/111] =?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 033/111] =?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 034/111] =?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 035/111] =?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 036/111] =?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 037/111] =?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 038/111] =?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 039/111] =?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 040/111] =?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 041/111] =?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 042/111] =?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 043/111] =?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 044/111] =?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 045/111] =?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 046/111] =?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 484efd163fdf2bdaf806104ffb378ffe9ce7f8c4 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 8 Jan 2021 13:56:42 +0800 Subject: [PATCH 047/111] =?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=91release=E5=B7=B2=E7=BB=8F=E9=AA=8C=E6=94=B6=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E4=B8=80=E4=BB=BD=E5=88=B0final=EF=BC=8C10.0.12.1?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E7=89=88=E6=9C=AC=E5=8F=91=E5=B8=83=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91release?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E9=AA=8C=E6=94=B6=EF=BC=8C=E6=8F=90=E4=B8=80?= =?UTF-8?q?=E4=BB=BD=E5=88=B0final=EF=BC=8C10.0.12.1=E4=B8=AD=E9=97=B4?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=91=E5=B8=83?= 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 | 91 ++++++------------- .../ui/designer/CheckBoxGroupDefinePane.java | 3 +- 3 files changed, 30 insertions(+), 68 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..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 @@ -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 @@ -404,8 +375,4 @@ public class TableDataDictPane extends FurtherBasicBeanPane public void registerDSChangeListener() { tableDataNameComboBox.registerGlobalDSChangeListener(); } - - 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: Fri, 8 Jan 2021 16:55:05 +0800 Subject: [PATCH 048/111] =?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=91releas?= =?UTF-8?q?e=E5=B7=B2=E9=AA=8C=E6=94=B6=EF=BC=8C=E4=BC=A0=E4=B8=80?= =?UTF-8?q?=E4=BB=BD=E5=88=B0final=EF=BC=8C10.0.12.1=E4=B8=AD=E9=97=B4?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=91=E5=B8=83=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91release=E5=B7=B2=E9=AA=8C?= =?UTF-8?q?=E6=94=B6=EF=BC=8C=E4=BC=A0=E4=B8=80=E4=BB=BD=E5=88=B0final?= =?UTF-8?q?=EF=BC=8C10.0.12.1=E4=B8=AD=E9=97=B4=E7=89=88=E6=9C=AC=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormDesignerUI.java | 4 ++-- 1 file changed, 2 insertions(+), 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..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); From cd5764193458b4fcef3766ad773a6428260c8377 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 8 Jan 2021 17:01:25 +0800 Subject: [PATCH 049/111] =?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 050/111] =?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 051/111] =?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 052/111] =?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 053/111] 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 054/111] =?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 055/111] =?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 056/111] =?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 057/111] =?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 058/111] =?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 059/111] =?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 060/111] =?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 061/111] =?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); + } }); } } From e2dd63a1026c7558b8420df151c07b12419f74f5 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 13 Jan 2021 10:56:26 +0800 Subject: [PATCH 062/111] =?UTF-8?q?REPORT-46971=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF-=E6=99=AE=E9=80=9A=E6=8A=A5=E8=A1=A8&?= =?UTF-8?q?=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8-=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF-=E6=8F=92=E4=BB=B6=E7=B1=BB=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E5=8F=B3=E4=BE=A7=E7=AC=AC=E5=9B=9B=E4=B8=AAtab?= =?UTF-8?q?=E9=A1=B5=E6=82=AC=E6=B5=AE=E6=97=B6=E5=92=8C=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=8A=E6=96=B9=E5=9D=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E2=80=9C=E7=BB=84=E4=BB=B6=E8=AE=BE=E7=BD=AE=E2=80=9D=EF=BC=8C?= =?UTF-8?q?=E5=BA=94=E2=80=9C=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/widget/ui/FormWidgetCardPane.java | 14 ++++++++++++++ .../ui/WidgetBasicPropertyPaneFactory.java | 16 ---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 8267c53b8c..4ab3fdb74a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -14,13 +14,16 @@ import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.dialog.AttrScrollPane; import com.fr.design.dialog.BasicScrollPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.JForm; import com.fr.design.widget.DataModify; import com.fr.design.widget.FormWidgetDefinePaneFactoryBase; import com.fr.design.widget.Operator; @@ -147,6 +150,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { } }; + freshPropertyMode(innerCreator); if (isExtraWidget) { return; } @@ -159,6 +163,16 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { } + 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); + } + } + } + private void initDefinePane() { currentEditorDefinePane = null; XCreator creator = getXCreatorDedicated(); 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 a3a34a0619..081ca14766 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,10 +1,6 @@ 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. @@ -12,7 +8,6 @@ import com.fr.design.mainframe.JForm; public class WidgetBasicPropertyPaneFactory { public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator) { - freshPropertyMode(xCreator); if (xCreator.supportSetVisible() && xCreator.supportSetEnable()) { return new FormBasicWidgetPropertyPane(); } @@ -23,15 +18,4 @@ public class WidgetBasicPropertyPaneFactory { } } - - 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 34176eda19142873551c92b73a1ef3d6fe194404 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 14 Jan 2021 09:36:22 +0800 Subject: [PATCH 063/111] =?UTF-8?q?REPORT-46953=20GeneralXMLTools=20?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=A4=84=E7=90=86?= 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, 2 insertions(+), 3 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 495252e38f..3f1aa26636 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,7 +99,6 @@ 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; @@ -192,8 +191,8 @@ public class DesignerActivator extends Activator { justStartModules4Designer(); CalculatorProviderContext.setValueConverter(valueConverter()); - EssentialUtils.Object_Tokenizer = startXMLReadObjectTokenizer(); - EssentialUtils.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); + GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); + GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); addAdapterForPlate(); designerRegister(); From 143a711fed50f03aa2456b8be0c09221d00119d5 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 14 Jan 2021 17:44:52 +0800 Subject: [PATCH 064/111] REPORT-46971 release->final --- .../mainframe/widget/ui/FormWidgetCardPane.java | 14 ++++++++++++++ .../ui/WidgetBasicPropertyPaneFactory.java | 16 ---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 8267c53b8c..4ab3fdb74a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -14,13 +14,16 @@ import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.dialog.AttrScrollPane; import com.fr.design.dialog.BasicScrollPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.JForm; import com.fr.design.widget.DataModify; import com.fr.design.widget.FormWidgetDefinePaneFactoryBase; import com.fr.design.widget.Operator; @@ -147,6 +150,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { } }; + freshPropertyMode(innerCreator); if (isExtraWidget) { return; } @@ -159,6 +163,16 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { } + 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); + } + } + } + private void initDefinePane() { currentEditorDefinePane = null; XCreator creator = getXCreatorDedicated(); 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 a3a34a0619..081ca14766 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,10 +1,6 @@ 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. @@ -12,7 +8,6 @@ import com.fr.design.mainframe.JForm; public class WidgetBasicPropertyPaneFactory { public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator) { - freshPropertyMode(xCreator); if (xCreator.supportSetVisible() && xCreator.supportSetEnable()) { return new FormBasicWidgetPropertyPane(); } @@ -23,15 +18,4 @@ public class WidgetBasicPropertyPaneFactory { } } - - 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 1b49f1e7d125d7673a04f378b1abceae6ecd00b0 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 14 Jan 2021 18:19:28 +0800 Subject: [PATCH 065/111] =?UTF-8?q?REPORT-47073=20=E3=80=90=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E5=AE=89=E8=A3=85=E6=8F=92=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E6=9C=AC=E6=9D=A5=E5=BA=94=E8=AF=A5=E5=9C=A8=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=8F=B3=E4=BE=A7=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E4=B8=8D=E6=98=BE=E7=A4=BA=E4=BA=86=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=9C=A8?= =?UTF-8?q?EastRegionContainerPane=E4=B8=AD=E4=BC=9A=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=9A=84=E4=B8=8D=E5=90=8C=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E5=88=87=E6=8D=A2=E5=85=B6icon=E5=90=8E=E7=BC=80?= =?UTF-8?q?=EF=BC=8C=E4=B9=8B=E5=89=8D=E7=9A=84=E6=98=AF=5Fnormal.png/=5Fd?= =?UTF-8?q?isabled.png=E7=AD=89=EF=BC=8C=E4=BD=86=E6=98=AF=E5=9C=A8?= =?UTF-8?q?=E6=8D=A2=E5=9B=BE=E6=A0=87=E8=BF=AD=E4=BB=A3=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E4=B8=BBjar=E9=87=8C=E7=9A=84=E8=BF=99=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E9=83=BD=E6=8D=A2=E6=88=90=E4=BA=86svg?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E7=BB=99=E5=90=8E=E7=BC=80=E6=94=B9?= =?UTF-8?q?=E6=88=90=E4=BA=86=5Fnormal.svg=E7=AD=89=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E6=9F=90=E4=BA=9B=E6=8F=92=E4=BB=B6=E4=B8=AD=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E4=B9=9F=E6=98=AF=E8=BF=99=E4=B8=AA=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E6=98=AF=E6=8F=92=E4=BB=B6=E4=B8=AD=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=80=82=E9=85=8Dsvg=E5=9B=BE=E6=A0=87=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E4=BC=9A=E9=80=A0=E6=88=90=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E5=9B=BE=E6=A0=87=EF=BC=8C=E7=84=B6=E5=90=8E=E8=A1=A8?= =?UTF-8?q?=E7=8E=B0=E4=B8=BA=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E5=9C=A8IconUtils=E4=B8=AD=E4=B8=BA=E8=BF=99?= =?UTF-8?q?=E7=A7=8D=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=9B=BE=E6=A0=87=E5=81=9A?= =?UTF-8?q?=E9=80=82=E9=85=8D=EF=BC=8C=E9=9D=A2=E5=AF=B9=E5=B8=A6=E6=98=8E?= =?UTF-8?q?=E7=A1=AE=E5=90=8E=E7=BC=80.svg=E7=9A=84=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=89=BE=E5=88=B0=E8=B5=84?= =?UTF-8?q?=E6=BA=90=EF=BC=8C=E5=B0=B1=E6=8D=A2=E6=88=90.png=E5=8E=BB?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/base/svg/IconUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 index 119471dcee..45c11c60c0 100644 --- a/designer-base/src/main/java/com/fr/base/svg/IconUtils.java +++ b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java @@ -35,7 +35,12 @@ public class IconUtils { if (resource.contains(SUFFIX_SEPARATOR)) { // 判断是否以.svg结尾 if (resource.endsWith(ICON_SUFFIX_SVG)) { - return SVGIcon.readSVGIcon(resource); + if (IOUtils.readResource(resource) != null) { + return SVGIcon.readSVGIcon(resource); + } + // 适配某些插件里是_normal.png、_selected.png的情况 + String pngResource = resource.replace(ICON_SUFFIX_SVG, ICON_SUFFIX_PNG); + return IOUtils.readIcon(pngResource); } return IOUtils.readIcon(resource); } From b02b72de9bf4a3e1e70b50b06825069e137469bd Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 14 Jan 2021 09:36:22 +0800 Subject: [PATCH 066/111] =?UTF-8?q?REPORT-46953=20GeneralXMLTools=20?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=A4=84=E7=90=86?= 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, 2 insertions(+), 3 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 495252e38f..3f1aa26636 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,7 +99,6 @@ 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; @@ -192,8 +191,8 @@ public class DesignerActivator extends Activator { justStartModules4Designer(); CalculatorProviderContext.setValueConverter(valueConverter()); - EssentialUtils.Object_Tokenizer = startXMLReadObjectTokenizer(); - EssentialUtils.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); + GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); + GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); addAdapterForPlate(); designerRegister(); From 6a3c3604cac33c8d128e8b2a66535191e6e7fc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 15 Jan 2021 13:36:54 +0800 Subject: [PATCH 067/111] =?UTF-8?q?CHART-15837=20feature=E2=86=92release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractCustomFieldComboBoxPane.java | 6 +- .../chart/gui/data/CalculateComboBox.java | 102 +++++++++--------- .../table/SeriesNameUseFieldNamePane.java | 2 +- 3 files changed, 57 insertions(+), 53 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java index 16f983c758..562393699d 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java @@ -23,13 +23,13 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.List; /** * Created by shine on 2018/9/12. @@ -253,7 +253,7 @@ public abstract class AbstractCustomFieldComboBoxPane extends BasicBeanPane= 0 && selectIndex < CLASS_ARRAY.length) { - return (AbstractDataFunction)CLASS_ARRAY[selectIndex].newInstance(); - } - } catch (InstantiationException e) { - FineLoggerFactory.getLogger().error("Function Error"); - return null; - } catch (IllegalAccessException e) { - FineLoggerFactory.getLogger().error("Function Error"); - return null; - } - - return null; - } + public static final String[] CALCULATE_ARRAY = {Toolkit.i18nText("Fine-Design_Chart_Data_Function_First"), Toolkit.i18nText("Fine-Design_Chart_Data_Function_Last"), + Toolkit.i18nText("Fine-Design_Chart_Data_Function_Sum"), Toolkit.i18nText("Fine-Design_Chart_Data_Function_Average"), + Toolkit.i18nText("Fine-Design_Chart_Data_Function_Max"), Toolkit.i18nText("Fine-Design_Chart_Data_Function_Min"), + Toolkit.i18nText("Fine-Design_Chart_Data_Function_Count")}; + public static final Class[] CLASS_ARRAY = {FirstFunction.class, NoneFunction.class, SumFunction.class, AverageFunction.class, + MaxFunction.class, MinFunction.class, CountFunction.class}; + + public CalculateComboBox() { + super(CALCULATE_ARRAY); + setSelectedIndex(2); + } + + public void reset() { + this.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Data_Function_Sum")); + } + + /** + * 更新公式选择. + */ + public void populateBean(AbstractDataFunction function) { + for (int i = 0; i < CLASS_ARRAY.length; i++) { + if (function != null && ComparatorUtils.equals(function.getClass(), CLASS_ARRAY[i])) { + setSelectedIndex(i); + break; + } + } + } + + /** + * 返回当前选择的公式 + */ + public AbstractDataFunction updateBean() { + try { + int selectIndex = getSelectedIndex(); + if (selectIndex >= 0 && selectIndex < CLASS_ARRAY.length) { + return (AbstractDataFunction) CLASS_ARRAY[selectIndex].newInstance(); + } + } catch (InstantiationException e) { + FineLoggerFactory.getLogger().error("Function Error"); + return null; + } catch (IllegalAccessException e) { + FineLoggerFactory.getLogger().error("Function Error"); + return null; + } + + return null; + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index 3f5f70aae3..9783c0577a 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -70,7 +70,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane Date: Mon, 18 Jan 2021 12:11:29 +0800 Subject: [PATCH 068/111] =?UTF-8?q?REPORT-46993=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=90=AF?= =?UTF-8?q?=E5=8A=A8=E4=B9=8B=E5=90=8E=E7=9A=84=E7=AC=AC=E4=B8=80=E5=BC=A0?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=B8=8D=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 3 +++ 1 file changed, 3 insertions(+) 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 a47a6095de..1b0c4a5cec 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 @@ -74,6 +74,7 @@ import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; +import sun.security.krb5.internal.crypto.Des; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -357,6 +358,8 @@ public abstract class JTemplate> removeCenterPane(); // 加入新的 addCenterPane(); + + refreshToolArea(); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } From c1f10eeaa39a991b18529ec61fd8b6df654c8594 Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 18 Jan 2021 12:13:36 +0800 Subject: [PATCH 069/111] =?UTF-8?q?REPORT-46993=20fix=20=E6=97=A0=E7=94=A8?= =?UTF-8?q?import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 1 - 1 file changed, 1 deletion(-) 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 1b0c4a5cec..2a13279203 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 @@ -74,7 +74,6 @@ import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; -import sun.security.krb5.internal.crypto.Des; import javax.swing.BorderFactory; import javax.swing.Icon; From 7862ac6653ea41bc4872f47efce7c08dc68c46c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 18 Jan 2021 14:33:46 +0800 Subject: [PATCH 070/111] =?UTF-8?q?=09CHART-17941=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF?= 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, 2 insertions(+) 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 745c3a79a8..c7ddda38b8 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 @@ -10,6 +10,7 @@ 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.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -35,6 +36,7 @@ public class VanChartMapAnchorMarkerPane extends BasicBeanPane Date: Mon, 21 Dec 2020 09:56:30 +0800 Subject: [PATCH 071/111] =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=AD=97=E6=AE=B5=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 44 +++++- .../richText/VanChartFieldAddPane.java | 124 +++++++++++++++ .../richText/VanChartFieldGroupPane.java | 115 ++++++++++++++ .../richText/VanChartFieldListener.java | 15 ++ .../VanChartRichEditorPane.java | 2 +- .../VanChartRichTextDialog.java} | 8 +- .../richText/VanChartRichTextPane.java | 144 ++++++++++++++++++ 7 files changed, 441 insertions(+), 11 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAddPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldGroupPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListener.java rename designer-chart/src/main/java/com/fr/van/chart/designer/component/{ => richText}/VanChartRichEditorPane.java (99%) rename designer-chart/src/main/java/com/fr/van/chart/designer/component/{VanChartRichEditorDialog.java => richText/VanChartRichTextDialog.java} (73%) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index b5f03a728a..b6e768e342 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.designer.component; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -32,7 +33,11 @@ import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; +import com.fr.van.chart.designer.component.richText.VanChartRichTextDialog; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; +import org.nfunk.jep.function.Str; import javax.swing.JComponent; import javax.swing.JPanel; @@ -45,6 +50,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; /** * 数据点提示内容界面,含有通用设置、富文本编辑器、自定义JS界面 @@ -437,24 +444,27 @@ public class VanChartTooltipContentPane extends BasicBeanPane pane = VanChartRichEditorPane.createRichEditorPane(richText); - BasicDialog dialog = new VanChartRichEditorDialog(DesignerContext.getDesignerFrame(), pane); + final ModernUIPane richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText); - pane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); + BasicPane panel = new VanChartRichTextPane(parent, getDefaultFieldNames(), getTableFieldNames(), richEditorPane); + + BasicDialog dialog = new VanChartRichTextDialog(DesignerContext.getDesignerFrame(), panel); + + richEditorPane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); dialog.addDialogActionListener(new DialogActionAdapter() { public void doOk() { - VanChartRichEditorPane.RichEditorModel model = pane.update(); + VanChartRichEditorPane.RichEditorModel model = richEditorPane.update(); String content = model.getContent(); updateLocalRichText(content, model.isAuto()); - SwingUtilities.getWindowAncestor(pane).setVisible(false); + SwingUtilities.getWindowAncestor(richEditorPane).setVisible(false); } public void doCancel() { - SwingUtilities.getWindowAncestor(pane).setVisible(false); + SwingUtilities.getWindowAncestor(richEditorPane).setVisible(false); } }); @@ -465,6 +475,28 @@ public class VanChartTooltipContentPane extends BasicBeanPane getDefaultFieldNames() { + List fieldNames = new ArrayList<>(); + + fieldNames.add("分类"); + fieldNames.add("系列"); + fieldNames.add("值"); + fieldNames.add("百分比"); + + return fieldNames; + } + + private List getTableFieldNames() { + List fieldNames = new ArrayList<>(); + + fieldNames.add("字段A"); + fieldNames.add("字段B"); + fieldNames.add("字段C"); + fieldNames.add("字段D"); + + return fieldNames; + } + private JPanel createHtmlPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAddPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAddPane.java new file mode 100644 index 0000000000..dd34a2a7f0 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAddPane.java @@ -0,0 +1,124 @@ +package com.fr.van.chart.designer.component.richText; + +import com.fr.base.BaseUtils; +import com.fr.data.util.function.DataFunction; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.Icon; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.text.Format; + +public class VanChartFieldAddPane extends JPanel { + + private static final Icon ADD_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"); + + private static final int W = 200; + private static final int H = 28; + + private UIToggleButton fieldButton; + private UIButton addButton; + + private Format format; + private DataFunction dataFunction; + + private String fieldName; + private boolean showSummary; + + public VanChartFieldAddPane(String fieldName, VanChartFieldListener listener) { + this(fieldName, false, listener); + } + + public VanChartFieldAddPane(String fieldName, boolean showSummary, VanChartFieldListener listener) { + this.fieldName = fieldName; + this.showSummary = showSummary; + + initComponents(fieldName, listener); + + this.setLayout(new BorderLayout()); + this.add(getContentPane(), BorderLayout.CENTER); + } + + public String getFieldName() { + return fieldName; + } + + public Format getFormat() { + return format; + } + + public void setFormat(Format format) { + this.format = format; + } + + public DataFunction getDataFunction() { + return dataFunction; + } + + public void setDataFunction(DataFunction dataFunction) { + this.dataFunction = dataFunction; + } + + public boolean isShowSummary() { + return showSummary; + } + + private void initComponents(String fieldName, VanChartFieldListener listener) { + fieldButton = new UIToggleButton(fieldName) { + + protected MouseListener getMouseListener() { + + return new MouseAdapter() { + public void mousePressed(MouseEvent e) { + setSelected(true); + + listener.refreshSelectedField(fieldName); + listener.setGlobalName(fieldName); + } + }; + } + }; + + addButton = new UIButton(ADD_ICON); + + addButton.addMouseListener(new MouseAdapter() { + + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + + listener.addSelectedField(fieldName); + } + }); + } + + private JPanel getContentPane() { + Component[][] components = new Component[][]{ + new Component[]{fieldButton, addButton} + }; + + double p = TableLayout.PREFERRED; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + + double[] rowSize = {p}; + double[] columnSize = {e, d}; + + JPanel content = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 5, 0); + content.setPreferredSize(new Dimension(W, H)); + + return content; + } + + public void setSelectedState(boolean selected) { + fieldButton.setSelected(selected); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldGroupPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldGroupPane.java new file mode 100644 index 0000000000..5e80aa78c7 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldGroupPane.java @@ -0,0 +1,115 @@ +package com.fr.van.chart.designer.component.richText; + +import com.fr.general.ComparatorUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.util.ArrayList; +import java.util.List; + +public class VanChartFieldGroupPane extends JPanel { + + private static final int FIELD_ADD_W = 400; + private static final int FIELD_ADD_H = 28; + + private List defaultFieldNameList; + private List tableFieldNameList; + + private List defaultFieldPaneList = new ArrayList<>(); + private List tableFieldPaneList = new ArrayList<>(); + + private VanChartFieldListener fieldListener; + + public VanChartFieldGroupPane(List defaultFieldNameList, List tableFieldNameList) { + this.defaultFieldNameList = defaultFieldNameList; + this.tableFieldNameList = tableFieldNameList; + + initFieldListener(); + + this.setLayout(new BorderLayout()); + + this.add(createDefaultFieldPane(), BorderLayout.CENTER); + this.add(createTableFieldPane(), BorderLayout.SOUTH); + } + + private JPanel createDefaultFieldPane() { + JPanel defaultField = new JPanel(); + + defaultField.setLayout(new GridLayout(0, 1, 1, 0)); + + for (String title : defaultFieldNameList) { + VanChartFieldAddPane fieldAddPane = new VanChartFieldAddPane(title, fieldListener); + + defaultField.add(fieldAddPane); + defaultFieldPaneList.add(fieldAddPane); + } + + defaultField.setPreferredSize(new Dimension(FIELD_ADD_W, defaultFieldNameList.size() * FIELD_ADD_H)); + defaultField.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); + + return defaultField; + } + + private JPanel createTableFieldPane() { + JPanel tableField = new JPanel(); + + tableField.setLayout(new GridLayout(0, 1, 1, 0)); + + for (String title : tableFieldNameList) { + VanChartFieldAddPane fieldAddPane = new VanChartFieldAddPane(title, fieldListener); + + tableField.add(fieldAddPane); + tableFieldPaneList.add(fieldAddPane); + } + + tableField.setPreferredSize(new Dimension(FIELD_ADD_W, defaultFieldNameList.size() * FIELD_ADD_H)); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap("数据集字段", tableField); + } + + private void initFieldListener() { + + fieldListener = new VanChartFieldListener() { + + private String fieldName; + + public void setGlobalName(String fieldName) { + this.fieldName = fieldName; + } + + public String getGlobalName() { + return this.fieldName; + } + + public void refreshSelectedField(String fieldName) { + if (ComparatorUtils.equals(fieldName, this.fieldName)) { + return; + } + + for (VanChartFieldAddPane fieldAddPane : defaultFieldPaneList) { + fieldAddPane.setSelectedState(ComparatorUtils.equals(fieldAddPane.getFieldName(), fieldName)); + } + + for (VanChartFieldAddPane fieldAddPane : tableFieldPaneList) { + fieldAddPane.setSelectedState(ComparatorUtils.equals(fieldAddPane.getFieldName(), fieldName)); + } + } + + public void addSelectedField(String fieldName) { + System.out.println(fieldName); + } + + public void populateFieldFormatPane() { + + } + + public void updateFieldFormatPane() { + + } + }; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListener.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListener.java new file mode 100644 index 0000000000..738492d67d --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListener.java @@ -0,0 +1,15 @@ +package com.fr.van.chart.designer.component.richText; + +import com.fr.design.event.GlobalNameListener; + +public interface VanChartFieldListener extends GlobalNameListener { + + public void refreshSelectedField(String fieldName); + + public void addSelectedField(String fieldName); + + public void populateFieldFormatPane(); + + public void updateFieldFormatPane(); + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java similarity index 99% rename from designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java rename to designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java index 6f308ad431..66453a1572 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java @@ -1,4 +1,4 @@ -package com.fr.van.chart.designer.component; +package com.fr.van.chart.designer.component.richText; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java similarity index 73% rename from designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java rename to designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java index a13208df56..2cf7050dc1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java @@ -1,4 +1,4 @@ -package com.fr.van.chart.designer.component; +package com.fr.van.chart.designer.component.richText; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; @@ -8,17 +8,17 @@ import com.fr.design.utils.gui.GUICoreUtils; import java.awt.Dimension; import java.awt.Frame; -public class VanChartRichEditorDialog extends BasicDialog { +public class VanChartRichTextDialog extends BasicDialog { public static final Dimension DEFAULT = new Dimension(960, 600); - public VanChartRichEditorDialog(Frame parent, BasicPane pane) { + public VanChartRichTextDialog(Frame parent, BasicPane pane) { super(parent, pane); this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor")); this.setBasicDialogSize(DEFAULT); GUICoreUtils.centerWindow(this); - this.setResizable(true); + this.setResizable(false); this.setModal(true); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java new file mode 100644 index 0000000000..927fbdaae1 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java @@ -0,0 +1,144 @@ +package com.fr.van.chart.designer.component.richText; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.style.FormatPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.util.List; + +// 标签提示中的富文本面板,包含字段设置和富文本编辑器 +public class VanChartRichTextPane extends BasicBeanPane { + + private static final int FIELD_PANE_W = 470; + private static final int FIELD_PANE_H = 270; + + private static final int RICH_EDITOR_W = 940; + private static final int RICH_EDITOR_H = 260; + + private static final double P = TableLayout.PREFERRED; + private static final double D = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + private static final double E = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + private JScrollPane fieldContentPane; + private JScrollPane fieldPropsPane; + + private FormatPane fieldFormatPane; + private JPanel fieldSummaryPane; + + private UIComboBox fieldSummaryBox; + + private VanChartStylePane parent; + + private List defaultFieldsFormat; + private List tableFieldsFormat; + + public VanChartRichTextPane(VanChartStylePane parent, List defaultFieldsFormat, List tableFieldsFormat, JPanel richEditor) { + this.parent = parent; + + this.defaultFieldsFormat = defaultFieldsFormat; + this.tableFieldsFormat = tableFieldsFormat; + + initFieldContentPane(); + initFieldPropsPane(); + + this.setLayout(new BorderLayout()); + this.add(createFieldDetailPane(), BorderLayout.CENTER); + this.add(createRichEditorPane(richEditor), BorderLayout.SOUTH); + } + + private void initFieldContentPane() { + JPanel content = new JPanel(); + content.setLayout(new BorderLayout()); + content.add(createDefaultContentPane(), BorderLayout.NORTH); + content.add(createTableFieldsPane(), BorderLayout.CENTER); + + fieldContentPane = new JScrollPane(content); + fieldContentPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); + fieldContentPane.setHorizontalScrollBar(null); + fieldContentPane.setBorder(BorderFactory.createTitledBorder("添加字段")); + } + + private void initFieldPropsPane() { + fieldFormatPane = new FormatPaneWithOutFont() { + protected JPanel createContentPane(Component[][] components) { + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{P, P, P}, new double[]{D, E}); + } + }; + + fieldSummaryBox = new CalculateComboBox(); + + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"), SwingConstants.LEFT), fieldSummaryBox} + }; + + fieldSummaryPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{P, P}, new double[]{D, E}); + + JPanel props = new JPanel(); + props.setLayout(new BorderLayout()); + props.add(fieldFormatPane, BorderLayout.NORTH); + props.add(fieldSummaryPane, BorderLayout.CENTER); + props.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); + + fieldPropsPane = new JScrollPane(props); + fieldPropsPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); + fieldPropsPane.setBorder(BorderFactory.createTitledBorder("字段设置")); + } + + private JPanel createDefaultContentPane() { + + return new VanChartFieldGroupPane(defaultFieldsFormat, tableFieldsFormat); + } + + private JPanel createTableFieldsPane() { + return new JPanel(); + } + + private JPanel createFieldDetailPane() { + JPanel fieldPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + + fieldPane.add(fieldContentPane); + fieldPane.add(fieldPropsPane); + + return fieldPane; + } + + private JPanel createRichEditorPane(JPanel richEditor) { + JPanel richEditorPane = new JPanel(); + + richEditorPane.setLayout(new BorderLayout()); + richEditorPane.setPreferredSize(new Dimension(RICH_EDITOR_W, RICH_EDITOR_H)); + richEditorPane.add(richEditor, BorderLayout.CENTER); + + return richEditorPane; + } + + public void populateBean(AttrTooltipContent ob) { + + } + + public AttrTooltipContent updateBean() { + return null; + } + + protected String title4PopupWindow() { + return StringUtils.EMPTY; + } +} From edcfd2c70d88fab526583de31af93a890fdc32e8 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 24 Dec 2020 17:29:03 +0800 Subject: [PATCH 072/111] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E7=95=8C=E9=9D=A2=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/FormatPane.java | 6 + .../component/VanChartTooltipContentPane.java | 91 +++--- .../richText/VanChartFieldAttrPane.java | 81 +++++ ...dAddPane.java => VanChartFieldButton.java} | 29 +- .../richText/VanChartFieldGroupPane.java | 115 ------- .../richText/VanChartFieldListPane.java | 294 ++++++++++++++++++ .../richText/VanChartFieldListener.java | 6 +- .../richText/VanChartRichEditorModel.java | 64 ++++ .../richText/VanChartRichEditorPane.java | 80 +---- .../richText/VanChartRichTextPane.java | 117 +++---- .../com/fr/design/editor/script/editor.js | 1 + 11 files changed, 563 insertions(+), 321 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java rename designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/{VanChartFieldAddPane.java => VanChartFieldButton.java} (82%) delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldGroupPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorModel.java diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java index 0b33b7adfc..ba68ab36f5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java @@ -6,6 +6,7 @@ import com.fr.base.Style; import com.fr.base.TextFormat; import com.fr.data.core.FormatField; import com.fr.data.core.FormatField.FormatContents; +import com.fr.design.event.UIObserverListener; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.i18n.Toolkit; import com.fr.design.border.UIRoundedBorder; @@ -469,6 +470,11 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse globalNameListener = listener; } + public void registerChangeListener(UIObserverListener listener) { + typeComboBox.registerChangeListener(listener); + textField.registerChangeListener(listener); + } + @Override public boolean shouldResponseNameListener() { return false; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index b6e768e342..9700e4faaf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -2,7 +2,6 @@ package com.fr.van.chart.designer.component; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -33,11 +32,11 @@ import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import com.fr.van.chart.designer.component.richText.VanChartRichTextDialog; import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; -import org.nfunk.jep.function.Str; import javax.swing.JComponent; import javax.swing.JPanel; @@ -99,7 +98,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText); - - BasicPane panel = new VanChartRichTextPane(parent, getDefaultFieldNames(), getTableFieldNames(), richEditorPane); - BasicDialog dialog = new VanChartRichTextDialog(DesignerContext.getDesignerFrame(), panel); + AttrTooltipRichText richText = this.richTextTooltipContent.getRichTextAttr(); + ModernUIPane richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText); + VanChartRichTextPane richTextPane = new VanChartRichTextPane(parent, getTableFieldNames(), richEditorPane); + BasicDialog richTextDialog = new VanChartRichTextDialog(DesignerContext.getDesignerFrame(), richTextPane); + // 更新字段格式和汇总方式 + richTextPane.populateBean(this.richTextTooltipContent); + // 更新富文本编辑器内容 richEditorPane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); - dialog.addDialogActionListener(new DialogActionAdapter() { + richTextDialog.addDialogActionListener(new DialogActionAdapter() { public void doOk() { - VanChartRichEditorPane.RichEditorModel model = richEditorPane.update(); + + // 收集字段格式和汇总方式 + updateTooltipFormat(richTextTooltipContent, richTextPane.updateBean()); + VanChartRichEditorModel model = richEditorPane.update(); String content = model.getContent(); + // 收集编辑后的富文本内容 updateLocalRichText(content, model.isAuto()); SwingUtilities.getWindowAncestor(richEditorPane).setVisible(false); @@ -468,24 +467,13 @@ public class VanChartTooltipContentPane extends BasicBeanPane getDefaultFieldNames() { - List fieldNames = new ArrayList<>(); - - fieldNames.add("分类"); - fieldNames.add("系列"); - fieldNames.add("值"); - fieldNames.add("百分比"); - - return fieldNames; - } - private List getTableFieldNames() { List fieldNames = new ArrayList<>(); @@ -745,8 +733,11 @@ public class VanChartTooltipContentPane extends BasicBeanPane defaultFieldNameList; - private List tableFieldNameList; - - private List defaultFieldPaneList = new ArrayList<>(); - private List tableFieldPaneList = new ArrayList<>(); - - private VanChartFieldListener fieldListener; - - public VanChartFieldGroupPane(List defaultFieldNameList, List tableFieldNameList) { - this.defaultFieldNameList = defaultFieldNameList; - this.tableFieldNameList = tableFieldNameList; - - initFieldListener(); - - this.setLayout(new BorderLayout()); - - this.add(createDefaultFieldPane(), BorderLayout.CENTER); - this.add(createTableFieldPane(), BorderLayout.SOUTH); - } - - private JPanel createDefaultFieldPane() { - JPanel defaultField = new JPanel(); - - defaultField.setLayout(new GridLayout(0, 1, 1, 0)); - - for (String title : defaultFieldNameList) { - VanChartFieldAddPane fieldAddPane = new VanChartFieldAddPane(title, fieldListener); - - defaultField.add(fieldAddPane); - defaultFieldPaneList.add(fieldAddPane); - } - - defaultField.setPreferredSize(new Dimension(FIELD_ADD_W, defaultFieldNameList.size() * FIELD_ADD_H)); - defaultField.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); - - return defaultField; - } - - private JPanel createTableFieldPane() { - JPanel tableField = new JPanel(); - - tableField.setLayout(new GridLayout(0, 1, 1, 0)); - - for (String title : tableFieldNameList) { - VanChartFieldAddPane fieldAddPane = new VanChartFieldAddPane(title, fieldListener); - - tableField.add(fieldAddPane); - tableFieldPaneList.add(fieldAddPane); - } - - tableField.setPreferredSize(new Dimension(FIELD_ADD_W, defaultFieldNameList.size() * FIELD_ADD_H)); - - return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap("数据集字段", tableField); - } - - private void initFieldListener() { - - fieldListener = new VanChartFieldListener() { - - private String fieldName; - - public void setGlobalName(String fieldName) { - this.fieldName = fieldName; - } - - public String getGlobalName() { - return this.fieldName; - } - - public void refreshSelectedField(String fieldName) { - if (ComparatorUtils.equals(fieldName, this.fieldName)) { - return; - } - - for (VanChartFieldAddPane fieldAddPane : defaultFieldPaneList) { - fieldAddPane.setSelectedState(ComparatorUtils.equals(fieldAddPane.getFieldName(), fieldName)); - } - - for (VanChartFieldAddPane fieldAddPane : tableFieldPaneList) { - fieldAddPane.setSelectedState(ComparatorUtils.equals(fieldAddPane.getFieldName(), fieldName)); - } - } - - public void addSelectedField(String fieldName) { - System.out.println(fieldName); - } - - public void populateFieldFormatPane() { - - } - - public void updateFieldFormatPane() { - - } - }; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java new file mode 100644 index 0000000000..aa3dbd17bf --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java @@ -0,0 +1,294 @@ +package com.fr.van.chart.designer.component.richText; + +import com.fr.data.util.function.AbstractDataFunction; +import com.fr.design.event.UIObserverListener; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.text.Format; +import java.util.ArrayList; +import java.util.List; + +public class VanChartFieldListPane extends JPanel { + + private static final int FIELD_ADD_W = 400; + private static final int FIELD_ADD_H = 28; + + private VanChartFieldButton categoryNameButton; + private VanChartFieldButton seriesNameButton; + private VanChartFieldButton valueButton; + private VanChartFieldButton percentButton; + + private VanChartFieldAttrPane fieldAttrPane; + private ModernUIPane richEditorPane; + private List tableFieldNameList; + private List tableFieldButtonList = new ArrayList<>(); + + private VanChartFieldListener fieldListener; + + public VanChartFieldListPane(List tableFieldNameList, VanChartFieldAttrPane fieldAttrPane, + ModernUIPane richEditorPane) { + + this.tableFieldNameList = tableFieldNameList; + + this.fieldAttrPane = fieldAttrPane; + this.richEditorPane = richEditorPane; + + initFieldListListener(); + registerAttrListener(); + + this.setLayout(new BorderLayout()); + + this.add(createDefaultFieldPane(), BorderLayout.CENTER); + this.add(createTableFieldPane(), BorderLayout.SOUTH); + } + + private JPanel createDefaultFieldPane() { + JPanel defaultField = new JPanel(); + + defaultField.setLayout(new GridLayout(0, 1, 1, 0)); + createDefaultButtonGroup(defaultField); + + List defaultFieldButtonList = getDefaultFieldButtonList(); + + defaultField.setPreferredSize(new Dimension(FIELD_ADD_W, defaultFieldButtonList.size() * FIELD_ADD_H)); + defaultField.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); + + return defaultField; + } + + protected void createDefaultButtonGroup(JPanel field) { + categoryNameButton = createCategoryFieldButton(); + seriesNameButton = createSeriesFieldButton(); + valueButton = createValueFieldButton(); + percentButton = createPercentFieldButton(); + + field.add(categoryNameButton); + field.add(seriesNameButton); + field.add(valueButton); + field.add(percentButton); + } + + // 不同图表的name和id不一样 + protected VanChartFieldButton createCategoryFieldButton() { + String name = Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"); + String id = new AttrTooltipCategoryFormat().getFormatJSONKey(); + + return new VanChartFieldButton(name, id, false, fieldListener); + } + + protected VanChartFieldButton createSeriesFieldButton() { + String name = Toolkit.i18nText("Fine-Design_Chart_Series_Name"); + String id = new AttrTooltipSeriesFormat().getFormatJSONKey(); + + return new VanChartFieldButton(name, id, false, fieldListener); + } + + protected VanChartFieldButton createValueFieldButton() { + String name = Toolkit.i18nText("Fine-Design_Chart_Use_Value"); + String id = new AttrTooltipValueFormat().getFormatJSONKey(); + + return new VanChartFieldButton(name, id, false, fieldListener); + } + + protected VanChartFieldButton createPercentFieldButton() { + String name = Toolkit.i18nText("Fine-Design_Chart_Use_Percent"); + String id = new AttrTooltipPercentFormat().getFormatJSONKey(); + + return new VanChartFieldButton(name, id, false, fieldListener); + } + + private JPanel createTableFieldPane() { + if (tableFieldNameList == null || tableFieldNameList.isEmpty()) { + return new JPanel(); + } + + JPanel tableField = new JPanel(); + + tableField.setLayout(new GridLayout(0, 1, 1, 0)); + + for (String name : tableFieldNameList) { + VanChartFieldButton fieldButton = new VanChartFieldButton(name, name, true, fieldListener); + + tableField.add(fieldButton); + tableFieldButtonList.add(fieldButton); + } + + tableField.setPreferredSize(new Dimension(FIELD_ADD_W, tableFieldNameList.size() * FIELD_ADD_H)); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap("数据集字段", tableField); + } + + protected List getDefaultFieldButtonList() { + List defaultFieldButtonList = new ArrayList<>(); + + defaultFieldButtonList.add(categoryNameButton); + defaultFieldButtonList.add(seriesNameButton); + defaultFieldButtonList.add(valueButton); + defaultFieldButtonList.add(percentButton); + + return defaultFieldButtonList; + } + + private void initFieldListListener() { + + fieldListener = new VanChartFieldListener() { + + private String fieldName; + + public void setGlobalName(String fieldName) { + this.fieldName = fieldName; + } + + public String getGlobalName() { + return this.fieldName; + } + + public VanChartFieldButton getSelectedField() { + List defaultFieldButtonList = getDefaultFieldButtonList(); + + for (VanChartFieldButton fieldButton : defaultFieldButtonList) { + if (ComparatorUtils.equals(fieldButton.getFieldName(), this.fieldName)) { + return fieldButton; + } + } + + for (VanChartFieldButton fieldButton : tableFieldButtonList) { + if (ComparatorUtils.equals(fieldButton.getFieldName(), this.fieldName)) { + return fieldButton; + } + } + + return null; + } + + public void refreshSelectedPane(String fieldName) { + if (ComparatorUtils.equals(fieldName, this.fieldName)) { + return; + } + + List defaultFieldButtonList = getDefaultFieldButtonList(); + + for (VanChartFieldButton fieldButton : defaultFieldButtonList) { + fieldButton.setSelectedState(ComparatorUtils.equals(fieldButton.getFieldName(), fieldName)); + } + + for (VanChartFieldButton fieldButton : tableFieldButtonList) { + fieldButton.setSelectedState(ComparatorUtils.equals(fieldButton.getFieldName(), fieldName)); + } + } + + public void addSelectedField(String fieldName, String fieldId) { + VanChartRichEditorModel model = richEditorPane.update(); + String content = model.getContent() + getFieldRichText(fieldName, fieldId); + model.setContent(content); + VanChartRichEditorPane.createRichEditorPane(model); + } + + public void populateFieldFormatPane() { + VanChartFieldButton fieldButton = this.getSelectedField(); + + if (fieldButton == null) { + return; + } + + Format format = fieldButton.getFormat(); + AbstractDataFunction dataFunction = (AbstractDataFunction) fieldButton.getDataFunction(); + boolean showDataFunction = fieldButton.isShowDataFunction(); + + fieldAttrPane.populate(format, dataFunction, showDataFunction); + } + + public void updateFieldFormatPane() { + VanChartFieldButton fieldButton = this.getSelectedField(); + + if (fieldButton == null) { + return; + } + + fieldButton.setFormat(fieldAttrPane.updateFormat()); + fieldButton.setDataFunction(fieldAttrPane.updateDataFunction()); + } + }; + } + + private void registerAttrListener() { + + fieldAttrPane.registerFunctionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + fieldListener.updateFieldFormatPane(); + } + }); + + fieldAttrPane.registerChangeListener(new UIObserverListener() { + public void doChange() { + fieldListener.updateFieldFormatPane(); + } + }); + } + + private void checkFieldListSelected() { + List defaultFieldButtonList = getDefaultFieldButtonList(); + + if (defaultFieldButtonList != null && defaultFieldButtonList.size() > 0) { + String selected = defaultFieldButtonList.get(0).getFieldName(); + + fieldListener.refreshSelectedPane(selected); + fieldListener.setGlobalName(selected); + fieldListener.populateFieldFormatPane(); + } + } + + private String getFieldRichText(String fieldName, String fieldId) { + return "

" + fieldName + "

"; + } + + public void populate(AttrTooltipContent tooltipContent) { + populateDefaultField(tooltipContent); + populateTableField(tooltipContent); + + // 初次打开富文本界面选中第一个 + checkFieldListSelected(); + } + + public void populateDefaultField(AttrTooltipContent tooltipContent) { + categoryNameButton.setFormat(tooltipContent.getRichTextCategoryFormat().getFormat()); + seriesNameButton.setFormat(tooltipContent.getRichTextSeriesFormat().getFormat()); + valueButton.setFormat(tooltipContent.getRichTextValueFormat().getFormat()); + percentButton.setFormat(tooltipContent.getRichTextPercentFormat().getFormat()); + } + + public void populateTableField(AttrTooltipContent tooltipContent) { + + } + + public void update(AttrTooltipContent tooltipContent) { + updateDefaultField(tooltipContent); + updateTableField(tooltipContent); + } + + public void updateDefaultField(AttrTooltipContent tooltipContent) { + tooltipContent.getRichTextCategoryFormat().setFormat(categoryNameButton.getFormat()); + tooltipContent.getRichTextSeriesFormat().setFormat(seriesNameButton.getFormat()); + tooltipContent.getRichTextValueFormat().setFormat(valueButton.getFormat()); + tooltipContent.getRichTextPercentFormat().setFormat(percentButton.getFormat()); + } + + public void updateTableField(AttrTooltipContent tooltipContent) { + + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListener.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListener.java index 738492d67d..62f0966636 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListener.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListener.java @@ -4,9 +4,11 @@ import com.fr.design.event.GlobalNameListener; public interface VanChartFieldListener extends GlobalNameListener { - public void refreshSelectedField(String fieldName); + public VanChartFieldButton getSelectedField(); - public void addSelectedField(String fieldName); + public void refreshSelectedPane(String fieldName); + + public void addSelectedField(String fieldName, String fieldId); public void populateFieldFormatPane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorModel.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorModel.java new file mode 100644 index 0000000000..245eaa9513 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorModel.java @@ -0,0 +1,64 @@ +package com.fr.van.chart.designer.component.richText; + +import com.fr.plugin.chart.type.TextAlign; +import com.fr.stable.StringUtils; + +public class VanChartRichEditorModel { + + private String content = StringUtils.EMPTY; + private boolean auto = true; + private String params = StringUtils.EMPTY; + private String initParams = StringUtils.EMPTY; + private String align = TextAlign.LEFT.getAlign(); + + public VanChartRichEditorModel() { + } + + public VanChartRichEditorModel(String content, boolean auto, String params, String initParams, String align) { + this.content = content; + this.auto = auto; + this.params = params; + this.initParams = initParams; + this.align = align; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public boolean isAuto() { + return auto; + } + + public void setAuto(boolean auto) { + this.auto = auto; + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params; + } + + public String getInitParams() { + return initParams; + } + + public void setInitParams(String initParams) { + this.initParams = initParams; + } + + public String getAlign() { + return align; + } + + public void setAlign(String align) { + this.align = align; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java index 66453a1572..99afba30e3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java @@ -25,7 +25,7 @@ public class VanChartRichEditorPane { private static final String richEditorPath = "/com/fr/design/editor/rich_editor.html"; private static final String expression = "dispatch()"; - private static ModernUIPane richEditorPane; + private static ModernUIPane richEditorPane; private static Browser browser; public static void initRichEditorPane() { @@ -36,7 +36,7 @@ public class VanChartRichEditorPane { @Override public void run() { try { - richEditorPane = initPane(new RichEditorModel()); + richEditorPane = initPane(new VanChartRichEditorModel()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -47,9 +47,12 @@ public class VanChartRichEditorPane { } } - public static ModernUIPane createRichEditorPane(AttrTooltipRichText richEditor) { - RichEditorModel model = getRichEditorModel(richEditor); + public static ModernUIPane createRichEditorPane(AttrTooltipRichText richEditor) { + VanChartRichEditorModel model = getRichEditorModel(richEditor); + return createRichEditorPane(model); + } + public static ModernUIPane createRichEditorPane(VanChartRichEditorModel model) { if (richEditorPane == null) { richEditorPane = initPane(model); } else if (browser != null) { @@ -59,8 +62,8 @@ public class VanChartRichEditorPane { return richEditorPane; } - public static ModernUIPane initPane(RichEditorModel model) { - return new ModernUIPane.Builder() + public static ModernUIPane initPane(VanChartRichEditorModel model) { + return new ModernUIPane.Builder() .prepare(new ScriptContextAdapter() { public void onScriptContextCreated(ScriptContextEvent event) { browser = event.getBrowser(); @@ -79,13 +82,13 @@ public class VanChartRichEditorPane { .namespace(namespace).build(); } - public static void updatePane(Browser browser, RichEditorModel model) { + public static void updatePane(Browser browser, VanChartRichEditorModel model) { JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); ns.asObject().setProperty(variable, model); browser.executeJavaScript("window." + namespace + "." + expression); } - public static RichEditorModel getRichEditorModel(AttrTooltipRichText richText) { + public static VanChartRichEditorModel getRichEditorModel(AttrTooltipRichText richText) { Map paramsMap = richText.getParams(); StringBuilder paramsStr = new StringBuilder(StringUtils.EMPTY); @@ -115,7 +118,7 @@ public class VanChartRichEditorPane { align = content.contains(left) ? left : center; } - return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams, align); + return new VanChartRichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams, align); } public static String generateTransformI18nJS() { @@ -129,63 +132,4 @@ public class VanChartRichEditorPane { return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());"; } - - public static class RichEditorModel { - private String content = StringUtils.EMPTY; - private boolean auto = true; - private String params = StringUtils.EMPTY; - private String initParams = StringUtils.EMPTY; - private String align = TextAlign.LEFT.getAlign(); - - public RichEditorModel() { - } - - public RichEditorModel(String content, boolean auto, String params, String initParams, String align) { - this.content = content; - this.auto = auto; - this.params = params; - this.initParams = initParams; - this.align = align; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public boolean isAuto() { - return auto; - } - - public void setAuto(boolean auto) { - this.auto = auto; - } - - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public String getInitParams() { - return initParams; - } - - public void setInitParams(String initParams) { - this.initParams = initParams; - } - - public String getAlign() { - return align; - } - - public void setAlign(String align) { - this.align = align; - } - } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java index 927fbdaae1..e480506190 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java @@ -1,25 +1,16 @@ package com.fr.van.chart.designer.component.richText; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.style.FormatPane; -import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.stable.StringUtils; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.SwingConstants; import java.awt.BorderLayout; -import java.awt.Component; import java.awt.Dimension; import java.util.List; @@ -32,110 +23,74 @@ public class VanChartRichTextPane extends BasicBeanPane { private static final int RICH_EDITOR_W = 940; private static final int RICH_EDITOR_H = 260; - private static final double P = TableLayout.PREFERRED; - private static final double D = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - private static final double E = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - - private JScrollPane fieldContentPane; - private JScrollPane fieldPropsPane; - - private FormatPane fieldFormatPane; - private JPanel fieldSummaryPane; - - private UIComboBox fieldSummaryBox; + private VanChartFieldListPane fieldListPane; + private VanChartFieldAttrPane fieldAttrPane; private VanChartStylePane parent; - private List defaultFieldsFormat; private List tableFieldsFormat; - public VanChartRichTextPane(VanChartStylePane parent, List defaultFieldsFormat, List tableFieldsFormat, JPanel richEditor) { - this.parent = parent; + private ModernUIPane richEditor; - this.defaultFieldsFormat = defaultFieldsFormat; + public VanChartRichTextPane(VanChartStylePane parent, List tableFieldsFormat, ModernUIPane richEditor) { + this.parent = parent; this.tableFieldsFormat = tableFieldsFormat; + this.richEditor = richEditor; - initFieldContentPane(); - initFieldPropsPane(); + initFieldContent(); this.setLayout(new BorderLayout()); - this.add(createFieldDetailPane(), BorderLayout.CENTER); - this.add(createRichEditorPane(richEditor), BorderLayout.SOUTH); + this.add(createFieldContentPane(), BorderLayout.CENTER); + this.add(createRichEditorPane(), BorderLayout.SOUTH); } - private void initFieldContentPane() { - JPanel content = new JPanel(); - content.setLayout(new BorderLayout()); - content.add(createDefaultContentPane(), BorderLayout.NORTH); - content.add(createTableFieldsPane(), BorderLayout.CENTER); - - fieldContentPane = new JScrollPane(content); - fieldContentPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); - fieldContentPane.setHorizontalScrollBar(null); - fieldContentPane.setBorder(BorderFactory.createTitledBorder("添加字段")); - } - - private void initFieldPropsPane() { - fieldFormatPane = new FormatPaneWithOutFont() { - protected JPanel createContentPane(Component[][] components) { - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{P, P, P}, new double[]{D, E}); - } - }; - - fieldSummaryBox = new CalculateComboBox(); - - Component[][] components = new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"), SwingConstants.LEFT), fieldSummaryBox} - }; - - fieldSummaryPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{P, P}, new double[]{D, E}); - - JPanel props = new JPanel(); - props.setLayout(new BorderLayout()); - props.add(fieldFormatPane, BorderLayout.NORTH); - props.add(fieldSummaryPane, BorderLayout.CENTER); - props.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); - - fieldPropsPane = new JScrollPane(props); - fieldPropsPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); - fieldPropsPane.setBorder(BorderFactory.createTitledBorder("字段设置")); + private void initFieldContent() { + fieldAttrPane = new VanChartFieldAttrPane(); + fieldListPane = new VanChartFieldListPane(tableFieldsFormat, fieldAttrPane, richEditor); } - private JPanel createDefaultContentPane() { + private JPanel createFieldContentPane() { + JPanel fieldPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - return new VanChartFieldGroupPane(defaultFieldsFormat, tableFieldsFormat); - } + // 新增字段目录 + JPanel fieldListContent = new JPanel(); + fieldListContent.setLayout(new BorderLayout()); + fieldListContent.add(fieldListPane, BorderLayout.NORTH); - private JPanel createTableFieldsPane() { - return new JPanel(); - } + JScrollPane fieldListScrollPane = new JScrollPane(fieldListContent); + fieldListScrollPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); + fieldListScrollPane.setHorizontalScrollBar(null); + fieldListScrollPane.setBorder(BorderFactory.createTitledBorder("添加字段")); - private JPanel createFieldDetailPane() { - JPanel fieldPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + // 字段格式和汇总 + JScrollPane fieldAttrScrollPane = new JScrollPane(fieldAttrPane); + fieldAttrScrollPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); + fieldAttrScrollPane.setBorder(BorderFactory.createTitledBorder("字段设置")); - fieldPane.add(fieldContentPane); - fieldPane.add(fieldPropsPane); + fieldPane.add(fieldListScrollPane); + fieldPane.add(fieldAttrScrollPane); return fieldPane; } - private JPanel createRichEditorPane(JPanel richEditor) { + private JPanel createRichEditorPane() { JPanel richEditorPane = new JPanel(); richEditorPane.setLayout(new BorderLayout()); richEditorPane.setPreferredSize(new Dimension(RICH_EDITOR_W, RICH_EDITOR_H)); - richEditorPane.add(richEditor, BorderLayout.CENTER); + richEditorPane.add(this.richEditor, BorderLayout.CENTER); return richEditorPane; } - public void populateBean(AttrTooltipContent ob) { - + public void populateBean(AttrTooltipContent tooltipContent) { + fieldListPane.populate(tooltipContent); } public AttrTooltipContent updateBean() { - return null; + AttrTooltipContent content = new AttrTooltipContent(); + fieldListPane.update(content); + return content; } protected String title4PopupWindow() { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index f3e0536797..a2b5dd6a7f 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -50,6 +50,7 @@ }, items: [{ type: "bi.htape", + tgap: 5, items: [{ type: "bi.label", text: BI.i18nText("BI-Design_Font_Style") + ": ", From 8950771cede13a46c10d1960730fe1a90944f559 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 28 Dec 2020 09:53:58 +0800 Subject: [PATCH 073/111] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../richText/VanChartFieldAttrPane.java | 20 +++-- .../richText/VanChartFieldListPane.java | 5 +- .../richText/VanChartRichEditorModel.java | 11 +++ .../richText/VanChartRichEditorPane.java | 74 +++++++++---------- .../com/fr/design/editor/rich_editor.html | 31 +++++++- 5 files changed, 86 insertions(+), 55 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java index cc99a2ce1e..89c3cd73e4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java @@ -16,7 +16,6 @@ import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ActionListener; -import java.awt.event.MouseListener; import java.text.Format; public class VanChartFieldAttrPane extends JPanel { @@ -27,6 +26,15 @@ public class VanChartFieldAttrPane extends JPanel { private JPanel fieldFunctionPane; public VanChartFieldAttrPane() { + initComponents(); + + this.setLayout(new BorderLayout()); + this.add(fieldFormatPane, BorderLayout.NORTH); + this.add(fieldFunctionPane, BorderLayout.CENTER); + this.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); + } + + private void initComponents() { double p = TableLayout.PREFERRED; double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; @@ -35,10 +43,6 @@ public class VanChartFieldAttrPane extends JPanel { protected JPanel createContentPane(Component[][] components) { return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, new double[]{d, e}); } - - public void addActionListener(ActionListener listener) { - - } }; fieldDataFunction = new CalculateComboBox(); @@ -49,11 +53,6 @@ public class VanChartFieldAttrPane extends JPanel { }; fieldFunctionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{d, e}); - - this.setLayout(new BorderLayout()); - this.add(fieldFormatPane, BorderLayout.NORTH); - this.add(fieldFunctionPane, BorderLayout.CENTER); - this.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); } public void registerFunctionListener(ActionListener listener) { @@ -67,7 +66,6 @@ public class VanChartFieldAttrPane extends JPanel { public void populate(Format format, AbstractDataFunction dataFunction, boolean showDataFunction) { fieldFormatPane.populateBean(format); fieldDataFunction.populateBean(dataFunction); - fieldFunctionPane.setVisible(showDataFunction); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java index aa3dbd17bf..c4039c6913 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java @@ -194,9 +194,8 @@ public class VanChartFieldListPane extends JPanel { public void addSelectedField(String fieldName, String fieldId) { VanChartRichEditorModel model = richEditorPane.update(); - String content = model.getContent() + getFieldRichText(fieldName, fieldId); - model.setContent(content); - VanChartRichEditorPane.createRichEditorPane(model); + model.setAddition(fieldName); + VanChartRichEditorPane.richEditorAddField(model); } public void populateFieldFormatPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorModel.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorModel.java index 245eaa9513..83df27c0fb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorModel.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorModel.java @@ -10,6 +10,7 @@ public class VanChartRichEditorModel { private String params = StringUtils.EMPTY; private String initParams = StringUtils.EMPTY; private String align = TextAlign.LEFT.getAlign(); + private String addition = StringUtils.EMPTY; public VanChartRichEditorModel() { } @@ -20,6 +21,7 @@ public class VanChartRichEditorModel { this.params = params; this.initParams = initParams; this.align = align; + this.addition = StringUtils.EMPTY; } public String getContent() { @@ -61,4 +63,13 @@ public class VanChartRichEditorModel { public void setAlign(String align) { this.align = align; } + + public String getAddition() { + return addition; + } + + public void setAddition(String addition) { + this.addition = addition; + } + } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java index 99afba30e3..87710da551 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java @@ -1,10 +1,8 @@ package com.fr.van.chart.designer.component.richText; -import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.ui.ModernUIPane; import com.fr.general.IOUtils; -import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.type.TextAlign; import com.fr.stable.StringUtils; @@ -15,38 +13,20 @@ import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; import java.util.Locale; import java.util.Map; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; public class VanChartRichEditorPane { - private static final String namespace = "Pool"; - private static final String variable = "data"; - private static final String richEditorPath = "/com/fr/design/editor/rich_editor.html"; - private static final String expression = "dispatch()"; + private static final String NAME_SPACE = "Pool"; + private static final String VARIABLE = "data"; + + private static final String RICH_EDITOR_HTML = "/com/fr/design/editor/rich_editor.html"; + + private static final String REFRESH = "refresh()"; + private static final String ADD_FIELD = "addField()"; private static ModernUIPane richEditorPane; private static Browser browser; - public static void initRichEditorPane() { - ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(new NamedThreadFactory("VanChartRichEditor")); - - try { - singleThreadExecutor.submit(new Runnable() { - @Override - public void run() { - try { - richEditorPane = initPane(new VanChartRichEditorModel()); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - }); - } finally { - singleThreadExecutor.shutdown(); - } - } - public static ModernUIPane createRichEditorPane(AttrTooltipRichText richEditor) { VanChartRichEditorModel model = getRichEditorModel(richEditor); return createRichEditorPane(model); @@ -55,13 +35,25 @@ public class VanChartRichEditorPane { public static ModernUIPane createRichEditorPane(VanChartRichEditorModel model) { if (richEditorPane == null) { richEditorPane = initPane(model); - } else if (browser != null) { - updatePane(browser, model); + } else { + richEditorRefresh(model); } return richEditorPane; } + public static void richEditorRefresh(VanChartRichEditorModel model) { + if (richEditorPane != null && browser != null) { + refresh(browser, model); + } + } + + public static void richEditorAddField(VanChartRichEditorModel model) { + if (richEditorPane != null && browser != null) { + addField(browser, model); + } + } + public static ModernUIPane initPane(VanChartRichEditorModel model) { return new ModernUIPane.Builder() .prepare(new ScriptContextAdapter() { @@ -74,18 +66,26 @@ public class VanChartRichEditorPane { browser.executeJavaScript(generateTransformI18nJS()); browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/materials.min.js")); - JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); - ns.asObject().setProperty(variable, model); + JSValue ns = browser.executeJavaScriptAndReturnValue("window." + NAME_SPACE); + ns.asObject().setProperty(VARIABLE, model); } }) - .withEMB(richEditorPath) - .namespace(namespace).build(); + .withEMB(RICH_EDITOR_HTML) + .namespace(NAME_SPACE).build(); + } + + public static void refresh(Browser browser, VanChartRichEditorModel model) { + stateChange(browser, model, REFRESH); + } + + public static void addField(Browser browser, VanChartRichEditorModel model) { + stateChange(browser, model, ADD_FIELD); } - public static void updatePane(Browser browser, VanChartRichEditorModel model) { - JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); - ns.asObject().setProperty(variable, model); - browser.executeJavaScript("window." + namespace + "." + expression); + public static void stateChange(Browser browser, VanChartRichEditorModel model, String trigger) { + JSValue ns = browser.executeJavaScriptAndReturnValue("window." + NAME_SPACE); + ns.asObject().setProperty(VARIABLE, model); + browser.executeJavaScript("window." + NAME_SPACE + "." + trigger); } public static VanChartRichEditorModel getRichEditorModel(AttrTooltipRichText richText) { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index e6c769f0a3..f62d7dbb2f 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -88,8 +88,7 @@ {type: "bi.rich_editor_color_chooser"}, {type: "bi.rich_editor_align_left_button"}, {type: "bi.rich_editor_align_center_button"}, - {type: "bi.rich_editor_align_right_button"}, - {type: "bi.design.chart.common.editor.insert_param"} + {type: "bi.rich_editor_align_right_button"} ] }, ref: function (_ref) { @@ -97,7 +96,7 @@ } }); - Pool.dispatch = function () { + Pool.refresh = function () { var content = Pool.data.getContent(); var isAuto = Pool.data.isAuto(); var params = Pool.data.getParams(); @@ -117,7 +116,31 @@ }); rich_editor.setFocus(); - } + }; + + Pool.addField = function () { + var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + + var content = Pool.data.getContent(); + var isAuto = Pool.data.isAuto(); + var params = Pool.data.getParams(); + var addition = Pool.data.getAddition(); + + if (addition) { + // todo 暂时先处理成在content后加一行 + content += '

' + editorService.getEditorParamImage(addition) + '

'; + } + + rich_editor.editor.bindToolbar(rich_editor.bar); + + rich_editor.setValue({ + content: content, + isAuto: isAuto, + dimensionIds: getDimensionIds(params) + }); + + rich_editor.setFocus(); + }; Pool.update = function () { var {content, isAuto} = rich_editor.getValue(); From 6ff17bf1a7da0e6498a5b9b0ee523790f115375c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 28 Dec 2020 17:34:37 +0800 Subject: [PATCH 074/111] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 2 +- .../richText/VanChartFieldButton.java | 23 +++- .../richText/VanChartFieldListPane.java | 109 +++++++++--------- .../richText/VanChartRichTextPane.java | 26 +---- 4 files changed, 79 insertions(+), 81 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 9700e4faaf..89a6275181 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -439,7 +439,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText); - VanChartRichTextPane richTextPane = new VanChartRichTextPane(parent, getTableFieldNames(), richEditorPane); + VanChartRichTextPane richTextPane = new VanChartRichTextPane(getTableFieldNames(), richEditorPane); BasicDialog richTextDialog = new VanChartRichTextDialog(DesignerContext.getDesignerFrame(), richTextPane); // 更新字段格式和汇总方式 diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java index 9c0c20d112..a3ccc2a471 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java @@ -6,6 +6,8 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.Icon; @@ -28,19 +30,20 @@ public class VanChartFieldButton extends JPanel { private final String fieldName; private final String fieldId; + private final AttrTooltipFormat tooltipFormat; private final boolean showDataFunction; private UIToggleButton fieldButton; private UIButton addButton; - private Format format; private DataFunction dataFunction; - public VanChartFieldButton(String fieldName, String fieldId, boolean showSummary, VanChartFieldListener listener) { + public VanChartFieldButton(String fieldName, AttrTooltipFormat format, boolean showDataFunction, VanChartFieldListener listener) { this.fieldName = fieldName; - this.fieldId = fieldId; + this.tooltipFormat = format; + this.showDataFunction = showDataFunction; - this.showDataFunction = showSummary; + this.fieldId = format == null ? StringUtils.EMPTY : format.getFormatJSONKey(); initComponents(fieldName, listener); @@ -52,12 +55,20 @@ public class VanChartFieldButton extends JPanel { return fieldName; } + public boolean isEnable() { + return this.tooltipFormat.isEnable(); + } + + public void setEnable(boolean enable) { + this.tooltipFormat.setEnable(enable); + } + public Format getFormat() { - return format; + return tooltipFormat.getFormat(); } public void setFormat(Format format) { - this.format = format; + this.tooltipFormat.setFormat(format); } public DataFunction getDataFunction() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java index c4039c6913..f7fb81d0cb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java @@ -7,6 +7,7 @@ import com.fr.design.ui.ModernUIPane; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; @@ -49,6 +50,8 @@ public class VanChartFieldListPane extends JPanel { this.richEditorPane = richEditorPane; initFieldListListener(); + initDefaultFieldButton(); + registerAttrListener(); this.setLayout(new BorderLayout()); @@ -58,58 +61,37 @@ public class VanChartFieldListPane extends JPanel { } private JPanel createDefaultFieldPane() { - JPanel defaultField = new JPanel(); + JPanel fieldPane = new JPanel(); - defaultField.setLayout(new GridLayout(0, 1, 1, 0)); - createDefaultButtonGroup(defaultField); + fieldPane.setLayout(new GridLayout(0, 1, 1, 0)); - List defaultFieldButtonList = getDefaultFieldButtonList(); + addDefaultFieldButton(fieldPane); - defaultField.setPreferredSize(new Dimension(FIELD_ADD_W, defaultFieldButtonList.size() * FIELD_ADD_H)); - defaultField.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); + fieldPane.setPreferredSize(new Dimension(FIELD_ADD_W, getDefaultFieldButtonList().size() * FIELD_ADD_H)); + fieldPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); - return defaultField; + return fieldPane; } - protected void createDefaultButtonGroup(JPanel field) { - categoryNameButton = createCategoryFieldButton(); - seriesNameButton = createSeriesFieldButton(); - valueButton = createValueFieldButton(); - percentButton = createPercentFieldButton(); + protected void initDefaultFieldButton() { + categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), + new AttrTooltipCategoryFormat(), false, fieldListener); - field.add(categoryNameButton); - field.add(seriesNameButton); - field.add(valueButton); - field.add(percentButton); - } + seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + new AttrTooltipSeriesFormat(), false, fieldListener); - // 不同图表的name和id不一样 - protected VanChartFieldButton createCategoryFieldButton() { - String name = Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"); - String id = new AttrTooltipCategoryFormat().getFormatJSONKey(); + valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + new AttrTooltipValueFormat(), false, fieldListener); - return new VanChartFieldButton(name, id, false, fieldListener); + percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Percent"), + new AttrTooltipPercentFormat(), false, fieldListener); } - protected VanChartFieldButton createSeriesFieldButton() { - String name = Toolkit.i18nText("Fine-Design_Chart_Series_Name"); - String id = new AttrTooltipSeriesFormat().getFormatJSONKey(); - - return new VanChartFieldButton(name, id, false, fieldListener); - } - - protected VanChartFieldButton createValueFieldButton() { - String name = Toolkit.i18nText("Fine-Design_Chart_Use_Value"); - String id = new AttrTooltipValueFormat().getFormatJSONKey(); - - return new VanChartFieldButton(name, id, false, fieldListener); - } - - protected VanChartFieldButton createPercentFieldButton() { - String name = Toolkit.i18nText("Fine-Design_Chart_Use_Percent"); - String id = new AttrTooltipPercentFormat().getFormatJSONKey(); - - return new VanChartFieldButton(name, id, false, fieldListener); + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(categoryNameButton); + fieldPane.add(seriesNameButton); + fieldPane.add(valueButton); + fieldPane.add(percentButton); } private JPanel createTableFieldPane() { @@ -122,7 +104,7 @@ public class VanChartFieldListPane extends JPanel { tableField.setLayout(new GridLayout(0, 1, 1, 0)); for (String name : tableFieldNameList) { - VanChartFieldButton fieldButton = new VanChartFieldButton(name, name, true, fieldListener); + VanChartFieldButton fieldButton = new VanChartFieldButton(name, getTableTooltipFormat(name), true, fieldListener); tableField.add(fieldButton); tableFieldButtonList.add(fieldButton); @@ -133,6 +115,11 @@ public class VanChartFieldListPane extends JPanel { return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap("数据集字段", tableField); } + // 生成新增字段对应的format + private AttrTooltipFormat getTableTooltipFormat(String fieldName) { + return new AttrTooltipCategoryFormat(); + } + protected List getDefaultFieldButtonList() { List defaultFieldButtonList = new ArrayList<>(); @@ -252,10 +239,6 @@ public class VanChartFieldListPane extends JPanel { } } - private String getFieldRichText(String fieldName, String fieldId) { - return "

" + fieldName + "

"; - } - public void populate(AttrTooltipContent tooltipContent) { populateDefaultField(tooltipContent); populateTableField(tooltipContent); @@ -265,10 +248,19 @@ public class VanChartFieldListPane extends JPanel { } public void populateDefaultField(AttrTooltipContent tooltipContent) { - categoryNameButton.setFormat(tooltipContent.getRichTextCategoryFormat().getFormat()); - seriesNameButton.setFormat(tooltipContent.getRichTextSeriesFormat().getFormat()); - valueButton.setFormat(tooltipContent.getRichTextValueFormat().getFormat()); - percentButton.setFormat(tooltipContent.getRichTextPercentFormat().getFormat()); + populateButtonFormat(categoryNameButton, tooltipContent.getRichTextCategoryFormat()); + populateButtonFormat(seriesNameButton, tooltipContent.getRichTextSeriesFormat()); + populateButtonFormat(valueButton, tooltipContent.getRichTextValueFormat()); + populateButtonFormat(percentButton, tooltipContent.getRichTextPercentFormat()); + } + + public void populateButtonFormat(VanChartFieldButton button, AttrTooltipFormat format) { + if (button == null || format == null) { + return; + } + + button.setEnable(format.isEnable()); + button.setFormat(format.getFormat()); } public void populateTableField(AttrTooltipContent tooltipContent) { @@ -281,13 +273,22 @@ public class VanChartFieldListPane extends JPanel { } public void updateDefaultField(AttrTooltipContent tooltipContent) { - tooltipContent.getRichTextCategoryFormat().setFormat(categoryNameButton.getFormat()); - tooltipContent.getRichTextSeriesFormat().setFormat(seriesNameButton.getFormat()); - tooltipContent.getRichTextValueFormat().setFormat(valueButton.getFormat()); - tooltipContent.getRichTextPercentFormat().setFormat(percentButton.getFormat()); + updateButtonFormat(categoryNameButton, tooltipContent.getRichTextCategoryFormat()); + updateButtonFormat(seriesNameButton, tooltipContent.getRichTextSeriesFormat()); + updateButtonFormat(valueButton, tooltipContent.getRichTextValueFormat()); + updateButtonFormat(percentButton, tooltipContent.getRichTextPercentFormat()); } public void updateTableField(AttrTooltipContent tooltipContent) { } + + public void updateButtonFormat(VanChartFieldButton button, AttrTooltipFormat format) { + if (button == null || format == null) { + return; + } + + format.setEnable(button.isEnable()); + format.setFormat(button.getFormat()); + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java index e480506190..7ee3f3df6f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java @@ -5,7 +5,6 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.stable.StringUtils; -import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -26,27 +25,14 @@ public class VanChartRichTextPane extends BasicBeanPane { private VanChartFieldListPane fieldListPane; private VanChartFieldAttrPane fieldAttrPane; - private VanChartStylePane parent; + public VanChartRichTextPane(List tableFieldNames, ModernUIPane richEditor) { - private List tableFieldsFormat; - - private ModernUIPane richEditor; - - public VanChartRichTextPane(VanChartStylePane parent, List tableFieldsFormat, ModernUIPane richEditor) { - this.parent = parent; - this.tableFieldsFormat = tableFieldsFormat; - this.richEditor = richEditor; - - initFieldContent(); + fieldAttrPane = new VanChartFieldAttrPane(); + fieldListPane = new VanChartFieldListPane(tableFieldNames, fieldAttrPane, richEditor); this.setLayout(new BorderLayout()); this.add(createFieldContentPane(), BorderLayout.CENTER); - this.add(createRichEditorPane(), BorderLayout.SOUTH); - } - - private void initFieldContent() { - fieldAttrPane = new VanChartFieldAttrPane(); - fieldListPane = new VanChartFieldListPane(tableFieldsFormat, fieldAttrPane, richEditor); + this.add(createRichEditorPane(richEditor), BorderLayout.SOUTH); } private JPanel createFieldContentPane() { @@ -73,12 +59,12 @@ public class VanChartRichTextPane extends BasicBeanPane { return fieldPane; } - private JPanel createRichEditorPane() { + private JPanel createRichEditorPane(JPanel richEditor) { JPanel richEditorPane = new JPanel(); richEditorPane.setLayout(new BorderLayout()); richEditorPane.setPreferredSize(new Dimension(RICH_EDITOR_W, RICH_EDITOR_H)); - richEditorPane.add(this.richEditor, BorderLayout.CENTER); + richEditorPane.add(richEditor, BorderLayout.CENTER); return richEditorPane; } From 5ee5c7a6423d2b7d46ba31280ed06a29708d843b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 29 Dec 2020 09:56:19 +0800 Subject: [PATCH 075/111] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 12 ++--- .../designer/style/VanChartStylePane.java | 54 +++++++++++++++++++ 2 files changed, 58 insertions(+), 8 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 89a6275181..b9472dd869 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -49,7 +49,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.ArrayList; import java.util.List; /** @@ -475,14 +474,11 @@ public class VanChartTooltipContentPane extends BasicBeanPane getTableFieldNames() { - List fieldNames = new ArrayList<>(); - - fieldNames.add("字段A"); - fieldNames.add("字段B"); - fieldNames.add("字段C"); - fieldNames.add("字段D"); + if (parent == null) { + return null; + } - return fieldNames; + return parent.getDataModelColumnNames(); } private JPanel createHtmlPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java index 32a4f8e547..f9d0720dc6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java @@ -1,9 +1,20 @@ package com.fr.van.chart.designer.style; +import com.fr.base.TableData; +import com.fr.base.chart.chartdata.TopDefinitionProvider; +import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartdata.MoreNameCDDefinition; +import com.fr.chart.chartdata.OneValueCDDefinition; +import com.fr.data.TableDataSource; +import com.fr.data.impl.EmbeddedTableData; +import com.fr.design.DesignModelAdapter; +import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; import com.fr.van.chart.designer.style.axis.VanChartAxisPane; import com.fr.van.chart.designer.style.background.VanChartAreaPane; @@ -75,4 +86,47 @@ public class VanChartStylePane extends ChartStylePane { protected void addVanChartTooltipPane(List paneList) { paneList.add(new VanChartTooltipPane(VanChartStylePane.this)); } + + public List getDataModelColumnNames() { + Chart chart = getChart(); + + if (chart == null) { + return null; + } + + TopDefinitionProvider definition = chart.getFilterDefinition(); + + if (definition == null) { + return null; + } + + DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); + TableDataSource tableDataSource = adapter == null ? null : adapter.getBook(); + + TableData tableData = null; + + if (ComparatorUtils.equals(definition.getDataDefinitionType(), OneValueCDDefinition.DEFINITION_TYPE)) { + OneValueCDDefinition oneValueCDDefinition = (OneValueCDDefinition) definition; + tableData = oneValueCDDefinition.getTableData(); + } + + if (ComparatorUtils.equals(definition.getDataDefinitionType(), MoreNameCDDefinition.DEFINITION_TYPE)) { + MoreNameCDDefinition moreNameCDDefinition = (MoreNameCDDefinition) definition; + tableData = moreNameCDDefinition.getTableData(); + } + + if (tableData == null) { + return null; + } + + try { + EmbeddedTableData embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tableDataSource, + tableData, TableData.RESULT_NOT_NEED, false); + + return DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return null; + } + } } \ No newline at end of file From a5b5f640910a5a2714f52c87a9a331e58f25bdea Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 29 Dec 2020 11:22:22 +0800 Subject: [PATCH 076/111] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../richText/VanChartFieldButton.java | 3 +- .../richText/VanChartFieldListPane.java | 60 ++++++++++++++++--- 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java index a3ccc2a471..4e75b9febd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java @@ -2,6 +2,7 @@ package com.fr.van.chart.designer.component.richText; import com.fr.base.BaseUtils; import com.fr.data.util.function.DataFunction; +import com.fr.data.util.function.NoneFunction; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.layout.TableLayout; @@ -36,7 +37,7 @@ public class VanChartFieldButton extends JPanel { private UIToggleButton fieldButton; private UIButton addButton; - private DataFunction dataFunction; + private DataFunction dataFunction = new NoneFunction(); public VanChartFieldButton(String fieldName, AttrTooltipFormat format, boolean showDataFunction, VanChartFieldListener listener) { this.fieldName = fieldName; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java index f7fb81d0cb..e88937a6ad 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java @@ -1,12 +1,17 @@ package com.fr.van.chart.designer.component.richText; import com.fr.data.util.function.AbstractDataFunction; +import com.fr.data.util.function.DataFunction; import com.fr.design.event.UIObserverListener; import com.fr.design.i18n.Toolkit; import com.fr.design.ui.ModernUIPane; import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.TableFieldCollection; +import com.fr.plugin.chart.base.TableFieldDefinition; import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFieldFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; @@ -23,6 +28,7 @@ import java.awt.event.ActionListener; import java.text.Format; import java.util.ArrayList; import java.util.List; +import java.util.Map; public class VanChartFieldListPane extends JPanel { @@ -38,13 +44,14 @@ public class VanChartFieldListPane extends JPanel { private ModernUIPane richEditorPane; private List tableFieldNameList; private List tableFieldButtonList = new ArrayList<>(); + private TableFieldCollection tableFieldCollection = new TableFieldCollection(); private VanChartFieldListener fieldListener; public VanChartFieldListPane(List tableFieldNameList, VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { - this.tableFieldNameList = tableFieldNameList; + this.tableFieldNameList = tableFieldNameList == null ? new ArrayList<>() : tableFieldNameList; this.fieldAttrPane = fieldAttrPane; this.richEditorPane = richEditorPane; @@ -104,7 +111,7 @@ public class VanChartFieldListPane extends JPanel { tableField.setLayout(new GridLayout(0, 1, 1, 0)); for (String name : tableFieldNameList) { - VanChartFieldButton fieldButton = new VanChartFieldButton(name, getTableTooltipFormat(name), true, fieldListener); + VanChartFieldButton fieldButton = new VanChartFieldButton(name, new AttrTooltipFieldFormat(name), true, fieldListener); tableField.add(fieldButton); tableFieldButtonList.add(fieldButton); @@ -115,11 +122,6 @@ public class VanChartFieldListPane extends JPanel { return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap("数据集字段", tableField); } - // 生成新增字段对应的format - private AttrTooltipFormat getTableTooltipFormat(String fieldName) { - return new AttrTooltipCategoryFormat(); - } - protected List getDefaultFieldButtonList() { List defaultFieldButtonList = new ArrayList<>(); @@ -180,6 +182,16 @@ public class VanChartFieldListPane extends JPanel { } public void addSelectedField(String fieldName, String fieldId) { + if (tableFieldNameList.contains(fieldName)) { + int index = tableFieldNameList.indexOf(fieldName); + + VanChartFieldButton fieldButton = tableFieldButtonList.get(index); + Format fieldFormat = fieldButton.getFormat(); + DataFunction dataFunction = fieldButton.getDataFunction(); + + tableFieldCollection.addFieldDefinition(fieldName, new TableFieldDefinition(fieldName, fieldFormat, dataFunction)); + } + VanChartRichEditorModel model = richEditorPane.update(); model.setAddition(fieldName); VanChartRichEditorPane.richEditorAddField(model); @@ -264,7 +276,35 @@ public class VanChartFieldListPane extends JPanel { } public void populateTableField(AttrTooltipContent tooltipContent) { + TableFieldCollection fieldCollection = tooltipContent.getFieldCollection(); + if (fieldCollection == null) { + return; + } + + Map fieldDefinitionGroup = fieldCollection.getFieldNameFormulaMap(); + + if (fieldDefinitionGroup == null || fieldDefinitionGroup.isEmpty()) { + return; + } + + this.tableFieldCollection = new TableFieldCollection(); + + for (int i = 0, len = tableFieldNameList.size(); i < len; i++) { + String fieldName = tableFieldNameList.get(i); + VanChartFieldButton fieldButton = tableFieldButtonList.get(i); + TableFieldDefinition fieldDefinition = fieldDefinitionGroup.get(fieldName); + + if (fieldDefinitionGroup.containsKey(fieldName)) { + Format fieldFormat = fieldDefinition.getFormat(); + DataFunction dataFunction = fieldDefinition.getDataFunction(); + + fieldButton.setFormat(fieldFormat); + fieldButton.setDataFunction(dataFunction); + + this.tableFieldCollection.addFieldDefinition(fieldName, new TableFieldDefinition(fieldName, fieldFormat, dataFunction)); + } + } } public void update(AttrTooltipContent tooltipContent) { @@ -280,7 +320,11 @@ public class VanChartFieldListPane extends JPanel { } public void updateTableField(AttrTooltipContent tooltipContent) { - + try { + tooltipContent.setFieldCollection(this.tableFieldCollection); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } } public void updateButtonFormat(VanChartFieldButton button, AttrTooltipFormat format) { From cd9e4832ce4a606c51ef4b7224c21fc575b7e37f Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 29 Dec 2020 13:55:09 +0800 Subject: [PATCH 077/111] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=8C=E6=96=87=E6=9C=AC=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 13 +++++++++---- .../component/richText/VanChartFieldListPane.java | 15 +++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index b9472dd869..ba6a55cb88 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -15,6 +15,7 @@ import com.fr.design.ui.ModernUIPane; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipRichText; +import com.fr.plugin.chart.base.TableFieldCollection; import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -449,15 +450,19 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Tue, 29 Dec 2020 17:00:14 +0800 Subject: [PATCH 078/111] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=8F=82=E6=95=B0=E6=9B=B4=E6=96=B0=E7=9A=84=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 56 ++++++++++++++++--- .../richText/VanChartFieldButton.java | 4 ++ .../richText/VanChartFieldListPane.java | 20 +++++++ .../richText/VanChartRichTextPane.java | 7 ++- 4 files changed, 78 insertions(+), 9 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index ba6a55cb88..66f04a3d38 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -16,7 +16,11 @@ import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.base.TableFieldCollection; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; @@ -50,7 +54,9 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 数据点提示内容界面,含有通用设置、富文本编辑器、自定义JS界面 @@ -436,15 +442,14 @@ public class VanChartTooltipContentPane extends BasicBeanPane richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText); - VanChartRichTextPane richTextPane = new VanChartRichTextPane(getTableFieldNames(), richEditorPane); + VanChartRichTextPane richTextPane = this.createRichTextPane(getTableFieldNames(), richEditorPane); + BasicDialog richTextDialog = new VanChartRichTextDialog(DesignerContext.getDesignerFrame(), richTextPane); - // 更新字段格式和汇总方式 richTextPane.populateBean(this.richTextTooltipContent); - // 更新富文本编辑器内容 richEditorPane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); richTextDialog.addDialogActionListener(new DialogActionAdapter() { @@ -486,6 +491,42 @@ public class VanChartTooltipContentPane extends BasicBeanPane tableFieldNames, ModernUIPane richEditorPane) { + return new VanChartRichTextPane(tableFieldNames, richEditorPane); + } + + protected void refreshRichTextFormat(AttrTooltipRichText richText) { + String[] fieldNames = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + + AttrTooltipFormat[] fieldFormats = new AttrTooltipFormat[]{ + new AttrTooltipCategoryFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; + + Map params = new HashMap<>(); + + for (int i = 0, len = fieldNames.length; i < len; i++) { + params.put(fieldNames[i], fieldFormats[i].getJs()); + } + + List tableFieldNames = this.getTableFieldNames(); + + if (tableFieldNames != null) { + for (String fieldName : tableFieldNames) { + params.put(fieldName, fieldName); + } + } + + richText.setParams(params); + } + private JPanel createHtmlPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -734,11 +775,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane { public VanChartRichTextPane(List tableFieldNames, ModernUIPane richEditor) { fieldAttrPane = new VanChartFieldAttrPane(); - fieldListPane = new VanChartFieldListPane(tableFieldNames, fieldAttrPane, richEditor); + fieldListPane = createFieldListPane(tableFieldNames, fieldAttrPane, richEditor); this.setLayout(new BorderLayout()); this.add(createFieldContentPane(), BorderLayout.CENTER); @@ -59,6 +59,11 @@ public class VanChartRichTextPane extends BasicBeanPane { return fieldPane; } + protected VanChartFieldListPane createFieldListPane(List tableFieldNames, VanChartFieldAttrPane fieldAttrPane, + ModernUIPane richEditor) { + return new VanChartFieldListPane(tableFieldNames, fieldAttrPane, richEditor); + } + private JPanel createRichEditorPane(JPanel richEditor) { JPanel richEditorPane = new JPanel(); From 4854fa76501f08351135f725572e7a3798c36281 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 31 Dec 2020 15:56:38 +0800 Subject: [PATCH 079/111] =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=90=8D?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChartOtherPane.java | 8 ++- .../component/VanChartTooltipContentPane.java | 44 +++----------- .../richText/VanChartFieldListPane.java | 7 ++- .../richText/VanChartRichEditorPane.java | 60 +++++++++++++++++++ .../richText/VanChartRichTextPane.java | 11 ++-- .../designer/style/VanChartStylePane.java | 55 +---------------- 6 files changed, 85 insertions(+), 100 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java index 9b494a1a45..54c010119d 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java @@ -13,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.other.ChartConditionAttrPane; import com.fr.design.mainframe.chart.gui.other.ChartInteractivePane; import com.fr.design.mainframe.chart.gui.type.ChartTabPane; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import javax.swing.JPanel; import java.util.ArrayList; @@ -76,11 +77,11 @@ public class ChartOtherPane extends AbstractChartAttrPane { public String title4PopupWindow() { return PaneTitleConstants.CHART_OTHER_TITLE; } - + private boolean isHaveCondition() { return hasCondition; } - + /** * 设置选中的界面id */ @@ -110,6 +111,7 @@ public class ChartOtherPane extends AbstractChartAttrPane { public void populateBean(Chart chart) { interactivePane.populateBean(chart); if (ChartOtherPane.this.isHaveCondition()) { + VanChartRichEditorPane.refreshFieldNames(chart); conditionAttrPane.populateBean(chart); } } @@ -126,7 +128,7 @@ public class ChartOtherPane extends AbstractChartAttrPane { //特效埋点 ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.EFFECT, chart.getBuryingPointEffectConfig()); } - + /** * 注册 切换按钮的切换事件. * @param currentChartEditPane 当前编辑的图表编辑界面. diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 66f04a3d38..544bd38257 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -36,7 +36,6 @@ import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutChe import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import com.fr.van.chart.designer.component.richText.VanChartRichTextDialog; @@ -445,7 +444,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText); - VanChartRichTextPane richTextPane = this.createRichTextPane(getTableFieldNames(), richEditorPane); + VanChartRichTextPane richTextPane = this.createRichTextPane(richEditorPane); BasicDialog richTextDialog = new VanChartRichTextDialog(DesignerContext.getDesignerFrame(), richTextPane); @@ -483,19 +482,11 @@ public class VanChartTooltipContentPane extends BasicBeanPane getTableFieldNames() { - if (parent == null) { - return null; - } - - return parent.getDataModelColumnNames(); - } - - protected VanChartRichTextPane createRichTextPane(List tableFieldNames, ModernUIPane richEditorPane) { - return new VanChartRichTextPane(tableFieldNames, richEditorPane); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + return new VanChartRichTextPane(richEditorPane); } - protected void refreshRichTextFormat(AttrTooltipRichText richText) { + protected void refreshRichTextParams(AttrTooltipRichText richText) { String[] fieldNames = new String[]{ Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), Toolkit.i18nText("Fine-Design_Chart_Series_Name"), @@ -516,7 +507,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane tableFieldNames = this.getTableFieldNames(); + List tableFieldNames = VanChartRichEditorPane.getFieldNames(); if (tableFieldNames != null) { for (String fieldName : tableFieldNames) { @@ -757,30 +748,13 @@ public class VanChartTooltipContentPane extends BasicBeanPane tableFieldNameList, VanChartFieldAttrPane fieldAttrPane, - ModernUIPane richEditorPane) { + public VanChartFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { - this.tableFieldNameList = tableFieldNameList == null ? new ArrayList<>() : tableFieldNameList; + List richEditorFieldNames = VanChartRichEditorPane.getFieldNames(); + + this.tableFieldNameList = richEditorFieldNames == null ? new ArrayList<>() : richEditorFieldNames; this.fieldAttrPane = fieldAttrPane; this.richEditorPane = richEditorPane; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java index 87710da551..dcec83deb4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java @@ -1,8 +1,19 @@ package com.fr.van.chart.designer.component.richText; +import com.fr.base.TableData; +import com.fr.base.chart.chartdata.TopDefinitionProvider; +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartdata.MoreNameCDDefinition; +import com.fr.chart.chartdata.OneValueCDDefinition; +import com.fr.data.TableDataSource; +import com.fr.data.impl.EmbeddedTableData; +import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; +import com.fr.design.data.DesignTableDataManager; import com.fr.design.ui.ModernUIPane; +import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.type.TextAlign; import com.fr.stable.StringUtils; @@ -11,6 +22,7 @@ import com.teamdev.jxbrowser.chromium.JSValue; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.util.List; import java.util.Locale; import java.util.Map; @@ -26,6 +38,54 @@ public class VanChartRichEditorPane { private static ModernUIPane richEditorPane; private static Browser browser; + private static List fieldNames; + + public static List getFieldNames() { + return fieldNames; + } + + public static void refreshFieldNames(Chart chart) { + VanChartRichEditorPane.fieldNames = null; + + if (chart == null) { + return; + } + + TopDefinitionProvider definition = chart.getFilterDefinition(); + + if (definition == null) { + return; + } + + DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); + TableDataSource tableDataSource = adapter == null ? null : adapter.getBook(); + + TableData tableData = null; + + if (ComparatorUtils.equals(definition.getDataDefinitionType(), OneValueCDDefinition.DEFINITION_TYPE)) { + OneValueCDDefinition oneValueCDDefinition = (OneValueCDDefinition) definition; + tableData = oneValueCDDefinition.getTableData(); + } + + if (ComparatorUtils.equals(definition.getDataDefinitionType(), MoreNameCDDefinition.DEFINITION_TYPE)) { + MoreNameCDDefinition moreNameCDDefinition = (MoreNameCDDefinition) definition; + tableData = moreNameCDDefinition.getTableData(); + } + + if (tableData == null) { + return; + } + + try { + EmbeddedTableData embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tableDataSource, + tableData, TableData.RESULT_NOT_NEED, false); + + List fieldNames = DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); + VanChartRichEditorPane.fieldNames = fieldNames; + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } public static ModernUIPane createRichEditorPane(AttrTooltipRichText richEditor) { VanChartRichEditorModel model = getRichEditorModel(richEditor); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java index 83ef4853e1..93fb9048a7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java @@ -11,7 +11,6 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import java.awt.BorderLayout; import java.awt.Dimension; -import java.util.List; // 标签提示中的富文本面板,包含字段设置和富文本编辑器 public class VanChartRichTextPane extends BasicBeanPane { @@ -25,10 +24,9 @@ public class VanChartRichTextPane extends BasicBeanPane { private VanChartFieldListPane fieldListPane; private VanChartFieldAttrPane fieldAttrPane; - public VanChartRichTextPane(List tableFieldNames, ModernUIPane richEditor) { - + public VanChartRichTextPane(ModernUIPane richEditor) { fieldAttrPane = new VanChartFieldAttrPane(); - fieldListPane = createFieldListPane(tableFieldNames, fieldAttrPane, richEditor); + fieldListPane = createFieldListPane(fieldAttrPane, richEditor); this.setLayout(new BorderLayout()); this.add(createFieldContentPane(), BorderLayout.CENTER); @@ -59,9 +57,8 @@ public class VanChartRichTextPane extends BasicBeanPane { return fieldPane; } - protected VanChartFieldListPane createFieldListPane(List tableFieldNames, VanChartFieldAttrPane fieldAttrPane, - ModernUIPane richEditor) { - return new VanChartFieldListPane(tableFieldNames, fieldAttrPane, richEditor); + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartFieldListPane(fieldAttrPane, richEditor); } private JPanel createRichEditorPane(JPanel richEditor) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java index f9d0720dc6..bb8df99fdb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java @@ -1,21 +1,11 @@ package com.fr.van.chart.designer.style; -import com.fr.base.TableData; -import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.chart.chartdata.MoreNameCDDefinition; -import com.fr.chart.chartdata.OneValueCDDefinition; -import com.fr.data.TableDataSource; -import com.fr.data.impl.EmbeddedTableData; -import com.fr.design.DesignModelAdapter; -import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import com.fr.van.chart.designer.style.axis.VanChartAxisPane; import com.fr.van.chart.designer.style.background.VanChartAreaPane; import com.fr.van.chart.designer.style.datasheet.VanChartDataSheetPane; @@ -87,46 +77,7 @@ public class VanChartStylePane extends ChartStylePane { paneList.add(new VanChartTooltipPane(VanChartStylePane.this)); } - public List getDataModelColumnNames() { - Chart chart = getChart(); - - if (chart == null) { - return null; - } - - TopDefinitionProvider definition = chart.getFilterDefinition(); - - if (definition == null) { - return null; - } - - DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); - TableDataSource tableDataSource = adapter == null ? null : adapter.getBook(); - - TableData tableData = null; - - if (ComparatorUtils.equals(definition.getDataDefinitionType(), OneValueCDDefinition.DEFINITION_TYPE)) { - OneValueCDDefinition oneValueCDDefinition = (OneValueCDDefinition) definition; - tableData = oneValueCDDefinition.getTableData(); - } - - if (ComparatorUtils.equals(definition.getDataDefinitionType(), MoreNameCDDefinition.DEFINITION_TYPE)) { - MoreNameCDDefinition moreNameCDDefinition = (MoreNameCDDefinition) definition; - tableData = moreNameCDDefinition.getTableData(); - } - - if (tableData == null) { - return null; - } - - try { - EmbeddedTableData embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tableDataSource, - tableData, TableData.RESULT_NOT_NEED, false); - - return DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - return null; - } + public void refreshTableFieldNames() { + VanChartRichEditorPane.refreshFieldNames(getChart()); } } \ No newline at end of file From 9db265cd919975de2be98503bce75b7e08bbf16e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 3 Jan 2021 22:15:28 +0800 Subject: [PATCH 080/111] =?UTF-8?q?=E6=95=A3=E7=82=B9=E5=9B=BE=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 28 ++++- .../richText/VanChartFieldListPane.java | 16 +++ .../richText/VanChartRichTextPane.java | 10 +- ...ChartScatterRefreshTooltipContentPane.java | 9 +- .../VanChartScatterRichTextFieldListPane.java | 93 ++++++++++++++ .../VanChartScatterTooltipContentPane.java | 114 ++++++++---------- 6 files changed, 189 insertions(+), 81 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 544bd38257..0698a3291f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -115,9 +115,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane params = new HashMap<>(); @@ -874,6 +888,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane { this.add(createRichEditorPane(richEditor), BorderLayout.SOUTH); } + public VanChartFieldListPane getFieldListPane() { + return fieldListPane; + } + private JPanel createFieldContentPane() { JPanel fieldPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); @@ -71,12 +75,16 @@ public class VanChartRichTextPane extends BasicBeanPane { return richEditorPane; } + protected AttrTooltipContent getInitialTooltipContent() { + return new AttrTooltipContent(); + } + public void populateBean(AttrTooltipContent tooltipContent) { fieldListPane.populate(tooltipContent); } public AttrTooltipContent updateBean() { - AttrTooltipContent content = new AttrTooltipContent(); + AttrTooltipContent content = getInitialTooltipContent(); fieldListPane.update(content); return content; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java index db7ce4152f..e5416b1c21 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java @@ -62,14 +62,7 @@ public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterToo @Override protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextXFormatPane(), null}, - new Component[]{getRichTextYFormatPane(), null}, - new Component[]{getRichTextSizeFormatPane(), null}, - new Component[]{richTextChangedSizeFormatPane, null}, - new Component[]{getRichTextChangedPercentFormatPane(), null} - }; + return null; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRichTextFieldListPane.java new file mode 100644 index 0000000000..776d5397d8 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRichTextFieldListPane.java @@ -0,0 +1,93 @@ +package com.fr.van.chart.scatter; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipSizeFormat; +import com.fr.plugin.chart.base.format.AttrTooltipXFormat; +import com.fr.plugin.chart.base.format.AttrTooltipYFormat; +import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltipContent; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartScatterRichTextFieldListPane extends VanChartFieldListPane { + + private VanChartFieldButton richTextXFormatPane; + private VanChartFieldButton richTextYFormatPane; + private VanChartFieldButton richTextSizeFormatPane; + + public VanChartScatterRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + public VanChartFieldButton getRichTextXFormatPane() { + return richTextXFormatPane; + } + + public VanChartFieldButton getRichTextYFormatPane() { + return richTextYFormatPane; + } + + public VanChartFieldButton getRichTextSizeFormatPane() { + return richTextSizeFormatPane; + } + + protected void initDefaultFieldButton() { + super.initDefaultFieldButton(); + + VanChartFieldListener listener = getFieldListener(); + + richTextXFormatPane = new VanChartFieldButton("x", new AttrTooltipXFormat(), false, listener); + richTextYFormatPane = new VanChartFieldButton("y", new AttrTooltipYFormat(), false, listener); + richTextSizeFormatPane = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"), new AttrTooltipSizeFormat(), false, listener); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(getSeriesNameButton()); + fieldPane.add(richTextXFormatPane); + fieldPane.add(richTextYFormatPane); + fieldPane.add(richTextSizeFormatPane); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(getSeriesNameButton()); + fieldButtonList.add(richTextXFormatPane); + fieldButtonList.add(richTextYFormatPane); + fieldButtonList.add(richTextSizeFormatPane); + + return fieldButtonList; + } + + public void populateDefaultField(AttrTooltipContent tooltipContent) { + super.populateDefaultField(tooltipContent); + + if (tooltipContent instanceof ScatterAttrTooltipContent) { + ScatterAttrTooltipContent scatter = (ScatterAttrTooltipContent) tooltipContent; + + populateButtonFormat(richTextXFormatPane, scatter.getRichTextXFormat()); + populateButtonFormat(richTextYFormatPane, scatter.getRichTextYFormat()); + populateButtonFormat(richTextSizeFormatPane, scatter.getRichTextSizeFormat()); + } + } + + public void updateDefaultField(AttrTooltipContent tooltipContent) { + super.updateDefaultField(tooltipContent); + + if (tooltipContent instanceof ScatterAttrTooltipContent) { + ScatterAttrTooltipContent scatter = (ScatterAttrTooltipContent) tooltipContent; + + updateButtonFormat(richTextXFormatPane, scatter.getRichTextXFormat()); + updateButtonFormat(richTextYFormatPane, scatter.getRichTextYFormat()); + updateButtonFormat(richTextSizeFormatPane, scatter.getRichTextSizeFormat()); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java index 39b20bedbd..8e33bd5e2b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java @@ -1,17 +1,22 @@ package com.fr.van.chart.scatter; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; 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.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSizeFormat; +import com.fr.plugin.chart.base.format.AttrTooltipXFormat; +import com.fr.plugin.chart.base.format.AttrTooltipYFormat; import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltipContent; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; -import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.XFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.XFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.YFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.YFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -26,10 +31,6 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa private YFormatPaneWithCheckBox yFormatPane; private ValueFormatPaneWithCheckBox sizeFormatPane; - private XFormatPaneWithoutCheckBox richTextXFormatPane; - private YFormatPaneWithoutCheckBox richTextYFormatPane; - private ValueFormatPaneWithoutCheckBox richTextSizeFormatPane; - public XFormatPaneWithCheckBox getXFormatPane() { return xFormatPane; } @@ -42,18 +43,6 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa return sizeFormatPane; } - public XFormatPaneWithoutCheckBox getRichTextXFormatPane() { - return richTextXFormatPane; - } - - public YFormatPaneWithoutCheckBox getRichTextYFormatPane() { - return richTextYFormatPane; - } - - public ValueFormatPaneWithoutCheckBox getRichTextSizeFormatPane() { - return richTextSizeFormatPane; - } - public VanChartScatterTooltipContentPane(VanChartStylePane parent, JPanel showOnPane){ super(parent, showOnPane); } @@ -71,13 +60,22 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa sizeFormatPane = new ValueFormatPaneWithCheckBox(parent, showOnPane); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initRichTextFormatPane(parent, showOnPane); + protected void initRichTextTooltipContent() { + setRichTextTooltipContent(new ScatterAttrTooltipContent()); + } + + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartScatterRichTextFieldListPane(fieldAttrPane, richEditor); + } - richTextXFormatPane = new XFormatPaneWithoutCheckBox(parent, showOnPane); - richTextYFormatPane = new YFormatPaneWithoutCheckBox(parent, showOnPane); - richTextSizeFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); + protected AttrTooltipContent getInitialTooltipContent() { + return new ScatterAttrTooltipContent(); + } + }; } @Override @@ -90,16 +88,6 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa }; } - @Override - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{richTextXFormatPane, null}, - new Component[]{richTextYFormatPane, null}, - new Component[]{richTextSizeFormatPane, null} - }; - } - @Override protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { super.populateFormatPane(attrTooltipContent); @@ -111,30 +99,20 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa } } - protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { - if (attrTooltipContent instanceof ScatterAttrTooltipContent) { - ScatterAttrTooltipContent scatterAttrTooltipContent = (ScatterAttrTooltipContent) attrTooltipContent; + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + "x", + "y", + Toolkit.i18nText("Fine-Design_Chart_Use_Value")}; + } - VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ - getRichTextSeriesNameFormatPane(), - richTextXFormatPane, - richTextYFormatPane, - richTextSizeFormatPane - }; - - AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ - scatterAttrTooltipContent.getRichTextSeriesFormat(), - scatterAttrTooltipContent.getRichTextXFormat(), - scatterAttrTooltipContent.getRichTextYFormat(), - scatterAttrTooltipContent.getRichTextSizeFormat() - }; - - setRichTextAttr(new AttrTooltipRichText()); - populateRichTextFormat(formatPaneGroup, formatGroup); - populateRichText(attrTooltipContent.getRichTextAttr()); - - checkRichEditorState(attrTooltipContent); - } + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipSeriesFormat(), + new AttrTooltipXFormat(), + new AttrTooltipYFormat(), + new AttrTooltipSizeFormat()}; } @Override @@ -148,14 +126,16 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa } } - protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { - super.updateRichEditor(attrTooltipContent); + protected void updateTooltipFormat(AttrTooltipContent target, AttrTooltipContent source) { + super.updateTooltipFormat(target, source); - if (attrTooltipContent instanceof ScatterAttrTooltipContent) { - ScatterAttrTooltipContent scatterAttrTooltipContent = (ScatterAttrTooltipContent) attrTooltipContent; - richTextXFormatPane.update(scatterAttrTooltipContent.getRichTextXFormat()); - richTextYFormatPane.update(scatterAttrTooltipContent.getRichTextYFormat()); - richTextSizeFormatPane.update(scatterAttrTooltipContent.getRichTextSizeFormat()); + if (target instanceof ScatterAttrTooltipContent && source instanceof ScatterAttrTooltipContent) { + ScatterAttrTooltipContent targetScatter = (ScatterAttrTooltipContent) target; + ScatterAttrTooltipContent sourceScatter = (ScatterAttrTooltipContent) source; + + targetScatter.setRichTextXFormat(sourceScatter.getRichTextXFormat()); + targetScatter.setRichTextYFormat(sourceScatter.getRichTextYFormat()); + targetScatter.setRichTextSizeFormat(sourceScatter.getRichTextSizeFormat()); } } From 8462205db47b3f76465f79dff653a623ac4fed00 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 3 Jan 2021 23:05:11 +0800 Subject: [PATCH 081/111] =?UTF-8?q?=E8=AF=8D=E4=BA=91=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 7 +--- .../VanChartScatterTooltipContentPane.java | 6 +-- ...anChartWordCloudRichTextFieldListPane.java | 41 +++++++++++++++++++ .../VanChartWordCloudTooltipContentPane.java | 37 ++++++----------- 4 files changed, 57 insertions(+), 34 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 0698a3291f..f2c5662307 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -115,8 +115,9 @@ public class VanChartTooltipContentPane extends BasicBeanPane richEditorPane) { return new VanChartRichTextPane(richEditorPane) { @@ -73,7 +69,7 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa } protected AttrTooltipContent getInitialTooltipContent() { - return new ScatterAttrTooltipContent(); + return createAttrTooltip(); } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRichTextFieldListPane.java new file mode 100644 index 0000000000..3394e6f05b --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRichTextFieldListPane.java @@ -0,0 +1,41 @@ +package com.fr.van.chart.wordcloud.designer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +public class VanChartWordCloudRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartWordCloudRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener fieldListener = getFieldListener(); + + VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + new AttrTooltipCategoryFormat(), false, fieldListener); + + VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Word_Name"), + new AttrTooltipNameFormat(), false, fieldListener); + + VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Word_Value"), + new AttrTooltipValueFormat(), false, fieldListener); + + VanChartFieldButton percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Percent"), + new AttrTooltipPercentFormat(), false, fieldListener); + + setCategoryNameButton(categoryNameButton); + setSeriesNameButton(seriesNameButton); + setValueButton(valueButton); + setPercentButton(percentButton); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java index c0e9ac6c37..99b437861d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java @@ -2,17 +2,18 @@ package com.fr.van.chart.wordcloud.designer.style; import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; 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.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.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -53,31 +54,19 @@ public class VanChartWordCloudTooltipContentPane extends VanChartTooltipContentP setPercentFormatPane(percentFormatPane); } - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); - } - }; - SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Word_Name"); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartWordCloudRichTextFieldListPane(fieldAttrPane, richEditor); } - }; - ValueFormatPaneWithoutCheckBox richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Word_Value"); + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); } }; - PercentFormatPaneWithoutCheckBox richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); - - setRichTextCategoryNameFormatPane(richTextCategoryNameFormatPane); - setRichTextSeriesNameFormatPane(richTextSeriesNameFormatPane); - setRichTextValueFormatPane(richTextValueFormatPane); - setRichTextPercentFormatPane(richTextPercentFormatPane); } - @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); attrTooltipContent.setSeriesFormat(new AttrTooltipNameFormat()); From 57c73aa26dff888a3df88bfbbefd3e015f3abd96 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 4 Jan 2021 16:04:46 +0800 Subject: [PATCH 082/111] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=AF=8D=E4=BA=91?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=AF=8C=E6=96=87=E6=9C=AC=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartWordCloudTooltipContentPane.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java index 99b437861d..0abd60ac1b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudTooltipContentPane.java @@ -4,7 +4,11 @@ package com.fr.van.chart.wordcloud.designer.style; import com.fr.design.i18n.Toolkit; import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; @@ -67,6 +71,24 @@ public class VanChartWordCloudTooltipContentPane extends VanChartTooltipContentP }; } + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Word_Name"), + Toolkit.i18nText("Fine-Design_Chart_Word_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipCategoryFormat(), + new AttrTooltipNameFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; + } + protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); attrTooltipContent.setSeriesFormat(new AttrTooltipNameFormat()); From 428204f0d2eaf43481b7c8f468e51e48efdb4d45 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 4 Jan 2021 16:33:58 +0800 Subject: [PATCH 083/111] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E9=9D=A2=E6=9D=BF=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartMapRichTextFieldListPane.java | 41 +++++++++++++++++++ .../label/VanChartMapLabelContentPane.java | 32 ++++++++++----- .../VanChartMapTooltipContentPane.java | 31 +++++++++----- 3 files changed, 84 insertions(+), 20 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapRichTextFieldListPane.java new file mode 100644 index 0000000000..91e1817ef5 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapRichTextFieldListPane.java @@ -0,0 +1,41 @@ +package com.fr.van.chart.map.designer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +public class VanChartMapRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartMapRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener fieldListener = getFieldListener(); + + VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Area_Name"), + new AttrTooltipAreaNameFormat(), false, fieldListener); + + VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + new AttrTooltipSeriesFormat(), false, fieldListener); + + VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + new AttrTooltipValueFormat(), false, fieldListener); + + VanChartFieldButton percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Percent"), + new AttrTooltipPercentFormat(), false, fieldListener); + + setCategoryNameButton(categoryNameButton); + setSeriesNameButton(seriesNameButton); + setValueButton(valueButton); + setPercentButton(percentButton); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java index 084953c996..baec70ca92 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java @@ -1,18 +1,19 @@ package com.fr.van.chart.map.designer.style.label; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipMapValueFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.plugin.chart.type.TextAlign; import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithoutCheckBox; 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; @@ -21,6 +22,7 @@ import javax.swing.JPanel; * Created by Mitisky on 16/5/20. */ public class VanChartMapLabelContentPane extends VanChartLabelContentPane { + public VanChartMapLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { super(parent, showOnPane, inCondition); } @@ -33,12 +35,22 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane { setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new MapAreaNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipAreaNameFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java index 12948b14dd..03f720bf73 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java @@ -1,17 +1,18 @@ package com.fr.van.chart.map.designer.style.tooltip; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipMapValueFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithoutCheckBox; 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; @@ -32,12 +33,22 @@ public class VanChartMapTooltipContentPane extends VanChartTooltipContentPane { setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new MapAreaNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipAreaNameFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } @Override From 940d684240e05d6638a1a42e1c95785397d2a67d Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 20 Jan 2021 11:00:04 +0800 Subject: [PATCH 084/111] =?UTF-8?q?REPORT-47258=20=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=97=B6=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 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 2a13279203..483e74d9d7 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; @@ -79,7 +80,6 @@ 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,30 +340,18 @@ public abstract class JTemplate> public void refreshResource(FILE file) { - - new SwingWorker() { - + setTargetByFile(file); + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override - protected Void doInBackground() throws Exception { - setTargetByFile(file); - return null; - } + public void run() { + // 先移除旧的。 + removeCenterPane(); + // 加入新的 + addCenterPane(); - @Override - public void done() { - try { - get(); - // 先移除旧的。 - removeCenterPane(); - // 加入新的 - addCenterPane(); - - refreshToolArea(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + refreshToolArea(); } - }.execute(); + }); } From dbf0cba2f6542b9ebfaa15ffaed028ddfa4788df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 20 Jan 2021 13:36:27 +0800 Subject: [PATCH 085/111] =?UTF-8?q?CHART-17958=20=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=85=8D=E8=89=B2=E5=8F=96=E8=89=B2=E5=99=A8=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/style/color/ColorAdjustPane.java | 4 ++++ .../java/com/fr/design/style/color/ColorSelectPane.java | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java index 909501857a..fcdc594b5f 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java @@ -206,6 +206,10 @@ public class ColorAdjustPane extends JPanel implements UIObserver { public void setVisible(boolean b) { super.setVisible(b); } + + protected boolean selectRealTime() { + return false; + } }; colorPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java index c82eac0c0d..68c1b2b992 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java @@ -115,12 +115,16 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7 // 最近使用 - UsedColorPane usedColorPane = new UsedColorPane(1, 8, 1, this, true, true); + UsedColorPane usedColorPane = new UsedColorPane(1, 8, 1, this, true, selectRealTime()); usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8)); row1Pane.add(usedColorPane.getPane()); return row1Pane; } + protected boolean selectRealTime() { + return true; + } + protected Color[] getColorArray() { return ColorFactory.MenuColors; } From 0368ee251bf5936f59d1abee25cf506608b9c603 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 21 Jan 2021 10:16:42 +0800 Subject: [PATCH 086/111] =?UTF-8?q?REPORT-43833=20=E3=80=9010.0.14?= =?UTF-8?q?=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5/=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=A2=9E=E5=8A=A0=E9=94=81=E5=AE=9A=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E6=8F=90=E4=BA=A4=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=91=E8=BF=AD=E4=BB=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/UpdateAction.java | 52 +++++++------- .../actions/server/ConnectionListAction.java | 39 +++++++++-- .../actions/server/GlobalTableDataAction.java | 44 +++++++++++- .../design/data/BasicTableDataTreePane.java | 23 +++++++ .../connect/ConnectionComboBoxPanel.java | 48 ++++++++++++- .../connect/ItemEditableComboBoxPanel.java | 58 ++++++++-------- .../editlock/ConnectionLockChangeChecker.java | 25 +++++++ .../editlock/EditLockChangeChecker.java | 67 ++++++++++++++++++ .../design/editlock/EditLockChangeEvent.java | 25 +++++++ .../editlock/EditLockChangeListener.java | 16 +++++ .../com/fr/design/editlock/EditLockUtils.java | 69 +++++++++++++++++++ .../ServerTableDataLockChangeChecker.java | 23 +++++++ .../fr/design/gui/ibutton/UILockButton.java | 46 +++++++++++++ .../fr/design/gui/imenu/UILockMenuItem.java | 47 +++++++++++++ .../fr/design/gui/imenu/UILockMenuItemUI.java | 28 ++++++++ .../design/os/impl/DatabaseDialogAction.java | 14 +++- .../images/m_web/connection_locked_normal.svg | 15 ++++ .../fr/design/images/m_web/locked_normal.svg | 14 ++++ .../images/m_web/warningIcon_normal.svg | 21 ++++++ .../module/DesignerWorkspaceProvider.java | 14 ++++ 20 files changed, 625 insertions(+), 63 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java create mode 100644 designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java create mode 100644 designer-base/src/main/java/com/fr/design/editlock/EditLockChangeEvent.java create mode 100644 designer-base/src/main/java/com/fr/design/editlock/EditLockChangeListener.java create mode 100644 designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java create mode 100644 designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItemUI.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/connection_locked_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/locked_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon_normal.svg 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 bb4ba4cccc..5c12ff29c3 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 @@ -339,33 +339,37 @@ public abstract class UpdateAction extends ShortCut implements Action { if (!(object instanceof AbstractButton)) { UIButton button = null; button = new UIButton(); - // 添加一个名字作为自动化测试用 - button.setName(getName()); - button.set4ToolbarButton(); - - //设置属性. - Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY); - if (mnemonicInteger != null) { - button.setMnemonic((char) mnemonicInteger.intValue()); - } - - button.setIcon((Icon) this.getValue(Action.SMALL_ICON)); - setPressedIcon4Button(button); - setDisabledIcon4Button(button); - button.addActionListener(this); + object = initButton(button, UIButton.class.getName()); + } - button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW); + return (JComponent) object; + } - this.putValue(UIButton.class.getName(), button); - button.setText(StringUtils.EMPTY); - button.setEnabled(this.isEnabled()); + protected JComponent initButton(UIButton button, String name) { + // 添加一个名字作为自动化测试用 + button.setName(getName()); + button.set4ToolbarButton(); - //peter:产生tooltip - button.setToolTipText(getToolTipText()); - object = button; + //设置属性. + Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY); + if (mnemonicInteger != null) { + button.setMnemonic((char) mnemonicInteger.intValue()); } - return (JComponent) object; + 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); + + this.putValue(name, button); + button.setText(StringUtils.EMPTY); + button.setEnabled(this.isEnabled()); + + //peter:产生tooltip + button.setToolTipText(getToolTipText()); + return button; } /** @@ -641,14 +645,14 @@ public abstract class UpdateAction extends ShortCut implements Action { shortPinyin.append(PinyinHelper.getShortPinyin(title)).append(separator); } - private void setPressedIcon4Button(AbstractButton button) { + protected 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) { + protected 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/server/ConnectionListAction.java b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java index 820de79e5e..45502c0733 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,19 +1,25 @@ 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; import com.fr.design.data.datapane.connect.DatabaseConnectionPane; import com.fr.design.dialog.BasicDialog; +import com.fr.design.editlock.ConnectionLockChangeChecker; +import com.fr.design.editlock.EditLockUtils; import com.fr.design.gui.NameInspector; +import com.fr.design.gui.ibutton.UILockButton; +import com.fr.design.gui.imenu.UILockMenuItem; +import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.menu.MenuKeySet; +import com.fr.stable.StringUtils; 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.workspace.server.lock.editlock.LockItem; -import javax.swing.*; +import javax.swing.KeyStroke; import java.awt.event.ActionEvent; import java.util.Map; @@ -53,8 +59,16 @@ public class ConnectionListAction extends UpdateAction { * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { - OSBasedAction osBasedAction = OSSupportCenter.getAction(DatabaseDialogAction.class); - osBasedAction.execute(); + // 尝试为数据连接加锁 + boolean actionLock = EditLockUtils.lock(LockItem.CONNECTION); + if (!actionLock) { + // 锁定失败,代表已经被其他用户锁定,跳出弹窗提示 + EditLockUtils.showLockMessage(); + } else { + // 锁定成功,执行后续操作 + OSBasedAction osBasedAction = OSSupportCenter.getAction(DatabaseDialogAction.class); + osBasedAction.execute(); + } } /** @@ -96,4 +110,21 @@ public class ConnectionListAction extends UpdateAction { public void update() { this.setEnabled(true); } + + @Override + public UIMenuItem createMenuItem() { + Object object = this.getValue(UILockMenuItem.class.getName()); + if (object == null && !(object instanceof UILockMenuItem)) { + UILockMenuItem menuItem = new UILockMenuItem(this, EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, StringUtils.EMPTY, LockItem.CONNECTION); + // 设置名字用作单元测 + menuItem.setName(getName()); + setPressedIcon4Button(menuItem); + setDisabledIcon4Button(menuItem); + object = menuItem; + + this.putValue(UILockMenuItem.class.getName(), object); + ConnectionLockChangeChecker.getInstance().addEditLockChangeListener((UILockMenuItem)object); + } + return (UILockMenuItem) object; + } } 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 468fb1f98d..14795066de 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 @@ -4,7 +4,6 @@ package com.fr.design.actions.server; 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; @@ -13,18 +12,24 @@ import com.fr.design.data.tabledata.ResponseDataSourceChange; import com.fr.design.data.tabledata.tabledatapane.TableDataManagerPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.editlock.EditLockUtils; +import com.fr.design.editlock.ServerTableDataLockChangeChecker; import com.fr.design.gui.NameInspector; +import com.fr.design.gui.imenu.UILockMenuItem; +import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.menu.MenuKeySet; import com.fr.file.TableDataConfig; +import com.fr.stable.StringUtils; import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; +import com.fr.workspace.server.lock.editlock.LockItem; import javax.swing.KeyStroke; -import java.awt.*; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.util.HashMap; import java.util.Map; @@ -66,6 +71,14 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { + // 尝试为服务器数据集加锁 + boolean actionLock = EditLockUtils.lock(LockItem.SERVER_TABLE_DATA); + if (!actionLock) { + // 锁定失败,代表已经被其他用户锁定,跳出弹窗提示 + EditLockUtils.showLockMessage(); + return; + } + // 锁定成功,执行后续操作 final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); final TableDataConfig tableDataConfig = TableDataConfig.getInstance(); final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { @@ -90,7 +103,8 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS globalTableDataDialog.setDoOKSucceed(false); return; } - + // 关闭服务器数据集页面,为其解锁 + EditLockUtils.unlock(LockItem.SERVER_TABLE_DATA); DesignTableDataManager.clearGlobalDs(); // 保存时 移除服务器数据集列名缓存 for (String name : tableDataConfig.getTableDatas().keySet()) { @@ -117,6 +131,13 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS } })); } + + @Override + public void doCancel() { + super.doCancel(); + // 关闭服务器数据集页面,为其解锁 + EditLockUtils.unlock(LockItem.SERVER_TABLE_DATA); + } }); globalTableDataDialog.setVisible(true); } @@ -166,4 +187,21 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS public void fireDSChanged(Map map) { DesignTableDataManager.fireDSChanged(map); } + + @Override + public UIMenuItem createMenuItem() { + Object object = this.getValue(UILockMenuItem.class.getName()); + if (object == null && !(object instanceof UILockMenuItem)) { + UILockMenuItem menuItem = new UILockMenuItem(this, EditLockUtils.SERVER_TABLEDATA_LOCKED_TOOLTIPS, StringUtils.EMPTY, LockItem.SERVER_TABLE_DATA); + // 设置名字用作单元测 + menuItem.setName(getName()); + setPressedIcon4Button(menuItem); + setDisabledIcon4Button(menuItem); + object = menuItem; + + this.putValue(UILockMenuItem.class.getName(), object); + ServerTableDataLockChangeChecker.getInstance().addEditLockChangeListener((UILockMenuItem)object); + } + return (UILockMenuItem) object; + } } 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 83740f6853..34482d0d20 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 @@ -18,7 +18,10 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; +import com.fr.design.editlock.ConnectionLockChangeChecker; +import com.fr.design.editlock.EditLockUtils; import com.fr.design.gui.ibutton.UIHeadGroup; +import com.fr.design.gui.ibutton.UILockButton; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.icon.IconPathConstants; @@ -31,8 +34,11 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; +import javax.swing.AbstractButton; +import javax.swing.Action; import javax.swing.DefaultCellEditor; import javax.swing.Icon; +import javax.swing.JComponent; import javax.swing.JTree; import javax.swing.event.CellEditorListener; import javax.swing.event.ChangeEvent; @@ -439,6 +445,23 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp this.setMnemonic('D'); this.setSmallIcon("/com/fr/design/images/m_web/connection"); } + + @Override + public JComponent createToolBarComponent() { + Object object = this.getValue(UILockButton.class.getName()); + if (!(object instanceof AbstractButton)) { + UILockButton button = new UILockButton( + EditLockUtils.CONNECTION_LOCKED_ICON, + (Icon) this.getValue(Action.SMALL_ICON), + EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, + getToolTipText() + ); + initButton(button, UILockButton.class.getName()); + object = button; + ConnectionLockChangeChecker.getInstance().addEditLockChangeListener((UILockButton)object); + } + return (JComponent) object; + } } /** diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index f4a7910b1c..91813418b5 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fr.base.svg.IconUtils; import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.Connection; import com.fr.data.impl.NameDatabaseConnection; @@ -7,6 +8,10 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.actions.server.ConnectionListAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.editlock.ConnectionLockChangeChecker; +import com.fr.design.editlock.EditLockUtils; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UILockButton; import com.fr.design.mainframe.DesignerContext; import com.fr.file.ConnectionConfig; import com.fr.general.ComparatorUtils; @@ -16,8 +21,12 @@ import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; import com.fr.workspace.WorkContext; import com.fr.workspace.server.connection.DBConnectAuth; +import com.fr.workspace.server.lock.editlock.LockItem; import javax.swing.SwingUtilities; +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.util.ArrayList; @@ -56,6 +65,25 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { refreshItems(); } + @Override + protected UIButton initEditButton(UIButton editButton, Dimension buttonSize) { + editButton = new UILockButton( + EditLockUtils.CONNECTION_LOCKED_ICON, + IconUtils.readIcon("/com/fr/design/images/m_web/connection"), + EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, + StringUtils.EMPTY + ); + editButton.setIcon(IconUtils.readIcon("/com/fr/design/images/m_web/connection")); + editButton.setPreferredSize(buttonSize); + editButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + editItems(); + } + }); + ConnectionLockChangeChecker.getInstance().addEditLockChangeListener((UILockButton) editButton); + return editButton; + } + /* * 刷新ComboBox.items */ @@ -97,6 +125,14 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { * 弹出对话框编辑Items */ protected void editItems() { + // 尝试为数据连接加锁 + boolean actionLock = EditLockUtils.lock(LockItem.CONNECTION); + if (!actionLock) { + // 锁定失败,代表已经被其他用户锁定,跳出弹窗提示 + EditLockUtils.showLockMessage(); + return; + } + // 锁定成功,执行后续操作 final ConnectionListPane connectionListPane = new ConnectionListPane(); final ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); ConnectionConfig cloned = connectionConfig.mirror(); @@ -109,7 +145,8 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { connectionListDialog.setDoOKSucceed(false); return; } - + // 关闭定义数据连接页面,为其解锁 + EditLockUtils.unlock(LockItem.CONNECTION); Configurations.modify(new WorkerFacade(ConnectionConfig.class) { @Override public void run() { @@ -129,6 +166,13 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { })); } + + @Override + public void doCancel() { + // 关闭定义数据连接页面,为其解锁 + super.doCancel(); + EditLockUtils.unlock(LockItem.CONNECTION); + } }); connectionListDialog.setVisible(true); refreshItems(); @@ -158,4 +202,4 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { } } } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java index 1c61eea265..f06d1405b8 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java @@ -12,7 +12,7 @@ import java.awt.event.ActionListener; public abstract class ItemEditableComboBoxPanel extends JPanel { /** - * + * */ private static final long serialVersionUID = 1L; @@ -21,37 +21,29 @@ public abstract class ItemEditableComboBoxPanel extends JPanel { return ""; } }; - + protected UIComboBox itemComboBox; protected UIButton editButton; protected UIButton refreshButton; - + public ItemEditableComboBoxPanel() { super(); - + initComponents(); } - + protected void initComponents() { this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - + Dimension buttonSize = new Dimension(26, 20); itemComboBox = new UIComboBox(); itemComboBox.setEnabled(true); this.add(itemComboBox, BorderLayout.CENTER); - - editButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/control-center2.png")); refreshButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); JPanel jPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 4 ,4); + editButton = initEditButton(editButton, buttonSize); jPanel.add(editButton); jPanel.add(refreshButton); this.add(jPanel, BorderLayout.EAST); - Dimension buttonSize = new Dimension(26, 20); - editButton.setPreferredSize(buttonSize); - editButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent evt) { - editItems(); - } - }); refreshButton.setPreferredSize(buttonSize); refreshButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -59,32 +51,44 @@ public abstract class ItemEditableComboBoxPanel extends JPanel { } }); } - + + protected UIButton initEditButton(UIButton editButton, Dimension buttonSize) { + editButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/control-center2.png")); + editButton.setPreferredSize(buttonSize); + editButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + editItems(); + } + }); + return editButton; + } + + /** * 给itemComboBox添加ActionListener */ public void addComboBoxActionListener(ActionListener l) { itemComboBox.addActionListener(l); } - + /* * 刷新itemComboBox的内容 */ protected void refreshItems() { // 记录原来选中的Item,重新加载后需要再次选中 Object lastSelectedItem = itemComboBox.getSelectedItem(); - + DefaultComboBoxModel model = ((DefaultComboBoxModel) itemComboBox.getModel()); model.removeAllElements(); - + // 先加EMPTY,再加items model.addElement(EMPTY); - + java.util.Iterator itemIt = items(); while(itemIt.hasNext()) { model.addElement(itemIt.next()); } - + // 再次选中之前选中的Item int idx = model.getIndexOf(lastSelectedItem); if(idx < 0) { @@ -92,16 +96,16 @@ public abstract class ItemEditableComboBoxPanel extends JPanel { } itemComboBox.setSelectedIndex(idx); } - + /* * 得到其中的itemComboBox所选中的Item */ public String getSelectedItem() { Object selected = itemComboBox.getSelectedItem(); - + return selected instanceof String ? (String)selected : null; } - + /* * 选中name项 */ @@ -109,14 +113,14 @@ public abstract class ItemEditableComboBoxPanel extends JPanel { DefaultComboBoxModel model = ((DefaultComboBoxModel) itemComboBox.getModel()); model.setSelectedItem(name); } - + /* * 刷新ComboBox.items */ protected abstract java.util.Iterator items(); - + /* * 弹出对话框编辑Items */ protected abstract void editItems(); -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java new file mode 100644 index 0000000000..ac80cd53c2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java @@ -0,0 +1,25 @@ +package com.fr.design.editlock; + + +import com.fr.workspace.server.lock.editlock.LockItem; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/20 + * 定义数据连接的checker + */ +public class ConnectionLockChangeChecker extends EditLockChangeChecker{ + + private static class Holder { + private static final ConnectionLockChangeChecker INSTANCE = new ConnectionLockChangeChecker(); + } + + public static ConnectionLockChangeChecker getInstance() { + return ConnectionLockChangeChecker.Holder.INSTANCE; + } + + public ConnectionLockChangeChecker() { + this.lockItem = LockItem.CONNECTION; + } +} diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java new file mode 100644 index 0000000000..13ac921e33 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java @@ -0,0 +1,67 @@ +package com.fr.design.editlock; + +import com.fr.concurrent.NamedThreadFactory; +import com.fr.log.FineLoggerFactory; +import com.fr.workspace.WorkContext; +import com.fr.workspace.server.lock.editlock.EditLockOperator; +import com.fr.workspace.server.lock.editlock.LockItem; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/19 + * 判断当前设计器在远程设计服务器中的锁状态是否发生了改变 + */ +public abstract class EditLockChangeChecker { + + private static final int INTERVAL = 30000; + private ScheduledExecutorService scheduler; + protected LockItem lockItem; + private boolean isLocked = false; + private List listeners = new ArrayList<>(); + + /** + * 轮询任务,如果是远程设计状态,每隔30s查询一次相应lockItem的锁状态是否改变 + */ + public void start() { + this.scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("EditLockChangeChecker")); + this.scheduler.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + // 判断是否为远程设计环境 + if (!WorkContext.getCurrent().isLocal()) { + try { + EditLockOperator operator = WorkContext.getCurrent().get(EditLockOperator.class); + boolean locked = operator.isLocked(lockItem); + if (isLocked != locked) { + isLocked = locked; + fireChange(); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + }, 0, INTERVAL, TimeUnit.MILLISECONDS); + } + + public void stop() { + this.scheduler.shutdown(); + } + + public void addEditLockChangeListener(EditLockChangeListener listener) { + this.listeners.add(listener); + } + + private void fireChange() { + for (EditLockChangeListener listener : this.listeners) { + listener.updateLockedState(new EditLockChangeEvent(isLocked)); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeEvent.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeEvent.java new file mode 100644 index 0000000000..66420fd0b7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeEvent.java @@ -0,0 +1,25 @@ +package com.fr.design.editlock; + +import java.util.EventObject; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/20 + */ +public class EditLockChangeEvent extends EventObject { + + private boolean isLocked; + + /** + * @param source 锁状态发生了改变,且当前锁状态就是source + */ + public EditLockChangeEvent(boolean source) { + super(source); + this.isLocked = source; + } + + public boolean isLocked() { + return isLocked; + } +} diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeListener.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeListener.java new file mode 100644 index 0000000000..dcabe87cce --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeListener.java @@ -0,0 +1,16 @@ +package com.fr.design.editlock; + +import java.util.EventListener; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/20 + */ +public interface EditLockChangeListener extends EventListener { + /** + * 锁定状态改变后执行的动作 + * @param event 事件 + */ + void updateLockedState(EditLockChangeEvent event); +} diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java new file mode 100644 index 0000000000..20708462d3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java @@ -0,0 +1,69 @@ +package com.fr.design.editlock; + +import com.fr.base.svg.IconUtils; +import com.fr.base.svg.SVGLoader; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.workspace.WorkContext; +import com.fr.workspace.server.lock.editlock.EditLockOperator; +import com.fr.workspace.server.lock.editlock.LockItem; +import org.jetbrains.annotations.Nullable; + +import javax.swing.Icon; +import javax.swing.JOptionPane; +import java.awt.Image; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/20 + * 关于编辑锁定的一些常量和静态方法 + */ +public class EditLockUtils { + + /** + * 数据连接锁定标志 + */ + public static final Icon CONNECTION_LOCKED_ICON = IconUtils.readIcon("/com/fr/design/images/m_web/connection_locked"); + + /** + * 小锁图片 + */ + public static final @Nullable Image LOCKED_IMAGE = SVGLoader.load("/com/fr/design/images/m_web/locked_normal.svg"); + + public static final Icon TOOLTIPS_ICON = IconUtils.readIcon("/com/fr/design/images/m_web/warningIcon"); + + /** + * 数据连接锁定中 + */ + public static final String CONNECTION_LOCKED_TOOLTIPS = Toolkit.i18nText("Fine_Designer_Remote_Design_Data_Connection_Locked"); + + /** + * 服务器数据集锁定中 + */ + public static final String SERVER_TABLEDATA_LOCKED_TOOLTIPS = Toolkit.i18nText("Fine_Designer_Remote_Design_Server_TableData_Locked"); + + public static final String LOCKED_MESSAGE = Toolkit.i18nText("Fine_Designer_Remote_Design_Locked_Message"); + + public static final String TOOLTIPS = Toolkit.i18nText("Fine-Engine_Report_Tooltips"); + + /** + * 已经被锁,跳出弹窗提示 + */ + public static void showLockMessage() { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), EditLockUtils.LOCKED_MESSAGE, EditLockUtils.TOOLTIPS, JOptionPane.INFORMATION_MESSAGE, EditLockUtils.TOOLTIPS_ICON); + } + + public static boolean lock(LockItem lockItem) { + return WorkContext.getCurrent().get(EditLockOperator.class).lock(lockItem); + } + + public static boolean unlock(LockItem lockItem) { + return WorkContext.getCurrent().get(EditLockOperator.class).unlock(lockItem); + } + + public static boolean isLocked(LockItem lockItem) { + return WorkContext.getCurrent().get(EditLockOperator.class).isLocked(lockItem); + } +} diff --git a/designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java new file mode 100644 index 0000000000..a3f2bbbf42 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java @@ -0,0 +1,23 @@ +package com.fr.design.editlock; + +import com.fr.workspace.server.lock.editlock.LockItem; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/20 + * 服务器数据集的checker + */ +public class ServerTableDataLockChangeChecker extends EditLockChangeChecker{ + private static class Holder { + private static final ServerTableDataLockChangeChecker INSTANCE = new ServerTableDataLockChangeChecker(); + } + + public static ServerTableDataLockChangeChecker getInstance() { + return ServerTableDataLockChangeChecker.Holder.INSTANCE; + } + + public ServerTableDataLockChangeChecker() { + this.lockItem = LockItem.SERVER_TABLE_DATA; + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java new file mode 100644 index 0000000000..aa643b6c11 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java @@ -0,0 +1,46 @@ +package com.fr.design.gui.ibutton; + +import com.fr.design.editlock.EditLockChangeEvent; +import com.fr.design.editlock.EditLockChangeListener; + +import javax.swing.Icon; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/20 + */ +public class UILockButton extends UIButton implements EditLockChangeListener { + + /** + * 锁定状态图标 + */ + private Icon lockedIcon; + /** + * 正常状态图标 + */ + private Icon normalIcon; + /** + * 锁定状态的提示信息 + */ + private String lockedTooltips; + /** + * 正常状态的提示信息 + */ + private String normalTooltips; + + public UILockButton(Icon lockedIcon, Icon normalIcon, String lockedTooltips, String normalTooltips) { + super(); + this.lockedIcon = lockedIcon; + this.normalIcon = normalIcon; + this.lockedTooltips = lockedTooltips; + this.normalTooltips = normalTooltips; + } + + @Override + public void updateLockedState(EditLockChangeEvent event) { + this.setIcon(event.isLocked() ? lockedIcon : normalIcon); + this.setToolTipText(event.isLocked() ? lockedTooltips : normalTooltips); + this.repaint(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java new file mode 100644 index 0000000000..092b765161 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java @@ -0,0 +1,47 @@ +package com.fr.design.gui.imenu; + +import com.fr.design.editlock.EditLockChangeEvent; +import com.fr.design.editlock.EditLockChangeListener; +import com.fr.workspace.server.lock.editlock.LockItem; + +import javax.swing.Action; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/20 + */ +public class UILockMenuItem extends UIMenuItem implements EditLockChangeListener { + + /** + * 锁定状态的提示信息 + */ + private String lockedTooltips; + /** + * 正常状态的提示信息 + */ + private String normalTooltips; + + /** + * 当前锁定项 + */ + private LockItem lockItem; + + public UILockMenuItem(Action action, String lockedTooltips, String normalTooltips, LockItem lockItem) { + super(action); + this.lockedTooltips = lockedTooltips; + this.normalTooltips = normalTooltips; + this.lockItem = lockItem; + setUI(new UILockMenuItemUI()); + } + + public LockItem getLockItem() { + return lockItem; + } + + @Override + public void updateLockedState(EditLockChangeEvent event) { + this.setToolTipText(event.isLocked() ? lockedTooltips : normalTooltips); + this.repaint(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItemUI.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItemUI.java new file mode 100644 index 0000000000..c0f70795bb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItemUI.java @@ -0,0 +1,28 @@ +package com.fr.design.gui.imenu; + +import com.fr.design.editlock.EditLockUtils; + +import javax.swing.JMenuItem; +import java.awt.Graphics; +import java.awt.Rectangle; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2021/1/20 + */ +public class UILockMenuItemUI extends UIMenuItemUI{ + + @Override + protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { + super.paintText(g, menuItem, textRect, text); + // 除了绘制text之外,还需要画一下锁定图标 + UILockMenuItem lockMenuItem = (UILockMenuItem) menuItem; + if (EditLockUtils.isLocked(lockMenuItem.getLockItem())) { + int width = menuItem.getWidth(); + int height = menuItem.getHeight(); + g.drawImage(EditLockUtils.LOCKED_IMAGE, (int) Math.round(width * 0.9), (int) Math.round(height * 0.1), 16, 16, null); + } + + } +} diff --git a/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java b/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java index acd9068974..3d343ab935 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java @@ -1,18 +1,17 @@ package com.fr.design.os.impl; -import com.fr.config.ServerPreferenceConfig; import com.fr.design.data.datapane.connect.ConnectionManagerPane; -import com.fr.design.dcm.UniversalDatabaseOpener; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.editlock.EditLockUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.file.ConnectionConfig; -import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.support.OSBasedAction; import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; +import com.fr.workspace.server.lock.editlock.LockItem; import static com.fr.design.actions.server.ConnectionListAction.doWithDatasourceManager; /** @@ -53,6 +52,8 @@ public class DatabaseDialogAction implements OSBasedAction { databaseListDialog.setDoOKSucceed(false); return; } + // 定义数据连接弹窗关闭后,解锁 + EditLockUtils.unlock(LockItem.CONNECTION); Configurations.modify(new WorkerFacade(ConnectionConfig.class) { @Override public void run() { @@ -71,6 +72,13 @@ public class DatabaseDialogAction implements OSBasedAction { } })); } + + @Override + public void doCancel() { + super.doCancel(); + // 定义数据连接弹窗关闭后,解锁 + EditLockUtils.unlock(LockItem.CONNECTION); + } }); databaseListDialog.setVisible(true); } diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/connection_locked_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/connection_locked_normal.svg new file mode 100644 index 0000000000..b1b9d17929 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/connection_locked_normal.svg @@ -0,0 +1,15 @@ + + + 编组 3 + + + + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/locked_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/locked_normal.svg new file mode 100644 index 0000000000..b3b2ac74f8 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/locked_normal.svg @@ -0,0 +1,14 @@ + + + 编组 2 + + + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon_normal.svg new file mode 100644 index 0000000000..b7748925d6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon_normal.svg @@ -0,0 +1,21 @@ + + + icon_WarningIcon_normal + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 a7ef4f108a..0a572e6721 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 @@ -3,6 +3,8 @@ package com.fr.start.module; import com.fr.design.DesignerEnvManager; import com.fr.design.EnvChangeEntrance; import com.fr.design.constants.DesignerLaunchStatus; +import com.fr.design.editlock.ConnectionLockChangeChecker; +import com.fr.design.editlock.ServerTableDataLockChangeChecker; import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo; @@ -88,6 +90,12 @@ public class DesignerWorkspaceProvider extends Activator { } } pluginErrorRemind(); + editLockCheckerStart(); + } + + private void editLockCheckerStart() { + ConnectionLockChangeChecker.getInstance().start(); + ServerTableDataLockChangeChecker.getInstance().start(); } private void pluginErrorRemind() { @@ -102,6 +110,12 @@ public class DesignerWorkspaceProvider extends Activator { @Override public void stop() { // void + editLockCheckerStop(); + } + + private void editLockCheckerStop() { + ConnectionLockChangeChecker.getInstance().stop(); + ServerTableDataLockChangeChecker.getInstance().stop(); } @Override From 389483541d0ae4c56af540024925973d33281693 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 21 Jan 2021 14:36:38 +0800 Subject: [PATCH 087/111] =?UTF-8?q?REPORT-43833=20=E3=80=9010.0.14?= =?UTF-8?q?=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5/=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=A2=9E=E5=8A=A0=E9=94=81=E5=AE=9A=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=87=AA?= =?UTF-8?q?=E6=B5=8B+=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9Bbug=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E8=87=AA=E6=B5=8B?= =?UTF-8?q?+=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/server/ConnectionListAction.java | 2 +- .../actions/server/GlobalTableDataAction.java | 2 +- .../connect/ConnectionComboBoxPanel.java | 1 - .../com/fr/design/editlock/EditLockUtils.java | 14 ++++++++++-- .../fr/design/gui/ibutton/UILockButton.java | 9 ++++++++ .../fr/design/images/m_web/warningIcon.png | Bin 0 -> 1190 bytes .../images/m_web/warningIcon_normal.svg | 21 ------------------ 7 files changed, 23 insertions(+), 26 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon.png delete mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon_normal.svg 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 45502c0733..1fd555e829 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 @@ -115,7 +115,7 @@ public class ConnectionListAction extends UpdateAction { public UIMenuItem createMenuItem() { Object object = this.getValue(UILockMenuItem.class.getName()); if (object == null && !(object instanceof UILockMenuItem)) { - UILockMenuItem menuItem = new UILockMenuItem(this, EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, StringUtils.EMPTY, LockItem.CONNECTION); + UILockMenuItem menuItem = new UILockMenuItem(this, EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, null, LockItem.CONNECTION); // 设置名字用作单元测 menuItem.setName(getName()); setPressedIcon4Button(menuItem); 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 14795066de..44d38db9fe 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 @@ -192,7 +192,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS public UIMenuItem createMenuItem() { Object object = this.getValue(UILockMenuItem.class.getName()); if (object == null && !(object instanceof UILockMenuItem)) { - UILockMenuItem menuItem = new UILockMenuItem(this, EditLockUtils.SERVER_TABLEDATA_LOCKED_TOOLTIPS, StringUtils.EMPTY, LockItem.SERVER_TABLE_DATA); + UILockMenuItem menuItem = new UILockMenuItem(this, EditLockUtils.SERVER_TABLEDATA_LOCKED_TOOLTIPS, null, LockItem.SERVER_TABLE_DATA); // 设置名字用作单元测 menuItem.setName(getName()); setPressedIcon4Button(menuItem); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index 91813418b5..a5ab12ff90 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -73,7 +73,6 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, StringUtils.EMPTY ); - editButton.setIcon(IconUtils.readIcon("/com/fr/design/images/m_web/connection")); editButton.setPreferredSize(buttonSize); editButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java index 20708462d3..baa3543f87 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java @@ -5,6 +5,7 @@ import com.fr.base.svg.SVGLoader; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; +import com.fr.general.IOUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.editlock.EditLockOperator; import com.fr.workspace.server.lock.editlock.LockItem; @@ -32,7 +33,10 @@ public class EditLockUtils { */ public static final @Nullable Image LOCKED_IMAGE = SVGLoader.load("/com/fr/design/images/m_web/locked_normal.svg"); - public static final Icon TOOLTIPS_ICON = IconUtils.readIcon("/com/fr/design/images/m_web/warningIcon"); + /** + * 提示弹窗中的提示标志 + */ + public static final Icon TOOLTIPS_ICON = IOUtils.readIcon("/com/fr/design/images/m_web/warningIcon.png"); /** * 数据连接锁定中 @@ -44,9 +48,15 @@ public class EditLockUtils { */ public static final String SERVER_TABLEDATA_LOCKED_TOOLTIPS = Toolkit.i18nText("Fine_Designer_Remote_Design_Server_TableData_Locked"); + /** + * 提示弹窗中的提示信息 + */ public static final String LOCKED_MESSAGE = Toolkit.i18nText("Fine_Designer_Remote_Design_Locked_Message"); - public static final String TOOLTIPS = Toolkit.i18nText("Fine-Engine_Report_Tooltips"); + /** + * 提示弹窗中的标题 + */ + public static final String TOOLTIPS = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Title_Hint"); /** * 已经被锁,跳出弹窗提示 diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java index aa643b6c11..b5534f6094 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java @@ -2,6 +2,8 @@ package com.fr.design.gui.ibutton; import com.fr.design.editlock.EditLockChangeEvent; import com.fr.design.editlock.EditLockChangeListener; +import com.fr.design.editlock.EditLockUtils; +import com.fr.workspace.server.lock.editlock.LockItem; import javax.swing.Icon; @@ -35,6 +37,13 @@ public class UILockButton extends UIButton implements EditLockChangeListener { this.normalIcon = normalIcon; this.lockedTooltips = lockedTooltips; this.normalTooltips = normalTooltips; + init(); + } + + private void init() { + boolean locked = EditLockUtils.isLocked(LockItem.CONNECTION); + this.setIcon(locked ? lockedIcon : normalIcon); + this.setToolTipText(locked ? lockedTooltips : normalTooltips); } @Override diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon.png b/designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..41c7c703a2d614f1a7321ae76f1f78be8f9ea3fe GIT binary patch literal 1190 zcmV;X1X=ruP)1-1EWA`z1MZ43<~dJBuW(d zqR2O)A%N(DzUO(q=QGcqIdkqvQSu)ENE2)w17r4+we-BR-j1J7NGYMrsbraEyDF3}B1$8+)wd1qVu5D)7s$ReGj%6$CtzGU87rmY>PG96JZOT!9p?!%^UudFV0kfJR~&xa_LvUCs{rDGyvb->N-@7 zgf~+|oE8P)IcAj(Z+{i_U9W|};rvhop?77PGvI>LVkQW`8-jX0CgnDr!2ynWwEg8e za?66#I*gPSxIG?o=5Y?xHwyYQ{_}#5ZpUz5V$GBy|X>4*#G}+su72E_9@8kBjF=pk~ zqH( zG+>qmr{($3I57|l7n=fyVC&O(V*8K_cG9@&a+;GF{OR2PS?2h5nXT@CU+$ctFpzrPy8@nVyJv+TeIvt*G(VWn5Sr zqQT`}t0Pm1)KdNfQvO+O_HUH(oF?=38aIAxUm4H|;xao}P!qI1h%6Vu@oexgenR^+ z5_|Ou296Ue@hyVmA^s>n1dsG8aKuH7#7cb${_ubn;T7C7Q#(wQ&`VeR;;Sm6_H0$d z!YJO!eF04cqylTPFzVsw)7N{cqE0Nx?BTxM@%6?j_1*>{vj?8|?%q-qpPiT&UqITg z?>9oci9eg3!)@`w;#U8Eh7|H9e%t*6x54i#BU5MZ0CBX*Zs}O8*#H0l07*qoM6N<$ Ef^m~eUjP6A literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon_normal.svg deleted file mode 100644 index b7748925d6..0000000000 --- a/designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon_normal.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - icon_WarningIcon_normal - - - - - - - - - - - - - - - - - - \ No newline at end of file From a97241863ef39822f4aa25bf79d340d3d7d4104e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 21 Jan 2021 16:25:20 +0800 Subject: [PATCH 088/111] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9A=84id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/component/VanChartTooltipContentPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index f2c5662307..c4c5fa9f55 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -522,7 +522,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Thu, 21 Jan 2021 16:25:51 +0800 Subject: [PATCH 089/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=A4=9A=E5=B1=82?= =?UTF-8?q?=E9=A5=BC=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartMultiPieLabelContentPane.java | 47 +++++++++++++++---- ...VanChartMultiPieRichTextFieldListPane.java | 41 ++++++++++++++++ .../VanChartMultiPieTooltipContentPane.java | 47 +++++++++++++++---- 3 files changed, 119 insertions(+), 16 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java index 73e766afc0..b62655a263 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java @@ -1,13 +1,21 @@ package com.fr.van.chart.multilayer.style; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; import com.fr.plugin.chart.type.TextAlign; 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.ValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -28,12 +36,35 @@ public class VanChartMultiPieLabelContentPane extends VanChartLabelContentPane { setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new MultiPieLevelNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new MultiPieSeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartMultiPieRichTextFieldListPane(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } + }; + } + + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Level_Name"), + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipMultiLevelNameFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } protected AttrTooltipContent createAttrTooltip() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieRichTextFieldListPane.java new file mode 100644 index 0000000000..2a0aea8194 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieRichTextFieldListPane.java @@ -0,0 +1,41 @@ +package com.fr.van.chart.multilayer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +public class VanChartMultiPieRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartMultiPieRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener fieldListener = getFieldListener(); + + VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Level_Name"), + new AttrTooltipMultiLevelNameFormat(), false, fieldListener); + + VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + new AttrTooltipSeriesFormat(), false, fieldListener); + + VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + new AttrTooltipValueFormat(), false, fieldListener); + + VanChartFieldButton percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Percent"), + new AttrTooltipPercentFormat(), false, fieldListener); + + setCategoryNameButton(categoryNameButton); + setSeriesNameButton(seriesNameButton); + setValueButton(valueButton); + setPercentButton(percentButton); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java index 1fbe0870a5..76d536d5bc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java @@ -1,12 +1,20 @@ package com.fr.van.chart.multilayer.style; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; 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.ValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -27,12 +35,35 @@ public class VanChartMultiPieTooltipContentPane extends VanChartTooltipContentPa setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new MultiPieLevelNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new MultiPieSeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartMultiPieRichTextFieldListPane(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } + }; + } + + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Level_Name"), + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipMultiLevelNameFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } @Override From 22e2d7cb9266795bbbe1fb69d391064a57de4087 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 21 Jan 2021 16:34:43 +0800 Subject: [PATCH 090/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../label/VanChartMapLabelContentPane.java | 20 +++++++++++++++++++ .../VanChartMapTooltipContentPane.java | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java index baec70ca92..ce3e34ba76 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.map.designer.style.label; import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; @@ -14,7 +15,12 @@ import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheck import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.map.designer.style.VanChartMapRichTextFieldListPane; import javax.swing.JPanel; @@ -35,6 +41,20 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane { setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartMapRichTextFieldListPane(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } + }; + } + protected String[] getRichTextFieldNames() { return new String[]{ Toolkit.i18nText("Fine-Design_Chart_Area_Name"), diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java index 03f720bf73..718cfc3584 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.map.designer.style.tooltip; import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; @@ -13,7 +14,12 @@ import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheck import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.map.designer.style.VanChartMapRichTextFieldListPane; import javax.swing.JPanel; @@ -33,6 +39,20 @@ public class VanChartMapTooltipContentPane extends VanChartTooltipContentPane { setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartMapRichTextFieldListPane(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } + }; + } + protected String[] getRichTextFieldNames() { return new String[]{ Toolkit.i18nText("Fine-Design_Chart_Area_Name"), From f29003889f7d59b9ed179b9a27405446c6defce8 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 21 Jan 2021 16:50:58 +0800 Subject: [PATCH 091/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=B5=81=E5=90=91?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartLineMapRichTextFieldListPane.java | 41 ++++++++++++++++ .../VanChartLineMapTooltipContentPane.java | 48 +++++++++++++++---- 2 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapRichTextFieldListPane.java new file mode 100644 index 0000000000..0a1e2bbb6b --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapRichTextFieldListPane.java @@ -0,0 +1,41 @@ +package com.fr.van.chart.map.line; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipStartAndEndNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +public class VanChartLineMapRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartLineMapRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener fieldListener = getFieldListener(); + + VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Start_And_End"), + new AttrTooltipStartAndEndNameFormat(), false, fieldListener); + + VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + new AttrTooltipSeriesFormat(), false, fieldListener); + + VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + new AttrTooltipValueFormat(), false, fieldListener); + + VanChartFieldButton percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Percent"), + new AttrTooltipPercentFormat(), false, fieldListener); + + setCategoryNameButton(categoryNameButton); + setSeriesNameButton(seriesNameButton); + setValueButton(valueButton); + setPercentButton(percentButton); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java index 9dbc696a68..04ab53b6a8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java @@ -1,15 +1,21 @@ package com.fr.van.chart.map.line; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; import com.fr.plugin.chart.base.format.AttrTooltipStartAndEndNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; 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.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -30,12 +36,36 @@ public class VanChartLineMapTooltipContentPane extends VanChartTooltipContentPan setPercentFormatPane(new PercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new StartAndEndNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new PercentFormatPaneWithoutCheckBox(parent, showOnPane)); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartLineMapRichTextFieldListPane(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } + }; + } + + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Start_And_End"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipStartAndEndNameFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } @Override From db2aa5788ec11f0a9d8b10ba3cfc48034e18501a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 21 Jan 2021 19:40:48 +0800 Subject: [PATCH 092/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=BC=8F=E6=96=97?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/VanChartFunnelLabelContentPane.java | 57 +++++++++-------- .../VanChartFunnelRichTextFieldListPane.java | 62 +++++++++++++++++++ .../VanChartFunnelTooltipContentPane.java | 57 +++++++++-------- 3 files changed, 124 insertions(+), 52 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java index a97225d55e..e785b562bc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java @@ -1,18 +1,21 @@ package com.fr.van.chart.funnel.designer.style; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; 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.base.format.AttrTooltipNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.plugin.chart.type.TextAlign; 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.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.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -54,32 +57,34 @@ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane { setPercentFormatPane(new FunnelPercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane)); - } + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { - protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { - VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ - getRichTextSeriesNameFormatPane(), - getRichTextValueFormatPane(), - getRichTextPercentFormatPane() - }; + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartFunnelRichTextFieldListPane(fieldAttrPane, richEditor); + } - AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ - attrTooltipContent.getRichTextSeriesFormat(), - attrTooltipContent.getRichTextValueFormat(), - attrTooltipContent.getRichTextPercentFormat() + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } }; + } - setRichTextAttr(new AttrTooltipRichText()); - populateRichTextFormat(formatPaneGroup, formatGroup); - populateRichText(attrTooltipContent.getRichTextAttr()); + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Value_Conversion") + }; + } - checkRichEditorState(attrTooltipContent); + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipNameFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } protected AttrTooltipContent createAttrTooltip() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRichTextFieldListPane.java new file mode 100644 index 0000000000..c63f112a7c --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRichTextFieldListPane.java @@ -0,0 +1,62 @@ +package com.fr.van.chart.funnel.designer.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartFunnelRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartFunnelRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener fieldListener = getFieldListener(); + + VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), + new AttrTooltipCategoryFormat(), false, fieldListener); + + VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + new AttrTooltipNameFormat(), false, fieldListener); + + VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + new AttrTooltipValueFormat(), false, fieldListener); + + VanChartFieldButton percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Value_Conversion"), + new AttrTooltipPercentFormat(), false, fieldListener); + + setCategoryNameButton(categoryNameButton); + setSeriesNameButton(seriesNameButton); + setValueButton(valueButton); + setPercentButton(percentButton); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(getSeriesNameButton()); + fieldPane.add(getValueButton()); + fieldPane.add(getPercentButton()); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(getSeriesNameButton()); + fieldButtonList.add(getValueButton()); + fieldButtonList.add(getPercentButton()); + + return fieldButtonList; + } + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java index 247194ec40..e15c62e0c2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java @@ -1,17 +1,20 @@ package com.fr.van.chart.funnel.designer.style; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; 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.base.format.AttrTooltipNameFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; 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.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.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -53,32 +56,34 @@ public class VanChartFunnelTooltipContentPane extends VanChartTooltipContentPane setPercentFormatPane(new FunnelPercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextPercentFormatPane(new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane)); - } + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { - protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { - VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ - getRichTextSeriesNameFormatPane(), - getRichTextValueFormatPane(), - getRichTextPercentFormatPane() - }; + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartFunnelRichTextFieldListPane(fieldAttrPane, richEditor); + } - AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ - attrTooltipContent.getRichTextSeriesFormat(), - attrTooltipContent.getRichTextValueFormat(), - attrTooltipContent.getRichTextPercentFormat() + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } }; + } - setRichTextAttr(new AttrTooltipRichText()); - populateRichTextFormat(formatPaneGroup, formatGroup); - populateRichText(attrTooltipContent.getRichTextAttr()); + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Value_Conversion") + }; + } - checkRichEditorState(attrTooltipContent); + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipNameFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } protected AttrTooltipContent createAttrTooltip() { From 7b271caeba1a2d19c15c6fd6e06ab445bd943672 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 21 Jan 2021 20:04:58 +0800 Subject: [PATCH 093/111] =?UTF-8?q?REPORT-43833=20=E3=80=9010.0.14?= =?UTF-8?q?=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5/=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=A2=9E=E5=8A=A0=E9=94=81=E5=AE=9A=20?= =?UTF-8?q?=E5=B0=86=E5=BC=B9=E7=AA=97=E5=85=B3=E9=97=AD=E5=90=8E=E8=A7=A3?= =?UTF-8?q?=E9=94=81=E7=9A=84=E6=93=8D=E4=BD=9C=EF=BC=8C=E6=94=BE=E5=88=B0?= =?UTF-8?q?afterCommit=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/server/GlobalTableDataAction.java | 4 ++-- .../main/java/com/fr/design/os/impl/DatabaseDialogAction.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 44d38db9fe..d41af3205f 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 @@ -103,8 +103,6 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS globalTableDataDialog.setDoOKSucceed(false); return; } - // 关闭服务器数据集页面,为其解锁 - EditLockUtils.unlock(LockItem.SERVER_TABLE_DATA); DesignTableDataManager.clearGlobalDs(); // 保存时 移除服务器数据集列名缓存 for (String name : tableDataConfig.getTableDatas().keySet()) { @@ -128,6 +126,8 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS // 刷新共有数据集 TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); fireDSChanged(globalTableDataPane.getDsChangedNameMap()); + // 关闭服务器数据集页面,为其解锁 + EditLockUtils.unlock(LockItem.SERVER_TABLE_DATA); } })); } diff --git a/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java b/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java index 3d343ab935..ae0f8d1cb5 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java @@ -52,8 +52,6 @@ public class DatabaseDialogAction implements OSBasedAction { databaseListDialog.setDoOKSucceed(false); return; } - // 定义数据连接弹窗关闭后,解锁 - EditLockUtils.unlock(LockItem.CONNECTION); Configurations.modify(new WorkerFacade(ConnectionConfig.class) { @Override public void run() { @@ -69,6 +67,8 @@ public class DatabaseDialogAction implements OSBasedAction { @Override public void afterCommit() { DesignerContext.getDesignerBean("databasename").refreshBeanElement(); + // 定义数据连接弹窗关闭后,解锁 + EditLockUtils.unlock(LockItem.CONNECTION); } })); } From 7cc2ffb8fdb68e1c3621ab48b0dfc5400fd86cb8 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 21 Jan 2021 20:10:13 +0800 Subject: [PATCH 094/111] =?UTF-8?q?REPORT-43833=20=E3=80=9010.0.14?= =?UTF-8?q?=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5/=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=A2=9E=E5=8A=A0=E9=94=81=E5=AE=9A=20?= =?UTF-8?q?=E5=B0=86=E9=80=9A=E7=9F=A5=E7=BB=84=E4=BB=B6=E7=9A=84=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=94=BE=E5=88=B0EDT=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/editlock/EditLockChangeChecker.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java index 13ac921e33..951bea3347 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java @@ -1,6 +1,7 @@ package com.fr.design.editlock; import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.ui.util.UIUtil; import com.fr.log.FineLoggerFactory; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.editlock.EditLockOperator; @@ -60,8 +61,13 @@ public abstract class EditLockChangeChecker { } private void fireChange() { - for (EditLockChangeListener listener : this.listeners) { - listener.updateLockedState(new EditLockChangeEvent(isLocked)); - } + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + for (EditLockChangeListener listener : EditLockChangeChecker.this.listeners) { + listener.updateLockedState(new EditLockChangeEvent(isLocked)); + } + } + }); } } From 43642548e66fa90a094c1361e9a39e12fb04735a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 22 Jan 2021 09:29:14 +0800 Subject: [PATCH 095/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...anChartStructureRichTextFieldListPane.java | 61 ++++++++++++++++++ .../VanChartStructureTooltipContentPane.java | 63 ++++++++----------- 2 files changed, 88 insertions(+), 36 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRichTextFieldListPane.java new file mode 100644 index 0000000000..49f81968cf --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRichTextFieldListPane.java @@ -0,0 +1,61 @@ +package com.fr.van.chart.structure.desinger.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartStructureRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartStructureRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener fieldListener = getFieldListener(); + + VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Node_Name"), + new AttrTooltipMultiLevelNameFormat(), false, fieldListener); + + VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + new AttrTooltipSeriesFormat(), false, fieldListener); + + VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + new AttrTooltipValueFormat(), false, fieldListener); + + VanChartFieldButton percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Percent"), + new AttrTooltipPercentFormat(), false, fieldListener); + + setCategoryNameButton(categoryNameButton); + setSeriesNameButton(seriesNameButton); + setValueButton(valueButton); + setPercentButton(percentButton); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(getCategoryNameButton()); + fieldPane.add(getSeriesNameButton()); + fieldPane.add(getValueButton()); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(getCategoryNameButton()); + fieldButtonList.add(getSeriesNameButton()); + fieldButtonList.add(getValueButton()); + + return fieldButtonList; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java index f5999391f0..f0252fab7a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java @@ -2,20 +2,21 @@ package com.fr.van.chart.structure.desinger.style; import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; 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.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; 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.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.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -70,44 +71,34 @@ public class VanChartStructureTooltipContentPane extends VanChartTooltipContentP setPercentFormatPane(percentFormatPane); } - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Node_Name"); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartStructureRichTextFieldListPane(fieldAttrPane, richEditor); } - }; - SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"); + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); } }; - ValueFormatPaneWithoutCheckBox richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); - PercentFormatPaneWithoutCheckBox richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); - - setRichTextCategoryNameFormatPane(richTextCategoryNameFormatPane); - setRichTextSeriesNameFormatPane(richTextSeriesNameFormatPane); - setRichTextValueFormatPane(richTextValueFormatPane); - setRichTextPercentFormatPane(richTextPercentFormatPane); } - protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { - VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ - getRichTextCategoryNameFormatPane(), - getRichTextSeriesNameFormatPane(), - getRichTextValueFormatPane() + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Node_Name"), + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value") }; + } - AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ - attrTooltipContent.getRichTextCategoryFormat(), - attrTooltipContent.getRichTextSeriesFormat(), - attrTooltipContent.getRichTextValueFormat() + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipMultiLevelNameFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat() }; - - setRichTextAttr(new AttrTooltipRichText()); - populateRichTextFormat(formatPaneGroup, formatGroup); - populateRichText(attrTooltipContent.getRichTextAttr()); - - checkRichEditorState(attrTooltipContent); } @Override From e5585ff488ed78cd428a8a23ba4606243d7a61ea Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 22 Jan 2021 15:16:45 +0800 Subject: [PATCH 096/111] =?UTF-8?q?REPORT-43833=20=E3=80=9010.0.14?= =?UTF-8?q?=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5/=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=A2=9E=E5=8A=A0=E9=94=81=E5=AE=9A=201.=20?= =?UTF-8?q?=E5=B0=86=E6=9C=AC=E5=9C=B0=E5=AE=9E=E7=8E=B0=E4=BD=9C=E4=B8=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=AE=9E=E7=8E=B0=EF=BC=8C=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E8=B5=B7=E6=9D=A5=EF=BC=8C=E4=BB=A5=E5=85=BC=E5=AE=B9=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E8=BF=9E=E6=8E=A5=E8=80=81=E7=89=88=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E7=9A=84=E6=83=85=E5=86=B5=202.=20=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E6=B8=85=E7=90=86=E8=84=8F=E6=95=B0=E6=8D=AE=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=B9=E5=BC=8F=E4=B8=BA=EF=BC=9A=E4=B8=BALockItem?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=88=90?= =?UTF-8?q?=E5=91=98=E5=8F=98=E9=87=8Fbirth=EF=BC=8C=E4=BB=A3=E8=A1=A8?= =?UTF-8?q?=E5=85=B6=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E4=BC=9A=E4=B8=BA=E6=AF=8F=E4=B8=AAClientID=E5=9C=A8?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84=E6=9C=8D=E5=8A=A1=E4=B8=AD=E5=AD=98?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E4=B8=AAkey=3DclientID=EF=BC=8Cvalue=3DLockI?= =?UTF-8?q?tem=E7=9A=84=E9=94=AE=E5=80=BC=E5=AF=B9=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=85=A5=E6=97=B6=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E6=AF=8F=E9=9A=9430s=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=EF=BC=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=99=BB=E5=87=BA=E6=97=B6=E6=B8=85=E9=99=A4=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E5=9C=A8=E8=BD=AE=E8=AF=A2=E4=BB=BB=E5=8A=A1=E4=B8=AD?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=A3=80=E6=9F=A5=E5=BD=93=E5=89=8D=E5=90=84?= =?UTF-8?q?=E4=B8=AALockItem=E5=AF=B9=E5=BA=94=E7=9A=84=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=B8=8B=E8=BF=99=E4=B8=AA=E9=94=AE=E5=80=BC=E5=AF=B9=E9=87=8C?= =?UTF-8?q?value=E7=9A=84birth=E6=98=AF=E5=90=A6=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E5=A6=82=E6=9E=9C=E8=B6=85=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=B8=85=E7=90=86=E8=84=8F=E6=95=B0=E6=8D=AE=203.=20=E5=B0=86?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=BD=BF=E7=94=A8=E7=9A=84applyForService?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAapplyForCleanableService=EF=BC=8C?= =?UTF-8?q?=E4=BE=BF=E4=BA=8E=E9=9B=86=E7=BE=A4=E9=87=8D=E5=90=AF=E6=97=B6?= =?UTF-8?q?=E6=B8=85=E7=90=86=E6=9C=8D=E5=8A=A1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/server/ConnectionListAction.java | 4 +--- .../com/fr/design/actions/server/GlobalTableDataAction.java | 3 +-- .../design/data/datapane/connect/ConnectionComboBoxPanel.java | 2 +- .../com/fr/design/editlock/ConnectionLockChangeChecker.java | 2 +- .../java/com/fr/design/editlock/EditLockChangeChecker.java | 2 +- .../src/main/java/com/fr/design/editlock/EditLockUtils.java | 2 +- .../fr/design/editlock/ServerTableDataLockChangeChecker.java | 2 +- .../src/main/java/com/fr/design/gui/ibutton/UILockButton.java | 2 +- .../src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java | 2 +- .../main/java/com/fr/design/os/impl/DatabaseDialogAction.java | 2 +- 10 files changed, 10 insertions(+), 13 deletions(-) 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 1fd555e829..4742f337cd 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 @@ -8,16 +8,14 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.editlock.ConnectionLockChangeChecker; import com.fr.design.editlock.EditLockUtils; import com.fr.design.gui.NameInspector; -import com.fr.design.gui.ibutton.UILockButton; import com.fr.design.gui.imenu.UILockMenuItem; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.menu.MenuKeySet; -import com.fr.stable.StringUtils; 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.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; import javax.swing.KeyStroke; import java.awt.event.ActionEvent; 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 d41af3205f..ab85a14dc1 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 @@ -22,11 +22,10 @@ import com.fr.design.mainframe.DesignerFrame; import com.fr.design.menu.MenuKeySet; import com.fr.file.TableDataConfig; -import com.fr.stable.StringUtils; import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; import javax.swing.KeyStroke; import java.awt.Dimension; diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index a5ab12ff90..afd65f3e52 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -21,7 +21,7 @@ import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; import com.fr.workspace.WorkContext; import com.fr.workspace.server.connection.DBConnectAuth; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; import javax.swing.SwingUtilities; import java.awt.Dimension; diff --git a/designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java index ac80cd53c2..8eb6a4aa9c 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java +++ b/designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java @@ -1,7 +1,7 @@ package com.fr.design.editlock; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; /** * @author Yvan diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java index 951bea3347..8f276dfe89 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java @@ -5,7 +5,7 @@ import com.fr.design.ui.util.UIUtil; import com.fr.log.FineLoggerFactory; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.editlock.EditLockOperator; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; import java.util.ArrayList; import java.util.List; diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java index baa3543f87..2ab10fb922 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java @@ -8,7 +8,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.general.IOUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.editlock.EditLockOperator; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; import org.jetbrains.annotations.Nullable; import javax.swing.Icon; diff --git a/designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java index a3f2bbbf42..e38a4e940b 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java +++ b/designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java @@ -1,6 +1,6 @@ package com.fr.design.editlock; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; /** * @author Yvan diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java index b5534f6094..77b5516f51 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java @@ -3,7 +3,7 @@ package com.fr.design.gui.ibutton; import com.fr.design.editlock.EditLockChangeEvent; import com.fr.design.editlock.EditLockChangeListener; import com.fr.design.editlock.EditLockUtils; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; import javax.swing.Icon; diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java index 092b765161..c609e5d5c7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java @@ -2,7 +2,7 @@ package com.fr.design.gui.imenu; import com.fr.design.editlock.EditLockChangeEvent; import com.fr.design.editlock.EditLockChangeListener; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; import javax.swing.Action; diff --git a/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java b/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java index ae0f8d1cb5..057b561fa0 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java @@ -11,7 +11,7 @@ import com.fr.stable.os.support.OSBasedAction; import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; -import com.fr.workspace.server.lock.editlock.LockItem; +import com.fr.report.LockItem; import static com.fr.design.actions.server.ConnectionListAction.doWithDatasourceManager; /** From a17002e48fe034bfcf6bb3648aa73fa83076a971 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 22 Jan 2021 15:20:22 +0800 Subject: [PATCH 097/111] =?UTF-8?q?REPORT-44666=20=E5=A4=9A=E5=B1=8F?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=20=E9=83=A8=E5=88=86=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=98=BE=E7=A4=BA=E5=9C=A8=E5=8F=A6=E4=B8=80=E5=9D=97?= =?UTF-8?q?=E5=B1=8F=E5=B9=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 2 +- .../datapane/preview/PreviewTablePane.java | 2 ++ .../gui/controlpane/UIListControlPane.java | 2 +- .../background/image/ExpandFileChooser.java | 3 +++ .../com/fr/design/utils/gui/GUICoreUtils.java | 26 +++++++++++++++++++ 5 files changed, 33 insertions(+), 2 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 2b36bd45f1..c8078777d5 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -437,7 +437,7 @@ public class EnvChangeEntrance { public void chooseEnv(final String envName) { final EnvListPane envListPane = new EnvListPane(); - final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); + final BasicDialog envListDialog = envListPane.showWindow(DesignerContext.getDesignerFrame()); envListPane.populateEnvManager(envName); envListDialog.addDialogActionListener(new DialogActionAdapter() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index d3881bcd12..da87c10f6e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -26,6 +26,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.function.TIME; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; @@ -168,6 +169,7 @@ public class PreviewTablePane extends BasicPane { this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER); if (this.dialog == null) { this.dialog = this.showWindow(new JFrame()); + GUICoreUtils.centerWindow(DesignerContext.getDesignerFrame(), this.dialog); } progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) { public void doMonitorCanceled() { diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index 100daf511b..ec76f5bf79 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -247,7 +247,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon resultPos.x = listPos.x + nameableList.getParent().getWidth(); } // 如果右侧显示不下,可以向左移动 - int maxX = Toolkit.getDefaultToolkit().getScreenSize().width - popupEditDialog.getWidth() - EDIT_RANGE; + int maxX = frame.getLocationOnScreen().x + frame.getWidth() - popupEditDialog.getWidth() - EDIT_RANGE; if (resultPos.x > maxX) { resultPos.x = maxX; } diff --git a/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java b/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java index ca091cf940..ef63716941 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java @@ -5,6 +5,7 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; @@ -19,6 +20,7 @@ import java.awt.Container; import java.awt.Dimension; import java.awt.Insets; import java.awt.LayoutManager; +import java.awt.Rectangle; import java.awt.event.ActionListener; /** @@ -85,6 +87,7 @@ public class ExpandFileChooser extends JFileChooser { @Override public int showDialog(Component parent, String approveButtonText) { dialog.setModal(true); + GUICoreUtils.centerWindow(parent, dialog); dialog.setVisible(true); return retVal; } diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index e6b276437a..d55382c499 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -292,6 +292,24 @@ public final class GUICoreUtils { return button; } + + /** + * 将独立弹窗设置在中间位置 适应多屏 跟随设计器主界面 + * 可从父界面获取弹窗应该所在的矩形范围 + * + * @param parent 独立弹窗的父窗口 + * @param win 弹窗自身 + */ + public static void centerWindow(Component parent, Window win) { + Rectangle rectangle; + if (parent == null) { + rectangle = DesignerContext.getDesignerFrame().getGraphicsConfiguration().getBounds(); + } else { + rectangle = parent.getGraphicsConfiguration().getBounds(); + } + centerWindow(win, rectangle); + } + /** * 设置一个窗口 * @@ -301,7 +319,14 @@ public final class GUICoreUtils { // Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小 // getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标 Rectangle rectangle = win.getGraphicsConfiguration().getBounds(); + centerWindow(win, rectangle); + } + /** + * @param win + * @param rectangle 窗口所在的一个矩形范围 + */ + public static void centerWindow(Window win, Rectangle rectangle) { Dimension screenSize = rectangle.getSize(); Dimension winSize = win.getSize(); @@ -315,6 +340,7 @@ public final class GUICoreUtils { win.setLocation(rectangle.x + (screenSize.width - winSize.width) / 2, rectangle.y + (screenSize.height - winSize.height) / 2 - WINDOW_GAP); } + /** * Gets window/frame to screen center. * @param owerWin 父窗口 From c785ac8c20094cb3fc1a8d1e4011db97042524f3 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 22 Jan 2021 15:32:04 +0800 Subject: [PATCH 098/111] =?UTF-8?q?REPORT-44666=20fix=20=E6=97=A0=E7=94=A8?= =?UTF-8?q?import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/style/background/image/ExpandFileChooser.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java b/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java index ef63716941..768e7dacd8 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java @@ -5,7 +5,6 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; @@ -20,7 +19,6 @@ import java.awt.Container; import java.awt.Dimension; import java.awt.Insets; import java.awt.LayoutManager; -import java.awt.Rectangle; import java.awt.event.ActionListener; /** From 6475734917184e419ea9d31da723540556c4fde7 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 22 Jan 2021 15:47:50 +0800 Subject: [PATCH 099/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E7=94=98=E7=89=B9?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../richText/VanChartFieldAttrPane.java | 52 +++++-- .../richText/VanChartFieldButton.java | 31 +++++ .../richText/VanChartFieldListPane.java | 18 ++- .../VanChartGanttRichTextFieldListPane.java | 107 ++++++++++++++ .../VanChartGanttTooltipContentPane.java | 131 ++++++------------ 5 files changed, 238 insertions(+), 101 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttRichTextFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java index 89c3cd73e4..5cab5485f9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldAttrPane.java @@ -2,11 +2,13 @@ package com.fr.van.chart.designer.component.richText; import com.fr.data.util.function.AbstractDataFunction; import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.style.FormatPane; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; +import com.fr.plugin.chart.base.format.IntervalTimeFormat; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; @@ -21,15 +23,18 @@ import java.text.Format; public class VanChartFieldAttrPane extends JPanel { private FormatPane fieldFormatPane; - private CalculateComboBox fieldDataFunction; + private UIComboBox intervalTimeBox; + private CalculateComboBox dataFunctionBox; + private JPanel formatPane; + private JPanel intervalTimePane; private JPanel fieldFunctionPane; public VanChartFieldAttrPane() { initComponents(); this.setLayout(new BorderLayout()); - this.add(fieldFormatPane, BorderLayout.NORTH); + this.add(formatPane, BorderLayout.NORTH); this.add(fieldFunctionPane, BorderLayout.CENTER); this.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); } @@ -44,28 +49,43 @@ public class VanChartFieldAttrPane extends JPanel { return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, new double[]{d, e}); } }; + intervalTimeBox = new UIComboBox(IntervalTimeFormat.getFormats()); + dataFunctionBox = new CalculateComboBox(); - fieldDataFunction = new CalculateComboBox(); - - Component[][] components = new Component[][]{ + Component[][] intervalTimeComponents = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), intervalTimeBox} + }; + Component[][] dataFunctionComponents = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"), SwingConstants.LEFT), fieldDataFunction} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"), SwingConstants.LEFT), dataFunctionBox} }; - fieldFunctionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{d, e}); - } + intervalTimePane = TableLayout4VanChartHelper.createGapTableLayoutPane(intervalTimeComponents, new double[]{p, p}, new double[]{d, e}); - public void registerFunctionListener(ActionListener listener) { - fieldDataFunction.addActionListener(listener); + formatPane = new JPanel(new BorderLayout()); + formatPane.add(fieldFormatPane, BorderLayout.NORTH); + formatPane.add(intervalTimePane, BorderLayout.CENTER); + + fieldFunctionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(dataFunctionComponents, new double[]{p, p}, new double[]{d, e}); } - public void registerChangeListener(UIObserverListener listener) { + public void registerFormatListener(UIObserverListener listener) { fieldFormatPane.registerChangeListener(listener); + intervalTimeBox.registerChangeListener(listener); } - public void populate(Format format, AbstractDataFunction dataFunction, boolean showDataFunction) { + public void registerFunctionListener(ActionListener listener) { + dataFunctionBox.addActionListener(listener); + } + + public void populate(Format format, IntervalTimeFormat intervalTime, AbstractDataFunction dataFunction, boolean showDataFunction, boolean showIntervalTime) { fieldFormatPane.populateBean(format); - fieldDataFunction.populateBean(dataFunction); + intervalTimeBox.setSelectedItem(intervalTime); + dataFunctionBox.populateBean(dataFunction); + + fieldFormatPane.setVisible(!showIntervalTime); + intervalTimePane.setVisible(showIntervalTime); fieldFunctionPane.setVisible(showDataFunction); } @@ -73,7 +93,11 @@ public class VanChartFieldAttrPane extends JPanel { return fieldFormatPane.update(); } + public IntervalTimeFormat updateIntervalTime() { + return (IntervalTimeFormat) intervalTimeBox.getSelectedItem(); + } + public AbstractDataFunction updateDataFunction() { - return fieldDataFunction.updateBean(); + return dataFunctionBox.updateBean(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java index 74bf770304..1e76d616cc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldButton.java @@ -7,7 +7,9 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.plugin.chart.base.format.AttrTooltipDurationFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.IntervalTimeFormat; import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -33,16 +35,27 @@ public class VanChartFieldButton extends JPanel { private final AttrTooltipFormat tooltipFormat; private final boolean showDataFunction; + private final boolean showIntervalTime; private UIToggleButton fieldButton; private UIButton addButton; private DataFunction dataFunction = new NoneFunction(); + public VanChartFieldButton(String fieldName, AttrTooltipFormat format, VanChartFieldListener listener) { + this(fieldName, format, false, false, listener); + } + public VanChartFieldButton(String fieldName, AttrTooltipFormat format, boolean showDataFunction, VanChartFieldListener listener) { + this(fieldName, format, showDataFunction, false, listener); + } + + public VanChartFieldButton(String fieldName, AttrTooltipFormat format, boolean showDataFunction, boolean showIntervalTime, VanChartFieldListener listener) { this.fieldName = fieldName; this.tooltipFormat = format; + this.showDataFunction = showDataFunction; + this.showIntervalTime = showIntervalTime; this.fieldId = format == null ? StringUtils.EMPTY : format.getFormatJSONKey(); @@ -72,6 +85,20 @@ public class VanChartFieldButton extends JPanel { this.tooltipFormat.setFormat(format); } + public IntervalTimeFormat getIntervalTimeFormat() { + if (tooltipFormat instanceof AttrTooltipDurationFormat) { + return ((AttrTooltipDurationFormat) tooltipFormat).getIntervalTimeFormat(); + } + + return IntervalTimeFormat.DAY; + } + + public void setIntervalTimeFormat(IntervalTimeFormat intervalTime) { + if (tooltipFormat instanceof AttrTooltipDurationFormat) { + ((AttrTooltipDurationFormat) tooltipFormat).setIntervalTimeFormat(intervalTime); + } + } + public DataFunction getDataFunction() { return dataFunction; } @@ -84,6 +111,10 @@ public class VanChartFieldButton extends JPanel { return showDataFunction; } + public boolean isShowIntervalTime() { + return showIntervalTime; + } + public String getFormatJs() { return this.tooltipFormat.getJs(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java index 2d6b4b5790..60a0b1158a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java @@ -11,11 +11,13 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.TableFieldCollection; import com.fr.plugin.chart.base.TableFieldDefinition; import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipDurationFormat; import com.fr.plugin.chart.base.format.AttrTooltipFieldFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.plugin.chart.base.format.IntervalTimeFormat; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.BorderFactory; @@ -242,10 +244,13 @@ public class VanChartFieldListPane extends JPanel { } Format format = fieldButton.getFormat(); + IntervalTimeFormat intervalTime = fieldButton.getIntervalTimeFormat(); AbstractDataFunction dataFunction = (AbstractDataFunction) fieldButton.getDataFunction(); + boolean showDataFunction = fieldButton.isShowDataFunction(); + boolean showIntervalTime = fieldButton.isShowIntervalTime(); - fieldAttrPane.populate(format, dataFunction, showDataFunction); + fieldAttrPane.populate(format, intervalTime, dataFunction, showDataFunction, showIntervalTime); } public void updateFieldFormatPane() { @@ -256,6 +261,7 @@ public class VanChartFieldListPane extends JPanel { } fieldButton.setFormat(fieldAttrPane.updateFormat()); + fieldButton.setIntervalTimeFormat(fieldAttrPane.updateIntervalTime()); fieldButton.setDataFunction(fieldAttrPane.updateDataFunction()); if (tableFieldNameList.contains(fieldName)) { @@ -276,7 +282,7 @@ public class VanChartFieldListPane extends JPanel { } }); - fieldAttrPane.registerChangeListener(new UIObserverListener() { + fieldAttrPane.registerFormatListener(new UIObserverListener() { public void doChange() { fieldListener.updateFieldFormatPane(); } @@ -317,6 +323,10 @@ public class VanChartFieldListPane extends JPanel { button.setEnable(format.isEnable()); button.setFormat(format.getFormat()); + + if (button.isShowIntervalTime() && format instanceof AttrTooltipDurationFormat) { + button.setIntervalTimeFormat(((AttrTooltipDurationFormat) format).getIntervalTimeFormat()); + } } public void populateTableField(AttrTooltipContent tooltipContent) { @@ -378,5 +388,9 @@ public class VanChartFieldListPane extends JPanel { format.setEnable(button.isEnable()); format.setFormat(button.getFormat()); + + if (button.isShowIntervalTime() && format instanceof AttrTooltipDurationFormat) { + ((AttrTooltipDurationFormat) format).setIntervalTimeFormat(button.getIntervalTimeFormat()); + } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttRichTextFieldListPane.java new file mode 100644 index 0000000000..6332c6757a --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttRichTextFieldListPane.java @@ -0,0 +1,107 @@ +package com.fr.van.chart.gantt.designer.style.tooltip; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipDurationFormat; +import com.fr.plugin.chart.base.format.AttrTooltipEndTimeFormat; +import com.fr.plugin.chart.base.format.AttrTooltipProcessesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipProgressFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipStartTimeFormat; +import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartGanttRichTextFieldListPane extends VanChartFieldListPane { + + private VanChartFieldButton richTextProcessesFormatPane; + private VanChartFieldButton richTextStartTimeFormatPane; + private VanChartFieldButton richTextEndTimeFormatPane; + private VanChartFieldButton richTextDurationFormatPane; + private VanChartFieldButton richTextProgressFormatPane; + + public VanChartGanttRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + VanChartFieldListener listener = getFieldListener(); + + richTextProcessesFormatPane = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Project_Name"), + new AttrTooltipProcessesFormat(), false, listener); + + setSeriesNameButton(new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + new AttrTooltipSeriesFormat(), false, listener)); + + richTextStartTimeFormatPane = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Start_Time"), + new AttrTooltipStartTimeFormat(), false, listener); + + richTextEndTimeFormatPane = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_End_Time"), + new AttrTooltipEndTimeFormat(), false, listener); + + richTextDurationFormatPane = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Duration_Time"), + new AttrTooltipDurationFormat(), false, true, listener); + + richTextProgressFormatPane = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Process"), + new AttrTooltipProgressFormat(), false, listener); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(richTextProcessesFormatPane); + fieldPane.add(getSeriesNameButton()); + fieldPane.add(richTextStartTimeFormatPane); + fieldPane.add(richTextEndTimeFormatPane); + fieldPane.add(richTextDurationFormatPane); + fieldPane.add(richTextProgressFormatPane); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(richTextProcessesFormatPane); + fieldButtonList.add(getSeriesNameButton()); + fieldButtonList.add(richTextStartTimeFormatPane); + fieldButtonList.add(richTextEndTimeFormatPane); + fieldButtonList.add(richTextDurationFormatPane); + fieldButtonList.add(richTextProgressFormatPane); + + return fieldButtonList; + } + + public void populateDefaultField(AttrTooltipContent tooltipContent) { + super.populateDefaultField(tooltipContent); + + if (tooltipContent instanceof AttrGanttTooltipContent) { + AttrGanttTooltipContent gantt = (AttrGanttTooltipContent) tooltipContent; + + populateButtonFormat(richTextProcessesFormatPane, gantt.getRichTextProcessesFormat()); + populateButtonFormat(richTextStartTimeFormatPane, gantt.getRichTextStartTimeFormat()); + populateButtonFormat(richTextEndTimeFormatPane, gantt.getRichTextEndTimeFormat()); + populateButtonFormat(richTextDurationFormatPane, gantt.getRichTextDurationFormat()); + populateButtonFormat(richTextProgressFormatPane, gantt.getRichTextProgressFormat()); + } + } + + public void updateDefaultField(AttrTooltipContent tooltipContent) { + super.updateDefaultField(tooltipContent); + + if (tooltipContent instanceof AttrGanttTooltipContent) { + AttrGanttTooltipContent gantt = (AttrGanttTooltipContent) tooltipContent; + + updateButtonFormat(richTextProcessesFormatPane, gantt.getRichTextProcessesFormat()); + updateButtonFormat(richTextStartTimeFormatPane, gantt.getRichTextStartTimeFormat()); + updateButtonFormat(richTextEndTimeFormatPane, gantt.getRichTextEndTimeFormat()); + updateButtonFormat(richTextDurationFormatPane, gantt.getRichTextDurationFormat()); + updateButtonFormat(richTextProgressFormatPane, gantt.getRichTextProgressFormat()); + } + } + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java index d724deff58..6868a0c879 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java @@ -1,10 +1,11 @@ package com.fr.van.chart.gantt.designer.style.tooltip; import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; -import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.base.format.AttrTooltipDurationFormat; import com.fr.plugin.chart.base.format.AttrTooltipEndTimeFormat; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipProcessesFormat; import com.fr.plugin.chart.base.format.AttrTooltipProgressFormat; import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; @@ -12,14 +13,15 @@ import com.fr.plugin.chart.base.format.AttrTooltipStartTimeFormat; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; 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.VanChartFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; import java.awt.Component; -import java.util.Map; /** * Created by hufan on 2017/1/13. @@ -31,12 +33,6 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane private VanChartFormatComBoxWithCheckBox durationFormatPane; private VanChartFormatPaneWithCheckBox progressFormatPane; - private VanChartFormatPaneWithoutCheckBox richTextProcessesFormatPane; - private VanChartDateFormatPaneWithoutCheckBox richTextStartTimeFormatPane; - private VanChartDateFormatPaneWithoutCheckBox richTextEndTimeFormatPane; - private VanChartFormatComBoxWithoutCheckBox richTextDurationFormatPane; - private VanChartFormatPaneWithoutCheckBox richTextProgressFormatPane; - public VanChartGanttTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { super(parent, showOnPane); } @@ -70,28 +66,39 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane }; } - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - richTextProcessesFormatPane = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane){ - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Project_Name"); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartGanttRichTextFieldListPane(fieldAttrPane, richEditor); } - }; - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - richTextStartTimeFormatPane = new VanChartDateFormatPaneWithoutCheckBox(parent, showOnPane){ - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Start_Time"); + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); } }; - richTextEndTimeFormatPane = new VanChartDateFormatPaneWithoutCheckBox(parent, showOnPane){ - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_End_Time"); - } + } + + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Project_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Start_Time"), + Toolkit.i18nText("Fine-Design_Chart_End_Time"), + Toolkit.i18nText("Fine-Design_Chart_Duration_Time"), + Toolkit.i18nText("Fine-Design_Chart_Process") }; - richTextDurationFormatPane = new VanChartFormatComBoxWithoutCheckBox(); - richTextProgressFormatPane = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane){ - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Process"); - } + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipProcessesFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipStartTimeFormat(), + new AttrTooltipEndTimeFormat(), + new AttrTooltipDurationFormat(), + new AttrTooltipProgressFormat() }; } @@ -106,17 +113,6 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane }; } - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{richTextProcessesFormatPane,null}, - new Component[]{getRichTextSeriesNameFormatPane(),null}, - new Component[]{richTextStartTimeFormatPane,null}, - new Component[]{richTextEndTimeFormatPane,null}, - new Component[]{richTextDurationFormatPane, null}, - new Component[]{richTextProgressFormatPane, null} - }; - } - protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p,p}; } @@ -135,43 +131,6 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane } } - protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { - if(attrTooltipContent instanceof AttrGanttTooltipContent){ - setRichTextAttr(new AttrTooltipRichText()); - - AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent; - Map params = getRichTextAttr().getParams(); - - AttrTooltipProcessesFormat processesFormat = ganttTooltipContent.getRichTextProcessesFormat(); - richTextProcessesFormatPane.populate(processesFormat); - richTextProcessesFormatPane.updateFormatParams(params, processesFormat.getJs()); - - AttrTooltipSeriesFormat seriesFormat = ganttTooltipContent.getRichTextSeriesFormat(); - getRichTextSeriesNameFormatPane().populate(seriesFormat); - getRichTextSeriesNameFormatPane().updateFormatParams(params, seriesFormat.getJs()); - - AttrTooltipStartTimeFormat startTimeFormat = ganttTooltipContent.getRichTextStartTimeFormat(); - richTextStartTimeFormatPane.populate(startTimeFormat); - richTextStartTimeFormatPane.updateFormatParams(params, startTimeFormat.getJs()); - - AttrTooltipEndTimeFormat endTimeFormat = ganttTooltipContent.getRichTextEndTimeFormat(); - richTextEndTimeFormatPane.populate(endTimeFormat); - richTextEndTimeFormatPane.updateFormatParams(params, endTimeFormat.getJs()); - - AttrTooltipDurationFormat durationFormat = ganttTooltipContent.getRichTextDurationFormat(); - richTextDurationFormatPane.populate(durationFormat); - richTextDurationFormatPane.updateFormatParams(params, durationFormat.getJs()); - - AttrTooltipProgressFormat progressFormat = ganttTooltipContent.getRichTextProgressFormat(); - richTextProgressFormatPane.populate(progressFormat); - richTextProgressFormatPane.updateFormatParams(params, progressFormat.getJs()); - - populateRichText(attrTooltipContent.getRichTextAttr()); - - checkRichEditorState(attrTooltipContent); - } - } - protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { if (attrTooltipContent instanceof AttrGanttTooltipContent){ AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent; @@ -184,16 +143,18 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane } } - protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { - if(attrTooltipContent instanceof AttrGanttTooltipContent) { - AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent; + protected void updateTooltipFormat(AttrTooltipContent target, AttrTooltipContent source) { + super.updateTooltipFormat(target, source); + + if (target instanceof AttrGanttTooltipContent && source instanceof AttrGanttTooltipContent) { + AttrGanttTooltipContent targetGantt = (AttrGanttTooltipContent) target; + AttrGanttTooltipContent sourceGantt = (AttrGanttTooltipContent) source; - richTextProcessesFormatPane.update(ganttTooltipContent.getRichTextProcessesFormat()); - getRichTextSeriesNameFormatPane().update(ganttTooltipContent.getRichTextSeriesFormat()); - richTextStartTimeFormatPane.update(ganttTooltipContent.getRichTextStartTimeFormat()); - richTextEndTimeFormatPane.update(ganttTooltipContent.getRichTextEndTimeFormat()); - richTextDurationFormatPane.update(ganttTooltipContent.getRichTextDurationFormat()); - richTextProgressFormatPane.update(ganttTooltipContent.getRichTextProgressFormat()); + targetGantt.setRichTextProcessesFormat(sourceGantt.getRichTextProcessesFormat()); + targetGantt.setRichTextStartTimeFormat(sourceGantt.getRichTextStartTimeFormat()); + targetGantt.setRichTextEndTimeFormat(sourceGantt.getRichTextEndTimeFormat()); + targetGantt.setRichTextDurationFormat(sourceGantt.getRichTextDurationFormat()); + targetGantt.setRichTextProgressFormat(sourceGantt.getRichTextProgressFormat()); } } From f6ef56ff9da4a570b123c15aada2718754020e52 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 22 Jan 2021 15:20:22 +0800 Subject: [PATCH 100/111] =?UTF-8?q?REPORT-44666=20=E5=A4=9A=E5=B1=8F?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=20=E9=83=A8=E5=88=86=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=98=BE=E7=A4=BA=E5=9C=A8=E5=8F=A6=E4=B8=80=E5=9D=97?= =?UTF-8?q?=E5=B1=8F=E5=B9=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 2 +- .../datapane/preview/PreviewTablePane.java | 2 ++ .../gui/controlpane/UIListControlPane.java | 2 +- .../background/image/ExpandFileChooser.java | 3 +++ .../com/fr/design/utils/gui/GUICoreUtils.java | 26 +++++++++++++++++++ 5 files changed, 33 insertions(+), 2 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 2b36bd45f1..c8078777d5 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -437,7 +437,7 @@ public class EnvChangeEntrance { public void chooseEnv(final String envName) { final EnvListPane envListPane = new EnvListPane(); - final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); + final BasicDialog envListDialog = envListPane.showWindow(DesignerContext.getDesignerFrame()); envListPane.populateEnvManager(envName); envListDialog.addDialogActionListener(new DialogActionAdapter() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index d3881bcd12..da87c10f6e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -26,6 +26,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.function.TIME; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; @@ -168,6 +169,7 @@ public class PreviewTablePane extends BasicPane { this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER); if (this.dialog == null) { this.dialog = this.showWindow(new JFrame()); + GUICoreUtils.centerWindow(DesignerContext.getDesignerFrame(), this.dialog); } progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) { public void doMonitorCanceled() { diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index 100daf511b..ec76f5bf79 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -247,7 +247,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon resultPos.x = listPos.x + nameableList.getParent().getWidth(); } // 如果右侧显示不下,可以向左移动 - int maxX = Toolkit.getDefaultToolkit().getScreenSize().width - popupEditDialog.getWidth() - EDIT_RANGE; + int maxX = frame.getLocationOnScreen().x + frame.getWidth() - popupEditDialog.getWidth() - EDIT_RANGE; if (resultPos.x > maxX) { resultPos.x = maxX; } diff --git a/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java b/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java index ca091cf940..ef63716941 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java @@ -5,6 +5,7 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; @@ -19,6 +20,7 @@ import java.awt.Container; import java.awt.Dimension; import java.awt.Insets; import java.awt.LayoutManager; +import java.awt.Rectangle; import java.awt.event.ActionListener; /** @@ -85,6 +87,7 @@ public class ExpandFileChooser extends JFileChooser { @Override public int showDialog(Component parent, String approveButtonText) { dialog.setModal(true); + GUICoreUtils.centerWindow(parent, dialog); dialog.setVisible(true); return retVal; } diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index e6b276437a..d55382c499 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -292,6 +292,24 @@ public final class GUICoreUtils { return button; } + + /** + * 将独立弹窗设置在中间位置 适应多屏 跟随设计器主界面 + * 可从父界面获取弹窗应该所在的矩形范围 + * + * @param parent 独立弹窗的父窗口 + * @param win 弹窗自身 + */ + public static void centerWindow(Component parent, Window win) { + Rectangle rectangle; + if (parent == null) { + rectangle = DesignerContext.getDesignerFrame().getGraphicsConfiguration().getBounds(); + } else { + rectangle = parent.getGraphicsConfiguration().getBounds(); + } + centerWindow(win, rectangle); + } + /** * 设置一个窗口 * @@ -301,7 +319,14 @@ public final class GUICoreUtils { // Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小 // getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标 Rectangle rectangle = win.getGraphicsConfiguration().getBounds(); + centerWindow(win, rectangle); + } + /** + * @param win + * @param rectangle 窗口所在的一个矩形范围 + */ + public static void centerWindow(Window win, Rectangle rectangle) { Dimension screenSize = rectangle.getSize(); Dimension winSize = win.getSize(); @@ -315,6 +340,7 @@ public final class GUICoreUtils { win.setLocation(rectangle.x + (screenSize.width - winSize.width) / 2, rectangle.y + (screenSize.height - winSize.height) / 2 - WINDOW_GAP); } + /** * Gets window/frame to screen center. * @param owerWin 父窗口 From a2e63648ad19a8cf3dee7c6b414cf988219be805 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 22 Jan 2021 15:32:04 +0800 Subject: [PATCH 101/111] =?UTF-8?q?REPORT-44666=20fix=20=E6=97=A0=E7=94=A8?= =?UTF-8?q?import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/style/background/image/ExpandFileChooser.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java b/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java index ef63716941..768e7dacd8 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/style/background/image/ExpandFileChooser.java @@ -5,7 +5,6 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; @@ -20,7 +19,6 @@ import java.awt.Container; import java.awt.Dimension; import java.awt.Insets; import java.awt.LayoutManager; -import java.awt.Rectangle; import java.awt.event.ActionListener; /** From 137adaaef28135d7b1b63d4258a5c86a3526af1b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 22 Jan 2021 17:14:50 +0800 Subject: [PATCH 102/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E7=AE=B1=E5=9E=8B?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ChartBoxRichTextDetailedFieldListPane.java | 135 ++++++++++ ...anChartBoxRichTextResultFieldListPane.java | 41 +++ .../box/VanChartBoxTooltipContentPane.java | 234 +++++++----------- 3 files changed, 259 insertions(+), 151 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxRichTextDetailedFieldListPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxRichTextResultFieldListPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxRichTextDetailedFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxRichTextDetailedFieldListPane.java new file mode 100644 index 0000000000..d780a44eb1 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxRichTextDetailedFieldListPane.java @@ -0,0 +1,135 @@ +package com.fr.van.chart.box; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; +import com.fr.plugin.chart.base.format.AttrTooltipDataMaxFormat; +import com.fr.plugin.chart.base.format.AttrTooltipDataMedianFormat; +import com.fr.plugin.chart.base.format.AttrTooltipDataMinFormat; +import com.fr.plugin.chart.base.format.AttrTooltipDataNumberFormat; +import com.fr.plugin.chart.base.format.AttrTooltipDataOutlierFormat; +import com.fr.plugin.chart.base.format.AttrTooltipDataQ1Format; +import com.fr.plugin.chart.base.format.AttrTooltipDataQ3Format; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartBoxRichTextDetailedFieldListPane extends VanChartFieldListPane { + + private VanChartFieldButton richTextNumber; + private VanChartFieldButton richTextMax; + private VanChartFieldButton richTextQ3; + private VanChartFieldButton richTextMedian; + private VanChartFieldButton richTextQ1; + private VanChartFieldButton richTextMin; + private VanChartFieldButton richTextOutlier; + + public VanChartBoxRichTextDetailedFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + public VanChartFieldButton getRichTextMax() { + return richTextMax; + } + + public VanChartFieldButton getRichTextQ3() { + return richTextQ3; + } + + public VanChartFieldButton getRichTextMedian() { + return richTextMedian; + } + + public VanChartFieldButton getRichTextQ1() { + return richTextQ1; + } + + public VanChartFieldButton getRichTextMin() { + return richTextMin; + } + + protected void initDefaultFieldButton() { + VanChartFieldListener listener = getFieldListener(); + + setCategoryNameButton(new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), new AttrTooltipCategoryFormat(), listener)); + setSeriesNameButton(new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Series_Name"), new AttrTooltipSeriesFormat(), listener)); + + richTextNumber = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Data_Number"), new AttrTooltipDataNumberFormat(), listener); + richTextMax = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Max_Value"), new AttrTooltipDataMaxFormat(), listener); + richTextQ3 = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Data_Q3"), new AttrTooltipDataQ3Format(), listener); + richTextMedian = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Data_Median"), new AttrTooltipDataMedianFormat(), listener); + richTextQ1 = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Data_Q1"), new AttrTooltipDataQ1Format(), listener); + richTextMin = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Min_Value"), new AttrTooltipDataMinFormat(), listener); + richTextOutlier = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Outlier_Value"), new AttrTooltipDataOutlierFormat(), listener); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(getCategoryNameButton()); + fieldPane.add(getSeriesNameButton()); + fieldPane.add(richTextNumber); + fieldPane.add(richTextMax); + fieldPane.add(richTextQ3); + fieldPane.add(richTextMedian); + fieldPane.add(richTextQ1); + fieldPane.add(richTextMin); + fieldPane.add(richTextOutlier); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(getCategoryNameButton()); + fieldButtonList.add(getSeriesNameButton()); + fieldButtonList.add(richTextNumber); + fieldButtonList.add(richTextMax); + fieldButtonList.add(richTextQ3); + fieldButtonList.add(richTextMedian); + fieldButtonList.add(richTextQ1); + fieldButtonList.add(richTextMin); + fieldButtonList.add(richTextOutlier); + + return fieldButtonList; + } + + public void populateDefaultField(AttrTooltipContent tooltipContent) { + super.populateDefaultField(tooltipContent); + + if (tooltipContent instanceof AttrBoxTooltipContent) { + AttrBoxTooltipContent box = (AttrBoxTooltipContent) tooltipContent; + + populateButtonFormat(richTextNumber, box.getRichTextNumber()); + populateButtonFormat(richTextMax, box.getRichTextMax()); + populateButtonFormat(richTextQ3, box.getRichTextQ3()); + populateButtonFormat(richTextMedian, box.getRichTextMedian()); + populateButtonFormat(richTextQ1, box.getRichTextQ1()); + populateButtonFormat(richTextMin, box.getRichTextMin()); + populateButtonFormat(richTextOutlier, box.getRichTextOutlier()); + } + } + + public void updateDefaultField(AttrTooltipContent tooltipContent) { + super.updateDefaultField(tooltipContent); + + if (tooltipContent instanceof AttrBoxTooltipContent) { + AttrBoxTooltipContent box = (AttrBoxTooltipContent) tooltipContent; + + updateButtonFormat(richTextNumber, box.getRichTextNumber()); + updateButtonFormat(richTextMax, box.getRichTextMax()); + updateButtonFormat(richTextQ3, box.getRichTextQ3()); + updateButtonFormat(richTextMedian, box.getRichTextMedian()); + updateButtonFormat(richTextQ1, box.getRichTextQ1()); + updateButtonFormat(richTextMin, box.getRichTextMin()); + updateButtonFormat(richTextOutlier, box.getRichTextOutlier()); + } + } + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxRichTextResultFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxRichTextResultFieldListPane.java new file mode 100644 index 0000000000..9816967ff0 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxRichTextResultFieldListPane.java @@ -0,0 +1,41 @@ +package com.fr.van.chart.box; + +import com.fr.design.ui.ModernUIPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartBoxRichTextResultFieldListPane extends VanChartBoxRichTextDetailedFieldListPane { + + public VanChartBoxRichTextResultFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(getCategoryNameButton()); + fieldPane.add(getSeriesNameButton()); + fieldPane.add(getRichTextMax()); + fieldPane.add(getRichTextQ3()); + fieldPane.add(getRichTextMedian()); + fieldPane.add(getRichTextQ1()); + fieldPane.add(getRichTextMin()); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(getCategoryNameButton()); + fieldButtonList.add(getSeriesNameButton()); + fieldButtonList.add(getRichTextMax()); + fieldButtonList.add(getRichTextQ3()); + fieldButtonList.add(getRichTextMedian()); + fieldButtonList.add(getRichTextQ1()); + fieldButtonList.add(getRichTextMin()); + + return fieldButtonList; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 25eb587d87..64501bd9a4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -4,8 +4,8 @@ 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.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; -import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; import com.fr.plugin.chart.base.format.AttrTooltipDataMaxFormat; import com.fr.plugin.chart.base.format.AttrTooltipDataMedianFormat; @@ -25,12 +25,15 @@ import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckB import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.util.Map; public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { @@ -55,9 +58,6 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { private JPanel dataNumberPane; private JPanel dataOutlierPane; - private JPanel richTextNumberPane; - private JPanel richTextOutlierPane; - public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) { super(parent, showOnPane); checkFormatVisible(isDetailed); @@ -155,14 +155,74 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { return commonPanel; } - protected JPanel createRichFormatPanel() { - JPanel richFormatPanel = new JPanel(new BorderLayout()); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + if (detailed) { + return new VanChartBoxRichTextDetailedFieldListPane(fieldAttrPane, richEditor); + } + + return new VanChartBoxRichTextResultFieldListPane(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } + }; + } + + protected String[] getRichTextFieldNames() { + if (detailed) { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Data_Number"), + Toolkit.i18nText("Fine-Design_Chart_Max_Value"), + Toolkit.i18nText("Fine-Design_Chart_Data_Q3"), + Toolkit.i18nText("Fine-Design_Chart_Data_Median"), + Toolkit.i18nText("Fine-Design_Chart_Data_Q1"), + Toolkit.i18nText("Fine-Design_Chart_Min_Value"), + Toolkit.i18nText("Fine-Design_Chart_Outlier_Value") + }; + } + + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Max_Value"), + Toolkit.i18nText("Fine-Design_Chart_Data_Q3"), + Toolkit.i18nText("Fine-Design_Chart_Data_Median"), + Toolkit.i18nText("Fine-Design_Chart_Data_Q1"), + Toolkit.i18nText("Fine-Design_Chart_Min_Value") + }; + } - richFormatPanel.add(createRichTextCateAndSeriesPane(), BorderLayout.NORTH); - richFormatPanel.add(createRichTextDataNumberPane(), BorderLayout.CENTER); - richFormatPanel.add(createRichTextDataDetailPane(), BorderLayout.SOUTH); + protected AttrTooltipFormat[] getRichTextFieldFormats() { + if (detailed) { + return new AttrTooltipFormat[]{ + new AttrTooltipCategoryFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipDataNumberFormat(), + new AttrTooltipDataMaxFormat(), + new AttrTooltipDataQ3Format(), + new AttrTooltipDataMedianFormat(), + new AttrTooltipDataQ1Format(), + new AttrTooltipDataMinFormat(), + new AttrTooltipDataOutlierFormat() + }; + } - return richFormatPanel; + return new AttrTooltipFormat[]{ + new AttrTooltipCategoryFormat(), + new AttrTooltipSeriesFormat(), + new AttrTooltipDataMaxFormat(), + new AttrTooltipDataQ3Format(), + new AttrTooltipDataMedianFormat(), + new AttrTooltipDataQ1Format(), + new AttrTooltipDataMinFormat() + }; } protected Component[][] getRichTextComponents() { @@ -249,72 +309,6 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { return detailPane; } - private JPanel createRichTextCateAndSeriesPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p}; - - Component[][] cateAndSeries = new Component[][]{ - new Component[]{null, null}, - new Component[]{null, getRichTextCategoryNameFormatPane()}, - new Component[]{null, getRichTextSeriesNameFormatPane()} - }; - - return TableLayoutHelper.createTableLayoutPane(cateAndSeries, rowSize, columnSize); - } - - private JPanel createRichTextDataNumberPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; - - Component[][] dataNumber = new Component[][]{ - new Component[]{null, null}, - new Component[]{null, richTextNumber}, - }; - - richTextNumberPane = TableLayoutHelper.createTableLayoutPane(dataNumber, rowSize, columnSize); - - return richTextNumberPane; - } - - private JPanel createRichTextDataDetailPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - - double[] columnSize = {f, e}; - - JPanel detailPane = new JPanel(new BorderLayout()); - - Component[][] richTextDetail = new Component[][]{ - new Component[]{null, null}, - new Component[]{null, richTextMax}, - new Component[]{new UILabel(getLabelContentTitle()), richTextQ3}, - new Component[]{null, richTextMedian}, - new Component[]{null, richTextQ1}, - new Component[]{null, richTextMin} - }; - - Component[][] dataOutlier = new Component[][]{ - new Component[]{null, null}, - new Component[]{null, richTextOutlier}, - }; - - richTextOutlierPane = TableLayoutHelper.createTableLayoutPane(dataOutlier, new double[]{p, p}, columnSize); - - detailPane.add(TableLayoutHelper.createTableLayoutPane(richTextDetail, new double[]{p, p, p, p, p, p}, columnSize), BorderLayout.NORTH); - detailPane.add(richTextOutlierPane, BorderLayout.CENTER); - - return detailPane; - } - public boolean isDirty() { return getCategoryNameFormatPane().isDirty() || getSeriesNameFormatPane().isDirty() @@ -362,63 +356,21 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } } - protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { - setRichTextAttr(new AttrTooltipRichText()); - Map params = getRichTextAttr().getParams(); - - AttrTooltipCategoryFormat categoryFormat = attrTooltipContent.getRichTextCategoryFormat(); - getRichTextCategoryNameFormatPane().populate(categoryFormat); - getRichTextCategoryNameFormatPane().updateFormatParams(params, categoryFormat.getJs()); - - AttrTooltipSeriesFormat seriesFormat = attrTooltipContent.getRichTextSeriesFormat(); - getRichTextSeriesNameFormatPane().populate(seriesFormat); - getRichTextSeriesNameFormatPane().updateFormatParams(params, seriesFormat.getJs()); - - if (attrTooltipContent instanceof AttrBoxTooltipContent) { - AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; - - VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = getFormatPaneGroup(); - AttrTooltipFormat[] formatGroup = getFormatGroup(boxTooltipContent); - - populateRichTextFormat(formatPaneGroup, formatGroup); - populateRichText(attrTooltipContent.getRichTextAttr()); - - checkRichEditorState(attrTooltipContent); - } - } - - private VanChartFormatPaneWithoutCheckBox[] getFormatPaneGroup() { - if (detailed) { - return new VanChartFormatPaneWithoutCheckBox[]{ - richTextNumber, richTextMax, richTextQ3, richTextMedian, - richTextQ1, richTextMin, richTextOutlier - }; - } - - return new VanChartFormatPaneWithoutCheckBox[]{ - richTextMax, richTextQ3, richTextMedian, richTextQ1, richTextMin - }; - } + protected void updateTooltipFormat(AttrTooltipContent target, AttrTooltipContent source) { + super.updateTooltipFormat(target, source); - private AttrTooltipFormat[] getFormatGroup(AttrBoxTooltipContent boxTooltipContent) { - AttrTooltipDataNumberFormat richTextNumber = boxTooltipContent.getRichTextNumber(); - AttrTooltipDataMaxFormat richTextMaxFormat = boxTooltipContent.getRichTextMax(); - AttrTooltipDataQ3Format richTextQ3Format = boxTooltipContent.getRichTextQ3(); - AttrTooltipDataMedianFormat richTextMedianFormat = boxTooltipContent.getRichTextMedian(); - AttrTooltipDataQ1Format richTextQ1Format = boxTooltipContent.getRichTextQ1(); - AttrTooltipDataMinFormat richTextMinFormat = boxTooltipContent.getRichTextMin(); - AttrTooltipDataOutlierFormat richTextOutlierFormat = boxTooltipContent.getRichTextOutlier(); + if (target instanceof AttrBoxTooltipContent && source instanceof AttrBoxTooltipContent) { + AttrBoxTooltipContent targetGantt = (AttrBoxTooltipContent) target; + AttrBoxTooltipContent sourceGantt = (AttrBoxTooltipContent) source; - if (detailed) { - return new AttrTooltipFormat[]{ - richTextNumber, richTextMaxFormat, richTextQ3Format, richTextMedianFormat, - richTextQ1Format, richTextMinFormat, richTextOutlierFormat - }; + targetGantt.setRichTextNumber(sourceGantt.getRichTextNumber()); + targetGantt.setRichTextMax(sourceGantt.getRichTextMax()); + targetGantt.setRichTextQ3(sourceGantt.getRichTextQ3()); + targetGantt.setRichTextMedian(sourceGantt.getRichTextMedian()); + targetGantt.setRichTextQ1(sourceGantt.getRichTextQ1()); + targetGantt.setRichTextMin(sourceGantt.getRichTextMin()); + targetGantt.setRichTextOutlier(sourceGantt.getRichTextOutlier()); } - - return new AttrTooltipFormat[]{ - richTextMaxFormat, richTextQ3Format, richTextMedianFormat, richTextQ1Format, richTextMinFormat - }; } protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { @@ -440,30 +392,10 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } } - protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { - getRichTextCategoryNameFormatPane().update(attrTooltipContent.getRichTextCategoryFormat()); - getRichTextSeriesNameFormatPane().update(attrTooltipContent.getRichTextSeriesFormat()); - - if (attrTooltipContent instanceof AttrBoxTooltipContent) { - AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; - - richTextNumber.update(boxTooltipContent.getRichTextNumber()); - richTextMax.update(boxTooltipContent.getRichTextMax()); - richTextQ3.update(boxTooltipContent.getRichTextQ3()); - richTextMedian.update(boxTooltipContent.getRichTextMedian()); - richTextQ1.update(boxTooltipContent.getRichTextQ1()); - richTextMin.update(boxTooltipContent.getRichTextMin()); - richTextOutlier.update(boxTooltipContent.getRichTextOutlier()); - } - } - public void checkFormatVisible(boolean detailed) { this.detailed = detailed; dataNumberPane.setVisible(detailed); dataOutlierPane.setVisible(detailed); - - richTextNumberPane.setVisible(detailed); - richTextOutlierPane.setVisible(detailed); } } From af29f516ef6e45e286b7aedcd55e60e6897f4a22 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 24 Jan 2021 16:14:15 +0800 Subject: [PATCH 103/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E9=A5=BC=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartPieCategoryLabelContentPane.java | 80 ++++++++++--------- ...ChartPieCategoryRichTextFieldListPane.java | 66 +++++++++++++++ .../VanChartPieValueLabelContentPane.java | 47 +++++++++-- ...VanChartPieValueRichTextFieldListPane.java | 34 ++++++++ ...ChartScatterRefreshTooltipContentPane.java | 21 ----- 5 files changed, 180 insertions(+), 68 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryRichTextFieldListPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueRichTextFieldListPane.java 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 index e5b55d7491..73c63bbeec 100644 --- 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 @@ -1,16 +1,20 @@ package com.fr.van.chart.pie.style; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; +import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; -import com.fr.plugin.chart.base.AttrTooltipRichText; +import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSummaryValueFormat; 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.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -25,8 +29,6 @@ public class VanChartPieCategoryLabelContentPane extends VanChartLabelContentPan private SummaryValueFormatPaneWithCheckBox summaryValueFormatPane; - private SummaryValueFormatPaneWithoutCheckBox richTextSummaryValueFormatPane; - public VanChartPieCategoryLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { super(parent, showOnPane, inCondition); } @@ -42,25 +44,39 @@ public class VanChartPieCategoryLabelContentPane extends VanChartLabelContentPan summaryValueFormatPane = new SummaryValueFormatPaneWithCheckBox(parent, showOnPane); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); - richTextSummaryValueFormatPane = new SummaryValueFormatPaneWithoutCheckBox(parent, showOnPane); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartPieCategoryRichTextFieldListPane(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } + }; } - @Override - protected Component[][] getPaneComponents() { - return new Component[][]{ - new Component[]{getCategoryNameFormatPane(), null}, - new Component[]{summaryValueFormatPane, null}, + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Summary_Value") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipCategoryFormat(), + new AttrTooltipSummaryValueFormat() }; } @Override - protected Component[][] getRichTextComponents() { + protected Component[][] getPaneComponents() { return new Component[][]{ - new Component[]{getRichTextCategoryNameFormatPane(), null}, - new Component[]{richTextSummaryValueFormatPane, null}, + new Component[]{getCategoryNameFormatPane(), null}, + new Component[]{summaryValueFormatPane, null}, }; } @@ -81,23 +97,15 @@ public class VanChartPieCategoryLabelContentPane extends VanChartLabelContentPan 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() - }; + protected void updateTooltipFormat(AttrTooltipContent target, AttrTooltipContent source) { + super.updateTooltipFormat(target, source); - setRichTextAttr(new AttrTooltipRichText()); - populateRichTextFormat(formatPaneGroup, formatGroup); - populateRichText(pieCategoryLabelContent.getRichTextAttr()); + if (target instanceof PieCategoryLabelContent && source instanceof PieCategoryLabelContent) { + PieCategoryLabelContent targetPieCategory = (PieCategoryLabelContent) target; + PieCategoryLabelContent sourcePieCategory = (PieCategoryLabelContent) source; - checkRichEditorState(pieCategoryLabelContent); + targetPieCategory.setRichTextSummaryValueFormat(sourcePieCategory.getRichTextSummaryValueFormat()); + } } @Override @@ -107,12 +115,6 @@ public class VanChartPieCategoryLabelContentPane extends VanChartLabelContentPan 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); diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryRichTextFieldListPane.java new file mode 100644 index 0000000000..deb62c01c9 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryRichTextFieldListPane.java @@ -0,0 +1,66 @@ +package com.fr.van.chart.pie.style; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipSummaryValueFormat; +import com.fr.plugin.chart.pie.attr.PieCategoryLabelContent; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartPieCategoryRichTextFieldListPane extends VanChartFieldListPane { + + private VanChartFieldButton summaryValueButton; + + public VanChartPieCategoryRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void initDefaultFieldButton() { + super.initDefaultFieldButton(); + + VanChartFieldListener listener = getFieldListener(); + + summaryValueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Summary_Value"), + new AttrTooltipSummaryValueFormat(), false, listener); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(getCategoryNameButton()); + fieldPane.add(summaryValueButton); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(getCategoryNameButton()); + fieldButtonList.add(summaryValueButton); + + return fieldButtonList; + } + + public void populateDefaultField(AttrTooltipContent tooltipContent) { + super.populateDefaultField(tooltipContent); + + if (tooltipContent instanceof PieCategoryLabelContent) { + PieCategoryLabelContent pieCategory = (PieCategoryLabelContent) tooltipContent; + populateButtonFormat(summaryValueButton, pieCategory.getRichTextSummaryValueFormat()); + } + } + + public void updateDefaultField(AttrTooltipContent tooltipContent) { + super.updateDefaultField(tooltipContent); + + if (tooltipContent instanceof PieCategoryLabelContent) { + PieCategoryLabelContent pieCategory = (PieCategoryLabelContent) tooltipContent; + updateButtonFormat(summaryValueButton, pieCategory.getRichTextSummaryValueFormat()); + } + } +} 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 index ddc6e66313..6fdc4e584f 100644 --- 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 @@ -1,12 +1,20 @@ package com.fr.van.chart.pie.style; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; 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.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; +import com.fr.van.chart.designer.component.richText.VanChartRichTextPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -35,11 +43,34 @@ public class VanChartPieValueLabelContentPane extends VanChartLabelContentPane { 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)); + protected VanChartRichTextPane createRichTextPane(ModernUIPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartPieValueRichTextFieldListPane(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } + }; + } + + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") + }; + } + + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipSeriesFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() + }; } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueRichTextFieldListPane.java new file mode 100644 index 0000000000..072b3a8012 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieValueRichTextFieldListPane.java @@ -0,0 +1,34 @@ +package com.fr.van.chart.pie.style; + +import com.fr.design.ui.ModernUIPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartPieValueRichTextFieldListPane extends VanChartFieldListPane { + + public VanChartPieValueRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(getSeriesNameButton()); + fieldPane.add(getValueButton()); + fieldPane.add(getPercentButton()); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(getSeriesNameButton()); + fieldButtonList.add(getValueButton()); + fieldButtonList.add(getPercentButton()); + + return fieldButtonList; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java index e5416b1c21..742df96340 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java @@ -77,27 +77,6 @@ public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterToo } } - protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { - super.populateRichEditor(attrTooltipContent); - - if (attrTooltipContent instanceof ScatterAttrTooltipContent) { - ScatterAttrTooltipContent scatterAttrTooltipContent = (ScatterAttrTooltipContent) attrTooltipContent; - - VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ - richTextChangedSizeFormatPane, - getRichTextChangedPercentFormatPane() - }; - - AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ - scatterAttrTooltipContent.getRichTextChangeSizeFormat(), - scatterAttrTooltipContent.getRichTextChangedSizePercentFormat() - }; - - populateRichTextFormat(formatPaneGroup, formatGroup); - populateRichText(attrTooltipContent.getRichTextAttr()); - } - } - @Override protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { super.updateFormatPane(attrTooltipContent); From 0e48e287219beae43059fa54ce6b53c67cc26b29 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 24 Jan 2021 21:49:45 +0800 Subject: [PATCH 104/111] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=EF=BC=8C=E6=B8=85=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../box/VanChartBoxTooltipContentPane.java | 66 ------------- .../VanChartRefreshTooltipContentPane.java | 22 ----- .../component/VanChartTooltipContentPane.java | 99 ------------------- ...efreshTooltipContentPaneWithOutSeries.java | 18 ---- .../TooltipContentPaneWithOutSeries.java | 53 +++++----- .../VanChartFieldListPaneWithOutSeries.java | 34 +++++++ .../style/VanChartFunnelLabelContentPane.java | 8 -- ...nChartFunnelRefreshTooltipContentPane.java | 18 ---- .../VanChartFunnelTooltipContentPane.java | 8 -- .../VanChartMapRefreshTooltipContentPane.java | 21 ---- ...ChartMutiPieRefreshTooltipContentPane.java | 20 ---- .../VanChartPieValueLabelContentPane.java | 9 -- ...ChartScatterRefreshTooltipContentPane.java | 29 ------ ...artStructureRefreshTooltipContentPane.java | 22 ----- .../VanChartStructureTooltipContentPane.java | 9 -- ...artWordCloudRefreshTooltipContentPane.java | 28 ------ 16 files changed, 65 insertions(+), 399 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/VanChartFieldListPaneWithOutSeries.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 64501bd9a4..4e7a657d6b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -20,11 +20,8 @@ import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; 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.SeriesNameFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; @@ -47,14 +44,6 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { private VanChartFormatPaneWithCheckBox min; private VanChartFormatPaneWithCheckBox outlier; - private VanChartFormatPaneWithoutCheckBox richTextNumber; - private VanChartFormatPaneWithoutCheckBox richTextMax; - private VanChartFormatPaneWithoutCheckBox richTextQ3; - private VanChartFormatPaneWithoutCheckBox richTextMedian; - private VanChartFormatPaneWithoutCheckBox richTextQ1; - private VanChartFormatPaneWithoutCheckBox richTextMin; - private VanChartFormatPaneWithoutCheckBox richTextOutlier; - private JPanel dataNumberPane; private JPanel dataOutlierPane; @@ -104,47 +93,6 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { }; } - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane)); - - richTextNumber = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Data_Number"); - } - }; - richTextMax = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Max_Value"); - } - }; - richTextQ3 = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Data_Q3"); - } - }; - richTextMedian = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Data_Median"); - } - }; - richTextQ1 = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Data_Q1"); - } - }; - richTextMin = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Min_Value"); - } - }; - richTextOutlier = new VanChartFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Outlier_Value"); - } - }; - } - protected JPanel createCommonFormatPanel() { JPanel commonPanel = new JPanel(new BorderLayout()); @@ -225,20 +173,6 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { }; } - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextCategoryNameFormatPane(), null}, - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{richTextNumber, null}, - new Component[]{richTextMax, null}, - new Component[]{richTextQ3, null}, - new Component[]{richTextMedian, null}, - new Component[]{richTextQ1, null}, - new Component[]{richTextMin, null}, - new Component[]{richTextOutlier, null} - }; - } - protected double[] getRowSize(double p) { return new double[]{p, p, p, p, p, p, p, p, p, p, p, p}; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java index 7ecb797d6a..93ef147617 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java @@ -1,9 +1,7 @@ package com.fr.van.chart.designer.component; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -34,14 +32,6 @@ public class VanChartRefreshTooltipContentPane extends VanChartTooltipContentPan setChangedPercentFormatPane(new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initRichTextFormatPane(parent, showOnPane); - - setRichTextChangedValueFormatPane(new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextChangedPercentFormatPane(new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane)); - } - protected Component[][] getPaneComponents(){ return new Component[][]{ new Component[]{getCategoryNameFormatPane(), null}, @@ -52,16 +42,4 @@ public class VanChartRefreshTooltipContentPane extends VanChartTooltipContentPan new Component[]{getChangedPercentFormatPane(), null}, }; } - - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextCategoryNameFormatPane(), null}, - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null}, - new Component[]{getRichTextChangedValueFormatPane(), null}, - new Component[]{getRichTextPercentFormatPane(), null}, - new Component[]{getRichTextChangedPercentFormatPane(), null} - }; - } - } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index c4c5fa9f55..7b22b02c87 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -24,17 +24,11 @@ import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; 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.ChangedPercentFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; 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.component.format.VanChartFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; @@ -84,13 +78,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane getContent() { return content; } @@ -558,13 +496,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane richEditorPane) { + + return new VanChartRichTextPane(richEditorPane) { + + protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditor) { + return new VanChartFieldListPaneWithOutSeries(fieldAttrPane, richEditor); + } + + protected AttrTooltipContent getInitialTooltipContent() { + return createAttrTooltip(); + } }; } - protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { - VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ - getRichTextCategoryNameFormatPane(), - getRichTextValueFormatPane(), - getRichTextPercentFormatPane() + protected String[] getRichTextFieldNames() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Use_Percent") }; + } - AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ - attrTooltipContent.getRichTextCategoryFormat(), - attrTooltipContent.getRichTextValueFormat(), - attrTooltipContent.getRichTextPercentFormat() + protected AttrTooltipFormat[] getRichTextFieldFormats() { + return new AttrTooltipFormat[]{ + new AttrTooltipCategoryFormat(), + new AttrTooltipValueFormat(), + new AttrTooltipPercentFormat() }; - - setRichTextAttr(new AttrTooltipRichText()); - populateRichTextFormat(formatPaneGroup, formatGroup); - populateRichText(attrTooltipContent.getRichTextAttr()); - - checkRichEditorState(attrTooltipContent); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/VanChartFieldListPaneWithOutSeries.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/VanChartFieldListPaneWithOutSeries.java new file mode 100644 index 0000000000..c651dbf891 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/VanChartFieldListPaneWithOutSeries.java @@ -0,0 +1,34 @@ +package com.fr.van.chart.designer.component.tooltip; + +import com.fr.design.ui.ModernUIPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldButton; +import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; + +import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; + +public class VanChartFieldListPaneWithOutSeries extends VanChartFieldListPane { + + public VanChartFieldListPaneWithOutSeries(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { + super(fieldAttrPane, richEditorPane); + } + + protected void addDefaultFieldButton(JPanel fieldPane) { + fieldPane.add(getCategoryNameButton()); + fieldPane.add(getValueButton()); + fieldPane.add(getPercentButton()); + } + + protected List getDefaultFieldButtonList() { + List fieldButtonList = new ArrayList<>(); + + fieldButtonList.add(getCategoryNameButton()); + fieldButtonList.add(getValueButton()); + fieldButtonList.add(getPercentButton()); + + return fieldButtonList; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java index e785b562bc..55c3e3e78e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java @@ -41,14 +41,6 @@ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane { }; } - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null}, - new Component[]{getRichTextPercentFormatPane(), null} - }; - } - @Override protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { setCategoryNameFormatPane(new CategoryNameFormatPaneWithCheckBox(parent, showOnPane)); diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java index b7f817eb3c..bb3b8bea30 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java @@ -29,14 +29,6 @@ public class VanChartFunnelRefreshTooltipContentPane extends VanChartFunnelToolt setChangedPercentFormatPane(new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initRichTextFormatPane(parent, showOnPane); - - setRichTextChangedValueFormatPane(new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextChangedPercentFormatPane(new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane)); - } - protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p}; } @@ -50,14 +42,4 @@ public class VanChartFunnelRefreshTooltipContentPane extends VanChartFunnelToolt new Component[]{getChangedPercentFormatPane(), null}, }; } - - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null}, - new Component[]{getRichTextChangedValueFormatPane(), null}, - new Component[]{getRichTextPercentFormatPane(), null}, - new Component[]{getRichTextChangedPercentFormatPane(), null} - }; - } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java index e15c62e0c2..e8c741b14c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java @@ -40,14 +40,6 @@ public class VanChartFunnelTooltipContentPane extends VanChartTooltipContentPane }; } - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null}, - new Component[]{getRichTextPercentFormatPane(), null} - }; - } - @Override protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { setCategoryNameFormatPane(new CategoryNameFormatPaneWithCheckBox(parent, showOnPane)); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java index 7dca0fb3bc..dff8a04d51 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java @@ -3,9 +3,7 @@ package com.fr.van.chart.map.designer.style.tooltip; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -35,14 +33,6 @@ public class VanChartMapRefreshTooltipContentPane extends VanChartMapTooltipCont setChangedPercentFormatPane(new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initRichTextFormatPane(parent, showOnPane); - - setRichTextChangedValueFormatPane(new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextChangedPercentFormatPane(new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane)); - } - protected Component[][] getPaneComponents(){ return new Component[][]{ new Component[]{getCategoryNameFormatPane(), null}, @@ -54,17 +44,6 @@ public class VanChartMapRefreshTooltipContentPane extends VanChartMapTooltipCont }; } - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextCategoryNameFormatPane(), null}, - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null}, - new Component[]{getRichTextChangedValueFormatPane(), null}, - new Component[]{getRichTextPercentFormatPane(), null}, - new Component[]{getRichTextChangedPercentFormatPane(), null} - }; - } - @Override protected AttrTooltipContent createAttrTooltip() { AttrTooltipContent content = new AttrTooltipContent(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java index f375fa78fa..f2e3534de1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java @@ -31,14 +31,6 @@ public class VanChartMutiPieRefreshTooltipContentPane extends VanChartMultiPieTo setChangedPercentFormatPane(new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane)); } - @Override - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initRichTextFormatPane(parent, showOnPane); - - setRichTextChangedValueFormatPane(new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane)); - setRichTextChangedPercentFormatPane(new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane)); - } - protected double[] getRowSize(double p){ return new double[]{p,p,p,p,p,p}; } @@ -53,16 +45,4 @@ public class VanChartMutiPieRefreshTooltipContentPane extends VanChartMultiPieTo new Component[]{getChangedPercentFormatPane(), null}, }; } - - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextCategoryNameFormatPane(), null}, - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null}, - new Component[]{getRichTextChangedValueFormatPane(), null}, - new Component[]{getRichTextPercentFormatPane(), null}, - new Component[]{getRichTextChangedPercentFormatPane(), null} - }; - } - } 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 index 6fdc4e584f..f8c094aa5c 100644 --- 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 @@ -87,15 +87,6 @@ public class VanChartPieValueLabelContentPane extends VanChartLabelContentPane { }; } - @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); diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java index 742df96340..dea0756505 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java @@ -1,13 +1,9 @@ package com.fr.van.chart.scatter; import com.fr.plugin.chart.base.AttrTooltipContent; -import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltipContent; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; -import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -19,7 +15,6 @@ import java.awt.Component; public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterTooltipContentPane { private ChangedValueFormatPaneWithCheckBox changedSizeFormatPane; - private ChangedValueFormatPaneWithoutCheckBox richTextChangedSizeFormatPane; public VanChartScatterRefreshTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { super(null, showOnPane); @@ -33,14 +28,6 @@ public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterToo setChangedPercentFormatPane(changedPercentFormatPane); } - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initRichTextFormatPane(parent, showOnPane); - - richTextChangedSizeFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); - ChangedPercentFormatPaneWithoutCheckBox richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); - setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane); - } - protected boolean supportRichEditor() { return false; } @@ -60,12 +47,6 @@ public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterToo }; } - @Override - protected Component[][] getRichTextComponents() { - return null; - } - - @Override protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { super.populateFormatPane(attrTooltipContent); @@ -87,16 +68,6 @@ public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterToo } } - protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { - super.updateRichEditor(attrTooltipContent); - - if (attrTooltipContent instanceof ScatterAttrTooltipContent) { - ScatterAttrTooltipContent scatterAttrTooltipContent = (ScatterAttrTooltipContent) attrTooltipContent; - richTextChangedSizeFormatPane.update(scatterAttrTooltipContent.getRichTextChangeSizeFormat()); - getRichTextChangedPercentFormatPane().update(scatterAttrTooltipContent.getRichTextChangedSizePercentFormat()); - } - } - @Override public void setDirty(boolean isDirty) { super.setDirty(isDirty); diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java index ea09ff3c83..cfbaefc02d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java @@ -1,9 +1,7 @@ package com.fr.van.chart.structure.desinger.style; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -28,16 +26,6 @@ public class VanChartStructureRefreshTooltipContentPane extends VanChartStructur setChangedPercentFormatPane(changedPercentFormatPane); } - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initRichTextFormatPane(parent, showOnPane); - - ChangedValueFormatPaneWithoutCheckBox richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane); - ChangedPercentFormatPaneWithoutCheckBox richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); - - setRichTextChangedValueFormatPane(richTextChangedValueFormatPane); - setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane); - } - protected boolean supportRichEditor() { return false; } @@ -55,14 +43,4 @@ public class VanChartStructureRefreshTooltipContentPane extends VanChartStructur new Component[]{getChangedPercentFormatPane(), null}, }; } - - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextCategoryNameFormatPane(), null}, - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null}, - new Component[]{getRichTextChangedValueFormatPane(), null}, - new Component[]{getRichTextChangedPercentFormatPane(), null} - }; - } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java index f0252fab7a..a2cb16308f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java @@ -39,15 +39,6 @@ public class VanChartStructureTooltipContentPane extends VanChartTooltipContentP }; } - @Override - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextCategoryNameFormatPane(), null}, - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null} - }; - } - @Override protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { CategoryNameFormatPaneWithCheckBox categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTooltipContentPane.java index cab4d85584..5d0ff9f921 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTooltipContentPane.java @@ -3,9 +3,7 @@ package com.fr.van.chart.wordcloud.designer.style; import com.fr.design.i18n.Toolkit; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -36,21 +34,6 @@ public class VanChartWordCloudRefreshTooltipContentPane extends VanChartWordClou setChangedPercentFormatPane(changedPercentFormatPane); } - protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { - super.initRichTextFormatPane(parent, showOnPane); - - ChangedValueFormatPaneWithoutCheckBox richTextChangedValueFormatPane = new ChangedValueFormatPaneWithoutCheckBox(parent, showOnPane) { - protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Design_Chart_Change_Word_Value"); - } - }; - - ChangedPercentFormatPaneWithoutCheckBox richTextChangedPercentFormatPane = new ChangedPercentFormatPaneWithoutCheckBox(parent, showOnPane); - - setRichTextChangedValueFormatPane(richTextChangedValueFormatPane); - setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane); - } - protected boolean supportRichEditor() { return false; } @@ -69,15 +52,4 @@ public class VanChartWordCloudRefreshTooltipContentPane extends VanChartWordClou new Component[]{getChangedPercentFormatPane(), null}, }; } - - protected Component[][] getRichTextComponents() { - return new Component[][]{ - new Component[]{getRichTextCategoryNameFormatPane(), null}, - new Component[]{getRichTextSeriesNameFormatPane(), null}, - new Component[]{getRichTextValueFormatPane(), null}, - new Component[]{getRichTextChangedValueFormatPane(), null}, - new Component[]{getRichTextPercentFormatPane(), null}, - new Component[]{getRichTextChangedPercentFormatPane(), null} - }; - } } From 860bd0fc981c6fc947f4093dd5e7cece54405c8a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 24 Jan 2021 22:22:19 +0800 Subject: [PATCH 105/111] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=8F=82=E6=95=B0=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 7b22b02c87..947c63684e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -47,7 +47,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -450,7 +450,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane params = new HashMap<>(); + Map params = new LinkedHashMap<>(); for (int i = 0, len = fieldNames.length; i < len; i++) { params.put(fieldNames[i], fieldFormats[i].getJs()); @@ -691,21 +691,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Sun, 24 Jan 2021 23:29:55 +0800 Subject: [PATCH 106/111] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=83=A8=E5=88=86=E5=9B=BE=E8=A1=A8=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/designer/PlotFactory.java | 15 +++++++++++++++ .../component/richText/VanChartFieldListPane.java | 6 +++++- .../richText/VanChartRichEditorPane.java | 8 ++++++++ .../VanChartPieCategoryRichTextFieldListPane.java | 4 ++++ 4 files changed, 32 insertions(+), 1 deletion(-) 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 0f9db09fab..3167b5f59c 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 @@ -19,6 +19,7 @@ import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot; import com.fr.plugin.chart.line.VanChartLinePlot; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot; +import com.fr.plugin.chart.radar.VanChartRadarPlot; import com.fr.plugin.chart.scatter.VanChartScatterPlot; import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; @@ -94,6 +95,20 @@ public class PlotFactory { return autoAdjustLabelPlots.contains(plot.getClass()); } + private static Set> supportAddTableFieldPlots = new HashSet<>(); + + static { + supportAddTableFieldPlots.add(PiePlot4VanChart.class); + supportAddTableFieldPlots.add(VanChartColumnPlot.class); + supportAddTableFieldPlots.add(VanChartLinePlot.class); + supportAddTableFieldPlots.add(VanChartAreaPlot.class); + supportAddTableFieldPlots.add(VanChartRadarPlot.class); + } + + public static boolean plotSupportAddTableField(Plot plot) { + return supportAddTableFieldPlots.contains(plot.getClass()); + } + private static Set> borderAndBackgroundLabelPlots = new HashSet<>(); static { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java index 60a0b1158a..6e0e587be9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java @@ -54,7 +54,7 @@ public class VanChartFieldListPane extends JPanel { List richEditorFieldNames = VanChartRichEditorPane.getFieldNames(); - this.tableFieldNameList = richEditorFieldNames == null ? new ArrayList<>() : richEditorFieldNames; + this.tableFieldNameList = (!supportAddField() || richEditorFieldNames == null) ? new ArrayList<>() : richEditorFieldNames; this.fieldAttrPane = fieldAttrPane; this.richEditorPane = richEditorPane; @@ -133,6 +133,10 @@ public class VanChartFieldListPane extends JPanel { new AttrTooltipPercentFormat(), false, fieldListener); } + protected boolean supportAddField() { + return true; + } + protected void addDefaultFieldButton(JPanel fieldPane) { fieldPane.add(categoryNameButton); fieldPane.add(seriesNameButton); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java index dcec83deb4..69c93926c5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.designer.component.richText; import com.fr.base.TableData; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.Plot; import com.fr.chart.chartdata.MoreNameCDDefinition; import com.fr.chart.chartdata.OneValueCDDefinition; import com.fr.data.TableDataSource; @@ -17,6 +18,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.type.TextAlign; import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.PlotFactory; import com.teamdev.jxbrowser.chromium.Browser; import com.teamdev.jxbrowser.chromium.JSValue; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; @@ -51,6 +53,12 @@ public class VanChartRichEditorPane { return; } + Plot plot = chart.getPlot(); + + if (plot == null || !PlotFactory.plotSupportAddTableField(plot)) { + return; + } + TopDefinitionProvider definition = chart.getFilterDefinition(); if (definition == null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryRichTextFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryRichTextFieldListPane.java index deb62c01c9..15361b490e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryRichTextFieldListPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/style/VanChartPieCategoryRichTextFieldListPane.java @@ -32,6 +32,10 @@ public class VanChartPieCategoryRichTextFieldListPane extends VanChartFieldListP new AttrTooltipSummaryValueFormat(), false, listener); } + protected boolean supportAddField() { + return false; + } + protected void addDefaultFieldButton(JPanel fieldPane) { fieldPane.add(getCategoryNameButton()); fieldPane.add(summaryValueButton); From 0527e1265ad0d54e55df97b4c8f2e5b89c9b242d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 25 Jan 2021 16:36:58 +0800 Subject: [PATCH 107/111] =?UTF-8?q?CHART-17775=20=E5=83=8F=E7=B4=A0=20&=20?= =?UTF-8?q?=E7=99=BE=E5=88=86=E6=AF=94=E6=8E=A7=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frpane/UINumberDragPaneWithPercent.java | 24 ++++ .../com/fr/design/gui/ispinner/UISpinner.java | 26 +++- .../ispinner/chart/UISpinnerWithPercent.java | 15 +++ .../gui/ispinner/chart/UISpinnerWithPx.java | 20 +++ .../gui/ispinner/chart/UISpinnerWithUnit.java | 31 +++++ .../design/gui/itextfield/UINumberField.java | 22 ++-- .../gui/itextfield/UINumberFieldWithUnit.java | 114 ++++++++++++++++++ .../SeriesCondition/LabelAlphaPane.java | 3 +- .../van/chart/box/VanChartBoxBorderPane.java | 3 +- .../bubble/component/VanChartBubblePane.java | 5 +- .../chart/column/ColumnBorderAttriPane.java | 3 +- .../column/VanChartColumnSeriesPane.java | 8 +- .../VanChartAreaSeriesFillColorPane.java | 3 +- .../component/VanChartLineTypePane.java | 5 +- .../component/VanChartTrendLinePane.java | 3 +- .../background/VanChartBackgroundPane.java | 3 +- ...rtBackgroundPaneWithOutImageAndShadow.java | 23 +++- ...BackgroundWithOutShadowWithRadiusPane.java | 3 +- .../border/VanChartBorderWithAlphaPane.java | 3 +- .../border/VanChartBorderWithRadiusPane.java | 3 +- .../border/VanChartBorderWithShapePane.java | 3 +- .../marker/VanChartCommonMarkerPane.java | 3 +- .../style/VanChartPlotLegendPane.java | 11 +- .../designer/style/VanChartTitlePane.java | 11 +- .../style/axis/VanChartBaseAxisPane.java | 10 +- .../background/VanChartAlertValuePane.java | 3 +- .../VanChartCustomIntervalBackgroundPane.java | 3 +- .../VanChartAbstractPlotSeriesPane.java | 3 +- .../VanChartDrillMapInteractivePane.java | 10 +- .../style/axis/GanttAxisStylePane.java | 3 +- .../chart/gauge/VanChartGaugeSeriesPane.java | 6 +- .../style/VanChartHeatMapSeriesPane.java | 20 +-- .../van/chart/map/VanChartMapSeriesPane.java | 3 +- .../series/VanChartMapAnchorMarkerPane.java | 3 +- .../van/chart/map/line/VanChartCurvePane.java | 6 +- .../style/VanChartMultiPieSeriesPane.java | 7 +- .../van/chart/pie/RadiusCardLayoutPane.java | 11 +- .../van/chart/pie/VanChartPieSeriesPane.java | 10 +- .../style/StructureNodeStylePane.java | 46 ++++--- .../style/VanChartStructureSeriesPane.java | 35 +++--- .../style/VanChartWordCloudSeriesPane.java | 51 ++++---- 41 files changed, 431 insertions(+), 147 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPaneWithPercent.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPercent.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPx.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberFieldWithUnit.java diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPaneWithPercent.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPaneWithPercent.java new file mode 100644 index 0000000000..9a17962b7a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPaneWithPercent.java @@ -0,0 +1,24 @@ +package com.fr.design.gui.frpane; + +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPercent; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-01-21 + */ +public class UINumberDragPaneWithPercent extends UINumberDragPane { + + public UINumberDragPaneWithPercent(double minValue, double maxValue) { + super(minValue, maxValue); + } + + public UINumberDragPaneWithPercent(double minValue, double maxValue, double dierta) { + super(minValue, maxValue, dierta); + } + + protected UISpinner createUISpinner(double minValue, double maxValue, double dierta) { + return new UISpinnerWithPercent(minValue, maxValue, dierta, minValue); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index c60ae27605..454b1e5b99 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -13,15 +13,28 @@ import com.fr.stable.CommonUtils; import com.fr.stable.Constants; import com.fr.stable.StringUtils; -import com.fr.stable.collections.utils.MathUtils; -import javax.swing.*; +import javax.swing.ButtonModel; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.plaf.ButtonUI; -import java.awt.*; -import java.awt.event.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver { @@ -46,6 +59,9 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver */ private int numberFieldColumns; + public UISpinner() { + + } public UISpinner(double minValue, double maxValue, double dierta) { init(minValue, maxValue, dierta); @@ -56,7 +72,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver textField.setValue(defaultValue); } - private void init(double minValue, double maxValue, double dierta) { + protected void init(double minValue, double maxValue, double dierta) { this.minValue = minValue; this.maxValue = maxValue; this.dierta = dierta; diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPercent.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPercent.java new file mode 100644 index 0000000000..5fdc0c3f67 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPercent.java @@ -0,0 +1,15 @@ +package com.fr.design.gui.ispinner.chart; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-01-21 + */ +public class UISpinnerWithPercent extends UISpinnerWithUnit { + + private static final String UNIT = "%"; + + public UISpinnerWithPercent(double minValue, double maxValue, double dierta, double defaultValue) { + super(minValue, maxValue, dierta, defaultValue, UNIT); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPx.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPx.java new file mode 100644 index 0000000000..44397cbc53 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPx.java @@ -0,0 +1,20 @@ +package com.fr.design.gui.ispinner.chart; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-01-21 + */ +public class UISpinnerWithPx extends UISpinnerWithUnit { + + private static final String UNIT = "px"; + + public UISpinnerWithPx(double defaultValue) { + this(0, Double.MAX_VALUE, 1, defaultValue); + } + + public UISpinnerWithPx(double minValue, double maxValue, double dierta, double defaultValue) { + super(minValue, maxValue, dierta, defaultValue, UNIT); + this.getTextField().canFillNegativeNumber(false); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java new file mode 100644 index 0000000000..d8d8ab8496 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java @@ -0,0 +1,31 @@ +package com.fr.design.gui.ispinner.chart; + +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.gui.itextfield.UINumberFieldWithUnit; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-01-20 + */ +public class UISpinnerWithUnit extends UISpinner { + + private String unit; + + public UISpinnerWithUnit(double minValue, double maxValue, double dierta, double defaultValue, String unit) { + this.unit = unit; + init(minValue, maxValue, dierta); + getTextField().setValue(defaultValue); + } + + @Override + protected UINumberField initNumberField() { + return new UINumberFieldWithUnit(3, unit); + } + + @Override + public UINumberFieldWithUnit getTextField() { + return (UINumberFieldWithUnit) super.getTextField(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java index 12b894ddce..f4437a9c4a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java @@ -1,16 +1,15 @@ package com.fr.design.gui.itextfield; import com.fr.base.Utils; -import com.fr.design.gui.ilable.UILabel; import com.fr.general.ComparatorUtils; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; -import javax.swing.*; 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.Toolkit; /** * Number Field. @@ -193,7 +192,6 @@ public class UINumberField extends UITextField { if (!fillNegativeNumber && strNew.contains("-")) { return true; } - boolean noChange = false; boolean isMinus = strNew.startsWith("-"); strNew = strNew.replaceFirst("-", StringUtils.EMPTY); // 控制能输入负数 String strIntPart; @@ -207,25 +205,27 @@ public class UINumberField extends UITextField { } if (isOverMaxOrMinValue(strIntPart, strDecPart, strNew)) { Toolkit.getDefaultToolkit().beep(); - noChange = true; + return true; } + return checkNumber(strNew, isMinus); + } + protected boolean checkNumber(String strValue, boolean isMinus) { try { - if (!ComparatorUtils.equals(strNew, StringUtils.EMPTY) && !ComparatorUtils.equals(strNew, "-")) {// 控制能输入负数 - double d = Double.parseDouble(strNew) * (isMinus ? -1 : 1); + if (!ComparatorUtils.equals(strValue, StringUtils.EMPTY) && !ComparatorUtils.equals(strValue, "-")) {// 控制能输入负数 + double d = Double.parseDouble(strValue) * (isMinus ? -1 : 1); if (d < minValue || d > maxValue) { throw new Exception(); } } } catch (Exception e) { Toolkit.getDefaultToolkit().beep(); - noChange = true; + return true; } - - return noChange; + return false; } - private boolean isOverMaxOrMinValue(String strIntPart, String strDecPart, String strNew) { + protected boolean isOverMaxOrMinValue(String strIntPart, String strDecPart, String strNew) { boolean checkLength = strIntPart.length() > maxIntegerLength || strDecPart.length() > maxDecimalLength; return checkLength || (strNew.length() > 1 && ComparatorUtils.equals(strNew.substring(0, 1), "0") && !ComparatorUtils.equals(strNew.substring(1, 2), ".")); diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberFieldWithUnit.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberFieldWithUnit.java new file mode 100644 index 0000000000..e9f412551e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberFieldWithUnit.java @@ -0,0 +1,114 @@ +package com.fr.design.gui.itextfield; + +import com.fr.base.Utils; +import com.fr.general.ComparatorUtils; +import com.fr.stable.StringUtils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import java.awt.Toolkit; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-01-20 + * 这个控件不会限制输入的数字大小,但是同样不允许输入数字之外的字符 + */ +public class UINumberFieldWithUnit extends UINumberField { + + private String unit; + + private List unitList = new ArrayList<>(); + + public UINumberFieldWithUnit(int columns, String unit) { + super(columns); + this.unit = unit; + initUnitList(); + } + + //对单位的字符进行组合 + private void initUnitList() { + char[] chars = unit.toCharArray(); + Set set = new LinkedHashSet<>(); + initUnitList(chars, 0, StringUtils.EMPTY, set); + unitList.addAll(set); + Collections.sort(unitList, Comparator.comparing(String::length)); + } + + private void initUnitList(char[] chars, int index, String str, Set set) { + if (index == chars.length) { + return; + } + for (int i = index; i < chars.length; i++) { + String newStr = str + chars[i]; + set.add(newStr); + initUnitList(chars, i + 1, newStr, set); + } + } + + public void setFieldDocument() { + setDocument(new NumberDocumentNoLimit()); + } + + public void setValue(double value) { + this.setText(Utils.doubleToString(value) + unit); + } + + public double getValue() throws NumberFormatException { + try { + String text = this.getText(); + if (StringUtils.isEmpty(text)) { + return 0; + } + + return Double.parseDouble(text.replace(getEndString(text), StringUtils.EMPTY)); + } catch (NumberFormatException numberFormatException) { + return UINumberField.ERROR_VALUE; + } + } + + private String getEndString(String text) { + int size = unitList.size(); + for (int i = size - 1; i >= 0; i--) { + String unit = unitList.get(i); + if (text.endsWith(unit)) { + return unit; + + } + } + return StringUtils.EMPTY; + } + + class NumberDocumentNoLimit extends NumberDocument { + + public boolean checkString(int offset, String s, String str) { + return (ComparatorUtils.equals(s, "F") + || ComparatorUtils.equals(s, "f") + || ComparatorUtils.equals(s, "D") + || ComparatorUtils.equals(s, "d") + || (ComparatorUtils.equals(s, ".") && getMaxDecimalLength() == 0)); + + } + + protected boolean isOverMaxOrMinValue(String strIntPart, String strDecPart, String strNew) { + return super.isOverMaxOrMinValue(strIntPart, strDecPart, strNew.replaceFirst(getEndString(strNew), StringUtils.EMPTY)); + } + + protected boolean checkNumber(String strValue, boolean isMinus) { + try { + if (ComparatorUtils.equals(strValue, StringUtils.EMPTY) || ComparatorUtils.equals(strValue, "-")) { + return false; + } + Double.parseDouble(strValue.replaceFirst(getEndString(strValue), StringUtils.EMPTY)); + } catch (Exception e) { + Toolkit.getDefaultToolkit().beep(); + return true; + } + return false; + } + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java index 1962ab4a9e..5c91765043 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java @@ -5,6 +5,7 @@ import com.fr.chart.base.DataSeriesCondition; import com.fr.design.condition.ConditionAttrSingleConditionPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ilable.UILabel; @@ -32,7 +33,7 @@ public class LabelAlphaPane extends ConditionAttrSingleConditionPane { }; } }; - lineWidth = new UISpinner(0.5, Double.MAX_VALUE, 0.5, 0.5); + lineWidth = new UISpinnerWithPx(0.5, Double.MAX_VALUE, 0.5, 0.5); Component[][] components = new Component[][]{ new Component[]{null, null}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/component/VanChartBubblePane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/component/VanChartBubblePane.java index a51f910479..2d95bf2727 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/component/VanChartBubblePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/component/VanChartBubblePane.java @@ -4,6 +4,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -24,8 +25,8 @@ public class VanChartBubblePane extends BasicBeanPane { private UIButtonGroup displayNegative; public VanChartBubblePane(){ - minDiameter = new UISpinner(0,Double.MAX_VALUE,1,0); - maxDiameter = new UISpinner(0,Double.MAX_VALUE,1,0); + minDiameter = new UISpinnerWithPx(0); + maxDiameter = new UISpinnerWithPx(0); shadow = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); displayNegative = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java index c81317a813..af4be834ae 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.column; import com.fr.design.chart.comp.BorderAttriPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import java.awt.Dimension; @@ -19,7 +20,7 @@ public class ColumnBorderAttriPane extends BorderAttriPane { public ColumnBorderAttriPane(String radiusString) { this.add(new UILabel(radiusString + ":")); - radius = new UISpinner(0,1000,1,0); + radius = new UISpinnerWithPx(0,1000,1,0); this.add(radius); radius.setPreferredSize(new Dimension(60, 18)); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java index eb2c3914ac..b83a20f612 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java @@ -3,6 +3,8 @@ package com.fr.van.chart.column; import com.fr.base.background.ImageBackground; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -76,10 +78,10 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane { private JPanel createSeriesStylePane(double[] row, double[] col) { isFixedWidth = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")}); - columnWidth = new UISpinner(0,1000,1,0); + columnWidth = new UISpinnerWithPx(0,1000,1,0); columnWidth.setBorder(BorderFactory.createEmptyBorder(0, (int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); - seriesGap = new UINumberDragPane(-100, 100); - categoryGap = new UINumberDragPane(0, 100); + seriesGap = new UINumberDragPaneWithPercent(-100, 100); + categoryGap = new UINumberDragPaneWithPercent(0, 100); isFillWithImage = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")}); imagePane = new ImageBackgroundQuickPane(false); imagePane.setBorder(BorderFactory.createEmptyBorder(0,(int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartAreaSeriesFillColorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartAreaSeriesFillColorPane.java index 24400cacdc..241798bef3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartAreaSeriesFillColorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartAreaSeriesFillColorPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.designer.component; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; @@ -36,7 +37,7 @@ public class VanChartAreaSeriesFillColorPane extends BasicPane { }; } }; - transparent = new UINumberDragPane(0, 100); + transparent = new UINumberDragPaneWithPercent(0, 100); JPanel transparentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha"), transparent); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java index 10c3308b3c..b6119aa642 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java @@ -4,6 +4,7 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.utils.gui.UIComponentUtils; @@ -15,11 +16,11 @@ import com.fr.plugin.chart.type.LineType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; +import java.util.Arrays; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Arrays; /** * line相关设置 @@ -74,7 +75,7 @@ public class VanChartLineTypePane extends BasicPane { lineTypeComboBox = createLineType(); - lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); + lineWidthSpinner = new UISpinnerWithPx(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); lineTypeComboBox.addActionListener(new ActionListener() { @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java index eb8bd0f16d..dbcdb0e21c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java @@ -7,6 +7,7 @@ import com.fr.design.dialog.BasicPane; 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.ispinner.chart.UISpinnerWithPx; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; @@ -61,7 +62,7 @@ public class VanChartTrendLinePane extends BasicPane{ trendLineName = new UITextField(); trendLineColor = new ColorSelectBox(PREFERRED_WIDTH); trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); - lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); + lineWidthSpinner = new UISpinnerWithPx(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); trendLineType = new UIComboBox(TYPES); prePeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); afterPeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java index 9a81b6ece1..c51ac0fe9f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java @@ -4,6 +4,7 @@ import com.fr.base.background.ImageBackground; import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; @@ -112,7 +113,7 @@ public class VanChartBackgroundPane extends BasicPane { } }); transparentLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")); - transparent = new UINumberDragPane(0, 100); + transparent = new UINumberDragPaneWithPercent(0, 100); } protected Component[][] getPaneComponents() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java index 812dd5a091..d854f9917f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java @@ -1,10 +1,15 @@ package com.fr.van.chart.designer.component.background; +import com.fr.design.constants.LayoutConstants; +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.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.Component; @@ -28,10 +33,13 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = { p,p,p}; + double[] columnSize = {f, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH}; + double[] rowSize = {p, p, p}; - return TableLayoutHelper.createTableLayoutPane(getPaneComponents(),rowSize,columnSize); + JPanel tableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize, + TableLayout4VanChartHelper.COMPONENT_INTERVAL, LayoutConstants.VGAP_MEDIUM); + tableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 4, 0)); + return tableLayoutPane; } @Override @@ -44,7 +52,7 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro */ @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Default_Name"); + return Toolkit.i18nText("Fine-Design_Chart_Default_Name"); } }); paneList.add(new ColorBackgroundQuickPane()); @@ -54,11 +62,14 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro @Override protected Component[][] getPaneComponents() { return new Component[][]{ - new Component[]{typeComboBox, null}, - new Component[]{centerPane, null}, + new Component[]{new UILabel(labelName()), typeComboBox}, + new Component[]{null, centerPane}, new Component[]{getTransparentLabel(), transparent}, }; } + protected String labelName() { + return Toolkit.i18nText("Fine-Design_Chart_Background"); + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java index 807ee62169..e0e8345985 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.designer.component.background; import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; import java.awt.Component; @@ -24,7 +25,7 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg } protected Component[][] getPaneComponents() { - radius = new UISpinner(0, 1000, 1, 0); + radius = new UISpinnerWithPx(0, 1000, 1, 0); return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithAlphaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithAlphaPane.java index 724cefe921..607bc0da52 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithAlphaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithAlphaPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.component.border; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; @@ -29,7 +30,7 @@ public class VanChartBorderWithAlphaPane extends VanChartBorderPane{ @Override protected void initComponents() { super.initComponents(); - transparent = new UINumberDragPane(0,100); + transparent = new UINumberDragPaneWithPercent(0,100); } protected void initContent() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java index d6fdf9c699..d92f3c0ee8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java @@ -4,6 +4,7 @@ import com.fr.chart.base.AttrBorder; import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; @@ -34,7 +35,7 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane { @Override protected void initComponents() { super.initComponents(); - radius = new UISpinner(0,1000,1,0); + radius = new UISpinnerWithPx(0,1000,1,0); } @Override 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 f40a51f123..292ae55acb 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 @@ -7,6 +7,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.gui.xcombox.MarkerComboBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; @@ -58,7 +59,7 @@ public class VanChartBorderWithShapePane extends BasicPane { }); lineColorBox = new ColorSelectBox(100); borderShape = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers()); - borderRadius = new UISpinner(0, 1000, 1, 0); + borderRadius = new UISpinnerWithPx(0, 1000, 1, 0); } private void createBorderPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index 444bebfaa1..e2cdf0cb02 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -4,6 +4,7 @@ import com.fr.chart.chartglyph.Marker; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.gui.xcombox.MarkerComboBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; @@ -89,7 +90,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane }; } }; - radius = new UISpinner(0, 100, 0.5, 0); + radius = new UISpinnerWithPx(0, 100, 0.5, 0); double p = TableLayout.PREFERRED; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java index 8a0a62f62d..5a16aa4c82 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java @@ -4,11 +4,12 @@ import com.fr.base.BaseUtils; import com.fr.chart.chartattr.Plot; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UIBubbleFloatPane; +import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icheckbox.UICheckBox; 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; @@ -65,7 +66,7 @@ public class VanChartPlotLegendPane extends BasicPane { //区域显示策略 恢复用注释。下面4行删除。 private UIButtonGroup customSize; - private UISpinner maxProportion; + private UINumberDragPane maxProportion; private JPanel maxProportionPane; //区域显示策略 恢复用注释。取消注释。 //private LimitPane limitPane; @@ -294,7 +295,7 @@ public class VanChartPlotLegendPane extends BasicPane { private JPanel createDisplayStrategy() { //区域显示策略 恢复用注释。开始删除。 - maxProportion = new UISpinner(0, 100, 1, 30); + maxProportion = new UINumberDragPaneWithPercent(0, 100, 1); customSize = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), customSize); @@ -402,7 +403,7 @@ public class VanChartPlotLegendPane extends BasicPane { legend.setLayout(layoutButton.getSelectedItem()); //区域显示策略 恢复用注释。下面2行删除。 legend.setCustomSize(customSize.getSelectedIndex() == 1); - legend.setMaxHeight(maxProportion.getValue()); + legend.setMaxHeight(maxProportion.updateBean()); //区域显示策略 恢复用注释。取消注释。 //legend.setLimitAttribute(limitPane.updateBean()); legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); @@ -427,7 +428,7 @@ public class VanChartPlotLegendPane extends BasicPane { layoutButton.setSelectedItem(legend.getLayout()); //区域显示策略 恢复用注释。下面2行删除。 customSize.setSelectedIndex(legend.isCustomSize() ? 1 : 0); - maxProportion.setValue(legend.getMaxHeight()); + maxProportion.populateBean(legend.getMaxHeight()); //区域显示策略 恢复用注释。取消注释。 //limitPane.populateBean(legend.getLimitAttribute()); if (highlightButton != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index 1c02f342ca..59652a4afa 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -7,11 +7,12 @@ import com.fr.chart.base.TextAttr; import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.frpane.UIBubbleFloatPane; +import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; @@ -64,7 +65,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { //区域显示策略 恢复用注释。下面3行删除。 private UIButtonGroup limitSize; - private UISpinner maxProportion; + private UINumberDragPane maxProportion; private JPanel maxProportionPane; //区域显示策略 恢复用注释。取消注释。 //private LimitPane limitPane; @@ -183,7 +184,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { private JPanel createDisplayStrategy() { //区域显示策略 恢复用注释。开始删除。 - maxProportion = new UISpinner(0, 100, 1, 30); + maxProportion = new UINumberDragPaneWithPercent(0, 100, 1); limitSize = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize); @@ -320,7 +321,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { customFloatPositionPane.setFloatPosition_y(title.getFloatPercentY()); //区域显示策略 恢复用注释。下面2行删除。 limitSize.setSelectedIndex(title.isLimitSize() ? 0 : 1); - maxProportion.setValue(title.getMaxHeight()); + maxProportion.populateBean(title.getMaxHeight()); //区域显示策略 恢复用注释。取消注释。 //limitPane.populateBean(title.getLimitAttribute()); @@ -357,7 +358,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { title.setFloating(customFloatPositionButton.isSelected()); //区域显示策略 恢复用注释。下面2行删除。 title.setLimitSize(limitSize.getSelectedIndex() == 0); - title.setMaxHeight(maxProportion.getValue()); + title.setMaxHeight(maxProportion.updateBean()); //区域显示策略 恢复用注释。取消注释。 //title.setLimitAttribute(limitPane.updateBean()); title.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 955be0a8c4..9fb0c7e31e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -8,11 +8,11 @@ import com.fr.chart.chartattr.Title; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.style.FormatPane; import com.fr.design.i18n.Toolkit; @@ -97,7 +97,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { //区域显示策略 恢复用注释。下面3行删除。 protected UIButtonGroup axisLimitSize; - protected UISpinner maxProportion; + protected UINumberDragPane maxProportion; protected JPanel maxProportionPane; //区域显示策略 恢复用注释。取消注释。 //private LimitPane limitPane; @@ -465,7 +465,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected JPanel createDisplayStrategy() { //区域显示策略 恢复用注释。删除到return,即除了注释的代码都删除。 - maxProportion = new UISpinner(0, 100, 1, 30); + maxProportion = new UINumberDragPaneWithPercent(0, 100, 1); axisLimitSize = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Limit"), Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), axisLimitSize); @@ -767,7 +767,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { axisLimitSize.setSelectedIndex(axis.isLimitSize() ? 0 : 1); } if (maxProportion != null) { - maxProportion.setValue(axis.getMaxHeight()); + maxProportion.populateBean(axis.getMaxHeight()); } //区域显示策略 恢复用注释。取消注释。 @@ -909,7 +909,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { axis.setLimitSize(axisLimitSize.getSelectedIndex() == 0); } if (maxProportion != null) { - axis.setMaxHeight(maxProportion.getValue()); + axis.setMaxHeight(maxProportion.updateBean()); } //区域显示策略 恢复用注释。取消注释。 // if (limitPane != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java index ca59824f69..387d974d28 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java @@ -10,6 +10,7 @@ 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.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; import com.fr.design.gui.style.FRFontPane; import com.fr.design.layout.FRGUIPaneFactory; @@ -90,7 +91,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { alertValue.setPreferredSize(new Dimension(VALUE_WD, HT)); alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.SOLID, LineType.DASHED}); - lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); + lineWidthSpinner = new UISpinnerWithPx(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); alertLineColor = new ColorSelectBox(PREFERRED_WIDTH); alertTextPosition = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Top"), Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")}); alertText = new TinyFormulaPane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java index 81aa8d276d..ef6dc0e111 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java @@ -5,6 +5,7 @@ import com.fr.base.Utils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -52,7 +53,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane { protected void initComponents() { textAttrPane = new ChartTextAttrPane(); colorSelectBox4button = new ColorSelectBoxWithOutTransparent(100); - transparent = new UINumberDragPane(0, 100); + transparent = new UINumberDragPaneWithPercent(0, 100); } protected Component[][] getUsedComponents() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java index 8a48837cb3..aab8f3cf2c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java @@ -3,9 +3,11 @@ package com.fr.van.chart.gauge; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -257,12 +259,12 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { } private Component[] getThermometerWidth() { - thermometerWidth = new UISpinner(0, Double.MAX_VALUE, 0.1, 10); + thermometerWidth = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.1, 10); return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Thermometer_Width")),thermometerWidth}; } private Component[] getChutePercent() { - chutePercent = new UINumberDragPane(0, 100, 1); + chutePercent = new UINumberDragPaneWithPercent(0, 100, 1); return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Chute_Percent")),chutePercent}; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java index 1e06db777e..0dd9cea31b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java @@ -3,9 +3,11 @@ package com.fr.van.chart.heatmap.designer.style; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -31,7 +33,7 @@ import java.awt.Component; public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane { private UISpinner radius; - private UISpinner blur; + private UINumberDragPane blur; private UINumberDragPane minOpacity; private UINumberDragPane maxOpacity; @@ -119,8 +121,8 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane { } private JPanel createHeatPointStylePane() { - radius = new UISpinner(0, Double.MAX_VALUE, 1, 30); - blur = new UISpinner(0, 100, 1, 30); + radius = new UISpinnerWithPx(0, Double.MAX_VALUE, 1, 30); + blur = new UINumberDragPaneWithPercent(0, 100, 1); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -130,8 +132,8 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane { Component[][] components = new Component[][]{ new Component[]{null, null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Heat_Map_Radius")), radius, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Heat_Map_Blur")), blur, new UILabel("%")} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Heat_Map_Radius")), radius, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Heat_Map_Blur")), blur, null} }; JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); @@ -141,8 +143,8 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane { } private JPanel createOpacityPane() { - maxOpacity = new UINumberDragPane(0, 100); - minOpacity = new UINumberDragPane(0, 100); + maxOpacity = new UINumberDragPaneWithPercent(0, 100); + minOpacity = new UINumberDragPaneWithPercent(0, 100); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -169,7 +171,7 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane { if (plot instanceof VanChartHeatMapPlot) { VanChartHeatMapPlot heatMapPlot = (VanChartHeatMapPlot) plot; radius.setValue(heatMapPlot.getRadius()); - blur.setValue(heatMapPlot.getBlur()); + blur.populateBean(heatMapPlot.getBlur()); maxOpacity.populateBean(heatMapPlot.getMaxOpacity()); minOpacity.populateBean(heatMapPlot.getMinOpacity()); getVanChartValueColorPane().populateBean((VanChartRangeLegend) plot.getLegend()); @@ -187,7 +189,7 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane { if (plot instanceof VanChartHeatMapPlot) { VanChartHeatMapPlot heatMapPlot = (VanChartHeatMapPlot) plot; heatMapPlot.setRadius(radius.getValue()); - heatMapPlot.setBlur(blur.getValue()); + heatMapPlot.setBlur(blur.updateBean()); heatMapPlot.setMaxOpacity(maxOpacity.updateBean()); heatMapPlot.setMinOpacity(minOpacity.updateBean()); getVanChartValueColorPane().updateBean((VanChartRangeLegend) plot.getLegend()); 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 8f5a3d1783..2d1cb2304c 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 @@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; @@ -321,7 +322,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { //不透明度 protected JPanel createAlphaPane() { - setTransparent(new UINumberDragPane(0, 100)); + setTransparent(new UINumberDragPaneWithPercent(0, 100)); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; 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 c7ddda38b8..d34a89b5de 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 @@ -3,6 +3,7 @@ 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.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -20,7 +21,7 @@ public class VanChartMapAnchorMarkerPane extends BasicBeanPane{ } private void initComponents(){ - lineWidth = new UISpinner(0, MAX_WIDTH, STEP, 0.5); + lineWidth = new UISpinnerWithPx(0, MAX_WIDTH, STEP, 0.5); bending = new UINumberDragPane(0, 100); - lineAlphaPane = new UINumberDragPane(0, 100); + lineAlphaPane = new UINumberDragPaneWithPercent(0, 100); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java index 4fa61802de..6c1575cfdf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.multilayer.style; import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; @@ -46,7 +47,7 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gradual_Deep")}); startAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); endAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); - innerRadius = new UISpinner(0, 100, 1, 0); + innerRadius = new UINumberDragPaneWithPercent(0, 100, 1); supportRotation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); supportDrill = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), @@ -72,7 +73,7 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane { gradualLevel.setSelectedIndex(multiPiePlot.isLight() ? 0 : 1); startAngle.setValue(multiPiePlot.getStartAngle()); endAngle.setValue(multiPiePlot.getEndAngle()); - innerRadius.setValue(multiPiePlot.getInnerRadiusPercent()); + innerRadius.populateBean(multiPiePlot.getInnerRadiusPercent()); supportDrill.setSelectedIndex(multiPiePlot.isSupportDrill() ? 0 : 1); supportRotation.setSelectedIndex(multiPiePlot.isSupportRotation() ? 0 : 1); } @@ -85,7 +86,7 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane { multiPiePlot.setLight(gradualLevel.getSelectedIndex() == 0); multiPiePlot.setStartAngle(startAngle.getValue()); multiPiePlot.setEndAngle(endAngle.getValue()); - multiPiePlot.setInnerRadiusPercent(innerRadius.getValue()); + multiPiePlot.setInnerRadiusPercent(innerRadius.updateBean()); multiPiePlot.setSupportDrill(supportDrill.getSelectedIndex() == 0); multiPiePlot.setSupportRotation(supportRotation.getSelectedIndex() == 0); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java index 4932eddb4e..7befd40e7d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java @@ -4,9 +4,10 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - import com.fr.plugin.chart.attr.radius.VanChartRadiusPlot; import com.fr.plugin.chart.base.VanChartRadius; import com.fr.plugin.chart.type.RadiusType; @@ -14,11 +15,11 @@ import com.fr.van.chart.layout.VanChartCardLayoutPane; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.util.HashMap; +import java.util.Map; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; -import java.util.HashMap; -import java.util.Map; /** * Created by hufan on 2016/10/25. @@ -40,8 +41,8 @@ public class RadiusCardLayoutPane extends BasicBeanPane { Map paneList = new HashMap(); - radiusType = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Auto"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fixed")}); - radius = new UISpinner(MIN_RADIUS, MAX_RADIUS, 1, 100); + radiusType = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); + radius = new UISpinnerWithPx(100); radiusContent = new JPanel(new BorderLayout()); radiusContent.add(radius, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java index a6a1a5e28a..6253190da2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java @@ -2,6 +2,8 @@ package com.fr.van.chart.pie; import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; @@ -27,7 +29,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { protected UISpinner startAngle; protected UISpinner endAngle; - protected UISpinner innerRadius; + protected UINumberDragPane innerRadius; private UIButtonGroup supportRotation; public VanChartPieSeriesPane(ChartStylePane parent, Plot plot) { @@ -52,7 +54,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { protected JPanel createSeriesStylePane(double[] row, double[] col) { startAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); endAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); - innerRadius = new UISpinner(0, 100, 1, 0); + innerRadius = new UINumberDragPaneWithPercent(0, 100, 1); supportRotation = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); @@ -86,7 +88,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { PiePlot4VanChart piePlot4VanChart = (PiePlot4VanChart) plot; startAngle.setValue(piePlot4VanChart.getStartAngle()); endAngle.setValue(piePlot4VanChart.getEndAngle()); - innerRadius.setValue(piePlot4VanChart.getInnerRadiusPercent()); + innerRadius.populateBean(piePlot4VanChart.getInnerRadiusPercent()); supportRotation.setSelectedIndex(piePlot4VanChart.isSupportRotation() == true ?0:1); } } @@ -107,7 +109,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { PiePlot4VanChart piePlot4VanChart = (PiePlot4VanChart)plot; piePlot4VanChart.setStartAngle(startAngle.getValue()); piePlot4VanChart.setEndAngle(endAngle.getValue()); - piePlot4VanChart.setInnerRadiusPercent(innerRadius.getValue()); + piePlot4VanChart.setInnerRadiusPercent(innerRadius.updateBean()); piePlot4VanChart.setSupportRotation(supportRotation.getSelectedItem()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java index 610c616d9c..333646c3c4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java @@ -3,13 +3,15 @@ package com.fr.van.chart.structure.desinger.style; import com.fr.base.background.ImageBackground; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; - import com.fr.plugin.chart.base.AttrNode; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartMarkerBackgroundPane; @@ -42,38 +44,46 @@ public class StructureNodeStylePane extends BasicBeanPane { double[] columnSize = {f, e}; double[] rowSize = {p, p, p, p, p}; - nodeRadiusType = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); - nodeRadius = new UISpinner(0,Double.MAX_VALUE,0.5,0); - nodeBorderWidth = new UISpinner(0,Double.MAX_VALUE,0.5,0); - nodeBorderColor = new VanChartMarkerBackgroundPane(); - nodeOpacity = new UINumberDragPane(0,100); + nodeRadiusType = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), + Toolkit.i18nText("Fine-Design_Chart_Custom")}); + nodeRadius = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 0); + nodeBorderWidth = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 0); + nodeBorderColor = new VanChartMarkerBackgroundPane() { + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Node_Radius")), typeComboBox}, + new Component[]{null, centerPane}, + }; + } + }; + nodeOpacity = new UINumberDragPaneWithPercent(0, 100); JPanel jPanel = new JPanel(new BorderLayout()); - jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Node_Radius"), nodeRadiusType), BorderLayout.NORTH); + jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Node_Radius"), nodeRadiusType), BorderLayout.NORTH); nodeRadiusPane = TableLayout4VanChartHelper.createGapTableLayoutPane("", nodeRadius); jPanel.add(nodeRadiusPane, BorderLayout.CENTER); Component[][] components1 = new Component[][]{ new Component[]{null, null}, new Component[]{jPanel, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border_Width")), nodeBorderWidth}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Border_Color")), nodeBorderColor}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), nodeOpacity} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Border_Width")), nodeBorderWidth}, + new Component[]{nodeBorderColor, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), nodeOpacity} }; JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(components1, rowSize, columnSize); - useImage = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_YES"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_NO")}); + useImage = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), + Toolkit.i18nText("Fine-Design_Chart_NO")}); imagePane = new ImageBackgroundQuickPane(false); - imagePane.setBorder(BorderFactory.createEmptyBorder(0,(int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); + imagePane.setBorder(BorderFactory.createEmptyBorder(0, (int) TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL, 0, 0)); Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")),useImage}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")), useImage}, }; JPanel useImagePane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, columnSize); - JPanel panel2 = new JPanel(new BorderLayout(0,6)); + JPanel panel2 = new JPanel(new BorderLayout(0, 6)); panel2.add(useImagePane, BorderLayout.NORTH); panel2.add(imagePane, BorderLayout.CENTER); @@ -91,7 +101,7 @@ public class StructureNodeStylePane extends BasicBeanPane { } }); - this.setLayout(new BorderLayout(0,6)); + this.setLayout(new BorderLayout(0, 6)); this.add(panel1, BorderLayout.NORTH); this.add(panel2, BorderLayout.CENTER); } @@ -112,7 +122,7 @@ public class StructureNodeStylePane extends BasicBeanPane { nodeBorderColor.populate(ob.getBorderColor()); nodeOpacity.populateBean(ob.getOpacity()); useImage.setSelectedIndex(ob.isUseImage() ? 0 : 1); - if(ob.getImageBackground() != null) { + if (ob.getImageBackground() != null) { imagePane.populateBean(ob.getImageBackground()); } checkRadius(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java index ee2cda46a6..daa0eaa6e3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java @@ -3,9 +3,12 @@ package com.fr.van.chart.structure.desinger.style; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; @@ -43,7 +46,7 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p,p,p}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{createLinkPane()}, new Component[]{createNodePane()} @@ -57,10 +60,10 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane private JPanel createLinkPane() { linkColor = new ColorSelectBox(100); - linkWidthType = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); - linkWidth = new UISpinner(0,Double.MAX_VALUE,0.5,0); - linkOpacity = new UINumberDragPane(0,100); + linkWidthType = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), + Toolkit.i18nText("Fine-Design_Chart_Custom")}); + linkWidth = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 0); + linkOpacity = new UINumberDragPaneWithPercent(0, 100); linkWidthType.addChangeListener(new ChangeListener() { @Override @@ -73,10 +76,10 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; - double[] rowSize = {p,p,p,p}; + double[] rowSize = {p, p, p, p}; JPanel jPanel = new JPanel(new BorderLayout()); - jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_Width")+" ", linkWidthType), BorderLayout.NORTH); + jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Tree_Width") + " ", linkWidthType), BorderLayout.NORTH); linkWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(" ", linkWidth); jPanel.add(linkWidthPane, BorderLayout.CENTER); @@ -104,8 +107,8 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane @Override public void populateBean(Plot plot) { super.populateBean(plot); - if(plot instanceof VanChartStructurePlot){ - VanChartStructurePlot structurePlot = (VanChartStructurePlot)plot; + if (plot instanceof VanChartStructurePlot) { + VanChartStructurePlot structurePlot = (VanChartStructurePlot) plot; linkColor.setSelectObject(structurePlot.getLinkColor()); linkWidthType.setSelectedIndex(structurePlot.isAutoLinkWidth() ? 0 : 1); linkWidth.setValue(structurePlot.getLinkWidth()); @@ -117,8 +120,8 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane @Override public void updateBean(Plot plot) { super.updateBean(plot); - if(plot instanceof VanChartStructurePlot){ - VanChartStructurePlot structurePlot = (VanChartStructurePlot)plot; + if (plot instanceof VanChartStructurePlot) { + VanChartStructurePlot structurePlot = (VanChartStructurePlot) plot; structurePlot.setLinkColor(linkColor.getSelectObject()); structurePlot.setAutoLinkWidth(linkWidthType.getSelectedIndex() == 0); structurePlot.setLinkWidth(linkWidth.getValue()); @@ -126,16 +129,16 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane } } - protected void populateCondition(ConditionAttr defaultAttr){ - if(nodeStylePane != null){ + protected void populateCondition(ConditionAttr defaultAttr) { + if (nodeStylePane != null) { AttrNode attrNode = defaultAttr.getExisted(AttrNode.class); nodeStylePane.populateBean(attrNode); } } - protected void updateCondition(ConditionAttr defaultAttr){ - if(nodeStylePane != null){ - AttrNode attrNode =defaultAttr.getExisted(AttrNode.class); + protected void updateCondition(ConditionAttr defaultAttr) { + if (nodeStylePane != null) { + AttrNode attrNode = defaultAttr.getExisted(AttrNode.class); if (attrNode != null) { defaultAttr.remove(attrNode); defaultAttr.addDataSeriesCondition(nodeStylePane.updateBean()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java index 4e9c612c09..543b8139f6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java @@ -4,10 +4,12 @@ import com.fr.base.Utils; import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageFileBackground; import com.fr.chart.chartattr.Plot; +import com.fr.design.constants.LayoutConstants; 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.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; @@ -61,7 +63,7 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p,p,p}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{createWordCloudStylePane()}, }; @@ -71,42 +73,43 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane { return contentPane; } - private JPanel createWordCloudStylePane(){ + private JPanel createWordCloudStylePane() { double labelSize = LABEL_SIZE; double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] centerC = {labelSize,f,p,f}; + double[] centerC = {labelSize, f, p, f}; double[] centerR = {p}; - minRotation = new UISpinner(-MAX_ROTATION,MAX_ROTATION,1,0); + minRotation = new UISpinner(-MAX_ROTATION, MAX_ROTATION, 1, 0); maxRotation = new - UISpinner(-MAX_ROTATION,MAX_ROTATION,1,0); + UISpinner(-MAX_ROTATION, MAX_ROTATION, 1, 0); Component[][] centerComps = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Rotation_Angle")), minRotation, new UILabel("-"), maxRotation}, }; - JPanel centerPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(centerComps,centerR,centerC); + JPanel centerPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(centerComps, centerR, centerC); double[] northC = {f, e}; - double[] northR = {p,p}; + double[] northR = {p, p}; fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); defineFontSize = new UIButtonGroup(new String[]{AUTO_FONT_SIZE, CUSTOM_FONT_SIZE}); Component[][] northComps = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font")), fontNameComboBox}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")), defineFontSize } + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")), defineFontSize} }; - JPanel northPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(northComps,northR,northC); + JPanel northPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(northComps, northR, northC); - minFontSize = new UISpinner(0,Double.MAX_VALUE,1,10); - maxFontSize = new UISpinner(0,Double.MAX_VALUE,1,100); + minFontSize = new UISpinnerWithPx(10); + maxFontSize = new UISpinnerWithPx(100); Component[][] fontComps = new Component[][]{ new Component[]{null, minFontSize, new UILabel("-"), maxFontSize}, }; - fontPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(fontComps,centerR,centerC); + fontPanel = TableLayoutHelper.createGapTableLayoutPane(fontComps, centerR, centerC, + 6, LayoutConstants.VGAP_LARGE); double[] columnSize = {f}; double[] rowSize = {p, p, p, p}; @@ -132,27 +135,27 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane { private JPanel createCloudShapePane() { cloudShape = new UIComboBox(CloudShapeType.getTypes()); - imageBackgroundQuickPane = new ImageBackgroundQuickPane(false){ + imageBackgroundQuickPane = new ImageBackgroundQuickPane(false) { @Override public Dimension getPreferredSize() { - if(cloudShape.getSelectedItem() == CloudShapeType.DEFAULT){ - return new Dimension(0,0); + if (cloudShape.getSelectedItem() == CloudShapeType.DEFAULT) { + return new Dimension(0, 0); } else { return super.getPreferredSize(); } } }; - JPanel panel = new JPanel(new BorderLayout(0,4)); + JPanel panel = new JPanel(new BorderLayout(0, 4)); panel.add(cloudShape, BorderLayout.NORTH); panel.add(imageBackgroundQuickPane, BorderLayout.CENTER); cloudShape.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { - CloudShapeType type = (CloudShapeType)cloudShape.getSelectedItem(); + CloudShapeType type = (CloudShapeType) cloudShape.getSelectedItem(); String path = type.getImageUrl(); - if(path != null) { + if (path != null) { ImageFileBackground imageBackground = new ImageFileBackground(IOUtils.readImage(path)); imageBackgroundQuickPane.populateBean(imageBackground); } else { @@ -181,8 +184,8 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane { @Override public void populateBean(Plot plot) { super.populateBean(plot); - if(plot instanceof VanChartWordCloudPlot){ - VanChartWordCloudPlot wordCloudPlot = (VanChartWordCloudPlot)plot; + if (plot instanceof VanChartWordCloudPlot) { + VanChartWordCloudPlot wordCloudPlot = (VanChartWordCloudPlot) plot; fontNameComboBox.setSelectedItem(wordCloudPlot.getFont().getFamily()); minRotation.setValue(wordCloudPlot.getMinRotation()); maxRotation.setValue(wordCloudPlot.getMaxRotation()); @@ -193,7 +196,7 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane { cloudShape.setSelectedItem(wordCloudPlot.getShapeType()); ImageBackground imageBackground = wordCloudPlot.getShapeImage(); - if(imageBackground != null) { + if (imageBackground != null) { imageBackgroundQuickPane.populateBean(imageBackground); } } @@ -209,8 +212,8 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane { @Override public void updateBean(Plot plot) { super.updateBean(plot); - if(plot instanceof VanChartWordCloudPlot){ - VanChartWordCloudPlot wordCloudPlot = (VanChartWordCloudPlot)plot; + if (plot instanceof VanChartWordCloudPlot) { + VanChartWordCloudPlot wordCloudPlot = (VanChartWordCloudPlot) plot; wordCloudPlot.setFont(FRFont.getInstance(fontNameComboBox.getSelectedItem().toString(), Font.PLAIN, 9)); wordCloudPlot.setMinRotation(minRotation.getValue()); wordCloudPlot.setMaxRotation(maxRotation.getValue()); @@ -220,7 +223,7 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane { wordCloudPlot.setMaxFontSize(maxFontSize.getValue()); wordCloudPlot.setShapeType((CloudShapeType) cloudShape.getSelectedItem()); - if(wordCloudPlot.getShapeType() != CloudShapeType.DEFAULT) { + if (wordCloudPlot.getShapeType() != CloudShapeType.DEFAULT) { wordCloudPlot.setShapeImage((ImageBackground) imageBackgroundQuickPane.updateBean()); } else { wordCloudPlot.setShapeImage(null); From f5509f100b3134c0bfcbfd8624463c8e2a7e17d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 25 Jan 2021 17:19:41 +0800 Subject: [PATCH 108/111] =?UTF-8?q?CHART-17775=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java index d8d8ab8496..84ac5fbcb1 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java @@ -23,9 +23,4 @@ public class UISpinnerWithUnit extends UISpinner { protected UINumberField initNumberField() { return new UINumberFieldWithUnit(3, unit); } - - @Override - public UINumberFieldWithUnit getTextField() { - return (UINumberFieldWithUnit) super.getTextField(); - } } From 2ad39c8eec604157768fa4f92428c19327686033 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 25 Jan 2021 17:28:06 +0800 Subject: [PATCH 109/111] =?UTF-8?q?CHART-18050=20=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=BC=B9=E7=AA=97=E7=95=8C=E9=9D=A2=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA=E5=8F=AF=E6=8B=96=E6=8B=BD=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/component/richText/VanChartRichTextDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java index 2cf7050dc1..e95ce977fc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java @@ -18,7 +18,7 @@ public class VanChartRichTextDialog extends BasicDialog { this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor")); this.setBasicDialogSize(DEFAULT); GUICoreUtils.centerWindow(this); - this.setResizable(false); + this.setResizable(true); this.setModal(true); } From 380e67d9e15ab35abd35795c8ae3ff3651bab21b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 25 Jan 2021 20:03:40 +0800 Subject: [PATCH 110/111] =?UTF-8?q?CHART-18050=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=8F=8C=E5=88=97=E7=BD=91=E6=A0=BC=E5=B8=83=E5=B1=80=E4=BB=A3?= =?UTF-8?q?=E6=9B=BF=E6=B5=81=E5=BC=8F=E5=B8=83=E5=B1=80=EF=BC=8C=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/richText/VanChartFieldListPane.java | 2 +- .../component/richText/VanChartRichTextDialog.java | 2 +- .../designer/component/richText/VanChartRichTextPane.java | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java index 6e0e587be9..61d7cfb257 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java @@ -162,7 +162,7 @@ public class VanChartFieldListPane extends JPanel { tableField.setPreferredSize(new Dimension(FIELD_ADD_W, tableFieldNameList.size() * FIELD_ADD_H)); - return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap("数据集字段", tableField); + return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap(Toolkit.i18nText("Fine-Design_Report_Table_Field"), tableField); } protected List getDefaultFieldButtonList() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java index e95ce977fc..2cf7050dc1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java @@ -18,7 +18,7 @@ public class VanChartRichTextDialog extends BasicDialog { this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor")); this.setBasicDialogSize(DEFAULT); GUICoreUtils.centerWindow(this); - this.setResizable(true); + this.setResizable(false); this.setModal(true); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java index b7c4e968d3..d2d0769ee6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.component.richText; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.ui.ModernUIPane; import com.fr.plugin.chart.base.AttrTooltipContent; @@ -38,7 +39,8 @@ public class VanChartRichTextPane extends BasicBeanPane { } private JPanel createFieldContentPane() { - JPanel fieldPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + JPanel fieldPane = new JPanel(); + fieldPane.setLayout(FRGUIPaneFactory.create2ColumnGridLayout()); // 新增字段目录 JPanel fieldListContent = new JPanel(); @@ -48,12 +50,12 @@ public class VanChartRichTextPane extends BasicBeanPane { JScrollPane fieldListScrollPane = new JScrollPane(fieldListContent); fieldListScrollPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); fieldListScrollPane.setHorizontalScrollBar(null); - fieldListScrollPane.setBorder(BorderFactory.createTitledBorder("添加字段")); + fieldListScrollPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Add_Field"))); // 字段格式和汇总 JScrollPane fieldAttrScrollPane = new JScrollPane(fieldAttrPane); fieldAttrScrollPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); - fieldAttrScrollPane.setBorder(BorderFactory.createTitledBorder("字段设置")); + fieldAttrScrollPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Field_Setting"))); fieldPane.add(fieldListScrollPane); fieldPane.add(fieldAttrScrollPane); From a3603b0fa47f8846bd994486eb1b36fdad5100f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 26 Jan 2021 11:33:49 +0800 Subject: [PATCH 111/111] =?UTF-8?q?CHART-17983=20=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E7=9B=AE=E6=A0=87=E5=80=BC=E9=BB=98=E8=AE=A4=20&&=20C?= =?UTF-8?q?HART-18024=20=E6=95=B0=E6=8D=AE=E9=9B=86=E6=94=B9=E5=8F=98?= =?UTF-8?q?=EF=BC=8C=E7=9B=91=E5=90=AC=E9=87=8D=E5=A4=8D=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/DatabaseTableDataPane.java | 15 ++++++++++----- .../data/table/MeterPlotTableDataContentPane.java | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java index 3c5ebf5354..40983c56b5 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java @@ -58,7 +58,7 @@ public class DatabaseTableDataPane extends BasicPane{ * 返回选中的数据源. */ public TableDataWrapper getTableDataWrapper() { - return tableNameCombox.getSelectedItem(); + return tableNameCombox.getSelectedItem(); } public void populateBean(TableData nameTableData) { @@ -68,12 +68,12 @@ public class DatabaseTableDataPane extends BasicPane{ tableNameCombox.setSelectedTableDataByName(((NameTableData)nameTableData).getName()); } } - + @Override protected String title4PopupWindow() { return null; } - + /** * 数据集列表选中后的事件 */ @@ -82,7 +82,12 @@ public class DatabaseTableDataPane extends BasicPane{ } private void initTableCombox() { - tableNameCombox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); + tableNameCombox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()){ + //图表的数据集选择下拉框,不需要注册监听,chartEditPane已经注册了。 + public void registerDSChangeListener() { + + } + }; tableNameCombox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { @@ -94,7 +99,7 @@ public class DatabaseTableDataPane extends BasicPane{ } }); } - + private void initReviewButton() { reviewButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/search.png")); reviewButton.setBorder(new LineBorder(UIConstants.LINE_COLOR)); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java index c7830f246e..bc18fafda9 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java @@ -56,6 +56,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane this.setLayout(new BorderLayout()); nameBox = new UIComboBoxWithNone(); + nameBox.setSelectedIndex(nameBox.getItemCount() -1); valueBox = new UIComboBox(); targetBox = new UIComboBox(); custom = new TinyFormulaPane();