FileDocCategorySizeDatePackage
ArrowIcon.javaAPI DocExample1385Mon Nov 09 12:45:50 GMT 1998None

ArrowIcon

public class ArrowIcon extends Object implements Icon

Fields Summary
public static final int
UP
public static final int
DOWN
private int
direction
private Polygon
pagePolygon
private int[]
arrowX
private Polygon
arrowUpPolygon
private Polygon
arrowDownPolygon
Constructors Summary
public ArrowIcon(int which)


     
    direction = which;
  
Methods Summary
public intgetIconHeight()

 return 14; 
public intgetIconWidth()

 return 14; 
public voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)

    g.setColor(Color.black);
    pagePolygon.translate(x, y);
    g.drawPolygon(pagePolygon);
    pagePolygon.translate(-x, -y);
    if (direction == UP) {
      arrowUpPolygon.translate(x, y);
      g.fillPolygon(arrowUpPolygon);
      arrowUpPolygon.translate(-x, -y);
    }
    else {
      arrowDownPolygon.translate(x, y);
      g.fillPolygon(arrowDownPolygon);
      arrowDownPolygon.translate(-x, -y);
    }