javax.media.nativewindow
Class Capabilities

java.lang.Object
  extended by javax.media.nativewindow.Capabilities
All Implemented Interfaces:
WriteCloneable, Cloneable, Comparable, CapabilitiesImmutable

public class Capabilities
extends Object
implements CapabilitiesImmutable, Cloneable, Comparable

Specifies a set of capabilities that a window's rendering context must support, such as color depth per channel. It currently contains the minimal number of routines which allow configuration on all supported window systems.


Constructor Summary
Capabilities()
          Creates a Capabilities object.
 
Method Summary
 Object clone()
           
 Object cloneMutable()
           
 int compareTo(Object o)
          comparing RGBA values only
 boolean equals(Object obj)
          Equality over the immutable attributes of both objects
 int getAlphaBits()
          Returns the number of bits requested for the color buffer's alpha component.
 int getBlueBits()
          Returns the number of bits requested for the color buffer's blue component.
 int getGreenBits()
          Returns the number of bits requested for the color buffer's green component.
 int getRedBits()
          Returns the number of bits requested for the color buffer's red component.
 int getTransparentAlphaValue()
          Gets the transparent alpha value for the frame buffer configuration.
 int getTransparentBlueValue()
          Gets the transparent blue value for the frame buffer configuration.
 int getTransparentGreenValue()
          Gets the transparent green value for the frame buffer configuration.
 int getTransparentRedValue()
          Gets the transparent red value for the frame buffer configuration.
 int hashCode()
          hash code over the immutable attributes of both objects
 boolean isBackgroundOpaque()
          Indicates whether the background of this OpenGL context should be considered opaque.
 boolean isOnscreen()
          Indicates whether the drawable surface is onscreen.
 void setAlphaBits(int alphaBits)
          Sets the number of bits requested for the color buffer's alpha component.
 void setBackgroundOpaque(boolean opaque)
          Defaults to true, ie.
 void setBlueBits(int blueBits)
          Sets the number of bits requested for the color buffer's blue component.
 void setGreenBits(int greenBits)
          Sets the number of bits requested for the color buffer's green component.
 void setOnscreen(boolean onscreen)
          Sets whether the drawable surface supports onscreen.
 void setRedBits(int redBits)
          Sets the number of bits requested for the color buffer's red component.
 void setTransparentAlphaValue(int transValueAlpha)
          Sets the transparent alpha value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for alpha.
 void setTransparentBlueValue(int transValueBlue)
          Sets the transparent blue value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for blue.
 void setTransparentGreenValue(int transValueGreen)
          Sets the transparent green value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for green.
 void setTransparentRedValue(int transValueRed)
          Sets the transparent red value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for red.
 String toString()
          Returns a textual representation of this Capabilities object.
 StringBuffer toString(StringBuffer sink)
          Return a textual representation of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Capabilities

public Capabilities()
Creates a Capabilities object. All attributes are in a default state.

Method Detail

cloneMutable

public Object cloneMutable()
Specified by:
cloneMutable in interface WriteCloneable

clone

public Object clone()
Overrides:
clone in class Object

hashCode

public int hashCode()
Description copied from interface: CapabilitiesImmutable
hash code over the immutable attributes of both objects

Specified by:
hashCode in interface CapabilitiesImmutable
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Description copied from interface: CapabilitiesImmutable
Equality over the immutable attributes of both objects

Specified by:
equals in interface CapabilitiesImmutable
Overrides:
equals in class Object

compareTo

public int compareTo(Object o)
comparing RGBA values only

Specified by:
compareTo in interface Comparable

getRedBits

public int getRedBits()
Returns the number of bits requested for the color buffer's red component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Specified by:
getRedBits in interface CapabilitiesImmutable

setRedBits

public void setRedBits(int redBits)
Sets the number of bits requested for the color buffer's red component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.


getGreenBits

public int getGreenBits()
Returns the number of bits requested for the color buffer's green component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Specified by:
getGreenBits in interface CapabilitiesImmutable

setGreenBits

public void setGreenBits(int greenBits)
Sets the number of bits requested for the color buffer's green component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.


getBlueBits

public int getBlueBits()
Returns the number of bits requested for the color buffer's blue component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Specified by:
getBlueBits in interface CapabilitiesImmutable

setBlueBits

public void setBlueBits(int blueBits)
Sets the number of bits requested for the color buffer's blue component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.


getAlphaBits

public int getAlphaBits()
Returns the number of bits requested for the color buffer's alpha component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.

Specified by:
getAlphaBits in interface CapabilitiesImmutable

setAlphaBits

public void setAlphaBits(int alphaBits)
Sets the number of bits requested for the color buffer's alpha component. On some systems only the color depth, which is the sum of the red, green, and blue bits, is considered.


setBackgroundOpaque

public void setBackgroundOpaque(boolean opaque)
Defaults to true, ie. opaque surface.

On supported platforms, setting opaque to false may result in a translucent surface.

Platform implementations may need an alpha component in the surface (eg. Windows), or expect pre-multiplied alpha values (eg. X11/XRender).
To unify the experience, this method also invokes setAlphaBits(1) if getAlphaBits() == 0.
Please note that in case alpha is required on the platform the clear color shall have an alpha lower than 1.0 to allow anything shining through.

Mind that translucency may cause a performance penalty due to the composite work required by the window manager.

The platform implementation may utilize the transparency RGBA values.
This is true for the original GLX transparency specification, which is no more used today.
Actually these values are currently not used by any implementation, so we may mark them deprecated soon, if this doesn't change.


isBackgroundOpaque

public boolean isBackgroundOpaque()
Indicates whether the background of this OpenGL context should be considered opaque. Defaults to true.

Specified by:
isBackgroundOpaque in interface CapabilitiesImmutable
See Also:
setBackgroundOpaque(boolean)

setOnscreen

public void setOnscreen(boolean onscreen)
Sets whether the drawable surface supports onscreen. Defaults to true.


isOnscreen

public boolean isOnscreen()
Indicates whether the drawable surface is onscreen. Defaults to true.

Specified by:
isOnscreen in interface CapabilitiesImmutable

getTransparentRedValue

public int getTransparentRedValue()
Gets the transparent red value for the frame buffer configuration. This value is undefined if isBackgroundOpaque() equals true.

Specified by:
getTransparentRedValue in interface CapabilitiesImmutable
See Also:
setTransparentRedValue(int)

getTransparentGreenValue

public int getTransparentGreenValue()
Gets the transparent green value for the frame buffer configuration. This value is undefined if isBackgroundOpaque() equals true.

Specified by:
getTransparentGreenValue in interface CapabilitiesImmutable
See Also:
setTransparentGreenValue(int)

getTransparentBlueValue

public int getTransparentBlueValue()
Gets the transparent blue value for the frame buffer configuration. This value is undefined if isBackgroundOpaque() equals true.

Specified by:
getTransparentBlueValue in interface CapabilitiesImmutable
See Also:
setTransparentBlueValue(int)

getTransparentAlphaValue

public int getTransparentAlphaValue()
Gets the transparent alpha value for the frame buffer configuration. This value is undefined if isBackgroundOpaque() equals true.

Specified by:
getTransparentAlphaValue in interface CapabilitiesImmutable
See Also:
setTransparentAlphaValue(int)

setTransparentRedValue

public void setTransparentRedValue(int transValueRed)
Sets the transparent red value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for red. This value is ignored if isBackgroundOpaque() equals true.
It defaults to half of the frambuffer value for red.
A value of -1 is interpreted as any value.


setTransparentGreenValue

public void setTransparentGreenValue(int transValueGreen)
Sets the transparent green value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for green. This value is ignored if isBackgroundOpaque() equals true.
It defaults to half of the frambuffer value for green.
A value of -1 is interpreted as any value.


setTransparentBlueValue

public void setTransparentBlueValue(int transValueBlue)
Sets the transparent blue value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for blue. This value is ignored if isBackgroundOpaque() equals true.
It defaults to half of the frambuffer value for blue.
A value of -1 is interpreted as any value.


setTransparentAlphaValue

public void setTransparentAlphaValue(int transValueAlpha)
Sets the transparent alpha value for the frame buffer configuration, ranging from 0 to the maximum frame buffer value for alpha. This value is ignored if isBackgroundOpaque() equals true.
It defaults to half of the frambuffer value for alpha.
A value of -1 is interpreted as any value.


toString

public StringBuffer toString(StringBuffer sink)
Description copied from interface: CapabilitiesImmutable
Return a textual representation of this object. Use the given StringBuffer [optional].

Specified by:
toString in interface CapabilitiesImmutable

toString

public String toString()
Returns a textual representation of this Capabilities object.

Specified by:
toString in interface CapabilitiesImmutable
Overrides:
toString in class Object


Copyright 2010 JogAmp Community.