1 8 package com.nightlabs.editor2d; 9 10 import java.util.ArrayList ; 11 import java.util.List ; 12 13 import com.nightlabs.editor2d.edit.ShapeDrawComponentEditPart; 14 import com.nightlabs.editor2d.util.EditorUtil; 15 16 17 public class EditorStateManager 18 { 19 public static final int STATE_NORMAL_SELECTION = 1; 20 public static final int STATE_EDIT_SHAPE = 2; 21 public static final int STATE_ROTATE = 3; 22 23 public EditorStateManager() { 24 super(); 25 } 26 27 protected static int currentState = STATE_NORMAL_SELECTION; 28 public static int getCurrentState() { 29 return currentState; 30 } 31 public static void setCurrentState(int currentState) { 32 EditorStateManager.currentState = currentState; 33 } 34 35 public static void setEditShapeMode(ShapeDrawComponentEditPart sdc) 36 { 37 setCurrentState(STATE_EDIT_SHAPE); 38 EditorUtil.selectEditPart(sdc); 41 } 42 43 public static void setNormalSelectionMode(List editParts) 44 { 45 setCurrentState(STATE_NORMAL_SELECTION); 46 EditorUtil.selectEditParts(editParts); 47 } 48 49 public static void setRotateMode(List editParts) 50 { 51 setCurrentState(STATE_ROTATE); 52 EditorUtil.selectEditParts(editParts); 53 } 54 55 } 56 | Popular Tags |