< prev index next >
src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java
Print this page
*** 31,45 ****
import sun.awt.SunToolkit;
import java.awt.*;
import java.beans.PropertyVetoException;
! /** This is an implementation of the <code>DesktopManager</code>.
* It currently implements the basic behaviors for managing
! * <code>JInternalFrame</code>s in an arbitrary parent.
! * <code>JInternalFrame</code>s that are not children of a
! * <code>JDesktop</code> will use this component
* to handle their desktop-like actions.
* <p>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.</p>
* @see JDesktopPane
--- 31,45 ----
import sun.awt.SunToolkit;
import java.awt.*;
import java.beans.PropertyVetoException;
! /** This is an implementation of the {@code DesktopManager}.
* It currently implements the basic behaviors for managing
! * {@code JInternalFrame}s in an arbitrary parent.
! * {@code JInternalFrame}s that are not children of a
! * {@code JDesktop} will use this component
* to handle their desktop-like actions.
* <p>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.</p>
* @see JDesktopPane
*** 81,92 ****
}
}
/**
* Removes the frame, and, if necessary, the
! * <code>desktopIcon</code>, from its parent.
! * @param f the <code>JInternalFrame</code> to be removed
*/
public void closeFrame(JInternalFrame f) {
JDesktopPane d = f.getDesktopPane();
if (d == null) {
return;
--- 81,92 ----
}
}
/**
* Removes the frame, and, if necessary, the
! * {@code desktopIcon}, from its parent.
! * @param f the {@code JInternalFrame} to be removed
*/
public void closeFrame(JInternalFrame f) {
JDesktopPane d = f.getDesktopPane();
if (d == null) {
return;
*** 142,153 ****
}
}
/**
* Restores the frame back to its size and position prior
! * to a <code>maximizeFrame</code> call.
! * @param f the <code>JInternalFrame</code> to be restored
*/
public void minimizeFrame(JInternalFrame f) {
// If the frame was an icon restore it back to an icon.
if (f.isIcon()) {
iconifyFrame(f);
--- 142,153 ----
}
}
/**
* Restores the frame back to its size and position prior
! * to a {@code maximizeFrame} call.
! * @param f the {@code JInternalFrame} to be restored
*/
public void minimizeFrame(JInternalFrame f) {
// If the frame was an icon restore it back to an icon.
if (f.isIcon()) {
iconifyFrame(f);
*** 162,173 ****
}
}
/**
* Removes the frame from its parent and adds its
! * <code>desktopIcon</code> to the parent.
! * @param f the <code>JInternalFrame</code> to be iconified
*/
public void iconifyFrame(JInternalFrame f) {
JInternalFrame.JDesktopIcon desktopIcon;
Container c = f.getParent();
JDesktopPane d = f.getDesktopPane();
--- 162,173 ----
}
}
/**
* Removes the frame from its parent and adds its
! * {@code desktopIcon} to the parent.
! * @param f the {@code JInternalFrame} to be iconified
*/
public void iconifyFrame(JInternalFrame f) {
JInternalFrame.JDesktopIcon desktopIcon;
Container c = f.getParent();
JDesktopPane d = f.getDesktopPane();
*** 211,221 ****
}
/**
* Removes the desktopIcon from its parent and adds its frame
* to the parent.
! * @param f the <code>JInternalFrame</code> to be de-iconified
*/
public void deiconifyFrame(JInternalFrame f) {
JInternalFrame.JDesktopIcon desktopIcon = f.getDesktopIcon();
Container c = desktopIcon.getParent();
JDesktopPane d = f.getDesktopPane();
--- 211,221 ----
}
/**
* Removes the desktopIcon from its parent and adds its frame
* to the parent.
! * @param f the {@code JInternalFrame} to be de-iconified
*/
public void deiconifyFrame(JInternalFrame f) {
JInternalFrame.JDesktopIcon desktopIcon = f.getDesktopIcon();
Container c = desktopIcon.getParent();
JDesktopPane d = f.getDesktopPane();
*** 245,257 ****
}
}
/** This will activate <b>f</b> moving it to the front. It will
* set the current active frame's (if any)
! * <code>IS_SELECTED_PROPERTY</code> to <code>false</code>.
* There can be only one active frame across all Layers.
! * @param f the <code>JInternalFrame</code> to be activated
*/
public void activateFrame(JInternalFrame f) {
Container p = f.getParent();
Component[] c;
JDesktopPane d = f.getDesktopPane();
--- 245,257 ----
}
}
/** This will activate <b>f</b> moving it to the front. It will
* set the current active frame's (if any)
! * {@code IS_SELECTED_PROPERTY} to {@code false}.
* There can be only one active frame across all Layers.
! * @param f the {@code JInternalFrame} to be activated
*/
public void activateFrame(JInternalFrame f) {
Container p = f.getParent();
Component[] c;
JDesktopPane d = f.getDesktopPane();
*** 346,356 ****
/**
* 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 <code>endDraggingFrame</code> is called.
*/
public void dragFrame(JComponent f, int newX, int newY) {
if (dragMode == OUTLINE_DRAG_MODE) {
JDesktopPane desktopPane = getDesktopPane(f);
--- 346,356 ----
/**
* 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 {@code endDraggingFrame} is called.
*/
public void dragFrame(JComponent f, int newX, int newY) {
if (dragMode == OUTLINE_DRAG_MODE) {
JDesktopPane desktopPane = getDesktopPane(f);
*** 408,418 ****
public void beginResizingFrame(JComponent f, int direction) {
setupDragMode(f);
}
/**
! * Calls <code>setBoundsForFrame</code> with the new values.
* @param f the component to be resized
* @param newX the new x-coordinate
* @param newY the new y-coordinate
* @param newWidth the new width
* @param newHeight the new height
--- 408,418 ----
public void beginResizingFrame(JComponent f, int direction) {
setupDragMode(f);
}
/**
! * Calls {@code setBoundsForFrame} with the new values.
* @param f the component to be resized
* @param newX the new x-coordinate
* @param newY the new y-coordinate
* @param newWidth the new width
* @param newHeight the new height
*** 453,463 ****
currentBounds = null;
}
}
! /** This moves the <code>JComponent</code> and repaints the damaged areas. */
public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) {
f.setBounds(newX, newY, newWidth, newHeight);
// we must validate the hierarchy to not break the hw/lw mixing
f.revalidate();
}
--- 453,463 ----
currentBounds = null;
}
}
! /** This moves the {@code JComponent} and repaints the damaged areas. */
public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) {
f.setBounds(newX, newY, newWidth, newHeight);
// we must validate the hierarchy to not break the hw/lw mixing
f.revalidate();
}
*** 588,607 ****
}
/**
* Gets the normal bounds of the component prior to the component
* being maximized.
! * @param f the <code>JInternalFrame</code> of interest
* @return the normal bounds of the component
*/
protected Rectangle getPreviousBounds(JInternalFrame f) {
return f.getNormalBounds();
}
/**
* Sets that the component has been iconized and the bounds of the
! * <code>desktopIcon</code> are valid.
*
* @param f the {@code JInternalFrame} of interest
* @param value a {@code Boolean} signifying if component has been iconized
*/
protected void setWasIcon(JInternalFrame f, Boolean value) {
--- 588,607 ----
}
/**
* Gets the normal bounds of the component prior to the component
* being maximized.
! * @param f the {@code JInternalFrame} of interest
* @return the normal bounds of the component
*/
protected Rectangle getPreviousBounds(JInternalFrame f) {
return f.getNormalBounds();
}
/**
* Sets that the component has been iconized and the bounds of the
! * {@code desktopIcon} are valid.
*
* @param f the {@code JInternalFrame} of interest
* @param value a {@code Boolean} signifying if component has been iconized
*/
protected void setWasIcon(JInternalFrame f, Boolean value) {
*** 609,625 ****
f.putClientProperty(HAS_BEEN_ICONIFIED_PROPERTY, value);
}
}
/**
! * Returns <code>true</code> if the component has been iconized
! * and the bounds of the <code>desktopIcon</code> are valid,
! * otherwise returns <code>false</code>.
*
! * @param f the <code>JInternalFrame</code> of interest
! * @return <code>true</code> if the component has been iconized;
! * otherwise returns <code>false</code>
*/
protected boolean wasIcon(JInternalFrame f) {
return (f.getClientProperty(HAS_BEEN_ICONIFIED_PROPERTY) == Boolean.TRUE);
}
--- 609,625 ----
f.putClientProperty(HAS_BEEN_ICONIFIED_PROPERTY, value);
}
}
/**
! * Returns {@code true} if the component has been iconized
! * and the bounds of the {@code desktopIcon} are valid,
! * otherwise returns {@code false}.
*
! * @param f the {@code JInternalFrame} of interest
! * @return {@code true} if the component has been iconized;
! * otherwise returns {@code false}
*/
protected boolean wasIcon(JInternalFrame f) {
return (f.getClientProperty(HAS_BEEN_ICONIFIED_PROPERTY) == Boolean.TRUE);
}
< prev index next >