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 TypeClassDescriptionclassprotected static classclassprotected classTo shutdown when run as an application.classclassclassclassAn Action to copy the current image into the clipboard.classclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyNested classes/interfaces inherited from interface org.openscience.jmol.app.jsonkiosk.JsonNioClient
JsonNioClient.TouchHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprivate static final booleanprivate static final booleanprivate static final booleanprivate static final booleanprotected static booleanprivate static final booleanprivate static final booleanprotected Stringprotected static final Stringprotected static BannerFrame(package private) static final Stringprotected JsonNioServerprotected static final Stringprotected static final Stringprotected JFrameprotected JmolPanel.CopyImageActionprotected static final Stringprotected JmolPanel.CopyScriptActionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected JmolPanel.ExecuteScriptActionprotected static final Stringprotected JmolPanel.ExportActionprotected static final Stringprotected static final Stringprotected static final Stringprotected GaussianDialogstatic HistoryFile(package private) static final String[](package private) static final String[]protected Stringprotected booleanprotected static KioskFrameprotected MeasurementTableprivate JMenuBarprotected JmolAdapterprotected StatusListenerprotected static final Stringprotected static final Stringprotected static intprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final intprotected JmolPanel.PasteClipboardActionprotected static final Stringstatic HistoryFile(package private) JMenu(package private) Map<String,JmolPlugin> (package private) booleanprotected JmolPanel.PovrayActionprotected static final Stringprotected PreferencesDialogprotected JmolPanel.PrintActionprotected static final Stringprotected intprotected intprotected RecentFilesDialogprotected static final Stringprotected static final Stringprotected static final Dimensionprotected static final Stringprivate JsonNioServerprotected intprotected intprotected StatusBarprotected SurfaceToolprotected static final Stringprotected JmolPanel.SurfaceToolActionprotected static final Stringprotected JToolBarprivate JsonNioClient.TouchHandlerprotected JmolPanel.ToWebActionprotected static final Stringprotected static final Stringprotected JmolPanel.ViewMeasurementTableActionprotected static final String(package private) WebExportprotected static final Stringprotected Stringprotected JmolPanel.WriteActionprotected static final StringFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface org.openscience.jmol.app.jsonkiosk.JsonNioClient
TYPES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHelpMenuBar(JMenuBar menuBar) static voidaddJmolProperties(Properties props) static voidaddJmolProperty(String key, String value) static voidaddJmolWindowInfo(String name, Component window, Point border) Deprecated.static voidaddJmolWindowInnerInfo(String name, Component window, Dimension inner) protected voidaddMacrosMenu(JMenuBar menuBar) protected voidaddNormalMenuBar(JMenuBar menuBar) protected voidprotected voidprotected GuiMap(package private) StringcreateImageStatus(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 JMenuBarCreate the menubar for the app.createMenuItem(String cmd) This is the hook through which all menu items are created.protected StatusBar(package private) voidprotected JToolBarCreate the toolbar.protected AbstractButtonCreate a button to go inside of the toolbar.(package private) void(package private) voidprotected booleandoClose(boolean saveSize) (package private) voiddoNew()protected ActionFetch the action that was created for the given command.protected JmolPlugingetAndRegisterPlugin(String name, String path) protected voidprotected ImageIconstatic ObjectgetInstanceWithParams(String name, Class<?>[] classes, Object... params) voidprotected static voidgetJavaConsole(Jmol jmol) Deprecated.static StringgetJmolProperty(String key, String defaultValue) static JsonNioServerprotected voidprotected JMenuItemgetMenuItem(String cmd) Fetch the menu item that was created for the given command.static StringgetPluginOption(String pluginName, String key, String defaultValue) getPreference(String key) protected StringgetStringX(String cmd) static FileReturns a new File referenced by the property 'user.dir', or null if the property is not defined.protected StringbooleanisServer()protected voidprotected JToolBarnewToolbar(String[] keys) voidnioClosed(JsonNioServer jns) (package private) voidnotifyFileOpen(String fullPathName, String title) (package private) voidopenFile()voidprint()added print command, so that it can be used by RasmolScriptHandlervoidprocessNioMessage(byte[] packet) protected void(package private) voidresizeDisplay(int width, int height) (package private) int[]resizeInnerPanel(String data) protected voidprotected void(package private) voidsendNioSyncRequest(Object data, int port, String strInfo) voidprotected voidprotected voidprotected voidsetFrameLocation(Point loc, JmolPanel parent) protected voidprotected StringsetMenuKeys(String key, String tokens) opportunity to adjust menus for a custom application(package private) voidsetMenuNBO(JMenu item) protected voidstatic voidsetPluginOption(String pluginName, String key, String value) (package private) voidvoidprotected voidprotected voidprotected voidsetupDnD()protected void(package private) voidvoidshowStatus(String message) (package private) voidvoid(package private) voidMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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:
showStatusin 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:
nioClosedin 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:
processNioMessagein interfaceJsonNioClient- Throws:
Exception
-
serverCycle
public void serverCycle()- Specified by:
serverCyclein interfaceJsonNioClient
-
isServer
public boolean isServer()
-