|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgoanim.primitives.Primitive
algoanim.primitives.SourceCode
public class SourceCode
Represents a source code element defined by its upper left corner and source code lines, which can be added.
| Field Summary | |
|---|---|
protected java.lang.Integer |
actRow
|
protected SourceCodeGenerator |
generator
|
protected java.util.Vector<java.lang.String> |
highlightedLabels
|
protected java.util.HashMap<java.lang.String,java.lang.Integer> |
labelLines
|
protected java.util.HashMap<java.lang.String,java.lang.Integer> |
labelRows
|
protected java.util.LinkedList<java.lang.String> |
lines
|
protected SourceCodeProperties |
properties
|
protected Node |
upperLeft
|
| Fields inherited from class algoanim.primitives.Primitive |
|---|
gen |
| Constructor Summary | |
|---|---|
SourceCode(SourceCodeGenerator generator,
Node upperLeft,
java.lang.String name,
DisplayOptions display,
SourceCodeProperties properties)
Instantiates the SourceCode and calls the create() method
of the associated SourceCodeGenerator. |
|
| Method Summary | |
|---|---|
int |
addCodeElement(java.lang.String code,
java.lang.String label,
boolean noSpaceSeparator,
int indentation,
Timing delay)
Adds a new code element to this SourceCode element. |
int |
addCodeElement(java.lang.String code,
java.lang.String label,
int indentation,
Timing delay)
Adds a new code element to this SourceCode element. |
int |
addCodeLine(java.lang.String code,
java.lang.String label,
int indentation,
Timing delay)
Adds a new code line to this SourceCode element. |
SourceCodeProperties |
getProperties()
Returns the properties of this SourceCode element. |
Node |
getUpperLeft()
Returns the upper left corner of this SourceCode element. |
void |
highlight(int lineNo)
Highlights a line in this SourceCode element. |
void |
highlight(int lineNo,
int colNo,
boolean context)
Highlights a line in this SourceCode element. |
void |
highlight(int lineNo,
int colNo,
boolean context,
Timing delay,
Timing duration)
Highlights a line in this SourceCode element. |
void |
highlight(java.lang.String label)
Highlights a line in this SourceCode element. |
void |
highlight(java.lang.String label,
boolean context)
Highlights a line in this SourceCode element. |
void |
highlight(java.lang.String label,
boolean context,
Timing delay,
Timing duration)
Highlights a line in this SourceCode element. |
void |
registerLabel(java.lang.String label,
int lineNo)
short form without row |
void |
registerLabel(java.lang.String label,
int lineNo,
int rowNo)
|
void |
setName(java.lang.String newName)
Sets the name of this Primitive. |
void |
toggleHighlight(int oldLine,
int newLine)
Toggles the highlight from one component to the next. |
void |
toggleHighlight(int oldLine,
int oldColumn,
boolean switchToContextMode,
int newLine,
int newColumn)
Toggles the highlight from one component to the next. |
void |
toggleHighlight(int oldLine,
int oldColumn,
boolean switchToContextMode,
int newLine,
int newColumn,
Timing delay,
Timing duration)
Toggles the highlight from one component to the next. |
void |
toggleHighlight(java.lang.String label)
|
void |
toggleHighlight(java.lang.String oldLabel,
boolean switchToContextMode,
java.lang.String newLabel)
Toggles the highlight from one component to the next. |
void |
toggleHighlight(java.lang.String oldLabel,
boolean switchToContextMode,
java.lang.String newLabel,
Timing delay,
Timing duration)
Toggles the highlight from one component to the next. |
void |
toggleHighlight(java.lang.String oldLabel,
java.lang.String newLabel)
Toggles the highlight from one component to the next. |
void |
unhighlight(int lineNo)
Unhighlights a line in this SourceCode element. |
void |
unhighlight(int lineNo,
int colNo,
boolean context)
Unhighlights a line in this SourceCode element. |
void |
unhighlight(int lineNo,
int colNo,
boolean context,
Timing delay,
Timing duration)
Unhighlights a line in this SourceCode element. |
void |
unhighlight(java.lang.String label)
Unhighlights a line in this SourceCode element. |
void |
unhighlight(java.lang.String label,
boolean context)
Unhighlights a line in this SourceCode element. |
void |
unhighlight(java.lang.String label,
boolean context,
Timing delay,
Timing duration)
Unhighlights a line in this SourceCode element. |
| Methods inherited from class algoanim.primitives.Primitive |
|---|
changeColor, exchange, getDisplayOptions, getName, hide, hide, moveBy, moveTo, moveVia, rotate, rotate, show, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SourceCodeProperties properties
protected SourceCodeGenerator generator
protected Node upperLeft
protected java.util.LinkedList<java.lang.String> lines
protected java.util.HashMap<java.lang.String,java.lang.Integer> labelLines
protected java.util.HashMap<java.lang.String,java.lang.Integer> labelRows
protected java.lang.Integer actRow
protected java.util.Vector<java.lang.String> highlightedLabels
| Constructor Detail |
|---|
public SourceCode(SourceCodeGenerator generator,
Node upperLeft,
java.lang.String name,
DisplayOptions display,
SourceCodeProperties properties)
SourceCode and calls the create() method
of the associated SourceCodeGenerator.
generator - the appropriate code Generator.upperLeft - the upper left corner of this SourceCode
element.name - the name of this SourceCode element.display - [optional] the DisplayOptions of this
SourceCode element.properties - [optional] the properties of this SourceCode
element.| Method Detail |
|---|
public void setName(java.lang.String newName)
PrimitivePrimitive.
setName in class PrimitivenewName - the new name for this Primitive.Primitive.setName(java.lang.String)
public void registerLabel(java.lang.String label,
int lineNo)
public void registerLabel(java.lang.String label,
int lineNo,
int rowNo)
public SourceCodeProperties getProperties()
SourceCode element.
SourceCode element.public Node getUpperLeft()
SourceCode element.
SourceCode element.
public int addCodeLine(java.lang.String code,
java.lang.String label,
int indentation,
Timing delay)
throws java.lang.NullPointerException
SourceCode element.
code - the actual code.label - a distinct name for the line.indentation - the indentation to apply to this line.delay - [optional] the delay after which this operation shall be
performed.
java.lang.NullPointerException
public int addCodeElement(java.lang.String code,
java.lang.String label,
boolean noSpaceSeparator,
int indentation,
Timing delay)
throws java.lang.NullPointerException
SourceCode element.
code - the actual code.label - a distinct name for the line.indentation - the indentation to apply to this line.delay - [optional] the delay after which this operation shall be
performed.
java.lang.NullPointerException
public int addCodeElement(java.lang.String code,
java.lang.String label,
int indentation,
Timing delay)
throws java.lang.NullPointerException
SourceCode element.
code - the actual code.label - a distinct name for the line.indentation - the indentation to apply to this line.delay - [optional] the delay after which this operation shall be
performed.
java.lang.NullPointerException
public void highlight(java.lang.String label)
throws LineNotExistsException
SourceCode element.
label - the name of the line to highlight
LineNotExistsException
public void highlight(java.lang.String label,
boolean context)
throws LineNotExistsException
SourceCode element.
label - the name of the line to highlightcontext - use the code context color instead of the code highlight
color.
LineNotExistsException
public void highlight(java.lang.String label,
boolean context,
Timing delay,
Timing duration)
throws LineNotExistsException
SourceCode element.
label - the name of the line to highlightcontext - use the code context color instead of the code highlight
color.delay - [optional] the delay to apply to this operation.duration - [optional] the duration of the action.
LineNotExistsException
public void highlight(int lineNo)
throws LineNotExistsException
SourceCode element.
lineNo - the line to highlight
LineNotExistsException
public void highlight(int lineNo,
int colNo,
boolean context)
throws LineNotExistsException
SourceCode element.
lineNo - the line to highlightcolNo - the code element to highlightcontext - use the code context color instead of the code highlight
color.
LineNotExistsException
public void highlight(int lineNo,
int colNo,
boolean context,
Timing delay,
Timing duration)
throws LineNotExistsException
SourceCode element.
lineNo - the line to highlightcolNo - the code element to highlightcontext - use the code context color instead of the code highlight
color.delay - [optional] the delay to apply to this operation.duration - [optional] the duration of the action.
LineNotExistsException
public void unhighlight(java.lang.String label)
throws LineNotExistsException
SourceCode element.
label - the name of the line to unhighlight
LineNotExistsException
public void unhighlight(java.lang.String label,
boolean context)
throws LineNotExistsException
SourceCode element.
label - the name of the line to unhighlightcontext - use the code context color instead of the code highlight
color.
LineNotExistsException
public void unhighlight(java.lang.String label,
boolean context,
Timing delay,
Timing duration)
throws LineNotExistsException
SourceCode element.
label - the name of the line to unhighlightcontext - use the code context color instead of the code highlight
color.delay - [optional] the delay to apply to this operation.duration - [optional] the duration of the action.
LineNotExistsException
public void unhighlight(int lineNo)
throws LineNotExistsException
SourceCode element.
lineNo - the line to unhighlight
LineNotExistsException
public void unhighlight(int lineNo,
int colNo,
boolean context)
throws LineNotExistsException
SourceCode element.
lineNo - the line to unhighlightcolNo - the code element to unhighlightcontext - use the code context color instead of the code highlight
color.
LineNotExistsException
public void unhighlight(int lineNo,
int colNo,
boolean context,
Timing delay,
Timing duration)
throws LineNotExistsException
SourceCode element.
lineNo - the line to unhighlightcolNo - the code element to unhighlightcontext - use the code context color instead of the code highlight
color.delay - [optional] the delay to apply to this operation.duration - [optional] the duration of the action.
LineNotExistsExceptionpublic void toggleHighlight(java.lang.String label)
public void toggleHighlight(java.lang.String oldLabel,
java.lang.String newLabel)
throws LineNotExistsException
oldLabel - the name of the line which should no longer be highlightednewLabel - the name of the new line to highlight
LineNotExistsException
public void toggleHighlight(java.lang.String oldLabel,
boolean switchToContextMode,
java.lang.String newLabel)
throws LineNotExistsException
oldLabel - the name of the line which should no longer be highlightedswitchToContextMode - determines if highlighting should be turned off for the
previous element, of it it should be put into context modenewLabel - the name of the new line to highlight
LineNotExistsException
public void toggleHighlight(java.lang.String oldLabel,
boolean switchToContextMode,
java.lang.String newLabel,
Timing delay,
Timing duration)
throws LineNotExistsException
oldLabel - the name of the line which should no longer be highlightedswitchToContextMode - determines if highlighting should be turned off for the
previous element, of it it should be put into context modenewLabel - the name of the new line to highlightdelay - [optional] the delay to apply to this operation.duration - [optional] the duration of the action.
LineNotExistsException
public void toggleHighlight(int oldLine,
int newLine)
throws LineNotExistsException
oldLine - the line which should no longer be highlightednewLine - the new line to highlight
LineNotExistsException
public void toggleHighlight(int oldLine,
int oldColumn,
boolean switchToContextMode,
int newLine,
int newColumn)
throws LineNotExistsException
oldLine - the line which should no longer be highlightedoldColumn - the code element to unhighlightswitchToContextMode - determines if highlighting should be turned off for the
previous element, of it it should be put into context modenewLine - the new line to highlightnewColumn - the code element to highlight
LineNotExistsException
public void toggleHighlight(int oldLine,
int oldColumn,
boolean switchToContextMode,
int newLine,
int newColumn,
Timing delay,
Timing duration)
throws LineNotExistsException
oldLine - the line which should no longer be highlightedoldColumn - the code element to unhighlightswitchToContextMode - determines if highlighting should be turned off for the
previous element, of it it should be put into context modenewLine - the new line to highlightnewColumn - the code element to highlightdelay - [optional] the delay to apply to this operation.duration - [optional] the duration of the action.
LineNotExistsException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||