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
  • Constructor Details

    • FR3DLayout

      public FR3DLayout()
  • Method Details

    • setAttractionMultiplier

      public void setAttractionMultiplier(double attraction)
    • initializeLocations

      protected void initializeLocations()
      Overrides:
      initializeLocations in class JungNetworkLayout<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
      Specified by:
      update in interface Layout<T,Network<T>>
      Overrides:
      update in class JungNetworkLayout<T>
    • getStatus

      public String getStatus()
      Returns the current temperature and number of iterations elapsed, as a string.
      Overrides:
      getStatus in class JungNetworkLayout<T>
    • forceMove

      public void forceMove(Object picked, double x, double y, double z)
      Overrides:
      forceMove in class JungNetworkLayout<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 class JungNetworkLayout<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 class JungNetworkLayout<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 class JungNetworkLayout<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 interface Layout<T,Network<T>>
      Overrides:
      getLocation in class JungNetworkLayout<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 interface Layout<T,Network<T>>
      Overrides:
      setProjection in class JungNetworkLayout<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 class JungNetworkLayout<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.