public class AssignmentColorPool extends Object
ColorScheme
s 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.
Constructor and Description |
---|
AssignmentColorPool(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) |
Modifier and Type | Method and Description |
---|---|
ColorList |
createColors(int numberUnpaired)
Creates a list of colors to describe the assignment.
|
boolean |
isDifferentColorsForPairs()
If true, different colors are used for paired objects, otherwise always the same color is
used.
|
public AssignmentColorPool(int numberPaired, ColorScheme colorSchemePaired)
numberPaired
- the number of paired objects that exist in the assignment.colorSchemePaired
- the color-scheme used to generate colors for paired objects.public AssignmentColorPool(int numberPaired, ColorScheme colorSchemePaired, ColorScheme colorSchemeUnpaired, boolean differentColorsForPairs)
public ColorList createColors(int numberUnpaired) throws OperationFailedException
The first numberPaired
elements in this list, are colors to describe the paired
elements.
The remaining elements, are colors to describe the unpaired elements.
numberUnpaired
- the number of unapred objects that exist in this particular set of
objects.numberPaired + numberUnpaired
as described above.OperationFailedException
- if colors cannot be generated from the respective ColorScheme
.public boolean isDifferentColorsForPairs()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.