cct.j3d
Class Java3dUniverse

java.lang.Object
  extended by cct.modelling.MolecularEditor
      extended by cct.j3d.Java3dUniverse
All Implemented Interfaces:
GraphicsRendererInterface, MoleculeRendererInterface, TreeSelectorInterface, MolecularProperties, OperationsOnAtoms, java.awt.event.ActionListener, java.util.EventListener

public class Java3dUniverse
extends MolecularEditor
implements MolecularProperties, OperationsOnAtoms, GraphicsRendererInterface, TreeSelectorInterface, java.awt.event.ActionListener, MoleculeRendererInterface


Field Summary
static java.lang.String ATOM_NODE
           
(package private)  javax.media.j3d.Appearance atomAppear
           
(package private)  boolean atomInfoPopup
           
(package private)  java.util.ArrayList atomLabels
           
(package private)  javax.vecmath.Color3f atomLabelsColor
           
(package private)  AtomLabelsDialog atomLabelsDialog
           
(package private)  java.awt.Font atomLabelsFont
           
(package private)  java.lang.String atomLabelsFontName
           
(package private)  int atomLabelsFontSize
           
(package private)  int atomLabelsFontStyle
           
(package private)  java.util.ArrayList<AtomNode> atomNodes
           
static java.lang.String BOND_NODE
           
(package private)  java.util.ArrayList<BondNode> bondNodes
           
(package private)  int bondRenderingStyle
           
(package private)  javax.media.j3d.Canvas3D canvas3D
           
 java.lang.Object chooseAtomType
           
(package private)  java.util.HashMap defaultSolventList
           
(package private)  boolean enableLabels
           
(package private)  javax.media.j3d.BranchGroup fastGroup
           
(package private)  javax.media.j3d.LinearFog fog
           
(package private)  java.lang.String fragContext
           
(package private)  java.net.URL fragmentDictionary
           
(package private)  java.util.HashMap fragmentsReferences
           
(package private)  GaussianInputEditorFrame gaussianInputEditorFrame
           
protected  java.util.ArrayList Geometries
           
 GeometrySelectDialog geometrySelectioDialog
           
 java.awt.MenuItem geometrySelection
           
(package private)  java.util.ArrayList<GraphicsObjectInterface> graphicsObjects
           
(package private)  java.awt.Frame guiFrame
           
(package private)  HelperInterface helper
           
 JAddMoleculeDialog jAddMoleculeDialog
           
 JModifyAngleDialog jModifyAngleDialog
           
 JModifyAtomDialog jModifyAtomDialog
           
 JModifyBondDialog jModifyBondDialog
           
(package private)  JSolvateShellDialog jSolvateShellDialog
           
 int lastSelectedAtom
           
(package private)  java.util.ArrayList materialStore
           
(package private)  javax.media.j3d.BranchGroup mol
           
(package private)  javax.media.j3d.TransformGroup moleculeTrans
           
(package private)  MousePicking mouse_picking_behavior
           
(package private)  com.sun.j3d.utils.behaviors.mouse.MouseRotate myMouseRotate
           
(package private)  com.sun.j3d.utils.behaviors.mouse.MouseZoom myMouseZoom
           
(package private)  javax.media.j3d.BranchGroup niceGroup
           
(package private)  javax.media.j3d.TransformGroup objRotate
           
(package private)  OffScreenCanvas3D offScreenCanvas3D
           
 java.lang.Object oneAtomSelectionDialog
           
(package private)  boolean otherLabelMethod
           
(package private)  Java3dUniverse otherRenderer
           
(package private) static double RADS_TO_DEGS
           
(package private)  com.sun.j3d.utils.geometry.Text2D referenceText2D
           
(package private)  int renderingStyle
           
(package private) static java.util.LinkedHashMap renderStyles
           
(package private)  javax.media.j3d.BranchGroup root
           
(package private)  javax.media.j3d.TransformGroup rootTrans
           
(package private)  javax.media.j3d.Transform3D rotate
           
(package private)  javax.media.j3d.BranchGroup scene
           
(package private)  javax.media.j3d.TransformGroup sceneOffset
           
(package private)  javax.media.j3d.Switch sceneSwitch
           
(package private)  javax.media.j3d.TransformGroup sceneTrans
           
(package private)  JSelectTreeDialog selectDefaultSolvent
           
(package private)  java.util.ArrayList selectedAtoms
           
protected  int selectedGeometry
           
 int selectedRule
           
 boolean selectionInProgress
           
 java.lang.String[] selectionRules
           
 java.lang.String[] selectionTypes
           
(package private)  java.lang.String solventContext
           
(package private)  java.net.URL solventDictionary
           
(package private)  vPoint3f temp_axis
           
(package private)  java.util.ArrayList temp_Group_1
           
(package private)  java.util.ArrayList temp_Group_2
           
(package private)  java.util.ArrayList temp_Group_3
           
(package private)  javax.vecmath.Matrix3d temp_Matrix
           
(package private)  com.sun.j3d.utils.geometry.Sphere temp_Sphere
           
(package private)  vPoint3f[] temp_structure
           
(package private)  MyMouseMotionListener tracer
           
(package private)  javax.media.j3d.Transform3D translate
           
(package private)  javax.media.j3d.ViewPlatform vp
           
 
Fields inherited from class cct.modelling.MolecularEditor
chemistryDatabase, connectedToDB, databaseAccess, gaussianData, HighlighSelectedAtoms, jAtomSelectionDialog, jModifyTorsionDialog, molecule, new_chemistryDatabase, new_sqlChemistryDatabase, processingSelected, Sander_8_Controls, selectAndProcessDialog, selectedMode, selectionRule, selectionType, sqlChemistryDatabase, sqlServerDialog
 
Fields inherited from interface cct.modelling.OperationsOnAtoms
FIXED_ATOM, ROTATE_ATOM, ROTATE_GROUP, RULE_DIFFERENCE, RULE_INTERSECTION, RULE_UNION, SELECT_ATOMS, SELECT_MOLECULES, SELECT_MONOMERS, SELECTED_ADD_ATOMS, SELECTED_ADD_FRAGMENT, SELECTED_ADD_MOLECULE, SELECTED_CHANGE_ATOM_LABELS_COLOR, SELECTED_CHANGE_ATOM_LABELS_SIZE, SELECTED_CREATE_CENTROID, SELECTED_DELETE_ATOMS, SELECTED_DISPLAY_ATOMS, SELECTED_FILL_VALENCES_WITH_HYDROGENS, SELECTED_LABEL_ATOMS, SELECTED_MODIFY_ANGLES, SELECTED_MODIFY_ATOMS, SELECTED_MODIFY_BONDS, SELECTED_MODIFY_DIHEDRALS, SELECTED_NOTHING, SELECTED_SOLVATE_CAP, SELECTED_SOLVATE_SHELL, SELECTED_UNDISPLAY_ATOMS, SELECTED_UNLABEL_ATOMS, SELECTION_FOUR_ATOMS_ONLY, SELECTION_ONE_ATOM_ONLY, SELECTION_SPOT_ONLY, SELECTION_THREE_ATOMS_ONLY, SELECTION_TWO_ATOMS_ONLY, SELECTION_UNLIMITED, TRANSLATE_ATOM, TRANSLATE_GROUP
 
Fields inherited from interface cct.interfaces.MoleculeRendererInterface
LOAD_CANCELED, MERGE_MOLECULE, NEW_MOLECULE, OVERWRITE_MOLECULE
 
Constructor Summary
Java3dUniverse()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 AtomNode addAtom(AtomInterface atom)
           
 void addAtom(AtomNode new_atom)
           
 AtomNode addAtom(javax.vecmath.Point3d origin, javax.vecmath.Vector3d dir, float length, boolean scale)
           
 BondNode addBond(BondInterface bond)
           
 void addFragment()
           
 void addFragment(Java3dUniverse otherUniverse)
          Adds a fragment to a molecule
 void addGaussianData(Gaussian gData)
           
 void addGraphics(GraphicsObjectInterface graphics)
           
 void addGraphicsToMolecule(javax.media.j3d.BranchGroup object, boolean enable)
           
 void addMolecule(Molecule m)
           
 void addMolecule(MoleculeInterface m)
           
 void addMolecule(MoleculeInterface molecule, int how_to_load_molecule)
           
 void addMolecule(javax.vecmath.Point3d origin, javax.vecmath.Vector3d dir, float length, boolean scale, Java3dUniverse otherUniverse)
          Adds a molecule to the main window
 void addMolecule(javax.vecmath.Point3f origin, Java3dUniverse otherUniverse)
           
 void addMousePicking(Java3dUniverse dad, javax.media.j3d.BranchGroup root, javax.media.j3d.Canvas3D canvas, javax.media.j3d.Bounds bounds)
           
 void addRenderingListener(RenderingListener listener)
          Add listener for change rendering style events
 void appendMolecule(Java3dUniverse otherRenderer)
           
 void appendMolecule(MoleculeInterface m, boolean merge_molecules)
           
 void appendMolecule(MoleculeInterface referenceMol, MoleculeInterface m, float[][] coord)
           
 boolean areLabels()
           
 boolean atomInfoPopupEnabled()
           
 void cancelSelection()
           
 void cancelTreeSelection()
           
 void centerMolecule(float x, float y, float z)
           
static void centerMolecule(MoleculeInterface molec, float x, float y, float z)
          Translates geometric center of a molecule to a point with coordinates x,y,z
 void centerScene()
           
 void centerSceneOnScreen()
           
 void changeAngleBetweenSelectedAtoms(float new_angle, int I_atom_status, int J_atom_status, int K_atom_status)
           
 void changeDihedralForSelectedAtoms(float new_angle, int I_atom_status, int L_atom_status)
           
 void changeDistanceBetweenSelectedAtoms(float new_distance, int I_atom_status, int J_atom_status)
          Status: 0 - Fixed, 1 - translate Atom; 2 - translate group
 void clearSelection()
           
static javax.media.j3d.Material cloneMaterial(javax.media.j3d.Material material)
          Clones material
 void confirmChanges()
           
 boolean connectToDatabase()
           
 AtomNode createAtom(AtomInterface atom)
           
 BondNode createBond(int origin, int target)
           
 void createdCentroidForSelectedAtoms()
           
 javax.media.j3d.BranchGroup createSceneGraph()
           
