org.omegahat.Graphics.Plots
Class DataPlot

java.lang.Object
  |
  +--org.omegahat.Graphics.Primitives.GraphicalObject
        |
        +--org.omegahat.Graphics.Primitives.RGO
              |
              +--org.omegahat.Graphics.Primitives.GraphicalContainer
                    |
                    +--org.omegahat.Graphics.Plots.DataPlot
All Implemented Interfaces:
Addable, Copyable, GraphicalComponentInt, GraphicalContainerInt, MathOperable, ScaledComponentInt, SimpleGraphicalContainerInt, Subsettable, Tree
Direct Known Subclasses:
Boxplot, DynamicTimeSeries, Histogram, Scatterplot

public class DataPlot
extends GraphicalContainer

the class of statistical plots defined by a scale of data values for the horizontal and vertical axes. This is a graphical object that defines three regions: a data region, in which the actual plotting of data-related objects takes place, and two axis regions, one for the x axis and one for the y axis. The typical style for using objects from this class is to create the object and then add graphical objects to the data region.


Field Summary
protected  GraphicalContainerInt dataRegion
           
protected  AxisInt xAxis
           
protected  java.lang.String xLabel
           
protected  AxisInt yAxis
           
protected  java.lang.String yLabel
           
 
Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalContainer
allocator, children, origin, parent, scaleX, scaleY
 
Fields inherited from class org.omegahat.Graphics.Primitives.RGO
region
 
Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalObject
ACTIVE, fontSize, lastDevice, lastHeightCM, lastRegion, lastWidthCM, parents, status, VISIBLE
 
Fields inherited from interface org.omegahat.Environment.DataStructures.MathOperable
DIVIDE, MINUS, MULTIPLY, PLUS
 
Constructor Summary
DataPlot()
           
DataPlot(ScaleInt sx, ScaleInt sy)
          Constructor specifying the X and Y scales for the data region and the axes.
 
Method Summary
 AxisInt bottomAxis(AxisInt xAxis)
           
 AxisInt bottomAxis(ScaleInt sx)
          The method used to construct the X axis when the DataPlot object is made, or to construct a new X axis, throwing away the previous.
protected  GraphicalContainerInt createDataRegion()
           
protected  GraphicalContainerInt createDataRegion(GraphicalContainerInt data)
           
protected  GraphicalContainerInt createDataRegion(ScaleInt sx, ScaleInt sy)
           
 RegionAllocator createRegionAllocator()
          Construct the RegionAllocator for this data plot.
 GraphicalContainerInt dataRegion()
           
 AxisInt getXAxis()
          Accessor for xAxis field
 java.lang.String getXLabel()
          Accessor for xLabel field
 AxisInt getYAxis()
          Accessor for yAxis field
 java.lang.String getYLabel()
          Accessor for yLabel field
 AxisInt leftAxis(AxisInt yaxis)
          Make this the Y-axis, removing any previous definition.
 AxisInt leftAxis(ScaleInt sy)
          The method used to construct the Y axis when the DataPlot object is made.
 boolean make(ScaleInt sx, ScaleInt sy)
          Construct the different standard elements/components of a data plot - the region allocator, the 2 axes and the data region.
 AxisInt setXAxis(AxisInt value)
          Accessor for setting xAxis field
 java.lang.String setXLabel(java.lang.String value)
          Accessor for setting xLabel field
 AxisInt setYAxis(AxisInt value)
          Accessor for setting yAxis field
 java.lang.String setYLabel(java.lang.String value)
          Accessor for setting yLabel field.
 
Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalContainer
add, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addValue, copy, copy, draw, drawChildren, get, getChild, getChildCount, getChildren, getDevice, getOrigin, getRegionAllocator, getXScale, getYScale, parent, parent, remove, removeGraphicalObject, removeGraphicalObject, setOrigin, setRegionAllocator, setXScale, setYScale, subset, subset, transform, transform
 
Methods inherited from class org.omegahat.Graphics.Primitives.RGO
center, centre, createRegionDescription, createRegionDescription, getRegion, height, height, setHJust, setRegion, setVJust, width, width, x, x, y, y
 
Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalObject
cacheSize, getFontSize, getFontSize, getParameters, getParents, getStatus, isActive, isVisible, lastHeightCM, lastRegion, lastWidthCM, parents, setActive, setParameters, setParents, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.omegahat.Graphics.Primitives.GraphicalComponentInt
getParameters, getRegion, isActive, isVisible, parents, setActive, setParameters, setRegion, setVisible
 

Field Detail

xLabel

protected java.lang.String xLabel

yLabel

protected java.lang.String yLabel

xAxis

protected AxisInt xAxis

yAxis

protected AxisInt yAxis

dataRegion

protected GraphicalContainerInt dataRegion
Constructor Detail

DataPlot

public DataPlot()

DataPlot

public DataPlot(ScaleInt sx,
                ScaleInt sy)
Constructor specifying the X and Y scales for the data region and the axes.
Method Detail

getXLabel

public java.lang.String getXLabel()
Accessor for xLabel field

setXLabel

public java.lang.String setXLabel(java.lang.String value)
Accessor for setting xLabel field

getYLabel

public java.lang.String getYLabel()
Accessor for yLabel field

setYLabel

public java.lang.String setYLabel(java.lang.String value)
Accessor for setting yLabel field. Also arranges to make this the label of the corresponding axis.

getXAxis

public AxisInt getXAxis()
Accessor for xAxis field

setXAxis

public AxisInt setXAxis(AxisInt value)
Accessor for setting xAxis field

getYAxis

public AxisInt getYAxis()
Accessor for yAxis field

setYAxis

public AxisInt setYAxis(AxisInt value)
Accessor for setting yAxis field

make

public boolean make(ScaleInt sx,
                    ScaleInt sy)
Construct the different standard elements/components of a data plot - the region allocator, the 2 axes and the data region. The scales from the axes are shared with the data region.

bottomAxis

public AxisInt bottomAxis(ScaleInt sx)
The method used to construct the X axis when the DataPlot object is made, or to construct a new X axis, throwing away the previous.

bottomAxis

public AxisInt bottomAxis(AxisInt xAxis)

leftAxis

public AxisInt leftAxis(ScaleInt sy)
The method used to construct the Y axis when the DataPlot object is made.

leftAxis

public AxisInt leftAxis(AxisInt yaxis)
Make this the Y-axis, removing any previous definition.

dataRegion

public GraphicalContainerInt dataRegion()

createDataRegion

protected GraphicalContainerInt createDataRegion()

createDataRegion

protected GraphicalContainerInt createDataRegion(ScaleInt sx,
                                                 ScaleInt sy)

createDataRegion

protected GraphicalContainerInt createDataRegion(GraphicalContainerInt data)

createRegionAllocator

public RegionAllocator createRegionAllocator()
Construct the RegionAllocator for this data plot. Performing this in a separate method (from make()), allows others to override it easily.