views:

101

answers:

4

Hi,

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

A: 

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
A: 

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
A: 

hi

i found the solution at Drawing Arrows thank you

sirvan
A: 

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

Vicente Reig