com.tensegrity.graph.layout
Interface LayoutableNode

All Superinterfaces:
Layoutable
All Known Subinterfaces:
VisualNode, VisualSubgraph

public interface LayoutableNode
extends Layoutable

This is the standard interface for any node which should be arranged by a NodeLayout. It specifies a contract with the NodeLayout interface by providing methods that deal with node location, dimension, bounding box as well as port location and its angular interval for valid incoming edges.

Version:
$Id: LayoutableNode.java,v 1.24 2006/01/30 18:05:21 SharokhKhani Exp $
Author:
Sharokh Khani

Field Summary
static int BBOXMASK_INCLUDE_ALL
          BBOXMASK_INCLUDE_ALL: Constant for getBoundingBox(int) to include all externals of the LayoutableNode boundaries
static int BBOXMASK_INCLUDE_EXTERNALS_ALL
          BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on all sides of the node boundaries
static int BBOXMASK_INCLUDE_EXTERNALS_BACK
          BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the back (z-direction) side of the LayoutableNode boundaries
static int BBOXMASK_INCLUDE_EXTERNALS_BOTTOM
          BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the bottom side of the LayoutableNode boundaries
static int BBOXMASK_INCLUDE_EXTERNALS_FRONT
          BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the front (z-direction) side of the LayoutableNode boundaries
static int BBOXMASK_INCLUDE_EXTERNALS_LEFT
          BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the left side of the LayoutableNode boundaries
static int BBOXMASK_INCLUDE_EXTERNALS_RIGHT
          BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the right side of the LayoutableNode boundaries
static int BBOXMASK_INCLUDE_EXTERNALS_TOP
          BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the top side of the LayoutableNode boundaries
static int BBOXMASK_INCLUDE_MARKER
          BBOXMASK_INCLUDE_MARKER:
static int BBOXMASK_INCLUDE_SHADOW
          BBOXMASK_INCLUDE_MARKER:
static int BBOXMASK_INCLUDE_STROKE
          BBOXMASK_INCLUDE_STROKE:
 
Method Summary
 Boundary getBoundingBox()
          Returns the boundary of the node.
 BoundingBox getBoundingBox(int calculationFlags)
          Returns the bounding box of this composite.
 Coordinate getLocation()
          Returns the current location of this node object.
 Coordinate getPortCoordinate(long portID)
          Gets the Coordinate of the port specified by portID.
 double[] getPortDirection(long portID)
          Returns the angular interval which the identified port accepts for any valid incoming LayoutableEdge.
 long[] getPorts()
          Returns the list of the provided ports by this node.
 Size getSize()
          Gets the Size of the node.
 void layout(int left, int top, int right, int bottom)
          Sets the bounding box of the node
 void setLocation(Coordinate coordinate)
          Set the location of the node object.
 
Methods inherited from interface com.tensegrity.graph.layout.Layoutable
getEdgeLayoutContext, getLayoutAttributeSet, getLayoutContext, getNodeLayoutContext, getUniqueID, setEdgeLayoutContext, setLayoutAttributes, setLayoutContext, setNodeLayoutContext
 

Field Detail

BBOXMASK_INCLUDE_EXTERNALS_LEFT

public static final int BBOXMASK_INCLUDE_EXTERNALS_LEFT
BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the left side of the LayoutableNode boundaries

See Also:
Constant Field Values

BBOXMASK_INCLUDE_EXTERNALS_TOP

public static final int BBOXMASK_INCLUDE_EXTERNALS_TOP
BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the top side of the LayoutableNode boundaries

See Also:
Constant Field Values

BBOXMASK_INCLUDE_EXTERNALS_RIGHT

public static final int BBOXMASK_INCLUDE_EXTERNALS_RIGHT
BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the right side of the LayoutableNode boundaries

See Also:
Constant Field Values

BBOXMASK_INCLUDE_EXTERNALS_BOTTOM

public static final int BBOXMASK_INCLUDE_EXTERNALS_BOTTOM
BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the bottom side of the LayoutableNode boundaries

See Also:
Constant Field Values

BBOXMASK_INCLUDE_EXTERNALS_FRONT

public static final int BBOXMASK_INCLUDE_EXTERNALS_FRONT
BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the front (z-direction) side of the LayoutableNode boundaries

See Also:
Constant Field Values

BBOXMASK_INCLUDE_EXTERNALS_BACK

public static final int BBOXMASK_INCLUDE_EXTERNALS_BACK
BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on the back (z-direction) side of the LayoutableNode boundaries

See Also:
Constant Field Values

BBOXMASK_INCLUDE_STROKE

public static final int BBOXMASK_INCLUDE_STROKE
BBOXMASK_INCLUDE_STROKE:

See Also:
Constant Field Values

BBOXMASK_INCLUDE_MARKER

public static final int BBOXMASK_INCLUDE_MARKER
BBOXMASK_INCLUDE_MARKER:

See Also:
Constant Field Values

BBOXMASK_INCLUDE_SHADOW

public static final int BBOXMASK_INCLUDE_SHADOW
BBOXMASK_INCLUDE_MARKER:

See Also:
Constant Field Values

BBOXMASK_INCLUDE_ALL

public static final int BBOXMASK_INCLUDE_ALL
BBOXMASK_INCLUDE_ALL: Constant for getBoundingBox(int) to include all externals of the LayoutableNode boundaries

See Also:
Constant Field Values

BBOXMASK_INCLUDE_EXTERNALS_ALL

public static final int BBOXMASK_INCLUDE_EXTERNALS_ALL
BBOXMASK_INCLUDE_EXTERNALS_LEFT: Constant for getBoundingBox(int) to include externals on all sides of the node boundaries

See Also:
Constant Field Values
Method Detail

getLocation

public Coordinate getLocation()
Returns the current location of this node object.

Returns:
The current top/left Coordinate of the node.

Find more information in the class documentation


setLocation

public void setLocation(Coordinate coordinate)
Set the location of the node object.

Parameters:
coordinate - the new top/left Coordinate for the node.

Find more information in the class documentation


getSize

public Size getSize()
Gets the Size of the node.

Returns:
the Size of the node.

getBoundingBox

public Boundary getBoundingBox()
Returns the boundary of the node.

Returns:
the boundary of the node.

Find more information in the class documentation


getBoundingBox

public BoundingBox getBoundingBox(int calculationFlags)
Returns the bounding box of this composite. You can control the calculation by using the flags defined in the constants starting with BBOXMASK in the LayoutableNode interface.

Parameters:
calculationFlags - The flags to control the calculation
Returns:
The bounding box of the layoutable node

Find more information in the class documentation


layout

public void layout(int left,
                   int top,
                   int right,
                   int bottom)
Sets the bounding box of the node

Parameters:
left - position of the bounding box
top - position of the bounding box
right - position of the bounding box
bottom - position of the bounding box

Find more information in the class documentation


getPorts

public long[] getPorts()
Returns the list of the provided ports by this node.

Returns:
a long array contains the identifier of the ports.

Find more information in the class documentation


getPortDirection

public double[] getPortDirection(long portID)
Returns the angular interval which the identified port accepts for any valid incoming LayoutableEdge.

Parameters:
portID - the identifier of a port
Returns:
a double array of length two, where the value stored at index 0 denotes the beginning of the interval and the value stored at index 1 denotes the end of the interval.

Find more information in the class documentation


getPortCoordinate

public Coordinate getPortCoordinate(long portID)
Gets the Coordinate of the port specified by portID.

Parameters:
portID - the identifier of the port of which the position is requested.
Returns:
the Coordinate of specified port.

Find more information in the class documentation



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