GoDiagram Web Reference
GoBasicNode Class
Members  Example 

A simple node with a Shape, a single Port and an optional text Label.
Syntax
'Declaration
 
<SerializableAttribute()>
Public Class GoBasicNode 
   Inherits GoNode
   Implements IGoCollectionIGoGraphPartIGoIdentifiablePartIGoLabeledNodeIGoLabeledPartIGoNode 
Remarks

By default the Shape is a GoEllipse. You can easily replace that shape with a GoRectangle or other GoShape. If you call the GoBasicNode Constructor(GoFigure) constructor, the shape will be a GoDrawing initialized to have that GoFigure.

The position and size of the Label relative to the Shape is determined by the LabelSpot property. When the spot is GoObject.Middle, the shape is automatically resized to fit the label's text (if AutoResizes is true) plus the MiddleLabelMargin, and the port is hidden and resized to be the same size as the shape itself.

When AutoResizes is false, the Label is sized to fit inside the bounds of the Shape, minus the margins. The label (a GoText) is automatically wrapped and clipped.

Since the default value for LabelSpot is GoObject.MiddleTop, you will need to explicitly set the LabelSpot to GoObject.Middle to get this appearance and behavior. Otherwise the default appearance is to have the Label be positioned outside of the Shape, with the Port small and positioned in the middle of the Shape.

Unless you set the Text or the Label property, there will be no Label. However, the GoBasicNode Constructor(GoFigure) constructor does create a Label, in addition to having the label be in the middle of the shape.

When the Shape is an instance of GoDrawing, you can get and set the Figure property, if you want to dynamically change the appearance of the node. More generally, you can modify that GoDrawing or replace the Shape with another kind of GoShape.

Setting the GoNode.Location, GoNode.Resizable, GoNode.Reshapable and GoNode.Shadowed properties actually set the same properties on the node's SelectionObject, which is the Shape.

Example
Typical usage might be something like:
GoBasicNode node1 = new GoBasicNode();
node1.LabelSpot = GoObject.Middle;
node1.Text = "basic node 1";
node1.Shape.BrushColor = Color.LightGreen;
node1.Location = new PointF(75, 50);
goView1.Document.Add(node1);
            
GoBasicNode node2 = new GoBasicNode(GoFigure.CreateRequest);
node2.Text = "basic node 2";
node2.Shape.BrushColor = Color.LightYellow;
node2.Location = new PointF(200, 50);
goView1.Document.Add(node2);
            
GoLink link = new GoLink();
link.ToArrow = true;
link.FromPort = node1.Port;
link.ToPort = node2.Port;
goView1.Document.Add(link);
Inheritance Hierarchy

System.Object
   Northwoods.GoWeb.GoObject
      Northwoods.GoWeb.GoGroup
         Northwoods.GoWeb.GoNode
            Northwoods.GoWeb.GoBasicNode

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GoBasicNode Members
Northwoods.GoWeb Namespace

 

 


© 2013. Northwoods Software Corporation. All Rights Reserved.

Send Feedback