public class GridLabelProvider extends LWRComponent
This is a utility class that provides labels on a 2D grid for rows and columns. This class should be considered as a piece designed specifically for interactions with the GUI and should not be considered as a means to override the ability to set rows and column indicie types.
The constructor takes a size that is N squared, and defaults to a positive number if the size is non-positive or zero.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
GridLabelProvider()
A default constructor that should ONLY be used for persistence and
testing.
|
GridLabelProvider(int size)
A parameterized constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
void |
copy(GridLabelProvider otherObject)
Deep copies the contents of the object.
|
boolean |
equals(java.lang.Object otherObject)
Overrides the equals operation to check the attributes on this object
with another object of the same type.
|
int |
getColumnFromLabel(java.lang.String columnLabel)
Returns the column position from a label.
|
java.lang.String |
getLabelFromColumn(int column)
Returns the label at position column.
|
java.lang.String |
getLabelFromRow(int row)
Returns the label at position row.
|
int |
getRowFromLabel(java.lang.String rowLabel)
Returns the row position from a label.
|
int |
getSize()
Returns the size for the row and column label ArrayLists.
|
int |
hashCode()
Returns the hashCode of the object.
|
boolean |
readAttributes(ncsa.hdf.object.h5.H5Group h5Group)
This operation reads Attributes from h5Group and assigns their values to
class variables.
|
boolean |
readDatasets(ncsa.hdf.object.h5.H5Group h5Group)
Overrides LWRComponent's readDatasets.
|
void |
setColumnLabels(java.util.ArrayList<java.lang.String> columnLabels)
Sets the array of column labels ordered from left to right.
|
void |
setRowLabels(java.util.ArrayList<java.lang.String> rowLabels)
Sets the array of row labels ordered from top to bottom.
|
boolean |
writeAttributes(ncsa.hdf.object.h5.H5File h5File,
ncsa.hdf.object.h5.H5Group h5Group)
This operation writes HDF5 Attributes to the metadata of h5Group in the
h5File.
|
boolean |
writeDatasets(ncsa.hdf.object.h5.H5File h5File,
ncsa.hdf.object.h5.H5Group h5Group)
This operation writes HDF5 Datasets to the h5Group in the h5File.
|
accept, accept, addData, copy, createGroup, getCurrentTime, getDataAtCurrentTime, getDescription, getFeatureList, getFeaturesAtCurrentTime, getHDF5LWRTag, getId, getName, getNumberOfTimeSteps, getSourceInfo, getTimes, getTimeStep, getTimeUnits, getWriteableChildren, readChild, register, removeAllDataFromFeature, setDescription, setId, setName, setSourceInfo, setTime, setTimeUnits, toString, unregister, update
public GridLabelProvider()
public GridLabelProvider(int size)
A parameterized constructor.
size
- The size for the row and column label ArrayLists.
public int getColumnFromLabel(java.lang.String columnLabel)
Returns the column position from a label. Returns -1 if the label is not found or if the label is null.
columnLabel
- The column label.
The column position.
public int getRowFromLabel(java.lang.String rowLabel)
Returns the row position from a label. Returns -1 if the label is not found or if the label is null.
rowLabel
- The row label.
The row position.
public java.lang.String getLabelFromColumn(int column)
Returns the label at position column.
column
- The column position.
The label at the provided column position.
public java.lang.String getLabelFromRow(int row)
Returns the label at position row.
row
- The row position.
The label at the provided row position.
public void setRowLabels(java.util.ArrayList<java.lang.String> rowLabels)
Sets the array of row labels ordered from top to bottom.
rowLabels
- The array of row labels ordered from top to bottom.
public void setColumnLabels(java.util.ArrayList<java.lang.String> columnLabels)
Sets the array of column labels ordered from left to right.
columnLabels
- The array of column labels ordered from left to right.
public int getSize()
Returns the size for the row and column label ArrayLists.
The size for the row and column label ArrayLists.
public boolean equals(java.lang.Object otherObject)
Overrides the equals operation to check the attributes on this object with another object of the same type. Returns true if the objects are equal. False otherwise.
equals
in interface Identifiable
equals
in class LWRComponent
otherObject
- The object to be compared.
True if otherObject is equal. False otherwise.
public int hashCode()
Returns the hashCode of the object.
hashCode
in interface Identifiable
hashCode
in class LWRComponent
The hash of the object.
public void copy(GridLabelProvider otherObject)
Deep copies the contents of the object.
otherObject
- The object to be copied.
public java.lang.Object clone()
Deep copies and returns a newly instantiated object.
clone
in interface Identifiable
clone
in class LWRComponent
The newly instantiated copied object.
public boolean writeAttributes(ncsa.hdf.object.h5.H5File h5File, ncsa.hdf.object.h5.H5Group h5Group)
IHdfWriteable
This operation writes HDF5 Attributes to the metadata of h5Group in the h5File. If the h5Group is null or h5File is null or can not be opened, then false is returned. If the operation fails to write all Attributes, then false is returned. Otherwise, true is returned.
writeAttributes
in interface IHdfWriteable
writeAttributes
in class LWRComponent
h5File
- h5Group
- public boolean writeDatasets(ncsa.hdf.object.h5.H5File h5File, ncsa.hdf.object.h5.H5Group h5Group)
IHdfWriteable
This operation writes HDF5 Datasets to the h5Group in the h5File. If the h5Group is null or h5File is null or can not be opened, then false is returned. If the operation fails to write all Datasets, then false is returned. Otherwise, true is returned.
writeDatasets
in interface IHdfWriteable
writeDatasets
in class LWRComponent
h5File
- h5Group
- public boolean readDatasets(ncsa.hdf.object.h5.H5Group h5Group)
Overrides LWRComponent's readDatasets.
readDatasets
in interface IHdfReadable
readDatasets
in class LWRComponent
h5Group
- public boolean readAttributes(ncsa.hdf.object.h5.H5Group h5Group)
IHdfReadable
This operation reads Attributes from h5Group and assigns their values to class variables. If h5Group is null, false is returned. If any Attribute values are null, false is returned. Otherwise, true is returned.
readAttributes
in interface IHdfReadable
readAttributes
in class LWRComponent
h5Group
-