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 37665 - Win Classic L&F - editor toolbar is not precisely according the spec
Summary: Win Classic L&F - editor toolbar is not precisely according the spec
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords: L&F
Depends on:
Blocks:
 
Reported: 2003-12-02 12:55 UTC by jrojcek
Modified: 2007-09-26 09:14 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ugly toolbar drawing (5.68 KB, image/jpeg)
2004-09-14 16:57 UTC, Martin Roskanin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jrojcek 2003-12-02 12:55:29 UTC
8. Editor toolbar proportions are not correct
according the spec.

http://ui.netbeans.org/docs/ui/ws/classic_polished.html

(I am not sure if this issue should be fixed in
editor module. If yes, please reassign).
Comment 1 David Simonek 2004-01-06 12:33:16 UTC
It's fixed in main trunk.
Comment 2 David Simonek 2004-01-06 12:35:05 UTC
Oops, my mistake, reopening.
Comment 3 David Simonek 2004-01-06 12:39:22 UTC
Editor guys, I'm leaving this issue for you, I don't know much about
editor's toolbar. Don't hesitate to ask if something is not clear.
Additionally, please check XP visual spec
http://ui.netbeans.org/docs/ui/ws/XP_style.html and modify toolbar
painting properly.  
Comment 4 Martin Roskanin 2004-09-01 15:18:04 UTC
Java module's NavigateAction creates a toolbar presenter with layout
BorderLayout(12,0) ... 
reassinging to java module.
For better imagination, please see image attached in the issue #48141
Especially, 1b and 6
Comment 5 Jan Becicka 2004-09-08 12:05:20 UTC
Checking in NavigateAction.java;
/cvs/java/src/org/netbeans/modules/java/ui/actions/NavigateAction.java,v
 <--  NavigateAction.java
new revision: 1.16; previous revision: 1.15
done
Comment 6 Martin Roskanin 2004-09-14 16:55:56 UTC
Please, use setContentAreaFilled(false)
Your fix causes the minor problem with 
javax.swing.plaf.metal.MetalLookAndFeel & jdk1.5
See attached image.
Comment 7 Martin Roskanin 2004-09-14 16:57:04 UTC
Created attachment 17628 [details]
ugly toolbar drawing
Comment 8 Jan Becicka 2004-09-17 10:11:55 UTC
Hmm, there is no setContentAreaFilled().
I used setOpaque(true) - Martine, can you test it? Thanks

Checking in NavigateAction.java;
/cvs/java/src/org/netbeans/modules/java/ui/actions/NavigateAction.java,v
 <--  NavigateAction.java
new revision: 1.17; previous revision: 1.16
done
Comment 9 Jesse Glick 2004-09-17 15:17:21 UTC
Please note that JPanel's constructor calls setOpaque(true) already.
Generally, explicit calls to setOpaque should be regarded with
suspicion (and if necessary, may be signs of a Swing bug that should
be investigated); this method was never intended for general use,
according to Swing team developers.
Comment 10 Jan Becicka 2004-09-17 15:39:38 UTC
Martine, does it help? Otherwise I do a rollback of my commit.
Comment 11 Martin Roskanin 2004-09-17 16:11:50 UTC
Unfortunatelly, problem is still visible...
Comment 12 Jan Becicka 2004-09-20 09:37:50 UTC
OK - I did a rollback (of setOpaque()) . But I really don't know how
should I fix it.
Comment 13 Martin Roskanin 2004-09-20 14:21:21 UTC
I don't know to fix it also. (If it is even possible to fix it)

I would use setBorder(new EmptyBorder(0,2,0,0)) instead of 
setBorder(new EmptyBorder(0,2,0,8))  :-)
Comment 14 Jan Becicka 2004-09-20 14:40:07 UTC
Yes, me too, but this issue was about editor toolbar, which is not
precisely according to the spec. This is the reason why the
EmptyBorder(0,2,0,8) was used :)
Comment 15 Martin Roskanin 2004-09-20 14:43:11 UTC
Yes, I know that :-)
It was just a small attempt to convince UI team to change UI spec :-)
Comment 16 Jan Becicka 2004-09-24 09:50:33 UTC
CCing Tim, maybe he knows how to do that.
Comment 17 _ tboudreau 2004-09-25 03:49:31 UTC
I did some ugliness for the combo boxes in the property sheet for Aqua, to always return 
Insets(0,0,0,0) from getInsets().  No idea if that's your problem here.  Maybe see if it either 
has a compound border with an outer EmptyBorder (which you can strip out), or if you can 
just give it a different (but decent looking border) - that's probably where the problem is.

Of course, if we intergrated the Navigator module we wouldn't need a combo box in the 
editor toolbar :-)
Comment 18 Jan Becicka 2004-10-15 08:33:49 UTC
Ugly toolbar drawing fixed.
Checking in NavigateAction.java;
/cvs/java/src/org/netbeans/modules/java/ui/actions/NavigateAction.java,v
 <--  NavigateAction.java
new revision: 1.19; previous revision: 1.18
done

But the the toolbar is still not sized correctly. Some pixels missing,
but I don't think, that this issue is P3.
Feel free to change priority of this issue, but for me it is P5.
Comment 19 jrojcek 2004-10-18 19:57:15 UTC
All visual appearance bugs should be P3 at least. Visual appearance gives the user a first 
impression about product's quality.
Comment 20 _ tboudreau 2004-10-18 21:46:40 UTC
FYI, the toolbar also looks a bit funny on Aqua - no upper border, which looks a bit odd.
Comment 21 Jan Becicka 2004-10-19 08:58:04 UTC
I'm sorry, I don't know how to fix it. I even don't know what is
wrong. It looks fine on my Windows XP. I give up.
Comment 22 Miloslav Metelka 2004-10-21 14:19:18 UTC
Looks like we need some Swing experts here to help us with the issue.
Let me recap the problem:
We need a border for a swing component (JComboBox in a toolbar) and
that border must allow the gradient of the underlying toolbar to be
visible around the button. If we use EmptyBorder then the underlying
toolbar's gradient is not visible because of the border on Metal L&F.

As the setContentAreaFilled() is only present on the AbstractButton
(not JComponent) one idea that comes to my mind is to create a JPanel
with the combo and a disabled JButton on the right and call
setContentAreaFilled(false) on the JButton. The panel would be used as
the presenter. Unfortunately the JButton would have to have the
explicit preferred width (but preferred height should in fact be
delegated to the combo's preferred height) so either we would have to
override the JButton's getPreferredSize() or use setMinimumSize(new
Dimension(12, 0)) if that has effect (not sure).
 Of course this is a sort of hack so if anyone knows about any better
idea please speak up.
Comment 23 ehucka 2005-01-11 12:46:19 UTC
old issue, please re-evaluate
Comment 24 Jan Becicka 2005-01-27 11:36:55 UTC
Navigation drop-down was replaced by Navigator module
Comment 25 Quality Engineering 2007-09-20 12:46:41 UTC
Reorganization of java component