Package org.gephi.layout.spi
Interface Layout
-
public interface LayoutA Layout algorithm should implement theLayoutinterface to allow theLayoutControllerto run it properly.See the
LayoutBuilderdocumentation to know how layout should be instanciated.To have fully integrated properties that can be changed in real-time by users, properly define the various
LayoutPropertyreturned by thegetProperties()method and provide getter and setter for each.- Author:
- Helder Suzuki
- See Also:
LayoutBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanAlgo()Tests if the algorithm can run, called before each pass.voidendAlgo()Called when the algorithm is finished (canAlgo() returns false).LayoutBuildergetBuilder()The reference to the LayoutBuilder that instanciated this Layout.LayoutProperty[]getProperties()The properties for this layout.voidgoAlgo()Run a step in the algorithm, should be called only if canAlgo() returns true.voidinitAlgo()initAlgo() is called to initialize the algorithm (prepare to run).voidresetPropertiesValues()Resets the properties values to the default values.voidsetGraphModel(GraphModel graphModel)Injects the graph model for the graph this Layout should operate on.
-
-
-
Method Detail
-
initAlgo
void initAlgo()
initAlgo() is called to initialize the algorithm (prepare to run).
-
setGraphModel
void setGraphModel(GraphModel graphModel)
Injects the graph model for the graph this Layout should operate on.It's preferable to get visible graph to perform on visualization.
- Parameters:
graphModel- the graph model that the layout is to be working on
-
goAlgo
void goAlgo()
Run a step in the algorithm, should be called only if canAlgo() returns true.
-
canAlgo
boolean canAlgo()
Tests if the algorithm can run, called before each pass.- Returns:
trueif the algorithm can run,falseotherwise
-
endAlgo
void endAlgo()
Called when the algorithm is finished (canAlgo() returns false).
-
getProperties
LayoutProperty[] getProperties()
The properties for this layout.- Returns:
- the layout properties
-
resetPropertiesValues
void resetPropertiesValues()
Resets the properties values to the default values.
-
getBuilder
LayoutBuilder getBuilder()
The reference to the LayoutBuilder that instanciated this Layout.- Returns:
- the reference to the builder that builts this instance
-
-