}
}
Collection<String> edges = scene.getEdges();
for (String id: edges) {
ConnectionWidget cw = (ConnectionWidget) scene.findWidget(id);
boolean isSourceIn;
boolean isTargetIn;
LabelWidget source = (LabelWidget) scene.findWidget(scene
.getEdgeSource(id));
Rectangle rect = source.getPreferredBounds();
Point location = source.getPreferredLocation();
Point pa = new Point(location.x + rect.x, location.y + rect.y);
Point pb = new Point(location.x + rect.x + rect.width,
location.y + rect.y + rect.height);
isSourceIn = isInSelectedArea(pa) && isInSelectedArea(pb);
LabelWidget target = (LabelWidget) scene.findWidget(scene
.getEdgeTarget(id));
rect = target.getPreferredBounds();
location = target.getPreferredLocation();
pa = new Point(location.x + rect.x, location.y + rect.y);
pb = new Point(location.x + rect.x + rect.width, location.y
+ rect.y + rect.height);
isTargetIn = isInSelectedArea(pa) && isInSelectedArea(pb);
if (!isSourceIn && !isTargetIn)
continue;
cwList.add(cw);
List<Point> cps = cw.getControlPoints();
boolean isCpIn[] = new boolean[cps.size()];
cpsList.add(cps);
for (int i = 0; i < cps.size(); ++i) {
if (isInSelectedArea(cps.get(i)))
isCpIn[i] = true;
else
isCpIn[i] = false;
}
if (!isSourceIn)
isCpIn[0] = false;
if (!isTargetIn)
isCpIn[cps.size() - 1] = false;
isCpsValid.add(isCpIn);
}
for (Widget lw: nodeList) {
Border border = lw.getBorder();
if (border instanceof LozengeBorder)
((LozengeBorder) border).setColor(Color.blue);
if (border instanceof TriangleBorder)
((TriangleBorder) border).setColor(Color.blue);
if (border instanceof RectangleBorder)
((RectangleBorder) border).setColor(Color.blue);
lw.setForeground(Color.blue);
lw.repaint();
}
for (ConnectionWidget cw: cwList) {
cw.setLineColor(Color.blue);
cw.setPaintControlPoints(true);
}
}
isSelecting = false;