Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Issue with changing the shapes of diagram node (Read 1975 times)
chiru29
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 35
Location: Hyderabad
Joined: Jul 16th, 2010
Issue with changing the shapes of diagram node
Jul 28th, 2010 at 10:52am
Print Post  
Hi,

I have a Diagram Node which has a default shape.

In DrawNode event, i am changing the Shape of the node to other Bpmn predefined shapes.

Here UI is not rendering properly.
Is this because the Draw node event is continously firing? what could be the resolution for this?


thanks
Chiru
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Issue with changing the shapes of diagram node
Reply #1 - Jul 28th, 2010 at 11:52am
Print Post  
Hi,

When this event is raised, the node has already been rendered with its current shape, and then changing the Shape property will invalidate the view and cause DrawNode to be called again.

If you need to draw a BPMN shape only as an element of a custom-drawn node, you could call Shapes.BpmnWhatever.Draw(...). This will render the shape in its default 100x100 coordinate space. You can apply translate and scale transforms to the graphics object to render the shape with a different size and position.

Another option is to use composition instead of custom drawing, e.g. you can attach additional ShapeNodes to the node and set their shapes to Bpmn.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
chiru29
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 35
Location: Hyderabad
Joined: Jul 16th, 2010
Re: Issue with changing the shapes of diagram node
Reply #2 - Jul 29th, 2010 at 9:30am
Print Post  
Thanks Stoyan.

I have another issue.

In my code earlier i have like:
ChartObject.ShadowColor = Color.Transparent;
ChartObject is a ChartObject from FlowchartX.

Now, we are upgrading to Diagramming version.
So, i have updated the above line with

ChartObject.ShadowBrush = new MindFusion.Drawing.SolidBrush(Color.Transparent);

Here ChartObject is a Diagramming Node.

But this line is causing an issue, by firing DrawNode event again.

Can you please advice me, any alternatives for this?

thanks
Chiru
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Issue with changing the shapes of diagram node
Reply #3 - Jul 29th, 2010 at 10:59am
Print Post  
Hi,

You can set ShadowBrush to null to hide the shadow.

Setting any visual property invalidates a part of the diagram and might lead to DrawNode event raised again for custom-drawn nodes. In the DrawNode handler you are supposed to call e.Graphics methods to draw custom graphics, and not change the node's properties from it.

What exactly are you trying to draw anyway?

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint