You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Bill van Melle <bi...@gmail.com> on 2011/02/25 06:54:53 UTC

Container that scales its content?

I could have sworn I once ran across a Pivot container that scaled its child
to whatever size you made the container, but I can't find it now.  Was I
hallucinating?

(Yes, I know Pivot by default scales things, in the sense that an ImageView
with fill=true will scale to its container, and things like TablePane with
width/height specified with * and GridPane make their children a size that
fills the space.  But it doesn't automatically scale fonts, or any of the
other constants that one sticks in component/style properties, like vertical
spacing, padding, fixed row/column widths, etc.  I tried using a
ScaleDecorator, which works as far as display is concerned, but totally
fails when it comes to hit detection on the underlying component.)

Re: Container that scales its content?

Posted by Bill van Melle <bi...@gmail.com>.
Okay, I created https://issues.apache.org/jira/browse/PIVOT-710

Re: Container that scales its content?

Posted by Sandro Martini <sa...@gmail.com>.
Hi Bill,
yes you could add a new feature request for the 2.1 release, in our
JIRA, as a logged user.

https://issues.apache.org/jira/browse/PIVOT

Bye,
Sandro

Re: Container that scales its content?

Posted by Bill van Melle <bi...@gmail.com>.
Shall I submit a feature request?  I haven't a clue how to write such a
control myself.

Re: Container that scales its content?

Posted by Greg Brown <gk...@verizon.net>.
Pivot does not currently support a ScalePane, though it should be possible to write one fairly easily.

On Feb 25, 2011, at 3:51 AM, Bill van Melle wrote:

> Yes, that's pretty much what I thought I had seen, but apparently only imagined.  Maybe I was just remembering WPF's ViewBox control (http://www.wpftutorial.net/ViewBox.html).
> 
> I'd settle for a way to explicitly apply a scale transform to a component.  That's what I thought ScaleDecorator was for.  But as I mentioned, it doesn't also scale mouse coordinates, so it's of pretty limited utility.


Re: Container that scales its content?

Posted by Bill van Melle <bi...@gmail.com>.
Yes, that's pretty much what I thought I had seen, but apparently only
imagined.  Maybe I was just remembering WPF's ViewBox control (
http://www.wpftutorial.net/ViewBox.html).

I'd settle for a way to explicitly apply a scale transform to a component.
 That's what I thought ScaleDecorator was for.  But as I mentioned, it
doesn't also scale mouse coordinates, so it's of pretty limited utility.

Re: Container that scales its content?

Posted by Chris Bartlett <cb...@gmail.com>.
I'm not aware of one, but could be mistaken.  Are you thinking of the
scaling built into Pivot itself?  (CTRL SHIFT + and CTRL SHIFT -)

What exactly do you need/want?
1. To create an arbitrary Component graph as normal, with whatever
properties & styles specified using absolute values.  (Created from BXML or
in straight java code)
2. Then if placed into a 'standard' container it would render as normal.
3. If placed in the 'scale to fit' container the root component and all
children would be scaled with mouse & keyboard behaviour unchanged

So if the 'scale to fit' container was 3 times wider than the preferred with
of the root component, and 2 times taller, its child would be stretched
accordingly and have a different aspect ratio?

Chris

On 25 February 2011 12:54, Bill van Melle <bi...@gmail.com> wrote:

> I could have sworn I once ran across a Pivot container that scaled its
> child to whatever size you made the container, but I can't find it now.  Was
> I hallucinating?
>
> (Yes, I know Pivot by default scales things, in the sense that an ImageView
> with fill=true will scale to its container, and things like TablePane with
> width/height specified with * and GridPane make their children a size that
> fills the space.  But it doesn't automatically scale fonts, or any of the
> other constants that one sticks in component/style properties, like vertical
> spacing, padding, fixed row/column widths, etc.  I tried using a
> ScaleDecorator, which works as far as display is concerned, but totally
> fails when it comes to hit detection on the underlying component.)
>