Record Class ScrollFacet

java.lang.Object
java.lang.Record
limn.accessibility.ScrollFacet
Record Components:
horizontalPercent - where the viewport sits along the content's width, in 0..1
verticalPercent - where it sits along the content's height, in 0..1
horizontalViewSize - the fraction of the content's width the viewport shows
verticalViewSize - the fraction of its height the viewport shows
horizontallyScrollable - whether the content is wider than the viewport
verticallyScrollable - whether it is taller

public record ScrollFacet(double horizontalPercent, double verticalPercent, double horizontalViewSize, double verticalViewSize, boolean horizontallyScrollable, boolean verticallyScrollable) extends Record
A node that scrolls its content: a scroll view, a list, a text area, an overflowing strip.

The two percentages are where the viewport sits in the content, from 0 at the start to 1 at the end; the two view sizes are the fraction of the content the viewport shows. An axis that does not scroll reports a percentage of 0 and a view size of 1, which is what every platform reads as "all of it, nowhere to go".

  • Constructor Details

    • ScrollFacet

      public ScrollFacet(double horizontalPercent, double verticalPercent, double horizontalViewSize, double verticalViewSize, boolean horizontallyScrollable, boolean verticallyScrollable)
      Creates an instance of a ScrollFacet record class.
      Parameters:
      horizontalPercent - the value for the horizontalPercent record component
      verticalPercent - the value for the verticalPercent record component
      horizontalViewSize - the value for the horizontalViewSize record component
      verticalViewSize - the value for the verticalViewSize record component
      horizontallyScrollable - the value for the horizontallyScrollable record component
      verticallyScrollable - the value for the verticallyScrollable record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • horizontalPercent

      public double horizontalPercent()
      Returns the value of the horizontalPercent record component.
      Returns:
      the value of the horizontalPercent record component
    • verticalPercent

      public double verticalPercent()
      Returns the value of the verticalPercent record component.
      Returns:
      the value of the verticalPercent record component
    • horizontalViewSize

      public double horizontalViewSize()
      Returns the value of the horizontalViewSize record component.
      Returns:
      the value of the horizontalViewSize record component
    • verticalViewSize

      public double verticalViewSize()
      Returns the value of the verticalViewSize record component.
      Returns:
      the value of the verticalViewSize record component
    • horizontallyScrollable

      public boolean horizontallyScrollable()
      Returns the value of the horizontallyScrollable record component.
      Returns:
      the value of the horizontallyScrollable record component
    • verticallyScrollable

      public boolean verticallyScrollable()
      Returns the value of the verticallyScrollable record component.
      Returns:
      the value of the verticallyScrollable record component