This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing
class DefaultDesktopManager

java.lang.Object extended by javax.swing.DefaultDesktopManager
All Implemented Interfaces:
Serializable, DesktopManager

public class DefaultDesktopManager
extends Object
implements DesktopManager, Serializable

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.


Constructor Summary

          
 
Method Summary
 void

          This will activate f moving it to the front.
 void

          
 void
beginResizingFrame(JComponent f, int direction)

          
 void

          Removes the frame, and, if necessary, the desktopIcon, from its parent.
 void

          
 void

          Removes the desktopIcon from its parent and adds its frame to the parent.
 void
dragFrame(JComponent f, int newX, int newY)

          Moves the visible location of the frame being dragged to the location specified.
 void

          
 void

          
protected Rectangle

          The iconifyFrame() code calls this to determine the proper bounds for the desktopIcon.
protected Rectangle

          Gets the normal bounds of the component prior to the component being maximized.
 void

          Removes the frame from its parent and adds its desktopIcon to the parent.
 void

          Resizes the frame to fill its parents bounds.
 void

          Restores the frame back to its size and position prior to a maximizeFrame call.
 void

          Normally this method will not be called.
protected void

          Convenience method to remove the desktopIcon of f is necessary.
 void
resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)

          Calls setBoundsForFrame with the new values.
 void
setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)

          This moves the JComponent and repaints the damaged areas.
protected void

          Stores the bounds of the component just before a maximize call.
protected void

          Sets that the component has been iconized and the bounds of the desktopIcon are valid.
protected boolean

          Returns true if the component has been iconized and the bounds of the desktopIcon are valid, otherwise returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDesktopManager

public DefaultDesktopManager()
Method Detail

activateFrame

public void activateFrame(JInternalFrame f)
This will activate f moving it to the front. It will set the current active frame's (if any) IS_SELECTED_PROPERTY to false. There can be only one active frame across all Layers.

Parameters:
f - the JInternalFrame to be activated

beginDraggingFrame

public void beginDraggingFrame(JComponent f)
Parameters:
f

beginResizingFrame

public void beginResizingFrame(JComponent f,
                               int direction)
Parameters:
f
direction

closeFrame

public void closeFrame(JInternalFrame f)
Removes the frame, and, if necessary, the desktopIcon, from its parent.

Parameters:
f - the JInternalFrame to be removed

deactivateFrame

public void deactivateFrame(JInternalFrame f)
Parameters:
f

deiconifyFrame

public void deiconifyFrame(JInternalFrame f)
Removes the desktopIcon from its parent and adds its frame to the parent.

Parameters:
f - the JInternalFrame to be de-iconified

dragFrame

public void dragFrame(JComponent f,
                      int newX,
                      int newY)
Moves 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 until endDraggingFrame is called.

Parameters:
f
newX
newY

endDraggingFrame

public void endDraggingFrame(JComponent f)
Parameters:
f

endResizingFrame

public void endResizingFrame(JComponent f)
Parameters:
f

getBoundsForIconOf

protected Rectangle getBoundsForIconOf(JInternalFrame f)
The iconifyFrame() code calls this to determine the proper bounds for the desktopIcon.

Parameters:
f

getPreviousBounds

protected Rectangle getPreviousBounds(JInternalFrame f)
Gets the normal bounds of the component prior to the component being maximized.

Parameters:
f - the JInternalFrame of interest
Returns:
the normal bounds of the component

iconifyFrame

public void iconifyFrame(JInternalFrame f)
Removes the frame from its parent and adds its desktopIcon to the parent.

Parameters:
f - the JInternalFrame to be iconified

maximizeFrame

public void maximizeFrame(JInternalFrame f)
Resizes the frame to fill its parents bounds.

Parameters:
f - the frame to be resized

minimizeFrame

public void minimizeFrame(JInternalFrame f)
Restores the frame back to its size and position prior to a maximizeFrame call.

Parameters:
f - the JInternalFrame to be restored

openFrame

public void openFrame(JInternalFrame f)
Normally this method will not be called. If it is, it try to determine the appropriate parent from the desktopIcon of the frame. Will remove the desktopIcon from its parent if it successfully adds the frame.

Parameters:
f

removeIconFor

protected void removeIconFor(JInternalFrame f)
Convenience method to remove the desktopIcon of f is necessary.

Parameters:
f

resizeFrame

public void resizeFrame(JComponent f,
                        int newX,
                        int newY,
                        int newWidth,
                        int newHeight)
Calls setBoundsForFrame with the new values.

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

setBoundsForFrame

public void setBoundsForFrame(JComponent f,
                              int newX,
                              int newY,
                              int newWidth,
                              int newHeight)
This moves the JComponent and repaints the damaged areas.

Parameters:
f
newX
newY
newWidth
newHeight

setPreviousBounds

protected void setPreviousBounds(JInternalFrame f,
                                 Rectangle r)
Stores 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

setWasIcon

protected void setWasIcon(JInternalFrame f,
                          Boolean value)
Sets that the component has been iconized and the bounds of the desktopIcon are valid.

Parameters:
f
value

wasIcon

protected boolean wasIcon(JInternalFrame f)
Returns true if the component has been iconized and the bounds of the desktopIcon are valid, otherwise returns false.

Parameters:
f - the JInternalFrame of interest
Returns:
true if the component has been iconized; otherwise returns false


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.