org.ceryle.graph.tm
Class TMLayoutPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.ceryle.graph.GraphLayoutPanel
                      extended by org.ceryle.graph.tm.TMLayoutPanel
All Implemented Interfaces:
TGScrollPane, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
EditorLayoutPanel

public class TMLayoutPanel
extends GraphLayoutPanel

TMLayoutPanel extends GraphLayoutPanel in providing methods for visualizing Topic Map-based graphs, as well as display of time lines, subgraphs, and other visualization features. This class is focused on display, whereas a number of associated classes take up other roles, such as TMPanelEditor does most of the grunt work in handling editing actions, coordinating between the underlying Topic Map(s) and the graph visualization.

As with its superclass, once constructed initialize(TMPanel) must be called to establish the graph engine and its GUI support. The IDs used by this panel's objects match the IDs used in the source TopicMap object, hence a query on ID will produce the object desired, e.g., findNode("id34") will return the TNode whose ID is "id34", which contains a Topic whose ID is "id34".

A TMLayoutPanel can display more than one TopicMap object. Because any TopicMap may cause others to be loaded automatically (via its own mergeMap directives), or due to pre-loading (caused by this application's settings), the number of TopicMaps "stored within" the TMLayoutPanel may not match the number of explicit requests.

Since:
JDK1.4
Version:
$Id: TMLayoutPanel.java,v 3.3 2007-06-20 01:28:11 altheim Exp $
Author:
Murray Altheim
See Also:
GraphLayoutPanel, Serialized Form

Nested Class Summary
protected  class TMLayoutPanel.LocalityAdjustmentListener
          A listener for changes to the locality scroll bar.
protected  class TMLayoutPanel.TopicViewer
          Internal class extends Thread to display a dialog box containing information about the selected Topic.
 
Nested classes/interfaces inherited from class org.ceryle.graph.GraphLayoutPanel
GraphLayoutPanel.ButtonListener
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
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
 int anodes
           
protected  JButton btn_closeLeg
           
protected  boolean colorizeByDistance
          When true, sets a mode causing changes of locality to be color highlighted by a range of colors expressing distance from the selected node.
static int defaultOntology
          The default ontology for the open graph dialog.
protected  DirtyEvent dirtyEvent
          Lazily-created dirty event.
 boolean enableMakeConsistent
          Variable controlling if the Topic Map should be made consistent prior to visualizing.
protected  boolean favInTransition
          A boolean indicating that the favorites list is in transition.
protected  FindTopicDialog findTopicDlog
          The dialog box used for find and replace operations.
protected  EventListenerList listenerList
          List of dirty event listeners.
protected  AssociationEditorDialog m_aedlog
          The dialog box used for association editing operations.
protected static boolean m_canEdit
          A boolean indicating that the graph can be edited.
protected  ColorLookupTable m_clut
          The current color lookup table (CLUT).
protected  boolean m_dirty
          Indicates if the document text has been changed.
protected  FrequencyModel m_favorites
           
protected  JComboBox m_favoritesBox
           
protected  Vector m_legend
          Container for legendary color squares.
protected  int m_maxListSize
           
protected  HashSet m_tmSysIDs
          The HashSet containing the explicitly-requested TopicMap system IDs within this TMLayoutPanel.
protected  HashSet m_topicmaps
          The HashSet containing all TopicMap objects displayed in this TMLayoutPanel.
protected  XidTransferHandler m_xidTxferHandler
          The TransferHandler supporting Drag and Drop operations.
 int maps
           
static int MIDDLE_ONTOLOGY
          Static constant indicating a middle base ontology.
static int MINIMAL_ONTOLOGY
          Static constant indicating a minimal base ontology.
static int NO_BASE_ONTOLOGY
          Static constant indicating a (visually) empty base ontology.
 int onodes
           
protected  int ovViewMode
           
 int rnodes
           
 boolean showAssociations
          Variable controlling if associations should be displayed.
 boolean showEdges
          Variable controlling if edges should be displayed.
 boolean showOccurrences
          Variable controlling if topic occurrences should be displayed.
 int snodes
           
protected  TopicEditorDialog tedlog
          The dialog box used for topic editing operations.
protected  TMLayoutPanel tmlp
           
protected  TMPanelEditor tmpedit
          The editor used for topic editing operations.
protected  TopicMapProcessor tmproc
          The TopicMapProcessor used by this TMLayoutPanel.
protected  TopicMapVisualizer tmviz
          The TopicMapVisualizer used to display TopicMaps.
 int tnodes
           
static int UPPER_ONTOLOGY
          Static constant indicating an upper base ontology.
static boolean useDragAndDrop
          Variable controlling whether drag and drop is supported.
 
Fields inherited from class org.ceryle.graph.GraphLayoutPanel
btn_hyper, btn_infinity, btn_locality, btn_rotate, btn_sequence, btn_zoom, DEFAULT_HYPERBOLIC, DEFAULT_LOCALITY, DEFAULT_SEQUENCE, defaultColor, editUI, gp, gPopupMenu, hvScroll, HYPER_SCROLL, hyperSB, hyperScroll, includeEdit, INFINITE_LOCALITY, lastClick, LOCALITY_SCROLL, localitySB, localityScroll, m_desktop, m_graphContainer, m_legendPanel, m_localityEnabled, m_mouseWheelListener, m_selectedSB, m_verbose, m_view, MAXIMUM_LOCALITY, mh, modeSelect, navigateUI, pm, popPanel, ROTATE_SCROLL, rotateSB, rotateScroll, scrollPanel, SEQUENCE_SCROLL, sequenceSB, sequenceScroll, srvs, tgLensSet, tgUIManager, UI_EDIT, UI_NAVIGATE, UI_ROTATEDRAG, zero, ZOOM_SCROLL, zoomSB, zoomScroll
 
Fields inherited from class javax.swing.JComponent
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TMLayoutPanel(View view)
          Constructor provided a reference to the parent View.
TMLayoutPanel(View view, TMPanel tmpanel)
          Constructor provided a reference to the parent View.
TMLayoutPanel(View view, TMPanel tmpanel, FrequencyModel favList)
          Constructor provided a reference to the parent View.
 
Method Summary
 ANode addANode(ANode anode, Point2D.Double p)
          Adds an Association Node (ANode) to the graph.
 ANode addANode(Association assoc, String id, String name)
          Adds an Association Node (ANode) with the ID id and an optional Association assoc and String name.
 ANode addANode(Association assoc, String id, String name, Point2D.Double p)
          Adds an Association Node (ANode) with the ID id and an optional Association assoc and String name.
 void addDirtyListener(DirtyListener listener)
          Add a listener for changes to the dirty state.
 GraphEdge addEdge(GraphNode node1, GraphNode node2, int length, int directed)
          Creates an edge between GraphNode node and node2 with a length of length, and edge direction of int directed (whose values may be GraphEdge.UNDIRECTED, GraphEdge.DIRECTED_TO, GraphEdge.DIRECTED_FROM, or GraphEdge.ARROW_FORWARD).
 void addFavoritesList(FrequencyModel list)
          Called once, adds the favorites list to the left side of the graph radio button bar.
 void addOccurrence(TNode tnode, ONode onode)
          Links a base TNode base to an ONode onode using a directed Edge.
 ONode addONode(ONode onode)
          Adds a Occurrence Node (ONode), provided its ID and (optional) name.
 ONode addONode(String id, String name)
          Adds a Occurrence Node (ONode), provided its ID and (optional) name.
 RNode addRNode(RNode rnode)
          Adds a Role Node (RNode) to the graph.
 void addScope(ANode anode, SNode snode, Collection nodes)
          Links an ANode anode through the SNode snode to a Collection of TNodes nodes using a directed Edge pointing into the association.
 SNode addSNode(SNode snode)
          Adds a Scope Node (SNode), provided its ID and (optional) name.
 SNode addSNode(String id, String name)
          Adds a Scope Node (SNode), provided its ID and (optional) name.
 SubGraph addSubGraph(int style, String id, String label, Set set)
          Links the provided Node node to a new subgraph having an ID id, String label, and optionally containing the Set of GraphNodes set.
 TNode addTNode(TNode tnode, Point2D.Double p)
          Adds a Topic Node (TNode) to the graph.
 TNode addTNode(Topic topic, String name)
          Adds a Topic Node (TNode) with the ID id and an optional name.
 TNode addTNode(Topic topic, String name, Point2D.Double p, boolean fixed)
          Adds a Topic Node (TNode) with the ID id and an optional name.
 void addToFavorites(GraphNode node)
          Adds TMNode node to the favorites list, if it has been initialized.
 boolean addTopicMap(TopicMap topicmap, boolean merge)
          Adds the TopicMap topicmap to this TMLayoutPanel, displaying it via its TopicMapVisualizer, and adding it to the registry of displayed TopicMaps.
protected  void addUIs()
          Extends org.ceryle.graph.GraphNavigateUI to use a TMNavigateUI.
 boolean changeNodeID(String oldId, String newId)
          Changes the ID of a topic having ID oldId to newId, returning true if successful.
 void clear()
          Clears the TMLayoutPanel of any content.
protected  void clearLegend()
          Clears the color legend.
 boolean contains(TypedInputSource source)
          A convenience method that returns true if the graph currently contains a graph whose system identifier (either the base or resource locator) matches the provided parameter.
 void defloat(boolean shifted)
          This extends GraphLayoutPanel's method by first processing all Topics, then passing the method for anything remaining to the superclass.
 boolean deleteNode(GraphNode node, boolean confirm)
          Deletes the GraphNode node, what happens depends on its type.
 boolean deleteSelected(boolean confirm)
          Deletes the selected nodes, depending on the number of type.
protected  void droppedOnBackground(Point p, String uriref)
          Called as a result of a drag 'n drop process, adds the URI reference as an Occurrence of a new Topic, whose display name will be taken from the Occurrence (if available).
protected  void droppedOnNode(TMNode node, String uriref)
          Called as a result of a drag 'n drop process, adds the URI reference as an Occurrence on the underlying Topic of TNode tnode.
 void editAssociation(ANode anode)
          Displays information about the provided ANode (association node) anode.
 void editTopic(TNode tnode)
          Displays information about the provided TNode (topic node) tnode.
 void editTopicMap()
          Displays information about the selected TNode (topic node) or ANode (association node), by opening the respective editor.
 Set find(String s)
          Searches the current graph's node labels for the String s, returning an Iterator over the matching nodes, or null if none are found.
 void findNext()
          Repeats the previous Find operation.
 void findTNodeByLabel(String label)
          Searches the current TMPanel for a TNode having label, selecting it if found.
protected  void fireDirtyStateChanged()
          Notify all listeners that have registered interest for notification on this event type.
 ANode getANodeForAssociation(Association assoc)
          Returns the ANode for the provided Association if it has been visualized, null if not.
 Set getANodes()
          Return the Set of all ANodes in the graph, an empty Set if none are available.
 AssociationEditorDialog getAssociationEditor()
          Returns the AssociationEditorDialog of this GraphView, or null if it has not been created.
 AssociationEditorDialog getAssociationEditor(ANode anode)
          Returns the AssociationEditorDialog associated with this TopicMayLayoutPanel, provided with an optional ANode anode.
 ColorLookupTable getCLUT()
          Returns the current ColorLookupTable (CLUT), null if unavailable.
 boolean getColorizeByDistance()
          Returns the current setting for colorize-by-distance.
 TMPanelEditor getEditor()
          Returns the TMPanelEditor associated with this TMLayoutPanel.
 FrequencyModel getFavoritesList()
          Returns the FrequencyModel backing the 'favorites' list, null if it has not been created.
 FindTopicDialog getFindTopicDialog(boolean simple)
          Returns a lazily-created FindTopicDialog.
 FindTopicPanel getFindTopicPanel()
          Returns the internal FindTopicPanel of the FindTopicDialog, which provides search capability on the graph.
 GraphPanel getGraphPanel()
          Overrides the superclass' method to return a lazily-created TMPanel, which extends GraphPanel.
 Set getRequestedBaseLocators()
          Returns an unmodifiable Set of the base Locators of the explicitly-requested TopicMap objects currently available from this TMLayoutPanel.
 TMPanel getTMPanel()
          Returns a lazily-created TMPanel (the GraphPanel extension) used by this TMLayoutPanel.
 TNode getTNodeByLabel(String label)
          Searches the current TMPanel for a TNode having label, returning it if found.
 TNode getTNodeForTopic(Topic topic)
          Returns the TNode for the provided Topic if it has been visualized, null if not.
 Set getTNodes()
          Return the Set of all TNodes in the graph, an empty Set if none are available.
 TopicEditorDialog getTopicEditor(TNode tnode)
          Returns the TopicEditorDialog associated with this TopicMayLayoutPanel, provided with an optional TMNode node.
 TopicMap getTopicMap()
          Returns the TopicMap object of the first Topic node (TNode) within the current graph.
 Set getTopicMapBaseLocators()
          Returns an unmodifiable Set of the base locators of all TopicMap objects currently available from this TMLayoutPanel.
 TopicMapProcessor getTopicMapProcessor()
          Returns the TopicMapProcessor used by this TMLayoutPanel.
 Set getTopicMaps()
          Returns an unmodifiable Set of the TopicMap objects currently available from this TMLayoutPanel.
 String getTopicReference(String title, String message)
          Display a dialog box provided with the dialog box title and message as Strings, requesting selection of a topic, returning a reference to it as a URI (generally, a relative reference).
 Set getTopics()
          Return the Set of all Topics corresponding to visualized TNodes in the graph, an empty Set if none are available.
 TopicMapVisualizer getVisualizer()
          Returns the TopicMapVisualizer associated with this TopicMayLayoutPanel.
 int[] graphStatus()
          Returns status info as an int array.
 void gridNodes(Collection nodes, boolean sort)
          Grids the provided Collection of nodes over the available screen area, alphabetizing them if the boolean sort is true.
 void initiateDrag(MouseEvent e)
          Returns true if a Drag and Drop is supported on this panel and was successfully initiated based on the provided MouseEvent.
 boolean isDirty()
          Returns true if the current document has been edited.
 boolean isEditable()
          Returns true if the TMLayoutPanel is editable.
 boolean isEmpty()
          A convenience method that returns true if the graph is empty (i.e., it contains no TopicMaps).
 void keyPressed(KeyEvent ke)
          Overrides GraphLayoutPanel's method, responding to KeyEvents sent to the GraphPanel's GraphKeyListener.
 void loadTopicMap(Locator loc, boolean confirm)
          Loads the topic map referenced by the provided link node, selecting the topic ID if its URI includes one.
 void makeAllConsistent()
          Makes all TopicMaps consistent.
protected  void makeColorsPermanent()
          Transfers the current hilight colors (as from by Colorize By Distance) to each node's flag color, which are stored permanently with the nodes as facets.
 TNode mergeTopics()
          Merges the selected topic nodes, returning the merged TNode.
 void nodeDoubleClicked(Node node, MouseEvent e)
          An action method that indicates that the Node node has been double-clicked.
 void nodeFixAll()
          A Thread that fixes the location of all TNodes in place.
 void nodeUnfixAll()
          A Thread that unfixes the location of all Nodes, regardless of type.
 boolean openBase()
          Queries the user to open a base TopicMap.
 boolean openBase(int option)
          Opens a default TopicMap.
 void openOccurrence(TNode tnode)
          Open the occurrence indicated by the Occurrence occur.
 void openOccurrence(TNode tnode, boolean inBrowser)
          Open the Occurrences of the TNode tnode.
 void openOccurrence(Topic topic, Occurrence occur)
          Open the occurrence indicated by the Occurrence occur.
 void openOccurrences()
          Open the Occurrences of the selected TNode using an OccurrenceView.
 void randomTMGraph()
          Generate a random TM-style graph.
 void removeDirtyListener(DirtyListener listener)
          Remove a listener for changes to the dirty state.
 boolean replaceBaseLocator(Locator oldloc, Locator newloc)
          Removes the provided Locator from the set of TopicMap objects currently available from this TMLayoutPanel.
 void restoreFavorites(TopicMap topicmap)
          Restores the favorites list from the metadata container Topic in the provided TopicMap topicmap.
 void saveProperties()
          A call to save any user properties to the preferences file.
 Set searchTopics(String searchString, boolean labelsOnly, boolean partial, boolean caseSensitive)
          Searches the current graph's underlying TopicMap for the String s, returning the Set of matching TNodes, an empty Set if none are found.
 void selectAll(boolean unfiltered)
          Selects all of the Topic nodes.
 void selectByLabel(String label)
          Called from favorites list.
 void selectFavorite()
          If the favorites list is populated, selects the favorite (first item) Topic in the graph.
 Topic selectFromTree(Object o, String title, String message, String description)
          Displays the TopicTreeDialog, allowing selection of a Topic from an expandable tree.
 void selectHierarchy(boolean up, boolean unfiltered)
          Selects TNodes up or down the superclass-subclass hierarchy.
 boolean selectNode(Node node)
          Selects the Node node, and if the appropriate editor is visible and node is a TNode or ANode, sets it to display the new Node.
 void setAssociationVisibility(boolean visible)
          Set the visibility of all ANodes to visible.
 void setCLUT(String name)
          Loads the ColorLookupTable used by this panel to one with the provided name.
 void setColorFlags(Set tnodes, Color color)
          Sets the Color of each TNode in the set to Color color.
 void setColorizeByDistance(boolean colorize)
          When set true, sets a mode causing changes of locality to be color highlighted by a range of colors expressing distance from the selected node, using the current CLUT.
 void setDefaultSelection(TopicMap topicmap)
          This selects a Topic node in order to affect the locality.
protected  void setDefaultStylesheet()
          Sets the default colors for this TMLayoutPanel.
 void setDirty(boolean dirty)
          Sets the state indicating that the current document has been edited.
 void setEdgeVisibility(boolean visible)
          Set the visibility of all Edges to visible.
 void setEditable(boolean editable)
          Sets the availability of editing features to editable.
 void setFixed(GraphNode node, boolean fixed)
          Sets the fixed state of GraphNode node to the boolean fixed.
 void setLegend(ColorLookupTable clut, boolean show)
          Populates the legend panel with the provided CLUT's palette.
 void setSizeByDistance(boolean resize)
          When set true, sets a mode causing changes of locality to be highlighted by a range of font sizes expressing distance from the selected node.
 void setStylesheet(String filename)
          Overrides the method in GraphLayoutPanel, setting display properties based on those found in file filename, which is an XML properties file in the same notation as the Ceryle property file (".ceryle.prop").
 void setTopicMapProcessor(TopicMapProcessor tmprocessor)
          Sets the TopicMapProcessor of this TMLayoutPanel to the provided parameter.
 void showFindTopic(boolean simple)
          Displays the FindTopic dialog box.
 void storeFavorites(TopicMap topicmap)
          Stores the current favorites list to the metadata container Topic for the provided TopicMap topicmap.
protected  void tmEngineRecover(String uri)
          Queries the user to reinitialize the Topic Map engine following an error.
 Set topicsToTNodes(Collection topics)
          Provided with a Collection of Topics, returns a Set of corresponding TNodes.
 Set traverseGraph(TNode node, int direction, int depth, boolean asTopics)
          Traverses the graph to depth nodes in direction, returning a Set of connected TNodes or Topics, depending on the boolean asTopics.
 void updateOccurrenceCount(TNode tnode, Topic topic)
          Updates the occurrence count based on the Topic corresponding to the TNode tnode.
 
Methods inherited from class org.ceryle.graph.GraphLayoutPanel
activateUI, addGraphPanel, buildLens, buildScrollBars, buildScrollPanel, centerNode, centerSelectedNode, centerSelectedNode, clearGraph, findNode, findNode, getAllEdges, getGraphView, getHVScroll, getHyperbolicDistortion, getHyperRadius, getHyperScroll, getLastClickPoint, getLeftOf, getLegend, getLocalityRadius, getLocalityScroll, getNodeCount, getNodeFont, getOffset, getPopPanel, getPopupMenu, getPosition, getPosition, getRotateScroll, getRotationAngle, getScrollPanel, getSelectedCount, getSelectedLocation, getSelectedNode, getSequenceDistortion, getSequenceScroll, getTGPanel, getTopOf, getView, getZoomScroll, getZoomValue, hideNode, initialize, initialize, isEditActive, isLocalityEnabled, nodeClicked, releaseGraphPanel, repaintNode, reset, selectFirstNode, selectFirstNode, selectNode, selectSB, setFixedSelectedNode, setGraphPriority, setGraphPriority, setHyperbolicDistortion, setHyperRadius, setLastClickPoint, setLocalityEnabled, setLocalityRadius, setNavigateVerbosity, setNodeFont, setOffset, setPosition, setRotationAngle, setScrollBarsEnabled, setScrollPanelVisibility, setSequenceDistortion, setToolVisibility, setZoomValue, update
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enableMakeConsistent

public boolean enableMakeConsistent
Variable controlling if the Topic Map should be made consistent prior to visualizing. NOTE: This is a temporary patch; the default is false.


NO_BASE_ONTOLOGY

public static final int NO_BASE_ONTOLOGY
Static constant indicating a (visually) empty base ontology.

See Also:
Constant Field Values

MINIMAL_ONTOLOGY

public static final int MINIMAL_ONTOLOGY
Static constant indicating a minimal base ontology.

See Also:
Constant Field Values

UPPER_ONTOLOGY

public static final int UPPER_ONTOLOGY
Static constant indicating an upper base ontology.

See Also:
Constant Field Values

MIDDLE_ONTOLOGY

public static final int MIDDLE_ONTOLOGY
Static constant indicating a middle base ontology.

See Also:
Constant Field Values

showAssociations

public boolean showAssociations
Variable controlling if associations should be displayed. The default is true.


showOccurrences

public boolean showOccurrences
Variable controlling if topic occurrences should be displayed. The default is false.


showEdges

public boolean showEdges
Variable controlling if edges should be displayed. The default is true.


colorizeByDistance

protected boolean colorizeByDistance
When true, sets a mode causing changes of locality to be color highlighted by a range of colors expressing distance from the selected node. (This is only a flag, and does not actually activate the mode.)


defaultOntology

public static int defaultOntology
The default ontology for the open graph dialog. Acceptable values are: The default is 2.


maps

public int maps

tnodes

public int tnodes

anodes

public int anodes

snodes

public int snodes

onodes

public int onodes

rnodes

public int rnodes

useDragAndDrop

public static boolean useDragAndDrop
Variable controlling whether drag and drop is supported. Default is true, but this can be altered via the http://purl.org/ceryle/prop/#dragAndDrop property.


tmviz

protected TopicMapVisualizer tmviz
The TopicMapVisualizer used to display TopicMaps.


findTopicDlog

protected FindTopicDialog findTopicDlog
The dialog box used for find and replace operations.


tedlog

protected TopicEditorDialog tedlog
The dialog box used for topic editing operations.


m_aedlog

protected AssociationEditorDialog m_aedlog
The dialog box used for association editing operations.


tmpedit

protected TMPanelEditor tmpedit
The editor used for topic editing operations.


m_topicmaps

protected final HashSet m_topicmaps
The HashSet containing all TopicMap objects displayed in this TMLayoutPanel.


m_clut

protected ColorLookupTable m_clut
The current color lookup table (CLUT).


m_legend

protected Vector m_legend
Container for legendary color squares.


m_tmSysIDs

protected final HashSet m_tmSysIDs
The HashSet containing the explicitly-requested TopicMap system IDs within this TMLayoutPanel.


m_xidTxferHandler

protected XidTransferHandler m_xidTxferHandler
The TransferHandler supporting Drag and Drop operations.


m_canEdit

protected static boolean m_canEdit
A boolean indicating that the graph can be edited. (Readonly mode is currently not supported. This is for future use.)


favInTransition

protected boolean favInTransition
A boolean indicating that the favorites list is in transition.


m_dirty

protected boolean m_dirty
Indicates if the document text has been changed.


listenerList

protected EventListenerList listenerList
List of dirty event listeners.


dirtyEvent

protected DirtyEvent dirtyEvent
Lazily-created dirty event.


ovViewMode

protected int ovViewMode

btn_closeLeg

protected JButton btn_closeLeg

m_favorites

protected FrequencyModel m_favorites

m_favoritesBox

protected JComboBox m_favoritesBox

tmlp

protected TMLayoutPanel tmlp

m_maxListSize

protected int m_maxListSize

tmproc

protected TopicMapProcessor tmproc
The TopicMapProcessor used by this TMLayoutPanel.

Constructor Detail

TMLayoutPanel

public TMLayoutPanel(View view)
              throws TopicMapException
Constructor provided a reference to the parent View. The TopicMapProcessor and TMPanel will be created.

Throws:
TopicMapException

TMLayoutPanel

public TMLayoutPanel(View view,
                     TMPanel tmpanel)
              throws TopicMapException
Constructor provided a reference to the parent View. The TMPanel is optional, and will be created if not supplied.

Throws:
TopicMapException

TMLayoutPanel

public TMLayoutPanel(View view,
                     TMPanel tmpanel,
                     FrequencyModel favList)
              throws TopicMapException
Constructor provided a reference to the parent View. The TMPanel is optional, and will be created if not supplied.

Throws:
TopicMapException
Method Detail

setTopicMapProcessor

public void setTopicMapProcessor(TopicMapProcessor tmprocessor)
Sets the TopicMapProcessor of this TMLayoutPanel to the provided parameter.


getTopicMapProcessor

public TopicMapProcessor getTopicMapProcessor()
Returns the TopicMapProcessor used by this TMLayoutPanel.


setDefaultStylesheet

protected void setDefaultStylesheet()
Sets the default colors for this TMLayoutPanel.

Overrides:
setDefaultStylesheet in class GraphLayoutPanel

setLegend

public void setLegend(ColorLookupTable clut,
                      boolean show)
Populates the legend panel with the provided CLUT's palette. if the boolean show is true, shows the legend.


makeColorsPermanent

protected void makeColorsPermanent()
Transfers the current hilight colors (as from by Colorize By Distance) to each node's flag color, which are stored permanently with the nodes as facets.


clearLegend

protected void clearLegend()
Clears the color legend.


clear

public void clear()
Clears the TMLayoutPanel of any content. This does not reset any current settings or features.


droppedOnNode

protected void droppedOnNode(TMNode node,
                             String uriref)
Called as a result of a drag 'n drop process, adds the URI reference as an Occurrence on the underlying Topic of TNode tnode. This currently filters out other node types with a status message.

In the special case where the URI corresponds to a database collection (with no document ID),


droppedOnBackground

protected void droppedOnBackground(Point p,
                                   String uriref)
Called as a result of a drag 'n drop process, adds the URI reference as an Occurrence of a new Topic, whose display name will be taken from the Occurrence (if available). This first creates a new Topic in the graph, then adds the Occurrence to it.

In the special case where the URI corresponds to a database collection (with no document ID), the collection is visualized as a spoke of document-based TNodes surrounding a central (often throwaway) hub representing the collection itself.


getFavoritesList

public FrequencyModel getFavoritesList()
Returns the FrequencyModel backing the 'favorites' list, null if it has not been created.


addFavoritesList

public void addFavoritesList(FrequencyModel list)
Called once, adds the favorites list to the left side of the graph radio button bar. The FrequencyModel is optional; a new one will be created if null. If the favorites list has already been created, this will substitute the provided list for the existing one. (This list is currently labeled "Recent".)


storeFavorites

public void storeFavorites(TopicMap topicmap)
Stores the current favorites list to the metadata container Topic for the provided TopicMap topicmap.


setDefaultSelection

public void setDefaultSelection(TopicMap topicmap)
This selects a Topic node in order to affect the locality. The priority on this is based on availability: 1. restored from metadata; 2. first item in favorites list; 3. the Topic "Thing"; 4. the first visualized Topic.


restoreFavorites

public void restoreFavorites(TopicMap topicmap)
Restores the favorites list from the metadata container Topic in the provided TopicMap topicmap.


selectFavorite

public void selectFavorite()
If the favorites list is populated, selects the favorite (first item) Topic in the graph.


addToFavorites

public void addToFavorites(GraphNode node)
Adds TMNode node to the favorites list, if it has been initialized.


selectByLabel

public void selectByLabel(String label)
Called from favorites list. This calls findTNodeByLabel(String) if the currently-selected node's label does not match label.


selectHierarchy

public void selectHierarchy(boolean up,
                            boolean unfiltered)
Selects TNodes up or down the superclass-subclass hierarchy.


selectAll

public void selectAll(boolean unfiltered)
Selects all of the Topic nodes. If the boolean unfiltered is true, nodes of all types are selected.

Overrides:
selectAll in class GraphLayoutPanel

defloat

public void defloat(boolean shifted)
This extends GraphLayoutPanel's method by first processing all Topics, then passing the method for anything remaining to the superclass. If shifted is true, uses the superclass' version of this method, which clusters all unfixed, unattached GraphNodes around the selected node. If false, organizes the nodes according to a grid. If there is no selected node or the selected node is offscreen, the center of the screen is used. This also sets the locality radius to infinity, as unattached nodes are only all displayed in that locality.

Overrides:
defloat in class GraphLayoutPanel

gridNodes

public void gridNodes(Collection nodes,
                      boolean sort)
Grids the provided Collection of nodes over the available screen area, alphabetizing them if the boolean sort is true.


setCLUT

public void setCLUT(String name)
Loads the ColorLookupTable used by this panel to one with the provided name. If provided with a null value, the default (obtained from the properties file) will be used. This also loads the CLUT into the color popup menu.


getCLUT

public ColorLookupTable getCLUT()
Returns the current ColorLookupTable (CLUT), null if unavailable. To obtain the CLUT name, use getCLUT().getID().


setColorFlags

public void setColorFlags(Set tnodes,
                          Color color)
Sets the Color of each TNode in the set to Color color. A null value for color will clear any existing flag colors.


setColorizeByDistance

public void setColorizeByDistance(boolean colorize)
When set true, sets a mode causing changes of locality to be color highlighted by a range of colors expressing distance from the selected node, using the current CLUT.


getColorizeByDistance

public boolean getColorizeByDistance()
Returns the current setting for colorize-by-distance.


setSizeByDistance

public void setSizeByDistance(boolean resize)
When set true, sets a mode causing changes of locality to be highlighted by a range of font sizes expressing distance from the selected node.


isDirty

public boolean isDirty()
Returns true if the current document has been edited.


setDirty

public void setDirty(boolean dirty)
Sets the state indicating that the current document has been edited.


addDirtyListener

public void addDirtyListener(DirtyListener listener)
Add a listener for changes to the dirty state.


removeDirtyListener

public void removeDirtyListener(DirtyListener listener)
Remove a listener for changes to the dirty state.


fireDirtyStateChanged

protected void fireDirtyStateChanged()
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.


changeNodeID

public boolean changeNodeID(String oldId,
                            String newId)
Changes the ID of a topic having ID oldId to newId, returning true if successful. This does not alter any connected edges, which will throw a NUllPointException on not being able to find their original node.


addUIs

protected void addUIs()
Extends org.ceryle.graph.GraphNavigateUI to use a TMNavigateUI.

Overrides:
addUIs in class GraphLayoutPanel

saveProperties

public void saveProperties()
A call to save any user properties to the preferences file.


getTopicEditor

public TopicEditorDialog getTopicEditor(TNode tnode)
Returns the TopicEditorDialog associated with this TopicMayLayoutPanel, provided with an optional TMNode node. Uses a lazy instantiation.


getAssociationEditor

public AssociationEditorDialog getAssociationEditor()
Returns the AssociationEditorDialog of this GraphView, or null if it has not been created.


getAssociationEditor

public AssociationEditorDialog getAssociationEditor(ANode anode)
Returns the AssociationEditorDialog associated with this TopicMayLayoutPanel, provided with an optional ANode anode. Uses a lazy instantiation.


getTMPanel

public TMPanel getTMPanel()
Returns a lazily-created TMPanel (the GraphPanel extension) used by this TMLayoutPanel.


getGraphPanel

public GraphPanel getGraphPanel()
Overrides the superclass' method to return a lazily-created TMPanel, which extends GraphPanel.

Overrides:
getGraphPanel in class GraphLayoutPanel

getTopicMap

public TopicMap getTopicMap()
Returns the TopicMap object of the first Topic node (TNode) within the current graph. This is a convenience method for TMPanel's method of the same name.


getVisualizer

public TopicMapVisualizer getVisualizer()
Returns the TopicMapVisualizer associated with this TopicMayLayoutPanel. Uses a lazy instantiation.


initiateDrag

public void initiateDrag(MouseEvent e)
Returns true if a Drag and Drop is supported on this panel and was successfully initiated based on the provided MouseEvent. If DnD support is not available, the method does nothing.


getEditor

public TMPanelEditor getEditor()
Returns the TMPanelEditor associated with this TMLayoutPanel. Uses a lazy instantiation.


getRequestedBaseLocators

public Set getRequestedBaseLocators()
Returns an unmodifiable Set of the base Locators of the explicitly-requested TopicMap objects currently available from this TMLayoutPanel. This returns an empty Collection (not null) if none are available.


replaceBaseLocator

public boolean replaceBaseLocator(Locator oldloc,
                                  Locator newloc)
Removes the provided Locator from the set of TopicMap objects currently available from this TMLayoutPanel. This does not remove the corresponding TopicMap.

Returns:
true if replaced

getTopicMaps

public Set getTopicMaps()
Returns an unmodifiable Set of the TopicMap objects currently available from this TMLayoutPanel. This returns an empty Collection (not null) if none are available.


getTopicMapBaseLocators

public Set getTopicMapBaseLocators()
Returns an unmodifiable Set of the base locators of all TopicMap objects currently available from this TMLayoutPanel. This returns an empty Collection (not null) if none are available.


addTopicMap

public boolean addTopicMap(TopicMap topicmap,
                           boolean merge)
Adds the TopicMap topicmap to this TMLayoutPanel, displaying it via its TopicMapVisualizer, and adding it to the registry of displayed TopicMaps. Returns true if the TopicMap was added (the directive will be ignored if the TopicMap is already displayed). If the boolean merge is true, the added TopicMap will be merged with existing content.


tmEngineRecover

protected void tmEngineRecover(String uri)
Queries the user to reinitialize the Topic Map engine following an error. TEMP


makeAllConsistent

public void makeAllConsistent()
Makes all TopicMaps consistent. Time-consuming on biggies.


mergeTopics

public TNode mergeTopics()
Merges the selected topic nodes, returning the merged TNode. Returns null if no merge has taken place, for any reason.


setStylesheet

public void setStylesheet(String filename)
Overrides the method in GraphLayoutPanel, setting display properties based on those found in file filename, which is an XML properties file in the same notation as the Ceryle property file (".ceryle.prop").

Overrides:
setStylesheet in class GraphLayoutPanel

openBase

public boolean openBase()
Queries the user to open a base TopicMap. This should only be called after clearing the existing graph.

Returns:
true if a document was opened

openBase

public boolean openBase(int option)
Opens a default TopicMap. This should only be called after clearing the existing graph. The parameter value option provides the following behaviour:

Returns:
true if a document was opened

loadTopicMap

public void loadTopicMap(Locator loc,
                         boolean confirm)
Loads the topic map referenced by the provided link node, selecting the topic ID if its URI includes one. The boolean confirm is true, requests confirmation before loading the new topic map, which is layered onto whatever current graph is displayed.

NOTE: This is not the same as merging two or more topic maps, this may result in the current graph containing two separate but potentially linked) maps.


