sysModel.env
Class WrappingEnv

java.lang.Object
  extended by sysModel.env.AGlobalEnv
      extended by sysModel.env.ASquareEnv
          extended by sysModel.env.BoundedEnv
              extended by sysModel.env.WrappingEnv

public class WrappingEnv
extends BoundedEnv

Implementation of a square wrapping environment.

Author:
Mathias G. Ricken

Nested Class Summary
 class WrappingEnv.Location
          Overridden location class that does wrapping.
static class WrappingEnv.Test_WrappingEnv
          Test cases for WrappingEnv.
static class WrappingEnv.Test_WrappingEnv_LocalEnv
          Test cases for WrappingEnv.LocalEnv.
static class WrappingEnv.Test_WrappingEnv_Location
          Test cases for WrappingEnv.Location.
 
Nested classes/interfaces inherited from class sysModel.env.BoundedEnv
BoundedEnv.EmptyField, BoundedEnv.IField, BoundedEnv.IFieldVisitor, BoundedEnv.LocalEnvironment, BoundedEnv.NonEmptyField, BoundedEnv.Test_BoundedEnv, BoundedEnv.Test_BoundedEnv_LocalEnv
 
Nested classes/interfaces inherited from class sysModel.env.ASquareEnv
ASquareEnv.ASquareLocalEnvironment, ASquareEnv.Direction, ASquareEnv.Location
 
Nested classes/interfaces inherited from class sysModel.env.AGlobalEnv
AGlobalEnv.ALocalEnv, AGlobalEnv.BreedLambda, AGlobalEnv.ILocalEnvVisitor
 
Field Summary
 
Fields inherited from class sysModel.env.BoundedEnv
_fieldMap, _height, _outOfBounds, _width, PAN_CENTER, PAN_SIZE
 
Fields inherited from class sysModel.env.AGlobalEnv
_breedLambdas, _cmdFactory, _moveLambdas, _securityManager, _waterColor, OCEAN_BLUE
 
Constructor Summary
WrappingEnv(ICmdFactory cmdFactory, ISecurityAdapter sm)
          Construct a new square wrapping environment.
WrappingEnv(ICmdFactory cmdFactory, ISecurityAdapter sm, int width, int height)
          Construct a new square wrapping environment.
 
Method Summary
 AEnvFactory makeEnvFactory()
          Get the environment settings class.
 ASquareEnv.Location makeLocation(double x, double y)
          Factory method for overridden Location.
protected  AGlobalEnv parseEnvironment(Lexer l)
          Factory method for parsing a stream of tokens and creating a global environment from it.
 
Methods inherited from class sysModel.env.BoundedEnv
addFishToInternalData, createLocalEnvironment, getDisplaySize, getPanDelta, getViewPosition, makeLocalEnv, printHeader, removeFishFromInternalData, returnHome
 
Methods inherited from class sysModel.env.ASquareEnv
editFish, getToolTipText, makeDirection, makeDirection, makeDirection, makeLocalEnv, parseFish
 
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
 

Constructor Detail

WrappingEnv

public WrappingEnv(ICmdFactory cmdFactory,
                   ISecurityAdapter sm)
Construct a new square wrapping environment. Does not set this object up for actual use. Note: This constructor needs to exist and be public for the "environment selection" dialog to work.

Parameters:
cmdFactory - command factory to use
sm - security manager to control fish action

WrappingEnv

public WrappingEnv(ICmdFactory cmdFactory,
                   ISecurityAdapter sm,
                   int width,
                   int height)
Construct a new square wrapping environment.

Parameters:
cmdFactory - command factory to use
sm - security manager to control fish actions
width - width of environment
height - height of environment
Method Detail

makeLocation

public ASquareEnv.Location makeLocation(double x,
                                        double y)
Factory method for overridden Location.

Overrides:
makeLocation in class ASquareEnv
Parameters:
x - x coordinate
y - y coordinate
Returns:
new WrappingEnv.Location at (x, y)

makeEnvFactory

public AEnvFactory makeEnvFactory()
Get the environment settings class.

Overrides:
makeEnvFactory in class BoundedEnv
Returns:
environment settings class

parseEnvironment

protected AGlobalEnv parseEnvironment(Lexer l)
Factory method for parsing a stream of tokens and creating a global environment from it.

Overrides:
parseEnvironment in class BoundedEnv
Parameters:
l - lexer
Returns:
new global environment