From: Timothy W. <tw...@us...> - 2007-11-02 18:38:16
|
On Nov 2, 2007, at 11:50 AM, Andrew Walker wrote: > Timothy, > > See my responses below, > > On 11/2/07, Timothy Wall <tw...@us...> wrote: You may need a > custom ComponentLocation object for the component, one > that translates a semantic object location (such as "circle 0" or > "footer-text") into a current pixel location. These are used for > JTable, JTree, et al. to convert a cell location into a pixel > location. > > I would need some help to get this done > > Alternatively, make sure your canvas is in a known scaling state when > you ask for a given pixel on it. > > The Canvas is in a known scaling state, we do a "fit content to > window" before attempting the click/drag. > > Can you tell if the point abbot is trying to reach is valid for the > current canvas? > > The point if valid on the graph, it was acquired using the record > feature. Sounds like Component.getVisibleRect() is not providing an accurate result. Can you instantiate your graph in a standalone JUnit test (ComponentTestFixture is provided for this purpose)? If you can do so, it'll be easier to poke and prod at the component to see what's unexpected in its responses. If you scale to fit, then the component size should match its visible rect. You can always tweak the abbot source to provide the current visible rect reported by the component in the error message. Basically, Abbot does this: a) get the current visible rect b) get the desired point c) if point is not within the current visible rect, call scrollRectToVisible d) if point is still not within the current visible rect, throw an exception > > Does the canvas behave normally within a scroll pane (like any other > Swing component), or does it do some sort of on-the-fly scaling as > you scroll? > > This is the interesting part. I'm not entirely sure because I don't > have the source code to the component but I have a feeling that it > is doing something that's not quite normal. The scrollbars expand > as the component is scrolled and there is definitely some dynamic > resizing as the image on the component is zoomed in and out. > |