FreeHEP API
Version v1.2.2

hep.aida.ref.plotter
Class BaseStyle

java.lang.Object
  |
  +--hep.aida.ref.plotter.BaseStyle
All Implemented Interfaces:
hep.aida.IBaseStyle
Direct Known Subclasses:
AxisStyle, hep.aida.ref.plotter.BrushStyle, DataStyle, InfoStyle, PlotterStyle, TitleStyle

public abstract class BaseStyle
extends Object
implements hep.aida.IBaseStyle

Author:
The AIDA team @ SLAC. When plotting an AIDA object there are several styles that contribute to the resulting style of the plot: the default (root) style, the style of the plotter, the style of the region and the style provided by the user. These styles have a parent-child relationship with the default (root) style being the parent of the plotter style, the plotter style the parent of the region style etc. All the styles in an inheritance chain have the same set of parameters. A prameter is defined by the following attributes: - options, i.e. possible values. This is meant to be an hint of what the possible values are. - current value. The current value is, by default null. When plotting, the top level style is considered first and all the other in sequence when a given parameter is not specified (still null) by the top level style. Please notice that parameters, options and values are CASE INSENSITIVE.

Constructor Summary
protected BaseStyle()
          Create a BaseStyle without a parent.
protected BaseStyle(BaseStyle parent)
          Create a BaseStyle with a given parent.
 
Method Summary
protected  void addBaseStyle(hep.aida.IBaseStyle baseStyle, String name)
          Add a BaseStyle to this BaseStyle.
protected  void addParameter(String parameterName)
          Add a new parameter to this BaseStyle.
protected  void addParameter(String parameterName, String defaultValue)
           
protected  void addParameter(String parameterName, String[] options)
           
protected  void addParameter(String parameterName, String[] options, String defaultValue)
           
 String[] availableParameterOptions(String parameterName)
          Below are the AIDA methods.
 String[] availableParameters()
           
protected abstract  void initializeBaseStyle()
          Initialize the BaseStyle.
protected  String name()
          Get the name of this BaseStyle.
protected  String parameterDefaultValue(int parIndex)
           
protected  String parameterDefaultValue(String parameterName)
          Get the defaultValue.
 String parameterValue(String parameterName)
           
 BaseStyle parent()
          Get the parent for this BaseStyle.
 void reset()
           
protected  void setName(String name)
          Set the name of this BaseStyle.
 boolean setParameter(String parameterName)
           
 boolean setParameter(String parameterName, String parValue)
           
 void setParent(hep.aida.IBaseStyle p)
          Set the parent for this BaseStyle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseStyle

protected BaseStyle()
Create a BaseStyle without a parent. The parent, if ever available, can be set via the setParent method.


BaseStyle

protected BaseStyle(BaseStyle parent)
Create a BaseStyle with a given parent. The parent CANNOT be changed.

Parameters:
parent - The parent.
Method Detail

initializeBaseStyle

protected abstract void initializeBaseStyle()
Initialize the BaseStyle. This method has to be overwritten by all Style that has to add parameters or internal BaseStyles.


setName

protected void setName(String name)
Set the name of this BaseStyle.

Parameters:
name - The name.

name

protected String name()
Get the name of this BaseStyle.

Returns:
The name of the BaseStyle.

setParent

public void setParent(hep.aida.IBaseStyle p)
Set the parent for this BaseStyle. The parent can be set only once; if this is done a second time a RuntimeException is thrown.


parent

public BaseStyle parent()
Get the parent for this BaseStyle.

Returns:
The parent.

addBaseStyle

protected void addBaseStyle(hep.aida.IBaseStyle baseStyle,
                            String name)
Add a BaseStyle to this BaseStyle. This method is to be invoked when a BaseStyle contains other BaseStyles in order for the reset and the setParent methods to work properly.


addParameter

protected void addParameter(String parameterName)
Add a new parameter to this BaseStyle.

Parameters:
parameterName - The name of the new parameter.

addParameter

protected void addParameter(String parameterName,
                            String defaultValue)

addParameter

protected void addParameter(String parameterName,
                            String[] options)

addParameter

protected void addParameter(String parameterName,
                            String[] options,
                            String defaultValue)

parameterDefaultValue

protected String parameterDefaultValue(String parameterName)
Get the defaultValue.


parameterDefaultValue

protected String parameterDefaultValue(int parIndex)

availableParameterOptions

public String[] availableParameterOptions(String parameterName)
Below are the AIDA methods.

Specified by:
availableParameterOptions in interface hep.aida.IBaseStyle

availableParameters

public String[] availableParameters()
Specified by:
availableParameters in interface hep.aida.IBaseStyle

parameterValue

public String parameterValue(String parameterName)
Specified by:
parameterValue in interface hep.aida.IBaseStyle

reset

public void reset()
Specified by:
reset in interface hep.aida.IBaseStyle

setParameter

public boolean setParameter(String parameterName)
Specified by:
setParameter in interface hep.aida.IBaseStyle

setParameter

public boolean setParameter(String parameterName,
                            String parValue)
Specified by:
setParameter in interface hep.aida.IBaseStyle

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.