ix.iview.domain
Class UIObjectClass

java.lang.Object
  extended by ix.icore.AbstractAnnotatedObject
      extended by ix.iview.domain.UIObjectClass
All Implemented Interfaces:
Annotated, Named, EditableObject, IXNode, UIEditableObject, UIObject, java.io.Serializable, javax.swing.tree.TreeNode

public class UIObjectClass
extends AbstractAnnotatedObject
implements Named, EditableObject, UIObject, IXNode, javax.swing.tree.TreeNode

A class that helps to edit type specifications for activity relatable objects. Note that these are all types rather than the objects themselves. Objects can be instantiated during execution, but not here.

See Also:
Serialized Form

Field Summary
 Annotations annotations
           
protected  ObjectClass baseObject
           
protected  java.lang.String baseReference
           
(package private)  java.util.HashSet dataChangeListeners
           
 Symbol name
           
 ix.icore.domain.ListOfObjectProperty objectProperties
          A list of symbols that are property names.
 ix.util.lisp.ListOfSymbol subClassNames
          A list of symbol names of child UIObjectClasses
 ix.util.lisp.ListOfSymbol superClassNames
          A list of symbol names of parent UIObjectClasses
protected  UIDomain uiDomain
           
 
Fields inherited from class ix.icore.AbstractAnnotatedObject
annotationListeners
 
Constructor Summary
UIObjectClass(UIDomain uiDomain, ObjectClass original)
           
UIObjectClass(UIDomain uiDomain, java.lang.String name)
           
UIObjectClass(UIDomain uiDomain, Symbol name)
           
 
Method Summary
 void addChild(IXNode child)
           
 void addChild(java.lang.String child)
           
 void addChild(Symbol child)
           
 void addChildren(java.util.List children)
          Adds a list of UIObjectClass to sub classes.
 void addDataChangeListener(DataChangeListener l)
           
 void addParent(IXNode parent)
           
 void addParents(java.util.List parents)
          Adds a list of UIObjectClass to super classes.
 void addProperty(ObjectProperty property)
           
 void addProperty(java.lang.String property)
           
 void addProperty(java.lang.String property, ObjectProperty.Syntax type)
           
 void addProperty(java.lang.String property, java.lang.String type)
           
 void addProperty(Symbol property)
           
 void addProperty(Symbol property, ObjectProperty.Syntax type)
           
 void addToDomain()
           
 void addToDomain(Domain domain)
          Adds the contents of this UIObject to the domain (part of publish).
 boolean checkLegalParent(UIObjectClass otherNode)
           
 java.util.Enumeration children()
           
 UIObjectClass cloneThis()
           
 java.util.List collectChanges()
          Collects the differences between this object and the base one.
 java.util.List collectChanges(ObjectClass original)
          Collects the differences between this object and the given one.
 java.util.List collectChanges(ObjectClass original, java.lang.String which)
           
 java.util.List collectChangesFromOriginal()
          Collects the differences between this object and the base one.
