edu.washington.cs.supple.customization
Class UiObjectInvocationHandler

java.lang.Object
  extended byedu.washington.cs.supple.rep.SuppleBeanImpl
      extended byedu.washington.cs.supple.rep.SuppleUiObjectHierarchyElementImpl
          extended byedu.washington.cs.supple.customization.UiObjectInvocationHandler
All Implemented Interfaces:
ConstraintManipulation, java.lang.reflect.InvocationHandler, java.io.Serializable, SuppleBean, SuppleUiObjectHierarchyElement

public class UiObjectInvocationHandler
extends SuppleUiObjectHierarchyElementImpl
implements java.lang.reflect.InvocationHandler, ConstraintManipulation

The invocation handler is used to copy UiObjects. It allows the creation of a new pseudo-UIObject, which has its own unique id and its own location within the object hierarchy. However, it's functionality and behavior is identical to the original UIObject. Moreover, changes in one UIObject are visible in the other.

Author:
raphaelh
See Also:
Serialized Form

Field Summary
protected  java.util.Vector constraints
           
protected  java.util.Vector hints
           
protected  java.lang.String name
           
protected  UiObject object
           
protected  SuppleType type
           
protected  int uniqueId
           
 
Fields inherited from class edu.washington.cs.supple.rep.SuppleUiObjectHierarchyElementImpl
parent
 
Fields inherited from class edu.washington.cs.supple.rep.SuppleBeanImpl
pcs
 
Constructor Summary
UiObjectInvocationHandler(UiObject object, SuppleType type)
          Creates a new invocation handler, that references another UIObject.
 
Method Summary
 void addRenderingConstraint(RenderingConstraint constr)
           
 void addRenderingHint(RenderingHint hint)
           
 boolean equals(java.lang.Object obj)
          This method is absolutely necessary for proxy objects.
 java.lang.String getName()
           
 ContainerType getParent()
          Returns the parent type of this type (i.e.
 UiObject getParentObject()
           
 java.util.Vector getRenderingConstraints()
           
 java.util.Vector getRenderingHints()
           
 UiObject getTarget()
           
 SuppleType getType()
           
 UiObject getUiObject()
           
 int getUniqueId()
          Returns a unique id of this instantiation.
 java.lang.Object invoke(java.lang.Object typeObject, java.lang.reflect.Method method, java.lang.Object[] args)
          The invoke method of this handler is called when a method of the pseudo- UIObject is called.
 boolean isRoot()
          Checks if this type objects is the root of the interface description
 void setParent(ContainerType parent)
          Sets the parent type of this type instance -- you shouldn't need to call this method (it's already automatically called in all the right places)
 void setType(SuppleType type)
           
 void setUiObject(UiObject object)
           
 
Methods inherited from class edu.washington.cs.supple.rep.SuppleUiObjectHierarchyElementImpl
getAncestors, getFullName, getRootObject, isChildOf, isDescendantOf, propertyChange, setName
 
Methods inherited from class edu.washington.cs.supple.rep.SuppleBeanImpl
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

protected UiObject object

type

protected SuppleType type

hints

protected java.util.Vector hints

constraints

protected java.util.Vector constraints

name

protected java.lang.String name

uniqueId

protected int uniqueId
Constructor Detail

UiObjectInvocationHandler

public UiObjectInvocationHandler(UiObject object,
                                 SuppleType type)
Creates a new invocation handler, that references another UIObject.

Parameters:
object -
type -
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object typeObject,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
The invoke method of this handler is called when a method of the pseudo- UIObject is called. Inside invoke the call is forwarded to the actual method implementation, which could be user-defined (in this class) or which could be an existing implementation of the original UIObject.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable
See Also:
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])

getName

public java.lang.String getName()
Specified by:
getName in interface SuppleUiObjectHierarchyElement
Overrides:
getName in class SuppleUiObjectHierarchyElementImpl
Returns:
a unique name used to distinguish among different children of the parent type; if the name is not set and there is no parent, string "root" is returned

getUiObject

public UiObject getUiObject()

setUiObject

public void setUiObject(UiObject object)

setType

public void setType(SuppleType type)

getType

public SuppleType getType()

getParent

public ContainerType getParent()
Description copied from interface: SuppleUiObjectHierarchyElement
Returns the parent type of this type (i.e. the container type that contains this one)

Specified by:
getParent in interface SuppleUiObjectHierarchyElement
Overrides:
getParent in class SuppleUiObjectHierarchyElementImpl

setParent

public void setParent(ContainerType parent)
Description copied from interface: SuppleUiObjectHierarchyElement
Sets the parent type of this type instance -- you shouldn't need to call this method (it's already automatically called in all the right places)

Specified by:
setParent in interface SuppleUiObjectHierarchyElement
Overrides:
setParent in class SuppleUiObjectHierarchyElementImpl

isRoot

public boolean isRoot()
Description copied from interface: SuppleUiObjectHierarchyElement
Checks if this type objects is the root of the interface description

Specified by:
isRoot in interface SuppleUiObjectHierarchyElement
Overrides:
isRoot in class SuppleUiObjectHierarchyElementImpl

getParentObject

public UiObject getParentObject()
Specified by:
getParentObject in interface SuppleUiObjectHierarchyElement
Overrides:
getParentObject in class SuppleUiObjectHierarchyElementImpl

getTarget

public UiObject getTarget()

addRenderingHint

public void addRenderingHint(RenderingHint hint)
Specified by:
addRenderingHint in interface ConstraintManipulation

getRenderingHints

public java.util.Vector getRenderingHints()
Specified by:
getRenderingHints in interface ConstraintManipulation

addRenderingConstraint

public void addRenderingConstraint(RenderingConstraint constr)
Specified by:
addRenderingConstraint in interface ConstraintManipulation

getRenderingConstraints

public java.util.Vector getRenderingConstraints()
Specified by:
getRenderingConstraints in interface ConstraintManipulation

getUniqueId

public int getUniqueId()
Returns a unique id of this instantiation.

Returns:
unique id

equals

public boolean equals(java.lang.Object obj)
This method is absolutely necessary for proxy objects. Otherwise proxy objects cannot be used with