edu.neu.ccs.gui
Class PlotMark

java.lang.Object
  |
  +--edu.neu.ccs.gui.PlotMark
All Implemented Interfaces:
Cloneable, Serializable

public class PlotMark
extends Object
implements Cloneable, Serializable

Helper class for drawing geometric shapes or marks at a specified point in a graphics context.

Since:
1.0
See Also:
Serialized Form

Field Summary
static int ASTERISK
          Value designating an ASTERISK.
protected  Ellipse2D.Double circle
          Helper for circle computation.
static int CIRCLE
          Value designating a circle.
static int CROSS
          Value designating a CROSS.
protected  Stroke currentStroke
          Helper to save the current stroke.
static int DIAMOND
          Value designating a diamond.
static int FILLED
          Value designating a filled shape.
static int FILLED_CIRCLE
          Value designating a filled circle.
static int FILLED_DIAMOND
          Value designating a filled diamond.
static int FILLED_SQUARE
          Value designating a filled square.
static int FILLED_WEDGE_E
          Value designating a filled wedge facing East.
static int FILLED_WEDGE_N
          Value designating a filled wedge facing North.
static int FILLED_WEDGE_S
          Value designating a filled wedge facing South.
static int FILLED_WEDGE_W
          Value designating a filled wedge facing West.
protected  Graphics2D G
          Reference to the graphics context for marking.
static int H_BAR
          Value designating a Horizontal Bar.
protected  Line2D.Double line
          Helper for line computation.
protected  int markSize
          Size for mark to be drawn.
protected  int markValue
          Value designating the mark to be drawn.
protected  Point2D.Double P
          Reference to the point to mark.
static int PLUS
          Value designating a PLUS.
protected  GeneralPath shape
          Helper for shapes.
protected  Rectangle2D.Double square
          Helper for square computation.
static int SQUARE
          Value designating a square.
protected  BasicStroke stroke
          Helper for strokes of thickness 1.
static int V_BAR
          Value designating a Vertical Bar.
static int WEDGE_E
          Value designating a wedge facing East.
static int WEDGE_N
          Value designating a wedge facing North.
static int WEDGE_S
          Value designating a wedge facing South.
static int WEDGE_W
          Value designating a wedge facing West.
 
Constructor Summary
PlotMark()
          Constructs a helper object using the default mark value and size.
PlotMark(int value)
          Constructs a helper object using the given mark value.
PlotMark(int value, int size)
          Constructs a helper object using the given mark value and size.
 
Method Summary
 int getMarkSize()
          Returns the mark size for this helper object.
 int getMarkValue()
          Returns the mark value for this helper object.
 void mark(Graphics2D g, Point2D.Double p)
          Marks the given point in the provided graphics context.
 PlotMark setMarkSize(int size)
          Sets the mark size to the given size
 PlotMark setMarkValue(int value)
          Sets the mark value to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

V_BAR

public static final int V_BAR
Value designating a Vertical Bar.

See Also:
Constant Field Values

H_BAR

public static final int H_BAR
Value designating a Horizontal Bar.

See Also:
Constant Field Values

PLUS

public static final int PLUS
Value designating a PLUS.

See Also:
Constant Field Values

CROSS

public static final int CROSS
Value designating a CROSS.

See Also:
Constant Field Values

ASTERISK

public static final int ASTERISK
Value designating an ASTERISK.

See Also:
Constant Field Values

SQUARE

public static final int SQUARE
Value designating a square.

See Also:
Constant Field Values

CIRCLE

public static final int CIRCLE
Value designating a circle.

See Also:
Constant Field Values

DIAMOND

public static final int DIAMOND
Value designating a diamond.

See Also:
Constant Field Values

WEDGE_N

public static final int WEDGE_N
Value designating a wedge facing North.

See Also:
Constant Field Values

WEDGE_E

public static final int WEDGE_E
Value designating a wedge facing East.

See Also:
Constant Field Values

WEDGE_S

public static final int WEDGE_S
Value designating a wedge facing South.

See Also:
Constant Field Values

WEDGE_W

public static final int WEDGE_W
Value designating a wedge facing West.

See Also:
Constant Field Values

FILLED

public static final int FILLED
Value designating a filled shape.

See Also:
Constant Field Values

FILLED_SQUARE

public static final int FILLED_SQUARE
Value designating a filled square.

See Also:
Constant Field Values

FILLED_CIRCLE

public static final int FILLED_CIRCLE
Value designating a filled circle.

See Also:
Constant Field Values

FILLED_DIAMOND

public static final int FILLED_DIAMOND
Value designating a filled diamond.

See Also:
Constant Field Values

FILLED_WEDGE_N

public static final int FILLED_WEDGE_N
Value designating a filled wedge facing North.

See Also:
Constant Field Values

FILLED_WEDGE_E

public static final int FILLED_WEDGE_E
Value designating a filled wedge facing East.

See Also:
Constant Field Values

FILLED_WEDGE_S

public static final int FILLED_WEDGE_S
Value designating a filled wedge facing South.

See Also:
Constant Field Values

FILLED_WEDGE_W

public static final int FILLED_WEDGE_W
Value designating a filled wedge facing West.

See Also:
Constant Field Values

markValue

protected int markValue
Value designating the mark to be drawn.


markSize

protected int markSize
Size for mark to be drawn.


G

protected Graphics2D G
Reference to the graphics context for marking.


P

protected Point2D.Double P
Reference to the point to mark.


currentStroke

protected transient Stroke currentStroke
Helper to save the current stroke.


line

protected transient Line2D.Double line
Helper for line computation.


square

protected transient Rectangle2D.Double square
Helper for square computation.


circle

protected transient Ellipse2D.Double circle
Helper for circle computation.


shape

protected transient GeneralPath shape
Helper for shapes.


stroke

protected transient BasicStroke stroke
Helper for strokes of thickness 1.

Constructor Detail

PlotMark

public PlotMark()
Constructs a helper object using the default mark value and size.

See Also:
PlotMark(int), PlotMark(int, int)

PlotMark

public PlotMark(int value)
Constructs a helper object using the given mark value.

Parameters:
value - the mark value to be used
See Also:
PlotMark(), PlotMark(int, int)

PlotMark

public PlotMark(int value,
                int size)
Constructs a helper object using the given mark value and size.

Parameters:
value - the mark value to be used
size - the size for a mark
See Also:
PlotMark(), PlotMark(int)
Method Detail

setMarkValue

public PlotMark setMarkValue(int value)
Sets the mark value to the given value.

Parameters:
value - the mark value to be used
Returns:
a reference to this helper object
See Also:
getMarkValue(), setMarkSize(int)

setMarkSize

public PlotMark setMarkSize(int size)
Sets the mark size to the given size

Parameters:
size - the size for a mark
Returns:
a reference to this helper object
See Also:
getMarkSize(), setMarkValue(int)

getMarkValue

public int getMarkValue()
Returns the mark value for this helper object.

See Also:
setMarkValue(int), getMarkSize()

getMarkSize

public int getMarkSize()
Returns the mark size for this helper object.

See Also:
setMarkSize(int), getMarkValue()

mark

public void mark(Graphics2D g,
                 Point2D.Double p)
Marks the given point in the provided graphics context.

Parameters:
g - the graphics context to mark
p - the point at which to draw the mark