Re: [JAVA2D] How to check intersection of Shape contour and Rectangle2D?

2009-01-20 Thread java2d
Hi, There is an alternative to the mouse point rectangle. Create special sense shapes with a somewhat thicker stroke and test if that sense shape contains the mouse point. I don't know which solution is better. I changed your code to demonstrate. (I took the liberty to set a cross hair cursor

Re: [JAVA2D] How to check intersection of Shape contour and Rectangle2D?

2009-01-20 Thread java2d
Well, I was able to achive something that I need: [code] import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import javax.swing.*; @SuppressWarnings(serial) public class MouseOverShapes extends JComponent { private Shape line; private Shape arc; private boolean overLine;

Re: [JAVA2D] Is there a bug with clipping and affine transforms?

2009-01-20 Thread java2d
First, note what the API doc says about setClip(Shape clip): [b]Not all objects that implement the Shape interface can be used to set the clip. The only Shape objects that are guaranteed to be supported are Shape objects that are obtained via the getClip method and via Rectangle objects.[/b]

Re: [JAVA2D] Clipboard, print, and Save-to-jpeg problem

2009-01-20 Thread Phil Race
The code below gives no indication of what could cause intermittent problems. If its a problem in both copying to the clipboard and printing its seems likely to be a general bug in your code. I guess you are drawing to an image. Perhaps you have an inappropriate use of multiple threads and you

Re: [JAVA2D] Is there a bug with clipping and affine transforms?

2009-01-20 Thread Jim Graham
jav...@javadesktop.org wrote: First, note what the API doc says about setClip(Shape clip): [b]Not all objects that implement the Shape interface can be used to set the clip. The only Shape objects that are guaranteed to be supported are Shape objects that are obtained via the getClip method and

Re: [JAVA2D] How to check intersection of Shape contour and Rectangle2D?

2009-01-20 Thread Jim Graham
The BasicStroke.createStrokedShape() is the intended method to test for intersection with the stroked shape as you implemented in your later example. Note that the default graphics setting for the STROKE_CONTROL hint is STROKE_NORMALIZE which allows tweaking of lines for aesthetic purposes

Re: [JAVA2D] Is there a bug with clipping and affine transforms?

2009-01-20 Thread Jim Graham
Note that, in Java 2D, a shape cannot know its outline design because that depends on another graphics attribute - the Stroke object. The default implementation of that interface is a BasicStroke object with a line width of 1.0f, but that is just the default for the Graphics objects you get