public class DefaultDesktopManager extends Objectimplements DesktopManager , Serializable
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.
JDesktopPane,
JInternalFrame
| Constructor and Description |
|---|
DefaultDesktopManager()
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateFrame(JInternalFrame
This will activate
f moving it to the front.
|
void |
beginDraggingFrame(JComponent
This method is normally called when the user has indicated that they will begin dragging a component around.
|
void |
beginResizingFrame(JComponent
This methods is normally called when the user has indicated that they will begin resizing the frame.
|
void |
closeFrame(JInternalFrame
Removes the frame, and, if necessary, the
desktopIcon, from its parent.
|
void |
deactivateFrame(JInternalFrame
Generally, indicate that this frame has lost focus.
|
void |
deiconifyFrame(JInternalFrame
Removes the desktopIcon from its parent and adds its frame to the parent.
|
void |
dragFrame(JComponent
Moves the visible location of the frame being dragged to the location specified.
|
void |
endDraggingFrame(JComponent
This method signals the end of the dragging session.
|
void |
endResizingFrame(JComponent
This method signals the end of the resize session.
|
protected Rectangle |
getBoundsForIconOf(JInternalFrame
The iconifyFrame() code calls this to determine the proper bounds for the desktopIcon.
|
protected Rectangle |
getPreviousBounds(JInternalFrame
Gets the normal bounds of the component prior to the component being maximized.
|
void |
iconifyFrame(JInternalFrame
Removes the frame from its parent and adds its
desktopIcon to the parent.
|
void |
maximizeFrame(JInternalFrame
Resizes the frame to fill its parents bounds.
|
void |
minimizeFrame(JInternalFrame
Restores the frame back to its size and position prior to a
maximizeFrame call.
|
void |
openFrame(JInternalFrame
Normally this method will not be called.
|
protected void |
removeIconFor(JInternalFrame
Convenience method to remove the desktopIcon of
f is necessary.
|
void |
resizeFrame(JComponent
Calls
setBoundsForFrame with the new values.
|
void |
setBoundsForFrame(JComponent
This moves the
JComponent and repaints the damaged areas.
|
protected void |
setPreviousBounds(JInternalFrame
Stores the bounds of the component just before a maximize call.
|
protected void |
setWasIcon(JInternalFrame
Sets that the component has been iconized and the bounds of the
desktopIcon are valid.
|
protected boolean |
wasIcon(JInternalFrame
Returns
true if the component has been iconized and the bounds of the
desktopIcon are valid, otherwise returns
false.
|
public void openFrame(JInternalFramef)
public void closeFrame(JInternalFramef)
desktopIcon, from its parent.
closeFrame in interface
DesktopManager
f - the
JInternalFrame to be removed
public void maximizeFrame(JInternalFramef)
maximizeFrame in interface
DesktopManager
f - the frame to be resized
public void minimizeFrame(JInternalFramef)
maximizeFrame call.
minimizeFrame in interface
DesktopManager
f - the
JInternalFrame to be restored
public void iconifyFrame(JInternalFramef)
desktopIcon to the parent.
iconifyFrame in interface
DesktopManager
f - the
JInternalFrame to be iconified
public void deiconifyFrame(JInternalFramef)
deiconifyFrame in interface
DesktopManager
f - the
JInternalFrame to be de-iconified
public void activateFrame(JInternalFramef)
IS_SELECTED_PROPERTY to
false. There can be only one active frame across all Layers.
activateFrame in interface
DesktopManager
f - the
JInternalFrame to be activated
public void deactivateFrame(JInternalFramef)
DesktopManager
public void beginDraggingFrame(JComponentf)
DesktopManager
public void dragFrame(JComponentf, int newX, int newY)
endDraggingFrame is called.
public void endDraggingFrame(JComponentf)
DesktopManager
public void beginResizingFrame(JComponentf, int direction)
DesktopManager
public void resizeFrame(JComponentf, int newX, int newY, int newWidth, int newHeight)
setBoundsForFrame with the new values.
resizeFrame in interface
DesktopManager
f - the component to be resized
newX - the new x-coordinate
newY - the new y-coordinate
newWidth - the new width
newHeight - the new height
public void endResizingFrame(JComponentf)
DesktopManager
public void setBoundsForFrame(JComponentf, int newX, int newY, int newWidth, int newHeight)
JComponent and repaints the damaged areas.
protected void removeIconFor(JInternalFramef)
protected RectanglegetBoundsForIconOf(JInternalFrame f)
protected void setPreviousBounds(JInternalFramef, Rectangle r)
f - the component about to be resized
r - the normal bounds to be saved away
protected RectanglegetPreviousBounds(JInternalFrame f)
f - the
JInternalFrame of interest
protected void setWasIcon(JInternalFramef, Boolean value)
desktopIcon are valid.
protected boolean wasIcon(JInternalFramef)
true if the component has been iconized and the bounds of the
desktopIcon are valid, otherwise returns
false.
f - the
JInternalFrame of interest
true if the component has been iconized; otherwise returns
false