org.openscience.jmol.app

Class Jmol

public class Jmol extends JPanel

Nested Class Summary
classJmol.AboutAction
static classJmol.ActionChangedListener
protected classJmol.AppCloser
To shutdown when run as an application.
classJmol.AtomSetChooserAction
classJmol.CloseAction
static classJmol.ConsoleAction
classJmol.CopyImageAction
An Action to copy the current image into the clipboard.
classJmol.CopyScriptAction
classJmol.ExecuteScriptAction
classJmol.ExitAction
Really lame implementation of an exit command
classJmol.ExportAction
classJmol.MyStatusListener
classJmol.NewAction
classJmol.NewwinAction
classJmol.OpenAction
classJmol.OpenUrlAction
classJmol.PasteClipboardAction
classJmol.PovrayAction
classJmol.PrintAction
classJmol.RecentFilesAction
classJmol.ScriptWindowAction
classJmol.ToWebAction
classJmol.UguideAction
classJmol.ViewMeasurementTableAction
classJmol.WhatsNewAction
classJmol.WriteAction
Field Summary
static StringaboutAction
StringappletContext
static StringatomsetchooserAction
AtomSetChooseratomSetChooser
static Pointborder
static AbstractButtonbuttonRotate
Button group for toggle buttons in the toolbar.
static StringchemFileProperty
static StringcloseAction
Hashtablecommands
static JFrameconsoleframe
Jmol.CopyImageActioncopyImageAction
static StringcopyImageActionProperty
Jmol.CopyScriptActioncopyScriptAction
static StringcopyScriptActionProperty
static StringCONSOLE_WINDOW_NAME
Action[]defaultActions
Actions defined by the Jmol class
DisplayPaneldisplay
Jmol.ExecuteScriptActionexecuteScriptAction
static StringexitAction
Jmol.ExportActionexportAction
static StringexportActionProperty
protected JFrameframe
static StringFILE_OPEN_WINDOW_NAME
GuiMapguimap
static BooleanhaveBorder
static BooleanhaveConsole
static BooleanhaveDisplay
static HistoryFilehistoryFile
static String[]imageChoices
static String[]imageExtensions
StringimageType
static BooleanisSilent
JmolPopupjmolpopup
static StringJMOL_WINDOW_NAME
Stringlanguage
MeasurementTablemeasurementTable
JMenuBarmenubar
static StringmenuFile
HashtablemenuItems
static StringmenuStructure
JmolAdaptermodelAdapter
static StringnewAction
static StringnewwinAction
static intnumWindows
static StringopenAction
static StringopenurlAction
Jmol.PasteClipboardActionpasteClipboardAction
static StringpasteClipboardActionProperty
PropertyChangeSupportpcs
Jmol.PovrayActionpovrayAction
static StringpovrayActionProperty
PreferencesDialogpreferencesDialog
Jmol.PrintActionprintAction
static StringprintActionProperty
intqualityJPG
intqualityPNG
RecentFilesDialogrecentFiles
static StringrecentFilesAction
static DimensionscreenSize
static StringscriptAction
ScriptWindowscriptWindow
Splashsplash
intstartupHeight
intstartupWidth
StatusBarstatus
static StringSCRIPT_WINDOW_NAME
JToolBartoolbar
static ButtonGrouptoolbarButtonGroup
Jmol.ToWebActiontoWebAction
static StringtoWebActionProperty
static StringuguideAction
static FileUserPropsFile
JmolViewerviewer
The data model.
Jmol.ViewMeasurementTableActionviewMeasurementTableAction
WebExportwebExport
static StringwhatsnewAction
Jmol.WriteActionwriteAction
static StringwriteActionProperty
static StringWEB_MAKER_WINDOW_NAME
Constructor Summary
Jmol(Splash splash, JFrame frame, Jmol parent, int startupWidth, int startupHeight, String commandOptions)
Jmol(Splash splash, JFrame frame, Jmol parent, int startupWidth, int startupHeight, String commandOptions, Point loc)
Method Summary
protected voidaddHelpMenuBar(JMenuBar menuBar)
protected voidaddMacrosMenuBar(JMenuBar menuBar)
protected voidaddNormalMenuBar(JMenuBar menuBar)
StringcreateImageStatus(String file, String type, Object text_or_bytes, int quality)
protected JMenucreateMenu(String key)
Create a menu for the app.
protected JMenuBarcreateMenubar()
Create the menubar for the app.
protected JMenuItemcreateMenuItem(String cmd)
This is the hook through which all menu items are created.
protected ComponentcreateStatusBar()
protected ComponentcreateTool(String key)
Hook through which every toolbar item is created.
ComponentcreateToolbar()
Create the toolbar.
protected AbstractButtoncreateToolbarButton(String key)
Create a button to go inside of the toolbar.
voiddispose(JFrame f)
voiddoClose()
protected ActiongetAction(String cmd)
Fetch the action that was created for the given command.
Action[]getActions()
protected FramegetFrame()
static HistoryFilegetHistoryFile()
static JmolgetJmol(JFrame frame, int startupWidth, int startupHeight, String commandOptions)
protected JMenuItemgetMenuItem(String cmd)
Fetch the menu item that was created for the given command.
StringgetOpenFileNameFromDialog(String fileName)
static FilegetUserDirectory()
Returns a new File referenced by the property 'user.dir', or null if the property is not defined.
static voidmain(String[] args)
voidprint()
added print command, so that it can be used by RasmolScriptHandler
static voidreport(String str)
voidsay(String message)
static voidsetRotateButton()
protected voidsetupNewFrame(String state)
protected String[]tokenize(String input)
Take the given string and chop it up into a series of strings on whitespace boundries.

