/[classpath]/classpath/javax/swing/plaf/metal/MetalBorders.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/metal/MetalBorders.java

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

revision 1.20 by trebligd, Tue Sep 27 15:40:26 2005 UTC revision 1.21 by trebligd, Tue Sep 27 20:53:56 2005 UTC
# Line 918  public class MetalBorders Line 918  public class MetalBorders
918    }    }
919        
920    /**    /**
921       * A button border that is only visible when the mouse pointer is within
922       * the button's bounds.
923       */
924      public static class RolloverButtonBorder
925        extends MetalBorders.ButtonBorder
926      {
927        /**
928         * Creates a new border instance.
929         */
930        public RolloverButtonBorder()
931        {
932        }
933        
934        /**
935         * Paints the border.
936         *
937         * @param c  the component.
938         * @param g  the graphics device.
939         * @param x  the x-coordinate.
940         * @param y  the y-coordinate.
941         * @param w  the width.
942         * @param h  the height.
943         */
944        public void paintBorder(Component c, Graphics g, int x, int y, int w,
945                int h)
946        {
947          boolean mouseIsOver = false;
948          if (c instanceof AbstractButton)
949            {
950              ButtonModel bmodel = ((AbstractButton) c).getModel();
951              mouseIsOver = bmodel.isRollover();
952            }
953          if (mouseIsOver)
954            super.paintBorder(c, g, x, y, w, h);
955        }
956      }
957      
958      /**
959     * This border is used in Toolbar buttons as inner border.     * This border is used in Toolbar buttons as inner border.
960     */     */
961    static class RolloverMarginBorder extends AbstractBorder    static class RolloverMarginBorder extends AbstractBorder

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

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