SubGraph collapsible object


Im using the MultiPortSubGraph and i have a problem with the collapse handle. look at the picture:
all the container objects are subgraphs and they have a Yellow collapse handle.
1. how do i change the color of the collapse handle?
2. the behavior of the collapse handle is not consistent. sometimes when i collpase the handle remains in the top-left corner and sometimes it moves to the middle of the subgraph (look at sequence1 in the top parallel execution subgraph and sequence 1 in the second parallel execution)
i want it to stay allways in the top-left corner of the subgraph.
how do i do that?
  1. this.Handle.Brush = Brushes.Pink;
2. Can you reproduce this in SubGraphApp, or is this behavior that is unique to your app?

I will check the subGraphApp but i just wanted to tell you that the differnce between the top sequence1 subgraph and the one below it is that the top sg has go objects inside it and the one below it doesn’t have. maybe this causes the problem and takes the handle to the middle?
make sense?


Yes, you should have something inside your subgraphs, other than the standard Handle and Label.

Wlater, i’m confused.
i cannot just put something inside the subgraph just to make the handle move. can’t i control it by overriding some method?
one more thing, if you look at the picture you can see that the subgraph named sequnce2 (in the lower parallel execution) contains 2 nodes and a link. the “problematic” subgraph (sequence1) contains just the same objects so its not really empty. its empty just from the end user experience.

Hope you can help.

If that “Sequence1” (in the lower “Parallel Execution”) has the same round start and end nodes as the “Sequence2”, I’m surprised. If they are implemented the same way and contain the copies of the same child objects, they ought to look and act the same way.

Now that you mention it, I notice that the upper “Sequence1” doesn’t look quite right either. Does it have the green and red round start and end nodes?

Yes, “Sequence1” has the same nodes as “Sequence2” look at the following picture:

this is how they look before i collapse them. now look what happens when i collapse the subGraphs:
now i put nodes inside them:
now when i collapse they look OK. just because i've added the nodes inside them:
regarding your question, the upper "sequence1" has round start & end nodes but its collapse handle stays in the upper left corner so for me its OK.
what do you say?

You could try using a GoSubGraph.CollapsedObject to make sure the collapsed subgraph is the size you want. The following code does that by using a GoRectangle that doesn’t paint anything.

protected override GoObject CreateCollapsedObject() { GoRectangle r = new GoRectangle(); r.Brush = null; r.Pen = null; r.Size = new SizeF(100, 20); // big enough to surround the Label r.Selectable = false; return r; }
You could also try changing the value of GoSubGraph.CollapsedLabelSpot, which controls where the Label is relative to the CollapsedObject when the subgraph is collapsed.

I know you done other customizations regarding size, so I don’t know how this might interact with them in your environment.