at.tuwien.ifs.somtoolbox.apps.viewer.controls.psomserver
Class PathMerger
java.lang.Object
at.tuwien.ifs.somtoolbox.apps.viewer.controls.psomserver.PathMerger
public class PathMerger
- extends Object
- Version:
- $Id: PathMerger.java 3590 2010-05-21 10:43:45Z mayer $
- Author:
- Jakob Frank
Method Summary |
void |
concatPaths(edu.umd.cs.piccolo.PNode[] paths)
|
private List<GeneralUnitPNode> |
convertPathToUnits(edu.umd.cs.piccolo.PNode node)
|
private edu.umd.cs.piccolo.nodes.PPath |
createCircle(Point2D center,
float radius)
Create a circle PNode |
void |
deleteAllDrawnStuff()
|
private double |
dist(double[] d1,
double[] d2)
|
private double |
distSq(double[] d1,
double[] d2)
|
private void |
findBorder(edu.umd.cs.piccolox.nodes.PLine l1,
edu.umd.cs.piccolox.nodes.PLine l2,
Color c,
edu.umd.cs.piccolox.nodes.PLine border)
Find the border between two lines. |
private
<A extends edu.umd.cs.piccolo.PNode>
A |
|
findClosest(A unit,
List<A> candidates)
|
private Point2D |
findClosest(Point2D point,
List<Point2D> candidates)
|
private Point2D |
findClosest(Point2D point,
edu.umd.cs.piccolox.nodes.PLine candidates)
|
edu.umd.cs.piccolox.nodes.PLine |
getBorderLine()
|
private double[] |
getMiddlePoint(double[] d1,
double[] d2)
|
private Point2D |
getMiddlePoint(Point2D p1,
Point2D p2)
Get the middle point between the Points. |
void |
highlightIntersectingUnits(edu.umd.cs.piccolo.PNode node,
boolean target)
|
void |
lineBasedMerge(edu.umd.cs.piccolo.PNode[] paths)
|
void |
newIntermediateInputSpaceMerge(edu.umd.cs.piccolo.PNode[] paths)
|
void |
newIntermediateMapMerge(edu.umd.cs.piccolo.PNode[] paths)
|
private String |
printNode(edu.umd.cs.piccolo.PNode node)
|
void |
setDebug(boolean debug)
|
void |
unitBasedMerge(edu.umd.cs.piccolo.PNode[] paths)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
map
private final MapPNode map
root
private edu.umd.cs.piccolo.PNode root
borderRoot
private edu.umd.cs.piccolo.PNode borderRoot
connsRoot
private edu.umd.cs.piccolo.PNode connsRoot
circlesRoot
private edu.umd.cs.piccolo.PNode circlesRoot
drawedStuff
private List<edu.umd.cs.piccolo.PNode> drawedStuff
debug
private boolean debug
PathMerger
public PathMerger(MapPNode map)
PathMerger
public PathMerger(MapPNode map,
boolean debug)
setDebug
public void setDebug(boolean debug)
unitBasedMerge
public void unitBasedMerge(edu.umd.cs.piccolo.PNode[] paths)
deleteAllDrawnStuff
public void deleteAllDrawnStuff()
newIntermediateMapMerge
public void newIntermediateMapMerge(edu.umd.cs.piccolo.PNode[] paths)
newIntermediateInputSpaceMerge
public void newIntermediateInputSpaceMerge(edu.umd.cs.piccolo.PNode[] paths)
dist
private double dist(double[] d1,
double[] d2)
distSq
private double distSq(double[] d1,
double[] d2)
getMiddlePoint
private double[] getMiddlePoint(double[] d1,
double[] d2)
lineBasedMerge
public void lineBasedMerge(edu.umd.cs.piccolo.PNode[] paths)
findBorder
private void findBorder(edu.umd.cs.piccolox.nodes.PLine l1,
edu.umd.cs.piccolox.nodes.PLine l2,
Color c,
edu.umd.cs.piccolox.nodes.PLine border)
- Find the border between two lines.
- Parameters:
l1
- first Linel2
- second Linec
- Color
of the borderborder
- where to add the border
createCircle
private edu.umd.cs.piccolo.nodes.PPath createCircle(Point2D center,
float radius)
- Create a circle
PNode
- Parameters:
center
- the center of the circleradius
- the radius (size) of the circle
- Returns:
- a round
PNode
getMiddlePoint
private Point2D getMiddlePoint(Point2D p1,
Point2D p2)
- Get the middle point between the Points.
- Parameters:
p1
- first Pointp2
- second Point
- Returns:
- the Point in the middle
findClosest
private Point2D findClosest(Point2D point,
edu.umd.cs.piccolox.nodes.PLine candidates)
findClosest
private Point2D findClosest(Point2D point,
List<Point2D> candidates)
findClosest
private <A extends edu.umd.cs.piccolo.PNode> A findClosest(A unit,
List<A> candidates)
convertPathToUnits
private List<GeneralUnitPNode> convertPathToUnits(edu.umd.cs.piccolo.PNode node)
printNode
private String printNode(edu.umd.cs.piccolo.PNode node)
highlightIntersectingUnits
public void highlightIntersectingUnits(edu.umd.cs.piccolo.PNode node,
boolean target)
concatPaths
public void concatPaths(edu.umd.cs.piccolo.PNode[] paths)
getBorderLine
public edu.umd.cs.piccolox.nodes.PLine getBorderLine()