de.uni_paderborn.fujaba.layout.classdiag.internalmodel
Class LayoutHelper

java.lang.Object
  extended byde.uni_paderborn.fujaba.layout.classdiag.internalmodel.LayoutHelper

public class LayoutHelper
extends java.lang.Object

LayoutHelper is a utility class which mainly returns various types of routing polygons for different kind of connection lines between two nodes. Specific layouters might use these methods to reuse certain kinds of diagram lines.

Version:
$Revision: 1.2 $ $Date: 2005/03/23 15:57:40 $ The class has been taken from Argo UML source code.
Author:
$Author: lowende $

Field Summary
static int EAST
          A constant bitmask for a direction.
static int NORTH
          A constant bitmask for a direction.
static int NORTHEAST
          A constant bitmask for a direction.
static int NORTHWEST
          A constant bitmask for a direction.
static int SOUTH
          A constant bitmask for a direction.
static int SOUTHEAST
          A constant bitmask for a direction.
static int SOUTHWEST
          A constant bitmask for a direction.
static int WEST
          A constant bitmask for a direction.
 
Constructor Summary
LayoutHelper()
           
 
Method Summary
static java.awt.Point getPointOnPerimeter(java.awt.Rectangle rect, int direction)
           
static java.awt.Point getPointOnPerimeter(java.awt.Rectangle rect, int direction, double xOff, double yOff)
           
static java.awt.Polygon getRoutingPolygonStraightLine(java.awt.Point start, java.awt.Point end)
          Get a routing polygon for a straightline between two points.
static java.awt.Polygon getRoutingPolygonStraightLineWithOffset(java.awt.Point start, java.awt.Point end, int offset)
          Get a routing polygon with a horizontal offset from the two points.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORTH

public static final int NORTH
A constant bitmask for a direction.

See Also:
Constant Field Values

NORTHEAST

public static final int NORTHEAST
A constant bitmask for a direction.

See Also:
Constant Field Values

EAST

public static final int EAST
A constant bitmask for a direction.

See Also:
Constant Field Values

SOUTHEAST

public static final int SOUTHEAST
A constant bitmask for a direction.

See Also:
Constant Field Values

SOUTH

public static final int SOUTH
A constant bitmask for a direction.

See Also:
Constant Field Values

SOUTHWEST

public static final int SOUTHWEST
A constant bitmask for a direction.

See Also:
Constant Field Values

WEST

public static final int WEST
A constant bitmask for a direction.

See Also:
Constant Field Values

NORTHWEST

public static final int NORTHWEST
A constant bitmask for a direction.

See Also:
Constant Field Values
Constructor Detail

LayoutHelper

public LayoutHelper()
Method Detail

getPointOnPerimeter

public static java.awt.Point getPointOnPerimeter(java.awt.Rectangle rect,
                                                 int direction)
Parameters:
rect - the rectangle
direction - the direction
Returns:
the point on the perimeter

getPointOnPerimeter

public static java.awt.Point getPointOnPerimeter(java.awt.Rectangle rect,
                                                 int direction,
                                                 double xOff,
                                                 double yOff)
Parameters:
rect - the rectangle
direction - the direction
xOff - the x offset
yOff - the y offset
Returns:
the point on the perimeter

getRoutingPolygonStraightLine

public static java.awt.Polygon getRoutingPolygonStraightLine(java.awt.Point start,
                                                             java.awt.Point end)
Get a routing polygon for a straightline between two points.

Parameters:
start - start of the line
end - end of the line
Returns:
the routing polygon between start and end

getRoutingPolygonStraightLineWithOffset

public static java.awt.Polygon getRoutingPolygonStraightLineWithOffset(java.awt.Point start,
                                                                       java.awt.Point end,
                                                                       int offset)
Get a routing polygon with a horizontal offset from the two points.

Parameters:
start - start of the line
end - end of the line
offset - the given offset
Returns:
the routing polygon between start and end