Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Overview diagram shrinks when zooming out (Read 13528 times)
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Overview diagram shrinks when zooming out
Sep 18th, 2007 at 11:55am
Print Post  
It happens when I zoom out of the main diagram.
In the overview, The red rectangle grew larger until it filled the entire Overview and stayed that size.
After the main diagram's size became smaller than the Overview's and I continued to zoom out - the diagram inside the Overview started becoming smaller and smaller as well.
As far as I understand the Overview concept - the diagram inside should stay the same all the time and only the rectangle needs to change.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview diagram shrinks when zooming out
Reply #1 - Sep 18th, 2007 at 12:21pm
Print Post  
The diagram image inside the overview should not change in size when in FitAll mode. Call the Overview.setFitAll(true) method to enable that mode. Otherwise the overview's ScaleFactor is combined with the diagram's one and the overview follows the diagram's zoom level.

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



Posts: 163
Joined: May 2nd, 2007
Re: Overview diagram shrinks when zooming out
Reply #2 - Sep 18th, 2007 at 12:26pm
Print Post  
The Overview is in FitAll(true) all the time.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview diagram shrinks when zooming out
Reply #3 - Sep 18th, 2007 at 1:20pm
Print Post  
Actually the overview does not allow using a scale larger than the diagram's one, which would happen if a very small zoom factor is set in the FlowChart object. If you wish to enable this, replace the last line in the void fit() method in FlowChart.java -

scaleFactor = Math.min(100.0f, 100.0f / ratio);

with

scaleFactor = 100.0f / ratio;

Or disable setting a zoom factor that would make the diagram smaller than its containing frame.

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



Posts: 163
Joined: May 2nd, 2007
Re: Overview diagram shrinks when zooming out
Reply #4 - Sep 18th, 2007 at 2:27pm
Print Post  
Hi,

I looked everywhere but couldn't find a method fit() in FlowChart (or the code "scaleFactor = Math.min(100.0f, 100.0f / ratio);").

If I want to use the second option, meaning: "disable setting a zoom factor that would make the diagram smaller than its containing frame" - how can I know what is the zoom factor of the Overview so I will set is as minimum?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview diagram shrinks when zooming out
Reply #5 - Sep 18th, 2007 at 3:45pm
Print Post  
Hi,

Ok, that method is in Overview.java.

If you prefer to disable zoom out to a very small scale - take a look at how the overview's scaleFactor is calculated in fit(). Use a similar code to check if the new zoom you would set will lead to scaleFactor > 100, and if so - disable the zoom out command in your application.

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



Posts: 163
Joined: May 2nd, 2007
Re: Overview diagram shrinks when zooming out
Reply #6 - Sep 19th, 2007 at 4:59am
Print Post  
Hi,

I can't override the fit() method since it's private, so extending Overview class won't work. I can't also use the getTransform() that is used inside the fit() code since it's private either.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview diagram shrinks when zooming out
Reply #7 - Sep 19th, 2007 at 6:44am
Print Post  
Hi,

I've meant you can modify the code and rebuild the .jar file to enable the overview's scale to be larger than the flowchart's one. That's until we decide why that check is there at all. It has been ported from the ActiveX version of the overview, which is several years old, and now we can't see a reason why it should be there  Undecided

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



Posts: 163
Joined: May 2nd, 2007
Re: Overview diagram shrinks when zooming out
Reply #8 - Oct 21st, 2007 at 2:33pm
Print Post  
Hi,
I'd rather not rebuild the Jar you've provided with my code. Once this door is opened, it means that I'll need to maintain all code changes each time you have a new version/fix. I'd rather not take the risk that I won't update the code correctly or that my fixes will be overriden.
Please tell me if you plan to fix it.
Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview diagram shrinks when zooming out
Reply #9 - Oct 22nd, 2007 at 11:32am
Print Post  
Hi,

I have sent you another PM with a version that removes this limitation.

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



Posts: 163
Joined: May 2nd, 2007
Re: Overview diagram shrinks when zooming out
Reply #10 - Oct 30th, 2007 at 11:10am
Print Post  
Thanks.
After replacing the Jar - suddenly the Overview disappears and I can't seem to be able to make it visible.
Do you know why?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview diagram shrinks when zooming out
Reply #11 - Oct 30th, 2007 at 11:19am
Print Post  
It works ok in my test project. What is your Overview initialization code, and the flowchart's initial zoom level?

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



Posts: 163
Joined: May 2nd, 2007
Re: Overview diagram shrinks when zooming out
Reply #12 - Nov 1st, 2007 at 10:49am
Print Post  
The code is quite simple.
I've extended Overview class.
In the constructor I run:

setDocument(_flowChart);

I've debugged and saw that _flowChart is not null and holds the one and only flowchart object.
About zoom: after FlowChart is created no zoom function runs. Only the size is changed with:

resizeToFitItems(50);

Is there any more information I can give? Debug something in the Overview class (I'll need the new code to do that).

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Overview diagram shrinks when zooming out
Reply #13 - Nov 1st, 2007 at 11:09am
Print Post  
How big is your flowchart after calling resizeToFitItems()?

The only thing we have changed in the Overview in the last three months is changing a line in the fit() method from

scaleFactor = Math.min(100.0f, 100.0f / ratio);

to

scaleFactor = 100.0f / ratio;

That was done in order to let the overview have a larger scale than the flowchart itself, as you requested. I can't think of any reason why this would make the overview control disappear. Could you try showing the standard Overview control, instead of your extended class?

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



Posts: 163
Joined: May 2nd, 2007
Re: Overview diagram shrinks when zooming out
Reply #14 - Nov 1st, 2007 at 2:06pm
Print Post  
I ran getPreferedSize and got 1084,694 - it doesn't seem too large.

I tried to diff between the two Jars (the old and the new and saw a lot of differences:
AnchorPatter, AnnealLayout, DebugGraphic2D, FillMode, FitSize, FlowChart, GridLayout, Node, Overview, Shape, etc... Total of 55 filees changed.
Could this be the problem? Maybe a change someplace else?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint