CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.cubetwister.doc
Class InfoModel

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by ch.randelshofer.cubetwister.doc.EntityModel
          extended by ch.randelshofer.cubetwister.doc.InfoModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.event.UndoableEditListener, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
CubeColorModel, CubeModel, MacroModel, NotationModel, ScriptModel, TextModel

public class InfoModel
extends EntityModel

Holds general information: a title, a description field, an author field and a date field.

Assumes that the root node of the tree is a DefaultMutableTreeNode and that its user object is a RootModel instance, which holds the tree! This is used to ensure proper listener notifications for object insertion and removal.

Version:
1.1 2007-08-11 Moved "name" property from subclasses up to this class.
1.0 2001-10-05 Created
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
protected  DocumentProxy author
           
protected  DocumentProxy date
           
protected  DocumentProxy description
           
protected  DocumentProxy name
           
static java.lang.String PROP_AUTHOR
           
static java.lang.String PROP_DATE
           
static java.lang.String PROP_DESCRIPTION
           
static java.lang.String PROP_NAME
           
 
Fields inherited from class ch.randelshofer.cubetwister.doc.EntityModel
PROP_CHILD_COUNT
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
InfoModel()
          Creates a new InfoModel.
 
Method Summary
 void basicSetAuthor(java.lang.String value)
           
 void basicSetDate(java.lang.String value)
           
 void basicSetDescription(java.lang.String value)
           
 void basicSetName(java.lang.String value)
           
 java.lang.Object clone()
          Returns a shallow copy of this model.
 void dispose()
           
 java.lang.String getAuthor()
          Returns the author property.
 DocumentProxy getAuthorDocument()
           
 java.lang.String getDate()
          Returns the date property.
 DocumentProxy getDateDocument()
           
 java.lang.String getDescription()
          Returns the description property.
 DocumentProxy getDescriptionDocument()
           
 java.lang.String getName()
           
 javax.swing.text.Document getNameDocument()
           
 java.lang.Object getUserObject()
           
 void setAuthor(java.lang.String value)
          Sets the author property.
 void setDate(java.lang.String value)
          Sets the date property.
 void setDescription(java.lang.String value)
          Sets the description property.
 void setName(java.lang.String value)
           
 void setUserObject(java.lang.Object obj)
           
 java.lang.String toString()
           
 void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
          An undoable edit happened
 
Methods inherited from class ch.randelshofer.cubetwister.doc.EntityModel
addPropertyChangeListener, children, fireNodeChanged, fireNodeStructureChanged, firePropertyChange, firePropertyChange, firePropertyChange, fireUndoableEditHappened, getDocument, hasPropertyListeners, insert, isDefaultCube, isDefaultNotation, isRemovable, 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
 

Field Detail

PROP_NAME

public static final java.lang.String PROP_NAME
See Also:
Constant Field Values

PROP_DESCRIPTION

public static final java.lang.String PROP_DESCRIPTION
See Also:
Constant Field Values

PROP_AUTHOR

public static final java.lang.String PROP_AUTHOR
See Also:
Constant Field Values

PROP_DATE

public static final java.lang.String PROP_DATE
See Also:
Constant Field Values

name

protected DocumentProxy name

description

protected DocumentProxy description

author

protected DocumentProxy author

date

protected DocumentProxy date
Constructor Detail

InfoModel

public InfoModel()
Creates a new InfoModel. Sets the author to the System user.name property and the date to the current time.

Method Detail

getName

public java.lang.String getName()

getNameDocument

public javax.swing.text.Document getNameDocument()

setName

public void setName(java.lang.String value)

basicSetName

public void basicSetName(java.lang.String value)

getDescription

public java.lang.String getDescription()
Returns the description property.


getDescriptionDocument

public DocumentProxy getDescriptionDocument()

setDescription

public void setDescription(java.lang.String value)
Sets the description property.


basicSetDescription

public void basicSetDescription(java.lang.String value)

getAuthor

public java.lang.String getAuthor()
Returns the author property.


getAuthorDocument

public DocumentProxy getAuthorDocument()

setAuthor

public void setAuthor(java.lang.String value)
Sets the author property.


basicSetAuthor

public void basicSetAuthor(java.lang.String value)

getDate

public java.lang.String getDate()
Returns the date property.


getDateDocument

public DocumentProxy getDateDocument()

setDate

public void setDate(java.lang.String value)
Sets the date property.


basicSetDate

public void basicSetDate(java.lang.String value)

undoableEditHappened

public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
An undoable edit happened

Specified by:
undoableEditHappened in interface javax.swing.event.UndoableEditListener
Overrides:
undoableEditHappened in class EntityModel

getUserObject

public java.lang.Object getUserObject()
Overrides:
getUserObject in class javax.swing.tree.DefaultMutableTreeNode

setUserObject

public void setUserObject(java.lang.Object obj)
Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode
Overrides:
setUserObject in class javax.swing.tree.DefaultMutableTreeNode

toString

public java.lang.String toString()
Overrides:
toString in class EntityModel

clone

public java.lang.Object clone()
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 EntityModel

dispose

public void dispose()
Overrides:
dispose in class EntityModel

(c) Werner Randelshofer.
All rights reserved.