Class PointSelectionEvent

  • All Implemented Interfaces:
    java.io.Serializable

    public class PointSelectionEvent
    extends java.util.EventObject
    Describes the result of an attempt to select a data point on a plot. This is usually the result of a user click action.
    Since:
    21 Nov 2014
    Author:
    Mark Taylor
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      PointSelectionEvent​(java.lang.Object source, java.awt.Point point, int isurf, long[] closestRows)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long[] getClosestRows()
      Returns an array of row indices, one for each plotted layer.
      java.awt.Point getPoint()
      Returns the point indicated by the user.
      int getSurfaceIndex()
      Returns the index of the surface to which this event applies.
      • Methods inherited from class java.util.EventObject

        getSource, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PointSelectionEvent

        public PointSelectionEvent​(java.lang.Object source,
                                   java.awt.Point point,
                                   int isurf,
                                   long[] closestRows)
        Constructor.
        Parameters:
        source - event source
        point - point indicated by the user
        isurf - numeric label of surface to which this event applies
        closestRows - array of dataset row index for each plotted layer
    • Method Detail

      • getPoint

        public java.awt.Point getPoint()
        Returns the point indicated by the user.
        Returns:
        indicated point
      • getSurfaceIndex

        public int getSurfaceIndex()
        Returns the index of the surface to which this event applies.
        Returns:
        numeric label of surface
      • getClosestRows

        public long[] getClosestRows()
        Returns an array of row indices, one for each plotted layer. Each element contains the index of of the data point plotted in the corresponding PlotLayer closest to the indicated graphics position. If that layer contains no data point within a few pixels of the given position, the corresponding value is -1. For layers without data positions, the corresponding value is always -1.

        The close-enough threshold for a point to be included is given by PlotUtil.NEAR_PIXELS (4.0).

        Note the event may represent no successful selections (all elements of the returned array equal to -1).

        Returns:
        array of data point indices, one for each plotted layer