Package uk.ac.starlink.ttools.plottask
Class StyleFactory
java.lang.Object
uk.ac.starlink.ttools.plottask.StyleFactory
- Direct Known Subclasses:
BarStyleFactory
,MarkStyleFactory
Defines an object which can obtain a
Style
object from the environment.- Since:
- 8 Aug 2008
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract uk.ac.starlink.task.Parameter<?>[]
getParameters
(String stSuffix) Returns the parameters used by this factory.abstract Style
Obtains a Style object from the environment by examining parameters.int
getStyleIndex
(String suffix) Returns a zero-based index associated with a given suffix for this factory.Assembles a parameter name from a base name and a dataset suffix.
-
Constructor Details
-
StyleFactory
Constructor.- Parameters:
prefix
- prefix to be prepended to all parameters used by this factory
-
-
Method Details
-
getParameters
Returns the parameters used by this factory.- Parameters:
stSuffix
- label identifying the data set for which the style will be required
-
getStyle
public abstract Style getStyle(uk.ac.starlink.task.Environment env, String stSuffix) throws uk.ac.starlink.task.TaskException Obtains a Style object from the environment by examining parameters.- Parameters:
env
- execution environmentstSuffix
- label identifying the data set for which the style is required- Returns:
- plotting style
- Throws:
uk.ac.starlink.task.TaskException
-
paramName
Assembles a parameter name from a base name and a dataset suffix.- Parameters:
baseName
- parameter base namestSuffix
- label identifying dataset- Returns:
- parameter name
-
getStyleIndex
Returns a zero-based index associated with a given suffix for this factory. The same suffix will always give the same result.- Parameters:
suffix
- identifier- Returns:
- identifier index
-