|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgui.playfield.PlayFieldGraphic
public abstract class PlayFieldGraphic
Superclass for all graphics to be drawn on the "play field".
Field Summary | |
---|---|
protected static double |
scale
Common scaling factor for all playfield graphics. |
Constructor Summary | |
---|---|
PlayFieldGraphic()
|
Method Summary | |
---|---|
abstract void |
draw(java.awt.Graphics2D g2)
Draws the graphic component to the graphics context g2 |
static double |
getScale()
Returns the currently used scaling factor |
static double |
invScale(double value)
Performs an inverse of the scaling procedure with current scale. |
static int |
scale(double value)
Scales the value according to current zoom level |
static int |
scale(int value)
Scales the value according to current zoom level |
static void |
setScale(double newScale)
Set the zooming factor of the graphics to be drawn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static double scale
setScale(double)
Constructor Detail |
---|
public PlayFieldGraphic()
Method Detail |
---|
public static void setScale(double newScale)
newScale
- New scalepublic static double getScale()
public abstract void draw(java.awt.Graphics2D g2)
g2
- The context to draw the graphics topublic static int scale(double value)
value
- Value to scale
public static int scale(int value)
value
- Value to scale
public static double invScale(double value)
value
- The value to inverse-scale
scale(double)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |