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 45274 - Code completion javadoc - font size is too big
Summary: Code completion javadoc - font size is too big
Status: CLOSED DUPLICATE of bug 42824
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Martin Roskanin
URL:
Keywords: REGRESSION
: 37313 46741 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-21 13:01 UTC by Marian Mirilovic
Modified: 2007-11-05 13:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
previous font size - [nb_dev](200406141800) (66.58 KB, image/png)
2004-06-21 13:02 UTC, Marian Mirilovic
Details
current (tto big) font size - [nb_dev](200406201800) (63.49 KB, image/png)
2004-06-21 13:03 UTC, Marian Mirilovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2004-06-21 13:01:04 UTC
Font size of javadoc part of Code completion is
too big.

It's regression - As you can see on attached
screenshots:
1. it works fine in [nb_dev](200406141800),
[jdk1.5.0](b51)  (first screenshot)
2. font is too big
[nb_dev](200406201800)[jdk1.5.0](b51)
Comment 1 Marian Mirilovic 2004-06-21 13:02:55 UTC
Created attachment 15878 [details]
previous font size - [nb_dev](200406141800)
Comment 2 Marian Mirilovic 2004-06-21 13:03:41 UTC
Created attachment 15879 [details]
current (tto big) font size - [nb_dev](200406201800)
Comment 3 Martin Roskanin 2004-06-21 16:23:02 UTC
I cannot reproduce it. And I cannot find a relevant cvs changelog that
could cause this between 14.6 and 20.6 :-(
Marian, could you please find out exactly the last build where this
worked and the build where it was broken? Thanks.
What LF do you use? Metal?
Comment 4 pfelenda 2004-06-21 16:33:41 UTC
Mato,
  should be a missing font the cause of this problem ?
Comment 5 Marian Mirilovic 2004-06-21 17:09:27 UTC
Mato,
I am using Linux and default L&F (metal), I am sorry but I have no
resources for investigation it now, sorry .....
Comment 6 Marian Mirilovic 2004-06-30 18:00:18 UTC
maybe related to issue 42824 ....
Comment 7 pfelenda 2004-07-02 07:59:47 UTC
[20040603, 20040606], jdk1.4.2_04
I tried open the Javadoc CC in build befeore/after the Trung's commit
(see issue 42824) and I have observed the change in font size.
But after restart of the IDE the font size was back. Only by the first
start is visible the changed font!

Before the change I have bigger font in Javadoc window CC than the CC
window itself. Now I have the same font for both windows (by first
start). It looks better now, but there are not used the same font for
all Linux systems.

Comment 8 Miloslav Metelka 2004-07-16 11:24:22 UTC
So it's confirmed that this is a regression caused by integration of
issue 42824 => closing as dup of it as it's now reopened (I've added a
note to the related issue as well).

*** This issue has been marked as a duplicate of 42824 ***
Comment 9 _ ttran 2004-07-16 16:27:50 UTC
No it can't be caused by fix for issue 42824.  I only modified the
style for the html editor kit attached to a text area in the wizard to
make it use *smaller* font.  This is the essence of the fix

        if (description.getEditorKit() instanceof HTMLEditorKit) {
            // override the Swing default CSS to make the
HTMLEditorKit use the
            // same font as the rest of the UI.  This must be done in
addNotify()
            // because before the components are realized the font
sizes are wrong
            // on GTKLookAndFeel

            HTMLEditorKit htmlkit = (HTMLEditorKit)
description.getEditorKit();
            StyleSheet css = htmlkit.getStyleSheet();
            Font f = jLabel1.getFont();
            css.addRule(new StringBuffer("body { font-size:
").append(f.getSize()) // NOI18N
                        .append("pt; font-family:
").append(f.getName()).append("; }").toString()); // NOI18N
        }
        
Comment 10 Miloslav Metelka 2004-07-18 21:51:04 UTC
Well, but if the instance of the HTMLEditorKit would be shared by
multiple editor pane instances your fix could affect others as well.
IIRC the kit instances are cloned for use in other panes. The
HTMLEditorKit.clone() does not deep-copy the "defaultStyles" variable
so the same physical StyleSheet instance would be used. But I'm just
guessing here - I need to verify first that this really happens.
Comment 11 Martin Roskanin 2004-07-20 14:13:10 UTC
Mila is right.

This issue is a regression caused by the fix for issue #42824.

StyleSheet is shared by all HTMLEditorKit instances.

Here is javadoc of HTMKEditorKit.getStyleSheet():
    /**
     * Get the set of styles currently being used to render the
     * HTML elements.  By default the resource specified by
     * DEFAULT_CSS gets loaded, and is shared by all HTMLEditorKit 
     * instances.
     */

And you can easily test it (the sharing of css) by the following scenario:

1. start IDE
2. open code completion javadoc popup. The font should be OK.
3. Then open File/New project wizard - it causes that styleSheet will
be modified
4. check the cc javadoc again, font is bigger (css is sharing)

Resolving as duplicate.



*** This issue has been marked as a duplicate of 42824 ***
Comment 12 Martin Roskanin 2004-07-29 14:00:35 UTC
*** Issue 46741 has been marked as a duplicate of this issue. ***
Comment 13 Marian Mirilovic 2004-07-29 14:01:14 UTC
*** Issue 46741 has been marked as a duplicate of this issue. ***
Comment 14 Marian Mirilovic 2004-08-02 07:19:45 UTC
verified in [nb_dev](200408011800)
Comment 15 Martin Roskanin 2004-11-15 09:54:37 UTC
*** Issue 37313 has been marked as a duplicate of this issue. ***