Field Detail

aboutAction

private static final String aboutAction

appletContext

String appletContext

atomsetchooserAction

private static final String atomsetchooserAction

atomSetChooser

public AtomSetChooser atomSetChooser

border

static Point border

buttonRotate

static AbstractButton buttonRotate
Button group for toggle buttons in the toolbar.

chemFileProperty

public static final String chemFileProperty

closeAction

private static final String closeAction

commands

private Hashtable commands

consoleframe

static JFrame consoleframe

copyImageAction

private Jmol.CopyImageAction copyImageAction

copyImageActionProperty

private static final String copyImageActionProperty

copyScriptAction

private Jmol.CopyScriptAction copyScriptAction

copyScriptActionProperty

private static final String copyScriptActionProperty

CONSOLE_WINDOW_NAME

private static final String CONSOLE_WINDOW_NAME

defaultActions

private Action[] defaultActions
Actions defined by the Jmol class

display

DisplayPanel display

executeScriptAction

private Jmol.ExecuteScriptAction executeScriptAction

exitAction

private static final String exitAction

exportAction

private Jmol.ExportAction exportAction

exportActionProperty

private static final String exportActionProperty

frame

protected JFrame frame

FILE_OPEN_WINDOW_NAME

private static final String FILE_OPEN_WINDOW_NAME

guimap

private GuiMap guimap

haveBorder

static Boolean haveBorder

haveConsole

static Boolean haveConsole

haveDisplay

static Boolean haveDisplay

historyFile

static HistoryFile historyFile

imageChoices

static final String[] imageChoices

imageExtensions

static final String[] imageExtensions

imageType

String imageType

isSilent

static Boolean isSilent

jmolpopup

JmolPopup jmolpopup

JMOL_WINDOW_NAME

private static final String JMOL_WINDOW_NAME

language

String language

measurementTable

MeasurementTable measurementTable

menubar

private JMenuBar menubar

menuFile

static String menuFile

menuItems

private Hashtable menuItems

menuStructure

static String menuStructure

modelAdapter

JmolAdapter modelAdapter

newAction

private static final String newAction

newwinAction

private static final String newwinAction

numWindows

private static int numWindows

openAction

private static final String openAction

openurlAction

private static final String openurlAction

pasteClipboardAction

private Jmol.PasteClipboardAction pasteClipboardAction

pasteClipboardActionProperty

private static final String pasteClipboardActionProperty

pcs

PropertyChangeSupport pcs

povrayAction

private Jmol.PovrayAction povrayAction

povrayActionProperty

private static final String povrayActionProperty

preferencesDialog

private PreferencesDialog preferencesDialog

printAction

private Jmol.PrintAction printAction

printActionProperty

private static final String printActionProperty

qualityJPG

int qualityJPG

qualityPNG

int qualityPNG

recentFiles

RecentFilesDialog recentFiles

recentFilesAction

private static final String recentFilesAction

screenSize

private static Dimension screenSize

scriptAction

private static final String scriptAction

scriptWindow

public ScriptWindow scriptWindow

splash

