APIdia Launch Partner
Top Description Fields Constructors Methods
sun.java2d.loops

public final Class CompositeType

extends Object
Class Inheritance
Imports
java.awt.AlphaComposite, java.util.HashMap

A CompositeType object provides a chained description of a type of algorithm for color compositing. The object will provide a single String constant descriptor which is one way of describing a particular compositing algorithm as well as a pointer to another CompositeType which describes a more general algorithm for achieving the same result.

A description of a more specific algorithm is considered a "subtype" and a description of a more general algorithm is considered a "supertype". Thus, the deriveSubType method provides a way to create a new CompositeType that is related to but more specific than an existing CompositeType and the getSuperType method provides a way to ask a given CompositeType for a more general algorithm to achieve the same result.

Note that you cannot construct a brand new root for a chain since the constructor is private. Every chain of types must at some point derive from the Any node provided here using the deriveSubType() method. The presence of this common Any node on every chain ensures that all chains end with the DESC_ANY descriptor so that a suitable General GraphicsPrimitive object can be obtained for the indicated algorithm if all of the more specific searches fail.

Field Summary

Modifier and TypeField and Description
public static final CompositeType
public static final CompositeType
Any

The root CompositeType object for all chains of algorithm descriptions.

public static final CompositeType
public static final CompositeType
private static final HashMap<String, Integer>
private String
public static final String
public static final String
DESC_ANY

algorithm is a general algorithm that uses a CompositeContext to do the rendering.

public static final String
DESC_ANY_ALPHA

constant used to describe an algorithm that implements all 8 of the Porter-Duff rules in one Primitive.

public static final String
DESC_CLEAR

constants used to describe the various AlphaComposite algorithms.

public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
DESC_SRC_NO_EA

constants used to describe the two common cases of AlphaComposite algorithms that are simpler if there is not extraAlpha.

public static final String
public static final String
public static final String
public static final String
DESC_XOR

constant used to describe the Graphics.setXORMode() algorithm

public static final CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
private CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
public static final CompositeType
private int
private static int
public static final CompositeType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public CompositeType
deriveSubType(String desc)

Return a new CompositeType object which uses this object as its more general "supertype" descriptor.

public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public static CompositeType
forAlphaComposite(AlphaComposite ac)

Return a CompositeType object for the specified AlphaComposite rule.

public String
public CompositeType
public int
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
public static synchronized int
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

AlphaXorback to summary
public static final CompositeType AlphaXor
Anyback to summary
public static final CompositeType Any

The root CompositeType object for all chains of algorithm descriptions.

AnyAlphaback to summary
public static final CompositeType AnyAlpha
Clearback to summary
public static final CompositeType Clear
compositeUIDMapback to summary
private static final HashMap<String, Integer> compositeUIDMap
descback to summary
private String desc
DESC_ALPHA_XORback to summary
public static final String DESC_ALPHA_XOR
DESC_ANYback to summary
public static final String DESC_ANY

algorithm is a general algorithm that uses a CompositeContext to do the rendering.

DESC_ANY_ALPHAback to summary
public static final String DESC_ANY_ALPHA

constant used to describe an algorithm that implements all 8 of the Porter-Duff rules in one Primitive.

DESC_CLEARback to summary
public static final String DESC_CLEAR

constants used to describe the various AlphaComposite algorithms.

DESC_DSTback to summary
public static final String DESC_DST
DESC_DST_ATOPback to summary
public static final String DESC_DST_ATOP
DESC_DST_INback to summary
public static final String DESC_DST_IN
DESC_DST_OUTback to summary
public static final String DESC_DST_OUT
DESC_DST_OVERback to summary
public static final String DESC_DST_OVER
DESC_SRCback to summary
public static final String DESC_SRC
DESC_SRC_ATOPback to summary
public static final String DESC_SRC_ATOP
DESC_SRC_INback to summary
public static final String DESC_SRC_IN
DESC_SRC_NO_EAback to summary
public static final String DESC_SRC_NO_EA

constants used to describe the two common cases of AlphaComposite algorithms that are simpler if there is not extraAlpha.

DESC_SRC_OUTback to summary
public static final String DESC_SRC_OUT
DESC_SRC_OVERback to summary
public static final String DESC_SRC_OVER
DESC_SRC_OVER_NO_EAback to summary
public static final String DESC_SRC_OVER_NO_EA
DESC_XORback to summary
public static final String DESC_XOR

constant used to describe the Graphics.setXORMode() algorithm

Dstback to summary
public static final CompositeType Dst
DstAtopback to summary
public static final CompositeType DstAtop
DstInback to summary
public static final CompositeType DstIn
DstOutback to summary
public static final CompositeType DstOut
DstOverback to summary
public static final CompositeType DstOver
Generalback to summary
public static final CompositeType General
nextback to summary
private CompositeType next
OpaqueSrcOverNoEaback to summary
public static final CompositeType OpaqueSrcOverNoEa
Srcback to summary
public static final CompositeType Src
SrcAtopback to summary
public static final CompositeType SrcAtop
SrcInback to summary
public static final CompositeType SrcIn
SrcNoEaback to summary
public static final CompositeType SrcNoEa
SrcOutback to summary
public static final CompositeType SrcOut
SrcOverback to summary
public static final CompositeType SrcOver
SrcOverNoEaback to summary
public static final CompositeType SrcOverNoEa
uniqueIDback to summary
private int uniqueID
unusedUIDback to summary
private static int unusedUID
Xorback to summary
public static final CompositeType Xor

Constructor Detail

CompositeTypeback to summary
private CompositeType(CompositeType parent, String desc)

Method Detail

deriveSubTypeback to summary
public CompositeType deriveSubType(String desc)

Return a new CompositeType object which uses this object as its more general "supertype" descriptor. If no operation can be found that implements the algorithm described more exactly by desc, then this object will define the more general compositing algorithm that can be used instead.

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

forAlphaCompositeback to summary
public static CompositeType forAlphaComposite(AlphaComposite ac)

Return a CompositeType object for the specified AlphaComposite rule.

getDescriptorback to summary
public String getDescriptor()
getSuperTypeback to summary
public CompositeType getSuperType()
getUniqueIDback to summary
public int getUniqueID()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
isDerivedFromback to summary
public boolean isDerivedFrom(CompositeType other)
makeUniqueIDback to summary
public static synchronized int makeUniqueID(String desc)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.