- Type Parameters:
V
- the vertex type
- All Known Implementing Classes:
ListenableLayoutModel2D
,MapLayoutModel2D
A general interface for the 2D layout model.
The layout model provides the necessary components to a
LayoutAlgorithm2D
in order to
draw a graph. Its responsibility is to provide the available drawable area, to be able to store
and answer queries about vertex coordinates, and to allow someone to fix (make permanent) a
vertex location.- Author:
- Dimitrios Michail
-
Method Summary
Modifier and TypeMethodDescriptioncollect()
Collect a map of all vertices locations.Get the last location of a particular vertex in the model.Get the drawable area of the model.boolean
Check whether a vertex is a fixed point.iterator()
Get an iterator with all vertices' locations.Set the location of a vertex.void
setDrawableArea
(Box2D drawableArea) Set the drawable area of the model.void
Set a point as being a "fixed-point" or not.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getDrawableArea
Box2D getDrawableArea()Get the drawable area of the model.- Returns:
- the drawable area of the model
-
setDrawableArea
Set the drawable area of the model.- Parameters:
drawableArea
- the drawable area to use
-
get
Get the last location of a particular vertex in the model. May return null if the vertex has not been assigned a location or if the particular implementation does not store the coordinates.- Parameters:
vertex
- the graph vertex- Returns:
- the last location of the vertex
-
put
Set the location of a vertex.- Parameters:
vertex
- the graph vertexpoint
- the location- Returns:
- the previous location or null if the vertex did not have a previous location or if the model does not store locations
-
setFixed
Set a point as being a "fixed-point" or not. It is the model's responsibility to make sure that changing the coordinates of a fixed point by callingput(Object, Point2D)
has no effect.- Parameters:
vertex
- a vertexfixed
- whether it is a fixed point or not.
-
isFixed
Check whether a vertex is a fixed point. It is the model's responsibility to make sure that changing the coordinates of a fixed point by callingput(Object, Point2D)
has no effect.- Parameters:
vertex
- the vertex- Returns:
- true if a fixed point, false otherwise
-
collect
Collect a map of all vertices locations. May return null if the model does not store locations.- Returns:
- a map with all the locations
-
iterator
Get an iterator with all vertices' locations. May return an empty iterator if the model does not store locations.
-