|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.kcl.cch.rdb2java.dynData.PropertyChangeObject uk.ac.kcl.cch.jb.pliny.containmentView.model.ContainmentSet
this model class for the ContainmentView represents the top level
object for the a view page. Each view page is centered on a
single Resource
,
so this object contains that starting Resource
and manages the ContainmentItem
s and ContainmentLink
s
that it needs to generate the display.
This class implements PropertyChangeObject
,
and so can so can be listened to. It raises an event ITEMSCHANGED_EVENT
each time an ContainmentItem is added or removed from the set.
The UI part of the the ContainmentView subscribes to this service
to that it can update itself at the time the user makes a change
to the underlying data.
ContainmentItem
,
ContainmentLink
Field Summary | |
static String |
ITEMSCHANGED_EVENT
|
Constructor Summary | |
ContainmentSet(Resource startingResource,
IncludedTypeManager typeManager)
this constructor creates an instance of this object that is meant to be centered on the startingResource . |
Method Summary | |
void |
addUndisplayedLinkableObject(LinkableObject lo)
|
void |
dispose()
|
void |
excludeType(LOType theType)
convenience method to ask the IncludedTypeManager to exclude links of
the given type. |
void |
extendItems(Vector items,
boolean showParents,
boolean showChildren)
extends the ContainmentItems in items by adding
either their parents or children or both to the set. |
Map |
getExpandedResources()
|
ContainmentItem |
getItem(Resource r)
returns a ContainmentItem that corresponds to the given Resource. |
ContainmentLink |
getLink(ContainmentItem from,
ContainmentItem to)
|
Vector |
getMyItems()
returns the ContainmentItems that this set is currently holding. |
boolean |
hasLink(Resource from,
Resource to)
|
void |
includeType(LOType theType)
convenience method to ask the IncludedTypeManager to include links of
the given type. |
boolean |
isChildExpanded(Resource r)
|
boolean |
isIncluded(LOType theType)
convenience method to ask the IncludedTypeManager to ask if the given type
is currently to be included or not. |
boolean |
isParentExpanded(Resource r)
|
void |
propertyChange(PropertyChangeEvent arg0)
|
void |
recordChildExpand(Resource r)
|
void |
recordParentExpand(Resource r)
|
void |
refresh()
completely regenerates the model for the existing Resource. |
void |
removeItem(ContainmentItem theItem)
|
void |
removeLink(ContainmentLink theLink)
|
void |
updateResource(Resource newResource)
refocuses this ContainmentSet so that it is centered on a new Resource. |
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 |
public static final String ITEMSCHANGED_EVENT
Constructor Detail |
public ContainmentSet(Resource startingResource, IncludedTypeManager typeManager)
startingResource
.
startingResource
- Resource that this ContainmentSet
refers to -- corresponds to the Resource the current ContainmentView page
is for.typeManager
- Method Detail |
public Vector getMyItems()
public Map getExpandedResources()
public ContainmentItem getItem(Resource r)
ContainmentItem
that corresponds to the given Resource.
If the ContainmentItem does not exist at the time, it is created
and stored so that the same one can be returned the next time the
one for the same resource is requested.
This method is used internally within the ContainmentView's classes, and it is not expected to need to be called by others.
r
- Resource the ContainmentItem is for.
public ContainmentLink getLink(ContainmentItem from, ContainmentItem to)
public boolean hasLink(Resource from, Resource to)
public void removeLink(ContainmentLink theLink)
public void removeItem(ContainmentItem theItem)
public void extendItems(Vector items, boolean showParents, boolean showChildren)
items
by adding
either their parents or children or both to the set.
items
- Vector containing ContainmentItemsshowParents
- boolean if true
, add parent itemsshowChildren
- boolean if true
, add children itemspublic void dispose()
public void propertyChange(PropertyChangeEvent arg0)
propertyChange
in interface PropertyChangeListener
public void updateResource(Resource newResource)
newResource
- Resource to replace old Resource.public void refresh()
Even though most of the data in the ContainmentSet is thrown away the set saves data that indicates whether or not a ContainmentSet for each Resource was expanded by showing its parents/children or not, so that after the refresh the display shows the same amount of child/parent data as it did before.
public void includeType(LOType theType)
IncludedTypeManager
to include links of
the given type.
theType
- LOType type to includepublic void excludeType(LOType theType)
IncludedTypeManager
to exclude links of
the given type.
theType
- LOType type to excludepublic boolean isIncluded(LOType theType)
IncludedTypeManager
to ask if the given type
is currently to be included or not.
theType
- LOType type to exclude
true
is the manager says
data of this type should be included.public void recordParentExpand(Resource r)
public void recordChildExpand(Resource r)
public boolean isParentExpanded(Resource r)
public boolean isChildExpanded(Resource r)
public void addUndisplayedLinkableObject(LinkableObject lo)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |