uk.ac.kcl.cch.jb.pliny.containmentView.model
Class ContainmentLink
java.lang.Object
uk.ac.kcl.cch.rdb2java.dynData.PropertyChangeObject
uk.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
Link
s 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:
BOTHWAY_EVENT
: when the link is first recognised
as actually working in both directions.
COLOUR_EVENT
: when the end of the link needs to
change colour.
ENDCHANGE_EVENT
: when either end of the object
needs to change.
- Author:
- John Bradley
- See Also:
ContainmentSet
,
ContainmentItem
,
ContainmentLinkEnd
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
ContainmentLink
public ContainmentLink(ContainmentItem from,
ContainmentItem to,
ContainmentSet containmentSet)
- constructs this object for a given pair of
ContainmentItem
s that
belong in the given
ContainmentSet
.
- Parameters:
from
- ContainmentItem source end of the linkto
- ContainmentItem target end of the linkcontainmentSet
- ContainmentSet set owner.
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()