|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ComponentPeer
Disabled: no SafeJ information.
The peer interface for 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.
Field Summary | |
---|---|
static int |
DEFAULT_OPERATION
The default operation, which is to set size and location. |
static int |
NO_EMBEDDED_CHECK
A flag that is used to suppress checks for embedded frames. |
static int |
RESET_OPERATION
Resets the setBounds() operation to DEFAULT_OPERATION. |
static int |
SET_BOUNDS
Operation for setBounds(int, int, int, int, int) , indicating
a change in the component size and location. |
static int |
SET_CLIENT_SIZE
Operation for setBounds(int, int, int, int, int) , indicating
a change in the component client size. |
static int |
SET_LOCATION
Operation for setBounds(int, int, int, int, int) , indicating
a change in the component location only. |
static int |
SET_SIZE
Operation for setBounds(int, int, int, int, int) , indicating
a change in the component size only. |
Method Summary | |
---|---|
void |
applyShape(sun.java2d.pipe.Region shape)
Applies the shape to the native component window. |
boolean |
canDetermineObscurity()
Returns true when the peer can determine if a component
has been obscured, false false otherwise. |
int |
checkImage(Image img,
int w,
int h,
ImageObserver o)
Determines the status of the construction of the screen representaion of the specified image. |
void |
coalescePaintEvent(PaintEvent e)
Called to coalesce paint events. |
void |
createBuffers(int numBuffers,
BufferCapabilities caps)
Create numBuffers flipping buffers with the specified
buffer capabilities. |
Image |
createImage(ImageProducer producer)
Creates an image using 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)
Creates an empty volatile image with the specified width and height. |
void |
destroyBuffers()
Destroys all created buffers. |
void |
dispose()
Disposes all resources held by the component peer. |
void |
flip(int x1,
int y1,
int x2,
int y2,
BufferCapabilities.FlipContents flipAction)
Move the back buffer to the front buffer. |
Image |
getBackBuffer()
Returns the back buffer as image. |
ColorModel |
getColorModel()
Returns the color model used by the component. |
FontMetrics |
getFontMetrics(Font font)
Returns a font metrics object to determine the metrics properties of the specified font. |
Graphics |
getGraphics()
Returns a graphics object to paint on the component. |
GraphicsConfiguration |
getGraphicsConfiguration()
Returns the graphics configuration that corresponds to this component. |
Point |
getLocationOnScreen()
Determines the location of the component on the screen. |
Dimension |
getMinimumSize()
Determines the minimum size of the component. |
Dimension |
getPreferredSize()
Determines the preferred size of the component. |
Toolkit |
getToolkit()
Returns the toolkit that is responsible for the component. |
void |
handleEvent(AWTEvent e)
Called to let the component peer handle events. |
boolean |
handlesWheelScrolling()
Determines if the component handles wheel scrolling itself. |
boolean |
isFocusable()
Returns true when the component takes part in the focus
traversal, false otherwise. |
boolean |
isObscured()
Determines if a component has been obscured, i.e. |
boolean |
isReparentSupported()
Returns whether this peer supports reparenting to another parent without destroying the peer. |
void |
layout()
Used by lightweight implementations to tell a ComponentPeer to layout its sub-elements. |
void |
paint(Graphics g)
Paints the component to the specified graphics context. |
boolean |
prepareImage(Image img,
int w,
int h,
ImageObserver o)
Prepare the specified image for rendering on this component. |
void |
print(Graphics g)
Prints the component to the specified graphics context. |
void |
reparent(ContainerPeer newContainer)
Reparents this peer to the new parent referenced by newContainer peer. |
boolean |
requestFocus(Component lightweightChild,
boolean temporary,
boolean focusedWindowChangeAllowed,
long time,
sun.awt.CausedFocusEvent.Cause cause)
Requests focus on this component. |
void |
setBackground(Color c)
Sets the background color of this component. |
void |
setBounds(int x,
int y,
int width,
int height,
int op)
Sets the location or size or both of the component. |
void |
setEnabled(boolean e)
Enables or disables a component. |
void |
setFont(Font f)
Sets the font of this component. |
void |
setForeground(Color c)
Sets the foreground color of this component. |
void |
setVisible(boolean v)
Makes a component visible or invisible. |
void |
setZOrder(ComponentPeer above)
Lowers this component at the bottom of the above HW peer. |
void |
updateCursorImmediately()
Updates the cursor of the component. |
boolean |
updateGraphicsData(GraphicsConfiguration gc)
Updates internal data structures related to the component's GC. |
Field Detail |
---|
static final int SET_LOCATION
setBounds(int, int, int, int, int)
, indicating
a change in the component location only.
setBounds(int, int, int, int, int)
,
Constant Field Valuesstatic final int SET_SIZE
setBounds(int, int, int, int, int)
, indicating
a change in the component size only.
setBounds(int, int, int, int, int)
,
Constant Field Valuesstatic final int SET_BOUNDS
setBounds(int, int, int, int, int)
, indicating
a change in the component size and location.
setBounds(int, int, int, int, int)
,
Constant Field Valuesstatic final int SET_CLIENT_SIZE
setBounds(int, int, int, int, int)
, indicating
a change in the component client size. This is used for setting
the 'inside' size of windows, without the border insets.
setBounds(int, int, int, int, int)
,
Constant Field Valuesstatic final int RESET_OPERATION
setBounds(int, int, int, int, int)
.
TODO: This is only used internally and should probably be moved outside
the peer interface.
Component.setBoundsOp(int)
,
Constant Field Valuesstatic final int NO_EMBEDDED_CHECK
static final int DEFAULT_OPERATION
Component.setBoundsOp(int)
,
Constant Field ValuesMethod Detail |
---|
boolean isObscured()
canDetermineObscurity()
returns false
.
true
when the component has been obscured,
false
otherwisecanDetermineObscurity()
,
JViewport.needsRepaintAfterBlit()
boolean canDetermineObscurity()
true
when the peer can determine if a component
has been obscured, false
false otherwise.
true
when the peer can determine if a component
has been obscured, false
false otherwiseisObscured()
,
JViewport.needsRepaintAfterBlit()
void setVisible(boolean v)
v
- true
to make a component visible,
false
to make it invisibleComponent.setVisible(boolean)
void setEnabled(boolean e)
e
- true
to enable the component, false
to disable itComponent.setEnabled(boolean)
void paint(Graphics g)
Component.paintAll(Graphics)
to paint the component.
g
- the graphics context to paint toComponent.paintAll(Graphics)
void print(Graphics g)
Component.printAll(Graphics)
to print the component.
g
- the graphics context to print toComponent.printAll(Graphics)
void setBounds(int x, int y, int width, int height, int op)
op
parameter specifies which properties change. If it is
SET_LOCATION
, then only the location changes (and the size
parameters can be ignored). If op
is SET_SIZE
,
then only the size changes (and the location can be ignored). If
op
is SET_BOUNDS
, then both change. There is a
special value SET_CLIENT_SIZE
, which is used only for
window-like components to set the size of the client (i.e. the 'inner'
size, without the insets of the window borders).
x
- the X location of the componenty
- the Y location of the componentwidth
- the width of the componentheight
- the height of the componentop
- the operation flagSET_BOUNDS
,
SET_LOCATION
,
SET_SIZE
,
SET_CLIENT_SIZE
void handleEvent(AWTEvent e)
e
- the AWT event to handleComponent.dispatchEvent(AWTEvent)
void coalescePaintEvent(PaintEvent e)
e
- the paint event to consider to coalesceEventQueue.coalescePaintEvent(java.awt.event.PaintEvent)
Point getLocationOnScreen()
Component.getLocationOnScreen()
Dimension getPreferredSize()
Component.getPreferredSize()
Dimension getMinimumSize()
Component.getMinimumSize()
ColorModel getColorModel()
Component.getColorModel()
Toolkit getToolkit()
Component.getToolkit()
Graphics getGraphics()
Component.getGraphics()
FontMetrics getFontMetrics(Font font)
font
- the font to determine the metrics for
Component.getFontMetrics(Font)
void dispose()
Component.removeNotify()
void setForeground(Color c)
c
- the foreground color to setComponent.setForeground(Color)
void setBackground(Color c)
c
- the background color to setComponent.setBackground(Color)
void setFont(Font f)
f
- the font of this componentComponent.setFont(Font)
void updateCursorImmediately()
Component.updateCursorImmediately()
boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time, sun.awt.CausedFocusEvent.Cause cause)
lightweightChild
- the actual lightweight child that requests the
focustemporary
- true
if the focus change is temporary,
false
otherwisefocusedWindowChangeAllowed
- true
if changing the
focus of the containing window is allowed or nottime
- the time of the focus change requestcause
- the cause of the focus change request
true
if the focus change is guaranteed to be
granted, false
otherwiseboolean isFocusable()
true
when the component takes part in the focus
traversal, false
otherwise.
true
when the component takes part in the focus
traversal, false
otherwiseImage createImage(ImageProducer producer)
producer
- the image producer from which the image pixels will be
produced
Component.createImage(ImageProducer)
Image createImage(int width, int height)
width
- the width of the imageheight
- the height of the image
Component.createImage(int, int)
VolatileImage createVolatileImage(int width, int height)
width
- the width of the imageheight
- the height of the image
Component.createVolatileImage(int, int)
boolean prepareImage(Image img, int w, int h, ImageObserver o)
img
- the image to preparew
- the width of the screen representationh
- the height of the screen representationo
- an image observer to observe the progress
true
if the image is already fully prepared,
false
otherwiseComponent.prepareImage(Image, int, int, ImageObserver)
int checkImage(Image img, int w, int h, ImageObserver o)
img
- the image to checkw
- the target widthh
- the target heighto
- the image observer to notify
Component.checkImage(Image, int, int, ImageObserver)
GraphicsConfiguration getGraphicsConfiguration()
Component.getGraphicsConfiguration()
boolean handlesWheelScrolling()
true
if the component handles wheel scrolling,
false
otherwiseComponent.dispatchEventImpl(AWTEvent)
void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException
numBuffers
flipping buffers with the specified
buffer capabilities.
numBuffers
- the number of buffers to createcaps
- the buffer capabilities
AWTException
- if flip buffering is not supportedComponent.FlipBufferStrategy#createBuffers
Image getBackBuffer()
Component.FlipBufferStrategy#getBackBuffer
void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction)
x1
- the area to be flipped, upper left X coordinatey1
- the area to be flipped, upper left Y coordinatex2
- the area to be flipped, lower right X coordinatey2
- the area to be flipped, lower right Y coordinateflipAction
- the flip action to performComponent.FlipBufferStrategy#flip
void destroyBuffers()
Component.FlipBufferStrategy#destroyBuffers
void reparent(ContainerPeer newContainer)
newContainer
peer. Implementation depends on toolkit and
container.
newContainer
- peer of the new parent containerboolean isReparentSupported()
void layout()
Component.validate()
void applyShape(sun.java2d.pipe.Region shape)
Component.applyCompoundShape(sun.java2d.pipe.Region)
void setZOrder(ComponentPeer above)
boolean updateGraphicsData(GraphicsConfiguration gc)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |