|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectexe.GAIGSbase
exe.GAIGSarray
public class GAIGSarray
GAIGSarray provides the ability to implement a one or two dimensional
array and also create GAIGS visualizations of its state. Use the various constructors
to specify the general parameters for the array visualization, and use the
toXML method to actually generate the array XML for snapshots. The display
mode can be as an array or as a bar graph. In the case of a bar graph the stored items must
be integers (or bad things will happen!).
Unlike standard Java, where all arrays are really one dimensional arrays, a
GAIGSarray is a two dimensional array, whether treated like one or not.
If a 1-d array is constructed, a 2-d array is allocated with just one column. The getter
and setter methods take one or two parameters, allowing the array to be treated as 1-d
or 2-d. Row and column labels are also supported.
Methods are also provided to set and get the presentation color of an array cell. A default array cell color can be set by using the appropriate constructor.
| Field Summary |
|---|
| Fields inherited from interface exe.GAIGSdatastr |
|---|
DEFAULT_COLOR, DEFAULT_FONT_SIZE, DEFAULT_NAME, DEFAULT_X1, DEFAULT_X2, DEFAULT_Y1, DEFAULT_Y2 |
| Constructor Summary | |
|---|---|
GAIGSarray(int rows)
Create a "1-d" array of length rows, using default parameters for all other instance variables. |
|
GAIGSarray(int rows,
boolean isBar)
Create a "1-d" array of length rows explicitly setting the display mode, using default parameters for all other instance variables. |
|
GAIGSarray(int rows,
boolean isBar,
java.lang.String name,
java.lang.String color,
double x1,
double y1,
double x2,
double y2,
double fontSize)
Create a "1-d" array of length rows using default parameters for all other instance variables.. |
|
GAIGSarray(int rows,
int cols)
Create a "2-d" array of dimensions rows x cols, using default parameters for all other instance variables. |
|
GAIGSarray(int rows,
int cols,
java.lang.String name,
java.lang.String color,
double x1,
double y1,
double x2,
double y2,
double fontSize)
Create a "2-d" array of dimensions rows x cols, setting all the instance variables. |
|
| Method Summary | |
|---|---|
java.lang.Object |
get(int r)
Return the value at location r. |
java.lang.Object |
get(int r,
int c)
Return the value at location r,c. |
java.lang.String |
getColLabel(java.lang.String label,
int c)
Get the label of column c. |
java.lang.String |
getColor(int r)
Return the color at location r. |
java.lang.String |
getColor(int r,
int c)
Return the color at location r,c. |
java.lang.String |
getRowLabel(int r)
Get the label of row r. |
void |
set(java.lang.Object item,
int r)
Set location r to value item. |
void |
set(java.lang.Object item,
int r,
int c)
Set location r,c to value item. |
void |
set(java.lang.Object item,
int r,
int c,
java.lang.String cl)
Set location r,c to value itemusing color cl. |
void |
set(java.lang.Object item,
int r,
java.lang.String cl)
Set location r to value item using color cl. |
void |
setColLabel(java.lang.String label,
int c)
Set the label of column c. |
void |
setColor(int r,
int c,
java.lang.String co)
Set the color of location r,c. |
void |
setColor(int r,
java.lang.String co)
Set the color of location r. |
void |
setRowLabel(java.lang.String label,
int r)
Set the label of row r. |
java.lang.String |
toXML()
Creates and returns GAIGS XML code for the current state of the array. |
| Methods inherited from class exe.GAIGSbase |
|---|
getName, setName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GAIGSarray(int rows)
rows - The length of this array.
public GAIGSarray(int rows,
boolean isBar)
rows - The length of this array.isBar - Whether is display this array as a bar graph.
public GAIGSarray(int rows,
boolean isBar,
java.lang.String name,
java.lang.String color,
double x1,
double y1,
double x2,
double y2,
double fontSize)
rows - The length of this array.isBar - Whether is display this array as a bar graph.name - Display name of this structure.color - Color for items unless locally overridden.x1 - Left display bound.y1 - Bottom display bound.x2 - Top display bound.y2 - Right display bound.fontSize - Font size for display.
public GAIGSarray(int rows,
int cols)
rows - The number of rows in this array.cols - The number of columns in this array.
public GAIGSarray(int rows,
int cols,
java.lang.String name,
java.lang.String color,
double x1,
double y1,
double x2,
double y2,
double fontSize)
rows - The length of this array.cols - The number of columns in this array.name - Display name of this structure.color - Color for items unless locally overridden.x1 - Left display bound.y1 - Bottom display bound.x2 - Top display bound.y2 - Right display bound.fontSize - Font size for display.| Method Detail |
|---|
public java.lang.Object get(int r)
r - The location to be accessed.
public java.lang.Object get(int r,
int c)
r - The row to be accessed.c - The col to be accessed.
public void set(java.lang.Object item,
int r)
item - The value to be stored.r - The location to be set.
public void set(java.lang.Object item,
int r,
java.lang.String cl)
item - The value to be stored.r - The location to be set.cl - The color for the value.
public void set(java.lang.Object item,
int r,
int c)
item - The value to be stored.r - The row location to be set.c - The col location to be set.
public void set(java.lang.Object item,
int r,
int c,
java.lang.String cl)
item - The value to be stored.r - The row location to be set.c - The col location to be set.cl - The color for the value.public java.lang.String getColor(int r)
r - The location to be accessed.
public java.lang.String getColor(int r,
int c)
r - The row to be accessed.c - The col to be accessed.
public void setColor(int r,
java.lang.String co)
r - The location to be set.co - The color to be stored.
public void setColor(int r,
int c,
java.lang.String co)
r - The row location to be set.c - The col location to be set.co - The color for the value.public java.lang.String getRowLabel(int r)
r - The row.
public java.lang.String getColLabel(java.lang.String label,
int c)
c - The column.
public void setRowLabel(java.lang.String label,
int r)
label - The label.r - The row.
public void setColLabel(java.lang.String label,
int c)
label - The label.c - The column.public java.lang.String toXML()
isBar.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||