prefuse.action.layout.graph
Class MultiEdgePositioningLayout

java.lang.Object
  extended by prefuse.activity.Activity
      extended by prefuse.action.Action
          extended by prefuse.action.GroupAction
              extended by prefuse.action.layout.Layout
                  extended by prefuse.action.layout.graph.MultiEdgePositioningLayout

public class MultiEdgePositioningLayout
extends Layout

This layout positions the edges in a graph to be half way between the nodes (as per the EdgePositioningLayout). If there are multiple node-node edges then the edge positions will be spread out along the equi-distant line between the nodes.

Author:
Anton Marsden

Field Summary
protected  boolean considerNodeBounds
           
protected  double edgeSeparation
           
protected  java.lang.String m_edgeGroup
           
protected  Alignment m_xAlign1
           
protected  Alignment m_xAlign2
           
protected  Alignment m_yAlign1
           
protected  Alignment m_yAlign2
           
protected  boolean positionHiddenEdges
           
 
Fields inherited from class prefuse.action.layout.Layout
m_anchor, m_bounds, m_bpts, m_insets, m_margin, m_tmpa, m_tmpb
 
Fields inherited from class prefuse.action.GroupAction
m_group
 
Fields inherited from class prefuse.action.Action
m_vis
 
Fields inherited from class prefuse.activity.Activity
DEFAULT_STEP_TIME, INFINITY
 
Constructor Summary
MultiEdgePositioningLayout(java.lang.String graph)
           
 
Method Summary
 boolean getConsiderNodeBounds()
           
 double getEdgeSeparation()
          Get the separation gap for edges linking the same two nodes.
 Alignment getHorizontalAlignment1()
          Get the horizontal alignment of the edge mount point with the first node.
 Alignment getHorizontalAlignment2()
          Get the horizontal alignment of the edge mount point with the second node.
protected  void getMidPoint(java.awt.geom.Point2D p, ObjectPair<? extends NodeItem<?,?>> pair)
           
protected  PolarLine2D getPolarLine(ObjectPair<? extends NodeItem<?,?>> pair)
           
 Alignment getVerticalAlignment1()
          Get the vertical alignment of the edge mount point with the first node.
 Alignment getVerticalAlignment2()
          Get the vertical aligment of the edge mount point with the second node.
 boolean isPositionHiddenEdges()
           
 void run(double frac)
          Runs this Action, triggering whatever processing this Action performs.
 void setConsiderNodeBounds(boolean considerNodeBounds)
           
 void setEdgeSeparation(double edgeSeparation)
          Sets the separation gap between the edges linking the same two nodes.
 void setHorizontalAlignment1(Alignment align)
          Set the horizontal alignment of the edge mount point with the first node.
 void setHorizontalAlignment2(Alignment align)
          Set the horizontal alignment of the edge mount point with the second node.
 void setPositionHiddenEdges(boolean positionHiddenEdges)
           
 void setVerticalAlignment1(Alignment align)
          Set the vertical alignment of the edge mount point with the first node.
 void setVerticalAlignment2(Alignment align)
          Set the vertical alignment of the edge mount point with the second node.
 
Methods inherited from class prefuse.action.layout.Layout
getLayoutAnchor, getLayoutBounds, setLayoutAnchor, setLayoutBounds, setMargin, setX, setY
 
Methods inherited from class prefuse.action.GroupAction
getGroup, setGroup
 
Methods inherited from class prefuse.action.Action
getVisualization, run, setVisualization
 
Methods inherited from class prefuse.activity.Activity
addActivityListener, alwaysRunAfter, cancel, fireActivityCancelled, fireActivityFinished, fireActivityScheduled, fireActivityStarted, fireActivityStepped, getDuration, getNextTime, getPace, getPacingFunction, getStartTime, getStepTime, getStopTime, isEnabled, isRunning, isScheduled, removeActivityListener, run, runAfter, runAt, setDuration, setEnabled, setPacingFunction, setStartTime, setStepTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_edgeGroup

protected java.lang.String m_edgeGroup

m_xAlign1

protected Alignment m_xAlign1

m_yAlign1

protected Alignment m_yAlign1

m_xAlign2

protected Alignment m_xAlign2

m_yAlign2

protected Alignment m_yAlign2

edgeSeparation

protected double edgeSeparation

considerNodeBounds

protected boolean considerNodeBounds

positionHiddenEdges

protected boolean positionHiddenEdges
Constructor Detail

MultiEdgePositioningLayout

public MultiEdgePositioningLayout(java.lang.String graph)
Method Detail

getEdgeSeparation

public double getEdgeSeparation()
Get the separation gap for edges linking the same two nodes.

Returns:
the edge separation

setEdgeSeparation

public void setEdgeSeparation(double edgeSeparation)
Sets the separation gap between the edges linking the same two nodes.

Parameters:
edgeSeparation - the edge separation

getHorizontalAlignment1

public Alignment getHorizontalAlignment1()
Get the horizontal alignment of the edge mount point with the first node.

Returns:
the horizontal alignment

getVerticalAlignment1

public Alignment getVerticalAlignment1()
Get the vertical alignment of the edge mount point with the first node.

Returns:
the vertical alignment

getHorizontalAlignment2

public Alignment getHorizontalAlignment2()
Get the horizontal alignment of the edge mount point with the second node.

Returns:
the horizontal alignment

getVerticalAlignment2

public Alignment getVerticalAlignment2()
Get the vertical aligment of the edge mount point with the second node.

Returns:
the vertical alignment

setHorizontalAlignment1

public void setHorizontalAlignment1(Alignment align)
Set the horizontal alignment of the edge mount point with the first node.

Parameters:
align - the horizontal alignment

setVerticalAlignment1

public void setVerticalAlignment1(Alignment align)
Set the vertical alignment of the edge mount point with the first node.

Parameters:
align - the vertical alignment

setHorizontalAlignment2

public void setHorizontalAlignment2(Alignment align)
Set the horizontal alignment of the edge mount point with the second node.

Parameters:
align - the horizontal alignment

setVerticalAlignment2

public void setVerticalAlignment2(Alignment align)
Set the vertical alignment of the edge mount point with the second node.

Parameters:
align - the vertical alignment

getConsiderNodeBounds

public boolean getConsiderNodeBounds()
Returns:

setConsiderNodeBounds

public void setConsiderNodeBounds(boolean considerNodeBounds)

isPositionHiddenEdges

public boolean isPositionHiddenEdges()
Returns:

setPositionHiddenEdges

public void setPositionHiddenEdges(boolean positionHiddenEdges)
Parameters:
positionHiddenEdges -

run

public void run(double frac)
Description copied from class: Action
Runs this Action, triggering whatever processing this Action performs. Subclass this method to create custom Actions.

Specified by:
run in class GroupAction
Parameters:
frac - the fraction of this Action's duration that has elapsed.
See Also:
Action.run(double)

getPolarLine

protected PolarLine2D getPolarLine(ObjectPair<? extends NodeItem<?,?>> pair)

getMidPoint

protected void getMidPoint(java.awt.geom.Point2D p,
                           ObjectPair<? extends NodeItem<?,?>> pair)


Copyright © 2008 Regents of the University of California