|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Canvas wyvern.common.util.AWTImageList
An image list that doesn't use any components, so it can manage its own drawing (for speed).
Nested Class Summary |
Nested classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static int |
DEFAULT_WIDTH
|
static int |
ITEM_HEIGHT
|
static int |
LEFT_GUTTER_WIDTH
|
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 | |
AWTImageList()
Constructs a new AWTImageList |
Method Summary | |
void |
add(java.lang.String caption,
java.awt.Image img)
Adds an item to the end of the list. |
void |
add(java.lang.String caption,
int tile,
int index,
short offset)
Adds the specified text/picture to the list at the specified index. |
void |
add(java.lang.String caption,
int tile,
short offset)
Adds an item to the end of the list. |
void |
addExtraRows(int rows)
Tells the list to size itself vertically larger, so you can scroll down until the last item is at the top of the view. |
void |
addNotify()
Now that the peer is built, create the offscreen buffer. |
protected java.awt.Graphics |
createGraphics()
You have to override this to provide a Graphics context for the list, so it can figure out how wide to be (based on font metrics) before it comes onscreen. |
void |
ensureBuffers()
Creates the offscreen buffers. |
protected java.awt.Image |
getImage(int tile,
int x,
int y)
Gets the image from the ClientImageCache |
protected java.awt.Image |
getImage(int tile,
short offset)
Returns a piece of an image given its offsets. |
java.awt.Dimension |
getMaximumSize()
Returns the max size. |
java.awt.Dimension |
getMinimumSize()
Returns the desired size for this list entry. |
int |
getNumItems()
Returns the size of the list. |
java.awt.Dimension |
getPreferredSize()
Computes the desired size. |
java.lang.String |
getTextValueAt(int index)
Returns the text of the specified item. |
void |
itemSelected(int index,
java.awt.event.MouseEvent e)
An item at a particular index was selected. |
int |
mouseToIndex(int y)
Returns the index of the item selected, given a mouse Y-coordinate |
void |
paint(java.awt.Graphics g)
Draws the list. |
void |
remove(int index)
Removes the item at the specified index. |
void |
removeAll()
Removes all the items. |
void |
replaceItem(java.lang.String caption,
short tile,
int index,
short offset)
Replaces the item at the specified location. |
void |
setBackgroundImage(java.awt.Image img)
Sets the background drawing image. |
void |
setFont(int size)
Sets the font for the text labels. |
void |
setTextColor(int index,
java.awt.Color c)
Sets the color of the text at the passed index. |
void |
update(java.awt.Graphics g)
Avoids flicker. |
Methods inherited from class java.awt.Canvas |
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ITEM_HEIGHT
public static final int LEFT_GUTTER_WIDTH
public static final int DEFAULT_WIDTH
Constructor Detail |
public AWTImageList()
Method Detail |
public void add(java.lang.String caption, int tile, int index, short offset)
caption
- the item texttile
- the TileDatabase index of the object's picture, -1
if the object has no visible representation.index
- the position at which to insert the item. -1 means
add to the end of the list.offset
- the offset at which to draw the image.public void add(java.lang.String caption, int tile, short offset)
caption
- the item texttile
- the TileDatabase index of the object's picture, -1
if the object has no visible representation.offset
- the offset at which to draw the image.public void add(java.lang.String caption, java.awt.Image img)
caption
- the item textimg
- the item imagepublic void replaceItem(java.lang.String caption, short tile, int index, short offset)
caption
- the item texttile
- the TileDatabase index of the object's picture, -1
if the object has no visible representation.index
- the index of the item to replacepublic void remove(int index)
index
- the index to removepublic void removeAll()
public java.lang.String getTextValueAt(int index)
index
- the index of the item to get
public void setFont(int size)
public int getNumItems()
public void setTextColor(int index, java.awt.Color c)
public java.awt.Dimension getMinimumSize()
public java.awt.Dimension getMaximumSize()
public java.awt.Dimension getPreferredSize()
public void addExtraRows(int rows)
rows
- the new number of empty rows to show at the bottom
of the listprotected java.awt.Graphics createGraphics()
public void update(java.awt.Graphics g)
public void paint(java.awt.Graphics g)
public void addNotify()
public void ensureBuffers()
protected java.awt.Image getImage(int tile, short offset)
offset
- the image offsetsprotected java.awt.Image getImage(int tile, int x, int y)
tile
- the tile numberx
- the x offsety
- the y offsetpublic int mouseToIndex(int y)
public void itemSelected(int index, java.awt.event.MouseEvent e)
public void setBackgroundImage(java.awt.Image img)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |