de.erichseifert.gral.plots
Class XYPlot

java.lang.Object
  extended by de.erichseifert.gral.AbstractDrawable
      extended by de.erichseifert.gral.DrawableContainer
          extended by de.erichseifert.gral.plots.Plot
              extended by de.erichseifert.gral.plots.XYPlot
All Implemented Interfaces:
Container, DataListener, Drawable, SettingsListener, SettingsStorage, Iterable<Drawable>
Direct Known Subclasses:
BarPlot

public class XYPlot
extends Plot

Class that displays data in an two dimensional coordinate system.


Nested Class Summary
static class XYPlot.XYLegend
          Class that displays a legend in an XYPlot.
static class XYPlot.XYPlotArea2D
          Class that represents the drawing area of an XYPlot.
 
Field Summary
static String AXIS_X
          Key for specifying the x-axis of an xy-plot.
static String AXIS_X2
          Key for specifying the secondary x-axis of an xy-plot.
static String AXIS_Y
          Key for specifying the y-axis of an xy-plot.
static String AXIS_Y2
          Key for specifying the secondary y-axis of an xy-plot.
 
Fields inherited from class de.erichseifert.gral.plots.Plot
ANTIALISING, BACKGROUND, BORDER, COLOR, LEGEND, LEGEND_LOCATION, LEGEND_MARGIN, TITLE
 
Constructor Summary
XYPlot(DataSource... data)
          Initializes a new instance object with the specified data sources and reasonable default settings.
 
Method Summary
 AreaRenderer getAreaRenderer(DataSource s)
          Returns the AreaRenderer for the specified DataSource.
 LineRenderer getLineRenderer(DataSource s)
          Returns the LineRenderer for the specified DataSource.
 PointRenderer getPointRenderer(DataSource s)
          Returns the PointRenderer for the specified DataSource.
 void refresh()
          Causes the plot data to be be updated.
 void setAreaRenderer(DataSource s, AreaRenderer areaRenderer)
          Sets the AreaRenderer for a certain DataSource to the specified value.
 void setAxisRenderer(Axis axis, AxisRenderer renderer)
          Sets the renderer for the specified axis.
 void setLineRenderer(DataSource s, LineRenderer lineRenderer)
          Sets the LineRenderer for a certain DataSource to the specified value.
 void setPointRenderer(DataSource s, PointRenderer pointRenderer)
          Sets the PointRenderer for a certain DataSource to the specified instance.
 
Methods inherited from class de.erichseifert.gral.plots.Plot
add, add, add, clear, contains, dataChanged, draw, get, getAxes, getAxis, getAxisRenderer, getAxisRenderer, getData, getLegend, getPlotArea, getSetting, getTitle, getVisibleData, isVisible, remove, removeAxis, removeSetting, removeSettingDefault, setAxis, setAxisRenderer, setSetting, setSettingDefault, settingChanged, setVisible
 
Methods inherited from class de.erichseifert.gral.DrawableContainer
add, add, getConstraints, getInsets, getLayout, getPreferredSize, iterator, remove, setBounds, setBounds, setInsets, setLayout, size
 
Methods inherited from class de.erichseifert.gral.AbstractDrawable
getBounds, getHeight, getWidth, getX, getY
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.erichseifert.gral.Container
getBounds
 

Field Detail

AXIS_X

public static String AXIS_X
Key for specifying the x-axis of an xy-plot.


AXIS_X2

public static String AXIS_X2
Key for specifying the secondary x-axis of an xy-plot.


AXIS_Y

public static String AXIS_Y
Key for specifying the y-axis of an xy-plot.


AXIS_Y2

public static String AXIS_Y2
Key for specifying the secondary y-axis of an xy-plot.

Constructor Detail

XYPlot

public XYPlot(DataSource... data)
Initializes a new instance object with the specified data sources and reasonable default settings.

Parameters:
data - Data to be displayed.
Method Detail

getPointRenderer

public PointRenderer getPointRenderer(DataSource s)
Returns the PointRenderer for the specified DataSource.

Parameters:
s - DataSource.
Returns:
PointRenderer.

setPointRenderer

public void setPointRenderer(DataSource s,
                             PointRenderer pointRenderer)
Sets the PointRenderer for a certain DataSource to the specified instance.

Parameters:
s - DataSource.
pointRenderer - PointRenderer to be set.

getLineRenderer

public LineRenderer getLineRenderer(DataSource s)
Returns the LineRenderer for the specified DataSource.

Parameters:
s - DataSource.
Returns:
LineRenderer.

setLineRenderer

public void setLineRenderer(DataSource s,
                            LineRenderer lineRenderer)
Sets the LineRenderer for a certain DataSource to the specified value.

Parameters:
s - DataSource.
lineRenderer - LineRenderer to be set.

getAreaRenderer

public AreaRenderer getAreaRenderer(DataSource s)
Returns the AreaRenderer for the specified DataSource.

Parameters:
s - DataSource.
Returns:
AreaRenderer.

setAreaRenderer

public void setAreaRenderer(DataSource s,
                            AreaRenderer areaRenderer)
Sets the AreaRenderer for a certain DataSource to the specified value.

Parameters:
s - DataSource.
areaRenderer - AreaRenderer to be set.

setAxisRenderer

public void setAxisRenderer(Axis axis,
                            AxisRenderer renderer)
Description copied from class: Plot
Sets the renderer for the specified axis.

Overrides:
setAxisRenderer in class Plot
Parameters:
axis - Axis to be rendered.
renderer - Instance to render the axis.

refresh

public void refresh()
Description copied from class: Plot
Causes the plot data to be be updated.

Overrides:
refresh in class Plot


Copyright © 2009-2010. All Rights Reserved.