APIdia Launch Partner
Top Fields Constructors Methods
sun.awt.X11

public Class XComponentPeer

extends XWindow
implements ComponentPeer, DropTargetPeer, BackBufferCapsProvider
Class Inheritance
All Implemented Interfaces
sun.java2d.BackBufferCapsProvider, java.awt.dnd.peer.DropTargetPeer, java.awt.peer.ComponentPeer
Known Direct Subclasses
sun.awt.X11.XLabelPeer, sun.awt.X11.XListPeer, sun.awt.X11.XScrollbarPeer, sun.awt.X11.XScrollPanePeer, sun.awt.X11.XTextAreaPeer, sun.awt.X11.XTextFieldPeer, sun.awt.X11.XButtonPeer, sun.awt.X11.XCanvasPeer, sun.awt.X11.XCheckboxPeer, sun.awt.X11.XChoicePeer
Imports
java.awt.AWTEvent, .AWTException, .BufferCapabilities, .Color, .Component, .Container, .Cursor, .Dimension, .Font, .FontMetrics, .Graphics, .GraphicsConfiguration, .Image, .Insets, .Rectangle, .SystemColor, .Toolkit, .Window, java.awt.dnd.DropTarget, java.awt.dnd.peer.DropTargetPeer, java.awt.event.FocusEvent, .InputEvent, .InputMethodEvent, .KeyEvent, .MouseEvent, .MouseWheelEvent, .PaintEvent, .WindowEvent, java.awt.image.VolatileImage, java.awt.peer.ComponentPeer, .ContainerPeer, java.util.Collection, .Objects, .Set, sun.awt.AWTAccessor, .AWTAccessor.ComponentAccessor, .SunToolkit, .X11GraphicsConfig, sun.awt.event.IgnorePaintEvent, sun.awt.image.SunVolatileImage, sun.java2d.BackBufferCapsProvider, sun.java2d.pipe.Region, sun.util.logging.PlatformLogger

Field Summary

Modifier and TypeField and Description
private long
private BufferCapabilities
backBufferCaps

The following multibuffering-related methods delegate to our associated GraphicsConfig (X11 or GLX) to handle the appropriate native windowing system specific actions.

pack-priv Color
pack-priv static final int
pack-priv boolean
bHasFocus

Keeps the track of focused state of the _NATIVE_ window

protected int
private static final PlatformLogger
pack-priv Color
private boolean
private static final PlatformLogger
private static final PlatformLogger
pack-priv Font
private static final PlatformLogger
pack-priv Color
pack-priv static final int
pack-priv static final int
pack-priv boolean
pack-priv Color
private static final PlatformLogger
pack-priv boolean
pack-priv Color
pack-priv static final int
private static final PlatformLogger
pack-priv static Color[]
private VolatileImage
Inherited from sun.awt.X11.XWindow:
backgroundColorclickCountgraphicsConfiggraphicsConfigDatalastButtonlastTimelastWindowReflastXlastYmwm_hintsoldHeightoldWidthpaintAreaparentREPARENTEDsurfaceDatatargetTARGETwinAttrwm_delete_windowwm_protocolswm_take_focus

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
pack-priv
XComponentPeer(Component target, long parentWindow, Rectangle bounds)

pack-priv
XComponentPeer(Component target)

Standard peer constructor, with corresponding Component

Method Summary

Modifier and TypeMethod and Description
public void
addDropTarget(DropTarget dt)

Implements java.awt.dnd.peer.DropTargetPeer.addDropTarget.

DropTargetPeer implementation

private void
addTree(Collection<Long> order, Set<Long> set, Container cont)

public void
applyShape(Region shape)

Implements java.awt.peer.ComponentPeer.applyShape.

Applies the shape to the X-window.

public void
public void
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
draw3DOval(Graphics g, Color[] colors, int x, int y, int w, int h, boolean raised)

Draw a 3D oval.

pack-priv void
draw3DOval(Graphics g, Color bg, int x, int y, int w, int h, boolean raised)

public void
draw3DRect(Graphics g, Color[] colors, int x, int y, int width, int height, boolean raised)

pack-priv void
draw3DRect(Graphics g, Color bg, int x, int y, int width, int height, boolean raised)

public void
drawMotif3DRect(Graphics g, int x, int y, int width, int height, boolean topShadow)

pack-priv void
drawScrollbar(Graphics g, Color bg, int thickness, int length, int min, int max, int val, int vis, boolean horizontal)

public void
public void
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 void
focusGained(FocusEvent e)

Called when component receives focus

public void
focusLost(FocusEvent e)

Called when component loses focus

public Image
getBackBuffer()

Implements java.awt.peer.ComponentPeer.getBackBuffer.

Returns the back buffer as image.

public BufferCapabilities
public Font
public FontMetrics

Returns:

the font metrics for font
getFontMetrics
(Font
the font for which font metrics is to be obtained
font
)

Overrides sun.awt.X11.XWindow.getFontMetrics.

