org.ceryle.ui.graph
Class CollectionVisualizer

java.lang.Object
  extended by java.lang.Thread
      extended by org.ceryle.ui.graph.CollectionVisualizer
All Implemented Interfaces:
Runnable

public class CollectionVisualizer
extends Thread

A utility that visualizes one or more XMLDB Collections via a GraphView.

Since:
JDK1.4
Version:
$Id: CollectionVisualizer.java,v 3.19 2007-06-20 01:28:21 altheim Exp $
Author:
Murray Altheim

Nested Class Summary
protected  class CollectionVisualizer.NodeInfo
           
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static boolean scopeNames
          When true, new Component Topics have their labels scoped by the Collection Topic.
static boolean skipTemplates
          When true, document IDs beginning with an underscore are ignored.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CollectionVisualizer(View view, Iterator collections, boolean visualize)
          Constructor for a CollectionVisualizer, with the parent ProjectView or GraphView, an optional Iterator over the Collection IDs (as Strings), and a boolean that when true indicates the resulting TopicMap should be visualized to a new GraphView.
CollectionVisualizer(View view, String cid, boolean visualize)
          Constructor for a CollectionVisualizer, with the parent ProjectView or GraphView, the Collection ID to be visualized, and a boolean that when true indicates the resulting TopicMap should be visualized to a new GraphView.
 
Method Summary
protected  Association collectionOf(Topic col, Topic parent)
          Create a collection-collection relation between a Collection and its parent.
protected  Association documentOf(Topic node, Topic col)
          Create a node-collection relation between a node and its parent Collection.
protected  TopicMap getTopicMap()
          Returns the TopicMap generated by this process, null if unavailable or not finished.
protected  boolean isDone()
          Returns the state of the processing, true when done.
 void run()
          Starts the Thread by calling start().
static Iterator selectCollections()
          Returns an Iterator over the list of Collection IDs, from a dialog box selection.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

skipTemplates

public static boolean skipTemplates
When true, document IDs beginning with an underscore are ignored. The default is false.


scopeNames

public static boolean scopeNames
When true, new Component Topics have their labels scoped by the Collection Topic. The default is false.

Constructor Detail

CollectionVisualizer

public CollectionVisualizer(View view,
                            String cid,
                            boolean visualize)
Constructor for a CollectionVisualizer, with the parent ProjectView or GraphView, the Collection ID to be visualized, and a boolean that when true indicates the resulting TopicMap should be visualized to a new GraphView. If the provided View is null or not an accepted type, a new GraphView will be created. The set of Collection IDs can be provided either at this time or via selectCollections() (the two lists are merged if both are used).

Parameters:
view - the parent ProjectView or GraphView.
cid - the optional list of Collection IDs
visualize - when true, the resulting TopicMap will be visualized in a new GraphView.

CollectionVisualizer

public CollectionVisualizer(View view,
                            Iterator collections,
                            boolean visualize)
Constructor for a CollectionVisualizer, with the parent ProjectView or GraphView, an optional Iterator over the Collection IDs (as Strings), and a boolean that when true indicates the resulting TopicMap should be visualized to a new GraphView. If the provided View is null or not an accepted type, a new GraphView will be created. The set of Collection IDs can be provided either at this time or via selectCollections() (the two lists are merged if both are used).

Parameters:
view - the parent ProjectView or GraphView.
collections - the optional list of Collection IDs
visualize - when true, the resulting TopicMap will be visualized in a new GraphView.
Method Detail

run

public void run()
Starts the Thread by calling start().

Specified by:
run in interface Runnable
Overrides:
run in class Thread

selectCollections

public static Iterator selectCollections()
Returns an Iterator over the list of Collection IDs, from a dialog box selection.

Returns:
an Iterator over the Set of available Collection IDs.

isDone

protected boolean isDone()
Returns the state of the processing, true when done.


getTopicMap

protected TopicMap getTopicMap()
Returns the TopicMap generated by this process, null if unavailable or not finished.


collectionOf

protected Association collectionOf(Topic col,
                                   Topic parent)
                            throws TopicMapException
Create a collection-collection relation between a Collection and its parent.

Throws:
TopicMapException

documentOf

protected Association documentOf(Topic node,
                                 Topic col)
                          throws TopicMapException
Create a node-collection relation between a node and its parent Collection.

Throws:
TopicMapException


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.