|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sysModel.env.AGlobalEnv sysModel.env.NoGridEnv
public class NoGridEnv
An environment that does not use grids to place fish.
Nested Class Summary | |
---|---|
static class |
NoGridEnv.Direction
Concrete direction class. |
protected class |
NoGridEnv.LocalEnvironment
Concrete local environment for the square unbounded environment. |
static class |
NoGridEnv.Location
Concrete location class. |
static class |
NoGridEnv.Test_NoGridEnv
Test cases for NoGridEnv. |
static class |
NoGridEnv.Test_NoGridEnv_LocalEnv
Test cases for NoGridEnv.LocalEnv. |
Nested classes/interfaces inherited from class sysModel.env.AGlobalEnv |
---|
AGlobalEnv.ALocalEnv, AGlobalEnv.BreedLambda, AGlobalEnv.ILocalEnvVisitor |
Field Summary | |
---|---|
private LRStruct |
_localEnvList
List of local environments in this global environment. |
private int |
_rotSteps
Number of steps for complete rotation. |
private static java.awt.geom.Point2D.Double |
PAN_CENTER
|
private static int |
PAN_SIZE
|
Fields inherited from class sysModel.env.AGlobalEnv |
---|
_breedLambdas, _cmdFactory, _moveLambdas, _securityManager, _waterColor, OCEAN_BLUE |
Constructor Summary | |
---|---|
NoGridEnv(ICmdFactory cmdFactory,
ISecurityAdapter sm)
Create a new environment without grids. |
|
NoGridEnv(ICmdFactory cmdFactory,
ISecurityAdapter sm,
int rotSteps,
java.awt.Color waterColor)
Create a new environment without grids. |
Method Summary | |
---|---|
protected void |
addFishToInternalData(AGlobalEnv.ALocalEnv localEnv,
AFish fish)
Add the fish to the global environment. |
protected NoGridEnv.LocalEnvironment |
createLocalEnvironment(NoGridEnv.Location loc,
NoGridEnv.Direction dir)
Create a local environment with the given data. |
ILambda |
editFish(AGlobalEnv.ALocalEnv le,
IFishFactory fishFactory,
int button)
Edit the fish. |
java.awt.Dimension |
getDisplaySize()
Get size of the display. |
java.awt.geom.Point2D.Double |
getPanDelta(java.awt.geom.Point2D.Double delta)
Ask the model how much to pan, given where the user scrolled. |
ILambda |
getToolTipText(java.awt.geom.Point2D.Double p)
Get a tool tip description for a specific place in the environment. |
java.awt.geom.Point2D.Double |
getViewPosition(java.awt.geom.Point2D.Double pos)
Ask the model where to scroll, given where the user has scrolled. |
AEnvFactory |
makeEnvFactory()
Get the environment settings class. |
private AGlobalEnv.ALocalEnv |
makeLocalEnv(NoGridEnv.Location loc,
NoGridEnv.Direction dir)
Create a local environment for the position. |
AGlobalEnv.ALocalEnv |
makeLocalEnv(java.awt.geom.Point2D.Double p)
Create a local environment for the position. |
protected AGlobalEnv |
parseEnvironment(Lexer l)
Factory method for parsing a stream of tokens and creating a global environment from it. |
protected void |
parseFish(Lexer l)
Parse fish and add them to the environment. |
protected void |
printHeader(java.io.PrintWriter pw)
Print file header. |
protected void |
removeFishFromInternalData(AGlobalEnv.ALocalEnv localEnv)
Remove the fish from the global environment. |
void |
returnHome(IScrollAdapter sa)
The action to be executed if the display should return home. |
Methods inherited from class sysModel.env.AGlobalEnv |
---|
addFish, deactivateBreedLambdas, deactivateMoveLambdas, drawBackground, makeDrawCmd, makeEditCmd, makeStepCmd, parse, removeFish, save |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static int PAN_SIZE
private static java.awt.geom.Point2D.Double PAN_CENTER
private LRStruct _localEnvList
private int _rotSteps
Constructor Detail |
---|
public NoGridEnv(ICmdFactory cmdFactory, ISecurityAdapter sm)
cmdFactory
- command factory to usesm
- security manager to control fish actionspublic NoGridEnv(ICmdFactory cmdFactory, ISecurityAdapter sm, int rotSteps, java.awt.Color waterColor)
cmdFactory
- command factory to usesm
- security manager to control fish actionsrotSteps
- rotation stepswaterColor
- color of the waterMethod Detail |
---|
protected void addFishToInternalData(AGlobalEnv.ALocalEnv localEnv, AFish fish)
addFishToInternalData
in class AGlobalEnv
localEnv
- local environmentfish
- fish to addprotected void removeFishFromInternalData(AGlobalEnv.ALocalEnv localEnv)
removeFishFromInternalData
in class AGlobalEnv
localEnv
- local environmentpublic AGlobalEnv.ALocalEnv makeLocalEnv(java.awt.geom.Point2D.Double p)
makeLocalEnv
in class AGlobalEnv
p
- position
private AGlobalEnv.ALocalEnv makeLocalEnv(NoGridEnv.Location loc, NoGridEnv.Direction dir)
loc
- locationdir
- direction
protected NoGridEnv.LocalEnvironment createLocalEnvironment(NoGridEnv.Location loc, NoGridEnv.Direction dir)
loc
- locationdir
- direction
public ILambda editFish(AGlobalEnv.ALocalEnv le, IFishFactory fishFactory, int button)
editFish
in class AGlobalEnv
le
- local environmentfishFactory
- button
-
protected AGlobalEnv parseEnvironment(Lexer l)
parseEnvironment
in class AGlobalEnv
l
- lexer to use
protected void parseFish(Lexer l)
parseFish
in class AGlobalEnv
l
- parser to read frompublic AEnvFactory makeEnvFactory()
makeEnvFactory
in class AGlobalEnv
protected void printHeader(java.io.PrintWriter pw)
printHeader
in class AGlobalEnv
pw
- PrintWriter to usepublic java.awt.Dimension getDisplaySize()
getDisplaySize
in class AGlobalEnv
public void returnHome(IScrollAdapter sa)
returnHome
in class AGlobalEnv
sa
- scroll adapterpublic java.awt.geom.Point2D.Double getViewPosition(java.awt.geom.Point2D.Double pos)
getViewPosition
in class AGlobalEnv
pos
- position where the user scrolled to
IDisplayAdapter.getPanDelta(java.awt.geom.Point2D.Double)
public java.awt.geom.Point2D.Double getPanDelta(java.awt.geom.Point2D.Double delta)
getPanDelta
in class AGlobalEnv
delta
- how far the user scrolled
IDisplayAdapter.getViewPosition(java.awt.geom.Point2D.Double)
public ILambda getToolTipText(java.awt.geom.Point2D.Double p)
getToolTipText
in class AGlobalEnv
p
- mouse coordinates
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |