javax.swing.plaf.basic
Class BasicInternalFrameUI
- 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 and Description protected class
BasicInternalFrameUI.BasicInternalFrameListener
protected class
BasicInternalFrameUI.BorderListener
Listens for border adjustments.protected class
BasicInternalFrameUI.ComponentHandler
protected class
BasicInternalFrameUI.GlassPaneDispatcher
class
BasicInternalFrameUI.InternalFrameLayout
class
BasicInternalFrameUI.InternalFramePropertyChangeListener
-
Field Summary
Fields Modifier and Type Field and Description protected MouseInputAdapter
borderListener
protected ComponentListener
componentListener
protected JComponent
eastPane
protected JInternalFrame
frame
protected MouseInputListener
glassPaneDispatcher
protected LayoutManager
internalFrameLayout
protected JComponent
northPane
protected KeyStroke
openMenuKey
Deprecated.As of Java 2 platform v1.3.protected PropertyChangeListener
propertyChangeListener
protected JComponent
southPane
protected BasicInternalFrameTitlePane
titlePane
protected JComponent
westPane
-
Constructor Summary
Constructors Constructor and Description BasicInternalFrameUI(JInternalFrame b)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and 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)
protected ComponentListener
createComponentListener()
protected DesktopManager
createDesktopManager()
protected JComponent
createEastPane(JInternalFrame w)
protected MouseInputListener
createGlassPaneDispatcher()
protected void
createInternalFrameListener()
protected LayoutManager
createLayoutManager()
protected JComponent
createNorthPane(JInternalFrame w)
protected PropertyChangeListener
createPropertyChangeListener()
protected JComponent
createSouthPane(JInternalFrame w)
static ComponentUI
createUI(JComponent b)
protected JComponent
createWestPane(JInternalFrame w)
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)
protected DesktopManager
getDesktopManager()
Returns the proper DesktopManager.JComponent
getEastPane()
Dimension
getMaximumSize(JComponent x)
Returns the specified component's maximum size appropriate for the look and feel.Dimension
getMinimumSize(JComponent x)
Returns the specified component's minimum size appropriate for the look and feel.JComponent
getNorthPane()
Dimension
getPreferredSize(JComponent x)
Returns the specified component's preferred size appropriate for the look and feel.JComponent
getSouthPane()
JComponent
getWestPane()
protected void
iconifyFrame(JInternalFrame f)
This method is called when the user wants to iconify the frame.protected void
installComponents()
protected void
installDefaults()
protected void
installKeyboardActions()
protected void
installListeners()
protected void
installMouseHandlers(JComponent c)
void
installUI(JComponent c)
Configures the specified component appropriately for the look and feel.boolean
isKeyBindingActive()
protected boolean
isKeyBindingRegistered()
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)
protected void
setKeyBindingActive(boolean b)
protected void
setKeyBindingRegistered(boolean b)
void
setNorthPane(JComponent c)
void
setSouthPane(JComponent c)
protected void
setupMenuCloseKey()
protected void
setupMenuOpenKey()
void
setWestPane(JComponent c)
protected void
uninstallComponents()
protected void
uninstallDefaults()
protected void
uninstallKeyboardActions()
protected void
uninstallListeners()
void
uninstallUI(JComponent c)
Reverses configuration which was done on the specified component duringinstallUI
.-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
-
-
-
-
Field Detail
frame
protected JInternalFrame frame
borderListener
protected MouseInputAdapter borderListener
propertyChangeListener
protected PropertyChangeListener propertyChangeListener
internalFrameLayout
protected LayoutManager internalFrameLayout
componentListener
protected ComponentListener componentListener
glassPaneDispatcher
protected MouseInputListener glassPaneDispatcher
northPane
protected JComponent northPane
southPane
protected JComponent southPane
westPane
protected JComponent westPane
eastPane
protected JComponent eastPane
titlePane
protected BasicInternalFrameTitlePane titlePane
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)
-
Method Detail
createUI
public static ComponentUI createUI(JComponent b)
installUI
public void installUI(JComponent c)
Description copied from class:ComponentUI
Configures the specified component appropriately for the look and feel. This method is invoked when theComponentUI
instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:- Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
- Install a
LayoutManager
on the component if necessary. - Create/add any required sub-components to the component.
- Create/install event listeners on the component.
- Create/install a
PropertyChangeListener
on the component in order to detect and respond to component property changes appropriately. - Install keyboard UI (mnemonics, traversal, etc.) on the component.
- Initialize any appropriate instance data.
- Overrides:
-
installUI
in classComponentUI
- Parameters:
-
c
- the component where this UI delegate is being installed - See Also:
-
ComponentUI.uninstallUI(javax.swing.JComponent)
,JComponent.setUI(javax.swing.plaf.ComponentUI)
,JComponent.updateUI()
uninstallUI
public void uninstallUI(JComponent c)
Description copied from class:ComponentUI
Reverses configuration which was done on the specified component duringinstallUI
. This method is invoked when thisUIComponent
instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed ininstallUI
, being careful to leave theJComponent
instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:- Remove any UI-set borders from the component.
- Remove any UI-set layout managers on the component.
- Remove any UI-added sub-components from the component.
- Remove any UI-added event/property listeners from the component.
- Remove any UI-installed keyboard UI from the component.
- Nullify any allocated instance data objects to allow for GC.
- Overrides:
-
uninstallUI
in classComponentUI
- Parameters:
-
c
- the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components - See Also:
-
ComponentUI.installUI(javax.swing.JComponent)
,JComponent.updateUI()
installDefaults
protected void installDefaults()
installKeyboardActions
protected void installKeyboardActions()
installComponents
protected void installComponents()
installListeners
protected void installListeners()
- Since:
- 1.3
uninstallDefaults
protected void uninstallDefaults()
uninstallComponents
protected void uninstallComponents()
uninstallListeners
protected void uninstallListeners()
- Since:
- 1.3
uninstallKeyboardActions
protected void uninstallKeyboardActions()
createLayoutManager
protected LayoutManager createLayoutManager()
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
getPreferredSize
public Dimension getPreferredSize(JComponent x)
Description copied from class:ComponentUI
Returns the specified component's preferred size appropriate for the look and feel. Ifnull
is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returnsnull
.- Overrides:
-
getPreferredSize
in classComponentUI
- Parameters:
-
x
- the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components - See Also:
-
JComponent.getPreferredSize()
,LayoutManager.preferredLayoutSize(java.awt.Container)
getMinimumSize
public Dimension getMinimumSize(JComponent x)
Description copied from class:ComponentUI
Returns the specified component's minimum size appropriate for the look and feel. Ifnull
is returned, the minimum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokesgetPreferredSize
and returns that value.- Overrides:
-
getMinimumSize
in classComponentUI
- Parameters:
-
x
- the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components - Returns:
-
a
Dimension
object ornull
- See Also:
-
JComponent.getMinimumSize()
,LayoutManager.minimumLayoutSize(java.awt.Container)
,ComponentUI.getPreferredSize(javax.swing.JComponent)
getMaximumSize
public Dimension getMaximumSize(JComponent x)
Description copied from class:ComponentUI
Returns the specified component's maximum size appropriate for the look and feel. Ifnull
is returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokesgetPreferredSize
and returns that value.- Overrides:
-
getMaximumSize
in classComponentUI
- Parameters:
-
x
- the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components - Returns:
-
a
Dimension
object ornull
- See Also:
-
JComponent.getMaximumSize()
,LayoutManager2.maximumLayoutSize(java.awt.Container)
replacePane
protected void replacePane(JComponent currentPane, JComponent newPane)
Installs necessary mouse handlers onnewPane
and adds it to the frame. Reverse process for thecurrentPane
.
deinstallMouseHandlers
protected void deinstallMouseHandlers(JComponent c)
installMouseHandlers
protected void installMouseHandlers(JComponent c)
createNorthPane
protected JComponent createNorthPane(JInternalFrame w)
createSouthPane
protected JComponent createSouthPane(JInternalFrame w)
createWestPane
protected JComponent createWestPane(JInternalFrame w)
createEastPane
protected JComponent createEastPane(JInternalFrame w)
createBorderListener
protected MouseInputAdapter createBorderListener(JInternalFrame w)
createInternalFrameListener
protected void createInternalFrameListener()
isKeyBindingRegistered
protected final boolean isKeyBindingRegistered()
setKeyBindingRegistered
protected final void setKeyBindingRegistered(boolean b)
isKeyBindingActive
public final boolean isKeyBindingActive()
setKeyBindingActive
protected final void setKeyBindingActive(boolean b)
setupMenuOpenKey
protected void setupMenuOpenKey()
setupMenuCloseKey
protected void setupMenuCloseKey()
getNorthPane
public JComponent getNorthPane()
setNorthPane
public void setNorthPane(JComponent c)
getSouthPane
public JComponent getSouthPane()
setSouthPane
public void setSouthPane(JComponent c)
getWestPane
public JComponent getWestPane()
setWestPane
public void setWestPane(JComponent c)
getEastPane
public JComponent getEastPane()
setEastPane
public void setEastPane(JComponent c)
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.
createDesktopManager
protected DesktopManager createDesktopManager()
closeFrame
protected void closeFrame(JInternalFrame f)
This method is called when the user wants to close the frame. TheplayCloseSound
Action is fired. This action is delegated to the desktopManager.
maximizeFrame
protected void maximizeFrame(JInternalFrame f)
This method is called when the user wants to maximize the frame. TheplayMaximizeSound
Action is fired. This action is delegated to the desktopManager.
minimizeFrame
protected void minimizeFrame(JInternalFrame f)
This method is called when the user wants to minimize the frame. TheplayRestoreDownSound
Action is fired. This action is delegated to the desktopManager.
iconifyFrame
protected void iconifyFrame(JInternalFrame f)
This method is called when the user wants to iconify the frame. TheplayMinimizeSound
Action is fired. This action is delegated to the desktopManager.
deiconifyFrame
protected void deiconifyFrame(JInternalFrame f)
This method is called when the user wants to deiconify the frame. TheplayRestoreUpSound
Action is fired. This action is delegated to the desktopManager.
activateFrame
protected void activateFrame(JInternalFrame f)
This method is called when the frame becomes selected. This action is delegated to the desktopManager.
deactivateFrame
protected void deactivateFrame(JInternalFrame f)
This method is called when the frame is no longer selected. This action is delegated to the desktopManager.
createComponentListener
protected ComponentListener createComponentListener()
createGlassPaneDispatcher
protected MouseInputListener createGlassPaneDispatcher()
-
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.