< prev index next >
src/java.desktop/share/classes/java/awt/Component.java
Print this page
*** 87,99 ****
/**
* A <em>component</em> is an object having a graphical representation
* that can be displayed on the screen and that can interact with the
* user. Examples of components are the buttons, checkboxes, and scrollbars
* of a typical graphical user interface. <p>
! * The <code>Component</code> class is the abstract superclass of
* the nonmenu-related Abstract Window Toolkit components. Class
! * <code>Component</code> can also be extended directly to create a
* lightweight component. A lightweight component is a component that is
* not associated with a native window. On the contrary, a heavyweight
* component is associated with a native window. The {@link #isLightweight()}
* method may be used to distinguish between the two kinds of the components.
* <p>
--- 87,99 ----
/**
* A <em>component</em> is an object having a graphical representation
* that can be displayed on the screen and that can interact with the
* user. Examples of components are the buttons, checkboxes, and scrollbars
* of a typical graphical user interface. <p>
! * The {@code Component} class is the abstract superclass of
* the nonmenu-related Abstract Window Toolkit components. Class
! * {@code Component} can also be extended directly to create a
* lightweight component. A lightweight component is a component that is
* not associated with a native window. On the contrary, a heavyweight
* component is associated with a native window. The {@link #isLightweight()}
* method may be used to distinguish between the two kinds of the components.
* <p>
*** 105,118 ****
* validated afterwards by means of the {@link Container#validate()} method
* invoked on the top-most invalid container of the hierarchy.
*
* <h3>Serialization</h3>
* It is important to note that only AWT listeners which conform
! * to the <code>Serializable</code> protocol will be saved when
* the object is stored. If an AWT object has listeners that
* aren't marked serializable, they will be dropped at
! * <code>writeObject</code> time. Developers will need, as always,
* to consider the implications of making an object serializable.
* One situation to watch out for is this:
* <pre>
* import java.awt.*;
* import java.awt.event.*;
--- 105,118 ----
* validated afterwards by means of the {@link Container#validate()} method
* invoked on the top-most invalid container of the hierarchy.
*
* <h3>Serialization</h3>
* It is important to note that only AWT listeners which conform
! * to the {@code Serializable} protocol will be saved when
* the object is stored. If an AWT object has listeners that
* aren't marked serializable, they will be dropped at
! * {@code writeObject} time. Developers will need, as always,
* to consider the implications of making an object serializable.
* One situation to watch out for is this:
* <pre>
* import java.awt.*;
* import java.awt.event.*;
*** 134,149 ****
* {
* System.out.println("Hello There");
* }
* }
* </pre>
! * In this example, serializing <code>aButton</code> by itself
! * will cause <code>MyApp</code> and everything it refers to
* to be serialized as well. The problem is that the listener
* is serializable by coincidence, not by design. To separate
! * the decisions about <code>MyApp</code> and the
! * <code>ActionListener</code> being serializable one can use a
* nested class, as in the following example:
* <pre>
* import java.awt.*;
* import java.awt.event.*;
* import java.io.Serializable;
--- 134,149 ----
* {
* System.out.println("Hello There");
* }
* }
* </pre>
! * In this example, serializing {@code aButton} by itself
! * will cause {@code MyApp} and everything it refers to
* to be serialized as well. The problem is that the listener
* is serializable by coincidence, not by design. To separate
! * the decisions about {@code MyApp} and the
! * {@code ActionListener} being serializable one can use a
* nested class, as in the following example:
* <pre>
* import java.awt.*;
* import java.awt.event.*;
* import java.io.Serializable;
*** 192,217 ****
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.Component");
private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Component");
/**
* The peer of the component. The peer implements the component's
! * behavior. The peer is set when the <code>Component</code> is
* added to a container that also is a peer.
* @see #addNotify
* @see #removeNotify
*/
transient volatile ComponentPeer peer;
/**
! * The parent of the object. It may be <code>null</code>
* for top-level components.
* @see #getParent
*/
transient Container parent;
/**
! * The <code>AppContext</code> of the component. Applets/Plugin may
* change the AppContext.
*/
transient AppContext appContext;
/**
--- 192,217 ----
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.Component");
private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Component");
/**
* The peer of the component. The peer implements the component's
! * behavior. The peer is set when the {@code Component} is
* added to a container that also is a peer.
* @see #addNotify
* @see #removeNotify
*/
transient volatile ComponentPeer peer;
/**
! * The parent of the object. It may be {@code null}
* for top-level components.
* @see #getParent
*/
transient Container parent;
/**
! * The {@code AppContext} of the component. Applets/Plugin may
* change the AppContext.
*/
transient AppContext appContext;
/**
*** 246,292 ****
*/
int height;
/**
* The foreground color for this component.
! * <code>foreground</code> can be <code>null</code>.
*
* @serial
* @see #getForeground
* @see #setForeground
*/
Color foreground;
/**
* The background color for this component.
! * <code>background</code> can be <code>null</code>.
*
* @serial
* @see #getBackground
* @see #setBackground
*/
Color background;
/**
* The font used by this component.
! * The <code>font</code> can be <code>null</code>.
*
* @serial
* @see #getFont
* @see #setFont
*/
volatile Font font;
/**
* The font which the peer is currently using.
! * (<code>null</code> if no peer exists.)
*/
Font peerFont;
/**
* The cursor displayed when pointer is over this component.
! * This value can be <code>null</code>.
*
* @serial
* @see #getCursor
* @see #setCursor
*/
--- 246,292 ----
*/
int height;
/**
* The foreground color for this component.
! * {@code foreground} can be {@code null}.
*
* @serial
* @see #getForeground
* @see #setForeground
*/
Color foreground;
/**
* The background color for this component.
! * {@code background} can be {@code null}.
*
* @serial
* @see #getBackground
* @see #setBackground
*/
Color background;
/**
* The font used by this component.
! * The {@code font} can be {@code null}.
*
* @serial
* @see #getFont
* @see #setFont
*/
volatile Font font;
/**
* The font which the peer is currently using.
! * ({@code null} if no peer exists.)
*/
Font peerFont;
/**
* The cursor displayed when pointer is over this component.
! * This value can be {@code null}.
*
* @serial
* @see #getCursor
* @see #setCursor
*/
*** 300,323 ****
* @see #setLocale
*/
Locale locale;
/**
! * A reference to a <code>GraphicsConfiguration</code> object
* used to describe the characteristics of a graphics
* destination.
! * This value can be <code>null</code>.
*
* @since 1.3
* @serial
* @see GraphicsConfiguration
* @see #getGraphicsConfiguration
*/
private transient GraphicsConfiguration graphicsConfig = null;
/**
! * A reference to a <code>BufferStrategy</code> object
* used to manipulate the buffers on this component.
*
* @since 1.4
* @see java.awt.image.BufferStrategy
* @see #getBufferStrategy()
--- 300,323 ----
* @see #setLocale
*/
Locale locale;
/**
! * A reference to a {@code GraphicsConfiguration} object
* used to describe the characteristics of a graphics
* destination.
! * This value can be {@code null}.
*
* @since 1.3
* @serial
* @see GraphicsConfiguration
* @see #getGraphicsConfiguration
*/
private transient GraphicsConfiguration graphicsConfig = null;
/**
! * A reference to a {@code BufferStrategy} object
* used to manipulate the buffers on this component.
*
* @since 1.4
* @see java.awt.image.BufferStrategy
* @see #getBufferStrategy()
*** 365,375 ****
* @see #invalidate
*/
private volatile boolean valid = false;
/**
! * The <code>DropTarget</code> associated with this component.
*
* @since 1.2
* @serial
* @see #setDropTarget
* @see #getDropTarget
--- 365,375 ----
* @see #invalidate
*/
private volatile boolean valid = false;
/**
! * The {@code DropTarget} associated with this component.
*
* @since 1.2
* @serial
* @see #setDropTarget
* @see #getDropTarget
*** 382,402 ****
*/
Vector<PopupMenu> popups;
/**
* A component's name.
! * This field can be <code>null</code>.
*
* @serial
* @see #getName
* @see #setName(String)
*/
private String name;
/**
* A bool to determine whether the name has
! * been set explicitly. <code>nameExplicitlySet</code> will
* be false if the name has not been set and
* true if it has.
*
* @serial
* @see #getName
--- 382,402 ----
*/
Vector<PopupMenu> popups;
/**
* A component's name.
! * This field can be {@code null}.
*
* @serial
* @see #getName
* @see #setName(String)
*/
private String name;
/**
* A bool to determine whether the name has
! * been set explicitly. {@code nameExplicitlySet} will
* be false if the name has not been set and
* true if it has.
*
* @serial
* @see #getName
*** 521,531 ****
*/
transient ComponentOrientation componentOrientation
= ComponentOrientation.UNKNOWN;
/**
! * <code>newEventsOnly</code> will be true if the event is
* one of the event types enabled for the component.
* It will then allow for normal processing to
* continue. If it is false the event is passed
* to the component's parent and up the ancestor
* tree until the event has been consumed.
--- 521,531 ----
*/
transient ComponentOrientation componentOrientation
= ComponentOrientation.UNKNOWN;
/**
! * {@code newEventsOnly} will be true if the event is
* one of the event types enabled for the component.
* It will then allow for normal processing to
* continue. If it is false the event is passed
* to the component's parent and up the ancestor
* tree until the event has been consumed.
*** 563,579 ****
static final String hierarchyBoundsListenerK = "hierarchyBoundsL";
static final String windowStateListenerK = "windowStateL";
static final String windowFocusListenerK = "windowFocusL";
/**
! * The <code>eventMask</code> is ONLY set by subclasses via
! * <code>enableEvents</code>.
* The mask should NOT be set when listeners are registered
* so that we can distinguish the difference between when
* listeners request events and subclasses request them.
* One bit is used to indicate whether input methods are
! * enabled; this bit is set by <code>enableInputMethods</code> and is
* on by default.
*
* @serial
* @see #enableInputMethods
* @see AWTEvent
--- 563,579 ----
static final String hierarchyBoundsListenerK = "hierarchyBoundsL";
static final String windowStateListenerK = "windowStateL";
static final String windowFocusListenerK = "windowFocusL";
/**
! * The {@code eventMask} is ONLY set by subclasses via
! * {@code enableEvents}.
* The mask should NOT be set when listeners are registered
* so that we can distinguish the difference between when
* listeners request events and subclasses request them.
* One bit is used to indicate whether input methods are
! * enabled; this bit is set by {@code enableInputMethods} and is
* on by default.
*
* @serial
* @see #enableInputMethods
* @see AWTEvent
*** 602,642 ****
new GetPropertyAction("awt.image.redrawrate"));
incRate = (s != null) ? Integer.parseInt(s) : 100;
}
/**
! * Ease-of-use constant for <code>getAlignmentY()</code>.
* Specifies an alignment to the top of the component.
* @see #getAlignmentY
*/
public static final float TOP_ALIGNMENT = 0.0f;
/**
! * Ease-of-use constant for <code>getAlignmentY</code> and
! * <code>getAlignmentX</code>. Specifies an alignment to
* the center of the component
* @see #getAlignmentX
* @see #getAlignmentY
*/
public static final float CENTER_ALIGNMENT = 0.5f;
/**
! * Ease-of-use constant for <code>getAlignmentY</code>.
* Specifies an alignment to the bottom of the component.
* @see #getAlignmentY
*/
public static final float BOTTOM_ALIGNMENT = 1.0f;
/**
! * Ease-of-use constant for <code>getAlignmentX</code>.
* Specifies an alignment to the left side of the component.
* @see #getAlignmentX
*/
public static final float LEFT_ALIGNMENT = 0.0f;
/**
! * Ease-of-use constant for <code>getAlignmentX</code>.
* Specifies an alignment to the right side of the component.
* @see #getAlignmentX
*/
public static final float RIGHT_ALIGNMENT = 1.0f;
--- 602,642 ----
new GetPropertyAction("awt.image.redrawrate"));
incRate = (s != null) ? Integer.parseInt(s) : 100;
}
/**
! * Ease-of-use constant for {@code getAlignmentY()}.
* Specifies an alignment to the top of the component.
* @see #getAlignmentY
*/
public static final float TOP_ALIGNMENT = 0.0f;
/**
! * Ease-of-use constant for {@code getAlignmentY} and
! * {@code getAlignmentX}. Specifies an alignment to
* the center of the component
* @see #getAlignmentX
* @see #getAlignmentY
*/
public static final float CENTER_ALIGNMENT = 0.5f;
/**
! * Ease-of-use constant for {@code getAlignmentY}.
* Specifies an alignment to the bottom of the component.
* @see #getAlignmentY
*/
public static final float BOTTOM_ALIGNMENT = 1.0f;
/**
! * Ease-of-use constant for {@code getAlignmentX}.
* Specifies an alignment to the left side of the component.
* @see #getAlignmentX
*/
public static final float LEFT_ALIGNMENT = 0.0f;
/**
! * Ease-of-use constant for {@code getAlignmentX}.
* Specifies an alignment to the right side of the component.
* @see #getAlignmentX
*/
public static final float RIGHT_ALIGNMENT = 1.0f;
*** 644,655 ****
* JDK 1.1 serialVersionUID
*/
private static final long serialVersionUID = -7644114512714619750L;
/**
! * If any <code>PropertyChangeListeners</code> have been registered,
! * the <code>changeSupport</code> field describes them.
*
* @serial
* @since 1.2
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
--- 644,655 ----
* JDK 1.1 serialVersionUID
*/
private static final long serialVersionUID = -7644114512714619750L;
/**
! * If any {@code PropertyChangeListeners} have been registered,
! * the {@code changeSupport} field describes them.
*
* @serial
* @since 1.2
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
*** 703,747 ****
* In general the baseline resize behavior will be valid for sizes
* greater than or equal to the minimum size (the actual minimum
* size; not a developer specified minimum size). For sizes
* smaller than the minimum size the baseline may change in a way
* other than the baseline resize behavior indicates. Similarly,
! * as the size approaches <code>Integer.MAX_VALUE</code> and/or
! * <code>Short.MAX_VALUE</code> the baseline may change in a way
* other than the baseline resize behavior indicates.
*
* @see #getBaselineResizeBehavior
* @see #getBaseline(int,int)
* @since 1.6
*/
public enum BaselineResizeBehavior {
/**
* Indicates the baseline remains fixed relative to the
! * y-origin. That is, <code>getBaseline</code> returns
* the same value regardless of the height or width. For example, a
! * <code>JLabel</code> containing non-empty text with a
! * vertical alignment of <code>TOP</code> should have a
! * baseline type of <code>CONSTANT_ASCENT</code>.
*/
CONSTANT_ASCENT,
/**
* Indicates the baseline remains fixed relative to the height
* and does not change as the width is varied. That is, for
* any height H the difference between H and
! * <code>getBaseline(w, H)</code> is the same. For example, a
! * <code>JLabel</code> containing non-empty text with a
! * vertical alignment of <code>BOTTOM</code> should have a
! * baseline type of <code>CONSTANT_DESCENT</code>.
*/
CONSTANT_DESCENT,
/**
* Indicates the baseline remains a fixed distance from
* the center of the component. That is, for any height H the
! * difference between <code>getBaseline(w, H)</code> and
! * <code>H / 2</code> is the same (plus or minus one depending upon
* rounding error).
* <p>
* Because of possible rounding errors it is recommended
* you ask for the baseline with two consecutive heights and use
* the return value to determine if you need to pad calculations
--- 703,747 ----
* In general the baseline resize behavior will be valid for sizes
* greater than or equal to the minimum size (the actual minimum
* size; not a developer specified minimum size). For sizes
* smaller than the minimum size the baseline may change in a way
* other than the baseline resize behavior indicates. Similarly,
! * as the size approaches {@code Integer.MAX_VALUE} and/or
! * {@code Short.MAX_VALUE} the baseline may change in a way
* other than the baseline resize behavior indicates.
*
* @see #getBaselineResizeBehavior
* @see #getBaseline(int,int)
* @since 1.6
*/
public enum BaselineResizeBehavior {
/**
* Indicates the baseline remains fixed relative to the
! * y-origin. That is, {@code getBaseline} returns
* the same value regardless of the height or width. For example, a
! * {@code JLabel} containing non-empty text with a
! * vertical alignment of {@code TOP} should have a
! * baseline type of {@code CONSTANT_ASCENT}.
*/
CONSTANT_ASCENT,
/**
* Indicates the baseline remains fixed relative to the height
* and does not change as the width is varied. That is, for
* any height H the difference between H and
! * {@code getBaseline(w, H)} is the same. For example, a
! * {@code JLabel} containing non-empty text with a
! * vertical alignment of {@code BOTTOM} should have a
! * baseline type of {@code CONSTANT_DESCENT}.
*/
CONSTANT_DESCENT,
/**
* Indicates the baseline remains a fixed distance from
* the center of the component. That is, for any height H the
! * difference between {@code getBaseline(w, H)} and
! * {@code H / 2} is the same (plus or minus one depending upon
* rounding error).
* <p>
* Because of possible rounding errors it is recommended
* you ask for the baseline with two consecutive heights and use
* the return value to determine if you need to pad calculations
*** 986,1000 ****
}
});
}
/**
! * Constructs a new component. Class <code>Component</code> can be
* extended directly to create a lightweight component that does not
* utilize an opaque native window. A lightweight component must be
* hosted by a native container somewhere higher up in the component
! * tree (for example, by a <code>Frame</code> object).
*/
protected Component() {
appContext = AppContext.getAppContext();
}
--- 986,1000 ----
}
});
}
/**
! * Constructs a new component. Class {@code Component} can be
* extended directly to create a lightweight component that does not
* utilize an opaque native window. A lightweight component must be
* hosted by a native container somewhere higher up in the component
! * tree (for example, by a {@code Frame} object).
*/
protected Component() {
appContext = AppContext.getAppContext();
}
*** 1002,1013 ****
void initializeFocusTraversalKeys() {
focusTraversalKeys = new Set[3];
}
/**
! * Constructs a name for this component. Called by <code>getName</code>
! * when the name is <code>null</code>.
*/
String constructComponentName() {
return null; // For strict compliance with prior platform versions, a Component
// that doesn't set its name should return null from
// getName()
--- 1002,1013 ----
void initializeFocusTraversalKeys() {
focusTraversalKeys = new Set[3];
}
/**
! * Constructs a name for this component. Called by {@code getName}
! * when the name is {@code null}.
*/
String constructComponentName() {
return null; // For strict compliance with prior platform versions, a Component
// that doesn't set its name should return null from
// getName()
*** 1069,1080 ****
Container getContainer() {
return getParent_NoClientCode();
}
/**
! * Associate a <code>DropTarget</code> with this component.
! * The <code>Component</code> will receive drops only if it
* is enabled.
*
* @see #isEnabled
* @param dt The DropTarget
*/
--- 1069,1080 ----
Container getContainer() {
return getParent_NoClientCode();
}
/**
! * Associate a {@code DropTarget} with this component.
! * The {@code Component} will receive drops only if it
* is enabled.
*
* @see #isEnabled
* @param dt The DropTarget
*/
*** 1117,1147 ****
}
}
}
/**
! * Gets the <code>DropTarget</code> associated with this
! * <code>Component</code>.
*
* @return the drop target
*/
public synchronized DropTarget getDropTarget() { return dropTarget; }
/**
! * Gets the <code>GraphicsConfiguration</code> associated with this
! * <code>Component</code>.
! * If the <code>Component</code> has not been assigned a specific
! * <code>GraphicsConfiguration</code>,
! * the <code>GraphicsConfiguration</code> of the
! * <code>Component</code> object's top-level container is
* returned.
! * If the <code>Component</code> has been created, but not yet added
! * to a <code>Container</code>, this method returns <code>null</code>.
*
! * @return the <code>GraphicsConfiguration</code> used by this
! * <code>Component</code> or <code>null</code>
* @since 1.3
*/
public GraphicsConfiguration getGraphicsConfiguration() {
synchronized(getTreeLock()) {
return getGraphicsConfiguration_NoClientCode();
--- 1117,1147 ----
}
}
}
/**
! * Gets the {@code DropTarget} associated with this
! * {@code Component}.
*
* @return the drop target
*/
public synchronized DropTarget getDropTarget() { return dropTarget; }
/**
! * Gets the {@code GraphicsConfiguration} associated with this
! * {@code Component}.
! * If the {@code Component} has not been assigned a specific
! * {@code GraphicsConfiguration},
! * the {@code GraphicsConfiguration} of the
! * {@code Component} object's top-level container is
* returned.
! * If the {@code Component} has been created, but not yet added
! * to a {@code Container}, this method returns {@code null}.
*
! * @return the {@code GraphicsConfiguration} used by this
! * {@code Component} or {@code null}
* @since 1.3
*/
public GraphicsConfiguration getGraphicsConfiguration() {
synchronized(getTreeLock()) {
return getGraphicsConfiguration_NoClientCode();
*** 1176,1187 ****
}
return false;
}
/**
! * Checks that this component's <code>GraphicsDevice</code>
! * <code>idString</code> matches the string argument.
*/
void checkGD(String stringID) {
if (graphicsConfig != null) {
if (!graphicsConfig.getDevice().getIDstring().equals(stringID)) {
throw new IllegalArgumentException(
--- 1176,1187 ----
}
return false;
}
/**
! * Checks that this component's {@code GraphicsDevice}
! * {@code idString} matches the string argument.
*/
void checkGD(String stringID) {
if (graphicsConfig != null) {
if (!graphicsConfig.getDevice().getIDstring().equals(stringID)) {
throw new IllegalArgumentException(
*** 1243,1253 ****
* when it is correctly sized and positioned within its parent
* container and all its children are also valid.
* In order to account for peers' size requirements, components are invalidated
* before they are first shown on the screen. By the time the parent container
* is fully realized, all its components will be valid.
! * @return <code>true</code> if the component is valid, <code>false</code>
* otherwise
* @see #validate
* @see #invalidate
* @since 1.0
*/
--- 1243,1253 ----
* when it is correctly sized and positioned within its parent
* container and all its children are also valid.
* In order to account for peers' size requirements, components are invalidated
* before they are first shown on the screen. By the time the parent container
* is fully realized, all its components will be valid.
! * @return {@code true} if the component is valid, {@code false}
* otherwise
* @see #validate
* @see #invalidate
* @since 1.0
*/
*** 1268,1279 ****
* A component is made undisplayable either when it is removed from
* a displayable containment hierarchy or when its containment hierarchy
* is made undisplayable. A containment hierarchy is made
* undisplayable when its ancestor window is disposed.
*
! * @return <code>true</code> if the component is displayable,
! * <code>false</code> otherwise
* @see Container#add(Component)
* @see Window#pack
* @see Window#show
* @see Container#remove(Component)
* @see Window#dispose
--- 1268,1279 ----
* A component is made undisplayable either when it is removed from
* a displayable containment hierarchy or when its containment hierarchy
* is made undisplayable. A containment hierarchy is made
* undisplayable when its ancestor window is disposed.
*
! * @return {@code true} if the component is displayable,
! * {@code false} otherwise
* @see Container#add(Component)
* @see Window#pack
* @see Window#show
* @see Container#remove(Component)
* @see Window#dispose
*** 1285,1297 ****
/**
* Determines whether this component should be visible when its
* parent is visible. Components are
* initially visible, with the exception of top level components such
! * as <code>Frame</code> objects.
! * @return <code>true</code> if the component is visible,
! * <code>false</code> otherwise
* @see #setVisible
* @since 1.0
*/
@Transient
public boolean isVisible() {
--- 1285,1297 ----
/**
* Determines whether this component should be visible when its
* parent is visible. Components are
* initially visible, with the exception of top level components such
! * as {@code Frame} objects.
! * @return {@code true} if the component is visible,
! * {@code false} otherwise
* @see #setVisible
* @since 1.0
*/
@Transient
public boolean isVisible() {
*** 1301,1313 ****
return visible;
}
/**
* Determines whether this component will be displayed on the screen.
! * @return <code>true</code> if the component and all of its ancestors
* until a toplevel window or null parent are visible,
! * <code>false</code> otherwise
*/
boolean isRecursivelyVisible() {
return visible && (parent == null || parent.isRecursivelyVisible());
}
--- 1301,1313 ----
return visible;
}
/**
* Determines whether this component will be displayed on the screen.
! * @return {@code true} if the component and all of its ancestors
* until a toplevel window or null parent are visible,
! * {@code false} otherwise
*/
boolean isRecursivelyVisible() {
return visible && (parent == null || parent.isRecursivelyVisible());
}
*** 1368,1401 ****
INCLUDE_DISABLED);
return inTheSameWindow;
}
/**
! * Returns the position of the mouse pointer in this <code>Component</code>'s
! * coordinate space if the <code>Component</code> is directly under the mouse
! * pointer, otherwise returns <code>null</code>.
! * If the <code>Component</code> is not showing on the screen, this method
! * returns <code>null</code> even if the mouse pointer is above the area
! * where the <code>Component</code> would be displayed.
! * If the <code>Component</code> is partially or fully obscured by other
! * <code>Component</code>s or native windows, this method returns a non-null
* value only if the mouse pointer is located above the unobscured part of the
! * <code>Component</code>.
* <p>
! * For <code>Container</code>s it returns a non-null value if the mouse is
! * above the <code>Container</code> itself or above any of its descendants.
* Use {@link Container#getMousePosition(boolean)} if you need to exclude children.
* <p>
* Sometimes the exact mouse coordinates are not important, and the only thing
! * that matters is whether a specific <code>Component</code> is under the mouse
! * pointer. If the return value of this method is <code>null</code>, mouse
! * pointer is not directly above the <code>Component</code>.
*
* @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
* @see #isShowing
* @see Container#getMousePosition
! * @return mouse coordinates relative to this <code>Component</code>, or null
* @since 1.5
*/
public Point getMousePosition() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()) {
throw new HeadlessException();
--- 1368,1401 ----
INCLUDE_DISABLED);
return inTheSameWindow;
}
/**
! * Returns the position of the mouse pointer in this {@code Component}'s
! * coordinate space if the {@code Component} is directly under the mouse
! * pointer, otherwise returns {@code null}.
! * If the {@code Component} is not showing on the screen, this method
! * returns {@code null} even if the mouse pointer is above the area
! * where the {@code Component} would be displayed.
! * If the {@code Component} is partially or fully obscured by other
! * {@code Component}s or native windows, this method returns a non-null
* value only if the mouse pointer is located above the unobscured part of the
! * {@code Component}.
* <p>
! * For {@code Container}s it returns a non-null value if the mouse is
! * above the {@code Container} itself or above any of its descendants.
* Use {@link Container#getMousePosition(boolean)} if you need to exclude children.
* <p>
* Sometimes the exact mouse coordinates are not important, and the only thing
! * that matters is whether a specific {@code Component} is under the mouse
! * pointer. If the return value of this method is {@code null}, mouse
! * pointer is not directly above the {@code Component}.
*
* @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
* @see #isShowing
* @see Container#getMousePosition
! * @return mouse coordinates relative to this {@code Component}, or null
* @since 1.5
*/
public Point getMousePosition() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()) {
throw new HeadlessException();
*** 1436,1447 ****
* <li>the component has been added to a visible {@code ScrollPane} but
* the {@code Component} is not currently in the scroll pane's view port.
* <li>the {@code Component} is obscured by another {@code Component} or
* {@code Container}.
* </ul>
! * @return <code>true</code> if the component is showing,
! * <code>false</code> otherwise
* @see #setVisible
* @since 1.0
*/
public boolean isShowing() {
if (visible && (peer != null)) {
--- 1436,1447 ----
* <li>the component has been added to a visible {@code ScrollPane} but
* the {@code Component} is not currently in the scroll pane's view port.
* <li>the {@code Component} is obscured by another {@code Component} or
* {@code Container}.
* </ul>
! * @return {@code true} if the component is showing,
! * {@code false} otherwise
* @see #setVisible
* @since 1.0
*/
public boolean isShowing() {
if (visible && (peer != null)) {
*** 1453,1465 ****
/**
* Determines whether this component is enabled. An enabled component
* can respond to user input and generate events. Components are
* enabled initially by default. A component may be enabled or disabled by
! * calling its <code>setEnabled</code> method.
! * @return <code>true</code> if the component is enabled,
! * <code>false</code> otherwise
* @see #setEnabled
* @since 1.0
*/
public boolean isEnabled() {
return isEnabledImpl();
--- 1453,1465 ----
/**
* Determines whether this component is enabled. An enabled component
* can respond to user input and generate events. Components are
* enabled initially by default. A component may be enabled or disabled by
! * calling its {@code setEnabled} method.
! * @return {@code true} if the component is enabled,
! * {@code false} otherwise
* @see #setEnabled
* @since 1.0
*/
public boolean isEnabled() {
return isEnabledImpl();
*** 1473,1492 ****
return enabled;
}
/**
* Enables or disables this component, depending on the value of the
! * parameter <code>b</code>. An enabled component can respond to user
* input and generate events. Components are enabled initially by default.
*
* <p>Note: Disabling a lightweight component does not prevent it from
* receiving MouseEvents.
* <p>Note: Disabling a heavyweight container prevents all components
* in this container from receiving any input events. But disabling a
* lightweight container affects only this container.
*
! * @param b If <code>true</code>, this component is
* enabled; otherwise this component is disabled
* @see #isEnabled
* @see #isLightweight
* @since 1.1
*/
--- 1473,1492 ----
return enabled;
}
/**
* Enables or disables this component, depending on the value of the
! * parameter {@code b}. An enabled component can respond to user
* input and generate events. Components are enabled initially by default.
*
* <p>Note: Disabling a lightweight component does not prevent it from
* receiving MouseEvents.
* <p>Note: Disabling a heavyweight container prevents all components
* in this container from receiving any input events. But disabling a
* lightweight container affects only this container.
*
! * @param b If {@code true}, this component is
* enabled; otherwise this component is disabled
* @see #isEnabled
* @see #isLightweight
* @since 1.1
*/
*** 1494,1504 ****
enable(b);
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by <code>setEnabled(boolean)</code>.
*/
@Deprecated
public void enable() {
if (!enabled) {
synchronized (getTreeLock()) {
--- 1494,1504 ----
enable(b);
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by {@code setEnabled(boolean)}.
*/
@Deprecated
public void enable() {
if (!enabled) {
synchronized (getTreeLock()) {
*** 1524,1534 ****
*
* @param b {@code true} to enable this component;
* otherwise {@code false}
*
* @deprecated As of JDK version 1.1,
! * replaced by <code>setEnabled(boolean)</code>.
*/
@Deprecated
public void enable(boolean b) {
if (b) {
enable();
--- 1524,1534 ----
*
* @param b {@code true} to enable this component;
* otherwise {@code false}
*
* @deprecated As of JDK version 1.1,
! * replaced by {@code setEnabled(boolean)}.
*/
@Deprecated
public void enable(boolean b) {
if (b) {
enable();
*** 1537,1547 ****
}
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by <code>setEnabled(boolean)</code>.
*/
@Deprecated
public void disable() {
if (enabled) {
KeyboardFocusManager.clearMostRecentFocusOwner(this);
--- 1537,1547 ----
}
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by {@code setEnabled(boolean)}.
*/
@Deprecated
public void disable() {
if (enabled) {
KeyboardFocusManager.clearMostRecentFocusOwner(this);
*** 1627,1642 ****
}
}
/**
* Shows or hides this component depending on the value of parameter
! * <code>b</code>.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
! * @param b if <code>true</code>, shows this component;
* otherwise, hides this component
* @see #isVisible
* @see #invalidate
* @since 1.1
*/
--- 1627,1642 ----
}
}
/**
* Shows or hides this component depending on the value of parameter
! * {@code b}.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
! * @param b if {@code true}, shows this component;
* otherwise, hides this component
* @see #isVisible
* @see #invalidate
* @since 1.1
*/
*** 1644,1654 ****
show(b);
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by <code>setVisible(boolean)</code>.
*/
@Deprecated
public void show() {
if (!visible) {
synchronized (getTreeLock()) {
--- 1644,1654 ----
show(b);
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by {@code setVisible(boolean)}.
*/
@Deprecated
public void show() {
if (!visible) {
synchronized (getTreeLock()) {
*** 1687,1697 ****
*
* @param b {@code true} to make this component visible;
* otherwise {@code false}
*
* @deprecated As of JDK version 1.1,
! * replaced by <code>setVisible(boolean)</code>.
*/
@Deprecated
public void show(boolean b) {
if (b) {
show();
--- 1687,1697 ----
*
* @param b {@code true} to make this component visible;
* otherwise {@code false}
*
* @deprecated As of JDK version 1.1,
! * replaced by {@code setVisible(boolean)}.
*/
@Deprecated
public void show(boolean b) {
if (b) {
show();
*** 1712,1722 ****
/* do nothing */
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by <code>setVisible(boolean)</code>.
*/
@Deprecated
public void hide() {
isPacked = false;
--- 1712,1722 ----
/* do nothing */
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by {@code setVisible(boolean)}.
*/
@Deprecated
public void hide() {
isPacked = false;
*** 1777,1787 ****
}
/**
* Sets the foreground color of this component.
* @param c the color to become this component's
! * foreground color; if this parameter is <code>null</code>
* then this component will inherit
* the foreground color of its parent
* @see #getForeground
* @since 1.0
*/
--- 1777,1787 ----
}
/**
* Sets the foreground color of this component.
* @param c the color to become this component's
! * foreground color; if this parameter is {@code null}
* then this component will inherit
* the foreground color of its parent
* @see #getForeground
* @since 1.0
*/
*** 1800,1814 ****
firePropertyChange("foreground", oldColor, c);
}
/**
* Returns whether the foreground color has been explicitly set for this
! * Component. If this method returns <code>false</code>, this Component is
* inheriting its foreground color from an ancestor.
*
! * @return <code>true</code> if the foreground color has been explicitly
! * set for this Component; <code>false</code> otherwise.
* @since 1.4
*/
public boolean isForegroundSet() {
return (foreground != null);
}
--- 1800,1814 ----
firePropertyChange("foreground", oldColor, c);
}
/**
* Returns whether the foreground color has been explicitly set for this
! * Component. If this method returns {@code false}, this Component is
* inheriting its foreground color from an ancestor.
*
! * @return {@code true} if the foreground color has been explicitly
! * set for this Component; {@code false} otherwise.
* @since 1.4
*/
public boolean isForegroundSet() {
return (foreground != null);
}
*** 1837,1847 ****
* The background color affects each component differently and the
* parts of the component that are affected by the background color
* may differ between operating systems.
*
* @param c the color to become this component's color;
! * if this parameter is <code>null</code>, then this
* component will inherit the background color of its parent
* @see #getBackground
* @since 1.0
* @beaninfo
* bound: true
--- 1837,1847 ----
* The background color affects each component differently and the
* parts of the component that are affected by the background color
* may differ between operating systems.
*
* @param c the color to become this component's color;
! * if this parameter is {@code null}, then this
* component will inherit the background color of its parent
* @see #getBackground
* @since 1.0
* @beaninfo
* bound: true
*** 1861,1875 ****
firePropertyChange("background", oldColor, c);
}
/**
* Returns whether the background color has been explicitly set for this
! * Component. If this method returns <code>false</code>, this Component is
* inheriting its background color from an ancestor.
*
! * @return <code>true</code> if the background color has been explicitly
! * set for this Component; <code>false</code> otherwise.
* @since 1.4
*/
public boolean isBackgroundSet() {
return (background != null);
}
--- 1861,1875 ----
firePropertyChange("background", oldColor, c);
}
/**
* Returns whether the background color has been explicitly set for this
! * Component. If this method returns {@code false}, this Component is
* inheriting its background color from an ancestor.
*
! * @return {@code true} if the background color has been explicitly
! * set for this Component; {@code false} otherwise.
* @since 1.4
*/
public boolean isBackgroundSet() {
return (background != null);
}
*** 1904,1914 ****
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param f the font to become this component's font;
! * if this parameter is <code>null</code> then this
* component will inherit the font of its parent
* @see #getFont
* @see #invalidate
* @since 1.0
* @beaninfo
--- 1904,1914 ----
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param f the font to become this component's font;
! * if this parameter is {@code null} then this
* component will inherit the font of its parent
* @see #getFont
* @see #invalidate
* @since 1.0
* @beaninfo
*** 1941,1955 ****
}
}
/**
* Returns whether the font has been explicitly set for this Component. If
! * this method returns <code>false</code>, this Component is inheriting its
* font from an ancestor.
*
! * @return <code>true</code> if the font has been explicitly set for this
! * Component; <code>false</code> otherwise.
* @since 1.4
*/
public boolean isFontSet() {
return (font != null);
}
--- 1941,1955 ----
}
}
/**
* Returns whether the font has been explicitly set for this Component. If
! * this method returns {@code false}, this Component is inheriting its
* font from an ancestor.
*
! * @return {@code true} if the font has been explicitly set for this
! * Component; {@code false} otherwise.
* @since 1.4
*/
public boolean isFontSet() {
return (font != null);
}
*** 1957,1967 ****
/**
* Gets the locale of this component.
* @return this component's locale; if this component does not
* have a locale, the locale of its parent is returned
* @see #setLocale
! * @exception IllegalComponentStateException if the <code>Component</code>
* does not have its own locale and has not yet been added to
* a containment hierarchy such that the locale can be determined
* from the containing parent
* @since 1.1
*/
--- 1957,1967 ----
/**
* Gets the locale of this component.
* @return this component's locale; if this component does not
* have a locale, the locale of its parent is returned
* @see #setLocale
! * @exception IllegalComponentStateException if the {@code Component}
* does not have its own locale and has not yet been added to
* a containment hierarchy such that the locale can be determined
* from the containing parent
* @since 1.1
*/
*** 2001,2011 ****
// This could change the preferred size of the Component.
invalidateIfValid();
}
/**
! * Gets the instance of <code>ColorModel</code> used to display
* the component on the output device.
* @return the color model used by this component
* @see java.awt.image.ColorModel
* @see java.awt.peer.ComponentPeer#getColorModel()
* @see Toolkit#getColorModel()
--- 2001,2011 ----
// This could change the preferred size of the Component.
invalidateIfValid();
}
/**
! * Gets the instance of {@code ColorModel} used to display
* the component on the output device.
* @return the color model used by this component
* @see java.awt.image.ColorModel
* @see java.awt.peer.ComponentPeer#getColorModel()
* @see Toolkit#getColorModel()
*** 2026,2042 ****
* point specifying the component's top-left corner.
* The location will be relative to the parent's coordinate space.
* <p>
* Due to the asynchronous nature of native event handling, this
* method can return outdated values (for instance, after several calls
! * of <code>setLocation()</code> in rapid succession). For this
* reason, the recommended method of obtaining a component's position is
! * within <code>java.awt.event.ComponentListener.componentMoved()</code>,
* which is called after the operating system has finished moving the
* component.
* </p>
! * @return an instance of <code>Point</code> representing
* the top-left corner of the component's bounds in
* the coordinate space of the component's parent
* @see #setLocation
* @see #getLocationOnScreen
* @since 1.1
--- 2026,2042 ----
* point specifying the component's top-left corner.
* The location will be relative to the parent's coordinate space.
* <p>
* Due to the asynchronous nature of native event handling, this
* method can return outdated values (for instance, after several calls
! * of {@code setLocation()} in rapid succession). For this
* reason, the recommended method of obtaining a component's position is
! * within {@code java.awt.event.ComponentListener.componentMoved()},
* which is called after the operating system has finished moving the
* component.
* </p>
! * @return an instance of {@code Point} representing
* the top-left corner of the component's bounds in
* the coordinate space of the component's parent
* @see #setLocation
* @see #getLocationOnScreen
* @since 1.1
*** 2047,2057 ****
/**
* Gets the location of this component in the form of a point
* specifying the component's top-left corner in the screen's
* coordinate space.
! * @return an instance of <code>Point</code> representing
* the top-left corner of the component's bounds in the
* coordinate space of the screen
* @throws IllegalComponentStateException if the
* component is not showing on the screen
* @see #setLocation
--- 2047,2057 ----
/**
* Gets the location of this component in the form of a point
* specifying the component's top-left corner in the screen's
* coordinate space.
! * @return an instance of {@code Point} representing
* the top-left corner of the component's bounds in the
* coordinate space of the screen
* @throws IllegalComponentStateException if the
* component is not showing on the screen
* @see #setLocation
*** 2093,2103 ****
/**
* Returns the location of this component's top left corner.
*
* @return the location of this component's top left corner
* @deprecated As of JDK version 1.1,
! * replaced by <code>getLocation()</code>.
*/
@Deprecated
public Point location() {
return location_NoClientCode();
}
--- 2093,2103 ----
/**
* Returns the location of this component's top left corner.
*
* @return the location of this component's top left corner
* @deprecated As of JDK version 1.1,
! * replaced by {@code getLocation()}.
*/
@Deprecated
public Point location() {
return location_NoClientCode();
}
*** 2106,2116 ****
return new Point(x, y);
}
/**
* Moves this component to a new location. The top-left corner of
! * the new location is specified by the <code>x</code> and <code>y</code>
* parameters in the coordinate space of this component's parent.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
--- 2106,2116 ----
return new Point(x, y);
}
/**
* Moves this component to a new location. The top-left corner of
! * the new location is specified by the {@code x} and {@code y}
* parameters in the coordinate space of this component's parent.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
*** 2134,2144 ****
* top-left corner in the parent's coordinate space
* @param y the <i>y</i>-coordinate of the new location's
* top-left corner in the parent's coordinate space
*
* @deprecated As of JDK version 1.1,
! * replaced by <code>setLocation(int, int)</code>.
*/
@Deprecated
public void move(int x, int y) {
synchronized(getTreeLock()) {
setBoundsOp(ComponentPeer.SET_LOCATION);
--- 2134,2144 ----
* top-left corner in the parent's coordinate space
* @param y the <i>y</i>-coordinate of the new location's
* top-left corner in the parent's coordinate space
*
* @deprecated As of JDK version 1.1,
! * replaced by {@code setLocation(int, int)}.
*/
@Deprecated
public void move(int x, int y) {
synchronized(getTreeLock()) {
setBoundsOp(ComponentPeer.SET_LOCATION);
*** 2146,2157 ****
}
}
/**
* Moves this component to a new location. The top-left corner of
! * the new location is specified by point <code>p</code>. Point
! * <code>p</code> is given in the parent's coordinate space.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param p the point defining the top-left corner
--- 2146,2157 ----
}
}
/**
* Moves this component to a new location. The top-left corner of
! * the new location is specified by point {@code p}. Point
! * {@code p} is given in the parent's coordinate space.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param p the point defining the top-left corner
*** 2166,2181 ****
setLocation(p.x, p.y);
}
/**
* Returns the size of this component in the form of a
! * <code>Dimension</code> object. The <code>height</code>
! * field of the <code>Dimension</code> object contains
! * this component's height, and the <code>width</code>
! * field of the <code>Dimension</code> object contains
* this component's width.
! * @return a <code>Dimension</code> object that indicates the
* size of this component
* @see #setSize
* @since 1.1
*/
public Dimension getSize() {
--- 2166,2181 ----
setLocation(p.x, p.y);
}
/**
* Returns the size of this component in the form of a
! * {@code Dimension} object. The {@code height}
! * field of the {@code Dimension} object contains
! * this component's height, and the {@code width}
! * field of the {@code Dimension} object contains
* this component's width.
! * @return a {@code Dimension} object that indicates the
* size of this component
* @see #setSize
* @since 1.1
*/
public Dimension getSize() {
*** 2187,2206 ****
* {@code Dimension} object.
*
* @return the {@code Dimension} object that indicates the
* size of this component
* @deprecated As of JDK version 1.1,
! * replaced by <code>getSize()</code>.
*/
@Deprecated
public Dimension size() {
return new Dimension(width, height);
}
/**
! * Resizes this component so that it has width <code>width</code>
! * and height <code>height</code>.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param width the new width of this component in pixels
--- 2187,2206 ----
* {@code Dimension} object.
*
* @return the {@code Dimension} object that indicates the
* size of this component
* @deprecated As of JDK version 1.1,
! * replaced by {@code getSize()}.
*/
@Deprecated
public Dimension size() {
return new Dimension(width, height);
}
/**
! * Resizes this component so that it has width {@code width}
! * and height {@code height}.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param width the new width of this component in pixels
*** 2218,2240 ****
* Resizes this component.
*
* @param width the new width of the component
* @param height the new height of the component
* @deprecated As of JDK version 1.1,
! * replaced by <code>setSize(int, int)</code>.
*/
@Deprecated
public void resize(int width, int height) {
synchronized(getTreeLock()) {
setBoundsOp(ComponentPeer.SET_SIZE);
setBounds(x, y, width, height);
}
}
/**
! * Resizes this component so that it has width <code>d.width</code>
! * and height <code>d.height</code>.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param d the dimension specifying the new size
--- 2218,2240 ----
* Resizes this component.
*
* @param width the new width of the component
* @param height the new height of the component
* @deprecated As of JDK version 1.1,
! * replaced by {@code setSize(int, int)}.
*/
@Deprecated
public void resize(int width, int height) {
synchronized(getTreeLock()) {
setBoundsOp(ComponentPeer.SET_SIZE);
setBounds(x, y, width, height);
}
}
/**
! * Resizes this component so that it has width {@code d.width}
! * and height {@code d.height}.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param d the dimension specifying the new size
*** 2253,2272 ****
* Resizes this component so that it has width {@code d.width}
* and height {@code d.height}.
*
* @param d the new size of this component
* @deprecated As of JDK version 1.1,
! * replaced by <code>setSize(Dimension)</code>.
*/
@Deprecated
public void resize(Dimension d) {
setSize(d.width, d.height);
}
/**
* Gets the bounds of this component in the form of a
! * <code>Rectangle</code> object. The bounds specify this
* component's width, height, and location relative to
* its parent.
* @return a rectangle indicating this component's bounds
* @see #setBounds
* @see #getLocation
--- 2253,2272 ----
* Resizes this component so that it has width {@code d.width}
* and height {@code d.height}.
*
* @param d the new size of this component
* @deprecated As of JDK version 1.1,
! * replaced by {@code setSize(Dimension)}.
*/
@Deprecated
public void resize(Dimension d) {
setSize(d.width, d.height);
}
/**
* Gets the bounds of this component in the form of a
! * {@code Rectangle} object. The bounds specify this
* component's width, height, and location relative to
* its parent.
* @return a rectangle indicating this component's bounds
* @see #setBounds
* @see #getLocation
*** 2279,2307 ****
/**
* Returns the bounding rectangle of this component.
*
* @return the bounding rectangle for this component
* @deprecated As of JDK version 1.1,
! * replaced by <code>getBounds()</code>.
*/
@Deprecated
public Rectangle bounds() {
return new Rectangle(x, y, width, height);
}
/**
* Moves and resizes this component. The new location of the top-left
! * corner is specified by <code>x</code> and <code>y</code>, and the
! * new size is specified by <code>width</code> and <code>height</code>.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param x the new <i>x</i>-coordinate of this component
* @param y the new <i>y</i>-coordinate of this component
! * @param width the new <code>width</code> of this component
! * @param height the new <code>height</code> of this
* component
* @see #getBounds
* @see #setLocation(int, int)
* @see #setLocation(Point)
* @see #setSize(int, int)
--- 2279,2307 ----
/**
* Returns the bounding rectangle of this component.
*
* @return the bounding rectangle for this component
* @deprecated As of JDK version 1.1,
! * replaced by {@code getBounds()}.
*/
@Deprecated
public Rectangle bounds() {
return new Rectangle(x, y, width, height);
}
/**
* Moves and resizes this component. The new location of the top-left
! * corner is specified by {@code x} and {@code y}, and the
! * new size is specified by {@code width} and {@code height}.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param x the new <i>x</i>-coordinate of this component
* @param y the new <i>y</i>-coordinate of this component
! * @param width the new {@code width} of this component
! * @param height the new {@code height} of this
* component
* @see #getBounds
* @see #setLocation(int, int)
* @see #setLocation(Point)
* @see #setSize(int, int)
*** 2320,2330 ****
* @param y the <i>y</i> coordinate of the upper left corner of the rectangle
* @param width the width of the rectangle
* @param height the height of the rectangle
*
* @deprecated As of JDK version 1.1,
! * replaced by <code>setBounds(int, int, int, int)</code>.
*/
@Deprecated
public void reshape(int x, int y, int width, int height) {
synchronized (getTreeLock()) {
try {
--- 2320,2330 ----
* @param y the <i>y</i> coordinate of the upper left corner of the rectangle
* @param width the width of the rectangle
* @param height the height of the rectangle
*
* @deprecated As of JDK version 1.1,
! * replaced by {@code setBounds(int, int, int, int)}.
*/
@Deprecated
public void reshape(int x, int y, int width, int height) {
synchronized (getTreeLock()) {
try {
*** 2440,2453 ****
}
}
/**
* Moves and resizes this component to conform to the new
! * bounding rectangle <code>r</code>. This component's new
! * position is specified by <code>r.x</code> and <code>r.y</code>,
! * and its new size is specified by <code>r.width</code> and
! * <code>r.height</code>
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param r the new bounding rectangle for this component
--- 2440,2453 ----
}
}
/**
* Moves and resizes this component to conform to the new
! * bounding rectangle {@code r}. This component's new
! * position is specified by {@code r.x} and {@code r.y},
! * and its new size is specified by {@code r.width} and
! * {@code r.height}
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param r the new bounding rectangle for this component
*** 2466,2477 ****
/**
* Returns the current x coordinate of the components origin.
* This method is preferable to writing
! * <code>component.getBounds().x</code>,
! * or <code>component.getLocation().x</code> because it doesn't
* cause any heap allocations.
*
* @return the current x coordinate of the components origin
* @since 1.2
*/
--- 2466,2477 ----
/**
* Returns the current x coordinate of the components origin.
* This method is preferable to writing
! * {@code component.getBounds().x},
! * or {@code component.getLocation().x} because it doesn't
* cause any heap allocations.
*
* @return the current x coordinate of the components origin
* @since 1.2
*/
*** 2481,2492 ****
/**
* Returns the current y coordinate of the components origin.
* This method is preferable to writing
! * <code>component.getBounds().y</code>,
! * or <code>component.getLocation().y</code> because it
* doesn't cause any heap allocations.
*
* @return the current y coordinate of the components origin
* @since 1.2
*/
--- 2481,2492 ----
/**
* Returns the current y coordinate of the components origin.
* This method is preferable to writing
! * {@code component.getBounds().y},
! * or {@code component.getLocation().y} because it
* doesn't cause any heap allocations.
*
* @return the current y coordinate of the components origin
* @since 1.2
*/
*** 2496,2507 ****
/**
* Returns the current width of this component.
* This method is preferable to writing
! * <code>component.getBounds().width</code>,
! * or <code>component.getSize().width</code> because it
* doesn't cause any heap allocations.
*
* @return the current width of this component
* @since 1.2
*/
--- 2496,2507 ----
/**
* Returns the current width of this component.
* This method is preferable to writing
! * {@code component.getBounds().width},
! * or {@code component.getSize().width} because it
* doesn't cause any heap allocations.
*
* @return the current width of this component
* @since 1.2
*/
*** 2511,2522 ****
/**
* Returns the current height of this component.
* This method is preferable to writing
! * <code>component.getBounds().height</code>,
! * or <code>component.getSize().height</code> because it
* doesn't cause any heap allocations.
*
* @return the current height of this component
* @since 1.2
*/
--- 2511,2522 ----
/**
* Returns the current height of this component.
* This method is preferable to writing
! * {@code component.getBounds().height},
! * or {@code component.getSize().height} because it
* doesn't cause any heap allocations.
*
* @return the current height of this component
* @since 1.2
*/
*** 2524,2537 ****
return height;
}
/**
* Stores the bounds of this component into "return value" <b>rv</b> and
! * return <b>rv</b>. If rv is <code>null</code> a new
! * <code>Rectangle</code> is allocated.
! * This version of <code>getBounds</code> is useful if the caller
! * wants to avoid allocating a new <code>Rectangle</code> object
* on the heap.
*
* @param rv the return value, modified to the components bounds
* @return rv
*/
--- 2524,2537 ----
return height;
}
/**
* Stores the bounds of this component into "return value" <b>rv</b> and
! * return <b>rv</b>. If rv is {@code null} a new
! * {@code Rectangle} is allocated.
! * This version of {@code getBounds} is useful if the caller
! * wants to avoid allocating a new {@code Rectangle} object
* on the heap.
*
* @param rv the return value, modified to the components bounds
* @return rv
*/
*** 2545,2558 ****
}
}
/**
* Stores the width/height of this component into "return value" <b>rv</b>
! * and return <b>rv</b>. If rv is <code>null</code> a new
! * <code>Dimension</code> object is allocated. This version of
! * <code>getSize</code> is useful if the caller wants to avoid
! * allocating a new <code>Dimension</code> object on the heap.
*
* @param rv the return value, modified to the components size
* @return rv
*/
public Dimension getSize(Dimension rv) {
--- 2545,2558 ----
}
}
/**
* Stores the width/height of this component into "return value" <b>rv</b>
! * and return <b>rv</b>. If rv is {@code null} a new
! * {@code Dimension} object is allocated. This version of
! * {@code getSize} is useful if the caller wants to avoid
! * allocating a new {@code Dimension} object on the heap.
*
* @param rv the return value, modified to the components size
* @return rv
*/
public Dimension getSize(Dimension rv) {
*** 2565,2578 ****
}
}
/**
* Stores the x,y origin of this component into "return value" <b>rv</b>
! * and return <b>rv</b>. If rv is <code>null</code> a new
! * <code>Point</code> is allocated.
! * This version of <code>getLocation</code> is useful if the
! * caller wants to avoid allocating a new <code>Point</code>
* object on the heap.
*
* @param rv the return value, modified to the components location
* @return rv
*/
--- 2565,2578 ----
}
}
/**
* Stores the x,y origin of this component into "return value" <b>rv</b>
! * and return <b>rv</b>. If rv is {@code null} a new
! * {@code Point} is allocated.
! * This version of {@code getLocation} is useful if the
! * caller wants to avoid allocating a new {@code Point}
* object on the heap.
*
* @param rv the return value, modified to the components location
* @return rv
*/
*** 2613,2628 ****
}
/**
* A lightweight component doesn't have a native toolkit peer.
! * Subclasses of <code>Component</code> and <code>Container</code>,
! * other than the ones defined in this package like <code>Button</code>
! * or <code>Scrollbar</code>, are lightweight.
* All of the Swing components are lightweights.
* <p>
! * This method will always return <code>false</code> if this component
* is not displayable because it is impossible to determine the
* weight of an undisplayable component.
*
* @return true if this component has a lightweight peer; false if
* it has a native peer or no peer
--- 2613,2628 ----
}
/**
* A lightweight component doesn't have a native toolkit peer.
! * Subclasses of {@code Component} and {@code Container},
! * other than the ones defined in this package like {@code Button}
! * or {@code Scrollbar}, are lightweight.
* All of the Swing components are lightweights.
* <p>
! * This method will always return {@code false} if this component
* is not displayable because it is impossible to determine the
* weight of an undisplayable component.
*
* @return true if this component has a lightweight peer; false if
* it has a native peer or no peer
*** 2634,2645 ****
}
/**
* Sets the preferred size of this component to a constant
! * value. Subsequent calls to <code>getPreferredSize</code> will always
! * return this value. Setting the preferred size to <code>null</code>
* restores the default behavior.
*
* @param preferredSize The new preferred size, or null
* @see #getPreferredSize
* @see #isPreferredSizeSet
--- 2634,2645 ----
}
/**
* Sets the preferred size of this component to a constant
! * value. Subsequent calls to {@code getPreferredSize} will always
! * return this value. Setting the preferred size to {@code null}
* restores the default behavior.
*
* @param preferredSize The new preferred size, or null
* @see #getPreferredSize
* @see #isPreferredSizeSet
*** 2662,2674 ****
}
/**
* Returns true if the preferred size has been set to a
! * non-<code>null</code> value otherwise returns false.
*
! * @return true if <code>setPreferredSize</code> has been invoked
* with a non-null value.
* @since 1.5
*/
public boolean isPreferredSizeSet() {
return prefSizeSet;
--- 2662,2674 ----
}
/**
* Returns true if the preferred size has been set to a
! * non-{@code null} value otherwise returns false.
*
! * @return true if {@code setPreferredSize} has been invoked
* with a non-null value.
* @since 1.5
*/
public boolean isPreferredSizeSet() {
return prefSizeSet;
*** 2689,2699 ****
/**
* Returns the component's preferred size.
*
* @return the component's preferred size
* @deprecated As of JDK version 1.1,
! * replaced by <code>getPreferredSize()</code>.
*/
@Deprecated
public Dimension preferredSize() {
/* Avoid grabbing the lock if a reasonable cached size value
* is available.
--- 2689,2699 ----
/**
* Returns the component's preferred size.
*
* @return the component's preferred size
* @deprecated As of JDK version 1.1,
! * replaced by {@code getPreferredSize()}.
*/
@Deprecated
public Dimension preferredSize() {
/* Avoid grabbing the lock if a reasonable cached size value
* is available.
*** 2710,2721 ****
return new Dimension(dim);
}
/**
* Sets the minimum size of this component to a constant
! * value. Subsequent calls to <code>getMinimumSize</code> will always
! * return this value. Setting the minimum size to <code>null</code>
* restores the default behavior.
*
* @param minimumSize the new minimum size of this component
* @see #getMinimumSize
* @see #isMinimumSizeSet
--- 2710,2721 ----
return new Dimension(dim);
}
/**
* Sets the minimum size of this component to a constant
! * value. Subsequent calls to {@code getMinimumSize} will always
! * return this value. Setting the minimum size to {@code null}
* restores the default behavior.
*
* @param minimumSize the new minimum size of this component
* @see #getMinimumSize
* @see #isMinimumSizeSet
*** 2736,2749 ****
minSizeSet = (minimumSize != null);
firePropertyChange("minimumSize", old, minimumSize);
}
/**
! * Returns whether or not <code>setMinimumSize</code> has been
* invoked with a non-null value.
*
! * @return true if <code>setMinimumSize</code> has been invoked with a
* non-null value.
* @since 1.5
*/
public boolean isMinimumSizeSet() {
return minSizeSet;
--- 2736,2749 ----
minSizeSet = (minimumSize != null);
firePropertyChange("minimumSize", old, minimumSize);
}
/**
! * Returns whether or not {@code setMinimumSize} has been
* invoked with a non-null value.
*
! * @return true if {@code setMinimumSize} has been invoked with a
* non-null value.
* @since 1.5
*/
public boolean isMinimumSizeSet() {
return minSizeSet;
*** 2762,2772 ****
/**
* Returns the minimum size of this component.
*
* @return the minimum size of this component
* @deprecated As of JDK version 1.1,
! * replaced by <code>getMinimumSize()</code>.
*/
@Deprecated
public Dimension minimumSize() {
/* Avoid grabbing the lock if a reasonable cached size value
* is available.
--- 2762,2772 ----
/**
* Returns the minimum size of this component.
*
* @return the minimum size of this component
* @deprecated As of JDK version 1.1,
! * replaced by {@code getMinimumSize()}.
*/
@Deprecated
public Dimension minimumSize() {
/* Avoid grabbing the lock if a reasonable cached size value
* is available.
*** 2783,2797 ****
return new Dimension(dim);
}
/**
* Sets the maximum size of this component to a constant
! * value. Subsequent calls to <code>getMaximumSize</code> will always
! * return this value. Setting the maximum size to <code>null</code>
* restores the default behavior.
*
! * @param maximumSize a <code>Dimension</code> containing the
* desired maximum allowable size
* @see #getMaximumSize
* @see #isMaximumSizeSet
* @since 1.5
*/
--- 2783,2797 ----
return new Dimension(dim);
}
/**
* Sets the maximum size of this component to a constant
! * value. Subsequent calls to {@code getMaximumSize} will always
! * return this value. Setting the maximum size to {@code null}
* restores the default behavior.
*
! * @param maximumSize a {@code Dimension} containing the
* desired maximum allowable size
* @see #getMaximumSize
* @see #isMaximumSizeSet
* @since 1.5
*/
*** 2810,2823 ****
maxSizeSet = (maximumSize != null);
firePropertyChange("maximumSize", old, maximumSize);
}
/**
! * Returns true if the maximum size has been set to a non-<code>null</code>
* value otherwise returns false.
*
! * @return true if <code>maximumSize</code> is non-<code>null</code>,
* false otherwise
* @since 1.5
*/
public boolean isMaximumSizeSet() {
return maxSizeSet;
--- 2810,2823 ----
maxSizeSet = (maximumSize != null);
firePropertyChange("maximumSize", old, maximumSize);
}
/**
! * Returns true if the maximum size has been set to a non-{@code null}
* value otherwise returns false.
*
! * @return true if {@code maximumSize} is non-{@code null},
* false otherwise
* @since 1.5
*/
public boolean isMaximumSizeSet() {
return maxSizeSet;
*** 2864,2883 ****
}
/**
* Returns the baseline. The baseline is measured from the top of
* the component. This method is primarily meant for
! * <code>LayoutManager</code>s to align components along their
* baseline. A return value less than 0 indicates this component
* does not have a reasonable baseline and that
! * <code>LayoutManager</code>s should not align this component on
* its baseline.
* <p>
* The default implementation returns -1. Subclasses that support
* baseline should override appropriately. If a value >= 0 is
* returned, then the component has a valid baseline for any
! * size >= the minimum size and <code>getBaselineResizeBehavior</code>
* can be used to determine how the baseline changes with size.
*
* @param width the width to get the baseline for
* @param height the height to get the baseline for
* @return the baseline or < 0 indicating there is no reasonable
--- 2864,2883 ----
}
/**
* Returns the baseline. The baseline is measured from the top of
* the component. This method is primarily meant for
! * {@code LayoutManager}s to align components along their
* baseline. A return value less than 0 indicates this component
* does not have a reasonable baseline and that
! * {@code LayoutManager}s should not align this component on
* its baseline.
* <p>
* The default implementation returns -1. Subclasses that support
* baseline should override appropriately. If a value >= 0 is
* returned, then the component has a valid baseline for any
! * size >= the minimum size and {@code getBaselineResizeBehavior}
* can be used to determine how the baseline changes with size.
*
* @param width the width to get the baseline for
* @param height the height to get the baseline for
* @return the baseline or < 0 indicating there is no reasonable
*** 2899,2917 ****
* Returns an enum indicating how the baseline of the component
* changes as the size changes. This method is primarily meant for
* layout managers and GUI builders.
* <p>
* The default implementation returns
! * <code>BaselineResizeBehavior.OTHER</code>. Subclasses that have a
* baseline should override appropriately. Subclasses should
! * never return <code>null</code>; if the baseline can not be
! * calculated return <code>BaselineResizeBehavior.OTHER</code>. Callers
* should first ask for the baseline using
! * <code>getBaseline</code> and if a value >= 0 is returned use
* this method. It is acceptable for this method to return a
! * value other than <code>BaselineResizeBehavior.OTHER</code> even if
! * <code>getBaseline</code> returns a value less than 0.
*
* @return an enum indicating how the baseline changes as the component
* size changes
* @see #getBaseline(int, int)
* @since 1.6
--- 2899,2917 ----
* Returns an enum indicating how the baseline of the component
* changes as the size changes. This method is primarily meant for
* layout managers and GUI builders.
* <p>
* The default implementation returns
! * {@code BaselineResizeBehavior.OTHER}. Subclasses that have a
* baseline should override appropriately. Subclasses should
! * never return {@code null}; if the baseline can not be
! * calculated return {@code BaselineResizeBehavior.OTHER}. Callers
* should first ask for the baseline using
! * {@code getBaseline} and if a value >= 0 is returned use
* this method. It is acceptable for this method to return a
! * value other than {@code BaselineResizeBehavior.OTHER} even if
! * {@code getBaseline} returns a value less than 0.
*
* @return an enum indicating how the baseline changes as the component
* size changes
* @see #getBaseline(int, int)
* @since 1.6
*** 2931,2941 ****
layout();
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by <code>doLayout()</code>.
*/
@Deprecated
public void layout() {
}
--- 2931,2941 ----
layout();
}
/**
* @deprecated As of JDK version 1.1,
! * replaced by {@code doLayout()}.
*/
@Deprecated
public void layout() {
}
*** 3080,3092 ****
}
}
/**
* Creates a graphics context for this component. This method will
! * return <code>null</code> if this component is currently not
* displayable.
! * @return a graphics context for this component, or <code>null</code>
* if it has none
* @see #paint
* @since 1.0
*/
public Graphics getGraphics() {
--- 3080,3092 ----
}
}
/**
* Creates a graphics context for this component. This method will
! * return {@code null} if this component is currently not
* displayable.
! * @return a graphics context for this component, or {@code null}
* if it has none
* @see #paint
* @since 1.0
*/
public Graphics getGraphics() {
*** 3144,3154 ****
* used. Instead metrics can be obtained at rendering time by calling
* {@link Graphics#getFontMetrics()} or text measurement APIs on the
* {@link Font Font} class.
* @param font the font for which font metrics is to be
* obtained
! * @return the font metrics for <code>font</code>
* @see #getFont
* @see java.awt.peer.ComponentPeer#getFontMetrics(Font)
* @see Toolkit#getFontMetrics(Font)
* @since 1.0
*/
--- 3144,3154 ----
* used. Instead metrics can be obtained at rendering time by calling
* {@link Graphics#getFontMetrics()} or text measurement APIs on the
* {@link Font Font} class.
* @param font the font for which font metrics is to be
* obtained
! * @return the font metrics for {@code font}
* @see #getFont
* @see java.awt.peer.ComponentPeer#getFontMetrics(Font)
* @see Toolkit#getFontMetrics(Font)
* @since 1.0
*/
*** 3167,3189 ****
return sun.font.FontDesignMetrics.getMetrics(font);
}
/**
* Sets the cursor image to the specified cursor. This cursor
! * image is displayed when the <code>contains</code> method for
* this component returns true for the current cursor location, and
* this Component is visible, displayable, and enabled. Setting the
! * cursor of a <code>Container</code> causes that cursor to be displayed
* within all of the container's subcomponents, except for those
! * that have a non-<code>null</code> cursor.
* <p>
* The method may have no visual effect if the Java platform
* implementation and/or the native system do not support
* changing the mouse cursor shape.
* @param cursor One of the constants defined
! * by the <code>Cursor</code> class;
! * if this parameter is <code>null</code>
* then this component will inherit
* the cursor of its parent
* @see #isEnabled
* @see #isShowing
* @see #getCursor
--- 3167,3189 ----
return sun.font.FontDesignMetrics.getMetrics(font);
}
/**
* Sets the cursor image to the specified cursor. This cursor
! * image is displayed when the {@code contains} method for
* this component returns true for the current cursor location, and
* this Component is visible, displayable, and enabled. Setting the
! * cursor of a {@code Container} causes that cursor to be displayed
* within all of the container's subcomponents, except for those
! * that have a non-{@code null} cursor.
* <p>
* The method may have no visual effect if the Java platform
* implementation and/or the native system do not support
* changing the mouse cursor shape.
* @param cursor One of the constants defined
! * by the {@code Cursor} class;
! * if this parameter is {@code null}
* then this component will inherit
* the cursor of its parent
* @see #isEnabled
* @see #isShowing
* @see #getCursor
*** 3219,3229 ****
/**
* Gets the cursor set in the component. If the component does
* not have a cursor set, the cursor of its parent is returned.
* If no cursor is set in the entire hierarchy,
! * <code>Cursor.DEFAULT_CURSOR</code> is returned.
*
* @return the cursor for this component
* @see #setCursor
* @since 1.1
*/
--- 3219,3229 ----
/**
* Gets the cursor set in the component. If the component does
* not have a cursor set, the cursor of its parent is returned.
* If no cursor is set in the entire hierarchy,
! * {@code Cursor.DEFAULT_CURSOR} is returned.
*
* @return the cursor for this component
* @see #setCursor
* @since 1.1
*/
*** 3244,3258 ****
}
}
/**
* Returns whether the cursor has been explicitly set for this Component.
! * If this method returns <code>false</code>, this Component is inheriting
* its cursor from an ancestor.
*
! * @return <code>true</code> if the cursor has been explicitly set for this
! * Component; <code>false</code> otherwise.
* @since 1.4
*/
public boolean isCursorSet() {
return (cursor != null);
}
--- 3244,3258 ----
}
}
/**
* Returns whether the cursor has been explicitly set for this Component.
! * If this method returns {@code false}, this Component is inheriting
* its cursor from an ancestor.
*
! * @return {@code true} if the cursor has been explicitly set for this
! * Component; {@code false} otherwise.
* @since 1.4
*/
public boolean isCursorSet() {
return (cursor != null);
}
*** 3261,3276 ****
* Paints this component.
* <p>
* This method is called when the contents of the component should
* be painted; such as when the component is first being shown or
* is damaged and in need of repair. The clip rectangle in the
! * <code>Graphics</code> parameter is set to the area
* which needs to be painted.
! * Subclasses of <code>Component</code> that override this
! * method need not call <code>super.paint(g)</code>.
* <p>
! * For performance reasons, <code>Component</code>s with zero width
* or height aren't considered to need painting when they are first shown,
* and also aren't considered to need repair.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
--- 3261,3276 ----
* Paints this component.
* <p>
* This method is called when the contents of the component should
* be painted; such as when the component is first being shown or
* is damaged and in need of repair. The clip rectangle in the
! * {@code Graphics} parameter is set to the area
* which needs to be painted.
! * Subclasses of {@code Component} that override this
! * method need not call {@code super.paint(g)}.
* <p>
! * For performance reasons, {@code Component}s with zero width
* or height aren't considered to need painting when they are first shown,
* and also aren't considered to need repair.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
*** 3286,3310 ****
/**
* Updates this component.
* <p>
* If this component is not a lightweight component, the
! * AWT calls the <code>update</code> method in response to
! * a call to <code>repaint</code>. You can assume that
* the background is not cleared.
* <p>
! * The <code>update</code> method of <code>Component</code>
! * calls this component's <code>paint</code> method to redraw
* this component. This method is commonly overridden by subclasses
* which need to do additional work in response to a call to
! * <code>repaint</code>.
* Subclasses of Component that override this method should either
! * call <code>super.update(g)</code>, or call <code>paint(g)</code>
! * directly from their <code>update</code> method.
* <p>
* The origin of the graphics context, its
! * (<code>0</code>, <code>0</code>) coordinate point, is the
* top-left corner of this component. The clipping region of the
* graphics context is the bounding rectangle of this component.
*
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
--- 3286,3310 ----
/**
* Updates this component.
* <p>
* If this component is not a lightweight component, the
! * AWT calls the {@code update} method in response to
! * a call to {@code repaint}. You can assume that
* the background is not cleared.
* <p>
! * The {@code update} method of {@code Component}
! * calls this component's {@code paint} method to redraw
* this component. This method is commonly overridden by subclasses
* which need to do additional work in response to a call to
! * {@code repaint}.
* Subclasses of Component that override this method should either
! * call {@code super.update(g)}, or call {@code paint(g)}
! * directly from their {@code update} method.
* <p>
* The origin of the graphics context, its
! * ({@code 0}, {@code 0}) coordinate point, is the
* top-left corner of this component. The clipping region of the
* graphics context is the bounding rectangle of this component.
*
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
*** 3323,3333 ****
/**
* Paints this component and all of its subcomponents.
* <p>
* The origin of the graphics context, its
! * (<code>0</code>, <code>0</code>) coordinate point, is the
* top-left corner of this component. The clipping region of the
* graphics context is the bounding rectangle of this component.
*
* @param g the graphics context to use for painting
* @see #paint
--- 3323,3333 ----
/**
* Paints this component and all of its subcomponents.
* <p>
* The origin of the graphics context, its
! * ({@code 0}, {@code 0}) coordinate point, is the
* top-left corner of this component. The clipping region of the
* graphics context is the bounding rectangle of this component.
*
* @param g the graphics context to use for painting
* @see #paint
*** 3361,3373 ****
/**
* Repaints this component.
* <p>
* If this component is a lightweight component, this method
! * causes a call to this component's <code>paint</code>
* method as soon as possible. Otherwise, this method causes
! * a call to this component's <code>update</code> method as soon
* as possible.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
--- 3361,3373 ----
/**
* Repaints this component.
* <p>
* If this component is a lightweight component, this method
! * causes a call to this component's {@code paint}
* method as soon as possible. Otherwise, this method causes
! * a call to this component's {@code update} method as soon
* as possible.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
*** 3381,3392 ****
repaint(0, 0, 0, width, height);
}
/**
* Repaints the component. If this component is a lightweight
! * component, this results in a call to <code>paint</code>
! * within <code>tm</code> milliseconds.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
--- 3381,3392 ----
repaint(0, 0, 0, width, height);
}
/**
* Repaints the component. If this component is a lightweight
! * component, this results in a call to {@code paint}
! * within {@code tm} milliseconds.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*** 3402,3414 ****
/**
* Repaints the specified rectangle of this component.
* <p>
* If this component is a lightweight component, this method
! * causes a call to this component's <code>paint</code> method
* as soon as possible. Otherwise, this method causes a call to
! * this component's <code>update</code> method as soon as possible.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
--- 3402,3414 ----
/**
* Repaints the specified rectangle of this component.
* <p>
* If this component is a lightweight component, this method
! * causes a call to this component's {@code paint} method
* as soon as possible. Otherwise, this method causes a call to
! * this component's {@code update} method as soon as possible.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*** 3424,3439 ****
repaint(0, x, y, width, height);
}
/**
* Repaints the specified rectangle of this component within
! * <code>tm</code> milliseconds.
* <p>
* If this component is a lightweight component, this method causes
! * a call to this component's <code>paint</code> method.
* Otherwise, this method causes a call to this component's
! * <code>update</code> method.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
--- 3424,3439 ----
repaint(0, x, y, width, height);
}
/**
* Repaints the specified rectangle of this component within
! * {@code tm} milliseconds.
* <p>
* If this component is a lightweight component, this method causes
! * a call to this component's {@code paint} method.
* Otherwise, this method causes a call to this component's
! * {@code update} method.
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
*** 3487,3500 ****
* Prints this component. Applications should override this method
* for components that must do special processing before being
* printed or should be printed differently than they are painted.
* <p>
* The default implementation of this method calls the
! * <code>paint</code> method.
* <p>
* The origin of the graphics context, its
! * (<code>0</code>, <code>0</code>) coordinate point, is the
* top-left corner of this component. The clipping region of the
* graphics context is the bounding rectangle of this component.
* @param g the graphics context to use for printing
* @see #paint(Graphics)
* @since 1.0
--- 3487,3500 ----
* Prints this component. Applications should override this method
* for components that must do special processing before being
* printed or should be printed differently than they are painted.
* <p>
* The default implementation of this method calls the
! * {@code paint} method.
* <p>
* The origin of the graphics context, its
! * ({@code 0}, {@code 0}) coordinate point, is the
* top-left corner of this component. The clipping region of the
* graphics context is the bounding rectangle of this component.
* @param g the graphics context to use for printing
* @see #paint(Graphics)
* @since 1.0
*** 3505,3515 ****
/**
* Prints this component and all of its subcomponents.
* <p>
* The origin of the graphics context, its
! * (<code>0</code>, <code>0</code>) coordinate point, is the
* top-left corner of this component. The clipping region of the
* graphics context is the bounding rectangle of this component.
* @param g the graphics context to use for printing
* @see #print(Graphics)
* @since 1.0
--- 3505,3515 ----
/**
* Prints this component and all of its subcomponents.
* <p>
* The origin of the graphics context, its
! * ({@code 0}, {@code 0}) coordinate point, is the
* top-left corner of this component. The clipping region of the
* graphics context is the bounding rectangle of this component.
* @param g the graphics context to use for printing
* @see #print(Graphics)
* @since 1.0
*** 3548,3592 ****
return new Insets(0, 0, 0, 0);
}
/**
* Repaints the component when the image has changed.
! * This <code>imageUpdate</code> method of an <code>ImageObserver</code>
* is called when more information about an
* image which had been previously requested using an asynchronous
! * routine such as the <code>drawImage</code> method of
! * <code>Graphics</code> becomes available.
! * See the definition of <code>imageUpdate</code> for
* more information on this method and its arguments.
* <p>
! * The <code>imageUpdate</code> method of <code>Component</code>
* incrementally draws an image on the component as more of the bits
* of the image are available.
* <p>
! * If the system property <code>awt.image.incrementaldraw</code>
! * is missing or has the value <code>true</code>, the image is
* incrementally drawn. If the system property has any other value,
* then the image is not drawn until it has been completely loaded.
* <p>
* Also, if incremental drawing is in effect, the value of the
! * system property <code>awt.image.redrawrate</code> is interpreted
* as an integer to give the maximum redraw rate, in milliseconds. If
* the system property is missing or cannot be interpreted as an
* integer, the redraw rate is once every 100ms.
* <p>
! * The interpretation of the <code>x</code>, <code>y</code>,
! * <code>width</code>, and <code>height</code> arguments depends on
! * the value of the <code>infoflags</code> argument.
*
* @param img the image being observed
! * @param infoflags see <code>imageUpdate</code> for more information
* @param x the <i>x</i> coordinate
* @param y the <i>y</i> coordinate
* @param w the width
* @param h the height
! * @return <code>false</code> if the infoflags indicate that the
! * image is completely loaded; <code>true</code> otherwise.
*
* @see java.awt.image.ImageObserver
* @see Graphics#drawImage(Image, int, int, Color, java.awt.image.ImageObserver)
* @see Graphics#drawImage(Image, int, int, java.awt.image.ImageObserver)
* @see Graphics#drawImage(Image, int, int, int, int, Color, java.awt.image.ImageObserver)
--- 3548,3592 ----
return new Insets(0, 0, 0, 0);
}
/**
* Repaints the component when the image has changed.
! * This {@code imageUpdate} method of an {@code ImageObserver}
* is called when more information about an
* image which had been previously requested using an asynchronous
! * routine such as the {@code drawImage} method of
! * {@code Graphics} becomes available.
! * See the definition of {@code imageUpdate} for
* more information on this method and its arguments.
* <p>
! * The {@code imageUpdate} method of {@code Component}
* incrementally draws an image on the component as more of the bits
* of the image are available.
* <p>
! * If the system property {@code awt.image.incrementaldraw}
! * is missing or has the value {@code true}, the image is
* incrementally drawn. If the system property has any other value,
* then the image is not drawn until it has been completely loaded.
* <p>
* Also, if incremental drawing is in effect, the value of the
! * system property {@code awt.image.redrawrate} is interpreted
* as an integer to give the maximum redraw rate, in milliseconds. If
* the system property is missing or cannot be interpreted as an
* integer, the redraw rate is once every 100ms.
* <p>
! * The interpretation of the {@code x}, {@code y},
! * {@code width}, and {@code height} arguments depends on
! * the value of the {@code infoflags} argument.
*
* @param img the image being observed
! * @param infoflags see {@code imageUpdate} for more information
* @param x the <i>x</i> coordinate
* @param y the <i>y</i> coordinate
* @param w the width
* @param h the height
! * @return {@code false} if the infoflags indicate that the
! * image is completely loaded; {@code true} otherwise.
*
* @see java.awt.image.ImageObserver
* @see Graphics#drawImage(Image, int, int, Color, java.awt.image.ImageObserver)
* @see Graphics#drawImage(Image, int, int, java.awt.image.ImageObserver)
* @see Graphics#drawImage(Image, int, int, int, int, Color, java.awt.image.ImageObserver)
*** 3631,3644 ****
* Creates an off-screen drawable image
* to be used for double buffering.
* @param width the specified width
* @param height the specified height
* @return an off-screen drawable image, which can be used for double
! * buffering. The return value may be <code>null</code> if the
* component is not displayable. This will always happen if
! * <code>GraphicsEnvironment.isHeadless()</code> returns
! * <code>true</code>.
* @see #isDisplayable
* @see GraphicsEnvironment#isHeadless
* @since 1.0
*/
public Image createImage(int width, int height) {
--- 3631,3644 ----
* Creates an off-screen drawable image
* to be used for double buffering.
* @param width the specified width
* @param height the specified height
* @return an off-screen drawable image, which can be used for double
! * buffering. The return value may be {@code null} if the
* component is not displayable. This will always happen if
! * {@code GraphicsEnvironment.isHeadless()} returns
! * {@code true}.
* @see #isDisplayable
* @see GraphicsEnvironment#isHeadless
* @since 1.0
*/
public Image createImage(int width, int height) {
*** 3655,3668 ****
* Creates a volatile off-screen drawable image
* to be used for double buffering.
* @param width the specified width.
* @param height the specified height.
* @return an off-screen drawable image, which can be used for double
! * buffering. The return value may be <code>null</code> if the
* component is not displayable. This will always happen if
! * <code>GraphicsEnvironment.isHeadless()</code> returns
! * <code>true</code>.
* @see java.awt.image.VolatileImage
* @see #isDisplayable
* @see GraphicsEnvironment#isHeadless
* @since 1.4
*/
--- 3655,3668 ----
* Creates a volatile off-screen drawable image
* to be used for double buffering.
* @param width the specified width.
* @param height the specified height.
* @return an off-screen drawable image, which can be used for double
! * buffering. The return value may be {@code null} if the
* component is not displayable. This will always happen if
! * {@code GraphicsEnvironment.isHeadless()} returns
! * {@code true}.
* @see java.awt.image.VolatileImage
* @see #isDisplayable
* @see GraphicsEnvironment#isHeadless
* @since 1.4
*/
*** 3681,3691 ****
/**
* Creates a volatile off-screen drawable image, with the given capabilities.
* The contents of this image may be lost at any time due
* to operating system issues, so the image must be managed
! * via the <code>VolatileImage</code> interface.
* @param width the specified width.
* @param height the specified height.
* @param caps the image capabilities
* @exception AWTException if an image with the specified capabilities cannot
* be created
--- 3681,3691 ----
/**
* Creates a volatile off-screen drawable image, with the given capabilities.
* The contents of this image may be lost at any time due
* to operating system issues, so the image must be managed
! * via the {@code VolatileImage} interface.
* @param width the specified width.
* @param height the specified height.
* @param caps the image capabilities
* @exception AWTException if an image with the specified capabilities cannot
* be created
*** 3702,3717 ****
/**
* Prepares an image for rendering on this component. The image
* data is downloaded asynchronously in another thread and the
* appropriate screen representation of the image is generated.
! * @param image the <code>Image</code> for which to
* prepare a screen representation
! * @param observer the <code>ImageObserver</code> object
* to be notified as the image is being prepared
! * @return <code>true</code> if the image has already been fully
! * prepared; <code>false</code> otherwise
* @since 1.0
*/
public boolean prepareImage(Image image, ImageObserver observer) {
return prepareImage(image, -1, -1, observer);
}
--- 3702,3717 ----
/**
* Prepares an image for rendering on this component. The image
* data is downloaded asynchronously in another thread and the
* appropriate screen representation of the image is generated.
! * @param image the {@code Image} for which to
* prepare a screen representation
! * @param observer the {@code ImageObserver} object
* to be notified as the image is being prepared
! * @return {@code true} if the image has already been fully
! * prepared; {@code false} otherwise
* @since 1.0
*/
public boolean prepareImage(Image image, ImageObserver observer) {
return prepareImage(image, -1, -1, observer);
}
*** 3721,3738 ****
* specified width and height.
* <p>
* The image data is downloaded asynchronously in another thread,
* and an appropriately scaled screen representation of the image is
* generated.
! * @param image the instance of <code>Image</code>
* for which to prepare a screen representation
* @param width the width of the desired screen representation
* @param height the height of the desired screen representation
! * @param observer the <code>ImageObserver</code> object
* to be notified as the image is being prepared
! * @return <code>true</code> if the image has already been fully
! * prepared; <code>false</code> otherwise
* @see java.awt.image.ImageObserver
* @since 1.0
*/
public boolean prepareImage(Image image, int width, int height,
ImageObserver observer) {
--- 3721,3738 ----
* specified width and height.
* <p>
* The image data is downloaded asynchronously in another thread,
* and an appropriately scaled screen representation of the image is
* generated.
! * @param image the instance of {@code Image}
* for which to prepare a screen representation
* @param width the width of the desired screen representation
* @param height the height of the desired screen representation
! * @param observer the {@code ImageObserver} object
* to be notified as the image is being prepared
! * @return {@code true} if the image has already been fully
! * prepared; {@code false} otherwise
* @see java.awt.image.ImageObserver
* @since 1.0
*/
public boolean prepareImage(Image image, int width, int height,
ImageObserver observer) {
*** 3751,3771 ****
/**
* Returns the status of the construction of a screen representation
* of the specified image.
* <p>
* This method does not cause the image to begin loading. An
! * application must use the <code>prepareImage</code> method
* to force the loading of an image.
* <p>
* Information on the flags returned by this method can be found
! * with the discussion of the <code>ImageObserver</code> interface.
! * @param image the <code>Image</code> object whose status
* is being checked
! * @param observer the <code>ImageObserver</code>
* object to be notified as the image is being prepared
* @return the bitwise inclusive <b>OR</b> of
! * <code>ImageObserver</code> flags indicating what
* information about the image is currently available
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
* @see java.awt.image.ImageObserver
* @since 1.0
--- 3751,3771 ----
/**
* Returns the status of the construction of a screen representation
* of the specified image.
* <p>
* This method does not cause the image to begin loading. An
! * application must use the {@code prepareImage} method
* to force the loading of an image.
* <p>
* Information on the flags returned by this method can be found
! * with the discussion of the {@code ImageObserver} interface.
! * @param image the {@code Image} object whose status
* is being checked
! * @param observer the {@code ImageObserver}
* object to be notified as the image is being prepared
* @return the bitwise inclusive <b>OR</b> of
! * {@code ImageObserver} flags indicating what
* information about the image is currently available
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
* @see java.awt.image.ImageObserver
* @since 1.0
*** 3777,3807 ****
/**
* Returns the status of the construction of a screen representation
* of the specified image.
* <p>
* This method does not cause the image to begin loading. An
! * application must use the <code>prepareImage</code> method
* to force the loading of an image.
* <p>
! * The <code>checkImage</code> method of <code>Component</code>
! * calls its peer's <code>checkImage</code> method to calculate
* the flags. If this component does not yet have a peer, the
! * component's toolkit's <code>checkImage</code> method is called
* instead.
* <p>
* Information on the flags returned by this method can be found
! * with the discussion of the <code>ImageObserver</code> interface.
! * @param image the <code>Image</code> object whose status
* is being checked
* @param width the width of the scaled version
* whose status is to be checked
* @param height the height of the scaled version
* whose status is to be checked
! * @param observer the <code>ImageObserver</code> object
* to be notified as the image is being prepared
* @return the bitwise inclusive <b>OR</b> of
! * <code>ImageObserver</code> flags indicating what
* information about the image is currently available
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
* @see java.awt.image.ImageObserver
* @since 1.0
--- 3777,3807 ----
/**
* Returns the status of the construction of a screen representation
* of the specified image.
* <p>
* This method does not cause the image to begin loading. An
! * application must use the {@code prepareImage} method
* to force the loading of an image.
* <p>
! * The {@code checkImage} method of {@code Component}
! * calls its peer's {@code checkImage} method to calculate
* the flags. If this component does not yet have a peer, the
! * component's toolkit's {@code checkImage} method is called
* instead.
* <p>
* Information on the flags returned by this method can be found
! * with the discussion of the {@code ImageObserver} interface.
! * @param image the {@code Image} object whose status
* is being checked
* @param width the width of the scaled version
* whose status is to be checked
* @param height the height of the scaled version
* whose status is to be checked
! * @param observer the {@code ImageObserver} object
* to be notified as the image is being prepared
* @return the bitwise inclusive <b>OR</b> of
! * {@code ImageObserver} flags indicating what
* information about the image is currently available
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
* @see java.awt.image.ImageObserver
* @since 1.0
*** 3822,3832 ****
/**
* Creates a new strategy for multi-buffering on this component.
* Multi-buffering is useful for rendering performance. This method
* attempts to create the best strategy available with the number of
! * buffers supplied. It will always create a <code>BufferStrategy</code>
* with that number of buffers.
* A page-flipping strategy is attempted first, then a blitting strategy
* using accelerated buffers. Finally, an unaccelerated blitting
* strategy is used.
* <p>
--- 3822,3832 ----
/**
* Creates a new strategy for multi-buffering on this component.
* Multi-buffering is useful for rendering performance. This method
* attempts to create the best strategy available with the number of
! * buffers supplied. It will always create a {@code BufferStrategy}
* with that number of buffers.
* A page-flipping strategy is attempted first, then a blitting strategy
* using accelerated buffers. Finally, an unaccelerated blitting
* strategy is used.
* <p>
*** 3883,3903 ****
* required buffer capabilities. This is useful, for example, if only
* accelerated memory or page flipping is desired (as specified by the
* buffer capabilities).
* <p>
* Each time this method
! * is called, <code>dispose</code> will be invoked on the existing
! * <code>BufferStrategy</code>.
* @param numBuffers number of buffers to create
* @param caps the required capabilities for creating the buffer strategy;
! * cannot be <code>null</code>
* @exception AWTException if the capabilities supplied could not be
* supported or met; this may happen, for example, if there is not enough
* accelerated memory currently available, or if page flipping is specified
* but not possible.
* @exception IllegalArgumentException if numBuffers is less than 1, or if
! * caps is <code>null</code>
* @see Window#getBufferStrategy()
* @see Canvas#getBufferStrategy()
* @since 1.4
*/
void createBufferStrategy(int numBuffers,
--- 3883,3903 ----
* required buffer capabilities. This is useful, for example, if only
* accelerated memory or page flipping is desired (as specified by the
* buffer capabilities).
* <p>
* Each time this method
! * is called, {@code dispose} will be invoked on the existing
! * {@code BufferStrategy}.
* @param numBuffers number of buffers to create
* @param caps the required capabilities for creating the buffer strategy;
! * cannot be {@code null}
* @exception AWTException if the capabilities supplied could not be
* supported or met; this may happen, for example, if there is not enough
* accelerated memory currently available, or if page flipping is specified
* but not possible.
* @exception IllegalArgumentException if numBuffers is less than 1, or if
! * caps is {@code null}
* @see Window#getBufferStrategy()
* @see Canvas#getBufferStrategy()
* @since 1.4
*/
void createBufferStrategy(int numBuffers,
*** 3978,3988 ****
return null;
}
/**
* Inner class for flipping buffers on a component. That component must
! * be a <code>Canvas</code> or <code>Window</code> or <code>Applet</code>.
* @see Canvas
* @see Window
* @see Applet
* @see java.awt.image.BufferStrategy
* @author Michael Martak
--- 3978,3988 ----
return null;
}
/**
* Inner class for flipping buffers on a component. That component must
! * be a {@code Canvas} or {@code Window} or {@code Applet}.
* @see Canvas
* @see Window
* @see Applet
* @see java.awt.image.BufferStrategy
* @author Michael Martak
*** 4029,4040 ****
*/
int height;
/**
* Creates a new flipping buffer strategy for this component.
! * The component must be a <code>Canvas</code> or <code>Window</code> or
! * <code>Applet</code>.
* @see Canvas
* @see Window
* @see Applet
* @param numBuffers the number of buffers
* @param caps the capabilities of the buffers
--- 4029,4040 ----
*/
int height;
/**
* Creates a new flipping buffer strategy for this component.
! * The component must be a {@code Canvas} or {@code Window} or
! * {@code Applet}.
* @see Canvas
* @see Window
* @see Applet
* @param numBuffers the number of buffers
* @param caps the capabilities of the buffers
*** 4067,4084 ****
* Creates one or more complex, flipping buffers with the given
* capabilities.
* @param numBuffers number of buffers to create; must be greater than
* one
* @param caps the capabilities of the buffers.
! * <code>BufferCapabilities.isPageFlipping</code> must be
! * <code>true</code>.
* @exception AWTException if the capabilities supplied could not be
* supported or met
* @exception IllegalStateException if the component has no peer
* @exception IllegalArgumentException if numBuffers is less than two,
! * or if <code>BufferCapabilities.isPageFlipping</code> is not
! * <code>true</code>.
* @see java.awt.BufferCapabilities#isPageFlipping()
*/
protected void createBuffers(int numBuffers, BufferCapabilities caps)
throws AWTException
{
--- 4067,4084 ----
* Creates one or more complex, flipping buffers with the given
* capabilities.
* @param numBuffers number of buffers to create; must be greater than
* one
* @param caps the capabilities of the buffers.
! * {@code BufferCapabilities.isPageFlipping} must be
! * {@code true}.
* @exception AWTException if the capabilities supplied could not be
* supported or met
* @exception IllegalStateException if the component has no peer
* @exception IllegalArgumentException if numBuffers is less than two,
! * or if {@code BufferCapabilities.isPageFlipping} is not
! * {@code true}.
* @see java.awt.BufferCapabilities#isPageFlipping()
*/
protected void createBuffers(int numBuffers, BufferCapabilities caps)
throws AWTException
{
*** 4155,4165 ****
/**
* Flipping moves the contents of the back buffer to the front buffer,
* either by copying or by moving the video pointer.
* @param flipAction an integer value describing the flipping action
* for the contents of the back buffer. This should be one of the
! * values of the <code>BufferCapabilities.FlipContents</code>
* property.
* @exception IllegalStateException if the buffers have not yet
* been created
* @see java.awt.BufferCapabilities#getFlipContents()
*/
--- 4155,4165 ----
/**
* Flipping moves the contents of the back buffer to the front buffer,
* either by copying or by moving the video pointer.
* @param flipAction an integer value describing the flipping action
* for the contents of the back buffer. This should be one of the
! * values of the {@code BufferCapabilities.FlipContents}
* property.
* @exception IllegalStateException if the buffers have not yet
* been created
* @see java.awt.BufferCapabilities#getFlipContents()
*/
*** 4269,4279 ****
}
}
/**
* @return whether the drawing buffer was lost since the last call to
! * <code>getDrawGraphics</code>
*/
public boolean contentsLost() {
if (drawVBuffer == null) {
return false;
}
--- 4269,4279 ----
}
}
/**
* @return whether the drawing buffer was lost since the last call to
! * {@code getDrawGraphics}
*/
public boolean contentsLost() {
if (drawVBuffer == null) {
return false;
}
*** 4556,4566 ****
}
}
/**
* @return whether the drawing buffer was lost since the last call to
! * <code>getDrawGraphics</code>
*/
public boolean contentsLost() {
if (backBuffers == null) {
return false;
} else {
--- 4556,4566 ----
}
}
/**
* @return whether the drawing buffer was lost since the last call to
! * {@code getDrawGraphics}
*/
public boolean contentsLost() {
if (backBuffers == null) {
return false;
} else {
*** 4635,4645 ****
}
}
/**
* Inner class for flipping buffers on a component. That component must
! * be a <code>Canvas</code> or <code>Window</code>.
* @see Canvas
* @see Window
* @see java.awt.image.BufferStrategy
* @author Michael Martak
* @since 1.4
--- 4635,4645 ----
}
}
/**
* Inner class for flipping buffers on a component. That component must
! * be a {@code Canvas} or {@code Window}.
* @see Canvas
* @see Window
* @see java.awt.image.BufferStrategy
* @author Michael Martak
* @since 1.4
*** 4703,4713 ****
return ignoreRepaint;
}
/**
* Checks whether this component "contains" the specified point,
! * where <code>x</code> and <code>y</code> are defined to be
* relative to the coordinate system of this component.
*
* @param x the <i>x</i> coordinate of the point
* @param y the <i>y</i> coordinate of the point
* @return {@code true} if the point is within the component;
--- 4703,4713 ----
return ignoreRepaint;
}
/**
* Checks whether this component "contains" the specified point,
! * where {@code x} and {@code y} are defined to be
* relative to the coordinate system of this component.
*
* @param x the <i>x</i> coordinate of the point
* @param y the <i>y</i> coordinate of the point
* @return {@code true} if the point is within the component;
*** 4756,4774 ****
* and if so, returns the containing component. This method only
* looks one level deep. If the point (<i>x</i>, <i>y</i>) is
* inside a subcomponent that itself has subcomponents, it does not
* go looking down the subcomponent tree.
* <p>
! * The <code>locate</code> method of <code>Component</code> simply
* returns the component itself if the (<i>x</i>, <i>y</i>)
! * coordinate location is inside its bounding box, and <code>null</code>
* otherwise.
* @param x the <i>x</i> coordinate
* @param y the <i>y</i> coordinate
* @return the component or subcomponent that contains the
* (<i>x</i>, <i>y</i>) location;
! * <code>null</code> if the location
* is outside this component
* @see #contains(int, int)
* @since 1.0
*/
public Component getComponentAt(int x, int y) {
--- 4756,4774 ----
* and if so, returns the containing component. This method only
* looks one level deep. If the point (<i>x</i>, <i>y</i>) is
* inside a subcomponent that itself has subcomponents, it does not
* go looking down the subcomponent tree.
* <p>
! * The {@code locate} method of {@code Component} simply
* returns the component itself if the (<i>x</i>, <i>y</i>)
! * coordinate location is inside its bounding box, and {@code null}
* otherwise.
* @param x the <i>x</i> coordinate
* @param y the <i>y</i> coordinate
* @return the component or subcomponent that contains the
* (<i>x</i>, <i>y</i>) location;
! * {@code null} if the location
* is outside this component
* @see #contains(int, int)
* @since 1.0
*/
public Component getComponentAt(int x, int y) {
*** 4804,4824 ****
}
/**
* @param e the event to deliver
* @deprecated As of JDK version 1.1,
! * replaced by <code>dispatchEvent(AWTEvent e)</code>.
*/
@Deprecated
public void deliverEvent(Event e) {
postEvent(e);
}
/**
* Dispatches an event to this component or one of its sub components.
! * Calls <code>processEvent</code> before returning for 1.1-style
! * events which have been enabled for the <code>Component</code>.
* @param e the event
*/
public final void dispatchEvent(AWTEvent e) {
dispatchEventImpl(e);
}
--- 4804,4824 ----
}
/**
* @param e the event to deliver
* @deprecated As of JDK version 1.1,
! * replaced by {@code dispatchEvent(AWTEvent e)}.
*/
@Deprecated
public void deliverEvent(Event e) {
postEvent(e);
}
/**
* Dispatches an event to this component or one of its sub components.
! * Calls {@code processEvent} before returning for 1.1-style
! * events which have been enabled for the {@code Component}.
* @param e the event
*/
public final void dispatchEvent(AWTEvent e) {
dispatchEventImpl(e);
}
*** 5282,5292 ****
// Event source interfaces
/**
* Adds the specified component listener to receive component events from
* this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the component listener
--- 5282,5292 ----
// Event source interfaces
/**
* Adds the specified component listener to receive component events from
* this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the component listener
*** 5307,5317 ****
/**
* Removes the specified component listener so that it no longer
* receives component events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
* @param l the component listener
* @see java.awt.event.ComponentEvent
--- 5307,5317 ----
/**
* Removes the specified component listener so that it no longer
* receives component events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
* @param l the component listener
* @see java.awt.event.ComponentEvent
*** 5329,5339 ****
/**
* Returns an array of all the component listeners
* registered on this component.
*
! * @return all <code>ComponentListener</code>s of this component
* or an empty array if no component
* listeners are currently registered
*
* @see #addComponentListener
* @see #removeComponentListener
--- 5329,5339 ----
/**
* Returns an array of all the component listeners
* registered on this component.
*
! * @return all {@code ComponentListener}s of this component
* or an empty array if no component
* listeners are currently registered
*
* @see #addComponentListener
* @see #removeComponentListener
*** 5344,5354 ****
}
/**
* Adds the specified focus listener to receive focus events from
* this component when this component gains input focus.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the focus listener
--- 5344,5354 ----
}
/**
* Adds the specified focus listener to receive focus events from
* this component when this component gains input focus.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the focus listener
*** 5375,5385 ****
/**
* Removes the specified focus listener so that it no longer
* receives focus events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the focus listener
--- 5375,5385 ----
/**
* Removes the specified focus listener so that it no longer
* receives focus events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the focus listener
*** 5398,5408 ****
/**
* Returns an array of all the focus listeners
* registered on this component.
*
! * @return all of this component's <code>FocusListener</code>s
* or an empty array if no component
* listeners are currently registered
*
* @see #addFocusListener
* @see #removeFocusListener
--- 5398,5408 ----
/**
* Returns an array of all the focus listeners
* registered on this component.
*
! * @return all of this component's {@code FocusListener}s
* or an empty array if no component
* listeners are currently registered
*
* @see #addFocusListener
* @see #removeFocusListener
*** 5414,5424 ****
/**
* Adds the specified hierarchy listener to receive hierarchy changed
* events from this component when the hierarchy to which this container
* belongs changes.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the hierarchy listener
--- 5414,5424 ----
/**
* Adds the specified hierarchy listener to receive hierarchy changed
* events from this component when the hierarchy to which this container
* belongs changes.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the hierarchy listener
*** 5452,5462 ****
/**
* Removes the specified hierarchy listener so that it no longer
* receives hierarchy changed events from this component. This method
* performs no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the hierarchy listener
--- 5452,5462 ----
/**
* Removes the specified hierarchy listener so that it no longer
* receives hierarchy changed events from this component. This method
* performs no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the hierarchy listener
*** 5489,5499 ****
/**
* Returns an array of all the hierarchy listeners
* registered on this component.
*
! * @return all of this component's <code>HierarchyListener</code>s
* or an empty array if no hierarchy
* listeners are currently registered
*
* @see #addHierarchyListener
* @see #removeHierarchyListener
--- 5489,5499 ----
/**
* Returns an array of all the hierarchy listeners
* registered on this component.
*
! * @return all of this component's {@code HierarchyListener}s
* or an empty array if no hierarchy
* listeners are currently registered
*
* @see #addHierarchyListener
* @see #removeHierarchyListener
*** 5505,5515 ****
/**
* Adds the specified hierarchy bounds listener to receive hierarchy
* bounds events from this component when the hierarchy to which this
* container belongs changes.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the hierarchy bounds listener
--- 5505,5515 ----
/**
* Adds the specified hierarchy bounds listener to receive hierarchy
* bounds events from this component when the hierarchy to which this
* container belongs changes.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the hierarchy bounds listener
*** 5545,5555 ****
/**
* Removes the specified hierarchy bounds listener so that it no longer
* receives hierarchy bounds events from this component. This method
* performs no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the hierarchy bounds listener
--- 5545,5555 ----
/**
* Removes the specified hierarchy bounds listener so that it no longer
* receives hierarchy bounds events from this component. This method
* performs no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the hierarchy bounds listener
*** 5651,5661 ****
/**
* Returns an array of all the hierarchy bounds listeners
* registered on this component.
*
! * @return all of this component's <code>HierarchyBoundsListener</code>s
* or an empty array if no hierarchy bounds
* listeners are currently registered
*
* @see #addHierarchyBoundsListener
* @see #removeHierarchyBoundsListener
--- 5651,5661 ----
/**
* Returns an array of all the hierarchy bounds listeners
* registered on this component.
*
! * @return all of this component's {@code HierarchyBoundsListener}s
* or an empty array if no hierarchy bounds
* listeners are currently registered
*
* @see #addHierarchyBoundsListener
* @see #removeHierarchyBoundsListener
*** 5707,5717 ****
/**
* Removes the specified key listener so that it no longer
* receives key events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the key listener
--- 5707,5717 ----
/**
* Removes the specified key listener so that it no longer
* receives key events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the key listener
*** 5730,5740 ****
/**
* Returns an array of all the key listeners
* registered on this component.
*
! * @return all of this component's <code>KeyListener</code>s
* or an empty array if no key
* listeners are currently registered
*
* @see #addKeyListener
* @see #removeKeyListener
--- 5730,5740 ----
/**
* Returns an array of all the key listeners
* registered on this component.
*
! * @return all of this component's {@code KeyListener}s
* or an empty array if no key
* listeners are currently registered
*
* @see #addKeyListener
* @see #removeKeyListener
*** 5745,5755 ****
}
/**
* Adds the specified mouse listener to receive mouse events from
* this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse listener
--- 5745,5755 ----
}
/**
* Adds the specified mouse listener to receive mouse events from
* this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse listener
*** 5776,5786 ****
/**
* Removes the specified mouse listener so that it no longer
* receives mouse events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse listener
--- 5776,5786 ----
/**
* Removes the specified mouse listener so that it no longer
* receives mouse events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse listener
*** 5799,5809 ****
/**
* Returns an array of all the mouse listeners
* registered on this component.
*
! * @return all of this component's <code>MouseListener</code>s
* or an empty array if no mouse
* listeners are currently registered
*
* @see #addMouseListener
* @see #removeMouseListener
--- 5799,5809 ----
/**
* Returns an array of all the mouse listeners
* registered on this component.
*
! * @return all of this component's {@code MouseListener}s
* or an empty array if no mouse
* listeners are currently registered
*
* @see #addMouseListener
* @see #removeMouseListener
*** 5814,5824 ****
}
/**
* Adds the specified mouse motion listener to receive mouse motion
* events from this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse motion listener
--- 5814,5824 ----
}
/**
* Adds the specified mouse motion listener to receive mouse motion
* events from this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse motion listener
*** 5845,5855 ****
/**
* Removes the specified mouse motion listener so that it no longer
* receives mouse motion events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse motion listener
--- 5845,5855 ----
/**
* Removes the specified mouse motion listener so that it no longer
* receives mouse motion events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse motion listener
*** 5868,5878 ****
/**
* Returns an array of all the mouse motion listeners
* registered on this component.
*
! * @return all of this component's <code>MouseMotionListener</code>s
* or an empty array if no mouse motion
* listeners are currently registered
*
* @see #addMouseMotionListener
* @see #removeMouseMotionListener
--- 5868,5878 ----
/**
* Returns an array of all the mouse motion listeners
* registered on this component.
*
! * @return all of this component's {@code MouseMotionListener}s
* or an empty array if no mouse motion
* listeners are currently registered
*
* @see #addMouseMotionListener
* @see #removeMouseMotionListener
*** 5888,5898 ****
* sub-components.
* <p>
* For information on how mouse wheel events are dispatched, see
* the class description for {@link MouseWheelEvent}.
* <p>
! * If l is <code>null</code>, no exception is thrown and no
* action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse wheel listener
--- 5888,5898 ----
* sub-components.
* <p>
* For information on how mouse wheel events are dispatched, see
* the class description for {@link MouseWheelEvent}.
* <p>
! * If l is {@code null}, no exception is thrown and no
* action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the mouse wheel listener
*** 5941,5951 ****
/**
* Returns an array of all the mouse wheel listeners
* registered on this component.
*
! * @return all of this component's <code>MouseWheelListener</code>s
* or an empty array if no mouse wheel
* listeners are currently registered
*
* @see #addMouseWheelListener
* @see #removeMouseWheelListener
--- 5941,5951 ----
/**
* Returns an array of all the mouse wheel listeners
* registered on this component.
*
! * @return all of this component's {@code MouseWheelListener}s
* or an empty array if no mouse wheel
* listeners are currently registered
*
* @see #addMouseWheelListener
* @see #removeMouseWheelListener
*** 5957,5969 ****
/**
* Adds the specified input method listener to receive
* input method events from this component. A component will
* only receive input method events from input methods
! * if it also overrides <code>getInputMethodRequests</code> to return an
! * <code>InputMethodRequests</code> instance.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="{@docRoot}/java/awt/doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the input method listener
--- 5957,5969 ----
/**
* Adds the specified input method listener to receive
* input method events from this component. A component will
* only receive input method events from input methods
! * if it also overrides {@code getInputMethodRequests} to return an
! * {@code InputMethodRequests} instance.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="{@docRoot}/java/awt/doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the input method listener
*** 5985,5995 ****
/**
* Removes the specified input method listener so that it no longer
* receives input method events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener <code>l</code> is <code>null</code>,
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the input method listener
--- 5985,5995 ----
/**
* Removes the specified input method listener so that it no longer
* receives input method events from this component. This method performs
* no function, nor does it throw an exception, if the listener
* specified by the argument was not previously added to this component.
! * If listener {@code l} is {@code null},
* no exception is thrown and no action is performed.
* <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
* >AWT Threading Issues</a> for details on AWT's threading model.
*
* @param l the input method listener
*** 6008,6018 ****
/**
* Returns an array of all the input method listeners
* registered on this component.
*
! * @return all of this component's <code>InputMethodListener</code>s
* or an empty array if no input method
* listeners are currently registered
*
* @see #addInputMethodListener
* @see #removeInputMethodListener
--- 6008,6018 ----
/**
* Returns an array of all the input method listeners
* registered on this component.
*
! * @return all of this component's {@code InputMethodListener}s
* or an empty array if no input method
* listeners are currently registered
*
* @see #addInputMethodListener
* @see #removeInputMethodListener
*** 6023,6058 ****
}
/**
* Returns an array of all the objects currently registered
* as <code><em>Foo</em>Listener</code>s
! * upon this <code>Component</code>.
* <code><em>Foo</em>Listener</code>s are registered using the
* <code>add<em>Foo</em>Listener</code> method.
*
* <p>
! * You can specify the <code>listenerType</code> argument
* with a class literal, such as
* <code><em>Foo</em>Listener.class</code>.
* For example, you can query a
! * <code>Component</code> <code>c</code>
* for its mouse listeners with the following code:
*
* <pre>MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));</pre>
*
* If no such listeners exist, this method returns an empty array.
*
* @param <T> the type of the listeners
* @param listenerType the type of listeners requested; this parameter
* should specify an interface that descends from
! * <code>java.util.EventListener</code>
* @return an array of all objects registered as
* <code><em>Foo</em>Listener</code>s on this component,
* or an empty array if no such listeners have been added
! * @exception ClassCastException if <code>listenerType</code>
* doesn't specify a class or interface that implements
! * <code>java.util.EventListener</code>
* @throws NullPointerException if {@code listenerType} is {@code null}
* @see #getComponentListeners
* @see #getFocusListeners
* @see #getHierarchyListeners
* @see #getHierarchyBoundsListeners
--- 6023,6058 ----
}
/**
* Returns an array of all the objects currently registered
* as <code><em>Foo</em>Listener</code>s
! * upon this {@code Component}.
* <code><em>Foo</em>Listener</code>s are registered using the
* <code>add<em>Foo</em>Listener</code> method.
*
* <p>
! * You can specify the {@code listenerType} argument
* with a class literal, such as
* <code><em>Foo</em>Listener.class</code>.
* For example, you can query a
! * {@code Component c}
* for its mouse listeners with the following code:
*
* <pre>MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));</pre>
*
* If no such listeners exist, this method returns an empty array.
*
* @param <T> the type of the listeners
* @param listenerType the type of listeners requested; this parameter
* should specify an interface that descends from
! * {@code java.util.EventListener}
* @return an array of all objects registered as
* <code><em>Foo</em>Listener</code>s on this component,
* or an empty array if no such listeners have been added
! * @exception ClassCastException if {@code listenerType}
* doesn't specify a class or interface that implements
! * {@code java.util.EventListener}
* @throws NullPointerException if {@code listenerType} is {@code null}
* @see #getComponentListeners
* @see #getFocusListeners
* @see #getHierarchyListeners
* @see #getHierarchyBoundsListeners
*** 6094,6108 ****
/**
* Gets the input method request handler which supports
* requests from input methods for this component. A component
* that supports on-the-spot text input must override this
! * method to return an <code>InputMethodRequests</code> instance.
* At the same time, it also has to handle input method events.
*
* @return the input method request handler for this component,
! * <code>null</code> by default
* @see #addInputMethodListener
* @since 1.2
*/
public InputMethodRequests getInputMethodRequests() {
return null;
--- 6094,6108 ----
/**
* Gets the input method request handler which supports
* requests from input methods for this component. A component
* that supports on-the-spot text input must override this
! * method to return an {@code InputMethodRequests} instance.
* At the same time, it also has to handle input method events.
*
* @return the input method request handler for this component,
! * {@code null} by default
* @see #addInputMethodListener
* @since 1.2
*/
public InputMethodRequests getInputMethodRequests() {
return null;
*** 6114,6124 ****
* in this component. By default, the input context used for
* the parent component is returned. Components may
* override this to return a private input context.
*
* @return the input context used by this component;
! * <code>null</code> if no context can be determined
* @since 1.2
*/
public InputContext getInputContext() {
Container parent = this.parent;
if (parent == null) {
--- 6114,6124 ----
* in this component. By default, the input context used for
* the parent component is returned. Components may
* override this to return a private input context.
*
* @return the input context used by this component;
! * {@code null} if no context can be determined
* @since 1.2
*/
public InputContext getInputContext() {
Container parent = this.parent;
if (parent == null) {
*** 6134,6145 ****
* <p>
* Event types are automatically enabled when a listener for
* that event type is added to the component.
* <p>
* This method only needs to be invoked by subclasses of
! * <code>Component</code> which desire to have the specified event
! * types delivered to <code>processEvent</code> regardless of whether
* or not a listener is registered.
* @param eventsToEnable the event mask defining the event types
* @see #processEvent
* @see #disableEvents
* @see AWTEvent
--- 6134,6145 ----
* <p>
* Event types are automatically enabled when a listener for
* that event type is added to the component.
* <p>
* This method only needs to be invoked by subclasses of
! * {@code Component} which desire to have the specified event
! * types delivered to {@code processEvent} regardless of whether
* or not a listener is registered.
* @param eventsToEnable the event mask defining the event types
* @see #processEvent
* @see #disableEvents
* @see AWTEvent
*** 6307,6338 ****
}
/**
* Potentially coalesce an event being posted with an existing
! * event. This method is called by <code>EventQueue.postEvent</code>
* if an event with the same ID as the event to be posted is found in
* the queue (both events must have this component as their source).
* This method either returns a coalesced event which replaces
* the existing event (and the new event is then discarded), or
! * <code>null</code> to indicate that no combining should be done
* (add the second event to the end of the queue). Either event
* parameter may be modified and returned, as the other one is discarded
! * unless <code>null</code> is returned.
* <p>
! * This implementation of <code>coalesceEvents</code> coalesces
* two event types: mouse move (and drag) events,
* and paint (and update) events.
* For mouse move events the last event is always returned, causing
* intermediate moves to be discarded. For paint events, the new
! * event is coalesced into a complex <code>RepaintArea</code> in the peer.
! * The new <code>AWTEvent</code> is always returned.
*
! * @param existingEvent the event already on the <code>EventQueue</code>
* @param newEvent the event being posted to the
! * <code>EventQueue</code>
! * @return a coalesced event, or <code>null</code> indicating that no
* coalescing was done
*/
protected AWTEvent coalesceEvents(AWTEvent existingEvent,
AWTEvent newEvent) {
return null;
--- 6307,6338 ----
}
/**
* Potentially coalesce an event being posted with an existing
! * event. This method is called by {@code EventQueue.postEvent}
* if an event with the same ID as the event to be posted is found in
* the queue (both events must have this component as their source).
* This method either returns a coalesced event which replaces
* the existing event (and the new event is then discarded), or
! * {@code null} to indicate that no combining should be done
* (add the second event to the end of the queue). Either event
* parameter may be modified and returned, as the other one is discarded
! * unless {@code null} is returned.
* <p>
! * This implementation of {@code coalesceEvents} coalesces
* two event types: mouse move (and drag) events,
* and paint (and update) events.
* For mouse move events the last event is always returned, causing
* intermediate moves to be discarded. For paint events, the new
! * event is coalesced into a complex {@code RepaintArea} in the peer.
! * The new {@code AWTEvent} is always returned.
*
! * @param existingEvent the event already on the {@code EventQueue}
* @param newEvent the event being posted to the
! * {@code EventQueue}
! * @return a coalesced event, or {@code null} indicating that no
* coalescing was done
*/
protected AWTEvent coalesceEvents(AWTEvent existingEvent,
AWTEvent newEvent) {
return null;
*** 6341,6351 ****
/**
* Processes events occurring on this component. By default this
* method calls the appropriate
* <code>process<event type>Event</code>
* method for the given class of event.
! * <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the event
* @see #processComponentEvent
--- 6341,6351 ----
/**
* Processes events occurring on this component. By default this
* method calls the appropriate
* <code>process<event type>Event</code>
* method for the given class of event.
! * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the event
* @see #processComponentEvent
*** 6401,6421 ****
}
/**
* Processes component events occurring on this component by
* dispatching them to any registered
! * <code>ComponentListener</code> objects.
* <p>
* This method is not called unless component events are
* enabled for this component. Component events are enabled
* when one of the following occurs:
* <ul>
! * <li>A <code>ComponentListener</code> object is registered
! * via <code>addComponentListener</code>.
! * <li>Component events are enabled via <code>enableEvents</code>.
* </ul>
! * <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the component event
* @see java.awt.event.ComponentEvent
--- 6401,6421 ----
}
/**
* Processes component events occurring on this component by
* dispatching them to any registered
! * {@code ComponentListener} objects.
* <p>
* This method is not called unless component events are
* enabled for this component. Component events are enabled
* when one of the following occurs:
* <ul>
! * <li>A {@code ComponentListener} object is registered
! * via {@code addComponentListener}.
! * <li>Component events are enabled via {@code enableEvents}.
* </ul>
! * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the component event
* @see java.awt.event.ComponentEvent
*** 6446,6482 ****
}
/**
* Processes focus events occurring on this component by
* dispatching them to any registered
! * <code>FocusListener</code> objects.
* <p>
* This method is not called unless focus events are
* enabled for this component. Focus events are enabled
* when one of the following occurs:
* <ul>
! * <li>A <code>FocusListener</code> object is registered
! * via <code>addFocusListener</code>.
! * <li>Focus events are enabled via <code>enableEvents</code>.
* </ul>
* <p>
! * If focus events are enabled for a <code>Component</code>,
! * the current <code>KeyboardFocusManager</code> determines
* whether or not a focus event should be dispatched to
! * registered <code>FocusListener</code> objects. If the
! * events are to be dispatched, the <code>KeyboardFocusManager</code>
! * calls the <code>Component</code>'s <code>dispatchEvent</code>
! * method, which results in a call to the <code>Component</code>'s
! * <code>processFocusEvent</code> method.
! * <p>
! * If focus events are enabled for a <code>Component</code>, calling
! * the <code>Component</code>'s <code>dispatchEvent</code> method
! * with a <code>FocusEvent</code> as the argument will result in a
! * call to the <code>Component</code>'s <code>processFocusEvent</code>
! * method regardless of the current <code>KeyboardFocusManager</code>.
*
! * <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the focus event
* @see java.awt.event.FocusEvent
--- 6446,6482 ----
}
/**
* Processes focus events occurring on this component by
* dispatching them to any registered
! * {@code FocusListener} objects.
* <p>
* This method is not called unless focus events are
* enabled for this component. Focus events are enabled
* when one of the following occurs:
* <ul>
! * <li>A {@code FocusListener} object is registered
! * via {@code addFocusListener}.
! * <li>Focus events are enabled via {@code enableEvents}.
* </ul>
* <p>
! * If focus events are enabled for a {@code Component},
! * the current {@code KeyboardFocusManager} determines
* whether or not a focus event should be dispatched to
! * registered {@code FocusListener} objects. If the
! * events are to be dispatched, the {@code KeyboardFocusManager}
! * calls the {@code Component}'s {@code dispatchEvent}
! * method, which results in a call to the {@code Component}'s
! * {@code processFocusEvent} method.
! * <p>
! * If focus events are enabled for a {@code Component}, calling
! * the {@code Component}'s {@code dispatchEvent} method
! * with a {@code FocusEvent} as the argument will result in a
! * call to the {@code Component}'s {@code processFocusEvent}
! * method regardless of the current {@code KeyboardFocusManager}.
*
! * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the focus event
* @see java.awt.event.FocusEvent
*** 6503,6545 ****
}
/**
* Processes key events occurring on this component by
* dispatching them to any registered
! * <code>KeyListener</code> objects.
* <p>
* This method is not called unless key events are
* enabled for this component. Key events are enabled
* when one of the following occurs:
* <ul>
! * <li>A <code>KeyListener</code> object is registered
! * via <code>addKeyListener</code>.
! * <li>Key events are enabled via <code>enableEvents</code>.
* </ul>
*
* <p>
! * If key events are enabled for a <code>Component</code>,
! * the current <code>KeyboardFocusManager</code> determines
* whether or not a key event should be dispatched to
! * registered <code>KeyListener</code> objects. The
! * <code>DefaultKeyboardFocusManager</code> will not dispatch
! * key events to a <code>Component</code> that is not the focus
* owner or is not showing.
* <p>
! * As of J2SE 1.4, <code>KeyEvent</code>s are redirected to
* the focus owner. Please see the
* <a href="doc-files/FocusSpec.html">Focus Specification</a>
* for further information.
* <p>
! * Calling a <code>Component</code>'s <code>dispatchEvent</code>
! * method with a <code>KeyEvent</code> as the argument will
! * result in a call to the <code>Component</code>'s
! * <code>processKeyEvent</code> method regardless of the
! * current <code>KeyboardFocusManager</code> as long as the
* component is showing, focused, and enabled, and key events
* are enabled on it.
! * <p>If the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the key event
* @see java.awt.event.KeyEvent
--- 6503,6545 ----
}
/**
* Processes key events occurring on this component by
* dispatching them to any registered
! * {@code KeyListener} objects.
* <p>
* This method is not called unless key events are
* enabled for this component. Key events are enabled
* when one of the following occurs:
* <ul>
! * <li>A {@code KeyListener} object is registered
! * via {@code addKeyListener}.
! * <li>Key events are enabled via {@code enableEvents}.
* </ul>
*
* <p>
! * If key events are enabled for a {@code Component},
! * the current {@code KeyboardFocusManager} determines
* whether or not a key event should be dispatched to
! * registered {@code KeyListener} objects. The
! * {@code DefaultKeyboardFocusManager} will not dispatch
! * key events to a {@code Component} that is not the focus
* owner or is not showing.
* <p>
! * As of J2SE 1.4, {@code KeyEvent}s are redirected to
* the focus owner. Please see the
* <a href="doc-files/FocusSpec.html">Focus Specification</a>
* for further information.
* <p>
! * Calling a {@code Component}'s {@code dispatchEvent}
! * method with a {@code KeyEvent} as the argument will
! * result in a call to the {@code Component}'s
! * {@code processKeyEvent} method regardless of the
! * current {@code KeyboardFocusManager} as long as the
* component is showing, focused, and enabled, and key events
* are enabled on it.
! * <p>If the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the key event
* @see java.awt.event.KeyEvent
*** 6572,6592 ****
}
/**
* Processes mouse events occurring on this component by
* dispatching them to any registered
! * <code>MouseListener</code> objects.
* <p>
* This method is not called unless mouse events are
* enabled for this component. Mouse events are enabled
* when one of the following occurs:
* <ul>
! * <li>A <code>MouseListener</code> object is registered
! * via <code>addMouseListener</code>.
! * <li>Mouse events are enabled via <code>enableEvents</code>.
* </ul>
! * <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the mouse event
* @see java.awt.event.MouseEvent
--- 6572,6592 ----
}
/**
* Processes mouse events occurring on this component by
* dispatching them to any registered
! * {@code MouseListener} objects.
* <p>
* This method is not called unless mouse events are
* enabled for this component. Mouse events are enabled
* when one of the following occurs:
* <ul>
! * <li>A {@code MouseListener} object is registered
! * via {@code addMouseListener}.
! * <li>Mouse events are enabled via {@code enableEvents}.
* </ul>
! * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the mouse event
* @see java.awt.event.MouseEvent
*** 6620,6640 ****
}
/**
* Processes mouse motion events occurring on this component by
* dispatching them to any registered
! * <code>MouseMotionListener</code> objects.
* <p>
* This method is not called unless mouse motion events are
* enabled for this component. Mouse motion events are enabled
* when one of the following occurs:
* <ul>
! * <li>A <code>MouseMotionListener</code> object is registered
! * via <code>addMouseMotionListener</code>.
! * <li>Mouse motion events are enabled via <code>enableEvents</code>.
* </ul>
! * <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the mouse motion event
* @see java.awt.event.MouseEvent
--- 6620,6640 ----
}
/**
* Processes mouse motion events occurring on this component by
* dispatching them to any registered
! * {@code MouseMotionListener} objects.
* <p>
* This method is not called unless mouse motion events are
* enabled for this component. Mouse motion events are enabled
* when one of the following occurs:
* <ul>
! * <li>A {@code MouseMotionListener} object is registered
! * via {@code addMouseMotionListener}.
! * <li>Mouse motion events are enabled via {@code enableEvents}.
* </ul>
! * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the mouse motion event
* @see java.awt.event.MouseEvent
*** 6659,6683 ****
}
/**
* Processes mouse wheel events occurring on this component by
* dispatching them to any registered
! * <code>MouseWheelListener</code> objects.
* <p>
* This method is not called unless mouse wheel events are
* enabled for this component. Mouse wheel events are enabled
* when one of the following occurs:
* <ul>
! * <li>A <code>MouseWheelListener</code> object is registered
! * via <code>addMouseWheelListener</code>.
! * <li>Mouse wheel events are enabled via <code>enableEvents</code>.
* </ul>
* <p>
* For information on how mouse wheel events are dispatched, see
* the class description for {@link MouseWheelEvent}.
* <p>
! * Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the mouse wheel event
* @see java.awt.event.MouseWheelEvent
--- 6659,6683 ----
}
/**
* Processes mouse wheel events occurring on this component by
* dispatching them to any registered
! * {@code MouseWheelListener} objects.
* <p>
* This method is not called unless mouse wheel events are
* enabled for this component. Mouse wheel events are enabled
* when one of the following occurs:
* <ul>
! * <li>A {@code MouseWheelListener} object is registered
! * via {@code addMouseWheelListener}.
! * <li>Mouse wheel events are enabled via {@code enableEvents}.
* </ul>
* <p>
* For information on how mouse wheel events are dispatched, see
* the class description for {@link MouseWheelEvent}.
* <p>
! * Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the mouse wheel event
* @see java.awt.event.MouseWheelEvent
*** 6703,6723 ****
}
/**
* Processes input method events occurring on this component by
* dispatching them to any registered
! * <code>InputMethodListener</code> objects.
* <p>
* This method is not called unless input method events
* are enabled for this component. Input method events are enabled
* when one of the following occurs:
* <ul>
! * <li>An <code>InputMethodListener</code> object is registered
! * via <code>addInputMethodListener</code>.
! * <li>Input method events are enabled via <code>enableEvents</code>.
* </ul>
! * <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the input method event
* @see java.awt.event.InputMethodEvent
--- 6703,6723 ----
}
/**
* Processes input method events occurring on this component by
* dispatching them to any registered
! * {@code InputMethodListener} objects.
* <p>
* This method is not called unless input method events
* are enabled for this component. Input method events are enabled
* when one of the following occurs:
* <ul>
! * <li>An {@code InputMethodListener} object is registered
! * via {@code addInputMethodListener}.
! * <li>Input method events are enabled via {@code enableEvents}.
* </ul>
! * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the input method event
* @see java.awt.event.InputMethodEvent
*** 6742,6762 ****
}
/**
* Processes hierarchy events occurring on this component by
* dispatching them to any registered
! * <code>HierarchyListener</code> objects.
* <p>
* This method is not called unless hierarchy events
* are enabled for this component. Hierarchy events are enabled
* when one of the following occurs:
* <ul>
! * <li>An <code>HierarchyListener</code> object is registered
! * via <code>addHierarchyListener</code>.
! * <li>Hierarchy events are enabled via <code>enableEvents</code>.
* </ul>
! * <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the hierarchy event
* @see java.awt.event.HierarchyEvent
--- 6742,6762 ----
}
/**
* Processes hierarchy events occurring on this component by
* dispatching them to any registered
! * {@code HierarchyListener} objects.
* <p>
* This method is not called unless hierarchy events
* are enabled for this component. Hierarchy events are enabled
* when one of the following occurs:
* <ul>
! * <li>An {@code HierarchyListener} object is registered
! * via {@code addHierarchyListener}.
! * <li>Hierarchy events are enabled via {@code enableEvents}.
* </ul>
! * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the hierarchy event
* @see java.awt.event.HierarchyEvent
*** 6778,6798 ****
}
/**
* Processes hierarchy bounds events occurring on this component by
* dispatching them to any registered
! * <code>HierarchyBoundsListener</code> objects.
* <p>
* This method is not called unless hierarchy bounds events
* are enabled for this component. Hierarchy bounds events are enabled
* when one of the following occurs:
* <ul>
! * <li>An <code>HierarchyBoundsListener</code> object is registered
! * via <code>addHierarchyBoundsListener</code>.
! * <li>Hierarchy bounds events are enabled via <code>enableEvents</code>.
* </ul>
! * <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the hierarchy event
* @see java.awt.event.HierarchyEvent
--- 6778,6798 ----
}
/**
* Processes hierarchy bounds events occurring on this component by
* dispatching them to any registered
! * {@code HierarchyBoundsListener} objects.
* <p>
* This method is not called unless hierarchy bounds events
* are enabled for this component. Hierarchy bounds events are enabled
* when one of the following occurs:
* <ul>
! * <li>An {@code HierarchyBoundsListener} object is registered
! * via {@code addHierarchyBoundsListener}.
! * <li>Hierarchy bounds events are enabled via {@code enableEvents}.
* </ul>
! * <p>Note that if the event parameter is {@code null}
* the behavior is unspecified and may result in an
* exception.
*
* @param e the hierarchy event
* @see java.awt.event.HierarchyEvent
*** 6975,6985 ****
public boolean action(Event evt, Object what) {
return false;
}
/**
! * Makes this <code>Component</code> displayable by connecting it to a
* native screen resource.
* This method is called internally by the toolkit and should
* not be called directly by programs.
* <p>
* This method changes layout-related information, and therefore,
--- 6975,6985 ----
public boolean action(Event evt, Object what) {
return false;
}
/**
! * Makes this {@code Component} displayable by connecting it to a
* native screen resource.
* This method is called internally by the toolkit and should
* not be called directly by programs.
* <p>
* This method changes layout-related information, and therefore,
*** 7079,7094 ****
}
}
}
/**
! * Makes this <code>Component</code> undisplayable by destroying it native
* screen resource.
* <p>
* This method is called by the toolkit internally and should
* not be called directly by programs. Code overriding
! * this method should call <code>super.removeNotify</code> as
* the first line of the overriding method.
*
* @see #isDisplayable
* @see #addNotify
* @since 1.0
--- 7079,7094 ----
}
}
}
/**
! * Makes this {@code Component} undisplayable by destroying it native
* screen resource.
* <p>
* This method is called by the toolkit internally and should
* not be called directly by programs. Code overriding
! * this method should call {@code super.removeNotify} as
* the first line of the overriding method.
*
* @see #isDisplayable
* @see #addNotify
* @since 1.0
*** 7196,7213 ****
public boolean lostFocus(Event evt, Object what) {
return false;
}
/**
! * Returns whether this <code>Component</code> can become the focus
* owner.
*
! * @return <code>true</code> if this <code>Component</code> is
! * focusable; <code>false</code> otherwise
* @see #setFocusable
* @since 1.1
! * @deprecated As of 1.4, replaced by <code>isFocusable()</code>.
*/
@Deprecated
public boolean isFocusTraversable() {
if (isFocusTraversableOverridden == FOCUS_TRAVERSABLE_UNKNOWN) {
isFocusTraversableOverridden = FOCUS_TRAVERSABLE_DEFAULT;
--- 7196,7213 ----
public boolean lostFocus(Event evt, Object what) {
return false;
}
/**
! * Returns whether this {@code Component} can become the focus
* owner.
*
! * @return {@code true} if this {@code Component} is
! * focusable; {@code false} otherwise
* @see #setFocusable
* @since 1.1
! * @deprecated As of 1.4, replaced by {@code isFocusable()}.
*/
@Deprecated
public boolean isFocusTraversable() {
if (isFocusTraversableOverridden == FOCUS_TRAVERSABLE_UNKNOWN) {
isFocusTraversableOverridden = FOCUS_TRAVERSABLE_DEFAULT;
*** 7216,7227 ****
}
/**
* Returns whether this Component can be focused.
*
! * @return <code>true</code> if this Component is focusable;
! * <code>false</code> otherwise.
* @see #setFocusable
* @since 1.4
*/
public boolean isFocusable() {
return isFocusTraversable();
--- 7216,7227 ----
}
/**
* Returns whether this Component can be focused.
*
! * @return {@code true} if this Component is focusable;
! * {@code false} otherwise.
* @see #setFocusable
* @since 1.4
*/
public boolean isFocusable() {
return isFocusTraversable();
*** 7341,7351 ****
}
/**
* Returns the Set of focus traversal keys for a given traversal operation
* for this Component. (See
! * <code>setFocusTraversalKeys</code> for a full description of each key.)
* <p>
* If a Set of traversal keys has not been explicitly defined for this
* Component, then this Component's parent's Set is returned. If no Set
* has been explicitly defined for any of this Component's ancestors, then
* the current KeyboardFocusManager's default Set is returned.
--- 7341,7351 ----
}
/**
* Returns the Set of focus traversal keys for a given traversal operation
* for this Component. (See
! * {@code setFocusTraversalKeys} for a full description of each key.)
* <p>
* If a Set of traversal keys has not been explicitly defined for this
* Component, then this Component's parent's Set is returned. If no Set
* has been explicitly defined for any of this Component's ancestors, then
* the current KeyboardFocusManager's default Set is returned.
*** 7441,7459 ****
}
/**
* Returns whether the Set of focus traversal keys for the given focus
* traversal operation has been explicitly defined for this Component. If
! * this method returns <code>false</code>, this Component is inheriting the
* Set from an ancestor, or from the current KeyboardFocusManager.
*
* @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
* KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or
* KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
! * @return <code>true</code> if the Set of focus traversal keys for the
* given focus traversal operation has been explicitly defined for
! * this Component; <code>false</code> otherwise.
* @throws IllegalArgumentException if id is not one of
* KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
* KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or
* KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
* @since 1.4
--- 7441,7459 ----
}
/**
* Returns whether the Set of focus traversal keys for the given focus
* traversal operation has been explicitly defined for this Component. If
! * this method returns {@code false}, this Component is inheriting the
* Set from an ancestor, or from the current KeyboardFocusManager.
*
* @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
* KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or
* KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
! * @return {@code true} if the Set of focus traversal keys for the
* given focus traversal operation has been explicitly defined for
! * this Component; {@code false} otherwise.
* @throws IllegalArgumentException if id is not one of
* KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
* KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or
* KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
* @since 1.4
*** 7524,7539 ****
* Component's top-level Window cannot become the focused Window,
* the request will be remembered and will be granted when the
* Window is later focused by the user.
* <p>
* This method cannot be used to set the focus owner to no Component at
! * all. Use <code>KeyboardFocusManager.clearGlobalFocusOwner()</code>
* instead.
* <p>
* Because the focus behavior of this method is platform-dependent,
* developers are strongly encouraged to use
! * <code>requestFocusInWindow</code> when possible.
*
* <p>Note: Not all focus transfers result from invoking this method. As
* such, a component may receive focus without this or any of the other
* {@code requestFocus} methods of {@code Component} being invoked.
*
--- 7524,7539 ----
* Component's top-level Window cannot become the focused Window,
* the request will be remembered and will be granted when the
* Window is later focused by the user.
* <p>
* This method cannot be used to set the focus owner to no Component at
! * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner()}
* instead.
* <p>
* Because the focus behavior of this method is platform-dependent,
* developers are strongly encouraged to use
! * {@code requestFocusInWindow} when possible.
*
* <p>Note: Not all focus transfers result from invoking this method. As
* such, a component may receive focus without this or any of the other
* {@code requestFocus} methods of {@code Component} being invoked.
*
*** 7552,7564 ****
boolean requestFocus(CausedFocusEvent.Cause cause) {
return requestFocusHelper(false, true, cause);
}
/**
! * Requests that this <code>Component</code> get the input focus,
! * and that this <code>Component</code>'s top-level ancestor
! * become the focused <code>Window</code>. This component must be
* displayable, focusable, visible and all of its ancestors (with
* the exception of the top-level Window) must be visible for the
* request to be granted. Every effort will be made to honor the
* request; however, in some cases it may be impossible to do
* so. Developers must never assume that this component is the
--- 7552,7564 ----
boolean requestFocus(CausedFocusEvent.Cause cause) {
return requestFocusHelper(false, true, cause);
}
/**
! * Requests that this {@code Component} get the input focus,
! * and that this {@code Component}'s top-level ancestor
! * become the focused {@code Window}. This component must be
* displayable, focusable, visible and all of its ancestors (with
* the exception of the top-level Window) must be visible for the
* request to be granted. Every effort will be made to honor the
* request; however, in some cases it may be impossible to do
* so. Developers must never assume that this component is the
*** 7566,7598 ****
* event. If this request is denied because this component's
* top-level window cannot become the focused window, the request
* will be remembered and will be granted when the window is later
* focused by the user.
* <p>
! * This method returns a boolean value. If <code>false</code> is returned,
! * the request is <b>guaranteed to fail</b>. If <code>true</code> is
* returned, the request will succeed <b>unless</b> it is vetoed, or an
* extraordinary event, such as disposal of the component's peer, occurs
* before the request can be granted by the native windowing system. Again,
! * while a return value of <code>true</code> indicates that the request is
* likely to succeed, developers must never assume that this component is
* the focus owner until this component receives a FOCUS_GAINED event.
* <p>
* This method cannot be used to set the focus owner to no component at
! * all. Use <code>KeyboardFocusManager.clearGlobalFocusOwner</code>
* instead.
* <p>
* Because the focus behavior of this method is platform-dependent,
* developers are strongly encouraged to use
! * <code>requestFocusInWindow</code> when possible.
* <p>
! * Every effort will be made to ensure that <code>FocusEvent</code>s
* generated as a
* result of this request will have the specified temporary value. However,
* because specifying an arbitrary temporary state may not be implementable
* on all native windowing systems, correct behavior for this method can be
! * guaranteed only for lightweight <code>Component</code>s.
* This method is not intended
* for general use, but exists instead as a hook for lightweight component
* libraries, such as Swing.
*
* <p>Note: Not all focus transfers result from invoking this method. As
--- 7566,7598 ----
* event. If this request is denied because this component's
* top-level window cannot become the focused window, the request
* will be remembered and will be granted when the window is later
* focused by the user.
* <p>
! * This method returns a boolean value. If {@code false} is returned,
! * the request is <b>guaranteed to fail</b>. If {@code true} is
* returned, the request will succeed <b>unless</b> it is vetoed, or an
* extraordinary event, such as disposal of the component's peer, occurs
* before the request can be granted by the native windowing system. Again,
! * while a return value of {@code true} indicates that the request is
* likely to succeed, developers must never assume that this component is
* the focus owner until this component receives a FOCUS_GAINED event.
* <p>
* This method cannot be used to set the focus owner to no component at
! * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner}
* instead.
* <p>
* Because the focus behavior of this method is platform-dependent,
* developers are strongly encouraged to use
! * {@code requestFocusInWindow} when possible.
* <p>
! * Every effort will be made to ensure that {@code FocusEvent}s
* generated as a
* result of this request will have the specified temporary value. However,
* because specifying an arbitrary temporary state may not be implementable
* on all native windowing systems, correct behavior for this method can be
! * guaranteed only for lightweight {@code Component}s.
* This method is not intended
* for general use, but exists instead as a hook for lightweight component
* libraries, such as Swing.
*
* <p>Note: Not all focus transfers result from invoking this method. As
*** 7601,7612 ****
*
* @param temporary true if the focus change is temporary,
* such as when the window loses the focus; for
* more information on temporary focus changes see the
*<a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
! * @return <code>false</code> if the focus change request is guaranteed to
! * fail; <code>true</code> if it is likely to succeed
* @see java.awt.event.FocusEvent
* @see #addFocusListener
* @see #isFocusable
* @see #isDisplayable
* @see KeyboardFocusManager#clearGlobalFocusOwner
--- 7601,7612 ----
*
* @param temporary true if the focus change is temporary,
* such as when the window loses the focus; for
* more information on temporary focus changes see the
*<a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
! * @return {@code false} if the focus change request is guaranteed to
! * fail; {@code true} if it is likely to succeed
* @see java.awt.event.FocusEvent
* @see #addFocusListener
* @see #isFocusable
* @see #isDisplayable
* @see KeyboardFocusManager#clearGlobalFocusOwner
*** 7628,7662 ****
* effort will be made to honor the request; however, in some
* cases it may be impossible to do so. Developers must never
* assume that this Component is the focus owner until this
* Component receives a FOCUS_GAINED event.
* <p>
! * This method returns a boolean value. If <code>false</code> is returned,
! * the request is <b>guaranteed to fail</b>. If <code>true</code> is
* returned, the request will succeed <b>unless</b> it is vetoed, or an
* extraordinary event, such as disposal of the Component's peer, occurs
* before the request can be granted by the native windowing system. Again,
! * while a return value of <code>true</code> indicates that the request is
* likely to succeed, developers must never assume that this Component is
* the focus owner until this Component receives a FOCUS_GAINED event.
* <p>
* This method cannot be used to set the focus owner to no Component at
! * all. Use <code>KeyboardFocusManager.clearGlobalFocusOwner()</code>
* instead.
* <p>
* The focus behavior of this method can be implemented uniformly across
* platforms, and thus developers are strongly encouraged to use this
! * method over <code>requestFocus</code> when possible. Code which relies
! * on <code>requestFocus</code> may exhibit different focus behavior on
* different platforms.
*
* <p>Note: Not all focus transfers result from invoking this method. As
* such, a component may receive focus without this or any of the other
* {@code requestFocus} methods of {@code Component} being invoked.
*
! * @return <code>false</code> if the focus change request is guaranteed to
! * fail; <code>true</code> if it is likely to succeed
* @see #requestFocus
* @see java.awt.event.FocusEvent
* @see #addFocusListener
* @see #isFocusable
* @see #isDisplayable
--- 7628,7662 ----
* effort will be made to honor the request; however, in some
* cases it may be impossible to do so. Developers must never
* assume that this Component is the focus owner until this
* Component receives a FOCUS_GAINED event.
* <p>
! * This method returns a boolean value. If {@code false} is returned,
! * the request is <b>guaranteed to fail</b>. If {@code true} is
* returned, the request will succeed <b>unless</b> it is vetoed, or an
* extraordinary event, such as disposal of the Component's peer, occurs
* before the request can be granted by the native windowing system. Again,
! * while a return value of {@code true} indicates that the request is
* likely to succeed, developers must never assume that this Component is
* the focus owner until this Component receives a FOCUS_GAINED event.
* <p>
* This method cannot be used to set the focus owner to no Component at
! * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner()}
* instead.
* <p>
* The focus behavior of this method can be implemented uniformly across
* platforms, and thus developers are strongly encouraged to use this
! * method over {@code requestFocus} when possible. Code which relies
! * on {@code requestFocus} may exhibit different focus behavior on
* different platforms.
*
* <p>Note: Not all focus transfers result from invoking this method. As
* such, a component may receive focus without this or any of the other
* {@code requestFocus} methods of {@code Component} being invoked.
*
! * @return {@code false} if the focus change request is guaranteed to
! * fail; {@code true} if it is likely to succeed
* @see #requestFocus
* @see java.awt.event.FocusEvent
* @see #addFocusListener
* @see #isFocusable
* @see #isDisplayable
*** 7670,7709 ****
boolean requestFocusInWindow(CausedFocusEvent.Cause cause) {
return requestFocusHelper(false, false, cause);
}
/**
! * Requests that this <code>Component</code> get the input focus,
! * if this <code>Component</code>'s top-level ancestor is already
! * the focused <code>Window</code>. This component must be
* displayable, focusable, visible and all of its ancestors (with
* the exception of the top-level Window) must be visible for the
* request to be granted. Every effort will be made to honor the
* request; however, in some cases it may be impossible to do
* so. Developers must never assume that this component is the
* focus owner until this component receives a FOCUS_GAINED event.
* <p>
! * This method returns a boolean value. If <code>false</code> is returned,
! * the request is <b>guaranteed to fail</b>. If <code>true</code> is
* returned, the request will succeed <b>unless</b> it is vetoed, or an
* extraordinary event, such as disposal of the component's peer, occurs
* before the request can be granted by the native windowing system. Again,
! * while a return value of <code>true</code> indicates that the request is
* likely to succeed, developers must never assume that this component is
* the focus owner until this component receives a FOCUS_GAINED event.
* <p>
* This method cannot be used to set the focus owner to no component at
! * all. Use <code>KeyboardFocusManager.clearGlobalFocusOwner</code>
* instead.
* <p>
* The focus behavior of this method can be implemented uniformly across
* platforms, and thus developers are strongly encouraged to use this
! * method over <code>requestFocus</code> when possible. Code which relies
! * on <code>requestFocus</code> may exhibit different focus behavior on
* different platforms.
* <p>
! * Every effort will be made to ensure that <code>FocusEvent</code>s
* generated as a
* result of this request will have the specified temporary value. However,
* because specifying an arbitrary temporary state may not be implementable
* on all native windowing systems, correct behavior for this method can be
* guaranteed only for lightweight components. This method is not intended
--- 7670,7709 ----
boolean requestFocusInWindow(CausedFocusEvent.Cause cause) {
return requestFocusHelper(false, false, cause);
}
/**
! * Requests that this {@code Component} get the input focus,
! * if this {@code Component}'s top-level ancestor is already
! * the focused {@code Window}. This component must be
* displayable, focusable, visible and all of its ancestors (with
* the exception of the top-level Window) must be visible for the
* request to be granted. Every effort will be made to honor the
* request; however, in some cases it may be impossible to do
* so. Developers must never assume that this component is the
* focus owner until this component receives a FOCUS_GAINED event.
* <p>
! * This method returns a boolean value. If {@code false} is returned,
! * the request is <b>guaranteed to fail</b>. If {@code true} is
* returned, the request will succeed <b>unless</b> it is vetoed, or an
* extraordinary event, such as disposal of the component's peer, occurs
* before the request can be granted by the native windowing system. Again,
! * while a return value of {@code true} indicates that the request is
* likely to succeed, developers must never assume that this component is
* the focus owner until this component receives a FOCUS_GAINED event.
* <p>
* This method cannot be used to set the focus owner to no component at
! * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner}
* instead.
* <p>
* The focus behavior of this method can be implemented uniformly across
* platforms, and thus developers are strongly encouraged to use this
! * method over {@code requestFocus} when possible. Code which relies
! * on {@code requestFocus} may exhibit different focus behavior on
* different platforms.
* <p>
! * Every effort will be made to ensure that {@code FocusEvent}s
* generated as a
* result of this request will have the specified temporary value. However,
* because specifying an arbitrary temporary state may not be implementable
* on all native windowing systems, correct behavior for this method can be
* guaranteed only for lightweight components. This method is not intended
*** 7716,7727 ****
*
* @param temporary true if the focus change is temporary,
* such as when the window loses the focus; for
* more information on temporary focus changes see the
*<a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
! * @return <code>false</code> if the focus change request is guaranteed to
! * fail; <code>true</code> if it is likely to succeed
* @see #requestFocus
* @see java.awt.event.FocusEvent
* @see #addFocusListener
* @see #isFocusable
* @see #isDisplayable
--- 7716,7727 ----
*
* @param temporary true if the focus change is temporary,
* such as when the window loses the focus; for
* more information on temporary focus changes see the
*<a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
! * @return {@code false} if the focus change request is guaranteed to
! * fail; {@code true} if it is likely to succeed
* @see #requestFocus
* @see java.awt.event.FocusEvent
* @see #addFocusListener
* @see #isFocusable
* @see #isDisplayable
*** 7952,7963 ****
* Component's focus traversal cycle. Each focus traversal cycle has only
* a single focus cycle root and each Component which is not a Container
* belongs to only a single focus traversal cycle.
*
* @param container the Container to be tested
! * @return <code>true</code> if the specified Container is a focus-cycle-
! * root of this Component; <code>false</code> otherwise
* @see Container#isFocusCycleRoot()
* @since 1.4
*/
public boolean isFocusCycleRoot(Container container) {
Container rootAncestor = getFocusCycleRootAncestor();
--- 7952,7963 ----
* Component's focus traversal cycle. Each focus traversal cycle has only
* a single focus cycle root and each Component which is not a Container
* belongs to only a single focus traversal cycle.
*
* @param container the Container to be tested
! * @return {@code true} if the specified Container is a focus-cycle-
! * root of this Component; {@code false} otherwise
* @see Container#isFocusCycleRoot()
* @since 1.4
*/
public boolean isFocusCycleRoot(Container container) {
Container rootAncestor = getFocusCycleRootAncestor();
*** 8134,8162 ****
}
}
}
/**
! * Returns <code>true</code> if this <code>Component</code> is the
* focus owner. This method is obsolete, and has been replaced by
! * <code>isFocusOwner()</code>.
*
! * @return <code>true</code> if this <code>Component</code> is the
! * focus owner; <code>false</code> otherwise
* @since 1.2
*/
public boolean hasFocus() {
return (KeyboardFocusManager.getCurrentKeyboardFocusManager().
getFocusOwner() == this);
}
/**
! * Returns <code>true</code> if this <code>Component</code> is the
* focus owner.
*
! * @return <code>true</code> if this <code>Component</code> is the
! * focus owner; <code>false</code> otherwise
* @since 1.4
*/
public boolean isFocusOwner() {
return hasFocus();
}
--- 8134,8162 ----
}
}
}
/**
! * Returns {@code true} if this {@code Component} is the
* focus owner. This method is obsolete, and has been replaced by
! * {@code isFocusOwner()}.
*
! * @return {@code true} if this {@code Component} is the
! * focus owner; {@code false} otherwise
* @since 1.2
*/
public boolean hasFocus() {
return (KeyboardFocusManager.getCurrentKeyboardFocusManager().
getFocusOwner() == this);
}
/**
! * Returns {@code true} if this {@code Component} is the
* focus owner.
*
! * @return {@code true} if this {@code Component} is the
! * focus owner; {@code false} otherwise
* @since 1.4
*/
public boolean isFocusOwner() {
return hasFocus();
}
*** 8231,8241 ****
/**
* Returns a string representing the state of this component. This
* method is intended to be used only for debugging purposes, and the
* content and format of the returned string may vary between
* implementations. The returned string may be empty but may not be
! * <code>null</code>.
*
* @return a string representation of this component's state
* @since 1.0
*/
protected String paramString() {
--- 8231,8241 ----
/**
* Returns a string representing the state of this component. This
* method is intended to be used only for debugging purposes, and the
* content and format of the returned string may vary between
* implementations. The returned string may be empty but may not be
! * {@code null}.
*
* @return a string representation of this component's state
* @since 1.0
*/
protected String paramString() {
*** 8256,8266 ****
return getClass().getName() + '[' + paramString() + ']';
}
/**
* Prints a listing of this component to the standard system output
! * stream <code>System.out</code>.
* @see java.lang.System#out
* @since 1.0
*/
public void list() {
list(System.out, 0);
--- 8256,8266 ----
return getClass().getName() + '[' + paramString() + ']';
}
/**
* Prints a listing of this component to the standard system output
! * stream {@code System.out}.
* @see java.lang.System#out
* @since 1.0
*/
public void list() {
list(System.out, 0);
*** 8351,8364 ****
* <li>this Component's preferred size ("preferredSize")</li>
* <li>this Component's minimum size ("minimumSize")</li>
* <li>this Component's maximum size ("maximumSize")</li>
* <li>this Component's name ("name")</li>
* </ul>
! * Note that if this <code>Component</code> is inheriting a bound property, then no
* event will be fired in response to a change in the inherited property.
* <p>
! * If <code>listener</code> is <code>null</code>,
* no exception is thrown and no action is performed.
*
* @param listener the property change listener to be added
*
* @see #removePropertyChangeListener
--- 8351,8364 ----
* <li>this Component's preferred size ("preferredSize")</li>
* <li>this Component's minimum size ("minimumSize")</li>
* <li>this Component's maximum size ("maximumSize")</li>
* <li>this Component's name ("name")</li>
* </ul>
! * Note that if this {@code Component} is inheriting a bound property, then no
* event will be fired in response to a change in the inherited property.
* <p>
! * If {@code listener} is {@code null},
* no exception is thrown and no action is performed.
*
* @param listener the property change listener to be added
*
* @see #removePropertyChangeListener
*** 8403,8413 ****
/**
* Returns an array of all the property change listeners
* registered on this component.
*
! * @return all of this component's <code>PropertyChangeListener</code>s
* or an empty array if no property change
* listeners are currently registered
*
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
--- 8403,8413 ----
/**
* Returns an array of all the property change listeners
* registered on this component.
*
! * @return all of this component's {@code PropertyChangeListener}s
* or an empty array if no property change
* listeners are currently registered
*
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
*** 8440,8453 ****
* <li>this Component's Set of BACKWARD_TRAVERSAL_KEYS
* ("backwardFocusTraversalKeys")</li>
* <li>this Component's Set of UP_CYCLE_TRAVERSAL_KEYS
* ("upCycleFocusTraversalKeys")</li>
* </ul>
! * Note that if this <code>Component</code> is inheriting a bound property, then no
* event will be fired in response to a change in the inherited property.
* <p>
! * If <code>propertyName</code> or <code>listener</code> is <code>null</code>,
* no exception is thrown and no action is taken.
*
* @param propertyName one of the property names listed above
* @param listener the property change listener to be added
*
--- 8440,8453 ----
* <li>this Component's Set of BACKWARD_TRAVERSAL_KEYS
* ("backwardFocusTraversalKeys")</li>
* <li>this Component's Set of UP_CYCLE_TRAVERSAL_KEYS
* ("upCycleFocusTraversalKeys")</li>
* </ul>
! * Note that if this {@code Component} is inheriting a bound property, then no
* event will be fired in response to a change in the inherited property.
* <p>
! * If {@code propertyName} or {@code listener} is {@code null},
* no exception is thrown and no action is taken.
*
* @param propertyName one of the property names listed above
* @param listener the property change listener to be added
*
*** 8468,8483 ****
changeSupport.addPropertyChangeListener(propertyName, listener);
}
}
/**
! * Removes a <code>PropertyChangeListener</code> from the listener
* list for a specific property. This method should be used to remove
! * <code>PropertyChangeListener</code>s
* that were registered for a specific bound property.
* <p>
! * If <code>propertyName</code> or <code>listener</code> is <code>null</code>,
* no exception is thrown and no action is taken.
*
* @param propertyName a valid property name
* @param listener the PropertyChangeListener to be removed
*
--- 8468,8483 ----
changeSupport.addPropertyChangeListener(propertyName, listener);
}
}
/**
! * Removes a {@code PropertyChangeListener} from the listener
* list for a specific property. This method should be used to remove
! * {@code PropertyChangeListener}s
* that were registered for a specific bound property.
* <p>
! * If {@code propertyName} or {@code listener} is {@code null},
* no exception is thrown and no action is taken.
*
* @param propertyName a valid property name
* @param listener the PropertyChangeListener to be removed
*
*** 8499,8511 ****
/**
* Returns an array of all the listeners which have been associated
* with the named property.
*
* @param propertyName the property name
! * @return all of the <code>PropertyChangeListener</code>s associated with
* the named property; if no such listeners have been added or
! * if <code>propertyName</code> is <code>null</code>, an empty
* array is returned
*
* @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
* @see #removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
* @see #getPropertyChangeListeners
--- 8499,8511 ----
/**
* Returns an array of all the listeners which have been associated
* with the named property.
*
* @param propertyName the property name
! * @return all of the {@code PropertyChangeListener}s associated with
* the named property; if no such listeners have been added or
! * if {@code propertyName} is {@code null}, an empty
* array is returned
*
* @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
* @see #removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
* @see #getPropertyChangeListeners
*** 8702,8712 ****
*/
private int componentSerializedDataVersion = 4;
/**
* This hack is for Swing serialization. It will invoke
! * the Swing package private method <code>compWriteObjectNotify</code>.
*/
private void doSwingSerialization() {
Package swingPackage = Package.getPackage("javax.swing");
// For Swing serialization to correctly work Swing needs to
// be notified before Component does it's serialization. This
--- 8702,8712 ----
*/
private int componentSerializedDataVersion = 4;
/**
* This hack is for Swing serialization. It will invoke
! * the Swing package private method {@code compWriteObjectNotify}.
*/
private void doSwingSerialization() {
Package swingPackage = Package.getPackage("javax.swing");
// For Swing serialization to correctly work Swing needs to
// be notified before Component does it's serialization. This
*** 8756,8790 ****
* Writes default serializable fields to stream. Writes
* a variety of serializable listeners as optional data.
* The non-serializable listeners are detected and
* no attempt is made to serialize them.
*
! * @param s the <code>ObjectOutputStream</code> to write
! * @serialData <code>null</code> terminated sequence of
! * 0 or more pairs; the pair consists of a <code>String</code>
! * and an <code>Object</code>; the <code>String</code> indicates
* the type of object and is one of the following (as of 1.4):
! * <code>componentListenerK</code> indicating an
! * <code>ComponentListener</code> object;
! * <code>focusListenerK</code> indicating an
! * <code>FocusListener</code> object;
! * <code>keyListenerK</code> indicating an
! * <code>KeyListener</code> object;
! * <code>mouseListenerK</code> indicating an
! * <code>MouseListener</code> object;
! * <code>mouseMotionListenerK</code> indicating an
! * <code>MouseMotionListener</code> object;
! * <code>inputMethodListenerK</code> indicating an
! * <code>InputMethodListener</code> object;
! * <code>hierarchyListenerK</code> indicating an
! * <code>HierarchyListener</code> object;
! * <code>hierarchyBoundsListenerK</code> indicating an
! * <code>HierarchyBoundsListener</code> object;
! * <code>mouseWheelListenerK</code> indicating an
! * <code>MouseWheelListener</code> object
! * @serialData an optional <code>ComponentOrientation</code>
! * (after <code>inputMethodListener</code>, as of 1.2)
*
* @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener)
* @see #componentListenerK
* @see #focusListenerK
* @see #keyListenerK
--- 8756,8790 ----
* Writes default serializable fields to stream. Writes
* a variety of serializable listeners as optional data.
* The non-serializable listeners are detected and
* no attempt is made to serialize them.
*
! * @param s the {@code ObjectOutputStream} to write
! * @serialData {@code null} terminated sequence of
! * 0 or more pairs; the pair consists of a {@code String}
! * and an {@code Object}; the {@code String} indicates
* the type of object and is one of the following (as of 1.4):
! * {@code componentListenerK} indicating an
! * {@code ComponentListener} object;
! * {@code focusListenerK} indicating an
! * {@code FocusListener} object;
! * {@code keyListenerK} indicating an
! * {@code KeyListener} object;
! * {@code mouseListenerK} indicating an
! * {@code MouseListener} object;
! * {@code mouseMotionListenerK} indicating an
! * {@code MouseMotionListener} object;
! * {@code inputMethodListenerK} indicating an
! * {@code InputMethodListener} object;
! * {@code hierarchyListenerK} indicating an
! * {@code HierarchyListener} object;
! * {@code hierarchyBoundsListenerK} indicating an
! * {@code HierarchyBoundsListener} object;
! * {@code mouseWheelListenerK} indicating an
! * {@code MouseWheelListener} object
! * @serialData an optional {@code ComponentOrientation}
! * (after {@code inputMethodListener}, as of 1.2)
*
* @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener)
* @see #componentListenerK
* @see #focusListenerK
* @see #keyListenerK
*** 8822,8837 ****
s.writeObject(null);
}
/**
! * Reads the <code>ObjectInputStream</code> and if it isn't
! * <code>null</code> adds a listener to receive a variety
* of events fired by the component.
* Unrecognized keys or values will be ignored.
*
! * @param s the <code>ObjectInputStream</code> to read
* @see #writeObject(ObjectOutputStream)
*/
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException
{
--- 8822,8837 ----
s.writeObject(null);
}
/**
! * Reads the {@code ObjectInputStream} and if it isn't
! * {@code null} adds a listener to receive a variety
* of events fired by the component.
* Unrecognized keys or values will be ignored.
*
! * @param s the {@code ObjectInputStream} to read
* @see #writeObject(ObjectOutputStream)
*/
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException
{
*** 8969,8987 ****
}
/**
* Sets the language-sensitive orientation that is to be used to order
* the elements or text within this component. Language-sensitive
! * <code>LayoutManager</code> and <code>Component</code>
* subclasses will use this property to
* determine how to lay out and draw components.
* <p>
* At construction time, a component's orientation is set to
! * <code>ComponentOrientation.UNKNOWN</code>,
* indicating that it has not been specified
* explicitly. The UNKNOWN orientation behaves the same as
! * <code>ComponentOrientation.LEFT_TO_RIGHT</code>.
* <p>
* To set the orientation of a single component, use this method.
* To set the orientation of an entire component
* hierarchy, use
* {@link #applyComponentOrientation applyComponentOrientation}.
--- 8969,8987 ----
}
/**
* Sets the language-sensitive orientation that is to be used to order
* the elements or text within this component. Language-sensitive
! * {@code LayoutManager} and {@code Component}
* subclasses will use this property to
* determine how to lay out and draw components.
* <p>
* At construction time, a component's orientation is set to
! * {@code ComponentOrientation.UNKNOWN},
* indicating that it has not been specified
* explicitly. The UNKNOWN orientation behaves the same as
! * {@code ComponentOrientation.LEFT_TO_RIGHT}.
* <p>
* To set the orientation of a single component, use this method.
* To set the orientation of an entire component
* hierarchy, use
* {@link #applyComponentOrientation applyComponentOrientation}.
*** 9010,9021 ****
invalidateIfValid();
}
/**
* Retrieves the language-sensitive orientation that is to be used to order
! * the elements or text within this component. <code>LayoutManager</code>
! * and <code>Component</code>
* subclasses that wish to respect orientation should call this method to
* get the component's orientation before performing layout or drawing.
*
* @return the orientation to order the elements or text
* @see ComponentOrientation
--- 9010,9021 ----
invalidateIfValid();
}
/**
* Retrieves the language-sensitive orientation that is to be used to order
! * the elements or text within this component. {@code LayoutManager}
! * and {@code Component}
* subclasses that wish to respect orientation should call this method to
* get the component's orientation before performing layout or drawing.
*
* @return the orientation to order the elements or text
* @see ComponentOrientation
*** 9025,9044 ****
public ComponentOrientation getComponentOrientation() {
return componentOrientation;
}
/**
! * Sets the <code>ComponentOrientation</code> property of this component
* and all components contained within it.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
*
* @param orientation the new component orientation of this component and
* the components contained within it.
! * @exception NullPointerException if <code>orientation</code> is null.
* @see #setComponentOrientation
* @see #getComponentOrientation
* @see #invalidate
* @since 1.4
*/
--- 9025,9044 ----
public ComponentOrientation getComponentOrientation() {
return componentOrientation;
}
/**
! * Sets the {@code ComponentOrientation} property of this component
* and all components contained within it.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
*
* @param orientation the new component orientation of this component and
* the components contained within it.
! * @exception NullPointerException if {@code orientation} is null.
* @see #setComponentOrientation
* @see #getComponentOrientation
* @see #invalidate
* @since 1.4
*/
*** 9102,9112 ****
ComponentPeer.SET_LOCATION);
}
}
/**
! * Returns the <code>Window</code> ancestor of the component.
* @return Window ancestor of the component or component by itself if it is Window;
* null, if component is not a part of window hierarchy
*/
Window getContainingWindow() {
return SunToolkit.getContainingWindow(this);
--- 9102,9112 ----
ComponentPeer.SET_LOCATION);
}
}
/**
! * Returns the {@code Window} ancestor of the component.
* @return Window ancestor of the component or component by itself if it is Window;
* null, if component is not a part of window hierarchy
*/
Window getContainingWindow() {
return SunToolkit.getContainingWindow(this);
*** 9129,9148 ****
* The {@code AccessibleContext} associated with this {@code Component}.
*/
protected AccessibleContext accessibleContext = null;
/**
! * Gets the <code>AccessibleContext</code> associated
! * with this <code>Component</code>.
* The method implemented by this base
! * class returns null. Classes that extend <code>Component</code>
* should implement this method to return the
! * <code>AccessibleContext</code> associated with the subclass.
*
*
! * @return the <code>AccessibleContext</code> of this
! * <code>Component</code>
* @since 1.3
*/
public AccessibleContext getAccessibleContext() {
return accessibleContext;
}
--- 9129,9148 ----
* The {@code AccessibleContext} associated with this {@code Component}.
*/
protected AccessibleContext accessibleContext = null;
/**
! * Gets the {@code AccessibleContext} associated
! * with this {@code Component}.
* The method implemented by this base
! * class returns null. Classes that extend {@code Component}
* should implement this method to return the
! * {@code AccessibleContext} associated with the subclass.
*
*
! * @return the {@code AccessibleContext} of this
! * {@code Component}
* @since 1.3
*/
public AccessibleContext getAccessibleContext() {
return accessibleContext;
}
*** 9239,9249 ****
}
} // inner class AccessibleAWTFocusHandler
/**
! * Adds a <code>PropertyChangeListener</code> to the listener list.
*
* @param listener the property change listener to be added
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
if (accessibleAWTComponentHandler == null) {
--- 9239,9249 ----
}
} // inner class AccessibleAWTFocusHandler
/**
! * Adds a {@code PropertyChangeListener} to the listener list.
*
* @param listener the property change listener to be added
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
if (accessibleAWTComponentHandler == null) {
*** 9276,9295 ****
// AccessibleContext methods
//
/**
* Gets the accessible name of this object. This should almost never
! * return <code>java.awt.Component.getName()</code>,
* as that generally isn't a localized name,
* and doesn't have meaning for the user. If the
* object is fundamentally a text object (e.g. a menu item), the
* accessible name should be the text of the object (e.g. "save").
* If the object has a tooltip, the tooltip text may also be an
* appropriate String to return.
*
* @return the localized name of the object -- can be
! * <code>null</code> if this
* object does not have a name
* @see javax.accessibility.AccessibleContext#setAccessibleName
*/
public String getAccessibleName() {
return accessibleName;
--- 9276,9295 ----
// AccessibleContext methods
//
/**
* Gets the accessible name of this object. This should almost never
! * return {@code java.awt.Component.getName()},
* as that generally isn't a localized name,
* and doesn't have meaning for the user. If the
* object is fundamentally a text object (e.g. a menu item), the
* accessible name should be the text of the object (e.g. "save").
* If the object has a tooltip, the tooltip text may also be an
* appropriate String to return.
*
* @return the localized name of the object -- can be
! * {@code null} if this
* object does not have a name
* @see javax.accessibility.AccessibleContext#setAccessibleName
*/
public String getAccessibleName() {
return accessibleName;
*** 9305,9351 ****
* had "save" as the tooltip text shouldn't return the tooltip
* text as the description, but something like "Saves the current
* text document" instead).
*
* @return the localized description of the object -- can be
! * <code>null</code> if this object does not have a description
* @see javax.accessibility.AccessibleContext#setAccessibleDescription
*/
public String getAccessibleDescription() {
return accessibleDescription;
}
/**
* Gets the role of this object.
*
! * @return an instance of <code>AccessibleRole</code>
* describing the role of the object
* @see javax.accessibility.AccessibleRole
*/
public AccessibleRole getAccessibleRole() {
return AccessibleRole.AWT_COMPONENT;
}
/**
* Gets the state of this object.
*
! * @return an instance of <code>AccessibleStateSet</code>
* containing the current state set of the object
* @see javax.accessibility.AccessibleState
*/
public AccessibleStateSet getAccessibleStateSet() {
return Component.this.getAccessibleStateSet();
}
/**
! * Gets the <code>Accessible</code> parent of this object.
! * If the parent of this object implements <code>Accessible</code>,
! * this method should simply return <code>getParent</code>.
! *
! * @return the <code>Accessible</code> parent of this
! * object -- can be <code>null</code> if this
! * object does not have an <code>Accessible</code> parent
*/
public Accessible getAccessibleParent() {
if (accessibleParent != null) {
return accessibleParent;
} else {
--- 9305,9351 ----
* had "save" as the tooltip text shouldn't return the tooltip
* text as the description, but something like "Saves the current
* text document" instead).
*
* @return the localized description of the object -- can be
! * {@code null} if this object does not have a description
* @see javax.accessibility.AccessibleContext#setAccessibleDescription
*/
public String getAccessibleDescription() {
return accessibleDescription;
}
/**
* Gets the role of this object.
*
! * @return an instance of {@code AccessibleRole}
* describing the role of the object
* @see javax.accessibility.AccessibleRole
*/
public AccessibleRole getAccessibleRole() {
return AccessibleRole.AWT_COMPONENT;
}
/**
* Gets the state of this object.
*
! * @return an instance of {@code AccessibleStateSet}
* containing the current state set of the object
* @see javax.accessibility.AccessibleState
*/
public AccessibleStateSet getAccessibleStateSet() {
return Component.this.getAccessibleStateSet();
}
/**
! * Gets the {@code Accessible} parent of this object.
! * If the parent of this object implements {@code Accessible},
! * this method should simply return {@code getParent}.
! *
! * @return the {@code Accessible} parent of this
! * object -- can be {@code null} if this
! * object does not have an {@code Accessible} parent
*/
public Accessible getAccessibleParent() {
if (accessibleParent != null) {
return accessibleParent;
} else {
*** 9368,9391 ****
return Component.this.getAccessibleIndexInParent();
}
/**
* Returns the number of accessible children in the object. If all
! * of the children of this object implement <code>Accessible</code>,
* then this method should return the number of children of this object.
*
* @return the number of accessible children in the object
*/
public int getAccessibleChildrenCount() {
return 0; // Components don't have children
}
/**
! * Returns the nth <code>Accessible</code> child of the object.
*
* @param i zero-based index of child
! * @return the nth <code>Accessible</code> child of the object
*/
public Accessible getAccessibleChild(int i) {
return null; // Components don't have children
}
--- 9368,9391 ----
return Component.this.getAccessibleIndexInParent();
}
/**
* Returns the number of accessible children in the object. If all
! * of the children of this object implement {@code Accessible},
* then this method should return the number of children of this object.
*
* @return the number of accessible children in the object
*/
public int getAccessibleChildrenCount() {
return 0; // Components don't have children
}
/**
! * Returns the nth {@code Accessible} child of the object.
*
* @param i zero-based index of child
! * @return the nth {@code Accessible} child of the object
*/
public Accessible getAccessibleChild(int i) {
return null; // Components don't have children
}
*** 9397,9409 ****
public Locale getLocale() {
return Component.this.getLocale();
}
/**
! * Gets the <code>AccessibleComponent</code> associated
* with this object if one exists.
! * Otherwise return <code>null</code>.
*
* @return the component
*/
public AccessibleComponent getAccessibleComponent() {
return this;
--- 9397,9409 ----
public Locale getLocale() {
return Component.this.getLocale();
}
/**
! * Gets the {@code AccessibleComponent} associated
* with this object if one exists.
! * Otherwise return {@code null}.
*
* @return the component
*/
public AccessibleComponent getAccessibleComponent() {
return this;
*** 9414,9506 ****
//
/**
* Gets the background color of this object.
*
* @return the background color, if supported, of the object;
! * otherwise, <code>null</code>
*/
public Color getBackground() {
return Component.this.getBackground();
}
/**
* Sets the background color of this object.
! * (For transparency, see <code>isOpaque</code>.)
*
! * @param c the new <code>Color</code> for the background
* @see Component#isOpaque
*/
public void setBackground(Color c) {
Component.this.setBackground(c);
}
/**
* Gets the foreground color of this object.
*
* @return the foreground color, if supported, of the object;
! * otherwise, <code>null</code>
*/
public Color getForeground() {
return Component.this.getForeground();
}
/**
* Sets the foreground color of this object.
*
! * @param c the new <code>Color</code> for the foreground
*/
public void setForeground(Color c) {
Component.this.setForeground(c);
}
/**
! * Gets the <code>Cursor</code> of this object.
*
! * @return the <code>Cursor</code>, if supported,
! * of the object; otherwise, <code>null</code>
*/
public Cursor getCursor() {
return Component.this.getCursor();
}
/**
! * Sets the <code>Cursor</code> of this object.
* <p>
* The method may have no visual effect if the Java platform
* implementation and/or the native system do not support
* changing the mouse cursor shape.
! * @param cursor the new <code>Cursor</code> for the object
*/
public void setCursor(Cursor cursor) {
Component.this.setCursor(cursor);
}
/**
! * Gets the <code>Font</code> of this object.
*
! * @return the <code>Font</code>, if supported,
! * for the object; otherwise, <code>null</code>
*/
public Font getFont() {
return Component.this.getFont();
}
/**
! * Sets the <code>Font</code> of this object.
*
! * @param f the new <code>Font</code> for the object
*/
public void setFont(Font f) {
Component.this.setFont(f);
}
/**
! * Gets the <code>FontMetrics</code> of this object.
*
! * @param f the <code>Font</code>
! * @return the <code>FontMetrics</code>, if supported,
! * the object; otherwise, <code>null</code>
* @see #getFont
*/
public FontMetrics getFontMetrics(Font f) {
if (f == null) {
return null;
--- 9414,9506 ----
//
/**
* Gets the background color of this object.
*
* @return the background color, if supported, of the object;
! * otherwise, {@code null}
*/
public Color getBackground() {
return Component.this.getBackground();
}
/**
* Sets the background color of this object.
! * (For transparency, see {@code isOpaque}.)
*
! * @param c the new {@code Color} for the background
* @see Component#isOpaque
*/
public void setBackground(Color c) {
Component.this.setBackground(c);
}
/**
* Gets the foreground color of this object.
*
* @return the foreground color, if supported, of the object;
! * otherwise, {@code null}
*/
public Color getForeground() {
return Component.this.getForeground();
}
/**
* Sets the foreground color of this object.
*
! * @param c the new {@code Color} for the foreground
*/
public void setForeground(Color c) {
Component.this.setForeground(c);
}
/**
! * Gets the {@code Cursor} of this object.
*
! * @return the {@code Cursor}, if supported,
! * of the object; otherwise, {@code null}
*/
public Cursor getCursor() {
return Component.this.getCursor();
}
/**
! * Sets the {@code Cursor} of this object.
* <p>
* The method may have no visual effect if the Java platform
* implementation and/or the native system do not support
* changing the mouse cursor shape.
! * @param cursor the new {@code Cursor} for the object
*/
public void setCursor(Cursor cursor) {
Component.this.setCursor(cursor);
}
/**
! * Gets the {@code Font} of this object.
*
! * @return the {@code Font}, if supported,
! * for the object; otherwise, {@code null}
*/
public Font getFont() {
return Component.this.getFont();
}
/**
! * Sets the {@code Font} of this object.
*
! * @param f the new {@code Font} for the object
*/
public void setFont(Font f) {
Component.this.setFont(f);
}
/**
! * Gets the {@code FontMetrics} of this object.
*
! * @param f the {@code Font}
! * @return the {@code FontMetrics}, if supported,
! * the object; otherwise, {@code null}
* @see #getFont
*/
public FontMetrics getFontMetrics(Font f) {
if (f == null) {
return null;
*** 9544,9554 ****
/**
* Determines if the object is visible. Note: this means that the
* object intends to be visible; however, it may not in fact be
* showing on the screen because one of the objects that this object
* is contained by is not visible. To determine if an object is
! * showing on the screen, use <code>isShowing</code>.
*
* @return true if object is visible; otherwise, false
*/
public boolean isVisible() {
return Component.this.isVisible();
--- 9544,9554 ----
/**
* Determines if the object is visible. Note: this means that the
* object intends to be visible; however, it may not in fact be
* showing on the screen because one of the objects that this object
* is contained by is not visible. To determine if an object is
! * showing on the screen, use {@code isShowing}.
*
* @return true if object is visible; otherwise, false
*/
public boolean isVisible() {
return Component.this.isVisible();
*** 9593,9615 ****
/**
* Checks whether the specified point is within this object's bounds,
* where the point's x and y coordinates are defined to be relative to
* the coordinate system of the object.
*
! * @param p the <code>Point</code> relative to the
* coordinate system of the object
! * @return true if object contains <code>Point</code>; otherwise false
*/
public boolean contains(Point p) {
return Component.this.contains(p);
}
/**
* Returns the location of the object on the screen.
*
* @return location of object on screen -- can be
! * <code>null</code> if this object is not on the screen
*/
public Point getLocationOnScreen() {
synchronized (Component.this.getTreeLock()) {
if (Component.this.isShowing()) {
return Component.this.getLocationOnScreen();
--- 9593,9615 ----
/**
* Checks whether the specified point is within this object's bounds,
* where the point's x and y coordinates are defined to be relative to
* the coordinate system of the object.
*
! * @param p the {@code Point} relative to the
* coordinate system of the object
! * @return true if object contains {@code Point}; otherwise false
*/
public boolean contains(Point p) {
return Component.this.contains(p);
}
/**
* Returns the location of the object on the screen.
*
* @return location of object on screen -- can be
! * {@code null} if this object is not on the screen
*/
public Point getLocationOnScreen() {
synchronized (Component.this.getTreeLock()) {
if (Component.this.isShowing()) {
return Component.this.getLocationOnScreen();
*** 9624,9634 ****
* of a point specifying the object's top-left corner in the screen's
* coordinate space.
*
* @return an instance of Point representing the top-left corner of
* the object's bounds in the coordinate space of the screen;
! * <code>null</code> if this object or its parent are not on the screen
*/
public Point getLocation() {
return Component.this.getLocation();
}
--- 9624,9634 ----
* of a point specifying the object's top-left corner in the screen's
* coordinate space.
*
* @return an instance of Point representing the top-left corner of
* the object's bounds in the coordinate space of the screen;
! * {@code null} if this object or its parent are not on the screen
*/
public Point getLocation() {
return Component.this.getLocation();
}
*** 9644,9662 ****
* Gets the bounds of this object in the form of a Rectangle object.
* The bounds specify this object's width, height, and location
* relative to its parent.
*
* @return a rectangle indicating this component's bounds;
! * <code>null</code> if this object is not on the screen
*/
public Rectangle getBounds() {
return Component.this.getBounds();
}
/**
* Sets the bounds of this object in the form of a
! * <code>Rectangle</code> object.
* The bounds specify this object's width, height, and location
* relative to its parent.
*
* @param r a rectangle indicating this component's bounds
*/
--- 9644,9662 ----
* Gets the bounds of this object in the form of a Rectangle object.
* The bounds specify this object's width, height, and location
* relative to its parent.
*
* @return a rectangle indicating this component's bounds;
! * {@code null} if this object is not on the screen
*/
public Rectangle getBounds() {
return Component.this.getBounds();
}
/**
* Sets the bounds of this object in the form of a
! * {@code Rectangle} object.
* The bounds specify this object's width, height, and location
* relative to its parent.
*
* @param r a rectangle indicating this component's bounds
*/
*** 9664,9680 ****
Component.this.setBounds(r);
}
/**
* Returns the size of this object in the form of a
! * <code>Dimension</code> object. The height field of the
! * <code>Dimension</code> object contains this object's
! * height, and the width field of the <code>Dimension</code>
* object contains this object's width.
*
! * @return a <code>Dimension</code> object that indicates
! * the size of this component; <code>null</code> if
* this object is not on the screen
*/
public Dimension getSize() {
return Component.this.getSize();
}
--- 9664,9680 ----
Component.this.setBounds(r);
}
/**
* Returns the size of this object in the form of a
! * {@code Dimension} object. The height field of the
! * {@code Dimension} object contains this object's
! * height, and the width field of the {@code Dimension}
* object contains this object's width.
*
! * @return a {@code Dimension} object that indicates
! * the size of this component; {@code null} if
* this object is not on the screen
*/
public Dimension getSize() {
return Component.this.getSize();
}
*** 9687,9706 ****
public void setSize(Dimension d) {
Component.this.setSize(d);
}
/**
! * Returns the <code>Accessible</code> child,
* if one exists, contained at the local
! * coordinate <code>Point</code>. Otherwise returns
! * <code>null</code>.
*
* @param p the point defining the top-left corner of
! * the <code>Accessible</code>, given in the
* coordinate space of the object's parent
! * @return the <code>Accessible</code>, if it exists,
! * at the specified location; else <code>null</code>
*/
public Accessible getAccessibleAt(Point p) {
return null; // Components don't have children
}
--- 9687,9706 ----
public void setSize(Dimension d) {
Component.this.setSize(d);
}
/**
! * Returns the {@code Accessible} child,
* if one exists, contained at the local
! * coordinate {@code Point}. Otherwise returns
! * {@code null}.
*
* @param p the point defining the top-left corner of
! * the {@code Accessible}, given in the
* coordinate space of the object's parent
! * @return the {@code Accessible}, if it exists,
! * at the specified location; else {@code null}
*/
public Accessible getAccessibleAt(Point p) {
return null; // Components don't have children
}
*** 9770,9780 ****
}
/**
* Gets the current state set of this object.
*
! * @return an instance of <code>AccessibleStateSet</code>
* containing the current state set of the object
* @see AccessibleState
*/
AccessibleStateSet getAccessibleStateSet() {
synchronized (getTreeLock()) {
--- 9770,9780 ----
}
/**
* Gets the current state set of this object.
*
! * @return an instance of {@code AccessibleStateSet}
* containing the current state set of the object
* @see AccessibleState
*/
AccessibleStateSet getAccessibleStateSet() {
synchronized (getTreeLock()) {
< prev index next >