Enum PolygonMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PolygonMode>

    public enum PolygonMode
    extends java.lang.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

      Enum Constants 
      Enum Constant Description
      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

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.awt.geom.Area createArea​(java.awt.Rectangle bounds, java.awt.Point[] points)
      Returns a drawable shape representing the area defined by a set of user-specified graphics points.
      abstract java.lang.String createExpression​(uk.ac.starlink.ttools.plot2.geom.PlanarSurface surface, java.awt.Point[] points, java.lang.String xvar, java.lang.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​(java.lang.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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • createArea

        public abstract java.awt.geom.Area createArea​(java.awt.Rectangle bounds,
                                                      java.awt.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 java.lang.String createExpression​(uk.ac.starlink.ttools.plot2.geom.PlanarSurface surface,
                                                          java.awt.Point[] points,
                                                          java.lang.String xvar,
                                                          java.lang.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