Class Viewer

All Implemented Interfaces:
PlatformViewer, AtomDataServer
Direct Known Subclasses:
NMR_Viewer

public class Viewer extends JmolViewer implements AtomDataServer, PlatformViewer
  • Field Details

    • nullDeletedAtoms

      public static final boolean nullDeletedAtoms
      See Also:
    • testAsync

      public boolean testAsync
    • autoExit

      public boolean autoExit
    • haveDisplay

      public boolean haveDisplay
    • isJS

      public static boolean isJS
    • isSwingJS

      public static boolean isSwingJS
    • isJSNoAWT

      public boolean isJSNoAWT
    • isWebGL

      public boolean isWebGL
    • isSingleThreaded

      public boolean isSingleThreaded
    • queueOnHold

      public boolean queueOnHold
    • fullName

      public String fullName
    • appletDocumentBase

      public static String appletDocumentBase
    • appletCodeBase

      public static String appletCodeBase
    • appletIdiomaBase

      public static String appletIdiomaBase
    • jsDocumentBase

      public static String jsDocumentBase
    • compiler

      public Object compiler
    • definedAtomSets

      public Map<String,Object> definedAtomSets
    • ms

      public ModelSet ms
    • fm

      public FileManager fm
    • isApplet

      public boolean isApplet
    • isJNLP

      public boolean isJNLP
    • isSyntaxAndFileCheck

      public boolean isSyntaxAndFileCheck
    • isSyntaxCheck

      public boolean isSyntaxCheck
    • listCommands

      public boolean listCommands
    • mustRender

      boolean mustRender
    • htmlName

      public String htmlName
    • appletName

      public String appletName
    • tryPt

      public int tryPt
    • insertedCommand

      private String insertedCommand
    • gdata

      public GData gdata
    • html5Applet

      public JSmolAppletObject html5Applet
    • jmolObject

      public static JmolToJSmolInterface jmolObject
    • acm

      public ActionManager acm
    • am

      public AnimationManager am
    • cm

      public ColorManager cm
    • dm

    • shm

      public ShapeManager shm
    • slm

      public SelectionManager slm
    • rm

    • g

      public GlobalSettings g
    • sm

      public StatusManager sm
    • tm

      public TransformManager tm
    • strJavaVendor

      public static String strJavaVendor
    • strOSName

      public static String strOSName
    • strJavaVersion

      public static String strJavaVersion
    • syncId

      String syncId
    • logFilePath

      String logFilePath
    • allowScripting

      private boolean allowScripting
    • isPrintOnly

      public boolean isPrintOnly
    • isSignedApplet

      public boolean isSignedApplet
    • isSignedAppletLocal

      private boolean isSignedAppletLocal
    • isSilent

      private boolean isSilent
    • multiTouch

      private boolean multiTouch
    • noGraphicsAllowed

      public boolean noGraphicsAllowed
    • useCommandThread

      private boolean useCommandThread
    • commandOptions

      private String commandOptions
    • vwrOptions

      public Map<String,Object> vwrOptions
    • display

      public Object display
    • modelAdapter

      private JmolAdapter modelAdapter
    • access

      private Viewer.ACCESS access
    • commandHistory

      private CommandHistory commandHistory
    • mm

      public ModelManager mm
    • stm

      public StateManager stm
    • scm

      private JmolScriptManager scm
    • eval

      public JmolScriptEvaluator eval
    • tempArray

      private TempArray tempArray
    • allowArrayDotNotation

      public boolean allowArrayDotNotation
    • async

      public boolean async
    • executor

      public Object executor
    • version_date

      private static String version_date
    • screenWidth

      int screenWidth
    • screenHeight

      int screenHeight
    • defaultVdw

      VDW defaultVdw
    • rd

      public RadiusData rd
    • chainMap

      public Map<Object,Object> chainMap
    • chainList

      private javajs.util.Lst<String> chainList
    • errorMessage

      private String errorMessage
    • errorMessageUntranslated

      private String errorMessageUntranslated
    • privateKey

      private double privateKey
    • dataOnly

      private boolean dataOnly
    • maximumSize

      private int maximumSize
    • gRight

      private Object gRight
      A graphics from a "slave" stereo display that has been synchronized with this this applet.
    • isStereoSlave

      private boolean isStereoSlave
      A flag to indicate that THIS is the right-side panel of a pair of synced applets running a left-right stereo display (that would be piped into a dual-image polarized projector system such as GeoWall).
    • imageFontScaling

      public float imageFontScaling
    • antialiased

      public boolean antialiased
    • prevFrame

      private int prevFrame
    • prevMorphModel

      private float prevMorphModel
    • haveJDX

      private boolean haveJDX
    • jsv

      private JmolJSpecView jsv
    • outputManager

      private OutputManager outputManager
    • jzt

      private javajs.api.GenericZipTools jzt
    • isPreviewOnly

      public boolean isPreviewOnly
    • headless

      public boolean headless
      determined by GraphicsEnvironment.isHeadless() from java -Djava.awt.headless=true disables command threading disables DELAY, TIMEOUT, PAUSE, LOOP, GOTO, SPIN , ANIMATION ON turns SPIN into just ROTATE
    • movableBitSet

      public javajs.util.BS movableBitSet
    • hasSelected

      public boolean hasSelected
    • mouse

      private GenericMouseInterface mouse
      either org.jmol.awt.Mouse or org.jmol.awtjs2d.Mouse
    • ligandModels

      Map<String,Object> ligandModels
    • ligandModelSet

      Map<String,Boolean> ligandModelSet
    • annotationParser

      private JmolAnnotationParser annotationParser
    • dssrParser

      private JmolAnnotationParser dssrParser
    • minimizer

      private Minimizer minimizer
    • smilesMatcher

      private SmilesMatcherInterface smilesMatcher
    • jsc

    • lastData

      private Object[] lastData
    • motionEventNumber

      private int motionEventNumber
    • inMotion

      private boolean inMotion
    • refreshing

      private boolean refreshing
    • REFRESH_REPAINT

      public static final int REFRESH_REPAINT
      See Also:
    • REFRESH_SYNC

      public static final int REFRESH_SYNC
      See Also:
    • REFRESH_SYNC_MASK

      public static final int REFRESH_SYNC_MASK
      See Also:
    • REFRESH_REPAINT_NO_MOTION_ONLY

      public static final int REFRESH_REPAINT_NO_MOTION_ONLY
      See Also:
    • REFRESH_SEND_WEBGL_NEW_ORIENTATION

      public static final int REFRESH_SEND_WEBGL_NEW_ORIENTATION
      See Also:
    • axesAreTainted

      private boolean axesAreTainted
    • captureParams

      public Map<String,Object> captureParams
    • jsParams

      private Map<String,Object> jsParams
    • cirChecked

      boolean cirChecked
    • hoverAtomIndex

      private int hoverAtomIndex
    • hoverText

      private String hoverText
    • hoverLabel

      private String hoverLabel
    • hoverEnabled

      private boolean hoverEnabled
    • currentCursor

      public int currentCursor
    • ptTemp

      private javajs.util.P3 ptTemp
    • selectionHalosEnabled

      private boolean selectionHalosEnabled
    • frankOn

      public boolean frankOn
    • noFrankEcho

      public boolean noFrankEcho
    • scriptEditorVisible

      public boolean scriptEditorVisible
    • appConsole

      public JmolAppConsoleInterface appConsole
    • scriptEditor

      private JmolScriptEditorInterface scriptEditor
    • jmolpopup

    • modelkit

      private ModelKit modelkit
    • headlessImageParams

      private Map<String,Object> headlessImageParams
    • pm

    • isTainted

      boolean isTainted
    • movingSelected

      private boolean movingSelected
    • showSelected

      private boolean showSelected
    • ptScreen

      private javajs.util.P3 ptScreen
    • ptScreenNew

      private javajs.util.P3 ptScreenNew
    • ptNew

      private javajs.util.P3 ptNew
    • atomHighlighted

      public int atomHighlighted
    • creatingImage

      public boolean creatingImage
    • SYNC_GRAPHICS_MESSAGE

      public static final String SYNC_GRAPHICS_MESSAGE
      See Also:
    • SYNC_NO_GRAPHICS_MESSAGE

      public static final String SYNC_NO_GRAPHICS_MESSAGE
      See Also:
    • bsUserVdws

      javajs.util.BS bsUserVdws
    • userVdws

      float[] userVdws
    • userVdwMars

      int[] userVdwMars
    • MODIFY_ASSIGN_ATOM

      public static final int MODIFY_ASSIGN_ATOM
      See Also:
    • MODIFY_DELETE_BONDS

      public static final int MODIFY_DELETE_BONDS
      See Also:
    • MODIFY_SET_COORD

      public static final int MODIFY_SET_COORD
      See Also:
    • MODIFY_DELETE_ATOM

      public static final int MODIFY_DELETE_ATOM
      See Also:
    • MODIFY_DELETE_MODEL

      public static final int MODIFY_DELETE_MODEL
      See Also:
    • MODIFY_ASSIGN_BOND

      public static final int MODIFY_ASSIGN_BOND
      See Also:
    • MODIFY_DELETE_ATOMS

      public static final int MODIFY_DELETE_ATOMS
      See Also:
    • currentShapeID

      private int currentShapeID
    • currentShapeState

      private String currentShapeState
    • staticFunctions

      static final Map<String,JmolScriptFunction> staticFunctions
    • localFunctions

      Map<String,JmolScriptFunction> localFunctions
    • isKiosk

      boolean isKiosk
    • MIN_SILENT

      public static final int MIN_SILENT
      See Also:
    • MIN_HAVE_FIXED

      public static final int MIN_HAVE_FIXED
      See Also:
    • MIN_QUICK

      public static final int MIN_QUICK
      See Also:
    • MIN_ADDH

      public static final int MIN_ADDH
      See Also:
    • MIN_NO_RANGE

      public static final int MIN_NO_RANGE
      See Also:
    • MIN_XX

      public static final int MIN_XX
      See Also:
    • nProcessors

      public static int nProcessors
    • displayLoadErrors

      public boolean displayLoadErrors
    • isParallel

      private boolean isParallel
    • stateScriptVersionInt

      public int stateScriptVersionInt
    • jsExporter3D

      private JmolRendererInterface jsExporter3D
    • timeouts

      public Map<String,Object> timeouts
    • chainCaseSpecified

      private boolean chainCaseSpecified
    • nmrCalculation

      JmolNMRInterface nmrCalculation
    • logFileName

      String logFileName
    • jbr

    • jcm

      private JmolChimeMessenger jcm
    • jsonParser

      private javajs.util.JSJSONParser jsonParser
    • triangulator

      private Triangulator triangulator
    • nboParser

      private NBOParser nboParser
    • macros

      private Map<String,Object> macros
    • consoleFontScale

      private int consoleFontScale
  • Constructor Details

    • Viewer

      public Viewer(Map<String,Object> info)
      new way...
      Parameters:
      info - "display" "adapter" "statusListener" "platform" "options" "fullName" "documentBase" "codeBase" "multiTouch" [options] "noGraphics" "printOnly" "previewOnly" "debug" "applet" "signedApplet" "appletProxy" "useCommandThread" "platform" [option] "backgroundTransparent" "exit" "listCommands" "check" "checkLoad" "silent" "access:READSPT" "access:NONE" "menuFile" "headlessMaxTimeMs" "headlessImage" "isDataOnly" "async"
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • setInsertedCommand

      public void setInsertedCommand(String strScript)
    • getJmolVersion

      public static String getJmolVersion()
    • allocateViewer

      protected static JmolViewer allocateViewer(Object display, JmolAdapter modelAdapter, String fullName, URL documentBase, URL codeBase, String commandOptions, JmolStatusListener statusListener, GenericPlatform implementedPlatform)
      old way...
      Parameters:
      display -
      modelAdapter -
      fullName -
      documentBase -
      codeBase -
      commandOptions -
      statusListener -
      implementedPlatform -
      Returns:
      JmolViewer object
    • haveAccess

      public boolean haveAccess(Viewer.ACCESS a)
    • getModelAdapter

      public JmolAdapter getModelAdapter()
      Specified by:
      getModelAdapter in class JmolViewer
    • getSmartsMatch

      public javajs.util.BS getSmartsMatch(String smarts, javajs.util.BS bsSelected) throws Exception
      Specified by:
      getSmartsMatch in class JmolViewer
      Throws:
      Exception
    • getSmartsMatchForNodes

      public javajs.util.BS getSmartsMatchForNodes(String smarts, Node[] atoms) throws Exception
      Throws:
      Exception
    • getSmartsMap

      public int[][] getSmartsMap(String smilesOrSmarts, javajs.util.BS bsSelected, int flags) throws Exception
      Parameters:
      smilesOrSmarts -
      bsSelected -
      flags - can be bitwise OR of JC.SMILES_* options, in particular, JC.SMILES_TYPE_SMARTS, JC.SMILES_TYPE_SMILES, and JC.SMILES_MAP_UNIQUE
      Returns:
      map
      Throws:
      Exception
    • setOptions

      public void setOptions(Map<String,Object> info)
    • setMaximumSize

      private void setMaximumSize(int x)
    • setStereo

      public void setStereo(boolean isStereoSlave, Object gRight)
    • getMenu

      public String getMenu(String type)
    • resizeInnerPanel

      public int[] resizeInnerPanel(int width, int height)
      Specified by:
      resizeInnerPanel in class JmolViewer
    • setScreenDimension

      public void setScreenDimension(int width, int height)
      Specified by:
      setScreenDimension in class JmolViewer
    • resizeImage

      void resizeImage(int width, int height, boolean isImageWrite, boolean isExport, boolean isReset)
    • getScreenWidth

      public int getScreenWidth()
      Specified by:
      getScreenWidth in class JmolViewer
    • getScreenHeight

      public int getScreenHeight()
      Specified by:
      getScreenHeight in class JmolViewer
    • getScreenDim

      public int getScreenDim()
    • setWidthHeightVar

      public void setWidthHeightVar()
    • getBoundBoxCenterX

      public int getBoundBoxCenterX()
    • getBoundBoxCenterY

      public int getBoundBoxCenterY()
    • updateWindow

      private boolean updateWindow(int width, int height)
    • getImage

      private Object getImage(boolean isDouble, boolean isImageWrite)
      Parameters:
      isDouble -
      isImageWrite -
      Returns:
      a java.awt.Image in the case of standard Jmol; an int[] in the case of Jmol-Android a canvas in the case of JSmol
    • beginRendering

      private void beginRendering(boolean isDouble, boolean isImageWrite)
    • render

      private void render()
    • drawImage

      private void drawImage(Object graphic, Object img, int x, int y, boolean isDTI)
      Parameters:
      graphic - In JavaScript/HTML5, a Canvas.Context2d
      img -
      x -
      y -
      isDTI - DTI format -- scrunch width by factor of two
    • getScreenImage

      public Object getScreenImage()
    • getScreenImageBuffer

      public Object getScreenImageBuffer(Object g, boolean isImageWrite)
      Image.getJpgImage, ImageCreator.clipImage, getImageBytes, Viewer.renderScreenImageStereo
      Specified by:
      getScreenImageBuffer in class JmolViewer
    • evalStringWaitStatusQueued

      public Object evalStringWaitStatusQueued(String returnType, String strScript, String statusList, boolean isQuiet, boolean isQueued)
    • popupMenu

      void popupMenu(int x, int y, char type)
    • getModelkit

      public ModelKit getModelkit(boolean andShow)
    • getPopupMenu

      Object getPopupMenu()
    • setMenu

      public void setMenu(String fileOrText, boolean isFile)
      Specified by:
      setMenu in class JmolViewer
    • setStatusFrameChanged

      void setStatusFrameChanged(boolean isVib, boolean doNotify)
      Parameters:
      isVib -
      doNotify - ignored; not implemented
    • doHaveJDX

      private boolean doHaveJDX()
    • getJSV

      JmolJSpecView getJSV()
    • getJDXBaseModelIndex

      public int getJDXBaseModelIndex(int modelIndex)
      get the model designated as "baseModel" in a JCamp-MOL file for example, the model used for bonding for an XYZVIB file or the model used as the base model for a mass spec file. This might then allow pointing off a peak in JSpecView to switch to the model that is involved in HNMR or CNMR
      Parameters:
      modelIndex -
      Returns:
      modelIndex
    • getJspecViewProperties

      public Object getJspecViewProperties(Object myParam)
    • scriptEcho

      public void scriptEcho(String strEcho)
    • isScriptQueued

      private boolean isScriptQueued()
    • notifyError

      public void notifyError(String errType, String errMsg, String errMsgUntranslated)
    • jsEval

      public String jsEval(String strEval)
    • jsEvalSV

      public SV jsEvalSV(String strEval)
    • setFileLoadStatus

      private void setFileLoadStatus(FIL ptLoad, String fullPathName, String fileName, String modelName, String strError, Boolean isAsync)
    • getZapName

      public String getZapName()
    • setStatusMeasuring

      public void setStatusMeasuring(String status, int intInfo, String strMeasure, float value)
    • notifyMinimizationStatus

      public void notifyMinimizationStatus()
    • setStatusAtomPicked

      public void setStatusAtomPicked(int atomIndex, String info, Map<String,Object> map, boolean andSelect)
    • getProperty

      public Object getProperty(String returnType, String infoType, Object paramInfo)
      Specified by:
      getProperty in class JmolViewer
      Parameters:
      returnType - "JSON", "string", "readable", and anything else returns the Java object.
      infoType -
      paramInfo -
      Returns:
      property data -- see org.jmol.viewer.PropertyManager.java
    • notifyMouseClicked

      public int notifyMouseClicked(int x, int y, int action, int mode)
    • getOutputManager

      private OutputManager getOutputManager()
    • getJzt

      public javajs.api.GenericZipTools getJzt()
    • readFileAsMap

      public void readFileAsMap(BufferedInputStream bis, Map<String,Object> map, String name)
    • getZipDirectoryAsString

      public String getZipDirectoryAsString(String fileName)
    • getImageAsBytes

      public byte[] getImageAsBytes(String type, int width, int height, int quality, String[] errMsg)
      Specified by:
      getImageAsBytes in class JmolViewer
      Parameters:
      type -
      width -
      height -
      quality -
      errMsg - TODO
      Returns:
      byte[] image, or null and an error message
    • releaseScreenImage

      public void releaseScreenImage()
      Specified by:
      releaseScreenImage in class JmolViewer
    • setDisplay

      public void setDisplay(Object canvas)
    • newMeasurementData

      public MeasurementData newMeasurementData(String id, javajs.util.Lst<Object> points)
    • getDataManager

      private JmolDataManager getDataManager()
    • getScriptManager

      private JmolScriptManager getScriptManager()
    • checkOption2

      private boolean checkOption2(String key1, String key2)
    • setStartupBooleans

      private void setStartupBooleans()
    • getExportDriverList

      public String getExportDriverList()
    • dispose

      public void dispose()
      end of life for this viewer
      Overrides:
      dispose in class JmolViewer
    • reset

      public void reset(boolean includingSpin)
    • homePosition

      public void homePosition()
      Specified by:
      homePosition in class JmolViewer
    • initialize

      public void initialize(boolean clearUserVariables, boolean isPyMOL)
    • saveModelOrientation

      void saveModelOrientation()
    • restoreModelOrientation

      void restoreModelOrientation(int modelIndex)
    • restoreModelRotation

      void restoreModelRotation(int modelIndex)
    • getGLmolView

      public Object getGLmolView()
      This method is only called by JmolGLmol applet._refresh();
      Returns:
      enough data to update a WebGL view
    • setRotationRadius

      public void setRotationRadius(float angstroms, boolean doAll)
    • setCenterBitSet

      public void setCenterBitSet(javajs.util.BS bsCenter, boolean doScale)
    • setNewRotationCenter

      public void setNewRotationCenter(javajs.util.P3 center)
    • move

      public void move(JmolScriptEvaluator eval, javajs.util.V3 dRot, float dZoom, javajs.util.V3 dTrans, float dSlab, float floatSecondsTotal, int fps)
    • moveTo

      public void moveTo(JmolScriptEvaluator eval, float floatSecondsTotal, javajs.util.P3 center, javajs.util.V3 rotAxis, float degrees, javajs.util.M3 rotationMatrix, float zoom, float xTrans, float yTrans, float rotationRadius, javajs.util.P3 navCenter, float xNav, float yNav, float navDepth, float cameraDepth, float cameraX, float cameraY)
    • moveUpdate

      public void moveUpdate(float floatSecondsTotal)
    • zoomBy

      void zoomBy(int pixels)
    • zoomByFactor

      void zoomByFactor(float factor, int x, int y)
    • rotateXYBy

      void rotateXYBy(float degX, float degY)
    • spinXYBy

      public void spinXYBy(int xDelta, int yDelta, float speed)
    • rotateZBy

      public void rotateZBy(int zDelta, int x, int y)
    • rotateSelected

      void rotateSelected(float deltaX, float deltaY, javajs.util.BS bsSelected)
    • setMovableBitSet

      private javajs.util.BS setMovableBitSet(javajs.util.BS bsSelected, boolean checkMolecule)
    • translateXYBy

      public void translateXYBy(int xDelta, int yDelta)
    • rotateFront

      public void rotateFront()
      Specified by:
      rotateFront in class JmolViewer
    • translate

      public void translate(char xyz, float x, char type, javajs.util.BS bsAtoms)
    • slabByPixels

      void slabByPixels(int pixels)
    • depthByPixels

      void depthByPixels(int pixels)
    • slabDepthByPixels

      void slabDepthByPixels(int pixels)
    • finalizeTransformParameters

      public void finalizeTransformParameters()
    • getScalePixelsPerAngstrom

      public float getScalePixelsPerAngstrom(boolean asAntialiased)
    • setSpin

      public void setSpin(String key, int value)
    • getSpinState

      public String getSpinState()
    • getOrientation

      public Object getOrientation(int type, String name, javajs.util.BS bs)
      Parameters:
      type -
      name -
      bs -
      Returns:
      String or Quat or P3[]
    • getCurrentColorRange

      public float[] getCurrentColorRange()
    • setDefaultColors

      private void setDefaultColors(boolean isRasmol)
    • setElementArgb

      public void setElementArgb(int elementNumber, int argb)
    • setVectorScale

      public void setVectorScale(float scale)
      Specified by:
      setVectorScale in class JmolViewer
    • setVibrationScale

      public void setVibrationScale(float scale)
      Specified by:
      setVibrationScale in class JmolViewer
    • setVibrationPeriod

      public void setVibrationPeriod(float period)
      Specified by:
      setVibrationPeriod in class JmolViewer
    • setObjectColor

      void setObjectColor(String name, String colorName)
    • setObjectVisibility

      public void setObjectVisibility(String name, boolean b)
    • setObjectArgb

      public void setObjectArgb(String name, int argb)
    • setBackgroundImage

      public void setBackgroundImage(String fileName, Object image)
    • getObjectColix

      public short getObjectColix(int objId)
    • setColorBackground

      public void setColorBackground(String colorName)
      Specified by:
      setColorBackground in class JmolViewer
    • getBackgroundArgb

      public int getBackgroundArgb()
      Specified by:
      getBackgroundArgb in class JmolViewer
    • setObjectMad10

      public void setObjectMad10(int iShape, String name, int mad10)
      input here is a JC.SHAPE_xxxx identifier
      Parameters:
      iShape -
      name -
      mad10 -
    • getObjectMad10

      public int getObjectMad10(int objId)
      Parameters:
      objId -
      Returns:
      mad10
    • setPropertyColorScheme

      public void setPropertyColorScheme(String scheme, boolean isTranslucent, boolean isOverloaded)
    • getLightingState

      public String getLightingState()
    • getColorPointForPropertyValue

      public javajs.util.P3 getColorPointForPropertyValue(float val)
    • select

      public void select(javajs.util.BS bs, boolean isGroup, int addRemove, boolean isQuiet)
    • setSelectionSet

      public void setSelectionSet(javajs.util.BS set)
      Specified by:
      setSelectionSet in class JmolViewer
    • selectBonds

      public void selectBonds(javajs.util.BS bs)
    • displayAtoms

      public void displayAtoms(javajs.util.BS bs, boolean isDisplay, boolean isGroup, int addRemove, boolean isQuiet)
    • getUndeletedGroupAtomBits

      private javajs.util.BS getUndeletedGroupAtomBits(javajs.util.BS bs)
    • reportSelection

      void reportSelection(String msg)
    • clearAtomSets

      private void clearAtomSets()
    • getDefinedAtomSet

      public javajs.util.BS getDefinedAtomSet(String name)
    • selectAll

      public void selectAll()
      Specified by:
      selectAll in class JmolViewer
    • clearSelection

      public void clearSelection()
      Specified by:
      clearSelection in class JmolViewer
    • bsA

      public javajs.util.BS bsA()
    • addSelectionListener

      public void addSelectionListener(JmolSelectionListener listener)
      Specified by:
      addSelectionListener in class JmolViewer
    • removeSelectionListener

      public void removeSelectionListener(JmolSelectionListener listener)
      Specified by:
      removeSelectionListener in class JmolViewer
    • getAtomBitSetEval

      javajs.util.BS getAtomBitSetEval(JmolScriptEvaluator eval, Object atomExpression)
    • processTwoPointGesture

      public void processTwoPointGesture(float[][][] touches)
    • processMouseEvent

      public boolean processMouseEvent(int id, int x, int y, int modifiers, long time)
    • processKeyEvent

      public void processKeyEvent(Object event)
    • getRubberBandSelection

      public Rectangle getRubberBandSelection()
    • isBound

      public boolean isBound(int mouseAction, int jmolAction)
    • getCursorX

      public int getCursorX()
    • getCursorY

      public int getCursorY()
    • getDefaultDirectory

      public String getDefaultDirectory()
    • getLocalUrl

      public String getLocalUrl(String fileName)
    • getFileAsString

      public String getFileAsString(String fileName)
    • getBufferedInputStream

      public BufferedInputStream getBufferedInputStream(String fullPathName)
      Specified by:
      getBufferedInputStream in interface AtomDataServer
    • setLoadParameters

      public Map<String,Object> setLoadParameters(Map<String,Object> htParams, boolean isAppend)
    • openFileAsyncSpecial

      public void openFileAsyncSpecial(String fileName, int flags)
      opens a file as a model, a script, or a surface via the creation of a script that is queued. Called from (JSmolCore.js)Jmol.$appEvent(,,"drop").reader.onloadend()
      Specified by:
      openFileAsyncSpecial in class JmolViewer
      Parameters:
      fileName -
      flags - 1=pdbCartoons, 2=no scripting, 4=append, 8=no autoplay, 16=file dropped, 32=script only (dropped into console) 64=check dims for resize
    • openFileAsyncSpecialType

      public void openFileAsyncSpecialType(String fileName, int flags, String fileType)
      Specified by:
      openFileAsyncSpecialType in class JmolViewer
    • openFile

      public String openFile(String fileName)
      for JmolSimpleViewer -- external applications only (and no-script JavaScript)
      Specified by:
      openFile in class JmolViewer
      Parameters:
      fileName -
      Returns:
      null or error
    • openFiles

      public String openFiles(String[] fileNames)
      for JmolSimpleViewer -- external applications only
      Specified by:
      openFiles in class JmolViewer
      Parameters:
      fileNames -
      Returns:
      null or error
    • openReader

      public String openReader(String fullPathName, String fileName, Object reader)
      Opens the file, given an already-created reader.
      Specified by:
      openReader in class JmolViewer
      Parameters:
      fullPathName -
      fileName - name without path or can just be null
      reader - could be Reader, BufferedInputStream, or byte[]
      Returns:
      null or error message
    • openDOM

      public String openDOM(Object DOMNode)
      applet DOM method -- does not preserve state
      Specified by:
      openDOM in class JmolViewer
      Parameters:
      DOMNode -
      Returns:
      null or error
    • loadModelFromFileRepaint

      private String loadModelFromFileRepaint(String fullPathName, String fileName, String[] fileNames, Object reader)
      for JmolSimpleViewer -- external applications only (and no-script JavaScript)
      Parameters:
      fullPathName -
      fileName -
      fileNames -
      reader -
      Returns:
      error message or null
    • loadModelFromFile

      public String loadModelFromFile(String fullPathName, String fileName, String[] fileNames, Object reader, boolean isAppend, Map<String,Object> htParams, javajs.util.SB loadScript, javajs.util.SB sOptions, int tokType, String filecat)
      Used by the ScriptEvaluator LOAD command to open one or more files. Now necessary for EVERY load of a file, as loadScript must be passed to the ModelLoader.
      Parameters:
      fullPathName - may be null; used only when reader != null
      fileName - must not be null
      fileNames - when present, reader is ignored
      reader - may be a Reader, BufferedReader, byte[], or BufferedInputStream
      isAppend -
      htParams -
      loadScript -
      sOptions -
      tokType -
      filecat - + or null, -, or space
      Returns:
      null or error
    • setLigandModel

      public void setLigandModel(String key, String data)
    • getLigandModel

      public Object getLigandModel(String id, String prefix, String suffix, String terminator)
      obtain CIF data for a ligand for purposes of adding hydrogens or for any other purpose in terms of saving a data set for a file in a state
      Parameters:
      id - unique key; if null, clear "bad" entries from the set.
      prefix -
      suffix - or fileName
      terminator - Only save to this if not null
      Returns:
      a ligand model or a string if just file data or null
    • openFileFull

      private Object openFileFull(String fileName, boolean isAppend, Map<String,Object> htParams, javajs.util.SB loadScript)
      does NOT repaint
      Parameters:
      fileName -
      isAppend -
      htParams -
      loadScript - only necessary for string reading
      Returns:
      an AtomSetCollection or a String (error)
    • openStringInline

      public String openStringInline(String strModel)
      only used by file dropper.
      Specified by:
      openStringInline in class JmolViewer
    • loadInline

      public String loadInline(String strModel)
      from Applet and external applications only
      Specified by:
      loadInline in class JmolViewer
    • loadInline

      public String loadInline(String strModel, char newLine)
      external apps only
      Specified by:
      loadInline in class JmolViewer
    • loadInlineAppend

      public String loadInlineAppend(String strModel, boolean isAppend)
      used by applet and console
      Specified by:
      loadInlineAppend in class JmolViewer
    • loadInlineScriptRepaint

      private String loadInlineScriptRepaint(String strModel, char newLine, boolean isAppend)
    • loadInline

      public String loadInline(String[] arrayModels)
      external apps only
      Specified by:
      loadInline in class JmolViewer
    • loadInline

      public String loadInline(String[] arrayModels, boolean isAppend)
      external apps and applet only
      Specified by:
      loadInline in class JmolViewer
      Parameters:
      arrayModels - and array of models, each of which is a String
      isAppend -
      Returns:
      null or error message
    • loadInline

      public String loadInline(List<Object> arrayData, boolean isAppend)
      External applications only; does not preserve state -- intentionally!
      Specified by:
      loadInline in class JmolViewer
      Parameters:
      arrayData -
      isAppend -
      Returns:
      null or error string
    • loadInlineScript

      private String loadInlineScript(String strModel, char newLine, boolean isAppend, Map<String,Object> htParams)
      used by loadInline and openFileFull
      Parameters:
      strModel -
      newLine -
      isAppend -
      htParams -
      Returns:
      null or error message
    • fixInlineString

      public static String fixInlineString(String strModel, char newLine)
    • openStringInlineParamsAppend

      public String openStringInlineParamsAppend(String strModel, Map<String,Object> htParams, boolean isAppend)
      Only used for adding hydrogen atoms and adding the model kit methane model; not part of the public interface.
      Parameters:
      strModel -
      htParams -
      isAppend -
      Returns:
      null or error string
    • openStringsInlineParamsAppend

      private String openStringsInlineParamsAppend(String[] arrayModels, Map<String,Object> htParams, boolean isAppend)
      opens multiple files inline; does NOT repaint
      Parameters:
      arrayModels -
      htParams -
      isAppend -
      Returns:
      null or error message
    • getInlineChar

      public char getInlineChar()
    • getDataSeparator

      String getDataSeparator()
    • createModelSetAndReturnError

      private String createModelSetAndReturnError(Object atomSetCollection, boolean isAppend, javajs.util.SB loadScript, Map<String,Object> htParams)
      finally(!) we are ready to create the "model set" from the "atom set collection" - does NOT repaint
      Parameters:
      atomSetCollection -
      isAppend -
      loadScript - if null, then some special method like DOM; turn off preserveState
      htParams -
      Returns:
      errMsg
    • loadAtomDataAndReturnError

      private String loadAtomDataAndReturnError(Object atomSetCollection, int tokType)
      or just apply the data to the current model set
      Parameters:
      atomSetCollection -
      tokType -
      Returns:
      error or null
    • getCurrentFileAsString

      public String getCurrentFileAsString(String state)
    • getFullPathNameOrError

      public String[] getFullPathNameOrError(String filename)
      Parameters:
      filename -
      Returns:
      String[2] where [0] is fullpathname and [1] is error message or null
    • getFileAsString3

      public String getFileAsString3(String name, boolean checkProtected, String state)
    • getFileAsString4

      public String getFileAsString4(String name, int nBytesMax, boolean doSpecialLoad, boolean allowBinary, boolean checkProtected, String state)
    • getAsciiFileOrNull

      public String getAsciiFileOrNull(String name)
    • autoCalculate

      public void autoCalculate(int tokProperty, String dataType)
    • calculateStraightness

      public void calculateStraightness()
    • calculateSurface

      public javajs.util.P3[] calculateSurface(javajs.util.BS bsSelected, float envelopeRadius)
    • getStructureList

      public Map<STR,float[]> getStructureList()
    • setStructureList

      public void setStructureList(float[] list, STR type)
    • calculateStructures

      public String calculateStructures(javajs.util.BS bsAtoms, boolean asDSSP, boolean setStructure, int version)
      Parameters:
      bsAtoms -
      asDSSP -
      setStructure - to actually change structures
      version -
      Returns:
      structure string from DSSP
    • getAnnotationParser

      public JmolAnnotationParser getAnnotationParser(boolean isDSSR)
    • getSelectedAtomIterator

      public AtomIndexIterator getSelectedAtomIterator(javajs.util.BS bsSelected, boolean isGreaterOnly, boolean modelZeroBased, boolean isMultiModel)
      Specified by:
      getSelectedAtomIterator in interface AtomDataServer
    • setIteratorForAtom

      public void setIteratorForAtom(AtomIndexIterator iterator, int atomIndex, float distance)
      Specified by:
      setIteratorForAtom in interface AtomDataServer
    • setIteratorForPoint

      public void setIteratorForPoint(AtomIndexIterator iterator, int modelIndex, javajs.util.T3 pt, float distance)
      Specified by:
      setIteratorForPoint in interface AtomDataServer
    • fillAtomData

      public void fillAtomData(AtomData atomData, int mode)
      Specified by:
      fillAtomData in interface AtomDataServer
    • addStateScript

      public StateScript addStateScript(String script, boolean addFrameNumber, boolean postDefinitions)
    • getMinimizer

      public Minimizer getMinimizer(boolean createNew)
    • getSmilesMatcher

      public SmilesMatcherInterface getSmilesMatcher()
    • clearModelDependentObjects

      public void clearModelDependentObjects()
    • zap

      public void zap(boolean notify, boolean resetUndo, boolean zapModelKit)
    • loadDefaultModelKitModel

      private void loadDefaultModelKitModel(Map<String,Object> htParams)
    • zapMsg

      private void zapMsg(String msg)
    • echoMessage

      void echoMessage(String msg)
    • initializeModel

      private void initializeModel(boolean isAppend)
    • startHoverWatcher

      public void startHoverWatcher(boolean tf)
    • getModelSetPathName

      public String getModelSetPathName()
      Specified by:
      getModelSetPathName in class JmolViewer
    • getModelSetFileName

      public String getModelSetFileName()
      Specified by:
      getModelSetFileName in class JmolViewer
    • getUnitCellInfoText

      public String getUnitCellInfoText()
    • getUnitCellInfo

      public float getUnitCellInfo(int infoType)
    • getV0abc

      public javajs.util.T3[] getV0abc(int iModel, Object def)
      convert string abc;offset or M3 or M4 to origin and three vectors -- a, b, c. The string can be preceded by ! for "reverse of". For example, "!a-b,-5a-5b,-c;7/8,0,1/8" offset is optional, but it still needs a semicolon: "a/2,b/2,c;"
      Parameters:
      iModel -
      def - a string or an M3 or M4
      Returns:
      vectors [origin a b c]
    • getCurrentUnitCell

      public SymmetryInterface getCurrentUnitCell()
    • getUnitCell

      private SymmetryInterface getUnitCell(int m)
    • getPolymerPointsAndVectors

      public void getPolymerPointsAndVectors(javajs.util.BS bs, javajs.util.Lst<javajs.util.P3[]> vList)
    • getHybridizationAndAxes

      public String getHybridizationAndAxes(int atomIndex, javajs.util.V3 z, javajs.util.V3 x, String lcaoType)
    • getAllAtoms

      public javajs.util.BS getAllAtoms()
    • getFrameAtoms

      public javajs.util.BS getFrameAtoms()
    • getVisibleFramesBitSet

      public javajs.util.BS getVisibleFramesBitSet()
      Specified by:
      getVisibleFramesBitSet in class JmolViewer
    • getModelUndeletedAtomsBitSet

      public javajs.util.BS getModelUndeletedAtomsBitSet(int modelIndex)
    • getModelUndeletedAtomsBitSetBs

      public javajs.util.BS getModelUndeletedAtomsBitSetBs(javajs.util.BS bsModels)
    • getBoundBoxCenter

      public javajs.util.P3 getBoundBoxCenter()
      Specified by:
      getBoundBoxCenter in class JmolViewer
    • calcBoundBoxDimensions

      public void calcBoundBoxDimensions(javajs.util.BS bs, float scale)
    • getBoundBoxCornerVector

      public javajs.util.V3 getBoundBoxCornerVector()
      Specified by:
      getBoundBoxCornerVector in class JmolViewer
    • getModelSetProperties

      public Properties getModelSetProperties()
      Specified by:
      getModelSetProperties in class JmolViewer
    • getModelProperties

      public Properties getModelProperties(int modelIndex)
      Specified by:
      getModelProperties in class JmolViewer
    • getModelForAtomIndex

      public Model getModelForAtomIndex(int iatom)
    • getModelSetAuxiliaryInfo

      public Map<String,Object> getModelSetAuxiliaryInfo()
      Specified by:
      getModelSetAuxiliaryInfo in class JmolViewer
    • getModelNumber

      public int getModelNumber(int modelIndex)
      Specified by:
      getModelNumber in class JmolViewer
    • getModelFileNumber

      public int getModelFileNumber(int modelIndex)
    • getModelNumberDotted

      public String getModelNumberDotted(int modelIndex)
      Specified by:
      getModelNumberDotted in class JmolViewer
    • getModelName

      public String getModelName(int modelIndex)
      Specified by:
      getModelName in class JmolViewer
    • modelHasVibrationVectors

      public boolean modelHasVibrationVectors(int modelIndex)
    • getBondsForSelectedAtoms

      public javajs.util.BS getBondsForSelectedAtoms(javajs.util.BS bsAtoms)
    • frankClicked

      public boolean frankClicked(int x, int y)
    • frankClickedModelKit

      public boolean frankClickedModelKit(int x, int y)
    • findNearestAtomIndex

      public int findNearestAtomIndex(int x, int y)
      Specified by:
      findNearestAtomIndex in class JmolViewer
    • findNearestAtomIndexMovable

      public int findNearestAtomIndexMovable(int x, int y, boolean mustBeMovable)
    • toCartesian

      public void toCartesian(javajs.util.T3 pt, boolean ignoreOffset)
      absolute or relative to origin of UNITCELL {x y z}
      Parameters:
      pt -
      ignoreOffset - TODO
    • toCartesianUC

      public void toCartesianUC(SymmetryInterface unitCell, javajs.util.T3 pt, boolean ignoreOffset)
    • toFractional

      public void toFractional(javajs.util.T3 pt, boolean ignoreOffset)
      Parameters:
      pt -
      ignoreOffset - set true for relative to {0 0 0}; otherwise relative to origin of UNITCELL {x y z}
    • toFractionalUC

      public void toFractionalUC(SymmetryInterface unitCell, javajs.util.T3 pt, boolean ignoreOffset)
    • toUnitCell

      public void toUnitCell(javajs.util.P3 pt, javajs.util.P3 offset)
      Returns the relative to origin without regard to offset created using the UNITCELL command. This method has limited use. Used in point3f % 1, where {0 0 0} % 1 gives {a b c}
      Parameters:
      pt - a Cartesian point
      offset - a lattice offset, or null to apply the current offset
    • setCurrentCage

      public void setCurrentCage(String isosurfaceId)
    • addUnitCellOffset

      public void addUnitCellOffset(javajs.util.P3 pt)
    • setAtomData

      public void setAtomData(int type, String name, String coordinateData, boolean isDefault)
    • setCenterSelected

      public void setCenterSelected()
      Specified by:
      setCenterSelected in class JmolViewer
    • setApplySymmetryToBonds

      void setApplySymmetryToBonds(boolean TF)
    • setBondTolerance

      public void setBondTolerance(float bondTolerance)
      Specified by:
      setBondTolerance in class JmolViewer
    • setMinBondDistance

      public void setMinBondDistance(float minBondDistance)
      Specified by:
      setMinBondDistance in class JmolViewer
    • getAtomsNearPt

      public javajs.util.BS getAtomsNearPt(float distance, javajs.util.P3 coord, javajs.util.BS bs)
    • getBranchBitSet

      public javajs.util.BS getBranchBitSet(int atomIndex, int atomIndexNot, boolean allowCyclic)
      given a set of atoms, a subset of atoms to test, two atoms that start the branch, and whether or not to allow the branch to cycle back on itself,deliver the set of atoms constituting this branch.
      Parameters:
      atomIndex -
      atomIndexNot -
      allowCyclic -
      Returns:
      bitset for this branch
    • getElementsPresentBitSet

      public javajs.util.BS getElementsPresentBitSet(int modelIndex)
      Specified by:
      getElementsPresentBitSet in class JmolViewer
    • getFileHeader

      String getFileHeader()
    • getFileData

      Object getFileData()
    • getCifData

      public Map<String,Object> getCifData(int modelIndex)
    • readCifData

      public Map<String,Object> readCifData(String fileName, String type)
    • readCifData

      public Map<String,Object> readCifData(String fileName, Object rdrOrStringData, String type)
      Specified by:
      readCifData in interface AtomDataServer
    • getStateCreator

      public JmolStateCreator getStateCreator()
    • getWrappedStateScript

      public String getWrappedStateScript()
    • getStateInfo

      public String getStateInfo()
      Specified by:
      getStateInfo in class JmolViewer
    • getStateInfo3

      public String getStateInfo3(String type, int width, int height)
    • getStructureState

      public String getStructureState()
    • getCoordinateState

      public String getCoordinateState(javajs.util.BS bsSelected)
    • setCurrentColorRange

      public void setCurrentColorRange(String label)
    • setData

      public void setData(String key, Object[] data, int dataType, int matchField, int matchFieldColumnCount, int dataField, int dataFieldColumnCount)
      A general-purpose data storage method. Note that matchFieldCount and dataFieldCount should both be positive or both be negative.
      Parameters:
      key - a simple key name for the data, starting with "property_" if user-defined
      data - data[0] -- label data[1] -- string or float[] or float[][] or float[][][] data[2] -- selection bitset or int[] atomMap when field > 0 data[3] -- arrayDepth 0(String),1(float[]),2(float[][]),3(float[][][]) or -1 to indidate that it is set by data type data[4] -- Boolean.TRUE == saveInState
      dataType - see JmolDataManager interface
      matchField - if positive, data must match atomNo in this column if 0, no match column
      matchFieldColumnCount - if positive, this number of characters in match column if 0, reference is to tokens, not characters
      dataField - if positive, column containing the data if 0, values are a simple list; clear the data if Integer.MAX_VALUE, values are a simple list; don't clear the data if Integer.MIN_VALUE, have one SINGLE data value for all selected atoms
      dataFieldColumnCount - if positive, this number of characters in data column if 0, reference is to tokens, not characters
    • getDataObj

      public Object getDataObj(String key, javajs.util.BS bsSelected, int dataType)
      Retrieve a data object
      Parameters:
      key -
      bsSelected - selected atoms; for DATA_AF only
      dataType - see JmolDataManager interface
      Returns:
      data object data[0] -- label (same as key) data[1] -- string or float[] or float[][] or float[][][] data[2] -- selection bitset or int[] atomMap when field > 0 data[3] -- arrayDepth 0(String),1(float[]),2(float[][]),3(float[][][]) or -1 to indicate that it is set by data type data[4] -- Boolean.TRUE == saveInState
    • autoHbond

      public int autoHbond(javajs.util.BS bsFrom, javajs.util.BS bsTo, boolean onlyIfHaveCalculated)
    • getDefaultMeasurementLabel

      public String getDefaultMeasurementLabel(int nPoints)
    • getMeasurementCount

      public int getMeasurementCount()
      Specified by:
      getMeasurementCount in class JmolViewer
    • getMeasurementStringValue

      public String getMeasurementStringValue(int i)
      Specified by:
      getMeasurementStringValue in class JmolViewer
    • getMeasurementInfoAsString

      public String getMeasurementInfoAsString()
    • getMeasurementCountPlusIndices

      public int[] getMeasurementCountPlusIndices(int i)
      Specified by:
      getMeasurementCountPlusIndices in class JmolViewer
    • setPendingMeasurement

      void setPendingMeasurement(MeasurementPending mp)
    • getPendingMeasurement

      public MeasurementPending getPendingMeasurement()
    • clearAllMeasurements

      public void clearAllMeasurements()
    • clearMeasurements

      public void clearMeasurements()
      Specified by:
      clearMeasurements in class JmolViewer
    • setAnimation

      public void setAnimation(int tok)
    • setAnimationFps

      public void setAnimationFps(int fps)
      Specified by:
      setAnimationFps in class JmolViewer
    • setAnimationMode

      private void setAnimationMode(String mode)
    • setAnimationOn

      public void setAnimationOn(boolean animationOn)
    • setAnimationRange

      public void setAnimationRange(int modelIndex1, int modelIndex2)
    • defineAtomSets

      public void defineAtomSets(Map<String,Object> info)
    • setAnimDisplay

      public void setAnimDisplay(javajs.util.BS bs)
    • setCurrentModelIndex

      public void setCurrentModelIndex(int modelIndex)
    • getTrajectoryState

      public String getTrajectoryState()
    • setFrameOffsets

      public void setFrameOffsets(javajs.util.BS bsAtoms, boolean isFull)
    • setCurrentModelIndexClear

      public void setCurrentModelIndexClear(int modelIndex, boolean clearBackground)
    • haveFileSet

      public boolean haveFileSet()
    • setBackgroundModelIndex

      public void setBackgroundModelIndex(int modelIndex)
    • setFrameVariables

      void setFrameVariables()
    • getInMotion

      public boolean getInMotion(boolean includeAnim)
    • getMotionEventNumber

      public int getMotionEventNumber()
      Specified by:
      getMotionEventNumber in class JmolViewer
    • setInMotion

      public void setInMotion(boolean inMotion)
      Specified by:
      setInMotion in class JmolViewer
    • setRefreshing

      private void setRefreshing(boolean TF)
    • getRefreshing

      public boolean getRefreshing()
    • pushHoldRepaint

      public void pushHoldRepaint()
      Specified by:
      pushHoldRepaint in class JmolViewer
    • pushHoldRepaintWhy

      public void pushHoldRepaintWhy(String why)
      Parameters:
      why -
    • popHoldRepaint

      public void popHoldRepaint(String why)
      Specified by:
      popHoldRepaint in class JmolViewer
    • refresh

      public void refresh(int mode, String strWhy)
      initiate a repaint/update sequence if it has not already been requested. invoked whenever any operation causes changes that require new rendering. The repaint/update sequence will only be invoked if (a) no repaint is already pending and (b) there is no hold flag set in repaintManager. Sequence is as follows: 1) RepaintManager.refresh() checks flags and then calls Viewer.repaint() 2) Viewer.repaint() invokes display.repaint(), provided display is not null (headless) 3) The system responds with an invocation of Jmol.update(Graphics g), which we are routing through Jmol.paint(Graphics g). 4) Jmol.update invokes Viewer.setScreenDimensions(size), which makes the necessary changes in parameters for any new window size. 5) Jmol.update invokes Viewer.renderScreenImage(g, size, rectClip) 6) Viewer.renderScreenImage checks object visibility, invokes render1 to do the actual creation of the image pixel map and send it to the screen, and then invokes repaintView() 7) Viewer.repaintView() invokes RepaintManager.repaintDone(), to clear the flags and then use notify() to release any threads holding on wait().
      Specified by:
      refresh in class JmolViewer
      Parameters:
      mode - REFRESH_REPAINT: ONLY do a repaint -- no syncing REFRESH_SYNC: mouse motion requiring synchronization -- not going through Eval so we bypass Eval and mainline on the other vwr! Also called from j2sApplet.js REFRESH_REPAINT_SYNC_MASK: same as REFRESH_REPAINT, but not WebGL REFRESH_NO_MOTION_ONLY: refresh only if not in motion REFRESH_SEND_WEBGL_NEW_ORIENTATION: send WebGL a "new orientation" command at the end of a script using html5applet._refresh()
      strWhy - debugging or for passing mouse command when using REFRESH_SYNC
    • requestRepaintAndWait

      public void requestRepaintAndWait(String why)
    • clearShapeRenderers

      public void clearShapeRenderers()
    • isRepaintPending

      public boolean isRepaintPending()
    • notifyViewerRepaintDone

      public void notifyViewerRepaintDone()
      Specified by:
      notifyViewerRepaintDone in class JmolViewer
    • areAxesTainted

      public boolean areAxesTainted()
    • generateOutputForExport

      public String generateOutputForExport(Map<String,Object> params)
      Description copied from class: JmolViewer
      for POV-Ray
      Specified by:
      generateOutputForExport in class JmolViewer
      Parameters:
      params -
      Returns:
      INI file
    • clearRepaintManager

      private void clearRepaintManager(int iShape)
    • renderScreenImage

      public void renderScreenImage(Object g, int width, int height)
      JmolViewer interface uses this, but that is all
      Specified by:
      renderScreenImage in class JmolViewer
    • renderScreenImageStereo

      public void renderScreenImageStereo(Object gLeft, boolean checkStereoSlave, int width, int height)
    • updateJS

      public void updateJS()
      for JavaScript only
    • updateJSView

      private void updateJSView(int imodel, int iatom)
      File has been loaded or model has been changed or atom picked. This is a call to Jmol.View for view sets (new in Jmol 14.1.8)
      Parameters:
      imodel -
      iatom -
    • evalFile

      public String evalFile(String strFilename)
      Specified by:
      evalFile in class JmolViewer
    • getInsertedCommand

      public String getInsertedCommand()
    • script

      public String script(String strScript)
      Specified by:
      script in class JmolViewer
    • evalString

      public String evalString(String strScript)
      Specified by:
      evalString in class JmolViewer
    • evalStringQuiet

      public String evalStringQuiet(String strScript)
      Specified by:
      evalStringQuiet in class JmolViewer
    • evalStringQuietSync

      public String evalStringQuietSync(String strScript, boolean isQuiet, boolean allowSyncScript)
    • clearScriptQueue

      public void clearScriptQueue()
    • setScriptQueue

      private void setScriptQueue(boolean TF)
    • checkHalt

      public boolean checkHalt(String str, boolean isInsert)
      Specified by:
      checkHalt in class JmolViewer
    • scriptWait

      public String scriptWait(String strScript)
      Specified by:
      scriptWait in class JmolViewer
    • scriptWaitStatus

      public Object scriptWaitStatus(String strScript, String statusList)
      Specified by:
      scriptWaitStatus in class JmolViewer
    • evalWait

      private Object evalWait(String returnType, String strScript, String statusList)
    • exitJmol

      public void exitJmol()
    • scriptCheckRet

      private Object scriptCheckRet(String strScript, boolean returnContext)
    • scriptCheck

      public Object scriptCheck(String strScript)
      Specified by:
      scriptCheck in class JmolViewer
    • isScriptExecuting

      public boolean isScriptExecuting()
      Specified by:
      isScriptExecuting in class JmolViewer
    • haltScriptExecution

      public void haltScriptExecution()
      Specified by:
      haltScriptExecution in class JmolViewer
    • pauseScriptExecution

      public void pauseScriptExecution()
    • resolveDatabaseFormat

      String resolveDatabaseFormat(String fileName)
    • hasDatabasePrefix

      public static boolean hasDatabasePrefix(String fileName)
    • isDatabaseCode

      public static boolean isDatabaseCode(char ch)
    • setLoadFormat

      public Object setLoadFormat(String name, char type, boolean withPrefix)
      Jmol will either specify a type or look for it in the first character, making sure it is found using isDatabaseCode() first. Starting with Jmol 13.1.13, we allow a generalized search using =xxx= where xxx is a known or user-specified database designation.
      Parameters:
      name -
      type - a character to distinguish the type of file, '?' means we are just doing an isosurface check
      withPrefix -
      Returns:
      String or String[]
    • checkCIR

      private void checkCIR(boolean forceCheck)
      Check to see if the resolver is working
      Parameters:
      forceCheck -
    • getStandardLabelFormat

      public String getStandardLabelFormat(int type)
    • getAdditionalHydrogens

      public javajs.util.P3[] getAdditionalHydrogens(javajs.util.BS bsAtoms, javajs.util.Lst<Atom> vConnections, int flags)
    • setMarBond

      public void setMarBond(short marBond)
      Specified by:
      setMarBond in class JmolViewer
    • setHoverLabel

      public void setHoverLabel(String strLabel)
    • setHoverEnabled

      private void setHoverEnabled(boolean tf)
    • hoverOn

      void hoverOn(int atomIndex, boolean isLabel)
    • isModelkitPickingActive

      private boolean isModelkitPickingActive()
    • isModelkitPickingRotateBond

      public boolean isModelkitPickingRotateBond()
    • hoverOnPt

      public void hoverOnPt(int x, int y, String text, String id, javajs.util.T3 pt)
      Hover over an arbitrary point.
      Parameters:
      x -
      y -
      text -
      id - optional id to set _objecthovered to
      pt - optional pt to set "hovered" to
    • hoverOff

      void hoverOff()
    • setDebugScript

      public void setDebugScript(boolean debugScript)
      Specified by:
      setDebugScript in class JmolViewer
    • clearClickCount

      void clearClickCount()
    • setCursor

      public void setCursor(int cursor)
    • setPickingMode

      public void setPickingMode(String strMode, int pickingMode)
    • getPickingMode

      public int getPickingMode()
    • setPickingStyle

      void setPickingStyle(String style, int pickingStyle)
    • getDrawHover

      public boolean getDrawHover()
    • getAtomInfo

      public String getAtomInfo(int atomOrPointIndex)
    • getAtomInfoXYZ

      private String getAtomInfoXYZ(int atomIndex, int mode)
    • setSync

      private void setSync()
    • setJmolCallbackListener

      public void setJmolCallbackListener(JmolCallbackListener listener)
      Specified by:
      setJmolCallbackListener in class JmolViewer
    • setJmolStatusListener

      public void setJmolStatusListener(JmolStatusListener listener)
      Specified by:
      setJmolStatusListener in class JmolViewer
    • getStatusChanged

      public javajs.util.Lst<javajs.util.Lst<javajs.util.Lst<Object>>> getStatusChanged(String statusNameList)
    • setStatusDragDropped

      public boolean setStatusDragDropped(int mode, int x, int y, String fileName, String[] retType)
      Allows a handler to set Jmol variable doDrop=false to cancel and also set the file type directly (Java) via the Jmol variable dropFileType (Java or JavaScript) if desired.
      Parameters:
      mode -
      x -
      y -
      fileName -
      retType -
      Returns:
      true if we should still handle this.
    • setStatusResized

      public void setStatusResized(int width, int height)
      resizeCallback is called whenever the applet gets a resize notification from the browser jmolSetCallback("resizeCallback", "myResizeCallback") function myResizeCallback(width, height) {}
      Parameters:
      width -
      height -
    • scriptStatus

      public void scriptStatus(String strStatus)
      scriptCallback is the primary way to monitor script status. In addition, it serves to for passing information to the user over the status line of the browser as well as to the console. Note that console messages are also sent by echoCallback. If messageCallback is enabled but not scriptCallback, these messages go to the messageCallback function instead. jmolSetCallback("scriptCallback", "myScriptCallback") function myScriptCallback(app, status, message, intStatus, errorMessageUntranslated) {} intStatus == -2 script start -- message is the script itself intStatus == 0 general messages during script execution; translated error message may be present intStatus >= 1 script termination message; translated and untranslated message may be present value is time for execution in milliseconds Eval.defineAtomSet -- compilation bug indicates problem in JmolConstants array Eval.instructionDispatchLoop -- debugScript messages Eval.logDebugScript -- debugScript messages Eval.pause -- script execution paused message Eval.runEval -- "Script completed" message Eval.script -- Chime "script " message Eval.scriptStatusOrBuffer -- various messages for Eval.checkContinue (error message) Eval.connect Eval.delete Eval.hbond Eval.load (logMessages message) Eval.message Eval.runEval (error message) Eval.write (error reading file) Eval.zap (error message) FileManager.createAtomSetCollectionFromFile "requesting..." for Chime-like compatibility actionManager.atomPicked "pick one more atom in order to spin..." for example Viewer.evalStringWaitStatus -- see above -2, 0 only if error, >=1 at termination Viewer.reportSelection "xxx atoms selected"
      Parameters:
      strStatus -
    • scriptStatusMsg

      public void scriptStatusMsg(String strStatus, String statusMessage)
    • setScriptStatus

      public void setScriptStatus(String strStatus, String statusMessage, int msWalltime, String strErrorMessageUntranslated)
    • showUrl

      public void showUrl(String urlString)
      syncCallback traps script synchronization messages and allows for cancellation (by returning "") or modification jmolSetCallback("syncCallback", "mySyncCallback") function mySyncCallback(app, script, appletName) { ...[modify script here]... return newScript } StatusManager.syncSend Viewer.setSyncTarget Viewer.syncScript
      Specified by:
      showUrl in class JmolViewer
    • setMeshCreator

      public void setMeshCreator(Object meshCreator)
      an external applet or app with class that extends org.jmol.jvxl.MeshCreator might execute: org.jmol.viewer.Viewer vwr = applet.getViewer(); vwr.setMeshCreator(this); then that class's updateMesh(String id) method will be called whenever a mesh is rendered.
      Parameters:
      meshCreator -
    • showConsole

      public void showConsole(boolean showConsole)
    • getConsole

      public JmolAppConsoleInterface getConsole()
    • getParameter

      public Object getParameter(String key)
      Specified by:
      getParameter in class JmolViewer
    • getP

      public Object getP(String key)
    • getPOrNull

      public Object getPOrNull(String key)
    • unsetProperty

      public void unsetProperty(String key)
    • notifyStatusReady

      public void notifyStatusReady(boolean isReady)
      Specified by:
      notifyStatusReady in class JmolViewer
    • getBooleanProperty

      public boolean getBooleanProperty(String key)
      Specified by:
      getBooleanProperty in class JmolViewer
    • getInt

      public int getInt(int tok)
      Specified by:
      getInt in class JmolViewer
    • getDelayMaximumMs

      public int getDelayMaximumMs()
    • getHermiteLevel

      public int getHermiteLevel()
    • getHoverDelay

      public int getHoverDelay()
    • getBoolean

      public boolean getBoolean(int tok)
      Specified by:
      getBoolean in class JmolViewer
    • allowEmbeddedScripts

      public boolean allowEmbeddedScripts()
    • getDragSelected

      boolean getDragSelected()
    • getBondsPickable

      boolean getBondsPickable()
    • isModelKitOpen

      boolean isModelKitOpen()
    • useMinimizationThread

      public boolean useMinimizationThread()
    • getFloat

      public float getFloat(int tok)
      Specified by:
      getFloat in class JmolViewer
    • setStringProperty

      public void setStringProperty(String key, String value)
      Specified by:
      setStringProperty in class JmolViewer
    • setStringPropertyTok

      private void setStringPropertyTok(String key, int tok, String value)
    • setFloatProperty

      public void setFloatProperty(String key, float value)
      Specified by:
      setFloatProperty in class JmolViewer
    • setFloatPropertyTok

      private void setFloatPropertyTok(String key, int tok, float value)
    • setIntProperty

      public void setIntProperty(String key, int value)
      Specified by:
      setIntProperty in class JmolViewer
    • setIntPropertyTok

      private void setIntPropertyTok(String key, int tok, int value)
    • checkIntRange

      private static int checkIntRange(int value, int min, int max)
    • checkFloatRange

      private static float checkFloatRange(float value, float min, float max)
    • setBooleanProperty

      public void setBooleanProperty(String key, boolean value)
      Specified by:
      setBooleanProperty in class JmolViewer
    • setBooleanPropertyTok

      private void setBooleanPropertyTok(String key, int tok, boolean value)
    • setModelKitMode

      private void setModelKitMode(boolean value)
    • setSmilesString

      public void setSmilesString(String s)
    • removeUserVariable

      public void removeUserVariable(String key)
    • jmolTest

      private void jmolTest()
    • showParameter

      public void showParameter(String key, boolean ifNotSet, int nMax)
    • showString

      public void showString(String str, boolean isPrint)
    • getAllSettings

      public String getAllSettings(String prefix)
    • getBindingInfo

      public String getBindingInfo(String qualifiers)
    • getIsosurfacePropertySmoothing

      public int getIsosurfacePropertySmoothing(boolean asPower)
    • setNavigationDepthPercent

      public void setNavigationDepthPercent(float percent)
    • getShowNavigationPoint

      public boolean getShowNavigationPoint()
    • setPerspectiveDepth

      public void setPerspectiveDepth(boolean perspectiveDepth)
      Specified by:
      setPerspectiveDepth in class JmolViewer
    • setAxesOrientationRasmol

      public void setAxesOrientationRasmol(boolean TF)
      Specified by:
      setAxesOrientationRasmol in class JmolViewer
    • setAxesScale

      private void setAxesScale(int tok, float val)
    • setAxesMode

      void setAxesMode(int mode)
    • getSelectionHalosEnabled

      public boolean getSelectionHalosEnabled()
    • setSelectionHalosEnabled

      public void setSelectionHalosEnabled(boolean TF)
    • getShowSelectedOnce

      public boolean getShowSelectedOnce()
    • setStrandCount

      private void setStrandCount(int type, int value)
    • getStrandCount

      public int getStrandCount(int type)
    • setNavigationMode

      public void setNavigationMode(boolean TF)
    • setAutoBond

      public void setAutoBond(boolean TF)
      Specified by:
      setAutoBond in class JmolViewer
    • makeConnections

      public int[] makeConnections(float minDistance, float maxDistance, int order, int connectOperation, javajs.util.BS bsA, javajs.util.BS bsB, javajs.util.BS bsBonds, boolean isBonds, boolean addGroup, float energy)
    • rebond

      public void rebond()
      Specified by:
      rebond in class JmolViewer
    • rebondState

      public void rebondState(boolean isStateScript)
    • setPercentVdwAtom

      public void setPercentVdwAtom(int value)
      Specified by:
      setPercentVdwAtom in class JmolViewer
    • getMadBond

      public short getMadBond()
      Specified by:
      getMadBond in class JmolViewer
    • setShowHydrogens

      public void setShowHydrogens(boolean TF)
      Specified by:
      setShowHydrogens in class JmolViewer
    • setShowBbcage

      public void setShowBbcage(boolean value)
    • getShowBbcage

      public boolean getShowBbcage()
    • setShowUnitCell

      public void setShowUnitCell(boolean value)
    • getShowUnitCell

      public boolean getShowUnitCell()
    • setShowAxes

      public void setShowAxes(boolean value)
    • getShowAxes

      public boolean getShowAxes()
    • setFrankOn

      public void setFrankOn(boolean TF)
      Specified by:
      setFrankOn in class JmolViewer
    • getShowFrank

      public boolean getShowFrank()
    • setShowMeasurements

      public void setShowMeasurements(boolean TF)
      Specified by:
      setShowMeasurements in class JmolViewer
    • setUnits

      public void setUnits(String units, boolean isDistance)
    • setRasmolDefaults

      public void setRasmolDefaults()
      Specified by:
      setRasmolDefaults in class JmolViewer
    • setJmolDefaults

      public void setJmolDefaults()
      Specified by:
      setJmolDefaults in class JmolViewer
    • setDefaultsType

      private void setDefaultsType(String type)
    • setAntialias

      private void setAntialias(int tok, boolean TF)
    • allocTempPoints

      public javajs.util.P3[] allocTempPoints(int size)
    • freeTempPoints

      public void freeTempPoints(javajs.util.P3[] tempPoints)
    • allocTempScreens

      public javajs.util.P3i[] allocTempScreens(int size)
    • freeTempScreens

      public void freeTempScreens(javajs.util.P3i[] tempScreens)
    • allocTempEnum

      public STR[] allocTempEnum(int size)
    • freeTempEnum

      public void freeTempEnum(STR[] temp)
    • getFont3D

      public Font getFont3D(String fontFace, String fontStyle, float fontSize)
    • getAtomGroupQuaternions

      public javajs.util.Quat[] getAtomGroupQuaternions(javajs.util.BS bsAtoms, int nMax)
    • setStereoMode

      public void setStereoMode(int[] twoColors, STER stereoMode, float degrees)
    • getChimeInfo

      public String getChimeInfo(int tok)
    • getModelFileInfo

      public String getModelFileInfo()
    • getModelFileInfoAll

      public String getModelFileInfoAll()
    • showEditor

      public void showEditor(String[] file_text)
    • getPropertyManager

      private JmolPropertyManager getPropertyManager()
    • setTainted

      public void setTainted(boolean TF)
    • checkObjectClicked

      Map<String,Object> checkObjectClicked(int x, int y, int modifiers)
    • checkObjectHovered

      public boolean checkObjectHovered(int x, int y)
    • checkObjectDragged

      boolean checkObjectDragged(int prevX, int prevY, int x, int y, int action)
    • rotateAxisAngleAtCenter

      public boolean rotateAxisAngleAtCenter(JmolScriptEvaluator eval, javajs.util.P3 rotCenter, javajs.util.V3 rotAxis, float degreesPerSecond, float endDegrees, boolean isSpin, javajs.util.BS bsSelected)
    • rotateAboutPointsInternal

      public boolean rotateAboutPointsInternal(JmolScriptEvaluator eval, javajs.util.P3 point1, javajs.util.P3 point2, float degreesPerSecond, float endDegrees, boolean isSpin, javajs.util.BS bsSelected, javajs.util.V3 translation, javajs.util.Lst<javajs.util.P3> finalPoints, float[] dihedralList, javajs.util.M4 m4)
    • startSpinningAxis

      public void startSpinningAxis(javajs.util.T3 pt1, javajs.util.T3 pt2, boolean isClockwise)
    • getModelDipole

      public javajs.util.V3 getModelDipole()
    • calculateMolecularDipole

      public javajs.util.V3 calculateMolecularDipole(javajs.util.BS bsAtoms) throws Exception
      Throws:
      Exception
    • setDefaultLattice

      public void setDefaultLattice(javajs.util.P3 p)
    • getDefaultLattice

      public javajs.util.P3 getDefaultLattice()
    • getModelExtract

      public String getModelExtract(Object atomExpression, boolean doTransform, boolean isModelKit, String type)
      V3000, SDF, JSON, CD, XYZ, XYZVIB, XYZRN, CML, PDB, PQR
      Parameters:
      atomExpression -
      doTransform -
      isModelKit -
      type -
      Returns:
      full file data
    • getData

      public String getData(String atomExpression, String type)
      Specified by:
      getData in class JmolViewer
    • getModelFileData

      public String getModelFileData(String atomExpression, String type, boolean allTrajectories)
      Parameters:
      atomExpression - -- will be wrapped in { } and evaluated
      type - -- lower case means "atom data only; UPPERCASE returns full file data
      allTrajectories -
      Returns:
      full or atom-only data formatted as specified
    • getModelCml

      public String getModelCml(javajs.util.BS bs, int nAtomsMax, boolean addBonds, boolean doTransform)
    • getPdbAtomData

      public String getPdbAtomData(javajs.util.BS bs, javajs.util.OC out, boolean asPQR, boolean doTransform)
    • isJmolDataFrame

      public boolean isJmolDataFrame()
    • setFrameTitle

      public void setFrameTitle(int modelIndex, String title)
    • setFrameTitleObj

      public void setFrameTitleObj(Object title)
    • getFrameTitle

      public String getFrameTitle()
    • setAtomProperty

      public void setAtomProperty(javajs.util.BS bs, int tok, int iValue, float fValue, String sValue, float[] values, String[] list)
    • checkCoordinatesChanged

      public void checkCoordinatesChanged()
    • setAtomCoords

      public void setAtomCoords(javajs.util.BS bs, int tokType, Object xyzValues)
    • setAtomCoordsRelative

      public void setAtomCoordsRelative(javajs.util.T3 offset, javajs.util.BS bs)
    • invertAtomCoord

      public void invertAtomCoord(javajs.util.P3 pt, javajs.util.P4 plane, javajs.util.BS bs, int ringAtomIndex, boolean isClick)
    • invertSelected

      public void invertSelected(javajs.util.P3 pt, javajs.util.P4 plane, int iAtom, javajs.util.BS bsAtoms)
    • moveAtoms

      public void moveAtoms(javajs.util.M4 m4, javajs.util.M3 mNew, javajs.util.M3 rotation, javajs.util.V3 translation, javajs.util.P3 center, boolean isInternal, javajs.util.BS bsAtoms, boolean translationOnly)
    • moveSelected

      public void moveSelected(int deltaX, int deltaY, int deltaZ, int x, int y, javajs.util.BS bsSelected, boolean isTranslation, boolean asAtoms, int modifiers)
    • highlightBond

      public void highlightBond(int index, int closestAtomIndex, int x, int y)
      from Sticks
      Parameters:
      index -
      closestAtomIndex - ignored
      x -
      y -
    • highlight

      public void highlight(javajs.util.BS bs)
    • refreshMeasures

      public void refreshMeasures(boolean andStopMinimization)
    • functionXY

      public float[][] functionXY(String functionName, int nX, int nY)
      fills an array with data -- if nX invalid input: '<' 0 and this would involve JavaScript, then this reads a full set of Double[][] in one function call. Otherwise it reads the values using individual function calls, which each return Double. If the functionName begins with "file:" then data are read from a file specified after the colon. The sign of nX is not relevant in that case. The file may contain mixed numeric and non-numeric values; the non-numeric values will be skipped by Parser.parseFloatArray
      Parameters:
      functionName -
      nX -
      nY -
      Returns:
      nX by nY array of floating values
    • functionXYZ

      public float[][][] functionXYZ(String functionName, int nX, int nY, int nZ)
    • extractMolData

      public String extractMolData(String what)
      Specified by:
      extractMolData in class JmolViewer
    • getNMRPredict

      public String getNMRPredict(String type)
      Parameters:
      type - C13 or H1
      Returns:
      null
    • getHelp

      public void getHelp(String what)
    • getChemicalInfo

      public String getChemicalInfo(String smiles, String info, javajs.util.BS bsAtoms)
    • addCommand

      public void addCommand(String command)
      Adds one or more commands to the command history
      Parameters:
      command - the command to add
    • pushState

      public void pushState()
    • popState

      public void popState()
    • removeCommand

      public String removeCommand()
      Removes one command from the command history
      Returns:
      command removed
    • getSetHistory

      public String getSetHistory(int howFarBack)
      Options include: ; all n == Integer.MAX_VALUE ; n prev n >= 1 ; next n == -1 ; set max to -2 - n n invalid input: '<'= -3 ; just clear n == -2 ; clear and turn off; return "" n == 0 ; clear and turn on; return "" n == Integer.MIN_VALUE;
      Specified by:
      getSetHistory in class JmolViewer
      Parameters:
      howFarBack - number of lines (-1 for next line)
      Returns:
      one or more lines of command history
    • historyFind

      public String historyFind(String cmd, int dir)
    • setHistory

      public void setHistory(String fileName)
    • getOutputChannel

      public javajs.util.OC getOutputChannel(String localName, String[] fullPath)
    • writeTextFile

      public String writeTextFile(String fileName, String data)
      Specified by:
      writeTextFile in class JmolViewer
    • clipImageOrPasteText

      public String clipImageOrPasteText(String text)
      Specified by:
      clipImageOrPasteText in class JmolViewer
      Parameters:
      text - null here clips image; String pastes text
      Returns:
      "OK image to clipboard: [width] * [height] or "OK text to clipboard: [length]
    • getClipboardText

      public String getClipboardText()
      Specified by:
      getClipboardText in class JmolViewer
    • processWriteOrCapture

      public String processWriteOrCapture(Map<String,Object> params)
      from eval write command only includes option to write set of files
      Parameters:
      params -
      Returns:
      message starting with "OK" or an error message
    • createZip

      public Object createZip(String fileName, String type, Map<String,Object> params)
    • outputToFile

      public String outputToFile(Map<String,Object> params)
      Specified by:
      outputToFile in class JmolViewer
      Parameters:
      params - include type, fileName, text, bytes, quality, width, height
      Returns:
      null (canceled) or a message starting with OK or an error message
    • setSyncTarget

      private void setSyncTarget(int mode, boolean TF)
    • syncScript

      public void syncScript(String script, String applet, int port)
      Specified by:
      syncScript in class JmolViewer
    • getModelIndexFromId

      public int getModelIndexFromId(String id)
      Specified by:
      getModelIndexFromId in class JmolViewer
      Parameters:
      id - some_id, filename#id, or ~fileNo.modelNo added ".basemodel" indicates to get the first model in a series from a JDX-MOL file.
      Returns:
      model index if found; -2 if file found but model not found -2 if no file indicated and no model found -1 if no such file
    • setSyncDriver

      public void setSyncDriver(int mode)
    • setProteinType

      public void setProteinType(STR type, javajs.util.BS bs)
    • getVanderwaalsMar

      public int getVanderwaalsMar(int i)
    • getVanderwaalsMarType

      public int getVanderwaalsMarType(int atomicAndIsotopeNumber, VDW type)
    • setVdwStr

      void setVdwStr(String name)
    • setUserVdw

      void setUserVdw(VDW mode)
    • getDefaultVdwNameOrData

      public String getDefaultVdwNameOrData(int mode, VDW type, javajs.util.BS bs)
    • deleteAtoms

      public int deleteAtoms(javajs.util.BS bsAtoms, boolean fullModels)
    • deleteModels

      public int deleteModels(int modelIndex, javajs.util.BS bsAtoms)
      called by ZAP {atomExpression} when atoms are present or the command is specific for a model, such as ZAP 2.1
      Parameters:
      modelIndex -
      bsAtoms -
      Returns:
      number of atoms deleted
    • deleteBonds

      public void deleteBonds(javajs.util.BS bsDeleted)
    • deleteModelAtoms

      public void deleteModelAtoms(int modelIndex, int firstAtomIndex, int nAtoms, javajs.util.BS bsModelAtoms)
    • getQuaternionFrame

      public char getQuaternionFrame()
    • loadImageData

      public boolean loadImageData(Object image, String nameOrError, String echoName, Object sco)
      NOTE: This method is called from within a j2sNative block in awtjs2d.Platform.java as well as from FileManager.loadImage
      Parameters:
      image - could be a byte array
      nameOrError -
      echoName - if this is an echo rather than the background
      sco - delivered in JavaScript from Platform.java
      Returns:
      false
    • cd

      public String cd(String dir)
    • setErrorMessage

      public String setErrorMessage(String errMsg, String errMsgUntranslated)
    • getErrorMessage

      public String getErrorMessage()
      Specified by:
      getErrorMessage in class JmolViewer
    • getErrorMessageUn

      public String getErrorMessageUn()
      Specified by:
      getErrorMessageUn in class JmolViewer
    • setShapeErrorState

      public void setShapeErrorState(int shapeID, String state)
    • getShapeErrorState

      public String getShapeErrorState()
    • handleError

      public void handleError(Error er, boolean doClear)
    • getFunctions

      public Map<String,JmolScriptFunction> getFunctions(boolean isStatic)
    • removeFunction

      public void removeFunction(String name)
    • getFunction

      public JmolScriptFunction getFunction(String name)
    • isStaticFunction

      static boolean isStaticFunction(String name)
    • isFunction

      public boolean isFunction(String name)
    • clearFunctions

      public void clearFunctions()
    • addFunction

      public void addFunction(JmolScriptFunction function)
    • getFunctionCalls

      public String getFunctionCalls(String selectedFunction)
    • checkPrivateKey

      public boolean checkPrivateKey(double privateKey)
      Simple method to ensure that the image creator (which writes files) was in fact opened by this vwr and not by some manipulation of the applet. When the image creator is used it requires both a vwr object and that vwr's private key. But the private key is private, so it is not possible to create a useable image creator without working through a vwr's own methods. Bob Hanson, 9/20/2009
      Parameters:
      privateKey -
      Returns:
      true if privateKey matches
    • bindAction

      public void bindAction(String desc, String name)
    • unBindAction

      public void unBindAction(String desc, String name)
    • calculateStruts

      public int calculateStruts(javajs.util.BS bs1, javajs.util.BS bs2)
    • getPreserveState

      public boolean getPreserveState()
      This flag if set FALSE: 1) turns UNDO off for the application 2) turns history off 3) prevents saving of inlinedata for later LOAD "" commands 4) turns off the saving of changed atom properties 5) does not guarantee accurate state representation 6) disallows generation of the state It is useful in situations such as web sites where memory is an issue and there is no need for such.
      Returns:
      TRUE or FALSE
    • isKiosk

      boolean isKiosk()
    • hasFocus

      public boolean hasFocus()
    • setFocus

      public void setFocus()
    • stopMinimization

      void stopMinimization()
    • clearMinimization

      void clearMinimization()
    • getMinimizationInfo

      public String getMinimizationInfo()
    • checkMinimization

      private void checkMinimization()
    • minimize

      public void minimize(JmolScriptEvaluator eval, int steps, float crit, javajs.util.BS bsSelected, javajs.util.BS bsFixed, float rangeFixed, int flags) throws Exception
      Parameters:
      eval -
      steps - Integer.MAX_VALUE --> use defaults
      crit - -1 --> use defaults
      bsSelected -
      bsFixed -
      rangeFixed -
      flags -
      Throws:
      Exception
    • setHydrogens

      private void setHydrogens(javajs.util.BS bsAtoms)
    • setMotionFixedAtoms

      public void setMotionFixedAtoms(javajs.util.BS bs)
    • setMotionFixed

      public void setMotionFixed(javajs.util.BS bs)
    • getMotionFixedAtoms

      public javajs.util.BS getMotionFixedAtoms()
    • getAtomicPropertyState

      void getAtomicPropertyState(javajs.util.SB commands, byte type, javajs.util.BS bs, String name, float[] data)
    • getCenterAndPoints

      public javajs.util.P3[][] getCenterAndPoints(javajs.util.Lst<Object[]> atomSets, boolean addCenter)
    • writeFileData

      public String writeFileData(String fileName, String type, int modelIndex, Object[] parameters)
    • getPdbData

      public String getPdbData(int modelIndex, String type, javajs.util.BS bsAtoms, Object[] parameters, javajs.util.OC oc, boolean getStructure)
    • getGroupsWithin

      public javajs.util.BS getGroupsWithin(int nResidues, javajs.util.BS bs)
    • setShapeSize

      public void setShapeSize(int shapeID, int madOrMad10, javajs.util.BS bsSelected)
      Parameters:
      shapeID -
      madOrMad10 - for axes, unitcell, and boundbox 10*mad; otherwise milliangstrom diameter
      bsSelected -
    • setShapeProperty

      public void setShapeProperty(int shapeID, String propertyName, Object value)
    • getShapeProperty

      public Object getShapeProperty(int shapeType, String propertyName)
    • getShapePropertyAsInt

      private int getShapePropertyAsInt(int shapeID, String propertyName)
    • setModelVisibility

      public void setModelVisibility()
    • resetShapes

      public void resetShapes(boolean andCreateNew)
    • setParallel

      public boolean setParallel(boolean TF)
    • isParallel

      public boolean isParallel()
    • undoMoveAction

      public int undoMoveAction(int action, int n)
      Parameters:
      action - Token.undo or Token.redo
      n - number of steps to go back/forward; 0 for all; -1 for clear; -2 for clear BOTH
      Returns:
      stack list count for action = T.count, or 0
    • undoMoveActionClear

      public void undoMoveActionClear(int taintedAtom, int type, boolean clearRedo)
    • moveAtomWithHydrogens

      protected void moveAtomWithHydrogens(int atomIndex, int deltaX, int deltaY, int deltaZ, javajs.util.BS bsAtoms)
    • isModelPDB

      public boolean isModelPDB(int i)
    • deleteMeasurement

      public void deleteMeasurement(int i)
      Specified by:
      deleteMeasurement in class JmolViewer
    • getSmiles

      public String getSmiles(javajs.util.BS bs) throws Exception
      Specified by:
      getSmiles in class JmolViewer
      Throws:
      Exception
    • getOpenSmiles

      public String getOpenSmiles(javajs.util.BS bs) throws Exception
      Specified by:
      getOpenSmiles in class JmolViewer
      Throws:
      Exception
    • getBioSmiles

      public String getBioSmiles(javajs.util.BS bs) throws Exception
      Throws:
      Exception
    • getSmilesOpt

      public String getSmilesOpt(javajs.util.BS bsSelected, int index1, int index2, int flags, String options) throws Exception
      returns the SMILES string for a sequence or atom set does not include attached protons on groups
      Parameters:
      bsSelected - selected atom set or null for current or specified range
      index1 - when bsSeleced == null, first atomIndex or -1 for current
      index2 - when bsSeleced == null, end atomIndex or -1 for current
      flags - see JC.SMILES_xxxx
      options - e.g. /strict,open/
      Returns:
      SMILES string
      Throws:
      Exception
    • isModel2D

      private boolean isModel2D(javajs.util.BS bs)
    • alert

      public void alert(String msg)
    • prompt

      public String prompt(String label, String data, String[] list, boolean asButtons)
    • dialogAsk

      public String dialogAsk(String type, String fileName, Map<String,Object> params)
      Ask for new file name when saving or opening a file in Java and saving a file in JavaScript. JavaScript use of FileReader goes through loadFileAsync
      Parameters:
      type -
      fileName -
      params -
      Returns:
      new file name
    • initializeExporter

      public JmolRendererInterface initializeExporter(Map<String,Object> params)
    • getMouseEnabled

      public boolean getMouseEnabled()
    • calcAtomsMinMax

      public void calcAtomsMinMax(javajs.util.BS bs, BoxInfo boxInfo)
      Specified by:
      calcAtomsMinMax in class JmolViewer
    • getObjectMap

      public void getObjectMap(Map<String,?> map, char c)
      used in autocompletion in console using TAB
      Parameters:
      map -
      c -
    • setPicked

      public void setPicked(int atomIndex, boolean andReset)
    • runScript

      public String runScript(String script)
      Run a script using the script function script("xxxxxx") using direct script tokens for script ( "xxxxxxx" )
      Specified by:
      runScript in class JmolViewer
      Parameters:
      script -
      Returns:
      string from ScriptEvaluator#outputBuffer
    • runScriptCautiously

      public String runScriptCautiously(String script)
      formerly runScript(), this method really can ONLY be called by the viewer being run from an already-running script. If it is invoked by a separate thread, it can wreak havoc on any queued thread, since they are not thread safe.
      Overrides:
      runScriptCautiously in class JmolViewer
      Parameters:
      script -
      Returns:
      output of the script.
    • setFrameDelayMs

      public void setFrameDelayMs(long millis)
    • getBaseModelBitSet

      public javajs.util.BS getBaseModelBitSet()
    • clearTimeouts

      public void clearTimeouts()
    • setTimeout

      public void setTimeout(String name, int mSec, String script)
    • triggerTimeout

      public void triggerTimeout(String name)
    • clearTimeout

      public void clearTimeout(String name)
    • showTimeout

      public String showTimeout(String name)
    • getOrCalcPartialCharges

      public float[] getOrCalcPartialCharges(javajs.util.BS bsSelected, javajs.util.BS bsIgnore) throws JmolAsyncException
      Throws:
      JmolAsyncException
    • calculatePartialCharges

      public void calculatePartialCharges(javajs.util.BS bsSelected) throws JmolAsyncException
      Throws:
      JmolAsyncException
    • setCurrentModelID

      public void setCurrentModelID(String id)
    • cacheClear

      public void cacheClear()
    • cachePut

      public void cachePut(String key, Object data)
      JSInterface -- allows saving files in memory for later retrieval
      Parameters:
      key -
      data -
    • cacheFileByName

      public int cacheFileByName(String fileName, boolean isAdd)
    • clearThreads

      public void clearThreads()
    • getEvalContextAndHoldQueue

      public ScriptContext getEvalContextAndHoldQueue(JmolScriptEvaluator eval)
    • getDefaultPropertyParam

      public String getDefaultPropertyParam(int propertyID)
    • getPropertyNumber

      public int getPropertyNumber(String name)
    • checkPropertyParameter

      public boolean checkPropertyParameter(String name)
    • extractProperty

      public Object extractProperty(Object property, Object args, int pt)
    • addHydrogens

      public javajs.util.BS addHydrogens(javajs.util.BS bsAtoms, int flags)
    • addHydrogensInline

      public javajs.util.BS addHydrogensInline(javajs.util.BS bsAtoms, javajs.util.Lst<Atom> vConnections, javajs.util.P3[] pts, Map<String,Object> htParams) throws Exception
      Throws:
      Exception
    • evalFunctionFloat

      public float evalFunctionFloat(Object func, Object params, float[] values)
      Specified by:
      evalFunctionFloat in interface AtomDataServer
    • evalParallel

      public boolean evalParallel(ScriptContext context, ShapeManager shapeManager)
    • evaluateExpression

      public Object evaluateExpression(Object stringOrTokens)
      synchronized here trapped the eventQueue; see also evaluateExpressionAsVariable
      Specified by:
      evaluateExpression in class JmolViewer
      Parameters:
      stringOrTokens -
      Returns:
      a String representation of the evaluated expression
    • evaluateExpressionAsVariable

      public SV evaluateExpressionAsVariable(Object stringOrTokens)
      Specified by:
      evaluateExpressionAsVariable in class JmolViewer
      Parameters:
      stringOrTokens -
      Returns:
      a String representation of the evaluated expression as a script variable (org.jmol.script.SV)
    • getAtomBitSet

      public javajs.util.BS getAtomBitSet(Object atomExpression)
    • getScriptContext

      public ScriptContext getScriptContext(String why)
    • getAtomDefs

      public String getAtomDefs(Map<String,Object> names)
    • setCGO

      public void setCGO(javajs.util.Lst<Object> info)
    • setModelSet

      public void setModelSet(ModelSet modelSet)
    • setObjectProp

      public String setObjectProp(String id, int tokCommand)
    • setDihedrals

      public void setDihedrals(float[] dihedralList, javajs.util.BS[] bsBranches, float rate)
    • getChainID

      public int getChainID(String id, boolean isAssign)
      Create a unique integer for any chain string. Note that if there are any chains that are more than a single character, chainCaseSensitive is automatically set TRUE
      Parameters:
      id - invalid input: '<' 256 is just the character of a single-character upper-case chain id, upper or lower case query; >= 256 invalid input: '<' 300 is lower case found in structure
      isAssign - from a file reader, not a select query
      Returns:
      i
    • getChainIDStr

      public String getChainIDStr(int id)
    • getScriptQueueInfo

      public Boolean getScriptQueueInfo()
    • getNMRCalculation

      public JmolNMRInterface getNMRCalculation()
    • getDistanceUnits

      public String getDistanceUnits(String s)
    • calculateFormalCharges

      public int calculateFormalCharges(javajs.util.BS bs)
    • setModulation

      public void setModulation(javajs.util.BS bs, boolean isOn, javajs.util.P3 t1, boolean isQ)
    • checkInMotion

      public void checkInMotion(int state)
    • checkMotionRendering

      public boolean checkMotionRendering(int tok)
      check motion for rendering during mouse movement, spin, vibration, and animation
      Parameters:
      tok -
      Returns:
      TRUE if allowed
    • openExportChannel

      public javajs.util.OC openExportChannel(double privateKey, String fileName, boolean asWriter) throws IOException
      Throws:
      IOException
    • log

      public void log(String data)
      Specified by:
      log in interface AtomDataServer
    • getLogFileName

      public String getLogFileName()
    • getCommands

      public String getCommands(Map<String,javajs.util.BS> htDefine, Map<String,javajs.util.BS> htMore, String select)
    • allowCapture

      public boolean allowCapture()
    • compileExpr

      public T[] compileExpr(String expr)
    • checkSelect

      public boolean checkSelect(Map<String,SV> h, T[] value)
    • getAnnotationInfo

      public String getAnnotationInfo(SV d, String match, int type)
    • getAtomValidation

      public javajs.util.Lst<Float> getAtomValidation(String type, Atom atom)
    • dragMinimizeAtom

      void dragMinimizeAtom(int iAtom)
    • getJBR

      public BioResolver getJBR()
    • checkMenuUpdate

      public void checkMenuUpdate()
    • getChimeMessenger

      public JmolChimeMessenger getChimeMessenger()
    • getModelSetAuxiliaryInfoForAtoms

      public Map<String,Object> getModelSetAuxiliaryInfoForAtoms(Object atomExpression)
    • getJSJSONParser

      private javajs.util.JSJSONParser getJSJSONParser()
    • parseJSON

      public Object parseJSON(String str)
    • parseJSONMap

      public Map<String,Object> parseJSONMap(String jsonMap)
    • parseJSONArray

      public javajs.util.Lst<Object> parseJSONArray(String jsonArray)
    • getSymTemp

      public SymmetryInterface getSymTemp()
      Retrieve a Symmetry object, possibly re-using an old one.
      Returns:
      org.jmol.symmetry.Symmetry object
    • setWindowDimensions

      public void setWindowDimensions(float[] dims)
    • getTriangulator

      public Triangulator getTriangulator()
    • getCurrentModelAuxInfo

      public Map<String,Object> getCurrentModelAuxInfo()
    • startNBO

      public void startNBO(String options)
    • startPlugin

      public void startPlugin(String plugin)
      startup -U nbo option
      Parameters:
      plugin -
    • connectNBO

      public void connectNBO(String type)
    • getNBOParser

      private NBOParser getNBOParser()
    • getNBOAtomLabel

      public String getNBOAtomLabel(Atom atom)
    • calculateChirality

      public String calculateChirality(javajs.util.BS bsAtoms)
    • getSubstructureSetArray

      public javajs.util.BS[] getSubstructureSetArray(String pattern, javajs.util.BS bsSelected, int flags) throws Exception
      Throws:
      Exception
    • getSubstructureSetArrayForNodes

      public javajs.util.BS[] getSubstructureSetArrayForNodes(String pattern, Node[] nodes, int flags) throws Exception
      Throws:
      Exception
    • getSmilesAtoms

      public Node[] getSmilesAtoms(String smiles) throws Exception
      Throws:
      Exception
    • calculateChiralityForSmiles

      public String[] calculateChiralityForSmiles(String smiles)
    • getPdbID

      public String getPdbID()
    • getModelInfo

      public Object getModelInfo(String key)
      get a value from the current model's Model.auxiliaryInfo
      Parameters:
      key -
      Returns:
      value, or null if there is no SINGLE current model
    • notifyScriptEditor

      public void notifyScriptEditor(int msWalltime, Object[] data)
    • sendConsoleMessage

      public void sendConsoleMessage(String msg)
    • getModelkitPropertySafely

      public Object getModelkitPropertySafely(String name)
      Get a ModelKit property.
      Parameters:
      name -
      Returns:
      value
    • setModelkitPropertySafely

      public Object setModelkitPropertySafely(String key, Object value)
    • getSymmetryInfo

      public Object getSymmetryInfo(int iatom, String xyz, int iOp, javajs.util.P3 translation, javajs.util.P3 pt1, javajs.util.P3 pt2, int type, String desc, float scaleFactor, int nth, int options)
      A general method for retrieving symmetry information with full capability of the symop() scripting function.
      Parameters:
      iatom - atom index specifying the model set and used for pt1 if that is null and also for matching element type.
      xyz - the desired Jones-Faithful representation of the symmetry operation or null
      iOp - the desired symmetry operation [1-n] or 0
      translation - [i j k] translational addition to symop
      pt1 - the starting point, or null if to use iatom or otherwise unnecessary
      pt2 - the target point, if this is a point-to-point determination, or the offset if not and options is nonzero
      type - a token type such as T.list or T.array
      desc - if type == T.nada (0), a name evaluating to a type, or one of the special names: "info", "description", "matrix", "axispoint", or "time" (as in time-reversal); otherwise, if type == T.draw, the root id given to a returned DRAW command set
      scaleFactor - if nonzero and type == T.draw, a scaling factor to be applied to the rotational vector
      nth - in the case of a point-to-point determination, the nth matching operator, or 0 for "all"
      options - if nonzero, a option, currently just T.offset, indicating that pt1 is an {i j k} offset from cell 555
      Returns:
      string, Object[], or Lstinvalid input: '<'Object[]>
    • getMacro

      public String getMacro(String key)
      retrieve macros.json from the directory
      Parameters:
      key -
      Returns:
      the macro path
    • getConsoleFontScale

      public int getConsoleFontScale()
    • setConsoleFontScale

      public void setConsoleFontScale(int scale)
    • confirm

      public int confirm(String msg, String msgNo)
    • evalStringGUI

      public void evalStringGUI(String script)
      Run a script asynchronously, adding the GUI flag to indicate that we should fire the SELECT callback at the end if there is one.
      Parameters:
      script -
    • selectStatus

      public void selectStatus(javajs.util.BS bs, boolean isGroup, int addRemove, boolean isQuiet, boolean reportStatus)
      "SELECT" starting with comma triggers the SELECT callback from a SELECT command. GUI scripts also trigger this if a select command has been given and the last select command given did not start with comma.
      Parameters:
      bs -
      isGroup -
      addRemove -
      isQuiet -
      reportStatus -
    • setStatusSelect

      public void setStatusSelect(javajs.util.BS bs)
      Make the SelectCallback call and reset the hasSelected value to false. This method is called by SELECT , ... or by a GUI script command completion or an atom selection using the mouse.
      Parameters:
      bs -
    • wasmInchiHack

      public String wasmInchiHack(String cmd)
      WASM inchi must be initialized asynchronously
      Parameters:
      cmd -
      Returns:
      cmd
    • getInchi

      public String getInchi(javajs.util.BS atoms, String molData, String options)
      Get an InChI or InChIKey for a set of atoms or MOL data.
      Parameters:
      atoms -
      molData - null, or MOL data, or a database $ or : call, or SMILES, or "InChI=...." to retrieve the key
      options -
      Returns:
      InChI or InChIKey
    • findSpaceGroup

      public Object findSpaceGroup(javajs.util.BS bsAtoms, String xyzList, float[] unitCell, boolean asString, boolean isAssign)
      Parameters:
      bsAtoms -
      xyzList - if present, a semicolon-separated list of operators
      unitCell -
      asString -
      isAssign - from ModelKit
      Returns:
      either an array of space group identifiers or, if asString, "", or null
    • restrictToModel

      public javajs.util.BS restrictToModel(javajs.util.BS bs, int mi)
      Restrict this bitset to the current model or its initial atom's model.
      Parameters:
      bs - or null for selected (or if none selected, then the current model)
      mi - >=0 for a specific model, -1 to restrict to current model if a single model or the first model of multiply displayed models
      Returns:
      restricted atom set
    • getThisModelAtoms

      public javajs.util.BS getThisModelAtoms()
    • getSymmetryEquivPoints

      public javajs.util.Lst<javajs.util.P3> getSymmetryEquivPoints(javajs.util.P3 pt, String flags)
    • getSymmetryEquivPointList

      public javajs.util.Lst<?> getSymmetryEquivPointList(javajs.util.Lst<javajs.util.P3> pts, String flags)
    • getOperativeSymmetry

      public SymmetryInterface getOperativeSymmetry()
      Only return symmetry that has operators.
      Returns:
      SymmetryInterface or null
    • formatText

      public String formatText(String text0)
    • getScaleText

      public String getScaleText(String units, boolean isAntialiased, float min, float[] ret)
      Depending upon the measure text, we need to indicate |-------| 1 A or 0.1 A for example.
      Parameters:
      units -
      isAntialiased -
      min -
      ret - return bar length in pixels
      Returns:
      text
    • assignSpaceGroup

      public String assignSpaceGroup(javajs.util.BS bs, String type, int modelIndex)
    • setStatusAtomMoved

      public void setStatusAtomMoved(boolean andCheckMinimize, javajs.util.BS bs)
    • isModelKitOption

      public boolean isModelKitOption(char type, String value)
    • getFormulaForAtoms

      public String getFormulaForAtoms(javajs.util.BS bs, String type, boolean isEmpirical)
      Get formula -- MF or CELLFORMULA, possibly empirical
      Parameters:
      bs -
      type -
      isEmpirical -
      Returns:
      formula as H xx C xx X xx...