public override void ProcessEvent(CoreMouseEventArgs e) { switch (e.Type) { case CoreMouseEventProcessor.MouseDown: { CoreMouseDownEventArgs args = e as CoreMouseDownEventArgs; if (args.Button == CoreMouseDownEventArgs.LeftButton) { Vector size = new Vector(150, 100); UseCaseUMLObject temp = new UseCaseUMLObject(new CoreRectRange(args.Location, args.Location + size)); Panel.AddShape(temp); temp.setDepth(DefaultDepth); Panel.UpdateDepth(); } break; } } }
public void Do_ChangeObjectName() { List <BaseUMLObject> Target = new List <BaseUMLObject>(); foreach (BaseUMLShape shape in UMLShapes) { if (shape as BaseUMLObject != null) { BaseUMLObject obj = shape as BaseUMLObject; if (obj.getSelected()) { Target.Add(obj); } } } if (Target.Count == 1) { if (Target.ElementAt(0) as ClassUMLObject != null) { ClassUMLObject temp = Target.ElementAt(0) as ClassUMLObject; BasicInputDialog inputDialog = new BasicInputDialog("Please enter your new class name:", temp.getTitleText()); if (inputDialog.ShowDialog() == true) { temp.setTitleText(inputDialog.Answer); } } if (Target.ElementAt(0) as UseCaseUMLObject != null) { UseCaseUMLObject temp = Target.ElementAt(0) as UseCaseUMLObject; BasicInputDialog inputDialog = new BasicInputDialog("Please enter your new usecase name:", temp.getName()); if (inputDialog.ShowDialog() == true) { temp.setName(inputDialog.Answer); } } this.InvalidateVisual(); } }