|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.fcps.karel2.Display
public class Display
Display houses most of the static constants used in object creation and rendering, Karel file locations and images, and the speed at which the WorldPanel updates. The Display.step() method is responsible for the animation of the Panel.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_MAP
|
static int |
EAST
|
static int |
FRAME_HEIGHT
|
static int |
FRAME_WIDTH
|
static int |
HORIZONTAL
|
static int |
INFINITY
|
static int |
NORTH
|
static int |
SOUTH
|
static int |
VERTICAL
|
static int |
WEST
|
Constructor Summary | |
---|---|
Display()
|
Method Summary | |
---|---|
static int |
getSpeed()
Returns the speed at which the Display updates. |
static boolean |
isDead()
Returns whether or not the Display is currently dead (no longer able to update). |
static void |
openDefaultWorld()
Closes the current world if there is one, then creates a new WorldFrame with the default map. |
static void |
openWorld(java.lang.String mapName)
Closes the current world if there is one, then creates a new WorldFrame with the specified map file. |
static void |
pause()
Sleeps the Thread for a period of time based on the current Display speed. |
static void |
setSize(int x,
int y)
The same as calling WorldBackend.setSize(x, y) |
static void |
setSpeed(int s)
Sets the speed at which the Display updates. |
static int |
validateDirection(int dir)
Takes a possible invalid direction and returns a valid one via modding |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_MAP
public static final int EAST
public static final int NORTH
public static final int WEST
public static final int SOUTH
public static int FRAME_WIDTH
public static int FRAME_HEIGHT
public static final int VERTICAL
public static final int HORIZONTAL
public static final int INFINITY
Constructor Detail |
---|
public Display()
Method Detail |
---|
public static void openWorld(java.lang.String mapName)
mapName
- the path to the map file to be loadedpublic static void openDefaultWorld()
public static void setSpeed(int s)
s
- the requested speed of the Display. If it is greater than the max speed, the speed
is set to the max speedpublic static int getSpeed()
public static int validateDirection(int dir)
dir
- a possibly invalid direction
public static void setSize(int x, int y)
x
- y
- public static void pause()
public static boolean isDead()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |