protected void DetachFromAllShapes(GraphicElement el) { /* el.DisconnectShapeFromConnector(GripType.Start); * el.DisconnectShapeFromConnector(GripType.End); * el.RemoveConnection(GripType.Start); * el.RemoveConnection(GripType.End);*/ }
public void SelectElement(GraphicElement el) { if (!selectedElements.Contains(el)) { selectedElements.Add(el); el.Select(); el.DrawSelection(); } }
public SnapAction(Action action, GraphicElement lineShape, GripType gripType, GraphicElement targetShape, ConnectionPoint lineConnectionPoint, ConnectionPoint shapeConnectionPoint, Point delta) { SnapType = action; this.connector = lineShape; this.gripType = gripType; this.targetShape = targetShape; this.lineConnectionPoint = lineConnectionPoint; this.shapeConnectionPoint = shapeConnectionPoint; Delta = delta; }
protected bool SelectElement(Point p) { GraphicElement el = elements.FirstOrDefault(e => e.IsSelectable(p)); if (el != null) { SelectElement(el); } return(el != null); }
public void ShowAnchors() { try { GraphicElement el = canvascontroller.GetRootShapeAt(CurrentMousePosition); Trace.WriteLine("*** ShowAnchors " + el.GetType().Name); el.ShowAnchors = true; el.DrawAnchors(); HoverShape = el; } catch { } //canvascontroller.SetAnchorCursor(el); }
protected void SelectSingleRootShape() { // Preserve for undo: List <GraphicElement> selectedShapes = canvascontroller.SelectedElements.ToList(); GraphicElement el = canvascontroller.GetRootShapeAt(CurrentMousePosition); if (!selectedShapes.Contains(el)) { MessageBox.Show(selectedShapes.Count + ""); canvascontroller.DeselectCurrentSelectedElements(); canvascontroller.SelectElement(el); } }
public override void Update(GraphicElement el, string label) { // X1 //(label == nameof(StartCap)).If(() => this.ChangePropertyWithUndoRedo<AvailableLineCap>(el, nameof(StartCap), nameof(StartCap))); //(label == nameof(EndCap)).If(() => this.ChangePropertyWithUndoRedo<AvailableLineCap>(el, nameof(EndCap), nameof(EndCap))); if (label == nameof(StartCap)) { ((Connector)el).StartCap = StartCap; } ; if (label == nameof(EndCap)) { ((Connector)el).EndCap = EndCap; } ; base.Update(el, label); }
public virtual void Update(GraphicElement el, string label) { // X1 //(label == nameof(Rectangle)).If(() => this.ChangePropertyWithUndoRedo<Rectangle>(el, nameof(el.DisplayRectangle), nameof(Rectangle))); //(label == nameof(BorderColor)).If(() => this.ChangePropertyWithUndoRedo<Color>(el, nameof(el.BorderPenColor), nameof(BorderColor))); //(label == nameof(BorderWidth)).If(() => this.ChangePropertyWithUndoRedo<int>(el, nameof(el.BorderPenWidth), nameof(BorderWidth))); //(label == nameof(FillColor)).If(() => this.ChangePropertyWithUndoRedo<Color>(el, nameof(el.FillColor), nameof(FillColor))); if (label == nameof(borderShape)) { el.DisplayRectangle = borderShape; } ; if (label == nameof(Name)) { el.Name = Name; } ; }
public void AddElement(GraphicElement el) { elements.Add(el); }
// public bool IsSnapToBeIgnored { get { return ((Control.ModifierKeys & Keys.Control) == Keys.Control) || UndoRedoIgnoreSnapCheck; } } public virtual void DeselectElement(GraphicElement el) { }
public virtual void SetAnchorCursor(GraphicElement el) { }
//public virtual void SelectElement(GraphicElement el) { } public virtual void SelectOnlyElement(GraphicElement el) { }
private void CreateControl(GraphicElement el) { IServiceManager.canvasController.AddElement(el); el.Draw(); }
public virtual void SetConnection(GripType gt, GraphicElement shape) { }
public virtual void UpdateFrom(GraphicElement el) { // The only property that can change. borderShape = el.DisplayRectangle; }
public ElementProperties(GraphicElement el) { this.element = el; borderShape = el.DisplayRectangle; Name = el.Name; }