editTopicMap

public void editTopicMap()
Displays information about the selected TNode (topic node) or ANode (association node), by opening the respective editor. If there is no selection or the selected node is the wrong type, a warning message is displayed in the message area.


selectNode

public boolean selectNode(Node node)
Selects the Node node, and if the appropriate editor is visible and node is a TNode or ANode, sets it to display the new Node. If the FindTopicDialog is visible, resets the visibility count.

Overrides:
selectNode in class GraphLayoutPanel

setEditable

public void setEditable(boolean editable)
Sets the availability of editing features to editable. (Readonly mode is currently not supported. This is for future use.)


isEditable

public boolean isEditable()
Returns true if the TMLayoutPanel is editable. (Readonly mode is currently not supported. This is for future use.)


keyPressed

public void keyPressed(KeyEvent ke)
Overrides GraphLayoutPanel's method, responding to KeyEvents sent to the GraphPanel's GraphKeyListener. This version notes if the "Favorites" list is visible, and hilights a list item if so. Otherwise, it just passes the message on to the superclass.

Specified by:
keyPressed in interface TGScrollPane
Overrides:
keyPressed in class GraphLayoutPanel

nodeDoubleClicked

public void nodeDoubleClicked(Node node,
                              MouseEvent e)
An action method that indicates that the Node node has been double-clicked. What happens is dependent upon what kind of node is double-clicked, and which modifier keys are pressed. If a MouseListener has been set for the GraphNode it is processed first (noting that the event may be consumed by that listener).

