File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes irregular polygons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "irregular polygons" Watch "irregular polygons" New topic

irregular polygons

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
As part of a project I am undertaking, I need to draw thiessen polygons from a series of (x,y co-ordinates) points using java, thiessen polygons are irregular polygons and a used as a tool for data visualisation.

All the irregular polygons are contained within a regular square and have a different colour i.e. intensity according to the value of the data the particular thiessen polygon represents.
The data is in a series of floating point numbers, of the form 0.00098456x106.
I would like to know if there is a class library available for this, or if there is anyway that I can solve the problem.
Any help would be greatly appreciated.
Steven YaegerII
Ranch Hand

Joined: May 31, 2000
Posts: 182
This might help a little, a small applet that draws a little and the HTML CODE to use with it:
import java.awt.*;
public class ourPolygon extends java.applet.Applet {
public void init()
public void paint(Graphics screen)
int[] xPoints = { 10, 10, 30, 100};
int[] yPoints = {90, 10, 250, 250};
int points = 4;
[&] substituted for open/close braces
[applet code = "ourPolygon.class" height = 300 width = 300]
[/applet code]
Do you have the java documentation, free at It tells about the Graphics and Graphics2D classes. You'll be overriding the paint() method. For all my searching I use I found most all my best links under the terms "Java tutorials", "Java", "+Java / +graphics tutorials", and alot of other words. Email me if you can't find anything, I'll sift through my bookmarks.
I hope this helps a little, Steve

[This message has been edited by Steven YaegerII (edited August 18, 2000).]
I agree. Here's the link:
subject: irregular polygons
It's not a secret anymore!