Class JmolPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, JsonNioClient, SplashInterface
Direct Known Subclasses:
Jmol, NMR_JmolPanel

public class JmolPanel extends JPanel implements SplashInterface, JsonNioClient
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getFrameActions

      protected List<Action> getFrameActions()
      Returns:
      A list of Actions that is understood by the upper level application
    • getStringX

      protected String getStringX(String cmd)
    • getIconX

      protected ImageIcon getIconX(String img)
    • getWindowName

      protected String getWindowName()
    • createGuiMap

      protected GuiMap createGuiMap()
    • createStatusBar

      protected StatusBar createStatusBar()
    • createToolBar

      protected JToolBar createToolBar()
      Create the toolbar. By default this reads the resource file for the definition of the toolbars.
      Returns:
      The toolbar
    • newToolbar

      protected JToolBar newToolbar(String[] keys)
    • 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

      protected void setFrameLocation(Point loc, JmolPanel parent)
    • setIntoFrame

      protected void setIntoFrame()
    • setupConsole

      protected void setupConsole()
    • setupDnD

      protected void setupDnD()
    • setAtomChooser

      protected void setAtomChooser()
    • launchMainFrame

      protected void launchMainFrame()
    • getJavaConsole

      @Deprecated protected static void getJavaConsole(Jmol jmol)
      Deprecated.
    • getJavaConsole

      public void getJavaConsole()
    • showStatus

      public void showStatus(String message)
      Specified by:
      showStatus in interface SplashInterface
    • report

      protected void report(String str)
    • say

      protected void say(String message)
    • doClose

      protected boolean doClose(boolean saveSize)
    • dispose

      void dispose(JFrame f, boolean saveSize)
    • saveWindowSizes

      protected void saveWindowSizes()
    • createMenuItem

      public 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:
    • 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.
    • 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
    • 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
    • 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
    • addPluginMenu

      protected void addPluginMenu(JMenuBar mb)
    • setPlugins

      void setPlugins()
    • addMacrosMenu

      protected void addMacrosMenu(JMenuBar menuBar)
    • addNormalMenuBar

      protected void addNormalMenuBar(JMenuBar menuBar)
    • addHelpMenuBar

      protected void addHelpMenuBar(JMenuBar menuBar)
    • createMenu

      public 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
    • setMenuKeys

      protected String setMenuKeys(String key, String tokens)
      opportunity to adjust menus for a custom application
      Parameters:
      key -
      tokens -
      Returns:
      possibly changed token string
    • setMenuState

      protected void setMenuState()
    • doNew

      void doNew()
    • setMenuNBO

      void setMenuNBO(JMenu item)
      Parameters:
      item -
    • startNBO

      void startNBO(Map<String,Object> jmolOptions)
      Parameters:
      jmolOptions - e.g. NOZAP;VIEWER unused
    • showPlugin

      void showPlugin(String name, String path, Map<String,Object> jmolOptions)
    • getAndRegisterPlugin

      protected JmolPlugin getAndRegisterPlugin(String name, String path)
    • getInstanceWithParams

      public static Object getInstanceWithParams(String name, Class<?>[] classes, Object... params)
    • print

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

      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"
      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

      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
    • openFile

      void openFile()
    • notifyFileOpen

      void notifyFileOpen(String fullPathName, String title)
    • resizeInnerPanel

      int[] resizeInnerPanel(String data)
    • resizeDisplay

      void resizeDisplay(int width, int height)
    • updateLabels

      void updateLabels()
    • nioClosed

      public void nioClosed(JsonNioServer jns)
      Specified by:
      nioClosed in interface JsonNioClient
    • sendNioSyncRequest

      void sendNioSyncRequest(Object data, int port, String strInfo)
    • getJsonNioServer

      public static JsonNioServer getJsonNioServer()
    • updateConsoleFont

      public void updateConsoleFont()
    • getPreference

      public Object getPreference(String key)
    • getConsole

      public AppConsole getConsole()
    • getJmolProperty

      public static String getJmolProperty(String key, String defaultValue)
    • setPluginOption

      public static void setPluginOption(String pluginName, String key, String value)
    • getPluginOption

      public static String getPluginOption(String pluginName, String key, String defaultValue)
    • addJmolProperties

      public static void addJmolProperties(Properties props)
    • addJmolProperty

      public static void addJmolProperty(String key, String value)
    • setStatus

      public void setStatus(int pos, String msg)
    • addJmolWindowInfo

      @Deprecated public static void addJmolWindowInfo(String name, Component window, Point border)
      Deprecated.
      Deprecated -- use addJmolWindowInnerInfo(name,window,Dimension inner)
      Parameters:
      name -
      window -
      border -
    • addJmolWindowInnerInfo

      public static void addJmolWindowInnerInfo(String name, Component window, Dimension inner)
    • processNioMessage

      public void processNioMessage(byte[] packet) throws Exception
      Specified by:
      processNioMessage in interface JsonNioClient
      Throws:
      Exception
    • serverCycle

      public void serverCycle()
      Specified by:
      serverCycle in interface JsonNioClient
    • isServer

      public boolean isServer()