edu.neu.ccs.gui
Class PlotMarkAlgorithm

java.lang.Object
  |
  +--edu.neu.ccs.gui.PlotMarkAlgorithm

public abstract class PlotMarkAlgorithm
extends Object

Class PlotMarkAlgorithm defines the requirements for an algorithm that will produce a scalable shape defined in the neighborhood of a given point. This class is intended to be used in constructors for the class PlotMark.

This class provides several static instances of itself.

Since:
2.4.0

Field Summary
static PlotMarkAlgorithm Asterisk
          The asterisk algorithm.
static PlotMarkAlgorithm BluntWedgeE
          The blunt-wedge-facing-east algorithm.
static PlotMarkAlgorithm BluntWedgeN
          The blunt-wedge-facing-north algorithm.
static PlotMarkAlgorithm BluntWedgeS
          The blunt-wedge-facing-south algorithm.
static PlotMarkAlgorithm BluntWedgeW
          The blunt-wedge-facing-west algorithm.
static PlotMarkAlgorithm Circle
          The circle algorithm.
static PlotMarkAlgorithm Cross
          The cross sign algorithm.
static PlotMarkAlgorithm Diamond
          The diamond algorithm.
static PlotMarkAlgorithm HBar
          The horizontal bar algorithm.
static PlotMarkAlgorithm Plus
          The plus sign algorithm.
static PlotMarkAlgorithm SharpWedgeE
          The sharp-wedge-facing-east algorithm.
static PlotMarkAlgorithm SharpWedgeN
          The sharp-wedge-facing-north algorithm.
static PlotMarkAlgorithm SharpWedgeS
          The sharp-wedge-facing-south algorithm.
static PlotMarkAlgorithm SharpWedgeW
          The sharp-wedge-facing-west algorithm.
static PlotMarkAlgorithm Square
          The square algorithm.
static PlotMarkAlgorithm VBar
          The vertical bar algorithm.
static PlotMarkAlgorithm WedgeE
          The wedge-facing-east algorithm.
static PlotMarkAlgorithm WedgeN
          The wedge-facing-north algorithm.
static PlotMarkAlgorithm WedgeS
          The wedge-facing-south algorithm.
static PlotMarkAlgorithm WedgeW
          The wedge-facing-west algorithm.
 
Constructor Summary
PlotMarkAlgorithm()
           
 
Method Summary
abstract  Shape makeShape(double x, double y, int size)
          Returns a shape constructed in the neighborhood of the given point and scaled with the given size.
 Shape makeShape(Point2D p, int size)
          Returns a shape constructed in the neighborhood of the given point and scaled with the given size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HBar

public static final PlotMarkAlgorithm HBar

The horizontal bar algorithm.

Produces the line segment path (x-size,y) to (x+size,y).

When used in a PlotMark, the fill setting should be false.


VBar

public static final PlotMarkAlgorithm VBar

The vertical bar algorithm.

Produces the line segment path (x,y-size) to (x,y+size).

When used in a PlotMark, the fill setting should be false.


Plus

public static final PlotMarkAlgorithm Plus

The plus sign algorithm.

Produces the combined path with 2 line segments:

When used in a PlotMark, the fill setting should be false.


Cross

public static final PlotMarkAlgorithm Cross

The cross sign algorithm.

Produces the combined path with 2 line segments:

When used in a PlotMark, the fill setting should be false.


Asterisk

public static final PlotMarkAlgorithm Asterisk

The asterisk algorithm.

Produces the combined path with 4 line segments:

When used in a PlotMark, the fill setting should be false.


Square

public static final PlotMarkAlgorithm Square

The square algorithm.

Returns new XSquare(x, y, size).


Circle

public static final PlotMarkAlgorithm Circle

The circle algorithm.

Returns new XCircle(x, y, size).


Diamond

public static final PlotMarkAlgorithm Diamond

The diamond algorithm.

Produces the closed path with 4 vertices:


WedgeN

public static final PlotMarkAlgorithm WedgeN

The wedge-facing-north algorithm.

Produces the closed path with 3 vertices:


WedgeE

public static final PlotMarkAlgorithm WedgeE

The wedge-facing-east algorithm.

Produces the closed path with 3 vertices:


WedgeS

public static final PlotMarkAlgorithm WedgeS

The wedge-facing-south algorithm.

Produces the closed path with 3 vertices:


WedgeW

public static final PlotMarkAlgorithm WedgeW

The wedge-facing-west algorithm.

Produces the closed path with 3 vertices:


BluntWedgeN

public static final PlotMarkAlgorithm BluntWedgeN

The blunt-wedge-facing-north algorithm.

Produces the closed path with 3 vertices:


BluntWedgeE

public static final PlotMarkAlgorithm BluntWedgeE

The blunt-wedge-facing-east algorithm.

Produces the closed path with 3 vertices:


BluntWedgeS

public static final PlotMarkAlgorithm BluntWedgeS

The blunt-wedge-facing-south algorithm.

Produces the closed path with 3 vertices:


BluntWedgeW

public static final PlotMarkAlgorithm BluntWedgeW

The blunt-wedge-facing-west algorithm.

Produces the closed path with 3 vertices:


SharpWedgeN

public static final PlotMarkAlgorithm SharpWedgeN

The sharp-wedge-facing-north algorithm.

Produces the closed path with 3 vertices:


SharpWedgeE

public static final PlotMarkAlgorithm SharpWedgeE

The sharp-wedge-facing-east algorithm.

Produces the closed path with 3 vertices:


SharpWedgeS

public static final PlotMarkAlgorithm SharpWedgeS

The sharp-wedge-facing-south algorithm.

Produces the closed path with 3 vertices:


SharpWedgeW

public static final PlotMarkAlgorithm SharpWedgeW

The sharp-wedge-facing-west algorithm.

Produces the closed path with 3 vertices:

Constructor Detail

PlotMarkAlgorithm

public PlotMarkAlgorithm()
Method Detail

makeShape

public final Shape makeShape(Point2D p,
                             int size)

Returns a shape constructed in the neighborhood of the given point and scaled with the given size.

If the given point is null, returns an empty shape.

Otherwise calls makeShape(double, double, int).

Parameters:
p - the point defining where to place the shape
size - the scale size

makeShape

public abstract Shape makeShape(double x,
                                double y,
                                int size)

Returns a shape constructed in the neighborhood of the given point and scaled with the given size.

When defined this method may return an empty shape but should not return null.

The scale size should be forced to at least 1 before building the shape.

Parameters:
x - the x-coordinate of the point defining where to place the shape
y - the y-coordinate of the point defining where to place the shape
size - the scale size