static ix.util.lisp.LinkedListOfSymbol collectClassNames(java.util.List objects)
           
 boolean getAllowsChildren()
           
 java.util.HashSet getAllProperties()
           
 java.util.HashSet getAncestorProperties()
           
 Annotations getAnnotations()
           
 java.lang.Class getBaseClass()
          Gets the class of objects that can represent this one in the domain.
 IXObject getBaseObject()
          Gets the object that corresponds to this one in the domain.
 java.lang.Object getBaseReference()
          Gets the Id that can be used to identify the base object in the domain.
 javax.swing.tree.TreeNode getChildAt(int index)
           
 int getChildCount()
           
 java.util.List getChildren()
           
 Domain getDomain()
          Gets the base domain.
 int getIndex(javax.swing.tree.TreeNode node)
           
 java.lang.String getName()
           
 java.util.List getObjectProperties()
           
 IXObject getOriginal()
          Gets the object that corresponds to this one in the original domain.
 java.util.HashSet getOwnProperties()
           
 javax.swing.tree.TreeNode getParent()
           
 java.util.List getParents()
           
 java.util.List getSubClassNames()
           
 java.util.List getSuperClassNames()
           
 UIDomain getUIDomain()
          Gets the ui domain of which this object is part.
 boolean hasChanged()
          Determines whether the object has changed since it was last saved to draft
 boolean hasChanged(ObjectClass original)
           
 boolean hasChangedFromOriginal()
          Determines whether the object has changed from its original.
 boolean hasOriginal()
          Determines whether the object has an original in the base domain.
 boolean isEmpty()
          If the specifications are empty, we don't care about the parents.
 boolean isEmpty(ObjectClass oc)
          If the original specifications are empty
 boolean isLeaf()
           
 boolean isNodeAncestor(javax.swing.tree.TreeNode otherNode)
          Returns true if the node is this node, or if it is a parent of this node, or if it is an ancestor of one of the parents.
 boolean isOwnProperty(ObjectProperty prop)
           
 boolean isParentOf(UIObjectClass otherNode)
           
 boolean isProperty(ObjectProperty prop)
           
 boolean isProperty(java.lang.String prop)
           
 boolean isUndefined()
           
 void loadFromDomain()
          Loads this object from its baseObject.
 void loadFromDomain(java.lang.Object domainObject)
          Loads the contents of this object from the given object.
 void loadFromOriginal()
          Loads the contents of this object from its original domain object.
 IXObject makeBaseObject()
          Makes an empty object of the right class that can represent this UIObject in the domain.
 void moveToUIDomain(UIDomain uiDomain)
          Move the object from its current UIDomain to the given one.
 boolean nameHasChanged(java.lang.Object nameThing)
          Determines whether the object's identifying fields have changed
 void noteChange()
          Get the UIDomain to note the change of this object
 java.lang.String print()
           
 void removeChild(IXNode child)
           
 void removeChild(java.lang.String child)
           
 void removeChild(Symbol child)
           
 void removeDataChangeListener(DataChangeListener l)
           
 void removeFromDomain()
           
 void removeFromDomain(Domain domain)
          Removes the object's corresponding base object from the domain.
 void removeParent(IXNode parent)
           
 void removeParent(java.lang.String parent)
           
 void removeParent(Symbol parent)
           
 void removeProperty(java.lang.Object property)
           
 void replaceProperty(ObjectProperty oldProp, ObjectProperty newProp)
           
 java.lang.String reportLegalChild(UIObjectClass otherNode)
           
 java.lang.String reportLegalParent(UIObjectClass otherNode)
           
 boolean sameValue(java.lang.String field, java.lang.Object value, java.lang.Object otherValue)
          Determines whether the two given values of the given field differ.
 void saveToDomain()
          Saves this object into a suitable baseObject.
 void saveToDomain(java.lang.Object domainObject)
          Saves the contents of this object into the given object.
 void setAnnotations(Annotations annotations)
           
 void setBaseObject(IXObject object)
          Sets the object that will represent this one in the domain.
 void setBaseReference(java.lang.Object ref)
          Sets the Id that can be used to identify the base object in the domain.
 void setLegalName(java.lang.String newName)
           
 void setName(java.lang.String newName)
           
 void setObjectProperties(java.util.List newValue)
           
 void setSubClassNames(java.util.List newValue)
           
 void setSuperClassNames(java.util.List newValue)
           
 boolean setValue(java.lang.String field, java.lang.Object value)
          Edits the ARO type.
 java.lang.String superString()
           
protected  void tidyChildren(Symbol oldN, Symbol newN)
           
protected  void tidyParents(Symbol oldN, Symbol newN)
           
 java.lang.String toString()
           
 void updateInDomain(Domain domain)
          Updates the base object in the domain with the contents of this object.
 void updateSuperClasses()
          Makes sure that super classes know about this one!
 
Methods inherited from class ix.icore.AbstractAnnotatedObject
addAnnotationListener, annMap, clearAnnotations, fireSetAnnotation, getAnnotation, getComments, makeAnnMap, removeAnnotation, setAnnotation, setComments, takeAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public Symbol name

superClassNames

public ix.util.lisp.ListOfSymbol superClassNames
A list of symbol names of parent UIObjectClasses


subClassNames

public ix.util.lisp.ListOfSymbol subClassNames
A list of symbol names of child UIObjectClasses


objectProperties

public ix.icore.domain.ListOfObjectProperty objectProperties
A list of symbols that are property names. May turn into a list of property types


annotations

public Annotations annotations

uiDomain

protected UIDomain uiDomain

baseObject

protected ObjectClass baseObject

baseReference

protected java.lang.String baseReference

dataChangeListeners

java.util.HashSet dataChangeListeners
Constructor Detail

UIObjectClass

public UIObjectClass(UIDomain uiDomain,
                     java.lang.String name)

UIObjectClass

public UIObjectClass(UIDomain uiDomain,
                     Symbol name)

UIObjectClass

public UIObjectClass(UIDomain uiDomain,
                     ObjectClass original)
Method Detail

cloneThis

public UIObjectClass cloneThis()

getName

public java.lang.String getName()
Specified by:
getName in interface Named

setName

public void setName(java.lang.String newName)
Specified by:
setName in interface UIObject

setLegalName

public void setLegalName(java.lang.String newName)

getObjectProperties

public java.util.List getObjectProperties()

getSuperClassNames

public java.util.List getSuperClassNames()

getSubClassNames

public java.util.List getSubClassNames()

getAnnotations

public Annotations getAnnotations()
Specified by:
getAnnotations in interface Annotated
Overrides:
getAnnotations in class AbstractAnnotatedObject

setAnnotations

public void setAnnotations(Annotations annotations)
Specified by:
setAnnotations in interface Annotated
Overrides:
setAnnotations in class AbstractAnnotatedObject

isProperty

public boolean isProperty(java.lang.String prop)

isProperty

public boolean isProperty(ObjectProperty prop)

isOwnProperty

public boolean isOwnProperty(ObjectProperty prop)

getOwnProperties

public java.util.HashSet getOwnProperties()

getAllProperties

public java.util.HashSet getAllProperties()

getAncestorProperties

public java.util.HashSet getAncestorProperties()

setValue

public boolean setValue(java.lang.String field,
                        java.lang.Object value)
Edits the ARO type. Implements EditableObjct

Specified by:
setValue in interface EditableObject
Specified by:
setValue in interface UIObject

sameValue

public boolean sameValue(java.lang.String field,
                         java.lang.Object value,
                         java.lang.Object otherValue)
Determines whether the two given values of the given field differ. implements EditableObjct

Specified by:
sameValue in interface EditableObject
Specified by:
sameValue in interface UIObject

isEmpty

public boolean isEmpty()
If the specifications are empty, we don't care about the parents.

Specified by:
isEmpty in interface UIEditableObject
Specified by:
isEmpty in interface UIObject

isUndefined

public boolean isUndefined()
Specified by:
isUndefined in interface UIEditableObject

isEmpty

public boolean isEmpty(ObjectClass oc)
If the original specifications are empty


updateSuperClasses

public void updateSuperClasses()
Makes sure that super classes know about this one!


setSuperClassNames

public void setSuperClassNames(java.util.List newValue)

addParent

public void addParent(IXNode parent)
Specified by:
addParent in interface IXNode

addParents

public void addParents(java.util.List parents)
Adds a list of UIObjectClass to super classes.


removeParent

public void removeParent(Symbol parent)

removeParent

public void removeParent(java.lang.String parent)

removeParent

public void removeParent(IXNode parent)
Specified by:
removeParent in interface IXNode

tidyParents

protected void tidyParents(Symbol oldN,
                           Symbol newN)

tidyChildren

protected void tidyChildren(Symbol oldN,
                            Symbol newN)

collectClassNames

public static ix.util.lisp.LinkedListOfSymbol collectClassNames(java.util.List objects)

setSubClassNames

public void setSubClassNames(java.util.List newValue)

addChild

public void addChild(Symbol child)

addChild

public void addChild(java.lang.String child)

addChild

public void addChild(IXNode child)
Specified by:
addChild in interface IXNode

addChildren

public void addChildren(java.util.List children)
Adds a list of UIObjectClass to sub classes.


removeChild

public void removeChild(Symbol child)

removeChild

public void removeChild(java.lang.String child)

removeChild

public void removeChild(IXNode child)
Specified by:
removeChild in interface IXNode

setObjectProperties

public void setObjectProperties(java.util.List newValue)

addProperty

public void addProperty(Symbol property,
                        ObjectProperty.Syntax type)

addProperty

public void addProperty(java.lang.String property,
                        ObjectProperty.Syntax type)

addProperty

public void addProperty(java.lang.String property,
                        java.lang.String type)

addProperty

public void addProperty(Symbol property)

addProperty

public void addProperty(java.lang.String property)

addProperty

public void addProperty(ObjectProperty property)

replaceProperty

public void replaceProperty(ObjectProperty oldProp,
                            ObjectProperty newProp)

removeProperty

public void removeProperty(java.lang.Object property)

getDomain

public Domain getDomain()
Description copied from interface: UIObject
Gets the base domain.

Specified by:
getDomain in interface UIObject

getUIDomain

public UIDomain getUIDomain()
Description copied from interface: UIObject
Gets the ui domain of which this object is part.

Specified by:
getUIDomain in interface UIObject

moveToUIDomain

public void moveToUIDomain(UIDomain uiDomain)
Description copied from interface: UIObject
Move the object from its current UIDomain to the given one.

Specified by:
moveToUIDomain in interface UIObject

getBaseReference

public java.lang.Object getBaseReference()
Description copied from interface: UIObject
Gets the Id that can be used to identify the base object in the domain.

Specified by:
getBaseReference in interface UIObject

setBaseReference

public void setBaseReference(java.lang.Object ref)
Description copied from interface: UIObject
Sets the Id that can be used to identify the base object in the domain.

Specified by:
setBaseReference in interface UIObject

getBaseObject

public IXObject getBaseObject()
Description copied from interface: UIObject
Gets the object that corresponds to this one in the domain.

Specified by:
getBaseObject in interface UIEditableObject
Specified by:
getBaseObject in interface UIObject

makeBaseObject

public IXObject makeBaseObject()
Description copied from interface: UIObject
Makes an empty object of the right class that can represent this UIObject in the domain.

Specified by:
makeBaseObject in interface UIObject

setBaseObject

public void setBaseObject(IXObject object)
Description copied from interface: UIObject
Sets the object that will represent this one in the domain.

Specified by:
setBaseObject in interface UIObject

getBaseClass

public java.lang.Class getBaseClass()
Description copied from interface: UIObject
Gets the class of objects that can represent this one in the domain.

Specified by:
getBaseClass in interface UIObject

hasOriginal

public boolean hasOriginal()
Description copied from interface: UIObject
Determines whether the object has an original in the base domain.

Specified by:
hasOriginal in interface UIEditableObject
Specified by:
hasOriginal in interface UIObject

saveToDomain

public void saveToDomain()
Saves this object into a suitable baseObject. Does not add the base object to the domain.

Specified by:
saveToDomain in interface UIObject

saveToDomain

public void saveToDomain(java.lang.Object domainObject)
Description copied from interface: UIObject
Saves the contents of this object into the given object.

Specified by:
saveToDomain in interface UIObject

addToDomain

public void addToDomain()

addToDomain

public void addToDomain(Domain domain)
Description copied from interface: UIObject
Adds the contents of this UIObject to the domain (part of publish).

Specified by:
addToDomain in interface UIObject

updateInDomain

public void updateInDomain(Domain domain)
                    throws DomainReferenceException
Description copied from interface: UIObject
Updates the base object in the domain with the contents of this object.

Specified by:
updateInDomain in interface UIObject
Throws:
DomainReferenceException

loadFromDomain

public void loadFromDomain()
Loads this object from its baseObject. ***Think about undoing this!!

Specified by:
loadFromDomain in interface UIObject

