KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > joshy > html > util > GraphicsUtil


1 package org.joshy.html.util;
2
3 import java.awt.Color JavaDoc;
4 import java.awt.Graphics JavaDoc;
5 import java.awt.Rectangle JavaDoc;
6 import org.joshy.html.box.Box;
7
8 public class GraphicsUtil {
9     public static void drawBox(Graphics JavaDoc g, Box box, Color JavaDoc color) {
10         Color JavaDoc oc = g.getColor();
11         g.setColor(color);
12         g.drawLine(-5,-5,5,5);
13         g.drawLine(-5,5,5,-5);
14         g.drawRect(box.x,box.y,box.width,box.height);
15         g.setColor(oc);
16     }
17     public static void draw(Graphics JavaDoc g, Rectangle JavaDoc box, Color JavaDoc color) {
18         Color JavaDoc oc = g.getColor();
19         g.setColor(color);
20         g.drawRect(box.x,box.y,box.width,box.height);
21         g.setColor(oc);
22     }
23 }
24
25
Popular Tags