edu.washington.cs.supple.customization.state
Class Specifications

java.lang.Object
  extended byedu.washington.cs.supple.customization.state.Specifications

public class Specifications
extends java.lang.Object

This class maintains a set of functional specifications. For every open dialog window in an application, there exists a functional specification. A functional specification is a tree of UIObjects. This class allows to view all functional specifications as being part of a single big tree of UIObjects, where dialog windows are considered as children of the buttons that have loaded them. The purpose of this view is that it enables a more powerful way of selecting a set of UIObjects by a structural pattern. Structural patterns can be used to generalize customization commands so that they can be automatically applied to similar parts of the UI.

Author:
raphael

Constructor Summary
Specifications()
           
 
Method Summary
 void addSpecification(Specification spec)
          Adds the functional specification of a window (without creator)
 void addSpecification(Specification spec, UiObject creator)
          Adds the functional specification of a window with a reference to its creator.
 java.util.Vector getAncestors(UiObject o)
          Returns a vector of ancestors for this object, root being the first element; if it is root, an empty vector is returned
 UiObject getCommonAncestor(UiObject o1, UiObject o2)
           
 UiObject getCreator(UiObject dynamicObject)
           
 UiObject getParentObject(UiObject o)
           
 UiObject getRoot(UiObject o)
           
 Specification getSpecificationByRoot(UiObject root)
           
 java.util.Collection getSpecifications()
          Return a collection of all specifications.
 java.util.Collection getSpecificationsByCreator(UiObject creator)
          Return a collection of specifications of elements that were created by a certain creator.
 boolean isDynamicObject(UiObject o)
           
 void removeSpecification(Specification spec)
          Remove a functional specification.
 void removeSpecification(UiObject root)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Specifications

public Specifications()
Method Detail

addSpecification

public void addSpecification(Specification spec)
Adds the functional specification of a window (without creator)

Parameters:
spec -

addSpecification

public void addSpecification(Specification spec,
                             UiObject creator)
Adds the functional specification of a window with a reference to its creator.

Parameters:
spec -
creator -

removeSpecification

public void removeSpecification(Specification spec)
Remove a functional specification.

Parameters:
spec -

removeSpecification

public void removeSpecification(UiObject root)

getSpecifications

public java.util.Collection getSpecifications()
Return a collection of all specifications.

Returns:

getSpecificationsByCreator

public java.util.Collection getSpecificationsByCreator(UiObject creator)
Return a collection of specifications of elements that were created by a certain creator.

Parameters:
creator -
Returns:

getSpecificationByRoot

public Specification getSpecificationByRoot(UiObject root)

getCreator

public UiObject getCreator(UiObject dynamicObject)

getParentObject

public UiObject getParentObject(UiObject o)

getRoot

public UiObject getRoot(UiObject o)

isDynamicObject

public boolean isDynamicObject(UiObject o)

getAncestors

public java.util.Vector getAncestors(UiObject o)
Returns a vector of ancestors for this object, root being the first element; if it is root, an empty vector is returned

Returns:
the list of ancestors starting with root

getCommonAncestor

public UiObject getCommonAncestor(UiObject o1,
                                  UiObject o2)