APIdia Launch Partner
Top Description Constructors Methods
sun.awt

public Class NullComponentPeer

extends Object
implements LightweightPeer, CanvasPeer, PanelPeer
Class Inheritance
All Implemented Interfaces
java.awt.peer.PanelPeer, java.awt.peer.ContainerPeer, java.awt.peer.ComponentPeer, java.awt.peer.CanvasPeer, java.awt.peer.LightweightPeer
Known Direct Subclasses
sun.awt.EmbeddedFrame.NullEmbeddedFramePeer
Imports
java.awt.AWTException, .BufferCapabilities, .Color, .Component, .Cursor, .Dimension, .Event, .Font, .FontMetrics, .Graphics, .GraphicsConfiguration, .Image, .Insets, .Point, .Rectangle, java.awt.event.FocusEvent.Cause, .PaintEvent, java.awt.image.ColorModel, .VolatileImage, java.awt.peer.CanvasPeer, .ComponentPeer, .ContainerPeer, .LightweightPeer, .PanelPeer, sun.java2d.pipe.Region

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.
Authors
Timothy Prinzing, Michael Martak

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
applyShape(Region shape)

Implements java.awt.peer.ComponentPeer.applyShape.

Applies the shape to the native component window.

public void
beginLayout()

Implements java.awt.peer.ContainerPeer.beginLayout.

Notifies the peer that layout is about to begin.

public void
beginValidate()

Implements java.awt.peer.ContainerPeer.beginValidate.

Notifies the peer that validation of the component tree is about to begin.

public boolean
canDetermineObscurity()

Implements java.awt.peer.ComponentPeer.canDetermineObscurity.

Returns true when the peer can determine if a component has been obscured, false false otherwise.

public void
coalescePaintEvent(PaintEvent e)

Implements java.awt.peer.ComponentPeer.coalescePaintEvent.

Called to coalesce paint events.

public void
createBuffers(int numBuffers, BufferCapabilities caps)

Implements java.awt.peer.ComponentPeer.createBuffers.

Create numBuffers flipping buffers with the specified buffer capabilities.

public Image
createImage(int width, int height)

Implements java.awt.peer.ComponentPeer.createImage.

Creates an empty image with the specified width and height.

public VolatileImage
createVolatileImage(int width, int height)

Implements java.awt.peer.ComponentPeer.createVolatileImage.

Creates an empty volatile image with the specified width and height.

public void
destroyBuffers()

Implements java.awt.peer.ComponentPeer.destroyBuffers.

Destroys all created buffers.

public void
public void
dispose()

Implements java.awt.peer.ComponentPeer.dispose.

Disposes all resources held by the component peer.

public void
public void
endLayout()

Implements java.awt.peer.ContainerPeer.endLayout.

Notifies the peer that layout is finished.

public void
endValidate()

Implements java.awt.peer.ContainerPeer.endValidate.

Notifies the peer that validation of the component tree is finished.

public void
flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction)

Implements java.awt.peer.ComponentPeer.flip.

Move the back buffer to the front buffer.

public GraphicsConfiguration
public Image
getBackBuffer()

Implements java.awt.peer.ComponentPeer.getBackBuffer.

Returns the back buffer as image.

public Rectangle
public ColorModel
getColorModel()

Implements java.awt.peer.ComponentPeer.getColorModel.

Returns the color model used by the component.

public FontMetrics
getFontMetrics(Font font)

Implements java.awt.peer.ComponentPeer.getFontMetrics.

Returns a font metrics object to determine the metrics properties of the specified font.

public Graphics
getGraphics()

Implements java.awt.peer.ComponentPeer.getGraphics.

Returns a graphics object to paint on the component.

public GraphicsConfiguration
getGraphicsConfiguration()

Implements java.awt.peer.ComponentPeer.getGraphicsConfiguration.

Returns the graphics configuration that corresponds to this component.

public Insets
getInsets()

Implements java.awt.peer.ContainerPeer.getInsets.

Returns the insets of this container.

public Point
getLocationOnScreen()

Implements java.awt.peer.ComponentPeer.getLocationOnScreen.

Determines the location of the component on the screen.

public Dimension
getMinimumSize()

Implements java.awt.peer.ComponentPeer.getMinimumSize.

Determines the minimum size of the component.

public Dimension
getPreferredSize()

Implements java.awt.peer.ComponentPeer.getPreferredSize.

Determines the preferred size of the component.

public boolean
handleEvent(Event e)
References Deprecated Event is deprecated or references (maybe indirectly) at least one deprecated element.

public void
handleEvent(AWTEvent arg0)

Implements java.awt.peer.ComponentPeer.handleEvent.

Called to let the component peer handle events.

public boolean
handlesWheelScrolling()

Implements java.awt.peer.ComponentPeer.handlesWheelScrolling.

