|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.croftsoft.core.animation.painter.TilePainter
public final class TilePainter
Tiles the Icon across the Component.
Supports a palette of up to 256 different icons.
Constructor Summary | |
---|---|
TilePainter(Icon icon)
Convenience constructor. |
|
TilePainter(int offsetX,
int offsetY,
Icon[] tileIcons,
byte[][] tileMap,
Dimension tileSize,
Shape tileShape)
Main constructor. |
|
TilePainter(int offsetX,
int offsetY,
Icon icon,
Shape tileShape)
Convenience constructor. |
Method Summary | |
---|---|
int |
getOffsetX()
|
int |
getOffsetY()
|
int |
getTileColumn(Point mousePoint)
|
int |
getTileColumns()
|
int |
getTileHeight()
|
int |
getTileRow(Point mousePoint)
|
int |
getTileRows()
|
int |
getTileWidth()
|
void |
paint(JComponent component,
Graphics2D graphics)
|
void |
setOffsetX(int offsetX)
|
void |
setOffsetY(int offsetY)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TilePainter(int offsetX, int offsetY, Icon[] tileIcons, byte[][] tileMap, Dimension tileSize, Shape tileShape)
offsetX
- Shifts the tile pattern horizontally.
When there is only one tile icon that is being repeated,
reasonable values are between 0 and the icon width less 1.
Example: values of 0 to 39 for an icon width of 40.offsetY
- Shifts the tile pattern vertically.
When there is only one tile icon that is being repeated,
reasonable values are between 0 and the icon height less 1.
Example: values of 0 to 39 for an icon height of 40.tileShape
- The area of the Component where the tiles will be painted.
If the tileShape is null, component.getBounds() will be used.public TilePainter(int offsetX, int offsetY, Icon icon, Shape tileShape)
public TilePainter(Icon icon)
this ( 0, 0, icon, null );
Method Detail |
---|
public int getOffsetX()
public int getOffsetY()
public int getTileWidth()
public int getTileHeight()
public int getTileRows()
public int getTileColumns()
public void setOffsetX(int offsetX)
public void setOffsetY(int offsetY)
public int getTileRow(Point mousePoint)
public int getTileColumn(Point mousePoint)
public void paint(JComponent component, Graphics2D graphics)
paint
in interface ComponentPainter
|
CroftSoft Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |