net.talvi.puffinplot.plots
Class EqAreaPlot

java.lang.Object
  extended by net.talvi.puffinplot.plots.Plot
      extended by net.talvi.puffinplot.plots.EqAreaPlot
Direct Known Subclasses:
AmsPlot, SampleEqAreaPlot, SeparateSuiteEaPlot, SiteEqAreaPlot, SuiteEqAreaPlot

public abstract class EqAreaPlot
extends Plot

An abstract superclass for Lambert azimuthal equal-area plots. It provides various facilities to simplify the drawing of an equal-area plot, including projection of the data points and drawing of the axes.


Field Summary
protected  java.awt.Graphics2D g
          The graphics object to which to draw the plot.
protected  int radius
          The radius of the projection.
protected  int xo
          The x co-ordinate of the projection's origin.
protected  int yo
          The y co-ordinate of the projection's origin.
 
Fields inherited from class net.talvi.puffinplot.plots.Plot
DEFAULT_PLOT_POSITIONS, dimensions, params, PLOT_POINT_SIZE
 
Constructor Summary
protected EqAreaPlot(GraphDisplay parent, PlotParams params, java.util.prefs.Preferences prefs)
          Creates a new equal-area plot with the supplies parameters.
protected EqAreaPlot(GraphDisplay parent, PlotParams params, java.util.prefs.Preferences prefs, boolean taperingEnabled)
          Creates a new equal-area plot with the supplies parameters.
 
Method Summary
protected  void drawAxes()
          Draws the axes of the plot.
protected  void drawGreatCircle(Vec3 pole, boolean drawPole)
          Projects and draws a great circle
protected  void drawGreatCircleSegment(Vec3 v0, Vec3 v1)
          Draws the projection of a specified great-circle segment.
protected  void drawGreatCircleSegment(Vec3 v0, Vec3 v1, Vec3 dir)
          Draws the projection of a specified great-circle segment.
protected  void drawLineSegments(java.util.List<Vec3> vs)
          Projects and draws the supplied vectors.
 boolean isTaperingEnabled()
          Reports whether tapered lines are enabled for this plot.
protected  java.awt.geom.Point2D.Double project(Vec3 v)
          Projects the direction of a three-dimensional vector into plot co-ordinates.
protected  void updatePlotDimensions(java.awt.Graphics2D g)
          Sets the fields g, radius, xo, and yo according to the supplied argument and the current plot dimensions.
protected  java.awt.geom.GeneralPath vectorsToPath(java.util.List<Vec3> vectors)
          Projects a list of three-dimensional vectors into a two-dimensional path in the current plot co-ordinates.
 
Methods inherited from class net.talvi.puffinplot.plots.Plot
addPoint, addSampleClickListener, applyTextAttributes, clearPoints, cropRectangle, draw, drawPoints, getDashedStroke, getDimensions, getDimensionsAsString, getFontSize, getMargin, getName, getNiceName, getStroke, getTextAttributes, getTickLength, getUnitSize, isVisible, mouseClicked, removeSampleClickListener, selectByRectangle, setDimensions, setDimensionsToDefault, setVisible, timesTenToThe, timesTenToThe, writeString, writeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

g

protected java.awt.Graphics2D g
The graphics object to which to draw the plot. It is set by updatePlotDimensions(Graphics2D).


xo

protected int xo
The x co-ordinate of the projection's origin. It is set by updatePlotDimensions(Graphics2D).


yo

protected int yo
The y co-ordinate of the projection's origin. It is set by updatePlotDimensions(Graphics2D).


radius

protected int radius
The radius of the projection. It is set by updatePlotDimensions(Graphics2D).

Constructor Detail

EqAreaPlot

protected EqAreaPlot(GraphDisplay parent,
                     PlotParams params,
                     java.util.prefs.Preferences prefs,
                     boolean taperingEnabled)
Creates a new equal-area plot with the supplies parameters.

Parameters:
parent - the graph display containing the plot
params - the plot parameters
prefs - the preferences containing the plot configuration
taperingEnabled - true to taper plotted lines according to z position

EqAreaPlot

protected EqAreaPlot(GraphDisplay parent,
                     PlotParams params,
                     java.util.prefs.Preferences prefs)
Creates a new equal-area plot with the supplies parameters. Plotted lines will not be tapered.

Parameters:
parent - the graph display containing the plot
params - the plot parameters
prefs - the preferences containing the plot configuration
Method Detail

updatePlotDimensions

protected void updatePlotDimensions(java.awt.Graphics2D g)
Sets the fields g, radius, xo, and yo according to the supplied argument and the current plot dimensions. This method should be called before redrawing the plot.

Parameters:
g - the field g will be set to this value

drawAxes

protected void drawAxes()
Draws the axes of the plot.


vectorsToPath

protected java.awt.geom.GeneralPath vectorsToPath(java.util.List<Vec3> vectors)
Projects a list of three-dimensional vectors into a two-dimensional path in the current plot co-ordinates.

Parameters:
vectors - the vectors to project
Returns:
a path containing the projected vectors

drawLineSegments

protected void drawLineSegments(java.util.List<Vec3> vs)
Projects and draws the supplied vectors.

Parameters:
vs - the vectors to draw

drawGreatCircleSegment

protected void drawGreatCircleSegment(Vec3 v0,
                                      Vec3 v1)
Draws the projection of a specified great-circle segment. The shorter of the two possible paths will be drawn.

Parameters:
v0 - one end of a great-circle segment
v1 - the other end of a great-circle segment

drawGreatCircleSegment

protected void drawGreatCircleSegment(Vec3 v0,
                                      Vec3 v1,
                                      Vec3 dir)
Draws the projection of a specified great-circle segment. Of the two possible paths, the one passing closer to the supplied vector dir will be drawn.

Parameters:
v0 - one end of a great-circle segment
v1 - the other end of a great-circle segment
dir - vector used to choose which path to draw

drawGreatCircle

protected void drawGreatCircle(Vec3 pole,
                               boolean drawPole)
Projects and draws a great circle

Parameters:
pole - the pole to the great circle which is to be drawn
drawPole - true to mark the pole on the plot

project

protected java.awt.geom.Point2D.Double project(Vec3 v)
Projects the direction of a three-dimensional vector into plot co-ordinates.

Parameters:
v - a vector
Returns:
the projection of the supplied vector onto this plot

isTaperingEnabled

public boolean isTaperingEnabled()
Reports whether tapered lines are enabled for this plot.

Returns:
true if tapered lines are enabled for this plot