1 /* 2 * aTunes 3 * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors 4 * 5 * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors 6 * 7 * http://www.atunes.org 8 * http://sourceforge.net/projects/atunes 9 * 10 * This program is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU General Public License 12 * as published by the Free Software Foundation; either version 2 13 * of the License, or (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 */ 20 21 package net.sourceforge.atunes.gui.images; 22 23 import java.awt.Color; 24 import java.awt.Polygon; 25 import java.awt.Rectangle; 26 import java.awt.geom.Ellipse2D; 27 28 import javax.swing.ImageIcon; 29 30 /** 31 * Icon for audio file 32 * 33 * @author alex 34 * 35 */ 36 public class AudioFileImageSmallIcon extends CachedIconFactory { 37 38 /** 39 * 40 */ 41 private static final long serialVersionUID = 4256539676766817966L; 42 43 private static final int SMALL_WIDTH = 16; 44 private static final int SMALL_HEIGHT = 16; 45 46 @Override createIcon(final Color color)47 protected ImageIcon createIcon(final Color color) { 48 Ellipse2D.Float e1 = new Ellipse2D.Float(1, 11, 6, 3); 49 Ellipse2D.Float e2 = new Ellipse2D.Float(8, 10, 6, 3); 50 51 Rectangle r1 = new Rectangle(5, 4, 2, 8); 52 Rectangle r2 = new Rectangle(12, 3, 2, 8); 53 Polygon r3 = new Polygon(); 54 r3.addPoint(5, 4); 55 r3.addPoint(5, 7); 56 r3.addPoint(14, 4); 57 r3.addPoint(14, 2); 58 59 return IconGenerator.generateIcon(color, SMALL_WIDTH, SMALL_HEIGHT, e1, 60 e2, r1, r2, r3); 61 } 62 } 63