Class AssignmentColorPool

Object
org.anchoranalysis.annotation.io.assignment.generator.AssignmentColorPool

public class AssignmentColorPool
extends Object
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

    Constructors 
    Constructor Description
    AssignmentColorPool​(int numberPaired, org.anchoranalysis.bean.shared.color.scheme.ColorScheme colorSchemePaired)
    Creates with a number and colors for the paired objects, and defaults colors for unpaired.
    AssignmentColorPool​(int numberPaired, org.anchoranalysis.bean.shared.color.scheme.ColorScheme colorSchemePaired, org.anchoranalysis.bean.shared.color.scheme.ColorScheme colorSchemeUnpaired, boolean differentColorsForPairs)  
  • Method Summary

    Modifier and Type Method Description
    org.anchoranalysis.core.color.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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AssignmentColorPool

      public AssignmentColorPool​(int numberPaired, org.anchoranalysis.bean.shared.color.scheme.ColorScheme colorSchemePaired)
      Creates with a number and colors for the paired objects, and defaults colors for unpaired.
      Parameters:
      numberPaired - the number of paired objects that exist in the assignment.
      colorSchemePaired - the color-scheme used to generate colors for paired objects.
    • AssignmentColorPool

      public AssignmentColorPool​(int numberPaired, org.anchoranalysis.bean.shared.color.scheme.ColorScheme colorSchemePaired, org.anchoranalysis.bean.shared.color.scheme.ColorScheme colorSchemeUnpaired, boolean differentColorsForPairs)
  • Method Details

    • createColors

      public org.anchoranalysis.core.color.ColorList createColors​(int numberUnpaired) throws org.anchoranalysis.core.exception.OperationFailedException
      Creates a list of colors to describe the assignment.

      The first numberPaired elements 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 + numberUnpaired as described above.
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if colors cannot be generated from the respective ColorScheme.
    • isDifferentColorsForPairs

      public boolean isDifferentColorsForPairs()
      If true, different colors are used for paired objects, otherwise always the same color is used.