Package net.ontopia.topicmaps.viz
Class TopicMapView
java.lang.Object
net.ontopia.topicmaps.viz.TopicMapView
INTERNAL: Maintains the TouchGraph view of the topic map.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classINTERNAL: PRIVATE: Purpose: Output debug information -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected VizTopicMapConfigurationManagerprotected VizControllerprotected TopicIFprotected TopicMapView.Debugstatic intprotected Listprotected MotionKillerprotected ArrayListstatic intprotected Collectionprotected ArrayListprotected ArrayListprotected VizigatorUser -
Constructor Summary
ConstructorsConstructorDescriptionTopicMapView(VizController controller, TopicMapIF topicmap, com.touchgraph.graphlayout.TGPanel tgPanel, VizTopicMapConfigurationManager configman) Creates the view and updates the TGPanel to show the new view. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAssociation(VizTMObjectIF object) voidaddAssociationScopeFilterTopic(TopicIF scopingTopic) protected TMTopicNodeassertNode(TopicIF topic, boolean create) protected voidbuild()Clears the panel and builds a new view.protected voidbuildAll()voidEXPERIMENTAL: method to redraw the map, without starting a new thread or displaying the progress barprotected TMTopicNodebuildTopic(TopicIF topic) voidvoidvoidcreateAssociations(TMAbstractNode abstractNode) Creates all edges for this node, including type -> instance, instance -> type, and ordinary associations.voidcreateAssociations(TMAbstractNode abstractNode, boolean create) voidcreateAssociations(TMAbstractNode abstractNode, boolean create, boolean createEdgesToExistingNodes) Creates all edges for this node, including type -> instance, instance -> type, and ordinary associations.voiddeleteEdge(VizTMObjectIF vizTMObject) voiddeleteEdges(Collection edges) voidvoiddeleteNode(TMAssociationNode node) voiddeleteNode(TMTopicNode node) voidprotected VizTMObjectIFfindObject(Object object, TopicIF type) protected voidfocusNode(TMAbstractNode node) static StringfullName(com.touchgraph.graphlayout.Node node) Returns a collection of all topic types in the topic map.Returns a collection of all topic types in the topic map including null (untyped).Returns a collection of all association types in the topic map.protected TMAssociationEdgegetEdge(AssociationIF association) protected TMRoleEdgegetEdge(AssociationRoleIF role) protected TMClassInstanceAssociationprotected VizController.VizHoverHelpManagerintintintprotected TMAssociationNodegetNode(AssociationIF association) getPagesFor(TopicIF topic) com.touchgraph.graphlayout.TGPanelprotected ListgetTopicNodesFor(TopicIF type) voidheadedDebug(String header, Object object) voidhideNode(TMAbstractNode node) Delete a node, all incident edges and all nodes and edges that no longer have a path to the focus node as a consequence of this.protected voidinitializeAssociation(VizTMAssociationIF anInstance) Initialize those things only associated with Association Objectsprotected voidlenientAddNode(TMAbstractNode node) This method was created as a work-around for bug #1898, which happens when two nodes have the same ID (the second node failing to get added to tgPanel.loadNodesInLocality(TMAbstractNode startNode, boolean create, boolean delete) If create is true, adds all nodes within locality's reach that were not already visible.protected VizTMObjectIFmakeAssociation(AssociationIF assoc, TMTopicNode activePlayer, boolean create) Create an associations, or, in the case of an n-ary association, if the activePlayer is not null, create the associatin node itself and then only the role that active player is involved in.protected TMRoleEdgemakeRole(TMAssociationNode assoc, AssociationRoleIF role, boolean create) protected TMClassInstanceAssociationmakeTypeInstanceEdge(TMTopicNode instance, TMTopicNode type) voidoutputDebugInfo(String operation) performSearch(String searchString) protected voidprocessForegroundQueue(Graphics graphics) protected voidprotected voidvoidremoveAssociationScopeFilterTopic(TopicIF scopingTopic) voidvoidvoidretainNodes(Collection nodes) voidretainObjects(Collection nodes) voidsetAllNodesFixed(boolean fixed) Sets all nodes to fixed (sticky) or not fixed.voidsetAssociationScopeFilterStrictness(int strictness) Set the current level of strictness of the association scope filter and remove/add edges where needed.voidsetAssociationTypeLineWeight(TopicIF type, int lineWeight) voidsetAssociationTypeShape(TopicIF type, int shape) voidsetAssociationTypeVisible(TopicIF type, boolean visible) NOTE: The calling method is responsible for calling the method: updateAssociationCountForAllTopics();voidsetConfigManager(VizTopicMapConfigurationManager configman) Called when a new configuration has been loaded.protected voidsetFocusNodeOf(TMObjectIF tmObject) Find the node of the given TMObjectIF.protected voidsetHighlightNode(TMAbstractNode node, Graphics g) voidsetLocality(int newLocality) Set the locality to a given value and adds/removes nodes where appropriate.voidsetMaxTopicNameLength(int length) voidsetMotionKillerEnabled(boolean enabled) voidsetPanelBackgroundColour(Color aColor) voidsetScopingTopic(TopicIF aScope) voidsetTopicTypeExcluded(TopicIF aType, boolean excluded) voidsetTopicTypeShape(TopicIF type, int shape) voidsetTopicTypeShapePadding(TopicIF type, int value) voidsetTopicTypeVisible(TopicIF type, boolean visible) NOTE!voidsetTypeColor(TopicIF type, Color c) voidsetTypeFont(TopicIF type, Font font) voidsetTypeIcon(TopicIF type, Icon icon) voidshouldDisplayRoleHoverHelp(boolean newValue) voidshouldDisplayScopedAssociationNames(boolean newValue) voidvoidvoidvoidvoidvoidupdateType(TopicIF type) boolean
-
Field Details
-
configman
-
controller
-
newNodes
-
objectTypeIndex
-
objectsByType
-
currentScopingTopic
-
debug
-
nodesUpdateCount
-
stat
-
stat1
-
motionKiller
-
vizigatorUser
-
foregroundQueue
-
NODE_LOCALITY
public static int NODE_LOCALITY -
EDGE_LOCALITY
public static int EDGE_LOCALITY
-
-
Constructor Details
-
TopicMapView
public TopicMapView(VizController controller, TopicMapIF topicmap, com.touchgraph.graphlayout.TGPanel tgPanel, VizTopicMapConfigurationManager configman) Creates the view and updates the TGPanel to show the new view. The TGPanel may be showing an old view.
-
-
Method Details
-
updateDisplay
public void updateDisplay() -
updateDisplayLazily
public void updateDisplayLazily() -
updateDisplayNoWork
public void updateDisplayNoWork() -
resetDamper
public void resetDamper() -
retainNodes
-
retainObjects
-
setLocality
public void setLocality(int newLocality) Set the locality to a given value and adds/removes nodes where appropriate. After a locality increase, all nodes and edges within locality's reach in addition to all nodes and edges that were there before will be visible. After a locality decrease, all nodes and edges that were visible before and that are still within locality's reach will be visible.- Parameters:
newLocality- The new locality.
-
loadNodesInLocality
If create is true, adds all nodes within locality's reach that were not already visible. Then (independent of 'create') collects all edges just beyond locality's reach and returns them. An edge with both end-points within locality's reach is counted as within locality's reach.. ALTERNATIVE EDGE ALGORITHM: An edge is within locality's reach if one end-point is attached to a node at least one step closer than locality's reach.- Parameters:
startNode- The node to start from.create- Whether to create new nodes and edges.- Returns:
- edges beyond locality's reach.
-
setTypeFont
-
setTopicTypeShape
-
setTypeColor
-
setTopicTypeShapePadding
-
setTypeIcon
-
updateType
-
getTopicNodesFor
-
setAssociationTypeShape
-
setAssociationTypeLineWeight
-
focusNode
-
clearFocusNode
public void clearFocusNode() -
setConfigManager
Called when a new configuration has been loaded. Switches the view over to the new configuration. -
hideNode
Delete a node, all incident edges and all nodes and edges that no longer have a path to the focus node as a consequence of this.- Parameters:
node- The base node to delete.
-
fullName
-
headedDebug
-
setTopicTypeVisible
NOTE! The calling mehtod is itself responsible for calling the method: updateAssociationCountForAllTopics(). -
setAssociationTypeVisible
NOTE: The calling method is responsible for calling the method: updateAssociationCountForAllTopics();- Parameters:
type- The type to set (in)visible.visible- true if 'type' should be set visible. Otherwise false.
-
setAssociationScopeFilterStrictness
public void setAssociationScopeFilterStrictness(int strictness) Set the current level of strictness of the association scope filter and remove/add edges where needed.- Parameters:
strictness- The new level of strictness
-
removeAssociationScopeFilterTopic
-
addAssociationScopeFilterTopic
-
updateAssociationCountForAllTopics
public void updateAssociationCountForAllTopics() -
updateAssociationCountForMarkedTopics
public void updateAssociationCountForMarkedTopics() -
getTopicMap
-
getPagesFor
-
getAssociationTypes
Returns a collection of all association types in the topic map. Does not work with remote topic maps. -
getAllTopicTypesWithNull
Returns a collection of all topic types in the topic map including null (untyped). Does not work with remote topic maps. -
getAllTopicTypes
Returns a collection of all topic types in the topic map. Does not work with remote topic maps. -
build
protected void build()Clears the panel and builds a new view. Assumes there is no existing graph. -
buildTopic
-
buildAllSilent
public void buildAllSilent()EXPERIMENTAL: method to redraw the map, without starting a new thread or displaying the progress bar -
buildAll
protected void buildAll() -
assertNode
-
queueInForeground
-
queueInForeground
-
setHighlightNode
-
processForegroundQueue
-
findObject
-
makeTypeInstanceEdge
-
makeAssociation
protected VizTMObjectIF makeAssociation(AssociationIF assoc, TMTopicNode activePlayer, boolean create) Create an associations, or, in the case of an n-ary association, if the activePlayer is not null, create the associatin node itself and then only the role that active player is involved in. -
lenientAddNode
This method was created as a work-around for bug #1898, which happens when two nodes have the same ID (the second node failing to get added to tgPanel. I don't know why two nodes sometimes get the same ID, which is important information needed to avoid it, hence this work-around. Adds a systematic suffix and tries to add the node until no exception occurrs.- Parameters:
node- The node that should be added to tgPanel.
-
setFocusNodeOf
Find the node of the given TMObjectIF. If no such node exists, then it should be created. Then set that node to be the focus node, recomputing the graph from this new focus node. Supports TMObjectsIFs instanceof TopicIF or AssociationIF.- Parameters:
tmObject- from which to create the node.
-
makeRole
-
initializeAssociation
Initialize those things only associated with Association Objects- Parameters:
anInstance-
-
addAssociation
-
getHoverHelpManager
-
createAssociations
Creates all edges for this node, including type -> instance, instance -> type, and ordinary associations. -
createAssociations
-
createAssociations
public void createAssociations(TMAbstractNode abstractNode, boolean create, boolean createEdgesToExistingNodes) Creates all edges for this node, including type -> instance, instance -> type, and ordinary associations. If create, then newnodes are created. -
getLocalityAlgorithm
public int getLocalityAlgorithm() -
useNodeLocality
public boolean useNodeLocality() -
deleteEdges
-
deleteEdgeUndoable
-
deleteEdge
-
deleteSingleEdge
-
deleteNode
-
deleteNode
-
getEdge
-
getEdge
-
getEdge
-
getNode
-
shouldDisplayRoleHoverHelp
public void shouldDisplayRoleHoverHelp(boolean newValue) -
setMotionKillerEnabled
public void setMotionKillerEnabled(boolean enabled) -
shouldDisplayScopedAssociationNames
public void shouldDisplayScopedAssociationNames(boolean newValue) -
setPanelBackgroundColour
-
removeDisconnectedNodes
public void removeDisconnectedNodes() -
setTopicTypeExcluded
-
performSearch
-
getLocality
public int getLocality() -
getStartNode
-
getFocusNode
-
getTGPanel
public com.touchgraph.graphlayout.TGPanel getTGPanel() -
outputDebugInfo
-
setScopingTopic
-
clearModel
public void clearModel() -
setAllNodesFixed
public void setAllNodesFixed(boolean fixed) Sets all nodes to fixed (sticky) or not fixed.- Parameters:
fixed- true(/false) if all nodes should get a (un)fixed position.
-
getMaxTopicNameLength
public int getMaxTopicNameLength() -
setMaxTopicNameLength
public void setMaxTopicNameLength(int length)
-