|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgoanim.primitives.generators.Generator
algoanim.animalscript.AnimalGenerator
public abstract class AnimalGenerator
This class implements functionality which is shared by all AnimalScript generators. Especially this applies to operations that can be performed on all primitives.
| Field Summary |
|---|
| Fields inherited from class algoanim.primitives.generators.Generator |
|---|
lang |
| Constructor Summary | |
|---|---|
AnimalGenerator(Language aLang)
Provides the given Language object to the Generator. |
|
| Method Summary | |
|---|---|
protected boolean |
addBooleanOption(AnimationProperties ap,
java.lang.String key,
java.lang.String entry,
java.lang.StringBuilder builder)
|
protected boolean |
addBooleanSwitch(AnimationProperties ap,
java.lang.String key,
java.lang.String ifTrue,
java.lang.String otherwise,
java.lang.StringBuilder builder)
|
protected boolean |
addColorOption(AnimationProperties ap,
java.lang.StringBuilder builder)
|
protected boolean |
addColorOption(AnimationProperties ap,
java.lang.String key,
java.lang.String entry,
java.lang.StringBuilder builder)
|
protected void |
addFontOption(AnimationProperties ap,
java.lang.String key,
java.lang.StringBuilder builder)
|
protected void |
addFontOption(AnimationProperties ap,
java.lang.String key,
java.lang.String tag,
java.lang.StringBuilder builder)
|
protected boolean |
addIntOption(AnimationProperties ap,
java.lang.String key,
java.lang.String entry,
java.lang.StringBuilder builder)
|
protected void |
addWithTiming(java.lang.StringBuilder sb,
Timing delay,
Timing duration)
|
void |
changeColor(Primitive elem,
java.lang.String colorType,
java.awt.Color newColor,
Timing delay,
Timing d)
Changes the color of a specified part of a Primitive after a
given delay. |
void |
exchange(Primitive p,
Primitive q)
Exchanges to Primitives after a given delay. |
void |
hide(Primitive q,
Timing t)
Hides a Primitive after a given delay. |
static java.lang.String |
makeColorDef(java.awt.Color aColor)
Creates a color definition in AnimalScript for the given values of red, green and blue. |
static java.lang.String |
makeColorDef(int r,
int g,
int b)
Creates a color definition in AnimalScript for the given values of red, green and blue. |
static java.lang.String |
makeDisplayOptionsDef(DisplayOptions d)
Creates the AnimalScript code for a DisplayOptions object. |
static java.lang.String |
makeDisplayOptionsDef(DisplayOptions d,
AnimationProperties props)
Creates the AnimalScript code for a DisplayOptions object. |
static java.lang.String |
makeDurationTimingDef(Timing duration)
Creates the AnimalScript code for a duration Timing. |
static java.lang.String |
makeHiddenDef(AnimationProperties props)
Creates the AnimalScript representation for a hidden object |
static java.lang.String |
makeNodeDef(Node n)
Creates the definition of a Node in AnimalScript. |
static java.lang.String |
makeOffsetTimingDef(Timing delay)
Creates the AnimalScript represantation of a Timing. |
void |
moveBy(Primitive p,
java.lang.String moveType,
int dx,
int dy,
Timing delay,
Timing duration)
Moves a Primitive to a point |
void |
moveTo(Primitive p,
java.lang.String direction,
java.lang.String moveType,
Node target,
Timing delay,
Timing duration)
Moves a Primitive to a point |
void |
moveVia(Primitive elem,
java.lang.String direction,
java.lang.String moveType,
Primitive via,
Timing delay,
Timing d)
Moves a Primitive along a Path in a given direction after a
set delay. |
void |
rotate(Primitive p,
Node center,
int degrees,
Timing t,
Timing d)
Rotates a Primitive by a given angle around a finite point
after a delay. |
void |
rotate(Primitive p,
Primitive around,
int degrees,
Timing t,
Timing d)
Rotates a Primitive around itself by a given angle after a
delay. |
void |
show(Primitive p,
Timing t)
Unhides a Primitive after a given delay. |
| 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 |
| Constructor Detail |
|---|
public AnimalGenerator(Language aLang)
Language object to the Generator.
aLang - the related Language object| Method Detail |
|---|
public static java.lang.String makeNodeDef(Node n)
Node in AnimalScript.
n - the node for which the code shall be created.
public static java.lang.String makeColorDef(int r,
int g,
int b)
r - the red part of the color (must between 0 - 255)g - the green part of the color (must between 0 - 255)b - the blue part of the color (must between 0 - 255)
public static java.lang.String makeColorDef(java.awt.Color aColor)
aColor - the color to be converted to a String
public static java.lang.String makeOffsetTimingDef(Timing delay)
Timing.
delay - the Timing to handle.
public static java.lang.String makeHiddenDef(AnimationProperties props)
props - the properties item
public static java.lang.String makeDurationTimingDef(Timing duration)
Timing.
duration - the Timing for which the code shall be created.
public static java.lang.String makeDisplayOptionsDef(DisplayOptions d)
DisplayOptions object.
d - the DisplayOptions for which the code shall be
created.
DisplayOptions.
public static java.lang.String makeDisplayOptionsDef(DisplayOptions d,
AnimationProperties props)
DisplayOptions object.
d - the DisplayOptions for which the code shall be
created.
DisplayOptions.
public void exchange(Primitive p,
Primitive q)
GeneratorInterfacePrimitives after a given delay.
p - the first Primitive.q - the second Primitive.GeneratorInterface.exchange(algoanim.primitives.Primitive,
algoanim.primitives.Primitive)
public void hide(Primitive q,
Timing t)
GeneratorInterfacePrimitive after a given delay.
q - the Primitive to hide.t - the delay before the operation is performed.#hide(algoanim.primitives.Primitive, algoanim.util.Timing)
public void rotate(Primitive p,
Primitive around,
int degrees,
Timing t,
Timing d)
GeneratorInterfacePrimitive around itself by a given angle after a
delay.
p - the Primitive to rotate.degrees - the angle by which the Primitive shall be rotated.t - the delay after which the operation shall be performed.d - the duration of the operation.#rotate(algoanim.primitives.Primitive, algoanim.primitives.Primitive,
int, algoanim.util.Timing, algoanim.util.Timing)
public void rotate(Primitive p,
Node center,
int degrees,
Timing t,
Timing d)
GeneratorInterfacePrimitive by a given angle around a finite point
after a delay.
p - the Primitive to rotate.center - the Point around which the Primitive shall be
rotated.degrees - the angle by which the Primitive shall be rotated.t - the delay after which the operation shall be performed.d - the duration of the operation.#rotate(algoanim.primitives.Primitive, algoanim.util.Node, int,
algoanim.util.Timing, algoanim.util.Timing)
public void show(Primitive p,
Timing t)
GeneratorInterfacePrimitive after a given delay.
p - the Primitive to show.t - the delay before the operation is performed.#show(algoanim.primitives.Primitive, algoanim.util.Timing)
public void moveVia(Primitive elem,
java.lang.String direction,
java.lang.String moveType,
Primitive via,
Timing delay,
Timing d)
throws IllegalDirectionException
GeneratorInterfacePrimitive along a Path in a given direction after a
set delay.
elem - the Primitive to move.direction - the direction to move the Primitive.moveType - the type of the movement.via - the Arc, along which the Primitive
is moved.delay - the delay, before the operation is performed.d - the duration of the operation.
IllegalDirectionException#moveVia(algoanim.primitives.Primitive, java.lang.String,
java.lang.String, algoanim.primitives.Primitive, algoanim.util.Timing,
algoanim.util.Timing)
public void moveTo(Primitive p,
java.lang.String direction,
java.lang.String moveType,
Node target,
Timing delay,
Timing duration)
throws IllegalDirectionException
GeneratorInterfacePrimitive to a point
p - the Primitive to move.direction - the direction to move the Primitive.moveType - the type of the movement.target - the point where the Primitive is moved to.delay - the delay, before the operation is performed.duration - the duration of the operation.
IllegalDirectionException#moveTo(algoanim.primitives.Primitive, java.lang.String,
java.lang.String, algoanim.util.Node, algoanim.util.Timing,
algoanim.util.Timing)
public void moveBy(Primitive p,
java.lang.String moveType,
int dx,
int dy,
Timing delay,
Timing duration)
GeneratorInterfacePrimitive to a point
p - the Primitive to move.moveType - the type of the movement.dx - the x offset to movedy - the y offset to movedelay - the delay, before the operation is performed.duration - the duration of the operation.#moveBy(algoanim.primitives.Primitive, java.lang.String, int, int,
algoanim.util.Timing, algoanim.util.Timing)
protected boolean addIntOption(AnimationProperties ap,
java.lang.String key,
java.lang.String entry,
java.lang.StringBuilder builder)
protected boolean addBooleanOption(AnimationProperties ap,
java.lang.String key,
java.lang.String entry,
java.lang.StringBuilder builder)
protected boolean addBooleanSwitch(AnimationProperties ap,
java.lang.String key,
java.lang.String ifTrue,
java.lang.String otherwise,
java.lang.StringBuilder builder)
protected void addWithTiming(java.lang.StringBuilder sb,
Timing delay,
Timing duration)
protected boolean addColorOption(AnimationProperties ap,
java.lang.StringBuilder builder)
protected boolean addColorOption(AnimationProperties ap,
java.lang.String key,
java.lang.String entry,
java.lang.StringBuilder builder)
protected void addFontOption(AnimationProperties ap,
java.lang.String key,
java.lang.StringBuilder builder)
protected void addFontOption(AnimationProperties ap,
java.lang.String key,
java.lang.String tag,
java.lang.StringBuilder builder)
public void changeColor(Primitive elem,
java.lang.String colorType,
java.awt.Color newColor,
Timing delay,
Timing d)
GeneratorInterfacePrimitive after a
given delay.
elem - the Primitive to which the action shall be applied.colorType - the part of the Primitive to change.newColor - the new color.delay - the delay, before the operation is performed.d - the duration of the operation.#changeColor(algoanim.primitives.Primitive, java.lang.String,
java.awt.Color, algoanim.util.Timing, algoanim.util.Timing)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||