java.lang.Object
de.grogra.persistence.ShareableBase
de.grogra.imp2d.layout.Layout
de.grogra.imp2d.layout.ForceBasedLayout
- All Implemented Interfaces:
Manageable
,Shareable
- Direct Known Subclasses:
DavidsonHarelLayout
,EadesLayout
,FruchtermanReingoldLayout
,SpringLayout
A
ForceBasedLayout
computes a graph layout based on a
force model. The concrete force model has to be implemented in subclasses.- Author:
- Ole Kniemeyer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
static class
Nested classes/interfaces inherited from class de.grogra.imp2d.layout.Layout
Layout.Algorithm
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ForceBasedLayout.Type
static final SCOType.Field
int
static final SCOType.Field
static final SCOType.Field
int
static final SCOType.Field
static final SCOType.Field
Fields inherited from class de.grogra.imp2d.layout.Layout
fit$FIELD, transformationSteps$FIELD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
computeForce
(Edge e, Vector2f force) Computes the force contribution of an edge.protected abstract void
computeForce
(Node s, Node t, Vector2f force) Computes the force contribution of a pair of nodes.protected Layout.Algorithm
Creates an algorithm for this layout.protected abstract void
setRandomPosition
(Node nodeTemp, Random rnd) void
setStartWithRandom
(boolean value) Methods inherited from class de.grogra.imp2d.layout.Layout
getParam, invoke, setParam, setRedraw, setTransformationSteps
Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.grogra.persistence.Manageable
getManageableType
-
Field Details
-
connectedNodesSize
public int connectedNodesSize -
nodesSize
public int nodesSize -
$TYPE
-
relaxation$FIELD
-
displayTransformation$FIELD
-
accuracy$FIELD
-
count$FIELD
-
startWithRandom$FIELD
-
-
Constructor Details
-
ForceBasedLayout
public ForceBasedLayout()
-
-
Method Details
-
setStartWithRandom
public void setStartWithRandom(boolean value) -
createAlgorithm
Description copied from class:Layout
Creates an algorithm for this layout.- Specified by:
createAlgorithm
in classLayout
- Returns:
- a new
Algorithm
instance
-
computeForce
Computes the force contribution of a pair of nodes. This method is invoked for every pair of nodes, whether they are connected or not. The computedforce
should be anti-symmetric with respect tos
andt
, i.e., if these parameters are exchanged, the resultingforce
should be the negative of the original force.- Parameters:
s
- the source nodet
- the target nodeforce
- the force in the direction froms
tot
has to be placed in here
-
computeForce
Computes the force contribution of an edge. This method is invoked for every edge of the graph.- Parameters:
e
- an edgeforce
- the force in the direction fromedge.source
toedge.target
has to be placed in here
-
setRandomPosition
-