|
|
@ -108,21 +108,21 @@ public class DarkButtonBorder implements Border, UIResource, VisualPaddingProvid |
|
|
|
Graphics2D g2 = (Graphics2D) g; |
|
|
|
Graphics2D g2 = (Graphics2D) g; |
|
|
|
g2.translate(x, y); |
|
|
|
g2.translate(x, y); |
|
|
|
|
|
|
|
|
|
|
|
int arc = getArc(c); |
|
|
|
int arcSize = getArc(c); |
|
|
|
int focusArc = getFocusArc(c); |
|
|
|
int focusArcSize = getFocusArc(c); |
|
|
|
GraphicsContext config = new GraphicsContext(g); |
|
|
|
GraphicsContext config = new GraphicsContext(g); |
|
|
|
AlignmentExt corner = getCornerFlag(c); |
|
|
|
AlignmentExt corner = getCornerFlag(c); |
|
|
|
|
|
|
|
|
|
|
|
boolean paintShadow = showDropShadow(corner); |
|
|
|
boolean paintShadow = showDropShadow(corner); |
|
|
|
boolean focus = paintFocus(c); |
|
|
|
boolean focus = paintFocus(c); |
|
|
|
int shadowHeight = paintShadow ? getShadowSize() : 0; |
|
|
|
int shadowHeight = paintShadow ? getShadowSize() : 0; |
|
|
|
int borderSize = getBorderSize(); |
|
|
|
int bs = getBorderSize(); |
|
|
|
|
|
|
|
|
|
|
|
Insets insetMask = new Insets(borderSize, borderSize, Math.max(borderSize, shadowHeight), borderSize); |
|
|
|
Insets insetMask = new Insets(bs, bs, Math.max(bs, shadowHeight), bs); |
|
|
|
Insets focusIns = new Insets(0, 0, 0, 0); |
|
|
|
Insets focusIns = new Insets(0, 0, 0, 0); |
|
|
|
if (corner != null) { |
|
|
|
if (corner != null) { |
|
|
|
focusIns = corner.maskInsets(focusIns, -borderSize - focusArc); |
|
|
|
focusIns = corner.maskInsets(focusIns, -bs - focusArcSize); |
|
|
|
insetMask = corner.maskInsets(insetMask, -arc); |
|
|
|
insetMask = corner.maskInsets(insetMask, -arcSize); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int bx = insetMask.left; |
|
|
|
int bx = insetMask.left; |
|
|
@ -132,13 +132,13 @@ public class DarkButtonBorder implements Border, UIResource, VisualPaddingProvid |
|
|
|
int fx = focusIns.left; |
|
|
|
int fx = focusIns.left; |
|
|
|
int fy = focusIns.top; |
|
|
|
int fy = focusIns.top; |
|
|
|
int fw = width - focusIns.left - focusIns.right; |
|
|
|
int fw = width - focusIns.left - focusIns.right; |
|
|
|
int fh = by + bh + borderSize - focusIns.top - focusIns.bottom; |
|
|
|
int fh = by + bh + bs - focusIns.top - focusIns.bottom; |
|
|
|
|
|
|
|
|
|
|
|
if (paintFocus(c)) { |
|
|
|
if (paintFocus(c)) { |
|
|
|
paintFocusBorder(g2, focusArc, borderSize, fx, fy, fw, fh); |
|
|
|
paintFocusBorder(g2, focusArcSize, bs, fx, fy, fw, fh); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
paintLineBorder(c, g2, arc, focus, bx, by, bw, bh); |
|
|
|
paintLineBorder(c, g2, arcSize, focus, bx, by, bw, bh); |
|
|
|
|
|
|
|
|
|
|
|
if (corner != null) { |
|
|
|
if (corner != null) { |
|
|
|
paintNeighbourFocus(g2, c, width, height); |
|
|
|
paintNeighbourFocus(g2, c, width, height); |
|
|
|