(package private)  void createUniverse()
           
 void deleteAllBonds()
           
 void deleteAtom(AtomInterface at)
           
 void deleteAtom(int n)
           
 void deleteBondBetweenAtoms(AtomInterface a_i, AtomInterface a_j)
           
 void deleteSelectedAtoms()
          Deletes selected atoms and associated bonds
 void displaySelectedAtoms(boolean enable)
           
 void doAtomSelection(javax.media.j3d.BranchGroup bgr, com.sun.j3d.utils.picking.PickResult pickingResult)
           
 void doAtomSelection(int nsel)
           
 void doAtomSelection(javax.vecmath.Point3d origin, javax.vecmath.Vector3d dir, javax.media.j3d.BranchGroup bgr, com.sun.j3d.utils.picking.PickResult[] pickingResults)
           
 void doProperSelection(int selected_atom)
           
 void drawBondBetweenSelectedAtoms(boolean draw_bond)
           
 void drawBonds(MoleculeInterface m)
           
 void drawMolecule(MoleculeInterface m)
           
 void enableAtomInfoPopup(boolean enable)
           
 void enableAtomPicking(int n, boolean enable)
           
 void enableMousePicking(boolean flag)
           
 void endProcessingSelectedAtoms()
           
 void fillEmptyValences(AtomInterface atom)
           
 int findClosestAtom(int x, int y)
           
 int findClosestAtom(javax.vecmath.Point3d origin, javax.vecmath.Vector3d dir)
           
 int findClosestBond(int x, int y)
           
 int findClosestBond(javax.vecmath.Point3d origin, javax.vecmath.Vector3d dir)
           
static javax.media.j3d.TransformGroup getAtomicSphereScale(javax.media.j3d.BranchGroup atom)
          Finds TransformGroup which scales sphere's redius
 javax.media.j3d.TransformGroup getAtomicTranformGroup(javax.media.j3d.BranchGroup atom)
           
 java.awt.Color getAtomLabelsColor()
           
 java.awt.Font getAtomLabelsFont()
           
 void getAtomLabelsFont(java.awt.Font font)
           
 java.util.HashSet<java.lang.String> getAtomNamesInMolecule()
           
 java.awt.Color getBackgroundColor()
           
 javax.vecmath.Color3f getBackgroundColor3f()
           
 javax.media.j3d.BoundingSphere getBoundingSphere()
           
 javax.media.j3d.Canvas3D getCanvas3D()
           
 java.util.HashSet getElementsInMolecule()
           
 Gaussian getGaussianData()
           
 java.util.ArrayList getGeometries()
           
 GraphicsObjectInterface getGraphicsObject(int n)
           
 java.util.ArrayList<GraphicsObjectInterface> getGraphicsObjects()
           
 java.awt.image.BufferedImage getImageCapture()
           
 int getLastSelectedAtom()
           
 javax.media.j3d.Locale getLocale()
           
 MoleculeInterface getMolecule()
           
 javax.media.j3d.BranchGroup getMoleculeBranchGroup()
          Returns BranchGroup of a molecule
 MoleculeInterface getMoleculeInterface()
           
 boolean getMousePickingStatus()
           
 int getNumberOfGraphicsObjects()
           
 int getProjectionMode()
           
 java.lang.String getProjectionModeAsString()
           
 java.lang.String[] getProjectionModes()
           
 java.lang.String[] getRenderingStyles()
           
 javax.media.j3d.BranchGroup getRootBranchGroup()
           
 int getSelectedAtomNumber(javax.media.j3d.BranchGroup bgr, com.sun.j3d.utils.geometry.Sphere sel_sphere)
           
 void getSelectedBranch(java.lang.String value)
           
 int getSelectedGeometry()
           
 java.lang.String getSQLHostName()
           
 javax.media.j3d.View getView()
           
 javax.vecmath.Point3f getVirtualWorldCoordinates(AtomInterface atom)
          Returns Virtual World coordinates of an atom
 float[][] getVirtualWorldCoordinates(MoleculeInterface molec)
          Transforms coordinates of atoms of the arbitrary molecule into current virtual world space
 javax.media.j3d.Transform3D getVWTransform()
           
 void handleSpotPicking(javax.vecmath.Point3d origin, javax.vecmath.Vector3d dir)
           
 void highlightSelectedAtom(javax.media.j3d.BranchGroup parent, AtomNode atom, int nsel, boolean highlight)
           
 void highlightSelectedAtom(int nsel, boolean highlight)
           
 void highlightSelectedAtoms()
           
(package private)  void initLighting()
           
(package private)  void initSceneGraph()
           
 void invertSelectedAtoms()
           
 void invertSelection()
           
 void labelSelectedAtoms(java.lang.String property)
           
 void loadFragment(java.lang.String specification)
           
 boolean logoutDatabase()
           
 void makeMonomersSelection(int[] monomers)
           
 void makeMonomersSelection(java.lang.Object[] monomers)
           
 void makeSelection(boolean[] selectedAtoms)
           
 void makeSelection(java.lang.Object[] elements, java.lang.Object[] atom_names)
           
 void modifyDihedralAngleDialog()
           
 void modifyDihedralAngleDialog(java.awt.Frame parent)
           
 boolean openMolecularModelingFile(int fileType, java.lang.String fileName)
           
 boolean openMolecularModelingFile(java.lang.String fileType, java.lang.String fileName)
           
(package private)  void openSolvateMoleculeDialog(int solvationType)
          Does solvation
 void processSelectedAtoms()
           
 void removeMolecule()
           
 void removeRenderingListener(RenderingListener listener)
           
 void renderMolecule(MoleculeInterface m)
           
 void resetGeometry()
           
 void resetMoleculeGraphics()
           
 void resetScene()
          Reset the whole scene to the identity matrix
 void resetSceneRotation()
          Reset rotation of the scene to the identity matrix
 void rotateAtomAroundAxis(int atom_index, float theta, Point3fInterface p1, Point3fInterface p2)
           
 void rotateAtomicGroupAroundAxis(java.util.ArrayList group, float theta, Point3fInterface p1, Point3fInterface p2)
           
 void selectAll()
           
 void selectAllAtoms(boolean enable)
           
 void setAtomColor(int natom, javax.vecmath.Color3f new_color, javax.media.j3d.Material new_material)
           
 void setAtomicSphere(javax.media.j3d.BranchGroup atom, com.sun.j3d.utils.geometry.Sphere sphere)
           
 void setAtomicSphereRadius(AtomNode atom_node, float radius)
           
 void setAtomLabelsColor(java.awt.Color color)
           
 void setAtomTypeForSelectedAtoms(java.lang.String new_atomType)
           
 void setBackgroundColor(javax.vecmath.Color3f color)
           
 void setBackgroundColor(float red, float green, float blue)
           
 void setBackgroundColor(int red, int green, int blue)
           
 void setColorForSelectedAtoms(java.awt.Color new_color)
           
 void setElementForSelectedAtoms(int new_element)
           
 void setFragmentDictionary(java.net.URL fragmentDic)
           
 void setGeometries(java.util.ArrayList geoms)
           
 void setGlobalRenderingStyle(int style)
           
 void setGlobalRenderingStyle(java.lang.String style)
           
 void setHelper(HelperInterface h)
           
 void setLabelForSelectedAtoms(java.lang.String new_label)
           
 void setMolecule(MoleculeInterface m)
          First deletes molecule and all related graphics, then adds a new molecule
 int setNewGeometry(int n)
           
 void setOtherRenderer(Java3dUniverse otherJ3D)
           
 void setParentFrame(java.awt.Frame parent)
           
 void setProjection(int mode)
          Sets projection policy
 void setProjection(java.lang.String mode)
           
 void setRadiusForSelectedAtoms(float radius)
           
 void setRenderingParameters(int style)
           
 void setSolventDictionary(java.net.URL fragmentDic)
          Setup base directory(URL) for the default Solvent dictionary
 int setupSelectedGeometry(MoleculeInterface molec, int n)
           
 void solvateMolecule(MoleculeInterface solvent, int solvationType)
           
 void startBulkDatabaseLoad(java.lang.String[] files)
           
(package private)  float[][] transformToLocalCoords(javax.vecmath.Point3f origin, Java3dUniverse otherUniverse)
           
 void translateAtom(int atom_index, float[] dir, float increment)
           
 void translateAtomicGroup(java.util.ArrayList group, float[] dir, float increment)
           
 void undoLastSelection()
           
 void unlabelSelectedAtoms()
           
 void updateAtomColorScheme()
           
 void updateAtomicRadii()
           
(package private)  void updateAtomNode(int atom_index, AtomInterface a)
           
 void updateBondRadii()
           
 void updateLabels()
           
 void updateMolecularGeometry()
          Updates geometry
 void updateSelectedAtomLabelsColor(java.awt.Color color)
           
 void updateSelectedAtomLabelsSize(double value)
           
 
Methods inherited from class cct.modelling.MolecularEditor
getJobType, getMolecularSubstructure, getSelectionType, getUniqueMonomersInMolecule, openAtomSelectionDialog, setJobType, setSelectionRule, setSelectionType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RADS_TO_DEGS

static double RADS_TO_DEGS

renderStyles

static java.util.LinkedHashMap renderStyles

ATOM_NODE

public static final java.lang.String ATOM_NODE
See Also:
Constant Field Values

BOND_NODE

public static final java.lang.String BOND_NODE
See Also:
Constant Field Values

helper

HelperInterface helper

guiFrame

java.awt.Frame guiFrame

renderingStyle

int renderingStyle

canvas3D

javax.media.j3d.Canvas3D canvas3D

offScreenCanvas3D

OffScreenCanvas3D offScreenCanvas3D

scene

javax.media.j3d.BranchGroup scene

rotate

javax.media.j3d.Transform3D rotate

translate

javax.media.j3d.Transform3D translate

objRotate

javax.media.j3d.TransformGroup objRotate

sceneTrans

javax.media.j3d.TransformGroup sceneTrans

moleculeTrans

javax.media.j3d.TransformGroup moleculeTrans

sceneOffset

javax.media.j3d.TransformGroup sceneOffset

sceneSwitch

javax.media.j3d.Switch sceneSwitch

myMouseRotate

com.sun.j3d.utils.behaviors.mouse.MouseRotate myMouseRotate

myMouseZoom

com.sun.j3d.utils.behaviors.mouse.MouseZoom myMouseZoom

atomAppear

javax.media.j3d.Appearance atomAppear

fastGroup

javax.media.j3d.BranchGroup fastGroup

niceGroup

javax.media.j3d.BranchGroup niceGroup

vp

javax.media.j3d.ViewPlatform vp

root

javax.media.j3d.BranchGroup root

rootTrans

javax.media.j3d.TransformGroup rootTrans

fog

javax.media.j3d.LinearFog fog

otherRenderer

Java3dUniverse otherRenderer

fragContext

java.lang.String fragContext

fragmentDictionary

java.net.URL fragmentDictionary

fragmentsReferences

java.util.HashMap fragmentsReferences

solventContext

java.lang.String solventContext

solventDictionary

java.net.URL solventDictionary

atomInfoPopup

boolean atomInfoPopup

tracer

MyMouseMotionListener tracer

mol

javax.media.j3d.BranchGroup mol

atomNodes

java.util.ArrayList<AtomNode> atomNodes

bondNodes

java.util.ArrayList<BondNode> bondNodes

