|
|||||||||
| Home >> All >> gnu >> java >> awt >> [ peer overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
gnu.java.awt.peer
Class GLightweightPeer

java.lang.Objectgnu.java.awt.peer.GLightweightPeer
- All Implemented Interfaces:
- java.awt.peer.ComponentPeer, java.awt.peer.ContainerPeer, java.awt.peer.LightweightPeer
- public class GLightweightPeer
- extends java.lang.Object
- implements java.awt.peer.LightweightPeer, java.awt.peer.ContainerPeer
- extends java.lang.Object
A stub class that implements the ComponentPeer and ContainerPeer interfaces using callbacks into the Component and Container classes. GLightweightPeer allows the Component and Container classes to treat lightweight and heavyweight peers in the same way. Lightweight components are painted directly onto their parent containers through an Image object provided by the toolkit.
| Field Summary | |
private java.awt.Component |
comp
|
private java.awt.Insets |
containerInsets
|
| Constructor Summary | |
GLightweightPeer(java.awt.Component comp)
|
|
| Method Summary | |
void |
beginLayout()
|
void |
beginValidate()
|
void |
cancelPendingPaint(int x,
int y,
int width,
int height)
Cancel a pending paint event on a region of this container. |
boolean |
canDetermineObscurity()
Returns true if this component peer can determine if the
component has been obscured, false otherwise. |
int |
checkImage(java.awt.Image img,
int width,
int height,
java.awt.image.ImageObserver o)
Returns the construction status of the specified image. |
void |
coalescePaintEvent(java.awt.event.PaintEvent e)
Coalesces the specified paint event. |
void |
createBuffers(int x,
java.awt.BufferCapabilities capabilities)
Create a number of image buffers that implement a buffering strategy according to the given capabilities. |
java.awt.Image |
createImage(java.awt.image.ImageProducer prod)
Creates an image by starting the specified image producer. |
java.awt.Image |
createImage(int width,
int height)
Creates an empty image with the specified width and
height. |
java.awt.image.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 |
endLayout()
|
void |
endValidate()
|
void |
flip(java.awt.BufferCapabilities.FlipContents contents)
Perform a page flip, leaving the contents of the back buffer in the specified state. |
java.awt.Image |
getBackBuffer()
Return the back buffer of this component. |
java.awt.Rectangle |
getBounds()
Get the bounds of this component peer. |
java.awt.image.ColorModel |
getColorModel()
Returns the color model of the component. |
java.awt.FontMetrics |
getFontMetrics(java.awt.Font f)
Returns the font metrics for the specified font. |
java.awt.Graphics |
getGraphics()
Returns a java.awt.Graphics object suitable for drawing on this component. |
java.awt.GraphicsConfiguration |
getGraphicsConfiguration()
Get the graphics configuration of the component. |
java.awt.Insets |
getInsets()
|
java.awt.Point |
getLocationOnScreen()
Returns the location of this component in screen coordinates. |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size for the component. |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size for the component. |
java.awt.Toolkit |
getToolkit()
Returns the toolkit that created this peer. |
void |
handleEvent(java.awt.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. |
java.awt.Insets |
insets()
|
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 |
isPaintPending()
|
boolean |
isReparentSupported()
Check if this component supports being reparented. |
boolean |
isRestackSupported()
Check if this container peer can be restacked. |
void |
layout()
Layout this component peer. |
java.awt.Dimension |
minimumSize()
Returns the minimum size for the component. |
void |
paint(java.awt.Graphics graphics)
|
java.awt.Dimension |
preferredSize()
Returns the preferred size for the component. |
boolean |
prepareImage(java.awt.Image img,
int width,
int height,
java.awt.image.ImageObserver o)
Prepares an image for rendering on this component. |
void |
print(java.awt.Graphics graphics)
|
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Repaints the specified rectangle of this component. |
void |
reparent(java.awt.peer.ContainerPeer parent)
Reparent this component under another container. |
void |
requestFocus()
Requests that this component receives the focus. |
boolean |
requestFocus(java.awt.Component source,
boolean bool1,
boolean bool2,
long x)
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 |
restack()
Restack the component peers in this container peer. |
void |
setBackground(java.awt.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 z,
int width,
int height)
Set the bounds of this component peer. |
void |
setCursor(java.awt.Cursor cursor)
Sets the cursor on the heavy-weight parent peer. |
void |
setEnabled(boolean enabled)
Sets the enabled/disabled state of this component. |
void |
setEventMask(long eventMask)
Part of an older API, no longer needed. |
void |
setFont(java.awt.Font font)
Sets the font of the component. |
void |
setForeground(java.awt.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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
comp
private java.awt.Component comp
containerInsets
private java.awt.Insets containerInsets
| Constructor Detail |
GLightweightPeer
public GLightweightPeer(java.awt.Component comp)
| Method Detail |
insets
public java.awt.Insets insets()
- Specified by:
insetsin interfacejava.awt.peer.ContainerPeer
getInsets
public java.awt.Insets getInsets()
- Specified by:
getInsetsin interfacejava.awt.peer.ContainerPeer
beginValidate
public void beginValidate()
- Specified by:
beginValidatein interfacejava.awt.peer.ContainerPeer
endValidate
public void endValidate()
- Specified by:
endValidatein interfacejava.awt.peer.ContainerPeer
beginLayout
public void beginLayout()
- Specified by:
beginLayoutin interfacejava.awt.peer.ContainerPeer
endLayout
public void endLayout()
- Specified by:
endLayoutin interfacejava.awt.peer.ContainerPeer
isPaintPending
public boolean isPaintPending()
- Specified by:
isPaintPendingin interfacejava.awt.peer.ContainerPeer
checkImage
public int checkImage(java.awt.Image img, int width, int height, java.awt.image.ImageObserver o)
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the construction status of the specified image. This is called
by Component.checkImage(Image, int, int, ImageObserver)>
Component.checkImage(Image, int, int, ImageObserver)55 .- Specified by:
checkImagein interfacejava.awt.peer.ComponentPeer
createImage
public java.awt.Image createImage(java.awt.image.ImageProducer prod)
- Description copied from interface:
java.awt.peer.ComponentPeer - Creates an image by starting the specified image producer. This is called
by Component.createImage(ImageProducer)>
Component.createImage(ImageProducer)55 .- Specified by:
createImagein interfacejava.awt.peer.ComponentPeer
createImage
public java.awt.Image createImage(int width, int height)
- Description copied from interface:
java.awt.peer.ComponentPeer - Creates an empty image with the specified
widthandheight.- Specified by:
createImagein interfacejava.awt.peer.ComponentPeer
disable
public void disable()
- Description copied from interface:
java.awt.peer.ComponentPeer - Disables the component. This is called by Component.disable()>
Component.disable()55 .- Specified by:
disablein interfacejava.awt.peer.ComponentPeer
dispose
public void dispose()
- Description copied from interface:
java.awt.peer.ComponentPeer - Disposes the component peer. This should release all resources held by the
peer. This is called when the component is no longer in use.
- Specified by:
disposein interfacejava.awt.peer.ComponentPeer
enable
public void enable()
- Description copied from interface:
java.awt.peer.ComponentPeer - Enables the component. This is called by Component.enable()>
Component.enable()55 .- Specified by:
enablein interfacejava.awt.peer.ComponentPeer
getGraphicsConfiguration
public java.awt.GraphicsConfiguration getGraphicsConfiguration()
- Description copied from interface:
java.awt.peer.ComponentPeer - Get the graphics configuration of the component. The color model
of the component can be derived from the configuration.
- Specified by:
getGraphicsConfigurationin interfacejava.awt.peer.ComponentPeer
getFontMetrics
public java.awt.FontMetrics getFontMetrics(java.awt.Font f)
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the font metrics for the specified font. This is called by
Component.getFontMetrics(Font)>
Component.getFontMetrics(Font)55 .- Specified by:
getFontMetricsin interfacejava.awt.peer.ComponentPeer
getGraphics
public java.awt.Graphics getGraphics()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns a java.awt.Graphics object suitable for drawing on this component.
This is called by Component.getGraphics()>
Component.getGraphics()55 .- Specified by:
getGraphicsin interfacejava.awt.peer.ComponentPeer
getLocationOnScreen
public java.awt.Point getLocationOnScreen()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the location of this component in screen coordinates. This is
called by Component.getLocationOnScreen()>
Component.getLocationOnScreen()55 .- Specified by:
getLocationOnScreenin interfacejava.awt.peer.ComponentPeer
getMinimumSize
public java.awt.Dimension getMinimumSize()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the minimum size for the component. This is called by
Component.getMinimumSize()>
Component.getMinimumSize()55 .- Specified by:
getMinimumSizein interfacejava.awt.peer.ComponentPeer
getPreferredSize
public java.awt.Dimension getPreferredSize()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the preferred size for the component. This is called by
Component.getPreferredSize()>
Component.getPreferredSize()55 .- Specified by:
getPreferredSizein interfacejava.awt.peer.ComponentPeer
getToolkit
public java.awt.Toolkit getToolkit()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the toolkit that created this peer.
- Specified by:
getToolkitin interfacejava.awt.peer.ComponentPeer
handleEvent
public void handleEvent(java.awt.AWTEvent e)
- Description copied from interface:
java.awt.peer.ComponentPeer - Handles the given event. This is called from
Component.dispatchEvent(AWTEvent)>
Component.dispatchEvent(AWTEvent)55 to give the peer a chance to react to events for the component.- Specified by:
handleEventin interfacejava.awt.peer.ComponentPeer
hide
public void hide()
- Description copied from interface:
java.awt.peer.ComponentPeer - Makes the component invisible. This is called from
Component.hide()>
Component.hide()55 .- Specified by:
hidein interfacejava.awt.peer.ComponentPeer
isFocusable
public boolean isFocusable()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns
trueif the component can receive keyboard input focus. This is called from Component.isFocusable()>Component.isFocusable()55 .- Specified by:
isFocusablein interfacejava.awt.peer.ComponentPeer
isFocusTraversable
public boolean isFocusTraversable()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns
trueif the component can receive keyboard input focus. This is called from Component.isFocusTraversable()>Component.isFocusTraversable()55 .- Specified by:
isFocusTraversablein interfacejava.awt.peer.ComponentPeer
minimumSize
public java.awt.Dimension minimumSize()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the minimum size for the component. This is called by
Component.minimumSize()>
Component.minimumSize()55 .- Specified by:
minimumSizein interfacejava.awt.peer.ComponentPeer
preferredSize
public java.awt.Dimension preferredSize()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the preferred size for the component. This is called by
Component.getPreferredSize()>
Component.getPreferredSize()55 .- Specified by:
preferredSizein interfacejava.awt.peer.ComponentPeer
paint
public void paint(java.awt.Graphics graphics)
- Specified by:
paintin interfacejava.awt.peer.ComponentPeer
prepareImage
public boolean prepareImage(java.awt.Image img, int width, int height, java.awt.image.ImageObserver o)
- Description copied from interface:
java.awt.peer.ComponentPeer - Prepares an image for rendering on this component. This is called by
Component.prepareImage(Image, int, int, ImageObserver)>
Component.prepareImage(Image, int, int, ImageObserver)55 .- Specified by:
prepareImagein interfacejava.awt.peer.ComponentPeer
public void print(java.awt.Graphics graphics)
- Specified by:
printin interfacejava.awt.peer.ComponentPeer
repaint
public void repaint(long tm,
int x,
int y,
int width,
int height)
- Description copied from interface:
java.awt.peer.ComponentPeer - Repaints the specified rectangle of this component. This is called from
Component.repaint(long, int, int, int, int)>
Component.repaint(long, int, int, int, int)55 .- Specified by:
repaintin interfacejava.awt.peer.ComponentPeer
requestFocus
public void requestFocus()
- Description copied from interface:
java.awt.peer.ComponentPeer - Requests that this component receives the focus. This is called from
Component.requestFocus()>
Component.requestFocus()55 .- Specified by:
requestFocusin interfacejava.awt.peer.ComponentPeer
requestFocus
public boolean requestFocus(java.awt.Component source, boolean bool1, boolean bool2, long x)
- Description copied from interface:
java.awt.peer.ComponentPeer - Requests that this component receives the focus. This is called from
Component.requestFocus()>
Component.requestFocus()55 .- Specified by:
requestFocusin interfacejava.awt.peer.ComponentPeer
reshape
public void reshape(int x,
int y,
int width,
int height)
- Description copied from interface:
java.awt.peer.ComponentPeer - Notifies the peer that the bounds of this component have changed. This
is called by Component.reshape(int, int, int, int)>
Component.reshape(int, int, int, int)55 .- Specified by:
reshapein interfacejava.awt.peer.ComponentPeer
setBackground
public void setBackground(java.awt.Color color)
- Description copied from interface:
java.awt.peer.ComponentPeer - Sets the background color of the component. This is called by
Component.setBackground(Color)>
Component.setBackground(Color)55 .- Specified by:
setBackgroundin interfacejava.awt.peer.ComponentPeer
setBounds
public void setBounds(int x,
int y,
int width,
int height)
- Description copied from interface:
java.awt.peer.ComponentPeer - Notifies the peer that the bounds of this component have changed. This
is called by Component.setBounds(int, int, int, int)>
Component.setBounds(int, int, int, int)55 .- Specified by:
setBoundsin interfacejava.awt.peer.ComponentPeer
setCursor
public void setCursor(java.awt.Cursor cursor)
- Sets the cursor on the heavy-weight parent peer.
Called by the MouseListener on mouse enter.
- Specified by:
setCursorin interfacejava.awt.peer.ComponentPeer
setEnabled
public void setEnabled(boolean enabled)
- Description copied from interface:
java.awt.peer.ComponentPeer - Sets the enabled/disabled state of this component. This is called by
Component.setEnabled(boolean)>
Component.setEnabled(boolean)55 .- Specified by:
setEnabledin interfacejava.awt.peer.ComponentPeer
setEventMask
public void setEventMask(long eventMask)
- Description copied from interface:
java.awt.peer.ComponentPeer - Part of an older API, no longer needed.
- Specified by:
setEventMaskin interfacejava.awt.peer.ComponentPeer
setFont
public void setFont(java.awt.Font font)
- Description copied from interface:
java.awt.peer.ComponentPeer - Sets the font of the component. This is called by
Component.setFont(Font)>
Component.setFont(Font)55 .- Specified by:
setFontin interfacejava.awt.peer.ComponentPeer
setForeground
public void setForeground(java.awt.Color color)
- Description copied from interface:
java.awt.peer.ComponentPeer - Sets the foreground color of the component. This is called by
Component.setForeground(Color)>
Component.setForeground(Color)55 .- Specified by:
setForegroundin interfacejava.awt.peer.ComponentPeer
setVisible
public void setVisible(boolean visible)
- Description copied from interface:
java.awt.peer.ComponentPeer - Sets the visibility state of the component. This is called by
Component.setVisible(boolean)>
Component.setVisible(boolean)55 .- Specified by:
setVisiblein interfacejava.awt.peer.ComponentPeer
show
public void show()
- Description copied from interface:
java.awt.peer.ComponentPeer - Makes the component visible. This is called by Component.show()>
Component.show()55 .- Specified by:
showin interfacejava.awt.peer.ComponentPeer
getColorModel
public java.awt.image.ColorModel getColorModel()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns the color model of the component. This is currently not used.
- Specified by:
getColorModelin interfacejava.awt.peer.ComponentPeer
isObscured
public boolean isObscured()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns
trueif this component has been obscured,falseotherwise. This will only work if ComponentPeer.canDetermineObscurity()>ComponentPeer.canDetermineObscurity()55 also returnstrue.- Specified by:
isObscuredin interfacejava.awt.peer.ComponentPeer
canDetermineObscurity
public boolean canDetermineObscurity()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns
trueif this component peer can determine if the component has been obscured,falseotherwise.- Specified by:
canDetermineObscurityin interfacejava.awt.peer.ComponentPeer
coalescePaintEvent
public void coalescePaintEvent(java.awt.event.PaintEvent e)
- Description copied from interface:
java.awt.peer.ComponentPeer - Coalesces the specified paint event.
- Specified by:
coalescePaintEventin interfacejava.awt.peer.ComponentPeer
updateCursorImmediately
public void updateCursorImmediately()
- Description copied from interface:
java.awt.peer.ComponentPeer - Updates the cursor.
- Specified by:
updateCursorImmediatelyin interfacejava.awt.peer.ComponentPeer
createVolatileImage
public java.awt.image.VolatileImage createVolatileImage(int width, int height)
- Description copied from interface:
java.awt.peer.ComponentPeer - A convenience method that creates a volatile image. The volatile
image is created on the screen device on which this component is
displayed, in the device's current graphics configuration.
- Specified by:
createVolatileImagein interfacejava.awt.peer.ComponentPeer
handlesWheelScrolling
public boolean handlesWheelScrolling()
- Description copied from interface:
java.awt.peer.ComponentPeer - Returns true, if this component can handle wheel scrolling,
falseotherwise.- Specified by:
handlesWheelScrollingin interfacejava.awt.peer.ComponentPeer
createBuffers
public void createBuffers(int x,
java.awt.BufferCapabilities capabilities)
throws java.awt.AWTException
- Description copied from interface:
java.awt.peer.ComponentPeer - Create a number of image buffers that implement a buffering
strategy according to the given capabilities.
- Specified by:
createBuffersin interfacejava.awt.peer.ComponentPeer
getBackBuffer
public java.awt.Image getBackBuffer()
- Description copied from interface:
java.awt.peer.ComponentPeer - Return the back buffer of this component.
- Specified by:
getBackBufferin interfacejava.awt.peer.ComponentPeer
flip
public void flip(java.awt.BufferCapabilities.FlipContents contents)
- Description copied from interface:
java.awt.peer.ComponentPeer - Perform a page flip, leaving the contents of the back buffer in
the specified state.
- Specified by:
flipin interfacejava.awt.peer.ComponentPeer
destroyBuffers
public void destroyBuffers()
- Description copied from interface:
java.awt.peer.ComponentPeer - Destroy the resources created by createBuffers.
- Specified by:
destroyBuffersin interfacejava.awt.peer.ComponentPeer
isRestackSupported
public boolean isRestackSupported()
- Description copied from interface:
java.awt.peer.ContainerPeer - Check if this container peer can be restacked.
- Specified by:
isRestackSupportedin interfacejava.awt.peer.ContainerPeer
cancelPendingPaint
public void cancelPendingPaint(int x,
int y,
int width,
int height)
- Description copied from interface:
java.awt.peer.ContainerPeer - Cancel a pending paint event on a region of this container.
- Specified by:
cancelPendingPaintin interfacejava.awt.peer.ContainerPeer
restack
public void restack()
- Description copied from interface:
java.awt.peer.ContainerPeer - Restack the component peers in this container peer.
- Specified by:
restackin interfacejava.awt.peer.ContainerPeer
getBounds
public java.awt.Rectangle getBounds()
- Description copied from interface:
java.awt.peer.ComponentPeer - Get the bounds of this component peer.
- Specified by:
getBoundsin interfacejava.awt.peer.ComponentPeer
reparent
public void reparent(java.awt.peer.ContainerPeer parent)
- Description copied from interface:
java.awt.peer.ComponentPeer - Reparent this component under another container.
- Specified by:
reparentin interfacejava.awt.peer.ComponentPeer
setBounds
public void setBounds(int x,
int y,
int z,
int width,
int height)
- Description copied from interface:
java.awt.peer.ComponentPeer - Set the bounds of this component peer.
- Specified by:
setBoundsin interfacejava.awt.peer.ComponentPeer
isReparentSupported
public boolean isReparentSupported()
- Description copied from interface:
java.awt.peer.ComponentPeer - Check if this component supports being reparented.
- Specified by:
isReparentSupportedin interfacejava.awt.peer.ComponentPeer
layout
public void layout()
- Description copied from interface:
java.awt.peer.ComponentPeer - Layout this component peer.
- Specified by:
layoutin interfacejava.awt.peer.ComponentPeer
|
|||||||||
| Home >> All >> gnu >> java >> awt >> [ peer overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
gnu.java.awt.peer.GLightweightPeer