Class ModelKit
java.lang.Object
org.jmol.modelkit.ModelKit
An abstract popup class that is instantiated for a given platform and context
as one of:
-- abstract ModelKitPopup
-- AwtModelKitPopup
-- JSModelKitPopup
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BSa bitset indicating the presence of element keys for models; clearing a bit will cause a new key to be produced.protected final BStracks models for which the element key has been explicitly set OFF, overriding global SET elementKey ONprotected booleanprotected charfrom SET ELEMENTKEY ON/OFF or SET LABELKEY ON/OFF; TRUE to automatically set element keys for all model s; off to turn them offprotected ModelSetprotected Viewer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionRotateBond(int deltaX, int deltaY, int x, int y, boolean forceFull) Actually rotate the bond.voidaddAtomSet(String data) voidaddLockedAtoms(SymmetryInterface sg, BS bsLocked) Only for the current modelintcheckMovedAtoms(BS bsFixed, BS bsAtoms, P3[] apos0) Something has changed atom positions.protected booleanbooleancheckOption(char type, String key) MODELKIT SET options for syntax checking.voidvoidclickAssignAtom(int atomIndex, String element, P3 ptNew) From Mouse or handleAtomOrBondBickedprotected voidclickProcessXtal(String id, String action) intcmdAssignAddAtoms(String type, P3[] pts, BS bsAtoms, float packing, String cmd) MODELKIT ADD @3 ...voidcmdAssignAtom(BS bs, P3 pt, String type, String cmd) A versatile method that allows changing element, setting charge, setting position, adding or deleting an atom via MODELKIT ASSIGN ATOMvoidcmdAssignBond(int bondIndex, char type, String cmd) voidcmdAssignConnect(int index, int index2, char type, String cmd) intDelete all atoms that are equivalent to this atom.intcmdAssignMoveAtoms(BS bsSelected, int iatom, P3 p, P3[] pts, boolean allowProjection, boolean isMolecule, boolean isCommand) voidcmdAssignSpaceGroup(String transform, SB sb, String cmd, float packing, boolean doDraw) MODELKIT SPACEGROUPintcmdFillOABC(T3[] oabc, float packing, String cmd) voidcmdMinimize(JmolScriptEvaluator eval, BS bsBasis, int steps, float crit, float rangeFixed, int flags) Minimize a unit cell with full symmetry constraints.voidcmdPackUnitCell(SymmetryInterface sym, BS bsAtoms, float packing) MODELKIT {1 0 0} PACKEDintcmdRotateAtoms(BS bsAtoms, P3[] points, float endDegrees) voiddispose()voiddrawSymmetry(String thisId, boolean isSymop, int iatom, String xyz, int iSym, P3 trans, P3 center, P3 target, int intScale, int nth, int options, int[] opList, boolean isModelkit) voiddrawSymop(int a1, int a2) from set picking symopvoiddrawUnitCell(String id, T3 ucLattice, String swidth) protected voidexitBondRotation(String text) for the thin box on the top left of the windowprotected String[]protected AtomgetBasisAtom(int iatom) protected Stringprotected Stringprotected static StringgetKey(int modelIndex, char ext) protected intgetProperty(String name) Get a property of the modelkit.intgetSym(int iatom) protected intprotected Stringprotected intprotected intbooleanhandleAssignNew(MouseState pressed, MouseState dragged, MeasurementPending mp, int dragAtomIndex, int key) handle a mouse-generated assignNew eventbooleanhasConstraint(int iatom, boolean ignoreGeneral, boolean addNew) booleanisHidden()booleanprotected booleanvoidminimizeEnd(BS bsBasis2, boolean isEnd) intmoveMinConstrained(int iatom, P3 p, BS bsAtoms) protected voidprocessMKPropertyItem(String name, boolean TF) protected booleanprocessSymop(String id, boolean isFocus) protected voidsetBondMeasure(int bi, MeasurementPending mp) protected org.jmol.modelkit.ModelKit.ConstraintsetConstraint(SymmetryInterface sym, int ia, int mode) This constraint will be set for the site only.protected booleanprotected voidsetHoverLabel(String mode, String text) voidsetMenu(ModelKitPopup menu) protected voidsetMKState(int bits) setProperty(String key, Object value) Modify the state by setting a property.voidshowMenu(int x, int y) booleantransformAtomsToUnitCell(SymmetryInterface sym, T3[] oabc, String ucname) Transform the atoms to fractional coordinate, set the unit cell to a new cell, and then transform them back to Cartesians.voidboolean
-
Field Details
-
vwr
-
lastModelSet
-
keyType
protected char keyTypefrom SET ELEMENTKEY ON/OFF or SET LABELKEY ON/OFF; TRUE to automatically set element keys for all model s; off to turn them off -
bsKeyModels
a bitset indicating the presence of element keys for models; clearing a bit will cause a new key to be produced. -
bsKeyModelsOFF
tracks models for which the element key has been explicitly set OFF, overriding global SET elementKey ON -
haveKeys
protected boolean haveKeys
-
-
Constructor Details
-
ModelKit
public ModelKit()
-
-
Method Details
-
getKey
-
actionRotateBond
public void actionRotateBond(int deltaX, int deltaY, int x, int y, boolean forceFull) Actually rotate the bond.- Parameters:
deltaX-deltaY-x-y-forceFull-
-
addLockedAtoms
Only for the current model- Parameters:
sg-bsLocked-
-
checkMovedAtoms
Something has changed atom positions. Check to see that this is allowed and, if it is, move all equivalent atoms appropriately. If it is not, then revert.- Parameters:
bsFixed-bsAtoms-apos0- original positions- Returns:
- number of atoms moved, possibly 0
-
checkOption
MODELKIT SET options for syntax checking.- Parameters:
type- 'M' menu, 'S' symmetry 'U' unit cell, 'B' booleankey-- Returns:
- true if the type exists
-
clearAtomConstraints
public void clearAtomConstraints() -
clickAssignAtom
From Mouse or handleAtomOrBondBicked- Parameters:
atomIndex- initiating atom clicked or dragged fromelement- chemical symbol or "X" for delete, or one of the pickAssignTypes, such as increase/decrease chargeptNew- if dragged to a new location to create a bond
-
cmdAssignAddAtoms
MODELKIT ADD @3 ... MODELKIT ADD _C wyckoff invalid input: '<'[a-zAG] MODELKIT ADD C| this model only - Parameters:
type-| "_" | ":"invalid input: '<'Wyckoff letter [a-zAG] pts- one or more new points, may be nullbsAtoms- the atoms to process, presumably from different sitespacking-cmd- the command generating this call- Returns:
- the number of atoms added
-
cmdAssignAtom
A versatile method that allows changing element, setting charge, setting position, adding or deleting an atom via MODELKIT ASSIGN ATOM- Parameters:
bs- may be -1pt- a Cartesian position for a new atom or when moving an atom to a new positiontype- one of: an element symbol, "X" (delete), "Mi" (decrement charge), "Pl" (increment charge), "." (from connect; just adding hydrogens)cmd- reference command given; may be null
-
cmdAssignBond
-
cmdAssignConnect
- Parameters:
index-index2-type-cmd-
-
cmdAssignSpaceGroup
-
cmdAssignDeleteAtoms
Delete all atoms that are equivalent to this atom.- Parameters:
bs-- Returns:
- number of deleted atoms
-
cmdPackUnitCell
MODELKIT {1 0 0} PACKED- Parameters:
sym-bsAtoms-packing-
-
cmdFillOABC
-
cmdAssignMoveAtoms
-
cmdMinimize
public void cmdMinimize(JmolScriptEvaluator eval, BS bsBasis, int steps, float crit, float rangeFixed, int flags) throws Exception Minimize a unit cell with full symmetry constraints. The model will be loaded with a 27-cell packing, but only the basis atoms themselves will be loaded.- Parameters:
eval-bsBasis-steps-crit-rangeFixed-flags-- Throws:
Exception
-
cmdRotateAtoms
-
dispose
public void dispose() -
getActiveMenu
for the thin box on the top left of the window- Returns:
- [ "atomMenu" | "bondMenu" | "xtalMenu" | null ]
-
getDefaultModel
-
getProperty
-
getRotateBondIndex
public int getRotateBondIndex() -
getSym
-
handleAssignNew
public boolean handleAssignNew(MouseState pressed, MouseState dragged, MeasurementPending mp, int dragAtomIndex, int key) handle a mouse-generated assignNew event- Parameters:
pressed-dragged-mp-dragAtomIndex-key- from a key press- Returns:
- true if we should do a refresh now
-
hasConstraint
public boolean hasConstraint(int iatom, boolean ignoreGeneral, boolean addNew) -
isHidden
public boolean isHidden() -
isPickAtomAssignCharge
public boolean isPickAtomAssignCharge() -
minimizeEnd
-
moveMinConstrained
-
setBondMeasure
-
setMenu
-
setProperty
-
showMenu
public void showMenu(int x, int y) -
updateMenu
public void updateMenu() -
wasRotating
public boolean wasRotating() -
checkNewModel
protected boolean checkNewModel() -
clickProcessXtal
-
exitBondRotation
-
getAllOperators
-
getBasisAtom
-
getCenterText
-
getElementFromUser
-
getMKState
protected int getMKState() -
getSymEditState
protected int getSymEditState() -
getSymopText
-
getSymViewState
protected int getSymViewState() -
getUnitCellState
protected int getUnitCellState() -
isXtalState
protected boolean isXtalState() -
processMKPropertyItem
-
processSymop
-
resetAtomPickType
protected void resetAtomPickType() -
setConstraint
protected org.jmol.modelkit.ModelKit.Constraint setConstraint(SymmetryInterface sym, int ia, int mode) This constraint will be set for the site only.- Parameters:
sym-ia-mode- GET, GET_CREATE, or GET_DELETE- Returns:
- a Constraint, or possibly null if not createNew
-
setHasUnitCell
protected boolean setHasUnitCell() -
setHoverLabel
-
setMKState
protected void setMKState(int bits) -
transformAtomsToUnitCell
Transform the atoms to fractional coordinate, set the unit cell to a new cell, and then transform them back to Cartesians.- Parameters:
sym-oabc-ucname-- Returns:
- true if this is a "reset" with no atoms or sym == null
-
drawSymop
public void drawSymop(int a1, int a2) from set picking symop- Parameters:
a1-a2-
-
addAtomSet
-
drawUnitCell
-
drawAxes
-
drawSymmetry
-