X and Y properties on GoBasicNode

My question is: does the GoBasicNode (or any of its inherited ancestors) have undocumented .X and .Y properties? It’s certainly possible I missed something, but I haven’t been able to see them.

I ask because I have a custom class derived from GoBasicNode in which I implement .X and .Y properties, which are populated from values in a database. When I then go to render my diagram, I follow these steps:

  1. Load data from the database, including populating the custom X and Y properties.
  2. Update the appearance of my derived node, including its size.
  3. Update the “Center” of my derived node based on the X/Y properties from the database.
  4. Plot the points on the GoView.

I’ve isolated the problem to a line in step #2, where the “Size” property is set.

// _FeatureType.Size is a short this.Size = new SizeF((float)_FeatureType.Size,(float)_FeatureType.Size);
The code above somehow changes the custom “X” and “Y” properties for my derived node. Note that changing the order of steps #2 and #3 above does not help solve the problem, though the effect is much greater if #3 occurs before #2.

Before I go and change my database and custom code to rename my X and Y properties, I was hoping that someone could provide insight here.

Thanks much,
Andrew

So your X/Y properties are referring to the Center of your node, right?

Perhaps the issue is that changing the Size of an object will change its Center value.
Perhaps another issue is that the Size of a node is not the same thing as the Size of a GoBasicNode.Shape, since the node also includes other child objects, such as the Label.

I use the X,Y properties to set the Center of the node later, correct.

I can understand that sizes of objects and shapes would have an effect on position(center). The real question is: why are my custom X,Y properties being affected at all? They’re implemented, as far as I can tell, completely independently of any GoXXX functionality. …Or are they?

My understanding is that as there is no GoBasicNode.X property, my DerivedBasicNode.X shouldn’t be affected by changing size/shape. But for some reason it is.

Hope that helps.

Yes, you’re right, GoDiagram does not define any X or any Y property or field. I guess you’re going to have to set a breakpoint in the setter, to see if it’s set at an unexpected time.