if (paramFigure.isVerticalOrientation())
{
// Determine the top/bottom orientation;
// XOR both sides (exactly one of both must be true, not both)
Orientation socketOrientation = socketFigure.determine2WayOrientation(true);
boolean topToBottom = socketOrientation == Orientation.TOP ^ isExit;
int x = r.x + r.width / 2;
if (topToBottom)
{
// Top -> Bottom
p1.setLocation(x, r.y);
p2.setLocation(x, r.y + r.height);
}
else
{
// Bottom -> Top
p2.setLocation(x, r.y);
p1.setLocation(x, r.y + r.height);
}
}
else
{
// Determine the left/right orientation;
// XOR both sides (exactly one of both must be true, not both)
Orientation socketOrientation = socketFigure.determine2WayOrientation(false);
boolean leftToRight = socketOrientation == Orientation.LEFT ^ isExit;
int y = r.y + r.height / 2;
if (leftToRight)