/[classpath]/classpath/javax/swing/plaf/basic/BasicIconFactory.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicIconFactory.java

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

revision 1.12 by trebligd, Fri Aug 26 18:17:57 2005 UTC revision 1.13 by trebligd, Thu Sep 29 08:53:11 2005 UTC
# Line 41  package javax.swing.plaf.basic; Line 41  package javax.swing.plaf.basic;
41  import java.awt.Color;  import java.awt.Color;
42  import java.awt.Component;  import java.awt.Component;
43  import java.awt.Graphics;  import java.awt.Graphics;
 import java.awt.Polygon;  
44  import java.io.Serializable;  import java.io.Serializable;
45    
46  import javax.swing.Icon;  import javax.swing.Icon;
# Line 241  public class BasicIconFactory implements Line 240  public class BasicIconFactory implements
240    {    {
241      return new DummyIcon();      return new DummyIcon();
242    }    }
243      
244      /**
245       * Returns a new instance of a 4 x 8 icon showing a small black triangle that
246       * points to the right.  This is displayed in menu items that have a
247       * sub menu.
248       *
249       * @return The icon.
250       */
251    public static Icon getMenuArrowIcon()    public static Icon getMenuArrowIcon()
252    {    {
253      return new Icon()      return new Icon()
254        {        {
255          public int getIconHeight()          public int getIconHeight()
256          {          {
257            return 12;            return 8;
258          }          }
   
259          public int getIconWidth()          public int getIconWidth()
260          {          {
261            return 12;            return 4;
262          }          }
   
263          public void paintIcon(Component c, Graphics g, int x, int y)          public void paintIcon(Component c, Graphics g, int x, int y)
264          {          {
           g.translate(x, y);  
   
265            Color saved = g.getColor();            Color saved = g.getColor();
   
266            g.setColor(Color.BLACK);            g.setColor(Color.BLACK);
267              for (int i = 0; i < 4; i++)
268            g.fillPolygon(new Polygon(new int[] { 3, 9, 3 },              g.drawLine(x + i, y + i, x + i, y + 7 - i);
                                   new int[] { 2, 6, 10 },  
                                   3));  
   
269            g.setColor(saved);            g.setColor(saved);
           g.translate(-x, -y);  
270          }          }
271        };        };
272    }    }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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