Class ObjectDrawAttributes
Object
ObjectDrawAttributes
A means of extracting attributes associated with a particular object (e.g. color, ID) when
drawing
-
Constructor Summary
ConstructorsConstructorDescriptionObjectDrawAttributes(ColorIndex colorIndex) Creates with a specific color-index and uses the iteration-index as both the ID and color-IDObjectDrawAttributes(ColorIndex colorIndex, IdentifierGetter<ObjectWithProperties> idGetter, IdentifierGetter<ObjectWithProperties> colorIDGetter) Creates a newObjectDrawAttributesinstance. -
Method Summary
Modifier and TypeMethodDescriptioncolorFor(ObjectWithProperties object, int index) A color for a particular objectbooleanGets a color ID associated with the objectColors for a given indexGets a unique ID associated with the objectinthashCode()intidFor(ObjectWithProperties object, int index) ID for a particular objecttoString()
-
Constructor Details
-
ObjectDrawAttributes
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 newObjectDrawAttributesinstance.- Parameters:
colorIndex- Colors for a given indexidGetter- Gets a unique ID associated with the objectcolorIDGetter- Gets a color ID associated with the object
-
-
Method Details
-
colorFor
A color for a particular object- Parameters:
object- the objectindex- the index of the object (unique incrementing ID for each object in a collection)- Returns:
- the color
-
idFor
ID for a particular object- Parameters:
object- the objectindex- the index of the object (unique incrementing ID for each object in a collection)- Returns:
- the id
-
getColorIndex
Colors for a given index -
getIdGetter
Gets a unique ID associated with the object -
getColorIDGetter
Gets a color ID associated with the object -
equals
-
hashCode
public int hashCode() -
toString
-