You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Clint Gilbert <cl...@hms.harvard.edu> on 2012/04/25 02:40:32 UTC

Clickable arbitrary shapes?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Pivot users,

Is it possible to have arbitrarily-shaped widgets that respond to
mouse events?

I have a project that attempts to implement a fairly complex board
game, and has a Pivot UI.  I've been using a StackPane to implement a
view of the game board, with an ImageView at the bottom, and player
markers, game pieces, etc as widgets stacked on top.

I'd love to present players with possible paths for their pieces to
move on the board with arrows.  Paths can pass through various board
locations, so they can look like zig-zags.

Is it possible to make a widget that draws a zig-zag shape with
Pivot's SVG support (or something else), and makes the shape respond
to mouse over and mouse click events?  Is there a better way to
achieve this?

I had done something similar in the past with now-deprecated Pivot
classes like 1.5's Rectangle, etc, but this was very rudimentary.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk+XSAAACgkQ0GFaTS4nYxuwHgCfXlxUmMhF/i7Wg2Ubxzzdt2Ck
UnMAn3LhYSnuC1FNru/3RD/HSHHQPAxP
=uBJn
-----END PGP SIGNATURE-----

Re: Clickable arbitrary shapes?

Posted by Sandro Martini <sa...@gmail.com>.
Hi Clint,
I found an old email on our dev list where I was proposing to Greg to
add a Component like the (Client Side ) "Image Map" in HTML:
Greg said to me to extend the ImageView component and play with the
mouse API ... but at that time there wasn't SVGSalamander integration.

I think should be possible to do something with SVGSalamander now, but
don't know, probably the best option is to ask to Mark Kitfox (the SVG
Salamander developer) how to implement it in native svgSalamander,
then see the remaining part for Pivot.

Note:
otherwise, if you prefer to stay on the (removed) Pivot Drawing API,
we could even think to move them in a dedicated subprojects under
Apache-Extras, onder one of ours projects ... and in this case could
you post here some code ?


Keep us updated.
Sandro