uk.ac.kcl.cch.jb.pliny.containmentView.model
Class ContainmentItem

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

public class ContainmentItem
extends PropertyChangeObject
implements PropertyChangeListener

this model class for the ContainmentView corresponds to the boxes in the graph that, in turn, correspond to the Resources that are connected to the main resource the display is centered around. All containmentItems are owned by a ContainmentSet which manages the set of items that are displayed by the Containment View that spread out from the central starting Resource.

A ContainmentItem also manages its Links to other ContainmentItems that present the containment information.

Author:
John Bradley
See Also:
ContainmentView

Constructor Summary
ContainmentItem(Resource myResource, ContainmentSet containmentSet, IncludedTypeManager typeManager)
          constructs an instance of a ContainmentItem for myResource, which is an item which needs to appear within the current containmentSet.
 
Method Summary
 void buildChildList()
          invoked to generate the current list of child items for this current item.
 void buildLinks()
          convenience method to build both child and parent items
 void buildParentList()
          invoked to generate the current list of parent items for this current item.
 void dispose()
           
 Set getFromSet()
          returns a list of ContainmentLink items that link from some other ContainmentItem to this one.
 Resource getResource()
           
 boolean getShowingAllChildren()
          reports where this Item is currently also displaying its Child items and links to them.
 boolean getShowingAllParents()
          reports where this Item is currently also displaying its Parent items and links to them.
 Set getToSet()
          returns a list of ContainmentLink items that link from this item to some other ContainmentItems.
 String printSets()
           
 void propertyChange(PropertyChangeEvent arg0)
          this object monitors changes in its Resource, and when one happens of interest to it deals with it.
 String toString()
           
 
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, wait, wait, wait
 

Constructor Detail

ContainmentItem

public ContainmentItem(Resource myResource,
                       ContainmentSet containmentSet,
                       IncludedTypeManager typeManager)
constructs an instance of a ContainmentItem for myResource, which is an item which needs to appear within the current containmentSet.

Parameters:
myResource - Resource which corresponds to this Item.
containmentSet - holder for this item.
typeManager - the current IncludedTypeManager
Method Detail

dispose

public void dispose()

getShowingAllParents

public boolean getShowingAllParents()
reports where this Item is currently also displaying its Parent items and links to them.

Returns:
true if showing parent items.

getShowingAllChildren

public boolean getShowingAllChildren()
reports where this Item is currently also displaying its Child items and links to them.

Returns:
true if showing child items.

buildChildList

public void buildChildList()
invoked to generate the current list of child items for this current item.


buildParentList

public void buildParentList()
invoked to generate the current list of parent items for this current item.


buildLinks

public void buildLinks()
convenience method to build both child and parent items


getResource

public Resource getResource()

getFromSet

public Set getFromSet()
returns a list of ContainmentLink items that link from some other ContainmentItem to this one.

Returns:
Set containing link items from other Items to this one.

getToSet

public Set getToSet()
returns a list of ContainmentLink items that link from this item to some other ContainmentItems.

Returns:
Set containing link items from this item to other Items.

printSets

public String printSets()

propertyChange

public void propertyChange(PropertyChangeEvent arg0)
this object monitors changes in its Resource, and when one happens of interest to it deals with it. The code here tracks the Resource's name, but also tracks changes in LinkableObjects that are added either with this item's Resource as the surrogate, or are displayed within its reference/annotation area, and adds or removes corresponding parent or child ContainmentItems and their links.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
arg0 - for the Resource it is linked to.

toString

public String toString()