public DependencyArrow(UMLElement firstBlock, UMLElement secondBlock, Tips type) { if (!(firstBlock is UMLClassBox) || !(secondBlock is UMLClassBox)) { throw new Exception("Один из элементов пустой"); } fb = firstBlock as UMLClassBox; sb = secondBlock as UMLClassBox; fguid = fb.getGuid(); sguid = sb.getGuid(); mode = type; t = generateTip(type); switch (type) { case Tips.AssotiationArrow: case Tips.DerivArrow: case Tips.AggregationArrow: case Tips.CompositionArrow: r = new BetweenLine(getPointForFirstBLock(), t.GetEndPointForLine(), BetweenLine.Type.Solid); break; case Tips.DependenceArrow: case Tips.ImplementationArrow: r = new BetweenLine(getPointForFirstBLock(), t.GetEndPointForLine(), BetweenLine.Type.Dotted); break; } updateEvents(); fieldsSync(); fb.addObserver(this); sb.addObserver(this); }
public override void move(Point point, Canvas canvas) { t.removeGraphicFromCanvas(canvas); t = generateTip(mode); t.draw(canvas); r.updateGraphicPoints(new Point[] { t.GetEndPointForLine(), getPointForFirstBLock() }); updateEvents(); }