/[classpath]/classpath/gnu/java/awt/AWTUtilities.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/AWTUtilities.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by rabbit78, Mon Jul 25 14:18:03 2005 UTC revision 1.5 by rabbit78, Tue Jul 26 13:53:34 2005 UTC
# Line 345  public class AWTUtilities Line 345  public class AWTUtilities
345     * @see #calculateInnerArea     * @see #calculateInnerArea
346     */     */
347    public static Rectangle calculateInsetArea(Rectangle base, Insets insets,    public static Rectangle calculateInsetArea(Rectangle base, Insets insets,
348                                                                                                                                                                                   Rectangle ret)                                               Rectangle ret)
349    {    {
350      if (ret == null)      if (ret == null)
351        ret = new Rectangle();        ret = new Rectangle();
# Line 570  public class AWTUtilities Line 570  public class AWTUtilities
570     * @param destination The component which the return value will be     * @param destination The component which the return value will be
571     * expressed in terms of     * expressed in terms of
572     *     *
573     * @return The point <code>(x,y)</code> converted from the coordinate space of the     * @return The point <code>(x,y)</code> converted from the coordinate
574       *         space of the
575     * source component to the coordinate space of the destination component     * source component to the coordinate space of the destination component
576     *     *
577     * @see #convertPointToScreen     * @see #convertPointToScreen
# Line 579  public class AWTUtilities Line 580  public class AWTUtilities
580     * @see #getRoot     * @see #getRoot
581     */     */
582    public static Point convertPoint(Component source, int x, int y,    public static Point convertPoint(Component source, int x, int y,
583                                                                                                                                           Component destination)                                     Component destination)
584    {    {
585      Point pt = new Point(x, y);      Point pt = new Point(x, y);
586    
# Line 622  public class AWTUtilities Line 623  public class AWTUtilities
623     * @see #convertPoint     * @see #convertPoint
624     * @see #getRoot     * @see #getRoot
625     */     */
626    public static Rectangle convertRectangle(Component source,    public static Rectangle convertRectangle(Component source, Rectangle rect,
627                                                                                                                                                                           Rectangle rect,                                             Component destination)
                                                                                                                                                                          Component destination)  
628    {    {
629      Point pt = convertPoint(source, rect.x, rect.y, destination);      Point pt = convertPoint(source, rect.x, rect.y, destination);
630      return new Rectangle(pt.x, pt.y, rect.width, rect.height);      return new Rectangle(pt.x, pt.y, rect.width, rect.height);
# Line 650  public class AWTUtilities Line 650  public class AWTUtilities
650     * @see #convertPoint     * @see #convertPoint
651     */     */
652    public static MouseEvent convertMouseEvent(Component source,    public static MouseEvent convertMouseEvent(Component source,
653                                                                                                                                                                                   MouseEvent sourceEvent,                                               MouseEvent sourceEvent,
654                                                                                                                                                                                   Component destination)                                               Component destination)
655    {    {
656      Point newpt = convertPoint(source, sourceEvent.getX(), sourceEvent.getY(),      Point newpt = convertPoint(source, sourceEvent.getX(), sourceEvent.getY(),
657          destination);                                 destination);
658    
659      return new MouseEvent(destination, sourceEvent.getID(),      return new MouseEvent(destination, sourceEvent.getID(),
660          sourceEvent.getWhen(), sourceEvent.getModifiers(),                            sourceEvent.getWhen(), sourceEvent.getModifiers(),
661                                  newpt.x, newpt.y, sourceEvent.getClickCount(),                            newpt.x, newpt.y, sourceEvent.getClickCount(),
662                                  sourceEvent.isPopupTrigger(), sourceEvent.getButton());                            sourceEvent.isPopupTrigger(),
663                              sourceEvent.getButton());
664    }    }
665    
666    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26