Bug 266123 - improve the capture method and the draw tool
Summary: improve the capture method and the draw tool
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: dev   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 3.2   Edit
Assignee: Hiroyuki CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 250884 276428 (view as bug list)
Depends on: 279364
Blocks:
  Show dependency tree
 
Reported: 2009-02-25 08:35 EST by Hiroyuki CLA
Modified: 2009-06-09 17:02 EDT (History)
3 users (show)

See Also:


Attachments
screenshot.png (208.35 KB, image/png)
2009-02-25 08:38 EST, Hiroyuki CLA
no flags Details
capturedialog.patch (19.28 KB, patch)
2009-02-26 05:59 EST, Hiroyuki CLA
no flags Details | Diff
newicons.zip (3.29 KB, application/octet-stream)
2009-02-26 06:00 EST, Hiroyuki CLA
no flags Details
NewTool.png (98.09 KB, image/png)
2009-02-28 03:30 EST, Hiroyuki CLA
no flags Details
screenshot.patch (56.56 KB, patch)
2009-03-01 05:10 EST, Hiroyuki CLA
no flags Details | Diff
screenshot_newicons.zip (9.07 KB, application/octet-stream)
2009-03-01 05:11 EST, Hiroyuki CLA
no flags Details
screenshot.patch (56.59 KB, patch)
2009-03-01 10:42 EST, Hiroyuki CLA
no flags Details | Diff
newtoolbar.png (203.58 KB, image/png)
2009-03-06 19:44 EST, Hiroyuki CLA
no flags Details
screenshot_newicons.zip (12.18 KB, application/octet-stream)
2009-03-07 11:01 EST, Hiroyuki CLA
no flags Details
screenshot.patch (78.03 KB, patch)
2009-03-07 11:03 EST, Hiroyuki CLA
no flags Details | Diff
screenshot.png (21.30 KB, image/png)
2009-03-10 07:11 EDT, Hiroyuki CLA
no flags Details
capture.patch (84.26 KB, patch)
2009-05-01 10:48 EDT, Hiroyuki CLA
no flags Details | Diff
capture_newicons.zip (10.56 KB, application/octet-stream)
2009-05-01 10:49 EDT, Hiroyuki CLA
no flags Details
capture.patch (84.90 KB, patch)
2009-05-01 11:10 EDT, Hiroyuki CLA
no flags Details | Diff
capture.patch (84.97 KB, patch)
2009-05-01 12:24 EDT, Hiroyuki CLA
no flags Details | Diff
screenshot (37.52 KB, image/png)
2009-05-04 00:46 EDT, Steffen Pingel CLA
no flags Details
ui-sample.png (84.59 KB, image/png)
2009-05-08 13:00 EDT, Hiroyuki CLA
no flags Details
capture.patch (91.56 KB, patch)
2009-05-09 04:29 EDT, Hiroyuki CLA
no flags Details | Diff
capture_newicons.zip (10.05 KB, application/octet-stream)
2009-05-09 04:30 EDT, Hiroyuki CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hiroyuki CLA 2009-02-25 08:35:46 EST
In the attachment dialog for the image, support the following method
- Getting from clipboard
- Getting from image file

And, The annotation tools are increased. 
- Line
- Rectangle
- Oval
Comment 1 Hiroyuki CLA 2009-02-25 08:38:44 EST
Created attachment 126712 [details]
screenshot.png

This is the implemented wizard page
Comment 2 Steffen Pingel CLA 2009-02-25 12:30:56 EST
That looks awesome! Are you interested in contributing a patch?
Comment 3 Hiroyuki CLA 2009-02-26 05:59:58 EST
Created attachment 126835 [details]
capturedialog.patch
Comment 4 Hiroyuki CLA 2009-02-26 06:00:51 EST
Created attachment 126836 [details]
newicons.zip

New icons
Comment 5 Steffen Pingel CLA 2009-02-26 14:26:36 EST
Thanks! One of the features that could be very useful is a way to add text to a screenshot. Do you think it would be very difficult to add that as well?
Comment 6 Mik Kersten CLA 2009-02-26 22:50:43 EST
Hiroyuki: Wow, this looks fantastic!

If you're interested in additional improvements, a very common use case for the screenshot capture tool is to annotate a screenshot with some additional information.  I don't know how hard this would be, but being able to create a shaded text box would be a great addition.
Comment 7 Hiroyuki CLA 2009-02-27 09:59:36 EST
It seems to take time to mount the text drawing.
When enhancing (undo, redo,  the line kind and the thickness) , examined.
Comment 8 Hiroyuki CLA 2009-02-28 03:30:33 EST
Created attachment 127074 [details]
NewTool.png

My goal is the following.

Capture image of Desktop
[New] Loading image from Clipboard and image file (Note: depends SWT implementation)
[Extend] Show image: Fit mode and Zoom mode: 100%, 200%, 400%, 800%
[Extend] Draw tool: Free, Line, Rectangle, Round Rectangle, Oval and Text
[Extend] Full color of the drawing line
[New] Selection of the font face, size, style and color
[Extend] Line style: Sold, Dot, Dash, Dash Dot, Dash Dot Dot
[New] Line tickness: 1, 2, 4, 8 dots
Clear all annotations
[New] Undo and redo of one annotation (No limitation)
Comment 9 Hiroyuki CLA 2009-03-01 05:10:55 EST
Created attachment 127102 [details]
screenshot.patch

The text drawing tool was implemented
To evade the SWT bug, the Tab draws as one space.
Comment 10 Hiroyuki CLA 2009-03-01 05:11:22 EST
Created attachment 127103 [details]
screenshot_newicons.zip
Comment 11 Hiroyuki CLA 2009-03-01 05:27:22 EST
The method of drawing text is done according to the following procedures. 

1. Capture desktop or load image
2. Set zoom as 100%, 200%, 400% or 800%
3. Click Annotate button
4. Select Text draw tool
5. Click Font button, and select font name, size, style and color
6. Click and drag for drawing rectangle
7. Typing string if caret is displayed
8. Click point of outside rectangle

Comment 12 Hiroyuki CLA 2009-03-01 10:42:24 EST
Created attachment 127110 [details]
screenshot.patch

Sorry, the detected bug was fixed
Comment 13 Mik Kersten CLA 2009-03-02 16:00:30 EST
Steffen will continue to mentor your patches, but I just wanted to say that it's excellent to see this progress Hiroyuki!  A lot of people are going to appreciate this functionality.

I encourage you to break up your contributions into individual patches that are 250 lines of code or less, whenever that makes sense.  That makes it much quicker for us to apply them, because they don't require IP review.  For example, you could break up the different features you'e adding into separate patches.
Comment 14 Hiroyuki CLA 2009-03-03 06:09:46 EST
I understood that your request is divide the patch.

The patch is made 8 blocks.

Show image: Zoom mode: 100%, 200%, 400%, 800%
and, common Action class definition
9 line -, 249 line+ (39 blank lines + 210 modified line)

Loading image from Clipboard and image file
11 lines -, 166 lines + (31 blank lines, 135 modified lines)

Full color of the drawing line
18 lines -, 25 lines + (25	modified lines)

Draw tool: Line, Rectangle, Round Rectangle, Oval
4 lines -, 175 lines + (37 blank lines, 138 modified lines)

Line style: Sold, Dot, Dash, Dash Dot, Dash Dot Dot,
and, Line tickness: 1, 2, 4, 8 dots
101 lines + (31 blank lines, 70 modified lines)

Draw tool: Text, and selection of the font face, size, style and color
197 lines + (23 blank lines, 174 modified lines)

Undo of one annotation (No limitation)
1 lines -, 240 lines + (24 blank lines, 216 modified lines)

Redo of one annotation
38 lines + (5 blank lines, 33	 modified lines)

Please note that the following patch can be made only when one patch is applied. 

Can you wait for the period of the IP review?
I will cooperate in the patch division when you immediately need this function.
Comment 15 Steffen Pingel CLA 2009-03-05 23:07:13 EST
*** Bug 250884 has been marked as a duplicate of this bug. ***
Comment 16 Steffen Pingel CLA 2009-03-06 14:16:35 EST
Hiroyuki, I have tried the patch and this is really cool! What do you think about adding a zoom mode to fit the cropped region? This would work perfectly for the use case where you capture the entire desktop but only want to attach and annotate a small part of the entire screen.

Can you please add an EPL copyright header and @author tags to all new files you created in the patch? I'll then put this up for IP review so we can hopefully add this in time for Galileo.
Comment 17 Hiroyuki CLA 2009-03-06 19:44:38 EST
Created attachment 127892 [details]
newtoolbar.png

I want to change the toolbar.  It will become easy to use more. 
The following will be added to a new patch. 

Zoom 50%
Capture the selected rectangle
Comment 18 Hiroyuki CLA 2009-03-07 11:01:14 EST
Created attachment 127914 [details]
screenshot_newicons.zip
Comment 19 Hiroyuki CLA 2009-03-07 11:03:26 EST
Created attachment 127915 [details]
screenshot.patch

New patch
Comment 20 Steffen Pingel CLA 2009-03-07 16:54:30 EST
That's an interesting approach. Having more controls available as icons is easier in terms of usability but I'm a bit worried that the UI is getting to complex. My sense is that the most common use case is to capture, crop and annotate using a pen or text. It's great to have more advanced tools available as well but I am not sure if these should be exposed as icons on toolbars. 

I really like the version from March 1st. Having the toolbar on top allows descriptive names in addition to icons and works nicely with the drop-downs. Based on the patch from March 1st, how about this:

- Keep "Capture", "Zoom", "Crop" and "Annotate"
- Make the default action of "Zoom" to Fit (if the user has cropped, Zoom to 100% and center the cropped area)
- Put "Free", "Rectangle" and "Text" as buttons in the toolbar. 
- Add one button that is a drop-down which has advanced tools and options:
* Oval
* Round Rectangle
* ...
--
* Line Style
 * Solid line
 * Dotted line
 * ..
* Font Style...
- Add a toolbar button for choosing the color with a drop-down that has a selection of colors (like the current implementation but in a menu) and an option to choose a custom color.
- Keep the "Clear", "Undo" and "Redo" buttons (this is a really awesome addition!)
Comment 21 Mik Kersten CLA 2009-03-09 15:54:18 EDT
Wow Hiroyuki, this is shaping up to be one of our best community contributions to date.

The only thing I noticed you using in your own screenshots, which is not yet captured by the tool, is arrows.  It seems that these will be a pretty common thing with screenshots, so if it's not too hard you could consider making an arrow tool.
Comment 22 Hiroyuki CLA 2009-03-10 07:11:30 EDT
Created attachment 128171 [details]
screenshot.png

It implemented. It are one side arrow and both sides arrow.
Comment 23 Hiroyuki CLA 2009-03-10 07:34:47 EDT
About comment #20 

I think that can easily operate the vertical tool palette, and use it easily. 
It is annoying to select each drop down menu.

Please discuss it with the your meeting. 
If the conclusion is the horizontal tool bar, I add an additional function to the previous patch.
Comment 24 Steffen Pingel CLA 2009-03-10 16:12:37 EDT
Thanks. That's wicked. I have added an item to the meeting agenda. Please feel free to join the call: http://wiki.eclipse.org/Mylyn/Meetings.
Comment 25 Hiroyuki CLA 2009-05-01 10:48:27 EDT
Created attachment 134062 [details]
capture.patch

The improvement was completed.
Comment 26 Hiroyuki CLA 2009-05-01 10:49:05 EDT
Created attachment 134063 [details]
capture_newicons.zip

New icons
Comment 27 Hiroyuki CLA 2009-05-01 11:10:16 EDT
Created attachment 134067 [details]
capture.patch

New patch
Comment 28 Hiroyuki CLA 2009-05-01 12:24:46 EDT
Created attachment 134078 [details]
capture.patch

Sorry, I found bug, and fixed it.
Patch is uploaded again.
Comment 29 Steffen Pingel CLA 2009-05-04 00:46:36 EDT
Created attachment 134195 [details]
screenshot
Comment 30 Hiroyuki CLA 2009-05-04 06:19:28 EDT
(In reply to comment #29)
> Created an attachment (id=134195)
> screenshot

That string is used in org.eclipse.mylyn.tasks.ui
/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttachmentPart.java .
And, it is defined in /src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties .

Is the meaning that you request a updataion of that string?
(But, the wizard title is not updated)
Comment 31 Anton Danilchenko CLA 2009-05-04 15:41:13 EDT
Please, add this features!
Comment 32 Steffen Pingel CLA 2009-05-04 17:33:07 EDT
This is looking great Hiroyuki! I just attached the screenshot as an example to discuss it at the next Mylyn meeting. 

In order to avoid overloading the UI the suggestion I would make is to group the options for selecting the line width and line type (dotted line etc.) in a drop down. I would also limit the default color choice to something like four colors and allow the user to pick additional colors from the picker or a drop down.
Comment 33 Mik Kersten CLA 2009-05-07 13:51:42 EDT
Hiroyuki: Once again, great to see this progress.  We discussed this contribution during the weekly call and want to proceed on incorporating it.  The main concern we have is that the UI is overly complex, but it seems quite straightforward to simplify.  We did a review and agreed that it was best to ensure that it was very easy to do the most common screenshot-specific actions, and that we could simplify by removing or hiding some of the more drawing-specific actions.  In order to do this, we need to identify the key use cases for screenshots.  Here's a start:
1) Point to a something in the screenshot with an arrow tool
2) Annotate screenshot with text
3) Block out a region of the screenshot
4) Bring attention to a region with a box
5) Draw freeform lines

To support this, I think that we could merge some of your drawing tools into specific tools that support the four actions above.  For example:
1) Single arrow tool with a fixed weight (2pt)
2) Current text tool
3) Filled box, rounded corners to look nicer
4) Empty box, rounded corners
5) Current freeform line tool (2pt)