Specified by:
nodeDoubleClicked in interface TGScrollPane
Overrides:
nodeDoubleClicked in class GraphLayoutPanel

deleteSelected

public boolean deleteSelected(boolean confirm)
Deletes the selected nodes, depending on the number of type. This is passed off to the TMPanelEditor.

Overrides:
deleteSelected in class GraphLayoutPanel
Returns:
true if the node was deleted

deleteNode

public boolean deleteNode(GraphNode node,
                          boolean confirm)
Deletes the GraphNode node, what happens depends on its type. This is passed off to the TMPanelEditor.

Overrides:
deleteNode in class GraphLayoutPanel
Returns:
true if the node was deleted

addScope

public void addScope(ANode anode,
                     SNode snode,
                     Collection nodes)
Links an ANode anode through the SNode snode to a Collection of TNodes nodes using a directed Edge pointing into the association.


addOccurrence

public void addOccurrence(TNode tnode,
                          ONode onode)
Links a base TNode base to an ONode onode using a directed Edge. The TNode and ONodes should already have been added to the graph.


addSubGraph

public SubGraph addSubGraph(int style,
                            String id,
                            String label,
                            Set set)
Links the provided Node node to a new subgraph having an ID id, String label, and optionally containing the Set of GraphNodes set.

The value of style must be either SubGraph.STYLE_CURVE or SubGraph.STYLE_RECTANGLE. Returns the subgraph node (SubGraph) if successful, null if not.


