org.openscience.jmol.app

Class AtomSetChooser

public class AtomSetChooser extends JFrame implements TreeSelectionListener, PropertyChangeListener, ActionListener, ChangeListener, Runnable

A JFrame that allows for choosing an Atomset to view.

Author: René Kanters, University of Richmond

Nested Class Summary
static classAtomSetChooser.AtomSet
Objects in the AtomSetChooser tree
Field Summary
static floatAMPLITUDE_MAX
Maximum value for vibration scale.
static floatAMPLITUDE_PRECISION
Precision of the vibration scale slider
static floatAMPLITUDE_VALUE
Initial value of vibration scale.
JSlideramplitudeSlider
ThreadanimThread
intcurrentIndex
static StringCOLLECTION
String for prefix/resource identifier for the collection area.
JSliderfpsSlider
static StringFF
static intFPS_MAX
Maximum value for the fps slider.
int[]indexes
Sequence of atom set indexes in current tree selection for a branch, or siblings for a leaf.
JLabelinfoLabel
static StringNEXT
JSliderperiodSlider
JTextAreapropertiesTextArea
static StringPAUSE
static floatPERIOD_MAX
Maximum value for the vibration period in seconds.
static floatPERIOD_PRECISION
Precision of the vibration period slider in seconds.
static floatPERIOD_VALUE
Initial value for the vibration period in seconds.
static StringPLAY
static StringPREVIOUS
JSliderradiusSlider
JCheckBoxrepeatCheckBox
static intRADIUS_MAX
Maximum value for vector radius.
static intRADIUS_VALUE
Initial value of vector radius.
static StringREWIND
JFileChoosersaveChooser
JSliderscaleSlider
JSliderselectSlider
static StringSAVE
static floatSCALE_MAX
Maximum value for vector scale.
static floatSCALE_PRECISION
Precision of the vector scale slider
static floatSCALE_VALUE
Initial value of vector scale.
JTreetree
DefaultTreeModeltreeModel
JmolViewerviewer
static StringVECTOR
String for prefix/resource identifier for the vector area.
Constructor Summary
AtomSetChooser(JmolViewer viewer, JFrame frame)
Method Summary
voidactionPerformed(ActionEvent e)
voidcreateTreeModel()
Creates the treeModel of the AtomSets available in the JmolViewer
JPanelcreateVCRController(String section)
Creates a VCR type set of controller inside a JPanel.
voidfindFrequency(int index, int increment)
Have the viewer show a particular frame with frequencies if it can be found.
voidlayoutWindow(Container container)
voidpropertyChange(PropertyChangeEvent propertyChangeEvent)
voidrun()
voidsaveXYZCollection()
Saves the currently active collection as a multistep XYZ file.
protected voidsetIndexes(DefaultMutableTreeNode node)
Sets the indexes to the atomSetIndex values of each leaf of the node.
protected voidshowAtomSetIndex(int index, boolean bSetSelectSlider)
Show an atom set from the indexes array
protected voidshowAuxiliaryInfo(Hashtable auxiliaryInfo)
Shows the auxiliary information in the propertiesPane of the AtomSetChooser window
protected voidshowProperties(Properties properties)
Shows the properties in the propertiesPane of the AtomSetChooser window
voidstateChanged(ChangeEvent e)
voidvalueChanged(TreeSelectionEvent e)

Field Detail

AMPLITUDE_MAX

private static final float AMPLITUDE_MAX
Maximum value for vibration scale. Should be in preferences?

AMPLITUDE_PRECISION

private static final float AMPLITUDE_PRECISION
Precision of the vibration scale slider

AMPLITUDE_VALUE

private static final float AMPLITUDE_VALUE
Initial value of vibration scale. Should be in preferences?

amplitudeSlider

private JSlider amplitudeSlider

animThread

private Thread animThread

currentIndex

private int currentIndex

COLLECTION

static final String COLLECTION
String for prefix/resource identifier for the collection area. This value is used in the Jmol properties files.

fpsSlider

private JSlider fpsSlider

FF

static final String FF

FPS_MAX

private static final int FPS_MAX
Maximum value for the fps slider.

indexes

private int[] indexes
Sequence of atom set indexes in current tree selection for a branch, or siblings for a leaf.

infoLabel

private JLabel infoLabel

static final String NEXT

periodSlider

private JSlider periodSlider

propertiesTextArea

private JTextArea propertiesTextArea

PAUSE

static final String PAUSE

PERIOD_MAX

private static final float PERIOD_MAX
Maximum value for the vibration period in seconds. Should be in preferences?

PERIOD_PRECISION

private static final float PERIOD_PRECISION
Precision of the vibration period slider in seconds.

PERIOD_VALUE

private static final float PERIOD_VALUE
Initial value for the vibration period in seconds. Should be in preferences?

PLAY

static final String PLAY

static final String PREVIOUS

radiusSlider

private JSlider radiusSlider

repeatCheckBox

private JCheckBox repeatCheckBox

RADIUS_MAX

private static final int RADIUS_MAX
Maximum value for vector radius.

RADIUS_VALUE

private static final int RADIUS_VALUE
Initial value of vector radius. Should be in preferences?

REWIND

static final String REWIND

saveChooser

private JFileChooser saveChooser

scaleSlider

private JSlider scaleSlider

selectSlider

private JSlider selectSlider

SAVE

static final String SAVE

SCALE_MAX

private static final float SCALE_MAX
Maximum value for vector scale. Should be in preferences?

SCALE_PRECISION

private static final float SCALE_PRECISION
Precision of the vector scale slider

SCALE_VALUE

private static final float SCALE_VALUE
Initial value of vector scale. Should be in preferences?

tree

private JTree tree

treeModel

private DefaultTreeModel treeModel

viewer

private JmolViewer viewer

VECTOR

static final String VECTOR
String for prefix/resource identifier for the vector area. This value is used in the Jmol properties files.

Constructor Detail

AtomSetChooser

public AtomSetChooser(JmolViewer viewer, JFrame frame)

Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)

createTreeModel

private void createTreeModel()
Creates the treeModel of the AtomSets available in the JmolViewer

createVCRController

private JPanel createVCRController(String section)
Creates a VCR type set of controller inside a JPanel.

Uses the JmolResourceHandler to get the label for the panel, the images for the buttons, and the tooltips. The button names are rewind, prev, play, pause, next, and ff.

The handler for the buttons should determine from the getActionCommand which button in which section triggered the actionEvent, which is identified by {section}.{name}.

Parameters: section String of the section that the controller belongs to.

Returns: The JPanel

findFrequency

public void findFrequency(int index, int increment)
Have the viewer show a particular frame with frequencies if it can be found.

Parameters: index Starting index where to start looking for frequencies increment Increment value for how to go through the list

layoutWindow

private void layoutWindow(Container container)

propertyChange

public void propertyChange(PropertyChangeEvent propertyChangeEvent)

run

public void run()

saveXYZCollection

public void saveXYZCollection()
Saves the currently active collection as a multistep XYZ file.

setIndexes

protected void setIndexes(DefaultMutableTreeNode node)
Sets the indexes to the atomSetIndex values of each leaf of the node.

Parameters: node The node whose leaf's atomSetIndex values should be used

showAtomSetIndex

protected void showAtomSetIndex(int index, boolean bSetSelectSlider)
Show an atom set from the indexes array

Parameters: index The index in the index array bSetSelectSlider If true, updates the selectSlider

showAuxiliaryInfo

protected void showAuxiliaryInfo(Hashtable auxiliaryInfo)
Shows the auxiliary information in the propertiesPane of the AtomSetChooser window

Parameters: auxiliaryInfo Hashtable to be shown.

showProperties

protected void showProperties(Properties properties)
Shows the properties in the propertiesPane of the AtomSetChooser window

Parameters: properties Properties to be shown.

stateChanged

public void stateChanged(ChangeEvent e)

valueChanged

public void valueChanged(TreeSelectionEvent e)