Package limn.scene

Record Class TooltipStyle

java.lang.Object
java.lang.Record
limn.scene.TooltipStyle
Record Components:
fill - panel background
border - panel outline
text - label color
font - label font
radius - corner radius
padH - horizontal padding, per side
padV - vertical padding, per side

public record TooltipStyle(Color fill, Color border, Color text, Font font, float radius, float padH, float padV) extends Record
Appearance of the scene's hover tooltip panel. The toolkit renders tooltips but has no theme of its own, so the components layer installs a supplier of this (reading its Theme at paint time) via Scene.installTooltipStyle(java.util.function.Function<limn.scene.ControlSize, limn.scene.TooltipStyle>). Without one, tooltips are not painted.

The box travels with the ink: a tooltip anchored to an XSMALL control gets an 11pt label in a box padded for one, because leaving the padding pinned would put an 11pt label inside a MEDIUM box, with padding at ~27% of the panel, the inverse of the whole design.

  • Constructor Summary

    Constructors
    Constructor
    Description
    TooltipStyle(Color fill, Color border, Color text, Font font, float radius, float padH, float padV)
    Creates an instance of a TooltipStyle record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the border record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the fill record component.
    Returns the value of the font record component.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the padH record component.
    float
    Returns the value of the padV record component.
    float
    Returns the value of the radius record component.
    Returns the value of the text record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TooltipStyle

      public TooltipStyle(Color fill, Color border, Color text, Font font, float radius, float padH, float padV)
      Creates an instance of a TooltipStyle record class.
      Parameters:
      fill - the value for the fill record component
      border - the value for the border record component
      text - the value for the text record component
      font - the value for the font record component
      radius - the value for the radius record component
      padH - the value for the padH record component
      padV - the value for the padV 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • fill

      public Color fill()
      Returns the value of the fill record component.
      Returns:
      the value of the fill record component
    • border

      public Color border()
      Returns the value of the border record component.
      Returns:
      the value of the border record component
    • text

      public Color text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • font

      public Font font()
      Returns the value of the font record component.
      Returns:
      the value of the font record component
    • radius

      public float radius()
      Returns the value of the radius record component.
      Returns:
      the value of the radius record component
    • padH

      public float padH()
      Returns the value of the padH record component.
      Returns:
      the value of the padH record component
    • padV

      public float padV()
      Returns the value of the padV record component.
      Returns:
      the value of the padV record component