Splash splash

startupHeight

int startupHeight

startupWidth

int startupWidth

status

StatusBar status

SCRIPT_WINDOW_NAME

private static final String SCRIPT_WINDOW_NAME

toolbar

private JToolBar toolbar

toolbarButtonGroup

static ButtonGroup toolbarButtonGroup

toWebAction

private Jmol.ToWebAction toWebAction

toWebActionProperty

private static final String toWebActionProperty

uguideAction

private static final String uguideAction

UserPropsFile

static File UserPropsFile

viewer

public JmolViewer viewer
The data model.

viewMeasurementTableAction

private Jmol.ViewMeasurementTableAction viewMeasurementTableAction

webExport

WebExport webExport

whatsnewAction

private static final String whatsnewAction

writeAction

private Jmol.WriteAction writeAction

writeActionProperty

private static final String writeActionProperty

WEB_MAKER_WINDOW_NAME

private static final String WEB_MAKER_WINDOW_NAME

Constructor Detail

Jmol

Jmol(Splash splash, JFrame frame, Jmol parent, int startupWidth, int startupHeight, String commandOptions)

Jmol

Jmol(Splash splash, JFrame frame, Jmol parent, int startupWidth, int startupHeight, String commandOptions, Point loc)

Method Detail

addHelpMenuBar

protected void addHelpMenuBar(JMenuBar menuBar)

addMacrosMenuBar

protected void addMacrosMenuBar(JMenuBar menuBar)

addNormalMenuBar

protected void addNormalMenuBar(JMenuBar menuBar)

createImageStatus

String createImageStatus(String file, String type, Object text_or_bytes, int quality)

createMenu

protected JMenu createMenu(String key)
Create a menu for the app. By default this pulls the definition of the menu from the associated resource file.

Parameters: key

Returns: Menu created

createMenubar

protected JMenuBar createMenubar()
Create the menubar for the app. By default this pulls the definition of the menu from the associated resource file.

Returns: Menubar

createMenuItem

protected JMenuItem createMenuItem(String cmd)
This is the hook through which all menu items are created. It registers the result with the menuitem hashtable so that it can be fetched with getMenuItem().

Parameters: cmd

Returns: Menu item created

See Also: Jmol

createStatusBar

protected Component createStatusBar()

createTool

protected Component createTool(String key)
Hook through which every toolbar item is created.

Parameters: key

Returns: Toolbar item

createToolbar

private Component createToolbar()
Create the toolbar. By default this reads the resource file for the definition of the toolbars.

Returns: The toolbar

createToolbarButton

protected AbstractButton createToolbarButton(String key)
Create a button to go inside of the toolbar. By default this will load an image resource. The image filename is relative to the classpath (including the '.' directory if its a part of the classpath), and may either be in a JAR file or a separate file.

Parameters: key The key in the resource file to serve as the basis of lookups.

Returns: Button

dispose

private void dispose(JFrame f)

doClose

void doClose()

getAction

protected Action getAction(String cmd)
Fetch the action that was created for the given command.

Parameters: cmd Name of the action.

Returns: The action

getActions

public Action[] getActions()

Returns: A list of Actions that is understood by the upper level application

getFrame

protected Frame getFrame()

Returns: The hosting frame, for the file-chooser dialog.

getHistoryFile

public static HistoryFile getHistoryFile()

getJmol

public static Jmol getJmol(JFrame frame, int startupWidth, int startupHeight, String commandOptions)

getMenuItem

protected JMenuItem getMenuItem(String cmd)
Fetch the menu item that was created for the given command.

Parameters: cmd Name of the action.

Returns: item created for the given command or null if one wasn't created.

getOpenFileNameFromDialog

String getOpenFileNameFromDialog(String fileName)

getUserDirectory

public static File getUserDirectory()
Returns a new File referenced by the property 'user.dir', or null if the property is not defined.

Returns: a File to the user directory

main

public static void main(String[] args)

print

public void print()
added print command, so that it can be used by RasmolScriptHandler

report

static void report(String str)

say

private void say(String message)

setRotateButton

public static void setRotateButton()

setupNewFrame

protected void setupNewFrame(String state)

tokenize

protected String[] tokenize(String input)
Take the given string and chop it up into a series of strings on whitespace boundries. This is useful for trying to get an array of strings out of the resource file.

Parameters: input String to chop

Returns: Strings chopped on whitespace boundries