Class TopicMapView


  • public class TopicMapView
    extends Object
    INTERNAL: Maintains the TouchGraph view of the topic map.
    • Constructor Detail

      • 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 Detail

      • updateDisplay

        public void updateDisplay()
      • updateDisplayLazily

        public void updateDisplayLazily()
      • updateDisplayNoWork

        public void updateDisplayNoWork()
      • resetDamper

        public void resetDamper()
      • retainNodes

        public void retainNodes​(Collection nodes)
      • retainObjects

        public void retainObjects​(Collection nodes)
      • 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

        public Collection loadNodesInLocality​(TMAbstractNode startNode,
                                              boolean create,
                                              boolean delete)
        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

        public void setTypeFont​(TopicIF type,
                                Font font)
      • setTopicTypeShape

        public void setTopicTypeShape​(TopicIF type,
                                      int shape)
      • setTypeColor

        public void setTypeColor​(TopicIF type,
                                 Color c)
      • setTopicTypeShapePadding

        public void setTopicTypeShapePadding​(TopicIF type,
                                             int value)
      • setTypeIcon

        public void setTypeIcon​(TopicIF type,
                                Icon icon)
      • updateType

        public void updateType​(TopicIF type)
      • getTopicNodesFor

        protected List getTopicNodesFor​(TopicIF type)
      • setAssociationTypeShape

        public void setAssociationTypeShape​(TopicIF type,
                                            int shape)
      • setAssociationTypeLineWeight

        public void setAssociationTypeLineWeight​(TopicIF type,
                                                 int lineWeight)
      • clearFocusNode

        public void clearFocusNode()
      • setConfigManager

        public void setConfigManager​(VizTopicMapConfigurationManager configman)
        Called when a new configuration has been loaded. Switches the view over to the new configuration.
      • hideNode

        public void hideNode​(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.
        Parameters:
        node - The base node to delete.
      • fullName

        public static String fullName​(com.touchgraph.graphlayout.Node node)
      • headedDebug

        public void headedDebug​(String header,
                                Object object)
      • setTopicTypeVisible

        public void setTopicTypeVisible​(TopicIF type,
                                        boolean visible)
        NOTE! The calling mehtod is itself responsible for calling the method: updateAssociationCountForAllTopics().
      • setAssociationTypeVisible

        public void setAssociationTypeVisible​(TopicIF type,
                                              boolean visible)
        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

        public void removeAssociationScopeFilterTopic​(TopicIF scopingTopic)
      • addAssociationScopeFilterTopic

        public void addAssociationScopeFilterTopic​(TopicIF scopingTopic)
      • updateAssociationCountForAllTopics

        public void updateAssociationCountForAllTopics()
      • updateAssociationCountForMarkedTopics

        public void updateAssociationCountForMarkedTopics()
      • getAssociationTypes

        public Collection getAssociationTypes()
        Returns a collection of all association types in the topic map. Does not work with remote topic maps.
      • getAllTopicTypesWithNull

        public Collection getAllTopicTypesWithNull()
        Returns a collection of all topic types in the topic map including null (untyped). Does not work with remote topic maps.
      • getAllTopicTypes

        public Collection 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.
      • buildAllSilent

        public void buildAllSilent()
        EXPERIMENTAL: method to redraw the map, without starting a new thread or displaying the progress bar
      • buildAll

        protected void buildAll()
      • queueInForeground

        protected void queueInForeground​(TMAbstractNode node)
      • queueInForeground

        protected void queueInForeground​(TMAbstractEdge edge)
      • processForegroundQueue

        protected void processForegroundQueue​(Graphics graphics)
      • 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

        protected void lenientAddNode​(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. 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

        protected void setFocusNodeOf​(TMObjectIF tmObject)
        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.
      • initializeAssociation

        protected void initializeAssociation​(VizTMAssociationIF anInstance)
        Initialize those things only associated with Association Objects
        Parameters:
        anInstance -
      • addAssociation

        protected void addAssociation​(VizTMObjectIF object)
      • createAssociations

        public void createAssociations​(TMAbstractNode abstractNode)
        Creates all edges for this node, including type -> instance, instance -> type, and ordinary associations.
      • createAssociations

        public void createAssociations​(TMAbstractNode abstractNode,
                                       boolean create)
      • 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

        public void deleteEdges​(Collection edges)
      • deleteEdgeUndoable

        public void deleteEdgeUndoable​(VizTMObjectIF edge)
      • deleteEdge

        public void deleteEdge​(VizTMObjectIF vizTMObject)
      • deleteSingleEdge

        public void deleteSingleEdge​(VizTMObjectIF edge)
      • deleteNode

        public void deleteNode​(TMTopicNode node)
      • shouldDisplayRoleHoverHelp

        public void shouldDisplayRoleHoverHelp​(boolean newValue)
      • setMotionKillerEnabled

        public void setMotionKillerEnabled​(boolean enabled)
      • shouldDisplayScopedAssociationNames

        public void shouldDisplayScopedAssociationNames​(boolean newValue)
      • setPanelBackgroundColour

        public void setPanelBackgroundColour​(Color aColor)
      • removeDisconnectedNodes

        public void removeDisconnectedNodes()
      • setTopicTypeExcluded

        public void setTopicTypeExcluded​(TopicIF aType,
                                         boolean excluded)
      • performSearch

        public List performSearch​(String searchString)
      • getLocality

        public int getLocality()
      • getTGPanel

        public com.touchgraph.graphlayout.TGPanel getTGPanel()
      • outputDebugInfo

        public void outputDebugInfo​(String operation)
      • setScopingTopic

        public void setScopingTopic​(TopicIF aScope)
      • 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)