Class JmolPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.openscience.jmol.app.jmolpanel.JmolPanel
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,JsonNioClient
,SplashInterface
- Direct Known Subclasses:
Jmol
,NMR_JmolPanel
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
protected static class
class
protected class
To shutdown when run as an application.class
class
class
class
An Action to copy the current image into the clipboard.class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
class
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Nested classes/interfaces inherited from interface org.openscience.jmol.app.jsonkiosk.JsonNioClient
JsonNioClient.TouchHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
private static final boolean
private static final boolean
private static final boolean
private static final boolean
protected static boolean
private static final boolean
private static final boolean
protected String
protected static final String
protected static BannerFrame
(package private) static final String
protected JsonNioServer
protected static final String
protected static final String
protected JFrame
protected JmolPanel.CopyImageAction
protected static final String
protected JmolPanel.CopyScriptAction
protected static final String
protected static final String
protected static final String
protected static final String
protected JmolPanel.ExecuteScriptAction
protected static final String
protected JmolPanel.ExportAction
protected static final String
protected static final String
protected static final String
protected GaussianDialog
static HistoryFile
(package private) static final String[]
(package private) static final String[]
protected String
protected boolean
protected static KioskFrame
protected MeasurementTable
private JMenuBar
protected JmolAdapter
protected StatusListener
protected static final String
protected static final String
protected static int
protected static final String
protected static final String
protected static final String
protected static final String
static final int
protected JmolPanel.PasteClipboardAction
protected static final String
static HistoryFile
(package private) JMenu
(package private) Map<String,
JmolPlugin> (package private) boolean
protected JmolPanel.PovrayAction
protected static final String
protected PreferencesDialog
protected JmolPanel.PrintAction
protected static final String
protected int
protected int
protected RecentFilesDialog
protected static final String
protected static final String
protected static final Dimension
protected static final String
private JsonNioServer
protected int
protected int
protected StatusBar
protected SurfaceTool
protected static final String
protected JmolPanel.SurfaceToolAction
protected static final String
protected JToolBar
private JsonNioClient.TouchHandler
protected JmolPanel.ToWebAction
protected static final String
protected static final String
protected JmolPanel.ViewMeasurementTableAction
protected static final String
(package private) WebExport
protected static final String
protected String
protected JmolPanel.WriteAction
protected static final String
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, 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
Fields inherited from interface org.openscience.jmol.app.jsonkiosk.JsonNioClient
TYPES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addHelpMenuBar
(JMenuBar menuBar) static void
addJmolProperties
(Properties props) static void
addJmolProperty
(String key, String value) static void
addJmolWindowInfo
(String name, Component window, Point border) Deprecated.static void
addJmolWindowInnerInfo
(String name, Component window, Dimension inner) protected void
addMacrosMenu
(JMenuBar menuBar) protected void
addNormalMenuBar
(JMenuBar menuBar) protected void
protected void
protected GuiMap
(package private) String
createImageStatus
(String fileName, String type, Object text_or_bytes, int quality) Starting with Jmol 11.8.RC5, this is just informational if type == null and null is returned, then it means "Jmol, you handle it"createMenu
(String key) Create a menu for the app.protected JMenuBar
Create the menubar for the app.createMenuItem
(String cmd) This is the hook through which all menu items are created.protected StatusBar
(package private) void
protected JToolBar
Create the toolbar.protected AbstractButton
Create a button to go inside of the toolbar.(package private) void
(package private) void
protected boolean
doClose
(boolean saveSize) (package private) void
doNew()
protected Action
Fetch the action that was created for the given command.protected JmolPlugin
getAndRegisterPlugin
(String name, String path) protected void
protected ImageIcon
static Object
getInstanceWithParams
(String name, Class<?>[] classes, Object... params) void
protected static void
getJavaConsole
(Jmol jmol) Deprecated.static String
getJmolProperty
(String key, String defaultValue) static JsonNioServer
protected void
protected JMenuItem
getMenuItem
(String cmd) Fetch the menu item that was created for the given command.static String
getPluginOption
(String pluginName, String key, String defaultValue) getPreference
(String key) protected String
getStringX
(String cmd) static File
Returns a new File referenced by the property 'user.dir', or null if the property is not defined.protected String
boolean
isServer()
protected void
protected JToolBar
newToolbar
(String[] keys) void
nioClosed
(JsonNioServer jns) (package private) void
notifyFileOpen
(String fullPathName, String title) (package private) void
openFile()
void
print()
added print command, so that it can be used by RasmolScriptHandlervoid
processNioMessage
(byte[] packet) protected void
(package private) void
resizeDisplay
(int width, int height) (package private) int[]
resizeInnerPanel
(String data) protected void
protected void
(package private) void
sendNioSyncRequest
(Object data, int port, String strInfo) void
protected void
protected void
protected void
setFrameLocation
(Point loc, JmolPanel parent) protected void
protected String
setMenuKeys
(String key, String tokens) opportunity to adjust menus for a custom application(package private) void
setMenuNBO
(JMenu item) protected void
static void
setPluginOption
(String pluginName, String key, String value) (package private) void
void
protected void
protected void
protected void
setupDnD()
protected void
(package private) void
void
showStatus
(String message) (package private) void
void
(package private) void
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
historyFile
-
pluginFile
-
addPreferencesDialog
private static final boolean addPreferencesDialog -
addMacrosMenu
private static final boolean addMacrosMenu -
allowRecentFiles
private static final boolean allowRecentFiles -
addAtomChooser
private static final boolean addAtomChooser -
allowPreferences
private static final boolean allowPreferences -
allowGaussian
private static final boolean allowGaussian -
vwr
-
modelAdapter
-
jmolApp
-
status
-
startupWidth
protected int startupWidth -
startupHeight
protected int startupHeight -
serverService
-
appletContext
-
pcs
-
display
-
gaussianDialog
-
recentFiles
-
atomSetChooser
-
frame
-
splash
-
consoleframe
-
clientService
-
qualityJPG
protected int qualityJPG -
qualityPNG
protected int qualityPNG -
imageType
-
guimap
-
executeScriptAction
-
preferencesDialog
-
myStatusListener
-
surfaceTool
-
measurementTable
-
commands
-
toolbar
-
exportAction
-
povrayAction
-
toWebAction
-
writeAction
-
printAction
-
copyImageAction
-
copyScriptAction
-
surfaceToolAction
-
pasteClipboardAction
-
viewMeasurementTableAction
-
vwrOptions
-
windowName
-
isPlugin
protected boolean isPlugin -
numWindows
protected static int numWindows -
kioskFrame
-
bannerFrame
-
allowJavaConsole
protected static boolean allowJavaConsole -
EDITOR_WINDOW_NAME
- See Also:
-
SCRIPT_WINDOW_NAME
- See Also:
-
FILE_OPEN_WINDOW_NAME
- See Also:
-
WEB_MAKER_WINDOW_NAME
- See Also:
-
SURFACETOOL_WINDOW_NAME
- See Also:
-
screenSize
-
newwinAction
- See Also:
-
openAction
- See Also:
-
openurlAction
- See Also:
-
openpdbAction
- See Also:
-
openmolAction
- See Also:
-
newAction
- See Also:
-
exportActionProperty
- See Also:
-
closeAction
- See Also:
-
exitAction
- See Also:
-
aboutAction
- See Also:
-
whatsnewAction
- See Also:
-
creditsAction
- See Also:
-
uguideAction
- See Also:
-
printActionProperty
- See Also:
-
recentFilesAction
- See Also:
-
povrayActionProperty
- See Also:
-
writeActionProperty
- See Also:
-
editorAction
- See Also:
-
consoleAction
- See Also:
-
toWebActionProperty
- See Also:
-
atomsetchooserAction
- See Also:
-
copyImageActionProperty
- See Also:
-
copyScriptActionProperty
- See Also:
-
surfaceToolActionProperty
- See Also:
-
pasteClipboardActionProperty
- See Also:
-
gaussianAction
- See Also:
-
resizeAction
- See Also:
-
plugins
Map<String,JmolPlugin> plugins -
pluginMenu
JMenu pluginMenu -
pluginsSet
boolean pluginsSet -
imageChoices
-
imageExtensions
-
webExport
WebExport webExport -
touchHandler
-
chemFileProperty
- See Also:
-
OUTSOCKET
public static final int OUTSOCKET- See Also:
-
-
Constructor Details
-
JmolPanel
-
-
Method Details
-
getFrameActions
- Returns:
- A list of Actions that is understood by the upper level application
-
getStringX
-
getIconX
-
getWindowName
-
createGuiMap
-
createStatusBar
-
createToolBar
Create the toolbar. By default this reads the resource file for the definition of the toolbars.- Returns:
- The toolbar
-
newToolbar
-
createDisplayAndAddStatusListener
protected void createDisplayAndAddStatusListener() -
setupModelAdapterAndViewer
protected void setupModelAdapterAndViewer() -
getDialogs
protected void getDialogs() -
getMeasurementTable
protected void getMeasurementTable() -
setCommandHooks
protected void setCommandHooks() -
setupDisplay
protected void setupDisplay() -
setFrameLocation
-
setIntoFrame
protected void setIntoFrame() -
setupConsole
protected void setupConsole() -
setupDnD
protected void setupDnD() -
setAtomChooser
protected void setAtomChooser() -
launchMainFrame
protected void launchMainFrame() -
getJavaConsole
Deprecated. -
getJavaConsole
public void getJavaConsole() -
showStatus
- Specified by:
showStatus
in interfaceSplashInterface
-
report
-
say
-
doClose
protected boolean doClose(boolean saveSize) -
dispose
-
saveWindowSizes
protected void saveWindowSizes() -
createMenuItem
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:
-
getMenuItem
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.
-
getAction
Fetch the action that was created for the given command.- Parameters:
cmd
- Name of the action.- Returns:
- The action
-
createToolbarButton
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
-
createMenubar
Create the menubar for the app. By default this pulls the definition of the menu from the associated resource file.- Returns:
- Menubar
-
addPluginMenu
-
setPlugins
void setPlugins() -
addMacrosMenu
-
addNormalMenuBar
-
addHelpMenuBar
-
createMenu
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
-
setMenuKeys
opportunity to adjust menus for a custom application- Parameters:
key
-tokens
-- Returns:
- possibly changed token string
-
setMenuState
protected void setMenuState() -
doNew
void doNew() -
setMenuNBO
- Parameters:
item
-
-
startNBO
- Parameters:
jmolOptions
- e.g. NOZAP;VIEWER unused
-
showPlugin
-
getAndRegisterPlugin
-
getInstanceWithParams
-
print
public void print()added print command, so that it can be used by RasmolScriptHandler -
createImageStatus
Starting with Jmol 11.8.RC5, this is just informational if type == null and null is returned, then it means "Jmol, you handle it"- Parameters:
fileName
-type
-text_or_bytes
-quality
-- Returns:
- null (you do it) or a message starting with OK or an error message
-
createWebExport
void createWebExport() -
createSurfaceTool
void createSurfaceTool() -
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
-
openFile
void openFile() -
notifyFileOpen
-
resizeInnerPanel
-
resizeDisplay
void resizeDisplay(int width, int height) -
updateLabels
void updateLabels() -
nioClosed
- Specified by:
nioClosed
in interfaceJsonNioClient
-
sendNioSyncRequest
-
getJsonNioServer
-
updateConsoleFont
public void updateConsoleFont() -
getPreference
-
getConsole
-
getJmolProperty
-
setPluginOption
-
getPluginOption
-
addJmolProperties
-
addJmolProperty
-
setStatus
-
addJmolWindowInfo
Deprecated.Deprecated -- use addJmolWindowInnerInfo(name,window,Dimension inner)- Parameters:
name
-window
-border
-
-
addJmolWindowInnerInfo
-
processNioMessage
- Specified by:
processNioMessage
in interfaceJsonNioClient
- Throws:
Exception
-
serverCycle
public void serverCycle()- Specified by:
serverCycle
in interfaceJsonNioClient
-
isServer
public boolean isServer()
-