|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container soc.client.FaceChooserFrame.FaceChooserList
protected static class FaceChooserFrame.FaceChooserList
FaceChooserList holds face icons (in rows and columns) and an optional scrollbar. Custom layout.
Nested Class Summary | |
---|---|
private class |
FaceChooserFrame.FaceChooserList.FaceChooserRow
Within FaceChooserList, one row of faces. |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private int |
currentFaceId
|
private int |
currentOffset
|
private int |
currentRow
|
private FaceChooserFrame.FaceChooserList.FaceChooserRow[] |
faceGrid
Will contain all faces. |
protected static int |
faceRowsHeight
How many rows to show? Default 6. |
private java.awt.Scrollbar |
faceSB
|
protected FaceChooserFrame |
fcf
|
private int |
initialFaceId
|
private boolean |
needsScroll
|
protected int |
padH
Padding beyond desired size; not known until doLayout() |
protected int |
padW
Padding beyond desired size; not known until doLayout() |
private int |
rowCount
|
protected static int |
rowFacesWidth
How many faces per row? Default 7. |
protected int |
scrollW
faceSB pixel width; not known until doLayout |
private FaceChooserFrame.FaceChooserList.FaceChooserRow[] |
visibleFaceGrid
Contains only visible faces (based on scrollbar). |
protected int |
wantH
Desired size (visible size inside of insets; not incl scrollW) |
protected java.awt.Dimension |
wantSize
Desired size |
protected int |
wantW
Desired size (visible size inside of insets; not incl scrollW) |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
protected |
FaceChooserFrame.FaceChooserList(FaceChooserFrame fcf,
int selectedFaceId)
Create facechooserlist for this frame, with selected face ID. |
Method Summary | |
---|---|
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Update displayed rows when scrollbar changes |
protected boolean |
checkInsetsPadding(java.awt.Insets i)
Now that insets and scrollbar size are known, check our size and padding. |
void |
doLayout()
Custom layout for this list, which makes things easier because visibleFaceGrid changes frequently. |
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
void |
moveCursor(int dr,
int dc,
java.awt.event.KeyEvent e)
Move the cursor choosing the current face, and change selected face in this browser. |
void |
scrollToRow(int newRow)
Ensure this row of faces is visible. |
void |
selectFace(int id)
Face chosen (clicked), by user or otherwise. |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static int rowFacesWidth
protected static int faceRowsHeight
protected FaceChooserFrame fcf
private int currentRow
private int currentOffset
private int rowCount
private int currentFaceId
private int initialFaceId
private FaceChooserFrame.FaceChooserList.FaceChooserRow[] faceGrid
private FaceChooserFrame.FaceChooserList.FaceChooserRow[] visibleFaceGrid
private boolean needsScroll
private java.awt.Scrollbar faceSB
protected int wantW
protected int wantH
protected java.awt.Dimension wantSize
protected int padW
protected int padH
protected int scrollW
Constructor Detail |
---|
protected FaceChooserFrame.FaceChooserList(FaceChooserFrame fcf, int selectedFaceId)
Method Detail |
---|
public void selectFace(int id)
id
- Face ID to select
java.lang.IllegalArgumentException
- if id <= 0 or id >= SOCFaceButton.NUM_FACESmoveCursor(int, int, KeyEvent)
public void scrollToRow(int newRow)
newRow
- Row number, counting from 0.
The row number can be determined from the faceID
by newRow = (faceId - 1) / rowFacesWidth.
java.lang.IllegalArgumentException
- if newRow < 0 or newRow >= rowCountpublic void moveCursor(int dr, int dc, java.awt.event.KeyEvent e) throws java.lang.IllegalArgumentException
dr
- Delta row: -3 jumps to very top; -2 is PageUp; -1 is one row; same for +.dc
- Delta column: -2 jumps to far-left, -1 is one to left, +1 is one to right, +2 jumps to far-right.
If already at far-left or far-right, -1/+1 move into the previous/next row.e
- KeyEvent to be consumed, or null. The event contents are ignored, only dr and dc
are used to choose the direction of movement.
If dr==0 and dc==0, e is still consumed.
java.lang.IllegalArgumentException
- If dr or dc is out of the range described hereselectFace(int)
,
scrollToRow(int)
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged
in interface java.awt.event.AdjustmentListener
protected boolean checkInsetsPadding(java.awt.Insets i)
i
- Insets
public void doLayout()
doLayout
in class java.awt.Container
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Container
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Container
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |