Class TLspRulerDistanceFormatStyle

All Implemented Interfaces:
ILcdCloneable, ILspStyler, Cloneable
Direct Known Subclasses:
TLspRulerSegmentLabelContentStyle

public class TLspRulerDistanceFormatStyle extends ALspLabelTextProviderStyle
A simple extension of ALspLabelTextProviderStyle. The label content when the domain object is an instance of ALspRulerMeasurement is equal to the total length of the ruler measurement, formatted using a a distance format.
Since:
2012.0
  • Constructor Details

  • Method Details

    • newBuilder

      public static TLspRulerDistanceFormatStyle.Builder<?> newBuilder()
      Creates a new builder with the default value:
      Returns:
      the new builder.
    • asBuilder

      public TLspRulerDistanceFormatStyle.Builder<?> asBuilder()
      Creates a new builder initialized with all the properties of this style.
      Overrides:
      asBuilder in class ALspLabelTextProviderStyle
      Returns:
      the new builder.
    • getText

      public String[] getText(Object aDomainObject, Object aSubLabelID, TLspContext aContext)
      Description copied from class: ALspLabelTextProviderStyle

      Returns text (one or more strings) for the given domain object and sublabel ID. When no label should be painted, this method should return null or an empty array.

      By default, this method returns an array containing only the result of the toString() method of the given domain object.

      When overriding this method, the implementation should make sure that the returned text is consistent for the given label. I.e. it should not return a different String every time it is called for a given label. Not doing so may lead to worse performance and incorrectly visualized labels.

      Overrides:
      getText in class ALspLabelTextProviderStyle
      Parameters:
      aDomainObject - a domain object.
      aSubLabelID - a sublabel ID.
      aContext - the context.
      Returns:
      text for the given identifier.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ALspStyle
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ALspStyle
    • getDistanceFormat

      public Format getDistanceFormat()
      Returns the used distance format.
      Returns:
      the current distance format.