gnu.java.awt.peer

Class GLightweightPeer

Implemented Interfaces:
ComponentPeer, ContainerPeer, LightweightPeer

public class GLightweightPeer
extends Object
implements LightweightPeer, ContainerPeer

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.

Constructor Summary

GLightweightPeer(Component comp)

Method Summary

void
beginLayout()
void
beginValidate()
boolean
canDetermineObscurity()
void
cancelPendingPaint(int x, int y, int width, int height)
int
checkImage(Image img, int width, int height, ImageObserver o)
void
coalescePaintEvent(PaintEvent e)
void
createBuffers(int x, BufferCapabilities capabilities)
Image
createImage(int width, int height)
Image
createImage(ImageProducer prod)
VolatileImage
createVolatileImage(int width, int height)
void
destroyBuffers()
void
disable()
void
dispose()
void
enable()
void
endLayout()
void
endValidate()
void
flip(BufferCapabilities.FlipContents contents)
Image
getBackBuffer()
Rectangle
getBounds()
ColorModel
getColorModel()
FontMetrics
getFontMetrics(Font f)
Graphics
getGraphics()
GraphicsConfiguration
getGraphicsConfiguration()
Insets
getInsets()
Point
getLocationOnScreen()
Dimension
getMinimumSize()
Dimension
getPreferredSize()
Toolkit
getToolkit()
void
handleEvent(AWTEvent e)
boolean
handlesWheelScrolling()
void
hide()
Insets
insets()
boolean
isFocusTraversable()
boolean
isFocusable()
boolean
isObscured()
boolean
isPaintPending()
boolean
isReparentSupported()
boolean
isRestackSupported()
void
layout()
Dimension
minimumSize()
void
paint(Graphics graphics)
Dimension
preferredSize()
boolean
prepareImage(Image img, int width, int height, ImageObserver o)
void
print(Graphics graphics)
void
repaint(long tm, int x, int y, int width, int height)
void
reparent(ContainerPeer parent)
void
requestFocus()
boolean
requestFocus(Component source, boolean bool1, boolean bool2, long x)
void
reshape(int x, int y, int width, int height)
void
restack()
void
setBackground(Color color)
void
setBounds(int x, int y, int width, int height)
void
setBounds(int x, int y, int z, int width, int height)
void
setCursor(Cursor cursor)
void
setEnabled(boolean enabled)
void
setEventMask(long eventMask)
void
setFont(Font font)
void
setForeground(Color color)
void
setVisible(boolean visible)
void
show()
void
updateCursorImmediately()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

GLightweightPeer

public GLightweightPeer(Component comp)

Method Details

beginLayout

public void beginLayout()
Specified by:
beginLayout in interface ContainerPeer

beginValidate

public void beginValidate()
Specified by:
beginValidate in interface ContainerPeer

canDetermineObscurity

public boolean canDetermineObscurity()
Specified by:
canDetermineObscurity in interface ComponentPeer

cancelPendingPaint

public void cancelPendingPaint(int x,
                               int y,
                               int width,
                               int height)
Specified by:
cancelPendingPaint in interface ContainerPeer

checkImage

public int checkImage(Image img,
                      int width,
                      int height,
                      ImageObserver o)
Specified by:
checkImage in interface ComponentPeer

coalescePaintEvent

public void coalescePaintEvent(PaintEvent e)
Specified by:
coalescePaintEvent in interface ComponentPeer

createBuffers

public void createBuffers(int x,
                          BufferCapabilities capabilities)
            throws AWTException
Specified by:
createBuffers in interface ComponentPeer

createImage

public Image createImage(int width,
                         int height)
Specified by:
createImage in interface ComponentPeer

createImage

public Image createImage(ImageProducer prod)
Specified by:
createImage in interface ComponentPeer

createVolatileImage

public VolatileImage createVolatileImage(int width,
                                         int height)
Specified by:
createVolatileImage in interface ComponentPeer

destroyBuffers

public void destroyBuffers()
Specified by:
destroyBuffers in interface ComponentPeer

disable

public void disable()
Specified by:
disable in interface ComponentPeer

dispose

public void dispose()
Specified by:
dispose in interface ComponentPeer

enable

public void enable()
Specified by:
enable in interface ComponentPeer

endLayout

public void endLayout()
Specified by:
endLayout in interface ContainerPeer

endValidate

public void endValidate()
Specified by:
endValidate in interface ContainerPeer

flip

public void flip(BufferCapabilities.FlipContents contents)
Specified by:
flip in interface ComponentPeer

getBackBuffer

public Image getBackBuffer()
Specified by:
getBackBuffer in interface ComponentPeer

