You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Robert Piotrowski <rp...@azonic.net> on 2010/03/24 20:17:38 UTC

textinput bounds

I'm trying to popup a menu related to a textinput that is on a form.  It was
working fine until I put in a scroll pane.  Once I scroll it, the popup
appears lower.

I there a way to subtract the scrolled distance from the textinput's Y bound
?


Thanks
Bob

Re: textinput bounds

Posted by Greg Brown <gk...@mac.com>.
It is the line that characters appear to sit on when rendering text.

On Mar 24, 2010, at 4:56 PM, Robert Piotrowski wrote:

> What's a "baseline"?  
> 
> 
> 
> On Wed, Mar 24, 2010 at 3:52 PM, Greg Brown <gk...@mac.com> wrote:
> > Should the ancestor be something else?  I used the top window on the display because that is the window that opens the popup.
> 
> I generally use the display, because window location (including your popup) is relative to the display.
> 
> 


Re: textinput bounds

Posted by Robert Piotrowski <rp...@azonic.net>.
What's a "baseline"?



On Wed, Mar 24, 2010 at 3:52 PM, Greg Brown <gk...@mac.com> wrote:

> > Should the ancestor be something else?  I used the top window on the
> display because that is the window that opens the popup.
>
> I generally use the display, because window location (including your popup)
> is relative to the display.
>
>

Re: Tutorial/Demo code for charting

Posted by Shahzad Bhatti <sb...@peak6.com>.
Thanks, that would work.


On 3/25/10 12:34 PM, "Greg Brown" <gk...@mac.com> wrote:

It doesn't have a tutorial, but you can see the source code here:

http://code.google.com/p/pivot-jfree/source/browse/#svn/trunk/demos/src/biz/ixnay/pivot/demos/charts/jfree


On Mar 25, 2010, at 3:31 PM, Shahzad Bhatti wrote:

