aicas logoJamaica 3.2 release 62

java.awt
Class AlphaComposite

java.lang.Object
  extended by java.awt.AlphaComposite
All Implemented Interfaces:
Composite

public final class AlphaComposite
extends Object
implements Composite

Since:
1.3
See Also:
Composite, CompositeContext
Status:
updated to 1.4 except for createContext, needs documentation

Field Summary
static AlphaComposite Clear
           
static int CLEAR
           
static AlphaComposite Dst
           
static int DST
           
static int DST_ATOP
           
static int DST_IN
           
static int DST_OUT
           
static int DST_OVER
           
static AlphaComposite DstAtop
           
static AlphaComposite DstIn
           
static AlphaComposite DstOut
           
static AlphaComposite DstOver
           
static AlphaComposite Src
           
static int SRC
           
static int SRC_ATOP
           
static int SRC_IN
           
static int SRC_OUT
           
static int SRC_OVER
           
static AlphaComposite SrcAtop
           
static AlphaComposite SrcIn
           
static AlphaComposite SrcOut
           
static AlphaComposite SrcOver
           
static AlphaComposite Xor
           
static int XOR
           
 
Method Summary
 CompositeContext createContext(ColorModel srcColorModel, ColorModel dstColorModel, RenderingHints hints)
          Creates a CompositeContext that can be used to perform compositing operations according to this AlphaComposite settings.
 AlphaComposite derive(float alpha)
          Return an AlphaComposite similar to this, that uses the specified alpha.
 AlphaComposite derive(int rule)
          Return an AlphaComposite similar to this, that uses the specified rule.
 boolean equals(Object o)
          equals compares this object to another object.
 float getAlpha()
           
static AlphaComposite getInstance(int rule)
          Creates an AlphaComposite object with the specified rule.
static AlphaComposite getInstance(int rule, float alpha)
          Creates an AlphaComposite object with the specified rule and the constant alpha to multiply with the alpha of the source.
 int getRule()
           
 int hashCode()
          hashCode returns a hash code for this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLEAR

public static final int CLEAR
See Also:
Constant Field Values

SRC

public static final int SRC
See Also:
Constant Field Values

DST

public static final int DST
See Also:
Constant Field Values

SRC_OVER

public static final int SRC_OVER
See Also:
Constant Field Values

DST_OVER

public static final int DST_OVER
See Also:
Constant Field Values

SRC_IN

public static final int SRC_IN
See Also:
Constant Field Values

DST_IN

public static final int DST_IN
See Also:
Constant Field Values

SRC_OUT

public static final int SRC_OUT
See Also:
Constant Field Values

DST_OUT

public static final int DST_OUT
See Also:
Constant Field Values

SRC_ATOP

public static final int SRC_ATOP
See Also:
Constant Field Values

DST_ATOP

public static final int DST_ATOP
See Also:
Constant Field Values

XOR

public static final int XOR
See Also:
Constant Field Values

Clear

public static final AlphaComposite Clear

Src

public static final AlphaComposite Src

Dst

public static final AlphaComposite Dst

SrcOver

public static final AlphaComposite SrcOver

DstOver

public static final AlphaComposite DstOver

SrcIn

public static final AlphaComposite SrcIn

DstIn

public static final AlphaComposite DstIn

SrcOut

public static final AlphaComposite SrcOut

DstOut

public static final AlphaComposite DstOut

SrcAtop

public static final AlphaComposite SrcAtop

DstAtop

public static final AlphaComposite DstAtop

Xor

public static final AlphaComposite Xor
Method Detail

getInstance

public static AlphaComposite getInstance(int rule)
Creates an AlphaComposite object with the specified rule.

Parameters:
rule - The compositing rule.
Throws:
IllegalArgumentException - If rule is not one of the following: CLEAR, SRC, DST, SRC_OVER, DST_OVER, SRC_IN, DST_IN, SRC_OUT, DST_OUT, SRC_ATOP, DST_ATOP, or XOR.

getInstance

public static AlphaComposite getInstance(int rule,
                                         float alpha)
Creates an AlphaComposite object with the specified rule and the constant alpha to multiply with the alpha of the source. The source is multiplied with the specified alpha before being composited with the destination.

Parameters:
rule - The compositing rule.
Throws:
IllegalArgumentException - If rule is not one of the following: CLEAR, SRC, DST, SRC_OVER, DST_OVER, SRC_IN, DST_IN, SRC_OUT, DST_OUT, SRC_ATOP, DST_ATOP, or XOR.

createContext

public CompositeContext createContext(ColorModel srcColorModel,
                                      ColorModel dstColorModel,
                                      RenderingHints hints)
Creates a CompositeContext that can be used to perform compositing operations according to this AlphaComposite settings.

Specified by:
createContext in interface Composite
Parameters:
srcColorModel - the color model of the source raster
dstColorModel - the color model of the destination raster
hints - the rendering hints to use
Returns:
a CompositeContext that can be used to perform compositing operations according to this AlphaComposite settings

derive

public AlphaComposite derive(int rule)
Return an AlphaComposite similar to this, that uses the specified rule. If rule is the same as this.rule, then this is returned.

Since:
1.6

derive

public AlphaComposite derive(float alpha)
Return an AlphaComposite similar to this, that uses the specified alpha. If alph is the same as this.alpha, then this is returned.

Since:
1.6

getAlpha

public float getAlpha()

getRule

public int getRule()

hashCode

public int hashCode()
Description copied from class: Object
hashCode returns a hash code for this object. The hash code must be equal for two objects a and b if a.equals(b) is true.

The default implementation returns System.identityHashCode(this).

Overrides:
hashCode in class Object
Returns:
a hash code value.

equals

public boolean equals(Object o)
Description copied from class: Object
equals compares this object to another object.

Equals must be symmetric (a.equals(b) == b.equals(a)), reflexive (a.equals(a)==true) and transitive (a.equals(b) && b.equals(c) IMPLIES (a.equals(c))) and not change over time (a.equals(b) == a.equals(b)). a.equals(null) should always return false.

If a.equals(b) is true for two objects a and b, then a.hashCode()==b.hashCode() must hold.

The default implementation of equals returns this==other.

Overrides:
equals in class Object
Parameters:
o - the other object.
Returns:
if this and other are considered equal.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.