materialStore

java.util.ArrayList materialStore

selectionTypes

public java.lang.String[] selectionTypes

selectionRules

public java.lang.String[] selectionRules

graphicsObjects

java.util.ArrayList<GraphicsObjectInterface> graphicsObjects

atomLabelsColor

javax.vecmath.Color3f atomLabelsColor

atomLabelsFontSize

int atomLabelsFontSize

atomLabelsFontStyle

int atomLabelsFontStyle

atomLabelsFontName

java.lang.String atomLabelsFontName

atomLabelsFont

java.awt.Font atomLabelsFont

atomLabels

java.util.ArrayList atomLabels

enableLabels

boolean enableLabels

otherLabelMethod

boolean otherLabelMethod

atomLabelsDialog

AtomLabelsDialog atomLabelsDialog

referenceText2D

com.sun.j3d.utils.geometry.Text2D referenceText2D

bondRenderingStyle

int bondRenderingStyle

selectedRule

public int selectedRule

selectionInProgress

public boolean selectionInProgress

mouse_picking_behavior

MousePicking mouse_picking_behavior

oneAtomSelectionDialog

public java.lang.Object oneAtomSelectionDialog

geometrySelectioDialog

public GeometrySelectDialog geometrySelectioDialog

selectDefaultSolvent

JSelectTreeDialog selectDefaultSolvent

jModifyAtomDialog

public JModifyAtomDialog jModifyAtomDialog

jModifyBondDialog

public JModifyBondDialog jModifyBondDialog

jModifyAngleDialog

public JModifyAngleDialog jModifyAngleDialog

jAddMoleculeDialog

public JAddMoleculeDialog jAddMoleculeDialog

jSolvateShellDialog

JSolvateShellDialog jSolvateShellDialog

defaultSolventList

java.util.HashMap defaultSolventList

chooseAtomType

public java.lang.Object chooseAtomType

gaussianInputEditorFrame

GaussianInputEditorFrame gaussianInputEditorFrame

lastSelectedAtom

public int lastSelectedAtom

selectedAtoms

java.util.ArrayList selectedAtoms

Geometries

protected java.util.ArrayList Geometries

selectedGeometry

protected int selectedGeometry

geometrySelection

public java.awt.MenuItem geometrySelection

temp_Matrix

javax.vecmath.Matrix3d temp_Matrix

temp_Sphere

com.sun.j3d.utils.geometry.Sphere temp_Sphere

temp_Group_1

java.util.ArrayList temp_Group_1

temp_Group_2

java.util.ArrayList temp_Group_2

temp_Group_3

java.util.ArrayList temp_Group_3

temp_axis

vPoint3f temp_axis

temp_structure

vPoint3f[] temp_structure
Constructor Detail

Java3dUniverse

public Java3dUniverse()
Method Detail

getView

public javax.media.j3d.View getView()

enableMousePicking

public void enableMousePicking(boolean flag)
Specified by:
enableMousePicking in class MolecularEditor

getMousePickingStatus

public boolean getMousePickingStatus()
Specified by:
getMousePickingStatus in class MolecularEditor

setOtherRenderer

public void setOtherRenderer(Java3dUniverse otherJ3D)

addRenderingListener

public void addRenderingListener(RenderingListener listener)
Add listener for change rendering style events

Parameters:
listener - RenderingListener - listener

removeRenderingListener

public void removeRenderingListener(RenderingListener listener)

createUniverse

void createUniverse()

getBoundingSphere

public javax.media.j3d.BoundingSphere getBoundingSphere()

setProjection

public void setProjection(int mode)
Sets projection policy

Parameters:
mode - int - either View.PERSPECTIVE_PROJECTION or View.PARALLEL_PROJECTION. Do nothing if mode != one of this values

setProjection

public void setProjection(java.lang.String mode)

getProjectionMode

public int getProjectionMode()

getProjectionModeAsString

public java.lang.String getProjectionModeAsString()

getProjectionModes

public java.lang.String[] getProjectionModes()

setBackgroundColor

public void setBackgroundColor(javax.vecmath.Color3f color)

setBackgroundColor

public void setBackgroundColor(float red,
                               float green,
                               float blue)

setBackgroundColor

public void setBackgroundColor(int red,
                               int green,
                               int blue)

getBackgroundColor

public java.awt.Color getBackgroundColor()

getBackgroundColor3f

public javax.vecmath.Color3f getBackgroundColor3f()

initSceneGraph

void initSceneGraph()

initLighting

void initLighting()

renderMolecule

public void renderMolecule(MoleculeInterface m)
Specified by:
renderMolecule in interface GraphicsRendererInterface

addMolecule

public void addMolecule(Molecule m)

appendMolecule

public void appendMolecule(MoleculeInterface referenceMol,
                           MoleculeInterface m,
                           float[][] coord)

addGraphicsToMolecule

public void addGraphicsToMolecule(javax.media.j3d.BranchGroup object,
                                  boolean enable)

appendMolecule

public void appendMolecule(MoleculeInterface m,
                           boolean merge_molecules)

cloneMaterial

public static javax.media.j3d.Material cloneMaterial(javax.media.j3d.Material material)
Clones material

Parameters:
material - Material
Returns:
Material

appendMolecule

public void appendMolecule(Java3dUniverse otherRenderer)

setMolecule

public void setMolecule(MoleculeInterface m)
First deletes molecule and all related graphics, then adds a new molecule

Parameters:
m - MoleculeInterface

addMolecule

