Interface SpannedRenderer<N extends Number>

All Known Implementing Classes:
RangeCursorTableHeaderRenderer, SpanSetTableCellRenderer, SpanTableCellRenderer

public interface SpannedRenderer<N extends Number>
  • Method Details

    • validateViewRange

      static SpannedRenderer.DoubleSpan validateViewRange(Span<? extends Number,?> fullSpan)
      Validate the given span and convert its endpoints to doubles
      Parameters:
      fullSpan - the span to validate
      Returns:
      the converted span
    • setFullRange

      void setFullRange(Span<N,?> fullRange)
      Set the span of the viewport
      Parameters:
      fullRange - the span
    • getFullRange

      Span<N,?> getFullRange()
      Get the span of the viewport
      Returns:
      the span
    • getFullRangeDouble

      Span<Double,?> getFullRangeDouble()
      Get the span of the viewport with double endpoints
      Returns:
      the span
    • getSpan

      double getSpan()
      Get the length of the span
      Returns:
      the length
    • interpolate

      default int interpolate(int w, double val)
      Compute the horizontal pixel position of the given value

      This interpolates the given value linearly mapping it to a pixel. Pixel 0 is at the full span's lower endpoint and pixel w is at the full span's upper endpoint. If the given value falls outside the full span, it is clamped.

      Parameters:
      w - the width of the viewport in pixels, i.e., getWidth()
      val - the value as in the span's domain, but as a double
      Returns:
      the horizontal pixel
    • getWidth

      int getWidth()
      Get the width of the renderer
      Returns:
      the width
      Implementation Notes:
      this is often implemented by inheriting Component.getWidth()
    • getHeight

      int getHeight()
      Get the height of the renderer
      Returns:
      the height
      Implementation Notes:
      this is often implemented by inheriting Component.getHeight()
    • paintRange

      default void paintRange(Graphics g, Span<N,?> range)
      Paint a given span
      Parameters:
      g - the graphics, bound to a component
      range - the span