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 68316 - External hyperlinks poorly aligned vertically
Summary: External hyperlinks poorly aligned vertically
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Help System (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Victor Vasilyev
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2005-11-08 22:14 UTC by Jesse Glick
Modified: 2009-05-25 21:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of part of "Working with Modules" in "NB Platform & Module Development" (2.88 KB, image/png)
2005-11-08 22:16 UTC, Jesse Glick
Details
A picture from the help content view after applying the fix. Red lines show the base lines of the strings. (10.17 KB, image/jpeg)
2009-04-22 11:00 UTC, Victor Vasilyev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2005-11-08 22:14:33 UTC
BrowserDisplayer.getPreferredLabelAlignment claims to

"Determine the alignment offset so the text is aligned with other views correctly."

but this does not appear to be working very well for me in a dev build on
Mustang / Ocean. See screenshot.
Comment 1 Jesse Glick 2005-11-08 22:16:48 UTC
Created attachment 26724 [details]
Screenshot of part of "Working with Modules" in "NB Platform & Module Development"
Comment 2 mslama 2005-11-14 11:37:43 UTC
Where is this doc in CVS? (source)
Comment 3 Jesse Glick 2005-11-15 01:05:02 UTC
apisupport/project/javahelp/org/netbeans/modules/apisupport/project/docs/about/modules_process.html
Comment 4 Antonin Nebuzelsky 2008-11-14 15:17:59 UTC
Reassigning to the new "core/help system" owner obarbashov.
Comment 5 Alexei Mokeev 2009-03-05 13:57:37 UTC
Moving JH issues to Victor.
Comment 6 Victor Vasilyev 2009-04-22 10:36:10 UTC
Original implementation of the method BrowserDisplayer.getPreferredLabelAlignment
tries to take into account a size of the icon, but according to javadoc of the class "Only text is supported".
So, immediately after initialization (i.e text is empty string and icon is null) the method returns the value 12.0f.
Note, expected return value of the method should be between 0.0f and 1.0f.
Also, the method has inconsistent name.

Proposed fix to resolve this issue is

    private float getPreferredAlignmentY() {
        // Fix for the Issue #68316
        Font font = getFont();
        FontMetrics fm = getToolkit().getFontMetrics(font);
        float h = fm.getHeight();
        float d = fm.getDescent();
        return (h - d) / h;
    } 
  
Comment 7 Victor Vasilyev 2009-04-22 11:00:58 UTC
Created attachment 80672 [details]
A picture from the help content view after applying the fix. Red lines show the base lines of the strings.
Comment 8 Victor Vasilyev 2009-04-22 14:00:55 UTC
Fixed as described.
http://hg.netbeans.org/main/rev/bb72f9f56c89