Implements java.awt.peer.ComponentPeer.getFontMetrics.

Gets the font metrics for the specified font.

public Graphics
getGraphics()

Overrides sun.awt.X11.XWindow.getGraphics.

Implements java.awt.peer.ComponentPeer.getGraphics, sun.awt.X11ComponentPeer.getGraphics.

Returns a graphics object to paint on the component.

public Color[]
public Insets
public Dimension
getMinimumSize()

Implements java.awt.peer.ComponentPeer.getMinimumSize.

Determines the minimum size of the component.

pack-priv XWindowPeer
pack-priv Color
pack-priv Font
pack-priv Color
pack-priv Dimension
public Dimension
getPreferredSize()

Implements java.awt.peer.ComponentPeer.getPreferredSize.

Determines the preferred size of the component.

pack-priv static int[]
pack-priv static Color[]
getSystemColors()

Returns an array of Colors similar to getGUIcolors(), but using the System colors.

public Color
public void
handleEvent(AWTEvent e)

Implements java.awt.peer.ComponentPeer.handleEvent.

Called to let the component peer handle events.

pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
public boolean
handlesWheelScrolling()

Implements java.awt.peer.ComponentPeer.handlesWheelScrolling.

Determines if the component handles wheel scrolling itself.

public final boolean
hasFocus()

Descendants should use this method to determine whether or not native window has focus.

public void
hide()

public final boolean
protected boolean
isEventDisabled(XEvent e)

Overrides sun.awt.X11.XBaseWindow.isEventDisabled.

Returns true if this event is disabled and shouldn't be processed by window Currently if target component is disabled the following event will be disabled on window: ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify

public boolean
isFocusable()

Implements java.awt.peer.ComponentPeer.isFocusable.

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

protected boolean
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()

Overrides sun.awt.X11.XWindow.layout.

Implements java.awt.peer.ComponentPeer.layout.

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

public void
pack-priv static String
operationToString(int operation)

public void
paint(final Graphics g)

Overrides sun.awt.X11.XWindow.paint.

Implements java.awt.peer.ComponentPeer.paint.

Paints the component to the specified graphics context.

pack-priv void
postInit(XCreateWindowParams params)

Overrides sun.awt.X11.XWindow.postInit.

Called after window creation, descendants should override to initialize Window with class-specific values and perform post-initialization actions.

pack-priv void
preInit(XCreateWindowParams params)

Overrides sun.awt.X11.XWindow.preInit.

Called before window creation, descendants should override to initialize the data, initialize params.

public final void
public void
pSetCursor(Cursor cursor, boolean ignoreSubComponents)

private boolean
public void
removeDropTarget(DropTarget dt)

Implements java.awt.dnd.peer.DropTargetPeer.removeDropTarget.

Remove the DropTarget from the system

public void
reparent(ContainerPeer newNativeParent)

Implements java.awt.peer.ComponentPeer.reparent.

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

public final 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)

Overrides sun.awt.X11.XWindow.reshape.

public void
setBackground(Color c)

Overrides sun.awt.X11.XWindow.setBackground.

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
setBoundsOperation(int operation)

public void
setEnabled(final boolean value)

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.

END OF FOCUS STUFF

public void
setZOrder(ComponentPeer above)

Implements java.awt.peer.ComponentPeer.setZOrder.

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

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.

pack-priv void
pack-priv static final AWTEvent
Inherited from sun.awt.X11.XWindow:
disposedoEraseBackgrounddoLayoutdoValidateSurfaceenterNotifyflushgetAWTKeyCodeForKeySymgetColorModelgetColorModelgetDefaultFontgetEventSourcegetGraphicsgetGraphicsConfigurationgetGraphicsConfigurationDatagetKeySymForAWTKeyCodegetLocationOnScreengetModifiersgetMouseMovementSmudgegetMWMHintsgetParentWindowIDgetParentXWindowObjectgetScalegetSurfaceDatagetTargetgetTargetBoundsgetWheelModifiersgetWMClassgetWMProtocolsgetWMStategetXModifiershandleButtonPressReleasehandleConfigureNotifyEventhandleExposeEventhandleKeyPresshandleKeyPresshandleKeyReleasehandleMapNotifyEventhandleMotionNotifyhandlePropertyNotifyhandleUnmapNotifyEventhandleXCrossingEventinitGraphicsConfigurationinitWMProtocolsisEmbeddedisFullScreenExclusiveModeisLocationByPlatformisMouseAboveisParentOfisReparentedisResizableisShowingisWheelkeyEventType2IdkeysymToUnicodeleaveNotifylogIncomingKeyEventpaintPeerpopuppostEventpostEventStaticpostEventToEventQueuepostKeyEventpostPaintEventprePostEventrepaintrepaintreshapescaleDownscaleUpsendEventsetBDatasetFullScreenExclusiveModeStatesetMouseAbovesetMWMHintssetReparentedstateChangedupdateSizeHintsupdateSizeHintsupdateSizeHintsvalidateSurfacewinBackgroundxSetBackground