uk.ac.starlink.ast.gui
Class PlotConfiguration

java.lang.Object
  extended by uk.ac.starlink.ast.gui.PlotConfiguration
All Implemented Interfaces:
XMLEncodeDecode

public class PlotConfiguration
extends Object
implements XMLEncodeDecode

PlotConfiguration is a repository for all the configuration information related to a Plot (i.e. the AST graphics configuration, plus addition information such as data limits and antialiasing state, which may be added).

The specific configurations for classes of objects are controlled by a series of container objects that can be accessed individually as required, or queried as a whole (for instance to get the complete AST description).

Each Plot should have one of these objects associated with it (which can be viewed and changed using a PlotConfigurator window).

The total state of configuration can be saved and restored from an XML snippet attached to a given XML Element.

Version:
$Id$
Author:
Peter W. Draper
See Also:
PlotConfigurator, Plot, AstTitle, AstStrings, AstAxisLabels,, AstNumberLabels, AstGrid, AstAxes, AstBorder, AstTicks

Field Summary
protected  AstAxes astAxes
          AST model of the axes.
protected  AstAxisLabels astAxisLabels
          AST model of the axis labels.
protected  AstBorder astBorder
          AST model of the border.
protected  ArrayList astConfigObjects
          Array of AbstractPlotControlsModel objects that are genuine Ast related parts (i.e.
protected  AstGrid astGrid
          AST model of the grid.
protected  AstNumberLabels astNumberLabels
          AST model of the number labels.
protected  AstStrings astStrings
          AST model of the text strings.
protected  AstTicks astTicks
          AST model of the plot ticks.
protected  AstTitle astTitle
          AST model of the title.
protected  ArrayList configObjects
          Array of AbstractPlotControlsModel objects that are storing the configuration parts.
 
Constructor Summary
PlotConfiguration()
          Create an instance.
 
Method Summary
 void add(AbstractPlotControlsModel model)
          Add an AbstractPlotControlsModel to the list.
 void decode(Element rootElement)
          Decode (i.e.
 void encode(Element rootElement)
          Encode the internal state of this object into an XML snippet rooted in an Element.
 String getAst()
          Get the complete AST description of all AST components.
 String getAst(boolean passone)
          Get the complete AST description (see getAst broken into two passes.
 AbstractPlotControlsModel getControlsModel(Class clazz)
          Get an AbstractPlotControlsModel by class
 String getTagName()
          The name for the parent tag of all stored elements.
 Iterator iterator()
          Return an Iterator for the list of AbstractPlotControlsModels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

astTitle

protected AstTitle astTitle
AST model of the title.


astStrings

protected AstStrings astStrings
AST model of the text strings.


astAxisLabels

protected AstAxisLabels astAxisLabels
AST model of the axis labels.


astNumberLabels

protected AstNumberLabels astNumberLabels
AST model of the number labels.


astGrid

protected AstGrid astGrid
AST model of the grid.


astAxes

protected AstAxes astAxes
AST model of the axes.


astBorder

protected AstBorder astBorder
AST model of the border.


astTicks

protected AstTicks astTicks
AST model of the plot ticks.


configObjects

protected ArrayList configObjects
Array of AbstractPlotControlsModel objects that are storing the configuration parts. Note we populate this with the default set, which are always available.


astConfigObjects

protected ArrayList astConfigObjects
Array of AbstractPlotControlsModel objects that are genuine Ast related parts (i.e. can be passed to an Ast Plot as configuration options, these are the default list and cannot be extended).

Constructor Detail

PlotConfiguration

public PlotConfiguration()
Create an instance.

Method Detail

getAst

public String getAst()
Get the complete AST description of all AST components. This option string can be given to a Plot.


getAst

public String getAst(boolean passone)
Get the complete AST description (see getAst broken into two passes. The two passes are used so that a different set of coordinates can be drawn along the top and bottom axes, without interfering with each other.


add

public void add(AbstractPlotControlsModel model)
Add an AbstractPlotControlsModel to the list.


iterator

public Iterator iterator()
Return an Iterator for the list of AbstractPlotControlsModels.


getControlsModel

public AbstractPlotControlsModel getControlsModel(Class clazz)
Get an AbstractPlotControlsModel by class


encode

public void encode(Element rootElement)
Encode the internal state of this object into an XML snippet rooted in an Element.

Specified by:
encode in interface XMLEncodeDecode
Parameters:
rootElement - the Element within which the object should store its configuration.

decode

public void decode(Element rootElement)
Decode (i.e. restore) the internal state of this object from an XML Element.

Specified by:
decode in interface XMLEncodeDecode
Parameters:
rootElement - the element to which a previous object this this type has attached its configuration.

getTagName

public String getTagName()
The name for the parent tag of all stored elements.

Specified by:
getTagName in interface XMLEncodeDecode
Returns:
the name of the root element.


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