Source for javax.swing.plaf.metal.MetalIconFactory

   1: /* MetalIconFactory.java --
   2:    Copyright (C) 2005 Free Software Foundation, Inc.
   3: 
   4: This file is part of GNU Classpath.
   5: 
   6: GNU Classpath is free software; you can redistribute it and/or modify
   7: it under the terms of the GNU General Public License as published by
   8: the Free Software Foundation; either version 2, or (at your option)
   9: any later version.
  10: 
  11: GNU Classpath is distributed in the hope that it will be useful, but
  12: WITHOUT ANY WARRANTY; without even the implied warranty of
  13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14: General Public License for more details.
  15: 
  16: You should have received a copy of the GNU General Public License
  17: along with GNU Classpath; see the file COPYING.  If not, write to the
  18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19: 02110-1301 USA.
  20: 
  21: Linking this library statically or dynamically with other modules is
  22: making a combined work based on this library.  Thus, the terms and
  23: conditions of the GNU General Public License cover the whole
  24: combination.
  25: 
  26: As a special exception, the copyright holders of this library give you
  27: permission to link this library with independent modules to produce an
  28: executable, regardless of the license terms of these independent
  29: modules, and to copy and distribute the resulting executable under
  30: terms of your choice, provided that you also meet, for each linked
  31: independent module, the terms and conditions of the license of that
  32: module.  An independent module is a module which is not derived from
  33: or based on this library.  If you modify this library, you may extend
  34: this exception to your version of the library, but you are not
  35: obligated to do so.  If you do not wish to do so, delete this
  36: exception statement from your version. */
  37: 
  38: 
  39: package javax.swing.plaf.metal;
  40: 
  41: import java.awt.Color;
  42: import java.awt.Component;
  43: import java.awt.Graphics;
  44: import java.io.Serializable;
  45: 
  46: import javax.swing.Icon;
  47: import javax.swing.JSlider;
  48: 
  49: /**
  50:  * Creates icons for the {@link MetalLookAndFeel}.
  51:  */
  52: public class MetalIconFactory implements Serializable 
  53: {
  54: 
  55:   /** A constant representing "dark". */
  56:   public static final boolean DARK = false;
  57:     
  58:   /** A constant representing "light". */
  59:   public static final boolean LIGHT = true;
  60:     
  61:   /**
  62:    * An icon representing a file (drawn as a piece of paper with the top-right
  63:    * corner turned down).
  64:    */
  65:   public static class FileIcon16 implements Icon, Serializable 
  66:   {
  67:     /**
  68:      * Returns the width of the icon, in pixels.
  69:      * 
  70:      * @return The width of the icon.
  71:      */
  72:     public int getIconWidth() 
  73:     {
  74:       return 16;
  75:     }
  76: 
  77:     /**
  78:      * Returns the height of the icon, in pixels.
  79:      * 
  80:      * @return The height of the icon.
  81:      */
  82:     public int getIconHeight() 
  83:     {
  84:       return 16;
  85:     }
  86:     
  87:     /**
  88:      * Paints the icon at the location (x, y).
  89:      * 
  90:      * @param c  the component.
  91:      * @param g  the graphics context.
  92:      * @param x  the x coordinate.
  93:      * @param y  the y coordinate.
  94:      */
  95:     public void paintIcon(Component c, Graphics g, int x, int y) 
  96:     {
  97:       // TODO: pick up appropriate UI colors
  98:       g.setColor(Color.black);
  99:       g.drawLine(x, y, x + 9, y);            
 100:       g.drawLine(x, y + 1, x, y + 15);            
 101:       g.drawLine(x, y + 15, x + 12, y + 15);            
 102:       g.drawLine(x + 12, y + 15, x + 12, y + 6);            
 103:       g.drawLine(x + 12, y + 6, x + 9, y);           
 104: 
 105:       g.drawLine(x + 7, y + 2, x + 11, y + 6);
 106:       g.drawLine(x + 8, y + 1, x + 9, y + 1);
 107: 
 108:       g.setColor(new Color(204, 204, 255));
 109:       g.drawLine(x + 1, y + 1, x + 7, y + 1);            
 110:       g.drawLine(x + 1, y + 1, x + 1, y + 14);            
 111:       g.drawLine(x + 1, y + 14, x + 11, y + 14);            
 112:       g.drawLine(x + 11, y + 14, x + 11, y + 7);            
 113:       g.drawLine(x + 8, y + 2, x + 10, y + 4);
 114:     }
 115:     
 116:     /**
 117:      * Returns the additional height (???).
 118:      * 
 119:      * @return The additional height.
 120:      */
 121:     public int getAdditionalHeight() 
 122:     {
 123:       return 0;
 124:     }
 125:         
 126:     /**
 127:      * Returns the shift (???).
 128:      * 
 129:      * @return The shift.
 130:      */
 131:     public int getShift() 
 132:     {
 133:       return 0;
 134:     }
 135:         
 136:   }
 137:     
 138:   /**
 139:    * An icon representing a folder.
 140:    */
 141:   public static class FolderIcon16 implements Icon, Serializable 
 142:   {
 143:     /**
 144:      * Returns the width of the icon, in pixels.
 145:      * 
 146:      * @return The width of the icon.
 147:      */
 148:     public int getIconWidth() {
 149:       return 16;
 150:     }
 151:     
 152:     /**
 153:      * Returns the height of the icon, in pixels.
 154:      * 
 155:      * @return The height of the icon.
 156:      */
 157:     public int getIconHeight() 
 158:     {
 159:       return 16;
 160:     }
 161: 
 162:     /**
 163:      * Paints the icon at the location (x, y).
 164:      * 
 165:      * @param c  the component.
 166:      * @param g  the graphics device.
 167:      * @param x  the x coordinate.
 168:      * @param y  the y coordinate.
 169:      */
 170:     public void paintIcon(Component c, Graphics g, int x, int y) 
 171:     {
 172:       // TODO: pick up appropriate UI colors
 173:       g.setColor(Color.black);
 174:       g.drawLine(x, y + 3, x, y + 12);
 175:       g.drawLine(x, y + 12, x + 15, y + 12);
 176:       g.drawLine(x + 15, y + 12, x + 15, y + 2);
 177:       g.drawLine(x + 14, y + 3, x + 9, y + 3);
 178:       g.drawLine(x + 8, y + 2, x + 1, y + 2);
 179:       g.setColor(new Color(204, 204, 255));
 180:       g.fillRect(x + 2, y + 4, 7, 8);
 181:       g.fillRect(x + 9, y + 5, 6, 7);
 182:       g.setColor(new Color(102, 102, 153));
 183:       g.drawLine(x + 9, y + 2, x + 14, y + 2);
 184:       g.setColor(new Color(50, 50, 120));
 185:       g.drawLine(x + 9, y + 1, x + 15, y + 1);
 186:       g.drawLine(x + 10, y, x + 15, y);
 187:     }
 188:     
 189:     /**
 190:      * Returns the additional height (???).
 191:      * 
 192:      * @return The additional height.
 193:      */
 194:     public int getAdditionalHeight() 
 195:     {
 196:       return 0;
 197:     }
 198:     
 199:     /**
 200:      * Returns the shift (???).
 201:      * 
 202:      * @return The shift.
 203:      */
 204:     public int getShift() 
 205:     {
 206:       return 0;
 207:     }
 208:         
 209:   }
 210:    
 211:     /**
 212:    * The icon used to display the thumb control on a horizontally oriented
 213:    * {@link JSlider} component.
 214:    */
 215:   private static class HorizontalSliderThumbIcon 
 216:       implements Icon, Serializable 
 217:   {
 218: 
 219:     /**
 220:      * Creates a new instance.
 221:      */
 222:     public HorizontalSliderThumbIcon() 
 223:     {
 224:     }
 225:     
 226:     /**
 227:      * Returns the width of the icon, in pixels.
 228:      * 
 229:      * @return The width of the icon.
 230:      */
 231:     public int getIconWidth() 
 232:     {
 233:       return 15;
 234:     }
 235:     
 236:     /**
 237:      * Returns the height of the icon, in pixels.
 238:      * 
 239:      * @return The height of the icon.
 240:      */
 241:     public int getIconHeight() 
 242:     {
 243:       return 16;
 244:     }
 245:     
 246:     /**
 247:      * Paints the icon, taking into account whether or not the component has 
 248:      * the focus.
 249:      * 
 250:      * @param c  the component.
 251:      * @param g  the graphics device.
 252:      * @param x  the x-coordinate.
 253:      * @param y  the y-coordinate.
 254:      */
 255:     public void paintIcon(Component c, Graphics g, int x, int y) 
 256:     {
 257:       boolean focus = false;
 258:       if (c != null) 
 259:         focus = c.hasFocus();    
 260:       // TODO: pick up the colors from the look and feel
 261:       
 262:       // draw the outline
 263:       g.setColor(Color.black);
 264:       g.drawLine(x + 1, y, x + 13, y);
 265:       g.drawLine(x + 14, y + 1, x + 14, y + 7);
 266:       g.drawLine(x + 14, y + 8, x + 7, y + 15);
 267:       g.drawLine(x + 6, y + 14, x, y + 8);
 268:       g.drawLine(x, y + 7, x, y + 1);
 269:       
 270:       // fill the icon
 271:       g.setColor(focus ? new Color(153, 153, 204) : new Color(204, 204, 204));  // medium
 272:       g.fillRect(x + 2, y + 2, 12, 7);
 273:       g.drawLine(x + 2, y + 9, x + 12, y + 9);
 274:       g.drawLine(x + 3, y + 10, x + 11, y + 10);
 275:       g.drawLine(x + 4, y + 11, x + 10, y + 11);
 276:       g.drawLine(x + 5, y + 12, x + 9, y + 12);
 277:       g.drawLine(x + 6, y + 13, x + 8, y + 13);
 278:       g.drawLine(x + 7, y + 14, x + 7, y + 14);
 279:       
 280:       // draw highlights
 281:       g.setColor(focus ? new Color(204, 204, 255) : new Color(255, 255, 255));  // light
 282:       g.drawLine(x + 1, y + 1, x + 13, y + 1);
 283:       g.drawLine(x + 1, y + 2, x + 1, y + 8);
 284:       g.drawLine(x + 2, y + 2, x + 2, y + 2);
 285:       g.drawLine(x + 6, y + 2, x + 6, y + 2);
 286:       g.drawLine(x + 10, y + 2, x + 10, y + 2);
 287: 
 288:       g.drawLine(x + 4, y + 4, x + 4, y + 4);
 289:       g.drawLine(x + 8, y + 4, x + 8, y + 4);
 290: 
 291:       g.drawLine(x + 2, y + 6, x + 2, y + 6);
 292:       g.drawLine(x + 6, y + 6, x + 6, y + 6);
 293:       g.drawLine(x + 10, y + 6, x + 10, y + 6);
 294: 
 295:       // draw dots
 296:       g.setColor(focus ? new Color(102, 102, 153) : Color.black);                 // dark
 297:       g.drawLine(x + 3, y + 3, x + 3, y + 3);
 298:       g.drawLine(x + 7, y + 3, x + 7, y + 3);
 299:       g.drawLine(x + 11, y + 3, x + 11, y + 3);
 300: 
 301:       g.drawLine(x + 5, y + 5, x + 5, y + 5);
 302:       g.drawLine(x + 9, y + 5, x + 9, y + 5);
 303: 
 304:       g.drawLine(x + 3, y + 7, x + 3, y + 7);
 305:       g.drawLine(x + 7, y + 7, x + 7, y + 7);
 306:       g.drawLine(x + 11, y + 7, x + 11, y + 7);
 307: 
 308:     }        
 309:   }
 310:   
 311:   /**
 312:    * The icon used to display the thumb control on a horizontally oriented
 313:    * {@link JSlider} component.
 314:    */
 315:   private static class VerticalSliderThumbIcon implements Icon, Serializable 
 316:   {
 317:     /**
 318:      * Creates a new instance.
 319:      */
 320:     public VerticalSliderThumbIcon() 
 321:     {
 322:     }
 323:     
 324:     /**
 325:      * Returns the width of the icon, in pixels.
 326:      * 
 327:      * @return The width of the icon.
 328:      */
 329:     public int getIconWidth() 
 330:     {
 331:       return 16;
 332:     }
 333:     
 334:     /**
 335:      * Returns the height of the icon, in pixels.
 336:      * 
 337:      * @return The height of the icon.
 338:      */
 339:     public int getIconHeight() 
 340:     {
 341:       return 15;
 342:     }
 343:     
 344:     /**
 345:      * Paints the icon taking into account whether the slider control has the
 346:      * focus or not.
 347:      * 
 348:      * @param c  the slider (must be a non-<code>null</code> instance of
 349:      *           {@link JSlider}.
 350:      * @param g  the graphics device.
 351:      * @param x  the x-coordinate.
 352:      * @param y  the y-coordinate.
 353:      */
 354:     public void paintIcon(Component c, Graphics g, int x, int y) 
 355:     {
 356:       boolean focus = false;
 357:       if (c != null) 
 358:         focus = c.hasFocus();    
 359:       // TODO: pick up the colors from the look and feel
 360:       
 361:       // draw the outline
 362:       g.setColor(Color.black);
 363:       g.drawLine(x + 1, y, x + 7, y);
 364:       g.drawLine(x + 8, y, x + 15, y + 7);
 365:       g.drawLine(x + 14, y + 8, x + 8, y + 14);
 366:       g.drawLine(x + 8, y + 14, x + 1, y + 14);
 367:       g.drawLine(x, y + 13, x, y + 1);
 368:       
 369:       // fill the icon
 370:       g.setColor(focus ? new Color(153, 153, 204) : new Color(204, 204, 204));  // medium
 371:       g.fillRect(x + 2, y + 2, 7, 12);
 372:       g.drawLine(x + 9, y + 2, x + 9, y + 12);
 373:       g.drawLine(x + 10, y + 3, x + 10, y + 11);
 374:       g.drawLine(x + 11, y + 4, x + 11, y + 10);
 375:       g.drawLine(x + 12, y + 5, x + 12, y + 9);
 376:       g.drawLine(x + 13, y + 6, x + 13, y + 8);
 377:       g.drawLine(x + 14, y + 7, x + 14, y + 7);
 378:       
 379:       // draw highlights
 380:       g.setColor(focus ? new Color(204, 204, 255) : new Color(255, 255, 255));  // light
 381:       g.drawLine(x + 1, y + 1, x + 8, y + 1);
 382:       g.drawLine(x + 1, y + 2, x + 1, y + 13);
 383:       g.drawLine(x + 2, y + 2, x + 2, y + 2);
 384:       g.drawLine(x + 2, y + 6, x + 2, y + 6);
 385:       g.drawLine(x + 2, y + 10, x + 2, y + 10);
 386: 
 387:       g.drawLine(x + 4, y + 4, x + 4, y + 4);
 388:       g.drawLine(x + 4, y + 8, x + 4, y + 8);
 389: 
 390:       g.drawLine(x + 6, y + 2, x + 6, y + 2);
 391:       g.drawLine(x + 6, y + 6, x + 6, y + 6);
 392:       g.drawLine(x + 6, y + 10, x + 6, y + 10);
 393: 
 394:       // draw dots
 395:       g.setColor(focus ? new Color(102, 102, 153) : Color.black);                 // dark
 396:       g.drawLine(x + 3, y + 3, x + 3, y + 3);
 397:       g.drawLine(x + 3, y + 7, x + 3, y + 7);
 398:       g.drawLine(x + 3, y + 11, x + 3, y + 11);
 399: 
 400:       g.drawLine(x + 5, y + 5, x + 5, y + 5);
 401:       g.drawLine(x + 5, y + 9, x + 5, y + 9);
 402: 
 403:       g.drawLine(x + 7, y + 3, x + 7, y + 3);
 404:       g.drawLine(x + 7, y + 7, x + 7, y + 7);
 405:       g.drawLine(x + 7, y + 11, x + 7, y + 11);
 406:     }        
 407:   }
 408:   
 409:   /**
 410:    * A tree control icon.  This icon can be in one of two states: expanded and
 411:    * collapsed.
 412:    */
 413:   public static class TreeControlIcon implements Icon, Serializable 
 414:   {
 415:     
 416:     /** ???. */
 417:     protected boolean isLight;
 418:     
 419:     /** A flag that controls whether or not the icon is collapsed. */
 420:     private boolean collapsed;
 421:     
 422:     /**
 423:      * Creates a new icon.
 424:      * 
 425:      * @param isCollapsed  a flag that controls whether the icon is in the
 426:      *                     collapsed state or the expanded state.
 427:      */
 428:     public TreeControlIcon(boolean isCollapsed) 
 429:     {
 430:       collapsed = isCollapsed;
 431:     }
 432:     
 433:     /**
 434:      * Returns the width of the icon, in pixels.
 435:      * 
 436:      * @return The width of the icon.
 437:      */
 438:     public int getIconWidth() 
 439:     {
 440:       return 18;
 441:     }
 442:     /**
 443:      * Returns the height of the icon, in pixels.
 444:      * 
 445:      * @return The height of the icon.
 446:      */
 447:     public int getIconHeight() 
 448:     {
 449:       return 18;
 450:     }
 451:     
 452:     /**
 453:      * Paints the icon at the location (x, y).
 454:      * 
 455:      * @param c  the component.
 456:      * @param g  the graphics device.
 457:      * @param x  the x coordinate.
 458:      * @param y  the y coordinate.
 459:      */
 460:     public void paintIcon(Component c, Graphics g, int x, int y) 
 461:     {
 462:       x = x + 5;
 463:       y = y + 5;
 464:       if (collapsed) 
 465:       {
 466:         // TODO: pick up appropriate UI colors
 467:         g.setColor(Color.black);
 468:         g.drawLine(x + 2, y, x + 5, y);
 469:         g.drawLine(x + 6, y + 1, x + 7, y + 2);
 470:         g.fillRect(x + 7, y + 3, 5, 2);
 471:         g.drawLine(x + 7, y + 5, x + 6, y + 6);
 472:         g.drawLine(x + 1, y + 1, x + 1, y + 1);
 473:         g.drawLine(x, y + 2, x, y + 5);
 474:         g.drawLine(x + 1, y + 6, x + 1, y + 6);
 475:         g.drawLine(x + 2, y + 7, x + 5, y + 7);
 476:         g.fillRect(x + 3, y + 3, 2, 2);
 477: 
 478:         g.setColor(new Color(204, 204, 255));
 479:         g.drawLine(x + 3, y + 2, x + 4, y + 2);
 480:         g.drawLine(x + 2, y + 3, x + 2, y + 4);
 481:         g.drawLine(x + 3, y + 5, x + 3, y + 5);
 482:         g.drawLine(x + 5, y + 3, x + 5, y + 3);
 483:         
 484:         g.setColor(new Color(153, 153, 204));
 485:         g.drawLine(x + 2, y + 2, x + 2, y + 2);
 486:         g.drawLine(x + 2, y + 5, x + 2, y + 5);
 487:         g.drawLine(x + 2, y + 6, x + 5, y + 6);
 488:         g.drawLine(x + 5, y + 2, x + 5, y + 2);
 489:         g.drawLine(x + 6, y + 2, x + 6, y + 5);
 490:         
 491:         g.setColor(new Color(102, 102, 153));
 492:         g.drawLine(x + 2, y + 1, x + 5, y + 1);
 493:         g.drawLine(x + 1, y + 2, x + 1, y + 5);
 494:       }
 495:       else
 496:       {
 497:         // TODO: pick up appropriate UI colors
 498:         g.setColor(Color.black);
 499:         g.drawLine(x + 2, y, x + 5, y);
 500:         g.drawLine(x + 6, y + 1, x + 7, y + 2);
 501:         g.drawLine(x + 7, y + 2, x + 7, y + 5);
 502:         g.fillRect(x + 3, y + 7, 2, 5);
 503:         g.drawLine(x + 7, y + 5, x + 6, y + 6);
 504:         g.drawLine(x + 1, y + 1, x + 1, y + 1);
 505:         g.drawLine(x, y + 2, x, y + 5);
 506:         g.drawLine(x + 1, y + 6, x + 1, y + 6);
 507:         g.drawLine(x + 2, y + 7, x + 5, y + 7);
 508:         g.fillRect(x + 3, y + 3, 2, 2);
 509: 
 510:         g.setColor(new Color(204, 204, 255));
 511:         g.drawLine(x + 3, y + 2, x + 4, y + 2);
 512:         g.drawLine(x + 2, y + 3, x + 2, y + 4);
 513:         g.drawLine(x + 3, y + 5, x + 3, y + 5);
 514:         g.drawLine(x + 5, y + 3, x + 5, y + 3);
 515:         
 516:         g.setColor(new Color(153, 153, 204));
 517:         g.drawLine(x + 2, y + 2, x + 2, y + 2);
 518:         g.drawLine(x + 2, y + 5, x + 2, y + 5);
 519:         g.drawLine(x + 2, y + 6, x + 5, y + 6);
 520:         g.drawLine(x + 5, y + 2, x + 5, y + 2);
 521:         g.drawLine(x + 6, y + 2, x + 6, y + 5);
 522:         
 523:         g.setColor(new Color(102, 102, 153));
 524:         g.drawLine(x + 2, y + 1, x + 5, y + 1);
 525:         g.drawLine(x + 1, y + 2, x + 1, y + 5);
 526:       }
 527:     } 
 528:     
 529:     /**
 530:      * Simply calls {@link #paintIcon(Component, Graphics, int, int)}.
 531:      * 
 532:      * @param c  the component.
 533:      * @param g  the graphics device.
 534:      * @param x  the x coordinate.
 535:      * @param y  the y coordinate.
 536:      */
 537:     public void paintMe(Component c, Graphics g, int x, int y) 
 538:     {
 539:       paintIcon(c, g, x, y);  
 540:     }
 541:   }
 542:     
 543:   /**
 544:    * A tree folder icon.
 545:    */
 546:   public static class TreeFolderIcon extends FolderIcon16 
 547:   {
 548:     /**
 549:      * Creates a new instance.
 550:      */
 551:     public TreeFolderIcon() 
 552:     {     
 553:     }
 554:     
 555:     /**
 556:      * Returns the additional height (???).
 557:      * 
 558:      * @return The additional height.
 559:      */
 560:     public int getAdditionalHeight() 
 561:     {
 562:       return 2;
 563:     }
 564:     
 565:     /**
 566:      * Returns the shift (???).
 567:      * 
 568:      * @return The shift.
 569:      */
 570:     public int getShift() 
 571:     {
 572:       return -1;
 573:     }
 574:   }
 575:     
 576:   /**
 577:    * A tree leaf icon.
 578:    */
 579:   public static class TreeLeafIcon extends FileIcon16 
 580:   {
 581:     /**
 582:      * Creates a new instance.
 583:      */
 584:     public TreeLeafIcon() 
 585:     {
 586:     }
 587:     
 588:     /**
 589:      * Returns the additional height (???).
 590:      * 
 591:      * @return The additional height.
 592:      */
 593:     public int getAdditionalHeight() 
 594:     {
 595:       return 4;
 596:     }
 597:     
 598:     /**
 599:      * Returns the shift (???).
 600:      * 
 601:      * @return The shift.
 602:      */
 603:     public int getShift() 
 604:     {
 605:       return 2;
 606:     }
 607:   }
 608:     
 609:   /**
 610:    * Creates a new instance.  All the methods are static, so creating an 
 611:    * instance isn't necessary.
 612:    */
 613:   public MetalIconFactory() 
 614:   {   
 615:   }
 616:   
 617:   /**
 618:    * Returns the icon used to display the thumb for a horizontally oriented
 619:    * {@link JSlider}.
 620:    * 
 621:    * @return The icon.
 622:    */
 623:   public static Icon getHorizontalSliderThumbIcon() 
 624:   {
 625:     return new HorizontalSliderThumbIcon();
 626:   }
 627:     
 628:   /**
 629:    * Returns the icon used to display the thumb for a vertically oriented
 630:    * {@link JSlider}.
 631:    * 
 632:    * @return The icon.
 633:    */
 634:   public static Icon getVerticalSliderThumbIcon() 
 635:   {
 636:     return new VerticalSliderThumbIcon();
 637:   }
 638:     
 639:   /**
 640:    * Creates and returns a new tree folder icon.
 641:    * 
 642:    * @return A new tree folder icon.
 643:    */  
 644:   public static Icon getTreeFolderIcon() 
 645:   {
 646:     return new TreeFolderIcon();
 647:   }
 648:     
 649:   /**
 650:    * Creates and returns a new tree leaf icon.
 651:    * 
 652:    * @return A new tree leaf icon.
 653:    */
 654:   public static Icon getTreeLeafIcon() 
 655:   {
 656:     return new TreeLeafIcon();
 657:   }
 658:   
 659:   /**
 660:    * Creates and returns a tree control icon.
 661:    * 
 662:    * @param isCollapsed  a flag that controls whether the icon is in the 
 663:    *                     collapsed or expanded state.
 664:    * 
 665:    * @return A tree control icon.
 666:    */
 667:   public static Icon getTreeControlIcon(boolean isCollapsed) 
 668:   {
 669:     return new TreeControlIcon(isCollapsed);
 670:   }
 671: 
 672: }