uk.ac.starlink.ast.gui
Class AstBorder

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

public class AstBorder
extends AbstractPlotControlsModel

AstBorder is a model of the Border 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 border.
protected  boolean isSet
          Whether border is set or unset.
protected  boolean show
          Whether the border should be shown (different from unset).
protected  int style
          The line style of the border lines.
protected  double width
          The width of the border lines.
 
Fields inherited from class uk.ac.starlink.ast.gui.AbstractPlotControlsModel
listeners
 
Constructor Summary
AstBorder()
          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 of the border.
 boolean getShown()
          Get whether the border is to be shown.
 boolean getState()
          Return if the border is set or unset.
 double getStyle()
          Get the line style.
 String getTagName()
          The name of our enclosing tag.
 double getWidth()
          Get the line width.
 void setColour(Color colour)
          Set the colour of the border.
 void setDefaults()
          Set/reset all values to their defaults.
 void setFromString(String name, String value)
          Set the value of a member variable by matching its name to a known local property string.
 void setShown(boolean show)
          Set whether the border should be shown or not.
 void setState(boolean isSet)
          Set whether the border is set or unset (unset implies that all properties should remain at their AST defaults).
 void setStyle(int style)
          Set the line style.
 void setWidth(double width)
          Set the line width.
 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 border is set or unset.


show

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


colour

protected Color colour
The colour of the border.


style

protected int style
The line style of the border lines.


width

protected double width
The width of the border lines.

Constructor Detail

AstBorder

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

Method Detail

setDefaults

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


setState

public void setState(boolean isSet)
Set whether the border 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 the border is set or unset.

Returns:
The state value

setShown

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

Parameters:
show - The new shown value

getShown

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

Returns:
The shown value

setColour

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

Parameters:
colour - The new colour value

getColour

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

Returns:
The colour value

setWidth

public void setWidth(double width)
Set the line width. The value DefaultGrf.BAD means no value.

Parameters:
width - The new width value

getWidth

public double getWidth()
Get the line width.

Returns:
The width value

setStyle

public void setStyle(int style)
Set the line style. This should be a style known to the Grf class (i.e. DefaultGrf.PLAIN, DefaultGrf.DASH etc.)

Parameters:
style - The new style value

getStyle

public double getStyle()
Get the line style.

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