public void Apply(ObjectState v) { State state = v as State; Invalidate(); invalidate_children(); style = state.style; type = state.type; nav = state.nav; for (int i = 1; i < ipoints.Count - 1; i++) { remove_child(ipoints[i] as GuiBound); } ipoints.Clear(); ipoints.Add(first); foreach (GuiPoint pt in state.ipoints) { ipoints.Add(pt); add_child(pt, null); } ipoints.Add(second); second.number_in_conn = ipoints.Count - 1; second.role.ux_bind = -ipoints.Count; first.Apply(state.p1); second.Apply(state.p2); notify_children(); invalidate_children(); Invalidate(); SetHidden(state.hidden); }
public GuiConnection(GuiConnectionPoint p1, GuiConnectionPoint p2, UmlRelationType t, StaticView par, GuiConnectionStyle style) { first = p1; second = p2; type = t; parent = par; this.style = style; nav = GuiConnectionNavigation.None; p1.parent = p2.parent = par; p1.root = p2.root = this; ipoints.Add(p1); ipoints.Add(p2); }
public void ChangeNavigationClick(object o, EventArgs ev) { ObjectState before = GetState(); this.Invalidate(); switch ((o as FlatMenuItem).Index) { case 0: // None nav = GuiConnectionNavigation.None; break; case 1: // Left nav = GuiConnectionNavigation.Left; break; case 2: // Right nav = GuiConnectionNavigation.Right; break; } this.Invalidate(); parent.Undo.Push(new StateOperation(this, before, GetState()), false); }