Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Diagram queries (Read 8813 times)
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Diagram queries
Sep 14th, 2009 at 7:15am
Print Post  
Hi,

I need to get structure in the diagram (for the required structure I had already sent a mail to support@mindfusion.eu headed "Diagram queries")?

Can this be implemented using the LaneDiagram.

Here the two structures(Header x and Header Y) have different number of rows.

How can we also get the following specifications:

* If lanes concept be applied then how the size of node should be proportional to the number of rows occupied by it in laneDiagram.

* When we drag the nodes from one place to another within one group(Say in Header X) then can a tooltip be made available indicating we are over which row of lane grid and on drop place the node at that row position occupying the same no of rows it was occupying earlier.

* Can a thumb lever be provided to each node(as in fig. attached) when the node is selected.Also the drag/drop of lever performs the same functionality as of the drag/drop for node.

Thanks,
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram queries
Reply #1 - Sep 14th, 2009 at 10:13am
Print Post  
Hi,

You can't have two lane grids, nor columns with a different number of rows in them. You can implement your X/Y Head structures using ShapeNodes, possibly with the head child nodes attached to them. You can implement the thumb thing by setting HandlesStyle to Custom and handling DrawAdjustmentHandles and HitTestAdjustmentHandles.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Re: Diagram queries
Reply #2 - Sep 14th, 2009 at 12:05pm
Print Post  
Hi Stoyan,

Thanks for the suggestion.

I have some queries in this

1). Can I use Rect instead of ShapeNode? This Rect will contain all the nodes and in this way can we put two Rect in the diagram?

2). Is it possible to Drag and Drop nodes within the Rect only, in which it is placed?

3). What wil be the custom implementation for thumb handle?

4). Can we divide each Rect into a given number of rows so that placement of nodes within the Rect be done corresponding to Rows?

As I am new to Diagramming, could you please provide me a sample so that I can start working on it.

Many thanks in advance,
Priyanka
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram queries
Reply #3 - Sep 14th, 2009 at 1:32pm
Print Post  
Hi Priyanka,

1. It could be either a ShapeNode whose Shape property is set to Shapes.Rectangle, or otherwise a DiagramNodeAdapter that wraps a Rectangle object.

2. If you call childNode.AttachTo(rect, ...), you might enable node.Constraints.KeepInsideParent to prevent from dragging the children outside.

3. It could be a call to the DrawingContext.DrawImage method in the DrawAdjustmentHandles event handler, or perhaps another attached node that just displays the image.

4. Yes, you could designate some value as a row height, and upon NodeModified, divide (childNode.Bounds.Y - containerNode.Bounds.Y) by that value to find out the row index. You could then shift the remaining node down if they should not overlap.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Re: Diagram queries
Reply #4 - Sep 15th, 2009 at 2:40pm
Print Post  
Hi,

Thanks for your reply..!!!!
The idea worked...!!!!

I am facing the following issues when come to development.

PLEASE REFER THE MAIL(with a sample project attached ) SENT TITLED "Diagram queries - Attached Sample Project" FOR THE ELEMENTS I AM TALKING ABOUT...!!!!


* I am not able to drag n drop "Element E" till the end of pink diagram whereas I am able to drag "Element B".
what could be the reason...can you please help for..
Also if we select Element E and give a Value in StartFrom text box as 28 and the press Go button it moves to the desired location

* Is there any way to make the child nodes Center Aligned for the parent shape node.

* Also when we drag Element B from one place to another it moves from back of all the nodes except for Element A(moves from front).
Is there a way to make all the nodes move from FRONT.

* I am not able to create a thumb handle for the nodes. Can u please add sample code to the project for it.



Thanks for your replay in advance....
  
Back to top
 
IP Logged
 
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Re: Diagram queries
Reply #5 - Sep 16th, 2009 at 6:03am
Print Post  
Hi,

I forgot to specify the StartFrom TextBox in the Application.
Its the first text box which is placed after the Click button.

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram queries
Reply #6 - Sep 16th, 2009 at 6:21am
Print Post  
Quote:
* I am not able to drag n drop "Element E" till the end of pink diagram whereas I am able to drag "Element B".
what could be the reason...can you please help for..


This happens because of the automatic grid alignment. Moving Element E further down and aligning it to the grid would move the element outside the pink container, and the Constraint.KeepInsideParent prevents you from doing that. You can solve this by setting diagram.AlignToGrid = false.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram queries
Reply #7 - Sep 16th, 2009 at 6:34am
Print Post  
Quote:
* Is there any way to make the child nodes Center Aligned for the parent shape node.


