import java.util.ArrayList;
import java.util.Collection;
-import javax.vecmath.Tuple2d;
-import javax.vecmath.Vector2d;
-
import org.simantics.databoard.Bindings;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
String commonLabel = scheme.generateLabel(graph, diagram);
// Create flags and connect both disconnected ends to them.
- Vector2d pos1, pos2;
+ Point2D pos1, pos2;
double theta;
double flagDist = 3.0;
if(isHorizontal) {
theta = 0.0;
- pos1 = new Vector2d(isectX-flagDist, isectY);
- pos2 = new Vector2d(isectX+flagDist, isectY);
+ pos1 = new Point2D.Double(isectX-flagDist, isectY);
+ pos2 = new Point2D.Double(isectX+flagDist, isectY);
}
else {
theta = Math.PI*0.5;
- pos1 = new Vector2d(isectX, isectY-flagDist);
- pos2 = new Vector2d(isectX, isectY+flagDist);
+ pos1 = new Point2D.Double(isectX, isectY-flagDist);
+ pos2 = new Point2D.Double(isectX, isectY+flagDist);
}
// Chooses flag directions
}
}
- private AffineTransform getFlagTransform(Tuple2d pos, double theta) {
- AffineTransform at = AffineTransform.getTranslateInstance(pos.x, pos.y);
+ private AffineTransform getFlagTransform(Point2D pos, double theta) {
+ AffineTransform at = AffineTransform.getTranslateInstance(pos.getX(), pos.getY());
at.rotate(theta);
return at;
}