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 e12e8dacdc..691221bda0 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 @@ -10,11 +10,9 @@ import com.fr.design.gui.ibutton.FiveButtonLayout; import com.fr.design.gui.style.*; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.style.BorderUtils; -import com.fr.design.utils.gui.GUICoreUtils; 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; diff --git a/designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java b/designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java index 51e89437bb..f528cff2ef 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java @@ -1,12 +1,8 @@ package com.fr.design.gui.ibutton; -import java.awt.*; - -import javax.swing.BorderFactory; -import javax.swing.Icon; +import javax.swing.*; import javax.swing.border.Border; - -import com.fr.design.constants.UIConstants; +import java.awt.*; public class UITabGroup extends UIButtonGroup { private boolean isOneLineTab = false; @@ -46,83 +42,6 @@ public class UITabGroup extends UIButtonGroup { } } - @Override - protected void paintBorder(Graphics g) { - Graphics2D g2d = (Graphics2D) g; - g2d.setColor(UIConstants.LINE_COLOR); - if (!isTwoLine()) { - int width = isDrawLine ? ORIGINAL_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; - if (isDrawLine) { - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.drawRoundRect(ORIGINAL_WIDTH, 0, width - ORIGINAL_WIDTH, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - } else { - g2d.drawRect(0, 0, width, getHeight() - 1); - } - - } else if (labelButtonList.size() % 2 != 0) { - paintOddNumberButtons(g, g2d); - } else { - int width = ORIGINAL_WIDTH; - int number = labelButtonList.size() / 2; - for (int i = 0; i < number - 1; i++) { - width += labelButtonList.get(i).getWidth() + 1; - int height = labelButtonList.get(i).getHeight() * 2 + 1; - g.drawLine(width, 0, width, height); - } - width += labelButtonList.get(number - 1).getWidth() + 1; - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.drawRoundRect(ORIGINAL_WIDTH, 0, width - ORIGINAL_WIDTH, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - - } - if (isDrawLine) { - g2d.drawLine(0, getHeight() / 2, getWidth(), getHeight() / 2); - } - } - - private void paintOddNumberButtons(Graphics g, Graphics2D g2d) { - int width = ORIGINAL_WIDTH; - int buttonHeight = labelButtonList.get(0).getHeight(); - int upButtonCount = labelButtonList.size() / 2 + 1; - for (int i = 0; i < upButtonCount - 1; i++) { - width += labelButtonList.get(i).getWidth() + 1; - int height = labelButtonList.get(i).getHeight() + 1; - g.drawLine(width, 0, width, height); - } - width += labelButtonList.get(upButtonCount - 1).getWidth() + 1; - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.drawRoundRect(ORIGINAL_WIDTH, 0, width - ORIGINAL_WIDTH, buttonHeight + 1, UIConstants.ARC, UIConstants.ARC); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - int line2X = labelButtonList.get(upButtonCount).getX(); - int line2Y = labelButtonList.get(upButtonCount).getY(); - width = line2X; - width += labelButtonList.get(upButtonCount).getWidth(); - int height = labelButtonList.get(upButtonCount).getHeight() + 1; - g.drawLine(width, line2Y, width, line2Y + height); - for (int i = upButtonCount + 1; i < labelButtonList.size() - 1; i++) { - width += labelButtonList.get(i).getWidth() + 1; - height = labelButtonList.get(i).getHeight() + 1; - g.drawLine(width, line2Y, width, line2Y + height); - } - width += labelButtonList.get(upButtonCount).getWidth() + 1; - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.drawRoundRect(line2X - 1, line2Y, width - line2X + 1, buttonHeight, UIConstants.ARC, UIConstants.ARC); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - - } - - protected boolean isTwoLine() { - return labelButtonList.size() >= BUTTON_NUMBER && !isOneLineTab; - } - public void setOneLineTab(boolean isOneLineTab) { this.isOneLineTab = isOneLineTab; } @@ -138,7 +57,7 @@ public class UITabGroup extends UIButtonGroup { @Override protected Border getGroupBorder() { if (!isDrawLine) { - return BorderFactory.createEmptyBorder(1, 1, 1, 1); + return BorderFactory.createEmptyBorder(0, 0, 0, 0); } return BorderFactory.createEmptyBorder(1, GAP, 1, GAP); }