|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectexe.GAIGSbase
exe.GAIGSlegend
public class GAIGSlegend
This class provides support for a color legend structure that can be used to
show the meanings of the various colors used in GAIGS visualizations. The
class is implemented similarly to the GAIGSarray class and uses
a two-dimensional array of GAIGSItem objects to store the color
and text information for each element in the color key. Each element in the
color key is displayed as a box containing the color for that element with
the text for that element appearing to the right of the box. Multiple lines
are allowed in the text that is displayed, but using too many lines for the
labels may force the text to shrink to fit into the available space. Note
also that, since the legend structure will likely be displayed in a small
portion of the screen, the fontsize will usually have to be
increased to keep the labels readable when the structure is localized to its
small subset of the screen's area. Each GAIGSItem element in
the key is initialized to null so any element that is not set
with a value will not be displayed when the key is shown on the screen.
| 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 | |
|---|---|
GAIGSlegend(int rows,
int columns)
Constructor that sets only the number of elements in the key and uses default values for all other fields. |
|
GAIGSlegend(int rows,
int columns,
double fontsize)
Constructor that sets the number of elements in the key and the key's font size and uses default values for all other fields. |
|
GAIGSlegend(int rows,
int columns,
double x1,
double y1,
double x2,
double y2)
Constructor that sets the number of elements in the key and the bounds for the key and uses default values for all other fields. |
|
GAIGSlegend(int rows,
int columns,
java.lang.String name)
Constructor that sets the number of elements in the key and the key's name and uses default values for all other fields. |
|
GAIGSlegend(int rows,
int columns,
java.lang.String name,
double fontsize)
Constructor that sets the number of elements in the key and the key's name and font size and uses default values for the bounds. |
|
GAIGSlegend(int rows,
int columns,
java.lang.String name,
double x1,
double y1,
double x2,
double y2,
double fontsize)
Constructor that explicitly sets all the values for this legend. |
|
| Method Summary | |
|---|---|
int |
getColumns()
Gives the number of columns in this legend structure. |
double |
getFontSize()
Gives the font size for the text labels in this legend. |
GAIGSItem |
getItem(int row,
int column)
Returns the item from this legend at the index specified. |
java.lang.String |
getName()
Returns the name of this legend structure. |
double |
getNameFontSize()
Returns the font size for this legend's name (can be sized independently from the text size used for labels within the legend). |
int |
getRows()
Gives the number of rows in this legend structure. |
double |
getX1()
Returns the left x-bound of this legend. |
double |
getX2()
Returns the right x-bound of this legend. |
double |
getY1()
Returns the lower y-bound of this legend. |
double |
getY2()
Returns the upper y-bound of this legend. |
void |
setBounds(double x1,
double y1,
double x2,
double y2)
Sets the bounds for this GAIGSlegend object. |
void |
setFontSize(double fontsize)
Sets the font size used for the text labels in this GAIGSlegend. |
void |
setItem(int row,
int column,
GAIGSItem item)
Sets the item in this legend at the index specified. |
void |
setName(java.lang.String name)
Sets the name for this legend. |
void |
setNameFontSize(double name_fontsize)
Sets the font size used to display this legend's name (can be sized independently from the text size used for labels within the legend). |
java.lang.String |
toXML()
Returns the GAIGS XML representation of this GAIGSlegend
object as a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GAIGSlegend(int rows,
int columns)
rows - The number of rows in the color key.columns - The number of columns in the color key.
public GAIGSlegend(int rows,
int columns,
java.lang.String name)
rows - The number of rows in the color key.columns - The number of columns in the color key.name - The name of the color key.
public GAIGSlegend(int rows,
int columns,
double fontsize)
rows - The number of rows in the color key.columns - The number of columns in the color key.fontsize - The font size for the text in this legend.
public GAIGSlegend(int rows,
int columns,
java.lang.String name,
double fontsize)
rows - The number of rows in the color key.columns - The number of columns in the color key.name - The name of the color key.fontsize - The font size for the text in this legend.
public GAIGSlegend(int rows,
int columns,
double x1,
double y1,
double x2,
double y2)
rows - The number of rows in the color key.columns - The number of columns in the color key.x1 - The left boundary of the legend (usually in [0,1]).y1 - The lower boundary of the legend (usually in [0,1]).x2 - The right boundary of the legend (usually in [0,1]).y2 - The upper boundary of the legend (usually in [0,1]).
public GAIGSlegend(int rows,
int columns,
java.lang.String name,
double x1,
double y1,
double x2,
double y2,
double fontsize)
rows - The number of rows in the color key.columns - The number of columns in the color key.name - The name of the color key.x1 - The left boundary of the legend (usually in [0,1]).y1 - The lower boundary of the legend (usually in [0,1]).x2 - The right boundary of the legend (usually in [0,1]).y2 - The upper boundary of the legend (usually in [0,1]).fontsize - The font size for the text in this legend.| Method Detail |
|---|
public GAIGSItem getItem(int row,
int column)
row - The row index of the GAIGSItem to be
returned.column - The column index of the GAIGSItem to be
returned.
GAIGSItem at index
[row][column] in the internal array that
represents this GAIGSlegend. If this index
is out of the bounds given to the array when this
GAIGSlegend was created, then
null is returned.public int getRows()
public int getColumns()
public java.lang.String getName()
getName in interface GAIGSdatastrgetName in class GAIGSbaseGAIGSlegend object.public double getNameFontSize()
GAIGSlegend object.public double getX1()
GAIGSlegend object.public double getY1()
GAIGSlegend object.public double getX2()
GAIGSlegend object.public double getY2()
GAIGSlegend object.public double getFontSize()
public void setItem(int row,
int column,
GAIGSItem item)
row - The row index of the GAIGSItem to be set.column - The column index of the GAIGSItem to be set.item - The GAIGSItem to be stored at the index
[row][column] in the internal array that
represents this GAIGSlegend. If this index is
out of the bounds that were given to this array when this
GAIGSlegend was created, then this method
returns without doing anything.public void setName(java.lang.String name)
setName in interface GAIGSdatastrsetName in class GAIGSbasename - The new name String for this
GAIGSlegend object.public void setNameFontSize(double name_fontsize)
name_fontsize - The new font size for the name of this
GAIGSlegend object.
public void setBounds(double x1,
double y1,
double x2,
double y2)
GAIGSlegend object.
x1 - The new left x-coordinate for the bounds of this legend.y1 - The new lower y-coordinate for the bounds of this legend.x2 - The new right x-coordinate for the bounds of this legend.y2 - The new upper y-coordinate for the bounds of this legend.public void setFontSize(double fontsize)
GAIGSlegend.
fontsize - The new font size for labels in this legend.public java.lang.String toXML()
GAIGSlegend
object as a String.
String containing the GAIGS XML representation of
this GAIGSlegend object.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||