org.proteinshader.structure.visitor
Class VisibilityVisitor

java.lang.Object
  extended by org.proteinshader.structure.visitor.Visitor
      extended by org.proteinshader.structure.visitor.VisibilityVisitor

public class VisibilityVisitor
extends Visitor

Knows how to traverse the Structure object hierarchy and find all visible Drawable objects.

Drawables marked as OPAQUE will be transferred to a list of opaque Segments or a list of opaque Atoms and Bonds. Drawables marked as TRANSLUCENT will be transferred to a single list of translucent Drawables.


Constructor Summary
VisibilityVisitor()
          Constructs a VisibilityVisitor.
 
Method Summary
 void includeAtoms(boolean includeAtoms)
          Determines whether Atoms should be included when the lists of opaque and translucent Drawables are filled.
 void includeBonds(boolean includeBonds)
          Determines whether Bonds should be included when the lists of opaque and translucent Drawables are filled.
 void includeSegments(boolean includeSegments)
          Determines whether Segments should be included when the lists of opaque and translucent Drawables are filled.
 void setListsToFill(List<Segment> opaqueSegments, List<Drawable> opaqueAtomsAndBonds, List<Drawable> translucentList)
          Sets the lists to place opaque and translucent Drawable objects in.
 void visit(Atom atom)
          Tests the visiblity of the Atom in order to determine if it should be transferred to the opaque Atoms and Bonds list or the translucent Drawables list.
 void visit(Bond bond)
          Tests the visiblity of the Bond in order to determine if it should be transferred to the opaque Atoms and Bonds or translucent Drawables list.
 void visit(Segment segment)
          Tests the visiblity of the Segment in order to determine if it should be transferred to the opaque Segments or translucent Drawables list.
 
Methods inherited from class org.proteinshader.structure.visitor.Visitor
clear, includeAAHetAndWater, setDebug, setMode, setMode, setMode, setMode, setMode, setMode, setVisitSegments, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisibilityVisitor

public VisibilityVisitor()
Constructs a VisibilityVisitor.

Method Detail

includeAtoms

public void includeAtoms(boolean includeAtoms)
Determines whether Atoms should be included when the lists of opaque and translucent Drawables are filled.

Parameters:
includeAtoms - true if Atoms should be included.

includeBonds

public void includeBonds(boolean includeBonds)
Determines whether Bonds should be included when the lists of opaque and translucent Drawables are filled.

Parameters:
includeBonds - true if Bonds should be included.

includeSegments

public void includeSegments(boolean includeSegments)
Determines whether Segments should be included when the lists of opaque and translucent Drawables are filled.

Parameters:
includeSegments - true if Segments should be included.

setListsToFill

public void setListsToFill(List<Segment> opaqueSegments,
                           List<Drawable> opaqueAtomsAndBonds,
                           List<Drawable> translucentList)
Sets the lists to place opaque and translucent Drawable objects in. The lists will be cleared before they are used.

Parameters:
opaqueSegments - the list to add OPAQUE Segment objects to.
opaqueAtomsAndBonds - the list to add OPAQUE Atoms and Bonds to.
translucentList - the list to add TRANSLUCENT Drawable objects to.

visit

public void visit(Atom atom)
           throws VisitorException
Tests the visiblity of the Atom in order to determine if it should be transferred to the opaque Atoms and Bonds list or the translucent Drawables list.

Overrides:
visit in class Visitor
Parameters:
atom - the Atom to test.
Throws:
VisitorException - if an error occurs during the traversal.

visit

public void visit(Bond bond)
           throws VisitorException
Tests the visiblity of the Bond in order to determine if it should be transferred to the opaque Atoms and Bonds or translucent Drawables list. The Bond will not be shown if the destination Atom is invisible.

Overrides:
visit in class Visitor
Parameters:
bond - the Bond to test.
Throws:
VisitorException - if an error occurs during the traversal.

visit

public void visit(Segment segment)
           throws VisitorException
Tests the visiblity of the Segment in order to determine if it should be transferred to the opaque Segments or translucent Drawables list.

Overrides:
visit in class Visitor
Parameters:
segment - the Segment to test.
Throws:
VisitorException - if an error occurs during the traversal.


Copyright © 2007-2008