ffe.panels
Class Graphics3D

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended byjavax.media.j3d.Canvas3D
              extended byffe.panels.Graphics3D
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public final class Graphics3D
extends javax.media.j3d.Canvas3D
implements java.awt.event.ActionListener

The Graphics class provides 3D Graphics capibilities, making heavy use of Java3D and its utility packages. The following display types are currently supported: Wireframe, Ball & Stick, Spacefill/CPK and Tube models.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int ACTIVE
           
static javax.media.j3d.ColoringAttributes coloringAttributes
           
static javax.vecmath.Color3f[] colors
           
static javax.media.j3d.PolygonAttributes fillPolygonAttributes
           
static int JPEG
           
static javax.media.j3d.LineAttributes lineAttributes
           
static javax.media.j3d.PolygonAttributes linePolygonAttributes
           
static int PNG
           
static javax.media.j3d.PolygonAttributes pointPolygonAttributes
           
static javax.media.j3d.RenderingAttributes renderingAttributes
           
static int SCREEN
           
static javax.media.j3d.TransparencyAttributes transparencyAttributes
           
static float[] vdw
           
 
Fields inherited from class javax.media.j3d.Canvas3D
FIELD_ALL, FIELD_LEFT, FIELD_RIGHT
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Graphics3D(java.awt.GraphicsConfiguration config, MainPanel f)
           
Graphics3D(MainPanel f)
          The Graphics Constructor initializes the Java3D SimpleUniverse, scene graph, lighting and Mouse Behaviors.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Handles actions performed on various menu items.
 void attach(javax.media.j3d.BranchGroup bg)
           
 boolean cacheFull()
           
 void centerView()
          This functions trys to center the molecular scene on the 3D canvas
 void clearPicks()
           
static javax.media.j3d.Shape3D createCone(javax.media.j3d.Appearance ap, int res)
          This method creates a Cylinder
static javax.media.j3d.Shape3D createCylinder(javax.media.j3d.Appearance ap, int res)
          This method creates a Cylinder
static javax.media.j3d.Material createMaterial(javax.vecmath.Color3f col)
           
static javax.media.j3d.Shape3D createPolar(javax.media.j3d.Appearance ap, int div)
           
static javax.media.j3d.Shape3D createSphere(javax.media.j3d.Appearance ap, int div)
          This method creates a single Sphere from the given appearance
static javax.media.j3d.Appearance getAppearance(javax.vecmath.Color3f col, int type)
           
static javax.vecmath.Color3f getColor(Atom a, int colortype)
          Finds the desired color for an Atom
static javax.media.j3d.Geometry getConeGeom(int num, int res)
           
static javax.media.j3d.Geometry getCylinderGeom(int num, int res)
           
 GlobalAxis getNavigation()
           
 int getPickMode()
           
static javax.media.j3d.Geometry getPolarGeom(int res)
           
 javax.vecmath.Point2d getScreenCoordinate(javax.media.j3d.Node node, javax.vecmath.Point3d point3d)
           
static javax.media.j3d.Geometry getSphereGeom(int res)
           
 javax.swing.JLabel getStatusBar()
           
 void loadPrefs()
          Load preferences from the user node
 javax.media.j3d.BranchGroup loadVRML(java.io.BufferedReader br)
           
 javax.media.j3d.BranchGroup loadVRML(java.io.File file)
           
 javax.media.j3d.BranchGroup loadVRML(java.net.URL pdburl)
           
 void paint(java.awt.Graphics g)
           
 void postRender()
           
 void postSwap()
          This function facilitates image capture from the 3D Canvas.
 void recurseVRML(javax.media.j3d.Node node)
           
 void remove(FSystem m)
          This method removes a FSystem from the Scene Graph
 void Render(FSystem s, boolean update)
          This method renders a FSystem to the 3DCanvas
 void savePrefs()
          Save preferences to the user node
 boolean sceneRendering()
           
 void selected()
           
 void setAxisShowing(boolean b)
           
 void setCapture(boolean c)
           
 void setColor(FNode node, java.lang.String colortype)
           
 void setColor(java.lang.String colortype)
           
 void setLabelsUpdated()
           
 void setPosition()
           
 void setPosition(FNode node)
           
 void setView(FNode node, java.lang.String style)
           
 void setView(java.lang.String style)
           
 void updateScene(java.util.ArrayList n, boolean t, boolean v, int viewtype, boolean c, int colortype)
           
 void updateScene(FNode n, boolean t, boolean v, int viewtype, boolean c, int colortype)
           
 
Methods inherited from class javax.media.j3d.Canvas3D
addNotify, getBounds, getBounds, getCenterEyeInImagePlate, getDoubleBufferAvailable, getDoubleBufferEnable, getGraphics2D, getGraphicsContext3D, getHeight, getImagePlateToVworld, getInverseVworldProjection, getLeftEyeInImagePlate, getLeftManualEyeInImagePlate, getLocation, getLocation, getLocationOnScreen, getMonoscopicViewPolicy, getOffScreenBuffer, getOffScreenLocation, getOffScreenLocation, getPhysicalHeight, getPhysicalWidth, getPixelLocationFromImagePlate, getPixelLocationInImagePlate, getPixelLocationInImagePlate, getRightEyeInImagePlate, getRightManualEyeInImagePlate, getSceneAntialiasingAvailable, getScreen3D, getSize, getSize, getStereoAvailable, getStereoEnable, getView, getVworldProjection, getVworldToImagePlate, getWidth, getX, getY, isOffScreen, isRendererRunning, preRender, queryProperties, removeNotify, renderField, renderOffScreenBuffer, setDoubleBufferEnable, setLeftManualEyeInImagePlate, setMonoscopicViewPolicy, setOffScreenBuffer, setOffScreenLocation, setOffScreenLocation, setRightManualEyeInImagePlate, setStereoEnable, startRenderer, stopRenderer, swap, waitForOffScreenRendering
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

