}
public void mouseClicked(MouseEvent e) {
if (!handleMouseClicked) return;
SceneNode scene = (SceneNode)e.getSource();
// Control adds the new selection to the old
// If not selected, then erase old selection
if ((e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) == MouseEvent.CTRL_DOWN_MASK) {
scene.toggleSinglePick(e.getX(), e.getY());
}
// Shift selects everything in the rectangle region defined by the last click
// position and this position
else if (((e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) == MouseEvent.SHIFT_DOWN_MASK)) {
scene.toggleAllPicks(e.getX(), e.getY());
}
else scene.pick(e.getX(), e.getY());
}