org.proteinshader.structure.visitor.modifiers
Class AtomModifier

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

public class AtomModifier
extends DrawableModifier

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

Currently, only the ball radius attribute (used for stick-and-ball models) is specific to Atom: the rest of the modifications are common to all Drawables.


Constructor Summary
AtomModifier()
          Constructs an AtomModifier.
 
Method Summary
 void clear()
          Clears the memory of what modifications have been requested.
 void modify(Atom atom)
          Modifies the ball radius if requested, and then calls on modify() of the superclass, DrawableModifier, to apply any other requested modifications such as visibility, color, or radius for space-filling model.
 void scaleBallRadius(double ballScaleFactor)
          Stores a memory that the ball radius (used in stick-and-ball models) needs to be multiplied by the scale factor given as an argument.
 void setBallRadius(double ballRadius)
          Stores a memory that the ball radius needs to be set to the value given as an argument.
 void setBallRadiusToDefault()
          Stores a memory that the ball radius needs to be set to its default.
 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 setRGBToDefault()
          Stores a memory that the (red, green, blue) components of the RGBA color need to be set to their default.
 void setToAminoAcidColor()
          Stores a memory that the Atom should be set to the default color for the AminoAcid 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

AtomModifier

public AtomModifier()
Constructs an AtomModifier.

Method Detail

setToAminoAcidColor

public void setToAminoAcidColor()
Stores a memory that the Atom should be set to the default color for the AminoAcid 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

scaleBallRadius

public void scaleBallRadius(double ballScaleFactor)
Stores a memory that the ball radius (used in stick-and-ball models) needs to be multiplied by the scale factor given as an argument. A scale factor of 0 or less will be ignored.

Parameters:
ballScaleFactor - the ball scale factor to multiply by.

setBallRadius

public void setBallRadius(double ballRadius)
Stores a memory that the ball radius needs to be set to the value given as an argument.

Parameters:
ballRadius - the ball radius as a double.

setBallRadiusToDefault

public void setBallRadiusToDefault()
Stores a memory that the ball radius needs to be set to its default.


modify

public void modify(Atom atom)
            throws ColorOutOfRangeException
Modifies the ball radius if requested, and then calls on modify() of the superclass, DrawableModifier, to apply any other requested modifications such as visibility, color, or radius for space-filling model. The modifications performed depend on which setter methods have been called since the last time clear() was called.

Parameters:
atom - the Atom 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