This helper method for the constructor adds a check box for turning whole
scene antialiasing on and a combo box for setting the number of times to
jitter the scene.
Creates a new AminoAcid with the type and Residue ID given as
arguments, adds the AminoAcid to the Chain's collection of
AminoAcids, and returns a reference to the new AminoAcid.
Creates a new Atom with the type and Atom ID given as arguments,
adds the Atom to the Residue's collection of Atoms, and
returns a reference to the new Atom.
Creates a new Atom with the type and Atom ID given as arguments,
adds the Atom to the Residue's collection of Atoms, and
returns a reference to the new Atom.
Creates a new atom with the atomID given as an argument, adds the
new Atom to the requested Model-Chain-AminoAcid, and then returns
a reference to the new Atom.
Creates a new BetaStrand with the BetaStrand ID given as an
argument, adds the BetaStrand to the Chain's collection of
BetaStrands, and returns a reference to the new BetaStrand.
The BetaStrand will be added to the equivalent Chain on each
Model, but this addition will only work if the sequence of
Residues that the BetaStrand refers to have already been added.
Creates a new Chain with the chainID given as an argument, adds
the Chain to the Model's collection of Chains, and returns a
reference to the new Chain.
Creates a new Helix with the Helix ID given as an argument, adds
the Helix to the Chain's collection of Helices, and returns a
reference to the new Helix.
The Helix will be added to the equivalent Chain on each Model, but
this addition will only work if the sequence of Residues that the
Helix refers to have already been added.
Creates a new atom with the atomID given as an argument, adds the
new Atom to the requested Model-Chain-(Heterogen or Water), and
then returns a reference to the new Atom.
Creates a new Heterogen with the name and Residue ID given as
arguments, adds the Heterogen to the Chain's collection of
Heterogens, and returns a reference to the new Heterogen.
Creates a new Water with the Residue ID given as an argument,
adds the Water to the Chain's collection of Waters, and returns
a reference to the new Water.
Modifies this quaternion by rotating it such that if it is
converted into a rotation matrix [N B T], the T vector will
match the tangent given as an argument.
Returns a copy of this quaternion that has been rotated such that
if it is converted into a rotation matrix [N B T], the T vector
will match the tangent given as an argument.
aim(GL) -
Method in class org.proteinshader.gui.viewing.Camera
Uses gluLookAt() to position and aim the camera.
ALPHA_HEIGHT -
Static variable in class org.proteinshader.graphics.Ribbon
The default ribbon height (y-axis dimension) for
an alpha-helix region is 3.0 angstroms.
ALPHA_RADIUS -
Static variable in class org.proteinshader.graphics.Tube
The default radius for a Helix region waist polygon
is 1.5 angstroms.
Returns the angle between the normals of the calling and argument
quaternions, where the normal is the first column vector of the
rotation matrix [N B T] that is the equivalent of a quaternion.
Determines if the entire scene should be antialiased (smoothed out) by
jittering the scene multiple times to the OpenGL accumulation buffer and
blending the images.
Applies the default scale to the Atoms (spheres) of whatever item
or items are currently selected in the RadioPanel, but only if the
current style is SPACE_FILLING or BALLS_AND_STICKS.
Applies the scale to the Atoms (spheres) of whatever item or items
are currently selected in the RadioPanel, but only if the style
is SPACE_FILLING or BALLS_AND_STICKS.
Turns on or off the ability of the halftoning shaders to soften aliasing
(jagged edges) by rendering translucent black silhouettes of tube and
ribbon segments (and using jitter) before calling on the halftoning shaders.
Turns on or off the ability of the halftoning shaders to soften aliasing
(jagged edges) by rendering translucent black silhouettes of tube and
ribbon segments (and using jitter) before calling on the halftoning shaders.
Turns on or off the ability of the halftoning shaders to soften aliasing
(jagged edges) by rendering translucent black silhouettes of tube and
ribbon segments (and using jitter) before calling on the halftoning shaders.
Turns on or off the ability of the halftoning shaders to soften aliasing
(jagged edges) by rendering translucent black silhouettes of tube and
ribbon segments (and using jitter) before calling on the halftoning shaders.
Constructs a BondPredictor with the Bond length tolerance
and minimum acceptable length set to DEFAULT_TOLERANCE and
DEFAULT_MIN_BOND_LENGTH, respectively.
Before Regions objects (Helix, BetaStrand, and Loop) are added
to the Structure, a rotation (the equivalent to a discrete Frenet
Frame) should be calculated for each AminoAcid.
Calculates a rotation matrix [N B T] based on the xyz-centers of
the three Atoms given as arguments, and then converts the rotation
matrix into a Quaternion that is returned.
If the xyz-point obtained by calculatePoint() is going to be
used to translate an object from the origin to the point, then it
is convenient for a vector to be returned instead of a point.
clear() -
Method in class org.proteinshader.structure.visitor.Visitor
Resets Visitor to default of ResidueMode.ALL,
RegionMode.NO_REGIONS, AAPortionMode.ENTIRE_AA, and restrictions
(AminoAcid type, Atom type, and Atom ID) to null.
This method is called automatically when the parent frame has been
made visible, so it will set this frame visible if it had been
hidden with the parent.
Creates a ChangeListener that will get the color selection from
the JColorChooser and calls on the ColorPanel to change the color
of whatever items are currently selected.
Creates a ChangeListener that will get the color selection from
the JColorChooser and calls on the Mediator to change the
background color of the canvas.
Creates an OpenGL display list for drawing a cylinder with
the radii, slices, stacks, and end caps specified in the
CylinderListInfo object given as an argument.
Creates an OpenGL display list for drawing a sphere with the
radius, number of slices, and number of stacks specified in the
SphereListInfo object given as an argument.
Creates an OpenGL display list for the thin sides of the ribbon,
and also calls on the createDisplayLists() method of superclass
ExtrudedShape to save the OpenGL display lists for the main
(broad surface) part of the ribbon and for the start and end caps.
After using the superclass createSegments() method, the
LocalFrames held by some of the Segment objects will be modified
so that beta-strands will have a pleated effect rather than a
twisted ribbon appearance.
This protected method should be called by the constructor of
concrete subclasses of Region so that the Segment objects for
the Region can be created with the appropriate type of
SegmentFactory.
Modifies the calling vector by calculating the cross product of
the calling vector and the vector given as an argument and storing
the result in the calling vector.
As a convienence for debugging, the toString() method
will return a representation of a point in the general
form "(x, y, z)", where the number of decimal places for
each value will be determined this decimal format String,
which is "0.000".
As a convenience for debugging, the toString() method
will return a representation of a quaternion in the general
form "(x, y, z, w)", where the number of decimal places for
each value will be determined this decimal format String,
which is "0.000".
As a convienence for debugging, the toString() method
will return a representation of a vector in the general
form "(x, y, z)", where the number of decimal places for
each value will be determined this decimal format String,
which is "0.000".
DECORATION -
Static variable in class org.proteinshader.structure.Segment
Provides an enumeration to specify if a Segment object should be plain,
with text labels, or with halftoning when the Segment is rendered as a
three-dimensional tube or ribbon.
The default tiling is 12, and is used to set the initial
number of slices and stacks for a generic sphere for
SPACE_FILLING style displays and a generic sphere for
BALLS_AND_STICKS style displays.
Returns the distance in angstroms between the xyz-center of the
calling Drawable object and the xyz-center of the Drawable object
given as an argument.
This abstract class defines attributes and methods that are shared by
all drawable objects, including the xyz-coordinates for the Drawable's
center and methods that will allow each object to be sorted based on
distance from the camera.
Draws the broad surfaces of a ribbon segment and remembers info
needed by any subsequent call to drawThinSidesOfRibbon(),
drawStartCap(), or drawEndCap().
field 1 = (serial field: 12-16)
field 2 = (serial field: 17-21)
field 3 = (serial field: 22-26)
field 4 = (serial field: 27-31)
It is legal for any (or even all 4) of these fields to be blank,
as the CONECT record may be used to specify salt bridges or
hydrogen bonds that are found in other fields.
Font files (glyph bitmaps) and their associated configuration
file ('.conf' files) must be in the fonts directory, which
has the relative pathname '/./../fonts/'.
Generates a 4 x 4 rotation matrix that is equivalent to this quaternion,
but returns it as a linear array of 16 elements so that it can be used
with Java Bindings for OpenGL.
Generates a 3 x 3 rotation matrix (actually 3 column vectors) that
is equivalent to this quaternion, assuming that the quaternion has
already been normalized (such that x^2 + y^2 + z^2 + w^2 = 1).
The concrete subclasses of this abstract class are used to store
information on an OpenGL display list that hold the commands to draw
a geometric object.
Returns the angstrom per pixel conversion factor, which is expected to be
set by the Camera class after the object to camera distance has been
calculated.
Returns the CylinderListInfo object that holds the information
on an OpenGL display list for a cylinder to be used for a
BALLS_AND_STICKS style display.
Returns the name (an integer) of an OpenGL texture object (stored
on the graphics card) that can be used as a second texture for
adding extra lines in the middle of segments that have a sharp
bend to them.
Returns the full name of the Segment, which is a concatenation of
the structureID, modelID, regionID, and residueID (with a single
blank space between IDs).
Returns the name (an integer) of an OpenGL texure object that can
be used for real-time halftoning (or returns zero if no such
texture object is associated with this Segment).
Uses SLERP (Spherical Linear intERPolation) and Hermite
interpolation to generate the requested number of LocalFrames
from the start frame to the end frame, inclusive.
Returns a reference to the next Segment with the same region so that
the visiblity status of the next Segment can be checked before deciding
to render a start cap for the current tube or ribbon segment.
Returns the name (an integer) of an OpenGL texure object that can
be used for applying a pattern onto the surface of this Segment
(or returns zero if there is no texture object for applying a
pattern).
Returns the Texture objects that were created with the
loadTextures() method and are intended for use as patterns to
apply to tubes and ribbons drawn in color (rather than
halftoning).
Returns a reference to the previous Segment with the same region so that
the visiblity status of the previous Segment can be checked before
deciding to render a start cap for the current tube or ribbon segment.
After calling on getSelectedFile() of the JFileChooser parent class, this
method will check that the filename has the correct extension based on the
image format type (unless the file is null, in which case null will still
be returned).
Returns the VisibilityMenu, which has methods for enabling/disabling
or selecting/deselecting a menu item ('Amino Acids Allowed',
'Heterogens Allowed', or 'Water Allowed').
Returns the x-coordinate of the top left corner of the glyph.
getX1() -
Method in class org.proteinshader.graphics.typography.Glyph
Returns the x-coordinate of the top left corner of the glyph
(this coordinate is used for extracting the glyph from the
larger image file with several glyphs).
Returns the x-coordinate of the bottom right corner of the glyph.
getX2() -
Method in class org.proteinshader.graphics.typography.Glyph
Returns the x-coordinate of the bottom right corner of the glyph
(this coordinate is used for extracting the glyph from the
larger image file with several glyphs).
getY() -
Method in class org.proteinshader.structure.Drawable
Returns the y-coordinate of the Drawable's center.
getY() -
Method in class org.proteinshader.structure.Model
Returns the y-coordinate for the center of gravity of the Model.
Returns the y-coordinate of the top left corner of the glyph.
getY1() -
Method in class org.proteinshader.graphics.typography.Glyph
Returns the y-coordinate of the top left corner of the glyph
(this coordinate is used for extracting the glyph from the
larger image file with several glyphs).
Returns the y-coordinate of the bottom right corner of the glyph.
getY2() -
Method in class org.proteinshader.graphics.typography.Glyph
Returns the y-coordinate of the bottom right corner of the glyph
(this coordinate is used for extracting the glyph from the
larger image file with several glyphs).
getZ() -
Method in class org.proteinshader.structure.Drawable
Returns the z-coordinate of the Drawable's center.
getZ() -
Method in class org.proteinshader.structure.Model
Returns the z-coordinate for the center of gravity of the Model.
Returns true if the last call to getGlyphs(text) had any unknown
characters in the String (unknown in the sense that the GlyphSet
did not have a Glyph for a character).
HALF_FOVY -
Static variable in class org.proteinshader.gui.viewing.Camera
Constructs a Hermite object by using the input points and vectors
to calculate and store the coefficients needed for the cubic
equations for x(t), y(t), and z(t).
Constructs a Hermite object by using the input vectors to
calculate and store the coefficients needed for the cubic
equations for x(t), y(t), and z(t).
This interface declares a processID() method that is intended to be
used as a helper method for constructors that need to perform tests
and/or any modifications on an ID.
IMAGE_FILE -
Static variable in class org.proteinshader.gui.components.menubar.HelpMenu
Holds path to the image file for the "About ProteinShader" box.
Used to report that a Region (Helix or BetaStrand) is invalid because
its start and end Residue IDs could not be matched to an existing
sequence of Residues in a Chain.
Uses the Atom IDs (from Atom name field in a PDB record) and the
AminoAcid type to determine if the Atoms should have a double Bond
(assuming that they both belong to the same AminoAcid).
Loads the Patterns menu with the current set of textures from the Mediator,
and sets the selected item to the second item in the menu (the first
item is always 'None').
This concrete subclass of Region holds information on
the general "loop" regions found between well-defined
regions of secondary structure (helices and beta-strands).
Performs some simple tests (constructors, setXYZ, cross product,
dot product, and normalization) with Vec3d objects, and a few
tests with Point3d objects.
Uses a PDBStructureReader to read a PDB file and create a
Structure, and then uses a WriterVisitor to write the contents
of the Structure to an output file.
Uses a PDBStructureReader to read a PDB file and create a
Structure, and then uses a WriterVisitor to write the contents of
the Structure to an output file.
Uses a PDBStructureReader to read a PDB file and create a
Structure, and then uses a WriterVisitor to write the contents
of the Structure to an output file.
The maximum number of slices for cylinders cached by this
class is 14, while the minimum will be the MIN_SLICES
declared in class Cylinder, which is 3.
MAX_SPEED -
Static variable in class org.proteinshader.gui.components.controlpanel.MotionPanel
The maximum rotation speed in degrees per second is 90.
The maximum tiling number (slices and stacks) for spheres
cached by this class is 57, while the minimum will be the
MIN_TILING declared in class Sphere, which is 3.
This interface specifies the methods for the single central mediator
object that allows communication between objects of the gui, the data
structure, and the renderer.
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.
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.
This helper method for applyVisibility() sets up whatever
DrawableModifiers are needed and then calls on the modifyHelices()
method of the radio panel.
This helper method for applyVisibility() sets up the AtomModifier
and the BondModifier and then calls on the modifySelected() method
of the radio panel.
This helper method for applyVisibility() sets up whatever
DrawableModifiers are needed and then calls on the
modifySelected() method of the radio panel.
This helper method for applyVisibility() sets up whatever
DrawableModifiers are needed and then calls on the modifyStrands()
method of the radio panel.
Holds the classes needed to manage OpenGL display lists, which are used
to cache reusable geometry for spheres, cylinders, ribbon segments, and
tube segments.
Holds a testing utility, class SegmentRenderer, which can be used for
drawing ribbon and tube segments on-the-fly, rather than using cached
geometry in the form of OpenGL display lists.
Holds all of the Swing GUI components and their associated listeners,
including class Renderer, which is registered as a listener for the GLCanvas
object that is used a drawing surface.
The key classes in this package are Hermite and Quaternion, which are needed
for generating the ribbons and tubes that are used to represent the backbone
of a protein in a cartoon-type display.
Holds the classes that store information from a Protein Data Bank file:
Structure, Model, Chain, AminoAcid, Heterogen, Water, Atom, Bond, Helix,
BetaStrand, Loop, etc.
This concrete implementation of interface StructureReader reads a
protein structure entry from a '.pdb' file formated according to the
PDB Contents Guide (Version 2.2, 20 Dec 1996) and creates a
Structure.
Setting print angstroms to true will cause object to camera distances to be
printed to standard out for testing and debugging purposes (and will also
cause tiling numbers to be printed if automatic tiling is in use).
If automatic tiling is in use, setting this method to true will
cause the tiling numbers to be printed to standard out for
testing and debugging purposes.
If automatic tiling is in use, giving this method an argument of
true will cause the tiling numbers to be printed to standard out
for testing and debugging purposes.
If automatic tiling is in use, giving this method an argument of
true will cause the tiling numbers to be printed to standard out
for testing and debugging purposes.
For each value in the array t, the slerp() method of class
Quaternion will be used to calculate and print an interpolated
Quaternion between the start and end Quaternions.
This class is used to create a quaternion, a four-dimensional
complex number that is typically used to represent a rotation in
three-dimensional space.
Reads the fpsfont.glf file and stores an OpenGL texture object with the
characters to be used for printing frames per second on the canvas during
an animation.
If an AminoAcid does not have an adjacent AminoAcid before
or after it, then the Segment representing the AminoAcid will
have it length determined by this constant, which currently
is set at 2.6 angstroms in length.
Stores information on multiple OpenGL display lists that can be used
for rendering Segments with different degrees of detail (this first
version only holds one OpenGL display list for each Segment, but a
future version will likely hold multiple OpenGL display lists for
each Segment (with varying tiling number) so that the level of detail
to be used can be calculated based on camera distance).
This class is intended only as a testing utility: it allows tube or ribbons
segments to be drawn on-the-fly, rather than from OpenGL display lists, soley
for the purpose of measure the performance advantage of caching geometry in
OpenGL display lists.
Creates a SeparatorListCellRenderer that will add a separator (a
dividing line) at the top of each menu item with a String matching
one of the Strings given the constuctor.
The Camera class should use this method to set a conversion factor that
will allow an x or y axis distance in viewport pixels be converted to an
x or y distance in world coordinates (angstroms) at the current object to
camera distance.
If automatic tiling is set to true, then the level of detail
(tiling number) for a sphere or cylinder will be calculated based
on the camera distance for each Atom or Bond, respectively.
If automatic tiling is set to true, then the level of detail
(tiling number) for a sphere or cylinder will be calculated based
on the camera distance for each Atom or Bond, respectively.
If automatic tiling is set to true, then the level of detail
(tiling number) for a sphere or cylinder will be calculated based
on the camera distance for each Atom or Bond, respectively.
Sets the name (an integer) of an OpenGL texture object (stored on
the graphics card) that can be used as a second texture for adding
extra lines in the middle of segments that have a sharp bend to
them.
Sets the traversal mode with regard to what kind of Residues
should be visited: ALL, AMINO_ACIDS, AA_AND_HETEROGENS,
AA_AND_WATERS, HETEROGENS, WATERS, HET_AND_WATERS, or NONE.
Sets the name (an integer) of an OpenGL texture object (stored on
the graphics card) that can be used for applying a pattern to the
surface of this Segment.
The ShaderManager is only needed because of an apparent bug on some
Mac OS X machines where material color can only be set once after a
custom shader is set, so to draw Frenet frames with more than one
color, the shaders must be reset each time.
Applies the requested side chain style (NONE, SPACE_FILLING,
BALLS_AND_STICKS, or STICKS) to whatever item or items are currently
selected in the RadioPanel.
Sets the number of slices that the nearly circular waist polygon
would be divided into if a line was drawn from the center of the
polygon to each vertex.
Sets the number of slices that the nearly circular waist polygon
would be divided into if a line was drawn from the center of the
polygon to each vertex.
Specifies the types of vertex and fragment shader pairs used in
the ProteinShader program, and provides a place to specify the
names of the shader files.
Sets the default filename for saving a file and then calls on the
showSaveDialog(c) of the super class, JFileChooser, to pop open a
"Save File" file chooser dialog.
Uses SLERP (Spherical Linear intERPolation) to calculate a
Quaternion (a rotation) at any point t between the calling
Quaternion and the argument Quaternion.
After all BetaStrand objects have been added to the Chain, this method can
be called to sort the linked hash map (the linked list part does have order)
according to the starting residue for each beta-strand.
Iterates through all Chains of the Model and modifies the linked hash map
of beta-strands so that when an iterator for beta-strands is handed over
(based on the linked list part) the beta-strands will be ordered according
to the starting amino acid.
Iterates through all Models of the Structure and modifies the linked hash
map of beta-strands for each Chain so that when an iterator for beta-strands
is handed over (based on the linked list part) the beta-strands will be
ordered according to the starting amino acid.
Constructs a SpringLoadedJFrame using default width and height
factors based on whether the spring-loaded frame is attached to
its parent frame at the TOP, BOTTOM, LEFT, or RIGHT (see comments
for DEFAULT_SHORT_FACTOR and DEFAULT_LONG_FACTOR).
Knows how to get numbers (such as zyz-coordinates and colors) from a
Drawable object (Atom, Bond, or Segment) and plug them into the right
graphics class for rendering a Shape (Sphere, Cylinder, or Segment).
Provides a menu for selecting the style to use when displaying a structure:
Cartoon (Tubes or Ribbons) or Atom (Space Filling, Balls-andSticks, or Sticks).
TEST A: Creates two matrices with known quaternion solutions and
prints the matrices, the known solutions, and the solutions
generated by class Quaternion.
Uses a TextureFactory object to read textures from files and then
stores Java Texture objects that have references to OpenGL texture
objects and menu names that can be used for selecting the textures.
As a convenience for debugging, the toString() method returns
the xyzw-components of the quaternion and the translation vector
in the form "{ (x, y, z, w), (x, y, z) }".
Draws a segment of a three-dimensional tube by using a waist polygon
that approximates a circle as the number of vertices in the waist
polygon becomes large.
Tube() -
Constructor for class org.proteinshader.graphics.Tube
Constructs a Tube object that can be used for rendering tubes with
a circular-shaped waist polygon.
Creates the vertices for a segment of a three-dimensional tube by
using a waist polygon that approximates a circle as the number of
vertices in the waist polygon becomes large.
Updates the tiling number text label below the 'Cylinder Caps'
combo box menu, updates the spinner value to match, and also sets
the 'Cylinder Caps' radio button as being selected.
Updates the tiling number text label below the 'Cylinders' combo
box menu, updates the spinner value to match, and also sets the
'Cylinders' radio button as being selected.
During a rotation animation the Renderer will call this method to
update whatever GUI components display the current frames per
second the animation is operating at.
During a rotation animation the Renderer will call this method to
update the ControlPanel with the current frames per second the
animation is operating at.
This method should be called whenever a new Model has been
selected, so that the ModifierPanel can call on any of its
subpanels that need to update themselves.
Updates the tiling number text label below the "Spheres" combo
box menu, updates the spinner value to match, and also sets the
"Spheres" radio button as being selected.
Gets the speed values from the text fields and uses them to update
the sliders (without firing a change event for the sliders), and,
if an animation is in progress, the new speeds will be forwarded
to the Mediator.
Uses the speed from the X-Axis slider to update the X-Axis text
field, and, if an animation is in progress, the new speed will be
sent to the Mediator.
Uses the speed from the Y-Axis slider to update the Y-Axis text
field, and, if an animation is in progress, the new speed will be
sent to the Mediator.
Uses Atom distances to generate Bonds within the AminoAcid, and
also uses the memory of the last carbonyl carbon seen to check for
a possible peptide Bond.
If the Water includes hydrogen atoms, then Bonds will be created
between the oxygen and each hydrogen (after checking that the Bond
lengths are reasonable).
Checks if the Atom is a possible Bond destination Atom for any
previously seen Atoms of the same Residue, and then adds the Atom
to the list of Atoms to remember.
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.
This interface requires an accept( Visitor ) method, which should be
used to call back to the Visitor so that the Visitor can perform one
or more operations on the Visitable object.
This self-propelled Visitor knows how to traverse the hierarchy of
data objects contained by a Structure.
Visitor() -
Constructor for class org.proteinshader.structure.visitor.Visitor
No-arg constuctor sets ResidueMode.ALL, RegionMode.NO_REGIONS,
AAPortionMode to ENTIRE_AA, restrictions (AminoAcid type, Atom
type, and Atom ID) to null, and debug to false.
This method is called automatically when the parent frame is
deiconified, and if this frame was hidden when the parent had been
iconified, then this frame will be made visible again.