com.tensegrity.graph.layout.edge
Class SimpleEdgeLayouter

java.lang.Object
  extended bycom.tensegrity.graph.layout.edge.SimpleEdgeLayouter

public class SimpleEdgeLayouter
extends java.lang.Object

This class provides a set of methods that can be used for arranging orthogonal or straight edges.

Version:
$Id: SimpleEdgeLayouter.java,v 1.64 2006/05/03 15:32:33 SharokhKhani Exp $
Author:
Sharokh Khani

Field Summary
 boolean bendAtCenter
          Determines the distance from the start-point to the first bend of an orthogonal edge.
 int minDistanceToMarker
          The minimum distance between the bends of edge and the edges marker.
 int preferBendDistance
          Prefer distance between the start-point and the first bend of an orthogonal edge.
 
Constructor Summary
SimpleEdgeLayouter()
          Constructor.
 
Method Summary
 void arrangeEdge(LayoutableEdge edge)
          This method arranges an given edge.
 void arrangeEdge(LayoutableEdge edge, int type)
          This method arranges an given edge.
 Coordinate[] getArrangedCoords(LayoutableEdge edge, Coordinate[] coords, int markerBeginSize, int markerEndSize, int type)
          This method returns the new edge path according the specifications.
 Coordinate[] getArrangedCoords(LayoutableEdge edge, Coordinate[] coords, int markerBeginSize, int markerEndSize, int sourceDirection, int targetDirection, int type)
          This method returns the new edge path according the specifications.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bendAtCenter

public boolean bendAtCenter
Determines the distance from the start-point to the first bend of an orthogonal edge. If true the first bend is at the middle point between the start and end-point of the edge, otherwise the distance specified by preferBendDistance preferBendDistance


preferBendDistance

public int preferBendDistance
Prefer distance between the start-point and the first bend of an orthogonal edge. This value will be ignored if the bendAtCenter is true


minDistanceToMarker

public int minDistanceToMarker
The minimum distance between the bends of edge and the edges marker.

Constructor Detail

SimpleEdgeLayouter

public SimpleEdgeLayouter()
Constructor.

Method Detail

arrangeEdge

public void arrangeEdge(LayoutableEdge edge)
This method arranges an given edge.

Parameters:
edge - the edge that is to be arranged.

arrangeEdge

public void arrangeEdge(LayoutableEdge edge,
                        int type)
This method arranges an given edge. This method ignores the internal edge type that can be gotten by LayoutableEdge.getType()

Parameters:
edge - that is to be arranged.
type - that should be taken into consideration.

getArrangedCoords

public Coordinate[] getArrangedCoords(LayoutableEdge edge,
                                      Coordinate[] coords,
                                      int markerBeginSize,
                                      int markerEndSize,
                                      int type)
This method returns the new edge path according the specifications. It does not change the edge coordinates. The caller is responsible for replace of the edge path.

Parameters:
edge - that should be arranged
coords - the current coordinate of the specified edge. This method ignores the internal edge coordinates which can be gotten by LayoutableEdge.getCoordinates()
markerBeginSize - the edge's start-marker size. This method ignores the internal start-marker size which can be gotten by LayoutableEdge.getMarkerBeginSize()
markerEndSize - the edge's end-marker size. This method ignores the internal end-marker size which can be gotten by LayoutableEdge.getMarkerEndSize()
type - of the edge. This method ignores the internal edge type which can be gotten by LayoutableEdge.getType()
Returns:
Coordinates of the new path for the edge

getArrangedCoords

public Coordinate[] getArrangedCoords(LayoutableEdge edge,
                                      Coordinate[] coords,
                                      int markerBeginSize,
                                      int markerEndSize,
                                      int sourceDirection,
                                      int targetDirection,
                                      int type)
This method returns the new edge path according the specifications. It does not change the edge coordinates. The caller is responsible for replace of the edge path.

Parameters:
edge - that should be arranged
coords - the current coordinate of the specified edge. This method ignores the internal edge coordinates which can be gotten by LayoutableEdge.getCoordinates()
markerBeginSize - the edge's start-marker size. This method ignores the internal start-marker size which can be gotten by LayoutableEdge.getMarkerBeginSize()
markerEndSize - the edge's end-marker size. This method ignores the internal end-marker size which can be gotten by LayoutableEdge.getMarkerEndSize()
sourceDirection - the outgoing direction of the edge.
targetDirection - the incoming direction of the edge.
type - of the edge. This method ignores the internal edge type which can be gotten by LayoutableEdge.getType()
Returns:
Coordinates of the new path for the edge


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.