optics.graphics
Class Spot

java.lang.Object
  extended by javax.vecmath.Tuple2d
      extended by javax.vecmath.Point2d
          extended by optics.graphics.Spot
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Spot
extends javax.vecmath.Point2d

Class to implement a coloured Spot for the Spot Panel.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.vecmath.Tuple2d
x, y
 
Constructor Summary
Spot(double x, double y)
          Form a spot of default colour
Spot(double x, double y, java.awt.Color c)
          Constructor to create a spot specifying position and color.
Spot(double x, double y, double lambda)
          Form a spot with colour specifed by wavelength
Spot(javax.vecmath.Point2d p)
          Constructor to create a spot of default colour
Spot(javax.vecmath.Point2d p, java.awt.Color c)
          Constructor to creats a spot of specific position and colour.
Spot(javax.vecmath.Point2d p, double lambda)
          Form a spot with colour specifed by wavelength
 
Method Summary
 java.awt.Color getColour()
          Method to get the color
 void setColour(java.awt.Color c)
          Method to set the color
static void setDefaultColour(java.awt.Color c)
          Method to set the default spot colour
 
Methods inherited from class javax.vecmath.Point2d
distance, distanceL1, distanceLinf, distanceSquared
 
Methods inherited from class javax.vecmath.Tuple2d
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, getX, getY, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, setX, setY, sub, sub, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Spot

public Spot(javax.vecmath.Point2d p,
            java.awt.Color c)
Constructor to creats a spot of specific position and colour.

Parameters:
p - the point
c - the colour

Spot

public Spot(double x,
            double y,
            java.awt.Color c)
Constructor to create a spot specifying position and color.

Parameters:
x - the x position
y - the y position
c - the colour

Spot

public Spot(javax.vecmath.Point2d p)
Constructor to create a spot of default colour

Parameters:
p - the position.

Spot

public Spot(double x,
            double y)
Form a spot of default colour

Parameters:
x - the x position.
y - the y position.
See Also:
Colour.SpotColour, setDefaultColour(java.awt.Color)

Spot

public Spot(double x,
            double y,
            double lambda)
Form a spot with colour specifed by wavelength

Parameters:
x - the x location
y - the y location
lambda - the wavelength
See Also:
Colour.WavelengthColour(double)

Spot

public Spot(javax.vecmath.Point2d p,
            double lambda)
Form a spot with colour specifed by wavelength

Parameters:
p - the Spot location.
lambda - the wavelength
See Also:
Colour.WavelengthColour(double)
Method Detail

setDefaultColour

public static void setDefaultColour(java.awt.Color c)
Method to set the default spot colour


setColour

public void setColour(java.awt.Color c)
Method to set the color

Parameters:
c - the color

getColour

public java.awt.Color getColour()
Method to get the color

Returns:
Color the color