uk.ac.starlink.ttools.plot2
Class LayerOpt

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.LayerOpt

@Equality
public class LayerOpt
extends Object

Defines characteristics of a plot layer that may enable plotting optimisations.

Since:
12 Feb 2013
Author:
Mark Taylor

Field Summary
static LayerOpt NO_SPECIAL
          Indicates layer with no known optimisation assumptions.
static LayerOpt OPAQUE
          Indicates opaque multicoloured layer.
 
Constructor Summary
LayerOpt(Color singleColor, boolean opaque)
          Constructs a LayerOpt with explicit options.
 
Method Summary
 boolean equals(Object o)
           
 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.
 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(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 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 Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.