On this page
Class DefaultDesktopManager
- All Implemented Interfaces:
Serializable
,DesktopManager
public class DefaultDesktopManager extends Object implements DesktopManager, Serializable
DesktopManager
. It currently implements the basic behaviors for managing JInternalFrame
s in an arbitrary parent. JInternalFrame
s 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.
- Since:
- 1.2
- See Also:
Constructor Summary
Constructor | Description |
---|---|
DefaultDesktopManager() |
Constructs a DefaultDesktopManager .
|
Method Summary
Modifier and Type | Method | Description |
---|---|---|
void |
activateFrame |
This will activate f moving it to the front.
|
void |
beginDraggingFrame |
This method is normally called when the user has indicated that they will begin dragging a component around.
|
void |
beginResizingFrame |
This method is normally called when the user has indicated that they will begin resizing the frame.
|
void |
closeFrame |
Removes the frame, and, if necessary, the desktopIcon , from its parent.
|
void |
deactivateFrame |
Generally, indicate that this frame has lost focus.
|
void |
deiconifyFrame |
Removes the desktopIcon from its parent and adds its frame to the parent.
|
void |
dragFrame |
Moves the visible location of the frame being dragged to the location specified.
|
void |
endDraggingFrame |
This method signals the end of the dragging session.
|
void |
endResizingFrame |
This method signals the end of the resize session.
|
protected Rectangle |
getBoundsForIconOf |
The iconifyFrame() code calls this to determine the proper bounds for the desktopIcon.
|
protected Rectangle |
getPreviousBounds |
Gets the normal bounds of the component prior to the component being maximized.
|
void |
iconifyFrame |
Removes the frame from its parent and adds its desktopIcon to the parent.
|
void |
maximizeFrame |
Resizes the frame to fill its parents bounds.
|
void |
minimizeFrame |
Restores the frame back to its size and position prior to a maximizeFrame call.
|
void |
openFrame |
Normally this method will not be called.
|
protected void |
removeIconFor |
Convenience method to remove the desktopIcon of f is necessary.
|
void |
resizeFrame |
Calls setBoundsForFrame with the new values.
|
void |
setBoundsForFrame |
This moves the JComponent and repaints the damaged areas.
|
protected void |
setPreviousBounds |
Stores the bounds of the component just before a maximize call.
|
protected void |
setWasIcon |
Sets that the component has been iconized and the bounds of the desktopIcon are valid.
|
protected boolean |
wasIcon |
Returns true if the component has been iconized and the bounds of the desktopIcon are valid, otherwise returns false .
|
Constructor Details
DefaultDesktopManager
public DefaultDesktopManager()
DefaultDesktopManager
.
Method Details
openFrame
public void openFrame(JInternalFrame f)
- Specified by:
openFrame
in interfaceDesktopManager
- Parameters:
f
- theJInternalFrame
to be displayed
closeFrame
public void closeFrame(JInternalFrame f)
desktopIcon
, from its parent.
- Specified by:
closeFrame
in interfaceDesktopManager
- Parameters:
f
- theJInternalFrame
to be removed
maximizeFrame
public void maximizeFrame(JInternalFrame f)
- Specified by:
maximizeFrame
in interfaceDesktopManager
- Parameters:
f
- the frame to be resized
minimizeFrame
public void minimizeFrame(JInternalFrame f)
maximizeFrame
call.
- Specified by:
minimizeFrame
in interfaceDesktopManager
- Parameters:
f
- theJInternalFrame
to be restored
iconifyFrame
public void iconifyFrame(JInternalFrame f)
desktopIcon
to the parent.
- Specified by:
iconifyFrame
in interfaceDesktopManager
- Parameters:
f
- theJInternalFrame
to be iconified
deiconifyFrame
public void deiconifyFrame(JInternalFrame f)
- Specified by:
deiconifyFrame
in interfaceDesktopManager
- Parameters:
f
- theJInternalFrame
to be de-iconified
activateFrame
public void activateFrame(JInternalFrame f)
IS_SELECTED_PROPERTY
to false
. There can be only one active frame across all Layers.
- Specified by:
activateFrame
in interfaceDesktopManager
- Parameters:
f
- theJInternalFrame
to be activated
deactivateFrame
public void deactivateFrame(JInternalFrame f)
DesktopManager
- Specified by:
deactivateFrame
in interfaceDesktopManager
- Parameters:
f
- theJInternalFrame
to be deactivated
beginDraggingFrame
public void beginDraggingFrame(JComponent f)
DesktopManager
- Specified by:
beginDraggingFrame
in interfaceDesktopManager
- Parameters:
f
- theJComponent
being dragged
dragFrame
public void dragFrame(JComponent f, int newX, int newY)
endDraggingFrame
is called.
- Specified by:
dragFrame
in interfaceDesktopManager
- Parameters:
f
- theJComponent
being draggednewX
- the new x-coordinatenewY
- the new y-coordinate
endDraggingFrame
public void endDraggingFrame(JComponent f)
DesktopManager
- Specified by:
endDraggingFrame
in interfaceDesktopManager
- Parameters:
f
- theJComponent
being dragged
beginResizingFrame
public void beginResizingFrame(JComponent f, int direction)
DesktopManager
- Specified by:
beginResizingFrame
in interfaceDesktopManager
- Parameters:
f
- theJComponent
being resizeddirection
- the direction
resizeFrame
public void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
setBoundsForFrame
with the new values.
- Specified by:
resizeFrame
in interfaceDesktopManager
- Parameters:
f
- the component to be resizednewX
- the new x-coordinatenewY
- the new y-coordinatenewWidth
- the new widthnewHeight
- the new height
endResizingFrame
public void endResizingFrame(JComponent f)
DesktopManager
- Specified by:
endResizingFrame
in interfaceDesktopManager
- Parameters:
f
- theJComponent
being resized
setBoundsForFrame
public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
JComponent
and repaints the damaged areas.
- Specified by:
setBoundsForFrame
in interfaceDesktopManager
- Parameters:
f
- theJComponent
being moved or resizednewX
- the new x-coordinatenewY
- the new y-coordinatenewWidth
- the new widthnewHeight
- the new height
removeIconFor
protected void removeIconFor(JInternalFrame f)
- Parameters:
f
- theJInternalFrame
for which to remove thedesktopIcon
getBoundsForIconOf
protected Rectangle getBoundsForIconOf(JInternalFrame f)
iconifyFrame()
code calls this to determine the proper bounds for the desktopIcon.
- Parameters:
f
- theJInternalFrame
of interest- Returns:
-
a
Rectangle
containing bounds for thedesktopIcon
setPreviousBounds
protected void setPreviousBounds(JInternalFrame f, Rectangle r)
- Parameters:
f
- the component about to be resizedr
- the normal bounds to be saved away
getPreviousBounds
protected Rectangle getPreviousBounds(JInternalFrame f)
- Parameters:
f
- theJInternalFrame
of interest- Returns:
- the normal bounds of the component
setWasIcon
protected void setWasIcon(JInternalFrame f, Boolean value)
desktopIcon
are valid.
- Parameters:
f
- theJInternalFrame
of interestvalue
- aBoolean
signifying if component has been iconized
wasIcon
protected boolean wasIcon(JInternalFrame f)
true
if the component has been iconized and the bounds of the desktopIcon
are valid, otherwise returns false
.
- Parameters:
f
- theJInternalFrame
of interest- Returns:
true
if the component has been iconized; otherwise returnsfalse
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/DefaultDesktopManager.html