uk.ac.starlink.ast.gui
Class GraphicsEdges

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

public class GraphicsEdges
extends AbstractPlotControlsModel

GraphicsEdges defines options about how the edges of a plot should be drawn (note these are not AST plot related). Currently this covers the amount of space reserved around the plot for data labels and whether any graphics should be clipped to lie within the border.

Version:
$Id$
Author:
Peter W. Draper
See Also:
PlotConfigurator, PlotConfiguration

Field Summary
protected  boolean clip
          Whether to clip the plotted data.
static double GAP_MAX
          The suggested maximum fraction.
static double GAP_MIN
          The suggested minimum fraction.
static double GAP_STEP
          The suggested fraction resolution (i.e.
protected  double xLeft
          Fraction of plot to keep for left labels.
protected  double xRight
          Fraction of plot to keep for right labels.
protected  double yBottom
          Fraction of plot to keep for the bottom labels.
protected  double yTop
          Fraction of plot to keep for the top labels.
 
Fields inherited from class uk.ac.starlink.ast.gui.AbstractPlotControlsModel
listeners
 
Constructor Summary
GraphicsEdges()
          Create an instance.
 
Method Summary
 void encode(Element rootElement)
          Encode the internal state of this object so that it is rooted in the given Element.
 String getTagName()
          The name of our enclosing tag.
 double getXLeft()
          Get the fraction of display reserved for X labelling on the left.
 double getXRight()
          Get the fraction of display reserved for X labelling on the right.
 double getYBottom()
          Get the fraction of display reserved for Y labelling at the bottom.
 double getYTop()
          Get the fraction of display reserved for Y labelling at the top.
 boolean isClipped()
          See if graphics should be clipped to lie within border.
 void setClipped(boolean clip)
          Set if graphics should be clipped to lie within border.
 void setDefaults()
          Set object back to its 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 setXLeft(double xLeft)
          Set the fraction of display reserved for X labelling on the left.
 void setXRight(double xRight)
          Set the fraction of display reserved for X labelling on the right.
 void setYBottom(double yBottom)
          Set the fraction of display reserved for Y labelling at the bottom.
 void setYTop(double yTop)
          Set the fraction of display reserved for Y labelling at the top.
 
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, toString, wait, wait, wait
 

Field Detail

clip

protected boolean clip
Whether to clip the plotted data.


xLeft

protected double xLeft
Fraction of plot to keep for left labels.


xRight

protected double xRight
Fraction of plot to keep for right labels.


yTop

protected double yTop
Fraction of plot to keep for the top labels.


yBottom

protected double yBottom
Fraction of plot to keep for the bottom labels.


GAP_MIN

public static final double GAP_MIN
The suggested minimum fraction.

See Also:
Constant Field Values

GAP_MAX

public static final double GAP_MAX
The suggested maximum fraction.

See Also:
Constant Field Values

GAP_STEP

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

See Also:
Constant Field Values
Constructor Detail

GraphicsEdges

public GraphicsEdges()
Create an instance.

Method Detail

setDefaults

public void setDefaults()
Set object back to its defaults.


isClipped

public boolean isClipped()
See if graphics should be clipped to lie within border.


setClipped

public void setClipped(boolean clip)
Set if graphics should be clipped to lie within border.


getXLeft

public double getXLeft()
Get the fraction of display reserved for X labelling on the left.


getXRight

public double getXRight()
Get the fraction of display reserved for X labelling on the right.


setXLeft

public void setXLeft(double xLeft)
Set the fraction of display reserved for X labelling on the left.


setXRight

public void setXRight(double xRight)
Set the fraction of display reserved for X labelling on the right.


getYTop

public double getYTop()
Get the fraction of display reserved for Y labelling at the top.


getYBottom

public double getYBottom()
Get the fraction of display reserved for Y labelling at the bottom.


setYTop

public void setYTop(double yTop)
Set the fraction of display reserved for Y labelling at the top.


setYBottom

public void setYBottom(double yBottom)
Set the fraction of display reserved for Y labelling at the bottom.


getTagName

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

Returns:
the name of the root element.

encode

public void encode(Element rootElement)
Description copied from interface: XMLEncodeDecode
Encode the internal state of this object so that it is rooted in the given Element.

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

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


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