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

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

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

revision 1.20 by rabbit78, Wed Nov 16 15:43:34 2005 UTC revision 1.21 by langel, Tue Nov 22 20:14:34 2005 UTC
# Line 2467  public class MetalIconFactory implements Line 2467  public class MetalIconFactory implements
2467      return treeHardDriveIcon;      return treeHardDriveIcon;
2468    }    }
2469    
2470      /**
2471       * Returns a new instance of a 4 x 8 icon showing a small black triangle that
2472       * points to the right.  This is displayed in menu items that have a
2473       * sub menu.
2474       *
2475       * @return The icon.
2476       */
2477      public static Icon getMenuArrowIcon()
2478      {
2479        return new Icon()
2480        {
2481          public int getIconHeight()
2482          {
2483            return 8;
2484          }
2485    
2486          public int getIconWidth()
2487          {
2488            return 4;
2489          }
2490    
2491          public void paintIcon(Component c, Graphics g, int x, int y)
2492          {
2493            Color saved = g.getColor();
2494            g.setColor(Color.BLACK);
2495            for (int i = 0; i < 4; i++)
2496              g.drawLine(x + i, y + i, x + i, y + 7 - i);
2497            g.setColor(saved);
2498          }
2499        };
2500      }
2501      
2502      /**
2503       * Returns a new instance of a 4 x 8 icon showing a small black triangle that
2504       * points to the right.  This is displayed in menu items that have a
2505       * sub menu.
2506       *
2507       * @return The icon.
2508       */
2509      public static Icon getMenuItemArrowIcon()
2510      {
2511        return getMenuArrowIcon();
2512      }
2513      
2514      /**
2515       * Returns a new instance of a 13 x 13 icon showing a small black check mark.
2516       *
2517       * @return The icon.
2518       */
2519      public static Icon getMenuItemCheckIcon()
2520      {
2521        return new Icon()
2522        {
2523          public int getIconHeight()
2524          {
2525            return 13;
2526          }
2527    
2528          public int getIconWidth()
2529          {
2530            return 13;
2531          }
2532    
2533          public void paintIcon(Component c, Graphics g, int x, int y)
2534          {
2535            Color saved = g.getColor();
2536            g.setColor(Color.BLACK);
2537            g.drawLine(3 + x, 5 + y, 3 + x, 9 + y);
2538            g.drawLine(4 + x, 5 + y, 4 + x, 9 + y);
2539            g.drawLine(5 + x, 7 + y, 9 + x, 3 + y);
2540            g.drawLine(5 + x, 8 + y, 9 + x, 4 + y);
2541            g.setColor(saved);
2542          }
2543        };
2544      }
2545  }  }

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