CVSROOT: /cvsroot/classpath Module name: classpath Changes by: Roman Kennke <rabbit78> 06/06/13 12:37:56
Modified files: javax/swing/plaf/basic: BasicLookAndFeel.java java/awt : Component.java . : ChangeLog Log message: 2006-06-13 Roman Kennke <[EMAIL PROTECTED]> * java/awt/Component.java (getGraphics): Translate child graphics correctly. (dispatchEvent): Only dispatch event if it hasn't been consumed yet by the global dispatcher. * javax/swing/plaf/basic/BasicLookAndFeel.java Added some API docs. (PopupHelper.mousePressed): Consume the event after closing opened menus. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java?cvsroot=classpath&r1=1.93&r2=1.94 http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/Component.java?cvsroot=classpath&r1=1.120&r2=1.121 http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.7793&r2=1.7794 Patches: Index: javax/swing/plaf/basic/BasicLookAndFeel.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java,v retrieving revision 1.93 retrieving revision 1.94 diff -u -b -r1.93 -r1.94 --- javax/swing/plaf/basic/BasicLookAndFeel.java 13 Jun 2006 09:28:57 -0000 1.93 +++ javax/swing/plaf/basic/BasicLookAndFeel.java 13 Jun 2006 12:37:53 -0000 1.94 @@ -79,7 +79,9 @@ import javax.swing.plaf.InsetsUIResource; /** - * BasicLookAndFeel + * A basic implementation of Swing's Look and Feel framework. This can serve + * as a base for custom look and feel implementations. + * * @author Andrew Selkirk */ public abstract class BasicLookAndFeel extends LookAndFeel @@ -126,8 +128,12 @@ Component target = ev.getComponent(); if (target instanceof Container) target = ((Container) target).findComponentAt(ev.getPoint()); - if (! m.isComponentPartOfCurrentMenu(target)) + if (m.getSelectedPath().length > 0 + && ! m.isComponentPartOfCurrentMenu(target)) + { m.clearSelectedPath(); + ev.consume(); + } } } @@ -197,6 +203,9 @@ */ private transient PopupHelper popupHelper; + /** + * Maps the audio actions for this l&f. + */ private ActionMap audioActionMap; /** @@ -425,9 +434,15 @@ } /** - * loadResourceBundle - * @param defaults TODO + * Loads the resource bundle in 'resources/basic' and adds the contained + * key/value pairs to the <code>defaults</code> table. + * + * @param defaults the UI defaults to load the resources into */ + // FIXME: This method is not used atm and private and thus could be removed. + // However, I consider this method useful for providing localized + // descriptions and similar stuff and therefore think that we should use it + // instead and provide the resource bundles. private void loadResourceBundle(UIDefaults defaults) { ResourceBundle bundle; @@ -446,7 +461,9 @@ } /** - * initComponentDefaults + * Populates the <code>defaults</code> table with UI default values for + * colors, fonts, keybindings and much more. + * * @param defaults the defaults table (<code>null</code> not permitted). */ protected void initComponentDefaults(UIDefaults defaults) Index: java/awt/Component.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v retrieving revision 1.120 retrieving revision 1.121 diff -u -b -r1.120 -r1.121 --- java/awt/Component.java 4 Jun 2006 20:21:39 -0000 1.120 +++ java/awt/Component.java 13 Jun 2006 12:37:54 -0000 1.121 @@ -1739,9 +1739,8 @@ if (gfx == null && parent != null) { gfx = parent.getGraphics(); - Rectangle bounds = getBounds(); - gfx.setClip(bounds); - gfx.translate(bounds.x, bounds.y); + gfx.clipRect(getX(), getY(), getWidth(), getHeight()); + gfx.translate(getX(), getY()); return gfx; } gfx.setFont(font); @@ -2315,6 +2314,7 @@ // Some subclasses in the AWT package need to override this behavior, // hence the use of dispatchEventImpl(). + if (! e.isConsumed()) dispatchEventImpl(e); } Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.7793 retrieving revision 1.7794 diff -u -b -r1.7793 -r1.7794 --- ChangeLog 13 Jun 2006 09:28:56 -0000 1.7793 +++ ChangeLog 13 Jun 2006 12:37:54 -0000 1.7794 @@ -1,3 +1,14 @@ +2006-06-13 Roman Kennke <[EMAIL PROTECTED]> + + * java/awt/Component.java + (getGraphics): Translate child graphics correctly. + (dispatchEvent): Only dispatch event if it hasn't been consumed + yet by the global dispatcher. + * javax/swing/plaf/basic/BasicLookAndFeel.java + Added some API docs. + (PopupHelper.mousePressed): Consume the event after closing + opened menus. + 2006-06-13 David Gilbert <[EMAIL PROTECTED]> * javax/swing/plaf/basic/BasicCheckBoxUI.java: Source code formatting