algoanim.animalscript
Class AnimalSourceCodeGenerator

java.lang.Object
  extended by algoanim.primitives.generators.Generator
      extended by algoanim.animalscript.AnimalGenerator
          extended by algoanim.animalscript.AnimalSourceCodeGenerator
All Implemented Interfaces:
GeneratorInterface, SourceCodeGenerator

public class AnimalSourceCodeGenerator
extends AnimalGenerator
implements SourceCodeGenerator

Author:
Stephan Mehlhase

Field Summary
 
Fields inherited from class algoanim.primitives.generators.Generator
lang
 
Constructor Summary
AnimalSourceCodeGenerator(Language aLang)
           
 
Method Summary
 void addCodeElement(SourceCode code, java.lang.String codeline, java.lang.String name, int indentation, boolean noSpace, int row, Timing t)
          Adds a new code element to the SourceCode.
 void addCodeElement(SourceCode code, java.lang.String codeline, java.lang.String name, int indentation, int row, Timing t)
          Adds a new code element to the SourceCode.
 void addCodeLine(SourceCode code, java.lang.String codeline, java.lang.String name, int indentation, Timing t)
          Adds a new code line to the SourceCode.
 void create(SourceCode sc)
          Creates the originating script code for a given SourceCode, due to the fact that before a primitive can be worked with it has to be defined and made known to the script language.
 void hide(SourceCode code, Timing delay)
          Hides the given SourceCode element.
 void highlight(SourceCode code, int line, int row, boolean context, Timing delay, Timing duration)
          Highlights a line in a certain SourceCode element.
 void highlight(SourceCode code, java.lang.String lineName, int row, boolean context, Timing delay, Timing duration)
           
 void unhighlight(SourceCode code, int line, int row, boolean context, Timing delay, Timing duration)
          Unhighlights a line in a certain SourceCode element.
 void unhighlight(SourceCode code, java.lang.String lineName, int row, boolean context, Timing delay, Timing duration)
           
 
Methods inherited from class algoanim.animalscript.AnimalGenerator
addBooleanOption, addBooleanSwitch, addColorOption, addColorOption, addFontOption, addFontOption, addIntOption, addWithTiming, changeColor, exchange, hide, makeColorDef, makeColorDef, makeDisplayOptionsDef, makeDisplayOptionsDef, makeDurationTimingDef, makeHiddenDef, makeNodeDef, makeOffsetTimingDef, moveBy, moveTo, moveVia, rotate, rotate, show
 
Methods inherited from class algoanim.primitives.generators.Generator
getLanguage, isNameUsed, isValidDirection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface algoanim.primitives.generators.GeneratorInterface
changeColor, exchange, getLanguage, hide, moveBy, moveTo, moveVia, rotate, rotate, show
 

Constructor Detail

AnimalSourceCodeGenerator

public AnimalSourceCodeGenerator(Language aLang)
Method Detail

create

public void create(SourceCode sc)
Description copied from interface: SourceCodeGenerator
Creates the originating script code for a given SourceCode, due to the fact that before a primitive can be worked with it has to be defined and made known to the script language.

Specified by:
create in interface SourceCodeGenerator
Parameters:
sc - the SourceCode for which the initiate script code shall be created.
See Also:
#create(algoanim.primitives.SourceCode)

highlight

public void highlight(SourceCode code,
                      int line,
                      int row,
                      boolean context,
                      Timing delay,
                      Timing duration)
Description copied from interface: SourceCodeGenerator
Highlights a line in a certain SourceCode element.

Specified by:
highlight in interface SourceCodeGenerator
Parameters:
code - the SourceCode which the line belongs to.
line - the line to highlight.
row - the code element to highlight.
context - use the code context colour instead of the code highlight colour.
delay - the delay to apply to this operation.
duration - the duration of the action.
See Also:
#highlight( algoanim.primitives.SourceCode, int, int, boolean, algoanim.util.Timing, algoanim.util.Timing)

highlight

public void highlight(SourceCode code,
                      java.lang.String lineName,
                      int row,
                      boolean context,
                      Timing delay,
                      Timing duration)
See Also:
SourceCodeGenerator.highlight( algoanim.primitives.SourceCode, int, int, boolean, algoanim.util.Timing, algoanim.util.Timing)

unhighlight

public void unhighlight(SourceCode code,
                        java.lang.String lineName,
                        int row,
                        boolean context,
                        Timing delay,
                        Timing duration)
See Also:
#unhighlight( algoanim.primitives.SourceCode, int, int, boolean, algoanim.util.Timing, algoanim.util.Timing)

unhighlight

public void unhighlight(SourceCode code,
                        int line,
                        int row,
                        boolean context,
                        Timing delay,
                        Timing duration)
Description copied from interface: SourceCodeGenerator
Unhighlights a line in a certain SourceCode element.

Specified by:
unhighlight in interface SourceCodeGenerator
Parameters:
code - the SourceCode which the line belongs to.
line - the line to unhighlight.
row - the code element to unhighlight.
context - use the code context colour instead of the code highlight colour.
delay - the delay to apply to this operation.
duration - the duration of the action.
See Also:
#unhighlight( algoanim.primitives.SourceCode, int, int, boolean, algoanim.util.Timing, algoanim.util.Timing)

hide

public void hide(SourceCode code,
                 Timing delay)
Description copied from interface: SourceCodeGenerator
Hides the given SourceCode element.

Specified by:
hide in interface SourceCodeGenerator
Parameters:
code - the SourceCode to hide.
delay - the delay to apply to this operation.
See Also:
#hide( algoanim.primitives.SourceCode, algoanim.util.Timing)

addCodeElement

public void addCodeElement(SourceCode code,
                           java.lang.String codeline,
                           java.lang.String name,
                           int indentation,
                           int row,
                           Timing t)
Description copied from interface: SourceCodeGenerator
Adds a new code element to the SourceCode.

Specified by:
addCodeElement in interface SourceCodeGenerator
Parameters:
code - the SourceCode which the element shall belong to.
codeline - the actual code.
name - a distinct name for the element.
indentation - the indentation to apply to this line.
row - specifies which entry of the current line this element should be.
t - the delay after which this operation shall be performed.
See Also:
#addCodeElement( algoanim.primitives.SourceCode, java.lang.String, java.lang.String, int, int, algoanim.util.Timing)

addCodeLine

public void addCodeLine(SourceCode code,
                        java.lang.String codeline,
                        java.lang.String name,
                        int indentation,
                        Timing t)
Description copied from interface: SourceCodeGenerator
Adds a new code line to the SourceCode.

Specified by:
addCodeLine in interface SourceCodeGenerator
Parameters:
code - the SourceCode which the line shall belong to.
codeline - the actual code.
name - a distinct name for the line.
indentation - the indentation to apply to this line.
t - the delay after which this operation shall be performed.
See Also:
#addCodeLine( algoanim.primitives.SourceCode, java.lang.String, java.lang.String, int, algoanim.util.Timing)

addCodeElement

public void addCodeElement(SourceCode code,
                           java.lang.String codeline,
                           java.lang.String name,
                           int indentation,
                           boolean noSpace,
                           int row,
                           Timing t)
Description copied from interface: SourceCodeGenerator
Adds a new code element to the SourceCode.

Specified by:
addCodeElement in interface SourceCodeGenerator
Parameters:
code - the SourceCode which the element shall belong to.
codeline - the actual code.
name - a distinct name for the element.
indentation - the indentation to apply to this line.
row - specifies which entry of the current line this element should be.
t - the delay after which this operation shall be performed.