showStructure
Class ShowStructure

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by showStructure.ShowStructure
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, javax.accessibility.Accessible

public class ShowStructure
extends java.applet.Applet
implements java.lang.Runnable

Displays unit cell structure.

Applet Parameters

NAME Variable Type Default Description
Animation boolean false Configures system for animation of atom segments for the specified unit cell.
A Float 1.0 Length for unit cell axis a.
B Float 1.0 Length for unit cell axis b.
C Float 1.0 Length for unit cell axis c.
CellType Integer 1 Specifies the cell type:
1     simple cubic (default)
2     body-centered cubic
3     face-centered cubic
4     hexagonal
IsReady String   JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature.
Offset float 2.0 Offset for positioning pieces and assembled pieces.
Red Float 0.0 RGB red component for animated pieces.
Green Float 1.0 RGB green component for animated pieces.
Blue Float 0.0 RGB blue component for animated pieces.
Time long 2000 Duration of each animation stage in milliseconds.
ViewDistance float 10.0 Distance of view from origin. Set to keep entire scene in view.

Version:
1.1
Author:
David N. Blauch
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
ShowStructure()
           
 
Method Summary
 void addCellAtoms(float r, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Adds atoms centered on cell positions
 void addHoleAtoms(int s, float r, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Adds atoms centered on hole positions
 void addLayer(int nx, int ny, float r, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Creates a layer of closest-packed atoms in the plane at z = 0;
 void addLineGroup(double x0, double y0, double z0, double x1, double y1, double z1)
           
 void addLineGroup(javax.vecmath.Point3d[] pts)
           
 void addPoints(float r, int nx, int ny)
          Adds a layer of points for a closest-packed structure
 void addSegments(int ns, float r, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Creates a set of sphere segments (sphere center at the origin) ns = -1 atoms in center unit cell layer of an hcp structure ns = 0 atoms on vertices of hexagonal cell ns = 2 sphere cut into halves by xy plane ns = 4 sphere cut into quarters by xy and xz planes ns = 6 sphere cut into sixths by xy plane and phi = 0, 120, and 240 degrees ns = 8 sphere cut into eighths by xy, xz, and yz planes
 void addSegmentsD(float r, float d, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Creates a set of sphere segments (sphere center at the origin) for atoms in center unit cell layer of an hcp structure
 void addSegmentsS(float r, float d, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Creates a set of sphere segments (sphere center at the origin) for atoms in center unit cell layer in a tetragonal cell
 void alignAtomAndPoint(int grp, int idx, int pt)
           
 void assemblePieces()
           
 void destroy()
           
 java.lang.String getAppletInfo()
           
 javax.vecmath.Vector3f getAtomGroupTranslation()
           
 boolean getIsAnimate()
           
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
           
 java.lang.String[][] getParameterInfo()
           
 void init()
           
 void mulUnitCellRotation(float x, float y, float z, float a)
           
 void mulUnitCellTranslation(float x, float y, float z)
           
 void resetAnimation()
           
 void run()
           
 void setAtomGroupRotation(float x, float y, float z, float a)
          Sets the rotation for the entire set of AtomGroups
 void setAtomGroupRotation(int grp, float x, float y, float z, float a)
          Sets the rotation for a specific AtomGroup
 void setAtomGroupTranslation(float x, float y, float z)
          Sets the translation for the entire set of AtomGroups
 void setAtomGroupTranslation(int grp, float x, float y, float z)
          Sets the translation for a specific AtomGroup
 void setAtomGroupVisible(int grp, boolean s)
          Sets the visibility of all atoms in a group
 void setAtomVisible(int grp, int idx, boolean s)
          Sets the visibility of the indicated atom
 void setCellGroupRotation(float x, float y, float z, float a)
          Sets the rotation for the cell group
 void setCellGroupTranslation(float x, float y, float z)
          Sets the translation of the cell group
 void setFacesVisible(boolean s)
          Sets the visibility of the unit cell faces
 void setLineGroupRotation(float x, float y, float z, float a)
          Sets the rotation for the entire set of LineGroups
 void setLineGroupRotation(int grp, float x, float y, float z, float a)
          Sets the rotation for a specific LineGroup
 void setLineGroupsVisible(boolean s)
          Sets the visibility of all LineGroups
 void setLineGroupTranslation(float x, float y, float z)
          Sets the translation for the entire set of LineGroups
 void setLineGroupTranslation(int grp, float x, float y, float z)
          Sets the translation for a specific LineGroup
 void setLineGroupVisible(int idx, boolean s)
          Sets the visibility of the indicated LineGroup
 void setLinesVisible(boolean s)
          Sets the visibility of the unit cell lines
 void setPointGroupRotation(float x, float y, float z, float a)
          Sets the rotation for the entire set of PointGroups
 void setPointGroupRotation(int grp, float x, float y, float z, float a)
          Sets the rotation for a specific PointGroup
 void setPointGroupTranslation(float x, float y, float z)
          Sets the translation for the entire set of PointGroups
 void setPointGroupTranslation(int grp, float x, float y, float z)
          Sets the translation for a specific PointGroup
 void setPointGroupVisible(boolean s)
          Sets the visibility of all points in all groups
 void setPointGroupVisible(int grp, boolean s)
          Sets the visibility of all points in a group
 void setRotation(float x, float y, float z, float a)
          Set rotation for the entire structure.
 void setSegmentGroupRotation(float x, float y, float z, float a)
          Sets the rotation for the entire set of SegmentGroups
 void setSegmentGroupRotation(int grp, float x, float y, float z, float a)
          Sets the rotation for a specific SegmentGroup
 void setSegmentGroupRotation(int grp, int idx, float x, float y, float z, float a)
          Sets the rotation for a specific SegmentGroup
 void setSegmentGroupTranslation(float x, float y, float z)
          Sets the translation for the entire set of SegmentGroups
 void setSegmentGroupTranslation(int grp, float x, float y, float z)
          Sets the translation for a specific SegmentGroup
 void setSegmentGroupTranslation(int grp, int idx, float x, float y, float z)
          Sets the translation for a specific SegmentGroup
 void setSegmentGroupVisible(int grp, boolean s)
          Sets the visibility of all segments in a group
 void setSegmentVisible(int grp, int idx, boolean s)
          Sets the visibility of the indicated segment
 void setTranslation(float x, float y, float z)
          Set the translation for the entire structure.
 void setUnitCellRotation(float x, float y, float z, float a)
           
 void setUnitCellTranslation(float x, float y, float z)
           
 void setViewDistance(float r)
          Sets the viewing distance.
 void showPieces()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, 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, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShowStructure

public ShowStructure()
Method Detail

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)

init

public void init()
Overrides:
init in class java.applet.Applet

start

public void start()
Overrides:
start in class java.applet.Applet

stop

public void stop()
Overrides:
stop in class java.applet.Applet

destroy

public void destroy()
Overrides:
destroy in class java.applet.Applet

addCellAtoms

public void addCellAtoms(float r,
                         float dRed,
                         float dGreen,
                         float dBlue,
                         float eRed,
                         float eGreen,
                         float eBlue)
Adds atoms centered on cell positions

Parameters:
r - atom radius
dRed - diffuse color red component
dGreen - diffuse color green component
dBlue - diffuse color blue component
eRed - emissive color red component
eGreen - emissive color green component
eBlue - emissive color blue component

addHoleAtoms

public void addHoleAtoms(int s,
                         float r,
                         float dRed,
                         float dGreen,
                         float dBlue,
                         float eRed,
                         float eGreen,
                         float eBlue)
Adds atoms centered on hole positions

Parameters:
s - type of hole, where multiple holes geometries exist
r - atom radius
dRed - diffuse color red component
dGreen - diffuse color green component
dBlue - diffuse color blue component
eRed - emissive color red component
eGreen - emissive color green component
eBlue - emissive color blue component

addPoints

public void addPoints(float r,
                      int nx,
                      int ny)
Adds a layer of points for a closest-packed structure

Parameters:
r - atom radius
nx - number of unit cells along x direction
ny - number of unit cells along y direction

addLayer

public void addLayer(int nx,
                     int ny,
                     float r,
                     float dRed,
                     float dGreen,
                     float dBlue,
                     float eRed,
                     float eGreen,
                     float eBlue)
Creates a layer of closest-packed atoms in the plane at z = 0;

Parameters:
nx - number of atoms along x axis
ny - number of atoms along y axis
r - atom radius
dRed - diffuse color red component
dGreen - diffuse color green component
dBlue - diffuse color blue component
eRed - emissive color red component
eGreen - emissive color green component
eBlue - emissive color blue component

addSegments

public void addSegments(int ns,
                        float r,
                        float dRed,
                        float dGreen,
                        float dBlue,
                        float eRed,
                        float eGreen,
                        float eBlue)
Creates a set of sphere segments (sphere center at the origin) ns = -1 atoms in center unit cell layer of an hcp structure ns = 0 atoms on vertices of hexagonal cell ns = 2 sphere cut into halves by xy plane ns = 4 sphere cut into quarters by xy and xz planes ns = 6 sphere cut into sixths by xy plane and phi = 0, 120, and 240 degrees ns = 8 sphere cut into eighths by xy, xz, and yz planes

Parameters:
ns - number of sphere segments
r - sphere radius
dRed - diffuse color red component
dGreen - diffuse color green component
dBlue - diffuse color blue component
eRed - emissive color red component
eGreen - emissive color green component
eBlue - emissive color blue component

addSegmentsD

public void addSegmentsD(float r,
                         float d,
                         float dRed,
                         float dGreen,
                         float dBlue,
                         float eRed,
                         float eGreen,
                         float eBlue)
Creates a set of sphere segments (sphere center at the origin) for atoms in center unit cell layer of an hcp structure

Parameters:
r - sphere radius
d - distance from origin of sphere to planes
dRed - diffuse color red component
dGreen - diffuse color green component
dBlue - diffuse color blue component
eRed - emissive color red component
eGreen - emissive color green component
eBlue - emissive color blue component

addSegmentsS

public void addSegmentsS(float r,
                         float d,
                         float dRed,
                         float dGreen,
                         float dBlue,
                         float eRed,
                         float eGreen,
                         float eBlue)
Creates a set of sphere segments (sphere center at the origin) for atoms in center unit cell layer in a tetragonal cell

Parameters:
r - sphere radius
d - distance from origin of sphere to planes
dRed - diffuse color red component
dGreen - diffuse color green component
dBlue - diffuse color blue component
eRed - emissive color red component
eGreen - emissive color green component
eBlue - emissive color blue component

addLineGroup

public void addLineGroup(javax.vecmath.Point3d[] pts)

addLineGroup

public void addLineGroup(double x0,
                         double y0,
                         double z0,
                         double x1,
                         double y1,
                         double z1)

getAtomGroupTranslation

public javax.vecmath.Vector3f getAtomGroupTranslation()

alignAtomAndPoint

public void alignAtomAndPoint(int grp,
                              int idx,
                              int pt)

setAtomVisible

public void setAtomVisible(int grp,
                           int idx,
                           boolean s)
Sets the visibility of the indicated atom

Parameters:
grp - group index
idx - atom index
s - visibility state

setAtomGroupVisible

public void setAtomGroupVisible(int grp,
                                boolean s)
Sets the visibility of all atoms in a group

Parameters:
grp - group index
s - visibility state

setAtomGroupRotation

public void setAtomGroupRotation(float x,
                                 float y,
                                 float z,
                                 float a)
Sets the rotation for the entire set of AtomGroups


setAtomGroupTranslation

public void setAtomGroupTranslation(float x,
                                    float y,
                                    float z)
Sets the translation for the entire set of AtomGroups


setAtomGroupRotation

public void setAtomGroupRotation(int grp,
                                 float x,
                                 float y,
                                 float z,
                                 float a)
Sets the rotation for a specific AtomGroup

Parameters:
grp - index of AtomGroup

setAtomGroupTranslation

public void setAtomGroupTranslation(int grp,
                                    float x,
                                    float y,
                                    float z)
Sets the translation for a specific AtomGroup

Parameters:
grp - index of AtomGroup

setCellGroupRotation

public void setCellGroupRotation(float x,
                                 float y,
                                 float z,
                                 float a)
Sets the rotation for the cell group


setCellGroupTranslation

public void setCellGroupTranslation(float x,
                                    float y,
                                    float z)
Sets the translation of the cell group


setFacesVisible

public void setFacesVisible(boolean s)
Sets the visibility of the unit cell faces

Parameters:
s - visibility state

setLinesVisible

public void setLinesVisible(boolean s)
Sets the visibility of the unit cell lines

Parameters:
s - visibility state

setLineGroupRotation

public void setLineGroupRotation(float x,
                                 float y,
                                 float z,
                                 float a)
Sets the rotation for the entire set of LineGroups


setLineGroupTranslation

public void setLineGroupTranslation(float x,
                                    float y,
                                    float z)
Sets the translation for the entire set of LineGroups


setLineGroupRotation

public void setLineGroupRotation(int grp,
                                 float x,
                                 float y,
                                 float z,
                                 float a)
Sets the rotation for a specific LineGroup

Parameters:
grp - index of LineGroup

setLineGroupTranslation

public void setLineGroupTranslation(int grp,
                                    float x,
                                    float y,
                                    float z)
Sets the translation for a specific LineGroup

Parameters:
grp - index of LineGroup

setLineGroupVisible

public void setLineGroupVisible(int idx,
                                boolean s)
Sets the visibility of the indicated LineGroup

Parameters:
idx - LineGroup index
s - visibility state

setLineGroupsVisible

public void setLineGroupsVisible(boolean s)
Sets the visibility of all LineGroups

Parameters:
s - visibility state

setPointGroupRotation

public void setPointGroupRotation(float x,
                                  float y,
                                  float z,
                                  float a)
Sets the rotation for the entire set of PointGroups


setPointGroupTranslation

public void setPointGroupTranslation(float x,
                                     float y,
                                     float z)
Sets the translation for the entire set of PointGroups


setPointGroupRotation

public void setPointGroupRotation(int grp,
                                  float x,
                                  float y,
                                  float z,
                                  float a)
Sets the rotation for a specific PointGroup

Parameters:
grp - index of PointGroup

setPointGroupTranslation

public void setPointGroupTranslation(int grp,
                                     float x,
                                     float y,
                                     float z)
Sets the translation for a specific PointGroup

Parameters:
grp - index of PointGroup

setPointGroupVisible

public void setPointGroupVisible(boolean s)
Sets the visibility of all points in all groups

Parameters:
s - visibility state

setPointGroupVisible

public void setPointGroupVisible(int grp,
                                 boolean s)
Sets the visibility of all points in a group

Parameters:
grp - group index
s - visibility state

setSegmentVisible

public void setSegmentVisible(int grp,
                              int idx,
                              boolean s)
Sets the visibility of the indicated segment

Parameters:
grp - group index
idx - segment index
s - visibility state

setSegmentGroupVisible

public void setSegmentGroupVisible(int grp,
                                   boolean s)
Sets the visibility of all segments in a group

Parameters:
grp - group index
s - visibility state

setSegmentGroupRotation

public void setSegmentGroupRotation(float x,
                                    float y,
                                    float z,
                                    float a)
Sets the rotation for the entire set of SegmentGroups


setSegmentGroupTranslation

public void setSegmentGroupTranslation(float x,
                                       float y,
                                       float z)
Sets the translation for the entire set of SegmentGroups


setSegmentGroupRotation

public void setSegmentGroupRotation(int grp,
                                    float x,
                                    float y,
                                    float z,
                                    float a)
Sets the rotation for a specific SegmentGroup

Parameters:
grp - index of SegmentGroup

setSegmentGroupTranslation

public void setSegmentGroupTranslation(int grp,
                                       float x,
                                       float y,
                                       float z)
Sets the translation for a specific SegmentGroup

Parameters:
grp - index of SegmentGroup

setSegmentGroupRotation

public void setSegmentGroupRotation(int grp,
                                    int idx,
                                    float x,
                                    float y,
                                    float z,
                                    float a)
Sets the rotation for a specific SegmentGroup

Parameters:
grp - index of SegmentGroup
idx - index of the segment

setSegmentGroupTranslation

public void setSegmentGroupTranslation(int grp,
                                       int idx,
                                       float x,
                                       float y,
                                       float z)
Sets the translation for a specific SegmentGroup

Parameters:
grp - index of SegmentGroup
idx - index of the segment

setRotation

public void setRotation(float x,
                        float y,
                        float z,
                        float a)
Set rotation for the entire structure.


setTranslation

public void setTranslation(float x,
                           float y,
                           float z)
Set the translation for the entire structure.


mulUnitCellRotation

public void mulUnitCellRotation(float x,
                                float y,
                                float z,
                                float a)

mulUnitCellTranslation

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

setUnitCellRotation

public void setUnitCellRotation(float x,
                                float y,
                                float z,
                                float a)

setUnitCellTranslation

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

setViewDistance

public void setViewDistance(float r)
Sets the viewing distance.

Parameters:
r - new viewing distance (along z axis)

showPieces

public void showPieces()

assemblePieces

public void assemblePieces()

resetAnimation

public void resetAnimation()

getIsAnimate

public boolean getIsAnimate()

run

public void run()
Specified by:
run in interface java.lang.Runnable