coloringAttributes

public static final javax.media.j3d.ColoringAttributes coloringAttributes

renderingAttributes

public static final javax.media.j3d.RenderingAttributes renderingAttributes

lineAttributes

public static final javax.media.j3d.LineAttributes lineAttributes

transparencyAttributes

public static final javax.media.j3d.TransparencyAttributes transparencyAttributes

fillPolygonAttributes

public static final javax.media.j3d.PolygonAttributes fillPolygonAttributes

pointPolygonAttributes

public static final javax.media.j3d.PolygonAttributes pointPolygonAttributes

linePolygonAttributes

public static final javax.media.j3d.PolygonAttributes linePolygonAttributes

JPEG

public static final int JPEG
See Also:
Constant Field Values

PNG

public static final int PNG
See Also:
Constant Field Values

SCREEN

public static final int SCREEN
See Also:
Constant Field Values

ACTIVE

public static final int ACTIVE
See Also:
Constant Field Values

colors

public static javax.vecmath.Color3f[] colors

vdw

public static float[] vdw
Constructor Detail

Graphics3D

public Graphics3D(java.awt.GraphicsConfiguration config,
                  MainPanel f)

Graphics3D

public Graphics3D(MainPanel f)
The Graphics Constructor initializes the Java3D SimpleUniverse, scene graph, lighting and Mouse Behaviors.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Handles actions performed on various menu items. This includes changes to the viewing and coloring types, as well as capturing the 3D view to a file.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

loadVRML

public javax.media.j3d.BranchGroup loadVRML(java.io.File file)

loadVRML

public javax.media.j3d.BranchGroup loadVRML(java.net.URL pdburl)

loadVRML

public javax.media.j3d.BranchGroup loadVRML(java.io.BufferedReader br)

recurseVRML

public void recurseVRML(javax.media.j3d.Node node)

attach

public void attach(javax.media.j3d.BranchGroup bg)

centerView

public void centerView()
This functions trys to center the molecular scene on the 3D canvas


clearPicks

public void clearPicks()

createMaterial

public static javax.media.j3d.Material createMaterial(javax.vecmath.Color3f col)

getAppearance

public static javax.media.j3d.Appearance getAppearance(javax.vecmath.Color3f col,
                                                       int type)

getConeGeom

public static javax.media.j3d.Geometry getConeGeom(int num,
                                                   int res)

createCone

public static javax.media.j3d.Shape3D createCone(javax.media.j3d.Appearance ap,
                                                 int res)
This method creates a Cylinder


getCylinderGeom

public static javax.media.j3d.Geometry getCylinderGeom(int num,
                                                       int res)

createCylinder

public static javax.media.j3d.Shape3D createCylinder(javax.media.j3d.Appearance ap,
                                                     int res)
This method creates a Cylinder


createPolar

public static javax.media.j3d.Shape3D createPolar(javax.media.j3d.Appearance ap,
                                                  int div)

createSphere

public static javax.media.j3d.Shape3D createSphere(javax.media.j3d.Appearance ap,
                                                   int div)
This method creates a single Sphere from the given appearance


getColor

public static javax.vecmath.Color3f getColor(Atom a,
                                             int colortype)
Finds the desired color for an Atom


getNavigation

public GlobalAxis getNavigation()

getPickMode

public int getPickMode()

getPolarGeom

public static javax.media.j3d.Geometry getPolarGeom(int res)

getStatusBar

public javax.swing.JLabel getStatusBar()

getSphereGeom

public static javax.media.j3d.Geometry getSphereGeom(int res)

paint

public void paint(java.awt.Graphics g)

postSwap

public void postSwap()
This function facilitates image capture from the 3D Canvas.


getScreenCoordinate

public javax.vecmath.Point2d getScreenCoordinate(javax.media.j3d.Node node,
                                                 javax.vecmath.Point3d point3d)

postRender

public void postRender()

setLabelsUpdated

public void setLabelsUpdated()

remove

public void remove(FSystem m)
This method removes a FSystem from the Scene Graph

Parameters:
m - FSystem to remove

savePrefs

public void savePrefs()
Save preferences to the user node


loadPrefs

public void loadPrefs()
Load preferences from the user node


Render

public void Render(FSystem s,
                   boolean update)
This method renders a FSystem to the 3DCanvas


setAxisShowing

public void setAxisShowing(boolean b)

setCapture

public void setCapture(boolean c)

selected

public void selected()

updateScene

public void updateScene(FNode n,
                        boolean t,
                        boolean v,
                        int viewtype,
                        boolean c,
                        int colortype)

updateScene

public void updateScene(java.util.ArrayList n,
                        boolean t,
                        boolean v,
                        int viewtype,
                        boolean c,
                        int colortype)

setView

public void setView(java.lang.String style)

setView

public void setView(FNode node,
                    java.lang.String style)

setColor

public void setColor(java.lang.String colortype)

setColor

public void setColor(FNode node,
                     java.lang.String colortype)

setPosition

public void setPosition()

setPosition

public void setPosition(FNode node)

sceneRendering

public boolean sceneRendering()

cacheFull

public boolean cacheFull()