org.primordion.user.app
Class TurtleExample1

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
          extended byorg.primordion.xholon.base.Turtle
              extended byorg.primordion.user.app.TurtleExample1
All Implemented Interfaces:
ITurtle, IXholon

public class TurtleExample1
extends Turtle


Field Summary
static int SIG_SELF
           
 
Fields inherited from class org.primordion.xholon.base.Turtle
color, heading, isHidden, penMode, xcor, ycor
 
Fields inherited from class org.primordion.xholon.base.XholonWithPorts
port
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
Fields inherited from interface org.primordion.xholon.base.ITurtle
COMMANDID_NONE, FILTERID_NONE, PENMODE_DOWN, PENMODE_ERASE, PENMODE_UP, WHENMOVED_INIT
 
Fields inherited from interface org.primordion.xholon.base.IXholon
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx
 
Constructor Summary
TurtleExample1()
           
 
Method Summary
static java.lang.String getAppSpecificParam1()
           
 void initialize()
          Initialize the tree node.
 void postConfigure()
          Perform some action, typically once at start up; MAY be overridden.
 void processReceivedMessage(Message msg)
          Process a received ROOM/UML2 message taken from the message queue.
static void setAppSpecificParam1(java.lang.String AppSpecificParam1Arg)
           
 void toBranch(double length, int level)
          source: Abelson, H.
 double toEquispi(double side, double angle, double scale)
          source: Abelson, H.
 double toInspi(double side, double angle, double inc)
          source: Abelson, H.
 void toLBranch(double length, double angle, int level)
          source: Abelson, H.
 void toLDragon(double size, int level)
          source: Abelson, H.
 void toPoly(double side, double angle)
          Draw a polygon.
 double toPolyspi(double side, double angle, double inc)
          source: Abelson, H.
 void toRBranch(double length, double angle, int level)
           
 void toRDragon(double size, int level)
           
 void toSquare(double size)
          Draw a square.
 
Methods inherited from class org.primordion.xholon.base.Turtle
aggregate, back, beep, bk, canMove, die, distance, distancexy, downhill, downhill4, dx, dy, face, facexy, fd, forward, getBreed, getColor, getHeading, getIsHidden, getLabel, getMaxPxcor, getMaxPycor, getMinPxcor, getMinPycor, getPcolor, getPenMode, getPlabel, getPxcor, getPycor, getWho, getWorldHeight, getWorldWidth, getXcor, getYcor, hasAlreadyMoved, hatch, hideTurtle, home, ht, inCone, initWhenMoved, inRadius, inRadius, jump, jump, jump, left, lineBresenham, lt, neighbors, neighbors4, otherTurtlesHere, patchAhead, patchAt, patchAtHeadingAndDistance, patchHere, patchLeftAndAhead, patchRightAndAhead, pd, pe, penDown, penErase, penUp, pu, right, rt, setBreed, setColor, setHeading, setIsHidden, setLabel, setPcolor, setPenMode, setPlabel, setPxcor, setPycor, setWho, setXcor, setxy, setYcor, showTurtle, st, stamp, stampErase, toString, towards, towardsxy, turtlesAt, turtlesHere, turtlesOn, uphill, uphill4, with
 
Methods inherited from class org.primordion.xholon.base.XholonWithPorts
configure, getMaxPorts, getPort, isActiveObject, isBound, isContainer, isPassiveObject, setMaxPorts, setPorts, terminate
 
Methods inherited from class org.primordion.xholon.base.Xholon
act, appendChild, appendChild, appendChild, cleanup, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPreviousSibling, getRoleName, getRootNode, getSiblings, getSizeMessageQ, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isExternal, isInternal, isLeaf, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, reconfigure, remove, removeChild, resetNextId, sendMessage, sendMessage, sendMessage, setAttributeVal, setFactory, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setRoleName, setSizeMessageQ, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, treeSize, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.primordion.xholon.base.IXholon
act, appendChild, appendChild, appendChild, cleanup, configure, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPort, getPreviousSibling, getRoleName, getRootNode, getSiblings, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isActiveObject, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, reconfigure, remove, removeChild, sendMessage, sendMessage, sendMessage, setAttributeVal, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPorts, setRoleName, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, terminate, treeSize, writeXml
 

Field Detail

SIG_SELF

public static final int SIG_SELF
See Also:
Constant Field Values
Constructor Detail

TurtleExample1

public TurtleExample1()
Method Detail

setAppSpecificParam1

public static void setAppSpecificParam1(java.lang.String AppSpecificParam1Arg)

getAppSpecificParam1

public static java.lang.String getAppSpecificParam1()

initialize

public void initialize()
Description copied from interface: IXholon
Initialize the tree node. Typically this is only used to re-initialize a node, such as when it is reused through the TreeNodeFactoryStatic.

Specified by:
initialize in interface IXholon
Overrides:
initialize in class XholonWithPorts

postConfigure

public void postConfigure()
Description copied from interface: IXholon
Perform some action, typically once at start up; MAY be overridden. Recursive; application should call this only for root.

Specified by:
postConfigure in interface IXholon
Overrides:
postConfigure in class XholonWithPorts

processReceivedMessage

public void processReceivedMessage(Message msg)
Description copied from interface: IXholon
Process a received ROOM/UML2 message taken from the message queue. All sent messages are placed in queues before they are processed.

Specified by:
processReceivedMessage in interface IXholon
Overrides:
processReceivedMessage in class Xholon

toSquare

public void toSquare(double size)
Draw a square. Example of a higher level procedure. This is NOT part of the core turtle language.

Parameters:
size - The length of the edges of the square.

toPoly

public void toPoly(double side,
                   double angle)
Draw a polygon. Example of a higher level procedure. This is NOT part of the core turtle language.

Parameters:
side - The length of a side of the polygon.
angle - The angle in degrees between sides.

toPolyspi

public double toPolyspi(double side,
                        double angle,
                        double inc)
source: Abelson, H. and diSessa, A. (1980). Turtle Geometry. Cambridge, MA: MIT Press. (p.19)

Parameters:
side -
angle -
inc -
Returns:

toInspi

public double toInspi(double side,
                      double angle,
                      double inc)
source: Abelson, H. and diSessa, A. (1980). Turtle Geometry. Cambridge, MA: MIT Press. (p.20)

Parameters:
side -
angle -
inc -
Returns:

toEquispi

public double toEquispi(double side,
                        double angle,
                        double scale)
source: Abelson, H. and diSessa, A. (1980). Turtle Geometry. Cambridge, MA: MIT Press. (p.77)

Parameters:
side -
angle -
scale -
Returns:

toBranch

public void toBranch(double length,
                     int level)
source: Abelson, H. and diSessa, A. (1980). Turtle Geometry. Cambridge, MA: MIT Press. (p.83)

Parameters:
length -
level -

toLBranch

public void toLBranch(double length,
                      double angle,
                      int level)
source: Abelson, H. and diSessa, A. (1980). Turtle Geometry. Cambridge, MA: MIT Press. (p.84)

Parameters:
length -
angle -
level -

toRBranch

public void toRBranch(double length,
                      double angle,
                      int level)

toLDragon

public void toLDragon(double size,
                      int level)
source: Abelson, H. and diSessa, A. (1980). Turtle Geometry. Cambridge, MA: MIT Press. (p.93)

Parameters:
size -
level -

toRDragon

public void toRDragon(double size,
                      int level)