ch.aplu.jgamegrid
Class ToolBarItem

java.lang.Object
  extended by ch.aplu.jgamegrid.Actor
      extended by ch.aplu.jgamegrid.ToolBarItem
All Implemented Interfaces:
GGActorCollisionListener, GGBorderListener, GGTileCollisionListener, java.util.EventListener
Direct Known Subclasses:
ToolBarSeparator, ToolBarStack, ToolBarText

public class ToolBarItem
extends Actor

A class to represent actors used for tool bar items. All sprites images in a tool bar should have the same height.


Field Summary
 
Fields inherited from class ch.aplu.jgamegrid.Actor
gameGrid, nbCycles
 
Constructor Summary
ToolBarItem(java.awt.image.BufferedImage... spriteImages)
          Constructs a tool bar item based on one or several sprite images defined by the given buffered images.
ToolBarItem(java.lang.String filename)
          Constructs a tool bar item with one sprite image.
ToolBarItem(java.lang.String filename, int nbSprites)
          Constructs a tool bar item using nbSprites sprite images.
 
Method Summary
 java.lang.String getFilename()
          Returns the filename of the sprite image.
 int getNumberOfSprites()
          Returns the number of sprite images specified for this actor.
 
Methods inherited from class ch.aplu.jgamegrid.Actor
act, addActorCollisionListener, addBorderListener, addCollisionActor, addCollisionActors, addCollisionActors, addCollisionTile, addCollisionTiles, addCollisionTiles, addMouseTouchListener, addMouseTouchListener, addTileCollisionListener, collide, collide, delay, displace, getBackground, getCollisionActors, getCollisionActorsInRange, getCollisionTiles, getCurrentImage, getDirection, getDirectionStart, getDisplacePosition, getHeight, getIdVisible, getImage, getImage, getIntDirection, getLocation, getLocationOffset, getLocationStart, getNbCycles, getNbHorzCells, getNbSprites, getNbVertCells, getNeighbours, getNeighbours, getNextMoveLocation, getPixelColor, getPixelLocation, getRotatedPosition, getRotationIndex, getScaledImage, getScaledImage, getScaledImage, getSlowDown, getWidth, getX, getXStart, getY, getYStart, hide, isActEnabled, isActorCollisionEnabled, isHorzMirror, isInGrid, isMoveValid, isNearBorder, isRemoved, isRotatable, isTileCollisionEnabled, isVertMirror, isVisible, move, move, nearBorder, removeSelf, reset, rotate, rotate, setActEnabled, setActorCollisionEnabled, setCollisionCircle, setCollisionCircle, setCollisionImage, setCollisionImage, setCollisionLine, setCollisionLine, setCollisionRectangle, setCollisionRectangle, setCollisionSpot, setCollisionSpot, setDirection, setDirection, setDisplacePosition, setHorzMirror, setLocation, setLocationOffset, setLocationOffset, setMouseTouchCircle, setMouseTouchCircle, setMouseTouchEnabled, setMouseTouchImage, setMouseTouchImage, setMouseTouchRectangle, setMouseTouchRectangle, setOnBottom, setOnTop, setPixelLocation, setSlowDown, setTileCollisionEnabled, setVertMirror, setX, setY, show, show, showNextSprite, showPreviousSprite, turn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolBarItem

public ToolBarItem(java.awt.image.BufferedImage... spriteImages)
Constructs a tool bar item based on one or several sprite images defined by the given buffered images.

See Also:
Actor.Actor(BufferedImage... bis)

ToolBarItem

public ToolBarItem(java.lang.String filename)
Constructs a tool bar item with one sprite image.

Parameters:
filename - the fully qualified path to the image file displayed for this actor
See Also:
Actor.Actor(String filename)

ToolBarItem

public ToolBarItem(java.lang.String filename,
                   int nbSprites)
Constructs a tool bar item using nbSprites sprite images.

Parameters:
filename - the fully qualified path to the image file displayed for this actor
nbSprites - the number of sprite images for the same actor
See Also:
Actor.Actor(String filename, int nbSprites)
Method Detail

getFilename

public java.lang.String getFilename()
Returns the filename of the sprite image.

Returns:
the path to the image file

getNumberOfSprites

public int getNumberOfSprites()
Returns the number of sprite images specified for this actor.

Returns:
the number of sprite images