java.lang.Object
org.jgrapht.alg.drawing.model.MapLayoutModel2D<V>
- Type Parameters:
V
- the vertex type
- All Implemented Interfaces:
Iterable<Map.Entry<V,
,Point2D>> LayoutModel2D<V>
A layout model which uses a hashtable to store the vertices' locations.
- Author:
- Dimitrios Michail
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.jgrapht.alg.drawing.model.LayoutModel2D
collect
-
Field Details
-
drawableArea
-
points
-
fixed
-
-
Constructor Details
-
MapLayoutModel2D
Create a new model.- Parameters:
drawableArea
- the drawable area
-
-
Method Details
-
getDrawableArea
Description copied from interface:LayoutModel2D
Get the drawable area of the model.- Specified by:
getDrawableArea
in interfaceLayoutModel2D<V>
- Returns:
- the drawable area of the model
-
setDrawableArea
Description copied from interface:LayoutModel2D
Set the drawable area of the model.- Specified by:
setDrawableArea
in interfaceLayoutModel2D<V>
- Parameters:
drawableArea
- the drawable area to use
-
iterator
Description copied from interface:LayoutModel2D
Get an iterator with all vertices' locations. May return an empty iterator if the model does not store locations. -
get
Description copied from interface:LayoutModel2D
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.- Specified by:
get
in interfaceLayoutModel2D<V>
- Parameters:
vertex
- the graph vertex- Returns:
- the last location of the vertex
-
put
Description copied from interface:LayoutModel2D
Set the location of a vertex.- Specified by:
put
in interfaceLayoutModel2D<V>
- 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
Description copied from interface:LayoutModel2D
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 callingLayoutModel2D.put(Object, Point2D)
has no effect.- Specified by:
setFixed
in interfaceLayoutModel2D<V>
- Parameters:
vertex
- a vertexfixed
- whether it is a fixed point or not.
-
isFixed
Description copied from interface:LayoutModel2D
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 callingLayoutModel2D.put(Object, Point2D)
has no effect.- Specified by:
isFixed
in interfaceLayoutModel2D<V>
- Parameters:
vertex
- the vertex- Returns:
- true if a fixed point, false otherwise
-