diva.canvas.connector
Class IncrManhattanRouter

java.lang.Object
  extended by diva.canvas.connector.IncrManhattanRouter
All Implemented Interfaces:
ManhattanRouter, Router

public class IncrManhattanRouter
extends java.lang.Object
implements ManhattanRouter

A manhattan router which does only incremental routing and delegates static routing to another manhattan router implementation.

Version:
$Id: IncrManhattanRouter.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Michael Shilman, John Reekie
Accepted Rating:
Red

Field Summary
private  ManhattanRouter _staticRouter
          The static router that handles calls to route().
 
Constructor Summary
IncrManhattanRouter(ManhattanRouter staticRouter)
          Construct a new incremental router which delegates static routing to the given manhattan router, but does incremental routing (the reroute*() methods) on its own.
 
Method Summary
 void reroute(Connector c, java.awt.Shape s)
          Reroute the given shape, given that both the head the tail sites moved.
 void rerouteHead(Connector c, java.awt.Shape s)
          Reroute the given Shape, given that the head site moved.
 void rerouteTail(Connector c, java.awt.Shape s)
          Reroute the given Shape, given that the tail site moved.
 java.awt.Shape route(Connector c)
          Delegate the static routing to the static router.
 Polyline2D routeManhattan(ManhattanConnector c)
          Delegate the static routing to the static router.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_staticRouter

private ManhattanRouter _staticRouter
The static router that handles calls to route().

Constructor Detail

IncrManhattanRouter

public IncrManhattanRouter(ManhattanRouter staticRouter)
Construct a new incremental router which delegates static routing to the given manhattan router, but does incremental routing (the reroute*() methods) on its own.

Method Detail

rerouteHead

public void rerouteHead(Connector c,
                        java.awt.Shape s)
Reroute the given Shape, given that the head site moved.

Specified by:
rerouteHead in interface Router

rerouteTail

public void rerouteTail(Connector c,
                        java.awt.Shape s)
Reroute the given Shape, given that the tail site moved.

Specified by:
rerouteTail in interface Router

reroute

public void reroute(Connector c,
                    java.awt.Shape s)
Reroute the given shape, given that both the head the tail sites moved. The shape is modified by the router.

Specified by:
reroute in interface Router

route

public java.awt.Shape route(Connector c)
Delegate the static routing to the static router.

Specified by:
route in interface Router

routeManhattan

public Polyline2D routeManhattan(ManhattanConnector c)
Delegate the static routing to the static router.

Specified by:
routeManhattan in interface ManhattanRouter