Is this your first time here? SwingWiki is a Java Swing Developer community site with an big archive of Swing-related usenet groups and mailing lists, but also tips, tricks and articles and book reviews written by your colleagues from around the world. If you came here through a search engine and did not find what you were looking for, make sure to check the wiki table of contents.

[skinlf-dev] Bug correction

From:[freedata4321-2006@masked-domain]
Sent on:Fri, 22 Dec 2006 12:37:11 +0100 (CET)
Hello!

I recently used skinlf to provide a better look to my
app.
Unfortunately i got troubles with the menu items.
so i corrected some little things.
it's working but not for everything, especially with
transparent skins like whistler.

Here is the code fragment:

GtkPersonality.java

...

public boolean paintMenuItem(java.awt.Graphics g,
javax.swing.JMenuItem c) {
if (menuitemSelected != null) {
// FIXME: bug correction or skin
if (c.isArmed() || (c instanceof JMenu &&
c.getModel().isSelected())) {
if(c.isOpaque()) {
paintOpaqueMenuItem( g, c );
} else {
menuitemSelected.paint(g, c);
}
} else
if( c.isOpaque() ) {
paintOpaqueMenuItem( g, c );
}
else {
return false;
}

return true;
}
else {
return false;
}
}


private void paintOpaqueMenuItem( java.awt.Graphics
g, javax.swing.JMenuItem c ) {
if( background != null ) {
ImageUtils.paint(c, g, background,
backgroundPaintMode);
} else {
Rectangle rect = c.getVisibleRect();
Color old = g.getColor();
g.setColor( c.getBackground() );

// for the whistler theme pack
Composite oldComposite = ((Graphics2D)
g).getComposite();
((Graphics2D)
g).setComposite(AlphaComposite.SrcOver);

g.fillRect( rect.x, rect.y, rect.width,
rect.height );
g.setColor( old );
((Graphics2D) g).setComposite(oldComposite);
}
}
...


I would like to get your comments about this stuff.
And if it's working, maybe you can include it in a
next release :)

Oh by the way, i post you from a tricky address,
please follow-up to fredREMOVEisfree AT users .
sourceforge .net

Happy Christmas!






___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [dev-unsubscribe@masked-domain]
For additional commands, e-mail: [dev-help@masked-domain]
Found what you were looking for? If not - continue at Wiki Index

 
Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register | The Quest For Software++| Ruby Resources

Sedo - Buy and Sell Domain Names and Websites project info: swingwiki.org Statistics for project swingwiki.org etracker� web controlling instead of log file analysis