javax.swing.plaf.basic

Class BasicInternalFrameTitlePane

public class BasicInternalFrameTitlePane extends JComponent

This class acts as a titlebar for JInternalFrames.
Nested Class Summary
classBasicInternalFrameTitlePane.CloseAction
The Action responsible for closing the JInternalFrame.
classBasicInternalFrameTitlePane.IconifyAction
This Action is responsible for iconifying the JInternalFrame.
classBasicInternalFrameTitlePane.MaximizeAction
This Action is responsible for maximizing the JInternalFrame.
classBasicInternalFrameTitlePane.MoveAction
This Action is responsible for dragging the JInternalFrame.
classBasicInternalFrameTitlePane.PropertyChangeHandler
This class is responsible for handling property change events from the JInternalFrame and adjusting the Title Pane as necessary.
classBasicInternalFrameTitlePane.RestoreAction
This Action is responsible for restoring the JInternalFrame.
classBasicInternalFrameTitlePane.SizeAction
This action is responsible for sizing the JInternalFrame.
classBasicInternalFrameTitlePane.SystemMenuBar
This class acts as the MenuBar for the TitlePane.
classBasicInternalFrameTitlePane.TitlePaneLayout
This class acts as the Layout Manager for the TitlePane.
Field Summary
protected ActioncloseAction
The action associated with closing the JInternalFrame.
protected JButtoncloseButton
The button that closes the JInternalFrame.
protected IconcloseIcon
The icon displayed in the close button.
protected static StringCLOSE_CMD
The action command for the Close action.
protected JInternalFrameframe
The JInternalFrame that this TitlePane is used in.
protected JButtoniconButton
The button that iconifies the JInternalFrame.
protected ActioniconifyAction
The action associated with iconifying the JInternalFrame.
protected IconiconIcon
The icon displayed in the iconify button.
protected static StringICONIFY_CMD
The action command for the Minimize action.
protected JButtonmaxButton
The button that maximizes the JInternalFrame.
protected ActionmaximizeAction
The action associated with maximizing the JInternalFrame.
protected IconmaxIcon
The icon displayed in the maximize button.
protected JMenuBarmenuBar
The JMenuBar that is located at the top left of the Title Pane.
protected IconminIcon
The icon displayed in the restore button.
protected ActionmoveAction
The action associated with moving the JInternalFrame.
protected static StringMAXIMIZE_CMD
The action command for the Maximize action.
protected static StringMOVE_CMD
The action command for the Move action.
protected ColornotSelectedTextColor
The text color of the TitlePane when the JInternalFrame is not selected.
protected ColornotSelectedTitleColor
The background color of the TitlePane when the JInternalFrame is not selected.
protected PropertyChangeListenerpropertyChangeListener
The Property Change listener that listens to the JInternalFrame.
protected ActionrestoreAction
The action associated with restoring the JInternalFrame.
protected static StringRESTORE_CMD
The action command for the Restore action.
protected ColorselectedTextColor
The text color of the titlePane when the JInternalFrame is selected.
protected ColorselectedTitleColor
The background color of the TitlePane when the JInternalFrame is selected.
protected ActionsizeAction
The action associated with resizing the JInternalFrame.
protected static StringSIZE_CMD
The action command for the Size action.
protected JMenuwindowMenu
The JMenu inside the menuBar.
Constructor Summary
BasicInternalFrameTitlePane(JInternalFrame f)
Creates a new BasicInternalFrameTitlePane object that is used in the given JInternalFrame.
Method Summary
protected voidaddSubComponents()
This method adds the sub components to the TitlePane.
protected voidaddSystemMenuItems(JMenu systemMenu)
This method adds the MenuItems to the given JMenu.
protected voidassembleSystemMenu()
This method creates the MenuBar used in the TitlePane.
protected voidcreateActions()
This method creates the actions that are used to manipulate the JInternalFrame.
protected voidcreateButtons()
This method creates the buttons used in the TitlePane.
protected LayoutManagercreateLayout()
This method creates a new LayoutManager for the TitlePane.
protected PropertyChangeListenercreatePropertyChangeListener()
This method creates a new PropertyChangeListener.
protected JMenucreateSystemMenu()
This method creates a new JMenu.
protected JMenuBarcreateSystemMenuBar()
This method creates a new JMenubar.
protected voidenableActions()
This method enables the actions for the TitlePane given the frame's properties.
protected StringgetTitle(String text, FontMetrics fm, int availableWidth)
This method returns the title string based on the available width and the font metrics.
protected voidinstallDefaults()
This method installs the defaults determined by the look and feel.
protected voidinstallListeners()
This method is used to install the listeners.
protected voidinstallTitlePane()
This method installs the TitlePane onto the JInternalFrameTitlePane.
voidpaintComponent(Graphics g)
This method paints the TitlePane.
protected voidpaintTitleBackground(Graphics g)
This method paints the TitlePane's background.
protected voidpostClosingEvent(JInternalFrame frame)
This method fires something similar to a WINDOW_CLOSING event.
protected voidsetButtonIcons()
Set icons for the minimize-, maximize- and close-buttons.
protected voidshowSystemMenu()
This method programmatically shows the JMenu.
protected voiduninstallDefaults()
This method uninstalls the defaults.
protected voiduninstallListeners()
This method is used to uninstall the listeners.

Field Detail

closeAction

