Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Determining FlowChart size (Read 6533 times)
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Determining FlowChart size
May 8th, 2007 at 9:35am
Print Post  
I don't really understand what determines the FlowChart's size.
I've create a new FlowChart and inserted it in JScrollPane. I can see that it spreads beyond the screen - although it was just created and it's empty.
???
I've tried using setPreferredSize and setMaximumSize - still with no success. The chart still seems to be bigger than the visible screen.
Why is that? How can I shrink this chart?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Determining FlowChart size
Reply #1 - May 8th, 2007 at 9:46am
Print Post  
FlowChart.setDocBounds() does that.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Determining FlowChart size
Reply #2 - May 8th, 2007 at 10:28am
Print Post  
Isn't there a way to use an automatic size?
What I need is to have a chart in a panel. Once the items in the chart exceed its limits, then scrollbars will appear, but until then the chart will retain it's minimal size. This is quite the same as SWING components behavior - retaining their minimal sizes but expand in case of need.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Determining FlowChart size
Reply #3 - May 8th, 2007 at 10:44am
Print Post  
There is something similar. You could use setDocBounds to set the initial size, and call FlowChart.setAutoSizeDoc(AutoSize.AllDirections). That will make the document size increase automatically when users draw new items. setAutoSizeDoc does not work for items that are created programmatically. You could call FlowChart.resizeToFitItems() to set the document size after creating items from code.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Determining FlowChart size
Reply #4 - May 8th, 2007 at 10:49am
Print Post  
This sounds like it solves most of the issues.
If there will be a feature in the future the resizes to fit but don't shrink more than a minimum given size - please tell me. This wil solve all the issues.
Thanks!
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Determining FlowChart size
Reply #5 - May 8th, 2007 at 11:14am
Print Post  
I think setAutoSizeDoc() won't shrink the size past the initial DocBounds. We can also add a minSize parameter to resizeToFitItems() and use it as the minimum size.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Determining FlowChart size
Reply #6 - May 8th, 2007 at 11:59am
Print Post  
This will be great, since I will use only resizeToFitItems(). I use a static graph that is created by program.
Thanks,
Yoav
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint