|
|
|
@ -31,9 +31,20 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
|
|
|
|
|
private int addX = -1; |
|
|
|
|
private int addY = -1; |
|
|
|
|
private int rollover = -1; |
|
|
|
|
private Color tabBorderColor = new Color(143, 160, 183); |
|
|
|
|
private final Color DEFAULT_TAB_BORDER_COLOR = new Color(143, 160, 183); |
|
|
|
|
private Color[] tabSelectedColor = {UIConstants.NORMAL_BLUE, UIConstants.NORMAL_BLUE, UIConstants.NORMAL_BLUE}; |
|
|
|
|
|
|
|
|
|
public Color getTabBorderColor() { |
|
|
|
|
Color color = null; |
|
|
|
|
if (tabPane instanceof UITabbedPane) { |
|
|
|
|
color = ((UITabbedPane) tabPane).getTabBorderColor(); |
|
|
|
|
} |
|
|
|
|
if (color == null) { |
|
|
|
|
color = DEFAULT_TAB_BORDER_COLOR; |
|
|
|
|
} |
|
|
|
|
return color; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 创建UI对象 |
|
|
|
|
* |
|
|
|
@ -252,9 +263,9 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
|
|
|
|
|
private void drawUITabBorder(Graphics g, int tabPlacement, int x, int y, int w, int h, |
|
|
|
|
boolean isSelected, boolean isEnabled, boolean isRollover) { |
|
|
|
|
if (!isEnabled) { |
|
|
|
|
drawUITabBorder(g, tabBorderColor, x, y, w, h, tabPlacement); |
|
|
|
|
drawUITabBorder(g, getTabBorderColor(), x, y, w, h, tabPlacement); |
|
|
|
|
} else if (isSelected || isRollover) { |
|
|
|
|
drawSelectedUITabBorder(g, tabBorderColor, x, y, w, h, tabPlacement); |
|
|
|
|
drawSelectedUITabBorder(g, getTabBorderColor(), x, y, w, h, tabPlacement); |
|
|
|
|
if (isRollover && canClose()) { |
|
|
|
|
closeX = x + w - closeIcon.getIconWidth() - 3; |
|
|
|
|
closeY = 0; |
|
|
|
@ -269,7 +280,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
|
|
|
|
|
closeIcon.paintIcon(tabPane, g, closeX, closeY); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
drawUITabBorder(g, tabBorderColor, x, y, w, h, tabPlacement); |
|
|
|
|
drawUITabBorder(g, getTabBorderColor(), x, y, w, h, tabPlacement); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -322,7 +333,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void drawUIContentBorder(Graphics g, int x, int y, int w, int h) { |
|
|
|
|
g.setColor(tabBorderColor); |
|
|
|
|
g.setColor(getTabBorderColor()); |
|
|
|
|
g.drawRect(x, y, w - 3, h - 3); |
|
|
|
|
// Shadow
|
|
|
|
|
g.setColor(new Color(204, 204, 204)); |
|
|
|
|