uk.ac.starlink.ttools.plottask
Class StyleFactory

java.lang.Object
  extended by uk.ac.starlink.ttools.plottask.StyleFactory
Direct Known Subclasses:
BarStyleFactory, MarkStyleFactory

public abstract class StyleFactory
extends Object

Defines an object which can obtain a Style object from the environment.

Since:
8 Aug 2008
Author:
Mark Taylor

Constructor Summary
protected StyleFactory(String prefix)
          Constructor.
 
Method Summary
abstract  Parameter[] getParameters(String stSuffix)
          Returns the parameters used by this factory.
abstract  Style getStyle(Environment env, String stSuffix)
          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.
 String paramName(String baseName, String stSuffix)
          Assembles a parameter name from a base name and a dataset suffix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleFactory

protected StyleFactory(String prefix)
Constructor.

Parameters:
prefix - prefix to be prepended to all parameters used by this factory
Method Detail

getParameters

public abstract Parameter[] getParameters(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(Environment env,
                               String stSuffix)
                        throws TaskException
Obtains a Style object from the environment by examining parameters.

Parameters:
env - execution environment
stSuffix - label identifying the data set for which the style is required
Returns:
plotting style
Throws:
TaskException

paramName

public String paramName(String baseName,
                        String stSuffix)
Assembles a parameter name from a base name and a dataset suffix.

Parameters:
baseName - parameter base name
stSuffix - label identifying dataset
Returns:
parameter name

getStyleIndex

public int getStyleIndex(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


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.