}
public void mouseReleased(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
Point mouseLocation = e.getPoint();
GraphPane graphPane = Tool.getGraphPane();
if (mouseLocation.equals(SelectingTool.left)) {
if (!SelectingTool.isOnlySuperVerticesSelection) {
Set<SimpleVertex> simpleVertices = graphPane.getGraphModel().getSimpleVertices();
for (IVertex v : simpleVertices) {
if (v.hitTest(mouseLocation)) {
graphPane.selectVertex(v);
break;
}
}
}
Set<SuperVertex> vertices = graphPane.getGraphModel().getSuperVertices();
for (IVertex v : vertices) {
if (v.hitTest(mouseLocation)) {
graphPane.selectVertex(v);
break;
}
}
} else {
Set<SuperVertex> superVertices = graphPane.getGraphModel().getSuperVertices();
for (SuperVertex v : superVertices) {
if (v.isInRectangleTest(SelectingTool.left, mouseLocation)) {
graphPane.selectVertex(v);
}
}
if (!SelectingTool.isOnlySuperVerticesSelection) {
Set<SimpleVertex> simpleVertices = graphPane.getGraphModel().getSimpleVertices();
for (SimpleVertex v : simpleVertices) {
if (v.isInRectangleTest(SelectingTool.left, mouseLocation) && !graphPane.getSelectedVertices().contains(v.getSuperVertex())) {
graphPane.selectVertex(v);
}
}
}
}
graphPane.repaint();
}
SelectingTool.rectangleWidth = 0;
SelectingTool.rectangleHeight = 0;
}