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

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

public class ContainmentLink
extends PropertyChangeObject
implements PropertyChangeListener

this model class for the ContainmentView represents a link between two ContainmentItems. Note that a single link is created when there is one or more Pliny model Links between the same two resources. If at least link goes in each direction, then there is still only one ContainmentLink created, but it has recorded that there are Links between the Resources it connects in both directions.

This class implements PropertyChangeObject, and so can so can be listened to. It raises the following events:

Author:
John Bradley
See Also:
ContainmentSet, ContainmentItem, ContainmentLinkEnd

Field Summary
static String BOTHWAY_EVENT
           
static String COLOUR_EVENT
           
static String ENDCHANGE_EVENT
           
 
Constructor Summary
ContainmentLink(ContainmentItem from, ContainmentItem to, ContainmentSet containmentSet)
          constructs this object for a given pair of ContainmentItems that belong in the given ContainmentSet.
 
Method Summary
 void dispose()
           
 boolean getBothWay()
           
 ContainmentItem getFrom()
           
 org.eclipse.swt.graphics.Color getSourceColour()
           
 ContainmentLinkEnd getSourceEnd()
           
 org.eclipse.swt.graphics.Color getTargetColour()
           
 ContainmentLinkEnd getTargetEnd()
           
 ContainmentItem getTo()
           
 void propertyChange(PropertyChangeEvent arg0)
          this class tracks changes in the ContainmentLinkEnd items, and responds to changes in them through this method.
 void removeLinkableObject(LinkableObject obj)
           
 void setBothWay(boolean val)
           
 void setLinkableObject(LinkableObject obj)
           
 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
 

Field Detail

BOTHWAY_EVENT

public static final String BOTHWAY_EVENT
See Also:
Constant Field Values

COLOUR_EVENT

public static final String COLOUR_EVENT
See Also:
Constant Field Values

ENDCHANGE_EVENT

public static final String ENDCHANGE_EVENT
See Also:
Constant Field Values
Constructor Detail

ContainmentLink

public ContainmentLink(ContainmentItem from,
                       ContainmentItem to,
                       ContainmentSet containmentSet)
constructs this object for a given pair of ContainmentItems that belong in the given ContainmentSet.

Parameters:
from - ContainmentItem source end of the link
to - ContainmentItem target end of the link
containmentSet - ContainmentSet set owner.
Method Detail

getSourceColour

public org.eclipse.swt.graphics.Color getSourceColour()

getSourceEnd

public ContainmentLinkEnd getSourceEnd()

getTargetEnd

public ContainmentLinkEnd getTargetEnd()

getTargetColour

public org.eclipse.swt.graphics.Color getTargetColour()

setLinkableObject

public void setLinkableObject(LinkableObject obj)

removeLinkableObject

public void removeLinkableObject(LinkableObject obj)

dispose

public void dispose()

setBothWay

public void setBothWay(boolean val)

getBothWay

public boolean getBothWay()

getFrom

public ContainmentItem getFrom()

getTo

public ContainmentItem getTo()

propertyChange

public void propertyChange(PropertyChangeEvent arg0)
this class tracks changes in the ContainmentLinkEnd items, and responds to changes in them through this method.

Specified by:
propertyChange in interface PropertyChangeListener

toString

public String toString()