org.ceryle.graph.tm
Class SNode

java.lang.Object
  extended by com.touchgraph.graphlayout.Node
      extended by org.ceryle.graph.GraphNode
          extended by org.ceryle.graph.tm.TMNode
              extended by org.ceryle.graph.tm.SNode
All Implemented Interfaces:
Comparable

public class SNode
extends TMNode

An extension of TMNode acting as a Scope Node (or S-Node) in a topic map graph.

Change in Scope API

Note that in previous versions of TM4J there existed a Scope object, which has been replaced by an array of Topics. Because of this, there is no longer a single TopicMapObject backing the SNode (scope node). SNode's get and set methods override those in the TopicMapObject superclass. While still providing single Topic get and set, for scopes containing more than one Topic an exception is thrown if they are called. This means that code dealing with Scopes must not make assumptions about its number of included Topics. The SNode constructor will pass along the first Topic of a scope array as the backing TopicMapObject, noting that this may be incomplete.

Since:
JDK1.3
Version:
$Id: SNode.java,v 3.6 2007-06-15 12:09:26 altheim Exp $
Author:
Murray Altheim

Field Summary
static Color COLOR_SCOPE_EDGE
          The color of scope edges.
static Color COLOR_SCOPE_NODE
          The color of scope nodes.
static Color COLOR_SCOPE_NODE_FIXED
          The color of fixed scope nodes.
static Color COLOR_SCOPE_NODE_TEXT
          The color of text on scope nodes.
protected  Topic[] m_scope
           
 
Fields inherited from class org.ceryle.graph.GraphNode
COLOR_BORDER_DRAG, COLOR_BORDER_FIXED, COLOR_BORDER_INACTIVE, COLOR_BORDER_MOUSE_OVER, COLOR_DEFAULT_NODE, COLOR_FIXED_NODE, COLOR_HILIGHTED_NODE, COLOR_NEW_LOCAL_NODE, COLOR_NODE_DOWNSTREAM, COLOR_NODE_REMOVAL, COLOR_NODE_TEXT, COLOR_NODE_UPSTREAM, COLOR_PROVISIONAL, COLOR_SELECT_NODE, COLOR_SELECT_NODE_B, COLOR_SELECT_NODE_D, COLOR_SMALL_TAG, COLOR_TRANSLUCENT_GRAY, defaultMargin, Ellipsis, fontMetrics, h, hidden, hilight, hMargin, m_listener, maxHeight, maxLabelLength, maxWidth, minHeight, minWidth, outlined, provisional, rel_angle, sortCaseSensitive, STROKE_OUTLINE, STROKE_PROVISIONAL, use3D, vMargin, w
 
Fields inherited from class com.touchgraph.graphlayout.Node
BACK_DEFAULT_COLOR, BACK_FIXED_COLOR, BACK_HILIGHT_COLOR, BACK_SELECT_COLOR, backColor, BORDER_DRAG_COLOR, BORDER_INACTIVE_COLOR, BORDER_MOUSE_OVER_COLOR, DEFAULT_TYPE, drawx, drawy, dx, dy, edges, fixed, font, justMadeLocal, lbl, markedForRemoval, massfade, repulsion, simpleDraw, SMALL_TAG_FONT, TEXT_COLOR, TEXT_FONT, textColor, typ, TYPE_CIRCLE, TYPE_ELLIPSE, TYPE_RECTANGLE, TYPE_ROUNDRECT, visible, visibleEdgeCnt, x, y
 
Constructor Summary
SNode(String id)
          Constructor with the required ID id value.
SNode(String id, String label)
          Constructor with the required ID id and label.
SNode(Topic[] scope, String id)
          Constructor with an array of Topic[] scope and a String ID id.
SNode(Topic[] scope, String id, String label)
          Constructor with a array of Topic[] scope and Strings for ID id and label.
 