traverseGraph

public Set traverseGraph(TNode node,
                         int direction,
                         int depth,
                         boolean asTopics)
Traverses the graph to depth nodes in direction, returning a Set of connected TNodes or Topics, depending on the boolean asTopics. The value for direction comes from Traverser:   Traverser.TRAVERSE_ANY, Traverser.TRAVERSE_TO, or Traverser.TRAVERSE_FROM.

Note that a depth of 2 is required to traverse anywhere, since the graph is bipartite. Also, if the provided TNode doesn't contain a Topic, an empty Set is returned rather than throwing an exception.


addEdge

public GraphEdge addEdge(GraphNode node1,
                         GraphNode node2,
                         int length,
                         int directed)
Creates an edge between GraphNode node and node2 with a length of length, and edge direction of int directed (whose values may be GraphEdge.UNDIRECTED, GraphEdge.DIRECTED_TO, GraphEdge.DIRECTED_FROM, or GraphEdge.ARROW_FORWARD).

Overrides:
addEdge in class GraphLayoutPanel

setEdgeVisibility

public void setEdgeVisibility(boolean visible)
Set the visibility of all Edges to visible.


addTNode

public TNode addTNode(TNode tnode,
                      Point2D.Double p)
Adds a Topic Node (TNode) to the graph. If the point is non-null, the initial location is set to it, and the TNode is also fixed in place.

