org.proteinshader.structure.visitor.modifiers
Class SegmentModifier

java.lang.Object
  extended by org.proteinshader.structure.visitor.modifiers.DrawableModifier
      extended by org.proteinshader.structure.visitor.modifiers.SegmentModifier

public class SegmentModifier
extends DrawableModifier

This helper class for the ModifierVisitor knows how to accept a Segment object and modify its attributes.

In addition to the regular methods for setting color on a Drawable object, a Segment can have its color set based on the type of AminoAcid it represents or the type of Region it belongs to.


Constructor Summary
SegmentModifier()
          Constructs an SegmentModifier.
 
Method Summary
 void clear()
          Clears the memory of what modifications have been requested.
 void modify(Segment segment)
          Sets the patterns texture, halftoning texture, Segment color, or decoration type as requested by SegmentModifier methods, and then calls on modify() of the DrawableModifier superclass.
 void setBendTexture(int bendTexture)
          Stores a memory that the Segment needs to have its OpenGL bend texture (an integer reference) set.
 void setColor(float red, float green, float blue)
          Stores a memory that the (red, green, blue) components of the RGBA color need to be set to the values given as arguments.
 void setDecoration(DecorationEnum decoration)
          Stores a memory that the decoration (PLAIN, WIREFRAME, TEXT_LABEL, or HALFTONING) needs to be set on the Segment.
 void setHalftoningTexture(int halftoningTexture)
          Stores a memory that the Segment needs to have its OpenGL halftoning texture (an integer reference) set.
 void setPatternsTexture(int patternsTexture)
          Stores a memory that the Segment needs to have its OpenGL patterns texture (an integer reference) set.
 void setRGBToDefault()
          Stores a memory that the (red, green, blue) components of the RGBA color need to be set to their default.
 void setSideChainStyle(SideChainEnum sideChainStyle, boolean displayAlphaCarbon)
          Stores a memory that the side chain display needs to be set.
 void setToAminoAcidColor()
          Stores a memory that the Segment should be set to the default color for the AminoAcid that it represents.
 void setToRegionColor()
          Stores a memory that the Segment should be set to the default color for the Region that it belongs to.
 
Methods inherited from class org.proteinshader.structure.visitor.modifiers.DrawableModifier
clearColorChangeMemory, modify, scaleRadius, setAlpha, setAlphaToDefault, setColor, setRadius, setRadiusToDefault, setRGBAToDefault, setSpecularExp, setSpecularExpToDefault, setVisibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SegmentModifier

public SegmentModifier()
Constructs an SegmentModifier.

Method Detail

setPatternsTexture

public void setPatternsTexture(int patternsTexture)
Stores a memory that the Segment needs to have its OpenGL patterns texture (an integer reference) set.

Parameters:
patternsTexture - the name (an integer) of an OpenGL texture object stored on the graphics card.

setHalftoningTexture

public void setHalftoningTexture(int halftoningTexture)
Stores a memory that the Segment needs to have its OpenGL halftoning texture (an integer reference) set.

Parameters:
halftoningTexture - the name (an integer) of an OpenGL texture object stored on the graphics card.

setBendTexture

public void setBendTexture(int bendTexture)
Stores a memory that the Segment needs to have its OpenGL bend texture (an integer reference) set.

Parameters:
bendTexture - the name (an integer) of an OpenGL texture object stored on the graphics card.

setToAminoAcidColor

public void setToAminoAcidColor()
Stores a memory that the Segment should be set to the default color for the AminoAcid that it represents.


setToRegionColor

public void setToRegionColor()
Stores a memory that the Segment should be set to the default color for the Region that it belongs to.


setColor

public void setColor(float red,
                     float green,
                     float blue)
              throws ColorOutOfRangeException
Stores a memory that the (red, green, blue) components of the RGBA color need to be set to the values given as arguments.

Overrides:
setColor in class DrawableModifier
Parameters:
red - component of the RGBA color.
green - component of the RGBA color.
blue - component of the RGBA color.
Throws:
ColorOutOfRangeException - if a color value is less than 0.0 or greater than 1.0.

setRGBToDefault

public void setRGBToDefault()
Stores a memory that the (red, green, blue) components of the RGBA color need to be set to their default.

Overrides:
setRGBToDefault in class DrawableModifier

setDecoration

public void setDecoration(DecorationEnum decoration)
Stores a memory that the decoration (PLAIN, WIREFRAME, TEXT_LABEL, or HALFTONING) needs to be set on the Segment.

Parameters:
decoration - the decoration type as a DecorationEnum.

setSideChainStyle

public void setSideChainStyle(SideChainEnum sideChainStyle,
                              boolean displayAlphaCarbon)
Stores a memory that the side chain display needs to be set. This method can also be used to set whether the alpha-carbon is shown.

Parameters:
sideChainStyle - SPACE_FILLING, BALLS_AND_STICKS, STICKS or NONE.
displayAlphaCarbon - determines if the alpha-carbon is shown.

modify

public void modify(Segment segment)
            throws ColorOutOfRangeException
Sets the patterns texture, halftoning texture, Segment color, or decoration type as requested by SegmentModifier methods, and then calls on modify() of the DrawableModifier superclass.

The modifications performed depend on which setter methods have been called since the last time clear() was called.

Parameters:
segment - the Segment to modify.
Throws:
ColorOutOfRangeException - if a color value (red, green, blue, alpha) is less than 0.0 or greater than 1.0.

clear

public void clear()
Clears the memory of what modifications have been requested.

Overrides:
clear in class DrawableModifier


Copyright © 2007-2008