Method Summary
 Color getPaintTextColor(TGPanel tgPanel)
          Returns the text color of the node, dependent on context.
 Topic[] getScope()
          Returns the Topic[] array backing this SNode, null if not set.
 void setScope(Topic[] scope)
          Sets the Topic[] references (comprising the Scope) within this SNode to the array Topic[] object.
 
Methods inherited from class org.ceryle.graph.tm.TMNode
getTopicMapObject, setFixed, setTopicMapObject
 
Methods inherited from class org.ceryle.graph.GraphNode
compareTo, getDefaultNodeFont, getHeight, getHilight, getID, getLabel, getMouseListener, getNodeFont, getPaintBackColor, getPaintBorderColor, getVerticalTweak, getVerticalTweak, getWidth, isHidden, isProvisional, jubble, paint, paintNodeBody, paintProvisional, paintSimple, paintSmallTag, setAlternateFont, setHidden, setHilight, setMargin, setMaximumLabelLength, setMouseListener, setNodeTagFont, setNodeTextFont, setProvisional, setSize, setVerticalTweak, toString
 
Methods inherited from class com.touchgraph.graphlayout.Node
addEdge, containsPoint, containsPoint, deleteEdges, edgeAt, edgeCount, edgeNum, getBackColor, getEdges, getFixed, getFont, getLocation, getTextColor, getType, hasEdge, intersects, isFixed, isVisible, removeEdge, setBackColor, setFixed, setFont, setID, setLabel, setLocation, setLocation, setNodeBackDefaultColor, setNodeBackFixedColor, setNodeBackHilightColor, setNodeBackSelectColor, setNodeBorderDragColor, setNodeBorderInactiveColor, setNodeBorderMouseOverColor, setNodeTextColor, setNodeType, setTextColor, setType, setVisible, visibleEdgeCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

COLOR_SCOPE_NODE

public static Color COLOR_SCOPE_NODE
The color of scope nodes. Ceryle property: http://purl.org/ceryle/prop/#graph-color-scopeNode.


COLOR_SCOPE_NODE_FIXED

public static Color COLOR_SCOPE_NODE_FIXED
The color of fixed scope nodes. Ceryle property: http://purl.org/ceryle/prop/#graph-color-scopeNodeFixed.


COLOR_SCOPE_EDGE

public static Color COLOR_SCOPE_EDGE
The color of scope edges. Ceryle property: http://purl.org/ceryle/prop/#graph-color-scopeEdge.


COLOR_SCOPE_NODE_TEXT

public static Color COLOR_SCOPE_NODE_TEXT
The color of text on scope nodes. Ceryle property: http://purl.org/ceryle/prop/#graph-color-scopeNodeText.


m_scope

protected Topic[] m_scope
Constructor Detail

SNode

public SNode(String id)
      throws GraphException
Constructor with the required ID id value.

Throws:
GraphException

SNode

public SNode(String id,
             String label)
      throws GraphException
Constructor with the required ID id and label.

Throws:
GraphException

SNode

public SNode(Topic[] scope,
             String id)
      throws GraphException
Constructor with an array of Topic[] scope and a String ID id.

Throws:
GraphException

SNode

public SNode(Topic[] scope,
             String id,
             String label)
      throws GraphException
Constructor with a array of Topic[] scope and Strings for ID id and label. It should be noted that the Scope ID is not used, and is not required to correspond with the ID used for the SNode.

Throws:
GraphException
Method Detail

setScope

public void setScope(Topic[] scope)
Sets the Topic[] references (comprising the Scope) within this SNode to the array Topic[] object. This can be set to null.


getScope

public Topic[] getScope()
Returns the Topic[] array backing this SNode, null if not set.


getPaintTextColor

public Color getPaintTextColor(TGPanel tgPanel)
Returns the text color of the node, dependent on context. This overrides the method in com.touchgraph.graphlayout.Node.

Overrides:
getPaintTextColor in class Node


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