See Also:
TNode, Node

addTNode

public TNode addTNode(Topic topic,
                      String name)
Adds a Topic Node (TNode) with the ID id and an optional name. At least one of the parameters must be provided.

See Also:
TNode, Topic, Node

addTNode

public TNode addTNode(Topic topic,
                      String name,
                      Point2D.Double p,
                      boolean fixed)
Adds a Topic Node (TNode) with the ID id and an optional name. At least one of the first two parameters must be provided. If the point is non-null, the initial location is set to it, and the TNode is also fixed in place. If store is true, the fixed position is also stored as a Topic property.

Parameters:
topic - the bound Topic
name - the label for the TNode
p - the initial location of the TNode
fixed - when true and a point is provided, also fixes the location
See Also:
TNode, Topic, Node

getTNodes

public Set getTNodes()
Return the Set of all TNodes in the graph, an empty Set if none are available. This is a convenience method that passes the message off to the TMPanel.


getTNodeForTopic

public TNode getTNodeForTopic(Topic topic)
Returns the TNode for the provided Topic if it has been visualized, null if not. This is a convenience method that passes the message off to the TMPanel.


getANodeForAssociation

public ANode getANodeForAssociation(Association assoc)
Returns the ANode for the provided Association if it has been visualized, null if not. This is a convenience method that passes the message off to the TMPanel.


