aspose file tools*
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
Author

irregular polygons

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi
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.
Andrew
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:
<pre>
import java.awt.*;
public class ourPolygon extends java.applet.Applet {
public void init()
{
setBackground(Color.white);
}
public void paint(Graphics screen)
{
int[] xPoints = { 10, 10, 30, 100};
int[] yPoints = {90, 10, 250, 250};
int points = 4;
screen.setColor(Color.black);
screen.drawPolygon(xPoints,yPoints,points);
}
}
---------------------------------------
[&] substituted for open/close braces
[HTML]
[HEAD][TITLE]ourPolygon[/TITLE][/HEAD]
[BODY]
[CENTER]
[applet code = "ourPolygon.class" height = 300 width = 300]
[/applet code]
[/CENTER]
[/BODY]
[/HTML]
</pre>
Do you have the java documentation, free at sun.com? It tells about the Graphics and Graphics2D classes. You'll be overriding the paint() method. For all my searching I use dogpile.com. 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).]
 
Don't get me started about those stupid light bulbs.
 
subject: irregular polygons
 
Similar Threads
irregular polygons
irregular polygons
Favourite tv series
irregular polygons
I need data structure advice