public void addMolecule(MoleculeInterface molecule,
                        int how_to_load_molecule)
Specified by:
addMolecule in interface MoleculeRendererInterface

addMolecule

public void addMolecule(MoleculeInterface m)
Specified by:
addMolecule in interface MoleculeRendererInterface

setRenderingParameters

public void setRenderingParameters(int style)

updateAtomicRadii

public void updateAtomicRadii()

updateBondRadii

public void updateBondRadii()

centerMolecule

public static void centerMolecule(MoleculeInterface molec,
                                  float x,
                                  float y,
                                  float z)
Translates geometric center of a molecule to a point with coordinates x,y,z

Parameters:
molec - MoleculeInterface
x - float
y - float
z - float

resetMoleculeGraphics

public void resetMoleculeGraphics()

removeMolecule

public void removeMolecule()

drawMolecule

public void drawMolecule(MoleculeInterface m)

drawBonds

public void drawBonds(MoleculeInterface m)

addMousePicking

public void addMousePicking(Java3dUniverse dad,
                            javax.media.j3d.BranchGroup root,
                            javax.media.j3d.Canvas3D canvas,
                            javax.media.j3d.Bounds bounds)

centerSceneOnScreen

public void centerSceneOnScreen()

centerMolecule

public void centerMolecule(float x,
                           float y,
                           float z)

centerScene

public void centerScene()

fillEmptyValences

public void fillEmptyValences(AtomInterface atom)

createAtom

public AtomNode createAtom(AtomInterface atom)

getMoleculeBranchGroup

public javax.media.j3d.BranchGroup getMoleculeBranchGroup()
Returns BranchGroup of a molecule

Returns:
BranchGroup

getRootBranchGroup

public javax.media.j3d.BranchGroup getRootBranchGroup()

getLocale

public javax.media.j3d.Locale getLocale()

getMolecule

public MoleculeInterface getMolecule()

getMoleculeInterface

public MoleculeInterface getMoleculeInterface()
Specified by:
getMoleculeInterface in interface GraphicsRendererInterface

createSceneGraph

public javax.media.j3d.BranchGroup createSceneGraph()

getSQLHostName

public java.lang.String getSQLHostName()

doAtomSelection

public void doAtomSelection(javax.vecmath.Point3d origin,
                            javax.vecmath.Vector3d dir,
                            javax.media.j3d.BranchGroup bgr,
                            com.sun.j3d.utils.picking.PickResult[] pickingResults)

findClosestAtom

public int findClosestAtom(javax.vecmath.Point3d origin,
                           javax.vecmath.Vector3d dir)

findClosestBond

public int findClosestBond(javax.vecmath.Point3d origin,
                           javax.vecmath.Vector3d dir)

doAtomSelection

public void doAtomSelection(int nsel)

doAtomSelection

public void doAtomSelection(javax.media.j3d.BranchGroup bgr,
                            com.sun.j3d.utils.picking.PickResult pickingResult)

doProperSelection

public void doProperSelection(int selected_atom)

highlightSelectedAtoms

public void highlightSelectedAtoms()

enableAtomPicking

public void enableAtomPicking(int n,
                              boolean enable)

highlightSelectedAtom

public void highlightSelectedAtom(int nsel,
                                  boolean highlight)

highlightSelectedAtom

public void highlightSelectedAtom(javax.media.j3d.BranchGroup parent,
                                  AtomNode atom,
                                  int nsel,
                                  boolean highlight)
Parameters:
parent - BranchGroup
atom - BranchGroup
nsel - int
highlight - boolean

getAtomicSphereScale

public static javax.media.j3d.TransformGroup getAtomicSphereScale(javax.media.j3d.BranchGroup atom)
Finds TransformGroup which scales sphere's redius

Parameters:
atom - BranchGroup
Returns:
TransformGroup

getAtomicTranformGroup

public javax.media.j3d.TransformGroup getAtomicTranformGroup(javax.media.j3d.BranchGroup atom)

setAtomicSphere

public void setAtomicSphere(javax.media.j3d.BranchGroup atom,
                            com.sun.j3d.utils.geometry.Sphere sphere)

selectAllAtoms

public void selectAllAtoms(boolean enable)
Parameters:
enable - boolean

invertSelectedAtoms

public void invertSelectedAtoms()

displaySelectedAtoms

public void displaySelectedAtoms(boolean enable)

createdCentroidForSelectedAtoms

public void createdCentroidForSelectedAtoms()

deleteAtom

public void deleteAtom(AtomInterface at)

deleteAtom

public void deleteAtom(int n)

deleteSelectedAtoms

public void deleteSelectedAtoms()
Deletes selected atoms and associated bonds


unlabelSelectedAtoms

public void unlabelSelectedAtoms()

labelSelectedAtoms

public void labelSelectedAtoms(java.lang.String property)

updateLabels

public void updateLabels()

areLabels

public boolean areLabels()

getSelectedAtomNumber

public int getSelectedAtomNumber(javax.media.j3d.BranchGroup bgr,
                                 com.sun.j3d.utils.geometry.Sphere sel_sphere)
Parameters:
bgr - BranchGroup
sel_sphere - Sphere
Returns:
int

getVWTransform

public javax.media.j3d.Transform3D getVWTransform()

getVirtualWorldCoordinates

public float[][] getVirtualWorldCoordinates(MoleculeInterface molec)
Transforms coordinates of atoms of the arbitrary molecule into current virtual world space

Parameters:
molec - MoleculeInterface - Molecule
Returns:
float[][] - cartesian coordinates float[number_of_atoms][3]