Determines if the component handles wheel scrolling itself.

public void
hide()

public Insets
public boolean
isFocusable()

Implements java.awt.peer.ComponentPeer.isFocusable.

Returns true when the component takes part in the focus traversal, false otherwise.

public boolean
isObscured()

Implements java.awt.peer.ComponentPeer.isObscured.

Determines if a component has been obscured, i.e. by an overlapping window or similar.

public boolean
public boolean
isReparentSupported()

Implements java.awt.peer.ComponentPeer.isReparentSupported.

Returns whether this peer supports reparenting to another parent without destroying the peer.

public void
layout()

Implements java.awt.peer.ComponentPeer.layout.

Used by lightweight implementations to tell a ComponentPeer to layout its sub-elements.

public Dimension
public void
paint(Graphics g)

Implements java.awt.peer.ComponentPeer.paint.

Paints the component to the specified graphics context.

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

public void
reparent(ContainerPeer newNativeParent)

Implements java.awt.peer.ComponentPeer.reparent.

Reparents this peer to the new parent referenced by newContainer peer.

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

Implements java.awt.peer.ComponentPeer.requestFocus.

Requests focus on this component.

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

public void
setBackground(Color c)

Implements java.awt.peer.ComponentPeer.setBackground.

Sets the background color of this component.

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

Implements java.awt.peer.ComponentPeer.setBounds.

Sets the location or size or both of the component.

public void
setCursor(Cursor cursor)

public void
setEnabled(boolean b)

Implements java.awt.peer.ComponentPeer.setEnabled.

Enables or disables a component.

public void
setFont(Font f)

Implements java.awt.peer.ComponentPeer.setFont.

Sets the font of this component.

public void
setForeground(Color c)

Implements java.awt.peer.ComponentPeer.setForeground.

Sets the foreground color of this component.

public void
setVisible(boolean b)

Implements java.awt.peer.ComponentPeer.setVisible.

Makes a component visible or invisible.

public void
setZOrder(ComponentPeer above)

Implements java.awt.peer.ComponentPeer.setZOrder.

Lowers this component at the bottom of the above HW peer.

public void
show()

public void
updateCursorImmediately()

Implements java.awt.peer.ComponentPeer.updateCursorImmediately.

Updates the cursor of the component.

public boolean
updateGraphicsData(GraphicsConfiguration gc)

Implements java.awt.peer.ComponentPeer.updateGraphicsData.

Updates internal data structures related to the component's GC.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NullComponentPeerback to summary
public NullComponentPeer()

Method Detail

applyShapeback to summary
public void applyShape(Region shape)

Implements java.awt.peer.ComponentPeer.applyShape.

Applies the shape to the native component window.

Since
1.7
beginLayoutback to summary
public void beginLayout()

Implements java.awt.peer.ContainerPeer.beginLayout.

Doc from java.awt.peer.ContainerPeer.beginLayout.

Notifies the peer that layout is about to begin. This is called before the container itself and its children are laid out.

beginValidateback to summary
public void beginValidate()

Implements java.awt.peer.ContainerPeer.beginValidate.

Doc from java.awt.peer.ContainerPeer.beginValidate.

Notifies the peer that validation of the component tree is about to begin.

canDetermineObscurityback to summary
public boolean canDetermineObscurity()

Implements java.awt.peer.ComponentPeer.canDetermineObscurity.

Doc from java.awt.peer.ComponentPeer.canDetermineObscurity.

Returns true when the peer can determine if a component has been obscured, false false otherwise.

coalescePaintEventback to summary
public void coalescePaintEvent(PaintEvent e)

Implements java.awt.peer.ComponentPeer.coalescePaintEvent.

Doc from java.awt.peer.ComponentPeer.coalescePaintEvent.

Called to coalesce paint events.

createBuffersback to summary
public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException

Implements java.awt.peer.ComponentPeer.createBuffers.

Doc from java.awt.peer.ComponentPeer.createBuffers.

Create numBuffers flipping buffers with the specified buffer capabilities.

Exceptions
AWTException:
if flip buffering is not supported
createImageback to summary
public Image createImage(int width, int height)

Implements java.awt.peer.ComponentPeer.createImage.

Doc from java.awt.peer.ComponentPeer.createImage.

Creates an empty image with the specified width and height. This is generally used as a non-accelerated backbuffer for drawing onto the component (e.g. by Swing).

createVolatileImageback to summary
public VolatileImage createVolatileImage(int width, int height)

Implements java.awt.peer.ComponentPeer.createVolatileImage.

Doc from java.awt.peer.ComponentPeer.createVolatileImage.

Creates an empty volatile image with the specified width and height. This is generally used as an accelerated backbuffer for drawing onto the component (e.g. by Swing).

destroyBuffersback to summary
public void destroyBuffers()