protected Action closeAction
The action associated with closing the JInternalFrame.

closeButton

protected JButton closeButton
The button that closes the JInternalFrame.

closeIcon

protected Icon closeIcon
The icon displayed in the close button.

CLOSE_CMD

protected static final String CLOSE_CMD
The action command for the Close action.

frame

protected JInternalFrame frame
The JInternalFrame that this TitlePane is used in.

iconButton

protected JButton iconButton
The button that iconifies the JInternalFrame.

iconifyAction

protected Action iconifyAction
The action associated with iconifying the JInternalFrame.

iconIcon

protected Icon iconIcon
The icon displayed in the iconify button.

ICONIFY_CMD

protected static final String ICONIFY_CMD
The action command for the Minimize action.

maxButton

protected JButton maxButton
The button that maximizes the JInternalFrame.

maximizeAction

protected Action maximizeAction
The action associated with maximizing the JInternalFrame.

maxIcon

protected Icon maxIcon
The icon displayed in the maximize button.

menuBar

protected JMenuBar menuBar
The JMenuBar that is located at the top left of the Title Pane.

minIcon

protected Icon minIcon
The icon displayed in the restore button.

moveAction

protected Action moveAction
The action associated with moving the JInternalFrame.

MAXIMIZE_CMD

protected static final String MAXIMIZE_CMD
The action command for the Maximize action.

MOVE_CMD

protected static final String MOVE_CMD
The action command for the Move action.

notSelectedTextColor

protected Color notSelectedTextColor
The text color of the TitlePane when the JInternalFrame is not selected.

notSelectedTitleColor

protected Color notSelectedTitleColor
The background color of the TitlePane when the JInternalFrame is not selected.

propertyChangeListener

protected PropertyChangeListener propertyChangeListener
The Property Change listener that listens to the JInternalFrame.

restoreAction

protected Action restoreAction
The action associated with restoring the JInternalFrame.

RESTORE_CMD

protected static final String RESTORE_CMD
The action command for the Restore action.

selectedTextColor

protected Color selectedTextColor
The text color of the titlePane when the JInternalFrame is selected.

selectedTitleColor

protected Color selectedTitleColor
The background color of the TitlePane when the JInternalFrame is selected.

sizeAction

protected Action sizeAction
The action associated with resizing the JInternalFrame.

SIZE_CMD

protected static final String SIZE_CMD
The action command for the Size action.

windowMenu

protected JMenu windowMenu
The JMenu inside the menuBar.

Constructor Detail

BasicInternalFrameTitlePane

public BasicInternalFrameTitlePane(JInternalFrame f)
Creates a new BasicInternalFrameTitlePane object that is used in the given JInternalFrame.

Parameters: f The JInternalFrame this BasicInternalFrameTitlePane will be used in.

Method Detail

addSubComponents

protected void addSubComponents()
This method adds the sub components to the TitlePane.

addSystemMenuItems

protected void addSystemMenuItems(JMenu systemMenu)
This method adds the MenuItems to the given JMenu.

Parameters: systemMenu The JMenu to add MenuItems to.

assembleSystemMenu

protected void assembleSystemMenu()
This method creates the MenuBar used in the TitlePane.

createActions

protected void createActions()
This method creates the actions that are used to manipulate the JInternalFrame.

createButtons

protected void createButtons()
This method creates the buttons used in the TitlePane.

createLayout

protected LayoutManager createLayout()
This method creates a new LayoutManager for the TitlePane.

Returns: A new LayoutManager.

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener()
This method creates a new PropertyChangeListener.

Returns: A new PropertyChangeListener.

createSystemMenu

protected JMenu createSystemMenu()
This method creates a new JMenu.

Returns: A new JMenu.

createSystemMenuBar

protected JMenuBar createSystemMenuBar()
This method creates a new JMenubar.

Returns: A new JMenuBar.

enableActions

protected void enableActions()
This method enables the actions for the TitlePane given the frame's properties.

getTitle

protected String getTitle(String text, FontMetrics fm, int availableWidth)
This method returns the title string based on the available width and the font metrics.

Parameters: text The desired title. fm The FontMetrics of the font used. availableWidth The available width.

Returns: The allowable string.

installDefaults

protected void installDefaults()
This method installs the defaults determined by the look and feel.

installListeners

protected void installListeners()
This method is used to install the listeners.

installTitlePane

protected void installTitlePane()
This method installs the TitlePane onto the JInternalFrameTitlePane. It also creates any children components that need to be created and adds listeners to the appropriate components.

paintComponent

public void paintComponent(Graphics g)
This method paints the TitlePane.

Parameters: g The Graphics object to paint with.

paintTitleBackground

protected void paintTitleBackground(Graphics g)
This method paints the TitlePane's background.

Parameters: g The Graphics object to paint with.

postClosingEvent

protected void postClosingEvent(JInternalFrame frame)
This method fires something similar to a WINDOW_CLOSING event.

Parameters: frame The JInternalFrame that is being closed.

setButtonIcons

protected void setButtonIcons()
Set icons for the minimize-, maximize- and close-buttons.

showSystemMenu

protected void showSystemMenu()
This method programmatically shows the JMenu.

uninstallDefaults

protected void uninstallDefaults()
This method uninstalls the defaults.

uninstallListeners

protected void uninstallListeners()
This method is used to uninstall the listeners.