Hi
I want to have something like a speedometer. I draw it with Java2D
Graphics2D g2d = ( Graphics2D ) new Graphics;
GeneralPath filledPolygon = new GeneralPath();
filledPolygon.moveTo( x, yo1 );
filledPolygon.lineTo( x, yu1 );
filledPolygon.lineTo( x1, yu1 );
filledPolygon.lineTo( x1, yu2 );
filledPolygon.lineTo( x2, y );
filledPolygon.lineTo( x1, yo2 );
filledPolygon.lineTo( x1, yo1 );
filledPolygon.lineTo( x, yo1 );
AffineTransform af = new AffineTransform();
af.translate(676, 75);
af.rotate( Math.PI );
af.scale(0.5, 0.6);
filledPolygon.transform(af);
g2d.setPaint( Color.white );
g2d.fill( filledPolygon );
If I have now an event, then I want to change to position of “filledPolygon”. How can I do that?
I found out, that i can translate the Graphics2D-Object, but this does not affect on my already created “filledPolygon” !
Any ideas?
Thanks, Flavio