Class ColourArray

java.lang.Object
pamViewFX.fxNodes.utilsFX.ColourArray
All Implemented Interfaces:
Serializable, Cloneable

public class ColourArray extends Object implements Cloneable, Serializable
A colour map contains information to create a colour map and the correct CSS to colour components.
Author:
Doug Gillespie, modified by Jamie Macaulay to use JavaFX classes
See Also:
  • Method Details

    • getName

      public static String getName(ColourArray.ColourArrayType type)
    • getColorArrayType

      public static ColourArray.ColourArrayType getColorArrayType(String name)
      Get the color array type from it's string name.
      Parameters:
      name - - string name of color array
      Returns:
    • getColourArrayType

      public static ColourArray.ColourArrayType getColourArrayType(String name)
      Get the ColourArrayType from it's string name
      Parameters:
      name - - the string name of the colour array type
      Returns:
      the ColourArrayType for the string name. Null if no ColourArrayType found.
    • createStandardColourArray

      public static ColourArray createStandardColourArray(int nPoints, ColourArray.ColourArrayType type)
    • getCSSColourArray

      public static String getCSSColourArray(ColourArray.ColourArrayType type)
      Get the CSS linear gradient for colouring Nodes by the selected colourmap.
      Parameters:
      type -
      Returns:
      CSS string for a linear gradient representing a colour map.
    • getColorList

      public static javafx.scene.paint.Color[] getColorList(ColourArray.ColourArrayType type)
      Get a list of colours which make up a colour array
      Returns:
      the linear gradient
    • createWhiteToBlackArray

      public static ColourArray createWhiteToBlackArray(int nPoints)
    • createBlackToWhiteArray

      public static ColourArray createBlackToWhiteArray(int nPoints)
    • createHotArray

      public static ColourArray createHotArray(int nPoints)
    • createFireArray

      public static ColourArray createFireArray(int nPoints)
    • createPatrioticArray

      public static ColourArray createPatrioticArray(int nPoints)
    • createMultiColouredArray

      public static ColourArray createMultiColouredArray(int nPoints, javafx.scene.paint.Color... colourList)
      Create a multicoloured array of colours that merges in turn between each of the colours given in the list.
      Parameters:
      nPoints - total number of colour points
      colourList - variable number of colours.
      Returns:
      a new ColourArray object.
    • createMergedArray

      public static ColourArray createMergedArray(int nPoints, javafx.scene.paint.Color c1, javafx.scene.paint.Color c2)
    • getColours

      public javafx.scene.paint.Color[] getColours()
    • getColour

      public javafx.scene.paint.Color getColour(double iCol)
      Get a colour from the colour array
      Parameters:
      iCol - - the colour index between 0 and 1 on the colour array.
      Returns:
      the colour at at percentage iCol within the array
    • getColour

      public javafx.scene.paint.Color getColour(int iCol)
      Get a colour from the colour array
      Parameters:
      iCol - - the colour index. i.e. 0 to N colours
      Returns:
      the colour at index iCol;
    • getIntColourArray

      public int[] getIntColourArray(int iCol)
    • getNumbColours

      public int getNumbColours()
    • reverseArray

      public void reverseArray()
    • getContrastingColour

      public javafx.scene.paint.Color getContrastingColour()
      Return a contrasting colour which is different to ALL of the colours in the array. This can be used to draw additional lines over 3D plots made with the array colours.
      Returns:
      the contrastingColor
    • setContrastingColour

      public void setContrastingColour(javafx.scene.paint.Color contrastingColor)
      Set a contrasting colour which is different to ALL of the colours in the array. This can be used to draw additional lines over 3D plots made with the array colours.
      Parameters:
      contrastingColor - the contrastingColor to set
    • getLinerGradient

      public static javafx.scene.paint.LinearGradient getLinerGradient(javafx.geometry.Orientation orientation, double size, ColourArray.ColourArrayType colourArrayType)
      Get the linear gradient to display on a node node for a colour array.
      Parameters:
      orientation - - orientation of the colour gradinet, vertical or horizontal.
      size - - size in pixels of the gradient.
      colourArrayType - - colour array
      Returns:
      the linear graident for the a ColourArrayType.