getTopics

public Set getTopics()
Return the Set of all Topics corresponding to visualized TNodes in the graph, an empty Set if none are available. Non-visualized Topics or those within invisible nodes are not included. This is a convenience method that passes the message off to the TMPanel.


searchTopics

public Set searchTopics(String searchString,
                        boolean labelsOnly,
                        boolean partial,
                        boolean caseSensitive)
Searches the current graph's underlying TopicMap for the String s, returning the Set of matching TNodes, an empty Set if none are found. This does not alter the current selection of visualized nodes.

Parameters:
searchString - the string to match
labelsOnly - search labels only, or all basenames
partial - allow partial name matches
caseSensitive - case senstive name matches when true
Returns:
the Set of matching TNodes (empty, never null)

updateOccurrenceCount

public void updateOccurrenceCount(TNode tnode,
                                  Topic topic)
Updates the occurrence count based on the Topic corresponding to the TNode tnode. The Topic can optionally be supplied.


getANodes

public Set getANodes()
Return the Set of all ANodes in the graph, an empty Set if none are available.


addANode

public ANode addANode(ANode anode,
                      Point2D.Double p)
Adds an Association Node (ANode) to the graph. The location point is optional.

Returns:
the ANode if successful, otherwise null
See Also:
ANode, Node

addANode

