public void update(Graphics g) {

		int w = getWidth();
		int h = getHeight();
		g.setColor(getBackground());
		g.fillRect(0, 0, w, h);

		g.setColor(getForeground());
		xend = w - margin * 2;
		yend = h / 2;
		g.drawLine(margin, yend - 1, xend, yend - 1);
		g.drawLine(margin, yend, xend, yend);
		g.drawLine(margin, yend + 1, xend, yend + 1);

		switch (type) {

		case STYLE1:
			if (polygon == null)
				polygon = new Polygon();
			else polygon.reset();
			polygon.addPoint(xend + 2, yend);
			polygon.addPoint(xend - 16, yend - 8);
			polygon.addPoint(xend - 16, yend + 8);
			g.fillPolygon(polygon);
			break;

		case STYLE2:
			((Graphics2D) g).setStroke(stroke);
			g.drawLine(xend, yend, xend - 16, yend - 6);
			g.drawLine(xend, yend, xend - 16, yend + 6);
			break;

		case STYLE3:
			if (polygon == null)
				polygon = new Polygon();
			else polygon.reset();
			polygon.addPoint(xend + 2, yend);
			polygon.addPoint(xend - 16, yend - 8);
			polygon.addPoint(xend - 10, yend);
			polygon.addPoint(xend - 16, yend + 8);
			g.fillPolygon(polygon);
			break;

		case STYLE4:
			if (polygon == null)
				polygon = new Polygon();
			else polygon.reset();
			polygon.addPoint(xend + 2, yend);
			polygon.addPoint(xend - 4, yend - 6);
			polygon.addPoint(xend - 10, yend);
			polygon.addPoint(xend - 4, yend + 6);
			g.fillPolygon(polygon);
			break;

		case STYLE5:
			g.fillOval(xend - 10, yend - 6, 12, 12);
			break;

		}

	}