/// <summary> /// Create a GoTextNode with four ports and a <see cref="T:Northwoods.Go.GoDrawing" /> background, /// initialized to have the figure <paramref name="fig" />. /// </summary> /// <param name="fig">a <see cref="T:Northwoods.Go.GoFigure" /> enumeration value</param> /// <remarks> /// This constructor basically does the following, but more efficiently: /// <pre><code> /// GoTextNode n = new GoTextNode(); /// n.Background = new GoDrawing(fig); /// </code></pre> /// </remarks> public GoTextNode(GoFigure fig) { base.InternalFlags &= -17; base.InternalFlags |= 16908288; myBack = new GoDrawing(fig) { Selectable = false, Resizable = false, Reshapable = false, Brush = GoShape.Brushes_LightGray }; Add(myBack); myLabel = CreateLabel(); Add(myLabel); myTopPort = CreatePort(32); Add(myTopPort); myRightPort = CreatePort(64); Add(myRightPort); myBottomPort = CreatePort(128); Add(myBottomPort); myLeftPort = CreatePort(256); Add(myLeftPort); base.Initializing = false; LayoutChildren(null); }
/// <summary> /// Create a GoBasicNode with a port and a label and a <see cref="T:Northwoods.Go.GoDrawing" /> shape, /// initialized to have the figure <paramref name="fig" /> and a Middle <see cref="P:Northwoods.Go.GoBasicNode.LabelSpot" />. /// </summary> /// <param name="fig">a <see cref="T:Northwoods.Go.GoFigure" /> enumeration value</param> /// <remarks> /// This constructor basically does the following, but more efficiently: /// <pre><code> /// GoBasicNode n = new GoBasicNode(); /// n.LabelSpot = GoObject.Middle; /// n.Text = ""; /// n.Shape = new GoDrawing(fig); /// </code></pre> /// </remarks> public GoBasicNode(GoFigure fig) { base.InternalFlags |= 16908288; myLabelSpot = 1; myShape = new GoDrawing(fig); myShape.Selectable = false; myShape.Resizable = false; myShape.Reshapable = false; myShape.Brush = GoShape.Brushes_White; myPort = CreatePort(); myPort.Style = GoPortStyle.None; myLabel = CreateLabel(""); Add(myShape); Add(myPort); Add(myLabel); if (myPort != null) { myPort.PortObject = myShape; } base.PropertiesDelegatedToSelectionObject = true; base.Initializing = false; LayoutChildren(null); }