java.awt.peer
public interface ComponentPeer
Method Summary | |
---|---|
boolean | canDetermineObscurity()
Returns true if this component peer can determine if the
component has been obscured, false otherwise.
|
int | checkImage(Image img, int width, int height, ImageObserver ob)
Returns the construction status of the specified image. |
void | coalescePaintEvent(PaintEvent e)
Coalesces the specified paint event.
|
void | createBuffers(int numBuffers, BufferCapabilities caps)
Create a number of image buffers that implement a buffering
strategy according to the given capabilities.
|
Image | createImage(ImageProducer prod)
Creates an image by starting the specified image producer. |
Image | createImage(int width, int height)
Creates an empty image with the specified width and
height .
|
VolatileImage | createVolatileImage(int width, int height)
A convenience method that creates a volatile image. |
void | destroyBuffers()
Destroy the resources created by createBuffers.
|
void | disable()
Disables the component. |
void | dispose()
Disposes the component peer. |
void | enable()
Enables the component. |
void | flip(BufferCapabilities.FlipContents contents)
Perform a page flip, leaving the contents of the back buffer in
the specified state.
|
Image | getBackBuffer()
Return the back buffer of this component.
|
Rectangle | getBounds()
Get the bounds of this component peer.
|
ColorModel | getColorModel()
Returns the color model of the component. |
FontMetrics | getFontMetrics(Font f)
Returns the font metrics for the specified font. |
Graphics | getGraphics()
Returns a {@link Graphics} object suitable for drawing on this component.
|
GraphicsConfiguration | getGraphicsConfiguration()
Get the graphics configuration of the component. |
Point | getLocationOnScreen()
Returns the location of this component in screen coordinates. |
Dimension | getMinimumSize()
Returns the minimum size for the component. |
Dimension | getPreferredSize()
Returns the preferred size for the component. |
Toolkit | getToolkit()
Returns the toolkit that created this peer.
|
void | handleEvent(AWTEvent e)
Handles the given event. |
boolean | handlesWheelScrolling()
Returns true, if this component can handle wheel scrolling,
false otherwise.
|
void | hide()
Makes the component invisible. |
boolean | isFocusable()
Returns true if the component can receive keyboard input
focus. |
boolean | isFocusTraversable()
Returns true if the component can receive keyboard input
focus. |
boolean | isObscured()
Returns true if this component has been obscured,
false otherwise. |
boolean | isReparentSupported()
Check if this component supports being reparented.
|
void | layout()
Layout this component peer.
|
Dimension | minimumSize()
Returns the minimum size for the component. |
void | paint(Graphics graphics) |
Dimension | preferredSize()
Returns the preferred size for the component. |
boolean | prepareImage(Image img, int width, int height, ImageObserver ob)
Prepares an image for rendering on this component. |
void | print(Graphics graphics) |
void | repaint(long tm, int x, int y, int width, int height)
Repaints the specified rectangle of this component. |
void | reparent(ContainerPeer parent)
Reparent this component under another container.
|
void | requestFocus()
Requests that this component receives the focus. |
boolean | requestFocus(Component request, boolean temporary, boolean allowWindowFocus, long time)
Requests that this component receives the focus. |
void | reshape(int x, int y, int width, int height)
Notifies the peer that the bounds of this component have changed. |
void | setBackground(Color color)
Sets the background color of the component. |
void | setBounds(int x, int y, int width, int height)
Notifies the peer that the bounds of this component have changed. |
void | setBounds(int x, int y, int width, int height, int z)
Set the bounds of this component peer.
|
void | setCursor(Cursor cursor)
Sets the cursor of the component. |
void | setEnabled(boolean enabled)
Sets the enabled/disabled state of this component. |
void | setEventMask(long mask)
Part of an older API, no longer needed. |
void | setFont(Font font)
Sets the font of the component. |
void | setForeground(Color color)
Sets the foreground color of the component. |
void | setVisible(boolean visible)
Sets the visibility state of the component. |
void | show()
Makes the component visible. |
void | updateCursorImmediately()
Updates the cursor. |
true
if this component peer can determine if the
component has been obscured, false
otherwise.
Returns: true
if this component peer can determine if the
component has been obscured, false
otherwise
Parameters: img the image width the width of the image height the height of the image ob the image observer to be notified of updates of the status
Returns: a bitwise ORed set of ImageObserver flags
Parameters: e the paint event
Parameters: numBuffers the number of buffers caps the buffering capabilities
Throws: AWTException if the specified buffering strategy is not implemented
Since: 1.2
Parameters: prod the image producer to be used to create the image
Returns: the created image
width
and
height
.
Parameters: width the width of the image to be created height the height of the image to be created
Returns: the created image
Parameters: width width of the image height height of the image
Since: 1.2
Since: 1.2
Parameters: contents the state in which to leave the back buffer
Since: 1.2
Returns: the back buffer of this component.
Since: 1.2
Returns: component peer bounds
Since: 1.5
Returns: the color model of the component
Parameters: f the font for which to query the font metrics
Returns: the font metrics for the specified font
Returns: a graphics object suitable for drawing on this component
Returns: the graphics configuration of the component
Returns: the location of this component in screen coordinates
Returns: the minimum size for the component
UNKNOWN: Presumably this method got added to replace minimumSize(). However, testing shows that this is never called in the RI (tested with JDK5), but instead minimumSize() is called directly. It is advisable to implement this method to delegate to minimumSize() and put the real implementation in there.
Returns: the preferred size for the component
UNKNOWN: Presumably this method got added to replace preferredSize(). However, testing shows that this is never called in the RI (tested with JDK5), but instead preferredSize() is called directly. It is advisable to implement this method to delegate to preferredSize() and put the real implementation in there.
Returns: the toolkit that created this peer
Parameters: e the event
false
otherwise.
Returns: true, if this component can handle wheel scrolling,
false
otherwise
true
if the component can receive keyboard input
focus. This is called from {@link Component#isFocusable()}.true
if the component can receive keyboard input
focus. This is called from {@link Component#isFocusTraversable()}.
UNKNOWN: Part of the earlier 1.1 API, replaced by isFocusable().
true
if this component has been obscured,
false
otherwise. This will only work if
{@link #canDetermineObscurity()} also returns true
.
Returns: true
if this component has been obscured,
false
otherwise.
Returns: true if this component can be reparented, false otherwise.
Since: 1.5
Since: 1.5
Returns: the minimum size for the component
Returns: the preferred size for the component
Parameters: img the image to prepare width the desired width of the rendered image height the desired height of the rendered image ob the image observer to be notified of updates in the preparation process
Returns: true
if the image has been fully prepared,
false
otherwise (in which case the image observer
receives updates)
Parameters: tm number of milliseconds to wait with repainting x the X coordinate of the upper left corner of the damaged rectangle y the Y coordinate of the upper left corner of the damaged rectangle width the width of the damaged rectangle height the height of the damaged rectangle
Parameters: parent
Since: 1.5
UNKNOWN: Part of the earlier 1.1 API, apparently replaced by argument form of the same method.
Parameters: request the component for which the focus is requested temporary indicates if the focus change is temporary (true) or permanent (false) allowWindowFocus indicates if it's allowed to change window focus time the timestamp
Parameters: x the X coordinate of the upper left corner of the component y the Y coordinate of the upper left corner of the component width the width of the component height the height of the component
Parameters: color the background color to set
Parameters: x the X coordinate of the upper left corner of the component y the Y coordinate of the upper left corner of the component width the width of the component height the height of the component
Parameters: x the new x co-ordinate y the new y co-ordinate width the new width height the new height z the new stacking level
Since: 1.5
UNKNOWN: Part of the earlier 1.1 API, apparently no longer needed.
Parameters: enabled true
to enable the component,
false
to disable it
Parameters: font the font to set
Parameters: color the foreground color to set
Parameters: visible true
to make the component visible,
false
to make it invisible