Bug 492889 - Copy image in the system buffer when hitting CTRL-C in a diagram
Summary: Copy image in the system buffer when hitting CTRL-C in a diagram
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 3.1.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-05-03 08:42 EDT by Cedric Brun CLA
Modified: 2016-05-12 05:50 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2016-05-03 08:42:22 EDT
This has been itching in the last few months but I never had the chance to have a real look at what that would mean technically. I'll track it here.

Models are often used in documentation, especially diagrams. The workflow is not optimal if you just want to integrate a diagram into an existing document:
1- export the diagram as an image, pick some place on your hardrive, decide of a name, decide of a file format.
2- import the diagram into your document authoring tool: go back to the same place on the harddrive, select the file (hopefully the file format was right)


These kind of user stories could be improved quite a lot if Sirius would just copy the image into the system buffer when the user hits CTRL+C in a diagram.

Bonus points if CTRL+C with on a selection of shapes copy an image croping the diagram to get these shapes (and their children) only.

It might be trivial to implement as AFAIK you can copy different formats with a single keystroke and that feature might bring a good boost of experience for many use case.
Comment 1 Pierre-Charles David CLA 2016-05-03 09:37:14 EDT
It looks like it could have a negative performance impact to render a potentialy large image and allocate the corresponding buffer on each innocent-looking Ctrl-c.

How about a "Copy to clipboard" alternative (and maybe an "Export selection only" flag too) in the "Export as image" dialog?
Comment 2 Cedric Brun CLA 2016-05-03 09:48:39 EDT
(In reply to Pierre-Charles David from comment #1)
> It looks like it could have a negative performance impact to render a
> potentialy large image and allocate the corresponding buffer on each
> innocent-looking Ctrl-c.
> 
> How about a "Copy to clipboard" alternative (and maybe an "Export selection
> only" flag too) in the "Export as image" dialog?

As long as I can get it into the clipboard with a keyboard shortcut, I'm all for it!
Comment 3 Maxime Porhel CLA 2016-05-12 05:09:11 EDT
With Windows, CTRL+C with diagram selected or with a slection of diagram element already put the corresponding image in the system clipboard. Then you can paste the image in an other tool (Ms Word, Paint, ...).

This is done by AWT in GMF (and in Sirius), see: 
 .  org.eclipse.gmf.runtime.diagram.ui.render.internal.providers.ImageSupportGlobalActionHandler.getCopyCommand()
 .  AWTClipboardHelper.getInstance().isImageCopySupported()
Comment 4 Maxime Porhel CLA 2016-05-12 05:50:04 EDT
> private static final boolean IMAGE_COPY_SUPPORTED = System.getProperty(
>       "os.name").toUpperCase().startsWith("WIN"); //$NON-NLS-1$ //$NON-NLS-2$