Class ObjectDrawAttributes
Object
org.anchoranalysis.overlay.writer.ObjectDrawAttributes
public final class ObjectDrawAttributes extends Object
A means of extracting attributes associated with a particular object (e.g. color, ID) when
drawing
-
Constructor Summary
Constructors Constructor Description ObjectDrawAttributes(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) -
Method Summary
Modifier and Type Method Description RGBColorcolorFor(ObjectWithProperties object, int index)A color for a particular objectbooleanequals(Object o)IdentifierGetter<ObjectWithProperties>getColorIDGetter()Gets a color ID associated with the objectColorIndexgetColorIndex()Colors for a given indexIdentifierGetter<ObjectWithProperties>getIdGetter()Gets a unique ID associated with the objectinthashCode()intidFor(ObjectWithProperties object, int index)ID for a particular objectStringtoString()
-
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)
-
-
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
-