java.lang.Object | +--javax.swing.DefaultDesktopManager
Unsafe: 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.
JDesktopPane,
JInternalFrame,
Serialized FormDefaultDesktopManager()
void
closeFrame(JInternalFrame f)
desktopIcon, from its parent.
void
deiconifyFrame(JInternalFrame f)
void
dragFrame(JComponent f,
int newX,
int newY)
private void
emergencyCleanup(JComponent f)
protected Rectangle
getBoundsForIconOf(JInternalFrame f)
protected Rectangle
getPreviousBounds(JInternalFrame f)
void
iconifyFrame(JInternalFrame f)
desktopIcon to the parent.
void
minimizeFrame(JInternalFrame f)
maximizeFrame call.
protected void
removeIconFor(JInternalFrame f)
void
resizeFrame(JComponent f,
int newX,
int newY,
int newWidth,
int newHeight)
setBoundsForFrame with the new values.
void
setBoundsForFrame(JComponent f,
int newX,
int newY,
int newWidth,
int newHeight)
JComponent and repaints the damaged areas.
protected void
setPreviousBounds(JInternalFrame f,
Rectangle r)
protected void
setWasIcon(JInternalFrame f,
Boolean value)
desktopIcon are valid.
protected boolean
wasIcon(JInternalFrame f)
true if the component has been iconized
and the bounds of the desktopIcon are valid,
otherwise returns false.
static final String HAS_BEEN_ICONIFIED_PROPERTY
static final int DEFAULT_DRAG_MODE
static final int OUTLINE_DRAG_MODE
static final int FASTER_DRAG_MODE
int dragMode
private transient Rectangle currentBounds
private transient Graphics desktopGraphics
private transient Rectangle desktopBounds
private transient Rectangle[] floatingItems
private transient Point currentLoc
public DefaultDesktopManager()
public void openFrame(JInternalFrame f)
openFrame in interface DesktopManagerpublic void closeFrame(JInternalFrame f)
desktopIcon, from its parent.
closeFrame in interface DesktopManagerf - the JInternalFrame to be removedpublic void maximizeFrame(JInternalFrame f)
maximizeFrame in interface DesktopManagerpublic void minimizeFrame(JInternalFrame f)
maximizeFrame call.
minimizeFrame in interface DesktopManagerf - the JInternalFrame to be restoredpublic void iconifyFrame(JInternalFrame f)
desktopIcon to the parent.
iconifyFrame in interface DesktopManagerf - the JInternalFrame to be iconifiedvoid activateNextFrame(Container c)
public void deiconifyFrame(JInternalFrame f)
deiconifyFrame in interface DesktopManagerf - the JInternalFrame to be de-iconifiedpublic void activateFrame(JInternalFrame f)
IS_SELECTED_PROPERTY to false.
There can be only one active frame across all Layers.
activateFrame in interface DesktopManagerf - the JInternalFrame to be activatedpublic void deactivateFrame(JInternalFrame f)
deactivateFrame in interface DesktopManagerpublic void beginDraggingFrame(JComponent f)
beginDraggingFrame in interface DesktopManagerprivate void setupDragMode(JComponent f)
public void dragFrame(JComponent f, int newX, int newY)
endDraggingFrame is called.
dragFrame in interface DesktopManagerpublic void endDraggingFrame(JComponent f)
endDraggingFrame in interface DesktopManagerpublic void beginResizingFrame(JComponent f, int direction)
beginResizingFrame in interface DesktopManagerpublic void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
setBoundsForFrame with the new values.
resizeFrame in interface DesktopManagerf - the component to be resizednewX - the new x-coordinatenewY - the new y-coordinatenewWidth - the new widthnewHeight - the new heightpublic void endResizingFrame(JComponent f)
endResizingFrame in interface DesktopManagerpublic void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
JComponent and repaints the damaged areas.
setBoundsForFrame in interface DesktopManagerprotected void removeIconFor(JInternalFrame f)
protected Rectangle getBoundsForIconOf(JInternalFrame f)
protected void setPreviousBounds(JInternalFrame f, Rectangle r)
f - the component about to be resizedr - the normal bounds to be saved awayprotected Rectangle getPreviousBounds(JInternalFrame f)
f - the JInternalFrame of interest
protected void setWasIcon(JInternalFrame f, Boolean value)
desktopIcon are valid.
protected boolean wasIcon(JInternalFrame f)
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 falseJDesktopPane getDesktopPane(JComponent frame)
private void dragFrameFaster(JComponent f, int newX, int newY)
private boolean isFloaterCollision(Rectangle moveFrom, Rectangle moveTo)
private Rectangle[] findFloatingItems(JComponent f)
private void emergencyCleanup(JComponent f)