public ANode addANode(Association assoc,
                      String id,
                      String name)
Adds an Association Node (ANode) with the ID id and an optional Association assoc and String name. If the Association is non-null, its ID will be used and the provided String id will be ignored.

Parameters:
assoc - the bound Association
id - the ID for the ANode
name - the ANode label
See Also:
ANode, Association, Node

addANode

public ANode addANode(Association assoc,
                      String id,
                      String name,
                      Point2D.Double p)
Adds an Association Node (ANode) with the ID id and an optional Association assoc and String name. If the Association is non-null, its ID will be used and the provided String id will be ignored. Note that even when the point is provided, the ANode's location is set but it's not fixed in place, unlike TNodes.

Parameters:
assoc - the bound Association
id - the ID for the ANode
name - the ANode label
p - the initial location for the ANode
See Also:
ANode, Association, Node

setAssociationVisibility

public void setAssociationVisibility(boolean visible)
Set the visibility of all ANodes to visible.


addSNode

public SNode addSNode(SNode snode)
Adds a Scope Node (SNode), provided its ID and (optional) name.

See Also:
Node

addSNode

public SNode addSNode(String id,
                      String name)
Adds a Scope Node (SNode), provided its ID and (optional) name.

See Also:
Node

addONode

public ONode addONode(ONode onode)
Adds a Occurrence Node (ONode), provided its ID and (optional) name.

