Class ObjectDrawAttributes

Object
ObjectDrawAttributes

public final class ObjectDrawAttributes extends Object
A means of extracting attributes associated with a particular object (e.g. color, ID) when drawing
  • Constructor Details

    • ObjectDrawAttributes

      public ObjectDrawAttributes(ColorIndex colorIndex)
      Creates with a specific color-index and uses the iteration-index as both the ID and color-ID
      Parameters:
      colorIndex - color-index
    • ObjectDrawAttributes

      public ObjectDrawAttributes(ColorIndex colorIndex, IdentifierGetter<ObjectWithProperties> idGetter, IdentifierGetter<ObjectWithProperties> colorIDGetter)
      Creates a new ObjectDrawAttributes instance.
      Parameters:
      colorIndex - Colors for a given index
      idGetter - Gets a unique ID associated with the object
      colorIDGetter - Gets a color ID associated with the object
  • Method Details

    • colorFor

      public RGBColor colorFor(ObjectWithProperties object, int index)
      A color for a particular object
      Parameters:
      object - the object
      index - the index of the object (unique incrementing ID for each object in a collection)
      Returns:
      the color
    • idFor

      public int idFor(ObjectWithProperties object, int index)
      ID for a particular object
      Parameters:
      object - the object
      index - the index of the object (unique incrementing ID for each object in a collection)
      Returns:
      the id
    • getColorIndex

      public ColorIndex getColorIndex()
      Colors for a given index
    • getIdGetter

      public IdentifierGetter<ObjectWithProperties> getIdGetter()
      Gets a unique ID associated with the object
    • getColorIDGetter

      public IdentifierGetter<ObjectWithProperties> getColorIDGetter()
      Gets a color ID associated with the object
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object