# Class StateManager

java.lang.Object
org.jmol.viewer.StateManager

public class StateManager extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`OBJ_AXIS1`
`static final int`
`OBJ_AXIS2`
`static final int`
`OBJ_AXIS3`
`static final int`
`OBJ_BACKGROUND`
`static final int`
`OBJ_BOUNDBOX`
`static final int`
`OBJ_FRANK`
`static final int`
`OBJ_MAX`
`static final int`
`OBJ_UNITCELL`
`protected Map<String,Object>`
`saved`
`protected final Viewer`
`vwr`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canDo(int type)`
`void`
`deleteSaved(String namelike)`
`Object`
`getContext(String saveName)`
`static int`
`getObjectIdFromName(String name)`
`String`
`getSavedCoordinates(String saveName)`
`String`
`getSavedState(String saveName)`
`String`
`getSavedStructure(String saveName)`
`String`
`getSavedUnitCell(String saveName)`
`String`
`getUndoInfo()`
`int`
`getUndoMax()`
`String`
`getUndoRedoState(int tok)`
`static String`
`getVariableList(Map<String,SV> htVariables, int nMax, boolean withSites, boolean definedOnly)`
`String`
`listSavedStates()`
`String`
`popStack(int type)`
Remove the last item on the specified stack, and save the current state to the other stack provided that state is not null.
`void`
`resetLighting()`
Reset lighting to Jmol defaults
`boolean`
`restoreBonds(String saveName)`
`boolean`
`restoreOrientation(String saveName, float timeSeconds, boolean isAll)`
`boolean`
`restoreScene(String saveName, float timeSeconds)`
`boolean`
`restoreSelection(String saveName)`
`boolean`
`restoreUnitCell(String saveName)`
`void`
`saveBonds(String saveName)`
`void`
`saveContext(String saveName, Object context)`
`void`
`saveCoordinates(String saveName, BS bsSelected)`
`void`
`saveOrientation(String saveName, float[] pymolView)`
`void`
`saveScene(String saveName, Map<String,Object> scene)`
`void`
`saveSelection(String saveName, BS bsSelected)`
`void`
`saveState(String saveName)`
`void`
`saveStructure(String saveName)`
`void`
`saveUnitCell(String saveName)`
`void`
`setUndoMax(int n)`
`static String`
`varClip(String name, String sv, int nMax)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### OBJ_BACKGROUND

public static final int OBJ_BACKGROUND

See Also:
  - Constant Field Values

### OBJ_AXIS1

public static final int OBJ_AXIS1

See Also:
  - Constant Field Values

### OBJ_AXIS2

public static final int OBJ_AXIS2

See Also:
  - Constant Field Values

### OBJ_AXIS3

public static final int OBJ_AXIS3

See Also:
  - Constant Field Values

### OBJ_BOUNDBOX

public static final int OBJ_BOUNDBOX

See Also:
  - Constant Field Values

### OBJ_UNITCELL

public static final int OBJ_UNITCELL

See Also:
  - Constant Field Values

### OBJ_FRANK

public static final int OBJ_FRANK

See Also:
  - Constant Field Values

### OBJ_MAX

public static final int OBJ_MAX

See Also:
  - Constant Field Values

### vwr

protected final Viewer vwr

### saved

protected Map<String,Object> saved

## Method Details

### getVariableList

public static String getVariableList(Map<String,SV> htVariables, int nMax, boolean withSites, boolean definedOnly)

### getObjectIdFromName

public static int getObjectIdFromName(String name)

### resetLighting

public void resetLighting()
Reset lighting to Jmol defaults

### listSavedStates

public String listSavedStates()

### deleteSaved

public void deleteSaved(String namelike)

### saveSelection

public void saveSelection(String saveName, BS bsSelected)

### restoreSelection

public boolean restoreSelection(String saveName)

### saveUnitCell

public void saveUnitCell(String saveName)

### getSavedUnitCell

public String getSavedUnitCell(String saveName)

### restoreUnitCell

public boolean restoreUnitCell(String saveName)

### saveState

public void saveState(String saveName)

### getSavedState

public String getSavedState(String saveName)

### popStack

public String popStack(int type)
Remove the last item on the specified stack, and save the current state to the other stack provided that state is not null.

Parameters:
  `type` -
Returns:
  state to run

### saveStructure

public void saveStructure(String saveName)

### getSavedStructure

public String getSavedStructure(String saveName)

### saveCoordinates

public void saveCoordinates(String saveName, BS bsSelected)

### getSavedCoordinates

public String getSavedCoordinates(String saveName)

### saveScene

public void saveScene(String saveName, Map<String,Object> scene)

### restoreScene

public boolean restoreScene(String saveName, float timeSeconds)

### saveOrientation

public void saveOrientation(String saveName, float[] pymolView)

### restoreOrientation

public boolean restoreOrientation(String saveName, float timeSeconds, boolean isAll)

### saveContext

public void saveContext(String saveName, Object context)

### getContext

public Object getContext(String saveName)

### saveBonds

public void saveBonds(String saveName)

### restoreBonds

public boolean restoreBonds(String saveName)

### varClip

public static String varClip(String name, String sv, int nMax)

### getUndoMax

public int getUndoMax()

### setUndoMax

public void setUndoMax(int n)

### getUndoRedoState

public String getUndoRedoState(int tok)

### canDo

public boolean canDo(int type)

### getUndoInfo

public String getUndoInfo()