Class DefaultDesktopManager
java.lang.Object
javax.swing.DefaultDesktopManager
- All Implemented Interfaces:
- Serializable, DesktopManager
This is an implementation of the 
DesktopManager.
 It currently implements the basic behaviors for managing
 JInternalFrames in an arbitrary parent.
 JInternalFrames that are not children of a
 JDesktop will use this component
 to handle their desktop-like actions.
 This class provides a policy for the various JInternalFrame methods, it is not meant to be called directly rather the various JInternalFrame methods will call into the DesktopManager.
- Since:
- 1.2
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidThis will activate f moving it to the front.voidThis method is normally called when the user has indicated that they will begin dragging a component around.voidbeginResizingFrame(JComponent f, int direction) This method is normally called when the user has indicated that they will begin resizing the frame.voidRemoves the frame, and, if necessary, thedesktopIcon, from its parent.voidGenerally, indicate that this frame has lost focus.voidRemoves the desktopIcon from its parent and adds its frame to the parent.voiddragFrame(JComponent f, int newX, int newY) Moves the visible location of the frame being dragged to the location specified.voidThis method signals the end of the dragging session.voidThis method signals the end of the resize session.protected RectangleTheiconifyFrame()code calls this to determine the proper bounds for the desktopIcon.protected RectangleGets the normal bounds of the component prior to the component being maximized.voidRemoves the frame from its parent and adds itsdesktopIconto the parent.voidResizes the frame to fill its parents bounds.voidRestores the frame back to its size and position prior to amaximizeFramecall.voidNormally this method will not be called.protected voidConvenience method to remove the desktopIcon of f is necessary.voidresizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) CallssetBoundsForFramewith the new values.voidsetBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) This moves theJComponentand repaints the damaged areas.protected voidStores the bounds of the component just before a maximize call.protected voidsetWasIcon(JInternalFrame f, Boolean value) Sets that the component has been iconized and the bounds of thedesktopIconare valid.protected booleanReturnstrueif the component has been iconized and the bounds of thedesktopIconare valid, otherwise returnsfalse.
- 
Constructor Details- 
DefaultDesktopManagerpublic DefaultDesktopManager()Constructs aDefaultDesktopManager.
 
- 
- 
Method Details- 
openFrameNormally this method will not be called. If it is, it tries to determine the appropriate parent from the desktopIcon of the frame. Will remove the desktopIcon from its parent if it successfully adds the frame.- Specified by:
- openFramein interface- DesktopManager
- Parameters:
- f- the- JInternalFrameto be displayed
 
- 
closeFrameRemoves the frame, and, if necessary, thedesktopIcon, from its parent.- Specified by:
- closeFramein interface- DesktopManager
- Parameters:
- f- the- JInternalFrameto be removed
 
- 
maximizeFrameResizes the frame to fill its parents bounds.- Specified by:
- maximizeFramein interface- DesktopManager
- Parameters:
- f- the frame to be resized
 
- 
minimizeFrameRestores the frame back to its size and position prior to amaximizeFramecall.- Specified by:
- minimizeFramein interface- DesktopManager
- Parameters:
- f- the- JInternalFrameto be restored
 
- 
iconifyFrameRemoves the frame from its parent and adds itsdesktopIconto the parent.- Specified by:
- iconifyFramein interface- DesktopManager
- Parameters:
- f- the- JInternalFrameto be iconified
 
- 
deiconifyFrameRemoves the desktopIcon from its parent and adds its frame to the parent.- Specified by:
- deiconifyFramein interface- DesktopManager
- Parameters:
- f- the- JInternalFrameto be de-iconified
 
- 
activateFrameThis will activate f moving it to the front. It will set the current active frame's (if any)IS_SELECTED_PROPERTYtofalse. There can be only one active frame across all Layers.- Specified by:
- activateFramein interface- DesktopManager
- Parameters:
- f- the- JInternalFrameto be activated
 
