java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.InternalFrameUI
javax.swing.plaf.basic.BasicInternalFrameUI
- Direct Known Subclasses:
MetalInternalFrameUI
,SynthInternalFrameUI
public class BasicInternalFrameUI extends InternalFrameUI
A basic L&F implementation of JInternalFrame.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
BasicInternalFrameUI.BasicInternalFrameListener
Basic internal frame listener.protected class
BasicInternalFrameUI.BorderListener
Listens for border adjustments.protected class
BasicInternalFrameUI.ComponentHandler
Component handler.protected class
BasicInternalFrameUI.GlassPaneDispatcher
Glass pane dispatcher.class
BasicInternalFrameUI.InternalFrameLayout
Internal frame layout.class
BasicInternalFrameUI.InternalFramePropertyChangeListener
Internal frame property change listener. -
Field Summary
Fields Modifier and Type Field Description protected MouseInputAdapter
borderListener
Border listenerprotected ComponentListener
componentListener
Component listenerprotected JComponent
eastPane
East paneprotected JInternalFrame
frame
frameprotected MouseInputListener
glassPaneDispatcher
Glass pane dispatcherprotected LayoutManager
internalFrameLayout
Internal frame layoutprotected JComponent
northPane
North paneprotected KeyStroke
openMenuKey
Deprecated.As of Java 2 platform v1.3.protected PropertyChangeListener
propertyChangeListener
Property change listenerprotected JComponent
southPane
South paneprotected BasicInternalFrameTitlePane
titlePane
Title paneprotected JComponent
westPane
West pane -
Constructor Summary
Constructors Constructor Description BasicInternalFrameUI(JInternalFrame b)
Constructs aBasicInternalFrameUI
. -
Method Summary
Modifier and Type Method Description protected void
activateFrame(JInternalFrame f)
This method is called when the frame becomes selected.protected void
closeFrame(JInternalFrame f)
This method is called when the user wants to close the frame.protected MouseInputAdapter
createBorderListener(JInternalFrame w)
Creates the border listener.protected ComponentListener
createComponentListener()
Creates a component listener.protected DesktopManager
createDesktopManager()
Creates the desktop manager.protected JComponent
createEastPane(JInternalFrame w)
Creates the east pane.protected MouseInputListener
createGlassPaneDispatcher()
Creates aGlassPaneDispatcher
.protected void
createInternalFrameListener()
Creates the internal frame listener.protected LayoutManager
createLayoutManager()
Creates the layout manager.protected JComponent
createNorthPane(JInternalFrame w)
Creates the north pane.protected PropertyChangeListener
createPropertyChangeListener()
Creates the property change listener.protected JComponent
createSouthPane(JInternalFrame w)
Creates the north pane.static ComponentUI
createUI(JComponent b)
Returns a component UI.protected JComponent
createWestPane(JInternalFrame w)
Creates the west pane.protected void
deactivateFrame(JInternalFrame f)
This method is called when the frame is no longer selected.protected void
deiconifyFrame(JInternalFrame f)
This method is called when the user wants to deiconify the frame.protected void
deinstallMouseHandlers(JComponent c)
Deinstalls the mouse handlers.protected DesktopManager
getDesktopManager()
Returns the proper DesktopManager.JComponent
getEastPane()
Returns the east pane.Dimension
getMaximumSize(JComponent x)
Returns the maximum size.Dimension
getMinimumSize(JComponent x)
Returns the minimum size.JComponent
getNorthPane()
Returns the north pane.Dimension
getPreferredSize(JComponent x)
Returns the preferred size.JComponent
getSouthPane()
Returns the south pane.JComponent
getWestPane()
Returns the west pane.protected void
iconifyFrame(JInternalFrame f)
This method is called when the user wants to iconify the frame.protected void
installComponents()
Installs the components.protected void
installDefaults()
Installs the defaults.protected void
installKeyboardActions()
Installs the keyboard actions.protected void
installListeners()
Installs the listeners.protected void
installMouseHandlers(JComponent c)
Installs the mouse handlers.void
installUI(JComponent c)
Installs the UI.boolean
isKeyBindingActive()
Returns whether or no the key binding is active.protected boolean
isKeyBindingRegistered()
Returns whether or no the key binding is registered.protected void
maximizeFrame(JInternalFrame f)
This method is called when the user wants to maximize the frame.protected void
minimizeFrame(JInternalFrame f)
This method is called when the user wants to minimize the frame.protected void
replacePane(JComponent currentPane, JComponent newPane)
Installs necessary mouse handlers onnewPane
and adds it to the frame.void
setEastPane(JComponent c)
Sets the east pane.protected void
setKeyBindingActive(boolean b)
Sets the key binding activity.protected void
setKeyBindingRegistered(boolean b)
Sets the key binding registration.void
setNorthPane(JComponent c)
Sets the north pane.void
setSouthPane(JComponent c)
Sets the south pane.protected void
setupMenuCloseKey()
Setup the menu close key.protected void
setupMenuOpenKey()
Setup the menu open key.void
setWestPane(JComponent c)
Sets the west pane.protected void
uninstallComponents()
Uninstalls the components.protected void
uninstallDefaults()
Uninstalls the defaults.protected void
uninstallKeyboardActions()
Uninstalls the keyboard actions.protected void
uninstallListeners()
Uninstalls the listeners.void
uninstallUI(JComponent c)
Uninstalls the UI.Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
-
Field Details
-
frame
frame -
borderListener
Border listener -
propertyChangeListener
Property change listener -
internalFrameLayout
Internal frame layout -
componentListener
Component listener -
glassPaneDispatcher
Glass pane dispatcher -
northPane
North pane -
southPane
South pane -
westPane
West pane -
eastPane
East pane -
titlePane
Title pane -
openMenuKey
Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
-
-
Constructor Details
-
BasicInternalFrameUI
Constructs aBasicInternalFrameUI
.- Parameters:
b
- the internal frame
-
-
Method Details
-
createUI
Returns a component UI.- Parameters:
b
- a component- Returns:
- a component UI
-
installUI
Installs the UI.- Overrides:
installUI
in classComponentUI
- Parameters:
c
- the component- See Also:
ComponentUI.uninstallUI(javax.swing.JComponent)
,JComponent.setUI(javax.swing.plaf.ComponentUI)
,JComponent.updateUI()
-
uninstallUI
Uninstalls the UI.- Overrides:
uninstallUI
in classComponentUI
- Parameters:
c
- the component- See Also:
ComponentUI.installUI(javax.swing.JComponent)
,JComponent.updateUI()
-
installDefaults
protected void installDefaults()Installs the defaults. -
installKeyboardActions
protected void installKeyboardActions()Installs the keyboard actions. -
installComponents
protected void installComponents()Installs the components. -
installListeners
protected void installListeners()Installs the listeners.- Since:
- 1.3
-
uninstallDefaults
protected void uninstallDefaults()Uninstalls the defaults. -
uninstallComponents
protected void uninstallComponents()Uninstalls the components. -
uninstallListeners
protected void uninstallListeners()Uninstalls the listeners.- Since:
- 1.3
-
uninstallKeyboardActions
protected void uninstallKeyboardActions()Uninstalls the keyboard actions. -
createLayoutManager
Creates the layout manager.- Returns:
- the layout manager
-
createPropertyChangeListener
Creates the property change listener.- Returns:
- the property change listener
-
getPreferredSize
Returns the preferred size.- Overrides:
getPreferredSize
in classComponentUI
- Parameters:
x
- the component- Returns:
- the preferred size
- See Also:
JComponent.getPreferredSize()
,LayoutManager.preferredLayoutSize(java.awt.Container)
-
getMinimumSize
Returns the minimum size.- Overrides:
getMinimumSize
in classComponentUI
- Parameters:
x
- the component- Returns:
- the minimum size
- See Also:
JComponent.getMinimumSize()
,LayoutManager.minimumLayoutSize(java.awt.Container)
,ComponentUI.getPreferredSize(javax.swing.JComponent)
-
getMaximumSize
Returns the maximum size.- Overrides:
getMaximumSize
in classComponentUI
- Parameters:
x
- the component- Returns:
- the maximum size
- See Also:
JComponent.getMaximumSize()
,LayoutManager2.maximumLayoutSize(java.awt.Container)
-
replacePane
Installs necessary mouse handlers onnewPane
and adds it to the frame. Reverse process for thecurrentPane
.- Parameters:
currentPane
- thisJcomponent
is the current pane being viewed that has mouse handlers installednewPane
- thisJcomponent
is the pane which will be added and have mouse handlers installed
-
deinstallMouseHandlers
Deinstalls the mouse handlers.- Parameters:
c
- the component
-
installMouseHandlers
Installs the mouse handlers.- Parameters:
c
- the component
-
createNorthPane
Creates the north pane.- Parameters:
w
- the internal frame- Returns:
- the north pane
-
createSouthPane
Creates the north pane.- Parameters:
w
- the internal frame- Returns:
- the north pane
-
createWestPane
Creates the west pane.- Parameters:
w
- the internal frame- Returns:
- the west pane
-
createEastPane
Creates the east pane.- Parameters:
w
- the internal frame- Returns:
- the east pane
-
createBorderListener
Creates the border listener.- Parameters:
w
- the internal frame- Returns:
- the border listener
-
createInternalFrameListener
protected void createInternalFrameListener()Creates the internal frame listener. -
isKeyBindingRegistered
protected final boolean isKeyBindingRegistered()Returns whether or no the key binding is registered.- Returns:
- whether or no the key binding is registered
-
setKeyBindingRegistered
protected final void setKeyBindingRegistered(boolean b)Sets the key binding registration.- Parameters:
b
- new value for key binding registration
-
isKeyBindingActive
public final boolean isKeyBindingActive()Returns whether or no the key binding is active.- Returns:
- whether or no the key binding is active
-
setKeyBindingActive
protected final void setKeyBindingActive(boolean b)Sets the key binding activity.- Parameters:
b
- new value for key binding activity
-
setupMenuOpenKey
protected void setupMenuOpenKey()Setup the menu open key. -
setupMenuCloseKey
protected void setupMenuCloseKey()Setup the menu close key. -
getNorthPane
Returns the north pane.- Returns:
- the north pane
-
setNorthPane
Sets the north pane.- Parameters:
c
- the new north pane
-
getSouthPane
Returns the south pane.- Returns:
- the south pane
-
setSouthPane
Sets the south pane.- Parameters:
c
- the new south pane
-
getWestPane
Returns the west pane.- Returns:
- the west pane
-
setWestPane
Sets the west pane.- Parameters:
c
- the new west pane
-
getEastPane
Returns the east pane.- Returns:
- the east pane
-
setEastPane
Sets the east pane.- Parameters:
c
- the new east pane
-
getDesktopManager
Returns the proper DesktopManager. Calls getDesktopPane() to find the JDesktop component and returns the desktopManager from it. If this fails, it will return a default DesktopManager that should work in arbitrary parents.- Returns:
- the proper DesktopManager
-
createDesktopManager
Creates the desktop manager.- Returns:
- the desktop manager
-
closeFrame
This method is called when the user wants to close the frame. TheplayCloseSound
Action is fired. This action is delegated to the desktopManager.- Parameters:
f
- theJInternalFrame
being viewed
-
maximizeFrame
This method is called when the user wants to maximize the frame. TheplayMaximizeSound
Action is fired. This action is delegated to the desktopManager.- Parameters:
f
- theJInternalFrame
being viewed
-
minimizeFrame
This method is called when the user wants to minimize the frame. TheplayRestoreDownSound
Action is fired. This action is delegated to the desktopManager.- Parameters:
f
- theJInternalFrame
being viewed
-
iconifyFrame
This method is called when the user wants to iconify the frame. TheplayMinimizeSound
Action is fired. This action is delegated to the desktopManager.- Parameters:
f
- theJInternalFrame
being viewed
-
deiconifyFrame
This method is called when the user wants to deiconify the frame. TheplayRestoreUpSound
Action is fired. This action is delegated to the desktopManager.- Parameters:
f
- theJInternalFrame
being viewed
-
activateFrame
This method is called when the frame becomes selected. This action is delegated to the desktopManager.- Parameters:
f
- theJInternalFrame
being viewed
-
deactivateFrame
This method is called when the frame is no longer selected. This action is delegated to the desktopManager.- Parameters:
f
- theJInternalFrame
being viewed
-
createComponentListener
Creates a component listener.- Returns:
- a component listener
-
createGlassPaneDispatcher
Creates aGlassPaneDispatcher
.- Returns:
- a
GlassPaneDispatcher
-