} else if (getRotatedCompassAt(x, y) != null) {
setState(getCompassRotationState());
} else if (getResizedCompassAt(x, y) != null) {
setState(getCompassResizeState());
} else {
Selectable item = getSelectableItemAt(x, y);
// If shift isn't pressed, and an item is under cursor position
if (!shiftDown && item != null) {
// Change state to SelectionMoveState
setState(getSelectionMoveState());
} else {
// Otherwise change state to RectangleSelectionState
setState(getRectangleSelectionState());
}
}
} else if (clickCount == 2) {
Selectable item = getSelectableItemAt(x, y);
// If shift isn't pressed, and an item is under cursor position
if (!shiftDown && item != null) {
// Modify selected item on a double click
if (item instanceof Wall) {
modifySelectedWalls();