uk.ac.starlink.ast.gui
Class AstTitle

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

public class AstTitle
extends AbstractPlotControlsModel

AstTitle is a model of the Title element shown in say an AST Plot. 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 the title.
protected  Font font
          The Font used to display the title.
protected  double gap
          The gap between title and plot border.
static double GAP_MAX
          The suggested maximum gap.
static double GAP_MIN
          The suggested minimum gap.
static double GAP_STEP
          The suggested gap resolution (i.e.
protected  DefaultGrfFontManager grfFontManager
          Reference to the GrfFontManager object.
protected  boolean isSet
          Whether title is set or unset.
static String NULL_TITLE
          A title to show that is the same as null.
protected  boolean show
          Whether the title should be shown (different from unset).
protected  String title
          The value for the title.
 
Fields inherited from class uk.ac.starlink.ast.gui.AbstractPlotControlsModel
listeners
 
Constructor Summary
AstTitle()
          Create a empty instance.
AstTitle(String title)
          Create an instance with initial value.
 
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 of the title.
 Font getFont()
          Get the Font used to draw title.
 double getGap()
          Get the gap between title and border.
 boolean getShown()
          Get whether the title is to be shown.
 boolean getState()
          Return if the title is set or unset.
 String getTagName()
          The name of our enclosing tag.
 String getTitle()
          Get the current title.
 void setColour(Color colour)
          Set the colour of the title.
 void setDefaults()
          Set/reset all values to their defaults.
 void setFont(Font font)
          Set the Font to be used when displaying title.
 void setFromString(String name, String value)
          Set the value of a member variable by matching its name to a known local property string.
 void setGap(double gap)
          Set the gap between title and border.
 void setShown(boolean show)
          Set whether the title should be shown or not.
 void setState(boolean isSet)
          Set whether the title is set or unset (unset implies that all title properties should remain at their AST defaults).
 void setTitle(String title)
          Set the title string.
 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 title is set or unset.


show

protected boolean show
Whether the title should be shown (different from unset).


title

protected String title
The value for the title.


font

protected Font font
The Font used to display the title.


colour

protected Color colour
The colour of the title.


gap

protected double gap
The gap between title and plot border.


GAP_MIN

public static final double GAP_MIN
The suggested minimum gap.

See Also:
Constant Field Values

GAP_MAX

public static final double GAP_MAX
The suggested maximum gap.

See Also:
Constant Field Values

GAP_STEP

public static final double GAP_STEP
The suggested gap resolution (i.e. interval between steps).

See Also:
Constant Field Values

NULL_TITLE

public static final String NULL_TITLE
A title to show that is the same as null.

See Also:
Constant Field Values

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

AstTitle

public AstTitle()
Create a empty instance. This indicates that the title element should remain at the AST Plot default.


AstTitle

public AstTitle(String title)
Create an instance with initial value.

Parameters:
title - Description of the Parameter
Method Detail

setDefaults

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


setState

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

Parameters:
isSet - The new state value

getState

public boolean getState()
Return if the title is set or unset.

Returns:
The state value

setShown

public void setShown(boolean show)
Set whether the title should be shown or not.

Parameters:
show - The new shown value

getShown

public boolean getShown()
Get whether the title is to be shown.

Returns:
The shown value

setTitle

public void setTitle(String title)
Set the title string. If null then title is unset.

Parameters:
title - The new title value

getTitle

public String getTitle()
Get the current title.

Returns:
The title value

setFont

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

Parameters:
font - The new font value

getFont

public Font getFont()
Get the Font used to draw title.

Returns:
The font value

setColour

public void setColour(Color colour)
Set the colour of the title.

Parameters:
colour - The new colour value

getColour

public Color getColour()
Get the colour of the title.

Returns:
The colour value

setGap

public void setGap(double gap)
Set the gap between title and border. The value DefaultGrf.BAD means no value.

Parameters:
gap - The new gap value

getGap

public double getGap()
Get the gap between title and border.

Returns:
The gap 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.