Class Displayable

java.lang.Object
journeymap.api.v2.client.display.Displayable
All Implemented Interfaces:
Comparable<Displayable>
Direct Known Subclasses:
Overlay

@ParametersAreNonnullByDefault public abstract class Displayable extends Object implements Comparable<Displayable>
Base class for Overlays and Waypoints. Mods should not extend this class directly. Use one of the provided implementations.
  • Field Details

    • modId

      @Since(1.1) protected final String modId
    • id

      @Since(1.1) protected final String id
    • displayType

      @Since(1.1) protected final DisplayType displayType
  • Constructor Details

    • Displayable

      protected Displayable(String modId)
      Constructor with explicit display id.
      Parameters:
      modId - the mod id
  • Method Details

    • clampRGB

      public static int clampRGB(int rgb)
      Clamps an rgb int value to the allowable range. If an ARGB value is passed in, alpha is masked to FF.
      Parameters:
      rgb - color
      Returns:
      clamped color
    • clampOpacity

      public static float clampOpacity(float opacity)
      Clamps an rgb int value to the allowable range of 0F-1F.
      Parameters:
      opacity - opacity
      Returns:
      clamped opacity
    • getDisplayOrder

      public abstract int getDisplayOrder()
      Used to determine display order, lower first.
      Returns:
      order
    • getModId

      public final String getModId()
      Your mod id.
      Returns:
      modId mod id
    • getId

      public final String getId()
      A unique id for the object. Uniqueness is only needed among instances of the same class.
      Returns:
      displayId display id
    • getDisplayType

      public final DisplayType getDisplayType()
      DisplayType enum for the object.
      Returns:
      enum value
    • getGuid

      public final String getGuid()
      Dash-delimited GUID for the display object in the form of "modid-displayType-displayId".
      Returns:
      the guid
    • equals

      public boolean equals(Object o)
      Equality is based on either reference equality or GUID.
      Overrides:
      equals in class Object
      Parameters:
      o - other
      Returns:
      true if equal
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(Displayable o)
      Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Specified by:
      compareTo in interface Comparable<Displayable>
      Parameters:
      o - the object to be compared.
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Throws:
      NullPointerException - if the specified object is null
      ClassCastException - if the specified object's type prevents it from being compared to this object.