1 package org.columba.core.gui.base; 17 18 import java.awt.Color ; 19 import java.awt.Component ; 20 import java.awt.Graphics ; 21 import java.awt.Graphics2D ; 22 23 import javax.swing.ImageIcon ; 24 25 @SuppressWarnings ( { "serial", "serial" }) 26 public class AscendingIcon extends ImageIcon { 27 28 private Color color = new Color (100,100,100); 29 30 public AscendingIcon() { 31 super(); 32 } 33 34 public AscendingIcon(Color color) { 35 super(); 36 this.color = color; 37 } 38 39 public void paintIcon(Component c, Graphics g, int x, int y) { 40 Graphics2D g2 = (Graphics2D ) g; 41 42 int[] xp = new int[3]; 43 int[] yp = new int[3]; 44 45 xp[0] = x; 46 xp[1] = x + 9; 47 xp[2] = x + 4; 48 49 yp[0] = y; 50 yp[1] = y; 51 yp[2] = y + 5; 52 53 g2.setColor(color); 54 g2.fillPolygon(xp, yp, 3); 55 } 56 57 60 public int getIconHeight() { 61 return 6; 62 } 63 64 67 public int getIconWidth() { 68 return 10; 69 } 70 71 } 72 | Popular Tags |