public class

NullComponentPeer

extends Object
implements CanvasPeer LightweightPeer PanelPeer
java.lang.Object
   ↳ sun.awt.NullComponentPeer

Class Overview

Implements the LightweightPeer interface for use in lightweight components that have no native window associated with them. This gets created by default in Component so that Component and Container can be directly extended to create useful components written entirely in java. These components must be hosted somewhere higher up in the component tree by a native container (such as a Frame). This implementation provides no useful semantics and serves only as a marker. One could provide alternative implementations in java that do something useful for some of the other peer interfaces to minimize the native code. This was renamed from java.awt.LightweightPeer (a horrible and confusing name) and moved from java.awt.Toolkit into sun.awt as a public class in its own file.

Summary

[Expand]
Inherited Constants
From interface java.awt.peer.ComponentPeer
Public Constructors
NullComponentPeer()
Public Methods
void applyShape(Region shape)
Applies the shape to the native component window.
void beginLayout()
void beginValidate()
boolean canDetermineObscurity()
int checkImage(Image img, int w, int h, ImageObserver o)
void coalescePaintEvent(PaintEvent e)
void createBuffers(int numBuffers, BufferCapabilities caps)
Image createImage(int width, int height)
Image createImage(ImageProducer producer)
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 endLayout()
void endValidate()
void flip(BufferCapabilities.FlipContents flipAction)
Image getBackBuffer()
Rectangle getBounds()
ColorModel getColorModel()
FontMetrics getFontMetrics(Font font)
Graphics getGraphics()
GraphicsConfiguration getGraphicsConfiguration()
Insets getInsets()
Point getLocationOnScreen()
Dimension getMinimumSize()
Dimension getPreferredSize()
Toolkit getToolkit()
boolean handleEvent(Event e)
void handleEvent(AWTEvent arg0)
boolean handlesWheelScrolling()
void hide()
DEPRECATED: Replaced by setVisible(boolean).
Insets insets()
DEPRECATED: Replaced by getInsets().
boolean isFocusable()
boolean isObscured()
boolean isPaintPending()
boolean isReparentSupported()
Returns whether this peer supports reparenting to another parent withour destroying the peer
boolean isRestackSupported()
Indicates availabiltity of restacking operation in this container.
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 newNativeParent)
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, CausedFocusEvent.Cause cause)
void reshape(int x, int y, int width, int height)
DEPRECATED: Replaced by setBounds(int, int, int, int).
void restack()
Restacks native windows - children of this native window - according to Java container order
void setBackground(Color c)
void setBounds(int x, int y, int width, int height, int op)
void setCursor(Cursor cursor)
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()
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.awt.peer.ComponentPeer
From interface java.awt.peer.ContainerPeer

Public Constructors

public NullComponentPeer ()

Public Methods

public void applyShape (Region shape)

Applies the shape to the native component window.

public void beginLayout ()

public void beginValidate ()

public boolean canDetermineObscurity ()

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

public void coalescePaintEvent (PaintEvent e)

public void createBuffers (int numBuffers, BufferCapabilities caps)

Throws
AWTException

public Image createImage (int width, int height)

public Image createImage (ImageProducer producer)

public VolatileImage createVolatileImage (int width, int height)

public void destroyBuffers ()

public void disable ()

DEPRECATED: Replaced by setEnabled(boolean).

public void dispose ()

public void enable ()

DEPRECATED: Replaced by setEnabled(boolean).

public void endLayout ()

public void endValidate ()

public void flip (BufferCapabilities.FlipContents flipAction)

public Image getBackBuffer ()

public Rectangle getBounds ()

public ColorModel getColorModel ()

public FontMetrics getFontMetrics (Font font)

public Graphics getGraphics ()

public GraphicsConfiguration getGraphicsConfiguration ()

public Insets getInsets ()

public Point getLocationOnScreen ()

public Dimension getMinimumSize ()

public Dimension getPreferredSize ()

public Toolkit getToolkit ()

public boolean handleEvent (Event e)

public void handleEvent (AWTEvent arg0)

public boolean handlesWheelScrolling ()

public void hide ()

DEPRECATED: Replaced by setVisible(boolean).

public Insets insets ()

DEPRECATED: Replaced by getInsets().

public boolean isFocusable ()

public boolean isObscured ()

public boolean isPaintPending ()

public boolean isReparentSupported ()

Returns whether this peer supports reparenting to another parent withour destroying the peer

Returns
  • true if appropriate reparent is supported, false otherwise

public boolean isRestackSupported ()

Indicates availabiltity of restacking operation in this container.

Returns
  • Returns true if restack is supported, false otherwise

public 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.

public Dimension minimumSize ()

DEPRECATED: Replaced by getMinimumSize().

public void paint (Graphics g)

public Dimension preferredSize ()

DEPRECATED: Replaced by getPreferredSize().

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

public void print (Graphics g)

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

public void reparent (ContainerPeer newNativeParent)

Reparents this peer to the new parent referenced by newContainer peer Implementation depends on toolkit and container.

Parameters
newNativeParent peer of the new parent container

public boolean requestFocus (Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)

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

DEPRECATED: Replaced by setBounds(int, int, int, int).

public void restack ()

Restacks native windows - children of this native window - according to Java container order

See Also

public void setBackground (Color c)

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

public void setCursor (Cursor cursor)

public void setEnabled (boolean b)

public void setFont (Font f)

public void setForeground (Color c)

public void setVisible (boolean b)

public void show ()

DEPRECATED: Replaced by setVisible(boolean).

public void updateCursorImmediately ()