public void ToolMouseDoubleClick(object sender, MouseEventArgs e) { string input; canvas.DeselectAllObjects(); selectedObject = canvas.SelectObjectAt(e.X, e.Y); if (selectedObject != null && selectedObject is Text) { input = Microsoft.VisualBasic.Interaction.InputBox("Input Text", "Text Box", this.selectedObject.GetText(), 500, 300); if (input.Length > 0) { this.selectedObject.SetText(input.ToString()); canvas.initUndoRedo(); } } else { Text text = new Text(); input = Microsoft.VisualBasic.Interaction.InputBox("Input Text", "Text Box", "", 500, 300); text.Value = input; canvas.AddDrawingObject(text); text.X = e.X; text.Y = e.Y; canvas.initUndoRedo(); } Debug.WriteLine("selection tool double click"); }
public ObjectShape SelectObjectAt(int x, int y) { ObjectShape obj = GetObjectAt(x, y); if (obj != null) { obj.Select(); } return(obj); }
public MemMemento getMemento() { List <ObjectShape> objectShapes = new List <ObjectShape>(); foreach (ObjectShape obj in canvasState.getObjectShapes()) { ObjectShape newObj = (ObjectShape)obj.Clone(); objectShapes.Add(newObj); } return(new MemMemento(objectShapes)); }
public MemMemento CloneMemento(MemMemento mem) { List <ObjectShape> objectShapes = new List <ObjectShape>(); foreach (ObjectShape obj in mem.getSavedObject()) { ObjectShape newObj = (ObjectShape)obj.Clone(); objectShapes.Add(newObj); } return(new MemMemento(objectShapes)); }
public void ToolMouseDown(object sender, MouseEventArgs e) { this.xInitial = e.X; this.yInitial = e.Y; if (e.Button == MouseButtons.Left && canvas != null) { canvas.DeselectAllObjects(); selectedObject = canvas.SelectObjectAt(e.X, e.Y); canvas.RemoveDrawingObject(selectedObject); } }
public override void Deselect(ObjectShape obj) { obj.ChangeState(StaticState.GetInstance()); }
public abstract bool Remove(ObjectShape obj);
public abstract bool Add(ObjectShape obj);
public override bool Remove(ObjectShape obj) { drawingObjects.Remove(obj); return(true); }
public override bool Add(ObjectShape obj) { drawingObjects.Add(obj); return(true); }
public override void Draw(ObjectShape obj) { obj.RenderOnStaticView(); }
public override bool Add(ObjectShape obj) { return(false); }
public override void Draw(ObjectShape obj) { obj.RenderOnEditingView(); }
public override void Select(ObjectShape obj) { }
public override void Draw(ObjectShape obj) { obj.RenderOnPreview(); }
public void AddDrawingObject(ObjectShape drawingObject) { this.objectShapes.Add(drawingObject); }
public void RemoveDrawingObject(ObjectShape drawingObject) { this.objectShapes.Remove(drawingObject); undoObject.SetStateForUndoRedo(); }
public override void Select(ObjectShape obj) { obj.ChangeState(EditState.GetInstance()); }
public override bool Remove(ObjectShape obj) { return(false); }