Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Use of setExpandable(true) in my Situation (Read 3689 times)
Ashutosh
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 24th, 2008
Use of setExpandable(true) in my Situation
Dec 2nd, 2008 at 7:20am
Print Post  
Hi All,

I am Generating a flowchart of any given input source code using JDiagram .
I want to hide a part of flowchart, I have already tried
node.setExpandable(true).


But my problem is that : - After using node.setExpandable(true) when I click on some node it will shirnk the whole diagram under it. But i want that only a part of diagram to collapse on clicking that node, and the portion above and below the required portions remains the same.

For example if a block conatins loop statements . Now If one wants to show detaiiled
statemts of that loop only, and wants that remaing diagram remains the same.
I am not clear with the approach,How do I proceed. Are there any other method by
which I can achive this .

If you provide me some sample code lines, it would be more beneficial for me.


Please Guide me.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Use of setExpandable(true) in my Situation
Reply #1 - Dec 2nd, 2008 at 9:56am
Print Post  
Hi,

You could handle the TreeCollapsed event, expand the children of the collapsed node, and hide the ones you wish to remain hidden.

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 24th, 2008
Re: Use of setExpandable(true) in my Situation
Reply #2 - Dec 2nd, 2008 at 12:10pm
Print Post  
Hi , I havnt Got , what u described in the reply, Please be more elaborative.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Use of setExpandable(true) in my Situation
Reply #3 - Dec 4th, 2008 at 12:16pm
Print Post  
We have ported the ExpandButtonAction property from the .NET version, which should help in your situation:

https://mindfusion.eu/_beta/jdiag_expand.zip

Set it to RaiseEvents, and it will stop the standard tree expand/collapse processing, and will only raise the ExpandButtonClicked event. Handle the event by calling DiagramItem.setVisible(false) for the items you need to hide.

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 24th, 2008
Re: Use of setExpandable(true) in my Situation
Reply #4 - Dec 9th, 2008 at 11:59am
Print Post  
Hi,
   I have used nodeClicked() method in DiagramListener, and in this method
   i am changing setExpanded(true/false) properties of ShapeNodes, to hide respect nodes and show others.
  I am able to hide the nodes i want ,by changing there Expanded properties or setting setVisible(false),
  The problem is :- "If i am hiding the nodes , The nodes which are not hided retains there location ,
there location doesnot change accordingly."


For eg.
If there are 8 nodes in my flow chart
  I want to hide 3,4,5 nodes and want 1,2,6,7,8 nodes to be visible when I click on 2nd node, 
  so 6th node should take position of  3rd node while the 3,4,5 are collapsed.
As soon as 3,4,5 are expanded 6 should retain its old location(i.e after 5).

I am able to hide the nodes but not able to change the location of 6th node to 3rd node and again adjust 6th node's position after 5th(when expanded)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Use of setExpandable(true) in my Situation
Reply #5 - Dec 9th, 2008 at 2:24pm
Print Post  
Perhaps you should also call node.setIgnoreLayout(true) if you are using TreeLayout.

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 24th, 2008
Re: Use of setExpandable(true) in my Situation
Reply #6 - Dec 10th, 2008 at 6:30am
Print Post  
Dear Stoyo,
I am Not using Tree Layout (infect i am not using any layout) . I embedded the class which extends DiagramView into my GUI,and  which is a swing based GUI.

Please Guide me , what to do ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Use of setExpandable(true) in my Situation
Reply #7 - Dec 10th, 2008 at 10:06am
Print Post  
Are you asking how to move programmatically a visible node so that it occupies the position of an invisible one? That should look like:

visibleNode.setBounds(invisibleNode.getBounds());

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