To make the UI for this simple, I suggest having these 5 tools along the left-hand-side of the image, especially since the vertical height is quite constrained by the wizard layout.  For a color selection we can have a drop down with the current color layout.  This should mean 5 regular buttons and one drop-down button, so the result should be simple enough.  If you prefer to keep some of the more advanced functionality, you could make another button that allows the user finer grained control of things like drawing shape and line weight.

Steffen can iterate with you on this.  Also, we do understand if you do not have time to do this next iteration, and can take the contribution as-is and do some of these changes on our own after it is accepted.  Just let us know what you prefer.  Thanks again, we're looking forward to getting this into the hands of users for Mylyn 3.2.
Comment 34 Steffen Pingel CLA 2009-05-07 14:54:43 EDT
Hiroyuki, it's fine to leave all the functionality and icons in the contribution for others to reuse as long as we can come up with a simplified UI for the screenshot capturing (comment 33). Let me know if you are interested in working on this in the next few days, since we are already past the IP deadline for Galileo and should submit this contribution for review asap.
Comment 35 Hiroyuki CLA 2009-05-07 17:30:28 EDT
Thank you for the response. 
The proposal of the simplification of UI is mounted.
Improvement UI will be able to be sent to 5/7 or 8 JST.  
Comment 36 Steffen Pingel CLA 2009-05-07 17:56:27 EDT
Great! Thanks.
Comment 37 Hiroyuki CLA 2009-05-08 13:00:34 EDT
Created attachment 134984 [details]
ui-sample.png

I thought about UI (attached image).
How do you think?
Comment 38 Steffen Pingel CLA 2009-05-08 16:36:50 EDT
That looks very good. How is the currently selected tool indicated? I liked the previous solution where the tool buttons would toggle but that won't work in combination with the drop-downs as far as I know. You could consider changing the icon of the Annotate button to always reflect the current tool.

Not sure the Dock On option is needed. Just having the toolbar visible on the left should be fine but we can leave it in if you think it's important. 

I think we are pretty close and it could make sense to put a patch up for IP review. Once we are through with the process and have the code in cvs we can still work out some of the nits later.
Comment 39 Hiroyuki CLA 2009-05-08 18:20:53 EDT
(In reply to comment #38)
> How is the currently selected tool indicated?

The image and tooltips of the tool button 
if the tool is selected on the drop down list. 

Note: Special specification for the tool button for Arrow/List/Box/Text

- shows in the selection color rectangle. 
- And, a little shadow is added in my plan. 

> Not sure the Dock On option is needed.

OK, it is erased. 


Comment 40 Steffen Pingel CLA 2009-05-08 18:32:47 EDT
Sounds good. Once you post the patch I'll try it and then submit the CQ.
Comment 41 Hiroyuki CLA 2009-05-09 04:29:44 EDT
Created attachment 135048 [details]
capture.patch

Improved
I tested Vista & SUSE (GTK)
Comment 42 Hiroyuki CLA 2009-05-09 04:30:36 EDT
Created attachment 135049 [details]
capture_newicons.zip

Icon files for Patch
Comment 43 Hiroyuki CLA 2009-05-09 05:00:47 EDT
Sorry, modify after apply patch

1) to comment  line 317, 318 (following lines)

		undoAction.setEnabled(false);
		redoAction.setEnabled(false);

2) to comment  line 347, 348 (following lines)

		undoAction.setEnabled(false);
		redoAction.setEnabled(false);
Comment 44 Steffen Pingel CLA 2009-05-11 15:56:21 EDT
Thanks Hiroyuki! I have submitted CQ 3291.
Comment 45 Hiroyuki CLA 2009-05-12 17:42:16 EDT
About patch,
It is wrote 100% of the code which is thought myself.
This code is contributed to Eclipse Mylyn project. 
Comment 46 Steffen Pingel CLA 2009-05-15 03:41:26 EDT
*** Bug 276428 has been marked as a duplicate of this bug. ***
Comment 47 Steffen Pingel CLA 2009-05-20 16:53:07 EDT
The CQ has been approved. I have committed the patch to CVS with minor modifications: I moved most of the images to an internal class ScreenshotImages and commented out the lines mentioned in comment 43.

Thanks a lot for your hard work Hiroyuki! This will certainly be one of the noteworthy  features in the Mylyn 3.2 release.
Comment 48 David Green CLA 2009-06-09 15:57:40 EDT
Nice work on this one.  I really love the new drawing features.
Comment 49 Mik Kersten CLA 2009-06-09 17:02:36 EDT
I echo those sentiments and will make sure that Hiroyuki is appropriately credited in the announcements around Mylyn 3.2.