Implements java.awt.peer.ComponentPeer.destroyBuffers.

Doc from java.awt.peer.ComponentPeer.destroyBuffers.

Destroys all created buffers.

disableback to summary
public void disable()
disposeback to summary
public void dispose()

Implements java.awt.peer.ComponentPeer.dispose.

Doc from java.awt.peer.ComponentPeer.dispose.

Disposes all resources held by the component peer. This is called when the component has been disconnected from the component hierarchy and is about to be garbage collected.

enableback to summary
public void enable()
endLayoutback to summary
public void endLayout()

Implements java.awt.peer.ContainerPeer.endLayout.

Doc from java.awt.peer.ContainerPeer.endLayout.

Notifies the peer that layout is finished. This is called after the container and its children have been laid out.

endValidateback to summary
public void endValidate()

Implements java.awt.peer.ContainerPeer.endValidate.

Doc from java.awt.peer.ContainerPeer.endValidate.

Notifies the peer that validation of the component tree is finished.

flipback to summary
public void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction)

Implements java.awt.peer.ComponentPeer.flip.

Doc from java.awt.peer.ComponentPeer.flip.

Move the back buffer to the front buffer.

getAppropriateGraphicsConfigurationback to summary
public GraphicsConfiguration getAppropriateGraphicsConfiguration(GraphicsConfiguration gc)

Implements java.awt.peer.CanvasPeer.getAppropriateGraphicsConfiguration.

Doc from java.awt.peer.CanvasPeer.getAppropriateGraphicsConfiguration.

Requests a GC that best suits this Canvas. The returned GC may differ from the requested GC passed as the argument to this method. This method must return a non-null value (given the argument is non-null as well).

getBackBufferback to summary
public Image getBackBuffer()

Implements java.awt.peer.ComponentPeer.getBackBuffer.

Doc from java.awt.peer.ComponentPeer.getBackBuffer.

Returns the back buffer as image.

getBoundsback to summary
public Rectangle getBounds()
getColorModelback to summary
public ColorModel getColorModel()

Implements java.awt.peer.ComponentPeer.getColorModel.

Doc from java.awt.peer.ComponentPeer.getColorModel.

Returns the color model used by the component.

getFontMetricsback to summary
public FontMetrics getFontMetrics(Font font)

Implements java.awt.peer.ComponentPeer.getFontMetrics.

Doc from java.awt.peer.ComponentPeer.getFontMetrics.

Returns a font metrics object to determine the metrics properties of the specified font.

getGraphicsback to summary
public Graphics getGraphics()

Implements java.awt.peer.ComponentPeer.getGraphics.

Doc from java.awt.peer.ComponentPeer.getGraphics.

Returns a graphics object to paint on the component.

getGraphicsConfigurationback to summary
public GraphicsConfiguration getGraphicsConfiguration()

Implements java.awt.peer.ComponentPeer.getGraphicsConfiguration.

Doc from java.awt.peer.ComponentPeer.getGraphicsConfiguration.

Returns the graphics configuration that corresponds to this component.

getInsetsback to summary
public Insets getInsets()

Implements java.awt.peer.ContainerPeer.getInsets.

Doc from java.awt.peer.ContainerPeer.getInsets.

Returns the insets of this container. Insets usually is the space that is occupied by things like borders.

getLocationOnScreenback to summary
public Point getLocationOnScreen()

Implements java.awt.peer.ComponentPeer.getLocationOnScreen.

Doc from java.awt.peer.ComponentPeer.getLocationOnScreen.

Determines the location of the component on the screen.

getMinimumSizeback to summary
public Dimension getMinimumSize()

Implements java.awt.peer.ComponentPeer.getMinimumSize.

Doc from java.awt.peer.ComponentPeer.getMinimumSize.

Determines the minimum size of the component.

getPreferredSizeback to summary
public Dimension getPreferredSize()

Implements java.awt.peer.ComponentPeer.getPreferredSize.

Doc from java.awt.peer.ComponentPeer.getPreferredSize.

Determines the preferred size of the component.

handleEventback to summary
public boolean handleEvent(Event e)

References Deprecated

Event is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@SuppressWarnings:deprecation
handleEventback to summary
public void handleEvent(AWTEvent arg0)

Implements java.awt.peer.ComponentPeer.handleEvent.

Doc from java.awt.peer.ComponentPeer.handleEvent.

Called to let the component peer handle events.

handlesWheelScrollingback to summary
public boolean handlesWheelScrolling()

Implements java.awt.peer.ComponentPeer.handlesWheelScrolling.

Doc from java.awt.peer.ComponentPeer.handlesWheelScrolling.

Determines if the component handles wheel scrolling itself. Otherwise it is delegated to the component's parent.