- 
deactivateFrameDescription copied from interface:DesktopManagerGenerally, indicate that this frame has lost focus. This is usually called after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false.- Specified by:
- deactivateFramein interface- DesktopManager
- Parameters:
- f- the- JInternalFrameto be deactivated
 
- 
beginDraggingFrameDescription copied from interface:DesktopManagerThis method is normally called when the user has indicated that they will begin dragging a component around. This method should be called prior to any dragFrame() calls to allow the DesktopManager to prepare any necessary state. Normally f will be a JInternalFrame.- Specified by:
- beginDraggingFramein interface- DesktopManager
- Parameters:
- f- the- JComponentbeing dragged
 
- 
dragFrameMoves the visible location of the frame being dragged to the location specified. The means by which this occurs can vary depending on the dragging algorithm being used. The actual logical location of the frame might not change untilendDraggingFrameis called.- Specified by:
- dragFramein interface- DesktopManager
- Parameters:
- f- the- JComponentbeing dragged
- newX- the new x-coordinate
- newY- the new y-coordinate
 
- 
endDraggingFrameDescription copied from interface:DesktopManagerThis method signals the end of the dragging session. Any state maintained by the DesktopManager can be removed here. Normally f will be a JInternalFrame.- Specified by:
- endDraggingFramein interface- DesktopManager
- Parameters:
- f- the- JComponentbeing dragged
 
- 
beginResizingFrameDescription copied from interface:DesktopManagerThis method is normally called when the user has indicated that they will begin resizing the frame. This method should be called prior to any resizeFrame() calls to allow the DesktopManager to prepare any necessary state. Normally f will be a JInternalFrame.- Specified by:
- beginResizingFramein interface- DesktopManager
- Parameters:
- f- the- JComponentbeing resized
- direction- the direction
 
- 
resizeFrameCallssetBoundsForFramewith the new values.- Specified by:
- resizeFramein interface- DesktopManager
- Parameters:
- f- the component to be resized
- newX- the new x-coordinate
- newY- the new y-coordinate
- newWidth- the new width
- newHeight- the new height
 
- 
endResizingFrameDescription copied from interface:DesktopManagerThis method signals the end of the resize session. Any state maintained by the DesktopManager can be removed here. Normally f will be a JInternalFrame.- Specified by:
- endResizingFramein interface- DesktopManager
- Parameters:
- f- the- JComponentbeing resized
 
- 
setBoundsForFrameThis moves theJComponentand repaints the damaged areas.- Specified by:
- setBoundsForFramein interface- DesktopManager
- Parameters:
- f- the- JComponentbeing moved or resized
- newX- the new x-coordinate
- newY- the new y-coordinate
- newWidth- the new width
- newHeight- the new height
 
- 
removeIconForConvenience method to remove the desktopIcon of f is necessary.- Parameters:
- f- the- JInternalFramefor which to remove the- desktopIcon
 
- 
getBoundsForIconOfTheiconifyFrame()code calls this to determine the proper bounds for the desktopIcon.- Parameters:
- f- the- JInternalFrameof interest
- Returns:
- a Rectanglecontaining bounds for thedesktopIcon
 
- 
setPreviousBoundsStores the bounds of the component just before a maximize call.- Parameters:
- f- the component about to be resized
- r- the normal bounds to be saved away
 
- 
getPreviousBoundsGets the normal bounds of the component prior to the component being maximized.- Parameters:
- f- the- JInternalFrameof interest
- Returns:
- the normal bounds of the component
 
- 
setWasIconSets that the component has been iconized and the bounds of thedesktopIconare valid.- Parameters:
- f- the- JInternalFrameof interest
- value- a- Booleansignifying if component has been iconized
 
- 
wasIconReturnstrueif the component has been iconized and the bounds of thedesktopIconare valid, otherwise returnsfalse.- Parameters:
- f- the- JInternalFrameof interest
- Returns:
- trueif the component has been iconized; otherwise returns- false
 
 
-