Class AssignmentColorPool
Object
AssignmentColorPool
Different
ColorSchemes that can be used to select colors for paired and unpaired objects.
This is useful when showing an assignment visually with the two objects side-by-side e.g. left and right.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionAssignmentColorPool(int numberPaired, ColorScheme colorSchemePaired) Creates with a number and colors for the paired objects, and defaults colors for unpaired.AssignmentColorPool(int numberPaired, ColorScheme colorSchemePaired, ColorScheme colorSchemeUnpaired, boolean differentColorsForPairs) Creates a newAssignmentColorPoolinstance. -
Method Summary
Modifier and TypeMethodDescriptioncreateColors(int numberUnpaired) Creates a list of colors to describe the assignment.booleanIf true, different colors are used for paired objects, otherwise always the same color is used.
-
Constructor Details
-
Method Details
-
createColors
Creates a list of colors to describe the assignment.The first
numberPairedelements in this list, are colors to describe the paired elements.The remaining elements, are colors to describe the unpaired elements.
- Parameters:
numberUnpaired- the number of unapred objects that exist in this particular set of objects.- Returns:
- a list of elements of size
numberPaired + numberUnpairedas described above. - Throws:
OperationFailedException- if colors cannot be generated from the respectiveColorScheme.
-
isDifferentColorsForPairs
public boolean isDifferentColorsForPairs()If true, different colors are used for paired objects, otherwise always the same color is used.
-