java.awt.peer
Interface ComponentPeer

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

public interface ComponentPeer

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
           
static int NO_EMBEDDED_CHECK
           
static int RESET_OPERATION
           
static int SET_BOUNDS
           
static int SET_CLIENT_SIZE
           
static int SET_LOCATION
           
static int SET_SIZE
           
 
Method Summary
 boolean canDetermineObscurity()
           
 int checkImage(Image img, int w, int h, ImageObserver o)
           
 void coalescePaintEvent(PaintEvent e)
           
 void createBuffers(int numBuffers, BufferCapabilities caps)
           
 Image createImage(ImageProducer producer)
           
 Image createImage(int width, int height)
           
 VolatileImage createVolatileImage(int width, int height)
           
 void destroyBuffers()
           
 void disable()
          DEPRECATED: Replaced by setEnabled(boolean).
 void dispose()
           
 void enable()
          DEPRECATED: Replaced by setEnabled(boolean).
 void flip(BufferCapabilities.FlipContents flipAction)
           
 Image getBackBuffer()
           
 Rectangle getBounds()
           
 ColorModel getColorModel()
           
 FontMetrics getFontMetrics(Font font)
           
 Graphics getGraphics()
           
 GraphicsConfiguration getGraphicsConfiguration()
           
 Point getLocationOnScreen()
           
 Dimension getMinimumSize()
           
 Dimension getPreferredSize()
           
 Toolkit getToolkit()
           
 void handleEvent(AWTEvent e)
           
 boolean handlesWheelScrolling()
           
 void hide()
          DEPRECATED: Replaced by setVisible(boolean).
 boolean isFocusable()
           
 boolean isObscured()
           
 boolean isReparentSupported()
          Returns whether this peer supports reparenting to another parent withour destroying the peer
 void layout()
          Used by lightweight implementations to tell a ComponentPeer to layout its sub-elements.
 Dimension minimumSize()
          DEPRECATED: Replaced by getMinimumSize().
 void paint(Graphics g)
           
 Dimension preferredSize()
          DEPRECATED: Replaced by getPreferredSize().
 boolean prepareImage(Image img, int w, int h, ImageObserver o)
           
 void print(Graphics g)
           
 void repaint(long tm, int x, int y, int width, int height)
           
 void reparent(ContainerPeer newContainer)
          Reparents this peer to the new parent referenced by newContainer peer Implementation depends on toolkit and container.
 boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time)
           
 void reshape(int x, int y, int width, int height)
          DEPRECATED: Replaced by setBounds(int, int, int, int).
 void setBackground(Color c)
           
 void setBounds(int x, int y, int width, int height, int op)
           
 void setEnabled(boolean b)
           
 void setFont(Font f)
           
 void setForeground(Color c)
           
 void setVisible(boolean b)
           
 void show()
          DEPRECATED: Replaced by setVisible(boolean).
 void updateCursorImmediately()
           
 

Field Detail

SET_LOCATION

static final int SET_LOCATION
See Also:
Constant Field Values

SET_SIZE

static final int SET_SIZE
See Also:
Constant Field Values

SET_BOUNDS

static final int SET_BOUNDS
See Also:
Constant Field Values

SET_CLIENT_SIZE

static final int SET_CLIENT_SIZE
See Also:
Constant Field Values

RESET_OPERATION

static final int RESET_OPERATION
See Also:
Constant Field Values

NO_EMBEDDED_CHECK

static final int NO_EMBEDDED_CHECK
See Also:
Constant Field Values

DEFAULT_OPERATION

static final int DEFAULT_OPERATION
See Also:
Constant Field Values
Method Detail

isObscured

boolean isObscured()

canDetermineObscurity

boolean canDetermineObscurity()

setVisible

void setVisible(boolean b)

setEnabled

void setEnabled(boolean b)

paint

void paint(Graphics g)

repaint

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

print

void print(Graphics g)

setBounds

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

handleEvent

void handleEvent(AWTEvent e)

coalescePaintEvent

void coalescePaintEvent(PaintEvent e)

getLocationOnScreen

Point getLocationOnScreen()

getPreferredSize

Dimension getPreferredSize()

getMinimumSize

Dimension getMinimumSize()

getColorModel

ColorModel getColorModel()

getToolkit

Toolkit getToolkit()

getGraphics

Graphics getGraphics()

getFontMetrics

FontMetrics getFontMetrics(Font font)

dispose

void dispose()

setForeground

void setForeground(Color c)

setBackground

void setBackground(Color c)

setFont

void setFont(Font f)

updateCursorImmediately

void updateCursorImmediately()

requestFocus

boolean requestFocus(Component lightweightChild,
                     boolean temporary,
                     boolean focusedWindowChangeAllowed,
                     long time)

isFocusable

boolean isFocusable()

createImage

Image createImage(ImageProducer producer)

createImage

Image createImage(int width,
                  int height)

createVolatileImage

VolatileImage createVolatileImage(int width,
                                  int height)

prepareImage

boolean prepareImage(Image img,
                     int w,
                     int h,
                     ImageObserver o)

checkImage

int checkImage(Image img,
               int w,
               int h,
               ImageObserver o)

getGraphicsConfiguration

GraphicsConfiguration getGraphicsConfiguration()

handlesWheelScrolling

boolean handlesWheelScrolling()

createBuffers

void createBuffers(int numBuffers,
                   BufferCapabilities caps)
                   throws AWTException
Throws:
AWTException

getBackBuffer

Image getBackBuffer()

flip

void flip(BufferCapabilities.FlipContents flipAction)

destroyBuffers

void destroyBuffers()

reparent

void reparent(ContainerPeer newContainer)
Reparents this peer to the new parent referenced by newContainer peer Implementation depends on toolkit and container.

Parameters:
newContainer - peer of the new parent container
Since:
1.5

isReparentSupported

boolean isReparentSupported()
Returns whether this peer supports reparenting to another parent withour destroying the peer

Returns:
true if appropriate reparent is supported, false otherwise
Since:
1.5

layout

void layout()
Used by lightweight implementations to tell a ComponentPeer to layout its sub-elements. For instance, a lightweight Checkbox needs to layout the box, as well as the text label.


getBounds

Rectangle getBounds()

preferredSize

Dimension preferredSize()
DEPRECATED: Replaced by getPreferredSize().


minimumSize

Dimension minimumSize()
DEPRECATED: Replaced by getMinimumSize().


show

void show()
DEPRECATED: Replaced by setVisible(boolean).


hide

void hide()
DEPRECATED: Replaced by setVisible(boolean).


enable

void enable()
DEPRECATED: Replaced by setEnabled(boolean).


disable

void disable()
DEPRECATED: Replaced by setEnabled(boolean).


reshape

void reshape(int x,
             int y,
             int width,
             int height)
DEPRECATED: Replaced by setBounds(int, int, int, int).