easik.sketch
Class SetPoints

java.lang.Object
  extended by easik.sketch.SetPoints
All Implemented Interfaces:
java.util.EventListener, org.jgraph.event.GraphModelListener

public class SetPoints
extends java.lang.Object
implements org.jgraph.event.GraphModelListener

Graph Listener to set points on edges so that multiple edges between two nodes can be displayed properly.

Since:
2006-08-21 Kevin Green
Version:
2006-08-23 Kevin Green
Author:
Kevin Green 2006

Constructor Summary
SetPoints()
          Create the new action
 
Method Summary
 java.awt.Point calculatePoint(int sourceX, int sourceY, int destX, int destY, int spacer)
          Calculates the point which the edge should bend to.
 void graphChanged(org.jgraph.event.GraphModelEvent e)
          When action is performed, update point
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetPoints

public SetPoints()
Create the new action

Method Detail

graphChanged

public void graphChanged(org.jgraph.event.GraphModelEvent e)
When action is performed, update point

Specified by:
graphChanged in interface org.jgraph.event.GraphModelListener
Parameters:
e - The action event

calculatePoint

public java.awt.Point calculatePoint(int sourceX,
                                     int sourceY,
                                     int destX,
                                     int destY,
                                     int spacer)
Calculates the point which the edge should bend to.

Parameters:
sourceX - The source X co-ord
sourceY - The source Y co-ord
destX - The dest X co-ord
destY - The dest Y co-ord
spacer - The space from the home position (based on # of edges)
Returns:
The calculated point