getVirtualWorldCoordinates

public javax.vecmath.Point3f getVirtualWorldCoordinates(AtomInterface atom)
Returns Virtual World coordinates of an atom

Parameters:
atom - AtomInterface
Returns:
Point3f

addAtom

public void addAtom(AtomNode new_atom)

addAtom

public AtomNode addAtom(AtomInterface atom)

addAtom

public AtomNode addAtom(javax.vecmath.Point3d origin,
                        javax.vecmath.Vector3d dir,
                        float length,
                        boolean scale)

addMolecule

public void addMolecule(javax.vecmath.Point3d origin,
                        javax.vecmath.Vector3d dir,
                        float length,
                        boolean scale,
                        Java3dUniverse otherUniverse)
Adds a molecule to the main window

Parameters:
origin - Point3d
dir - Vector3d
length - float
scale - boolean
otherUniverse - Java3dUniverse

transformToLocalCoords

float[][] transformToLocalCoords(javax.vecmath.Point3f origin,
                                 Java3dUniverse otherUniverse)

addMolecule

public void addMolecule(javax.vecmath.Point3f origin,
                        Java3dUniverse otherUniverse)

addFragment

public void addFragment()

addFragment

public void addFragment(Java3dUniverse otherUniverse)
                 throws java.lang.Exception
Adds a fragment to a molecule

Parameters:
otherUniverse - Java3dUniverse
Throws:
java.lang.Exception

addBond

public BondNode addBond(BondInterface bond)

createBond

public BondNode createBond(int origin,
                           int target)

makeMonomersSelection

public void makeMonomersSelection(java.lang.Object[] monomers)
Specified by:
makeMonomersSelection in class MolecularEditor

makeMonomersSelection

public void makeMonomersSelection(int[] monomers)
Specified by:
makeMonomersSelection in class MolecularEditor

makeSelection

public void makeSelection(java.lang.Object[] elements,
                          java.lang.Object[] atom_names)
Specified by:
makeSelection in class MolecularEditor
Parameters:
elements - Object[]
atom_names - Object[]

makeSelection

public void makeSelection(boolean[] selectedAtoms)
Specified by:
makeSelection in class MolecularEditor
Parameters:
selectedAtoms - boolean[]

endProcessingSelectedAtoms

public void endProcessingSelectedAtoms()
Specified by:
endProcessingSelectedAtoms in class MolecularEditor

processSelectedAtoms

public void processSelectedAtoms()
Specified by:
processSelectedAtoms in class MolecularEditor

handleSpotPicking

public void handleSpotPicking(javax.vecmath.Point3d origin,
                              javax.vecmath.Vector3d dir)

setNewGeometry

public int setNewGeometry(int n)

logoutDatabase

public boolean logoutDatabase()

connectToDatabase

public boolean connectToDatabase()

startBulkDatabaseLoad

public void startBulkDatabaseLoad(java.lang.String[] files)

addGaussianData

public void addGaussianData(Gaussian gData)

getGaussianData

public Gaussian getGaussianData()

getCanvas3D

public javax.media.j3d.Canvas3D getCanvas3D()

setRadiusForSelectedAtoms

public void setRadiusForSelectedAtoms(float radius)
Specified by:
setRadiusForSelectedAtoms in interface GraphicsRendererInterface

setAtomicSphereRadius

public void setAtomicSphereRadius(AtomNode atom_node,
                                  float radius)

setColorForSelectedAtoms

public void setColorForSelectedAtoms(java.awt.Color new_color)
Specified by:
setColorForSelectedAtoms in interface GraphicsRendererInterface

resetSceneRotation

public void resetSceneRotation()
Reset rotation of the scene to the identity matrix


resetScene

public void resetScene()
Reset the whole scene to the identity matrix


setAtomColor

public void setAtomColor(int natom,
                         javax.vecmath.Color3f new_color,
                         javax.media.j3d.Material new_material)

setLabelForSelectedAtoms

public void setLabelForSelectedAtoms(java.lang.String new_label)
Specified by:
setLabelForSelectedAtoms in interface GraphicsRendererInterface

setAtomTypeForSelectedAtoms

public void setAtomTypeForSelectedAtoms(java.lang.String new_atomType)
Specified by:
setAtomTypeForSelectedAtoms in interface GraphicsRendererInterface

setElementForSelectedAtoms

public void setElementForSelectedAtoms(int new_element)
Specified by:
setElementForSelectedAtoms in interface GraphicsRendererInterface
Parameters:
new_element - int

drawBondBetweenSelectedAtoms

public void drawBondBetweenSelectedAtoms(boolean draw_bond)

deleteBondBetweenAtoms

public void deleteBondBetweenAtoms(AtomInterface a_i,
                                   AtomInterface a_j)

deleteAllBonds

public void deleteAllBonds()

changeDistanceBetweenSelectedAtoms

public void changeDistanceBetweenSelectedAtoms(float new_distance,
                                               int I_atom_status,
                                               int J_atom_status)
Status: 0 - Fixed, 1 - translate Atom; 2 - translate group

Parameters:
new_distance - float
I_atom_status - int
J_atom_status - int

translateAtomicGroup

public void translateAtomicGroup(java.util.ArrayList group,
                                 float[] dir,
                                 float increment)

rotateAtomicGroupAroundAxis

public void rotateAtomicGroupAroundAxis(java.util.ArrayList group,
                                        float theta,
                                        Point3fInterface p1,
                                        Point3fInterface p2)

