org.gephi.layout.plugin
Class AutoLayout
java.lang.Object
org.gephi.layout.plugin.AutoLayout
public class AutoLayout
- extends java.lang.Object
Class to build layout scenario that runs for a certain duration. Multiple
layout can be chained and their duration ratio set. Moreover layout
property can be mananaged automatically and set in advance.
Example:
This will execute ForceAtlas for the first 80%, and LabelAdjust for remaining 20%
AutoLayout autoLayout = new AutoLayout(10, TimeUnit.SECONDS);
ForceAtlasLayout forceAtlasLayout = new ForceAtlasLayout(null);
AutoLayout.DynamicProperty gravity = AutoLayout.createDynamicProperty("Gravity", new Double[]{80., 400.0}, new float[]{0f, 1f}, AutoLayout.Interpolation.LINEAR);
AutoLayout.DynamicProperty speed = AutoLayout.createDynamicProperty("Speed", new Double[]{1.2, 0.3}, new float[]{0f, 1f}, AutoLayout.Interpolation.LINEAR);
AutoLayout.DynamicProperty repulsion = AutoLayout.createDynamicProperty("Repulsion strength", new Double[]{3000.0, 6000.}, new float[]{0f, 1f}, AutoLayout.Interpolation.LINEAR);
AutoLayout.DynamicProperty freeze = AutoLayout.createDynamicProperty("Autostab Strength", new Double(100.0), 0f);
autoLayout.addLayout(forceAtlasLayout, 0.8f, new AutoLayout.DynamicProperty[]{gravity, speed, repulsion, freeze});
//LabelAdjust
LabelAdjust labelAdjust = new LabelAdjust(null);
AutoLayout.DynamicProperty speed2 = AutoLayout.createDynamicProperty("Speed", new Double[]{0.5, 0.2}, new float[]{0f, 1f}, AutoLayout.Interpolation.LINEAR);
autoLayout.addLayout(labelAdjust, 0.2f, new AutoLayout.DynamicProperty[]{speed2});
Work in Progress
- Author:
- Mathieu Bastian
Constructor Summary |
AutoLayout(long duration,
java.util.concurrent.TimeUnit timeUnit)
|
Method Summary |
void |
addLayout(Layout layout,
float ratio)
|
void |
addLayout(Layout layout,
float ratio,
AutoLayout.DynamicProperty[] properties)
|
void |
cancel()
|
static AutoLayout.DynamicProperty |
createDynamicProperty(java.lang.String propertyName,
java.lang.Number[] value,
float[] ratio,
AutoLayout.Interpolation interpolation)
|
static AutoLayout.DynamicProperty |
createDynamicProperty(java.lang.String propertyName,
java.lang.Object[] value,
float[] ratio)
|
static AutoLayout.DynamicProperty |
createDynamicProperty(java.lang.String propertyName,
java.lang.Object value,
float ratio)
|
void |
execute()
|
void |
setGraphModel(GraphModel graphModel)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AutoLayout
public AutoLayout(long duration,
java.util.concurrent.TimeUnit timeUnit)
addLayout
public void addLayout(Layout layout,
float ratio)
addLayout
public void addLayout(Layout layout,
float ratio,
AutoLayout.DynamicProperty[] properties)
execute
public void execute()
cancel
public void cancel()
setGraphModel
public void setGraphModel(GraphModel graphModel)
createDynamicProperty
public static AutoLayout.DynamicProperty createDynamicProperty(java.lang.String propertyName,
java.lang.Object value,
float ratio)
createDynamicProperty
public static AutoLayout.DynamicProperty createDynamicProperty(java.lang.String propertyName,
java.lang.Object[] value,
float[] ratio)
createDynamicProperty
public static AutoLayout.DynamicProperty createDynamicProperty(java.lang.String propertyName,
java.lang.Number[] value,
float[] ratio,
AutoLayout.Interpolation interpolation)