com.tensegrity.graph.view
Class VisualNodePlacement

java.lang.Object
  extended bycom.tensegrity.graph.view.VisualNodePlacement

public final class VisualNodePlacement
extends java.lang.Object

This class implements basic node placement and consists of static methods for simple node placement tasks.

Version:
$Id: VisualNodePlacement.java,v 1.10 2004/07/06 07:12:03 MichaelKegel Exp $
Author:
Stepan Rutz

Method Summary
static void circular(VisualGraph visualgraph, double rangeX, double rangeY)
          Places node in a circle depending on their index in the graph.
static void origin(VisualGraph visualgraph)
          Places all nodes at the coordinate origin (0.0, 0.0)
static void random(VisualGraph visualgraph, double minX, double minY, double rangeX, double rangeY)
          Places nodes randomly within the given rectangular bounds.
static void random(VisualGraph visualgraph, VisualNode visualnode, double minX, double minY, double rangeX, double rangeY)
          Places a single visualnodet randomly.
static void random(VisualGraph visualgraph, VisualNode visualnode, double minX, double minY, double rangeX, double rangeY, java.util.Random rnd)
          Places a single visualnodet randomly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

origin

public static final void origin(VisualGraph visualgraph)
Places all nodes at the coordinate origin (0.0, 0.0)

Parameters:
visualgraph - the graph view to place the nodes in.

circular

public static final void circular(VisualGraph visualgraph,
                                  double rangeX,
                                  double rangeY)
Places node in a circle depending on their index in the graph. The oval has a radius of rangeX and rangeY and is centered on the coordinate origin. Thus all points x and y components are in the intervall [-1.0, 1.0 ].

Parameters:
visualgraph - the graph view to place the nodes in.
rangeX - oval's x coordinate range.
rangeY - oval's y coordinate range.

random

public static final void random(VisualGraph visualgraph,
                                double minX,
                                double minY,
                                double rangeX,
                                double rangeY)
Places nodes randomly within the given rectangular bounds.

Parameters:
visualgraph - the graph view to place the nodes in.
minX - the minimum x coordinate.
minY - the minimum y coordinate.
rangeX - the x coordinate range.
rangeY - the y coordinate range.

random

public static final void random(VisualGraph visualgraph,
                                VisualNode visualnode,
                                double minX,
                                double minY,
                                double rangeX,
                                double rangeY)
Places a single visualnodet randomly.

Parameters:
visualgraph - the visualgraph of the visualnode to place.
visualnode - the visualnode to place.
minX - the minimum x coordinate.
minY - the minimum y coordinate.
rangeX - the x coordinate range.
rangeY - the y coordinate range.

random

public static final void random(VisualGraph visualgraph,
                                VisualNode visualnode,
                                double minX,
                                double minY,
                                double rangeX,
                                double rangeY,
                                java.util.Random rnd)
Places a single visualnodet randomly.

Parameters:
visualgraph - the visualgraph of the visualnode to place.
visualnode - the visualnode to place.
minX - the minimum x coordinate.
minY - the minimum y coordinate.
rangeX - the x coordinate range.
rangeY - the y coordinate range.
rnd - the random generator to use.


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