public class ToolBar
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addItem(ToolBarItem... item)
Add the next item(s) into the tool bar in the order they are passed.
|
void |
addToolBarListener(ToolBarListener listener)
Registers a tool bar listener to get event notifications when an item
is touched.
|
ToolBarItem |
getItem(int itemIndex)
Returns the tool bar item actor at the specified index of the item list.
|
void |
removeAllItems()
Removes all currently displayed items from the card game window
and empties the item list.
|
void |
setAllSpriteIds(int spriteId)
Sets the sprite id of all items to given value.
|
void |
setLocation(Location barLocation)
Moves the current tool bar at the specified location.
|
void |
setOnBottom(java.lang.Class clazz)
Puts the given class prior to the ToolBarItem class in the paint order,
so that actors from the given class are painted on top of tool bar item images.
|
void |
setOnTop(java.lang.Class clazz)
Puts the ToolBarItem class prior to the given class in the paint order,
so that the tool bar item images are painted on top of actors from the given class.
|
void |
setSpriteId(int itemIndex,
int spriteId)
Sets the sprite id of the item at given index to given value.
|
void |
show(Location barLocation)
Adds the tool bar item actors to the card game window at the
given location (upper left corner of first item).
|
public ToolBar(GameGrid gameGrid)
public void show(Location barLocation)
barLocation
- the location of the upper left corner of the first itempublic void removeAllItems()
public void addItem(ToolBarItem... item)
item
- the item(s) or array of items to be addedpublic void setSpriteId(int itemIndex, int spriteId)
itemIndex
- the index of the item in the item list
(in the range 0..nbItems-1, nothing happens if outside)spriteId
- the new sprite id of the item actorpublic void setAllSpriteIds(int spriteId)
spriteId
- the new sprite id of all item actorspublic ToolBarItem getItem(int itemIndex)
itemIndex
- the index of the item in the item list
(in the range 0..nbItems-1)public void setOnTop(java.lang.Class clazz)
public void setOnBottom(java.lang.Class clazz)
public void setLocation(Location barLocation)
barLocation
- the new location of the tool barpublic void addToolBarListener(ToolBarListener listener)
listener
- the ToolBarListener to register