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 127040 - diagram is not marked as dirty when it's modified
Summary: diagram is not marked as dirty when it's modified
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: General Diagram (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: _ jyothivasa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-09 01:17 UTC by Peter Lam
Modified: 2008-06-03 04:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Lam 2008-02-09 01:17:23 UTC
Moving the elements around in the diagram does not get marked with the asterisk to indicate the diagram is dirty. So,
closing and reopening diagram lost the changes.
Comment 1 Peter Lam 2008-03-10 22:37:40 UTC
Because of this issue, the Save Docuement menu option is not enabled from the diagram tab's popup menu, so no way to
save the diagram. 
This issue causes data loss so raising its priority to a P1.
Comment 2 Peter Lam 2008-03-10 23:46:17 UTC
Sometimes, DnD element from project tree to diagram also does not get the diagram marked as dirty.
An interesting observation is that when the diagram is marked as dirty, the popup menu from the diagram tab has Save
Document menu option enabled only if there is an item(s) selected in the diagram. If deselect the selected item(s) from
the diagram, the Save Docuement menu option is no longer enabled.
Comment 3 Thuy.d Nguyen 2008-03-20 22:21:17 UTC
UML developers, when your code modifies a diagram in any way, please mark the diagram "dirty" in your code as follows:

UMLDiagramDataObject dataObj = getDiagramDO();
dataObj.setDirty(true, getScene());   // "true" for dirty

When the diagram is saved, the dirty flag is reset to false, the dirty mark (the *) is removed from the diagram to
indicate its clean status. Programmatically, you should never need to mark the diagram "clean" by passing false to the
above setDirty method. 
Comment 4 _ jyothivasa 2008-03-28 00:37:01 UTC
Diagram is now marked dirty when moving elements.
Comment 5 Peter Lam 2008-03-28 22:02:09 UTC
Verified in build 20080327.
Even creating new elements in the diagram, the dirty indicator (asterisk) is not displayed. This seems to happen on only
re-opened diagram since it works ok on initially created diagram.
Comment 6 _ jyothivasa 2008-04-09 01:04:07 UTC
My fix was overwritten due to a merge. Restored the fix.
Comment 7 Peter Lam 2008-04-12 00:44:12 UTC
verified in build 20080411.
This issue still exists but not every time on the same scenario.

- create a uml java-platform project 
- create a class diagram
- create a couple of classes on the diagram
- save the diagram and close it
- reopen the diagram
- move the element or create a new class to the diagram, etc. will mark the diagram dirty
- now just click the "x" on the diagram tab to close it (will not prompt to save dirty diagram - a separate bug)
- reopen the diagram 
- now moving or creating new element to the diagram will NOT mark the diagram dirty
- starting from the 2nd reopen and on, diagram will not be marked dirty any more
Comment 8 _ jyothivasa 2008-05-23 00:31:45 UTC
Save confirmation dialog now pops up when you try to close a dirty diagram.
Diagram is marked dirty when something changes (even after a reopen).
Comment 9 Peter Lam 2008-05-24 01:14:59 UTC
verified in build 20080522. Still a few minor issues (eg, layout would not mark the diagram dirty) which will be tracked
separate issues.
Comment 10 Quality Engineering 2008-06-03 04:15:33 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #234 build
Changeset: http://hg.netbeans.org/main/rev/0ee872991c16
User: jyothivasa@netbeans.org
Log: Fix for #127040 - diagram is not marked as dirty when it's modified