From 0a4d5aad4ef856f9f980f49b397bcd0d121b0020 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Wed, 27 Dec 2023 20:01:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-107973=20=E4=BF=AE=E6=94=B9=E6=B8=90?= =?UTF-8?q?=E5=8F=98=E8=89=B2=E6=BB=91=E5=9D=97UI=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/light/ui/FineGradientBarUI.java | 35 +++++++++++++------ .../gradient/AbstractComponentPopBox.java | 13 +++---- .../background/gradient/GradientBar.java | 2 -- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineGradientBarUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineGradientBarUI.java index fdf4a7f601..a57f40c8bb 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineGradientBarUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineGradientBarUI.java @@ -1,6 +1,7 @@ package com.fine.theme.light.ui; import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.ui.FlatPanelUI; import com.fr.design.style.background.gradient.GradientBar; import com.fr.design.style.background.gradient.SelectColorPointBtn; import com.fr.stable.AssistUtils; @@ -31,7 +32,7 @@ import java.util.List; * @since 11.0 * Created on 2023/12/19 */ -public class FineGradientBarUI extends ComponentUI { +public class FineGradientBarUI extends FlatPanelUI { private int directionalShapeSize; private int recHeight; @@ -54,6 +55,10 @@ public class FineGradientBarUI extends ComponentUI { boolean[] hoverStatus; + protected FineGradientBarUI(boolean shared) { + super(shared); + } + /** * 创建UI @@ -62,7 +67,7 @@ public class FineGradientBarUI extends ComponentUI { * @return UI */ public static ComponentUI createUI(JComponent c) { - return new FineGradientBarUI(); + return new FineGradientBarUI(false); } @Override @@ -71,10 +76,6 @@ public class FineGradientBarUI extends ComponentUI { installDefaults(c); gradientBar = (GradientBar) c; - list = gradientBar.getList(); - p1 = gradientBar.getSelectColorPointBtnP1(); - p2 = gradientBar.getSelectColorPointBtnP2(); - hoverStatus = new boolean[list.size()]; mouseMotionListener = new TrackMotionListener(); mouseListener = new TrackMouseListener(); gradientBar.addMouseMotionListener(mouseMotionListener); @@ -143,7 +144,6 @@ public class FineGradientBarUI extends ComponentUI { int halfSize = directionalShapeSize / 2; boolean x = e.getX() <= gradientBar.getWidth() - halfSize && e.getX() >= halfSize; if (x) { - list.get(index).setX(e.getX()); list.get(index).setStartPosition((double) (e.getX() - halfSize) / (gradientBar.getWidth() - directionalShapeSize)); gradientBar.repaint(); } @@ -201,6 +201,15 @@ public class FineGradientBarUI extends ComponentUI { public void paint(Graphics g, JComponent c) { Graphics2D g2 = (Graphics2D) g; + + gradientBar = (GradientBar) c; + list = gradientBar.getList(); + p1 = gradientBar.getSelectColorPointBtnP1(); + p2 = gradientBar.getSelectColorPointBtnP2(); + if (hoverStatus == null) { + hoverStatus = new boolean[list.size()]; + } + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); @@ -232,6 +241,13 @@ public class FineGradientBarUI extends ComponentUI { colors[i] = btnList.get(i).getColorInner(); } + float[] dist = getColorFloats(c, btnList); + LinearGradientPaint paint = new LinearGradientPaint(start, end, dist, colors); + g2d.setPaint(paint); + g2d.fillRect(halfSize + borderWidth, borderWidth, c.getWidth() - directionalShapeSize - borderWidth * 2, recHeight - borderWidth * 2); + } + + private float[] getColorFloats(GradientBar c, List btnList) { float[] dist = new float[btnList.size()]; for (int i = 0; i < btnList.size(); i++) { if (btnList.get(i).getStartPosition() < 0) { @@ -243,6 +259,7 @@ public class FineGradientBarUI extends ComponentUI { } btnList.get(i).setX(dist[i] * (c.getWidth() - directionalShapeSize) + (double) directionalShapeSize / 2); + btnList.get(i).setY(recHeight); } float dist1 = dist[btnList.size() - 1]; @@ -250,9 +267,7 @@ public class FineGradientBarUI extends ComponentUI { if (AssistUtils.equals(dist1, dist2)) { dist[btnList.size() - 1] = (float) (dist2 + offset); } - LinearGradientPaint paint = new LinearGradientPaint(start, end, dist, colors); - g2d.setPaint(paint); - g2d.fillRect(halfSize + borderWidth, borderWidth, c.getWidth() - directionalShapeSize - borderWidth * 2, recHeight - borderWidth * 2); + return dist; } private void paintBorder(Graphics2D g2d, GradientBar c) { diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/AbstractComponentPopBox.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/AbstractComponentPopBox.java index ef647f2bde..2adfc85ef7 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/AbstractComponentPopBox.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/AbstractComponentPopBox.java @@ -4,14 +4,11 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.background.BackgroundJComponent; import com.fr.general.Background; -import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JWindow; import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.util.ArrayList; -import java.util.List; import java.awt.AWTEvent; import java.awt.Dimension; import java.awt.Point; @@ -21,13 +18,17 @@ import java.awt.Window; import java.awt.event.AWTEventListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; /** + * 渐变色弹出窗口 + * * @author Bjorn - * @version 10.0 - * Created by Bjorn on 2021-08-24 + * @since 10.0 + * Created on 2021-08-24 */ -public abstract class AbstractComponentPopBox extends JComponent { +public abstract class AbstractComponentPopBox extends JPanel { protected BackgroundJComponent displayComponent; diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index 1540191df3..7954387448 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -1,6 +1,5 @@ package com.fr.design.style.background.gradient; -import com.fine.theme.light.ui.FineGradientBarUI; import com.fine.theme.utils.FineUIUtils; import com.fr.base.background.ColorBackground; import com.fr.design.event.UIObserver; @@ -86,7 +85,6 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, p2.setStartPosition(1); addMouseClickListener(); iniListener(); - setUI(new FineGradientBarUI()); } public List getList() { From b3f8663e3b3e3f32ab2c8f6b3ed702bd2ffb15e8 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 4 Jan 2024 15:09:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-107973=20=E5=BC=B9=E7=AA=97=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=EF=BC=8C=E5=8C=97=E5=8C=BA=E8=83=8C=E6=99=AF=E3=80=81?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=E8=BE=B9=E6=A1=86=20=E7=BF=BB?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fine/theme/light/ui/FineLightIconSet.java | 19 ++++- .../light/ui/FineReportComponentBorder.java | 28 ++++++++ .../ui/FineReportComponentCompositeUI.java | 40 +++++++++++ .../DefaultTemplateTreeDefineProcessor.java | 7 +- .../com/fr/design/gui/imenu/UIHeadMenu.java | 6 +- .../com/fr/design/gui/imenu/UIMenuItem.java | 5 -- .../mainframe/CenterRegionContainerPane.java | 15 ++-- .../fr/design/mainframe/DesktopCardPane.java | 1 + .../fr/design/mainframe/JFormSliderPane.java | 69 +++++------------- .../mainframe/NorthRegionContainerPane.java | 4 +- .../mainframe/loghandler/LogMessageBar.java | 60 +++++++--------- .../main/java/com/fr/design/menu/MenuDef.java | 14 +++- .../ui/NotificationCenterPane.java | 4 +- .../com/fine/theme/icon/cell/cellClear.svg | 5 ++ .../theme/icon/cell/cellClear_disable.svg | 5 ++ .../theme/icon/cell/cellConditionalAttr.svg | 5 ++ .../icon/cell/cellConditionalAttr_disable.svg | 5 ++ .../fine/theme/icon/cell/cellElementAttr.svg | 5 ++ .../icon/cell/cellElementAttr_disable.svg | 5 ++ .../fine/theme/icon/cell/cellExpandAttr.svg | 11 +++ .../icon/cell/cellExpandAttr_disable.svg | 11 +++ .../theme/icon/cell/cellHyperLinkAttr.svg | 14 ++++ .../icon/cell/cellHyperLinkAttr_disable.svg | 14 ++++ .../fine/theme/icon/cell/cellOtherAttr.svg | 5 ++ .../theme/icon/cell/cellOtherAttr_disable.svg | 5 ++ .../fine/theme/icon/cell/cellPresentAttr.svg | 5 ++ .../icon/cell/cellPresentAttr_disable.svg | 5 ++ .../fine/theme/icon/cell/cellStyleAttr.svg | 5 ++ .../theme/icon/cell/cellStyleAttr_disable.svg | 5 ++ .../fine/theme/icon/cell/cellWidgetAttr.svg | 7 ++ .../icon/cell/cellWidgetAttr_disable.svg | 7 ++ .../theme/icon/filetree/monochrome_copy.svg | 5 ++ .../icon/filetree/monochrome_copy_disable.svg | 5 ++ .../theme/icon/filetree/monochrome_paste.svg | 5 ++ .../filetree/monochrome_paste_disable.svg | 5 ++ .../com/fine/theme/icon/filetree/move.svg | 5 ++ .../fine/theme/icon/filetree/move_disable.svg | 5 ++ .../com/fine/theme/icon/log/logMsg.svg | 5 ++ .../fine/theme/icon/log/logMsg_disable.svg | 5 ++ .../com/fine/theme/icon/log/logMsg_dot.svg | 8 +++ .../theme/icon/log/logMsg_dot_disable.svg | 8 +++ .../theme/light/ui/laf/FineLaf.properties | 1 + .../light/ui/laf/FineLightLaf.properties | 27 +++++-- .../actions/cell/CellAttributeAction.java | 4 +- .../actions/cell/CellExpandAttrAction.java | 4 +- .../actions/cell/CellStyleAttrAction.java | 5 +- .../actions/cell/CellWidgetAttrAction.java | 4 +- .../cell/ConditionAttributesAction.java | 4 +- .../design/actions/cell/EditCellAction.java | 4 +- .../design/actions/edit/HyperlinkAction.java | 4 +- .../utils/DeprecatedActionManager.java | 12 ++-- .../fr/design/cell/bar/DynamicScrollBar.java | 1 + .../mainframe/ReportComponentComposite.java | 20 ++++-- .../fr/design/mainframe/SheetNameTabPane.java | 72 +++++++++++-------- .../alphafine/component/AlphaFinePane.java | 4 +- .../design/mainframe/bbs/UserInfoLabel.java | 15 ++-- .../fr/design/mainframe/bbs/UserInfoPane.java | 4 -- .../src/main/java/com/fr/grid/GridCorner.java | 12 ++-- 58 files changed, 445 insertions(+), 204 deletions(-) create mode 100644 designer-base/src/main/java/com/fine/theme/light/ui/FineReportComponentBorder.java create mode 100644 designer-base/src/main/java/com/fine/theme/light/ui/FineReportComponentCompositeUI.java create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellClear.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellClear_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellConditionalAttr.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellConditionalAttr_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellElementAttr.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellElementAttr_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellExpandAttr.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellExpandAttr_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellHyperLinkAttr.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellHyperLinkAttr_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellOtherAttr.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellOtherAttr_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellPresentAttr.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellPresentAttr_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellStyleAttr.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellStyleAttr_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellWidgetAttr.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/cell/cellWidgetAttr_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_copy.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_copy_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_paste.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_paste_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/filetree/move.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/filetree/move_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/log/logMsg.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_disable.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_dot.svg create mode 100755 designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_dot_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 bd0c0157fd..17a5f62791 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 @@ -220,7 +220,24 @@ public class FineLightIconSet extends AbstractIconSet { new SvgIconSource("dot", "com/fine/theme/icon/dot.svg", true), new SvgIconSource("expand_popup", "com/fine/theme/icon/popup/expand_popup.svg"), - new SvgIconSource("collapse_popup", "com/fine/theme/icon/popup/collapse_popup.svg") + new SvgIconSource("collapse_popup", "com/fine/theme/icon/popup/collapse_popup.svg"), + + new SvgIconSource("logMsg", "com/fine/theme/icon/log/logMsg.svg", true), + new SvgIconSource("logMsg_dot", "com/fine/theme/icon/log/logMsg_dot.svg", true), + + // 右键弹窗 + new SvgIconSource("cellClear", "com/fine/theme/icon/cell/cellClear.svg", true), + new SvgIconSource("cellExpandAttr", "com/fine/theme/icon/cell/cellExpandAttr.svg", true), + new SvgIconSource("cellStyleAttr", "com/fine/theme/icon/cell/cellStyleAttr.svg", true), + new SvgIconSource("cellOtherAttr", "com/fine/theme/icon/cell/cellOtherAttr.svg", true), + new SvgIconSource("cellWidgetAttr", "com/fine/theme/icon/cell/cellWidgetAttr.svg", true), + new SvgIconSource("cellConditionalAttr", "com/fine/theme/icon/cell/cellConditionalAttr.svg", true), + new SvgIconSource("cellHyperLinkAttr", "com/fine/theme/icon/cell/cellHyperLinkAttr.svg", true), + new SvgIconSource("cellPresentAttr", "com/fine/theme/icon/cell/cellPresentAttr.svg", true), + new SvgIconSource("cellElementAttr", "com/fine/theme/icon/cell/cellElementAttr.svg", true), + new SvgIconSource("move", "com/fine/theme/icon/filetree/move.svg", true), + new SvgIconSource("monochrome_copy", "com/fine/theme/icon/filetree/monochrome_copy.svg", true), + new SvgIconSource("monochrome_paste", "com/fine/theme/icon/filetree/monochrome_paste.svg", true) ); } } diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineReportComponentBorder.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineReportComponentBorder.java new file mode 100644 index 0000000000..6d381761ac --- /dev/null +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineReportComponentBorder.java @@ -0,0 +1,28 @@ +package com.fine.theme.light.ui; + +import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.ui.FlatRoundBorder; + +import javax.swing.UIManager; +import java.awt.Color; +import java.awt.Component; + +/** + * 报表编辑区域边框 + * + * @author Leo.Qin + * @since 11.0 + * Created on 2024/1/2 + */ +public class FineReportComponentBorder extends FlatRoundBorder { + + @Override + protected int getArc(Component c) { + return FineUIUtils.getAndScaleInt("Center.arc", 10); + } + + @Override + protected Color getBorderColor(Component c) { + return UIManager.getColor("Center.ZoneBorderColor"); + } +} diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineReportComponentCompositeUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineReportComponentCompositeUI.java new file mode 100644 index 0000000000..7886af3c33 --- /dev/null +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineReportComponentCompositeUI.java @@ -0,0 +1,40 @@ +package com.fine.theme.light.ui; + +import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.ui.FlatPanelUI; + +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.plaf.ComponentUI; + +/** + * 报表编辑区域UI + * + * @author Leo.Qin + * @since 11.0 + * Created on 2024/1/2 + */ +public class FineReportComponentCompositeUI extends FlatPanelUI { + /** + * @param shared + * @since 2 + */ + protected FineReportComponentCompositeUI(boolean shared) { + super(shared); + } + + /** + * 创建UI + */ + public static ComponentUI createUI(JComponent c) { + return new FineReportComponentCompositeUI(false); + } + + @Override + protected void installDefaults(JPanel p) { + super.installDefaults(p); + this.arc = FineUIUtils.getAndScaleInt("Center.arc", 10); + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java index 1d2048fa28..39ce819dd6 100644 --- a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java +++ b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java @@ -1,5 +1,6 @@ package com.fr.design.file; +import com.fine.theme.icon.LazyIcon; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.file.DelFileAction; import com.fr.design.actions.file.LocateAction; @@ -147,7 +148,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi public CopyAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Copy")); this.setMnemonic('C'); - this.setSmallIcon("/com/fr/design/images/m_edit/copy"); + this.setSmallIcon(new LazyIcon("monochrome_copy")); } @Override @@ -190,7 +191,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi public PasteAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Action_Paste_Name")); this.setMnemonic('P'); - this.setSmallIcon("/com/fr/design/images/m_edit/paste"); + this.setSmallIcon(new LazyIcon("monochrome_paste")); } @Override @@ -315,7 +316,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi public MoveAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Move")); - this.setSmallIcon("/com/fr/design/images/m_edit/move"); + this.setSmallIcon(new LazyIcon("move")); } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIHeadMenu.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIHeadMenu.java index 77974f67d2..f71abbaec8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIHeadMenu.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIHeadMenu.java @@ -1,15 +1,15 @@ package com.fr.design.gui.imenu; -import com.fine.theme.utils.FineUIScale; +import com.fine.theme.utils.FineUIUtils; import javax.swing.Action; import javax.swing.JButton; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.MenuElement; -import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import java.awt.Component; +import java.awt.Insets; /** * @author null @@ -20,7 +20,7 @@ public class UIHeadMenu extends UIMenu { public UIHeadMenu(String name) { super(name); - setBorder(new EmptyBorder(FineUIScale.scale(UIManager.getInsets("HeadMenu.borderMargins")))); + setBorder(new EmptyBorder(FineUIUtils.getAndScaleUIInsets("HeadMenu.borderMargins", new Insets(5, 9, 5, 10)))); } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItem.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItem.java index d5bd493bde..3d7a0b85ba 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItem.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItem.java @@ -33,9 +33,4 @@ public class UIMenuItem extends JMenuItem{ setAction(action); } - @Override - public String getText() { - return StringUtils.BLANK + super.getText(); - } - } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index 23199fb02d..ea9a6110ec 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe; -import com.fine.theme.utils.FineClientProperties; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.DesignState; import com.fr.design.base.mode.DesignModeContext; @@ -17,7 +16,6 @@ import org.jetbrains.annotations.Nullable; import javax.swing.JComponent; import javax.swing.JPanel; -import javax.swing.UIManager; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -26,6 +24,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import static com.fine.theme.utils.FineClientProperties.setStyle; + /** * @author shine @@ -69,9 +69,8 @@ public class CenterRegionContainerPane extends JPanel { public CenterRegionContainerPane() { toolbarPane = new JPanel(); - toolbarPane.setBorder(new ScaledEmptyBorder(6, 0, 10, 0)); + toolbarPane.setBorder(new ScaledEmptyBorder(6, 0, 0, 0)); toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout()); - toolbarPane.setBackground(UIManager.getColor("Center.SpaceColor")); eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); largeToolbar = getToolBarMenuDock().createLargeToolbar(); eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -86,9 +85,9 @@ public class CenterRegionContainerPane extends JPanel { this.setLayout(new BorderLayout()); this.add(centerTemplateCardPane = new DesktopCardPane(), BorderLayout.CENTER); - centerTemplateCardPane.setBorder(new ScaledEmptyBorder(0, 10, 10, 10)); + centerTemplateCardPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); this.add(toolbarPane, BorderLayout.NORTH); - this.setBackground(UIManager.getColor("Center.SpaceColor")); + setStyle(this, "NormalColorPane"); } public ToolBarMenuDock getToolBarMenuDock() { @@ -100,7 +99,7 @@ public class CenterRegionContainerPane extends JPanel { */ private void combineUpTooBar() { combineUp = new UIToolbar(FlowLayout.LEFT); - FineClientProperties.setStyle(combineUp, "topTools"); + setStyle(combineUp, "topTools"); combineUp.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 2)); setUpUpToolBar(null); @@ -222,7 +221,7 @@ public class CenterRegionContainerPane extends JPanel { // 颜色,字体那些按钮的工具栏 toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER); - FineClientProperties.setStyle(toolbarComponent, "topTools"); + setStyle(toolbarComponent, "topTools"); toolbarComponent.setBorder(new ScaledEmptyBorder(0, 10, 10, 10)); JPanel customNorthPane = strategy.customNorthPane(toolbarPane, plus); if (!isExist(customNorthPane)) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java index 9757b0f0b5..02fa561416 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java @@ -54,6 +54,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener protected DesktopCardPane() { setLayout(new BorderLayout()); + setOpaque(false); layeredPane.add(transparentPane, TRANSPARENT_LAYER); layeredPane.add(failedPane, FAILED_LAYER); layeredPane.add(forbiddenPane, FORBIDDEN_LAYER); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java index ec87157ca4..824dd08044 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java @@ -2,7 +2,9 @@ package com.fr.design.mainframe; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIScale; +import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.FlatDarculaLaf; +import com.formdev.flatlaf.ui.FlatUIUtils; import com.fr.base.BaseUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; @@ -16,7 +18,6 @@ import javax.swing.JPanel; import javax.swing.UIManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import javax.swing.plaf.basic.BasicSliderUI; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -26,7 +27,6 @@ import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Point; -import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; @@ -34,8 +34,11 @@ import java.awt.event.FocusListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; +import java.awt.geom.Path2D; import java.math.BigDecimal; +import static com.fine.theme.utils.FineClientProperties.setStyle; + /** * Created by MoMeak on 2017/7/13. */ @@ -65,6 +68,7 @@ public class JFormSliderPane extends JPanel { public JFormSliderPane() { this.setLayout(new BorderLayout()); + setStyle(this, "LightGreyPanel"); initSlider(); initDownUpButton(); initShowValField(); @@ -76,7 +80,7 @@ public class JFormSliderPane extends JPanel { UILabel uiLabel = new UILabel(SUFFIX); uiLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4)); panel.add(uiLabel); -// panel.setBackground(BACK_COLOR); + panel.setOpaque(false); this.add(panel, BorderLayout.NORTH); } @@ -222,6 +226,15 @@ public class JFormSliderPane extends JPanel { return result; } + @Override + public void paintComponent(Graphics g) { + int arc = FineUIUtils.getAndScaleInt("Center.arc", 10) / 2; + Path2D roundedPath = FineUIUtils.createPartRoundRectangle(0, 0, this.getWidth(), this.getHeight(), 0, 0, arc, 0); + FlatUIUtils.setRenderingHints(g); + Graphics2D g2 = (Graphics2D) g; + g2.setColor(getBackground()); + g2.fill(roundedPath); + } public static double divide(double v1, double v2, int scale) { BigDecimal b1 = new BigDecimal(Double.toString(v1)); @@ -282,56 +295,6 @@ public class JFormSliderPane extends JPanel { this.slider.addChangeListener(changeListener); } - class JSliderPaneUI extends BasicSliderUI { - - private static final int THUMB_XOFFSET = 8; - private static final int THUMB_YOFFSET = 3; - private static final int FOUR = 4; - private static final int FIVE = 5; - private static final int SIX = 6; - private static final int MID_X_SHIFT = 2; // 中点标记的水平位置偏移 - - public JSliderPaneUI(UISlider b) { - super(b); - } - - /** - * 绘制指示物 - */ - public void paintThumb(Graphics g) { - Rectangle knobBounds = thumbRect; - Graphics2D g2d = (Graphics2D) g; - g2d.drawImage(APPFIT_V0, knobBounds.x - THUMB_XOFFSET, knobBounds.y + THUMB_YOFFSET, null); - g2d.dispose(); - } - - /** - * 绘制刻度轨迹 - */ - public void paintTrack(Graphics g) { - int cy, cw; - Rectangle trackBounds = trackRect; - if (slider.getOrientation() == UISlider.HORIZONTAL) { - Graphics2D g2 = (Graphics2D) g; - cy = (trackBounds.height / 2); - cw = trackBounds.width; -// g2.setPaint(BACK_COLOR); - g2.fillRect(0, -cy, cw + 10, cy * 4); - g.setColor(new Color(216, 216, 216)); - g.drawLine(0, cy, cw + 3, cy); - g.drawLine(MID_X_SHIFT + cw / 2, cy - FOUR, MID_X_SHIFT + cw / 2, cy + FOUR); - } else { - super.paintTrack(g); - } - } - - public void setThumbLocation(int x, int y) { - super.setThumbLocation(x, y); - slider.repaint(); - } - - } - public static void main(String[] args) { try { UIManager.setLookAndFeel( new FlatDarculaLaf() ); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java index e1540f9a51..2da92be7a7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java @@ -69,6 +69,7 @@ public class NorthRegionContainerPane extends JPanel { this.setLayout(new BorderLayout()); this.add(initNorthEastPane(ad), BorderLayout.EAST); this.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("North.border"))); + setStyle(this, "MenuBar"); } /** @@ -79,6 +80,7 @@ public class NorthRegionContainerPane extends JPanel { //hugh: private修改为protected方便oem的时候修改右上的组件构成 //顶部日志+登陆按钮 final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + northEastPane.setOpaque(false); initPluginListener(northEastPane, ad); refreshNorthEastPane(northEastPane, ad); return northEastPane; @@ -142,7 +144,6 @@ public class NorthRegionContainerPane extends JPanel { northEastPane.removeAll(); northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); - northEastPane.add(LogMessageBar.getInstance()); TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING); if (processor != null) { final Component[] bbsLoginPane = {null}; @@ -161,6 +162,7 @@ public class NorthRegionContainerPane extends JPanel { /// 新手引导功能,暂时屏蔽 // northEastPane.add(ad.createGuideEntryPane()); northEastPane.add(ad.createNotificationCenterPane()); + northEastPane.add(LogMessageBar.getInstance()); OSSupportCenter.buildAction(new OSBasedAction() { @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java index 21419fcb3e..0712327eca 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -1,22 +1,25 @@ package com.fr.design.mainframe.loghandler; -import com.fr.design.gui.ilable.UILabel; -import com.fr.stable.StringUtils; +import com.fine.theme.icon.LazyIcon; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.UIButton; import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.UIManager; import java.awt.BorderLayout; -import java.awt.Dimension; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -public class LogMessageBar extends JPanel { +/** + * 日志消息 + * + * @author Leo.Qin + * @Created on 2023/12/28 + * @since 11.0 + */ +public class LogMessageBar extends BasicPane { - private static final String LOG_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log"); - private UILabel messageLabel; - private int width = 600; + private UIButton logButton; private static volatile LogMessageBar THIS; private JFrame dlg = new LogDetailPane().showDialog(); @@ -31,18 +34,14 @@ public class LogMessageBar extends JPanel { return THIS; } - public static LogMessageBar getInstance(int width) { - LogMessageBar bar = LogMessageBar.getInstance(); - bar.setLoggerBarWidth(width); - return bar; - } - private LogMessageBar() { - messageLabel = new UILabel(); setLayout(new BorderLayout()); - add(messageLabel, BorderLayout.CENTER); - messageLabel.setForeground(UIManager.getColor("North.messageLabel.foreground")); - addMouseListener(new MouseAdapter() { + setOpaque(false); + logButton = new UIButton(new LazyIcon("logMsg")); + logButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Show_Log_Message")); + logButton.set4ToolbarButton(); + add(logButton); + logButton.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (dlg != null && dlg.isVisible()) { @@ -57,25 +56,11 @@ public class LogMessageBar extends JPanel { } public void setMessage(String message) { - if (message == null) { - return; - } - messageLabel.setText(LOG_MARK + " | " + message); - repaint(); + logButton.setIcon(new LazyIcon("logMsg_dot")); } public void clear() { - messageLabel.setText(StringUtils.EMPTY); - repaint(); - } - - public void setLoggerBarWidth(int width) { - this.width = width; - } - - @Override - public Dimension getPreferredSize() { - return new Dimension(width, 24); + logButton.setIcon(new LazyIcon("logMsg")); } /** @@ -91,4 +76,9 @@ public class LogMessageBar extends JPanel { public JFrame getLogFrame() { return dlg; } + + @Override + protected String title4PopupWindow() { + return "LogCenter"; + } } \ No newline at end of file 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 ee82d256ec..e523a18384 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,5 +1,6 @@ package com.fr.design.menu; +import com.fine.theme.icon.LazyIcon; import com.fr.base.svg.IconUtils; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ibutton.UIButton; @@ -14,6 +15,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; +import javax.swing.Icon; import javax.swing.JMenu; import javax.swing.JPopupMenu; import javax.swing.JToolBar; @@ -64,6 +66,7 @@ public class MenuDef extends ShortCut { protected JPopupMenu popupMenu; protected boolean hasScrollSubMenu; protected boolean isHeadMenu; + private Icon icon; private String anchor; @@ -199,7 +202,9 @@ public class MenuDef extends ShortCut { */ public UIButton createUIButton() { if (createdButton == null) { - if (iconPath != null) { + if (icon != null) { + createdButton = new UIButton(icon); + } else if (iconPath != null) { createdButton = new UIButton(IconUtils.readIcon(iconPath)); if(needDisabled) { createdButton.setDisabledIcon(IconUtils.readIcon(iconPath + IconUtils.ICON_TYPE_DISABLED)); @@ -230,7 +235,9 @@ public class MenuDef extends ShortCut { if (createdJMenu == null) { createdJMenu = createJMenu0(); createdJMenu.setMnemonic(this.getMnemonic()); - if (this.iconPath != null) { + if (icon != null) { + createdJMenu.setIcon(icon); + } else if (this.iconPath != null) { createdJMenu.setIcon(IconUtils.readIcon(iconPath)); } MenuListener menuListener = createMenuListener(); @@ -510,4 +517,7 @@ public class MenuDef extends ShortCut { } + public void setIcon(LazyIcon icon) { + this.icon = icon; + } } diff --git a/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java b/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java index 7856b9b991..817afcdcd6 100644 --- a/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java +++ b/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java @@ -8,7 +8,6 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.notification.NotificationCenter; import java.awt.BorderLayout; -import java.awt.Dimension; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -17,13 +16,12 @@ public class NotificationCenterPane extends BasicPane { private static UIButton notificationCenterButton; private NotificationCenterPane() { - setPreferredSize(new Dimension(24, 24)); setLayout(new BorderLayout()); + setOpaque(false); notificationCenterButton = new UIButton(); notificationCenterButton.setIcon(new LazyIcon("notification")); notificationCenterButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Show_Notification")); notificationCenterButton.set4ToolbarButton(); - notificationCenterButton.setRolloverEnabled(false); this.add(notificationCenterButton); notificationCenterButton.addMouseListener(new MouseAdapter() { @Override diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellClear.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellClear.svg new file mode 100755 index 0000000000..df2c632f8e --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellClear.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellClear_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellClear_disable.svg new file mode 100755 index 0000000000..559e6856ec --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellClear_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellConditionalAttr.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellConditionalAttr.svg new file mode 100755 index 0000000000..2f88d20627 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellConditionalAttr.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellConditionalAttr_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellConditionalAttr_disable.svg new file mode 100755 index 0000000000..b6d8aff07b --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellConditionalAttr_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellElementAttr.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellElementAttr.svg new file mode 100755 index 0000000000..64367b9b29 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellElementAttr.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellElementAttr_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellElementAttr_disable.svg new file mode 100755 index 0000000000..623de600ec --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellElementAttr_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellExpandAttr.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellExpandAttr.svg new file mode 100755 index 0000000000..a2b023102d --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellExpandAttr.svg @@ -0,0 +1,11 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellExpandAttr_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellExpandAttr_disable.svg new file mode 100755 index 0000000000..e0d2bf1341 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellExpandAttr_disable.svg @@ -0,0 +1,11 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellHyperLinkAttr.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellHyperLinkAttr.svg new file mode 100755 index 0000000000..317e1dd9a7 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellHyperLinkAttr.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellHyperLinkAttr_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellHyperLinkAttr_disable.svg new file mode 100755 index 0000000000..24dbe0af7d --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellHyperLinkAttr_disable.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellOtherAttr.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellOtherAttr.svg new file mode 100755 index 0000000000..73c33af502 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellOtherAttr.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellOtherAttr_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellOtherAttr_disable.svg new file mode 100755 index 0000000000..1b59fa856e --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellOtherAttr_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellPresentAttr.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellPresentAttr.svg new file mode 100755 index 0000000000..ad1acee124 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellPresentAttr.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellPresentAttr_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellPresentAttr_disable.svg new file mode 100755 index 0000000000..d5334fcdca --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellPresentAttr_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellStyleAttr.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellStyleAttr.svg new file mode 100755 index 0000000000..391906e7bf --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellStyleAttr.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellStyleAttr_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellStyleAttr_disable.svg new file mode 100755 index 0000000000..7e40dd5fef --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellStyleAttr_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellWidgetAttr.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellWidgetAttr.svg new file mode 100755 index 0000000000..c919716b53 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellWidgetAttr.svg @@ -0,0 +1,7 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/cell/cellWidgetAttr_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellWidgetAttr_disable.svg new file mode 100755 index 0000000000..271256d571 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/cell/cellWidgetAttr_disable.svg @@ -0,0 +1,7 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_copy.svg b/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_copy.svg new file mode 100755 index 0000000000..ef9dcf9c8e --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_copy.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_copy_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_copy_disable.svg new file mode 100755 index 0000000000..2a9e24ddaf --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_copy_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_paste.svg b/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_paste.svg new file mode 100755 index 0000000000..ba3d92d61e --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_paste.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_paste_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_paste_disable.svg new file mode 100755 index 0000000000..08caea5d7c --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_paste_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/filetree/move.svg b/designer-base/src/main/resources/com/fine/theme/icon/filetree/move.svg new file mode 100755 index 0000000000..0e664e067c --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/filetree/move.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/filetree/move_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/filetree/move_disable.svg new file mode 100755 index 0000000000..e7318afdee --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/filetree/move_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg.svg b/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg.svg new file mode 100755 index 0000000000..f6bafda5ca --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_disable.svg new file mode 100755 index 0000000000..037846556c --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_disable.svg @@ -0,0 +1,5 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_dot.svg b/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_dot.svg new file mode 100755 index 0000000000..7d89dafebe --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_dot.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_dot_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_dot_disable.svg new file mode 100755 index 0000000000..9354463b17 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/log/logMsg_dot_disable.svg @@ -0,0 +1,8 @@ + + + + + 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 ce1aaba19a..55596987fe 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 @@ -50,4 +50,5 @@ CombinationButtonUI=com.fine.theme.light.ui.FineCombinationButtonUI InputUI=com.fine.theme.light.ui.FineInputUI GradientBarUI=com.fine.theme.light.ui.FineGradientBarUI TemplateTabPaneUI=com.fine.theme.light.ui.FineTemplateTabPaneUI +ReportComponentCompositeUI=com.fine.theme.light.ui.FineReportComponentCompositeUI ColorButtonUI=com.fine.theme.light.ui.FineColorButtonUI 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 7a7a852246..357d16e0ff 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 @@ -456,7 +456,7 @@ Menu.background = @menuBackground MenuBar.borderColor = $Separator.foreground MenuBar.border = com.formdev.flatlaf.ui.FlatMenuBarBorder -MenuBar.background = @menuBackground +MenuBar.background=#eaeff5 MenuBar.hoverBackground = @menuHoverBackground MenuBar.itemMargins = 3,8,3,8 MenuBar.selectionInsets = $MenuItem.selectionInsets @@ -468,7 +468,7 @@ MenuBar.selectionArc = $MenuItem.selectionArc MenuItem.border = com.formdev.flatlaf.ui.FlatMenuItemBorder MenuItem.arrowIcon = com.formdev.flatlaf.icons.FlatMenuItemArrowIcon MenuItem.checkIcon = null -MenuItem.margin = @menuItemMargin +MenuItem.margin=0,10,0,10 MenuItem.opaque = false MenuItem.borderPainted = true MenuItem.verticallyAlignText = true @@ -480,11 +480,14 @@ MenuItem.minimumIconSize = 16,16 MenuItem.iconTextGap = 6 MenuItem.textAcceleratorGap = 24 MenuItem.textNoAcceleratorGap = 6 -MenuItem.acceleratorArrowGap = 2 +MenuItem.acceleratorArrowGap=4 MenuItem.acceleratorDelimiter = "+" [mac]MenuItem.acceleratorDelimiter = "" MenuItem.selectionInsets = 0,0,0,0 MenuItem.selectionArc = 0 +MenuItem.selectionBackground=$brand.normal +MenuItem.selectionForeground=$text.white +MenuItem.disabledForeground=fade(@foreground,29%) # for MenuItem.selectionType = underline MenuItem.underlineSelectionBackground = @menuHoverBackground @@ -560,7 +563,7 @@ PopupMenu.arc=$Component.arc PopupMenuSeparator.height = 9 PopupMenuSeparator.stripeWidth = 1 -PopupMenuSeparator.stripeIndent = 4 +PopupMenuSeparator.stripeIndent=2 #---- ProgressBar ---- @@ -680,7 +683,7 @@ TreeSearchToolbarPane.borderInsets=0, 8, 0, 8 Separator.height = 3 Separator.stripeWidth = 1 Separator.stripeIndent = 1 -Separator.foreground = shade(@background,15%) +Separator.foreground=$fill.hover #---- Slider ---- @@ -1153,8 +1156,6 @@ North.userinfoLabel.borderMargins=2, 16, 2, 16 North.userinfoLabel.width=80 North.userinfoLabel.height=24 North.border = $defaultBorderColor -North.userinfoLabel.foreground=$text.white -North.userinfoLabel.background=$brand.normal North.messageLabel.foreground=$text.placeholder North.coverPane.background = #0a1c38 North.coverPane.radius = 8 @@ -1166,6 +1167,8 @@ Center.ZoneBorderColor = #E6E9EF Center.GridColumnRowColor = #F8F9FC Center.SpaceColor = #FFF Center.border = 0, 10, 10, 10 +Center.arc=10 + #---- CellOtherSetPane ---- CellOtherSetPane.height=$Component.defaultHeight @@ -1230,6 +1233,16 @@ CellOtherSetPane.height=$Component.defaultHeight [style]ToolBar.topTools = \ background: #fff +[style]Panel.NormalColorPane=\ + background: $fill.normal +[style]Panel.LightGreyPanel=\ + background: $Center.OuterShadowColor +[style]Panel.MenuBar=\ + background: $MenuBar.background +[style]Label.BrandColorLabel=\ + background: $brand.normal;\ + foreground: $text.white;\ + opaque: true #---- clearButton ---- # for clear/cancel button in text fields diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/CellAttributeAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/CellAttributeAction.java index 6dff89dfd8..c3f95ebe89 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/CellAttributeAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/CellAttributeAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.cell; -import com.fr.base.svg.IconUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.design.menu.KeySetUtils; @@ -12,7 +12,7 @@ public class CellAttributeAction extends CellAttributeTableAction { this.setMenuKeySet(KeySetUtils.CELL_OTHER_ATTR); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/m_format/cellAttr"); + this.setSmallIcon(new LazyIcon("cellOtherAttr")); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/CellExpandAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/CellExpandAttrAction.java index 62f2db3125..74754f454c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/CellExpandAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/CellExpandAttrAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.cell; -import com.fr.base.svg.IconUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.design.menu.KeySetUtils; @@ -11,7 +11,7 @@ public class CellExpandAttrAction extends CellAttributeTableAction{ this.setMenuKeySet(KeySetUtils.CELL_EXPAND_ATTR); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/expand/cellAttr"); + this.setSmallIcon(new LazyIcon("cellExpandAttr")); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/CellStyleAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/CellStyleAttrAction.java index a257ea95d6..2dc58c81d3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/CellStyleAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/CellStyleAttrAction.java @@ -1,9 +1,8 @@ package com.fr.design.actions.cell; -import com.fr.base.BaseUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.design.i18n.Toolkit; import com.fr.design.menu.KeySetUtils; -import com.fr.general.IOUtils; /** * @author Starryi @@ -16,7 +15,7 @@ public class CellStyleAttrAction extends CellAttributeTableAction { this.setMenuKeySet(KeySetUtils.GLOBAL_STYLE); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_format/cell.png")); + this.setSmallIcon(new LazyIcon("cellStyleAttr")); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/CellWidgetAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/CellWidgetAttrAction.java index f1110187a0..8bfeba521e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/CellWidgetAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/CellWidgetAttrAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions.cell; -import com.fr.base.svg.IconUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.menu.KeySetUtils; @@ -16,7 +16,7 @@ public class CellWidgetAttrAction extends UpdateAction { this.setMenuKeySet(KeySetUtils.CELL_WIDGET_ATTR); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/m_format/modified"); + this.setSmallIcon(new LazyIcon("cellWidgetAttr")); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/ConditionAttributesAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/ConditionAttributesAction.java index d019c978b3..b976e6939f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/ConditionAttributesAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/ConditionAttributesAction.java @@ -3,7 +3,7 @@ */ package com.fr.design.actions.cell; -import com.fr.base.svg.IconUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.menu.KeySetUtils; @@ -18,7 +18,7 @@ public class ConditionAttributesAction extends UpdateAction { this.setMenuKeySet(KeySetUtils.CONDITION_ATTR); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/m_format/highlight"); + this.setSmallIcon(new LazyIcon("cellConditionalAttr")); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/EditCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/EditCellAction.java index 81c7f3cfb2..0d9db1dd1d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/EditCellAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/EditCellAction.java @@ -4,7 +4,7 @@ package com.fr.design.actions.cell; -import com.fr.base.svg.IconUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.design.actions.ElementCaseAction; import com.fr.design.mainframe.ElementCasePane; @@ -20,7 +20,7 @@ public class EditCellAction extends ElementCaseAction { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); this.setMnemonic('I'); - this.setSmallIcon("/com/fr/design/images/control/edit"); + this.setSmallIcon(new LazyIcon("edit")); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/edit/HyperlinkAction.java b/designer-realize/src/main/java/com/fr/design/actions/edit/HyperlinkAction.java index 41aba36880..bdf48d16aa 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/edit/HyperlinkAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/edit/HyperlinkAction.java @@ -3,7 +3,7 @@ */ package com.fr.design.actions.edit; -import com.fr.base.svg.IconUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.menu.KeySetUtils; @@ -19,7 +19,7 @@ public class HyperlinkAction extends UpdateAction { this.setMenuKeySet(KeySetUtils.HYPER_LINK); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/m_insert/hyperLink"); + this.setSmallIcon(new LazyIcon("cellHyperLinkAttr")); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java b/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java index d12e88cf50..af19c26306 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java +++ b/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java @@ -1,7 +1,7 @@ package com.fr.design.actions.utils; -import com.fr.base.BaseUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.base.present.DictPresent; import com.fr.base.present.FormulaPresent; import com.fr.design.ExtraDesignClassManager; @@ -46,7 +46,7 @@ public class DeprecatedActionManager { */ public static UIMenu getClearMenu(ElementCasePane ePane) { UIMenu clearMenu = new UIMenu(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Clear")); - clearMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/control/clear.png")); + clearMenu.setIcon(new LazyIcon("cellClear")); clearMenu.setMnemonic('a'); ClearAction ReportComponentAction = new ClearAllAction(ePane); @@ -71,7 +71,7 @@ public class DeprecatedActionManager { public static MenuDef getCellMenu(final ElementCasePane ePane) { // 单元格菜单 final MenuDef subMenuDef = new MenuDef(KeySetUtils.CELL_ELEMENT.getMenuName()); - subMenuDef.setIconPath("/com/fr/design/images/m_insert/cell"); + subMenuDef.setIcon(new LazyIcon("cellElementAttr")); UpdateAction[] actions = ActionFactory.createCellInsertAction(ElementCasePane.class, ePane); for (UpdateAction action : actions) { @@ -95,7 +95,7 @@ public class DeprecatedActionManager { public static MenuDef getPresentMenu(final ElementCasePane ePane) { final MenuDef presentMenu = new MenuDef(KeySetUtils.PRESENT.getMenuKeySetName()); - presentMenu.setIconPath("com/fr/design/images/data/source/dataDictionary"); + presentMenu.setIcon(new LazyIcon("cellPresentAttr")); presentMenu.setMnemonic(KeySetUtils.PRESENT.getMnemonic()); NewPresentAction dataDictAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Format_Data_Map"), DictPresent.class.getName()); dataDictAction.setMnemonic('D'); @@ -138,7 +138,7 @@ public class DeprecatedActionManager { public static UIMenu getDeleteMenu(ElementCasePane ePane) { UIMenu deleteMenu = new UIMenu(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")); - deleteMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/control/remove.png")); + deleteMenu.setIcon(new LazyIcon("remove")); deleteMenu.setMnemonic('d'); deleteMenu.add(new DeleteRowAction(ePane).createMenuItem()); @@ -149,7 +149,7 @@ public class DeprecatedActionManager { public static UIMenu getInsertMenu(ElementCasePane ePane) { UIMenu deleteMenu = new UIMenu(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert") + "(I)"); - deleteMenu.setIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); + deleteMenu.setIcon(new LazyIcon("add")); deleteMenu.setMnemonic('i'); deleteMenu.add(new InsertRowAction(ePane).createMenuItem()); diff --git a/designer-realize/src/main/java/com/fr/design/cell/bar/DynamicScrollBar.java b/designer-realize/src/main/java/com/fr/design/cell/bar/DynamicScrollBar.java index 9829b4e0d9..467b1be426 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/bar/DynamicScrollBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/bar/DynamicScrollBar.java @@ -31,6 +31,7 @@ public class DynamicScrollBar extends JScrollBar { this.reportPane = reportPane; this.dpi = dpi; + this.setOpaque(false); //init some values.h this.setMinimum(0); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 5bfc086f37..dd21ff1ed0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fine.theme.light.ui.FineReportComponentBorder; import com.fr.base.ScreenResolution; import com.fr.base.TRL; import com.fr.design.actions.replace.ui.ITReplaceMainDialog; @@ -16,10 +17,8 @@ import com.fr.main.impl.WorkBook; import com.fr.report.report.TemplateReport; import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; -import javax.swing.UIManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -28,10 +27,18 @@ import java.util.ArrayList; /** * 整个报表编辑区域 包括滚动条、中间的grid或者聚合块、下面的sheetTab * - * @editor zhou - * @since 2012-3-27下午12:12:05 + * @author zhou + * @since 11.0 + * Created on 2012-3-27 */ -public class ReportComponentComposite extends JComponent implements RemoveListener { +public class ReportComponentComposite extends JPanel implements RemoveListener { + + private static final String UI_CLASS_ID = "ReportComponentCompositeUI"; + + @Override + public String getUIClassID() { + return UI_CLASS_ID; + } private static final int MAX = 400; private static final int HUND = 100; @@ -65,7 +72,7 @@ public class ReportComponentComposite extends JComponent implements RemoveListen CellElementRegion = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.add(CellElementRegion, BorderLayout.NORTH); this.add(createSouthControlPane(), BorderLayout.SOUTH); - this.setBorder(BorderFactory.createLineBorder(UIManager.getColor("Center.ZoneBorderColor"))); + this.setBorder(new FineReportComponentBorder()); jSliderContainer.addValueChangeListener(showValSpinnerChangeListener); } @@ -228,6 +235,7 @@ public class ReportComponentComposite extends JComponent implements RemoveListen southPane.add(sheetNameTab, BorderLayout.CENTER); } southPane.add(jSliderContainer, BorderLayout.EAST); + southPane.setOpaque(false); return southPane; } 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 531e3f08e6..49ad367532 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.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils; import com.fr.base.GraphHelper; import com.fr.base.svg.IconUtils; @@ -27,17 +28,16 @@ import com.fr.report.report.TemplateReport; import com.fr.report.worksheet.WorkSheet; import javax.swing.Icon; -import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.UIManager; +import java.awt.BasicStroke; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FontMetrics; -import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; @@ -49,22 +49,26 @@ import java.awt.event.ComponentListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; +import java.awt.geom.Path2D; import java.awt.geom.RoundRectangle2D; import java.util.ArrayList; import java.util.List; +import static com.fine.theme.utils.FineClientProperties.setStyle; + /** * NameTabPane of sheets * - * @editor zhou - * @since 2012-3-26下午1:45:53 + * @author zhou + * @since 11.0 + * Created on 2012-3-26 */ -public class SheetNameTabPane extends JComponent implements MouseListener, MouseMotionListener, RemoveListener { +public class SheetNameTabPane extends JPanel implements MouseListener, MouseMotionListener, RemoveListener { - private static final Color BORDER_COLOR = UIManager.getColor("Center.ZoneBorderColor"); - private static final Color BACKGROUND_COLOR = UIManager.getColor("Center.OuterShadowColor"); - private static final Color SELECTED_COLOR = UIManager.getColor("South.SheetSelectedColor"); - private static final Color FONT_COLOR = UIManager.getColor("DarkenedFontColor"); + private Color borderColor = UIManager.getColor("Center.ZoneBorderColor"); + private Color backgroundColor = UIManager.getColor("Center.OuterShadowColor"); + private Color selectedColor = UIManager.getColor("South.SheetSelectedColor"); + private Color fontColor = UIManager.getColor("DarkenedFontColor"); private static final Icon ADD_WORK_SHEET = new LazyIcon("add_worksheet"); protected static final Icon ADD_POLY_SHEET = new LazyIcon("add_polysheet"); @@ -81,12 +85,12 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private static final int POLY_TOSHEET_LEFT = 30; // 添加poly按钮左侧距sheet面板右侧的距离 private static final int POLY_TOSHEET_RIGHT = 50; // 添加poly按钮右侧距sheet面板右侧的距离 - 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标签栏圆角属性 + private int iconSepDistance = UIManager.getInt("South.SheetIconSepDistance"); + private int sheetIconGap = UIManager.getInt("South.SheetIconGap"); // 每个sheet图标之间的距离 + private int toolbarHeight = UIManager.getInt("South.SheetBarHeight"); + private int addWidthBySheetname = UIManager.getInt("South.SheetAddWidth"); //sheet名字的文本到图标边框的距离 + private int tabButtonGap = UIManager.getInt("South.SheetTabButtonGap"); // 两个添加按钮与其他组件预留的间隔 + private int sheetTabRadius = UIManager.getInt("South.SheetTabRadius"); // sheet标签栏圆角属性 /** * 左移和右移按钮 @@ -160,12 +164,12 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse this.addMouseListener(this); this.addMouseMotionListener(this); this.setBorder(null); - this.setForeground(FONT_COLOR); - this.setBackground(BACKGROUND_COLOR); + this.setForeground(fontColor); + setStyle(this, "LightGreyPanel"); leftButton = new UIButton(LEFT_ICON) { @Override public Dimension getPreferredSize() { - return new Dimension(super.getPreferredSize().width, TOOLBAR_HEIGHT); + return new Dimension(super.getPreferredSize().width, toolbarHeight); } }; leftButton.set4ToolbarButton(); @@ -173,7 +177,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse rightButton = new UIButton(RIGHT_ICON) { @Override public Dimension getPreferredSize() { - return new Dimension(super.getPreferredSize().width, TOOLBAR_HEIGHT); + return new Dimension(super.getPreferredSize().width, toolbarHeight); } }; rightButton.set4ToolbarButton(); @@ -332,7 +336,6 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse */ @Override public void paintComponent(Graphics g) { - super.paintComponent(g); isAuthorityEditing = DesignerMode.isAuthorityEditing(); showCount = 0; // 开始画那些Tab. @@ -343,7 +346,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse double textHeight = this.getSize().getHeight() - 1; widthArray = calculateWidthArray(); - int operationWidth = TAB_BUTTON_GAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth(); + int operationWidth = tabButtonGap + getAddWorkSheet().getIconWidth() + iconSepDistance + ADD_POLY_SHEET.getIconWidth(); double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度 paintBackgroundAndLine(g2d, textHeight, maxWidth, charWidth, textAscent); checkButton(showCount < widthArray.length); @@ -361,11 +364,18 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse } private void paintBackgroundAndLine(Graphics2D g2d, double textHeight, double maxWidth, int charWidth, int textAscent) { + + int arc = FineUIUtils.getAndScaleInt("Center.arc", 10) / 2; + Path2D roundedPath = FineUIUtils.createPartRoundRectangle(0, 0, this.getWidth(), this.getHeight(), 0, 0, 0, arc); + FlatUIUtils.setRenderingHints(g2d); + g2d.setColor(getBackground()); + g2d.fill(roundedPath); + showCount = 0; int addIconlocation = 0; WorkBook workBook = reportComposite.getEditingWorkBook(); int reportCount = workBook.getReportCount(); - double textX = SHEET_ICON_GAP; + double textX = sheetIconGap; for (int i = scrollIndex; i < reportCount; i++) { lastOneIndex = i; TemplateReport templateReport = workBook.getTemplateReport(i); @@ -397,20 +407,20 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse } // 画两个添加sheet图标 - iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + TAB_BUTTON_GAP; + iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + tabButtonGap; paintAddButton(g2d); } protected void paintAddButton(Graphics2D g2d){ getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3); - ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3); + ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + iconSepDistance, 3); } 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()); + Color backgroundColor = isSelected ? selectedColor : (isNeedPaintAuthority ? UIConstants.AUTHORITY_SHEET_UNSELECTED : getBackground()); g2d.setColor(backgroundColor); // 绘制圆角矩形背景 @@ -418,11 +428,11 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse 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); + int height = (int) textHeight + sheetTabRadius; + RoundRectangle2D.Double backgroundRect = new RoundRectangle2D.Double(textX, -10, width, height, sheetTabRadius, sheetTabRadius); g2d.fill(backgroundRect); - g2d.setColor(BORDER_COLOR); + g2d.setColor(borderColor); g2d.setStroke(new BasicStroke(1)); g2d.draw(backgroundRect); } @@ -475,7 +485,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse int[] widthArray = new int[reportCount]; for (int i = 0; i < reportCount; i++) { String sheetName = workBook.getReportName(i); - widthArray[i] = fm.stringWidth(sheetName) + charWidth * 2 - 1 + ADD_WIDTH_BY_SHEETNAME; + widthArray[i] = fm.stringWidth(sheetName) + charWidth * 2 - 1 + addWidthBySheetname; } return widthArray; } @@ -595,7 +605,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse this.setReleasedXY(e.getX(), e.getY()); int width = 0; for (int w : widthArray) { - width = width + w + SHEET_ICON_GAP; + width = width + w + sheetIconGap; } if (isAuthorityEditing) { return; @@ -759,7 +769,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse widthArray = calculateWidthArray(); int width = widthArray[i]; textX += width + 1; - int operationWidth = TAB_BUTTON_GAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth(); + int operationWidth = tabButtonGap + getAddWorkSheet().getIconWidth() + iconSepDistance + ADD_POLY_SHEET.getIconWidth(); double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度 if (i < widthArray.length - 1 && textX + widthArray[i + 1] + 1 > maxWidth) { isOvertakeWidth = true; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java index fcd652980f..34569667b2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java @@ -9,7 +9,6 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper; import java.awt.AWTEvent; import java.awt.BorderLayout; -import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -25,13 +24,12 @@ public class AlphaFinePane extends BasicPane { } public AlphaFinePane() { - setPreferredSize(new Dimension(24, 24)); + setOpaque(false); setLayout(new BorderLayout()); UIButton refreshButton = new UIButton(); refreshButton.setIcon(new LazyIcon(("search"))); refreshButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Learn_More_About")); refreshButton.set4ToolbarButton(); - refreshButton.setRolloverEnabled(false); this.add(refreshButton); refreshButton.addActionListener(new ActionListener() { @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 3ba44743df..b77d9600a3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -5,7 +5,6 @@ package com.fr.design.mainframe.bbs; import com.fr.design.DesignerEnvManager; import com.fr.design.bbs.BBSLoginUtils; -import com.fr.design.constants.UIConstants; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.LoginContextListener; import com.fr.design.extra.UserLoginContext; @@ -31,6 +30,7 @@ import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; + import javax.swing.JOptionPane; import javax.swing.SwingConstants; import java.awt.Cursor; @@ -48,6 +48,8 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import static com.fine.theme.utils.FineClientProperties.setStyle; + /** * @author neil * @date: 2015-3-4-上午9:05:52 @@ -78,16 +80,6 @@ public class UserInfoLabel extends UILabel { @Override public void mouseEntered(MouseEvent e) { UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR)); - if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) { - UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK); - } - } - - @Override - public void mouseExited(MouseEvent e) { - if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) { - UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND); - } } @Override @@ -159,6 +151,7 @@ public class UserInfoLabel extends UILabel { public UserInfoLabel(UserInfoPane userInfoPane) { init(userInfoPane); + setStyle(this, "BrandColorLabel"); } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java index 1bb4ebf740..088a9ec79d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -104,9 +104,6 @@ public class UserInfoPane extends BasicPane { */ public void markUnSignIn() { this.userInfoLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Onclick")); - this.userInfoLabel.setForeground(UIManager.getColor("North.userinfoLabel.foreground")); - this.userInfoLabel.setOpaque(true); - this.userInfoLabel.setBackground(UIManager.getColor("North.userinfoLabel.background")); this.userInfoLabel.resetUserName(); } @@ -118,7 +115,6 @@ public class UserInfoPane extends BasicPane { public void markSignIn(String userName) { this.userInfoLabel.setText(userName); this.userInfoLabel.setUserName(userName); - this.userInfoLabel.setOpaque(true); } @Override diff --git a/designer-realize/src/main/java/com/fr/grid/GridCorner.java b/designer-realize/src/main/java/com/fr/grid/GridCorner.java index 43ca7fbe5e..8776a11b6c 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridCorner.java +++ b/designer-realize/src/main/java/com/fr/grid/GridCorner.java @@ -4,14 +4,15 @@ package com.fr.grid; import com.fr.base.GraphHelper; - import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.mainframe.ElementCasePane; import javax.swing.event.MouseInputListener; -import java.awt.*; -import java.awt.geom.Rectangle2D; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; /** * GridCorner used to paint and edit grid cornor. @@ -19,7 +20,7 @@ import java.awt.geom.Rectangle2D; public class GridCorner extends BaseGridComponent { public GridCorner() { - this.setOpaque(true); + this.setOpaque(false); //james 清除所有的Key Action this.getInputMap().clear(); this.getActionMap().clear(); @@ -39,9 +40,6 @@ public class GridCorner extends BaseGridComponent { float time = (float) reportPane.getResolution() / DesignerUIModeConfig.getInstance().getScreenResolution(); //size Dimension size = this.getSize(); - Rectangle2D rect2D = new Rectangle2D.Double(0, 0, size.getWidth(), size.getHeight()); - g2d.setPaint(reportPane.getGrid().getBackground()); - GraphHelper.fill(g2d, rect2D); paintArc(g2d, size, time);