Aren't they already?

Quote:
* Also when we drag Element B from one place to another it moves from back of all the nodes except for Element A(moves from front). Is there a way to make all the nodes move from FRONT.


Our Z order sorting function should do that if SelectionOnTop is enabled, but it seems it doesn't work correctly for child nodes in a group. Our developer will check this.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram queries
Reply #8 - Sep 16th, 2009 at 6:48am
Print Post  
Quote:
* I am not able to create a thumb handle for the nodes. Can u please add sample code to the project for it.


Code
Select All
diagram.DrawAdjustmentHandles += new DrawItemEventHandler(diagram_DrawAdjustmentHandles);
diagram.HitTestAdjustmentHandles += new HitTestEventHandler(diagram_HitTestAdjustmentHandles);

void diagram_HitTestAdjustmentHandles(object sender, HitTestEventArgs e)
{
	// this is in diagram coordinates
	Rect r = e.Item.GetBounds();
	r.X -= 20;
	r.Width = 15;
	if (r.Contains(e.MousePosition))
		e.HitResult = 8; // move
}

void diagram_DrawAdjustmentHandles(object sender, DrawItemEventArgs e)
{
	// this is in local coordinates
	Rect r = e.Item.GetBounds();
	r.Y = 0;
	r.Width = 15;
	r.X = -20;
	e.Graphics.DrawRectangle(Brushes.AliceBlue, new Pen(), r);
} 



and also set childNode.HandlesStyle = HandlesStyle.Custom when creating the nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Re: Diagram queries
Reply #9 - Sep 16th, 2009 at 7:15am
Print Post  
Hi,

Thanks for all your replies.....

All worked.....!!!!!  Cheesy

All what I am not able to do now is setting both the custom handle and also a hatch frame for the a node

I am dong something like:
childNode.HandlesStyle = HandlesStyle.Custom | HandlesStyle.HatchFrame;

but is able to get only the hatchFrame handle and not able to see the thumb handle....

Can u please suggest what could be done...

Many thanks again for your help...!!!!!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram queries
Reply #10 - Sep 16th, 2009 at 1:54pm
Print Post  
Hi,

It's not possible to combine the HandlesStyle flags, though we could implement that at least for the Custom member. Now you could trick the node into rendering some of the standard handles like this:

Code
Select All
void diagram_DrawAdjustmentHandles(object sender, DrawItemEventArgs e)
{
	// this is in local coordinates
	Rect r = e.Item.GetBounds();
	r.Y = 0;
	r.Width = 15;
	r.X = -20;
	e.Graphics.DrawRectangle(Brushes.AliceBlue, new Pen(), r);

	DiagramNode node = e.Item as DiagramNode;
vif (node != null)
	{
		node.HandlesStyle = HandlesStyle.HatchHandles;
		node.DrawHandles(e.Graphics, Brushes.Black);
		node.HandlesStyle = HandlesStyle.Custom;
	}
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Re: Diagram queries
Reply #11 - Sep 17th, 2009 at 5:33am
Print Post  
Hi,

Thanks,

But doing so also I am able to move to nodes only with the help of custom handle which appear.

I am not able to catch and drag drop the node just by selecting the node, I always need to hold the handle and then only I can move the node.

Is there any way to drag/drop the node by both the Custom Handle or by jst holding the selected node and drag/drop it.

Thanks,
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram queries
Reply #12 - Sep 17th, 2009 at 1:25pm
Print Post  
Change the hit-test handler to this:

Code
Select All
void diagram_HitTestAdjustmentHandles(object sender, HitTestEventArgs e)
{
	// this is in diagram coordinates
	Rect r1 = e.Item.GetBounds();
	Rect r2 = r1;
	r2.X -= 20;
	r2.Width = 15;
	if (r1.Contains(e.MousePosition) ||
		r2.Contains(e.MousePosition))
		e.HitResult = 8; // move
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Re: Diagram queries
Reply #13 - Oct 9th, 2009 at 11:11am
Print Post  
Hi,

I need to make some shapeNodes in my Diagram to be not affected when I Zoom In/Out on the diagram i.e. I want some of the nodes to be of the same size as defined, even when zoom operations are performed on the diagtam.

Or can this functionality be made available on any other object on Diagram.????

Please provide some inputs.!!!!

Thanks,
Priyanka
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram queries
Reply #14 - Oct 9th, 2009 at 7:09pm
Print Post  
Try appending a ScaleTransform to the node's RenderTransform such that the scaleX/Y values are equal to 100/ZoomFactor.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint