|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrl.client.ui.Sprite
public abstract class Sprite
Everything in the main map view is either the board or it's a sprite displayed on top of the board. Most sprites store a transparent image which they draw onto the screen when told to. Sprites keep a bounds rectangle, so it's easy to tell when they'return onscreen.
| Field Summary | |
|---|---|
protected java.awt.Image |
m_Image
|
protected javax.swing.JComponent |
m_ParentComponent
|
protected boolean |
m_Visible
|
protected static int |
TRANSPARENT
|
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Sprite(javax.swing.JComponent parent)
|
|
| Method Summary | |
|---|---|
protected java.awt.Image |
createImage(java.awt.image.ImageProducer producer)
|
protected java.awt.Image |
createImage(int width,
int height)
|
void |
draw(java.awt.Graphics2D g,
java.awt.image.ImageObserver observer)
Draws this sprite onto the specified graphics context. |
void |
draw(java.awt.Graphics2D g,
java.awt.image.ImageObserver observer,
boolean makeTranslucent)
|
protected abstract java.awt.Image |
drawContent(java.awt.Graphics2D graph,
java.awt.Image tempImage,
java.awt.Rectangle bounds)
|
abstract java.awt.Rectangle |
getBounds()
Returns our bounding rectangle. |
boolean |
imageUpdate(java.awt.Image image,
int infoflags,
int x,
int y,
int width,
int height)
When we draw our buffered images, it's necessary to implement the ImageObserver interface. |
boolean |
isReady()
Are we ready to draw? By default, checks to see that our buffered image has been created. |
boolean |
isVisible()
|
void |
prepare()
Do any necessary preparation. |
void |
repaint()
|
void |
setVisible(boolean visible)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int TRANSPARENT
protected javax.swing.JComponent m_ParentComponent
protected java.awt.Image m_Image
protected boolean m_Visible
| Constructor Detail |
|---|
public Sprite(javax.swing.JComponent parent)
| Method Detail |
|---|
public void prepare()
protected abstract java.awt.Image drawContent(java.awt.Graphics2D graph,
java.awt.Image tempImage,
java.awt.Rectangle bounds)
public void repaint()
public final boolean imageUpdate(java.awt.Image image,
int infoflags,
int x,
int y,
int width,
int height)
imageUpdate in interface java.awt.image.ImageObserverpublic abstract java.awt.Rectangle getBounds()
public boolean isReady()
public boolean isVisible()
public void draw(java.awt.Graphics2D g,
java.awt.image.ImageObserver observer)
public final void draw(java.awt.Graphics2D g,
java.awt.image.ImageObserver observer,
boolean makeTranslucent)
protected java.awt.Image createImage(int width,
int height)
protected java.awt.Image createImage(java.awt.image.ImageProducer producer)
public void setVisible(boolean visible)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||