uk.ac.starlink.topcat.plot2
Enum PolygonMode

java.lang.Object
  extended by java.lang.Enum<PolygonMode>
      extended by uk.ac.starlink.topcat.plot2.PolygonMode
All Implemented Interfaces:
Serializable, Comparable<PolygonMode>

public enum PolygonMode
extends Enum<PolygonMode>

Defines how an area is constructed from a user-supplied set of vertices on a 2d graphics surface.

Since:
14 Sep 2018
Author:
Mark Taylor

Enum Constant Summary
ABOVE
          Area above a line formed by joining points.
BELOW
          Area below a line formed by joining points.
INSIDE
          Area within the polygon bounded by (at least 3) points.
LEFT
          Area to the left of a line formed by joining points.
OUTSIDE
          Area outside the polygon bounded by (at least 3) points.
RIGHT
          Area to the right of a line formed by joining points.
 
Method Summary
abstract  Area createArea(Rectangle bounds, Point[] points)
          Returns a drawable shape representing the area defined by a set of user-specified graphics points.
abstract  String createExpression(uk.ac.starlink.ttools.plot2.geom.PlanarSurface surface, Point[] points, String xvar, String yvar)
          Returns an algebraic (JEL) expression defining the area in data space defined by a set of user-specified graphics points.
static PolygonMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PolygonMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSIDE

public static final PolygonMode INSIDE
Area within the polygon bounded by (at least 3) points.


OUTSIDE

public static final PolygonMode OUTSIDE
Area outside the polygon bounded by (at least 3) points.


BELOW

public static final PolygonMode BELOW
Area below a line formed by joining points.


ABOVE

public static final PolygonMode ABOVE
Area above a line formed by joining points.


LEFT

public static final PolygonMode LEFT
Area to the left of a line formed by joining points.


RIGHT

public static final PolygonMode RIGHT
Area to the right of a line formed by joining points.

Method Detail

values

public static PolygonMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PolygonMode c : PolygonMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PolygonMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

createArea

public abstract Area createArea(Rectangle bounds,
                                Point[] points)
Returns a drawable shape representing the area defined by a set of user-specified graphics points. The shape does not necessarily extend beyond the supplied bounding rectangle. If the points are not appropriate or sufficient to define a polygon of this type, null is returned.

Parameters:
bounds - bounds of graphics space on which the area will be drawn
points - vertices in graphics space defining the polygon
Returns:
inclusion shape, or null

createExpression

public abstract String createExpression(uk.ac.starlink.ttools.plot2.geom.PlanarSurface surface,
                                        Point[] points,
                                        String xvar,
                                        String yvar)
Returns an algebraic (JEL) expression defining the area in data space defined by a set of user-specified graphics points. If the points are not appropriate or sufficient to define a polygon of this type, null is returned.

Parameters:
surface - plotting surface
points - vertices in graphics space defining the polygon
xvar - JEL-friendly expression naming the X coordinate
yvar - JEL-friendly expression naming the Y coordinate
Returns:
boolean JEL inclusion expression, or null


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.