|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgoanim.primitives.Primitive
algoanim.primitives.MatrixPrimitive
algoanim.primitives.StringMatrix
public class StringMatrix
StringMatrix manages an internal matrix. Operations on
objects of StringMatrix are almost performed like on a simple
matrix.
| Field Summary | |
|---|---|
protected StringMatrixGenerator |
generator
The related StringMatrixGenerator, which is responsible for
generating the appropriate scriptcode for operations performed on
this object. |
| Fields inherited from class algoanim.primitives.MatrixPrimitive |
|---|
nrCols, nrRows |
| Fields inherited from class algoanim.primitives.Primitive |
|---|
gen |
| Constructor Summary | |
|---|---|
StringMatrix(StringMatrixGenerator iag,
Node upperLeftCorner,
java.lang.String[][] matrixData,
java.lang.String name,
DisplayOptions display,
MatrixProperties iap)
Instantiates the StringMatrix and calls the create() method
of the associated StringMatrixGenerator. |
|
| Method Summary | |
|---|---|
java.lang.String[][] |
getData()
Returns the internal int matrix. |
java.lang.String |
getElement(int row,
int col)
retrieves the element at position (row, col) if this is legal, else "" |
MatrixProperties |
getProperties()
Returns the properties of this matrix. |
java.lang.String[] |
getRow(int row)
Returns the data at the given position of the internal matrix. |
Node |
getUpperLeft()
Returns the upper left corner of this matrix. |
void |
highlightCell(int row,
int col,
Timing offset,
Timing duration)
Highlights the matrix cell at a given position after a distinct offset. |
void |
highlightCellColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
Highlights a range of array cells of an StringMatrix. |
void |
highlightCellRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
Highlights a range of array cells of an StringMatrix. |
void |
highlightElem(int row,
int col,
Timing offset,
Timing duration)
Highlights the matrix element at a given position after a distinct offset. |
void |
highlightElemColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
Highlights a range of matrix elements. |
void |
highlightElemRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
Highlights a range of array elements of an StringMatrix. |
void |
put(int row,
int col,
java.lang.String what,
Timing t,
Timing d)
Puts the value what at position [row][col]. |
void |
setName(java.lang.String newName)
Sets the name of this Primitive. |
void |
swap(int sourceRow,
int sourceCol,
int targetRow,
int targetCol,
Timing t,
Timing d)
Swaps the elements at index [sourceRow][sourceCol] and
[targetRow][targetCol]. |
void |
unhighlightCell(int row,
int col,
Timing offset,
Timing duration)
Unhighlights the array cell of an StringMatrix at a given position
after a distinct offset. |
void |
unhighlightCellColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
Unhighlights a range of array cells of an StringMatrix. |
void |
unhighlightCellRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
Unhighlights a range of array cells of an StringMatrix. |
void |
unhighlightElem(int row,
int col,
Timing offset,
Timing duration)
Unhighlights the matrix element at a given position after a distinct offset. |
void |
unhighlightElemColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
Unhighlights a range of array elements of an StringMatrix. |
void |
unhighlightElemRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
Unhighlights a range of array elements of an StringMatrix. |
| Methods inherited from class algoanim.primitives.MatrixPrimitive |
|---|
getNrCols, getNrRows |
| 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 StringMatrixGenerator generator
StringMatrixGenerator, which is responsible for
generating the appropriate scriptcode for operations performed on
this object.
| Constructor Detail |
|---|
public StringMatrix(StringMatrixGenerator iag,
Node upperLeftCorner,
java.lang.String[][] matrixData,
java.lang.String name,
DisplayOptions display,
MatrixProperties iap)
StringMatrix and calls the create() method
of the associated StringMatrixGenerator.
iag - the appropriate code Generator.upperLeftCorner - the upper left corner of this
StringMatrix.matrixData - the data of this StringMatrix.name - the name of this StringMatrix.display - [optional] the DisplayOptions of this
StringMatrix.iap - [optional] the properties of this StringMatrix.| Method Detail |
|---|
public java.lang.String getElement(int row,
int col)
row - the row of the element to be retrievedcol - the column of the element to be retrieved
public void put(int row,
int col,
java.lang.String what,
Timing t,
Timing d)
throws java.lang.IndexOutOfBoundsException
what at position [row][col].
This is the delayed version as specified by t.
The duration of this operation may also be specified.
row - the row position of the element to write.col - the column position of the element to write.what - the new value.t - [optional] the delay which shall be applied to the
operation.d - [optional] the duration this action needs.
java.lang.IndexOutOfBoundsException
public void swap(int sourceRow,
int sourceCol,
int targetRow,
int targetCol,
Timing t,
Timing d)
throws java.lang.IndexOutOfBoundsException
[sourceRow][sourceCol] and
[targetRow][targetCol].
This is the delayed version. The duration of this
operation may also be specified.
sourceRow - the row position of the first element to swap.sourceCol - the column position of the first element to swap.targetRow - the row position of the second element to swap.targetCol - the column position of the second element to swap.t - [optional] the delay which shall be applied to the
operation.d - [optional] the duration this action needs.
java.lang.IndexOutOfBoundsExceptionpublic java.lang.String[][] getData()
int matrix.
int matrix.
public java.lang.String[] getRow(int row)
throws java.lang.IndexOutOfBoundsException
row - the position where to look for the data.
i in the internal
int matrix.
java.lang.IndexOutOfBoundsExceptionpublic Node getUpperLeft()
public MatrixProperties getProperties()
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 highlightCell(int row,
int col,
Timing offset,
Timing duration)
row - the row of the cell to highlight.col - the column of the cell to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void highlightCellColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
StringMatrix.
row - the row of the interval to highlight.startCol - the start column of the interval to highlight.endCol - the end column of the interval to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void highlightCellRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
StringMatrix.
startRow - the start row of the interval to highlight.endRow - the end row of the interval to highlight.col - the column of the interval to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void unhighlightCell(int row,
int col,
Timing offset,
Timing duration)
StringMatrix at a given position
after a distinct offset.
row - the row position of the cell to unhighlight.col - the column position of the cell to unhighlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void unhighlightCellColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
StringMatrix.
row - the row of the interval to highlight.startCol - the start column of the interval to highlight.endCol - the end column of the interval to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void unhighlightCellRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
StringMatrix.
startRow - the start row of the interval to highlight.endRow - the end row of the interval to highlight.col - the column of the interval to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void highlightElem(int row,
int col,
Timing offset,
Timing duration)
row - the row of the element to highlight.col - the column of the element to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void highlightElemColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
row - the row of the interval to highlight.startCol - the start of the column interval to highlight.endCol - the end of the column interval to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void highlightElemRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
StringMatrix.
startRow - the start of the row interval to highlight.endRow - the end of the row interval to highlight.col - the column interval to highlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void unhighlightElem(int row,
int col,
Timing offset,
Timing duration)
row - the row of the element to unhighlight.col - the column of the element to unhighlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void unhighlightElemColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
StringMatrix.
row - the row of the interval to unhighlight.startCol - the start of the column interval to unhighlight.endCol - the end of the column interval to unhighlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void unhighlightElemRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
StringMatrix.
startRow - the start row of the interval to unhighlight.endRow - the end row of the interval to unhighlight.col - the column interval to unhighlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||