updateMolecularGeometry

public void updateMolecularGeometry()
Updates geometry


translateAtom

public void translateAtom(int atom_index,
                          float[] dir,
                          float increment)

rotateAtomAroundAxis

public void rotateAtomAroundAxis(int atom_index,
                                 float theta,
                                 Point3fInterface p1,
                                 Point3fInterface p2)

updateAtomNode

void updateAtomNode(int atom_index,
                    AtomInterface a)

changeAngleBetweenSelectedAtoms

public void changeAngleBetweenSelectedAtoms(float new_angle,
                                            int I_atom_status,
                                            int J_atom_status,
                                            int K_atom_status)
Specified by:
changeAngleBetweenSelectedAtoms in class MolecularEditor

undoLastSelection

public void undoLastSelection()
Specified by:
undoLastSelection in class MolecularEditor

resetGeometry

public void resetGeometry()
Specified by:
resetGeometry in class MolecularEditor

confirmChanges

public void confirmChanges()
Specified by:
confirmChanges in class MolecularEditor

modifyDihedralAngleDialog

public void modifyDihedralAngleDialog()

modifyDihedralAngleDialog

public void modifyDihedralAngleDialog(java.awt.Frame parent)

changeDihedralForSelectedAtoms

public void changeDihedralForSelectedAtoms(float new_angle,
                                           int I_atom_status,
                                           int L_atom_status)
Specified by:
changeDihedralForSelectedAtoms in class MolecularEditor

cancelSelection

public void cancelSelection()
Specified by:
cancelSelection in class MolecularEditor

clearSelection

public void clearSelection()
Specified by:
clearSelection in class MolecularEditor

selectAll

public void selectAll()
Specified by:
selectAll in class MolecularEditor

invertSelection

public void invertSelection()
Specified by:
invertSelection in class MolecularEditor

getElementsInMolecule

public java.util.HashSet getElementsInMolecule()
Specified by:
getElementsInMolecule in class MolecularEditor

getAtomNamesInMolecule

public java.util.HashSet<java.lang.String> getAtomNamesInMolecule()
Specified by:
getAtomNamesInMolecule in class MolecularEditor

openMolecularModelingFile

public boolean openMolecularModelingFile(int fileType,
                                         java.lang.String fileName)

openMolecularModelingFile

public boolean openMolecularModelingFile(java.lang.String fileType,
                                         java.lang.String fileName)

setParentFrame

public void setParentFrame(java.awt.Frame parent)

setHelper

public void setHelper(HelperInterface h)
Overrides:
setHelper in class MolecularEditor

getAtomLabelsColor

public java.awt.Color getAtomLabelsColor()

setAtomLabelsColor

public void setAtomLabelsColor(java.awt.Color color)

getAtomLabelsFont

public java.awt.Font getAtomLabelsFont()

getAtomLabelsFont

public void getAtomLabelsFont(java.awt.Font font)

getGeometries

public java.util.ArrayList getGeometries()

getSelectedGeometry

public int getSelectedGeometry()

setGeometries

public void setGeometries(java.util.ArrayList geoms)

getLastSelectedAtom

public int getLastSelectedAtom()

setupSelectedGeometry

public int setupSelectedGeometry(MoleculeInterface molec,
                                 int n)

setFragmentDictionary

public void setFragmentDictionary(java.net.URL fragmentDic)
                           throws java.lang.Exception
Throws:
java.lang.Exception

loadFragment

public void loadFragment(java.lang.String specification)

openSolvateMoleculeDialog

void openSolvateMoleculeDialog(int solvationType)
Does solvation

Parameters:
solvationType - int

setSolventDictionary

public void setSolventDictionary(java.net.URL fragmentDic)
                          throws java.lang.Exception
Setup base directory(URL) for the default Solvent dictionary

Parameters:
fragmentDic - URL
Throws:
java.lang.Exception

getSelectedBranch

public void getSelectedBranch(java.lang.String value)
Specified by:
getSelectedBranch in interface TreeSelectorInterface

cancelTreeSelection

public void cancelTreeSelection()
Specified by:
cancelTreeSelection in interface TreeSelectorInterface

solvateMolecule

public void solvateMolecule(MoleculeInterface solvent,
                            int solvationType)

updateAtomColorScheme

public void updateAtomColorScheme()

getImageCapture

public java.awt.image.BufferedImage getImageCapture()

findClosestAtom

public int findClosestAtom(int x,
                           int y)

findClosestBond

public int findClosestBond(int x,
                           int y)

atomInfoPopupEnabled

public boolean atomInfoPopupEnabled()

enableAtomInfoPopup

public void enableAtomInfoPopup(boolean enable)

setGlobalRenderingStyle

public void setGlobalRenderingStyle(int style)
                             throws java.lang.Exception
Throws:
java.lang.Exception

setGlobalRenderingStyle

public void setGlobalRenderingStyle(java.lang.String style)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getRenderingStyles

public java.lang.String[] getRenderingStyles()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

updateSelectedAtomLabelsSize

public void updateSelectedAtomLabelsSize(double value)

updateSelectedAtomLabelsColor

public void updateSelectedAtomLabelsColor(java.awt.Color color)

addGraphics

public void addGraphics(GraphicsObjectInterface graphics)

getNumberOfGraphicsObjects

public int getNumberOfGraphicsObjects()

getGraphicsObject

public GraphicsObjectInterface getGraphicsObject(int n)

getGraphicsObjects

public java.util.ArrayList<GraphicsObjectInterface> getGraphicsObjects()