java.awt.peer

Interface ComponentPeer

Known Subinterfaces:
ButtonPeer, CanvasPeer, CheckboxPeer, ChoicePeer, ContainerPeer, DialogPeer, FileDialogPeer, FramePeer, LabelPeer, LightweightPeer, ListPeer, PanelPeer, ScrollbarPeer, ScrollPanePeer, TextAreaPeer, TextComponentPeer, TextFieldPeer, WindowPeer

public interface ComponentPeer

Method Summary

boolean
canDetermineObscurity()
int
checkImage(Image img, int width, int height, ImageObserver ob)
void
coalescePaintEvent(PaintEvent e)
void
createBuffers(int numBuffers, BufferCapabilities caps)
Create a number of image buffers that implement a buffering strategy according to the given capabilities.
Image
createImage(int width, int height)
Image
createImage(ImageProducer prod)
VolatileImage
createVolatileImage(int width, int height)
A convenience method that creates a volatile image.
void
destroyBuffers()
Destroy the resources created by createBuffers.
void
disable()
void
dispose()
void
enable()
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()
FontMetrics
getFontMetrics(Font f)
Graphics
getGraphics()
GraphicsConfiguration
getGraphicsConfiguration()
Get the graphics configuration of the component.
Point
getLocationOnScreen()
Dimension
getMinimumSize()
Dimension
getPreferredSize()
Toolkit
getToolkit()
void
handleEvent(AWTEvent e)
boolean
handlesWheelScrolling()
void
hide()
boolean
isFocusTraversable()
Part of the earlier 1.1 API, replaced by isFocusable().
boolean
isFocusable()
boolean
isObscured()
boolean
isReparentSupported()
Check if this component supports being reparented.
void
layout()
Layout this component peer.
Dimension
minimumSize()
void
paint(Graphics graphics)
Dimension
preferredSize()
boolean
prepareImage(Image img, int width, int height, ImageObserver ob)
void
print(Graphics graphics)
void
repaint(long tm, int x, int y, int width, int height)
void
reparent(ContainerPeer parent)
Reparent this component under another container.
void
requestFocus()
Part of the earlier 1.1 API, apparently replaced by argument form of the same method.
boolean
requestFocus(Component source, boolean bool1, boolean bool2, long x)
void
reshape(int x, int y, int width, int height)
void
setBackground(Color color)
void
setBounds(int x, int y, int width, int height)
void
setBounds(int x, int y, int width, int height, int z)
Set the bounds of this component peer.
void
setCursor(Cursor cursor)
Part of the earlier 1.1 API, apparently no longer needed.
void
setEnabled(boolean enabled)
void
setEventMask(long mask)
Part of an older API, no longer needed.
void
setFont(Font font)
void
setForeground(Color color)
void
setVisible(boolean visible)
void
show()
void
updateCursorImmediately()

Method Details

canDetermineObscurity

public boolean canDetermineObscurity()

checkImage

public int checkImage(Image img,
                      int width,
                      int height,
                      ImageObserver ob)

coalescePaintEvent

public void coalescePaintEvent(PaintEvent e)

createBuffers

public void createBuffers(int numBuffers,
                          BufferCapabilities caps)
            throws AWTException
Create a number of image buffers that implement a buffering strategy according to the given capabilities.
Parameters:
numBuffers - the number of buffers
caps - the buffering capabilities
Throws:
AWTException - if the specified buffering strategy is not implemented
Since:
1.2

createImage

public Image createImage(int width,
                         int height)

createImage

public Image createImage(ImageProducer prod)

createVolatileImage

public VolatileImage createVolatileImage(int width,
                                         int height)
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.
Parameters:
width - width of the image
height - height of the image
Since:
1.2
See Also:
VolatileImage

destroyBuffers

public void destroyBuffers()
Destroy the resources created by createBuffers.
Since:
1.2

disable

public void disable()

dispose

public void dispose()

enable

public void enable()

flip

public void flip(BufferCapabilities.FlipContents contents)
Perform a page flip, leaving the contents of the back buffer in the specified state.
Parameters:
contents - the state in which to leave the back buffer
Since:
1.2

getBackBuffer

public Image getBackBuffer()
Return the back buffer of this component.
Returns:
the back buffer of this component.
Since:
1.2

getBounds

public Rectangle getBounds()
Get the bounds of this component peer.
Returns:
component peer bounds
Since:
1.5

getColorModel

public ColorModel getColorModel()

getFontMetrics

public FontMetrics getFontMetrics(Font f)

getGraphics

public Graphics getGraphics()

getGraphicsConfiguration

public GraphicsConfiguration getGraphicsConfiguration()
Get the graphics configuration of the component. The color model of the component can be derived from the configuration.

getLocationOnScreen

public Point getLocationOnScreen()

getMinimumSize

public Dimension getMinimumSize()

getPreferredSize

public Dimension getPreferredSize()

getToolkit

public Toolkit getToolkit()

handleEvent

public void handleEvent(AWTEvent e)

handlesWheelScrolling

public boolean handlesWheelScrolling()

hide

public void hide()

isFocusTraversable

public boolean isFocusTraversable()
Part of the earlier 1.1 API, replaced by isFocusable().

isFocusable

public boolean isFocusable()

isObscured

public boolean isObscured()

isReparentSupported

public boolean isReparentSupported()
Check if this component supports being reparented.
Returns:
true if this component can be reparented, false otherwise.
Since:
1.5

layout

public void layout()
Layout this component peer.
Since:
1.5

minimumSize

public Dimension minimumSize()

paint

public void paint(Graphics graphics)

preferredSize

public Dimension preferredSize()

prepareImage

public boolean prepareImage(Image img,
                            int width,
                            int height,
                            ImageObserver ob)

print

public void print(Graphics graphics)

repaint

public void repaint(long tm,
                    int x,
                    int y,
                    int width,
                    int height)

reparent

public void reparent(ContainerPeer parent)
Reparent this component under another container.
Parameters:
parent -
Since:
1.5

requestFocus

public void requestFocus()
Part of the earlier 1.1 API, apparently replaced by argument form of the same method.

requestFocus

public boolean requestFocus(Component source,
                            boolean bool1,
                            boolean bool2,
                            long x)

reshape

public void reshape(int x,
                    int y,
                    int width,
                    int height)

setBackground

public void setBackground(Color color)

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height,
                      int z)
Set the bounds of this component peer.
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

setCursor

public void setCursor(Cursor cursor)
Part of the earlier 1.1 API, apparently no longer needed.

setEnabled

public void setEnabled(boolean enabled)

setEventMask

public void setEventMask(long mask)
Part of an older API, no longer needed.

setFont

public void setFont(Font font)

setForeground

public void setForeground(Color color)

setVisible

public void setVisible(boolean visible)

show

public void show()

updateCursorImmediately

public void updateCursorImmediately()

ComponentPeer.java -- Toplevel component peer Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.