pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger L. Whitcomb" <Roger.Whitc...@actian.com>
Subject RE: zooming into a custom component using mouse selection
Date Mon, 08 Apr 2013 19:15:58 GMT
Hi Cynthia,

                I'm thinking you would probably need to do most of the
work yourself in your custom component.  The ScaleDecorator can be
applied to a whole component (not just a portion of one, which is what
you are needing to do).  And, and you found out, there is no mouse
interaction for the selection process in the Decorator - it is only
essentially a visual filter on the drawing process.  The other
components that handle mouse selection all do it within their
corresponding Skin classes, so I imagine you would have to add mouse
listeners to your custom component and keep track of the mouse selection
in a similar manner, then adjust your drawing routines to scale just
that portion of the graph (I think that's what you're component draws).
So, once you have established a selected region (rectangle?!) you would
probably have to draw the whole component but with a negative clip
region of the selected area (i.e., draw everything BUT what's in that
region), then apply a scaling transform to the selected area and draw
just that portion.  Just thinking out loud.  You can look at the source
for TextArea (for instance) for clues on how to do selection using the
mouse.

                Alternatively, you could potentially extend
ScaleDecorator to do the scaling I just described, and make the code
somewhat modular.  That way, you would have a "RegionZoomDecorator"
which you would apply to your component, that would take a
rectangle/region and a zoom factor, and do the drawing / scaling as
above.  That way, once you have established a zoom region from your
mouse selection, you configure and apply this decorator to the component
and voila!

                Sounds pretty cool - I'd be interested to see what you
come up with ... J

 

HTH,

~Roger Whitcomb


Mime
View raw message