ch.aplu.jgamegrid
Class ToolBarText

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

public class ToolBarText
extends ToolBarItem

A class to represent a text actor used for tool bar items.


Field Summary
 
Fields inherited from class ch.aplu.jgamegrid.Actor
gameGrid, nbCycles
 
Constructor Summary
ToolBarText(java.lang.String text, java.awt.Color textColor, java.awt.Font font, java.awt.Color bgColor, int height)
          Creates a tool bar text item displaying the given text with given font and color centered in a rectangle with given color and height.
ToolBarText(java.lang.String text, int height)
          Creates a tool bar text item displaying the given text in black centered in a white rectangle with given height.
 
Method Summary
 
Methods inherited from class ch.aplu.jgamegrid.ToolBarItem
getFilename, getNumberOfSprites
 
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

ToolBarText

public ToolBarText(java.lang.String text,
                   int height)
Creates a tool bar text item displaying the given text in black centered in a white rectangle with given height. The text font is SansSerif, PLAIN, 12 px.

Parameters:
text - the text to display
height - the height of the background rectangle in pixels

ToolBarText

public ToolBarText(java.lang.String text,
                   java.awt.Color textColor,
                   java.awt.Font font,
                   java.awt.Color bgColor,
                   int height)
Creates a tool bar text item displaying the given text with given font and color centered in a rectangle with given color and height. The width of the rectangle is adapted to the text font and text length.

Parameters:
text - the text to display
textColor - the color of the text
font - the font of the text
bgColor - the color of the background rectangle
height - the height of the background rectangle in pixels