equal
deleted
inserted
replaced
44 * @since 1.3 |
44 * @since 1.3 |
45 */ |
45 */ |
46 @SuppressWarnings("serial") // Superclass is not serializable across versions |
46 @SuppressWarnings("serial") // Superclass is not serializable across versions |
47 public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane { |
47 public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane { |
48 |
48 |
|
49 /** |
|
50 * The value {@code isPalette} |
|
51 */ |
49 protected boolean isPalette = false; |
52 protected boolean isPalette = false; |
|
53 |
|
54 /** |
|
55 * The palette close icon. |
|
56 */ |
50 protected Icon paletteCloseIcon; |
57 protected Icon paletteCloseIcon; |
|
58 |
|
59 /** |
|
60 * The height of the palette title. |
|
61 */ |
51 protected int paletteTitleHeight; |
62 protected int paletteTitleHeight; |
52 |
63 |
53 private static final Border handyEmptyBorder = new EmptyBorder(0,0,0,0); |
64 private static final Border handyEmptyBorder = new EmptyBorder(0,0,0,0); |
54 |
65 |
55 /** |
66 /** |
92 private Color activeBumpsHighlight = MetalLookAndFeel. |
103 private Color activeBumpsHighlight = MetalLookAndFeel. |
93 getPrimaryControlHighlight(); |
104 getPrimaryControlHighlight(); |
94 private Color activeBumpsShadow = MetalLookAndFeel. |
105 private Color activeBumpsShadow = MetalLookAndFeel. |
95 getPrimaryControlDarkShadow(); |
106 getPrimaryControlDarkShadow(); |
96 |
107 |
|
108 /** |
|
109 * Constructs a new instance of {@code MetalInternalFrameTitlePane} |
|
110 * |
|
111 * @param f an instance of {@code JInternalFrame} |
|
112 */ |
97 public MetalInternalFrameTitlePane(JInternalFrame f) { |
113 public MetalInternalFrameTitlePane(JInternalFrame f) { |
98 super( f ); |
114 super( f ); |
99 } |
115 } |
100 |
116 |
101 public void addNotify() { |
117 public void addNotify() { |
305 |
321 |
306 buttonsWidth = leftToRight ? w - x : x; |
322 buttonsWidth = leftToRight ? w - x : x; |
307 } |
323 } |
308 } |
324 } |
309 |
325 |
|
326 /** |
|
327 * Paints palette. |
|
328 * |
|
329 * @param g a instance of {@code Graphics} |
|
330 */ |
310 public void paintPalette(Graphics g) { |
331 public void paintPalette(Graphics g) { |
311 boolean leftToRight = MetalUtils.isLeftToRight(frame); |
332 boolean leftToRight = MetalUtils.isLeftToRight(frame); |
312 |
333 |
313 int width = getWidth(); |
334 int width = getWidth(); |
314 int height = getHeight(); |
335 int height = getHeight(); |
469 int bumpHeight = getHeight() - (2 * bumpYOffset); |
490 int bumpHeight = getHeight() - (2 * bumpYOffset); |
470 bumps.setBumpArea( bumpLength, bumpHeight ); |
491 bumps.setBumpArea( bumpLength, bumpHeight ); |
471 bumps.paintIcon(this, g, bumpXOffset, bumpYOffset); |
492 bumps.paintIcon(this, g, bumpXOffset, bumpYOffset); |
472 } |
493 } |
473 |
494 |
|
495 /** |
|
496 * If {@code b} is {@code true}, sets palette icons. |
|
497 * |
|
498 * @param b if {@code true}, sets palette icons |
|
499 */ |
474 public void setPalette(boolean b) { |
500 public void setPalette(boolean b) { |
475 isPalette = b; |
501 isPalette = b; |
476 |
502 |
477 if (isPalette) { |
503 if (isPalette) { |
478 closeButton.setIcon(paletteCloseIcon); |
504 closeButton.setIcon(paletteCloseIcon); |