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

      public String htmlName
    • appletName

      public String appletName
    • tryPt

      public int tryPt
    • 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
    • shm

      public ShapeManager shm
    • slm

      public SelectionManager slm
    • 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
    • isPrintOnly

      public boolean isPrintOnly
    • isSignedApplet

      public boolean isSignedApplet
    • noGraphicsAllowed

      public boolean noGraphicsAllowed
    • vwrOptions

      public Map<String,Object> vwrOptions
    • display

      public Object display
    • mm

      public org.jmol.viewer.ModelManager mm
    • stm

      public StateManager stm
    • scm

      public JmolScriptManager scm
    • eval

      public JmolScriptEvaluator eval
    • allowArrayDotNotation

      public boolean allowArrayDotNotation
    • async

      public boolean async
    • executor

      public Object executor
    • rd

      public RadiusData rd
    • chainMap

      public Map<Object,Object> chainMap
    • imageFontScaling

      public float imageFontScaling
    • antialiased

      public boolean antialiased
    • 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 BS movableBitSet
    • hasSelected

      public boolean hasSelected
    • 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:
    • captureParams

      public Map<String,Object> captureParams
    • currentCursor

      public int currentCursor
    • frankOn

      public boolean frankOn
    • noFrankEcho

      public boolean noFrankEcho
    • scriptEditorVisible

      public boolean scriptEditorVisible
    • appConsole

      public JmolAppConsoleInterface appConsole
    • 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:
    • 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:
    • MIN_SILENT

      public static final int MIN_SILENT
      See Also:
    • MIN_SELECTED

      public static final int MIN_SELECTED
      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_SELECT_ONLY

      public static final int MIN_SELECT_ONLY
      See Also:
    • MIN_GROUP_SELECT

      public static final int MIN_GROUP_SELECT
      See Also:
    • MIN_XX

      public static final int MIN_XX
      See Also:
    • MIN_MODELKIT

      public static final int MIN_MODELKIT
      See Also:
    • nProcessors

      public static int nProcessors
    • isHighPrecision

      public static boolean isHighPrecision
      adjustable
    • isDoublePrecision

      public static final boolean isDoublePrecision
      See Also:
    • displayLoadErrors

      public boolean displayLoadErrors
    • stateScriptVersionInt

      public int stateScriptVersionInt
    • timeouts

      public Map<String,Object> timeouts
  • 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 BS getSmartsMatch(String smarts, BS bsSelected) throws Exception
      Specified by:
      getSmartsMatch in class JmolViewer
      Throws:
      Exception
    • isSubstructure

      public boolean isSubstructure(String smarts, String smiles)
    • hasStructure

      public boolean hasStructure(String pattern, String smiles, boolean isSmarts)
    • getSmartsMatchForNodes

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

      public int[][] getSmartsMap(String smilesOrSmarts, 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)
    • 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
    • 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()
    • 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)
    • getModelkit

      public ModelKit getModelkit(boolean andShow)
    • setMenu

      public void setMenu(String fileOrText, boolean isFile)
      Specified by:
      setMenu in class JmolViewer
    • 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)
    • notifyError

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

      public String jsEval(String strEval)
    • jsEvalSV

      public SV jsEvalSV(String strEval)
    • 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.
      Returns:
      property data -- see org.jmol.viewer.PropertyManager.java
    • notifyMouseClicked

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

      public 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
      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, Lst<Object> points)
    • 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)
    • 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(BS bsCenter, boolean doScale)
    • setNewRotationCenter

      public void setNewRotationCenter(P3 center)
    • move

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

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

      public void moveUpdate(float floatSecondsTotal)
    • spinXYBy

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

      public void rotateZBy(int zDelta, int x, int y)
    • 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, BS bsAtoms)
    • 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, BS bs, P3[] points)
      Parameters:
      type -
      name -
      bs -
      points -
      Returns:
      String or Quat or P3[]
    • getCurrentColorRange

      public float[] getCurrentColorRange()
    • 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
    • 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 P3 getColorPointForPropertyValue(float val)
    • select

      public void select(BS bs, boolean isGroup, int addRemove, boolean isQuiet)
      Parameters:
      bs -
      isGroup -
      addRemove - T.add, T.remove, or ignored
      isQuiet -
    • setSelectionSet

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

      public void selectBonds(BS bs)
    • displayAtoms

      public void displayAtoms(BS bs, boolean isDisplay, boolean isGroup, int addRemove, boolean isQuiet)
    • getDefinedAtomSet

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

      public String loadModelFromFile(String fullPathName, String fileName, String[] fileNames, Object reader, boolean isAppend, Map<String,Object> htParams, SB loadScript, 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
    • 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
    • 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
      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
    • 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
    • getInlineChar

      public char getInlineChar()
    • 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 P3[] calculateSurface(BS bsSelected, float envelopeRadius)
    • getStructureList

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

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

      public String calculateStructures(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(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, 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)
    • 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 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()
    • getPolymerPointsAndVectors

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

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

      public BS getAllAtoms()
    • getFrameAtoms

      public BS getFrameAtoms()
    • getVisibleFramesBitSet

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

      public BS getModelUndeletedAtomsBitSet(int modelIndex)
    • getModelUndeletedAtomsBitSetBs

      public BS getModelUndeletedAtomsBitSetBs(BS bsModels)
    • getBoundBoxCenter

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

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

      public 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)
    • getModelIndexForAtom

      public int getModelIndexForAtom(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 BS getBondsForSelectedAtoms(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(T3 pt, boolean ignoreOffset)
      absolute or relative to origin of UNITCELL {x y z}
      Parameters:
      pt -
      ignoreOffset -
    • toCartesianUC

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

      public void toFractional(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, T3 pt, boolean ignoreOffset)
    • toUnitCell

      public void toUnitCell(P3 pt, 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(P3 pt)
    • setAtomData

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

      public void setCenterSelected()
      Specified by:
      setCenterSelected in class JmolViewer
    • 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 BS getAtomsNearPt(float distance, P3 coord, BS bs)
    • getBranchBitSet

      public 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 BS getElementsPresentBitSet(int modelIndex)
      Specified by:
      getElementsPresentBitSet in class JmolViewer
    • 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(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, 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(BS bsFrom, 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
    • 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
    • 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(BS bs)
    • setCurrentModelIndex

      public void setCurrentModelIndex(int modelIndex)
    • getTrajectoryState

      public String getTrajectoryState()
    • setFrameOffsets

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

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

      public boolean haveFileSet()
    • setBackgroundModelIndex

      public void setBackgroundModelIndex(int modelIndex)
    • 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
    • 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
      Returns:
      INI file
    • 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
    • evalFile

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

      public String evalFileArgs(String strFilename, String args)
      Specified by:
      evalFileArgs 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()
    • 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
    • exitJmol

      public void exitJmol()
    • 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()
    • hasDatabasePrefix

      public static boolean hasDatabasePrefix(String fileName)
    • isDatabaseCode

      public static boolean isDatabaseCode(char ch)
    • setLoadFormat

      public Object setLoadFormat(boolean isSurface, 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:
      isSurface - TODO
      name -
      type - a character to distinguish the type of file, '?' means we are just doing an isosurface check
      withPrefix -
      Returns:
      String or String[]
    • getStandardLabelFormat

      public String getStandardLabelFormat(int type)
    • getAdditionalHydrogens

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

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

      public void setHoverLabel(String strLabel)
    • isModelkitPickingRotateBond

      public boolean isModelkitPickingRotateBond()
    • hoverOnPt

      public void hoverOnPt(int x, int y, String text, String id, 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
    • setDebugScript

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

      public void setCursor(int cursor)
    • setPickingMode

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

      public int getPickingMode()
    • getDrawHover

      public boolean getDrawHover()
    • getAtomInfo

      public String getAtomInfo(int atomOrPointIndex)
    • 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 Lst<Lst<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()
    • 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
    • setFloatProperty

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

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

      public void setIntPropertyTok(String key, int tok, int value)
    • setBooleanProperty

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

      public void setBooleanPropertyTok(String key, int tok, boolean value)
    • setSmilesString

      public void setSmilesString(String s)
    • removeUserVariable

      public void removeUserVariable(String key)
    • 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
    • getSelectionHalosEnabled

      public boolean getSelectionHalosEnabled()
    • setSelectionHalosEnabled

      public void setSelectionHalosEnabled(boolean TF)
    • getShowSelectedOnce

      public boolean getShowSelectedOnce()
    • 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, BS bsA, BS bsB, 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
    • allocTempPoints

      public P3[] allocTempPoints(int size)
    • freeTempPoints

      public void freeTempPoints(P3[] tempPoints)
    • allocTempScreens

      public P3i[] allocTempScreens(int size)
    • freeTempScreens

      public void freeTempScreens(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 Quat[] getAtomGroupQuaternions(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)
    • setTainted

      public void setTainted(boolean TF)
    • checkObjectHovered

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

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

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

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

      public V3 getModelDipole()
    • calculateMolecularDipole

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

      public void setDefaultLattice(P3 p)
    • getDefaultLattice

      public 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(BS bs, int nAtomsMax, boolean addBonds, boolean doTransform)
    • getPdbAtomData

      public String getPdbAtomData(BS bs, 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(BS bs, int tok, int iValue, float fValue, String sValue, float[] values, String[] list)
    • checkCoordinatesChanged

      public void checkCoordinatesChanged(BS bsAtoms)
    • setAtomCoords

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

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

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

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

      public void moveAtoms(M4 m4, M3 mNew, M3 rotation, V3 translation, P3 center, boolean isInternal, BS bsAtoms, boolean translationOnly, boolean useModelKit)
    • highlightBond

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

      public void highlight(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 < 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, 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 <= -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 OC getOutputChannel(String localName, String[] fullPath)
    • writeTextFile

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

      public String writeFile(String fileName, Object data, String type)
    • 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
    • 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, BS bs)
    • getVanderwaalsMar

      public int getVanderwaalsMar(int i)
    • getVanderwaalsMarType

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

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

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

      public int deleteModels(int modelIndex, 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(BS bsDeleted)
    • deleteModelAtoms

      public void deleteModelAtoms(int modelIndex, int firstAtomIndex, int nAtoms, 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(Throwable er, boolean doClear)
    • getFunctions

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

      public void removeFunction(String name)
    • getFunction

      public JmolScriptFunction getFunction(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(BS bs1, 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
    • hasFocus

      public boolean hasFocus()
    • setFocus

      public void setFocus()
    • getMinimizationInfo

      public String getMinimizationInfo()
    • minimize

      public void minimize(JmolScriptEvaluator eval, int steps, float crit, BS bsSelected, BS bsFixed, BS bsInFrame, float rangeFixed, int flags) throws Exception
      From the MINIMIZE command and other sources.
      Parameters:
      eval -
      steps - Integer.MAX_VALUE --> use defaults
      crit - -1 --> use defaults
      bsSelected -
      bsFixed -
      bsInFrame -
      rangeFixed -
      flags -
      Throws:
      Exception
    • setMotionFixedAtoms

      public void setMotionFixedAtoms(BS bs)
    • setMotionFixed

      public void setMotionFixed(BS bs)
    • getMotionFixedAtoms

      public BS getMotionFixedAtoms(SymmetryInterface sym, BS bsFixed)
      For the current SINGLE model only.
      Parameters:
      sym - operationalSymmetry
      bsFixed - optional starting BitSet to be added to
      Returns:
      bsFixed
    • getCenterAndPoints

      public P3[][] getCenterAndPoints(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, BS bsAtoms, Object[] parameters, OC oc, boolean getStructure)
    • getGroupsWithin

      public BS getGroupsWithin(int nResidues, BS bs)
    • setShapeSize

      public void setShapeSize(int shapeID, int madOrMad10, 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)
    • 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

      public int moveAtomWithHydrogens(int atomIndex, int deltaX, int deltaY, int deltaZ, P3 ptNew, BS bsAtoms)
    • isModelPDB

      public boolean isModelPDB(int i)
    • deleteMeasurement

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

      public String getSmiles(BS bs) throws Exception
      NOT getting aromatic smiles
      Specified by:
      getSmiles in class JmolViewer
      Throws:
      Exception
    • getOpenSmiles

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

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

      public String getSmilesOpt(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
    • 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(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 immediately using the script function script("xxxxxx") using direct script tokens for script ( "xxxxxxx" )
      Specified by:
      runScript in class JmolViewer
      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 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(BS bsSelected, BS bsIgnore) throws JmolAsyncException
      Throws:
      JmolAsyncException
    • calculatePartialCharges

      public void calculatePartialCharges(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 BS addHydrogens(BS bsAtoms, int flags)
    • addHydrogensInline

      public BS addHydrogensInline(BS bsAtoms, Lst<Atom> vConnections, 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
      Returns:
      a String representation of the evaluated expression
    • evaluateExpressionAsVariable

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

      public BS getAtomBitSet(Object atomExpression)
    • getScriptContext

      public ScriptContext getScriptContext(String why)
    • getAtomDefs

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

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

      public void setModelSet(ModelSet modelSet)
    • setObjectProp

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

      public void setDihedrals(float[] dihedralList, 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 - < 256 is just the character of a single-character upper-case chain id, upper or lower case query; >= 256 < 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(BS bs)
    • setModulation

      public void setModulation(BS bs, boolean isOn, 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 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,BS> htDefine, Map<String,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 Lst<Float> getAtomValidation(String type, Atom atom)
    • getJBR

      public BioResolver getJBR()
    • checkMenuUpdate

      public void checkMenuUpdate()
    • getChimeMessenger

      public JmolChimeMessenger getChimeMessenger()
    • getModelSetAuxiliaryInfoForAtoms

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

      public Object parseJSON(String str)
    • parseJSONMap

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

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

      public SymmetryInterface getSymTemp()
      Retrieve a new Symmetry object.
      Returns:
      org.jmol.symmetry.Symmetry object
    • getSymStatic

      public SymmetryInterface getSymStatic()
      Retrieve the static Symmetry object, which should be used only statically
      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)
    • getNBOAtomLabel

      public String getNBOAtomLabel(Atom atom)
    • calculateChirality

      public String calculateChirality(BS bsAtoms)
    • getSubstructureSetArray

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

      public 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, but only if the modelkit exists already.
      Parameters:
      name -
      Returns:
      value
    • setModelkitPropertySafely

      public Object setModelkitPropertySafely(String key, Object value)
      Set a ModelKit property, but only if the modelkit exists already.
      Parameters:
      key -
      value -
      Returns:
      varies, quite possibly null
    • isModelKitOption

      public boolean isModelKitOption(char type, String value)
      Check for an option type 'M' 'S' 'U' 'B'.
      Parameters:
      type -
      value -
      Returns:
      true or false, but true only if the modelkit already exists
    • getSymmetryInfo

      public Object getSymmetryInfo(int iatom, String xyz, int iOp, P3 translation, P3 pt1, P3 pt2, int type, String desc, float scaleFactor, int nth, int options, int[] opList)
      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
      opList -
      Returns:
      string, Object[], or Lst<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(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(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(BS atoms, Object 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(SymmetryInterface sym, BS bsAtoms, String xyzList, float[] unitCellParams, T3 origin, T3[] oabc, int flags)
      Parameters:
      sym - TODO
      bsAtoms -
      xyzList - if present, a semicolon-separated list of operators
      unitCellParams -
      origin - TODO
      oabc - TODO
      spaceGroup - TODO
      asString -
      isAssign - from ModelKit
      checkSupercell - only true for x=spacegroup("parent")
      Returns:
      either an array of space group identifiers or, if asString, "", or null
    • restrictToModel

      public BS restrictToModel(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 BS getThisModelAtoms()
    • getSymmetryEquivPoints

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

      public Lst<?> getSymmetryEquivPointList(Lst<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
    • setStatusAtomMoved

      public void setStatusAtomMoved(boolean andCheckMinimize, BS bs)
    • getFormulaForAtoms

      public String getFormulaForAtoms(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...
    • evalCallback

      public void evalCallback(String cmd, Object[] params, boolean doWait)
    • checkConsoleScript

      public boolean checkConsoleScript(String strScript)