public ModifyVariable(Wrappers.Wrapper wrapped, Cdn.Variable property, Cdn.VariableFlags flags) : base(wrapped, property) { d_expression = null; d_flags = flags; d_previousFlags = property.Flags; }
private void HandleChildRemoved(Wrappers.Node source, Wrappers.Wrapper child) { Wrappers.Node grp = child as Wrappers.Node; if (grp == null) { return; } if (d_pathWidgets.ContainsKey(grp)) { int start = d_pathGroups.IndexOf(grp); for (int i = start; i < d_pathGroups.Count; ++i) { d_pathGroups[i].ChildRemoved -= HandleChildRemoved; d_pathWidgets.Remove(d_pathGroups[i]); if (d_pathGroups[i] == d_active) { d_active = null; } } d_pathGroups.RemoveRange(start, d_pathGroups.Count - start); Widget[] children = Children; for (int i = start * 2 - 1; i < children.Length; ++i) { children[i].Destroy(); } } }
public Variable(Wrappers.Network network, Widgets.Window parent, Wrappers.Wrapper obj) { d_object = obj; DestroyWithParent = true; TransientFor = parent; HasSeparator = false; if (obj is Wrappers.Edge) { SetDefaultSize(600, 300); } else { SetDefaultSize(400, 300); } d_view = new Widgets.Editors.Wrapper(d_object, parent.Actions, network); d_view.BorderWidth = 6; VBox.PackStart(d_view, true, true, 0); d_object.VariableChanged += delegate(Wrappers.Wrapper source, Cdn.Variable name) { UpdateTitle(); }; VBox.ShowAll(); AddButton(Gtk.Stock.Close, ResponseType.Close); UpdateTitle(); }
public Edge(Cdn.Edge obj, Wrappers.Wrapper from, Wrappers.Wrapper to) : base(obj) { Renderer = new Renderers.Edge(this); if (obj != null && from != null) { obj.Input = from; } UpdateFrom(); if (obj != null && to != null) { obj.Output = to; } UpdateTo(); obj.AddNotification("output", OnToChanged); obj.AddNotification("input", OnFromChanged); obj.ActionAdded += HandleActionAdded; obj.ActionRemoved += HandleActionRemoved; CalculateAnchors(); }
public Variable(Wrappers.Wrapper wrapped, string name, string expression, Cdn.VariableFlags flags) { d_wrapped = wrapped; d_name = name; d_expression = expression; d_flags = flags; }
public Wrapper(Wrappers.Wrapper wrapper, Actions actions, Wrappers.Network network) : base(false, 6) { d_wrapper = wrapper; d_actions = actions; d_network = network; Build(); }
public Box(Wrappers.Wrapper obj) : base(obj) { d_object = obj; d_hoverColor = new double[] { 0.3, 0.6, 0.3, 0.6 }; d_linkColor = new double[] { 0.9, 0.9, 0.1, 1.0 }; d_radius = 0.3; MakePatterns(); }
public MoveObject(Wrappers.Wrapper wrapped, int dx, int dy) : base(null, wrapped) { d_dx = dx; d_dy = dy; // The merged group stuff is to support merging with a group whos first action // is also a move. This is kind of an ugly hack to make applying a dangling // link using DND more usable d_mergedGroup = null; }
public Variables(Wrappers.Wrapper wrapper, Actions actions) { d_wrapper = wrapper; d_actions = actions; d_blockInterfaceRemove = false; WidgetFlags |= WidgetFlags.NoWindow; Build(); }
public WrapperNode(Widget widget, Wrappers.Wrapper wrapper, GLib.Object obj) { d_widget = widget; d_wrapper = wrapper; d_object = obj; d_icon = WrapperIcon(); d_inconsistent = new List <WrapperNode>(); if (d_wrapper != null) { Wrappers.Node grp = wrapper as Wrappers.Node; if (grp != null) { grp.ChildAdded += OnChildAdded; grp.ChildRemoved += OnChildRemoved; foreach (Wrappers.Wrapper wr in grp.Children) { OnChildAdded(grp, wr); } } Wrappers.Edge link = wrapper as Wrappers.Edge; if (link != null) { d_wrapper.WrappedObject.AddNotification("from", OnLinkChanged); d_wrapper.WrappedObject.AddNotification("to", OnLinkChanged); } d_wrapper.WrappedObject.AddNotification("id", OnIdChanged); d_wrapper.VariableAdded += OnVariableAdded; d_wrapper.VariableRemoved += OnVariableRemoved; foreach (Cdn.Variable prop in d_wrapper.WrappedObject.Variables) { OnVariableAdded(wrapper, prop); } } if (d_object != null) { if (d_object is Cdn.Variable) { d_object.AddNotification("name", OnIdChanged); } else if (d_object is Cdn.EdgeAction) { d_object.AddNotification("target", OnIdChanged); } } }
public Object(Wrappers.Wrapper obj, Actions actions, Wrappers.Network network) : base(false, 6) { d_actions = actions; d_object = obj; d_network = network; Build(); Sensitive = (d_object != null); Connect(); }
public Node(Wrappers.Wrapper obj) : base(obj) { d_node = obj as Wrappers.Node; d_colors = new double[5][]; d_colors[0] = new double[] { 26 / 125.0, 80 / 125.0, 130 / 125.0 }; d_colors[1] = new double[] { 80 / 125.0, 26 / 125.0, 130 / 125.0 }; d_colors[2] = new double[] { 26 / 125.0, 130 / 125.0, 80 / 125.0 }; d_colors[3] = new double[] { 130 / 125.0, 80 / 125.0, 26 / 125.0 }; d_colors[4] = new double[] { 80.0 / 125.0, 130.0 / 125.0, 26.0 / 125.0 }; }
private void OnVariableRemoved(Wrappers.Wrapper wrapper, Cdn.Variable property) { foreach (WrapperNode node in AllChildren) { if (node.d_object == property) { Remove(node); break; } } }
private void OnChildRemoved(Wrappers.Node grp, Wrappers.Wrapper child) { foreach (WrapperNode node in AllChildren) { if (node.Wrapper == child) { Remove(node); break; } } }
public Object(Wrappers.Node parent, Wrappers.Wrapper wrapped) { d_parent = parent; d_wrapped = wrapped; d_templates = new List <Wrappers.Wrapper>(); Wrappers.Edge link = wrapped as Wrappers.Edge; if (link != null) { d_from = link.Input; d_to = link.Output; } }
private void DoVariableAdded(Wrappers.Wrapper obj, Cdn.Variable prop) { Node node = new Node(prop); d_treeview.NodeStore.Remove(d_dummy); d_treeview.NodeStore.Add(node); d_treeview.NodeStore.Add(d_dummy); if (d_selectProperty) { d_treeview.Selection.UnselectAll(); d_treeview.Selection.SelectPath(node.Path); d_treeview.SetCursor(node.Path, d_treeview.GetColumn(0), true); } }
private void RecalculateLinkOffsets(Wrappers.Wrapper o1, Wrappers.Wrapper o2) { if (o1 == null || o2 == null) { return; } // See how many links there are between o1 and o2 List <Wrappers.Edge> d1 = new List <Wrappers.Edge>(); // From o1 to o2 foreach (Wrappers.Edge l in o2.Links) { if (l.Input == o1) { d1.Add(l); } } List <Wrappers.Edge> d2 = new List <Wrappers.Edge>(); // From o2 to o1 foreach (Wrappers.Edge l in o1.Links) { if (l.Input == o2) { d2.Add(l); } } int baseOffset = (d1.Count == 0 || d2.Count == 0) ? 0 : 1; for (int i = 0; i < d1.Count; ++i) { d1[i].Offset = i + baseOffset; } for (int i = 0; i < d2.Count; ++i) { d2[i].Offset = i + baseOffset; } }
private void MergeAnnotations(Wrappers.Wrapper original, Wrappers.Wrapper imported) { imported.Allocation = original.Allocation.Copy(); Wrappers.Node grp = original as Wrappers.Node; Wrappers.Node imp = imported as Wrappers.Node; if (grp != null) { foreach (Wrappers.Wrapper wrapper in grp.Children) { Wrappers.Wrapper other = imp.GetChild(wrapper.Id); if (other != null) { MergeAnnotations(wrapper, other); } } } }
override public void Dispose() { base.Dispose(); if (d_wrapper != null) { d_wrapper.WrappedObject.RemoveNotification("from", OnLinkChanged); d_wrapper.WrappedObject.RemoveNotification("to", OnLinkChanged); d_wrapper.WrappedObject.RemoveNotification("id", OnIdChanged); Wrappers.Node grp = d_wrapper as Wrappers.Node; if (grp != null) { grp.ChildAdded -= OnChildAdded; grp.ChildRemoved -= OnChildRemoved; } d_wrapper.VariableAdded -= OnVariableAdded; d_wrapper.VariableRemoved -= OnVariableRemoved; } if (d_object != null) { if (d_object is Cdn.Variable) { d_object.RemoveNotification("name", OnIdChanged); } else if (d_object is Cdn.EdgeAction) { d_object.RemoveNotification("target", OnIdChanged); } d_object = null; } d_wrapper = null; }
private void DoRemoveProperty() { List <Undo.IAction> actions = new List <Undo.IAction>(); foreach (TreePath path in d_treeview.Selection.GetSelectedRows()) { Node node = d_treeview.NodeStore.FindPath(path); if (node == d_dummy) { continue; } Wrappers.Wrapper temp = d_wrapper.GetVariableTemplate(node.Variable, false); if (temp != null) { Cdn.Variable tempProp = temp.Variable(node.Variable.Name); actions.Add(new Undo.ModifyVariable(d_wrapper, node.Variable, tempProp.Expression.AsString)); actions.Add(new Undo.ModifyVariable(d_wrapper, node.Variable, tempProp.Flags)); } else { actions.Add(new Undo.RemoveVariable(d_wrapper, node.Variable)); } } try { d_actions.Do(new Undo.Group(actions)); } catch (GLib.GException err) { // Display could not remove, or something Error(this, err); } }
public abstract DTO.CMState ProcessMessage(Wrappers.Wrapper wrapper);
public UnapplyTemplate(Wrappers.Wrapper obj, Wrappers.Wrapper template) : base(obj, template) { }
public ModifyObjectId(Wrappers.Wrapper wrapped, string id) : base(wrapped.Parent, wrapped) { d_id = id; d_prevId = wrapped.Id; }
public RemoveObject(Wrappers.Node parent, Wrappers.Wrapper wrapped) : base(parent, wrapped) { }
public RemoveObject(Wrappers.Wrapper wrapped) : this(wrapped.Parent, wrapped) { }
public RemoveVariable(Wrappers.Wrapper wrapped, Cdn.Variable property) : base(wrapped, property) { }
public Edge(Wrappers.Wrapper obj) : base(obj) { }
public ModifyVariable(Wrappers.Wrapper wrapped, Cdn.Variable property, string expression) : base(wrapped, property) { d_expression = expression == null ? "" : expression; d_previousExpression = property.Expression.AsString; }
public AddObject(Wrappers.Node parent, Wrappers.Wrapper wrapped) : base(parent, wrapped) { }
public bool ImportsObject(Wrappers.Wrapper obj) { return(WrappedObject.ImportsObject(obj)); }