61 |
|
|
62 |
|
|
63 |
/** |
/** |
64 |
* The title pane for a {@link JInternalFrame}. This can be displayed in two |
* The title pane for a {@link JInternalFrame} (see |
65 |
* styles: one for regular internal frames, and the other for "palette" style |
* {@link MetalInternalFrameUI#createNorthPane(JInternalFrame)}). This can |
66 |
* internal frames. |
* be displayed in two styles: one for regular internal frames, and the other |
67 |
|
* for "palette" style internal frames. |
68 |
*/ |
*/ |
69 |
public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane |
public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane |
70 |
{ |
{ |
87 |
|
|
88 |
/** |
/** |
89 |
* Handles <code>JInternalFrame.isPalette</code> property changes, with all |
* Handles <code>JInternalFrame.isPalette</code> property changes, with all |
90 |
* other propert changes being passed to the superclass. |
* other property changes being passed to the superclass. |
91 |
* |
* |
92 |
* @param e the event. |
* @param e the event. |
93 |
*/ |
*/ |
215 |
*/ |
*/ |
216 |
public void removeLayoutComponent(Component c) |
public void removeLayoutComponent(Component c) |
217 |
{ |
{ |
218 |
|
// Nothing to do here. |
219 |
} |
} |
220 |
} |
} |
221 |
|
|
236 |
protected int paletteTitleHeight; |
protected int paletteTitleHeight; |
237 |
|
|
238 |
/** The label used to display the title for the internal frame. */ |
/** The label used to display the title for the internal frame. */ |
239 |
private JLabel title; |
JLabel title; |
240 |
|
|
241 |
/** |
/** |
242 |
* Creates a new title pane for the specified frame. |
* Creates a new title pane for the specified frame. |
317 |
// do nothing |
// do nothing |
318 |
} |
} |
319 |
|
|
320 |
|
/** |
321 |
|
* Adds the sub components of the title pane. |
322 |
|
*/ |
323 |
protected void addSubComponents() |
protected void addSubComponents() |
324 |
{ |
{ |
325 |
// FIXME: this method is probably overridden to only add the required |
// FIXME: this method is probably overridden to only add the required |
353 |
Rectangle b = SwingUtilities.getLocalBounds(this); |
Rectangle b = SwingUtilities.getLocalBounds(this); |
354 |
g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); |
g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); |
355 |
g.fillRect(b.x, b.y, b.width, b.height); |
g.fillRect(b.x, b.y, b.width, b.height); |
356 |
MetalUtils.fillMetalPattern(g, b.x + 4, b.y + 2, b.width |
MetalUtils.fillMetalPattern(this, g, b.x + 4, b.y + 2, b.width |
357 |
- paletteCloseIcon.getIconWidth() - 13, b.height - 5, |
- paletteCloseIcon.getIconWidth() - 13, b.height - 5, |
358 |
MetalLookAndFeel.getPrimaryControlHighlight(), |
MetalLookAndFeel.getPrimaryControlHighlight(), |
359 |
MetalLookAndFeel.getBlack()); |
MetalLookAndFeel.getBlack()); |
404 |
endX = Math.max(closeButton.getX(), endX); |
endX = Math.max(closeButton.getX(), endX); |
405 |
endX -= 7; |
endX -= 7; |
406 |
if (endX > startX) |
if (endX > startX) |
407 |
MetalUtils.fillMetalPattern(g, startX, 3, endX - startX, getHeight() - 6, Color.white, Color.gray); |
MetalUtils.fillMetalPattern(this, g, startX, 3, endX - startX, getHeight() - 6, Color.white, Color.gray); |
408 |
} |
} |
409 |
g.setColor(savedColor); |
g.setColor(savedColor); |
410 |
} |
} |
427 |
closeButton.setIcon(closeIcon); |
closeButton.setIcon(closeIcon); |
428 |
} |
} |
429 |
|
|
430 |
|
/** |
431 |
|
* Creates and returns a property change handler for the title pane. |
432 |
|
* |
433 |
|
* @return The property change handler. |
434 |
|
*/ |
435 |
protected PropertyChangeListener createPropertyChangeListener() |
protected PropertyChangeListener createPropertyChangeListener() |
436 |
{ |
{ |
437 |
return new MetalInternalFrameTitlePanePropertyChangeHandler(); |
return new MetalInternalFrameTitlePanePropertyChangeHandler(); |