From bda5a9fab625b136cb92ac6b24378102a38a4d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Mon, 4 Dec 2023 16:27:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-107972=20=E3=80=90UI=E7=BF=BB?= =?UTF-8?q?=E6=96=B0=E3=80=91=E7=BF=BB=E6=96=B0=E5=BA=95=E9=83=A8SheetTab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fine/theme/light/ui/FineLightIconSet.java | 38 ++++ .../theme/light/ui}/UIFlatTreeUI.java | 2 +- .../resources/com/fine/theme/icon/add.svg | 5 + .../com/fine/theme/icon/add_disable.svg | 5 + .../com/fine/theme/icon/drag_left.svg | 5 + .../com/fine/theme/icon/drag_right.svg | 5 + .../icon/propertiestab/authorityedit.svg | 7 + .../propertiestab/authorityedit_disabled.svg | 8 + .../propertiestab/authorityedit_selected.svg | 7 + .../theme/icon/propertiestab/cellattr.svg | 6 + .../icon/propertiestab/cellattr_disabled.svg | 6 + .../icon/propertiestab/cellattr_selected.svg | 8 + .../theme/icon/propertiestab/cellelement.svg | 3 + .../propertiestab/cellelement_disabled.svg | 3 + .../propertiestab/cellelement_selected.svg | 6 + .../icon/propertiestab/conditionattr.svg | 3 + .../propertiestab/conditionattr_disabled.svg | 3 + .../propertiestab/conditionattr_selected.svg | 5 + .../icon/propertiestab/configuredroles.svg | 7 + .../configuredroles_disabled.svg | 7 + .../configuredroles_selected.svg | 7 + .../theme/icon/propertiestab/floatelement.svg | 10 + .../propertiestab/floatelement_disabled.svg | 10 + .../propertiestab/floatelement_selected.svg | 14 ++ .../icon/propertiestab/hyperLink_selected.svg | 5 + .../theme/icon/propertiestab/hyperlink.svg | 4 + .../icon/propertiestab/hyperlink_disabled.svg | 4 + .../theme/icon/propertiestab/widgetlib.svg | 5 + .../icon/propertiestab/widgetlib_disabled.svg | 5 + .../icon/propertiestab/widgetlib_selected.svg | 8 + .../icon/propertiestab/widgetsettings.svg | 10 + .../propertiestab/widgetsettings_disabled.svg | 6 + .../propertiestab/widgetsettings_selected.svg | 8 + .../com/fine/theme/icon/sheet/add_frm.svg | 20 ++ .../fine/theme/icon/sheet/add_frm_disable.svg | 24 +++ .../com/fine/theme/icon/sheet/add_sheet.svg | 24 +++ .../theme/icon/sheet/add_sheet_disable.svg | 20 ++ .../light/ui/laf/FineLightLaf.properties | 20 +- .../fr/design/mainframe/SheetNameTabPane.java | 187 +++++------------- 39 files changed, 394 insertions(+), 136 deletions(-) rename designer-base/src/main/java/com/{fr/design/gui/itree => fine/theme/light/ui}/UIFlatTreeUI.java (95%) create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/add.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/add_disable.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/drag_left.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/drag_right.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperLink_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperlink.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperlink_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings_disabled.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings_selected.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/sheet/add_frm.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/sheet/add_frm_disable.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/sheet/add_sheet.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/sheet/add_sheet_disable.svg diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java index 9af2a3dff6..9e9c6b97bd 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java @@ -31,6 +31,9 @@ public class FineLightIconSet extends AbstractIconSet { new SvgIconSource("template_theme", "com/fine/theme/icon/template_theme.svg", true), new SvgIconSource("remove", "com/fine/theme/icon/remove.svg", true), new SvgIconSource("search", "com/fine/theme/icon/search.svg", true), + new SvgIconSource("add", "com/fine/theme/icon/add.svg", true), + new SvgIconSource("drag_left", "com/fine/theme/icon/drag_left.svg", true), + new SvgIconSource("drag_right", "com/fine/theme/icon/drag_right.svg", true), // 数据集相关Icon new SvgIconSource("database", "com/fine/theme/icon/dataset/database.svg", true), @@ -65,6 +68,41 @@ public class FineLightIconSet extends AbstractIconSet { new SvgIconSource("refresh", "com/fine/theme/icon/filetree/refresh.svg", true), new SvgIconSource("new_folder", "com/fine/theme/icon/filetree/new_folder.svg", true), + // 属性面板Icon + new SvgIconSource("cellattr", "com/fine/theme/icon/propertiestab/cellattr.svg", false), + new SvgIconSource("cellattr_disabled", "com/fine/theme/icon/propertiestab/cellattr_disabled.svg", false), + new SvgIconSource("cellattr_selected", "com/fine/theme/icon/propertiestab/cellattr_selected.svg", false), + new SvgIconSource("cellelement", "com/fine/theme/icon/propertiestab/cellelement.svg", false), + new SvgIconSource("cellelement_disabled", "com/fine/theme/icon/propertiestab/cellelement_disabled.svg", false), + new SvgIconSource("cellelement_selected", "com/fine/theme/icon/propertiestab/cellelement_selected.svg", false), + new SvgIconSource("conditionattr", "com/fine/theme/icon/propertiestab/conditionattr.svg", false), + new SvgIconSource("conditionattr_disabled", "com/fine/theme/icon/propertiestab/conditionattr_disabled.svg", false), + new SvgIconSource("conditionattr_selected", "com/fine/theme/icon/propertiestab/conditionattr_selected.svg", false), + new SvgIconSource("floatelement", "com/fine/theme/icon/propertiestab/floatelement.svg", false), + new SvgIconSource("floatelement_disabled", "com/fine/theme/icon/propertiestab/floatelement_disabled.svg", false), + new SvgIconSource("floatelement_selected", "com/fine/theme/icon/propertiestab/floatelement_selected.svg", false), + new SvgIconSource("hyperlink", "com/fine/theme/icon/propertiestab/hyperlink.svg", false), + new SvgIconSource("hyperlink_disabled", "com/fine/theme/icon/propertiestab/hyperlink_disabled.svg", false), + new SvgIconSource("hyperlink_selected", "com/fine/theme/icon/propertiestab/hyperlink_selected.svg", false), + new SvgIconSource("widgetlib", "com/fine/theme/icon/propertiestab/widgetlib.svg", false), + new SvgIconSource("widgetlib_disabled", "com/fine/theme/icon/propertiestab/widgetlib_disabled.svg", false), + new SvgIconSource("widgetlib_selected", "com/fine/theme/icon/propertiestab/widgetlib_selected.svg", false), + new SvgIconSource("widgetsettings", "com/fine/theme/icon/propertiestab/widgetsettings.svg", false), + new SvgIconSource("widgetsettings_disabled", "com/fine/theme/icon/propertiestab/widgetsettings_disabled.svg", false), + new SvgIconSource("widgetsettings_selected", "com/fine/theme/icon/propertiestab/widgetsettings_selected.svg", false), + // TODO: 视觉未提供,先用旧的,待视觉提供后替换 + new SvgIconSource("configuredroles", "com/fine/theme/icon/propertiestab/configuredroles.svg", false), + new SvgIconSource("configuredroles_selected", "com/fine/theme/icon/propertiestab/configuredroles_selected.svg", false), + new SvgIconSource("configuredroles_disabled", "com/fine/theme/icon/propertiestab/configuredroles_disabled.svg", false), + new SvgIconSource("authorityedit", "com/fine/theme/icon/propertiestab/authorityedit.svg", false), + new SvgIconSource("authorityedit_disabled", "com/fine/theme/icon/propertiestab/authorityedit_disabled.svg", false), + new SvgIconSource("authorityedit_selected", "com/fine/theme/icon/propertiestab/authorityedit_selected.svg", false), + + // sheet标签栏相关icon + new SvgIconSource("add_worksheet", "com/fine/theme/icon/sheet/add_sheet.svg", true), + // TODO: 待视觉提供后替换 + new SvgIconSource("add_polysheet", "com/fine/theme/icon/sheet/add_frm.svg", true), + // CheckBox相关Icon new SvgIconSource("checkbox_checked", "com/fine/theme/icon/checkbox/checked.svg", true), new SvgIconSource("checkbox_unchecked", "com/fine/theme/icon/checkbox/unchecked.svg", true), diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/UIFlatTreeUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/UIFlatTreeUI.java similarity index 95% rename from designer-base/src/main/java/com/fr/design/gui/itree/UIFlatTreeUI.java rename to designer-base/src/main/java/com/fine/theme/light/ui/UIFlatTreeUI.java index d8d9546a25..2b9a12852e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/UIFlatTreeUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/UIFlatTreeUI.java @@ -1,4 +1,4 @@ -package com.fr.design.gui.itree; +package com.fine.theme.light.ui; import com.fine.theme.icon.LazyIcon; import com.formdev.flatlaf.ui.FlatTreeUI; diff --git a/designer-base/src/main/resources/com/fine/theme/icon/add.svg b/designer-base/src/main/resources/com/fine/theme/icon/add.svg new file mode 100644 index 0000000000..24f1235ada --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/add.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/add_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/add_disable.svg new file mode 100644 index 0000000000..b46e7d9a5b --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/add_disable.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/drag_left.svg b/designer-base/src/main/resources/com/fine/theme/icon/drag_left.svg new file mode 100644 index 0000000000..3908d661b3 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/drag_left.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/drag_right.svg b/designer-base/src/main/resources/com/fine/theme/icon/drag_right.svg new file mode 100644 index 0000000000..8a825724ab --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/drag_right.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit.svg new file mode 100644 index 0000000000..b7000e6f96 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit.svg @@ -0,0 +1,7 @@ + + + icon_属性_权限编辑_normal + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit_disabled.svg new file mode 100644 index 0000000000..7df1acf348 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit_disabled.svg @@ -0,0 +1,8 @@ + + + icon_属性_权限编辑_disabled + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit_selected.svg new file mode 100644 index 0000000000..e70df0a896 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/authorityedit_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_权限编辑_selected + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr.svg new file mode 100644 index 0000000000..cfb36fc85d --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr_disabled.svg new file mode 100644 index 0000000000..a1150442f7 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr_disabled.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr_selected.svg new file mode 100644 index 0000000000..17706fc98d --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellattr_selected.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement.svg new file mode 100644 index 0000000000..e152ee4c18 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement_disabled.svg new file mode 100644 index 0000000000..0aafcc1d1c --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement_disabled.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement_selected.svg new file mode 100644 index 0000000000..cb613c2c1f --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/cellelement_selected.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr.svg new file mode 100644 index 0000000000..d0497406f7 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr_disabled.svg new file mode 100644 index 0000000000..7c5064a191 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr_disabled.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr_selected.svg new file mode 100644 index 0000000000..9a85985534 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/conditionattr_selected.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles.svg new file mode 100644 index 0000000000..972f102b1d --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles.svg @@ -0,0 +1,7 @@ + + + icon_属性_配置角色_normal + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles_disabled.svg new file mode 100644 index 0000000000..61a2c84fea --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles_disabled.svg @@ -0,0 +1,7 @@ + + + icon_属性_配置角色_disabled + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles_selected.svg new file mode 100644 index 0000000000..74eef28bb3 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/configuredroles_selected.svg @@ -0,0 +1,7 @@ + + + icon_属性_配置角色_selected + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement.svg new file mode 100644 index 0000000000..4ef1ef8734 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement_disabled.svg new file mode 100644 index 0000000000..0c8a5296ed --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement_disabled.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement_selected.svg new file mode 100644 index 0000000000..1cbe48bfb2 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/floatelement_selected.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperLink_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperLink_selected.svg new file mode 100644 index 0000000000..582f97a227 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperLink_selected.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperlink.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperlink.svg new file mode 100644 index 0000000000..474c6e9fa8 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperlink.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperlink_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperlink_disabled.svg new file mode 100644 index 0000000000..ea0b21353a --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/hyperlink_disabled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib.svg new file mode 100644 index 0000000000..ff3df716ed --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib_disabled.svg new file mode 100644 index 0000000000..cd65358eda --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib_disabled.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib_selected.svg new file mode 100644 index 0000000000..d27dbe70d4 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetlib_selected.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings.svg new file mode 100644 index 0000000000..1ed6e9fa32 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings_disabled.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings_disabled.svg new file mode 100644 index 0000000000..7cd626f1c5 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings_disabled.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings_selected.svg b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings_selected.svg new file mode 100644 index 0000000000..04168614f9 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/propertiestab/widgetsettings_selected.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_frm.svg b/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_frm.svg new file mode 100644 index 0000000000..db67adf7c2 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_frm.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_frm_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_frm_disable.svg new file mode 100644 index 0000000000..209f893dc5 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_frm_disable.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_sheet.svg b/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_sheet.svg new file mode 100644 index 0000000000..e3a3b480e9 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_sheet.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_sheet_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_sheet_disable.svg new file mode 100644 index 0000000000..f40b7d35e1 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/sheet/add_sheet_disable.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + 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 cee3a00b75..3695d23491 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 @@ -84,7 +84,7 @@ ToggleButtonUI = com.fine.theme.light.ui.FineToggleButtonUI ToolBarUI = com.formdev.flatlaf.ui.FlatToolBarUI ToolBarSeparatorUI = com.formdev.flatlaf.ui.FlatToolBarSeparatorUI ToolTipUI = com.formdev.flatlaf.ui.FlatToolTipUI -TreeUI = com.fr.design.gui.itree.UIFlatTreeUI +TreeUI = com.fine.theme.light.ui.UIFlatTreeUI ViewportUI = com.formdev.flatlaf.ui.FlatViewportUI @@ -155,7 +155,14 @@ inactiveCaption = #bfcddb controlHighlight = lighten($controlShadow,12%) controlLtHighlight = lighten($controlShadow,25%) controlDkShadow = darken($controlShadow,15%) +DarkenedFontColor = #091E40 +DesignerSpaceColor = #FFF +# ---- MainWorkArea ---- + +CenterOuterShadowColor = #F2F4F8 +ZoneBorderColor = #E6E9EF +GridColumnRowColor = #F8F9FC #---- Button ---- @@ -1054,7 +1061,16 @@ Tree.icon.openColor = @icon Tree.hash = darken($Tree.background,10%) #---- East ---- -East.border = #E9EDF2 +East.border = #DADEE7 +East.TabSelectedColor = #B3CFF9 + +#---- South ---- +South.SheetTabRadius = 6 +South.SheetTabButtonGap = 20 +South.SheetIconSepDistance = 16 +South.SheetBarHeight = 24 +South.SheetAddWidth = 6 +South.SheetIconGap = 5 #---- Styles ------------------------------------------------------------------ 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 c971264b9b..f0f1cbf46c 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 @@ -1,6 +1,7 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; +import com.fine.theme.icon.LazyIcon; +import com.formdev.flatlaf.ui.FlatUIUtils; import com.fr.base.GraphHelper; import com.fr.base.svg.IconUtils; import com.fr.base.theme.ReportTheme; @@ -19,7 +20,6 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; import com.fr.main.impl.WorkBook; import com.fr.poly.PolyDesigner; import com.fr.report.poly.PolyWorkSheet; @@ -37,7 +37,7 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FontMetrics; -import java.awt.GradientPaint; +import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; @@ -49,8 +49,7 @@ import java.awt.event.ComponentListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; -import java.awt.geom.GeneralPath; -import java.awt.geom.Path2D; +import java.awt.geom.RoundRectangle2D; import java.util.ArrayList; import java.util.List; @@ -62,29 +61,32 @@ import java.util.List; */ public class SheetNameTabPane extends JComponent implements MouseListener, MouseMotionListener, RemoveListener { - private static final Color LINE_COLOR = new Color(0xababab); + private static final Color BORDER_COLOR = UIManager.getColor("ZoneBorderColor"); + private static final Color BACKGROUND_COLOR = UIManager.getColor("CenterOuterShadowColor"); + private static final Color SELECTED_COLOR = UIManager.getColor("DesignerSpaceColor"); + private static final Color FONT_COLOR = UIManager.getColor("DarkenedFontColor"); - private static final Icon ADD_WORK_SHEET = IconUtils.readIcon("/com/fr/design/standard/add_worksheet"); - protected static final Icon ADD_POLY_SHEET = IconUtils.readIcon("/com/fr/design/standard/add_polysheet"); - private static final Icon WORK_SHEET_ICON = IconUtils.readIcon("/com/fr/design/standard/worksheet"); - private static final Icon POLY_SHEET_ICON = IconUtils.readIcon("/com/fr/design/standard/polysheet"); + private static final Icon ADD_WORK_SHEET = new LazyIcon("add_worksheet"); + protected static final Icon ADD_POLY_SHEET = new LazyIcon("add_polysheet"); + + // TODO: 视觉未提供 private static final Icon LEFT_ICON = IconUtils.readIcon("/com/fr/design/standard/prepage/pre_page"); private static final Icon RIGHT_ICON = IconUtils.readIcon("/com/fr/design/standard/nextpage/next_page"); private static final Icon DISABLED_LEFT_ICON = IconUtils.readIcon("/com/fr/design/standard/prepage/pre_page_disabled.svg"); private static final Icon DISABLED_RIGHT_ICON = IconUtils.readIcon("/com/fr/design/standard/nextpage/next_page_disabled.svg"); + private static final int NUM = 10; - private static final int ICON_SEP_DISTANCE = 8; - private static final int TOOLBAR_HEIGHT = 16; - private static final int ADD_WIDTH_BY_SHEETNAME = 20; //sheet名字的文本到图标边框的距离 private static final int GRID_TOSHEET_RIGHT = 20; // 添加grid按钮右侧距sheet面板右侧的距离 private static final int POLY_TOSHEET_LEFT = 30; // 添加poly按钮左侧距sheet面板右侧的距离 private static final int POLY_TOSHEET_RIGHT = 50; // 添加poly按钮右侧距sheet面板右侧的距离 - private static final int SHEET_ICON_GAP = 5; // 每个sheet图标之间的距离 - private static final int GRAP = 12; // 给两个添加按钮与其他组件预留的间隔 - private static final int LEFT_CORNOR = 0;// 左角落. - private static final int RIGHT_CORNOR = 0;// 右角落 + private static final int ICON_SEP_DISTANCE = UIManager.getInt("South.SheetIconSepDistance"); + private static final int SHEET_ICON_GAP = UIManager.getInt("South.SheetIconGap"); // 每个sheet图标之间的距离 + private static final int TOOLBAR_HEIGHT = UIManager.getInt("South.SheetBarHeight"); + private static final int ADD_WIDTH_BY_SHEETNAME = UIManager.getInt("South.SheetAddWidth"); //sheet名字的文本到图标边框的距离 + private static final int TAB_BUTTON_GAP = UIManager.getInt("South.SheetTabButtonGap"); // 两个添加按钮与其他组件预留的间隔 + private static final int SHEET_TAB_RADIUS = UIManager.getInt("South.SheetTabRadius"); // sheet标签栏圆角属性 /** * 左移和右移按钮 @@ -158,25 +160,14 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse this.addMouseListener(this); this.addMouseMotionListener(this); this.setBorder(null); - this.setForeground(new Color(99, 99, 99)); + this.setForeground(FONT_COLOR); + this.setBackground(BACKGROUND_COLOR); leftButton = new UIButton(LEFT_ICON) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TOOLBAR_HEIGHT); } }; -// leftButton.setUI(new UIButtonUI() { -// @Override -// protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) { -// if (isPressed(b) && b.isPressedPainted()) { -// GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.PROPERTY_PANE_BACKGROUND); -// } else if (isRollOver(b)) { -// GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.PROPERTY_PANE_BACKGROUND); -// } else if (b.isNormalPainted()) { -// GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); -// } -// } -// }); leftButton.set4ToolbarButton(); leftButton.setDisabledIcon(DISABLED_LEFT_ICON); rightButton = new UIButton(RIGHT_ICON) { @@ -185,18 +176,6 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse return new Dimension(super.getPreferredSize().width, TOOLBAR_HEIGHT); } }; -// rightButton.setUI(new UIButtonUI() { -// @Override -// protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) { -// if (isPressed(b) && b.isPressedPainted()) { -// GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.PROPERTY_PANE_BACKGROUND); -// } else if (isRollOver(b)) { -// GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.PROPERTY_PANE_BACKGROUND); -// } else if (b.isNormalPainted()) { -// GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); -// } -// } -// }); rightButton.set4ToolbarButton(); rightButton.setDisabledIcon(DISABLED_RIGHT_ICON); buttonPane = new JPanel(new BorderLayout(3, 0)); @@ -347,13 +326,11 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse public Icon getAddWorkSheet(){ return ADD_WORK_SHEET; } - public Icon getWorkSheetIcon(){ - return WORK_SHEET_ICON; - } - @Override + /** * 画Tab */ + @Override public void paintComponent(Graphics g) { super.paintComponent(g); isAuthorityEditing = DesignerMode.isAuthorityEditing(); @@ -366,7 +343,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse double textHeight = this.getSize().getHeight() - 1; widthArray = calculateWidthArray(); - int operationWidth = GRAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth(); + int operationWidth = TAB_BUTTON_GAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth(); double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度 paintBackgroundAndLine(g2d, textHeight, maxWidth, charWidth, textAscent); checkButton(showCount < widthArray.length); @@ -389,7 +366,6 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse WorkBook workBook = reportComposite.getEditingWorkBook(); int reportCount = workBook.getReportCount(); double textX = 0; - Icon sheeticon; for (int i = scrollIndex; i < reportCount; i++) { lastOneIndex = i; TemplateReport templateReport = workBook.getTemplateReport(i); @@ -398,13 +374,11 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); isNeedPaintedAuthority = templateReport.getWorkSheetPrivilegeControl().checkInvisible(selectedRoles); } - sheeticon = templateReport instanceof WorkSheet ? getWorkSheetIcon() : POLY_SHEET_ICON; String sheetName = workBook.getReportName(i); - if (i == selectedIndex) { - paintSelectedTab(g2d, sheeticon, textHeight, textX, sheetName, charWidth, textAscent, isNeedPaintedAuthority); - } else { - paintUnSelectedTab(g2d, sheeticon, textHeight, textX, sheetName, charWidth, textAscent, i, isNeedPaintedAuthority); - } + + boolean selected = i == selectedIndex; + paintTab(g2d, textHeight, textX, sheetName, charWidth, textAscent, i, isNeedPaintedAuthority, selected); + int width = widthArray[i]; textX += width + 1; addIconlocation += width; @@ -423,7 +397,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse } // 画两个添加sheet图标 - iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + GRAP; + iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + TAB_BUTTON_GAP; paintAddButton(g2d); } @@ -433,78 +407,29 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3); } - /** - * 画选中的tab - * - * @param g2d - * @param sheeticon - * @param textHeight - * @param textX - * @param sheetName - * @param charWidth - * @param textAscent - */ - private void paintSelectedTab(Graphics2D g2d, Icon sheeticon, double textHeight, double textX, String sheetName, int charWidth, int textAscent, boolean isNeedPaintAuthority) { - double[] x = {textX, textX, textX + LEFT_CORNOR, textX + widthArray[selectedIndex] - RIGHT_CORNOR, textX + widthArray[selectedIndex] + RIGHT_CORNOR}; - double[] y = {0, textHeight - LEFT_CORNOR, textHeight, textHeight, 0}; - if (isNeedPaintAuthority) { - g2d.setPaint(new GradientPaint(1, 1, UIConstants.AUTHORITY_SHEET_LIGHT, 1, getHeight() - 1, UIConstants.AUTHORITY_SHEET_DARK)); - } else { - g2d.setPaint(new GradientPaint(1, 1, getBackground(), 1, getHeight() - 1, getBackground())); - } - GeneralPath generalPath = new GeneralPath(Path2D.WIND_EVEN_ODD, x.length); - generalPath.moveTo((float) x[0], (float) y[0]); - for (int index = 1; index < x.length; index++) { - generalPath.lineTo((float) x[index], (float) y[index]); + private void paintTab(Graphics2D g2d, double textHeight, double textX, String sheetName, int charWidth, int textAscent, int i, boolean isNeedPaintAuthority, boolean isSelected) { + + Color backgroundColor = isSelected ? SELECTED_COLOR: (isNeedPaintAuthority ? UIConstants.AUTHORITY_SHEET_UNSELECTED : getBackground()); + g2d.setColor(backgroundColor); + + // 绘制圆角矩形背景 + if (isSelected) { + FlatUIUtils.setRenderingHints(g2d); + + int width = widthArray[i]; + int height = (int) textHeight + SHEET_TAB_RADIUS; + RoundRectangle2D.Double backgroundRect = new RoundRectangle2D.Double(textX, -10, width, height, SHEET_TAB_RADIUS, SHEET_TAB_RADIUS); + g2d.fill(backgroundRect); + + g2d.setColor(BORDER_COLOR); + g2d.setStroke(new BasicStroke(1)); + g2d.draw(backgroundRect); } - generalPath.closePath(); - g2d.fill(generalPath); - sheeticon.paintIcon(this, g2d, (int) textX + charWidth, 2); - // peter:画字符 - g2d.setPaint(getForeground()); - GraphHelper.drawString(g2d, sheetName, (int) textX + charWidth + 14, textAscent); - } - /** - * 画不是选中状态的tab - * - * @param g2d - * @param sheetIcon - * @param textHeight - * @param textX - * @param sheetName - * @param charWidth - * @param textAscent - * @param i - */ - private void paintUnSelectedTab(Graphics2D g2d, Icon sheetIcon, double textHeight, double textX, String sheetName, int charWidth, int textAscent, int i, boolean isNeedPaintAuthority) { - Color tabBackground = UIConstants.COMBOBOX_BTN_NORMAL; - int width = widthArray[i]; - double[] x = {textX, textX, textX + LEFT_CORNOR, textX + width - RIGHT_CORNOR, textX + width, textX + width}; - double[] y = {0, textHeight - LEFT_CORNOR, textHeight, textHeight, textHeight - RIGHT_CORNOR, 0}; - if (isNeedPaintAuthority) { - g2d.setPaint(UIConstants.AUTHORITY_SHEET_UNSELECTED); - } else{ - g2d.setPaint(getBackground()); - } - GeneralPath generalPath = new GeneralPath(Path2D.WIND_EVEN_ODD, x.length); - generalPath.moveTo((float) x[0], (float) y[0]); - - for (int index = 1; index < x.length; index++) { - generalPath.lineTo((float) x[index], (float) y[index]); - } - generalPath.closePath(); - g2d.fill(generalPath); - - g2d.setPaint(LINE_COLOR); - double startX = textX > 0 ? textX - 1 : textX; - g2d.drawRect((int)startX, 0, width, (int)textHeight); - - sheetIcon.paintIcon(this, g2d, (int) textX + charWidth, 2); - g2d.setPaint(getForeground()); - // REPORT-40495 之前的g2d.drawString(),在windows下默认宋体时,无法绘制韩文字符,而GraphHelper的drawString中对韩文做了额外处理,可以绘制韩文字符 - GraphHelper.drawString(g2d, sheetName, (int) textX + charWidth + 14, textAscent); + // 绘制文本 + g2d.setColor(getForeground()); + GraphHelper.drawString(g2d, sheetName, (int) textX + charWidth + 4, textAscent + 2); } /** @@ -529,12 +454,8 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse for (int i = 0; i < selectedIndex; i++) { totalWidth += widthArray[i]; } - int distance = startPointX - totalWidth; - int[] x = {(int) lastPoint.getX() - distance, (int) lastPoint.getX() - distance, (int) lastPoint.getX() - distance + width, (int) lastPoint.getX() + width - distance}; - int[] y = {0, (int) (textHeight), (int) (textHeight), 0}; - g2d.drawPolygon(x, y, 4); // peter:画字符 g2d.setPaint(getForeground()); // richie:把当前选中的workSheet的名字画到鼠标拖动产生的图形上. @@ -799,7 +720,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse protected abstract class SheetInsertAction extends UpdateAction { SheetInsertAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert") + getTemplateReportType()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/control/add.png")); + this.setSmallIcon(new LazyIcon("add")); } @Override @@ -838,7 +759,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse widthArray = calculateWidthArray(); int width = widthArray[i]; textX += width + 1; - int operationWidth = GRAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth(); + int operationWidth = TAB_BUTTON_GAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth(); double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度 if (i < widthArray.length - 1 && textX + widthArray[i + 1] + 1 > maxWidth) { isOvertakeWidth = true; @@ -890,7 +811,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private class RemoveSheetAction extends UpdateAction { RemoveSheetAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + this.setSmallIcon(new LazyIcon("remove")); } @Override @@ -947,7 +868,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private class RenameSheetAction extends UpdateAction { RenameSheetAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Rename")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/rename.png")); + this.setSmallIcon(new LazyIcon("rename")); } @Override @@ -981,7 +902,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private class CopySheetAction extends UpdateAction { CopySheetAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy")); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); + this.setSmallIcon(new LazyIcon("copy")); } @Override From b71d6f55a6bdc8e16e43d4142380eb93a80f9368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Mon, 4 Dec 2023 16:36:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-107972=20=E3=80=90UI=E7=BF=BB?= =?UTF-8?q?=E6=96=B0=E3=80=91=E7=BF=BB=E6=96=B0=E4=B8=9C=E5=8C=BA=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=9D=A2=E6=9D=BF=E4=BE=A7=E8=BE=B9=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fine/theme/light/ui/PropertiesItemUI.java | 39 +++++++++++++ .../icontainer/UIEastResizableContainer.java | 45 ++++++--------- .../mainframe/EastRegionContainerPane.java | 55 ++++++++----------- 3 files changed, 79 insertions(+), 60 deletions(-) create mode 100644 designer-base/src/main/java/com/fine/theme/light/ui/PropertiesItemUI.java diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/PropertiesItemUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/PropertiesItemUI.java new file mode 100644 index 0000000000..45ce82d352 --- /dev/null +++ b/designer-base/src/main/java/com/fine/theme/light/ui/PropertiesItemUI.java @@ -0,0 +1,39 @@ +package com.fine.theme.light.ui; + +import com.formdev.flatlaf.ui.FlatButtonUI; +import com.formdev.flatlaf.ui.FlatUIUtils; + +import javax.swing.JComponent; +import java.awt.*; + +/** + * 东区属性面板,属性按钮UI + * + * @author Levy.Xie + * @since 11.0 + * Created on 2023/11/30 + */ +public class PropertiesItemUI extends FlatButtonUI { + + + public PropertiesItemUI(boolean shared) { + super(shared); + } + + @Override + protected void paintBackground(Graphics g, JComponent c) { + Color background = getBackground( c ); + if( background == null ) { + return; + } + Graphics2D g2 = (Graphics2D) g.create(); + try { + FlatUIUtils.setRenderingHints( g2 ); + g2.setColor(FlatUIUtils.deriveColor(background, getBackgroundBase(c, true))); + float focusWidth = FlatUIUtils.getBorderFocusWidth( c ); + FlatUIUtils.paintComponentBackground( g2, 0, 0, c.getWidth(), c.getHeight(), focusWidth, 0 ); + } finally { + g2.dispose(); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 6c35310fa4..a366626153 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -1,23 +1,27 @@ package com.fr.design.gui.icontainer; +import com.fine.theme.icon.LazyIcon; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.utils.SvgDrawUtils; import com.fr.design.utils.gui.GUICoreUtils; +import javax.swing.BorderFactory; +import javax.swing.UIManager; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; +import javax.swing.Icon; +import javax.swing.border.Border; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Image; import java.awt.LayoutManager; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -34,20 +38,18 @@ public class UIEastResizableContainer extends JPanel { private int containerWidth = 240; private int preferredWidth = 240; - private int topToolPaneHeight = 25; + private int topToolPaneHeight = 40; private int leftPaneWidth = 42; private JComponent leftPane; private JComponent rightPane; - // private HorizotalToolPane horizontToolPane; private TopToolPane topToolPane; private static final int ARROW_MARGIN = 15; private static final int ARROW_RANGE = 35; -// private boolean isRightPaneVisible = true; public UIEastResizableContainer() { this(new JPanel(), new JPanel()); @@ -68,21 +70,17 @@ public class UIEastResizableContainer extends JPanel { } -// public void setRightPaneVisible(boolean isVisible){ -// this.isRightPaneVisible = isVisible; -// } private void setPreferredWidth(int width) { this.preferredWidth = width; } public UIEastResizableContainer(JComponent leftPane, JComponent rightPane) { -// setBackground(UIConstants.PROPERTY_PANE_BACKGROUND); this.leftPane = leftPane; this.rightPane = rightPane; - this.topToolPane = new TopToolPane(); -// topToolPane.setBackground(UIConstants.PROPERTY_PANE_BACKGROUND); + topToolPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 1, 0)); + topToolPane.setBorder(BorderFactory.createMatteBorder(1 ,1, 0, 1, UIManager.getColor("East.border"))); setLayout(containerLayout); add(topToolPane); @@ -176,12 +174,8 @@ public class UIEastResizableContainer extends JPanel { if (topToolPane == null || rightPane == null) { return; } - -// topToolPane.setBounds(0, 0, containerWidth, topToolPaneHeight);//0,0,10,462 topToolPane.setBounds(0, 0, leftPaneWidth, topToolPaneHeight);//0,0,10,462 leftPane.setBounds(0, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight); - -// parameterPane.setBounds(20, 0, 230, getParameterPaneHeight());//10,0,230,462 rightPane.setBounds(leftPaneWidth, 0, containerWidth - leftPaneWidth, getHeight());//20,0,230,0 } @@ -322,21 +316,18 @@ public class UIEastResizableContainer extends JPanel { @Override public void paint(Graphics g) { - Image button; + // 绘制边框 + Border border = getBorder(); + if (border != null) { + border.paintBorder(this, g, 0, 0, getWidth(), getHeight()); + } + Icon button; if (containerWidth == leftPaneWidth) { - if (model == UIConstants.MODEL_NORMAL) { - button = UIConstants.DRAG_LEFT_NORMAL; - } else { - button = UIConstants.DRAG_LEFT_PRESS; - } + button = new LazyIcon("drag_left"); } else { - if (model == UIConstants.MODEL_NORMAL) { - button = UIConstants.DRAG_RIGHT_NORMAL; - } else { - button = UIConstants.DRAG_RIGHT_PRESS; - } + button = new LazyIcon("drag_right"); } - SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, 10, 7, null)); + button.paintIcon(this, g, 12, 12); } } } \ No newline at end of file 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 9898d606ff..73b37acd6c 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,9 +1,10 @@ package com.fr.design.mainframe; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.light.ui.PropertiesItemUI; import com.formdev.flatlaf.FlatDarkLaf; import com.formdev.flatlaf.ui.FlatLineBorder; 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; @@ -80,9 +81,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private static final int CONTAINER_WIDTH = containerWidth(); private static final int TAB_WIDTH = 42; private static final int TAB_BUTTON_WIDTH = 40; - private static final int TAB_BUTTON_HEIGHT = 34; + private static final int TAB_BUTTON_HEIGHT = 40; private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH; - private static final int POPUP_TOOLPANE_HEIGHT = 27; + private static final int POPUP_TOOLPANE_HEIGHT = 40; private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; // 弹出对话框高度 private static final int POPUP_MIN_HEIGHT = 145; @@ -416,7 +417,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { // 左侧按钮面板 private void initLeftPane() { leftPane = new JPanel(); - leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 1, 4)); + leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 1, 0)); for (PropertyItem item : propertyItemMap.values()) { if (item.isPoppedOut() || !item.isVisible()) { continue; @@ -767,16 +768,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer { // 完整icon路径为 ICON_BASE_DIR + btnIconName + iconSuffix private static final String ICON_BASE_DIR = "/com/fr/design/standard/propertiestab/"; - 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 String ICON_SUFFIX_NORMAL = StringUtils.EMPTY; + private static final String ICON_SUFFIX_DISABLED = "_disabled"; + private static final String ICON_SUFFIX_SELECTED = "_selected"; 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, 三者之一 - private final Color selectedBtnBackground = new Color(0xF5F5F7); - private Color originBtnBackground; + private final Color selectedBtnBackground = UIManager.getColor("East.TabSelectedColor"); private ActionListener actionListener; @@ -967,15 +967,18 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private String getBtnIconUrl() { - return getIconBaseDir() + btnIconName + iconSuffix; } + private String getBtnIconId() { + return btnIconName + iconSuffix; + } + public void resetButtonIcon() { + button.setBackground(null); if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) { iconSuffix = ICON_SUFFIX_NORMAL; - button.setIcon(IconUtils.readIcon(getBtnIconUrl())); -// button.setBackground(originBtnBackground); + button.setIcon(new LazyIcon(getBtnIconId())); button.setOpaque(false); } } @@ -983,8 +986,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void setTabButtonSelected() { resetPropertyIcons(); iconSuffix = ICON_SUFFIX_SELECTED; - button.setIcon(IconUtils.readIcon(getBtnIconUrl())); -// button.setBackground(selectedBtnBackground); + button.setIcon(new LazyIcon(getBtnIconId())); + button.setBackground(selectedBtnBackground); button.setOpaque(true); selectedItem = this; } @@ -994,28 +997,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private void initButton() { - button = new UIButton(IconUtils.readIcon(getBtnIconUrl())) { + button = new UIButton(new LazyIcon(getBtnIconId())) { public Dimension getPreferredSize() { return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT); } }; - button.setDisabledIcon(IconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED)); + button.setDisabledIcon(new LazyIcon(btnIconName + ICON_SUFFIX_DISABLED)); button.set4LargeToolbarButton(); -// button.setUI(new UIButtonUI() { -// @Override -// protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) { -// if (isPressed(b) && b.isPressedPainted()) { -// Color pressColor = isTabButtonSelected() ? UIConstants.TAB_BUTTON_PRESS_SELECTED : UIConstants.TAB_BUTTON_PRESS; -// GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), pressColor); -// } else if (isRollOver(b)) { -// Color hoverColor = isTabButtonSelected() ? UIConstants.TAB_BUTTON_HOVER_SELECTED : UIConstants.TAB_BUTTON_HOVER; -// GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), hoverColor); -// } else if (b.isNormalPainted()) { -// GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); -// } -// } -// }); - originBtnBackground = button.getBackground(); + button.setUI(new PropertiesItemUI(false)); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -1284,9 +1273,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { this.propertyItem = propertyItem; this.title = propertyItem.getTitle(); originColor = UIConstants.UI_TOOLBAR_COLOR; + this.setForeground(UIManager.getColor("DarkenedFontColor")); contentPane = new JPanel(); -// contentPane.setBackground(originColor); contentPane.setLayout(new BorderLayout()); UILabel label = new UILabel(title); contentPane.add(label, BorderLayout.WEST); @@ -1294,7 +1283,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { setLayout(new BorderLayout()); add(contentPane, BorderLayout.CENTER); - setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); + setBorder(BorderFactory.createMatteBorder(1, 0, 1, 0, UIManager.getColor("East.border"))); initToolButton(buttonType); }