0

I have a set of points which define a route and I must draw them so a vehicle's moving direction is denoted. The points may be from a curve and I need to draw some arrows. I want to draw arrows on the route to define which arrow vehicle goes. I have a mapviewr java applet and the last I must do is this work, I want to define arrows on every 10 points on the route.
A thing like this: alt text http://img517.yfrog.com/img517/7690/schermafbeelding2010032.png

Dennis Williamson
  • 346,391
  • 90
  • 374
  • 439
sirvan
  • 321
  • 1
  • 8
  • 21

3 Answers3

0

I would suggest you to take a look at Java2D shapes :they allow you to define any kind of ... well ... shape and draw them on a given path. You can take a look at this tutorial or at Sun tutorial.

Riduidel
  • 22,052
  • 14
  • 85
  • 185
0

In addition to what Riduidel said you should also try to get the angle that results from the intersection of the line with OX. Using that angle you could calculate a transformation matrix to draw the arraws neatly aligned to the line.

Sanctus2099
  • 1,669
  • 5
  • 22
  • 40
0

Pete Kirkham posted a full working example a few months ago in How to draw a directed arrow in Java?

Community
  • 1
  • 1
Vicente Reig
  • 877
  • 9
  • 14