Class FR3DLayout<T>
- java.lang.Object
-
- repast.simphony.visualization.AbstractNetworkLayout<T>
-
- repast.simphony.visualization.visualization3D.layout.JungNetworkLayout<T>
-
- repast.simphony.visualization.visualization3D.layout.FR3DLayout<T>
-
- All Implemented Interfaces:
edu.uci.ics.jung.visualization.util.ChangeEventSupport
,Layout<T,Network<T>>
public class FR3DLayout<T> extends JungNetworkLayout<T>
Modified from the Fruchterman-Reingold algorithm for node layouts from JUNG- FRLayout for 2D...but modified to do 3D- Author:
- M. Altaweel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FR3DLayout.FRVertexData
-
Field Summary
-
Fields inherited from class repast.simphony.visualization.visualization3D.layout.JungNetworkLayout
changeListeners, changeSupport, dontmove, objectData, vertex_locations, visibleEdges, visibleGraph, visibleVertices, xSize, ySize
-
Fields inherited from class repast.simphony.visualization.AbstractNetworkLayout
baseGraph, layoutName, locationData
-
-
Constructor Summary
Constructors Constructor Description FR3DLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advancePositions()
Moves the iteration forward one notch, calculation attraction and repulsion between vertices and edges and cooling the temperature.void
calcAttraction(RepastEdge e)
void
calcPositions(Object v)
void
calcRepulsion(Object v1)
void
forceMove(Object picked, double x, double y, double z)
Box
getBoundingBox()
Gets a bounding box that describes the extent of this layout in location coordinates.DimensionLocal
getCurrentSize()
Returns the current size of the visualization space, same as JUNG AbstractLayout.getCurrentSize()FR3DLayout.FRVertexData
getFRData(Object o)
Object
getKey()
Returns a visualization-specific key (that is, specific both to this instance and AbstractLayout that can be used to accessfloat[]
getLocation(Object obj)
Finds the location of the objectString
getStatus()
Returns the current temperature and number of iterations elapsed, as a string.int
getX()
int
getY()
int
getZ()
boolean
incrementsAreDone()
Returns true once the current iteration has passed the maximum count, MAX_ITERATIONS.void
initialize(DimensionLocal size)
void
initialize(DimensionLocal size, JungVertexLocationFunction v_locations)
protected void
initialize_local()
Initializes all local information, and is called immediately within the initialize() process.protected void
initialize_local_vertex(Object o)
Initializes the local information on a single vertex.protected void
initializeLocation(Object o, double[] coord, DimensionLocal d)
Sets random locations for a vertex within the dimensions of the space.protected void
initializeLocations()
boolean
isIncremental()
This one is an incremental visualization.void
setAttractionMultiplier(double attraction)
void
setMaxIterations(int maxIterations)
void
setProjection(Network projection)
Sets the projection associated with this Layout.void
setRepulsionMultiplier(double repulsion)
void
setX(int x)
void
setY(int y)
void
setZ(int z)
void
update()
set update by default to advance positions-
Methods inherited from class repast.simphony.visualization.visualization3D.layout.JungNetworkLayout
addChangeListener, addEdgesOrVertices, applyFilter, dontMove, fireStateChanged, forceMove, getAVertex, getBaseKey, getChangeListeners, getCoordinates, getEdge, getEdge, getGraph, getLocation, getName, getVertex, getVertex, getVisibleEdges, getVisibleGraph, getVisibleVertices, getX, getXSize, getY, getYSize, initialize, initialize, initializeLocation, lockVertex, offsetVertex, postInitialize, removeChangeListener, resetVisibleEdgesAndVertices, resize, restart, returnEqualSet, returnMatchingCoordinate, setXSize, setYSize, unlockVertex
-
Methods inherited from class repast.simphony.visualization.AbstractNetworkLayout
getLayoutProperties, getLocationData, setLayoutProperties
-
-
-
-
Method Detail
-
setAttractionMultiplier
public void setAttractionMultiplier(double attraction)
-
initializeLocations
protected void initializeLocations()
- Overrides:
initializeLocations
in classJungNetworkLayout<T>
-
initializeLocation
protected void initializeLocation(Object o, double[] coord, DimensionLocal d)
Sets random locations for a vertex within the dimensions of the space. If you want to initialize in some different way, override this method.- Parameters:
coord
-o
-d
-
-
setRepulsionMultiplier
public void setRepulsionMultiplier(double repulsion)
-
update
public void update()
Description copied from class:JungNetworkLayout
set update by default to advance positions
-
getStatus
public String getStatus()
Returns the current temperature and number of iterations elapsed, as a string.- Overrides:
getStatus
in classJungNetworkLayout<T>
-
forceMove
public void forceMove(Object picked, double x, double y, double z)
- Overrides:
forceMove
in classJungNetworkLayout<T>
-
initialize_local
protected void initialize_local()
Description copied from class:JungNetworkLayout
Initializes all local information, and is called immediately within the initialize() process. The user is responsible for overriding this method to do any construction that may be necessary: for example, to initialize local per-edge or graph-wide data.- Overrides:
initialize_local
in classJungNetworkLayout<T>
-
getKey
public Object getKey()
Returns a visualization-specific key (that is, specific both to this instance and AbstractLayout that can be used to access
-
initialize
public void initialize(DimensionLocal size)
-
initialize
public void initialize(DimensionLocal size, JungVertexLocationFunction v_locations)
-
initialize_local_vertex
protected void initialize_local_vertex(Object o)
Description copied from class:JungNetworkLayout
Initializes the local information on a single vertex. The user is responsible for overriding this method to do any vertex-level construction that may be necessary: for example, to attach vertex-level information to each vertex.- Specified by:
initialize_local_vertex
in classJungNetworkLayout<T>
-
advancePositions
public void advancePositions()
Moves the iteration forward one notch, calculation attraction and repulsion between vertices and edges and cooling the temperature.- Specified by:
advancePositions
in classJungNetworkLayout<T>
-
calcPositions
public void calcPositions(Object v)
-
calcAttraction
public void calcAttraction(RepastEdge e)
-
calcRepulsion
public void calcRepulsion(Object v1)
-
setMaxIterations
public void setMaxIterations(int maxIterations)
-
getFRData
public FR3DLayout.FRVertexData getFRData(Object o)
-
isIncremental
public boolean isIncremental()
This one is an incremental visualization.
-
incrementsAreDone
public boolean incrementsAreDone()
Returns true once the current iteration has passed the maximum count, MAX_ITERATIONS.
-
getLocation
public float[] getLocation(Object obj)
Description copied from class:JungNetworkLayout
Finds the location of the object- Specified by:
getLocation
in interfaceLayout<T,Network<T>>
- Overrides:
getLocation
in classJungNetworkLayout<T>
- Parameters:
obj
- you want to find location of- Returns:
- the float[] containing the location
-
setProjection
public void setProjection(Network projection)
Description copied from interface:Layout
Sets the projection associated with this Layout.- Specified by:
setProjection
in interfaceLayout<T,Network<T>>
- Overrides:
setProjection
in classJungNetworkLayout<T>
- Parameters:
projection
- the associated projection.
-
getCurrentSize
public DimensionLocal getCurrentSize()
Description copied from class:JungNetworkLayout
Returns the current size of the visualization space, same as JUNG AbstractLayout.getCurrentSize()- Overrides:
getCurrentSize
in classJungNetworkLayout<T>
- Returns:
- the current size of the screen
-
getX
public int getX()
-
setX
public void setX(int x)
-
getY
public int getY()
-
setY
public void setY(int y)
-
getZ
public int getZ()
-
setZ
public void setZ(int z)
-
getBoundingBox
public Box getBoundingBox()
Description copied from interface:Layout
Gets a bounding box that describes the extent of this layout in location coordinates.- Returns:
- a bounding box that describes the extent of this layout in location coordinates, or a 0 size box if the extent is unknown.
-
-