ch.randelshofer.cubetwister.doc
Class ScriptModel
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
ch.randelshofer.cubetwister.doc.EntityModel
ch.randelshofer.cubetwister.doc.InfoModel
ch.randelshofer.cubetwister.doc.ScriptModel
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.event.UndoableEditListener, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
public class ScriptModel
- extends InfoModel
Holds a Script and its attributes.
- Version:
- 2.2.1 2010-04-05 Removed dependencies to IBM Unicode normalizer.
2.2 Normalize script to Unicode NFKC before parsing.
2.1 2007-08-11 Moved "name" property into superclass.
1.3 2006-09-24 Reworked.
1.2.2 2004-07-31 Variable parseException was not properly assigned
in method check().
1.2.1 2003-03-05 ProProgressPanelst not be cloned.
1.2 2002-12-26 Method translateInto(NotatationModel) improved.
1.1.2 2002-11-20 Set the notationModel property to getDocument.getDefaultNotation(),
when the notationModel is removed from the document.
1.1.1 2002-02-03 TranslateInto and change of Notation
could not be undone.
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Immensee, Switzerland.
- See Also:
- Serialized Form
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
|
Constructor Summary |
ScriptModel()
Creates new CubeScript |
| Methods inherited from class ch.randelshofer.cubetwister.doc.InfoModel |
basicSetAuthor, basicSetDate, basicSetDescription, basicSetName, dispose, getAuthor, getAuthorDocument, getDate, getDateDocument, getDescription, getDescriptionDocument, getName, getNameDocument, getUserObject, setAuthor, setDate, setDescription, setName, setUserObject, toString, undoableEditHappened |
| Methods inherited from class ch.randelshofer.cubetwister.doc.EntityModel |
addPropertyChangeListener, children, fireNodeChanged, fireNodeStructureChanged, firePropertyChange, firePropertyChange, firePropertyChange, fireUndoableEditHappened, getDocument, hasPropertyListeners, insert, isDefaultCube, isDefaultNotation, remove, removePropertyChangeListener, setRemovable |
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add, breadthFirstEnumeration, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObjectPath, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PROP_NAME
public static final java.lang.String PROP_NAME
- See Also:
- Constant Field Values
PROP_SCRIPT
public static final java.lang.String PROP_SCRIPT
- See Also:
- Constant Field Values
NOTATION_PROPERTY
public static final java.lang.String NOTATION_PROPERTY
- See Also:
- Constant Field Values
CHECKED_PROPERTY
public static final java.lang.String CHECKED_PROPERTY
- See Also:
- Constant Field Values
PROP_STATE_INFO
public static final java.lang.String PROP_STATE_INFO
- See Also:
- Constant Field Values
CUBE_PROPERTY
public static final java.lang.String CUBE_PROPERTY
- See Also:
- Constant Field Values
PROP_IS_GENERATOR
public static final java.lang.String PROP_IS_GENERATOR
- See Also:
- Constant Field Values
PROP_SOLVER_MODEL
public static final java.lang.String PROP_SOLVER_MODEL
- See Also:
- Constant Field Values
PROP_SCRIPT_MODEL
public static final java.lang.String PROP_SCRIPT_MODEL
- See Also:
- Constant Field Values
PROP_INTERACTION_MODE
public static final java.lang.String PROP_INTERACTION_MODE
- See Also:
- Constant Field Values
PROP_CUBE_3D
public static final java.lang.String PROP_CUBE_3D
- See Also:
- Constant Field Values
MODE_TWIST
public static final int MODE_TWIST
- See Also:
- Constant Field Values
MODE_STICKER
public static final int MODE_STICKER
- See Also:
- Constant Field Values
MODE_RECORD
public static final int MODE_RECORD
- See Also:
- Constant Field Values
ScriptModel
public ScriptModel()
- Creates new CubeScript
getCubeModel
public CubeModel getCubeModel()
isUsingDefaultCube
public boolean isUsingDefaultCube()
setCubeModel
public void setCubeModel(CubeModel value)
getScript
public java.lang.String getScript()
getScriptDocument
public javax.swing.text.StyledDocument getScriptDocument()
setScript
public void setScript(java.lang.String value)
basicSetScript
public void basicSetScript(java.lang.String value)
getNotationModel
public NotationModel getNotationModel()
isUsingDefaultNotation
public boolean isUsingDefaultNotation()
setNotationModel
public void setNotationModel(NotationModel value)
addNotify
public void addNotify(EntityModel m)
removeNotify
public void removeNotify(EntityModel m)
getParser
public ScriptParser getParser()
getParseException
public ParseException getParseException()
clearParseException
public void clearParseException()
check
public void check()
throws ParseException
- Throws:
ParseException
isChecked
public boolean isChecked()
isGenerator
public boolean isGenerator()
setGenerator
public void setGenerator(boolean value)
uncheck
public void uncheck()
getStateInfo
public java.lang.String getStateInfo()
getParsedScript
public SequenceNode getParsedScript()
- Returns a parsed version of the script.
Returns an empty script, if the parsing failed - never returns null.
getMacros
public java.util.List<MacroNode> getMacros()
getMacroModels
public javax.swing.tree.DefaultMutableTreeNode getMacroModels()
translateInto
public void translateInto(NotationModel n)
throws java.io.IOException
- Throws:
java.io.IOException
clone
public java.lang.Object clone()
- Description copied from class:
InfoModel
- Returns a shallow copy of this model.
All references to other models are maintained.
The new model has no parent or children and no property change listeners.
- Overrides:
clone in class InfoModel
setProgressView
public void setProgressView(ProgressObserver view)
- Sets the progress view of a running solver that writes its results
into this script model.
getProgressView
public ProgressObserver getProgressView()
- Gets the progress view of a running solver that writes its results
into this script model.
isRemovable
public boolean isRemovable()
- Returns true if the node may be removed from its parent.
- Overrides:
isRemovable in class EntityModel
getInteractionMode
public int getInteractionMode()
getPlayer
public ScriptPlayer getPlayer()
getCube
public Cube getCube()
getCube3D
public Cube3D getCube3D()
getSolverModel
public SolverModel getSolverModel()
reset
public void reset()
scramble
public void scramble()