Package uk.ac.starlink.ttools.plottask
Class StyleFactory
- java.lang.Object
-
- uk.ac.starlink.ttools.plottask.StyleFactory
-
- Direct Known Subclasses:
BarStyleFactory
,MarkStyleFactory
public abstract class StyleFactory extends java.lang.Object
Defines an object which can obtain aStyle
object from the environment.- Since:
- 8 Aug 2008
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StyleFactory(java.lang.String prefix)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract uk.ac.starlink.task.Parameter<?>[]
getParameters(java.lang.String stSuffix)
Returns the parameters used by this factory.abstract Style
getStyle(uk.ac.starlink.task.Environment env, java.lang.String stSuffix)
Obtains a Style object from the environment by examining parameters.int
getStyleIndex(java.lang.String suffix)
Returns a zero-based index associated with a given suffix for this factory.java.lang.String
paramName(java.lang.String baseName, java.lang.String stSuffix)
Assembles a parameter name from a base name and a dataset suffix.
-
-
-
Method Detail
-
getParameters
public abstract uk.ac.starlink.task.Parameter<?>[] getParameters(java.lang.String stSuffix)
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, java.lang.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
public java.lang.String paramName(java.lang.String baseName, java.lang.String stSuffix)
Assembles a parameter name from a base name and a dataset suffix.- Parameters:
baseName
- parameter base namestSuffix
- label identifying dataset- Returns:
- parameter name
-
getStyleIndex
public int getStyleIndex(java.lang.String suffix)
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
-
-