uk.ac.starlink.ast.gui
Class AstStrings

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

public class AstStrings
extends AbstractPlotControlsModel

AstStrings is a model for all the general text elements shown in an AST Plot (i.e. those with element name "strings"). It encompasses all the values that describe its representation and returns these in various formats (such as the complete AST Plot options list for drawing it).

Version:
$Id$
Author:
Peter W. Draper

Field Summary
protected  Color colour
          The colour of text
protected  Font font
          The Font used to display text.
protected  DefaultGrfFontManager grfFontManager
          Reference to the GrfFontManager object.
protected  boolean isSet
          Whether values are set or unset.
 
Fields inherited from class uk.ac.starlink.ast.gui.AbstractPlotControlsModel
listeners
 
Constructor Summary
AstStrings()
          Create a empty instance.
 
Method Summary
 void encode(Element rootElement)
          Description of the Method
 String getAstOptions()
          Get the AST plot options description of this object.
 Color getColour()
          Get the colour.
 Font getFont()
          Get the Font used.
 boolean getState()
          Return if this object is set or unset.
 String getTagName()
          The name of our enclosing tag.
 void setColour(Color colour)
          Set the colour.
 void setDefaults()
          Set/reset all values to their defaults.
 void setFont(Font font)
          Set the Font to be used.
 void setFromString(String name, String value)
          Set the value of a member variable by matching its name to a known local property string.
 void setState(boolean isSet)
          Set whether this objects state is set or unset (unset implies that all properties should remain at their AST defaults).
 String toString()
          Get a string representation of the AST options.
 
Methods inherited from class uk.ac.starlink.ast.gui.AbstractPlotControlsModel
addChangeListener, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, booleanFromString, booleanToString, colorFromString, colorToString, decode, doubleFromString, doubleToString, fireChanged, fontFromString, fontToString, getChildren, getElementName, getElementValue, intFromString, intToString, longFromString, longToString, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isSet

protected boolean isSet
Whether values are set or unset.


font

protected Font font
The Font used to display text.


colour

protected Color colour
The colour of text


grfFontManager

protected DefaultGrfFontManager grfFontManager
Reference to the GrfFontManager object. Use this to add and remove fonts from the global list. Also provides the index of the font as known to Grf.

Constructor Detail

AstStrings

public AstStrings()
Create a empty instance. This indicates that string elements should be drawn using the AST defaults.

Method Detail

setDefaults

public void setDefaults()
Set/reset all values to their defaults.


setState

public void setState(boolean isSet)
Set whether this objects state is set or unset (unset implies that all properties should remain at their AST defaults).

Parameters:
isSet - The new state value

getState

public boolean getState()
Return if this object is set or unset.

Returns:
The state value

setFont

public void setFont(Font font)
Set the Font to be used.

Parameters:
font - The new font value

getFont

public Font getFont()
Get the Font used.

Returns:
The font value

setColour

public void setColour(Color colour)
Set the colour.

Parameters:
colour - The new colour value

getColour

public Color getColour()
Get the colour.

Returns:
The colour value

getAstOptions

public String getAstOptions()
Get the AST plot options description of this object.

Returns:
The astOptions value

toString

public String toString()
Get a string representation of the AST options.

Overrides:
toString in class Object
Returns:
Description of the Return Value

getTagName

public String getTagName()
The name of our enclosing tag.

Returns:
the name of the root element.

encode

public void encode(Element rootElement)
Description of the Method

Specified by:
encode in interface XMLEncodeDecode
Specified by:
encode in class AbstractPlotControlsModel
Parameters:
rootElement - Description of the Parameter

setFromString

public void setFromString(String name,
                          String value)
Set the value of a member variable by matching its name to a known local property string.

Specified by:
setFromString in class AbstractPlotControlsModel
Parameters:
name - The new fromString value
value - The new fromString value


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