See Also:
Node

addONode

public ONode addONode(String id,
                      String name)
Adds a Occurrence Node (ONode), provided its ID and (optional) name.

See Also:
Node

addRNode

public RNode addRNode(RNode rnode)
Adds a Role Node (RNode) to the graph.

See Also:
RNode, Node

editTopic

public void editTopic(TNode tnode)
Displays information about the provided TNode (topic node) tnode.


openOccurrences

public void openOccurrences()
Open the Occurrences of the selected TNode using an OccurrenceView. If there is not one selected TNode, nothing happens.


editAssociation

public void editAssociation(ANode anode)
Displays information about the provided ANode (association node) anode.


openOccurrence

public void openOccurrence(TNode tnode)
Open the occurrence indicated by the Occurrence occur.


openOccurrence

public void openOccurrence(TNode tnode,
                           boolean inBrowser)
Open the Occurrences of the TNode tnode. If inBrowser is true, open instead in a Web browser.


openOccurrence

public void openOccurrence(Topic topic,
                           Occurrence occur)
Open the occurrence indicated by the Occurrence occur.


showFindTopic

public void showFindTopic(boolean simple)
Displays the FindTopic dialog box. If the boolean simple is true, uses a very minimal, one row version.


getFindTopicDialog

public FindTopicDialog getFindTopicDialog(boolean simple)
Returns a lazily-created FindTopicDialog.


getFindTopicPanel

public FindTopicPanel getFindTopicPanel()
Returns the internal FindTopicPanel of the FindTopicDialog, which provides search capability on the graph. Returns null if the FindTopicDialog does not exist.


find

public Set find(String s)
Searches the current graph's node labels for the String s, returning an Iterator over the matching nodes, or null if none are found.

This may alter the current selection of nodes, and uses the settings from the FindTopicPanel. This is a simple search that only searches only within the TouchGraph nodes, and doesn't look within the underlying Topic objects, which may have more than one base name per Topic.

See Also:
FindTopicPanel.find(String,boolean)

findNext

public void findNext()
Repeats the previous Find operation. This is ignored if the FindTopicDialog does not exist or no search string exists.


getTNodeByLabel

public TNode getTNodeByLabel(String label)
Searches the current TMPanel for a TNode having label, returning it if found. This does not change the selection. If not found, returns null. There may be more than one match - this locates the first.


findTNodeByLabel

public void findTNodeByLabel(String label)
Searches the current TMPanel for a TNode having label, selecting it if found. If not found, no change to the selection occurs. There may be more than one match - this selects and centers the first.


selectFromTree

public Topic selectFromTree(Object o,
                            String title,
                            String message,
                            String description)
Displays the TopicTreeDialog, allowing selection of a Topic from an expandable tree. Returns the Topic, or null if there was no selection, the user cancelled, or the process failed. The Traversal starts with either a Topic object, or a List of one or more Topics.


getTopicReference

public String getTopicReference(String title,
                                String message)
Display a dialog box provided with the dialog box title and message as Strings, requesting selection of a topic, returning a reference to it as a URI (generally, a relative reference).


setFixed

public void setFixed(GraphNode node,
                     boolean fixed)
Sets the fixed state of GraphNode node to the boolean fixed. This method is to be used in preference to TNode.setFixed(boolean) because if the GraphNode is a TNode, it also sets the backing Topic's storage of the Point.


topicsToTNodes

public Set topicsToTNodes(Collection topics)
Provided with a Collection of Topics, returns a Set of corresponding TNodes. No ordering of the result is done (this is backed by a HashSet).


nodeFixAll

public void nodeFixAll()
A Thread that fixes the location of all TNodes in place. Other node types are ignored.


nodeUnfixAll

public void nodeUnfixAll()
A Thread that unfixes the location of all Nodes, regardless of type.


isEmpty

public boolean isEmpty()
A convenience method that returns true if the graph is empty (i.e., it contains no TopicMaps). This overrides the superclass' method that checks the node count.

Overrides:
isEmpty in class GraphLayoutPanel

contains

public boolean contains(TypedInputSource source)
A convenience method that returns true if the graph currently contains a graph whose system identifier (either the base or resource locator) matches the provided parameter.


graphStatus

public int[] graphStatus()
Returns status info as an int array. The values are: [0] node count; [1] visible node count; [2] edge count; [3] visible edge count; [4] topics; [5] assocs; [6] scopes.

Returns null on empty graphs.

Overrides:
graphStatus in class GraphLayoutPanel

randomTMGraph

public void randomTMGraph()
Generate a random TM-style graph. The number of generated nodes is a random number bounded by two times the current rotation angle (plus 3 for good measure).



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