Class PolygonOutliner

  • All Implemented Interfaces:
    Outliner

    public class PolygonOutliner
    extends PixOutliner
    Outliner implementations for plotting shapes defined by listing three or more vertices in data space. There are lots of implementation details hidden in this class, but external users should just need the public static factory methods.
    Since:
    5 Mar 2019
    Author:
    Mark Taylor
    • Field Detail

      • MINSIZE_KEY

        public static final ConfigKey<java.lang.Integer> MINSIZE_KEY
        Config key for the replacement marker threshold size.
      • MINSHAPE_KEY

        public static final ConfigKey<MarkerShape> MINSHAPE_KEY
        Config key for the replacement marker shape.
    • Method Detail

      • getLegendIcon

        public javax.swing.Icon getLegendIcon()
        Description copied from interface: Outliner
        Returns an icon suitable for identifying points painted by this object in a plot legend. The returned icon does not manipulate the colour of the graphics context it operates on.
        Returns:
        legend icon for this outliner
      • getAuxRangers

        public java.util.Map<AuxScale,​AuxReader> getAuxRangers​(DataGeom geom)
        Description copied from interface: Outliner
        Defines what non-axis ranging information is required by this outliner. The return value is a map in which the keys define the ranges that must be supplied to the painting methods, and the values are reader objects that can acquire these ranges from a dataset.
        Parameters:
        geom - data geometry
        Returns:
        map of required scale keys to scale reader objects
      • canPaint

        public boolean canPaint​(DataSpec dataSpec)
        Description copied from interface: Outliner
        Indicates whether this outliner is willing to provide painters for a given DataSpec. The return value may be unconditionally true, but this method provides a hook for outliners to reject plotting based only on characteristics of the DataSpec.
        Parameters:
        dataSpec - data specification for plot
        Returns:
        true if dataSpec can be used to obtain a non-null painter
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • createFixedOutliner

        public static PolygonOutliner createFixedOutliner​(int np,
                                                          PolygonShape polyShape,
                                                          int minSize,
                                                          MarkerShape minShape)
        Returns an outliner for polygons with a fixed number of vertices.
        Parameters:
        np - number of vertices
        polyShape - polygon painter
        minSize - threshold size for replacement markers
        minShape - shape for replacement markers
        Returns:
        outliner
      • createPlaneAreaOutliner

        public static PolygonOutliner createPlaneAreaOutliner​(AreaCoord<PlaneDataGeom> coord,
                                                              int icArea,
                                                              PolygonShape polyShape,
                                                              int minSize,
                                                              MarkerShape minShape)
        Returns an outliner for drawing Area objects to a Plane plot.
        Parameters:
        coord - coordinate for reading area objects
        icArea - coordinate index in tuple for area coordinate
        polyShape - polygon painter
        minSize - threshold size for replacement markers
        minShape - shape for replacement markers
        Returns:
        outliner
      • createSkyAreaOutliner

        public static PolygonOutliner createSkyAreaOutliner​(AreaCoord<SkyDataGeom> coord,
                                                            int icArea,
                                                            PolygonShape polyShape,
                                                            int minSize,
                                                            MarkerShape minShape)
        Returns an outliner for drawing Area objects to a Sky plot.
        Parameters:
        coord - coordinate for reading area objects
        icArea - coordinate index in tuple for area coordinate
        polyShape - polygon painter
        minSize - threshold size for replacement markers
        minShape - shape for replacement markers
        Returns:
        outliner
      • createSphereAreaOutliner

        public static PolygonOutliner createSphereAreaOutliner​(AreaCoord<SphereDataGeom> areaCoord,
                                                               int icArea,
                                                               FloatingCoord radialCoord,
                                                               int icRadial,
                                                               PolygonShape polyShape,
                                                               int minSize,
                                                               MarkerShape minShape)
        Returns an outliner for drawing Area objects to a Sphere plot.
        Parameters:
        areaCoord - coordinate for reading area objects
        icArea - coordinate index in tuple for area coordinate
        radialCoord - coordinate for reading radial distance of area
        icRadial - coordinate index in tuple for radial coordinate
        polyShape - polygon painter
        minSize - threshold size for replacement markers
        minShape - shape for replacement markers
        Returns:
        outliner
      • createArrayOutliner

        public static PolygonOutliner createArrayOutliner​(FloatingArrayCoord arrayCoord,
                                                          boolean includePos,
                                                          PolygonShape polyShape)
        Returns an outliner for polygons defined by an array-valued coordinate providing interleaved coordinates in user data space. Each array instance may be of length N*D, where D is the number of coordinates per point in user space. For instance a triangle in plane coordinates would be (x1,y1, x2,y2, x3,y3), and in sky coordinates (lon1,lat1, lon2,lat2, lon3,lat3).
        Parameters:
        arrayCoord - array-valued coordinate
        includePos - if true, positional coordinate is included as the first vertex, if false it is ignored
        polyShape - polygon painter
        Returns:
        outliner