> Thanks Greg, does that site include any examples as under download I saw just jar files. Ideally, I would like to define some pivot based model objects that I can use for displaying tables and rendering charts. Thanks.
>
>
> On 3/25/10 11:30 AM, "Greg Brown" <gk...@mac.com> wrote:
>
>> Are there any examples of charts with Pivot?
>
> Yes, but they live here:
>
> http://code.google.com/p/pivot-jfree/
>
> Pivot provides "pluggable" charting support - the Pivot/JFree project is a charting provider that is based on JFreeChart. However, JFreeChart is licensed under LGPL (which isn't compatible with the Apache license), so it isn't part of the platform itself.
>
> G
>
>
>
> ______________________________________________
>
> See  http://www.peak6.com/email_disclaimer.php
> for terms and conditions related to this email



Re: Tutorial/Demo code for charting

Posted by Greg Brown <gk...@mac.com>.
It doesn't have a tutorial, but you can see the source code here:

http://code.google.com/p/pivot-jfree/source/browse/#svn/trunk/demos/src/biz/ixnay/pivot/demos/charts/jfree


On Mar 25, 2010, at 3:31 PM, Shahzad Bhatti wrote:

> Thanks Greg, does that site include any examples as under download I saw just jar files. Ideally, I would like to define some pivot based model objects that I can use for displaying tables and rendering charts. Thanks.
> 
> 
> On 3/25/10 11:30 AM, "Greg Brown" <gk...@mac.com> wrote:
> 
>> Are there any examples of charts with Pivot?
> 
> Yes, but they live here:
> 
> http://code.google.com/p/pivot-jfree/
> 
> Pivot provides "pluggable" charting support - the Pivot/JFree project is a charting provider that is based on JFreeChart. However, JFreeChart is licensed under LGPL (which isn't compatible with the Apache license), so it isn't part of the platform itself.
> 
> G
> 
> 
> 
> ______________________________________________
> 
> See  http://www.peak6.com/email_disclaimer.php
> for terms and conditions related to this email


Re: Tutorial/Demo code for charting

Posted by Shahzad Bhatti <sb...@peak6.com>.
Thanks Greg, does that site include any examples as under download I saw just jar files. Ideally, I would like to define some pivot based model objects that I can use for displaying tables and rendering charts. Thanks.


On 3/25/10 11:30 AM, "Greg Brown" <gk...@mac.com> wrote:

> Are there any examples of charts with Pivot?

Yes, but they live here:

http://code.google.com/p/pivot-jfree/

Pivot provides "pluggable" charting support - the Pivot/JFree project is a charting provider that is based on JFreeChart. However, JFreeChart is licensed under LGPL (which isn't compatible with the Apache license), so it isn't part of the platform itself.

G



______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

Re: Tutorial/Demo code for charting

Posted by Greg Brown <gk...@mac.com>.
> Are there any examples of charts with Pivot? 

Yes, but they live here:

http://code.google.com/p/pivot-jfree/

Pivot provides "pluggable" charting support - the Pivot/JFree project is a charting provider that is based on JFreeChart. However, JFreeChart is licensed under LGPL (which isn't compatible with the Apache license), so it isn't part of the platform itself.
 
G


Tutorial/Demo code for charting

Posted by Shahzad Bhatti <sb...@peak6.com>.
I have been going through the tutorial and demo code and it has been very helpful, however I didn't see any examples of charting in the tutorial. Are there any examples of charts with Pivot? It would greatly help. Thanks.

______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

Re: textinput bounds

Posted by Todd Volkert <tv...@gmail.com>.
Sweet - glad you got it working.


>
> If I use JavaStart, do I have to sign the jars when using the @WTKX
> binding?
>

I'm not sure (worth testing), but if you do, another option would be just to
make the @WTKX fields public.

Re: textinput bounds

Posted by Robert Piotrowski <rp...@azonic.net>.
You beat me to the email

I just got it:

 int scrolldistance =
((ScrollPane)textInput.getParent().getParent()).getScrollTop();

                Bounds ti_bounds = textInput.getBounds();


                popup.open(textInput.getDisplay(), ti_bounds.x, ti_bounds.y+
ti_bounds.height + 45-scrolldistance);

"45" is my static "adjustment"

Perfect.

BTW, these textinputs are on a form that is generated by SOLR with XSLT.
 All I have to do is call the URL and add a Form.Section to my Form that's
declared ahead-of-time. I created a custom SOLR search component that
generates a list of indexed fields  and then an XSLT that wraps it in WTKX,
so anytime we change the schema of the index or another dynamic field is
added, the form adjusts automatically.  To me, that's the real power of
PIVOT.  Being able to build GUI components on the server and populated it
with data and simple adding it to a parent GUI container.  Sweet stuff.

If I use JavaStart, do I have to sign the jars when using the @WTKX binding?



Bob


On Thu, Mar 25, 2010 at 8:44 AM, Todd Volkert <tv...@gmail.com> wrote:

> The scrolled distance is a property of the ScrollPane (getScrollTop()), so
> you can get it, but I'm wondering if you can send some small sample code --
> mapPointToAncestor() should have worked, so if you send a sample, I'll take
> a look and see if there's an easier way...
>
> -T
>
> On Thu, Mar 25, 2010 at 9:38 AM, Robert Piotrowski <rpiotrowski@azonic.net
> > wrote:
>
>> I tried mapping to display and also tried parent, parent/parent,
>> parent/parent/parent etc.
>>
>> It's not linear so I can't "adjust" the x&y coordinates for the popup with
>> something like x+100 or x-150, etc.
>>
>> Getting the bounds of the textinput and subtracting the scrolled distance
>> would do the trick.  I just need to get that scrolled distance.  Is that
>> even possible, or is that handled by the skin and out of reach from the
>> TextInput object?
>>
>>
>>
>> Bob
>>
>>
>>
>> On Wed, Mar 24, 2010 at 3:52 PM, Greg Brown <gk...@mac.com> wrote:
>>
>>> > Should the ancestor be something else?  I used the top window on the
>>> display because that is the window that opens the popup.
>>>
>>> I generally use the display, because window location (including your
>>> popup) is relative to the display.
>>>
>>>
>>
>

Re: textinput bounds

Posted by Todd Volkert <tv...@gmail.com>.
The scrolled distance is a property of the ScrollPane (getScrollTop()), so
you can get it, but I'm wondering if you can send some small sample code --
mapPointToAncestor() should have worked, so if you send a sample, I'll take
a look and see if there's an easier way...

-T

On Thu, Mar 25, 2010 at 9:38 AM, Robert Piotrowski
<rp...@azonic.net>wrote:

> I tried mapping to display and also tried parent, parent/parent,
> parent/parent/parent etc.
>
> It's not linear so I can't "adjust" the x&y coordinates for the popup with
> something like x+100 or x-150, etc.
>
> Getting the bounds of the textinput and subtracting the scrolled distance
> would do the trick.  I just need to get that scrolled distance.  Is that
> even possible, or is that handled by the skin and out of reach from the
> TextInput object?
>
>
>
> Bob
>
>
>
> On Wed, Mar 24, 2010 at 3:52 PM, Greg Brown <gk...@mac.com> wrote:
>
>> > Should the ancestor be something else?  I used the top window on the
>> display because that is the window that opens the popup.
>>
>> I generally use the display, because window location (including your
>> popup) is relative to the display.
>>
>>
>

Re: textinput bounds

Posted by Robert Piotrowski <rp...@azonic.net>.
I'm going to look into the viewport and scrollbar objects.


Bob

On Thu, Mar 25, 2010 at 8:38 AM, Robert Piotrowski
<rp...@azonic.net>wrote:

> I tried mapping to display and also tried parent, parent/parent,
> parent/parent/parent etc.
>
> It's not linear so I can't "adjust" the x&y coordinates for the popup with
> something like x+100 or x-150, etc.
>
> Getting the bounds of the textinput and subtracting the scrolled distance
> would do the trick.  I just need to get that scrolled distance.  Is that
> even possible, or is that handled by the skin and out of reach from the
> TextInput object?
>
>
>
> Bob
>
>
>
> On Wed, Mar 24, 2010 at 3:52 PM, Greg Brown <gk...@mac.com> wrote:
>
>> > Should the ancestor be something else?  I used the top window on the
>> display because that is the window that opens the popup.
>>
>> I generally use the display, because window location (including your
>> popup) is relative to the display.
>>
>>
>

Re: textinput bounds

Posted by Robert Piotrowski <rp...@azonic.net>.
I tried mapping to display and also tried parent, parent/parent,
parent/parent/parent etc.

It's not linear so I can't "adjust" the x&y coordinates for the popup with
something like x+100 or x-150, etc.

Getting the bounds of the textinput and subtracting the scrolled distance
would do the trick.  I just need to get that scrolled distance.  Is that
even possible, or is that handled by the skin and out of reach from the
TextInput object?



Bob



On Wed, Mar 24, 2010 at 3:52 PM, Greg Brown <gk...@mac.com> wrote:

> > Should the ancestor be something else?  I used the top window on the
> display because that is the window that opens the popup.
>
> I generally use the display, because window location (including your popup)
> is relative to the display.
>
>

Re: textinput bounds

Posted by Greg Brown <gk...@mac.com>.
> Should the ancestor be something else?  I used the top window on the display because that is the window that opens the popup.

I generally use the display, because window location (including your popup) is relative to the display.


Re: textinput bounds

Posted by Robert Piotrowski <rp...@azonic.net>.
Greg,

I tried the mapPointToAncestor() with the top window as the ancestor.  It's
worse then getting the bounds of the textinput, adding the textintput
height, and then adjusting it a little more.

Should the ancestor be something else?  I used the top window on the display
because that is the window that opens the popup.


Bob

On Wed, Mar 24, 2010 at 2:56 PM, Greg Brown <gk...@mac.com> wrote:

> How are you currently determining the position of the popup? I'd suggest
> using Component#mapPointToAncestor() if you are not already doing so. You
> can use this method to convert a point in your text input's coordinate space
> to the display's coordinate space.
>
> Note that, when your popup is open, you may want to listen for scroll wheel
> events on the display and either close or reposition the popup - otherwise,
> it may not remain aligned with the text input.
>
>
> On Mar 24, 2010, at 3:17 PM, Robert Piotrowski wrote:
>
> > I'm trying to popup a menu related to a textinput that is on a form.  It
> was working fine until I put in a scroll pane.  Once I scroll it, the popup
> appears lower.
> >
> > I there a way to subtract the scrolled distance from the textinput's Y
> bound ?
> >
> >
> > Thanks
> > Bob
>
>

Re: textinput bounds

Posted by Greg Brown <gk...@mac.com>.
How are you currently determining the position of the popup? I'd suggest using Component#mapPointToAncestor() if you are not already doing so. You can use this method to convert a point in your text input's coordinate space to the display's coordinate space.

Note that, when your popup is open, you may want to listen for scroll wheel events on the display and either close or reposition the popup - otherwise, it may not remain aligned with the text input.


On Mar 24, 2010, at 3:17 PM, Robert Piotrowski wrote:

> I'm trying to popup a menu related to a textinput that is on a form.  It was working fine until I put in a scroll pane.  Once I scroll it, the popup appears lower.
> 
> I there a way to subtract the scrolled distance from the textinput's Y bound ?
> 
> 
> Thanks
> Bob