Class SpreadSheetRowPointHitDetector

    • Constructor Detail

      • SpreadSheetRowPointHitDetector

        public SpreadSheetRowPointHitDetector​(SpreadSheetRowPanel owner)
        Initializes the hit detector.
        Parameters:
        owner - the panel that uses this detector
    • Method Detail

      • getOwner

        public SpreadSheetRowPanel getOwner()
        Returns the owner.
        Returns:
        the owning panel
      • findEnclosingAttributeIndices

        protected int[] findEnclosingAttributeIndices​(SpreadSheetRow row,
                                                      double x)
        Determines the enclosing attribute indices for the given x value. If the given x happens to be an exact point, then this points will be stored at index 0. If no index could be determined, then -1 will be stored.
        Parameters:
        row - the underlying row
        x - the x on the plot
        Returns:
        the indices
      • findClosestAttributeIndex

        protected int findClosestAttributeIndex​(SpreadSheetRow row,
                                                double x)
        Returns the closest attribute index for the given x.
        Parameters:
        row - the underlying Row
        x - the x to get the index for
        Returns:
        the index
      • findSpreadSheetRowPoint

        protected SpreadSheetRowPoint findSpreadSheetRowPoint​(SpreadSheetRow inst,
                                                              int index)
        Returns the Row point at the specified position.
        Parameters:
        inst - the Row data structure to search
        index - the attribute index (original dataset)
        Returns:
        the RowPoint, null if not found