Class LayerOpt


  • @Equality
    public class LayerOpt
    extends java.lang.Object
    Defines characteristics of a plot layer that may enable plotting optimisations.
    Since:
    12 Feb 2013
    Author:
    Mark Taylor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static LayerOpt NO_SPECIAL
      Indicates layer with no known optimisation assumptions.
      static LayerOpt OPAQUE
      Indicates opaque multicoloured layer.
    • Constructor Summary

      Constructors 
      Constructor Description
      LayerOpt​(java.awt.Color singleColor, boolean opaque)
      Constructs a LayerOpt with explicit options.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.awt.Color getSingleColor()
      Returns a colour if the only painting done by this layer is in a single colour.
      int hashCode()  
      boolean isOpaque()
      Indicates whether it's safe to assume that all drawing is opaque.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • OPAQUE

        public static LayerOpt OPAQUE
        Indicates opaque multicoloured layer.
      • NO_SPECIAL

        public static LayerOpt NO_SPECIAL
        Indicates layer with no known optimisation assumptions.
    • Constructor Detail

      • LayerOpt

        public LayerOpt​(java.awt.Color singleColor,
                        boolean opaque)
        Constructs a LayerOpt with explicit options.
        Parameters:
        singleColor - colour if only one is used by the layer, else null
        opaque - true if only opaque pixels are generated by the layer
    • Method Detail

      • getSingleColor

        public java.awt.Color getSingleColor()
        Returns a colour if the only painting done by this layer is in a single colour. Different alphas are permitted, but not different RGB values.
        Returns:
        single colour, or null
      • isOpaque

        public boolean isOpaque()
        Indicates whether it's safe to assume that all drawing is opaque.
        Returns:
        true if no transparency is used
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object