Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 494453

Summary: [HiDPI] Update Javadocs that talk about pixels to points
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: SWTAssignee: Niraj Modi <niraj.modi>
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: gautier.desaintmartinlacaze, lshanmug, niraj.modi
Version: 4.6   
Target Milestone: 4.10   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/131350
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=62cc958e0c289fb7e774c98368dba95e9e8ebe48
https://git.eclipse.org/r/131632
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=62d2b8df4b34008e4944c364dc84435d09cd94fe
Whiteboard:
Bug Depends on:    
Bug Blocks: 534932, 538680, 541631    

Description Markus Keller CLA 2016-05-24 11:59:11 EDT
Many SWT Javadocs still talk about pixels (e.g. TextLayout#setAscent(int)).

Most of these should be changed to talk about points. Note that some APIs e.g. in class Image really mean pixels (either coordinates in native pixels, or in contexts such as "transparentPixel").

Other APIs like ImageDataProvider and ImageFileNameProvider talk about "physical monitor pixel" and "SWT logical pixel". The latter should be called "SWT logical point".

Regex to find where "pixel" is mentioned in a comment:

^\s*(\*|/\*).*pixel
Comment 1 Niraj Modi CLA 2018-05-17 10:29:39 EDT
Moving to 4.9
Comment 2 Niraj Modi CLA 2018-09-04 08:45:03 EDT
Below are few methods, which have Pixel in the method name. Converting Pixel to Point may cause some confusion here:
StyledText#getHorizontalPixel()
StyledText#getLinePixel()
StyledText#getTopPixel()

In below the point seems little overloaded either to mean Point(class) or point:
Point CoolItem#getMinimumSize()
CoolItem#setMinimumSize(Point)

Apart from above, public APIs in GLData class using pixel need to be evaluated.

Few of the above can be addressed by changing 'Pixel' to 'SWT logical Point', but then this has to be done through-out the SWT APIs for consistency.
Suggest to defer this bug to 4.10 for further discussion.
Comment 3 Niraj Modi CLA 2018-10-23 03:20:19 EDT
Targeting for 4.10 M3
Comment 4 Eclipse Genie CLA 2018-10-23 03:21:15 EDT
New Gerrit change created: https://git.eclipse.org/r/131350
Comment 6 Eclipse Genie CLA 2018-10-30 05:04:55 EDT
New Gerrit change created: https://git.eclipse.org/r/131632
Comment 8 Niraj Modi CLA 2018-11-16 03:14:48 EST
Will do a one more pass over the code base then will run the JavaDoc bash part to update other platforms.
Comment 9 Niraj Modi CLA 2018-12-03 02:18:02 EST
(In reply to Niraj Modi from comment #8)
> Will do a one more pass over the code base then will run the JavaDoc bash
> part to update other platforms.

Did a final pass over the code, no more changes needed in SWT API JavaDocs.
Note: w.r.t. to 'pixel', there still exists entries on below places:
- code comments
- methods signature in which term 'pixel' is used

Copying of the 'point' to 'pixel' changes to other platform code will be taken care by JavaDoc basher via bug 541631

Resolving this bug now.