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

pack-priv final Class XListPeer

extends XComponentPeer
implements ListPeer, XScrollbarClient
Class Inheritance
All Implemented Interfaces
sun.awt.X11.XScrollbarClient, java.awt.peer.ListPeer, java.awt.peer.ComponentPeer
Imports
java.awt.*, java.awt.event.*, java.awt.peer.*, java.util.Objects, .Vector, java.awt.image.*, sun.util.logging.PlatformLogger

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
XListPeer.ListPainter

Sometimes painter is called on Toolkit thread, so the lock sequence is: awtLock -> Painter -> awtLock Sometimes it is called on other threads: Painter -> awtLock Since we can't guarantee the sequence, use awtLock.

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv boolean
private static final int
pack-priv int
public static final int
pack-priv int
pack-priv int
pack-priv boolean
private int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
public static final int
public static final int
pack-priv XHorizontalScrollbar
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv Vector<String>
pack-priv int
pack-priv int
private static final PlatformLogger
public static final int
pack-priv int
pack-priv boolean
pack-priv boolean
pack-priv boolean
public static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
pack-priv XListPeer.ListPainter
public static final int
public static final int
pack-priv int[]
public static final int
public static final int
pack-priv XVerticalScrollbar
pack-priv boolean
public static final int
Inherited from sun.awt.X11.XComponentPeer:
backgroundBACKGROUND_COLORbHasFocusboundsOperationdarkShadowfontforegroundFOREGROUND_COLORHIGHLIGHT_COLORisLayoutinglightShadowpaintPendingselectColorSHADOW_COLORsystemColors

Constructor Summary

AccessConstructor and Description
pack-priv
XListPeer(List target)

Create a list

Method Summary

Modifier and TypeMethod and Description
public void
add(String item, int index)

Implements java.awt.peer.ListPeer.add.

Adds an item to the list at the specified index.

public void
addItem(String item, int i)

add an item if the index of the item is < 0 or >= than items.size() then add the item to the end of the list

public void
clear()

clear

pack-priv void
createHorScrollbar()

add Horizontal scrollbar

pack-priv void
createVerScrollbar()

add Vertical Scrollbar

public void
delItems(int s, int e)

Implements java.awt.peer.ListPeer.delItems.

delete items starting with s (start position) to e (end position) including s and e if s < 0 then s = 0 if e >= items.size() then e = items.size() - 1

public void
deselect(int index)

Implements java.awt.peer.ListPeer.deselect.

ListPeer method focusedIndex isn't updated according to native (Window, Motif) behaviour

private void
deselectAllItems()

deselect all items in List

pack-priv void
deselectItem(int index)

deselect the index redraw the list to the screen

public void
focusGained(FocusEvent e)

Overrides sun.awt.X11.XComponentPeer.focusGained.

Called when component receives focus

public void
focusLost(FocusEvent e)

Overrides sun.awt.X11.XComponentPeer.focusLost.

Called when component loses focus

pack-priv int
pack-priv int
pack-priv Rectangle
getFocusRect()

Update and return the focus rectangle.

pack-priv Rectangle
pack-priv int
pack-priv int
getItemWidth(int i)

Calculates the width of item's label

pack-priv int
pack-priv int
pack-priv int
getItemY(int item)

pack-priv int
private Color
getListBackground(Color[] colors)

Returns the color that should be used to paint the background of the list of items.

private Color
getListForeground(Color[] colors)

Returns the color that should be used to paint the list item text.

pack-priv int
getListWidth()

returns the width of the list portion of the component (accounts for presence of vertical scrollbar)

public Dimension
getMinimumSize()

Overrides sun.awt.X11.XComponentPeer.getMinimumSize.

Implements java.awt.peer.ComponentPeer.getMinimumSize.

Determines the minimum size of the component.

public Dimension
getMinimumSize(int rows)

Implements java.awt.peer.ListPeer.getMinimumSize.

Returns the minimum size for a list with the specified number of rows.

public Dimension
getPreferredSize(int rows)

Implements java.awt.peer.ListPeer.getPreferredSize.

Returns the preferred size for a list with the specified number of rows.

public int[]
getSelectedIndexes()

Implements java.awt.peer.ListPeer.getSelectedIndexes.

return the selected indexes

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

Overrides sun.awt.X11.XComponentPeer.handlesWheelScrolling.

Implements java.awt.peer.ComponentPeer.handlesWheelScrolling.

Determines if the component handles wheel scrolling itself.

pack-priv boolean
hsbIsVisible(boolean vsbVisible)

return true if horizontal scrollbar is visible and false otherwise; vsbVisible is the visibility of the vertical scrollbar

pack-priv int
index2y(int index)

return the y value of the given index "i".

pack-priv boolean
inHorizontalScrollbar(int x, int y)

return true if the x and y position is in the horizontal scrollbar

pack-priv void
initFontMetrics()

Calculate font metrics

pack-priv boolean
inVerticalScrollbar(int x, int y)

return true if the x and y position is in the verticalscrollbar

pack-priv boolean
inWindow(int x, int y)

return true if the x and y position is in the window

public boolean
isFocusable()

Overrides sun.awt.X11.XComponentPeer.isFocusable.

Implements java.awt.peer.ComponentPeer.isFocusable.

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

