From f9e9fa0625ba2a875150c1f728d742e69d56cb3b Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 6 Sep 2024 18:41:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-127437=20fix:=20newui=20=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/TableDataTree.java | 6 ++-- .../wrapper/ServerTableDataWrapper.java | 8 ++++- .../fr/design/file/SaveSomeTemplatePane.java | 3 -- .../gui/controlpane/JListControlPane.java | 3 +- .../com/fr/design/gui/ilist/JNameEdList.java | 6 ++-- .../fr/design/i18n/DesignSizeI18nManager.java | 3 +- .../fr/design/mainframe/DesignerFrame.java | 8 +++-- .../design/mainframe/check/CheckButton.java | 31 +++++++++++-------- .../com/fine/theme/icon/tip/waiting.svg | 4 +++ .../fine/theme/light/ui/fine_light.icon.json | 1 + .../theme/light/ui/laf/FineLaf.properties | 2 +- .../light/ui/laf/FineLightLaf.properties | 1 + .../fr/design/i18n/dimension_zh.properties | 2 +- 13 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/tip/waiting.svg diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java index ca7cb38b4b..b1877fa75e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java @@ -64,11 +64,11 @@ public class TableDataTree extends UserObjectRefreshJTree { } else if (nameObject.getObject() instanceof Integer) { int num = (Integer) nameObject.getObject(); if (num == TableDataSourceOP.SERVER_TABLE_DATA) { - this.setIcon(IconUtils.readIcon(IconPathConstants.STD_SHOW_ICON_PATH)); + this.setIcon(new LazyIcon("server_database")); } else if (num == TableDataSourceOP.STORE_PRECEDURE_DATA) { - this.setIcon(IconUtils.readIcon(IconPathConstants.SP_SHOW_ICON_PATH)); + this.setIcon(new LazyIcon("store_procedure")); } else { - this.setIcon(IconUtils.readIcon(IconPathConstants.DS_QUERY_ICON_PATH)); + this.setIcon(new LazyIcon("database")); } } else { this.setIcon(new LazyIcon("store_procedure")); diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java index fb02f1a3f8..0d7b1297ea 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java @@ -6,6 +6,8 @@ import com.fr.base.svg.SVGLoader; import com.fr.data.impl.ClassTableData; import com.fr.data.impl.DBTableData; import com.fr.data.impl.EmbeddedTableData; +import com.fr.data.impl.FileTableData; +import com.fr.data.impl.MultiTDTableData; import com.fr.data.impl.RecursionTableData; import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.design.icon.WarningIcon; @@ -39,7 +41,11 @@ public final class ServerTableDataWrapper extends AbstractTableDataWrapper { return new LazyIcon("tree"); } else if (tabledata instanceof StoreProcedure) { return new LazyIcon("store_procedure"); - } + } else if (tabledata instanceof FileTableData) { + return new LazyIcon("file"); + } else if (tabledata instanceof MultiTDTableData) { + return new LazyIcon("multi"); + } return new LazyIcon("server_database"); } diff --git a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java index 8ee5c61fb2..1932dab3d6 100644 --- a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java @@ -85,9 +85,6 @@ public class SaveSomeTemplatePane extends BasicPane { templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); scrollPane.setBorder(new FineRoundBorder()); - if (SystemInfo.isWindows) { - scrollPane.getVerticalScrollBar().setUI(new UIScrollBarUI()); - } this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 7a1094ab17..a4b80242a9 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -30,6 +30,7 @@ import javax.swing.JPopupMenu; import javax.swing.ListCellRenderer; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; +import javax.swing.UIManager; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.BorderLayout; @@ -381,7 +382,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - setPreferredSize(new Dimension(list.getWidth(), FineUIScale.scale(24))); + setPreferredSize(new Dimension(list.getWidth(), FineUIScale.scale(UIManager.getInt("List.cellRender.height")))); if (value instanceof ListModelElement) { ListModelElement element = ((ListModelElement) value); Nameable nameable = element.wrapper; diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java index 4c9135e151..7029fac1f8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java @@ -22,10 +22,10 @@ import java.util.Vector; public class JNameEdList extends UIList implements CellEditorListener { /** - * 原值为20,设计器图标由png替换为svg之后JNameEdList的icon大小为16x16 + * 原值为20,设计器图标由png替换为svg之后JNameEdList的icon大小为24x24 * 重命名是会出现左侧一部分带有背景色的渲染 */ - private static final int ICON_WIDTH = 16; + private static final int ICON_WIDTH = 24; private boolean editable = true; // kunsnat: 是否强制ListName是数字 (int型) @@ -240,7 +240,7 @@ public class JNameEdList extends UIList implements CellEditorListener { return false; } Rectangle rect = this.getCellBounds(index, index); - // alex:所有的JNameEdList都有Icon,空出前面20 * 20的位置就是放的Icon + // alex:所有的JNameEdList都有Icon,空出前面24 * 24的位置就是放的Icon rect.setRect(createRect(rect, getIconWidth())); editorComp.setBounds(rect); diff --git a/designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java b/designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java index 1dd2306b89..8b0e8739cf 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java +++ b/designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java @@ -1,5 +1,6 @@ package com.fr.design.i18n; +import com.fine.theme.utils.FineUIScale; import com.fr.design.dialog.BasicDialog; import com.fr.general.GeneralContext; import com.fr.locale.LocaleManager; @@ -52,6 +53,6 @@ public class DesignSizeI18nManager { if (arr.length < SPLIT_LENGTH) { return BasicDialog.DEFAULT; } - return new Dimension(Integer.parseInt(arr[WIDTH_INDEX]), Integer.parseInt(arr[HEIGHT_INDEX])); + return FineUIScale.scale(new Dimension(Integer.parseInt(arr[WIDTH_INDEX]), Integer.parseInt(arr[HEIGHT_INDEX]))); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index a4239bc64c..1417bd548a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -107,6 +107,8 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.CopyOnWriteArrayList; +import static com.fine.theme.utils.FineUIScale.scale; + public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { private static final String DESIGNER_FRAME_NAME = "designer_frame"; @@ -115,7 +117,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private static final long serialVersionUID = -8732559571067484460L; - private static final int MENU_HEIGHT = 26; + private static final int MENU_HEIGHT = scale(26); private static final Integer SECOND_LAYER = 100; @@ -578,8 +580,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta closeButton.setBorder(null); int x = contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - closeMode.getIconWidth() / 2; int y = MENU_HEIGHT - closeMode.getIconHeight() / 2; - closeButton.setBounds(x, y, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, - UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH); + closeButton.setBounds(x, y, scale(UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH), + scale(UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH)); } /** diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java index dc502dcdf4..09170352fd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.check; import com.fine.theme.icon.LazyIcon; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseUtils; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; @@ -24,7 +25,7 @@ import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; -import java.awt.FlowLayout; +import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; @@ -32,6 +33,10 @@ import java.awt.event.WindowEvent; import java.util.Set; import java.util.concurrent.ExecutionException; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.row; import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog; import static javax.swing.JOptionPane.OK_CANCEL_OPTION; import static javax.swing.JOptionPane.OK_OPTION; @@ -73,7 +78,7 @@ public class CheckButton extends UIButton { } if (set.isEmpty()) { okButton.setEnabled(true); - imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png")); + imageLabel.setIcon(new LazyIcon("success", 20)); message.setText("" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + ""); } else { if (dialog != null) { @@ -172,7 +177,7 @@ public class CheckButton extends UIButton { @Override public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { - imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png")); + imageLabel.setIcon(new LazyIcon("error", 20)); message.setText("" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + ""); okButton.setEnabled(true); return null; @@ -198,16 +203,16 @@ public class CheckButton extends UIButton { dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension(this.getClass().getName())); JPanel jp = new JPanel(); JPanel upPane = new JPanel(); - JPanel downPane = new JPanel(); - imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/waiting.png")); - upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); - upPane.add(imageLabel); - upPane.add(message); - downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); - downPane.add(okButton); - jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); - jp.add(upPane); - jp.add(downPane); + JPanel downPane = new JPanel(new BorderLayout()); + imageLabel = new UILabel(new LazyIcon("waiting", 20)); + upPane.add(row(10, + column(cell(imageLabel),flex()), cell(message) + ).getComponent()); + downPane.add(okButton, BorderLayout.EAST); + jp.setLayout(new BorderLayout()); + jp.add(column(flex(), cell(upPane), flex()).getComponent()); + jp.add(downPane, BorderLayout.SOUTH); + jp.setBorder(new ScaledEmptyBorder(10, 10, 10,10)); dialog.add(jp); dialog.setResizable(false); dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this)); diff --git a/designer-base/src/main/resources/com/fine/theme/icon/tip/waiting.svg b/designer-base/src/main/resources/com/fine/theme/icon/tip/waiting.svg new file mode 100644 index 0000000000..d28bde3384 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/tip/waiting.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json index aaa6df6d59..e2dba1c4ce 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json @@ -439,6 +439,7 @@ "top": "border/top.svg", "all":"border/all.svg", "error":"tip/error.svg", + "waiting":"tip/waiting.svg", "information":"tip/information.svg", "new_information":"tip/new_information.svg", "success":"tip/success.svg", diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties index 9ac0952b65..cd5d39cb54 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties @@ -26,7 +26,7 @@ ProgressBarUI=com.formdev.flatlaf.ui.FlatProgressBarUI RadioButtonUI=com.formdev.flatlaf.ui.FlatRadioButtonUI RadioButtonMenuItemUI=com.formdev.flatlaf.ui.FlatRadioButtonMenuItemUI RootPaneUI=com.formdev.flatlaf.ui.FlatRootPaneUI -ScrollBarUI=com.formdev.flatlaf.ui.FlatScrollBarUI +ScrollBarUI=com.fr.design.gui.iscrollbar.UIScrollBarUI ScrollPaneUI=com.formdev.flatlaf.ui.FlatScrollPaneUI SeparatorUI=com.formdev.flatlaf.ui.FlatSeparatorUI SliderUI=com.fine.theme.light.ui.FineSliderUI diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties index d941f77eec..22a4f0eef8 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties @@ -450,6 +450,7 @@ List.showCellFocusIndicator = false List.cellRender.background = #FFF List.cellRender.button.width = 28 List.cellRender.button.height = 24 +List.cellRender.height = 24 List.wrapper.text.fontColor = #0a1c3877 #---- Menu ---- diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index bc6f1a8810..1e30edaf4e 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -1,5 +1,5 @@ # \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height -com.fr.design.mainframe.check.CheckButton=250*118 +com.fr.design.mainframe.check.CheckButton=360*160 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=360*185 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=360*280 From afdbf158bf189c80e8ac49e107a6810b3535a614 Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 6 Sep 2024 18:51:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/ServerTableDataWrapper.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java index 0d7b1297ea..4a07d9ab91 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java @@ -27,13 +27,10 @@ public final class ServerTableDataWrapper extends AbstractTableDataWrapper { @Override public Icon getIcon() { if (tabledata instanceof DBTableData) { - if (StringUtils.isBlank(((DBTableData) tabledata).getQuery())) { - return new LazyIcon("server_database_warning"); - } - else { - return new LazyIcon("server_database"); - } - } else if (tabledata instanceof ClassTableData) { + return getDBTableDataIcon(); + } + + if (tabledata instanceof ClassTableData) { return new LazyIcon("class_table_data"); } else if (tabledata instanceof EmbeddedTableData) { return new LazyIcon("data_table"); @@ -49,6 +46,15 @@ public final class ServerTableDataWrapper extends AbstractTableDataWrapper { return new LazyIcon("server_database"); } + private Icon getDBTableDataIcon() { + if (StringUtils.isBlank(((DBTableData) tabledata).getQuery())) { + return new LazyIcon("server_database_warning"); + } + else { + return new LazyIcon("server_database"); + } + } + /** * 是否异常 * @return From 8888ff5f866531a4da1b6824146c5bf395c9ed0e Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 6 Sep 2024 19:32:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E5=9B=9E=E9=80=80=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/file/SaveSomeTemplatePane.java | 3 +++ .../resources/com/fine/theme/light/ui/laf/FineLaf.properties | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java index 1932dab3d6..8ee5c61fb2 100644 --- a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java @@ -85,6 +85,9 @@ public class SaveSomeTemplatePane extends BasicPane { templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); scrollPane.setBorder(new FineRoundBorder()); + if (SystemInfo.isWindows) { + scrollPane.getVerticalScrollBar().setUI(new UIScrollBarUI()); + } this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties index cd5d39cb54..9ac0952b65 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties @@ -26,7 +26,7 @@ ProgressBarUI=com.formdev.flatlaf.ui.FlatProgressBarUI RadioButtonUI=com.formdev.flatlaf.ui.FlatRadioButtonUI RadioButtonMenuItemUI=com.formdev.flatlaf.ui.FlatRadioButtonMenuItemUI RootPaneUI=com.formdev.flatlaf.ui.FlatRootPaneUI -ScrollBarUI=com.fr.design.gui.iscrollbar.UIScrollBarUI +ScrollBarUI=com.formdev.flatlaf.ui.FlatScrollBarUI ScrollPaneUI=com.formdev.flatlaf.ui.FlatScrollPaneUI SeparatorUI=com.formdev.flatlaf.ui.FlatSeparatorUI SliderUI=com.fine.theme.light.ui.FineSliderUI