Interface Plotter<S extends Style>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      PlotLayer createLayer​(DataGeom pointDataGeom, DataSpec dataSpec, S style)
      Creates a PlotLayer based on the given geometry, data and style.
      S createStyle​(ConfigMap config)
      Creates a style that can be used when creating a plot layer.
      CoordGroup getCoordGroup()
      Returns an object describing which data coordinates are used for this plotter and how they are arranged in supplied DataSpec objects.
      java.lang.String getPlotterDescription()
      Returns an XML description of this plotter.
      javax.swing.Icon getPlotterIcon()
      Returns an icon for this plotter for use in user interface.
      java.lang.String getPlotterName()
      Returns the name of this plotter for use in user interface.
      java.lang.Object getRangeStyleKey​(S style)
      Returns an opaque object characterising the region of the plot surface covered when using a given plotter style.
      ConfigKey<?>[] getStyleKeys()
      Returns the configuration keys used to configure style for this plotter.
      boolean hasReports()
      Indicates whether the drawings produced by this plotter will return general interest report information to upstream plotting code.
    • Method Detail

      • getPlotterName

        java.lang.String getPlotterName()
        Returns the name of this plotter for use in user interface.
        Returns:
        user-directed plotter name
      • getPlotterIcon

        javax.swing.Icon getPlotterIcon()
        Returns an icon for this plotter for use in user interface.
        Returns:
        plotter icon
      • getPlotterDescription

        java.lang.String getPlotterDescription()
        Returns an XML description of this plotter.

        Note: really this should appear at the LayerType level.

        Returns:
        one or more <p> elements
      • getCoordGroup

        CoordGroup getCoordGroup()
        Returns an object describing which data coordinates are used for this plotter and how they are arranged in supplied DataSpec objects.
        Returns:
        coordinate group
      • hasReports

        boolean hasReports()
        Indicates whether the drawings produced by this plotter will return general interest report information to upstream plotting code.
        Returns:
        true if the plot report may return interesting information
        See Also:
        Drawing.getReport(java.lang.Object)
      • getRangeStyleKey

        @Equality
        java.lang.Object getRangeStyleKey​(S style)
        Returns an opaque object characterising the region of the plot surface covered when using a given plotter style. If this object changes between layers produced by this plotter, it provides a hint that it may be necessary to redetermine the axis ranges (using extendCoordinateRanges).

        In many cases, such as scatter-plot-like plotters, the range is determined only by the coordinate data (managed by DataSpec inputs) so a null value may be returned. This method is chiefly required by histogram-like plotters for which the region on the plot surface is not the union of the input positions.

        Parameters:
        style - plot style to assess
        Returns:
        opaque object with equality semantics, or null if axis range is not a function of style
      • createLayer

        PlotLayer createLayer​(DataGeom pointDataGeom,
                              DataSpec dataSpec,
                              S style)
        Creates a PlotLayer based on the given geometry, data and style.

        The style parameter is the result of a call to createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap).

        The dataSpec parameter must contain the coordinates defined by this plotter's CoordGroup.

        The pointDataGeom parameter is only used if getCoordGroup(). getPositionCount returns a non-zero value, otherwise the plot does not have point positions.

        It is legal to supply null for any of the parameters; if insufficient data is supplied to generate a plot, then the method should return null.

        Creating a layer should be cheap; layers may be created and not used.

        Parameters:
        pointDataGeom - indicates base position coordinates and their mapping to points in the data space; if non-null, the data geom's DataGeom.hasPosition() method will return true
        dataSpec - specifies the data required for the plot
        style - data style as obtained from createStyle
        Returns:
        new plot layer, or null if no drawing will take place