Record Class TooltipConfig

java.lang.Object
java.lang.Record
com.dua3.utility.fx.controls.TooltipConfig
Record Components:
showDelay - the delay before a tooltip is shown after the pointer enters the node
showDuration - how long the tooltip is shown
hideDelay - the delay before the tooltip is hidden when the pointer is moved outside the node

public record TooltipConfig(Duration showDelay, Duration showDuration, Duration hideDelay) extends Record
A record holding tooltip durations.
  • Constructor Details

    • TooltipConfig

      public TooltipConfig(Duration showDelay, Duration showDuration, Duration hideDelay)
      Creates an instance of a TooltipConfig record class.
      Parameters:
      showDelay - the value for the showDelay record component
      showDuration - the value for the showDuration record component
      hideDelay - the value for the hideDelay record component
  • Method Details

    • getDefault

      public static TooltipConfig getDefault()
      Get the configuration with the default values as defined by JavaFX.
      Returns:
      configuration with default values
    • applyTo

      public void applyTo(Tooltip tt)
      Apply this configuration to a tooltip.
      Parameters:
      tt - the tooltip
    • from

      public static TooltipConfig from(Tooltip tt)
      Obtain configuration from a tooltip.
      Parameters:
      tt - the tooltip
      Returns:
      configuration with values from the tooltip
    • 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 Objects::equals(Object,Object).
      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.
    • showDelay

      public Duration showDelay()
      Returns the value of the showDelay record component.
      Returns:
      the value of the showDelay record component
    • showDuration

      public Duration showDuration()
      Returns the value of the showDuration record component.
      Returns:
      the value of the showDuration record component
    • hideDelay

      public Duration hideDelay()
      Returns the value of the hideDelay record component.
      Returns:
      the value of the hideDelay record component