2 * Copyright (c) 2003, the JUNG Project and the Regents of the University
6 * This software is open-source under the BSD license; see either
8 * http://jung.sourceforge.net/license.txt for a description.
10 package edu.uci.ics.jung.algorithms.layout;
12 import java.awt.Dimension;
13 import java.awt.geom.Point2D;
15 import org.apache.commons.collections15.Transformer;
17 import edu.uci.ics.jung.graph.Graph;
20 * A generalized interface is a mechanism for returning (x,y) coordinates
21 * from vertices. In general, most of these methods are used to both control and
22 * get information from the layout algorithm.
27 public interface Layout<V, E> extends Transformer<V,Point2D> {
30 * Initializes fields in the node that may not have
31 * been set during the constructor. Must be called before
32 * the iterations begin.
37 * provides initial locations for all vertices.
40 void setInitializer(Transformer<V,Point2D> initializer);
46 void setGraph(Graph<V,E> graph);
49 * Returns the full graph (the one that was passed in at
50 * construction time) that this Layout refers to.
53 Graph<V,E> getGraph();
64 void setSize(Dimension d);
67 * Returns the current size of the visualization's space.
73 * Sets a flag which fixes this vertex in place.
77 void lock(V v, boolean state);
80 * Returns <code>true</code> if the position of vertex <code>v</code>
83 boolean isLocked(V v);
86 * set the location of a vertex
90 void setLocation(V v, Point2D location);