de.mud.bsx
Class BSXObject
java.lang.Object
|
+--de.mud.bsx.BSXObject
- Direct Known Subclasses:
- BSXScene
- public class BSXObject
- extends java.lang.Object
Basic object for BSX Graphic.
- renders its data on a given Graphics object
- Version:
- 1.0
- Author:
- Thomas Kriegelstein (tk4@rb.mud.de)
|
Field Summary |
static java.awt.Color[] |
bsxColors
BSX Colors |
protected int[][] |
data
the data to be rendered |
protected int[][] |
poly
the translated polygons |
|
Constructor Summary |
BSXObject(java.lang.String id,
int[][] data)
Constructor for BSXObject. |
|
Method Summary |
void |
draw(java.awt.Graphics g,
int x,
int y)
draw image on specified graphics |
boolean |
equals(java.lang.Object obj)
|
void |
flush()
keep ressoure allocation small |
int |
hashCode()
|
void |
setData(int[][] data)
change th data of this object |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
data
protected int[][] data
- the data to be rendered
poly
protected int[][] poly
- the translated polygons
bsxColors
public static final java.awt.Color[] bsxColors
- BSX Colors
BSXObject
public BSXObject(java.lang.String id,
int[][] data)
- Constructor for BSXObject.
- Parameters:
id - identifier of this objectdata - field containing gfx information
- data.length - number of polygons
- (data[i].length-1)/2 - number of edges
- data[i][0] - color index
- data[i][j*2+1] - x coord
- data[i][j*2+2] - y coord
draw
public void draw(java.awt.Graphics g,
int x,
int y)
- draw image on specified graphics
- Parameters:
g - draw therex - BSX_XPOSy - BSX_YPOSobs - ImageObserver to be notified
setData
public void setData(int[][] data)
- change th data of this object
- Parameters:
data - new data to be used
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
flush
public void flush()
- keep ressoure allocation small