Component. This is the top level peer
interface for widgets and defines the bulk of methods for AWT component
peers. Most component peers have to implement this interface (via one
of the subinterfaces), except menu components, which implement
MenuComponentPeer.
The peer interfaces are intended only for use in porting
the AWT. They are not intended for use by application
developers, and developers should not implement peers
nor invoke any of the peer methods directly on the peer
instances.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT_OPERATION
The default operation, which is to set size and location. |
| public static final int | NO_EMBEDDED_CHECK
A flag that is used to suppress checks for embedded frames. |
| public static final int | RESET_OPERATION
Resets the setBounds() operation to DEFAULT_OPERATION. |
| public static final int | SET_BOUNDS
Operation for |
| public static final int | SET_CLIENT_SIZE
Operation for |
| public static final int | SET_LOCATION
Operation for |
| public static final int | SET_SIZE
Operation for |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | Returns: true when the peer can determine if a component
has been obscured, false false otherwiseReturns |
| public void | coalescePaintEvent(PaintEvent
the paint event to consider to coalesce e)Called to coalesce paint events. |
| public void | createBuffers(int
the number of buffers to create numBuffers, BufferCapabilities the buffer capabilities caps)Create |
| public Image | Returns: the created imagethe width of the image width, int the height of the image height)Creates an empty image with the specified width and height. |
| public VolatileImage | Returns: the created volatile imagethe width of the image width, int the height of the image height)Creates an empty volatile image with the specified width and height. |
| public void | |
| public void | |
| public void | flip(int
the area to be flipped, upper left X coordinate x1, int the area to be flipped, upper left Y coordinate y1, int the area to be flipped, lower right X coordinate x2, int the area to be flipped, lower right Y coordinate y2, BufferCapabilities.the flip action to perform flipActionMove the back buffer to the front buffer. |
| public Image | |
| public ColorModel | Returns: the color model used by the componentReturns the color model used by the component. |
| public FontMetrics | Returns: a font metrics object to determine the metrics properties of the specified fontthe font to determine the metrics for font)Returns a font metrics object to determine the metrics properties of the specified font. |
| public Graphics | Returns: a graphics object to paint on the componentReturns a graphics object to paint on the component. |
| public GraphicsConfiguration | Returns: the graphics configuration that corresponds to this componentReturns the graphics configuration that corresponds to this component. |
| public Point | Returns: the location of the component on the screenDetermines the location of the component on the screen. |
| public Dimension | Returns: the minimum size of the componentDetermines the minimum size of the component. |
| public Dimension | Returns: the preferred size of the componentDetermines the preferred size of the component. |
| public void | |
| public boolean | Returns: true if the component handles wheel scrolling,
false otherwiseDetermines if the component handles wheel scrolling itself. |
| public boolean | Returns: true when the component takes part in the focus
traversal, false otherwiseReturns |
| public boolean | Returns: true when the component has been obscured,
false otherwiseDetermines if a component has been obscured, i.e. by an overlapping window or similar. |
| public boolean | Returns: true if appropriate reparent is supported, false otherwiseReturns whether this peer supports reparenting to another parent without destroying the peer. |
| public void | |
| public void | |
| public void | |
| public void | reparent(ContainerPeer
peer of the new parent container newContainer)Reparents this peer to the new parent referenced by
|
| public boolean | Returns: true if the focus change is guaranteed to be
granted, false otherwisethe actual lightweight child that requests the
focus lightweightChild, boolean true if the focus change is temporary,
false otherwisetrue if changing the
focus of the containing window is allowed or notthe time of the focus change request time, FocusEvent.the cause of the focus change request causeRequests focus on this component. |
| public void | |
| public void | setBounds(int
the X location of the component x, int the Y location of the component y, int the width of the component width, int the height of the component height, int the operation flag op)Sets the location or size or both of the component. |
| public void | setEnabled(boolean
true to enable the component, false
to disable itEnables or disables a component. |
| public void | |
| public void | |
| public void | setVisible(boolean
true to make a component visible,
false to make it invisibleMakes a component visible or invisible. |
| public void | setZOrder(ComponentPeer
the peer to lower this component with respect to above)Lowers this component at the bottom of the above HW peer. |
| public void | |
| public boolean | Returns: true if the peer needs to be recreated for the changes to
take effect, otherwise falsethe reference graphics configuration gc)Updates internal data structures related to the component's GC. |
| DEFAULT_OPERATION | back to summary |
|---|---|
| public static final int DEFAULT_OPERATION The default operation, which is to set size and location. Todo This is only used internally and should probably be moved outside the peer interface.
| |
| NO_EMBEDDED_CHECK | back to summary |
|---|---|
| public static final int NO_EMBEDDED_CHECK A flag that is used to suppress checks for embedded frames. Todo This is only used internally and should probably be moved outside the peer interface. | |
| RESET_OPERATION | back to summary |
|---|---|
| public static final int RESET_OPERATION Resets the setBounds() operation to DEFAULT_OPERATION. This is not
passed into Todo This is only used internally and should probably be moved outside the peer interface.
| |
| SET_BOUNDS | back to summary |
|---|---|
| public static final int SET_BOUNDS Operation for
| |
| SET_CLIENT_SIZE | back to summary |
|---|---|
| public static final int SET_CLIENT_SIZE Operation for
| |
| SET_LOCATION | back to summary |
|---|---|
| public static final int SET_LOCATION Operation for
| |
| SET_SIZE | back to summary |
|---|---|
| public static final int SET_SIZE Operation for
| |
| applyShape | back to summary |
|---|---|
| public void applyShape(Region shape) Applies the shape to the native component window.
| |
| canDetermineObscurity | back to summary |
|---|---|
| public boolean canDetermineObscurity() Returns
| |
| coalescePaintEvent | back to summary |
|---|---|
| public void coalescePaintEvent(PaintEvent e) Called to coalesce paint events.
| |
| createBuffers | back to summary |
|---|---|
| public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException Create
| |
| createImage | back to summary |
|---|---|
| public Image createImage(int width, int height) Creates an empty image with the specified width and height. This is generally used as a non-accelerated backbuffer for drawing onto the component (e.g. by Swing).
| |
| createVolatileImage | back to summary |
|---|---|
| public VolatileImage createVolatileImage(int width, int height) Creates an empty volatile image with the specified width and height. This is generally used as an accelerated backbuffer for drawing onto the component (e.g. by Swing).
| |
| destroyBuffers | back to summary |
|---|---|
| public void destroyBuffers() Destroys all created buffers. | |
| dispose | back to summary |
|---|---|
| public void dispose() Disposes all resources held by the component peer. This is called when the component has been disconnected from the component hierarchy and is about to be garbage collected.
| |
| flip | back to summary |
|---|---|
| public void flip(int x1, int y1, int x2, int y2, BufferCapabilities. Move the back buffer to the front buffer.
| |
| getBackBuffer | back to summary |
|---|---|
| public Image getBackBuffer() Returns the back buffer as image.
| |
| getColorModel | back to summary |
|---|---|
| public ColorModel getColorModel() Returns the color model used by the component.
| |
| getFontMetrics | back to summary |
|---|---|
| public FontMetrics getFontMetrics(Font font) Returns a font metrics object to determine the metrics properties of the specified font.
| |
| getGraphics | back to summary |
|---|---|
| public Graphics getGraphics() Returns a graphics object to paint on the component.
| |
| getGraphicsConfiguration | back to summary |
|---|---|
| public GraphicsConfiguration getGraphicsConfiguration() Returns the graphics configuration that corresponds to this component.
| |
| getLocationOnScreen | back to summary |
|---|---|
| public Point getLocationOnScreen() Determines the location of the component on the screen.
| |
| getMinimumSize | back to summary |
|---|---|
| public Dimension getMinimumSize() Determines the minimum size of the component.
| |
| getPreferredSize | back to summary |
|---|---|
| public Dimension getPreferredSize() Determines the preferred size of the component.
| |
| handleEvent | back to summary |
|---|---|
| public void handleEvent(AWTEvent e) Called to let the component peer handle events.
| |
| handlesWheelScrolling | back to summary |
|---|---|
| public boolean handlesWheelScrolling() Determines if the component handles wheel scrolling itself. Otherwise it is delegated to the component's parent.
| |
| isFocusable | back to summary |
|---|---|
| public boolean isFocusable() Returns
| |
| isObscured | back to summary |
|---|---|
| public boolean isObscured() Determines if a component has been obscured, i.e. by an overlapping
window or similar. This is used by JViewport for optimizing performance.
This doesn't have to be implemented, when
| |
| isReparentSupported | back to summary |
|---|---|
| public boolean isReparentSupported() Returns whether this peer supports reparenting to another parent without destroying the peer.
| |
| layout | back to summary |
|---|---|
| public void layout() Used by lightweight implementations to tell a ComponentPeer to layout its sub-elements. For instance, a lightweight Checkbox needs to layout the box, as well as the text label.
| |
| paint | back to summary |
|---|---|
| public void paint(Graphics g) Paints the component to the specified graphics context. This is called
by
| |
| back to summary | |
|---|---|
| public void print(Graphics g) Prints the component to the specified graphics context. This is called
by
| |
| reparent | back to summary |
|---|---|
| public void reparent(ContainerPeer newContainer) Reparents this peer to the new parent referenced by
| |
| requestFocus | back to summary |
|---|---|
| public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time, FocusEvent. Requests focus on this component.
| |
| setBackground | back to summary |
|---|---|
| public void setBackground(Color c) Sets the background color of this component.
| |
| setBounds | back to summary |
|---|---|
| public void setBounds(int x, int y, int width, int height, int op) Sets the location or size or both of the component. The location is
specified relative to the component's parent. The
| |
| setEnabled | back to summary |
|---|---|
| public void setEnabled(boolean e) Enables or disables a component. Disabled components are usually grayed out and cannot be activated.
| |
| setFont | back to summary |
|---|---|
| public void setFont(Font f) Sets the font of this component.
| |
| setForeground | back to summary |
|---|---|
| public void setForeground(Color c) Sets the foreground color of this component.
| |
| setVisible | back to summary |
|---|---|
| public void setVisible(boolean v) Makes a component visible or invisible.
| |
| setZOrder | back to summary |
|---|---|
| public void setZOrder(ComponentPeer above) Lowers this component at the bottom of the above HW peer. If the above parameter is null then the method places this component at the top of the Z-order.
| |
| updateCursorImmediately | back to summary |
|---|---|
| public void updateCursorImmediately() Updates the cursor of the component.
| |
| updateGraphicsData | back to summary |
|---|---|
| public boolean updateGraphicsData(GraphicsConfiguration gc) Updates internal data structures related to the component's GC.
| |