|
JMV 0.80 Programmer's Documentation | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MolecGraphics
Responsible for drawing and updating the molecule graphics.
Field Summary | |
static int |
BACK
Enumeration indicating back light |
javax.media.j3d.DirectionalLight |
backLight
DirectionalLight for back light |
static int |
BGR
Enumeration for color gradient blue-green-red |
static int |
BONDS
Enumeration indicating Bonds drawing representation |
static int |
BW
Enumeration for color gradient black-white |
static int |
BWR
Enumeration for color gradient blue-white-red |
static int |
CARTOON
Enumeration indicating mixed drawing representations |
ColorCategory |
cc
ColorCategory for determining and changing colors |
static int |
CHAIN
Enumeration indicating coloring by atom chain |
static int |
CPK
Enumeration indicating CPK drawing representation |
javax.media.j3d.ExponentialFog |
exponentialFog
Fog for depth cueing |
static int |
FRONT
Enumeration indicating front light |
javax.media.j3d.DirectionalLight |
frontLight
DirectionalLight for front light |
static int |
INDEX
Enumeration indicating coloring by atom index |
static int |
LICORICE
Enumeration indicating Cartoon drawing representation |
static int |
LINES
Enumeration indicating Lines drawing representation |
static int |
LOWER
Enumeration indicating lower light |
javax.media.j3d.DirectionalLight |
lowerLight
DirectionalLight for lower light |
javax.media.j3d.BranchGroup |
m_bgCalculating
|
javax.media.j3d.BranchGroup |
m_bgLoading
|
util.SoftHashMap |
m_map
SoftHashMap for storing BranchGroups |
java.lang.String |
m_strFilename
filename of the current molecule |
static int |
MIX
Enumeration indicating Licorice drawing representation |
static int |
NAME
Enumeration indicating coloring by atom name |
static int |
RESNAME
Enumeration indicating coloring by atom residue |
static int |
RGB
Enumeration for color gradient red-green-blue |
static int |
RWB
Enumeration for color gradient red-white-blue |
static int |
SEGNAME
Enumeration indicating coloring by atom segment |
static int |
STEREO_OFF
Enumeration indicating Stereo mode off |
static int |
STEREO_ON
Enumeration indicating Stereo mode on |
static int |
STRUCTURE
Enumeration indicating coloring by structure |
static int |
TRACE
Enumeration indicating Trace drawing representation |
static int |
TUBE
Enumeration indicating Tube drawing representation |
static int |
UPPER
Enumeration indicating upper light |
javax.media.j3d.DirectionalLight |
upperLight
DirectionalLight for upper light |
static int |
VDW
Enumeration indicating VDW drawing representation |
static int |
VRML
Enumeration indicating a VRML scene |
static int |
WB
Enumeration for color gradient white-black |
Constructor Summary | |
MolecGraphics()
Constructor |
Method Summary | |
void |
addUtilities(javax.media.j3d.BranchGroup objRoot)
Adds lights, rotations to the main branch group |
void |
changeColors(Molecule molec,
int rep,
int newScheme)
Changes the color of an already drawn molecule |
void |
changeColorsInBranchGroup(javax.media.j3d.BranchGroup bg,
Molecule molec,
int rep,
int newScheme)
Changes the color for a BranchGroup containing a molecule (or part of a molecule) |
void |
changeDepth(int on)
Toggles depth cueing |
void |
changeGradient(int grad)
Sets gradient based on the selected option |
void |
changeLights(int light)
Turns a light in the scene on or off |
void |
changeStereoMode(int mode)
Sets the stereo mode |
static javax.media.j3d.Appearance |
createAPR(float r,
float g,
float b)
Creates an Appearance with the given color uses default shininess, etc |
javax.media.j3d.BranchGroup |
createSceneGraph(Molecule molecule,
int rep,
int colorScheme,
java.util.Vector v)
Creates the entire sceneGraph used when changing molecules |
IndexedBranchGroup |
drawAllCylinders(Molecule molecule,
int colorScheme,
float scale)
Draws the bonds of a molecule as cylinders |
javax.media.j3d.BranchGroup |
drawAtoms(Molecule molec,
java.util.Vector v)
Draws atoms on a per atom basis |
IndexedBranchGroup |
drawBondAtom(Molecule molec,
int colorScheme,
float scale,
int index)
Draws an atom in Bond representation |
javax.media.j3d.BranchGroup |
drawBonds(Molecule molecule,
int colorScheme)
Draws line representation |
javax.media.j3d.TransformGroup |
drawCylinder(float[] coords,
int startPt,
int endPt,
javax.media.j3d.Appearance currentAppearance,
float scale,
boolean full)
Creates a single cylinder |
javax.media.j3d.Shape3D |
drawLineAtoms(Molecule molecule,
PubSynchBean.DrawAtoms da)
Draws some atoms of a molecule in Lines representation |
javax.media.j3d.BranchGroup |
drawMolecule(Molecule molecule,
int rep,
int colorScheme)
Returns a branchGroup from the given molecule, with the given representation used when changing the representation. |
javax.media.j3d.TransformGroup |
drawOneSphere(Molecule molecule,
int colorScheme,
float scale,
int index)
Draws one atom as a sphere for a given molecule |
javax.media.j3d.TransformGroup |
drawOneSphere(Molecule molecule,
int colorScheme,
float scale,
int index,
boolean radScale)
Draws one atom as a sphere for a given molecule |
IndexedBranchGroup |
drawSpheres(Molecule molecule,
int colorScheme,
float scale)
Draws atoms as spheres for a given molecule |
IndexedBranchGroup |
drawSpheres(Molecule molecule,
int colorScheme,
float scale,
boolean radScale)
Draws atoms as spheres for a given molecule |
javax.media.j3d.BranchGroup |
drawTrace(Molecule molec,
int colorScheme)
Draws a molecule in Trace representation |
javax.media.j3d.BranchGroup |
drawTraceAtom(Molecule molec,
int colorScheme,
int index)
Draws a specified atom in Trace representation |
javax.media.j3d.BranchGroup |
drawTube(Molecule molec,
int colorScheme,
float scale)
Draws the molecule in Tube representation |
javax.media.j3d.BranchGroup |
drawTubeAtom(Molecule molec,
int colorScheme,
float scale,
int index)
Draw a single atom in Tube rep |
float[] |
getColorArray(Molecule molec,
int scheme)
Gets the array of colors for a LineArray |
float[] |
getColorArray(Molecule molec,
int scheme,
java.util.Vector v)
Creates the array of colors for a LineArray |
void |
init(java.awt.Panel p)
Initializes the scene and add it to the panel for display |
void |
loadVRMLFile(java.lang.String file)
|
static javax.media.j3d.BranchGroup |
messageScreen(java.lang.String strMessage)
Creates a quick message screen to display (such as while a molecule is being loaded and created) |
int |
redraw(Molecule molec,
int rep,
int colorScheme,
boolean redrawScene)
Redraws molecule. |
int |
redraw(Molecule molec,
int rep,
int colorScheme,
boolean redrawScene,
java.util.Vector v)
Redraws molecule. |
static javax.media.j3d.BranchGroup |
titleScreen()
Displays the JMV title screen |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public ColorCategory cc
public javax.media.j3d.DirectionalLight frontLight
public javax.media.j3d.DirectionalLight backLight
public javax.media.j3d.DirectionalLight upperLight
public javax.media.j3d.DirectionalLight lowerLight
public javax.media.j3d.ExponentialFog exponentialFog
public static final int STEREO_OFF
public static final int STEREO_ON
public static final int LINES
public static final int VDW
public static final int BONDS
public static final int CPK
public static final int TRACE
public static final int TUBE
public static final int LICORICE
public static final int CARTOON
public static final int MIX
public static final int VRML
public static final int NAME
public static final int INDEX
public static final int RESNAME
public static final int CHAIN
public static final int SEGNAME
public static final int STRUCTURE
public static final int FRONT
public static final int BACK
public static final int UPPER
public static final int LOWER
public static final int RGB
public static final int BGR
public static final int RWB
public static final int BWR
public static final int BW
public static final int WB
public java.lang.String m_strFilename
public util.SoftHashMap m_map
public javax.media.j3d.BranchGroup m_bgLoading
public javax.media.j3d.BranchGroup m_bgCalculating
Constructor Detail |
public MolecGraphics()
Method Detail |
public static javax.media.j3d.Appearance createAPR(float r, float g, float b)
r
- red componentg
- green componentb
- blue component
public void changeGradient(int grad)
grad
- the gradient enumeration to usepublic javax.media.j3d.BranchGroup drawBonds(Molecule molecule, int colorScheme)
molecule
- the molecule to drawcolorScheme
- the color scheme to use
public javax.media.j3d.Shape3D drawLineAtoms(Molecule molecule, PubSynchBean.DrawAtoms da)
molecule
- the molecule to drawda
- the DrawAtoms containing the color scheme and Vector of which
atoms to draw
PubSynchBean.DrawAtoms
public javax.media.j3d.BranchGroup drawMolecule(Molecule molecule, int rep, int colorScheme)
molecule
- the molecule to drawrep
- the representation (Lines, VDW, etc)colorScheme
- the color scheme to use
public javax.media.j3d.BranchGroup createSceneGraph(Molecule molecule, int rep, int colorScheme, java.util.Vector v)
molecule
- the new Molecule object to drawrep
- the representation (lines, vdw, etc).colorScheme
- the colorization to use when coloring atomsv
- Vector of PubSynchBean.DrawAtoms's. Only used if rep == MIX.
public void addUtilities(javax.media.j3d.BranchGroup objRoot)
objRoot
- the main branchGrouppublic void init(java.awt.Panel p)
p
- Panel to add scene topublic int redraw(Molecule molec, int rep, int colorScheme, boolean redrawScene)
molec
- the new molecule to drawrep
- the representationcolorScheme
- the color scheme to useredrawScene
- redraws the entire scene if true
(entirely new molecule), else just redraws the molecule
(new representation of already drawn molecule)public int redraw(Molecule molec, int rep, int colorScheme, boolean redrawScene, java.util.Vector v)
molec
- the new molecule to drawrep
- the representationcolorScheme
- the color scheme to useredrawScene
- redraws the entire scene if true
(entirely new molecule), else just redraws the molecule
(new representation of already drawn molecule)v
- Vector of PubSynchBean.DrawAtoms's. Only used if rep==MIX.
(otherwise null)public void changeStereoMode(int mode)
mode
- STEREO_ON to turn it on or STEREO_OFF to turn it offpublic void changeColorsInBranchGroup(javax.media.j3d.BranchGroup bg, Molecule molec, int rep, int newScheme)
bg
- the BranchGroup to change the color ofmolec
- the molecule to be coloredrep
- the current representation of the moleculenewScheme
- the new color scheme to use in coloring the moleculepublic void changeColors(Molecule molec, int rep, int newScheme)
molec
- the molecule to be coloredrep
- the current representation of the moleculenewScheme
- the new color scheme to use in coloring the moleculepublic float[] getColorArray(Molecule molec, int scheme, java.util.Vector v)
molec
- the Molecule to get the colors forscheme
- the color scheme to get colors forv
- Vector of Integers of which atoms to get colors for
public float[] getColorArray(Molecule molec, int scheme)
molec
- the Molecule to get the colors forscheme
- the color scheme to get colors for
public javax.media.j3d.TransformGroup drawCylinder(float[] coords, int startPt, int endPt, javax.media.j3d.Appearance currentAppearance, float scale, boolean full)
coords
- the coordinates for the moleculestartPt
- the index of the first atomendPt
- the index of the second atomcurrentAppearance
- the Appearance used to color the cylinderscale
- factor to scale the cylinder radius. The original radius is
determined in MolecGraphicsProperties.full
- if true, draws a full cylinder from startPt to endPt
if false, draws a cylinder starting at startPt, and
ending 1/2 way between startPt and endPt.
public IndexedBranchGroup drawAllCylinders(Molecule molecule, int colorScheme, float scale)
molecule
- the molecule to draw bonds forcolorScheme
- the color scheme used to color the cylindersscale
- factor to scale the cylinder radius. The original radius is
determined in MolecGraphicsProperties.
public IndexedBranchGroup drawSpheres(Molecule molecule, int colorScheme, float scale)
molecule
- the Molecule to drawcolorScheme
- the color scheme used to color the spheresscale
- the factor to scale the spheres. The original sizes are
determined by atom name
public IndexedBranchGroup drawSpheres(Molecule molecule, int colorScheme, float scale, boolean radScale)
molecule
- the Molecule to drawcolorScheme
- the color scheme used to color the spheresscale
- the factor to scale the spheres. The original sizes are
determined by atom nameradScale
- true if scale based on the atom type, false if not
public javax.media.j3d.TransformGroup drawOneSphere(Molecule molecule, int colorScheme, float scale, int index)
molecule
- the Molecule the atom is incolorScheme
- the color scheme used to color the spherescale
- the factor to scale the sphere. The original sizes are
determined by atom nameindex
- the atom index of the atom to draw
public javax.media.j3d.TransformGroup drawOneSphere(Molecule molecule, int colorScheme, float scale, int index, boolean radScale)
molecule
- the Molecule the atom is incolorScheme
- the color scheme used to color the spherescale
- the factor to scale the sphere. The original sizes are
determined by atom nameindex
- the atom index of the atom to drawradScale
- true if you scale based on the atom type,
false if not
public javax.media.j3d.BranchGroup drawTrace(Molecule molec, int colorScheme)
molec
- the molecule to drawcolorScheme
- the color scheme to use
public javax.media.j3d.BranchGroup drawTraceAtom(Molecule molec, int colorScheme, int index)
molec
- the molecule the atom is incolorScheme
- the color scheme used to color the atomindex
- the atom index of the atom
public IndexedBranchGroup drawBondAtom(Molecule molec, int colorScheme, float scale, int index)
molec
- the molecule the atom is incolorScheme
- the color scheme to usescale
- the scale of the cylinder radiusindex
- the atom index of the atom to draw
public javax.media.j3d.BranchGroup drawTube(Molecule molec, int colorScheme, float scale)
molec
- the molecule to drawcolorScheme
- the color scheme to usescale
- the scale for the cylinder radius
public javax.media.j3d.BranchGroup drawTubeAtom(Molecule molec, int colorScheme, float scale, int index)
molec
- the moleculecolorScheme
- the color scheme used to color the atomscale
- the scale for cylinder radiusindex
- the index of the atom to draw
public javax.media.j3d.BranchGroup drawAtoms(Molecule molec, java.util.Vector v)
molec
- the molecule to drawv
- the Vector of PubSynch.DrawAtoms's to draw
PubSynchBean.DrawAtoms
public void changeLights(int light)
light
- the index of the light to togglepublic void changeDepth(int on)
on
- 1 if it is to be turned on, else 0public static javax.media.j3d.BranchGroup titleScreen()
public static javax.media.j3d.BranchGroup messageScreen(java.lang.String strMessage)
public void loadVRMLFile(java.lang.String file)
|
Copyright (C) 2000-2002 The Board of Trustees of the University of Illinois | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |