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 83789 - Copy/paste of diagram details not working
Summary: Copy/paste of diagram details not working
Status: RESOLVED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: General Diagram (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Yang Su
URL:
Keywords:
Depends on: 137774 142631 143108
Blocks:
  Show dependency tree
 
Reported: 2006-08-30 14:20 UTC by jfurmankiewicz
Modified: 2008-09-05 18:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
original diagram (29.98 KB, image/png)
2006-08-30 14:21 UTC, jfurmankiewicz
Details
Copied diagram (21.31 KB, image/png)
2006-08-30 14:21 UTC, jfurmankiewicz
Details
original class diagram (38.39 KB, image/jpeg)
2007-02-06 00:35 UTC, Peter Lam
Details
copied/pasted class diagram (33.70 KB, image/jpeg)
2007-02-06 00:35 UTC, Peter Lam
Details
original activity diagram (25.13 KB, image/jpeg)
2007-02-06 00:44 UTC, Peter Lam
Details
copied/pasted activity diagram (25.95 KB, image/jpeg)
2007-02-06 00:45 UTC, Peter Lam
Details
original activity diagram (35.00 KB, image/jpeg)
2007-02-06 19:09 UTC, Peter Lam
Details
copy/paste activity diagram (29.69 KB, application/octet-stream)
2007-02-06 19:10 UTC, Peter Lam
Details
copy/paste activity diagram (29.69 KB, image/jpeg)
2007-02-06 19:10 UTC, Peter Lam
Details
ide log file (29.26 KB, text/plain)
2008-09-02 22:46 UTC, Peter Lam
Details
screenshot of copy and paste diagram (65.99 KB, image/png)
2008-09-02 22:47 UTC, Peter Lam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jfurmankiewicz 2006-08-30 14:20:36 UTC
I had an existing activity diagram. Created a brand new one. Wanted to copy all
the items from the original diagram into the new one.

Selected original diagram, Ctrl+A to select all items, copy.

Went to new blank diagram, Ctrl+V to paste...all items were pasted, but they
were horribly misplaced and mangled compared to the original diagram.

Please see attachments for original diagram and the copied version.
Comment 1 jfurmankiewicz 2006-08-30 14:21:03 UTC
Created attachment 33410 [details]
original diagram
Comment 2 jfurmankiewicz 2006-08-30 14:21:20 UTC
Created attachment 33411 [details]
Copied diagram
Comment 3 Peter Lam 2007-01-29 16:55:11 UTC
consider loss of data - let say copying a big diagram which user manually did
the layout so the result of the copy and paste to a new diagram is lost.
Comment 4 Thuy.d Nguyen 2007-01-30 01:54:52 UTC
The cross-diagram-paste function does not work at all (i.e. nothing is pasted)
in the latest daily build, which is  the side effect of the fix for the issue
92846.  I'm working to restore the paste function and will address this issue next.
Comment 5 Thuy.d Nguyen 2007-02-05 18:03:46 UTC
Fixed to retain the size of the copied nodes and the bend points of the edges
when copying the graph to the new diagram.
Comment 6 Peter Lam 2007-02-06 00:35:28 UTC
Created attachment 38077 [details]
original class diagram
Comment 7 Peter Lam 2007-02-06 00:35:54 UTC
Created attachment 38078 [details]
copied/pasted class diagram
Comment 8 Peter Lam 2007-02-06 00:44:59 UTC
Created attachment 38079 [details]
original activity diagram
Comment 9 Peter Lam 2007-02-06 00:45:58 UTC
Created attachment 38080 [details]
copied/pasted activity diagram
Comment 10 Peter Lam 2007-02-06 00:49:54 UTC
the fix does make the copied/pasted diagram looks better, especially the
activity diagram as indicated in the attachements (original activity diagram &
copied/pasted activity diagram). However, trying the same for the class diagram
still looks screwed up as shown in attachements (original class diagram &
copied/pasted class diagram). Have not tried with all different diagram types
yet. Re-opening the issue.
Comment 11 Peter Lam 2007-02-06 19:09:52 UTC
Created attachment 38136 [details]
original activity diagram
Comment 12 Peter Lam 2007-02-06 19:10:19 UTC
Created attachment 38137 [details]
copy/paste activity diagram
Comment 13 Peter Lam 2007-02-06 19:10:24 UTC
Created attachment 38138 [details]
copy/paste activity diagram
Comment 14 Peter Lam 2007-02-06 19:11:57 UTC
just attached another 2 snapshots showing the original and copied/pasted
activity diagram that contains the Partition elements which was not
copied/pasted properly to the new diagram.
Comment 15 Thuy.d Nguyen 2007-02-08 07:06:37 UTC
Fine-tunned the code some more to keep the size, the shape and the position of
most of modeling elements the same as those on the source diagram. 

There's still some minor issues with a certain element, e.g, the width of the
left partition of a Partition element takes up the entire width of the node when
the element being pasted.  For those minor issue,  the workaround is manually
adjusting the position of the element.
Comment 16 jfurmankiewicz 2007-02-08 12:31:43 UTC
Wouldn't it be possible to fix that as well as part of this defect? Seems
incomplete if there are still any issues left with the paste functionality.
Thank you
Comment 17 Peter Lam 2007-02-09 23:00:30 UTC
Yes, I agree. This is not an easy fix and I think it is too risky to get into
the detail here for the Customer Acceptance (CA) release. However, the fix so
far is a lot better than before but I'll re-open this and putting a waiver
request for the CA release. Hopefully it can be fixed for the FCS release.
Comment 18 George Vasick 2007-06-28 22:09:54 UTC
Targeted in the drawing area redesign.
Comment 19 George Vasick 2007-07-04 00:43:40 UTC
REstoring the original priority and using the NB 6.0 waiver process.
Comment 20 George Vasick 2008-01-02 16:53:43 UTC
Diagram area bugs waived for 6.0 will also be waived for 6.1.
Comment 21 Joanne Lau 2008-05-22 16:59:57 UTC
Still exists in 6.5
Comment 22 George Vasick 2008-06-10 17:02:40 UTC
Removing obsolete assignments.  Bugs will be reassigned for M2.
Comment 23 Sergey Petrov 2008-07-03 11:09:59 UTC
initial case with ctrl-a (i.e. copy-paste of all elements) have easy alternative, save as for a diagram.
Comment 24 Trey Spiva 2008-08-08 22:34:17 UTC
I was not able to reproduce the original problem with 6.5.  Therefore I am going to close this issue.  However when I was testing peters last use case with 
the partitions I noticed that the diagram was really messed up after copy and past.  However this issue is covered by the issue 143108.
Comment 25 Trey Spiva 2008-08-11 13:49:03 UTC
While the original problem is fixed in 6.5, this issue is being used as an umbrella bug.  The following issues still need to be fixed.

1. copy paste node with label didn't work, I checked in the implementation this week, didn't file a new issue though, I thought we had enough
2. copy paste connection with label does not work, (neither label visibility nor location was thought of, not to mention the color)
3. view info ( iconic vs. standard ) is not preserved (137774 outstanding blocking issue as shown on dependency tree)
4. copy pasting package with contained class only yields package alone, same problem with activity group
5. widget with collapsible compartments is not pasted with the show/hide state in mind
6. movable compartment size info is not preserved, neither is contained element location, size, color or anything
7. copy/pasting parameter usage results in altered multiline label format
8. pasted use case does not even have the same size, not to mention the hide/show extension state
9. copy/pasting lifelines with messages does not work
Comment 26 Yang Su 2008-08-27 23:51:10 UTC
With implementation of cloning the connection widget and fix to #1, #4, #5, #6, #7 and #8, the major issues in
copy/paste this one can be verified now. The remaining issues (e.g. #2 edge label and #9 lifeline) are either trivial or
should be tracked separately with appropriate priority.

Comment 27 Peter Lam 2008-09-02 22:45:49 UTC
Verified in build 20080902. Just tried something similar to the original activity diagram. On the first paste of a
copied activity diagram by left clicking on an empty diagram area on a new activity diagram to paste, the following
exception popped up (see attached ide log file for complete exception), but not sure if it's a result of the fix. Tried
to paste again with Ctrl+V but nothing seems to be in the buffer at this time. So, copied again and pasted again. The
diagram does look better but not exactly as the original. See attached screenshots.

java.lang.AssertionError
	at org.netbeans.modules.uml.drawingarea.actions.SceneAcceptProvider.isContained(SceneAcceptProvider.java:667)
	at org.netbeans.modules.uml.drawingarea.actions.SceneAcceptProvider.accept(SceneAcceptProvider.java:250)
	at org.netbeans.modules.uml.drawingarea.actions.SceneAcceptProvider.accept(SceneAcceptProvider.java:205)
	at org.netbeans.modules.uml.drawingarea.actions.DiagramSceneAcceptAction.mouseClicked(DiagramSceneAcceptAction.java:78)
	at org.netbeans.api.visual.action.WidgetAction$Chain.mouseClicked(WidgetAction.java:752)
Comment 28 Peter Lam 2008-09-02 22:46:13 UTC
Created attachment 68907 [details]
ide log file
Comment 29 Peter Lam 2008-09-02 22:47:05 UTC
Created attachment 68908 [details]
screenshot of copy and paste diagram
Comment 30 Yang Su 2008-09-04 19:58:25 UTC
fixed recent regression on copy/paste edges with bending points
changeset d2b0a1979f92 in uml-main
details: http://hg.netbeans.org/uml-main?cmd=changeset;node=d2b0a1979f92

copy/paste edge label is tracked in issue 143102
Comment 31 Trey Spiva 2008-09-05 18:16:51 UTC
Reviewed