edu.mines.jtk.sgl
Class BlendState

java.lang.Object
  extended by edu.mines.jtk.sgl.BlendState
All Implemented Interfaces:
State

public class BlendState
extends java.lang.Object
implements State

OpenGL blend state.

Version:
2005.05.31
Author:
Dave Hale, Colorado School of Mines

Constructor Summary
BlendState()
          Constructs blend state.
 
Method Summary
 void apply()
          Applies this OpenGL state.
 int getAttributeBits()
          Gets the OpenGL attribute bits for this state.
 java.awt.Color getColor()
          Gets the blend color.
 int getDfactor()
          Gets the blend function dfactor.
 int getEquation()
          Gets the blend equation.
 int getSfactor()
          Gets the blend function sfactor.
 boolean hasBlendFunction()
          Determines whether blend function is set.
 boolean hasColor()
          Determines whether blend color is set.
 boolean hasEquation()
          Determines whether blend equation is set.
 void setColor(java.awt.Color color)
          Sets the blend color.
 void setEquation(int mode)
          Sets the blend equation.
 void setFunction(int sfactor, int dfactor)
          Sets the blend function.
 void unsetColor()
          Unsets the blend color.
 void unsetEquation()
          Unsets the blend equation.
 void unsetFunction()
          Unsets the blend function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlendState

public BlendState()
Constructs blend state.

Method Detail

hasColor

public boolean hasColor()
Determines whether blend color is set.

Returns:
true, if set; false, otherwise.

getColor

public java.awt.Color getColor()
Gets the blend color.

Returns:
the blend color.

setColor

public void setColor(java.awt.Color color)
Sets the blend color.

Parameters:
color - the blend color.

unsetColor

public void unsetColor()
Unsets the blend color.


hasEquation

public boolean hasEquation()
Determines whether blend equation is set.

Returns:
true, if set; false, otherwise.

getEquation

public int getEquation()
Gets the blend equation.

Returns:
the blend equation.

setEquation

public void setEquation(int mode)
Sets the blend equation.

Parameters:
mode - the blend equation.

unsetEquation

public void unsetEquation()
Unsets the blend equation.


hasBlendFunction

public boolean hasBlendFunction()
Determines whether blend function is set.

Returns:
true, if set; false, otherwise.

getSfactor

public int getSfactor()
Gets the blend function sfactor.

Returns:
the blend function sfactor.

getDfactor

public int getDfactor()
Gets the blend function dfactor.

Returns:
the blend function dfactor.

setFunction

public void setFunction(int sfactor,
                        int dfactor)
Sets the blend function.

Parameters:
sfactor - the source factor.
dfactor - the destination factor.

unsetFunction

public void unsetFunction()
Unsets the blend function.


apply

public void apply()
Description copied from interface: State
Applies this OpenGL state. This method makes OpenGL state consistent with any attribute fields in this state that are currently set.

Specified by:
apply in interface State

getAttributeBits

public int getAttributeBits()
Description copied from interface: State
Gets the OpenGL attribute bits for this state. These bits indicate what OpenGL state is changed by the method State.apply(). If these bits are passed to glPushAttrib before calling State.apply(), then glPopAttrib will restore any OpenGL state that is changed by that method.

Specified by:
getAttributeBits in interface State