From d41aca61440d2176a7082e9044146fc8823b7c03 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 16 Jan 2024 12:00:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=20REPORT-107973=20=E4=BF=AE=E6=94=B9frm=20?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E8=83=8C=E6=99=AF=EF=BC=9Bfrm?= =?UTF-8?q?=E4=B8=8B=E7=82=B9=E5=87=BB=E6=8A=A5=E8=A1=A8=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=E4=B8=8B=E7=A7=BB=20=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91frm=E4=B8=8B?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8A=A5=E8=A1=A8=E5=9D=97=EF=BC=8C=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E4=B8=8B=E7=A7=BB=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=86frm=E7=9A=84=E5=B7=A5=E5=85=B7=E6=A0=8F=E5=B8=83?= =?UTF-8?q?=E5=B1=80=EF=BC=8C=E4=B9=8B=E5=89=8D=E7=9A=84=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E7=94=A8setPreferredSize=E5=AF=BC=E8=87=B4=20=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fine/theme/light/ui/FineLightIconSet.java | 1 + .../com/fr/design/gui/ibutton/UIButton.java | 8 ++-- .../design/mainframe/FormParaWidgetPane.java | 39 +++++++------------ 3 files changed, 20 insertions(+), 28 deletions(-) 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 2409e9246..8c9b68cc1 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 @@ -35,6 +35,7 @@ public class FineLightIconSet extends AbstractIconSet { new SvgIconSource("drag_left", "com/fine/theme/icon/drag_left.svg", true), new SvgIconSource("drag_right", "com/fine/theme/icon/drag_right.svg", true), new SvgIconSource("down_arrow", "com/fine/theme/icon/down_arrow.svg", true), + new SvgIconSource("up_arrow", "com/fine/theme/icon/up_arrow.svg", true), new SvgIconSource("down_arrow_12", "com/fine/theme/icon/down_arrow.svg", true, 12), new SvgIconSource("up_arrow_12", "com/fine/theme/icon/up_arrow.svg", true, 12), new SvgIconSource("select", "com/fine/theme/icon/select.svg", true), diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java index 736a34029..c54c39cb4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java @@ -25,7 +25,9 @@ import java.awt.event.ActionListener; import java.awt.geom.RoundRectangle2D; import static com.fine.theme.utils.FineUIStyle.STYLE_PRIMARY; +import static com.fine.theme.utils.FineUIStyle.STYLE_TEXT; import static com.fine.theme.utils.FineUIStyle.hasStyle; +import static com.fine.theme.utils.FineUIStyle.setStyle; public class UIButton extends JButton implements UIObserver, UITextComponent { @@ -91,7 +93,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent { setRolloverIcon(rollOver); setPressedIcon(pressed); setExtraPainted(false); - setBackground(null); + setStyle(this, STYLE_TEXT); setOpaque(false); initListener(); } @@ -132,7 +134,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent { public void set4ToolbarButton() { setNormalPainted(false); Dimension dim = getPreferredSize(); - setBackground(null); + setStyle(this, STYLE_TEXT); setOpaque(false); setSize(dim); setBorderPaintedOnlyWhenPressed(true); @@ -140,7 +142,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent { public void set4LargeToolbarButton() { setNormalPainted(false); - setBackground(null); + setStyle(this, STYLE_TEXT); setOpaque(false); setBorderPainted(false); setSize(new Dimension(40, 40)); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index 33eae2a9f..42d6ea377 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fine.theme.icon.LazyIcon; import com.fr.base.BaseUtils; import com.fr.base.svg.IconUtils; import com.fr.design.ExtraDesignClassManager; @@ -25,7 +26,6 @@ import com.fr.design.mainframe.share.ui.online.mini.MiniComponentShopDialog; import com.fr.design.mainframe.share.util.OnlineShopUtils; import com.fr.design.module.DesignModuleFactory; import com.fr.design.ui.util.UIUtil; -import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.Widget; import com.fr.form.ui.WidgetConfig; @@ -50,8 +50,6 @@ import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; import java.awt.FlowLayout; -import java.awt.event.ComponentAdapter; -import java.awt.event.ComponentEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; @@ -142,26 +140,6 @@ public class FormParaWidgetPane extends UIToolbar { public FormParaWidgetPane() { setLayout(new FlowLayout(FlowLayout.LEFT)); - DesignerContext.getDesignerFrame().getCenterTemplateCardPane().addComponentListener(new ComponentAdapter() { - @Override - public void componentResized(ComponentEvent e) { - if (FormParaWidgetPane.this.getParent() != null) { - JPanel parent = (JPanel) FormParaWidgetPane.this.getParent(); - int deltaWidth = 0; - for (int i = 0; i < parent.getComponentCount() - 1; i++) { - deltaWidth += parent.getComponent(i).getWidth(); - } - - if (deltaWidth == 0) { - return; - } - - Dimension d = parent.getSize(); - setPreferredSize(new Dimension(d.width - deltaWidth, d.height)); - LayoutUtils.layoutContainer(parent); - } - } - }); initFormParaComponent(); } @@ -306,6 +284,8 @@ public class FormParaWidgetPane extends UIToolbar { jPanel.add(uiLabel, BorderLayout.NORTH); jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Component_Reuse_Apply_Widget")), BorderLayout.CENTER); jPanel.setToolTipText(Toolkit.i18nText("Fine-Design_Share_Component")); + jPanel.setOpaque(false); + uiLabel.setOpaque(false); return jPanel; } @@ -360,6 +340,9 @@ public class FormParaWidgetPane extends UIToolbar { labelPane.add(label, BorderLayout.CENTER); reportPane.add(labelPane, BorderLayout.SOUTH); reportPane.setPreferredSize(new Dimension((int) reportPane.getPreferredSize().getWidth(), (int) reportPane.getPreferredSize().getHeight())); + reportPane.setOpaque(false); + jComponent.setOpaque(false); + labelPane.setOpaque(false); return reportPane; } @@ -381,6 +364,9 @@ public class FormParaWidgetPane extends UIToolbar { }); labelPane.add(chartPopUpButton, BorderLayout.EAST); chartPane.add(labelPane, BorderLayout.SOUTH); + jComponent.setOpaque(false); + chartPane.setOpaque(false); + labelPane.setOpaque(false); return chartPane; } @@ -408,6 +394,9 @@ public class FormParaWidgetPane extends UIToolbar { }); labelPane.add(chartPopUpButton, BorderLayout.EAST); widgetPane.add(labelPane, BorderLayout.SOUTH); + jComponent.setOpaque(false); + widgetPane.setOpaque(false); + labelPane.setOpaque(false); return widgetPane; } @@ -435,13 +424,13 @@ public class FormParaWidgetPane extends UIToolbar { } private UIButton createPopUpButton() { - UIButton popUpButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png")); + UIButton popUpButton = new UIButton(new LazyIcon("down_arrow")); popUpButton.set4ToolbarButton(); return popUpButton; } private UIButton createPopDownButton() { - UIButton popUpButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowup.png")); + UIButton popUpButton = new UIButton(new LazyIcon("up_arrow")); popUpButton.set4ToolbarButton(); return popUpButton; } From 87182803b3ed552b0267962c794ecde64f087b50 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 16 Jan 2024 12:01:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=20REPORT-107973=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E3=80=81=E5=B7=B2=E7=BC=96=E8=BE=91=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E7=9A=84=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fine/theme/light/ui/laf/FineLightLaf.properties | 4 +++- .../src/main/java/com/fr/grid/GridColumnUI.java | 11 +++++++---- .../src/main/java/com/fr/grid/GridRowUI.java | 9 ++++++--- 3 files changed, 16 insertions(+), 8 deletions(-) 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 a03c97da7..45378742e 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 @@ -1173,7 +1173,9 @@ North.coverPane.radius = 8 Center.OuterShadowColor = #F2F4F8 Center.ZoneBorderColor = #E6E9EF -Center.GridColumnRowColor = #F8F9FC +Center.GridColumnRowColor=#e8e8e9 +Center.GridColumnRowSelectedColor=fade(@BrandColor, 12%) +Center.GridColumnRowEditedColor=#e9ecf1 Center.SpaceColor = #FFF Center.border = 0, 10, 10, 10 Center.arc=10 diff --git a/designer-realize/src/main/java/com/fr/grid/GridColumnUI.java b/designer-realize/src/main/java/com/fr/grid/GridColumnUI.java index bf430f322..291851219 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridColumnUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridColumnUI.java @@ -31,7 +31,10 @@ import java.awt.geom.Rectangle2D; * @since 2012-3-22下午5:51:10 */ public class GridColumnUI extends ComponentUI { - protected Color withoutDetailsBackground = UIManager.getColor("Center.GridColumnRowColor"); + protected Color backgroundColor = UIManager.getColor("Center.GridColumnRowColor"); + protected Color editedBackground = UIManager.getColor("Center.GridColumnRowEditedColor"); + protected Color selectedBackground = UIManager.getColor("Center.GridColumnRowSelectedColor"); + private int resolution ; public GridColumnUI(int resolution){ @@ -74,8 +77,8 @@ public class GridColumnUI extends ComponentUI { columnLeftWidth = columnWidthList.getRangeValue(horizontalBeginValue, columnCount).toPixD(resolution); } columnLeftWidth = Math.min(verticalLineWidth, columnLeftWidth); - if (gridColumn.getBackground() != null) { - g2d.setPaint(this.withoutDetailsBackground); + if (editedBackground != null) { + g2d.setPaint(editedBackground); GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, columnLeftWidth, size.getHeight())); } // draw left border line. @@ -114,7 +117,7 @@ public class GridColumnUI extends ComponentUI { Selection sel = reportPane.getSelection(); int[] selectedColumn = sel.getSelectedColumns(); if (IntList.asList(selectedColumn).contain(i)) { - g2d.setColor(gridColumn.getSelectedBackground()); + g2d.setColor(selectedBackground); GraphHelper.fill(g2d, new Rectangle2D.Double(tmpWidth1 + 1, 0, tmpIncreaseWidth - 1, size.height)); isSelectedBounds = true; } else { diff --git a/designer-realize/src/main/java/com/fr/grid/GridRowUI.java b/designer-realize/src/main/java/com/fr/grid/GridRowUI.java index 97d2eb926..d2b7391f8 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridRowUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridRowUI.java @@ -32,6 +32,9 @@ import java.awt.geom.Rectangle2D; */ public class GridRowUI extends ComponentUI { private Color detailsBackground = UIManager.getColor("Center.GridColumnRowColor"); + protected Color editedBackground = UIManager.getColor("Center.GridColumnRowEditedColor"); + protected Color selectedBackground = UIManager.getColor("Center.GridColumnRowSelectedColor"); + private int resolution ; GridRowUI(int resolution){ @@ -74,8 +77,8 @@ public class GridRowUI extends ComponentUI { rowTopHeight = rowHeightList.getRangeValue(verticalBeginValue, rowCount).toPixD(resolution); } rowTopHeight = Math.min(horizontalLineHeight, rowTopHeight); - if (gridRow.getBackground() != null) { - g2d.setPaint(this.detailsBackground); + if (editedBackground != null) { + g2d.setPaint(editedBackground); GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, size.getWidth(), rowTopHeight)); } // draw top border line. @@ -110,7 +113,7 @@ public class GridRowUI extends ComponentUI { Selection sel = reportPane.getSelection(); int[] selectedRows = sel.getSelectedRows(); if (IntList.asList(selectedRows).contain(i)) { - g2d.setPaint(gridRow.getSelectedBackground()); + g2d.setPaint(selectedBackground); GraphHelper.fill(g2d, new Rectangle2D.Double(0, tmpHeight1 + 1, size.width, tmpIncreaseHeight - 1)); isSelectedBounds = true; } else { From f7bbaee0ba022ebcba0d73099146355af4774e16 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 16 Jan 2024 12:01:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=20REPORT-107973=20=E8=A5=BF=E5=8C=BA?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E9=80=89=E4=B8=AD=E5=90=8E=EF=BC=8C=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=9C=AA=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/EastRegionContainerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7a3e533ec..0b564ced1 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 @@ -987,8 +987,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void setTabButtonSelected() { resetPropertyIcons(); if (StringUtils.isEmpty(iconBaseDir)) { - button.setIcon(new LazyIcon(getBtnIconId())); iconSuffix = ICON_SUFFIX_SELECTED; + button.setIcon(new LazyIcon(getBtnIconId())); } else { iconSuffix = ICON_SUFFIX_SELECTED_DEPRECATED; button.setIcon(IconUtils.readIcon(getBtnIconUrl()));