Bug 348671 - [diagram] Node label edit mode activation area is too large
Summary: [diagram] Node label edit mode activation area is too large
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ling Hao CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2011-06-07 22:30 EDT by Konstantin Komissarchik CLA
Modified: 2021-11-19 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Komissarchik CLA 2011-06-07 22:30:17 EDT
In the default node presentation (such as the map sample), if you enter a short node label, there looks to be a lot of room in the node on left and right of the label. However, double-clicking in that area activates the edit mode. I would expect it to activate the default node action. Activation of the edit mode should be constrained to the actual bounds of the text (even if the text box that is later shown stretches across the entire node).
Comment 1 Konstantin Komissarchik CLA 2011-06-07 22:31:57 EDT
Targeting to 0.3 for evaluation. If this is going to be difficult due to Graphiti, I am fine with deferring to 0.4 release.
Comment 2 Konstantin Komissarchik CLA 2011-11-02 22:10:00 EDT
Bulk deferral of diagram-related items to the 0.5 release.
Comment 3 Konstantin Komissarchik CLA 2012-05-17 17:43:59 EDT
This is still relevant post GEF migration. Ling, maybe you can take a look at this one?
Comment 4 Ling Hao CLA 2012-05-17 19:26:05 EDT
The edit box was extending beyond the node boundary and when editing the text was right aligned instead of center aligned. These fixes were checked in. 

The current behavior seems correct. When the text editing is inside a boundary - the cell editing is expanded to the boundary. This is the behavior in the GEF sample and in graphiti.
Comment 5 Shenxue Zhou CLA 2012-06-01 17:31:12 EDT
Verified that the text is centered aligned and the cell editor doesn't extend the node boundary when direct edit is activated.

The activation area size is consistent with Graphiti and GEF samples. Closing.
Comment 6 Konstantin Komissarchik CLA 2012-06-01 17:40:07 EDT
Sorry, but this isn't how I'd like this to work regardless of what is customary for Graphiti and GEF. Since double-click on a node is either edit mode activation or the default node action (whatever that might be), we need to carefully constrain the boundary box of edit mode activation to the actual text. Extending activation area to node boundaries takes too much area away from default node action activation. 

Also, if I activate direct edit mode in one of the sample editors, the text box extends slightly beyond node boundary. For presentation aesthetics, I would like to see the text box constrainted to be let's say two pixels inset from the dark blue border.
Comment 7 Shenxue Zhou CLA 2012-06-01 18:03:09 EDT
(In reply to comment #6)
> Sorry, but this isn't how I'd like this to work regardless of what is customary
> for Graphiti and GEF. Since double-click on a node is either edit mode
> activation or the default node action (whatever that might be), we need to
> carefully constrain the boundary box of edit mode activation to the actual
> text. Extending activation area to node boundaries takes too much area away
> from default node action activation. 

In Diagram Node's definition, developers can specify the label size. This is mainly for cases where diagram node's presentation is an image plus label placed vertically but it's desired to give label extra width to allow long labels. In this case, when calculating the node size, we use the label width as the node width. 

But you can still argue for such case if the label is short, we should use what's occupied by the text rather than what's specified by the label width for the direct edit activation area.
Comment 8 Shenxue Zhou CLA 2012-06-01 18:14:37 EDT
I've checked in the fix for the direct edit activation area size. It now uses what's occupied by the text rather than the space reserved for the label.
Comment 9 Konstantin Komissarchik CLA 2012-06-01 18:27:05 EDT
> I've checked in the fix for the direct edit activation area size. It now uses
> what's occupied by the text rather than the space reserved for the label.

I've verified this portion of the fix. Working well now. Thanks. 

The issue with size of the direct edit text box is still there.
Comment 10 Ling Hao CLA 2012-06-04 17:34:49 EDT
Direct edit text box is now the size of the text.
Comment 11 Konstantin Komissarchik CLA 2012-06-04 17:42:52 EDT
Better, but there is still one thing that I'd like to see corrected. If I type into the text field, the size of the field expands until it reaches node width. That's fine, but it looks like max size calculation isn't quite correct. The right edge of the text field reaches a pixel or two past the node border. For best presentation, neither left nor right edge should ever touch node border. There should be a visible margin between text field border and node border. Let's set that margin at 2 pixels for now.
Comment 12 Ling Hao CLA 2012-06-04 19:51:22 EDT
Added buffer.
Comment 13 Konstantin Komissarchik CLA 2012-06-06 17:35:49 EDT
This is still not working well. The behavior is inconsistent. Sometimes left edge touches. Sometimes right edge touches. Sometimes right edge exceeds.
Comment 14 Ling Hao CLA 2012-06-06 19:19:58 EDT
checked in new cell editor location calculation. Weird behavior happens only when a scroll bar is present.
Comment 15 Konstantin Komissarchik CLA 2012-06-08 14:10:41 EDT
Works fine now. Verified. Closing.