FreeHEP API
Version current

hep.aida.ref.plotter
Class BaseStyle

java.lang.Object
  extended byhep.aida.ref.plotter.BaseStyle
All Implemented Interfaces:
hep.aida.IBaseStyle, StyleListener
Direct Known Subclasses:
AxisStyle, BoxStyle, hep.aida.ref.plotter.BrushStyle, DataStyle, InfoStyle, LegendBoxStyle, PlotterStyle, StatisticsBoxStyle, TitleStyle

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

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.
Source Code:
BaseStyle.java

Constructor Summary
protected BaseStyle()
          Create a BaseStyle without a parent.
protected BaseStyle(BaseStyle style)
          Create a clone of a BaseStyle.
 
Method Summary
protected  boolean addBaseStyle(hep.aida.IBaseStyle baseStyle, String name)
          Add a BaseStyle to this BaseStyle.
protected  void addParameter(AbstractStyleParameter styleParameter)
          Add a new parameter to this BaseStyle.
 String[] availableParameterOptions(String parameterName)
          Below are the AIDA methods.
 String[] availableParameters()
           
 hep.aida.IBaseStyle child(String name)
           
 hep.aida.IBaseStyle[] children()
           
protected  AbstractStyleParameter deepestSetParameter(String parName)
           
protected abstract  void initializeBaseStyle()
          Initialize the BaseStyle.
 boolean isParameterSet(String parameterName)
           
 boolean isVisible()
          Get isVisible of the data.
 String name()
          Get the name of this BaseStyle.
protected  int numberOfParameters()
           
 AbstractStyleParameter parameter(String parName)
           
protected  Collection parameters()
           
 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)
           
protected  void setParameterDefault(String parameterName, String parDefaultValue)
           
 void setParent(hep.aida.IBaseStyle p)
          Set the parent for this BaseStyle.
 boolean setVisible(boolean visible)
          Set isVisible of the data.
 void styleChanged(BaseStyle style)
           
 Class type()
           
 
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 style)
Create a clone of a BaseStyle.

Parameters:
style - The BaseStyle to be cloned.
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

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

Specified by:
name in interface hep.aida.IBaseStyle
Returns:
The name of the BaseStyle.

type

public Class type()
Specified by:
type in interface hep.aida.IBaseStyle
Returns:
The type of the style.

child

public hep.aida.IBaseStyle child(String name)
Specified by:
child in interface hep.aida.IBaseStyle
Returns:
A sub style, knowing its name.

children

public hep.aida.IBaseStyle[] children()
Specified by:
children in interface hep.aida.IBaseStyle
Returns:
The array of sub styles.

setVisible

public boolean setVisible(boolean visible)
Set isVisible of the data.

Specified by:
setVisible in interface hep.aida.IBaseStyle

isVisible

public boolean isVisible()
Get isVisible of the data. return The isVisible of the data.

Specified by:
isVisible in interface hep.aida.IBaseStyle

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.

Parameters:
p - The parent for this BaseStyle.

parent

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

Returns:
The parent.

addBaseStyle

protected boolean 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(AbstractStyleParameter styleParameter)
Add a new parameter to this BaseStyle.

Parameters:
styleParameter - The style parameter.

parameter

public AbstractStyleParameter parameter(String parName)

deepestSetParameter

protected AbstractStyleParameter deepestSetParameter(String parName)

numberOfParameters

protected int numberOfParameters()

parameters

protected Collection parameters()

isParameterSet

public boolean isParameterSet(String parameterName)

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

setParameterDefault

protected void setParameterDefault(String parameterName,
                                   String parDefaultValue)

styleChanged

public void styleChanged(BaseStyle style)
Specified by:
styleChanged in interface StyleListener

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.