loadFromDomain

public void loadFromDomain(java.lang.Object domainObject)
Description copied from interface: UIObject
Loads the contents of this object from the given object. The given object should be of the right class (same as the result of getBaseClass()).

Specified by:
loadFromDomain in interface UIObject

removeFromDomain

public void removeFromDomain()
                      throws DomainReferenceException
Throws:
DomainReferenceException

removeFromDomain

public void removeFromDomain(Domain domain)
                      throws DomainReferenceException
Description copied from interface: UIObject
Removes the object's corresponding base object from the domain.

Specified by:
removeFromDomain in interface UIObject
Throws:
DomainReferenceException

getOriginal

public IXObject getOriginal()
Description copied from interface: UIObject
Gets the object that corresponds to this one in the original domain.

Specified by:
getOriginal in interface UIObject

loadFromOriginal

public void loadFromOriginal()
Description copied from interface: UIObject
Loads the contents of this object from its original domain object.

Specified by:
loadFromOriginal in interface UIObject

noteChange

public void noteChange()
Get the UIDomain to note the change of this object

Specified by:
noteChange in interface UIObject

hasChanged

public boolean hasChanged()
Description copied from interface: UIObject
Determines whether the object has changed since it was last saved to draft

Specified by:
hasChanged in interface UIEditableObject
Specified by:
hasChanged in interface UIObject

hasChanged

public boolean hasChanged(ObjectClass original)

hasChangedFromOriginal

public boolean hasChangedFromOriginal()
Description copied from interface: UIObject
Determines whether the object has changed from its original.

Specified by:
hasChangedFromOriginal in interface UIEditableObject
Specified by:
hasChangedFromOriginal in interface UIObject

collectChanges

public java.util.List collectChanges()
Collects the differences between this object and the base one.

Specified by:
collectChanges in interface UIObject
Returns:
a list of strings describing changes

collectChangesFromOriginal

public java.util.List collectChangesFromOriginal()
Collects the differences between this object and the base one.

Specified by:
collectChangesFromOriginal in interface UIObject
Returns:
a list of strings describing changes

collectChanges

public java.util.List collectChanges(ObjectClass original)
Collects the differences between this object and the given one.

Returns:
a list of strings describing changes

collectChanges

public java.util.List collectChanges(ObjectClass original,
                                     java.lang.String which)

nameHasChanged

public boolean nameHasChanged(java.lang.Object nameThing)
Description copied from interface: UIObject
Determines whether the object's identifying fields have changed

Specified by:
nameHasChanged in interface UIObject

toString

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

superString

public java.lang.String superString()

print

public java.lang.String print()
Specified by:
print in interface UIObject

children

public java.util.Enumeration children()
Specified by:
children in interface javax.swing.tree.TreeNode

getChildren

public java.util.List getChildren()
Specified by:
getChildren in interface IXNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

getChildAt

public javax.swing.tree.TreeNode getChildAt(int index)
Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Specified by:
getIndex in interface javax.swing.tree.TreeNode

getParent

public javax.swing.tree.TreeNode getParent()
Specified by:
getParent in interface javax.swing.tree.TreeNode

getParents

public java.util.List getParents()
Specified by:
getParents in interface IXNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode

checkLegalParent

public boolean checkLegalParent(UIObjectClass otherNode)

reportLegalParent

public java.lang.String reportLegalParent(UIObjectClass otherNode)

reportLegalChild

public java.lang.String reportLegalChild(UIObjectClass otherNode)

isParentOf

public boolean isParentOf(UIObjectClass otherNode)

isNodeAncestor

public boolean isNodeAncestor(javax.swing.tree.TreeNode otherNode)
Returns true if the node is this node, or if it is a parent of this node, or if it is an ancestor of one of the parents.


addDataChangeListener

public void addDataChangeListener(DataChangeListener l)
Specified by:
addDataChangeListener in interface EditableObject

removeDataChangeListener

public void removeDataChangeListener(DataChangeListener l)
Specified by:
removeDataChangeListener in interface EditableObject