uk.ac.kcl.cch.jb.pliny.model
Class ReferencerList

java.lang.Object
  extended byuk.ac.kcl.cch.rdb2java.dynData.PropertyChangeObject
      extended byuk.ac.kcl.cch.jb.pliny.model.ReferencerList
All Implemented Interfaces:
EventListener, IPropertyChangeObject, PropertyChangeListener

public class ReferencerList
extends PropertyChangeObject
implements PropertyChangeListener

the model class that corresponds to the Pliny referencer for a LinkableObject that can be displayed in a reference/annotation area. It fetches the set of Resources that (through the items they display in their reference/annotation area) contain a reference to the same surrogate Resource that this LinkableObject refers to.

This class tracks changes in the linked set of {link LinkableObjects} for this class so that it will be automatically updated if a new item is added or removed. When this occurs it fires its own event REFLIST_CHANGE to notify listeners (the GEF EditPart that displays the ReferencerList) that it needs to update itself.

The creation and management of this class is handled by the ReferencerManager.

Author:
John Bradley

Field Summary
protected  org.eclipse.draw2d.geometry.Rectangle myBounds
           
protected  LinkableObject myLinkableObject
           
protected  Vector myReferencers
           
protected  Resource myResource
           
static String REFBOUNDS_CHANGE
           
static String REFLIST_CHANGE
           
 
Constructor Summary
ReferencerList()
          creates an empty instance of this class -- containing no data.
ReferencerList(LinkableObject myLinkableObject)
          creates an instance of this class linked to a given LinkableObject (Reference Object).
 
Method Summary
 void dispose()
           
 Vector getList()
          returns the list of Resource objects that also refer to the surrogate for this object's LinkableObject.
 org.eclipse.draw2d.geometry.Rectangle getMyBounds()
           
 Resource getMyResource()
           
 void propertyChange(PropertyChangeEvent arg0)
           
 void setMyBounds(org.eclipse.draw2d.geometry.Rectangle r)
          controls the position of the referencer in the 2D reference/anotation space.
 void setMySize(org.eclipse.draw2d.geometry.Dimension d)
          controls the size of the referencer display in the 2D reference/anotation space.
 
Methods inherited from class uk.ac.kcl.cch.rdb2java.dynData.PropertyChangeObject
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REFLIST_CHANGE

public static final String REFLIST_CHANGE
See Also:
Constant Field Values

REFBOUNDS_CHANGE

public static final String REFBOUNDS_CHANGE
See Also:
Constant Field Values

myResource

protected Resource myResource

myLinkableObject

protected LinkableObject myLinkableObject

myReferencers

protected Vector myReferencers

myBounds

protected org.eclipse.draw2d.geometry.Rectangle myBounds
Constructor Detail

ReferencerList

public ReferencerList()
creates an empty instance of this class -- containing no data.


ReferencerList

public ReferencerList(LinkableObject myLinkableObject)
creates an instance of this class linked to a given LinkableObject (Reference Object).

Parameters:
myLinkableObject -
Method Detail

getMyBounds

public org.eclipse.draw2d.geometry.Rectangle getMyBounds()

setMyBounds

public void setMyBounds(org.eclipse.draw2d.geometry.Rectangle r)
controls the position of the referencer in the 2D reference/anotation space.

Parameters:
r - the position as bounds.

setMySize

public void setMySize(org.eclipse.draw2d.geometry.Dimension d)
controls the size of the referencer display in the 2D reference/anotation space.

Parameters:
d - the position as bounds.

getMyResource

public Resource getMyResource()

dispose

public void dispose()

getList

public Vector getList()
returns the list of Resource objects that also refer to the surrogate for this object's LinkableObject.

Returns:
Vector containing Resource items.

propertyChange

public void propertyChange(PropertyChangeEvent arg0)
Specified by:
propertyChange in interface PropertyChangeListener