/*
* Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.awt;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.Vector;
import java.util.Locale;
import java.util.EventListener;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.Collections;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.LightweightPeer;
import java.awt.image.BufferStrategy;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.image.ColorModel;
import java.awt.image.VolatileImage;
import java.awt.event.*;
import java.io.Serializable;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.Transient;
import java.awt.im.InputContext;
import java.awt.im.InputMethodRequests;
import java.awt.dnd.DropTarget;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.AccessControlContext;
import javax.accessibility.*;
import java.applet.Applet;
import sun.security.action.GetPropertyAction;
import sun.awt.AppContext;
import sun.awt.AWTAccessor;
import sun.awt.ConstrainableGraphics;
import sun.awt.SubRegionShowable;
import sun.awt.SunToolkit;
import sun.awt.WindowClosingListener;
import sun.awt.CausedFocusEvent;
import sun.awt.EmbeddedFrame;
import sun.awt.dnd.SunDropTargetEvent;
import sun.awt.im.CompositionArea;
import sun.font.FontManager;
import sun.font.FontManagerFactory;
import sun.font.SunFontManager;
import sun.java2d.SunGraphics2D;
import sun.java2d.pipe.Region;
import sun.awt.image.VSyncedBSManager;
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
import sun.awt.RequestFocusController;
import sun.java2d.SunGraphicsEnvironment;
import sun.util.logging.PlatformLogger;
/**
* A <em>component</em> is an object having a graphical representation
* that can be displayed on the screen and that can interact with the
* user. Examples of components are the buttons, checkboxes, and scrollbars
* of a typical graphical user interface. <p>
* The <code>Component</code> class is the abstract superclass of
* the nonmenu-related Abstract Window Toolkit components. Class
* <code>Component</code> can also be extended directly to create a
* lightweight component. A lightweight component is a component that is
* not associated with a native window. On the contrary, a heavyweight
* component is associated with a native window. The {@link #isLightweight()}
* method may be used to distinguish between the two kinds of the components.
* <p>
* Lightweight and heavyweight components may be mixed in a single component
* hierarchy. However, for correct operating of such a mixed hierarchy of
* components, the whole hierarchy must be valid. When the hierarchy gets
* invalidated, like after changing the bounds of components, or
* adding/removing components to/from containers, the whole hierarchy must be
* validated afterwards by means of the {@link Container#validate()} method
* invoked on the top-most invalid container of the hierarchy.
*
* <h3>Serialization</h3>
* It is important to note that only AWT listeners which conform
* to the <code>Serializable</code> protocol will be saved when
* the object is stored. If an AWT object has listeners that
* aren't marked serializable, they will be dropped at
* <code>writeObject</code> time. Developers will need, as always,
* to consider the implications of making an object serializable.
* One situation to watch out for is this:
* <pre>
* import java.awt.*;
* import java.awt.event.*;
* import java.io.Serializable;
*
* class MyApp implements ActionListener, Serializable
* {
* BigObjectThatShouldNotBeSerializedWithAButton bigOne;
* Button aButton = new Button();
*
* MyApp()
* {
* // Oops, now aButton has a listener with a reference
* // to bigOne!
* aButton.addActionListener(this);
* }
*
* public void actionPerformed(ActionEvent e)
* {
* System.out.println("Hello There");
* }
* }
* </pre>
* In this example, serializing <code>aButton</code> by itself
* will cause <code>MyApp</code> and everything it refers to
* to be serialized as well. The problem is that the listener
* is serializable by coincidence, not by design. To separate
* the decisions about <code>MyApp</code> and the
* <code>ActionListener</code> being serializable one can use a
* nested class, as in the following example:
* <pre>
* import java.awt.*;
* import java.awt.event.*;
* import java.io.Serializable;
*
* class MyApp implements java.io.Serializable
* {
* BigObjectThatShouldNotBeSerializedWithAButton bigOne;
* Button aButton = new Button();
*
* static class MyActionListener implements ActionListener
* {
* public void actionPerformed(ActionEvent e)
* {
* System.out.println("Hello There");
* }
* }
*
* MyApp()
* {
* aButton.addActionListener(new MyActionListener());
* }
* }
* </pre>
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
* <p>
* For details on the focus subsystem, see
* <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
* How to Use the Focus Subsystem</a>,
* a section in <em>The Java Tutorial</em>, and the
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
* for more information.
*
* @author Arthur van Hoff
* @author Sami Shaio
*/
public abstract class Component implements ImageObserver, MenuContainer,
Serializable
{
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Component");
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.Component");
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.Component");
private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Component");
/**
* The peer of the component. The peer implements the component's
* behavior. The peer is set when the <code>Component</code> is
* added to a container that also is a peer.
* @see #addNotify
* @see #removeNotify
*/
transient ComponentPeer peer;
/**
* The parent of the object. It may be <code>null</code>
* for top-level components.
* @see #getParent
*/
transient Container parent;
/**
* The <code>AppContext</code> of the component. Applets/Plugin may
* change the AppContext.
*/
transient AppContext appContext;
/**
* The x position of the component in the parent's coordinate system.
*
* @serial
* @see #getLocation
*/
int x;
/**
* The y position of the component in the parent's coordinate system.
*
* @serial
* @see #getLocation
*/
int y;
/**
* The width of the component.
*
* @serial
* @see #getSize
*/
int width;
/**
* The height of the component.
*
* @serial
* @see #getSize
*/
int height;
/**
* The
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
springboot常用配置- jdk8 (2000个子文件)
java.c 67KB
java_md.c 48KB
parse_manifest.c 21KB
wildcard.c 12KB
version_comp.c 10KB
main.c 3KB
splashscreen_stubs.c 2KB
jli_util.c 2KB
java.h 9KB
manifest_info.h 6KB
emessages.h 5KB
jli_util.h 3KB
defines.h 2KB
java_md.h 863B
splashscreen.h 664B
version_comp.h 552B
wildcard.h 344B
Component.java 370KB
Character.java 261KB
ConcurrentHashMap.java 256KB
Arrays.java 222KB
BigDecimal.java 217KB
Pattern.java 215KB
Collections.java 213KB
BaseRowSet.java 210KB
ResultSet.java 203KB
DateTimeFormatterBuilder.java 196KB
Container.java 190KB
Formatter.java 187KB
DecimalFormat.java 174KB
BigInteger.java 169KB
Files.java 165KB
MethodHandles.java 162KB
DatabaseMetaData.java 159KB
ObjectInputStream.java 157KB
Window.java 150KB
ForkJoinPool.java 149KB
Class.java 144KB
AffineTransform.java 143KB
Calendar.java 139KB
GregorianCalendar.java 133KB
Locale.java 133KB
ConcurrentSkipListMap.java 133KB
URI.java 131KB
CallableStatement.java 131KB
ComponentColorModel.java 131KB
ResourceBundle.java 130KB
KeyboardFocusManager.java 128KB
String.java 121KB
DualPivotQuicksort.java 114KB
Toolkit.java 111KB
Font.java 106KB
TreeMap.java 106KB
X509CertSelector.java 104KB
TextLayout.java 102KB
ZonedDateTime.java 102KB
Path2D.java 102KB
RowSet.java 100KB
Scanner.java 98KB
DateTimeFormatter.java 97KB
JapaneseImperialCalendar.java 97KB
SimpleDateFormat.java 95KB
File.java 95KB
ObjectStreamClass.java 94KB
CharacterData00.java 93KB
LocalDate.java 90KB
Math.java 90KB
HashMap.java 90KB
ObjectOutputStream.java 90KB
ColorModel.java 89KB
AbstractQueuedSynchronizer.java 89KB
CompletableFuture.java 88KB
Logger.java 88KB
GridBagLayout.java 88KB
LocalDateTime.java 88KB
Spliterators.java 84KB
OffsetDateTime.java 84KB
ClassLoader.java 82KB
CachedRowSet.java 81KB
ThreadPoolExecutor.java 80KB
AbstractQueuedLongSynchronizer.java 79KB
Raster.java 77KB
Thread.java 77KB
Nodes.java 77KB
MethodHandleImpl.java 76KB
LambdaForm.java 74KB
KeyStore.java 74KB
MethodHandle.java 73KB
LogManager.java 73KB
SecurityManager.java 73KB
MutableBigInteger.java 72KB
Collectors.java 72KB
Provider.java 71KB
Connection.java 71KB
SimpleTimeZone.java 70KB
LocalTime.java 69KB
AbstractPreferences.java 68KB
ICC_Profile.java 67KB
Socket.java 66KB
MessageFormat.java 66KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
哈哈喲
- 粉丝: 24
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功