|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.washington.NVisF.plotter.PlotCommand
A PlotCommand encapsulates a request to represent a certain set of
data with a 3D representation suitable for viewing. Other classes
collaborate with the PlotCommand, eventually inserting the
ObjectGroup
that contains the 3D representation. This class
is intended to be the functional unit of a plotting request mediating
access to the request and the resources needed to fulfill it.
Currently the PlotCommand manages three components. First, it holds a
DataReader
that provides the physical data. Second, it holds a
predicate that, when given to the DataReader, specifies which data objects
should be used to construct the viewable object. Third, it holds a
PlotStrategy
that defines how to construct the 3D representation.
The PlotStrategy is called to produce the 3D representation with this
PlotCommand as an argument, which mediates access to the data by
providing a subset of the functionality of DataReader.
NullPointerExceptions will be thrown on an attempt to build a 3D
object without having all the necessary resources previously defined,
or when a null argument is passed to a contructor or setComponent method.
Constructor Summary | |
PlotCommand()
Constructs an empty PlotCommand. |
|
PlotCommand(DataReader dataReader,
java.lang.String predicate)
Constructs a PlotCommand referencing the specified DataReader and predicate, but with no defined PlotStrategy. |
|
PlotCommand(DataReader dataReader,
java.lang.String predicate,
PlotManager plotManager)
Constructs a PlotCommand referencing the specified DataReader and predicate. |
|
PlotCommand(DataReader dataReader,
java.lang.String predicate,
PlotStrategy plotStrategy)
Constructs a PlotCommand referencing the specified DataReader, predicate, and PlotStrategy. |
Method Summary | |
ObjectGroup |
buildObjectGroup()
builds an ObjectGroup from the 3D objects created by the defined PlotStrategy and installs the result in this PlotCommand. |
int |
getCount()
returns dataReader.getCount(predicate) |
DataReader |
getDataReader()
returns a reference to this PlotCommand's DataReader. |
ObjectGroup |
getObjectGroup()
returns the ObjectGroup for this PlotCommand. |
PlotStrategy |
getPlotStrategy()
returns a reference to this PlotCommand's PlotStrategy. |
java.lang.String |
getPredicate()
returns a reference to this PlotCommand's predicate. |
float[] |
getScalar(java.lang.String dataField)
returns dataReader.getScalar(predicate,dataField) |
float[][] |
getVector(java.lang.String dataField)
returns dataReader.getVector(predicate,dataField) |
java.lang.String |
parseObjectFromPredicate(java.lang.String predicate)
extracts the object name from the given predicate. |
void |
setDataReader(DataReader dataReader)
sets this PlotCommand's DataReader. |
void |
setPlotStrategy(PlotManager plotManager)
sets this PlotCommand's PlotStrategy by extracting the object name from the predicate and using the name to retrieve a PlotStrategy from the supplied PlotManager. |
void |
setPlotStrategy(PlotStrategy plotStrategy)
sets this PlotCommand's PlotStrategy. |
void |
setPredicate(java.lang.String predicate)
sets this PlotCommand's predicate. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PlotCommand()
public PlotCommand(DataReader dataReader, java.lang.String predicate)
NullPointerException
- if any argument is nullpublic PlotCommand(DataReader dataReader, java.lang.String predicate, PlotStrategy plotStrategy)
NullPointerException
- if any argument is nullpublic PlotCommand(DataReader dataReader, java.lang.String predicate, PlotManager plotManager)
NullPointerException
- if any argument is nullMethod Detail |
public DataReader getDataReader()
public void setDataReader(DataReader dataReader)
NullPointerException
- if passed a null argumentpublic java.lang.String getPredicate()
public void setPredicate(java.lang.String predicate)
NullPointerException
- if passed a null argumentpublic PlotStrategy getPlotStrategy()
public void setPlotStrategy(PlotStrategy plotStrategy)
NullPointerException
- if passed a null argumentpublic void setPlotStrategy(PlotManager plotManager)
NullPointerException
- if passed a null argument, or if no predicate
has yet been defined, or if a null PlotStrategy is retrievedpublic java.lang.String parseObjectFromPredicate(java.lang.String predicate)
public ObjectGroup buildObjectGroup()
NullPointerException
- if some components have not been defined yet,
or if an unexpected null occurs when assembling the 3D objectpublic ObjectGroup getObjectGroup()
public int getCount()
DataReader
public float[] getScalar(java.lang.String dataField)
DataReader
public float[][] getVector(java.lang.String dataField)
DataReader
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |