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
| Modifier and Type | Field and Description |
|---|---|
| private transient Rectangle | |
| private transient Point | |
| pack-priv static final int | |
| private transient Rectangle | |
| private transient Graphics | |
| private transient boolean | didDrag
Set to true when the user actually drags a frame vs clicks on it to start the drag operation. |
| pack-priv int | |
| pack-priv static final int | |
| private transient Rectangle[] | |
| pack-priv static final String | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | activateFrame(JInternalFrame
the f)JInternalFrame to be activatedImplements javax. This will activate f moving it to the front. |
| public void | beginDraggingFrame(JComponent f)
Implements javax. This method is normally called when the user has indicated that they will begin dragging a component around. |
| public void | beginResizingFrame(JComponent f, int direction)
Implements javax. This method is normally called when the user has indicated that they will begin resizing the frame. |
| public void | closeFrame(JInternalFrame
the f)JInternalFrame to be removedImplements javax. Removes the frame, and, if necessary, the
|
| public void | deactivateFrame(JInternalFrame f)
Implements javax. Generally, indicate that this frame has lost focus. |
| public void | deiconifyFrame(JInternalFrame
the f)JInternalFrame to be de-iconifiedImplements javax. Removes the desktopIcon from its parent and adds its frame to the parent. |
| public void | dragFrame(JComponent f, int newX, int newY)
Implements javax. Moves the visible location of the frame being dragged to the location specified. |
| private void | |
| private void | emergencyCleanup(final JComponent f)
This method is here to clean up problems associated with a race condition which can occur when the full contents of a copyArea's source argument is not available onscreen. |
| public void | endDraggingFrame(JComponent f)
Implements javax. This method signals the end of the dragging session. |
| public void | endResizingFrame(JComponent f)
Implements javax. This method signals the end of the resize session. |
| private Rectangle[] | |
| protected Rectangle | Returns: aRectangle containing bounds for the desktopIconthe f)JInternalFrame of interestThe |
| pack-priv JDesktopPane | |
| protected Rectangle | Returns: the normal bounds of the componentthe f)JInternalFrame of interestGets the normal bounds of the component prior to the component being maximized. |
| public void | iconifyFrame(JInternalFrame
the f)JInternalFrame to be iconifiedImplements javax. Removes the frame from its parent and adds its
|
| private boolean | |
| public void | maximizeFrame(JInternalFrame
the frame to be resized f)Implements javax. Resizes the frame to fill its parents bounds. |
| public void | minimizeFrame(JInternalFrame
the f)JInternalFrame to be restoredImplements javax. Restores the frame back to its size and position prior
to a |
| public void | openFrame(JInternalFrame f)
Implements javax. Normally this method will not be called. |
| protected void | removeIconFor(JInternalFrame
the f)JInternalFrame for which to remove the
desktopIconConvenience method to remove the desktopIcon of f is necessary. |
| public void | resizeFrame(JComponent
the component to be resized f, int the new x-coordinate newX, int the new y-coordinate newY, int the new width newWidth, int the new height newHeight)Implements javax. Calls |
| public void | setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
Implements javax. This moves the |
| protected void | setPreviousBounds(JInternalFrame
the component about to be resized f, Rectangle the normal bounds to be saved away r)Stores the bounds of the component just before a maximize call. |
| private void | |
| protected void | setWasIcon(JInternalFrame
the f, Boolean JInternalFrame of interesta value)Boolean signifying if component has been iconizedSets that the component has been iconized and the bounds of the
|
| protected boolean | Returns: true if the component has been iconized;
otherwise returns falsethe f)JInternalFrame of interestReturns |
| currentBounds | back to summary |
|---|---|
| private transient Rectangle currentBounds | |
| currentLoc | back to summary |
|---|---|
| private transient Point currentLoc | |
| DEFAULT_DRAG_MODE | back to summary |
|---|---|
| pack-priv static final int DEFAULT_DRAG_MODE | |
| desktopBounds | back to summary |
|---|---|
| private transient Rectangle desktopBounds | |
| desktopGraphics | back to summary |
|---|---|
| private transient Graphics desktopGraphics | |
| didDrag | back to summary |
|---|---|
| private transient boolean didDrag Set to true when the user actually drags a frame vs clicks on it to start the drag operation. This is only used when dragging with FASTER_DRAG_MODE. | |
| dragMode | back to summary |
|---|---|
| pack-priv int dragMode | |
| FASTER_DRAG_MODE | back to summary |
|---|---|
| pack-priv static final int FASTER_DRAG_MODE | |
| floatingItems | back to summary |
|---|---|
| private transient Rectangle[] floatingItems | |
| HAS_BEEN_ICONIFIED_PROPERTY | back to summary |
|---|---|
| pack-priv static final String HAS_BEEN_ICONIFIED_PROPERTY | |
| OUTLINE_DRAG_MODE | back to summary |
|---|---|
| pack-priv static final int OUTLINE_DRAG_MODE | |
| DefaultDesktopManager | back to summary |
|---|---|
| public DefaultDesktopManager() Constructs a | |
| activateFrame | back to summary |
|---|---|
| public void activateFrame(JInternalFrame f) Implements javax. This will activate f moving it to the front. It will
set the current active frame's (if any)
| |
| beginDraggingFrame | back to summary |
|---|---|
| public void beginDraggingFrame(JComponent f) Implements javax. Doc from javax. This 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. | |
| beginResizingFrame | back to summary |
|---|---|
| public void beginResizingFrame(JComponent f, int direction) Implements javax. Doc from javax. This 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. | |
| closeFrame | back to summary |
|---|---|
| public void closeFrame(JInternalFrame f) Implements javax. Removes the frame, and, if necessary, the
| |
| deactivateFrame | back to summary |
|---|---|
| public void deactivateFrame(JInternalFrame f) Implements javax. Doc from javax. Generally, indicate that this frame has lost focus. This is usually called after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false. | |
| deiconifyFrame | back to summary |
|---|---|
| public void deiconifyFrame(JInternalFrame f) Implements javax. Removes the desktopIcon from its parent and adds its frame to the parent.
| |
| dragFrame | back to summary |
|---|---|
| public void dragFrame(JComponent f, int newX, int newY) Implements javax. 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 | |
| dragFrameFaster | back to summary |
|---|---|
| private void dragFrameFaster(JComponent f, int newX, int newY) | |
| emergencyCleanup | back to summary |
|---|---|
| private void emergencyCleanup(final JComponent f) This method is here to clean up problems associated with a race condition which can occur when the full contents of a copyArea's source argument is not available onscreen. This uses brute force to clean up in case of possible damage | |
| endDraggingFrame | back to summary |
|---|---|
| public void endDraggingFrame(JComponent f) Implements javax. Doc from javax. This method signals the end of the dragging session. Any state maintained by the DesktopManager can be removed here. Normally f will be a JInternalFrame. | |
| endResizingFrame | back to summary |
|---|---|
| public void endResizingFrame(JComponent f) Implements javax. Doc from javax. This method signals the end of the resize session. Any state maintained by the DesktopManager can be removed here. Normally f will be a JInternalFrame. | |
| findFloatingItems | back to summary |
|---|---|
| private Rectangle[] findFloatingItems(JComponent f) | |
| getBoundsForIconOf | back to summary |
|---|---|
| protected Rectangle getBoundsForIconOf(JInternalFrame f) The
| |
| getDesktopPane | back to summary |
|---|---|
| pack-priv JDesktopPane getDesktopPane(JComponent frame) | |
| getPreviousBounds | back to summary |
|---|---|
| protected Rectangle getPreviousBounds(JInternalFrame f) Gets the normal bounds of the component prior to the component being maximized.
| |
| iconifyFrame | back to summary |
|---|---|
| public void iconifyFrame(JInternalFrame f) Implements javax. Removes the frame from its parent and adds its
| |
| isFloaterCollision | back to summary |
|---|---|
| private boolean isFloaterCollision(Rectangle moveFrom, Rectangle moveTo) | |
| maximizeFrame | back to summary |
|---|---|
| public void maximizeFrame(JInternalFrame f) Implements javax. Resizes the frame to fill its parents bounds.
| |
| minimizeFrame | back to summary |
|---|---|
| public void minimizeFrame(JInternalFrame f) Implements javax. Restores the frame back to its size and position prior
to a
| |
| openFrame | back to summary |
|---|---|
| public void openFrame(JInternalFrame f) Implements javax. Normally 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. | |
| removeIconFor | back to summary |
|---|---|
| protected void removeIconFor(JInternalFrame f) Convenience method to remove the desktopIcon of f is necessary.
| |
| resizeFrame | back to summary |
|---|---|
| public void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) Implements javax. Calls
| |
| setBoundsForFrame | back to summary |
|---|---|
| public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) Implements javax. This moves the | |
| setPreviousBounds | back to summary |
|---|---|
| protected void setPreviousBounds(JInternalFrame f, Rectangle r) Stores the bounds of the component just before a maximize call.
| |
| setupDragMode | back to summary |
|---|---|
| private void setupDragMode(JComponent f) | |
| setWasIcon | back to summary |
|---|---|
| protected void setWasIcon(JInternalFrame f, Boolean value) Sets that the component has been iconized and the bounds of the
| |
| wasIcon | back to summary |
|---|---|
| protected boolean wasIcon(JInternalFrame f) Returns
| |