Initial opendaylight infrastructure commit!!
[controller.git] / third-party / net.sf.jung2 / src / main / java / edu / uci / ics / jung / algorithms / layout / Layout.java
1 /*
2 * Copyright (c) 2003, the JUNG Project and the Regents of the University 
3 * of California
4 * All rights reserved.
5 *
6 * This software is open-source under the BSD license; see either
7 * "license.txt" or
8 * http://jung.sourceforge.net/license.txt for a description.
9 */
10 package edu.uci.ics.jung.algorithms.layout;
11
12 import java.awt.Dimension;
13 import java.awt.geom.Point2D;
14
15 import org.apache.commons.collections15.Transformer;
16
17 import edu.uci.ics.jung.graph.Graph;
18
19 /**
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.
23  * <p>
24  * @author danyelf
25  * @author tom nelson
26  */
27 public interface Layout<V, E> extends Transformer<V,Point2D> {
28     
29         /**
30          * Initializes fields in the node that may not have
31          * been set during the constructor. Must be called before
32          * the iterations begin.
33          */
34         void initialize();
35         
36         /**
37          * provides initial locations for all vertices.
38          * @param initializer
39          */
40         void setInitializer(Transformer<V,Point2D> initializer);
41     
42         /**
43          * setter for graph
44          * @param graph
45          */
46     void setGraph(Graph<V,E> graph);
47
48         /**
49          * Returns the full graph (the one that was passed in at 
50          * construction time) that this Layout refers to.
51          * 
52          */
53         Graph<V,E> getGraph();
54         
55         /**
56          * 
57          *
58          */
59         void reset();
60         
61         /**
62          * @param d
63          */
64         void setSize(Dimension d);
65         
66         /**
67          * Returns the current size of the visualization's space.
68          */
69         Dimension getSize();
70
71
72         /**
73          * Sets a flag which fixes this vertex in place.
74      * 
75          * @param v     vertex
76          */
77         void lock(V v, boolean state);
78
79     /**
80      * Returns <code>true</code> if the position of vertex <code>v</code>
81      * is locked.
82      */
83     boolean isLocked(V v);
84
85     /**
86      * set the location of a vertex
87      * @param v
88      * @param location
89      */
90         void setLocation(V v, Point2D location);
91
92
93 }