pack-priv boolean
pack-priv boolean
isItemHidden(int index)

returns whether the given index is currently scrolled off the top or bottom of the List.

pack-priv boolean
isSelected(int index)

is the index "index" selected

pack-priv int
itemsDisplayed()

returns number of items actually displayed in the List

pack-priv int
itemsInWindow(boolean scrollbarVisible)

return the number of items that can fit in the current window

pack-priv int
pack-priv void
pack-priv int
lastItemDisplayed()

returns index of last item displayed in the List

public void
layout()

Overrides sun.awt.X11.XComponentPeer.layout.

Implements java.awt.peer.ComponentPeer.layout.

Layout the sub-components of the List - that is, the scrollbars and the list of items.

public void
makeVisible(int index)

Implements java.awt.peer.ListPeer.makeVisible.

ensure that the given index is visible, scrolling the List if necessary, or doing nothing if the item is already visible.

pack-priv int
maxLength()

return the length of the largest item in the list

pack-priv void
pack-priv void
pack-priv void
public void
notifyValue(XScrollbar obj, int type, int v, boolean isAdjusting)

Implements sun.awt.X11.XScrollbarClient.notifyValue.

return value from the scrollbar

pack-priv void
pack-priv int
posInSel(int index)

return the position of the index in the selected array if the index isn't in the array selected return -1;

public void
postInit(XCreateWindowParams params)

Overrides sun.awt.X11.XComponentPeer.postInit.

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

public void
preInit(XCreateWindowParams params)

Overrides sun.awt.X11.XComponentPeer.preInit.

Overridden from XWindow

pack-priv boolean
prePostEvent(final AWTEvent e)

Overrides sun.awt.X11.XWindow.prePostEvent.

Returns true if the event has been handled and should not be posted to Java.

pack-priv boolean
public void
removeAll()

Implements java.awt.peer.ListPeer.removeAll.

Removes all items from the list.

public void
repaint()

Overrides sun.awt.X11.XWindow.repaint.

Overridden for performance

private void
repaint(int options)

private void
repaint(int firstItem, int lastItem, int options)

private void
repaint(int
the position of the first item of the range to repaint
firstItem
,
int
the position of the last item of the range to repaint
lastItem
,
int
specifies the particular area of the component to repaint
options
,
Rectangle
the area of the component to copy
source
,
Point
the distance to copy the source area
distance
)

In most cases the entire area of the component doesn't have to be repainted.

public void
pack-priv void
scrollHorizontal(int x)

scrollHorizontal x is the number of pixels to scroll

pack-priv void
scrollVertical(int y)

scrollVertical y is the number of items to scroll

public void
select(int index)

Implements java.awt.peer.ListPeer.select.

ListPeer method

pack-priv void
selectItem(int index)

select the index redraw the list to the screen

public void
setBackground(Color c)

Overrides sun.awt.X11.XComponentPeer.setBackground.

Implements java.awt.peer.ComponentPeer.setBackground.

Sets the background color of this component.

pack-priv void
setFocusIndex(int value)

public void
setFont(Font f)

Overrides sun.awt.X11.XComponentPeer.setFont.

Implements java.awt.peer.ComponentPeer.setFont.

Sets the font of this component.

public void
setForeground(Color c)

Overrides sun.awt.X11.XComponentPeer.setForeground.

Implements java.awt.peer.ComponentPeer.setForeground.

Sets the foreground color of this component.

public void
setMultipleMode(boolean b)

Implements java.awt.peer.ListPeer.setMultipleMode.

Toggles multiple selection mode on or off.

public void
setMultipleSelections(boolean v)

set multiple selections

pack-priv int
stringLength(String str)

return the on-screen width of the given string "str"

pack-priv void
pack-priv void
pack-priv boolean
validY(int y)

pack-priv boolean
vsbIsVisible(boolean hsbVisible)

return true if vertical scrollbar is visible and false otherwise; hsbVisible is the visibility of the horizontal scrollbar

pack-priv int
y2index(int y)

return the index

Inherited from sun.awt.X11.XComponentPeer:
addDropTargetapplyShapebeginLayoutbeginValidatecanDetermineObscuritycoalescePaintEventcreateBufferscreateImagecreateVolatileImagedestroyBuffersdraw3DOvaldraw3DOvaldraw3DRectdraw3DRectdrawMotif3DRectdrawScrollbarendLayoutendValidateflipgetBackBuffergetBackBufferCapsgetFontgetFontMetricsgetGraphicsgetGUIcolorsgetInsetsgetParentTopLevelgetPeerBackgroundgetPeerFontgetPeerForegroundgetPeerSizegetPreferredSizegetRGBvalsgetSystemColorsgetWinBackgroundhandleEventhandleF10JavaKeyEventhandleJavaFocusEventhandleJavaInputMethodEventhandleJavaWindowFocusEventhasFocushideisEnabledisEventDisabledisInitialReshapeisObscuredisPaintPendingisReparentSupportednotifyTextComponentChangeoperationToStringpaintprintpSetCursorpSetCursorremoveDropTargetreparentrequestFocusreshapesetBoundssetBoundsOperationsetEnabledsetVisiblesetZOrderupdateCursorImmediatelyupdateGraphicsDataupdateMotifColorswrapInSequenced