That is infinitely helpful, thanks! getShapeAt() does just what I need. The FadeDecorator information is pretty useful too. Thanks, Greg!
From: Greg Brown [mailto:[email protected]] Sent: Wednesday, February 24, 2010 9:13 AM To: [email protected] Subject: Re: Stack Panes and Z-Position That brings me to another problem to solve, though. It doesn't look like I can make a Button transparent, and what I'm attempting to do is draw a set of shapes and trigger an action when the shape is clicked. You can do this in a couple of ways. You can set the button's color, background color, and border color to a color with an alpha value, but the easier way would be to use an instance of org.apache.pivot.wtk.effects.FadeDecorator. getComponentAt(x,y) argument, but that returns components, and while I see how to get the components parent, I don't see how to get back down to the rectangle that the user actually clicked. Would it make more sense for me to create filled borders instead of drawing rectangles? That seems like it would work with rectangular objects, but not other shapes. My first thought was to use a ComponentMouseButtonListener and then use the pane's The org.apache.pivot.wtk.media.drawing.Group class has a getShapeAt() method you can use for this. The Canvas, Rectangle, and ImageView listeners don't look like they have any kind of mouse button listeners available. Shapes don't have mouse button listeners but ImageView does (it extends Component).
