I have to draw 1-pixel wide polylines(~5000 pts visible at one time) with a
variety of different dash patterns to help distinguish them. My problem is
the incredibly poor performance of using BasicStroke to get the dashed lines
drawn. I'm using the following constructor to build one of the line styles:

   final int CAP  = BasicStroke.CAP_BUTT;
   final int JOIN = BasicStroke.JOIN_MITER;
   final float[] pattern = {20.0f, 20.0f};
   BasicStroke bs =
     new BasicStroke(1.0f, CAP, JOIN, 10.0f, pattern, 0.0f);

 
When my drawing application is zoomed in so there are only a few hundred
data points in the polyline arrays(I use g.drawPolyline(xpts, ypts, npts))
then the performance is OK. But when I'm zoomed all the way out so there are
several thousand data points in the polyline, then scrolling of my graphical
drawing surface is pretty much unusable.

Are there any tricks I can try? I've tried using a TexturePaint with a solid
stroke but this is only marginally better, and the quality of the pseudo
dash patterns is awful when compared to what you can get with BasicStroke.

Short of trying to tell all my users to run on a dual processor 1.5GHz PC,
what can I do?

Thanks,

John  (using 1.3)
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to