|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimulation_MVC_Basic.Utility
public class Utility
Method Summary | |
---|---|
static java.awt.geom.Rectangle2D |
getBoundingBox(java.lang.String theText,
java.awt.Font f,
java.awt.Graphics2D g)
Returns a bounding box that encapsulates the passed text string, as rendered in the specified font in the specified graphics context. |
static java.awt.Dimension |
getQuarterOfScreen()
This method determines the dimensions of the screen that is being used by the VM and returns a dimension that is half the width and half the height. |
static ShapeSprite |
getRandomShapeSprite(int width,
int height)
This method returns a sprite that is randomly chosen from among the "tubular", "sphere" and "tri-fold" versions. |
static int |
getRandomValue(int val1,
int val2)
This method returns a displacement value from the range [MIN,...,MAX], where MIN and MAX are taken from the parameters, val1 and val2. |
static ShapeSprite |
getShapeSprite(int width,
int height)
This method returns a "tubular" sprite. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getRandomValue(int val1, int val2)
val1
- val2
-
public static java.awt.Dimension getQuarterOfScreen()
public static ShapeSprite getShapeSprite(int width, int height)
width
- the width of the game worldheight
- the width of the game world
public static ShapeSprite getRandomShapeSprite(int width, int height)
width
- the width of the game worldheight
- the width of the game world
public static java.awt.geom.Rectangle2D getBoundingBox(java.lang.String theText, java.awt.Font f, java.awt.Graphics2D g)
theText
- the string for which the bounding box is desiredf
- the Font that will be used to render the textg
- the graphics context in which the font will be used
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |