- 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 classBasicInternalFrameUI.BasicInternalFrameListenerBasic internal frame listener.protected classBasicInternalFrameUI.BorderListenerListens for border adjustments.protected classBasicInternalFrameUI.ComponentHandlerComponent handler.protected classBasicInternalFrameUI.GlassPaneDispatcherGlass pane dispatcher.classBasicInternalFrameUI.InternalFrameLayoutInternal frame layout.classBasicInternalFrameUI.InternalFramePropertyChangeListenerInternal frame property change listener.
-
Field Summary
Fields Modifier and Type Field Description protected MouseInputAdapterborderListenerBorder listenerprotected ComponentListenercomponentListenerComponent listenerprotected JComponenteastPaneEast paneprotected JInternalFrameframeframeprotected MouseInputListenerglassPaneDispatcherGlass pane dispatcherprotected LayoutManagerinternalFrameLayoutInternal frame layoutprotected JComponentnorthPaneNorth paneprotected KeyStrokeopenMenuKeyDeprecated.As of Java 2 platform v1.3.protected PropertyChangeListenerpropertyChangeListenerProperty change listenerprotected JComponentsouthPaneSouth paneprotected BasicInternalFrameTitlePanetitlePaneTitle paneprotected JComponentwestPaneWest pane
-
Constructor Summary
Constructors Constructor Description BasicInternalFrameUI(JInternalFrame b)Constructs aBasicInternalFrameUI.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivateFrame(JInternalFrame f)This method is called when the frame becomes selected.protected voidcloseFrame(JInternalFrame f)This method is called when the user wants to close the frame.protected MouseInputAdaptercreateBorderListener(JInternalFrame w)Creates the border listener.protected ComponentListenercreateComponentListener()Creates a component listener.protected DesktopManagercreateDesktopManager()Creates the desktop manager.protected JComponentcreateEastPane(JInternalFrame w)Creates the east pane.protected MouseInputListenercreateGlassPaneDispatcher()Creates aGlassPaneDispatcher.protected voidcreateInternalFrameListener()Creates the internal frame listener.protected LayoutManagercreateLayoutManager()Creates the layout manager.protected JComponentcreateNorthPane(JInternalFrame w)Creates the north pane.protected PropertyChangeListenercreatePropertyChangeListener()Creates the property change listener.protected JComponentcreateSouthPane(JInternalFrame w)Creates the north pane.static ComponentUIcreateUI(JComponent b)Returns a component UI.protected JComponentcreateWestPane(JInternalFrame w)Creates the west pane.protected voiddeactivateFrame(JInternalFrame f)This method is called when the frame is no longer selected.protected voiddeiconifyFrame(JInternalFrame f)This method is called when the user wants to deiconify the frame.protected voiddeinstallMouseHandlers(JComponent c)Deinstalls the mouse handlers.protected DesktopManagergetDesktopManager()Returns the proper DesktopManager.JComponentgetEastPane()Returns the east pane.DimensiongetMaximumSize(JComponent x)Returns the maximum size.DimensiongetMinimumSize(JComponent x)Returns the minimum size.JComponentgetNorthPane()Returns the north pane.DimensiongetPreferredSize(JComponent x)Returns the preferred size.JComponentgetSouthPane()Returns the south pane.JComponentgetWestPane()Returns the west pane.protected voidiconifyFrame(JInternalFrame f)This method is called when the user wants to iconify the frame.protected voidinstallComponents()Installs the components.protected voidinstallDefaults()Installs the defaults.protected voidinstallKeyboardActions()Installs the keyboard actions.protected voidinstallListeners()Installs the listeners.protected voidinstallMouseHandlers(JComponent c)Installs the mouse handlers.voidinstallUI(JComponent c)Installs the UI.booleanisKeyBindingActive()Returns whether or no the key binding is active.protected booleanisKeyBindingRegistered()Returns whether or no the key binding is registered.protected voidmaximizeFrame(JInternalFrame f)This method is called when the user wants to maximize the frame.protected voidminimizeFrame(JInternalFrame f)This method is called when the user wants to minimize the frame.protected voidreplacePane(JComponent currentPane, JComponent newPane)Installs necessary mouse handlers onnewPaneand adds it to the frame.voidsetEastPane(JComponent c)Sets the east pane.protected voidsetKeyBindingActive(boolean b)Sets the key binding activity.protected voidsetKeyBindingRegistered(boolean b)Sets the key binding registration.voidsetNorthPane(JComponent c)Sets the north pane.voidsetSouthPane(JComponent c)Sets the south pane.protected voidsetupMenuCloseKey()Setup the menu close key.protected voidsetupMenuOpenKey()Setup the menu open key.voidsetWestPane(JComponent c)Sets the west pane.protected voiduninstallComponents()Uninstalls the components.protected voiduninstallDefaults()Uninstalls the defaults.protected voiduninstallKeyboardActions()Uninstalls the keyboard actions.protected voiduninstallListeners()Uninstalls the listeners.voiduninstallUI(JComponent c)Uninstalls the UI.-
Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
-
-
-
-
Field Detail
-
frame
protected JInternalFrame frame
frame
-
borderListener
protected MouseInputAdapter borderListener
Border listener
-
propertyChangeListener
protected PropertyChangeListener propertyChangeListener
Property change listener
-
internalFrameLayout
protected LayoutManager internalFrameLayout
Internal frame layout
-
componentListener
protected ComponentListener componentListener
Component listener
-
glassPaneDispatcher
protected MouseInputListener glassPaneDispatcher
Glass pane dispatcher
-
northPane
protected JComponent northPane
North pane
-
southPane
protected JComponent southPane
South pane
-
westPane
protected JComponent westPane
West pane
-
eastPane
protected JComponent eastPane
East pane
-
titlePane
protected BasicInternalFrameTitlePane titlePane
Title pane
-
openMenuKey
@Deprecated protected KeyStroke 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 Detail
-
BasicInternalFrameUI
public BasicInternalFrameUI(JInternalFrame b)
Constructs aBasicInternalFrameUI.- Parameters:
b- the internal frame
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent b)
Returns a component UI.- Parameters:
b- a component- Returns:
- a component UI
-
installUI
public void installUI(JComponent c)
Installs the UI.- Overrides:
installUIin classComponentUI- Parameters:
c- the component- See Also:
ComponentUI.uninstallUI(javax.swing.JComponent),JComponent.setUI(javax.swing.plaf.ComponentUI),JComponent.updateUI()
-
uninstallUI
public void uninstallUI(JComponent c)
Uninstalls the UI.- Overrides:
uninstallUIin 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
protected LayoutManager createLayoutManager()
Creates the layout manager.- Returns:
- the layout manager
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
Creates the property change listener.- Returns:
- the property change listener
-
getPreferredSize
public Dimension getPreferredSize(JComponent x)
Returns the preferred size.- Overrides:
getPreferredSizein classComponentUI- Parameters:
x- the component- Returns:
- the preferred size
- See Also:
JComponent.getPreferredSize(),LayoutManager.preferredLayoutSize(java.awt.Container)
-
getMinimumSize
public Dimension getMinimumSize(JComponent x)
Returns the minimum size.- Overrides:
getMinimumSizein classComponentUI- Parameters:
x- the component- Returns:
- the minimum size
- See Also:
JComponent.getMinimumSize(),LayoutManager.minimumLayoutSize(java.awt.Container),ComponentUI.getPreferredSize(javax.swing.JComponent)
-
getMaximumSize
public Dimension getMaximumSize(JComponent x)
Returns the maximum size.- Overrides:
getMaximumSizein classComponentUI- Parameters:
x- the component- Returns:
- the maximum size
- See Also:
JComponent.getMaximumSize(),LayoutManager2.maximumLayoutSize(java.awt.Container)
-
replacePane
protected void replacePane(JComponent currentPane, JComponent newPane)
Installs necessary mouse handlers onnewPaneand adds it to the frame. Reverse process for thecurrentPane.- Parameters:
currentPane- thisJcomponentis the current pane being viewed that has mouse handlers installednewPane- thisJcomponentis the pane which will be added and have mouse handlers installed
-
deinstallMouseHandlers
protected void deinstallMouseHandlers(JComponent c)
Deinstalls the mouse handlers.- Parameters:
c- the component
-
installMouseHandlers
protected void installMouseHandlers(JComponent c)
Installs the mouse handlers.- Parameters:
c- the component
-
createNorthPane
protected JComponent createNorthPane(JInternalFrame w)
Creates the north pane.- Parameters:
w- the internal frame- Returns:
- the north pane
-
createSouthPane
protected JComponent createSouthPane(JInternalFrame w)
Creates the north pane.- Parameters:
w- the internal frame- Returns:
- the north pane
-
createWestPane
protected JComponent createWestPane(JInternalFrame w)
Creates the west pane.- Parameters:
w- the internal frame- Returns:
- the west pane
-
createEastPane
protected JComponent createEastPane(JInternalFrame w)
Creates the east pane.- Parameters:
w- the internal frame- Returns:
- the east pane
-
createBorderListener
protected MouseInputAdapter createBorderListener(JInternalFrame w)
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
public JComponent getNorthPane()
Returns the north pane.- Returns:
- the north pane
-
setNorthPane
public void setNorthPane(JComponent c)
Sets the north pane.- Parameters:
c- the new north pane
-
getSouthPane
public JComponent getSouthPane()
Returns the south pane.- Returns:
- the south pane
-
setSouthPane
public void setSouthPane(JComponent c)
Sets the south pane.- Parameters:
c- the new south pane
-
getWestPane
public JComponent getWestPane()
Returns the west pane.- Returns:
- the west pane
-
setWestPane
public void setWestPane(JComponent c)
Sets the west pane.- Parameters:
c- the new west pane
-
getEastPane
public JComponent getEastPane()
Returns the east pane.- Returns:
- the east pane
-
setEastPane
public void setEastPane(JComponent c)
Sets the east pane.- Parameters:
c- the new east pane
-
getDesktopManager
protected DesktopManager 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
protected DesktopManager createDesktopManager()
Creates the desktop manager.- Returns:
- the desktop manager
-
closeFrame
protected void closeFrame(JInternalFrame f)
This method is called when the user wants to close the frame. TheplayCloseSoundAction is fired. This action is delegated to the desktopManager.- Parameters:
f- theJInternalFramebeing viewed
-
maximizeFrame
protected void maximizeFrame(JInternalFrame f)
This method is called when the user wants to maximize the frame. TheplayMaximizeSoundAction is fired. This action is delegated to the desktopManager.- Parameters:
f- theJInternalFramebeing viewed
-
minimizeFrame
protected void minimizeFrame(JInternalFrame f)
This method is called when the user wants to minimize the frame. TheplayRestoreDownSoundAction is fired. This action is delegated to the desktopManager.- Parameters:
f- theJInternalFramebeing viewed
-
iconifyFrame
protected void iconifyFrame(JInternalFrame f)
This method is called when the user wants to iconify the frame. TheplayMinimizeSoundAction is fired. This action is delegated to the desktopManager.- Parameters:
f- theJInternalFramebeing viewed
-
deiconifyFrame
protected void deiconifyFrame(JInternalFrame f)
This method is called when the user wants to deiconify the frame. TheplayRestoreUpSoundAction is fired. This action is delegated to the desktopManager.- Parameters:
f- theJInternalFramebeing viewed
-
activateFrame
protected void activateFrame(JInternalFrame f)
This method is called when the frame becomes selected. This action is delegated to the desktopManager.- Parameters:
f- theJInternalFramebeing viewed
-
deactivateFrame
protected void deactivateFrame(JInternalFrame f)
This method is called when the frame is no longer selected. This action is delegated to the desktopManager.- Parameters:
f- theJInternalFramebeing viewed
-
createComponentListener
protected ComponentListener createComponentListener()
Creates a component listener.- Returns:
- a component listener
-
createGlassPaneDispatcher
protected MouseInputListener createGlassPaneDispatcher()
Creates aGlassPaneDispatcher.- Returns:
- a
GlassPaneDispatcher
-
-