hideback to summary
public void hide()
insetsback to summary
public Insets insets()
isFocusableback to summary
public boolean isFocusable()

Implements java.awt.peer.ComponentPeer.isFocusable.

Doc from java.awt.peer.ComponentPeer.isFocusable.

Returns true when the component takes part in the focus traversal, false otherwise.

isObscuredback to summary
public boolean isObscured()

Implements java.awt.peer.ComponentPeer.isObscured.

Doc from java.awt.peer.ComponentPeer.isObscured.

Determines if a component has been obscured, i.e. by an overlapping window or similar. This is used by JViewport for optimizing performance. This doesn't have to be implemented, when canDetermineObscurity() returns false.

isPaintPendingback to summary
public boolean isPaintPending()
isReparentSupportedback to summary
public boolean isReparentSupported()

Implements java.awt.peer.ComponentPeer.isReparentSupported.

Doc from java.awt.peer.ComponentPeer.isReparentSupported.

Returns whether this peer supports reparenting to another parent without destroying the peer.

See Also
java.awt.peer.ComponentPeer#isReparentSupported
layoutback to summary
public void layout()

Implements java.awt.peer.ComponentPeer.layout.

Doc from java.awt.peer.ComponentPeer.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.

minimumSizeback to summary
public Dimension minimumSize()
paintback to summary
public void paint(Graphics g)

Implements java.awt.peer.ComponentPeer.paint.

Doc from java.awt.peer.ComponentPeer.paint.

Paints the component to the specified graphics context. This is called by Component#paintAll(Graphics) to paint the component.

preferredSizeback to summary
public Dimension preferredSize()
repaintback to summary
public void repaint(long tm, int x, int y, int width, int height)
reparentback to summary
public void reparent(ContainerPeer newNativeParent)

Implements java.awt.peer.ComponentPeer.reparent.

Doc from java.awt.peer.ComponentPeer.reparent.

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

See Also
java.awt.peer.ComponentPeer#reparent
requestFocusback to summary
public boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time, FocusEvent.Cause cause)

Implements java.awt.peer.ComponentPeer.requestFocus.

Doc from java.awt.peer.ComponentPeer.requestFocus.

Requests focus on this component.

reshapeback to summary
public void reshape(int x, int y, int width, int height)
setBackgroundback to summary
public void setBackground(Color c)

Implements java.awt.peer.ComponentPeer.setBackground.

Doc from java.awt.peer.ComponentPeer.setBackground.

Sets the background color of this component.

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

Implements java.awt.peer.ComponentPeer.setBounds.

Doc from java.awt.peer.ComponentPeer.setBounds.

Sets the location or size or both of the component. The location is specified relative to the component's parent. The op parameter specifies which properties change. If it is SET_LOCATION, then only the location changes (and the size parameters can be ignored). If op is SET_SIZE, then only the size changes (and the location can be ignored). If op is SET_BOUNDS, then both change. There is a special value SET_CLIENT_SIZE, which is used only for window-like components to set the size of the client (i.e. the 'inner' size, without the insets of the window borders).

setCursorback to summary
public void setCursor(Cursor cursor)
setEnabledback to summary
public void setEnabled(boolean b)

Implements java.awt.peer.ComponentPeer.setEnabled.

Doc from java.awt.peer.ComponentPeer.setEnabled.

Enables or disables a component. Disabled components are usually grayed out and cannot be activated.

setFontback to summary
public void setFont(Font f)

Implements java.awt.peer.ComponentPeer.setFont.

Doc from java.awt.peer.ComponentPeer.setFont.

Sets the font of this component.

setForegroundback to summary
public void setForeground(Color c)

Implements java.awt.peer.ComponentPeer.setForeground.

Doc from java.awt.peer.ComponentPeer.setForeground.

Sets the foreground color of this component.

setVisibleback to summary
public void setVisible(boolean b)

Implements java.awt.peer.ComponentPeer.setVisible.

Doc from java.awt.peer.ComponentPeer.setVisible.

Makes a component visible or invisible.

setZOrderback to summary
public void setZOrder(ComponentPeer above)

Implements java.awt.peer.ComponentPeer.setZOrder.

Lowers this component at the bottom of the above HW peer. If the above parameter is null then the method places this component at the top of the Z-order.

showback to summary
public void show()
updateCursorImmediatelyback to summary
public void updateCursorImmediately()

Implements java.awt.peer.ComponentPeer.updateCursorImmediately.

Doc from java.awt.peer.ComponentPeer.updateCursorImmediately.

Updates the cursor of the component.

updateGraphicsDataback to summary
public boolean updateGraphicsData(GraphicsConfiguration gc)

Implements java.awt.peer.ComponentPeer.updateGraphicsData.

Doc from java.awt.peer.ComponentPeer.updateGraphicsData.

Updates internal data structures related to the component's GC.