3909N/A * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A <em>component</em> is an object having a graphical representation 0N/A * that can be displayed on the screen and that can interact with the 0N/A * user. Examples of components are the buttons, checkboxes, and scrollbars 0N/A * of a typical graphical user interface. <p> 0N/A * The <code>Component</code> class is the abstract superclass of 0N/A * the nonmenu-related Abstract Window Toolkit components. Class 0N/A * <code>Component</code> can also be extended directly to create a 0N/A * lightweight component. A lightweight component is a component that is 1724N/A * not associated with a native window. On the contrary, a heavyweight 1724N/A * component is associated with a native window. The {@link #isLightweight()} 1724N/A * method may be used to distinguish between the two kinds of the components. 1724N/A * Lightweight and heavyweight components may be mixed in a single component 1724N/A * hierarchy. However, for correct operating of such a mixed hierarchy of 1724N/A * components, the whole hierarchy must be valid. When the hierarchy gets 1724N/A * invalidated, like after changing the bounds of components, or 1724N/A * validated afterwards by means of the {@link Container#validate()} method 1724N/A * invoked on the top-most invalid container of the hierarchy. 0N/A * <h3>Serialization</h3> 0N/A * It is important to note that only AWT listeners which conform 0N/A * to the <code>Serializable</code> protocol will be saved when 0N/A * the object is stored. If an AWT object has listeners that 0N/A * aren't marked serializable, they will be dropped at 0N/A * <code>writeObject</code> time. Developers will need, as always, 0N/A * to consider the implications of making an object serializable. 0N/A * One situation to watch out for is this: 0N/A * import java.awt.*; 0N/A * import java.awt.event.*; 0N/A * import java.io.Serializable; 0N/A * class MyApp implements ActionListener, Serializable 0N/A * BigObjectThatShouldNotBeSerializedWithAButton bigOne; 0N/A * Button aButton = new Button(); 0N/A * // Oops, now aButton has a listener with a reference 0N/A * aButton.addActionListener(this); 0N/A * public void actionPerformed(ActionEvent e) 0N/A * System.out.println("Hello There"); 0N/A * In this example, serializing <code>aButton</code> by itself 0N/A * will cause <code>MyApp</code> and everything it refers to 0N/A * to be serialized as well. The problem is that the listener 0N/A * is serializable by coincidence, not by design. To separate 0N/A * the decisions about <code>MyApp</code> and the 0N/A * <code>ActionListener</code> being serializable one can use a 0N/A * nested class, as in the following example: 0N/A * import java.awt.*; 0N/A * import java.awt.event.*; 0N/A * import java.io.Serializable; 5312N/A * class MyApp implements java.io.Serializable 0N/A * BigObjectThatShouldNotBeSerializedWithAButton bigOne; 0N/A * Button aButton = new Button(); 0N/A * static class MyActionListener implements ActionListener 0N/A * public void actionPerformed(ActionEvent e) 0N/A * System.out.println("Hello There"); 0N/A * aButton.addActionListener(new MyActionListener()); 0N/A * <b>Note</b>: For more information on the paint mechanisms utilitized 0N/A * by AWT and Swing, including information on how to write the most 0N/A * efficient painting code, see 0N/A * For details on the focus subsystem, see 0N/A * How to Use the Focus Subsystem</a>, 0N/A * a section in <em>The Java Tutorial</em>, and the 0N/A * for more information. 0N/A * @author Arthur van Hoff 0N/A * @author Sami Shaio 0N/A * The peer of the component. The peer implements the component's 0N/A * behavior. The peer is set when the <code>Component</code> is 0N/A * added to a container that also is a peer. 0N/A * @see #removeNotify 0N/A * The parent of the object. It may be <code>null</code> 0N/A * for top-level components. 0N/A * change the AppContext. 0N/A * The x position of the component in the parent's coordinate system. 0N/A * The y position of the component in the parent's coordinate system. 0N/A * The width of the component. 0N/A * The height of the component. 0N/A * The foreground color for this component. 0N/A * <code>foreground</code> can be <code>null</code>. 0N/A * @see #getForeground 0N/A * @see #setForeground 0N/A * The background color for this component. 0N/A * <code>background</code> can be <code>null</code>. 0N/A * @see #getBackground 0N/A * @see #setBackground 0N/A * The font used by this component. 0N/A * The <code>font</code> can be <code>null</code>. 0N/A * The font which the peer is currently using. 0N/A * (<code>null</code> if no peer exists.) 0N/A * The cursor displayed when pointer is over this component. 0N/A * This value can be <code>null</code>. 0N/A * The locale for the component. 0N/A * A reference to a <code>GraphicsConfiguration</code> object 0N/A * used to describe the characteristics of a graphics 0N/A * This value can be <code>null</code>. 0N/A * @see GraphicsConfiguration 0N/A * @see #getGraphicsConfiguration 0N/A * A reference to a <code>BufferStrategy</code> object 0N/A * used to manipulate the buffers on this component. 0N/A * @see java.awt.image.BufferStrategy 0N/A * @see #getBufferStrategy() 0N/A * True when the object should ignore all repaint events. 0N/A * @see #setIgnoreRepaint 0N/A * @see #getIgnoreRepaint 0N/A * True when the object is visible. An object that is not 0N/A * visible is not drawn on the screen. 0N/A * True when the object is enabled. An object that is not 0N/A * enabled does not interact with the user. 0N/A * True when the object is valid. An invalid object needs to 0N/A * be layed out. This flag is set to false when the object 0N/A * The <code>DropTarget</code> associated with this component. 0N/A * @see #setDropTarget 0N/A * @see #getDropTarget 0N/A * A component's name. 0N/A * This field can be <code>null</code>. 0N/A * @see #setName(String) 0N/A * A bool to determine whether the name has 0N/A * been set explicitly. <code>nameExplicitlySet</code> will 0N/A * be false if the name has not been set and 0N/A * @see #setName(String) 0N/A * Indicates whether this Component can be focused. 0N/A * @see #setFocusable 0N/A * Tracks whether this Component is relying on default focus travesability. 0N/A * The focus traversal keys. These keys will generate focus traversal 0N/A * behavior for Components for which focus traversal keys are enabled. If a 0N/A * value of null is specified for a traversal key, this Component inherits 0N/A * that traversal key from its parent. If all ancestors of this Component 0N/A * have null specified for that traversal key, then the current 0N/A * KeyboardFocusManager's default traversal key is used. 0N/A * @see #setFocusTraversalKeys 0N/A * @see #getFocusTraversalKeys 0N/A "forwardFocusTraversalKeys",
0N/A "backwardFocusTraversalKeys",
0N/A "upCycleFocusTraversalKeys",
0N/A "downCycleFocusTraversalKeys" 0N/A * Indicates whether focus traversal keys are enabled for this Component. 0N/A * Components for which focus traversal keys are disabled receive key 0N/A * events for focus traversal keys. Components for which focus traversal 0N/A * keys are enabled do not see these events; instead, the events are 0N/A * automatically converted to traversal operations. 0N/A * @see #setFocusTraversalKeysEnabled 0N/A * @see #getFocusTraversalKeysEnabled 0N/A * The locking object for AWT component-tree and layout operations. 3787N/A * The component's AccessControlContext. 0N/A * (This field perhaps should have been transient). 0N/A * Whether or not setMinimumSize has been invoked with a non-null value. 0N/A * (This field perhaps should have been transient). 0N/A * Whether or not setPreferredSize has been invoked with a non-null value. 0N/A * Whether or not setMaximumSize has been invoked with a non-null value. 0N/A * The orientation for this component. 0N/A * @see #getComponentOrientation 0N/A * @see #setComponentOrientation 0N/A * <code>newEventsOnly</code> will be true if the event is 0N/A * one of the event types enabled for the component. 0N/A * It will then allow for normal processing to 0N/A * continue. If it is false the event is passed 0N/A * to the component's parent and up the ancestor 0N/A * tree until the event has been consumed. 0N/A * @see #dispatchEvent 0N/A /** Internal, constants for serialization */ 0N/A * The <code>eventMask</code> is ONLY set by subclasses via 0N/A * <code>enableEvents</code>. 0N/A * The mask should NOT be set when listeners are registered 0N/A * so that we can distinguish the difference between when 0N/A * listeners request events and subclasses request them. 0N/A * One bit is used to indicate whether input methods are 0N/A * enabled; this bit is set by <code>enableInputMethods</code> and is 0N/A * @see #enableInputMethods 0N/A * Static properties for incremental drawing. 0N/A /* ensure that the necessary native libraries are loaded */ 0N/A /* initialize JNI field and method ids */ 0N/A * Ease-of-use constant for <code>getAlignmentY()</code>. 0N/A * Specifies an alignment to the top of the component. 0N/A * @see #getAlignmentY 0N/A * Ease-of-use constant for <code>getAlignmentY</code> and 0N/A * <code>getAlignmentX</code>. Specifies an alignment to 0N/A * the center of the component 0N/A * @see #getAlignmentX 0N/A * @see #getAlignmentY 0N/A * Ease-of-use constant for <code>getAlignmentY</code>. 0N/A * Specifies an alignment to the bottom of the component. 0N/A * @see #getAlignmentY 0N/A * Ease-of-use constant for <code>getAlignmentX</code>. 0N/A * Specifies an alignment to the left side of the component. 0N/A * @see #getAlignmentX 0N/A * Ease-of-use constant for <code>getAlignmentX</code>. 0N/A * Specifies an alignment to the right side of the component. 0N/A * @see #getAlignmentX 0N/A * JDK 1.1 serialVersionUID 0N/A * If any <code>PropertyChangeListeners</code> have been registered, 0N/A * the <code>changeSupport</code> field describes them. 0N/A * @see #addPropertyChangeListener 0N/A * @see #removePropertyChangeListener 0N/A * @see #firePropertyChange 541N/A * In some cases using "this" as an object to synchronize by 541N/A * can lead to a deadlock if client code also uses synchronization 541N/A * by a component object. For every such situation revealed we should 541N/A * consider possibility of replacing "this" with the package private 4518N/A * objectLock object introduced below. So far there're 3 issues known: 4518N/A * - CR 6608764 (the PropertyChangeListener machinery); 541N/A * Note: this field is considered final, though readObject() prohibits 541N/A * initializing final fields. 3787N/A * Returns the acc this component was constructed with. 0N/A * Pseudoparameter for direct Geometry API (setLocation, setBounds setSize 0N/A * to signal setBounds what's changing. Should be used under TreeLock. 0N/A * This is only needed due to the inability to change the cross-calling 0N/A * order of public and deprecated methods. 0N/A * Enumeration of the common ways the baseline of a component can 0N/A * change as the size changes. The baseline resize behavior is 0N/A * primarily for layout managers that need to know how the 0N/A * position of the baseline changes as the component size changes. 0N/A * In general the baseline resize behavior will be valid for sizes 0N/A * greater than or equal to the minimum size (the actual minimum 0N/A * size; not a developer specified minimum size). For sizes 0N/A * smaller than the minimum size the baseline may change in a way 0N/A * other than the baseline resize behavior indicates. Similarly, 0N/A * as the size approaches <code>Integer.MAX_VALUE</code> and/or 0N/A * <code>Short.MAX_VALUE</code> the baseline may change in a way 0N/A * other than the baseline resize behavior indicates. 0N/A * @see #getBaselineResizeBehavior 0N/A * @see #getBaseline(int,int) 0N/A * Indicates the baseline remains fixed relative to the 0N/A * y-origin. That is, <code>getBaseline</code> returns 0N/A * the same value regardless of the height or width. For example, a 0N/A * <code>JLabel</code> containing non-empty text with a 0N/A * vertical alignment of <code>TOP</code> should have a 0N/A * baseline type of <code>CONSTANT_ASCENT</code>. 0N/A * Indicates the baseline remains fixed relative to the height 0N/A * and does not change as the width is varied. That is, for 0N/A * any height H the difference between H and 0N/A * <code>getBaseline(w, H)</code> is the same. For example, a 0N/A * <code>JLabel</code> containing non-empty text with a 0N/A * vertical alignment of <code>BOTTOM</code> should have a 0N/A * baseline type of <code>CONSTANT_DESCENT</code>. 0N/A * Indicates the baseline remains a fixed distance from 0N/A * the center of the component. That is, for any height H the 0N/A * difference between <code>getBaseline(w, H)</code> and 0N/A * <code>H / 2</code> is the same (plus or minus one depending upon 0N/A * Because of possible rounding errors it is recommended 0N/A * you ask for the baseline with two consecutive heights and use 0N/A * the return value to determine if you need to pad calculations 0N/A * by 1. The following shows how to calculate the baseline for 0N/A * Dimension preferredSize = component.getPreferredSize(); 0N/A * int baseline = getBaseline(preferredSize.width, 0N/A * preferredSize.height); 0N/A * int nextBaseline = getBaseline(preferredSize.width, 0N/A * preferredSize.height + 1); 0N/A * // Amount to add to height when calculating where baseline 0N/A * // lands for a particular height: 0N/A * // Where the baseline is relative to the mid point 0N/A * int baselineOffset = baseline - height / 2; 0N/A * if (preferredSize.height % 2 == 0 && 0N/A * baseline != nextBaseline) { 0N/A * else if (preferredSize.height % 2 == 1 && 0N/A * baseline == nextBaseline) { 0N/A * // The following calculates where the baseline lands for 0N/A * int calculatedBaseline = (z + padding) / 2 + baselineOffset; 0N/A * Indicates the baseline resize behavior can not be expressed using 0N/A * any of the other constants. This may also indicate the baseline 0N/A * varies with the width of the component. This is also returned 0N/A * by components that do not have a baseline. 0N/A * The shape set with the applyCompoundShape() method. It uncludes the result 0N/A * of the HW/LW mixing related shape computation. It may also include 0N/A * the user-specified shape of the component. 886N/A * The 'null' value means the component has normal shape (or has no shape at all) 886N/A * and applyCompoundShape() will skip the following shape identical to normal. 886N/A * Represents the shape of this lightweight component to be cut out from 886N/A * heavyweight components should they intersect. Possible values: 886N/A * 1. null - consider the shape rectangular 886N/A * 2. EMPTY_REGION - nothing gets cut out (children still get cut out) 886N/A * 3. non-empty - this shape gets cut out. 0N/A * Indicates whether addNotify() is complete 0N/A * (i.e. the peer is created). 0N/A * Should only be used in subclass getBounds to check that part of bounds 0N/A * is actualy changing 1045N/A // Whether this Component has had the background erase flag 1045N/A // specified via SunToolkit.disableBackgroundErase(). This is 1045N/A // needed in order to make this function work on X11 platforms, 1045N/A // where currently there is no chance to interpose on the creation 1045N/A // of the peer and therefore the call to XSetBackground. 0N/A * Constructs a new component. Class <code>Component</code> can be 0N/A * extended directly to create a lightweight component that does not 0N/A * utilize an opaque native window. A lightweight component must be 0N/A * hosted by a native container somewhere higher up in the component 0N/A * tree (for example, by a <code>Frame</code> object). 0N/A * Constructs a name for this component. Called by <code>getName</code> 0N/A * when the name is <code>null</code>. 0N/A return null;
// For strict compliance with prior platform versions, a Component 0N/A // that doesn't set its name should return null from 0N/A * Gets the name of the component. 0N/A * @return this component's name 0N/A * Sets the name of the component to the specified string. 0N/A * @param name the string that is to be this 0N/A * Gets the parent of this component. 0N/A * @return the parent container of this component 0N/A // NOTE: This method may be called by privileged threads. 0N/A // This functionality is implemented in a package-private method 0N/A // to insure that it cannot be overridden by client subclasses. 0N/A // DO NOT INVOKE CLIENT CODE ON THIS THREAD! 0N/A // This method is overriden in the Window class to return null, 0N/A // because the parent field of the Window object contains 0N/A // the owner of the window, not its parent. 0N/A * @deprecated As of JDK version 1.1, 0N/A * programs should not directly manipulate peers; 0N/A * replaced by <code>boolean isDisplayable()</code>. 0N/A * Associate a <code>DropTarget</code> with this component. 0N/A * The <code>Component</code> will receive drops only if it 0N/A * @param dt The DropTarget 0N/A // if we have a new one, and we have a peer, add it! 0N/A * Gets the <code>DropTarget</code> associated with this 0N/A * <code>Component</code>. 0N/A * Gets the <code>GraphicsConfiguration</code> associated with this 0N/A * <code>Component</code>. 0N/A * If the <code>Component</code> has not been assigned a specific 0N/A * <code>GraphicsConfiguration</code>, 0N/A * the <code>GraphicsConfiguration</code> of the 0N/A * <code>Component</code> object's top-level container is 0N/A * If the <code>Component</code> has been created, but not yet added 0N/A * to a <code>Container</code>, this method returns <code>null</code>. 0N/A * @return the <code>GraphicsConfiguration</code> used by this 0N/A * <code>Component</code> or <code>null</code> 0N/A * Checks that this component's <code>GraphicsDevice</code> 0N/A * <code>idString</code> matches the string argument. 0N/A "adding a container to a container on a different GraphicsDevice");
0N/A * Gets this component's locking object (the object that owns the thread 212N/A * synchronization monitor) for AWT component-tree and layout 0N/A * @return this component's locking object 0N/A * Gets the toolkit of this component. Note that 0N/A * the frame that contains a component controls which 0N/A * toolkit is used by that component. Therefore if the component 0N/A * is moved from one frame to another, the toolkit it uses may change. 0N/A * @return the toolkit of this component 0N/A * This is called by the native code, so client code can't 0N/A * be called on the toolkit thread. 0N/A * Determines whether this component is valid. A component is valid 0N/A * when it is correctly sized and positioned within its parent 0N/A * container and all its children are also valid. 0N/A * In order to account for peers' size requirements, components are invalidated 0N/A * before they are first shown on the screen. By the time the parent container 0N/A * is fully realized, all its components will be valid. 0N/A * @return <code>true</code> if the component is valid, <code>false</code> 0N/A * Determines whether this component is displayable. A component is 0N/A * displayable when it is connected to a native screen resource. 0N/A * A component is made displayable either when it is added to 0N/A * a displayable containment hierarchy or when its containment 0N/A * hierarchy is made displayable. 0N/A * A containment hierarchy is made displayable when its ancestor 0N/A * window is either packed or made visible. 0N/A * A component is made undisplayable either when it is removed from 0N/A * a displayable containment hierarchy or when its containment hierarchy 0N/A * is made undisplayable. A containment hierarchy is made 0N/A * undisplayable when its ancestor window is disposed. 0N/A * @return <code>true</code> if the component is displayable, 0N/A * <code>false</code> otherwise 0N/A * @see Container#add(Component) 0N/A * @see Container#remove(Component) 0N/A * @see Window#dispose 0N/A * Determines whether this component should be visible when its 0N/A * parent is visible. Components are 0N/A * initially visible, with the exception of top level components such 0N/A * as <code>Frame</code> objects. 0N/A * @return <code>true</code> if the component is visible, 0N/A * <code>false</code> otherwise 0N/A * Determines whether this component will be displayed on the screen. 0N/A * @return <code>true</code> if the component and all of its ancestors 0N/A * until a toplevel window or null parent are visible, 0N/A * <code>false</code> otherwise 0N/A * Translates absolute coordinates into coordinates in the coordinate 0N/A * space of this component. 0N/A * Assuming that mouse location is stored in PointerInfo passed 0N/A * to this method, it finds a Component that is in the same 0N/A * Window as this Component and is located under the mouse pointer. 0N/A * If no such Component exists, null is returned. 0N/A * NOTE: this method should be called under the protection of 0N/A * tree lock, as it is done in Component.getMousePosition() and 0N/A * Container.getMousePosition(boolean). 0N/A * Returns the position of the mouse pointer in this <code>Component</code>'s 0N/A * coordinate space if the <code>Component</code> is directly under the mouse 0N/A * pointer, otherwise returns <code>null</code>. 0N/A * If the <code>Component</code> is not showing on the screen, this method 0N/A * returns <code>null</code> even if the mouse pointer is above the area 0N/A * where the <code>Component</code> would be displayed. 0N/A * If the <code>Component</code> is partially or fully obscured by other 0N/A * <code>Component</code>s or native windows, this method returns a non-null 0N/A * value only if the mouse pointer is located above the unobscured part of the 0N/A * <code>Component</code>. 0N/A * For <code>Container</code>s it returns a non-null value if the mouse is 0N/A * above the <code>Container</code> itself or above any of its descendants. 0N/A * Use {@link Container#getMousePosition(boolean)} if you need to exclude children. 0N/A * Sometimes the exact mouse coordinates are not important, and the only thing 0N/A * that matters is whether a specific <code>Component</code> is under the mouse 0N/A * pointer. If the return value of this method is <code>null</code>, mouse 0N/A * pointer is not directly above the <code>Component</code>. 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true 0N/A * @see Container#getMousePosition 0N/A * @return mouse coordinates relative to this <code>Component</code>, or null 0N/A * Overridden in Container. Must be called under TreeLock. 0N/A * Determines whether this component is showing on screen. This means 0N/A * that the component must be visible, and it must be in a container 0N/A * that is visible and showing. 0N/A * <strong>Note:</strong> sometimes there is no way to detect whether the 0N/A * {@code Component} is actually visible to the user. This can happen when: 0N/A * <li>the component has been added to a visible {@code ScrollPane} but 0N/A * the {@code Component} is not currently in the scroll pane's view port. 0N/A * <li>the {@code Component} is obscured by another {@code Component} or 0N/A * {@code Container}. 0N/A * @return <code>true</code> if the component is showing, 0N/A * <code>false</code> otherwise 0N/A * Determines whether this component is enabled. An enabled component 0N/A * can respond to user input and generate events. Components are 0N/A * enabled initially by default. A component may be enabled or disabled by 0N/A * calling its <code>setEnabled</code> method. 0N/A * @return <code>true</code> if the component is enabled, 0N/A * <code>false</code> otherwise 0N/A * This is called by the native code, so client code can't 0N/A * be called on the toolkit thread. 0N/A * Enables or disables this component, depending on the value of the 0N/A * parameter <code>b</code>. An enabled component can respond to user 0N/A * input and generate events. Components are enabled initially by default. 0N/A * <p>Note: Disabling a lightweight component does not prevent it from 0N/A * receiving MouseEvents. 0N/A * <p>Note: Disabling a heavyweight container prevents all components 0N/A * in this container from receiving any input events. But disabling a 0N/A * lightweight container affects only this container. 0N/A * @param b If <code>true</code>, this component is 0N/A * enabled; otherwise this component is disabled 0N/A * @see #isLightweight 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setEnabled(boolean)</code>. 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setEnabled(boolean)</code>. 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setEnabled(boolean)</code>. 218N/A // A disabled lw container is allowed to contain a focus owner. 0N/A // Don't clear the global focus owner. If transferFocus 0N/A // fails, we want the focus to stay on the disabled 0N/A // Component so that keyboard traversal, et. al. still 0N/A // makes sense to the user. 0N/A * Returns true if this component is painted to an offscreen image 0N/A * ("buffer") that's copied to the screen later. Component 0N/A * subclasses that support double buffering should override this 0N/A * method to return true if double buffering is enabled. 0N/A * @return false by default 0N/A * Enables or disables input method support for this component. If input 0N/A * method support is enabled and the component also processes key events, 0N/A * incoming events are offered to 0N/A * the current input method and will only be processed by the component or 0N/A * dispatched to its listeners if the input method does not consume them. 0N/A * By default, input method support is enabled. 0N/A * @param enable true to enable, false to disable 0N/A * @see #processKeyEvent 0N/A // If this component already has focus, then activate the 0N/A // input method by dispatching a synthesized focus gained 0N/A * Shows or hides this component depending on the value of parameter 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param b if <code>true</code>, shows this component; 0N/A * otherwise, hides this component 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setVisible(boolean)</code>. 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setVisible(boolean)</code>. 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setVisible(boolean)</code>. 0N/A * Gets the foreground color of this component. 0N/A * @return this component's foreground color; if this component does 0N/A * not have a foreground color, the foreground color of its parent 0N/A * @see #setForeground 0N/A * Sets the foreground color of this component. 0N/A * @param c the color to become this component's 0N/A * foreground color; if this parameter is <code>null</code> 0N/A * then this component will inherit 0N/A * the foreground color of its parent 0N/A * @see #getForeground 0N/A // This is a bound property, so report the change to 0N/A // any registered listeners. (Cheap if there are none.) 0N/A * Returns whether the foreground color has been explicitly set for this 0N/A * Component. If this method returns <code>false</code>, this Component is 0N/A * inheriting its foreground color from an ancestor. 0N/A * @return <code>true</code> if the foreground color has been explicitly 0N/A * set for this Component; <code>false</code> otherwise. 0N/A * Gets the background color of this component. 0N/A * @return this component's background color; if this component does 0N/A * not have a background color, 0N/A * the background color of its parent is returned 0N/A * @see #setBackground 0N/A * Sets the background color of this component. 0N/A * The background color affects each component differently and the 0N/A * parts of the component that are affected by the background color 0N/A * may differ between operating systems. 0N/A * @param c the color to become this component's color; 0N/A * if this parameter is <code>null</code>, then this 0N/A * component will inherit the background color of its parent 0N/A * @see #getBackground 0N/A // This is a bound property, so report the change to 0N/A // any registered listeners. (Cheap if there are none.) 0N/A * Returns whether the background color has been explicitly set for this 0N/A * Component. If this method returns <code>false</code>, this Component is 0N/A * inheriting its background color from an ancestor. 0N/A * @return <code>true</code> if the background color has been explicitly 0N/A * set for this Component; <code>false</code> otherwise. 0N/A * Gets the font of this component. 0N/A * @return this component's font; if a font has not been set 0N/A * for this component, the font of its parent is returned 0N/A // NOTE: This method may be called by privileged threads. 0N/A // This functionality is implemented in a package-private method 0N/A // to insure that it cannot be overridden by client subclasses. 0N/A // DO NOT INVOKE CLIENT CODE ON THIS THREAD! 0N/A * Sets the font of this component. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param f the font to become this component's font; 0N/A * if this parameter is <code>null</code> then this 0N/A * component will inherit the font of its parent 0N/A synchronized (
this) {
0N/A // This is a bound property, so report the change to 0N/A // any registered listeners. (Cheap if there are none.) 0N/A // This could change the preferred size of the Component. 0N/A // Fix for 6213660. Should compare old and new fonts and do not 0N/A // call invalidate() if they are equal. 0N/A * Returns whether the font has been explicitly set for this Component. If 0N/A * this method returns <code>false</code>, this Component is inheriting its 0N/A * font from an ancestor. 0N/A * @return <code>true</code> if the font has been explicitly set for this 0N/A * Component; <code>false</code> otherwise. 0N/A * Gets the locale of this component. 0N/A * @return this component's locale; if this component does not 0N/A * have a locale, the locale of its parent is returned 0N/A * @exception IllegalComponentStateException if the <code>Component</code> 0N/A * does not have its own locale and has not yet been added to 0N/A * a containment hierarchy such that the locale can be determined 0N/A * from the containing parent 0N/A * Sets the locale of this component. This is a bound property. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param l the locale to become this component's locale 0N/A // This is a bound property, so report the change to 0N/A // any registered listeners. (Cheap if there are none.) 0N/A // This could change the preferred size of the Component. 0N/A * Gets the instance of <code>ColorModel</code> used to display 0N/A * the component on the output device. 0N/A * @return the color model used by this component 0N/A * @see java.awt.image.ColorModel 0N/A * @see java.awt.peer.ComponentPeer#getColorModel() 0N/A * @see Toolkit#getColorModel() 0N/A * Gets the location of this component in the form of a 0N/A * point specifying the component's top-left corner. 0N/A * The location will be relative to the parent's coordinate space. 0N/A * Due to the asynchronous nature of native event handling, this 0N/A * method can return outdated values (for instance, after several calls 0N/A * of <code>setLocation()</code> in rapid succession). For this 0N/A * reason, the recommended method of obtaining a component's position is 0N/A * within <code>java.awt.event.ComponentListener.componentMoved()</code>, 0N/A * which is called after the operating system has finished moving the 0N/A * @return an instance of <code>Point</code> representing 0N/A * the top-left corner of the component's bounds in 0N/A * the coordinate space of the component's parent 0N/A * @see #getLocationOnScreen 0N/A * Gets the location of this component in the form of a point 0N/A * specifying the component's top-left corner in the screen's 0N/A * @return an instance of <code>Point</code> representing 0N/A * the top-left corner of the component's bounds in the 0N/A * coordinate space of the screen 0N/A * @throws <code>IllegalComponentStateException</code> if the 0N/A * component is not showing on the screen 0N/A * a package private version of getLocationOnScreen 0N/A * used by GlobalCursormanager to update cursor 0N/A // lightweight component location needs to be translated 0N/A // relative to a native component. 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getLocation()</code>. 0N/A * Moves this component to a new location. The top-left corner of 0N/A * the new location is specified by the <code>x</code> and <code>y</code> 0N/A * parameters in the coordinate space of this component's parent. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param x the <i>x</i>-coordinate of the new location's 0N/A * top-left corner in the parent's coordinate space 0N/A * @param y the <i>y</i>-coordinate of the new location's 0N/A * top-left corner in the parent's coordinate space 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setLocation(int, int)</code>. 0N/A * Moves this component to a new location. The top-left corner of 0N/A * the new location is specified by point <code>p</code>. Point 0N/A * <code>p</code> is given in the parent's coordinate space. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param p the point defining the top-left corner 0N/A * of the new location, given in the coordinate space of this 0N/A * component's parent 0N/A * Returns the size of this component in the form of a 0N/A * <code>Dimension</code> object. The <code>height</code> 0N/A * field of the <code>Dimension</code> object contains 0N/A * this component's height, and the <code>width</code> 0N/A * field of the <code>Dimension</code> object contains 0N/A * this component's width. 0N/A * @return a <code>Dimension</code> object that indicates the 0N/A * size of this component 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getSize()</code>. 0N/A * Resizes this component so that it has width <code>width</code> 0N/A * and height <code>height</code>. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param width the new width of this component in pixels 0N/A * @param height the new height of this component in pixels 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setSize(int, int)</code>. 0N/A * Resizes this component so that it has width <code>d.width</code> 0N/A * and height <code>d.height</code>. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param d the dimension specifying the new size 3025N/A * @throws NullPointerException if {@code d} is {@code null} 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setSize(Dimension)</code>. 0N/A * Gets the bounds of this component in the form of a 0N/A * <code>Rectangle</code> object. The bounds specify this 0N/A * component's width, height, and location relative to 0N/A * @return a rectangle indicating this component's bounds 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getBounds()</code>. 0N/A * Moves and resizes this component. The new location of the top-left 0N/A * corner is specified by <code>x</code> and <code>y</code>, and the 0N/A * new size is specified by <code>width</code> and <code>height</code>. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param x the new <i>x</i>-coordinate of this component 0N/A * @param y the new <i>y</i>-coordinate of this component 0N/A * @param width the new <code>width</code> of this component 0N/A * @param height the new <code>height</code> of this 0N/A * @see #setLocation(int, int) 0N/A * @see #setLocation(Point) 0N/A * @see #setSize(int, int) 0N/A * @see #setSize(Dimension) 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setBounds(int, int, int, int)</code>. 0N/A boolean moved = (
this.x != x) || (
this.y != y);
0N/A // LightwightPeer is an empty stub so can skip peer.reshape 0N/A // Check peer actualy changed coordinates 0N/A // fix for 5025858: do not send ComponentEvents for toplevel 0N/A // windows here as it is done from peer or native code when 0N/A // the window is really resized or moved, otherwise some 0N/A // events may be sent twice 0N/A // Have the parent redraw the area this component occupied. 0N/A // Have the parent redraw the area this component *now* occupies. 0N/A // native peer might be offset by more than direct 0N/A // parent since parent might be lightweight. 0N/A * Moves and resizes this component to conform to the new 0N/A * bounding rectangle <code>r</code>. This component's new 0N/A * position is specified by <code>r.x</code> and <code>r.y</code>, 0N/A * and its new size is specified by <code>r.width</code> and 0N/A * <code>r.height</code> 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param r the new bounding rectangle for this component 3025N/A * @throws NullPointerException if {@code r} is {@code null} 0N/A * @see #setLocation(int, int) 0N/A * @see #setLocation(Point) 0N/A * @see #setSize(int, int) 0N/A * @see #setSize(Dimension) 0N/A * Returns the current x coordinate of the components origin. 0N/A * This method is preferable to writing 0N/A * <code>component.getBounds().x</code>, 0N/A * or <code>component.getLocation().x</code> because it doesn't 0N/A * cause any heap allocations. 0N/A * @return the current x coordinate of the components origin 0N/A * Returns the current y coordinate of the components origin. 0N/A * This method is preferable to writing 0N/A * <code>component.getBounds().y</code>, 0N/A * or <code>component.getLocation().y</code> because it 0N/A * doesn't cause any heap allocations. 0N/A * @return the current y coordinate of the components origin 0N/A * Returns the current width of this component. 0N/A * This method is preferable to writing 0N/A * <code>component.getBounds().width</code>, 0N/A * or <code>component.getSize().width</code> because it 0N/A * doesn't cause any heap allocations. 0N/A * @return the current width of this component 0N/A * Returns the current height of this component. 0N/A * This method is preferable to writing 0N/A * <code>component.getBounds().height</code>, 0N/A * or <code>component.getSize().height</code> because it 0N/A * doesn't cause any heap allocations. 0N/A * @return the current height of this component 0N/A * Stores the bounds of this component into "return value" <b>rv</b> and 0N/A * return <b>rv</b>. If rv is <code>null</code> a new 0N/A * <code>Rectangle</code> is allocated. 0N/A * This version of <code>getBounds</code> is useful if the caller 0N/A * wants to avoid allocating a new <code>Rectangle</code> object 0N/A * @param rv the return value, modified to the components bounds 0N/A * Stores the width/height of this component into "return value" <b>rv</b> 0N/A * and return <b>rv</b>. If rv is <code>null</code> a new 0N/A * <code>Dimension</code> object is allocated. This version of 0N/A * <code>getSize</code> is useful if the caller wants to avoid 0N/A * allocating a new <code>Dimension</code> object on the heap. 0N/A * @param rv the return value, modified to the components size 0N/A * Stores the x,y origin of this component into "return value" <b>rv</b> 0N/A * and return <b>rv</b>. If rv is <code>null</code> a new 0N/A * <code>Point</code> is allocated. 0N/A * This version of <code>getLocation</code> is useful if the 0N/A * caller wants to avoid allocating a new <code>Point</code> 0N/A * object on the heap. 0N/A * @param rv the return value, modified to the components location 0N/A * Returns true if this component is completely opaque, returns 0N/A * An opaque component paints every pixel within its 0N/A * rectangular region. A non-opaque component paints only some of 0N/A * its pixels, allowing the pixels underneath it to "show through". 0N/A * A component that does not fully paint its pixels therefore 1403N/A * provides a degree of transparency. 0N/A * Subclasses that guarantee to always completely paint their 1403N/A * contents should override this method and return true. 0N/A * @return true if this component is completely opaque 0N/A * @see #isLightweight 0N/A * A lightweight component doesn't have a native toolkit peer. 0N/A * Subclasses of <code>Component</code> and <code>Container</code>, 0N/A * other than the ones defined in this package like <code>Button</code> 0N/A * or <code>Scrollbar</code>, are lightweight. 0N/A * All of the Swing components are lightweights. 0N/A * This method will always return <code>false</code> if this component 0N/A * is not displayable because it is impossible to determine the 0N/A * weight of an undisplayable component. 0N/A * @return true if this component has a lightweight peer; false if 0N/A * it has a native peer or no peer 0N/A * @see #isDisplayable 0N/A * Sets the preferred size of this component to a constant 0N/A * value. Subsequent calls to <code>getPreferredSize</code> will always 0N/A * return this value. Setting the preferred size to <code>null</code> 0N/A * restores the default behavior. 0N/A * @param preferredSize The new preferred size, or null 0N/A * @see #getPreferredSize 0N/A * @see #isPreferredSizeSet 0N/A // If the preferred size was set, use it as the old value, otherwise 0N/A // use null to indicate we didn't previously have a set preferred 0N/A * Returns true if the preferred size has been set to a 0N/A * non-<code>null</code> value otherwise returns false. 0N/A * @return true if <code>setPreferredSize</code> has been invoked 0N/A * with a non-null value. 0N/A * Gets the preferred size of this component. 0N/A * @return a dimension object indicating this component's preferred size 0N/A * @see #getMinimumSize 0N/A * @see LayoutManager 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getPreferredSize()</code>. 0N/A /* Avoid grabbing the lock if a reasonable cached size value 0N/A * Sets the minimum size of this component to a constant 0N/A * value. Subsequent calls to <code>getMinimumSize</code> will always 0N/A * return this value. Setting the minimum size to <code>null</code> 0N/A * restores the default behavior. 0N/A * @param minimumSize the new minimum size of this component 0N/A * @see #getMinimumSize 0N/A * @see #isMinimumSizeSet 0N/A // If the minimum size was set, use it as the old value, otherwise 0N/A // use null to indicate we didn't previously have a set minimum 0N/A * Returns whether or not <code>setMinimumSize</code> has been 0N/A * invoked with a non-null value. 0N/A * @return true if <code>setMinimumSize</code> has been invoked with a 0N/A * Gets the mininimum size of this component. 0N/A * @return a dimension object indicating this component's minimum size 0N/A * @see #getPreferredSize 0N/A * @see LayoutManager 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getMinimumSize()</code>. 0N/A /* Avoid grabbing the lock if a reasonable cached size value 0N/A * Sets the maximum size of this component to a constant 0N/A * value. Subsequent calls to <code>getMaximumSize</code> will always 0N/A * return this value. Setting the maximum size to <code>null</code> 0N/A * restores the default behavior. 0N/A * @param maximumSize a <code>Dimension</code> containing the 0N/A * desired maximum allowable size 0N/A * @see #getMaximumSize 0N/A * @see #isMaximumSizeSet 0N/A // If the maximum size was set, use it as the old value, otherwise 0N/A // use null to indicate we didn't previously have a set maximum 0N/A * Returns true if the maximum size has been set to a non-<code>null</code> 0N/A * value otherwise returns false. 0N/A * @return true if <code>maximumSize</code> is non-<code>null</code>, 0N/A * Gets the maximum size of this component. 0N/A * @return a dimension object indicating this component's maximum size 0N/A * @see #getMinimumSize 0N/A * @see #getPreferredSize 0N/A * @see LayoutManager 0N/A * Returns the alignment along the x axis. This specifies how 0N/A * the component would like to be aligned relative to other 0N/A * components. The value should be a number between 0 and 1 0N/A * where 0 represents alignment along the origin, 1 is aligned 0N/A * the furthest away from the origin, 0.5 is centered, etc. 0N/A * Returns the alignment along the y axis. This specifies how 0N/A * the component would like to be aligned relative to other 0N/A * components. The value should be a number between 0 and 1 0N/A * where 0 represents alignment along the origin, 1 is aligned 0N/A * the furthest away from the origin, 0.5 is centered, etc. 0N/A * Returns the baseline. The baseline is measured from the top of 0N/A * the component. This method is primarily meant for 0N/A * <code>LayoutManager</code>s to align components along their 0N/A * baseline. A return value less than 0 indicates this component 0N/A * does not have a reasonable baseline and that 0N/A * <code>LayoutManager</code>s should not align this component on 0N/A * The default implementation returns -1. Subclasses that support 0N/A * baseline should override appropriately. If a value >= 0 is 0N/A * returned, then the component has a valid baseline for any 0N/A * size >= the minimum size and <code>getBaselineResizeBehavior</code> 0N/A * can be used to determine how the baseline changes with size. 0N/A * @param width the width to get the baseline for 0N/A * @param height the height to get the baseline for 0N/A * @return the baseline or < 0 indicating there is no reasonable 0N/A * @throws IllegalArgumentException if width or height is < 0 0N/A * @see #getBaselineResizeBehavior 0N/A * @see java.awt.FontMetrics 0N/A "Width and height must be >= 0");
0N/A * Returns an enum indicating how the baseline of the component 0N/A * changes as the size changes. This method is primarily meant for 0N/A * layout managers and GUI builders. 0N/A * The default implementation returns 0N/A * <code>BaselineResizeBehavior.OTHER</code>. Subclasses that have a 0N/A * baseline should override appropriately. Subclasses should 0N/A * never return <code>null</code>; if the baseline can not be 0N/A * calculated return <code>BaselineResizeBehavior.OTHER</code>. Callers 0N/A * should first ask for the baseline using 0N/A * <code>getBaseline</code> and if a value >= 0 is returned use 0N/A * this method. It is acceptable for this method to return a 0N/A * value other than <code>BaselineResizeBehavior.OTHER</code> even if 0N/A * <code>getBaseline</code> returns a value less than 0. 0N/A * @return an enum indicating how the baseline changes as the component 0N/A * @see #getBaseline(int, int) 0N/A * Prompts the layout manager to lay out this component. This is 0N/A * usually called when the component (more specifically, container) 0N/A * @see LayoutManager 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>doLayout()</code>. 1895N/A * Validates this component. 1895N/A * The meaning of the term <i>validating</i> is defined by the ancestors of 1895N/A * this class. See {@link Container#validate} for more details. 0N/A * @see LayoutManager 0N/A * @see Container#validate 1895N/A * Invalidates this component and its ancestors. 4195N/A * By default, all the ancestors of the component up to the top-most 4195N/A * container of the hierarchy are marked invalid. If the {@code 4195N/A * java.awt.smartInvalidate} system property is set to {@code true}, 4195N/A * invalidation stops on the nearest validate root of this component. 4195N/A * Marking a container <i>invalid</i> indicates that the container needs to 1895N/A * This method is called automatically when any layout-related information 1895N/A * changes (e.g. setting the bounds of the component, or adding the 1895N/A * component to a container). 1895N/A * This method might be called often, so it should work fast. 0N/A * @see LayoutManager 1895N/A * @see java.awt.Container#isValidateRoot 0N/A /* Nullify cached layout and size information. 0N/A * For efficiency, propagate invalidate() upwards only if 0N/A * some other component hasn't already done so first. 1895N/A * Invalidates the parent of this component if any. 1895N/A * This method MUST BE invoked under the TreeLock. 555N/A /** Invalidates the component unless it is already invalid. 4074N/A * Revalidates the component hierarchy up to the nearest validate root. 4074N/A * This method first invalidates the component hierarchy starting from this 4074N/A * component up to the nearest validate root. Afterwards, the component 4074N/A * hierarchy is validated starting from the nearest validate root. 4074N/A * This is a convenience method supposed to help application developers 4074N/A * avoid looking for validate roots manually. Basically, it's equivalent to 4074N/A * first calling the {@link #invalidate()} method on this component, and 4074N/A * then calling the {@link #validate()} method on the nearest validate 4074N/A * @see Container#isValidateRoot 4074N/A // There's no parents. Just validate itself. 4074N/A // If there's no validate roots, we'll validate the 0N/A * Creates a graphics context for this component. This method will 0N/A * return <code>null</code> if this component is currently not 0N/A * @return a graphics context for this component, or <code>null</code> 0N/A // This is for a lightweight component, need to 0N/A // translate coordinate spaces and clip relative 0N/A // This is for a lightweight component, need to 0N/A // translate coordinate spaces and clip relative 0N/A * Gets the font metrics for the specified font. 0N/A * Warning: Since Font metrics are affected by the 0N/A * {@link java.awt.font.FontRenderContext FontRenderContext} and 0N/A * this method does not provide one, it can return only metrics for 0N/A * the default render context which may not match that used when 0N/A * rendering on the Component if {@link Graphics2D} functionality is being 0N/A * used. Instead metrics can be obtained at rendering time by calling 0N/A * {@link Graphics#getFontMetrics()} or text measurement APIs on the 0N/A * {@link Font Font} class. 0N/A * @param font the font for which font metrics is to be 0N/A * @return the font metrics for <code>font</code> 0N/A * @see java.awt.peer.ComponentPeer#getFontMetrics(Font) 0N/A * @see Toolkit#getFontMetrics(Font) 1686N/A // This is an unsupported hack, but left in for a customer. 0N/A * Sets the cursor image to the specified cursor. This cursor 0N/A * image is displayed when the <code>contains</code> method for 0N/A * this component returns true for the current cursor location, and 0N/A * this Component is visible, displayable, and enabled. Setting the 0N/A * cursor of a <code>Container</code> causes that cursor to be displayed 0N/A * within all of the container's subcomponents, except for those 0N/A * that have a non-<code>null</code> cursor. 0N/A * The method may have no visual effect if the Java platform 0N/A * implementation and/or the native system do not support 0N/A * changing the mouse cursor shape. 0N/A * @param cursor One of the constants defined 0N/A * by the <code>Cursor</code> class; 0N/A * if this parameter is <code>null</code> 0N/A * then this component will inherit 0N/A * the cursor of its parent 0N/A * @see Toolkit#createCustomCursor 0N/A * Updates the cursor. May not be invoked from the native 0N/A * Gets the cursor set in the component. If the component does 0N/A * not have a cursor set, the cursor of its parent is returned. 0N/A * If no cursor is set in the entire hierarchy, 0N/A * <code>Cursor.DEFAULT_CURSOR</code> is returned. 0N/A * Returns whether the cursor has been explicitly set for this Component. 0N/A * If this method returns <code>false</code>, this Component is inheriting 0N/A * its cursor from an ancestor. 0N/A * @return <code>true</code> if the cursor has been explicitly set for this 0N/A * Component; <code>false</code> otherwise. 0N/A * Paints this component. 0N/A * This method is called when the contents of the component should 0N/A * be painted; such as when the component is first being shown or 0N/A * is damaged and in need of repair. The clip rectangle in the 0N/A * <code>Graphics</code> parameter is set to the area 0N/A * which needs to be painted. 0N/A * Subclasses of <code>Component</code> that override this 0N/A * method need not call <code>super.paint(g)</code>. 0N/A * For performance reasons, <code>Component</code>s with zero width 0N/A * or height aren't considered to need painting when they are first shown, 0N/A * and also aren't considered to need repair. 0N/A * <b>Note</b>: For more information on the paint mechanisms utilitized 0N/A * by AWT and Swing, including information on how to write the most 0N/A * efficient painting code, see 0N/A * @param g the graphics context to use for painting 0N/A * Updates this component. 0N/A * If this component is not a lightweight component, the 0N/A * AWT calls the <code>update</code> method in response to 0N/A * a call to <code>repaint</code>. You can assume that 0N/A * the background is not cleared. 0N/A * The <code>update</code> method of <code>Component</code> 0N/A * calls this component's <code>paint</code> method to redraw 0N/A * this component. This method is commonly overridden by subclasses 0N/A * which need to do additional work in response to a call to 0N/A * <code>repaint</code>. 0N/A * Subclasses of Component that override this method should either 0N/A * call <code>super.update(g)</code>, or call <code>paint(g)</code> 0N/A * directly from their <code>update</code> method. 0N/A * The origin of the graphics context, its 0N/A * (<code>0</code>, <code>0</code>) coordinate point, is the 0N/A * top-left corner of this component. The clipping region of the 0N/A * graphics context is the bounding rectangle of this component. 0N/A * <b>Note</b>: For more information on the paint mechanisms utilitized 0N/A * by AWT and Swing, including information on how to write the most 0N/A * efficient painting code, see 0N/A * @param g the specified context to use for updating 0N/A * Paints this component and all of its subcomponents. 0N/A * The origin of the graphics context, its 0N/A * (<code>0</code>, <code>0</code>) coordinate point, is the 0N/A * top-left corner of this component. The clipping region of the 0N/A * graphics context is the bounding rectangle of this component. 0N/A * @param g the graphics context to use for painting 0N/A * Simulates the peer callbacks into java.awt for painting of 0N/A * lightweight Components. 0N/A * @param g the graphics context to use for painting 0N/A * Paints all the heavyweight subcomponents. 0N/A * Repaints this component. 0N/A * If this component is a lightweight component, this method 0N/A * causes a call to this component's <code>paint</code> 0N/A * method as soon as possible. Otherwise, this method causes 0N/A * a call to this component's <code>update</code> method as soon 0N/A * <b>Note</b>: For more information on the paint mechanisms utilitized 0N/A * by AWT and Swing, including information on how to write the most 0N/A * efficient painting code, see 0N/A * @see #update(Graphics) 0N/A * Repaints the component. If this component is a lightweight 0N/A * component, this results in a call to <code>paint</code> 0N/A * within <code>tm</code> milliseconds. 0N/A * <b>Note</b>: For more information on the paint mechanisms utilitized 0N/A * by AWT and Swing, including information on how to write the most 0N/A * efficient painting code, see 0N/A * @param tm maximum time in milliseconds before update 0N/A * @see #update(Graphics) 0N/A * Repaints the specified rectangle of this component. 0N/A * If this component is a lightweight component, this method 0N/A * causes a call to this component's <code>paint</code> method 0N/A * as soon as possible. Otherwise, this method causes a call to 0N/A * this component's <code>update</code> method as soon as possible. 0N/A * <b>Note</b>: For more information on the paint mechanisms utilitized 0N/A * by AWT and Swing, including information on how to write the most 0N/A * efficient painting code, see 0N/A * @param x the <i>x</i> coordinate 0N/A * @param y the <i>y</i> coordinate 0N/A * @param width the width 0N/A * @param height the height 0N/A * @see #update(Graphics) 0N/A * Repaints the specified rectangle of this component within 0N/A * <code>tm</code> milliseconds. 0N/A * If this component is a lightweight component, this method causes 0N/A * a call to this component's <code>paint</code> method. 0N/A * Otherwise, this method causes a call to this component's 0N/A * <code>update</code> method. 0N/A * <b>Note</b>: For more information on the paint mechanisms utilitized 0N/A * by AWT and Swing, including information on how to write the most 0N/A * efficient painting code, see 0N/A * @param tm maximum time in milliseconds before update 0N/A * @param x the <i>x</i> coordinate 0N/A * @param y the <i>y</i> coordinate 0N/A * @param width the width 0N/A * @param height the height 0N/A * @see #update(Graphics) 0N/A // Needs to be translated to parent coordinates since 0N/A // a parent native container provides the actual repaint 0N/A // services. Additionally, the request is restricted to 0N/A // the bounds of the component. 0N/A * Prints this component. Applications should override this method 0N/A * for components that must do special processing before being 0N/A * printed or should be printed differently than they are painted. 0N/A * The default implementation of this method calls the 0N/A * <code>paint</code> method. 0N/A * The origin of the graphics context, its 0N/A * (<code>0</code>, <code>0</code>) coordinate point, is the 0N/A * top-left corner of this component. The clipping region of the 0N/A * graphics context is the bounding rectangle of this component. 0N/A * @param g the graphics context to use for printing 0N/A * @see #paint(Graphics) 0N/A * Prints this component and all of its subcomponents. 0N/A * The origin of the graphics context, its 0N/A * (<code>0</code>, <code>0</code>) coordinate point, is the 0N/A * top-left corner of this component. The clipping region of the 0N/A * graphics context is the bounding rectangle of this component. 0N/A * @param g the graphics context to use for printing 0N/A * @see #print(Graphics) 0N/A * Simulates the peer callbacks into java.awt for printing of 0N/A * lightweight Components. 0N/A * @param g the graphics context to use for printing 0N/A * Prints all the heavyweight subcomponents. 0N/A * Repaints the component when the image has changed. 0N/A * This <code>imageUpdate</code> method of an <code>ImageObserver</code> 0N/A * is called when more information about an 0N/A * image which had been previously requested using an asynchronous 0N/A * routine such as the <code>drawImage</code> method of 0N/A * <code>Graphics</code> becomes available. 0N/A * See the definition of <code>imageUpdate</code> for 0N/A * more information on this method and its arguments. 0N/A * The <code>imageUpdate</code> method of <code>Component</code> 0N/A * incrementally draws an image on the component as more of the bits 0N/A * of the image are available. 0N/A * If the system property <code>awt.image.incrementaldraw</code> 0N/A * is missing or has the value <code>true</code>, the image is 0N/A * incrementally drawn. If the system property has any other value, 0N/A * then the image is not drawn until it has been completely loaded. 0N/A * Also, if incremental drawing is in effect, the value of the 0N/A * system property <code>awt.image.redrawrate</code> is interpreted 0N/A * as an integer to give the maximum redraw rate, in milliseconds. If 0N/A * the system property is missing or cannot be interpreted as an 0N/A * integer, the redraw rate is once every 100ms. 0N/A * The interpretation of the <code>x</code>, <code>y</code>, 0N/A * <code>width</code>, and <code>height</code> arguments depends on 0N/A * the value of the <code>infoflags</code> argument. 0N/A * @param img the image being observed 0N/A * @param infoflags see <code>imageUpdate</code> for more information 0N/A * @param x the <i>x</i> coordinate 0N/A * @param y the <i>y</i> coordinate 0N/A * @param w the width 0N/A * @param h the height 0N/A * @return <code>false</code> if the infoflags indicate that the 0N/A * image is completely loaded; <code>true</code> otherwise. 0N/A * @see java.awt.image.ImageObserver 0N/A * @see Graphics#drawImage(Image, int, int, Color, java.awt.image.ImageObserver) 0N/A * @see Graphics#drawImage(Image, int, int, java.awt.image.ImageObserver) 0N/A * @see Graphics#drawImage(Image, int, int, int, int, Color, java.awt.image.ImageObserver) 0N/A * @see Graphics#drawImage(Image, int, int, int, int, java.awt.image.ImageObserver) 0N/A * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) 0N/A int x,
int y,
int w,
int h) {
0N/A * Creates an image from the specified image producer. 0N/A * @param producer the image producer 0N/A * @return the image produced 0N/A * Creates an off-screen drawable image 0N/A * to be used for double buffering. 0N/A * @param width the specified width 0N/A * @param height the specified height 0N/A * @return an off-screen drawable image, which can be used for double 0N/A * buffering. The return value may be <code>null</code> if the 0N/A * component is not displayable. This will always happen if 0N/A * <code>GraphicsEnvironment.isHeadless()</code> returns 0N/A * <code>true</code>. 0N/A * @see #isDisplayable 0N/A * @see GraphicsEnvironment#isHeadless 0N/A * Creates a volatile off-screen drawable image 0N/A * to be used for double buffering. 0N/A * @param width the specified width. 0N/A * @param height the specified height. 0N/A * @return an off-screen drawable image, which can be used for double 0N/A * buffering. The return value may be <code>null</code> if the 0N/A * component is not displayable. This will always happen if 0N/A * <code>GraphicsEnvironment.isHeadless()</code> returns 0N/A * <code>true</code>. 0N/A * @see java.awt.image.VolatileImage 0N/A * @see #isDisplayable 0N/A * @see GraphicsEnvironment#isHeadless 0N/A * Creates a volatile off-screen drawable image, with the given capabilities. 0N/A * The contents of this image may be lost at any time due 0N/A * to operating system issues, so the image must be managed 0N/A * via the <code>VolatileImage</code> interface. 0N/A * @param width the specified width. 0N/A * @param height the specified height. 0N/A * @param caps the image capabilities 0N/A * @exception AWTException if an image with the specified capabilities cannot 0N/A * @return a VolatileImage object, which can be used 0N/A * to manage surface contents loss and capabilities. 0N/A * @see java.awt.image.VolatileImage 0N/A // REMIND : check caps 0N/A * Prepares an image for rendering on this component. The image 0N/A * data is downloaded asynchronously in another thread and the 0N/A * appropriate screen representation of the image is generated. 0N/A * @param image the <code>Image</code> for which to 0N/A * prepare a screen representation 0N/A * @param observer the <code>ImageObserver</code> object 0N/A * to be notified as the image is being prepared 0N/A * @return <code>true</code> if the image has already been fully 0N/A * prepared; <code>false</code> otherwise 0N/A * Prepares an image for rendering on this component at the 0N/A * specified width and height. 0N/A * The image data is downloaded asynchronously in another thread, 0N/A * and an appropriately scaled screen representation of the image is 0N/A * @param image the instance of <code>Image</code> 0N/A * for which to prepare a screen representation 0N/A * @param width the width of the desired screen representation 0N/A * @param height the height of the desired screen representation 0N/A * @param observer the <code>ImageObserver</code> object 0N/A * to be notified as the image is being prepared 0N/A * @return <code>true</code> if the image has already been fully 0N/A * prepared; <code>false</code> otherwise 0N/A * @see java.awt.image.ImageObserver 0N/A * Returns the status of the construction of a screen representation 0N/A * of the specified image. 0N/A * This method does not cause the image to begin loading. An 0N/A * application must use the <code>prepareImage</code> method 0N/A * to force the loading of an image. 0N/A * Information on the flags returned by this method can be found 0N/A * with the discussion of the <code>ImageObserver</code> interface. 0N/A * @param image the <code>Image</code> object whose status 0N/A * @param observer the <code>ImageObserver</code> 0N/A * object to be notified as the image is being prepared 0N/A * @return the bitwise inclusive <b>OR</b> of 0N/A * <code>ImageObserver</code> flags indicating what 0N/A * information about the image is currently available 0N/A * @see #prepareImage(Image, int, int, java.awt.image.ImageObserver) 0N/A * @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver) 0N/A * @see java.awt.image.ImageObserver 0N/A * Returns the status of the construction of a screen representation 0N/A * of the specified image. 0N/A * This method does not cause the image to begin loading. An 0N/A * application must use the <code>prepareImage</code> method 0N/A * to force the loading of an image. 0N/A * The <code>checkImage</code> method of <code>Component</code> 0N/A * calls its peer's <code>checkImage</code> method to calculate 0N/A * the flags. If this component does not yet have a peer, the 0N/A * component's toolkit's <code>checkImage</code> method is called 0N/A * Information on the flags returned by this method can be found 0N/A * with the discussion of the <code>ImageObserver</code> interface. 0N/A * @param image the <code>Image</code> object whose status 0N/A * @param width the width of the scaled version 0N/A * whose status is to be checked 0N/A * @param height the height of the scaled version 0N/A * whose status is to be checked 0N/A * @param observer the <code>ImageObserver</code> object 0N/A * to be notified as the image is being prepared 0N/A * @return the bitwise inclusive <b>OR</b> of 0N/A * <code>ImageObserver</code> flags indicating what 0N/A * information about the image is currently available 0N/A * @see #prepareImage(Image, int, int, java.awt.image.ImageObserver) 0N/A * @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver) 0N/A * @see java.awt.image.ImageObserver 0N/A * Creates a new strategy for multi-buffering on this component. 0N/A * Multi-buffering is useful for rendering performance. This method 0N/A * attempts to create the best strategy available with the number of 0N/A * buffers supplied. It will always create a <code>BufferStrategy</code> 0N/A * with that number of buffers. 0N/A * A page-flipping strategy is attempted first, then a blitting strategy 0N/A * using accelerated buffers. Finally, an unaccelerated blitting 0N/A * Each time this method is called, 0N/A * the existing buffer strategy for this component is discarded. 0N/A * @param numBuffers number of buffers to create, including the front buffer 0N/A * @exception IllegalArgumentException if numBuffers is less than 1. 0N/A * @exception IllegalStateException if the component is not displayable 0N/A * @see #isDisplayable 0N/A * @see Window#getBufferStrategy() 0N/A * @see Canvas#getBufferStrategy() 0N/A // Try to create a page-flipping strategy 0N/A // Try a blitting (but still accelerated) strategy 0N/A // Try an unaccelerated blitting strategy 0N/A // Code should never reach here (an unaccelerated blitting 0N/A // strategy should always work) 0N/A * Creates a new strategy for multi-buffering on this component with the 0N/A * required buffer capabilities. This is useful, for example, if only 0N/A * accelerated memory or page flipping is desired (as specified by the 0N/A * buffer capabilities). 0N/A * Each time this method 0N/A * is called, <code>dispose</code> will be invoked on the existing 0N/A * <code>BufferStrategy</code>. 0N/A * @param numBuffers number of buffers to create 0N/A * @param caps the required capabilities for creating the buffer strategy; 0N/A * cannot be <code>null</code> 0N/A * @exception AWTException if the capabilities supplied could not be 0N/A * supported or met; this may happen, for example, if there is not enough 0N/A * accelerated memory currently available, or if page flipping is specified 0N/A * @exception IllegalArgumentException if numBuffers is less than 1, or if 0N/A * caps is <code>null</code> 0N/A * @see Window#getBufferStrategy() 0N/A * @see Canvas#getBufferStrategy() 0N/A "Number of buffers must be at least 1");
0N/A // Destroy old buffers 0N/A // assert numBuffers > 1; 430N/A * This is a proxy capabilities class used when a FlipBufferStrategy 430N/A * is created instead of the requested Blit strategy. 430N/A * @see sun.awt.SunGraphicsEnvironment#isFlipStrategyPreferred(ComponentPeer) 0N/A * @return the buffer strategy used by this component 0N/A * @see Window#createBufferStrategy 0N/A * @see Canvas#createBufferStrategy 0N/A * @return the back buffer currently used by this component's 0N/A * BufferStrategy. If there is no BufferStrategy or no 0N/A * back buffer, this method returns null. 0N/A * Inner class for flipping buffers on a component. That component must 0N/A * be a <code>Canvas</code> or <code>Window</code>. 0N/A * @see java.awt.image.BufferStrategy 0N/A * @author Michael Martak 0N/A * The number of buffers 0N/A * The buffering capabilities 0N/A * The drawing buffer 0N/A * The drawing buffer as a volatile image 0N/A * Whether or not the drawing buffer has been recently restored from 0N/A * Size of the back buffers. (Note: these fields were added in 6.0 0N/A * but kept package-private to avoid exposing them in the spec. 0N/A * protected when they were introduced in 1.4, but now we just have 0N/A * to live with that decision.) 0N/A * Creates a new flipping buffer strategy for this component. 0N/A * The component must be a <code>Canvas</code> or <code>Window</code>. 0N/A * @param numBuffers the number of buffers 0N/A * @param caps the capabilities of the buffers 0N/A * @exception AWTException if the capabilities supplied could not be 0N/A * @exception ClassCastException if the component is not a canvas or 3723N/A * @exception IllegalStateException if the component has no peer 3723N/A * @exception IllegalArgumentException if {@code numBuffers} is less than two, 3723N/A * or if {@code BufferCapabilities.isPageFlipping} is not 3723N/A * @see #createBuffers(int, BufferCapabilities) 0N/A "Component must be a Canvas or Window");
0N/A * Creates one or more complex, flipping buffers with the given 0N/A * @param numBuffers number of buffers to create; must be greater than 0N/A * @param caps the capabilities of the buffers. 0N/A * <code>BufferCapabilities.isPageFlipping</code> must be 0N/A * <code>true</code>. 0N/A * @exception AWTException if the capabilities supplied could not be 0N/A * @exception IllegalStateException if the component has no peer 0N/A * @exception IllegalArgumentException if numBuffers is less than two, 0N/A * or if <code>BufferCapabilities.isPageFlipping</code> is not 0N/A * <code>true</code>. 0N/A * @see java.awt.BufferCapabilities#isPageFlipping() 0N/A "Number of buffers cannot be less than two");
0N/A "Component must have a valid peer");
0N/A "Page flipping capabilities must be specified");
0N/A // save the current bounds 0N/A // dispose the existing backbuffers 0N/A // ... then recreate the backbuffers 430N/A // if this buffer strategy is not allowed to be v-synced, 430N/A // change the caps that we pass to the peer but keep on 430N/A // trying to create v-synced buffers; 430N/A // do not throw IAE here in case it is disallowed, see 430N/A // ExtendedBufferCapabilities for more info 0N/A * Updates internal buffers (both volatile and non-volatile) 0N/A * by requesting the back-buffer from the peer. 0N/A // get the images associated with the draw buffer 0N/A * @return direct access to the back buffer, as an image. 0N/A * @exception IllegalStateException if the buffers have not yet 0N/A "Component must have a valid peer");
0N/A * Flipping moves the contents of the back buffer to the front buffer, 0N/A * either by copying or by moving the video pointer. 0N/A * @param flipAction an integer value describing the flipping action 0N/A * for the contents of the back buffer. This should be one of the 0N/A * values of the <code>BufferCapabilities.FlipContents</code> 0N/A * @exception IllegalStateException if the buffers have not yet 0N/A * @see java.awt.BufferCapabilities#getFlipContents() 430N/A "Component must have a valid peer");
0N/A "Component must have a valid peer");
0N/A * Destroys the buffers created through this object 0N/A "Component must have a valid peer");
0N/A * @return the buffering capabilities of this strategy 0N/A * @return the graphics on the drawing buffer. This method may not 0N/A * be synchronized for performance reasons; use of this method by multiple 0N/A * threads should be handled at the application level. Disposal of the 0N/A * graphics object must be handled by the application. 0N/A * Restore the drawing buffer if it has been lost 0N/A // component has been resized; recreate the backbuffers 0N/A // shouldn't be possible 0N/A // get the buffers from the peer every time since they 0N/A // might have been replaced in response to a display change event 0N/A // now validate the backbuffer 0N/A // shouldn't be possible 0N/A // backbuffers were recreated, so validate again 0N/A * @return whether the drawing buffer was lost since the last call to 0N/A * <code>getDrawGraphics</code> 0N/A * @return whether the drawing buffer was recently restored from a lost 0N/A * state and reinitialized to the default background color (white) 0N/A * Makes the next available buffer visible by either blitting or 430N/A * Makes specified region of the the next available buffer visible 430N/A * by either blitting or flipping. 0N/A }
// Inner class FlipBufferStrategy 0N/A * Inner class for blitting offscreen surfaces to a component. 0N/A * @author Michael Martak 0N/A * The buffering capabilities 0N/A * Whether or not the drawing buffer has been recently restored from 0N/A * Size of the back buffers 0N/A * Insets for the hosting Component. The size of the back buffer 0N/A * is constrained by these. 0N/A * Creates a new blt buffer strategy around a component 0N/A * @param numBuffers number of buffers to create, including the 0N/A * @param caps the capabilities of the buffers 0N/A * Creates the back buffers 0N/A // save the current bounds 0N/A // It is possible for the component's width and/or height 0N/A // to be 0 here. Force the size of the backbuffers to 0N/A // be > 0 so that creating the image won't fail. 0N/A // flush any existing backbuffers 0N/A // create the backbuffers 0N/A * @return the buffering capabilities of this strategy 0N/A * @return the draw graphics 0N/A * @return direct access to the back buffer, as an image. 0N/A * If there is no back buffer, returns null. 0N/A * Makes the next available buffer visible. 0N/A * Package-private method to present a specific rectangular area 0N/A * of this buffer. This class currently shows only the entire 0N/A * buffer, by calling showSubRegion() with the full dimensions of 0N/A * the buffer. Subclasses (e.g., BltSubRegionBufferStrategy 0N/A * and FlipSubRegionBufferStrategy) may have region-specific show 0N/A * methods that call this method with actual sub regions of the 0N/A // Adjust location to be relative to client area. 0N/A // Not showing, bail 0N/A // First image copy is in terms of Frame's coordinates, need 0N/A // to translate to client area. 0N/A * Restore the drawing buffer if it has been lost 0N/A // component has been resized; recreate the backbuffers 0N/A // now validate the backbuffer 0N/A // backbuffers were recreated, so validate again 0N/A // else case means we're called from Swing on the toolkit 0N/A // thread, don't recreate buffers as that'll deadlock 0N/A // (creating VolatileImages invokes getting GraphicsConfig 0N/A // which grabs treelock). 0N/A * @return whether the drawing buffer was lost since the last call to 0N/A * <code>getDrawGraphics</code> 0N/A * @return whether the drawing buffer was recently restored from a lost 0N/A * state and reinitialized to the default background color (white) 0N/A }
// Inner class BltBufferStrategy 0N/A * Private class to perform sub-region flipping. 0N/A // This is invoked by Swing on the toolkit thread. 0N/A * Private class to perform sub-region blitting. Swing will use 0N/A * this subclass via the SubRegionShowable interface in order to 0N/A * copy only the area changed during a repaint. 0N/A * @see javax.swing.BufferStrategyPaintManager 0N/A // This method is called by Swing on the toolkit thread. 0N/A * Inner class for flipping buffers on a component. That component must 0N/A * be a <code>Canvas</code> or <code>Window</code>. 0N/A * @see java.awt.image.BufferStrategy 0N/A * @author Michael Martak 0N/A }
// Inner class SingleBufferStrategy 0N/A * Sets whether or not paint messages received from the operating system 0N/A * should be ignored. This does not affect paint events generated in 0N/A * software by the AWT, unless they are an immediate response to an 0N/A * OS-level paint message. 0N/A * This is useful, for example, if running under full-screen mode and 0N/A * better performance is desired, or if page-flipping is used as the 0N/A * @see #getIgnoreRepaint 0N/A * @see Canvas#createBufferStrategy 0N/A * @see Window#createBufferStrategy 0N/A * @see java.awt.image.BufferStrategy 0N/A * @see GraphicsDevice#setFullScreenWindow 0N/A * @return whether or not paint messages received from the operating system 0N/A * should be ignored. 0N/A * @see #setIgnoreRepaint 0N/A * Checks whether this component "contains" the specified point, 0N/A * where <code>x</code> and <code>y</code> are defined to be 0N/A * relative to the coordinate system of this component. 0N/A * @param x the <i>x</i> coordinate of the point 0N/A * @param y the <i>y</i> coordinate of the point 0N/A * @see #getComponentAt(int, int) 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by contains(int, int). 0N/A * Checks whether this component "contains" the specified point, 0N/A * where the point's <i>x</i> and <i>y</i> coordinates are defined 0N/A * to be relative to the coordinate system of this component. 0N/A * @param p the point 3025N/A * @throws NullPointerException if {@code p} is {@code null} 0N/A * @see #getComponentAt(Point) 0N/A * Determines if this component or one of its immediate 0N/A * subcomponents contains the (<i>x</i>, <i>y</i>) location, 0N/A * and if so, returns the containing component. This method only 0N/A * looks one level deep. If the point (<i>x</i>, <i>y</i>) is 0N/A * inside a subcomponent that itself has subcomponents, it does not 0N/A * go looking down the subcomponent tree. 0N/A * The <code>locate</code> method of <code>Component</code> simply 0N/A * returns the component itself if the (<i>x</i>, <i>y</i>) 0N/A * coordinate location is inside its bounding box, and <code>null</code> 0N/A * @param x the <i>x</i> coordinate 0N/A * @param y the <i>y</i> coordinate 0N/A * @return the component or subcomponent that contains the 0N/A * (<i>x</i>, <i>y</i>) location; 0N/A * <code>null</code> if the location 0N/A * is outside this component 0N/A * @see #contains(int, int) 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by getComponentAt(int, int). 0N/A * Returns the component or subcomponent that contains the 0N/A * @param p the point 0N/A * @see java.awt.Component#contains 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>dispatchEvent(AWTEvent e)</code>. 0N/A * Dispatches an event to this component or one of its sub components. 0N/A * Calls <code>processEvent</code> before returning for 1.1-style 0N/A * events which have been enabled for the <code>Component</code>. 0N/A * @param e the event 0N/A // Check that this component belongs to this app-context 0N/A * 0. Set timestamp and modifiers of current event. 0N/A * before we notify AWTEventListeners. 0N/A // Invoke the private focus retargeting method which provides 0N/A // lightweight Component support 0N/A // Now, with the event properly targeted to a lightweight 0N/A // descendant if necessary, invoke the public focus retargeting 0N/A // and dispatching function 0N/A // MouseWheel may need to be retargeted here so that 0N/A // AWTEventListener sees the event go to the correct 0N/A // Component. If the MouseWheelEvent needs to go to an ancestor, 0N/A // the event is dispatched to the ancestor, and dispatching here 0N/A * 2. Allow the Toolkit to pass this to AWTEventListeners. 0N/A * 3. If no one has consumed a key event, allow the 0N/A * KeyboardFocusManager to process it. 0N/A * 4. Allow input methods to process the event 0N/A // We need to pass on InputMethodEvents since some host 0N/A // input method adapters send them through the Java 0N/A // event queue instead of directly to the component, 0N/A // and the input context also handles the Java composition window 0N/A // Otherwise, we only pass on input and focus events, because 0N/A // a) input methods shouldn't know about semantic or component-level events 0N/A // b) passing on the events takes time 0N/A // c) isConsumed() is always true for semantic events. 0N/A // When non-clients get focus, we need to explicitly disable the native 0N/A // input method. The native input method is actually not disabled when 0N/A * 5. Pre-process any special events before delivery 0N/A // Handling of the PAINT and UPDATE events is now done in the 0N/A // peer's handleEvent() method so the background can be cleared 0N/A // selectively for non-native components on Windows only. 0N/A // - Fred.Ecks@Eng.sun.com, 5-8-98 0N/A * 6. Deliver event for normal processing 0N/A // Filtering needs to really be moved to happen at a lower 0N/A // level in order to get maximum performance gain; it is 0N/A // here temporarily to ensure the API spec is honored. 0N/A // newEventsOnly will be false for a listenerless ScrollPane, but 0N/A // MouseWheelEvents still need to be dispatched to it so scrolling 0N/A // backward compatibility 0N/A // if target changed key or modifier values, copy them 0N/A // back to original event 0N/A * 8. Special handling for 4061116 : Hook for browser to close modal 0N/A * 9. Allow the peer to process the event. 0N/A * Except KeyEvents, they will be processed by peer after 0N/A * all KeyEventPostProcessors 0N/A * (see DefaultKeyboardFocusManager.dispatchKeyEvent()) 0N/A // if focus owner is lightweight then its native container 0N/A }
// dispatchEventImpl() 0N/A * If newEventsOnly is false, method is called so that ScrollPane can 0N/A * override it and handle common-case mouse wheel scrolling. NOP 0N/A * Dispatch given MouseWheelEvent to the first ancestor for which 0N/A * MouseWheelEvents are enabled. 0N/A * Returns whether or not event was dispatched to an ancestor 0N/A // Component (e.getX()), and this Component's 0N/A // position relative to its parent. 0N/A /* parent field for Window refers to the owning Window. 0N/A * MouseWheelEvents should NOT be propagated into owning Windows 0N/A // fix coordinates to be relative to new event source 0N/A // Change event to be from new source, with new x,y 0N/A // For now, just create a new event - yucky 0N/A // When dispatching a wheel event to 0N/A // ancestor, there is no need trying to find descendant 0N/A // lightweights to dispatch event to. 0N/A // If we dispatch the event to toplevel ancestor, 0N/A // this could encolse the loop: 6480024. 0N/A // in 1.2, we assume input method support is required for all 0N/A // components that handle key events, but components can turn off 0N/A // input methods by calling enableInputMethods(false). 0N/A // REMIND: remove when filtering is handled at lower level 0N/A // Always pass on events defined by external programs. 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by dispatchEvent(AWTEvent). 0N/A // Event source interfaces 0N/A * Adds the specified component listener to receive component events from 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the component listener 0N/A * @see java.awt.event.ComponentEvent 0N/A * @see java.awt.event.ComponentListener 0N/A * @see #removeComponentListener 0N/A * @see #getComponentListeners 0N/A * Removes the specified component listener so that it no longer 0N/A * receives component events from this component. This method performs 0N/A * no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the component listener 0N/A * @see java.awt.event.ComponentEvent 0N/A * @see java.awt.event.ComponentListener 0N/A * @see #addComponentListener 0N/A * @see #getComponentListeners 0N/A * Returns an array of all the component listeners 0N/A * registered on this component. 0N/A * @return all of this comonent's <code>ComponentListener</code>s 0N/A * or an empty array if no component 0N/A * listeners are currently registered 0N/A * @see #addComponentListener 0N/A * @see #removeComponentListener 0N/A * Adds the specified focus listener to receive focus events from 0N/A * this component when this component gains input focus. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the focus listener 0N/A * @see java.awt.event.FocusEvent 0N/A * @see java.awt.event.FocusListener 0N/A * @see #removeFocusListener 0N/A * @see #getFocusListeners 0N/A // if this is a lightweight component, enable focus events 0N/A // in the native container. 0N/A * Removes the specified focus listener so that it no longer 0N/A * receives focus events from this component. This method performs 0N/A * no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the focus listener 0N/A * @see java.awt.event.FocusEvent 0N/A * @see java.awt.event.FocusListener 0N/A * @see #addFocusListener 0N/A * @see #getFocusListeners 0N/A * Returns an array of all the focus listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>FocusListener</code>s 0N/A * or an empty array if no component 0N/A * listeners are currently registered 0N/A * @see #addFocusListener 0N/A * @see #removeFocusListener 0N/A * Adds the specified hierarchy listener to receive hierarchy changed 0N/A * events from this component when the hierarchy to which this container 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the hierarchy listener 0N/A * @see java.awt.event.HierarchyEvent 0N/A * @see java.awt.event.HierarchyListener 0N/A * @see #removeHierarchyListener 0N/A * @see #getHierarchyListeners 0N/A synchronized (
this) {
0N/A * Removes the specified hierarchy listener so that it no longer 0N/A * receives hierarchy changed events from this component. This method 0N/A * performs no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the hierarchy listener 0N/A * @see java.awt.event.HierarchyEvent 0N/A * @see java.awt.event.HierarchyListener 0N/A * @see #addHierarchyListener 0N/A * @see #getHierarchyListeners 0N/A synchronized (
this) {
0N/A * Returns an array of all the hierarchy listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>HierarchyListener</code>s 0N/A * or an empty array if no hierarchy 0N/A * listeners are currently registered 0N/A * @see #addHierarchyListener 0N/A * @see #removeHierarchyListener 0N/A * Adds the specified hierarchy bounds listener to receive hierarchy 0N/A * bounds events from this component when the hierarchy to which this 0N/A * container belongs changes. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the hierarchy bounds listener 0N/A * @see java.awt.event.HierarchyEvent 0N/A * @see java.awt.event.HierarchyBoundsListener 0N/A * @see #removeHierarchyBoundsListener 0N/A * @see #getHierarchyBoundsListeners 0N/A synchronized (
this) {
0N/A * Removes the specified hierarchy bounds listener so that it no longer 0N/A * receives hierarchy bounds events from this component. This method 0N/A * performs no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the hierarchy bounds listener 0N/A * @see java.awt.event.HierarchyEvent 0N/A * @see java.awt.event.HierarchyBoundsListener 0N/A * @see #addHierarchyBoundsListener 0N/A * @see #getHierarchyBoundsListeners 0N/A synchronized (
this) {
0N/A // Should only be called while holding the tree lock 0N/A // One mask or the other, but not neither or both. 0N/A // Should only be called while holding tree lock 0N/A // Should only be called while holding the tree lock 0N/A * Returns an array of all the hierarchy bounds listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>HierarchyBoundsListener</code>s 0N/A * or an empty array if no hierarchy bounds 0N/A * listeners are currently registered 0N/A * @see #addHierarchyBoundsListener 0N/A * @see #removeHierarchyBoundsListener 0N/A * Should only be called while holding the tree lock. 0N/A * It's added only for overriding in java.awt.Window 0N/A * because parent in Window is owner. 0N/A * Adds the specified key listener to receive key events from 0N/A * If l is null, no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the key listener. 0N/A * @see java.awt.event.KeyEvent 0N/A * @see java.awt.event.KeyListener 0N/A * @see #removeKeyListener 0N/A * @see #getKeyListeners 0N/A // if this is a lightweight component, enable key events 0N/A // in the native container. 0N/A * Removes the specified key listener so that it no longer 0N/A * receives key events from this component. This method performs 0N/A * no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the key listener 0N/A * @see java.awt.event.KeyEvent 0N/A * @see java.awt.event.KeyListener 0N/A * @see #addKeyListener 0N/A * @see #getKeyListeners 0N/A * Returns an array of all the key listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>KeyListener</code>s 0N/A * or an empty array if no key 0N/A * listeners are currently registered 0N/A * @see #addKeyListener 0N/A * @see #removeKeyListener 0N/A * Adds the specified mouse listener to receive mouse events from 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the mouse listener 0N/A * @see java.awt.event.MouseEvent 0N/A * @see java.awt.event.MouseListener 0N/A * @see #removeMouseListener 0N/A * @see #getMouseListeners 0N/A // if this is a lightweight component, enable mouse events 0N/A // in the native container. 0N/A * Removes the specified mouse listener so that it no longer 0N/A * receives mouse events from this component. This method performs 0N/A * no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the mouse listener 0N/A * @see java.awt.event.MouseEvent 0N/A * @see java.awt.event.MouseListener 0N/A * @see #addMouseListener 0N/A * @see #getMouseListeners 0N/A * Returns an array of all the mouse listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>MouseListener</code>s 0N/A * or an empty array if no mouse 0N/A * listeners are currently registered 0N/A * @see #addMouseListener 0N/A * @see #removeMouseListener 0N/A * Adds the specified mouse motion listener to receive mouse motion 0N/A * events from this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the mouse motion listener 0N/A * @see java.awt.event.MouseEvent 0N/A * @see java.awt.event.MouseMotionListener 0N/A * @see #removeMouseMotionListener 0N/A * @see #getMouseMotionListeners 0N/A // if this is a lightweight component, enable mouse events 0N/A // in the native container. 0N/A * Removes the specified mouse motion listener so that it no longer 0N/A * receives mouse motion events from this component. This method performs 0N/A * no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the mouse motion listener 0N/A * @see java.awt.event.MouseEvent 0N/A * @see java.awt.event.MouseMotionListener 0N/A * @see #addMouseMotionListener 0N/A * @see #getMouseMotionListeners 0N/A * Returns an array of all the mouse motion listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>MouseMotionListener</code>s 0N/A * or an empty array if no mouse motion 0N/A * listeners are currently registered 0N/A * @see #addMouseMotionListener 0N/A * @see #removeMouseMotionListener 0N/A * Adds the specified mouse wheel listener to receive mouse wheel events 0N/A * from this component. Containers also receive mouse wheel events from 0N/A * For information on how mouse wheel events are dispatched, see 0N/A * the class description for {@link MouseWheelEvent}. 0N/A * If l is <code>null</code>, no exception is thrown and no 0N/A * action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the mouse wheel listener 0N/A * @see java.awt.event.MouseWheelEvent 0N/A * @see java.awt.event.MouseWheelListener 0N/A * @see #removeMouseWheelListener 0N/A * @see #getMouseWheelListeners 0N/A // if this is a lightweight component, enable mouse events 0N/A // in the native container. 0N/A * Removes the specified mouse wheel listener so that it no longer 0N/A * receives mouse wheel events from this component. This method performs 0N/A * no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If l is null, no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the mouse wheel listener. 0N/A * @see java.awt.event.MouseWheelEvent 0N/A * @see java.awt.event.MouseWheelListener 0N/A * @see #addMouseWheelListener 0N/A * @see #getMouseWheelListeners 0N/A * Returns an array of all the mouse wheel listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>MouseWheelListener</code>s 0N/A * or an empty array if no mouse wheel 0N/A * listeners are currently registered 0N/A * @see #addMouseWheelListener 0N/A * @see #removeMouseWheelListener 0N/A * Adds the specified input method listener to receive 0N/A * input method events from this component. A component will 0N/A * only receive input method events from input methods 0N/A * if it also overrides <code>getInputMethodRequests</code> to return an 0N/A * <code>InputMethodRequests</code> instance. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the input method listener 0N/A * @see java.awt.event.InputMethodEvent 0N/A * @see java.awt.event.InputMethodListener 0N/A * @see #removeInputMethodListener 0N/A * @see #getInputMethodListeners 0N/A * @see #getInputMethodRequests 0N/A * Removes the specified input method listener so that it no longer 0N/A * receives input method events from this component. This method performs 0N/A * no function, nor does it throw an exception, if the listener 0N/A * specified by the argument was not previously added to this component. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the input method listener 0N/A * @see java.awt.event.InputMethodEvent 0N/A * @see java.awt.event.InputMethodListener 0N/A * @see #addInputMethodListener 0N/A * @see #getInputMethodListeners 0N/A * Returns an array of all the input method listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>InputMethodListener</code>s 0N/A * or an empty array if no input method 0N/A * listeners are currently registered 0N/A * @see #addInputMethodListener 0N/A * @see #removeInputMethodListener 0N/A * Returns an array of all the objects currently registered 0N/A * as <code><em>Foo</em>Listener</code>s 0N/A * upon this <code>Component</code>. 0N/A * <code><em>Foo</em>Listener</code>s are registered using the 0N/A * <code>add<em>Foo</em>Listener</code> method. 0N/A * You can specify the <code>listenerType</code> argument 0N/A * with a class literal, such as 0N/A * <code><em>Foo</em>Listener.class</code>. 0N/A * For example, you can query a 0N/A * <code>Component</code> <code>c</code> 0N/A * for its mouse listeners with the following code: 0N/A * <pre>MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));</pre> 0N/A * If no such listeners exist, this method returns an empty array. 0N/A * @param listenerType the type of listeners requested; this parameter 0N/A * should specify an interface that descends from 0N/A * <code>java.util.EventListener</code> 0N/A * @return an array of all objects registered as 0N/A * <code><em>Foo</em>Listener</code>s on this component, 0N/A * or an empty array if no such listeners have been added 0N/A * @exception ClassCastException if <code>listenerType</code> 0N/A * doesn't specify a class or interface that implements 0N/A * <code>java.util.EventListener</code> 3025N/A * @throws NullPointerException if {@code listenerType} is {@code null} 0N/A * @see #getComponentListeners 0N/A * @see #getFocusListeners 0N/A * @see #getHierarchyListeners 0N/A * @see #getHierarchyBoundsListeners 0N/A * @see #getKeyListeners 0N/A * @see #getMouseListeners 0N/A * @see #getMouseMotionListeners 0N/A * @see #getMouseWheelListeners 0N/A * @see #getInputMethodListeners 0N/A * @see #getPropertyChangeListeners 0N/A * Gets the input method request handler which supports 0N/A * requests from input methods for this component. A component 0N/A * that supports on-the-spot text input must override this 0N/A * method to return an <code>InputMethodRequests</code> instance. 0N/A * At the same time, it also has to handle input method events. 0N/A * @return the input method request handler for this component, 0N/A * <code>null</code> by default 0N/A * @see #addInputMethodListener 0N/A * Gets the input context used by this component for handling 0N/A * the communication with input methods when text is entered 0N/A * in this component. By default, the input context used for 0N/A * the parent component is returned. Components may 0N/A * override this to return a private input context. 0N/A * @return the input context used by this component; 0N/A * <code>null</code> if no context can be determined 0N/A * Enables the events defined by the specified event mask parameter 0N/A * to be delivered to this component. 0N/A * Event types are automatically enabled when a listener for 0N/A * that event type is added to the component. 0N/A * This method only needs to be invoked by subclasses of 0N/A * <code>Component</code> which desire to have the specified event 0N/A * types delivered to <code>processEvent</code> regardless of whether 0N/A * or not a listener is registered. 0N/A * @param eventsToEnable the event mask defining the event types 0N/A * @see #processEvent 0N/A * @see #disableEvents 0N/A synchronized (
this) {
0N/A // if this is a lightweight component, enable mouse events 0N/A // in the native container. 0N/A * Disables the events defined by the specified event mask parameter 0N/A * from being delivered to this component. 0N/A * @param eventsToDisable the event mask defining the event types 0N/A * @see #enableEvents 0N/A synchronized (
this) {
0N/A * @see #isCoalescingEnabled 0N/A * @see #checkCoalescing 0N/A * Weak map of known coalesceEvent overriders. 0N/A * Value indicates whether overriden. 0N/A * Bootstrap classes are not included. 0N/A * Indicates whether this class overrides coalesceEvents. 0N/A * It is assumed that all classes that are loaded from the bootstrap 0N/A * The boostrap class loader is assumed to be represented by null. 0N/A * We do not check that the method really overrides 0N/A * (it might be static, private or package private). 0N/A // Need to check non-bootstraps. 0N/A * Parameter types of coalesceEvents(AWTEvent,AWTEVent). 0N/A * Indicates whether a class or its superclasses override coalesceEvents. 0N/A * Must be called with lock on coalesceMap and privileged. 0N/A * @see checkCoalsecing 0N/A // First check superclass - we may not need to bother ourselves. 0N/A // Only occurs on implementations that 0N/A // do not use null to represent the bootsrap class loader. 0N/A // Not done already - recurse. 0N/A // Throws if not overriden. 0N/A // Not present in this class. 0N/A * Indicates whether coalesceEvents may do something. 0N/A * Potentially coalesce an event being posted with an existing 0N/A * event. This method is called by <code>EventQueue.postEvent</code> 0N/A * if an event with the same ID as the event to be posted is found in 0N/A * the queue (both events must have this component as their source). 0N/A * This method either returns a coalesced event which replaces 0N/A * the existing event (and the new event is then discarded), or 0N/A * <code>null</code> to indicate that no combining should be done 0N/A * (add the second event to the end of the queue). Either event 0N/A * parameter may be modified and returned, as the other one is discarded 0N/A * unless <code>null</code> is returned. 0N/A * This implementation of <code>coalesceEvents</code> coalesces 0N/A * two event types: mouse move (and drag) events, 0N/A * and paint (and update) events. 0N/A * For mouse move events the last event is always returned, causing 0N/A * intermediate moves to be discarded. For paint events, the new 0N/A * event is coalesced into a complex <code>RepaintArea</code> in the peer. 0N/A * The new <code>AWTEvent</code> is always returned. 0N/A * @param existingEvent the event already on the <code>EventQueue</code> 0N/A * @param newEvent the event being posted to the 0N/A * <code>EventQueue</code> 0N/A * @return a coalesced event, or <code>null</code> indicating that no 0N/A * coalescing was done 0N/A * Processes events occurring on this component. By default this 0N/A * method calls the appropriate 0N/A * <code>process<event type>Event</code> 0N/A * method for the given class of event. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the event 0N/A * @see #processComponentEvent 0N/A * @see #processFocusEvent 0N/A * @see #processKeyEvent 0N/A * @see #processMouseEvent 0N/A * @see #processMouseMotionEvent 0N/A * @see #processInputMethodEvent 0N/A * @see #processHierarchyEvent 0N/A * @see #processMouseWheelEvent 0N/A * Processes component events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>ComponentListener</code> objects. 0N/A * This method is not called unless component events are 0N/A * enabled for this component. Component events are enabled 0N/A * when one of the following occurs: 0N/A * <li>A <code>ComponentListener</code> object is registered 0N/A * via <code>addComponentListener</code>. 0N/A * <li>Component events are enabled via <code>enableEvents</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the component event 0N/A * @see java.awt.event.ComponentEvent 0N/A * @see java.awt.event.ComponentListener 0N/A * @see #addComponentListener 0N/A * @see #enableEvents 0N/A * Processes focus events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>FocusListener</code> objects. 0N/A * This method is not called unless focus events are 0N/A * enabled for this component. Focus events are enabled 0N/A * when one of the following occurs: 0N/A * <li>A <code>FocusListener</code> object is registered 0N/A * via <code>addFocusListener</code>. 0N/A * <li>Focus events are enabled via <code>enableEvents</code>. 0N/A * If focus events are enabled for a <code>Component</code>, 0N/A * the current <code>KeyboardFocusManager</code> determines 0N/A * whether or not a focus event should be dispatched to 0N/A * registered <code>FocusListener</code> objects. If the 0N/A * events are to be dispatched, the <code>KeyboardFocusManager</code> 0N/A * calls the <code>Component</code>'s <code>dispatchEvent</code> 0N/A * method, which results in a call to the <code>Component</code>'s 0N/A * <code>processFocusEvent</code> method. 0N/A * If focus events are enabled for a <code>Component</code>, calling 0N/A * the <code>Component</code>'s <code>dispatchEvent</code> method 0N/A * with a <code>FocusEvent</code> as the argument will result in a 0N/A * call to the <code>Component</code>'s <code>processFocusEvent</code> 0N/A * method regardless of the current <code>KeyboardFocusManager</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the focus event 0N/A * @see java.awt.event.FocusEvent 0N/A * @see java.awt.event.FocusListener 0N/A * @see java.awt.KeyboardFocusManager 0N/A * @see #addFocusListener 0N/A * @see #enableEvents 0N/A * @see #dispatchEvent 0N/A * Processes key events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>KeyListener</code> objects. 0N/A * This method is not called unless key events are 0N/A * enabled for this component. Key events are enabled 0N/A * when one of the following occurs: 0N/A * <li>A <code>KeyListener</code> object is registered 0N/A * via <code>addKeyListener</code>. 0N/A * <li>Key events are enabled via <code>enableEvents</code>. 0N/A * If key events are enabled for a <code>Component</code>, 0N/A * the current <code>KeyboardFocusManager</code> determines 0N/A * whether or not a key event should be dispatched to 0N/A * registered <code>KeyListener</code> objects. The 0N/A * <code>DefaultKeyboardFocusManager</code> will not dispatch 0N/A * key events to a <code>Component</code> that is not the focus 0N/A * owner or is not showing. 0N/A * As of J2SE 1.4, <code>KeyEvent</code>s are redirected to 0N/A * the focus owner. Please see the 0N/A * for further information. 0N/A * Calling a <code>Component</code>'s <code>dispatchEvent</code> 0N/A * method with a <code>KeyEvent</code> as the argument will 0N/A * result in a call to the <code>Component</code>'s 0N/A * <code>processKeyEvent</code> method regardless of the 0N/A * current <code>KeyboardFocusManager</code> as long as the 0N/A * component is showing, focused, and enabled, and key events 0N/A * are enabled on it. 0N/A * <p>If the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the key event 0N/A * @see java.awt.event.KeyEvent 0N/A * @see java.awt.event.KeyListener 0N/A * @see java.awt.KeyboardFocusManager 0N/A * @see java.awt.DefaultKeyboardFocusManager 0N/A * @see #processEvent 0N/A * @see #dispatchEvent 0N/A * @see #addKeyListener 0N/A * @see #enableEvents 0N/A * Processes mouse events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>MouseListener</code> objects. 0N/A * This method is not called unless mouse events are 0N/A * enabled for this component. Mouse events are enabled 0N/A * when one of the following occurs: 0N/A * <li>A <code>MouseListener</code> object is registered 0N/A * via <code>addMouseListener</code>. 0N/A * <li>Mouse events are enabled via <code>enableEvents</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the mouse event 0N/A * @see java.awt.event.MouseEvent 0N/A * @see java.awt.event.MouseListener 0N/A * @see #addMouseListener 0N/A * @see #enableEvents 0N/A * Processes mouse motion events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>MouseMotionListener</code> objects. 0N/A * This method is not called unless mouse motion events are 0N/A * enabled for this component. Mouse motion events are enabled 0N/A * when one of the following occurs: 0N/A * <li>A <code>MouseMotionListener</code> object is registered 0N/A * via <code>addMouseMotionListener</code>. 0N/A * <li>Mouse motion events are enabled via <code>enableEvents</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the mouse motion event 0N/A * @see java.awt.event.MouseEvent 0N/A * @see java.awt.event.MouseMotionListener 0N/A * @see #addMouseMotionListener 0N/A * @see #enableEvents 0N/A * Processes mouse wheel events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>MouseWheelListener</code> objects. 0N/A * This method is not called unless mouse wheel events are 0N/A * enabled for this component. Mouse wheel events are enabled 0N/A * when one of the following occurs: 0N/A * <li>A <code>MouseWheelListener</code> object is registered 0N/A * via <code>addMouseWheelListener</code>. 0N/A * <li>Mouse wheel events are enabled via <code>enableEvents</code>. 0N/A * For information on how mouse wheel events are dispatched, see 0N/A * the class description for {@link MouseWheelEvent}. 0N/A * Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the mouse wheel event 0N/A * @see java.awt.event.MouseWheelEvent 0N/A * @see java.awt.event.MouseWheelListener 0N/A * @see #addMouseWheelListener 0N/A * @see #enableEvents 0N/A * Processes input method events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>InputMethodListener</code> objects. 0N/A * This method is not called unless input method events 0N/A * are enabled for this component. Input method events are enabled 0N/A * when one of the following occurs: 0N/A * <li>An <code>InputMethodListener</code> object is registered 0N/A * via <code>addInputMethodListener</code>. 0N/A * <li>Input method events are enabled via <code>enableEvents</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the input method event 0N/A * @see java.awt.event.InputMethodEvent 0N/A * @see java.awt.event.InputMethodListener 0N/A * @see #addInputMethodListener 0N/A * @see #enableEvents 0N/A * Processes hierarchy events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>HierarchyListener</code> objects. 0N/A * This method is not called unless hierarchy events 0N/A * are enabled for this component. Hierarchy events are enabled 0N/A * when one of the following occurs: 0N/A * <li>An <code>HierarchyListener</code> object is registered 0N/A * via <code>addHierarchyListener</code>. 0N/A * <li>Hierarchy events are enabled via <code>enableEvents</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the hierarchy event 0N/A * @see java.awt.event.HierarchyEvent 0N/A * @see java.awt.event.HierarchyListener 0N/A * @see #addHierarchyListener 0N/A * @see #enableEvents 0N/A * Processes hierarchy bounds events occurring on this component by 0N/A * dispatching them to any registered 0N/A * <code>HierarchyBoundsListener</code> objects. 0N/A * This method is not called unless hierarchy bounds events 0N/A * are enabled for this component. Hierarchy bounds events are enabled 0N/A * when one of the following occurs: 0N/A * <li>An <code>HierarchyBoundsListener</code> object is registered 0N/A * via <code>addHierarchyBoundsListener</code>. 0N/A * <li>Hierarchy bounds events are enabled via <code>enableEvents</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the hierarchy event 0N/A * @see java.awt.event.HierarchyEvent 0N/A * @see java.awt.event.HierarchyBoundsListener 0N/A * @see #addHierarchyBoundsListener 0N/A * @see #enableEvents 0N/A * @deprecated As of JDK version 1.1 0N/A * replaced by processEvent(AWTEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processMouseEvent(MouseEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processMouseMotionEvent(MouseEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processMouseEvent(MouseEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processMouseMotionEvent(MouseEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processMouseEvent(MouseEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processMouseEvent(MouseEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processKeyEvent(KeyEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processKeyEvent(KeyEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * should register this component as ActionListener on component 0N/A * which fires action events. 0N/A * Makes this <code>Component</code> displayable by connecting it to a 0N/A * native screen resource. 0N/A * This method is called internally by the toolkit and should 0N/A * not be called directly by programs. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @see #isDisplayable 0N/A * @see #removeNotify 0N/A // Update both the Component's peer variable and the local 0N/A // variable we use for thread safety. 0N/A // This is a lightweight component which means it won't be 0N/A // able to get window-related events by itself. If any 0N/A // have been enabled, then the nearest native container must 1891N/A // It's native. If the parent is lightweight it will need some 0N/A // Update stacking order 0N/A * Makes this <code>Component</code> undisplayable by destroying it native 0N/A * This method is called by the toolkit internally and should 0N/A * not be called directly by programs. Code overriding 0N/A * this method should call <code>super.removeNotify</code> as 0N/A * the first line of the overriding method. 0N/A * @see #isDisplayable 0N/A // If there is any input context for this component, notify 0N/A // that this component is being removed. (This has to be done 0N/A // before hiding peer.) 0N/A // Hide peer first to stop system events such as cursor moves. 886N/A // Nullifying compoundShape means that the component has normal shape 886N/A // (or has no shape at all). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processFocusEvent(FocusEvent). 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by processFocusEvent(FocusEvent). 0N/A * Returns whether this <code>Component</code> can become the focus 0N/A * @return <code>true</code> if this <code>Component</code> is 0N/A * focusable; <code>false</code> otherwise 0N/A * @see #setFocusable 0N/A * @deprecated As of 1.4, replaced by <code>isFocusable()</code>. 0N/A * Returns whether this Component can be focused. 0N/A * @return <code>true</code> if this Component is focusable; 0N/A * <code>false</code> otherwise. 0N/A * @see #setFocusable 0N/A * Sets the focusable state of this Component to the specified value. This 0N/A * value overrides the Component's default focusability. 0N/A * @param focusable indicates whether this Component is focusable 0N/A synchronized (
this) {
0N/A * Sets the focus traversal keys for a given traversal operation for this 0N/A * The default values for a Component's focus traversal keys are 0N/A * implementation-dependent. Sun recommends that all implementations for a 0N/A * particular native platform use the same default values. The 0N/A * recommendations for Windows and Unix are listed below. These 0N/A * recommendations are used in the Sun AWT implementations. 0N/A * <table border=1 summary="Recommended default values for a Component's focus traversal keys"> 0N/A * <th>Identifier</th> 0N/A * <td>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</td> 0N/A * <td>Normal forward keyboard traversal</td> 0N/A * <td>TAB on KEY_PRESSED, CTRL-TAB on KEY_PRESSED</td> 0N/A * <td>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</td> 0N/A * <td>Normal reverse keyboard traversal</td> 0N/A * <td>SHIFT-TAB on KEY_PRESSED, CTRL-SHIFT-TAB on KEY_PRESSED</td> 0N/A * <td>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</td> 0N/A * <td>Go up one focus traversal cycle</td> 0N/A * To disable a traversal key, use an empty Set; Collections.EMPTY_SET is 0N/A * Using the AWTKeyStroke API, client code can specify on which of two 0N/A * specific KeyEvents, KEY_PRESSED or KEY_RELEASED, the focus traversal 0N/A * operation will occur. Regardless of which KeyEvent is specified, 0N/A * however, all KeyEvents related to the focus traversal key, including the 0N/A * associated KEY_TYPED event, will be consumed, and will not be dispatched 0N/A * to any Component. It is a runtime error to specify a KEY_TYPED event as 0N/A * mapping to a focus traversal operation, or to map the same event to 0N/A * multiple default focus traversal operations. 0N/A * If a value of null is specified for the Set, this Component inherits the 0N/A * Set from its parent. If all ancestors of this Component have null 0N/A * specified for the Set, then the current KeyboardFocusManager's default 0N/A * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or 0N/A * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS 0N/A * @param keystrokes the Set of AWTKeyStroke for the specified operation 0N/A * @see #getFocusTraversalKeys 0N/A * @see KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS 0N/A * @see KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS 0N/A * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS 0N/A * @throws IllegalArgumentException if id is not one of 0N/A * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or 0N/A * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or if keystrokes 0N/A * contains null, or if any Object in keystrokes is not an 0N/A * AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, 0N/A * or if any keystroke already maps to another focus traversal 0N/A * operation for this Component 0N/A * Returns the Set of focus traversal keys for a given traversal operation 0N/A * for this Component. (See 0N/A * <code>setFocusTraversalKeys</code> for a full description of each key.) 0N/A * If a Set of traversal keys has not been explicitly defined for this 0N/A * Component, then this Component's parent's Set is returned. If no Set 0N/A * has been explicitly defined for any of this Component's ancestors, then 0N/A * the current KeyboardFocusManager's default Set is returned. 0N/A * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or 0N/A * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS 0N/A * @return the Set of AWTKeyStrokes for the specified operation. The Set 0N/A * will be unmodifiable, and may be empty. null will never be 0N/A * @see #setFocusTraversalKeys 0N/A * @see KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS 0N/A * @see KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS 0N/A * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS 0N/A * @throws IllegalArgumentException if id is not one of 0N/A * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or 0N/A * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS 0N/A // We define these methods so that Container does not need to repeat this 0N/A // code. Container cannot call super.<method> because Container allows 0N/A // DOWN_CYCLE_TRAVERSAL_KEY while Component does not. The Component method 0N/A // would erroneously generate an IllegalArgumentException for 0N/A // DOWN_CYCLE_TRAVERSAL_KEY. 0N/A synchronized (
this) {
0N/A //According to javadoc this method should throw IAE instead of ClassCastException 0N/A // Okay to return Set directly because it is an unmodifiable view 0N/A * Returns whether the Set of focus traversal keys for the given focus 0N/A * traversal operation has been explicitly defined for this Component. If 0N/A * this method returns <code>false</code>, this Component is inheriting the 0N/A * Set from an ancestor, or from the current KeyboardFocusManager. 0N/A * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or 0N/A * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS 0N/A * @return <code>true</code> if the the Set of focus traversal keys for the 0N/A * given focus traversal operation has been explicitly defined for 0N/A * this Component; <code>false</code> otherwise. 0N/A * @throws IllegalArgumentException if id is not one of 0N/A * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or 0N/A * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS 0N/A * Sets whether focus traversal keys are enabled for this Component. 0N/A * Components for which focus traversal keys are disabled receive key 0N/A * events for focus traversal keys. Components for which focus traversal 0N/A * keys are enabled do not see these events; instead, the events are 0N/A * automatically converted to traversal operations. 0N/A * @param focusTraversalKeysEnabled whether focus traversal keys are 0N/A * enabled for this Component 0N/A * @see #getFocusTraversalKeysEnabled 0N/A * @see #setFocusTraversalKeys 0N/A * @see #getFocusTraversalKeys 0N/A synchronized (
this) {
0N/A * Returns whether focus traversal keys are enabled for this Component. 0N/A * Components for which focus traversal keys are disabled receive key 0N/A * events for focus traversal keys. Components for which focus traversal 0N/A * keys are enabled do not see these events; instead, the events are 0N/A * automatically converted to traversal operations. 0N/A * @return whether focus traversal keys are enabled for this Component 0N/A * @see #setFocusTraversalKeysEnabled 0N/A * @see #setFocusTraversalKeys 0N/A * @see #getFocusTraversalKeys 0N/A * Requests that this Component get the input focus, and that this 0N/A * Component's top-level ancestor become the focused Window. This 0N/A * component must be displayable, focusable, visible and all of 0N/A * its ancestors (with the exception of the top-level Window) must 0N/A * be visible for the request to be granted. Every effort will be 0N/A * made to honor the request; however, in some cases it may be 0N/A * impossible to do so. Developers must never assume that this 0N/A * Component is the focus owner until this Component receives a 0N/A * FOCUS_GAINED event. If this request is denied because this 0N/A * Component's top-level Window cannot become the focused Window, 0N/A * the request will be remembered and will be granted when the 0N/A * Window is later focused by the user. 0N/A * This method cannot be used to set the focus owner to no Component at 0N/A * all. Use <code>KeyboardFocusManager.clearGlobalFocusOwner()</code> 0N/A * Because the focus behavior of this method is platform-dependent, 0N/A * developers are strongly encouraged to use 0N/A * <code>requestFocusInWindow</code> when possible. 0N/A * <p>Note: Not all focus transfers result from invoking this method. As 0N/A * such, a component may receive focus without this or any of the other 0N/A * {@code requestFocus} methods of {@code Component} being invoked. 0N/A * @see #requestFocusInWindow 0N/A * @see java.awt.event.FocusEvent 0N/A * @see #addFocusListener 0N/A * @see #isDisplayable 0N/A * @see KeyboardFocusManager#clearGlobalFocusOwner 0N/A * Requests that this <code>Component</code> get the input focus, 0N/A * and that this <code>Component</code>'s top-level ancestor 0N/A * become the focused <code>Window</code>. This component must be 0N/A * displayable, focusable, visible and all of its ancestors (with 0N/A * the exception of the top-level Window) must be visible for the 0N/A * request to be granted. Every effort will be made to honor the 0N/A * request; however, in some cases it may be impossible to do 0N/A * so. Developers must never assume that this component is the 0N/A * focus owner until this component receives a FOCUS_GAINED 0N/A * event. If this request is denied because this component's 0N/A * top-level window cannot become the focused window, the request 0N/A * will be remembered and will be granted when the window is later 0N/A * focused by the user. 0N/A * This method returns a boolean value. If <code>false</code> is returned, 0N/A * the request is <b>guaranteed to fail</b>. If <code>true</code> is 0N/A * returned, the request will succeed <b>unless</b> it is vetoed, or an 0N/A * extraordinary event, such as disposal of the component's peer, occurs 0N/A * before the request can be granted by the native windowing system. Again, 0N/A * while a return value of <code>true</code> indicates that the request is 0N/A * likely to succeed, developers must never assume that this component is 0N/A * the focus owner until this component receives a FOCUS_GAINED event. 0N/A * This method cannot be used to set the focus owner to no component at 0N/A * all. Use <code>KeyboardFocusManager.clearGlobalFocusOwner</code> 0N/A * Because the focus behavior of this method is platform-dependent, 0N/A * developers are strongly encouraged to use 0N/A * <code>requestFocusInWindow</code> when possible. 0N/A * Every effort will be made to ensure that <code>FocusEvent</code>s 0N/A * result of this request will have the specified temporary value. However, 0N/A * because specifying an arbitrary temporary state may not be implementable 0N/A * on all native windowing systems, correct behavior for this method can be 0N/A * guaranteed only for lightweight <code>Component</code>s. 0N/A * This method is not intended 0N/A * for general use, but exists instead as a hook for lightweight component 0N/A * libraries, such as Swing. 0N/A * <p>Note: Not all focus transfers result from invoking this method. As 0N/A * such, a component may receive focus without this or any of the other 0N/A * {@code requestFocus} methods of {@code Component} being invoked. 0N/A * @param temporary true if the focus change is temporary, 0N/A * such as when the window loses the focus; for 0N/A * more information on temporary focus changes see the 0N/A * @return <code>false</code> if the focus change request is guaranteed to 0N/A * fail; <code>true</code> if it is likely to succeed 0N/A * @see java.awt.event.FocusEvent 0N/A * @see #addFocusListener 0N/A * @see #isDisplayable 0N/A * @see KeyboardFocusManager#clearGlobalFocusOwner 0N/A * Requests that this Component get the input focus, if this 0N/A * Component's top-level ancestor is already the focused 0N/A * Window. This component must be displayable, focusable, visible 0N/A * and all of its ancestors (with the exception of the top-level 0N/A * Window) must be visible for the request to be granted. Every 0N/A * effort will be made to honor the request; however, in some 0N/A * cases it may be impossible to do so. Developers must never 0N/A * assume that this Component is the focus owner until this 0N/A * Component receives a FOCUS_GAINED event. 0N/A * This method returns a boolean value. If <code>false</code> is returned, 0N/A * the request is <b>guaranteed to fail</b>. If <code>true</code> is 0N/A * returned, the request will succeed <b>unless</b> it is vetoed, or an 0N/A * extraordinary event, such as disposal of the Component's peer, occurs 0N/A * before the request can be granted by the native windowing system. Again, 0N/A * while a return value of <code>true</code> indicates that the request is 0N/A * likely to succeed, developers must never assume that this Component is 0N/A * the focus owner until this Component receives a FOCUS_GAINED event. 0N/A * This method cannot be used to set the focus owner to no Component at 0N/A * all. Use <code>KeyboardFocusManager.clearGlobalFocusOwner()</code> 0N/A * The focus behavior of this method can be implemented uniformly across 0N/A * platforms, and thus developers are strongly encouraged to use this 0N/A * method over <code>requestFocus</code> when possible. Code which relies 0N/A * on <code>requestFocus</code> may exhibit different focus behavior on 0N/A * different platforms. 0N/A * <p>Note: Not all focus transfers result from invoking this method. As 0N/A * such, a component may receive focus without this or any of the other 0N/A * {@code requestFocus} methods of {@code Component} being invoked. 0N/A * @return <code>false</code> if the focus change request is guaranteed to 0N/A * fail; <code>true</code> if it is likely to succeed 0N/A * @see #requestFocus 0N/A * @see java.awt.event.FocusEvent 0N/A * @see #addFocusListener 0N/A * @see #isDisplayable 0N/A * @see KeyboardFocusManager#clearGlobalFocusOwner 0N/A * Requests that this <code>Component</code> get the input focus, 0N/A * if this <code>Component</code>'s top-level ancestor is already 0N/A * the focused <code>Window</code>. This component must be 0N/A * displayable, focusable, visible and all of its ancestors (with 0N/A * the exception of the top-level Window) must be visible for the 0N/A * request to be granted. Every effort will be made to honor the 0N/A * request; however, in some cases it may be impossible to do 0N/A * so. Developers must never assume that this component is the 0N/A * focus owner until this component receives a FOCUS_GAINED event. 0N/A * This method returns a boolean value. If <code>false</code> is returned, 0N/A * the request is <b>guaranteed to fail</b>. If <code>true</code> is 0N/A * returned, the request will succeed <b>unless</b> it is vetoed, or an 0N/A * extraordinary event, such as disposal of the component's peer, occurs 0N/A * before the request can be granted by the native windowing system. Again, 0N/A * while a return value of <code>true</code> indicates that the request is 0N/A * likely to succeed, developers must never assume that this component is 0N/A * the focus owner until this component receives a FOCUS_GAINED event. 0N/A * This method cannot be used to set the focus owner to no component at 0N/A * all. Use <code>KeyboardFocusManager.clearGlobalFocusOwner</code> 0N/A * The focus behavior of this method can be implemented uniformly across 0N/A * platforms, and thus developers are strongly encouraged to use this 0N/A * method over <code>requestFocus</code> when possible. Code which relies 0N/A * on <code>requestFocus</code> may exhibit different focus behavior on 0N/A * different platforms. 0N/A * Every effort will be made to ensure that <code>FocusEvent</code>s 0N/A * result of this request will have the specified temporary value. However, 0N/A * because specifying an arbitrary temporary state may not be implementable 0N/A * on all native windowing systems, correct behavior for this method can be 0N/A * guaranteed only for lightweight components. This method is not intended 0N/A * for general use, but exists instead as a hook for lightweight component 0N/A * libraries, such as Swing. 0N/A * <p>Note: Not all focus transfers result from invoking this method. As 0N/A * such, a component may receive focus without this or any of the other 0N/A * {@code requestFocus} methods of {@code Component} being invoked. 0N/A * @param temporary true if the focus change is temporary, 0N/A * such as when the window loses the focus; for 0N/A * more information on temporary focus changes see the 0N/A * @return <code>false</code> if the focus change request is guaranteed to 0N/A * fail; <code>true</code> if it is likely to succeed 0N/A * @see #requestFocus 0N/A * @see java.awt.event.FocusEvent 0N/A * @see #addFocusListener 0N/A * @see #isDisplayable 0N/A * @see KeyboardFocusManager#clearGlobalFocusOwner 0N/A // Update most-recent map 0N/A // Focus this Component 0N/A // We have passed all regular checks for focus request, 0N/A // now let's call RequestFocusController and see what it says. 0N/A // sometimes most recent focus owner may be null, but focus owner is not 0N/A // e.g. we reset most recent focus owner if user removes focus owner 0N/A // Controller is supposed to verify focus transfers and for this it 0N/A // should know both from and to components. And it shouldn't verify 0N/A // transfers from when these components are equal. 0N/A // we shouldn't call RequestFocusController in case we are 0N/A // in activation. We do request focus on component which 0N/A // has got temporary focus lost and then on component which is 0N/A // most recent focus owner. But most recent focus owner can be 0N/A // changed by requestFocsuXXX() call only, so this transfer has 0N/A // been already approved. 0N/A // Swing access this method through reflection to implement InputVerifier's functionality. 0N/A // Perhaps, we should make this method public (later ;) 0N/A * Returns the Container which is the focus cycle root of this Component's 0N/A * focus traversal cycle. Each focus traversal cycle has only a single 0N/A * focus cycle root and each Component which is not a Container belongs to 0N/A * only a single focus traversal cycle. Containers which are focus cycle 0N/A * roots belong to two cycles: one rooted at the Container itself, and one 0N/A * rooted at the Container's nearest focus-cycle-root ancestor. For such 0N/A * Containers, this method will return the Container's nearest focus-cycle- 0N/A * @return this Component's nearest focus-cycle-root ancestor 0N/A * @see Container#isFocusCycleRoot() 0N/A * Returns whether the specified Container is the focus cycle root of this 0N/A * Component's focus traversal cycle. Each focus traversal cycle has only 0N/A * a single focus cycle root and each Component which is not a Container 0N/A * belongs to only a single focus traversal cycle. 0N/A * @param container the Container to be tested 0N/A * @return <code>true</code> if the specified Container is a focus-cycle- 0N/A * root of this Component; <code>false</code> otherwise 0N/A * @see Container#isFocusCycleRoot() 218N/A * Transfers the focus to the next component, as though this Component were 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by transferFocus(). 0N/A * Transfers the focus to the previous component, as though this Component 0N/A * were the focus owner. 0N/A * @see #requestFocus() 0N/A * Transfers the focus up one focus traversal cycle. Typically, the focus 0N/A * owner is set to this Component's focus cycle root, and the current focus 0N/A * cycle root is set to the new focus owner's focus cycle root. If, 0N/A * however, this Component's focus cycle root is a Window, then the focus 0N/A * owner is set to the focus cycle root's default Component to focus, and 0N/A * the current focus cycle root is unchanged. 0N/A * @see #requestFocus() 0N/A * @see Container#isFocusCycleRoot() 0N/A * @see Container#setFocusCycleRoot(boolean) 0N/A * Returns <code>true</code> if this <code>Component</code> is the 0N/A * focus owner. This method is obsolete, and has been replaced by 0N/A * <code>isFocusOwner()</code>. 0N/A * @return <code>true</code> if this <code>Component</code> is the 0N/A * focus owner; <code>false</code> otherwise 0N/A * Returns <code>true</code> if this <code>Component</code> is the 0N/A * @return <code>true</code> if this <code>Component</code> is the 0N/A * focus owner; <code>false</code> otherwise 218N/A * Used to disallow auto-focus-transfer on disposal of the focus owner 218N/A * in the process of disposing its parent container. 0N/A * Adds the specified popup menu to the component. 0N/A * @param popup the popup menu to be added to the component. 0N/A * @see #remove(MenuComponent) 0N/A * @exception NullPointerException if {@code popup} is {@code null} 0N/A * Removes the specified popup menu from the component. 0N/A * @param popup the popup menu to be removed 0N/A * @see #add(PopupMenu) 0N/A * Returns a string representing the state of this component. This 0N/A * method is intended to be used only for debugging purposes, and the 0N/A * content and format of the returned string may vary between 0N/A * implementations. The returned string may be empty but may not be 0N/A * <code>null</code>. 0N/A * @return a string representation of this component's state 0N/A * Returns a string representation of this component and its values. 0N/A * @return a string representation of this component 0N/A * Prints a listing of this component to the standard system output 0N/A * stream <code>System.out</code>. 0N/A * @see java.lang.System#out 0N/A * Prints a listing of this component to the specified output 0N/A * @param out a print stream 3025N/A * @throws NullPointerException if {@code out} is {@code null} 0N/A * Prints out a list, starting at the specified indentation, to the 0N/A * specified print stream. 0N/A * @param out a print stream 0N/A * @param indent number of spaces to indent 0N/A * @see java.io.PrintStream#println(java.lang.Object) 3025N/A * @throws NullPointerException if {@code out} is {@code null} 0N/A * Prints a listing to the specified print writer. 0N/A * @param out the print writer to print to 3025N/A * @throws NullPointerException if {@code out} is {@code null} 0N/A * Prints out a list, starting at the specified indentation, to 0N/A * the specified print writer. 0N/A * @param out the print writer to print to 0N/A * @param indent the number of spaces to indent 3025N/A * @throws NullPointerException if {@code out} is {@code null} 0N/A * @see java.io.PrintStream#println(java.lang.Object) 0N/A * Fetches the native container somewhere higher up in the component 0N/A * tree that contains this component. 0N/A * Adds a PropertyChangeListener to the listener list. The listener is 0N/A * registered for all bound properties of this class, including the 0N/A * <li>this Component's font ("font")</li> 0N/A * <li>this Component's background color ("background")</li> 0N/A * <li>this Component's foreground color ("foreground")</li> 0N/A * <li>this Component's focusability ("focusable")</li> 0N/A * <li>this Component's focus traversal keys enabled state 0N/A * ("focusTraversalKeysEnabled")</li> 0N/A * <li>this Component's Set of FORWARD_TRAVERSAL_KEYS 0N/A * ("forwardFocusTraversalKeys")</li> 0N/A * <li>this Component's Set of BACKWARD_TRAVERSAL_KEYS 0N/A * ("backwardFocusTraversalKeys")</li> 0N/A * <li>this Component's Set of UP_CYCLE_TRAVERSAL_KEYS 0N/A * ("upCycleFocusTraversalKeys")</li> 0N/A * <li>this Component's preferred size ("preferredSize")</li> 0N/A * <li>this Component's minimum size ("minimumSize")</li> 0N/A * <li>this Component's maximum size ("maximumSize")</li> 0N/A * <li>this Component's name ("name")</li> 0N/A * Note that if this <code>Component</code> is inheriting a bound property, then no 0N/A * event will be fired in response to a change in the inherited property. 0N/A * If <code>listener</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * @param listener the property change listener to be added 0N/A * @see #removePropertyChangeListener 0N/A * @see #getPropertyChangeListeners 0N/A * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) 0N/A * Removes a PropertyChangeListener from the listener list. This method 0N/A * should be used to remove PropertyChangeListeners that were registered 0N/A * for all bound properties of this class. 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param listener the PropertyChangeListener to be removed 0N/A * @see #addPropertyChangeListener 0N/A * @see #getPropertyChangeListeners 0N/A * @see #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) 0N/A * Returns an array of all the property change listeners 0N/A * registered on this component. 0N/A * @return all of this component's <code>PropertyChangeListener</code>s 0N/A * or an empty array if no property change 0N/A * listeners are currently registered 0N/A * @see #addPropertyChangeListener 0N/A * @see #removePropertyChangeListener 0N/A * @see #getPropertyChangeListeners(java.lang.String) 0N/A * @see java.beans.PropertyChangeSupport#getPropertyChangeListeners 0N/A * Adds a PropertyChangeListener to the listener list for a specific 0N/A * property. The specified property may be user-defined, or one of the 0N/A * <li>this Component's font ("font")</li> 0N/A * <li>this Component's background color ("background")</li> 0N/A * <li>this Component's foreground color ("foreground")</li> 0N/A * <li>this Component's focusability ("focusable")</li> 0N/A * <li>this Component's focus traversal keys enabled state 0N/A * ("focusTraversalKeysEnabled")</li> 0N/A * <li>this Component's Set of FORWARD_TRAVERSAL_KEYS 0N/A * ("forwardFocusTraversalKeys")</li> 0N/A * <li>this Component's Set of BACKWARD_TRAVERSAL_KEYS 0N/A * ("backwardFocusTraversalKeys")</li> 0N/A * <li>this Component's Set of UP_CYCLE_TRAVERSAL_KEYS 0N/A * ("upCycleFocusTraversalKeys")</li> 0N/A * Note that if this <code>Component</code> is inheriting a bound property, then no 0N/A * event will be fired in response to a change in the inherited property. 0N/A * If <code>propertyName</code> or <code>listener</code> is <code>null</code>, 0N/A * no exception is thrown and no action is taken. 0N/A * @param propertyName one of the property names listed above 0N/A * @param listener the property change listener to be added 0N/A * @see #removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) 0N/A * @see #getPropertyChangeListeners(java.lang.String) 0N/A * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) 0N/A * Removes a <code>PropertyChangeListener</code> from the listener 0N/A * list for a specific property. This method should be used to remove 0N/A * <code>PropertyChangeListener</code>s 0N/A * that were registered for a specific bound property. 0N/A * If <code>propertyName</code> or <code>listener</code> is <code>null</code>, 0N/A * no exception is thrown and no action is taken. 0N/A * @param propertyName a valid property name 0N/A * @param listener the PropertyChangeListener to be removed 0N/A * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) 0N/A * @see #getPropertyChangeListeners(java.lang.String) 0N/A * @see #removePropertyChangeListener(java.beans.PropertyChangeListener) 0N/A * Returns an array of all the listeners which have been associated 0N/A * with the named property. 0N/A * @return all of the <code>PropertyChangeListener</code>s associated with 0N/A * the named property; if no such listeners have been added or 0N/A * if <code>propertyName</code> is <code>null</code>, an empty 0N/A * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) 0N/A * @see #removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) 0N/A * @see #getPropertyChangeListeners 0N/A * Support for reporting bound property changes for Object properties. 0N/A * This method can be called when a bound property has changed and it will 0N/A * send the appropriate PropertyChangeEvent to any registered 0N/A * PropertyChangeListeners. 0N/A * @param propertyName the property whose value has changed 0N/A * @param oldValue the property's previous value 0N/A * @param newValue the property's new value 0N/A * Support for reporting bound property changes for boolean properties. 0N/A * This method can be called when a bound property has changed and it will 0N/A * send the appropriate PropertyChangeEvent to any registered 0N/A * PropertyChangeListeners. 0N/A * @param propertyName the property whose value has changed 0N/A * @param oldValue the property's previous value 0N/A * @param newValue the property's new value 0N/A * Support for reporting bound property changes for integer properties. 0N/A * This method can be called when a bound property has changed and it will 0N/A * send the appropriate PropertyChangeEvent to any registered 0N/A * PropertyChangeListeners. 0N/A * @param propertyName the property whose value has changed 0N/A * @param oldValue the property's previous value 0N/A * @param newValue the property's new value 0N/A * Reports a bound property change. 0N/A * @param propertyName the programmatic name of the property 0N/A * @param oldValue the old value of the property (as a byte) 0N/A * @param newValue the new value of the property (as a byte) 0N/A * @see #firePropertyChange(java.lang.String, java.lang.Object, 0N/A * Reports a bound property change. 0N/A * @param propertyName the programmatic name of the property 0N/A * @param oldValue the old value of the property (as a char) 0N/A * @param newValue the new value of the property (as a char) 0N/A * @see #firePropertyChange(java.lang.String, java.lang.Object, 0N/A * Reports a bound property change. 0N/A * @param propertyName the programmatic name of the property 0N/A * @param oldValue the old value of the property (as a short) 0N/A * @param newValue the old value of the property (as a short) 0N/A * @see #firePropertyChange(java.lang.String, java.lang.Object, 0N/A * Reports a bound property change. 0N/A * @param propertyName the programmatic name of the property 0N/A * @param oldValue the old value of the property (as a long) 0N/A * @param newValue the new value of the property (as a long) 0N/A * @see #firePropertyChange(java.lang.String, java.lang.Object, 0N/A * Reports a bound property change. 0N/A * @param propertyName the programmatic name of the property 0N/A * @param oldValue the old value of the property (as a float) 0N/A * @param newValue the new value of the property (as a float) 0N/A * @see #firePropertyChange(java.lang.String, java.lang.Object, 0N/A * Reports a bound property change. 0N/A * @param propertyName the programmatic name of the property 0N/A * @param oldValue the old value of the property (as a double) 0N/A * @param newValue the new value of the property (as a double) 0N/A * @see #firePropertyChange(java.lang.String, java.lang.Object, 0N/A // Serialization support. 0N/A * Component Serialized Data Version. 0N/A * This hack is for Swing serialization. It will invoke 0N/A * the Swing package private method <code>compWriteObjectNotify</code>. 0N/A // For Swing serialization to correctly work Swing needs to 0N/A // be notified before Component does it's serialization. This 0N/A // hack accomodates this. 0N/A // Swing classes MUST be loaded by the bootstrap class loader, 0N/A // otherwise we don't consider them. 0N/A // Find the first override of the compWriteObjectNotify method 0N/A // We found it, use doPrivileged to make it accessible 0N/A // Invoke the method 0N/A // We're done, bail. 0N/A * Writes default serializable fields to stream. Writes 0N/A * a variety of serializable listeners as optional data. 0N/A * The non-serializable listeners are detected and 0N/A * no attempt is made to serialize them. 0N/A * @param s the <code>ObjectOutputStream</code> to write 0N/A * @serialData <code>null</code> terminated sequence of 0N/A * 0 or more pairs; the pair consists of a <code>String</code> 0N/A * and an <code>Object</code>; the <code>String</code> indicates 0N/A * the type of object and is one of the following (as of 1.4): 0N/A * <code>componentListenerK</code> indicating an 0N/A * <code>ComponentListener</code> object; 0N/A * <code>focusListenerK</code> indicating an 0N/A * <code>FocusListener</code> object; 0N/A * <code>keyListenerK</code> indicating an 0N/A * <code>KeyListener</code> object; 0N/A * <code>mouseListenerK</code> indicating an 0N/A * <code>MouseListener</code> object; 0N/A * <code>mouseMotionListenerK</code> indicating an 0N/A * <code>MouseMotionListener</code> object; 0N/A * <code>inputMethodListenerK</code> indicating an 0N/A * <code>InputMethodListener</code> object; 0N/A * <code>hierarchyListenerK</code> indicating an 0N/A * <code>HierarchyListener</code> object; 0N/A * <code>hierarchyBoundsListenerK</code> indicating an 0N/A * <code>HierarchyBoundsListener</code> object; 0N/A * <code>mouseWheelListenerK</code> indicating an 0N/A * <code>MouseWheelListener</code> object 0N/A * @serialData an optional <code>ComponentOrientation</code> 0N/A * (after <code>inputMethodListener</code>, as of 1.2) 0N/A * @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener) 0N/A * @see #componentListenerK 0N/A * @see #focusListenerK 0N/A * @see #keyListenerK 0N/A * @see #mouseListenerK 0N/A * @see #mouseMotionListenerK 0N/A * @see #inputMethodListenerK 0N/A * @see #hierarchyListenerK 0N/A * @see #hierarchyBoundsListenerK 0N/A * @see #mouseWheelListenerK 0N/A * @see #readObject(ObjectInputStream) 0N/A * Reads the <code>ObjectInputStream</code> and if it isn't 0N/A * <code>null</code> adds a listener to receive a variety 0N/A * of events fired by the component. 0N/A * Unrecognized keys or values will be ignored. 0N/A * @param s the <code>ObjectInputStream</code> to read 0N/A * @see #writeObject(ObjectOutputStream) 0N/A // These fields are non-transient and rely on default 0N/A // serialization. However, the default values are insufficient, 0N/A // so we need to set them explicitly for object data streams prior 0N/A else // skip value for unrecognized key 0N/A // Read the component's orientation if it's present 0N/A // JDK 1.1 instances will not have this optional data. 0N/A // e.eof will be true to indicate that there is no more 0N/A // data available for this object. 0N/A // If e.eof is not true, throw the exception as it 0N/A // might have been caused by reasons unrelated to 0N/A // componentOrientation. 0N/A // skip value for unrecognized key 0N/A // JDK 1.1/1.2 instances will not have this optional data. 0N/A // e.eof will be true to indicate that there is no more 0N/A // data available for this object. 0N/A // If e.eof is not true, throw the exception as it 0N/A // might have been caused by reasons unrelated to 0N/A // hierarchy and hierarchyBounds listeners. 0N/A // skip value for unrecognized key 0N/A // pre-1.3 instances will not have this optional data. 0N/A // e.eof will be true to indicate that there is no more 0N/A // data available for this object. 0N/A // If e.eof is not true, throw the exception as it 0N/A // might have been caused by reasons unrelated to 0N/A // mouse wheel listeners 0N/A * Sets the language-sensitive orientation that is to be used to order 0N/A * the elements or text within this component. Language-sensitive 0N/A * <code>LayoutManager</code> and <code>Component</code> 0N/A * subclasses will use this property to 0N/A * determine how to lay out and draw components. 0N/A * At construction time, a component's orientation is set to 0N/A * <code>ComponentOrientation.UNKNOWN</code>, 0N/A * indicating that it has not been specified 0N/A * explicitly. The UNKNOWN orientation behaves the same as 0N/A * <code>ComponentOrientation.LEFT_TO_RIGHT</code>. 0N/A * To set the orientation of a single component, use this method. 0N/A * To set the orientation of an entire component 0N/A * {@link #applyComponentOrientation applyComponentOrientation}. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @see ComponentOrientation 0N/A * @author Laura Werner, IBM 0N/A // This is a bound property, so report the change to 0N/A // any registered listeners. (Cheap if there are none.) 0N/A // This could change the preferred size of the Component. 0N/A * Retrieves the language-sensitive orientation that is to be used to order 0N/A * the elements or text within this component. <code>LayoutManager</code> 0N/A * and <code>Component</code> 0N/A * subclasses that wish to respect orientation should call this method to 0N/A * get the component's orientation before performing layout or drawing. 0N/A * @see ComponentOrientation 0N/A * @author Laura Werner, IBM 0N/A * Sets the <code>ComponentOrientation</code> property of this component 0N/A * and all components contained within it. 1724N/A * This method changes layout-related information, and therefore, 1724N/A * invalidates the component hierarchy. 0N/A * @param orientation the new component orientation of this component and 0N/A * the components contained within it. 0N/A * @exception NullPointerException if <code>orientation</code> is null. 0N/A * @see #setComponentOrientation 0N/A * @see #getComponentOrientation 543N/A // It is enabled, visible, focusable. 0N/A * Checks that this component meets the prerequesites to be focus owner: 0N/A * - it is enabled, visible, focusable 0N/A * - it's parents are all enabled and showing 0N/A * - top-level window is focusable 0N/A * - if focus cycle root has DefaultFocusTraversalPolicy then it also checks that this policy accepts 0N/A * this component as focus owner 0N/A // - it is enabled, visible, focusable 0N/A // - it's parents are all enabled and showing 107N/A * Fix the location of the HW component in a LW container hierarchy. 0N/A * Returns the <code>Window</code> ancestor of the component. 0N/A * @return Window ancestor of the component or component by itself if it is Window; 0N/A * null, if component is not a part of window hierarchy 0N/A * Initialize JNI field and method IDs 0N/A * --- Accessibility Support --- 0N/A * Component will contain all of the methods in interface Accessible, 0N/A * though it won't actually implement the interface - that will be up 0N/A * to the individual objects which extend Component. 0N/A * Gets the <code>AccessibleContext</code> associated 0N/A * with this <code>Component</code>. 0N/A * The method implemented by this base 0N/A * class returns null. Classes that extend <code>Component</code> 0N/A * should implement this method to return the 0N/A * <code>AccessibleContext</code> associated with the subclass. 0N/A * @return the <code>AccessibleContext</code> of this 0N/A * <code>Component</code> 0N/A * Inner class of Component used to provide default support for 0N/A * accessibility. This class is not meant to be used directly by 0N/A * application developers, but is instead meant only to be 0N/A * subclassed by component developers. 0N/A * The class used to obtain the accessible role for this object. 0N/A * Though the class is abstract, this should be called by 0N/A * Fire PropertyChange listener, if one is registered, 0N/A }
// inner class AccessibleAWTComponentHandler 0N/A * Fire PropertyChange listener, if one is registered, 0N/A * when focus events happen 0N/A }
// inner class AccessibleAWTFocusHandler 0N/A * Adds a <code>PropertyChangeListener</code> to the listener list. 0N/A * @param listener the property change listener to be added 0N/A * Remove a PropertyChangeListener from the listener list. 0N/A * This removes a PropertyChangeListener that was registered 0N/A * for all properties. 0N/A * @param listener The PropertyChangeListener to be removed 0N/A // AccessibleContext methods 0N/A * Gets the accessible name of this object. This should almost never 0N/A * return <code>java.awt.Component.getName()</code>, 0N/A * as that generally isn't a localized name, 0N/A * and doesn't have meaning for the user. If the 0N/A * object is fundamentally a text object (e.g. a menu item), the 0N/A * accessible name should be the text of the object (e.g. "save"). 0N/A * If the object has a tooltip, the tooltip text may also be an 0N/A * appropriate String to return. 0N/A * @return the localized name of the object -- can be 0N/A * <code>null</code> if this 0N/A * object does not have a name 0N/A * @see javax.accessibility.AccessibleContext#setAccessibleName 0N/A * Gets the accessible description of this object. This should be 0N/A * a concise, localized description of what this object is - what 0N/A * is its meaning to the user. If the object has a tooltip, the 0N/A * tooltip text may be an appropriate string to return, assuming 0N/A * it contains a concise description of the object (instead of just 0N/A * the name of the object - e.g. a "Save" icon on a toolbar that 0N/A * had "save" as the tooltip text shouldn't return the tooltip 0N/A * text as the description, but something like "Saves the current 0N/A * text document" instead). 0N/A * @return the localized description of the object -- can be 0N/A * <code>null</code> if this object does not have a description 0N/A * @see javax.accessibility.AccessibleContext#setAccessibleDescription 0N/A * Gets the role of this object. 0N/A * @return an instance of <code>AccessibleRole</code> 0N/A * describing the role of the object 0N/A * @see javax.accessibility.AccessibleRole 0N/A * Gets the state of this object. 0N/A * @return an instance of <code>AccessibleStateSet</code> 0N/A * containing the current state set of the object 0N/A * @see javax.accessibility.AccessibleState 0N/A * Gets the <code>Accessible</code> parent of this object. 0N/A * If the parent of this object implements <code>Accessible</code>, 0N/A * this method should simply return <code>getParent</code>. 0N/A * @return the <code>Accessible</code> parent of this 0N/A * object -- can be <code>null</code> if this 0N/A * object does not have an <code>Accessible</code> parent 0N/A * Gets the index of this object in its accessible parent. 0N/A * @return the index of this object in its parent; or -1 if this 0N/A * object does not have an accessible parent 0N/A * @see #getAccessibleParent 0N/A * Returns the number of accessible children in the object. If all 0N/A * of the children of this object implement <code>Accessible</code>, 0N/A * then this method should return the number of children of this object. 0N/A * @return the number of accessible children in the object 0N/A return 0;
// Components don't have children 0N/A * Returns the nth <code>Accessible</code> child of the object. 0N/A * @param i zero-based index of child 0N/A * @return the nth <code>Accessible</code> child of the object 0N/A return null;
// Components don't have children 0N/A * Returns the locale of this object. 0N/A * @return the locale of this object 0N/A * Gets the <code>AccessibleComponent</code> associated 0N/A * with this object if one exists. 0N/A * Otherwise return <code>null</code>. 0N/A * @return the component 0N/A // AccessibleComponent methods 0N/A * Gets the background color of this object. 0N/A * @return the background color, if supported, of the object; 0N/A * otherwise, <code>null</code> 0N/A * Sets the background color of this object. 0N/A * (For transparency, see <code>isOpaque</code>.) 0N/A * @param c the new <code>Color</code> for the background 0N/A * @see Component#isOpaque 0N/A * Gets the foreground color of this object. 0N/A * @return the foreground color, if supported, of the object; 0N/A * otherwise, <code>null</code> 0N/A * Sets the foreground color of this object. 0N/A * @param c the new <code>Color</code> for the foreground 0N/A * Gets the <code>Cursor</code> of this object. 0N/A * @return the <code>Cursor</code>, if supported, 0N/A * of the object; otherwise, <code>null</code> 0N/A * Sets the <code>Cursor</code> of this object. 0N/A * The method may have no visual effect if the Java platform 0N/A * implementation and/or the native system do not support 0N/A * changing the mouse cursor shape. 0N/A * @param cursor the new <code>Cursor</code> for the object 0N/A * Gets the <code>Font</code> of this object. 0N/A * @return the <code>Font</code>, if supported, 0N/A * for the object; otherwise, <code>null</code> 0N/A * Sets the <code>Font</code> of this object. 0N/A * @param f the new <code>Font</code> for the object 0N/A * Gets the <code>FontMetrics</code> of this object. 0N/A * @param f the <code>Font</code> 0N/A * @return the <code>FontMetrics</code>, if supported, 0N/A * the object; otherwise, <code>null</code> 0N/A * Determines if the object is enabled. 0N/A * @return true if object is enabled; otherwise, false 0N/A * Sets the enabled state of the object. 0N/A * @param b if true, enables this object; otherwise, disables it 0N/A * Determines if the object is visible. Note: this means that the 0N/A * object intends to be visible; however, it may not in fact be 0N/A * showing on the screen because one of the objects that this object 0N/A * is contained by is not visible. To determine if an object is 0N/A * showing on the screen, use <code>isShowing</code>. 0N/A * @return true if object is visible; otherwise, false 0N/A * Sets the visible state of the object. 0N/A * @param b if true, shows this object; otherwise, hides it 0N/A * Determines if the object is showing. This is determined by checking 0N/A * the visibility of the object and ancestors of the object. Note: 0N/A * this will return true even if the object is obscured by another 0N/A * (for example, it happens to be underneath a menu that was pulled 0N/A * @return true if object is showing; otherwise, false 0N/A * Checks whether the specified point is within this object's bounds, 0N/A * where the point's x and y coordinates are defined to be relative to 0N/A * the coordinate system of the object. 0N/A * @param p the <code>Point</code> relative to the 0N/A * coordinate system of the object 0N/A * @return true if object contains <code>Point</code>; otherwise false 0N/A * Returns the location of the object on the screen. 0N/A * @return location of object on screen -- can be 0N/A * <code>null</code> if this object is not on the screen 0N/A * Gets the location of the object relative to the parent in the form 0N/A * of a point specifying the object's top-left corner in the screen's 0N/A * @return an instance of Point representing the top-left corner of 0N/A * the object's bounds in the coordinate space of the screen; 0N/A * <code>null</code> if this object or its parent are not on the screen 0N/A * Sets the location of the object relative to the parent. 0N/A * @param p the coordinates of the object 0N/A * Gets the bounds of this object in the form of a Rectangle object. 0N/A * The bounds specify this object's width, height, and location 0N/A * relative to its parent. 0N/A * @return a rectangle indicating this component's bounds; 0N/A * <code>null</code> if this object is not on the screen 0N/A * Sets the bounds of this object in the form of a 0N/A * <code>Rectangle</code> object. 0N/A * The bounds specify this object's width, height, and location 0N/A * relative to its parent. 0N/A * @param r a rectangle indicating this component's bounds 0N/A * Returns the size of this object in the form of a 0N/A * <code>Dimension</code> object. The height field of the 0N/A * <code>Dimension</code> object contains this objects's 0N/A * height, and the width field of the <code>Dimension</code> 0N/A * object contains this object's width. 0N/A * @return a <code>Dimension</code> object that indicates 0N/A * the size of this component; <code>null</code> if 0N/A * this object is not on the screen 0N/A * Resizes this object so that it has width and height. 0N/A * @param d - the dimension specifying the new size of the object 0N/A * Returns the <code>Accessible</code> child, 0N/A * if one exists, contained at the local 0N/A * coordinate <code>Point</code>. Otherwise returns 0N/A * <code>null</code>. 0N/A * @param p the point defining the top-left corner of 0N/A * the <code>Accessible</code>, given in the 0N/A * coordinate space of the object's parent 0N/A * @return the <code>Accessible</code>, if it exists, 0N/A * at the specified location; else <code>null</code> 0N/A return null;
// Components don't have children 0N/A * Returns whether this object can accept focus or not. 0N/A * @return true if object can accept focus; otherwise false 0N/A * Requests focus for this object. 0N/A * Adds the specified focus listener to receive focus events from this 0N/A * @param l the focus listener 0N/A * Removes the specified focus listener so it no longer receives focus 0N/A * events from this component. 0N/A * @param l the focus listener 0N/A }
// inner class AccessibleAWTComponent 0N/A * Gets the index of this object in its accessible parent. 0N/A * If this object does not have an accessible parent, returns 0N/A * @return the index of this object in its accessible parent 0N/A * Gets the current state set of this object. 0N/A * @return an instance of <code>AccessibleStateSet</code> 0N/A * containing the current state set of the object 0N/A * @see AccessibleState 0N/A * Checks that the given object is instance of the given class. 0N/A * @param obj Object to be checked 0N/A * @param className The name of the class. Must be fully-qualified class name. 0N/A * @return true, if this object is instanceof given class, 0N/A * false, otherwise, or if obj or className is null 0N/A // ************************** MIXING CODE ******************************* 103N/A * Check whether we can trust the current bounds of the component. 103N/A * The return value of false indicates that the container of the 103N/A * component is invalid, and therefore needs to be layed out, which would 103N/A * probably mean changing the bounds of its children. 103N/A * Null-layout of the container or absence of the container mean 103N/A * the bounds of the component are final and can be trusted. 0N/A * Applies the shape to the component 0N/A * @param shape Shape to be applied to the component 0N/A // The Region class has some optimizations. That's why 0N/A // we should manually check whether it's empty and 0N/A // substitute the object ourselves. Otherwise we end up 0N/A // with some incorrect Region object with loX being 0N/A // greater than the hiX for instance. 0N/A // the Region object ourselves, so there's no any possibility 0N/A // to modify the object outside of the mixing code. 886N/A // Nullifying compoundShape means that the component has normal shape 886N/A // (or has no shape at all). 0N/A * Returns the shape previously set with applyCompoundShape(). 0N/A * If the component is LW or no shape was applied yet, 0N/A * the method returns the normal shape. 0N/A //XXX: if we allow LW components to have a shape, this must be changed 0N/A * Returns the full shape of the component located in window coordinates 0N/A //XXX: we may take into account a user-specified shape for this component 886N/A * Returns the "opaque shape" of the component. 886N/A * The opaque shape of a lightweight components is the actual shape that 886N/A * needs to be cut off of the heavyweight components in order to mix this 886N/A * lightweight component correctly with them. 886N/A * The method is overriden in the java.awt.Container to handle non-opaque 886N/A * containers containing opaque children. 886N/A * See 6637655 for details. 1615N/A // traversing the hierarchy up to the closest HW container; 1615N/A // further traversing may return a component that is not actually 1615N/A // a native sibling of this component and this kind of z-order 1615N/A // request may not be allowed by the underlying system (6852051). 0N/A /* It is assumed that: 0N/A * getComponent(getContainer().getComponentZOrder(comp)) == comp 0N/A * The assumption has been made according to the current 0N/A * implementation of the Container class. 0N/A return;
// Because applyCompoundShape() ignores such components anyway 886N/A // First, reapply shapes of my siblings 886N/A // Second, if my container is non-opaque, reapply shapes of siblings of my container 886N/A // First, cut my siblings 886N/A // Second, if my container is non-opaque, cut siblings of my container 0N/A // We cannot be sure that the peer exists at this point, so we need the argument 0N/A // to find out whether the hiding component is (well, actually was) a LW or a HW. 555N/A // This method gets overriden in the Container. Obviously, a plain 555N/A // non-container components don't need to handle validation. 0N/A // ****************** END OF MIXING CODE ******************************** 1162N/A // Note that the method is overriden in the Window class, 1162N/A // a window doesn't need to be updated in the Z-order.