getBounds

public Rectangle getBounds()
Specified by:
getBounds in interface ComponentPeer

getColorModel

public ColorModel getColorModel()
Specified by:
getColorModel in interface ComponentPeer

getFontMetrics

public FontMetrics getFontMetrics(Font f)
Specified by:
getFontMetrics in interface ComponentPeer

getGraphics

public Graphics getGraphics()
Specified by:
getGraphics in interface ComponentPeer

getGraphicsConfiguration

public GraphicsConfiguration getGraphicsConfiguration()
Specified by:
getGraphicsConfiguration in interface ComponentPeer

getInsets

public Insets getInsets()
Specified by:
getInsets in interface ContainerPeer

getLocationOnScreen

public Point getLocationOnScreen()
Specified by:
getLocationOnScreen in interface ComponentPeer

getMinimumSize

public Dimension getMinimumSize()
Specified by:
getMinimumSize in interface ComponentPeer

getPreferredSize

public Dimension getPreferredSize()
Specified by:
getPreferredSize in interface ComponentPeer

getToolkit

public Toolkit getToolkit()
Specified by:
getToolkit in interface ComponentPeer

handleEvent

public void handleEvent(AWTEvent e)
Specified by:
handleEvent in interface ComponentPeer

handlesWheelScrolling

public boolean handlesWheelScrolling()
Specified by:
handlesWheelScrolling in interface ComponentPeer

hide

public void hide()
Specified by:
hide in interface ComponentPeer

insets

public Insets insets()
Specified by:
insets in interface ContainerPeer

isFocusTraversable

public boolean isFocusTraversable()
Specified by:
isFocusTraversable in interface ComponentPeer

isFocusable

public boolean isFocusable()
Specified by:
isFocusable in interface ComponentPeer

isObscured

public boolean isObscured()
Specified by:
isObscured in interface ComponentPeer

isPaintPending

public boolean isPaintPending()
Specified by:
isPaintPending in interface ContainerPeer

isReparentSupported

public boolean isReparentSupported()
Specified by:
isReparentSupported in interface ComponentPeer

isRestackSupported

public boolean isRestackSupported()
Specified by:
isRestackSupported in interface ContainerPeer

layout

public void layout()
Specified by:
layout in interface ComponentPeer

minimumSize

public Dimension minimumSize()
Specified by:
minimumSize in interface ComponentPeer

paint

public void paint(Graphics graphics)
Specified by:
paint in interface ComponentPeer

preferredSize

public Dimension preferredSize()
Specified by:
preferredSize in interface ComponentPeer

prepareImage

public boolean prepareImage(Image img,
                            int width,
                            int height,
                            ImageObserver o)
Specified by:
prepareImage in interface ComponentPeer

print

public void print(Graphics graphics)
Specified by:
print in interface ComponentPeer

repaint

public void repaint(long tm,
                    int x,
                    int y,
                    int width,
                    int height)
Specified by:
repaint in interface ComponentPeer

reparent

public void reparent(ContainerPeer parent)
Specified by:
reparent in interface ComponentPeer

requestFocus

public void requestFocus()
Specified by:
requestFocus in interface ComponentPeer

requestFocus

public boolean requestFocus(Component source,
                            boolean bool1,
                            boolean bool2,
                            long x)
Specified by:
requestFocus in interface ComponentPeer

reshape

public void reshape(int x,
                    int y,
                    int width,
                    int height)
Specified by:
reshape in interface ComponentPeer

restack

public void restack()
Specified by:
restack in interface ContainerPeer

setBackground

public void setBackground(Color color)
Specified by:
setBackground in interface ComponentPeer

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Specified by:
setBounds in interface ComponentPeer

setBounds

public void setBounds(int x,
                      int y,
                      int z,
                      int width,
                      int height)
Specified by:
setBounds in interface ComponentPeer

setCursor

public void setCursor(Cursor cursor)
Specified by:
setCursor in interface ComponentPeer

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface ComponentPeer

setEventMask

public void setEventMask(long eventMask)
Specified by:
setEventMask in interface ComponentPeer

setFont

public void setFont(Font font)
Specified by:
setFont in interface ComponentPeer

setForeground

public void setForeground(Color color)
Specified by:
setForeground in interface ComponentPeer

setVisible

public void setVisible(boolean visible)
Specified by:
setVisible in interface ComponentPeer

show

public void show()
Specified by:
show in interface ComponentPeer

updateCursorImmediately

public void updateCursorImmediately()
Specified by:
updateCursorImmediately in interface ComponentPeer

GLightweightPeer.java -- Copyright (C) 2003, 2004 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.