This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 76311 - [55cat] wrong(shifted) UML Diagram view after reopen
Summary: [55cat] wrong(shifted) UML Diagram view after reopen
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: General Diagram (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords:
: 86153 98748 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-12 21:31 UTC by _ alexlamsl
Modified: 2007-10-15 20:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Java sources for Blueprints project (no nb project included) (250.67 KB, application/octet-stream)
2007-09-12 21:52 UTC, Craig Conover
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ alexlamsl 2006-05-12 21:31:38 UTC
1) Create an UML project with a Class Diagram
2) Add a few elements in it
3) Move them around
4) Do a bit of scrolling
5) Close the Diagram
6) Open the Diagram again. The editor view will be at the bottom right of your 
original viewpoint.
Comment 1 Peter Lam 2006-05-31 00:14:16 UTC
This is a known issue.
Comment 2 Yang Su 2007-03-26 18:55:22 UTC
*** Issue 98748 has been marked as a duplicate of this issue. ***
Comment 3 Peter Lam 2007-03-26 20:13:39 UTC
This should be a P2 Ease of Use issue. Actually this issue has been fixed and
working well in NB 5.5 but it's getting much worse in NB 6.0. I'd call this a
regression now compare to NB 5.5 moving to NB 6.0.
Comment 4 Peter Lam 2007-03-26 20:27:37 UTC
Version should be 6.0 now since it no longer exists in NB 5.
Comment 5 Sergey Petrov 2007-03-27 09:27:03 UTC
*** Issue 86153 has been marked as a duplicate of this issue. ***
Comment 6 Sergey Petrov 2007-03-27 09:30:42 UTC
see also Issue 86153 with additional steps
Comment 7 Yang Su 2007-04-14 00:23:35 UTC
Fixed the defect in calculating current view port position when diagram is
saved. Now when diagram is reopened, the previous view port is restored, even
better than blindly centering the graph. 
Comment 8 Peter Lam 2007-04-26 00:45:58 UTC
I'm using the latest NBI build 200704251200 and still see that all 8 different
types of diagrams opened all the way to the top-left corner. 
Comment 9 Yang Su 2007-04-26 07:09:31 UTC
How did you test it? If you just open a diagram created in a previous version
which had a bug in calculating the view port information, the wrong data from
old version saved in the diagram file will be loaded and used to adjust the view
port initially, you won't see the fix at this moment. Now try to modify the
diagram by moving elements and/or view port followed by saving the diagram,
reopen it again to verify the fix. Or simply create a new diagram to start from
fresh. 
Comment 10 Peter Lam 2007-04-26 09:29:44 UTC
After I installed the new ide with the latest nbi build, I started from fresh
userdir. Then, created new uml project and new diagram, saved and closed
diagram, and then re-opened the saved diagram. I tried this a few times and for
everyone of the 8 different diagram types. I'll try again with tomorrow's nbi
build to see if it's still the same for me and let you know.
Comment 11 Peter Lam 2007-04-26 23:12:09 UTC
Ok, here's kind of a consistent reproducible case. Seems like the initially
created diagram, regardless of its size: small or big, saving/closing and
reopening it would have the issue.
Comment 12 Sergey Petrov 2007-05-02 08:49:05 UTC
I'm able to reproduce too.
Comment 13 Craig Conover 2007-09-12 21:52:21 UTC
Created attachment 48685 [details]
Java sources for Blueprints project (no nb project included)
Comment 14 Craig Conover 2007-09-12 21:53:08 UTC
Ignore the Blueprints attachment. I attached to wrong issue.
Comment 15 _ alexlamsl 2007-09-16 02:52:17 UTC
Still reproducible on:

Product Version: NetBeans IDE Dev (Build 200709150000) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06 System: 
Windows Vista version 6.0 running on x86; Cp1252; en_GB (nb) Userdir: C:\Users\User\.netbeans\dev

Every time I reopen the Class Diagram, it shows up on the bottom right corner.

On another note, the zoom levels are not restored neither.
Comment 16 Craig Conover 2007-09-26 21:52:13 UTC
The zoom levels are only restored if the diagram is saved after the zoom level is changed. Unfortunately, changing the
zoom level doesn't "dirty" the diagram. Maybe this should be a separate issue. But if you just slightly move one of the
elements on the diagram, you can force it to go to dirty state so that you can save your changed zoom setting.

Still, after saving, closing and opening again, the diagram is shifted up and left off the viewable area. I was able to
reproduce this in 5.5.1 as well, so it is not a regression from then.
Comment 17 Craig Conover 2007-09-27 01:16:00 UTC
Seems that anytime the diagram is saved it is enlarging the total size of the diagram by padding some space to the left
and bottom of the diagram. I realize this is not new information, but it must be a difference in viewable graph vs.
total graph. The challenge is finding where this is happening.
Comment 18 Trey Spiva 2007-10-05 20:02:14 UTC
When we store the zoom and the view location in the diagram file what we are really saying is this is the view of the last person that opened the diagram.  
This distinction is more important when version control is being used.  Instead the zoom level, and viewable area should be stored in a users properties.  In 
other words it should be stored in the <project dir>/nbproject/priviate directory.

This also fits with the comment that zooming the diagram does not mark the diagram as dirty.  We do not want to mark the diagram as dirty when the user 
is simply looking around the diagram.  The user will be asked to save the diagram when they have not actually made any modifications.  This use case is a 
second argument for storing the view properties in a userdir not in the diagram file.

With the current implementation our graphing tool is giving us a little grief with opening the diagram to a know zoom and location.  Since we are currently 
working on replacing our graphing package in the next release (the development has already started), and that these properties should be moved to the 
private user directory, we have decided to do something a little different.  When the diagram is opened we are going to zoom it to fit the window.  That way 
it will be easy to navigate to the desired location.

In the next version we will add better support for this feature.
Comment 19 Peter Lam 2007-10-12 01:19:18 UTC
verified in instrumented trunk build 200710110401. All diagrams are now opened in fit-to-window. However, the generated
report has the smaller size diagrams shrunk to the sizes that are too small to be unreadable, which is tracked in issue
118643. Leaving this one as fixed and perhaps the fix might need to be rolled back if no easy resolution to issue 118643.
Comment 20 Peter Lam 2007-10-15 20:35:21 UTC
verified in trunk build 20071015. 
issue 118643 has been verified in the same build.
Comment 21 Peter Lam 2007-10-15 20:36:41 UTC
alexlamsl, please try it with the recent builds to see if the automated fit-to-window option works for you. Thanks.