public class DefaultDesktopManager extends Object implements DesktopManager, Serializable
| Constructor and Description |
|---|
DefaultDesktopManager()
This creates a new DefaultDesktopManager object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateFrame(JInternalFrame frame)
This method activates the JInternalFrame by moving it to the front and
selecting it.
|
void |
beginDraggingFrame(JComponent component)
This method is called to indicate that the DesktopManager should prepare
to drag the JInternalFrame.
|
void |
beginResizingFrame(JComponent component,
int direction)
This method is called to indicate that the given JComponent will be
resized.
|
void |
closeFrame(JInternalFrame frame)
This method removes the JInternalFrame and JDesktopIcon (if one is
present) from their parents.
|
void |
deactivateFrame(JInternalFrame frame)
This method is called when the JInternalFrame loses focus.
|
void |
deiconifyFrame(JInternalFrame frame)
This method removes the JInternalFrame's JDesktopIcon representation and
adds the JInternalFrame back to its parent.
|
void |
dragFrame(JComponent component,
int newX,
int newY)
This method is called to drag the JInternalFrame to a new location.
|
void |
endDraggingFrame(JComponent component)
This method indicates that the dragging is done.
|
void |
endResizingFrame(JComponent component)
This method is called to indicate that the given JComponent has finished
dragging.
|
protected Rectangle |
getBoundsForIconOf(JInternalFrame frame)
This method is called by iconifyFrame to determine the bounds of the
JDesktopIcon for the given JInternalFrame.
|
protected Rectangle |
getPreviousBounds(JInternalFrame frame)
This method returns the normal bounds of the JInternalFrame from before
the maximize call.
|
void |
iconifyFrame(JInternalFrame frame)
This method removes the JInternalFrame from its parent and adds its
JDesktopIcon representation.
|
void |
maximizeFrame(JInternalFrame frame)
This method resizes the JInternalFrame to match its parent's bounds.
|
void |
minimizeFrame(JInternalFrame frame)
This method restores the JInternalFrame's bounds to what they were
previous to the setMaximize call.
|
void |
openFrame(JInternalFrame frame)
This method is not normally called since the user will typically add the
JInternalFrame to a Container.
|
protected void |
removeIconFor(JInternalFrame frame)
This is a helper method that removes the JDesktopIcon of the given
JInternalFrame from the parent.
|
void |
resizeFrame(JComponent component,
int newX,
int newY,
int newWidth,
int newHeight)
This method resizes the give JComponent.
|
void |
setBoundsForFrame(JComponent component,
int newX,
int newY,
int newWidth,
int newHeight)
This method calls setBounds with the given parameters and repaints the
JComponent.
|
protected void |
setPreviousBounds(JInternalFrame frame,
Rectangle rect)
This method sets the bounds of the JInternalFrame right before the
maximizeFrame call.
|
protected void |
setWasIcon(JInternalFrame frame,
Boolean value)
This method sets the value to true if the given JInternalFrame has been
iconized and the bounds of its DesktopIcon are valid.
|
protected boolean |
wasIcon(JInternalFrame frame)
This method returns true if the given JInternalFrame has been iconized
and the bounds of its DesktopIcon are valid.
|
public DefaultDesktopManager()
public void openFrame(JInternalFrame frame)
openFrame in interface DesktopManagerframe - The JInternalFrame to open.public void closeFrame(JInternalFrame frame)
closeFrame in interface DesktopManagerframe - The JInternalFrame to close.public void maximizeFrame(JInternalFrame frame)
maximizeFrame in interface DesktopManagerframe - The JInternalFrame to maximize.public void minimizeFrame(JInternalFrame frame)
minimizeFrame in interface DesktopManagerframe - The JInternalFrame to minimize.public void iconifyFrame(JInternalFrame frame)
iconifyFrame in interface DesktopManagerframe - The JInternalFrame to iconify.public void deiconifyFrame(JInternalFrame frame)
deiconifyFrame in interface DesktopManagerframe - The JInternalFrame to deiconify.public void activateFrame(JInternalFrame frame)
activateFrame in interface DesktopManagerframe - The JInternalFrame to activate.public void deactivateFrame(JInternalFrame frame)
deactivateFrame in interface DesktopManagerframe - The JInternalFram to deactivate.public void beginDraggingFrame(JComponent component)
beginDraggingFrame in interface DesktopManagercomponent - The JComponent to drag, usually a JInternalFrame.public void dragFrame(JComponent component, int newX, int newY)
dragFrame in interface DesktopManagercomponent - The JComponent to drag, usually a JInternalFrame.newX - The new x coordinate.newY - The new y coordinate.public void endDraggingFrame(JComponent component)
endDraggingFrame in interface DesktopManagercomponent - The JComponent that has finished dragging.public void beginResizingFrame(JComponent component, int direction)
beginResizingFrame in interface DesktopManagercomponent - The JComponent to resize, usually a JInternalFrame.direction - The direction to drag in (a SwingConstant).public void resizeFrame(JComponent component, int newX, int newY, int newWidth, int newHeight)
resizeFrame in interface DesktopManagercomponent - The JComponent to resize.newX - The new x coordinate.newY - The new y coordinate.newWidth - The new width.newHeight - The new height.public void endResizingFrame(JComponent component)
endResizingFrame in interface DesktopManagercomponent - The JComponent that finished resizing.public void setBoundsForFrame(JComponent component, int newX, int newY, int newWidth, int newHeight)
setBoundsForFrame in interface DesktopManagercomponent - The JComponent to set bounds for.newX - The new x coordinate.newY - The new y coordinate.newWidth - The new width.newHeight - The new height.protected void removeIconFor(JInternalFrame frame)
frame - The JInternalFrame to remove an icon for.protected Rectangle getBoundsForIconOf(JInternalFrame frame)
frame - The JInternalFrame to find the bounds of its JDesktopIcon
for.protected void setPreviousBounds(JInternalFrame frame, Rectangle rect)
frame - The JInternalFrame being maximized.rect - The normal bounds.protected Rectangle getPreviousBounds(JInternalFrame frame)
frame - The JInternalFrame that is being restored.protected void setWasIcon(JInternalFrame frame, Boolean value)
frame - The JInternalFrame for the JDesktopIcon.value - True if the JInternalFrame has been iconized and the bounds
of the JDesktopIcon are valid.protected boolean wasIcon(JInternalFrame frame)
frame - The JInternalFrame for the JDesktopIcon.