org.wilmascope.view
Class NodeView

java.lang.Object
  extended by org.wilmascope.patterns.Prototype
      extended by org.wilmascope.view.GraphElementView
          extended by org.wilmascope.view.NodeView
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, NodeAbility, NodeView, Viewable, View2D
Direct Known Subclasses:
BoxNodeView, ClusterView, DefaultNodeView, LabelNodeView, LineNodeView, OrientedBoxNodeView, SquareTubeNodeView, StarNodeView, TubeNodeView

public abstract class NodeView
extends GraphElementView
implements NodeView, View2D

Title: WilmaToo Description: Sequel to the ever popular WilmaScope software Copyright: Copyright (c) 2001 Company: WilmaScope.org

Version:
1.0
Author:
Tim Dwyer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.wilmascope.view.GraphElementView
t3d
 
Constructor Summary
NodeView()
           
 
Method Summary
 void addGeometryObserver(NodeGeometryObserver o)
          By implementing the NodeGeometryObserver interface an EdgeView can register with this NodeView to be notified of any changes to its geometry so that it can update itself accordingly
 void draw()
           
 void draw2D(Renderer2D r, java.awt.Graphics2D g, float transparency)
           
 java.awt.Point getCanvasPosition(java.awt.Component canvas)
           
 javax.swing.ImageIcon getIcon()
           
 Node getNode()
          Get the Node that this ability is registered with
 java.util.Properties getProperties()
           
 float getRadius()
           
 javax.vecmath.Point3f getVWorldPosition()
           
 void hideAnchor()
           
 void moveToCanvasPos(GraphCanvas c, int x, int y)
          Move the node in a plane parallel to the view plate, such that it appears at the point on the canvas specified in x and y.
 void setColour(javax.vecmath.Color3f c)
          When a new colour is set any GeometryObservers that have been added to this object will be notified
 void setNode(Node node)
          Called by Node when this ability is registered with that node.
 void setProperties(java.util.Properties p)
           
 void setRadius(float radius)
          sets the radius of the node's boundary sphere
 void showAnchor()
           
protected  void showLabel(java.lang.String text)
           
 
Methods inherited from class org.wilmascope.view.GraphElementView
addLabel, addLiveBranch, addPickingClient, addShape, addTransformGroupChild, defaultColour, delete, getAppearance, getAxisAngle4f, getBranchGroup, getColor3f, getColour, getDefaultColour, getGraphCanvas, getLabel, getTransformGroup, getUserData, hide, highlightColour, init, initGraphElement, isDefaultColour, makePickable, picked, removeLabel, removePickingClient, setColour, setColour, setFullTransform, setFullTransform, setLabel, setLabel, setLabel, setPickable, setResizeTranslateTransform, setTransformGroupTransform, setTranslation, setTransparencyAttributes, setupDefaultAppearance, setupDefaultMaterial, setupHighlightAppearance, setupHighlightMaterial, setUserData, show, transform
 
Methods inherited from class org.wilmascope.patterns.Prototype
clone, getTypeName, setTypeName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.wilmascope.graph.Viewable
delete, hide, setPickable, show
 

Constructor Detail

NodeView

public NodeView()
Method Detail

addGeometryObserver

public void addGeometryObserver(NodeGeometryObserver o)
By implementing the NodeGeometryObserver interface an EdgeView can register with this NodeView to be notified of any changes to its geometry so that it can update itself accordingly

Parameters:
o -

draw

public void draw()
Specified by:
draw in interface Viewable

getNode

public Node getNode()
Description copied from interface: NodeAbility
Get the Node that this ability is registered with

Specified by:
getNode in interface NodeAbility

setNode

public void setNode(Node node)
Description copied from interface: NodeAbility
Called by Node when this ability is registered with that node.

Specified by:
setNode in interface NodeAbility

getIcon

public javax.swing.ImageIcon getIcon()
Specified by:
getIcon in class GraphElementView

showLabel

protected void showLabel(java.lang.String text)
Specified by:
showLabel in class GraphElementView

showAnchor

public void showAnchor()

hideAnchor

public void hideAnchor()

getVWorldPosition

public javax.vecmath.Point3f getVWorldPosition()

getCanvasPosition

public java.awt.Point getCanvasPosition(java.awt.Component canvas)
Specified by:
getCanvasPosition in interface NodeView
Returns:
position of node on 2D canvas, removing all local transforms

moveToCanvasPos

public void moveToCanvasPos(GraphCanvas c,
                            int x,
                            int y)
Move the node in a plane parallel to the view plate, such that it appears at the point on the canvas specified in x and y. The x and y parameters are in AWT coordinates with 0,0 at the top left of the canvas.

Parameters:
c - the canvas
x - the x awt coordinate
y - the y awt coordinate

setColour

public void setColour(javax.vecmath.Color3f c)
When a new colour is set any GeometryObservers that have been added to this object will be notified

Overrides:
setColour in class GraphElementView
Parameters:
c - new colour for this NodeView
See Also:
addGeometryObserver(NodeGeometryObserver)

setRadius

public void setRadius(float radius)
sets the radius of the node's boundary sphere

Specified by:
setRadius in interface NodeView
Parameters:
radius - the radius of the node, (0.25 is a good size)

getRadius

public float getRadius()
Specified by:
getRadius in interface NodeView
Returns:
radius of the nodes boundary sphere

setProperties

public void setProperties(java.util.Properties p)
Overrides:
setProperties in class GraphElementView

getProperties

public java.util.Properties getProperties()
Overrides:
getProperties in class GraphElementView

draw2D

public void draw2D(Renderer2D r,
                   java.awt.Graphics2D g,
                   float transparency)
Specified by:
draw2D in interface View2D