public static void setActionMode(int actionMode) {
        //cleanup after actionMode
        switch (GlobalController.actionMode) {
            case ACTION_ARC_SELECT_TARGET:
                if (CanvasController.arc_no_target_id != null) {
                    Arc arc = (Arc)PetriNetController.getElementById(CanvasController.arc_no_target_id);
                    arc.delete();
                    CanvasController.arc_no_target_id = null;
                    CanvasController.repaintCanvas();
                }
                break;
            default:
                break;
        }
        //cleanup before actionMode
        switch (actionMode) {
            case ACTION_PLACE:
            case ACTION_TRANSITION:
            case ACTION_ARC:
            case ACTION_ARC_SELECT_TARGET:
                SelectionController.clearSelection();
                CanvasController.repaintCanvas();
                break;
            default:
                break;
        }

        GlobalController.actionMode = actionMode;
    }