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 74522 - Matisse changes border and margin without notice
Summary: Matisse changes border and margin without notice
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 96489 97255 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-06 15:48 UTC by swpalmer
Modified: 2007-08-07 14:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2006-04-06 15:48:35 UTC
Matisse will change the default border and margins of some components, presumably to work around 
"ugliness" in some particular Look and Feels.  The problem is that this is simply not in the realm of things 
that Matisse has any business messing with.   By attempting to work around appearance issues in some 
specific look and feels it has broken the general case by removing needed borders and margins of other 
look and feels.
The Quaqua look and feel used by some Mac developers is an example of where this goes wrong.
Comment 1 randelshofer 2006-04-08 16:02:04 UTC
I am highly interested to see Quaqua work well with Matisse.
If this is not going to be fixed, I will add workarounds to the Quaqua Look and Feel specifically for this. 
e.g. by implementing a System property, which will make the UI ignore border and margin settings.

-Werner Randelshofer, Quaqua Look and Feel
Comment 2 winnall 2006-04-09 21:53:03 UTC
I have been bitten by this bug using Quaqua on Mac OS X. I think that Matisse is endangering the Java 
Desktop by enforcing arbitrary rules: it would be better for Matisse to do less and allow products like 
Quaqua and JGoodies to make enhancements which improve the user experience on the end-platform. A 
Matisse L&F is legitimate but it shouldn't usurp any prerogatives.

Stephen Winnall, Vimia GmbH
Comment 3 Jan Stola 2006-09-07 16:51:21 UTC
I don't agree that Matisse shouldn't modify borders and margins because that 
would make the forms ugly on standard look and feels. On the other hand I 
understand that these changes may not work well with other look and feels. 
Unfortunately I don't see a good solution there. Do you have any idea? Note 
that you can always restore the default border and margin for any component 
within Matisse.
Comment 4 randelshofer 2006-09-07 20:22:46 UTC
> I don't agree that Matisse shouldn't modify borders and margins because that 
> would make the forms ugly on standard look and feels.

The problem is that this 1) prevents future fixes on the standard look and feels, 
and 2) all look and feels are now forced to not have the border and margins set 
to the values that are preferred by Matisse.

> Do you have any idea? Note that you can always restore the default border 
> and margin for any component within Matisse.

I would to have an option in the IDE allowing me to turn this behavior off.
Comment 5 randelshofer 2006-09-07 20:23:35 UTC
> I don't agree that Matisse shouldn't modify borders and margins because that 
> would make the forms ugly on standard look and feels.

The problem is that this 1) prevents future fixes on the standard look and feels, 
and 2) all look and feels are now forced to not have the border and margins set 
to the values that are preferred by Matisse.

> Do you have any idea? Note that you can always restore the default border 
> and margin for any component within Matisse.

I would like to have an option in the IDE allowing me to turn this behavior off.
Comment 6 Jan Stola 2006-09-08 13:36:44 UTC
> I would like to have an option in the IDE allowing me
> to turn this behavior off.

Of course, we will not make this option visible in UI (e.g. in Options dialog), 
but we can provide you a System property, for example netbeans.form.laf_tweaks 
that would turn the modification of borders and margins off (for newly created 
components). You can recommend usage of this option on your web (in the IDE 
integration section) e.g. besides flags like -J-DQuaqua.opaque=true you would 
add also -J-Dnetbeans.form.laf_tweaks=no. Would that work for you?
Comment 7 randelshofer 2006-09-08 21:20:39 UTC
jstola: that's a good proposal, which would work fine for me.

There is a little downside though. If you are not going to make this switch visible in the UI of NetBeans, 
then the majority of the layouts created with Matisse will still not work with the Quaqua look and feel. 
Therefore, I still need to implement a workaround for this in the Quaqua Look and Feel. Maybe I'll make 
Quaqua support a System property or UIManager property that enforces borders and margins. i.e. 
"Quaqua.enforceVisualMargins=true" or something... 

On the upside, I think, I have found now a way, to get rid of the "ugliness" of the standard look and 
feels, even if the netbeans.form.laf_tweaks switch is turned to off. A program just needs to put the 
"Matisse values" into UIManager after it has set a standard look and feel. (e.g. put an EmptyBorder to 
CheckBox.border after the CrossPlattformLookAndFeel has been set). This will also fix the "ugliness" 
when other layout managers than GroupLayout are in use.

Thanks,
Werner


Comment 8 Tomas Pavek 2007-08-07 14:21:58 UTC
*** Issue 96489 has been marked as a duplicate of this issue. ***
Comment 9 Tomas Pavek 2007-08-07 14:22:44 UTC
*** Issue 97255 has been marked as a duplicate of this issue. ***
Comment 10 Tomas Pavek 2007-08-07 14:41:44 UTC
After all we decided to stop setting the zero border and margin to checkboxes and radiobuttons due to problems on Mac
(Aqua), Metal look&feel and potentially other areas. We are aware of the impact on Windows platform, but it seems
there's no choice - it was a hack trying to fix a problem in Swing that can't be fixed on our side. I think in this
situation we don't need the described cmd line switch (system property) anymore.

Changed file:
/cvs/form/src/org/netbeans/modules/form/MetaComponentCreator.java
new revision: 1.106; previous revision: 1.105