From 317be4b0d5839fdd549b05f350abde193d51a781 Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 27 Nov 2017 15:48:38 +0800 Subject: [PATCH 01/10] =?UTF-8?q?REPORT-5508=20=E5=8A=A0=E5=9B=9E=E8=BE=B9?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ibutton/UIButtonGroup.java | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java index 76828e38e..d2e2b8d1d 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -218,11 +218,11 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { } protected Border getGroupBorder() { - return BorderFactory.createEmptyBorder(0, 0, 0, 0); + return BorderFactory.createEmptyBorder(1, 1, 1, 1); } protected LayoutManager getGridLayout(int number) { - return new GridLayout(0, number, 0, 0); + return new GridLayout(0, number, 1, 0); } /** @@ -233,7 +233,7 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { public void paintComponents(Graphics g) { Graphics2D g2d = (Graphics2D) g; Shape oldClip = g2d.getClip(); - g2d.clip(new RoundRectangle2D.Double(0, 0, getWidth(), getHeight(), UIConstants.ARC, UIConstants.ARC)); + g2d.clip(new RoundRectangle2D.Double(1, 1, getWidth(), getHeight(), UIConstants.ARC, UIConstants.ARC)); super.paintComponents(g); g2d.setClip(oldClip); } @@ -394,6 +394,34 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { fireStateChanged(); } + /** + * 重载Border画法 + * + * @param g + */ + @Override + protected void paintBorder(Graphics g) { + if (isToolBarComponent) { + return; + } + Graphics2D g2d = (Graphics2D) g; + g2d.setColor(UIConstants.SHADOW_GREY); + + int width = 0; + for (int i = 0; i < labelButtonList.size() - 1; i++) { + width += labelButtonList.get(i).getWidth() + 1; + int height = labelButtonList.get(i).getHeight(); + g.drawLine(width, 0, width, height); + } + + width += labelButtonList.get(labelButtonList.size() - 1).getWidth() + 1; + + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.drawRoundRect(0, 0, width, getHeight() - 1, UIConstants.BUTTON_GROUP_ARC, UIConstants.BUTTON_GROUP_ARC); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + + } + /** * main * From 791cd851ba57592ced01197ea95d3b6d01715d44 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 29 Nov 2017 10:24:36 +0800 Subject: [PATCH 02/10] =?UTF-8?q?REPORT-5695=20[9.0=E4=B8=89=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92][8.0]=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E5=90=8E=EF=BC=8C=E6=8A=A5=E8=A1=A8=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=A0=8F=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/itoolbar/UIToolbar.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java b/designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java index 76be04705..758537c18 100644 --- a/designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java +++ b/designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java @@ -5,7 +5,6 @@ import java.awt.*; import java.util.ArrayList; public class UIToolbar extends JToolBar { - private static final int TOOLBAR_HEIGNT = 26; public UIToolbar() { this(FlowLayout.LEFT); @@ -24,13 +23,6 @@ public class UIToolbar extends JToolBar { this(align, new UIToolBarUI()); } - @Override - public Dimension getPreferredSize() { - Dimension dim = super.getPreferredSize(); - dim.height = TOOLBAR_HEIGNT; - return dim; - } - public void checkComponentsByNames(boolean flag, ArrayList names) { for (int i = 0; i < getComponentCount(); i++) { Component component = getComponents()[i]; From 854ad41fd029dd07ecad84f746bd6ddddb625fc9 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 29 Nov 2017 11:17:35 +0800 Subject: [PATCH 03/10] =?UTF-8?q?REPORT-5508=20=E5=8A=A0=E5=9B=9E=E8=BE=B9?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/cell/settingpane/style/CustomStylePane.java | 3 +++ .../src/com/fr/design/gui/ibutton/UIToggleButton.java | 1 + 2 files changed, 4 insertions(+) diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java index 06b8cb937..0f6d38520 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java @@ -4,6 +4,7 @@ import com.fr.base.CellBorderStyle; import com.fr.base.NameStyle; import com.fr.base.Style; import com.fr.design.actions.utils.ReportActionUtils; +import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.MultiTabPane; import com.fr.design.gui.style.*; @@ -12,6 +13,7 @@ import com.fr.design.style.BorderUtils; import com.fr.general.Inter; import com.fr.stable.Constants; +import javax.swing.*; import javax.swing.event.ChangeListener; import java.awt.*; import java.util.ArrayList; @@ -38,6 +40,7 @@ public class CustomStylePane extends MultiTabPane