|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.ceryle.graph.tm.TM4JVisualizerImpl
public class TM4JVisualizerImpl
Generate a visualization of a TopicMap
object (a TM4J-based TopicMap) using a TMLayoutPanel and other
TouchGraph extensions.
Note that this implementation displays TopicMap objects, but does not modify them nor pay attention to how many TopicMaps are currently displayed - this, and any other issues regarding multiple Topic Maps, merging, etc. is left to whatever classes call the visualizer. It has a policy not to modify the visualized TopicMaps.
The visualization process shouldn't in theory make any modifications to the TopicMap, but this needs to be worked out/tested more thoroughly, as it seems that some Topics will get added if they are necessary for visualization and don't exist in the source TopicMap.
Copyright 2001-2007 Murray Altheim. All Rights Reserved.
See LICENSE included with distribution.
| Nested Class Summary | |
|---|---|
protected class |
TM4JVisualizerImpl.DeferredNodeSet
Internal class extends Hashtable as a container for deferred addition of GraphNodes to the graph. |
class |
TM4JVisualizerImpl.DialogHider
|
protected class |
TM4JVisualizerImpl.TMViz
Internal class extends Thread to display a specific TopicMap. |
| Nested classes/interfaces inherited from class javax.swing.JDialog |
|---|
JDialog.AccessibleJDialog |
| Nested classes/interfaces inherited from class java.awt.Dialog |
|---|
Dialog.AccessibleAWTDialog |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected boolean |
hideXTM
A flag that when true suppresses display of Topics having subjects matching any of the XTM 1.0 PSIs. |
protected boolean |
inProgress
When true, indicates that the visualizer is currently loading/visualizing a Topic Map. |
protected boolean |
m_deferred
Indicates TopicMap size is bigger than threshold; that deferred addition will be done. |
protected TM4JVisualizerImpl.DeferredNodeSet |
m_deferredSet
An extension of HashSet used only during deferred addition. |
protected int |
m_deferredThreshold
The number of TopicMapObjects to visualize before using the deferred set method. |
protected Desktop |
m_desktop
|
protected TopicMap |
m_topicmap
The current TopicMap node (org.tm4j.topicmap.TopicMap). |
protected boolean |
m_verbose
|
protected boolean |
m_visible
|
protected int |
m_vizDlogThreshold
The number of TopicMapObjects required before showing the dialog during vizualization. |
protected MessageHandler |
mh
|
static int |
minimumAdic
The minimum number of association members required for Association displayability. |
protected PropertyManager |
pm
|
protected Topic[] |
scope_l10n
The scope of the default Locale. |
protected Topic[] |
scope_template
The scope of the XTM Associations. |
protected boolean |
showFacets
A flag that when true indicates that any facet associations be displayed. |
protected boolean |
showHidden
A flag that when true indicates that any normally-hidden topics be displayed. |
protected Services |
srvs
|
protected TMLayoutPanel |
tmlp
|
protected TopicMapProcessor |
tmproc
|
protected Topic |
topic_hasfacet
The typing Topic of a 'has facet' association. |
protected boolean |
visualizeScopes
Variable controlling if scopes should be displayed, ie., if association scopes should receive an explicit node display. |
protected boolean |
visualizeTemplates
Variable controlling if Association template relationships should be displayed, ie., if <instanceOf> within an Association should receive an explicit node display. |
| Fields inherited from class javax.swing.JDialog |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
TM4JVisualizerImpl(TMLayoutPanel topicMapLayoutPanel,
boolean visible)
Constructor provided the TMLayoutPanel to contain the visualization. |
|
| Method Summary | |
|---|---|
protected boolean |
dialogWarranted(TopicMap topicmap)
Returns true if the TopicMap is large enough and has enough visualizable nodes to warrant the dialog be shown. |
protected void |
displayScope(Topic[] scope,
ANode anode,
Set tnodes)
|
Set |
getAssociationRegistry()
Returns the Association signature registry as a Set, to be used when re-visualizing associations. |
int |
getEdgeDirection(Member member)
Returns an edge direction provided an Association member, by checking its role Topic. |
boolean |
inProgress()
Returns true if a visualization is currently being processed/in progress. |
protected ANode |
instanceOf(Association assoc,
TNode classNode,
ANode instanceNode)
Links the TNode classNode to the ANode instanceNode, creating a new class-instance ANode (based on the Association assoc) as an "association template". |
protected ANode |
instanceOf(Association assoc,
TNode classNode,
TNode instanceNode)
Links the TNode classNode to the TNode instanceNode, creating a new class-instance ANode (based on the Association assoc). |
Object |
instanceOf(Association assoc,
Topic classTopic,
Topic instanceTopic)
Links the Topic classTopic to the Topic instanceTopic, creating a new class-instance ANode (based on the Association assoc). |
boolean |
isDisplayable(Association assoc)
Returns true if the Association should be displayed. |
boolean |
isDisplayable(Topic topic)
Returns true if the Topic should be displayed. |
Object |
onAssociation(Association assoc)
Indicates the start of an Association. |
boolean |
onBaseName(Topic topic,
BaseName basename)
Indicates the start of a BaseName. |
boolean |
onMember(Association assoc,
Member member)
Indicates the start of a Member. |
boolean |
onOccurrence(Topic topic,
Occurrence occur)
Currently, occurrences are not visualized. |
void |
onParameter(Topic param)
Indicates the start of a Variant Parameter. |
Object |
onRole(Association assoc,
Topic player,
Topic role)
Visualize the Topic role for the provided Topic player in the Association assoc. |
Set |
onScope(Topic[] scope)
Indicates the start of a Scope. |
void |
onSubject(Topic topic,
Locator subject)
|
void |
onSubjectIndicator(Topic topic,
Locator subjectIndicator)
|
Object |
onTheme(Topic theme)
Indicates the start of a Theme (Topic used in a Scope). |
Object |
onTopic(Topic topic)
Indicates the start of a Topic, returning the TNode created. |
boolean |
onTopicMap(TopicMap topicmap)
Called at the beginning of the processing cycle to initialize various member variables. |
boolean |
onVariant(BaseName basename,
Variant variant)
Indicates the start of a Variant. |
void |
onVariantName(Variant variant,
VariantName varName)
Indicates the start of a Variant Name. |
void |
postProcess(TopicMap topicmap)
Does any post-visualization processes, like selecting a default node. |
boolean |
registerAssociation(Association assoc)
Returns true if successful in registering the provided Association, false if it was already contained in the registry. |
void |
reset()
Resets the visualizer so that it has no record of past visualizations. |
protected ANode |
returnANodeForAssociation(Association assoc)
Creates a new or returns an existing ANode given Association assoc, based on its ID. |
protected TNode |
returnTNodeForTopic(Topic topic,
boolean merge)
Creates a new or returns an existing TNode for Topic topic, based on its ID. |
void |
setEnglishLocale(TopicMap topicmap)
Sets the default locale for display names to English. |
void |
setTMLayoutPanel(TMLayoutPanel tmlpanel)
Set the TMLayoutPanel for this TopicMapVisualizer. |
protected ANode |
subclassOf(Association assoc,
TNode superclass,
TNode subclass)
Links the TNode superclass to the TNode subclass, creating a new superclass-subclass ANode (association). |
Object |
subclassOf(Association assoc,
Topic superclassTopic,
Topic subclassTopic)
Links the Topic superclassTopic to the Topic subclassTopic, creating a new superclass-subclass ANode (based on the Association assoc). |
void |
updateAssociation(Association assoc)
Update an already visualized ANode and its edge directions based on the current Association assoc, if available. |
void |
visualize(TopicMap topicmap,
boolean merge)
Displays the TopicMap topicmap as a graph. |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean visualizeTemplates
protected boolean visualizeScopes
protected boolean showHidden
protected boolean showFacets
public static int minimumAdic
protected boolean hideXTM
protected boolean inProgress
protected TopicMap m_topicmap
protected Topic[] scope_template
protected Topic[] scope_l10n
protected Topic topic_hasfacet
protected boolean m_deferred
protected TM4JVisualizerImpl.DeferredNodeSet m_deferredSet
protected int m_deferredThreshold
protected int m_vizDlogThreshold
protected TMLayoutPanel tmlp
protected TopicMapProcessor tmproc
protected Desktop m_desktop
protected Services srvs
protected MessageHandler mh
protected PropertyManager pm
protected boolean m_visible
protected boolean m_verbose
| Constructor Detail |
|---|
public TM4JVisualizerImpl(TMLayoutPanel topicMapLayoutPanel,
boolean visible)
throws VisualizationException
VisualizationException| Method Detail |
|---|
public void setTMLayoutPanel(TMLayoutPanel tmlpanel)
public void setEnglishLocale(TopicMap topicmap)
throws TopicMapException
TopicMapExceptionpublic void reset()
reset in interface TopicMapVisualizer
public void visualize(TopicMap topicmap,
boolean merge)
throws VisualizationException
visualize in interface TopicMapVisualizerVisualizationExceptionprotected boolean dialogWarranted(TopicMap topicmap)
( topic_count + ( assoc_count / 2 ) ) > T
public void postProcess(TopicMap topicmap)
postProcess in interface TopicMapVisualizerpublic boolean inProgress()
inProgress in interface TopicMapVisualizer
public boolean onTopicMap(TopicMap topicmap)
throws VisualizationException
onTopicMap in interface TopicMapVisualizerVisualizationException
public Object onTopic(Topic topic)
throws VisualizationException
onTopic in interface TopicMapVisualizerVisualizationException
public void onSubject(Topic topic,
Locator subject)
throws VisualizationException
VisualizationException
public void onSubjectIndicator(Topic topic,
Locator subjectIndicator)
throws VisualizationException
VisualizationException
public Set onScope(Topic[] scope)
throws VisualizationException
TopicMapVisualizer
onScope in interface TopicMapVisualizerVisualizationException
public Object onTheme(Topic theme)
throws VisualizationException
TopicMapVisualizer
onTheme in interface TopicMapVisualizerVisualizationException
public boolean onBaseName(Topic topic,
BaseName basename)
throws VisualizationException
TopicMapVisualizer
onBaseName in interface TopicMapVis