uk.ac.starlink.ast.gui
Class AstAxes

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

public class AstAxes
extends AbstractPlotControlsModel

AstAxes is a model of the axes elements shown in an AST Plot.

Version:
$Id$
Author:
Peter W. Draper

Field Summary
protected  boolean interior
          Axes placement, interior or exterior.
protected  boolean isXSet
          Whether X axis is set or unset.
protected  boolean isYSet
          Whether Y axis is set or unset.
protected  boolean logX
          Whether the X axis should be logarithmic.
protected  boolean logY
          Whether the Y axis should be logarithmic.
static int MAX_WIDTH
          Suggested maximum width.
static int MIN_WIDTH
          Suggested minimum width.
protected  boolean showX
          Whether the X axis should be shown (different from unset).
protected  boolean showY
          Whether the Y axis should be shown (different from unset).
protected  Color xColour
          The colour of the X axis.
protected  double xLabelAt
          A position to start the X labelling at, not used when axes are drawn externally.
protected  int xStyle
          The line style of the X axis.
protected  double xWidth
          The width of the X axis.
protected  Color yColour
          The colour of the Y axis.
protected  double yLabelAt
          A position to start the Y labelling at, not used when axes are drawn externally.
protected  int yStyle
          The line style of the Y axis.
protected  double yWidth
          The width of the Y axis.
 
Fields inherited from class uk.ac.starlink.ast.gui.AbstractPlotControlsModel
listeners
 
Constructor Summary
AstAxes()
          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.
 boolean getForceExterior()
          Return if the exterior axes will be forced.
 boolean getInterior()
          Return if the suggestion axis placement is interior
 String getTagName()
          The name of our enclosing tag.
 Color getXColour()
          Get the colour of the X axis.
 double getXLabelAt()
          Get the position along the X axis at which labelling is to start.
 boolean getXLog()
          Get whether the X axis is to be drawn with logarithmic spacing.
 boolean getXShown()
          Get whether the X axis is to be shown.
 boolean getXState()
          Return if the X axis is set or unset.
 int getXStyle()
          Get the X axis line style.
 double getXWidth()
          Get the X axis line width.
 Color getYColour()
          Get the colour of the Y axis.
 double getYLabelAt()
          Get the position along the Y axis at which labelling is to start.
 boolean getYLog()
          Get whether the Y axis is to be drawn with logarithmic spacing.
 boolean getYShown()
          Get whether the Y axis is to be shown.
 boolean getYState()
          Return if the Y axis is set or unset.
 int getYStyle()
          Get the Y axis line style.
 double getYWidth()
          Get the Y axis line width.
 void setDefaults()
          Set object to default state.
 void setForceExterior(boolean forceExterior)
          Set whether exterior axes placement should be forced, when the labelling choice is exterior.
 void setFromString(String name, String value)
          Set the value of a member variable by matching its name to a known local property string.
 void setInterior(boolean interior)
          Set whether the suggested placement for axes is interior.
 void setXColour(Color xColour)
          Set the colour of the X axis.
 void setXLabelAt(double xLabelAt)
          Set position along the X axis at which to start labelling (i.e.
 void setXLog(boolean logX)
          Set whether the X axis should be drawn with logarithmic spacing.
 void setXShown(boolean showX)
          Set whether the X axis should be shown or not.
 void setXState(boolean isXSet)
          Set whether the X axis is set or unset (unset implies that all properties should remain at their AST defaults).
 void setXStyle(int xStyle)
          Set the X axis line style.
 void setXWidth(double xWidth)
          Set the X axis line width.
 void setYColour(Color yColour)
          Set the colour of the Y axis.
 void setYLabelAt(double yLabelAt)
          Set position along the Y axis at which to start labelling (i.e.
 void setYLog(boolean logY)
          Set whether the Y axis should be drawn with logarithmic spacing.
 void setYShown(boolean showY)
          Set whether the Y axis should be shown or not.
 void setYState(boolean isYSet)
          Set whether the Y axis is set or unset (unset implies that all properties should remain at their AST defaults).
 void setYStyle(int yStyle)
          Set the Y axis line style.
 void setYWidth(double yWidth)
          Set the Y axis 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

isXSet

protected boolean isXSet
Whether X axis is set or unset.


isYSet

protected boolean isYSet
Whether Y axis is set or unset.


showX

protected boolean showX
Whether the X axis should be shown (different from unset).


showY

protected boolean showY
Whether the Y axis should be shown (different from unset).


logX

protected boolean logX
Whether the X axis should be logarithmic.


logY

protected boolean logY
Whether the Y axis should be logarithmic.


interior

protected boolean interior
Axes placement, interior or exterior. This is just a suggestion.


xLabelAt

protected double xLabelAt
A position to start the X labelling at, not used when axes are drawn externally.


yLabelAt

protected double yLabelAt
A position to start the Y labelling at, not used when axes are drawn externally.


xColour

protected Color xColour
The colour of the X axis.


yColour

protected Color yColour
The colour of the Y axis.


xStyle

protected int xStyle
The line style of the X axis.


yStyle

protected int yStyle
The line style of the Y axis.


xWidth

protected double xWidth
The width of the X axis.


yWidth

protected double yWidth
The width of the Y axis.


MIN_WIDTH

public static int MIN_WIDTH
Suggested minimum width.


MAX_WIDTH

public static int MAX_WIDTH
Suggested maximum width.

Constructor Detail

AstAxes

public AstAxes()
Create a empty instance. This indicates that the axis elements should remain at the AST Plot default.

Method Detail

setDefaults

public void setDefaults()
Set object to default state.


setXState

public void setXState(boolean isXSet)
Set whether the X axis is set or unset (unset implies that all properties should remain at their AST defaults).

Parameters:
isXSet - The new state value

getXState

public boolean getXState()
Return if the X axis is set or unset.

Returns:
The state value

setYState

public void setYState(boolean isYSet)
Set whether the Y axis is set or unset (unset implies that all properties should remain at their AST defaults).

Parameters:
isYSet - The new state value

getYState

public boolean getYState()
Return if the Y axis is set or unset.

Returns:
The state value

setXShown

public void setXShown(boolean showX)
Set whether the X axis should be shown or not.

Parameters:
showX - The new shown value

getXShown

public boolean getXShown()
Get whether the X axis is to be shown.

Returns:
The shown value

setYShown

public void setYShown(boolean showY)
Set whether the Y axis should be shown or not.

Parameters:
showY - The new shown value

getYShown

public boolean getYShown()
Get whether the Y axis is to be shown.

Returns:
The shown value

setXLog

public void setXLog(boolean logX)
Set whether the X axis should be drawn with logarithmic spacing.

Parameters:
logX - The new logX value

getXLog

public boolean getXLog()
Get whether the X axis is to be drawn with logarithmic spacing.

Returns:
The logX value.

setYLog

public void setYLog(boolean logY)
Set whether the Y axis should be drawn with logarithmic spacing.

Parameters:
logY - The new logY value

getYLog

public boolean getYLog()
Get whether the Y axis is to be drawn with logarithmic spacing.

Returns:
The logY value.

setXLabelAt

public void setXLabelAt(double xLabelAt)
Set position along the X axis at which to start labelling (i.e. the Y axis intersection with the X axis). Ignore if labelling is drawn externally. DefaultGrf.BAD indicates that the default value should be used. The units are those of the X axis.

Parameters:
xLabelAt - The new position to start labelling.

getXLabelAt

public double getXLabelAt()
Get the position along the X axis at which labelling is to start. DefaultGrf.BAD indicates that the default value should be used.

Returns:
The xLabelAt value

setYLabelAt

public void setYLabelAt(double yLabelAt)
Set position along the Y axis at which to start labelling (i.e. the X axis intersection with the Y axis). Ignore if labelling is drawn externally. DefaultGrf.BAD indicates that the default value should be used. The units are those of the Y axis.

Parameters:
yLabelAt - The new position to start labelling.

getYLabelAt

public double getYLabelAt()
Get the position along the Y axis at which labelling is to start. DefaultGrf.BAD indicates that the default value should be used.

Returns:
The yLabelAt value

setXColour

public void setXColour(Color xColour)
Set the colour of the X axis.

Parameters:
colour - The new colour value

getXColour

public Color getXColour()
Get the colour of the X axis.

Returns:
The colour value

setYColour

public void setYColour(Color yColour)
Set the colour of the Y axis.

Parameters:
colour - The new colour value

getYColour

public Color getYColour()
Get the colour of the Y axis.

Returns:
The colour value

setXWidth

public void setXWidth(double xWidth)
Set the X axis line width. The value DefaultGrf.BAD means no value.

Parameters:
width - The new width value

getXWidth

public double getXWidth()
Get the X axis line width.

Returns:
The width value

setYWidth

public void setYWidth(double yWidth)
Set the Y axis line width. The value DefaultGrf.BAD means no value.

Parameters:
width - The new width value

getYWidth

public double getYWidth()
Get the Y axis line width.

Returns:
The width value

setXStyle

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

Parameters:
xStyle - The new style value

getXStyle

public int getXStyle()
Get the X axis line style.

Returns:
The style value

setYStyle

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

Parameters:
yStyle - The new style value

getYStyle

public int getYStyle()
Get the Y axis line style.

Returns:
The style value

setInterior

public void setInterior(boolean interior)
Set whether the suggested placement for axes is interior. If false then it is suggested that axes are placed on the exterior.

Parameters:
interior - Whether to place axes on the interior

getInterior

public boolean getInterior()
Return if the suggestion axis placement is interior

Returns:
The state value

setForceExterior

public void setForceExterior(boolean forceExterior)
Set whether exterior axes placement should be forced, when the labelling choice is exterior.

Parameters:
forceExterior - Whether to force exterior axes.

getForceExterior

public boolean getForceExterior()
Return if the exterior axes will be forced.

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