You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by pavan vadavalli <pa...@gmail.com> on 2011/12/10 22:33:44 UTC

Maximizing Frame overrides the Set Limits

Hi,
I have tried to set the Height and Width limits for  a Frame.
But when i click on the Maximize button , these limits are not 
considered and the Frame is expanded to the limits of Display.

Is there any other way to limit this?

Basically i was trying to restrict the length and width of the Frame to 
not to cross a specific components limits.

Thanks and Regards,
Pavan

Re: Maximizing Frame overrides the Set Limits

Posted by pavan vadavalli <pa...@gmail.com>.
Apologize if i wasnt clear enough

The below is what i was looking for and the API that you have pointed is also in relation this.

"you want to have the maximize button, but when pressed, it
would never expand beyond the preferred width/height that you
previously supplied?"

To be clear in what i was trying to achieve, I am trying to finish the 
MDI Implementation for Pivot.
main Display window using Split Pane split to Display Area and Task bar
I completed the "Task Bar" container for Minimized controls with scroll Bar.
and specific "Internal Frames" that could be added to the "Desktop" .

Now trying to implement the issues of
1. Internal Frames getting "locked" to the main Display  area not 
overwriting the Task Bar
2. Resizing of Internal Frames.
3. Resizing the Main Display would reset the Location , height , width 
of the Visible Internal Frames.

All the above functionality are locked with ability to control the 
resizing capacities of the Frame.

Thanks and Regards,
Pavan


On 11/12/2011 9:45 AM, Chris Bartlett wrote:
> On 11 December 2011 05:35, pavan vadavalli<pa...@gmail.com>  wrote:
>> Hi Chris,
>> Thanks for the response , the option of overwriting the setMaximized is
>> feasible since i have already extended Frame. I will let you know the
>> results.
>>
>> Attached is a simple demo of java Frame maximize respecting the Bounds set
>> in the form of Rectangle.
> Maybe I have misunderstood that you want to do?
>
> Do you just want to disable the maximize functionality of the Frame?
> If so you can hide the maximize button by setting the
> 'showMaximizeButton' style to false (or override the
> setMaximized(boolean) method as mentioned in my last email)
>
> Or maybe you want to have the maximize button, but when pressed, it
> would never expand beyond the preferred width/height that you
> previously supplied?
>
> Chris

Re: Maximizing Frame overrides the Set Limits

Posted by pavan vadavalli <pa...@gmail.com>.
Hi Pivot Developers,
Any thoughts on this design please.
Thanks and Regards,
Pavan

On Thursday, 15 December 2011 7:49:38 AM, pavan vadavalli wrote:
> my first search was for any getter or setter available and it wasnt 
> there,
> My quick fix was to change the access specifier of the variable to get 
> it running and test it.
>
> One more option i can think of is providing the ButtonPressListnerList 
> for access to an extended class as protected or a public getter.
>
> Any other alternative solution is most welcome, basically i need to 
> override the functionality of default Listners for these buttons.
>
> Thanks and Regards,
> Pavan
>
> On Thursday, 15 December 2011 4:47:03 AM, Sandro Martini wrote:
>> Hi Pavan,
>>
>>> Updates to Access specifier:
>>> If you can get the access specifier to be Protected for 2.0.1, it 
>>> would make it easy for me to upgrade to 2.0.1 quickly.
>> Good, but I have a question:
>>> I have taken the approach of upgrading the access specifier of 
>>> Minimize and Maximize buttons of TerraFrameSkin to Protected.
>> you have changed from
>> private FrameButton minimizeButton = null;
>> private FrameButton maximizeButton = null;
>> to
>> protected FrameButton minimizeButton = null;
>> protected FrameButton maximizeButton = null;
>> ??
>>
>> I was thinking you changed getter methods, because I don't think it's
>> a good thing change directly attribute properties in this way, even
>> because those attributes are specific implementations of the Terra
>> Skin. Searching inside wtk-terra I haven't found a trick like this, so
>> really I think we should change the solution ...
>>
>> An alternative could be instead of using FrameButton (implemented in
>> the Terra Skin), maybe use PushButton (generic, and from Wtk) instead
>> ... because
>> public static class FrameButton extends PushButton {
>> and add protected getter (and maybe even setter), but I have to see if
>> this is enough (and doesn't give problems in other parts) ...
>>
>> Chris (and other Pivot Developers), what do you think ?
>>
>> If we don't find a quick (and robust) solution in a few days we have
>> to delay it to 2.0.2 or 2.1 ... sorry.
>>
>>
>>> Learning Points for Pivot
>>> One painful area for me in learning Pivot was a good documentation 
>>> about the Life Cycle API for example when layout , paint methods 
>>> would be called.
>> I understand :-) ... in 2.0.1 we have do some improvement in JavaDocs
>> (thanks even to some our users), have you tried to update to the
>> latest trunk and see if is enough ? Or if it is't, any suggestion is
>> welcome :-) .
>>
>>> I am just getting hold of Pivot now, sure i will start compiling the 
>>> list as i move along .
>> Very good.
>>
>>> Will update about once i finish the MDI implementation .I have to 
>>> take complete this on my spare time . Once i am done i will submit 
>>> the code to Core group and would seek your suggestions improving the 
>>> same.
>> Ok, let's wait your suggestions, and we have time for 2.1, don't worry.
>>
>>
>> Bye,
>> Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by pavan vadavalli <pa...@gmail.com>.
Hi Pivot Developers,
Any thoughts on this design please.
Thanks and Regards,
Pavan

On Thursday, 15 December 2011 7:49:38 AM, pavan vadavalli wrote:
> my first search was for any getter or setter available and it wasnt 
> there,
> My quick fix was to change the access specifier of the variable to get 
> it running and test it.
>
> One more option i can think of is providing the ButtonPressListnerList 
> for access to an extended class as protected or a public getter.
>
> Any other alternative solution is most welcome, basically i need to 
> override the functionality of default Listners for these buttons.
>
> Thanks and Regards,
> Pavan
>
> On Thursday, 15 December 2011 4:47:03 AM, Sandro Martini wrote:
>> Hi Pavan,
>>
>>> Updates to Access specifier:
>>> If you can get the access specifier to be Protected for 2.0.1, it 
>>> would make it easy for me to upgrade to 2.0.1 quickly.
>> Good, but I have a question:
>>> I have taken the approach of upgrading the access specifier of 
>>> Minimize and Maximize buttons of TerraFrameSkin to Protected.
>> you have changed from
>> private FrameButton minimizeButton = null;
>> private FrameButton maximizeButton = null;
>> to
>> protected FrameButton minimizeButton = null;
>> protected FrameButton maximizeButton = null;
>> ??
>>
>> I was thinking you changed getter methods, because I don't think it's
>> a good thing change directly attribute properties in this way, even
>> because those attributes are specific implementations of the Terra
>> Skin. Searching inside wtk-terra I haven't found a trick like this, so
>> really I think we should change the solution ...
>>
>> An alternative could be instead of using FrameButton (implemented in
>> the Terra Skin), maybe use PushButton (generic, and from Wtk) instead
>> ... because
>> public static class FrameButton extends PushButton {
>> and add protected getter (and maybe even setter), but I have to see if
>> this is enough (and doesn't give problems in other parts) ...
>>
>> Chris (and other Pivot Developers), what do you think ?
>>
>> If we don't find a quick (and robust) solution in a few days we have
>> to delay it to 2.0.2 or 2.1 ... sorry.
>>
>>
>>> Learning Points for Pivot
>>> One painful area for me in learning Pivot was a good documentation 
>>> about the Life Cycle API for example when layout , paint methods 
>>> would be called.
>> I understand :-) ... in 2.0.1 we have do some improvement in JavaDocs
>> (thanks even to some our users), have you tried to update to the
>> latest trunk and see if is enough ? Or if it is't, any suggestion is
>> welcome :-) .
>>
>>> I am just getting hold of Pivot now, sure i will start compiling the 
>>> list as i move along .
>> Very good.
>>
>>> Will update about once i finish the MDI implementation .I have to 
>>> take complete this on my spare time . Once i am done i will submit 
>>> the code to Core group and would seek your suggestions improving the 
>>> same.
>> Ok, let's wait your suggestions, and we have time for 2.1, don't worry.
>>
>>
>> Bye,
>> Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by Sandro Martini <sa...@gmail.com>.
Hi all,

Pavan, I think that in any case all changes should go for the 2.1
release, where there are already some issues open, like the following:
https://issues.apache.org/jira/browse/PIVOT-463
at the moment I don't find the issue (if someone remember what is,
please link here :-) ) related to "improve Terra Skin to let users
extend it", this could be one of important things for 2.1.

Pavan, for now thanks for your suggestions, but even a small changes
like this has to be better seen, so we can remove current constraints
in many places.

If it's not a problem for you I suggest to update your local copy of
sources to 2.0.1 final (during these weeks I'm freezing the release,
it'squestion of days now, i hope :-) ) and extend/fork them.
When you'll have a full working solution (and if you want/can share
with us, even only a diff patch) we could try to see what changes you
require (could be in many places/components until you finish the work)
and look how to integrate them in Pivot 2.1 (where some little
breaking change could happen).

Bye,
Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by Chris Bartlett <cb...@gmail.com>.
Pavan,

Did you look into creating a custom skin for your custom Frames?

See these methods
org.apache.pivot.wtk.skin.terra.TerraFrameSkin.layout()
org.apache.pivot.wtk.skin.terra.TerraFrameSkin.paint(Graphics2D)
http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java

My gut feeling is that you should be able to alter the logic in layout
to size & locate your frames so that they do not overlap other areas
of your UI that need to remain visible.  So you would forget about
changing the behaviour of the maximize button, but instead change how
a maximized frame is displayed.

You will probably find that many if not all of the required fields
within TerraFrameSkin are private, but copying the skin and making
your own implementation should work.  If you can solve you problem via
an 'improved' skin, then I think adding getter methods or changing the
field access modifiers to protected should be acceptable.  Then you
*would* simply be able to extend TerraFrameSkin and override the
relevant methods such as layout() to redefine what 'maximized' means
for your custom Frame implementation.

Chris

On 15 December 2011 03:49, pavan vadavalli <pa...@gmail.com> wrote:
> my first search was for any getter or setter available and it wasnt there,
> My quick fix was to change the access specifier of the variable to get it
> running and test it.
>
> One more option i can think of  is  providing the ButtonPressListnerList for
> access to an extended class as protected or a public getter.
>
> Any other alternative solution is most welcome, basically i need to override
> the functionality of default Listners for these buttons.
>
> Thanks and Regards,
> Pavan
>
>
> On Thursday, 15 December 2011 4:47:03 AM, Sandro Martini wrote:
>>
>> Hi Pavan,
>>
>>> Updates to Access specifier:
>>> If you can get the access specifier to be Protected for 2.0.1, it would
>>> make it easy for me to upgrade to 2.0.1 quickly.
>>
>> Good, but I have a question:
>>>
>>> I have taken the approach of upgrading  the access specifier  of Minimize
>>> and Maximize buttons of TerraFrameSkin to Protected.
>>
>> you have changed from
>>     private FrameButton minimizeButton = null;
>>     private FrameButton maximizeButton = null;
>> to
>>     protected FrameButton minimizeButton = null;
>>     protected FrameButton maximizeButton = null;
>> ??
>>
>> I was thinking you changed getter methods, because I don't think it's
>> a good thing change directly attribute properties in this way, even
>> because those attributes are specific implementations of the Terra
>> Skin. Searching inside wtk-terra I haven't found a trick like this, so
>> really I think we should change the solution ...
>>
>> An alternative could be instead of using FrameButton (implemented in
>> the Terra Skin), maybe use PushButton (generic, and from Wtk) instead
>> ... because
>>     public static class FrameButton extends PushButton {
>> and add protected getter (and maybe even setter), but I have to see if
>> this is enough (and doesn't give problems in other parts) ...
>>
>> Chris (and other Pivot Developers), what do you think ?
>>
>> If we don't find a quick (and robust) solution in a few days we have
>> to delay it to 2.0.2 or 2.1 ... sorry.
>>
>>
>>> Learning Points for Pivot
>>> One painful area for me in learning Pivot was a good documentation about
>>> the Life Cycle API for example when layout , paint methods would be called.
>>
>> I understand :-) ... in 2.0.1 we have do some improvement in JavaDocs
>> (thanks even to some our users), have you tried to update to the
>> latest trunk and see if is enough ? Or if it is't, any suggestion is
>> welcome :-) .
>>
>>> I am just getting hold of Pivot now, sure i will start compiling the list
>>> as i move along .
>>
>> Very good.
>>
>>> Will update about once i finish the MDI implementation .I have to take
>>> complete this on my spare time . Once i am done i will submit the code to
>>> Core group and would seek your suggestions improving the same.
>>
>> Ok, let's wait your suggestions, and we have time for 2.1, don't worry.
>>
>>
>> Bye,
>> Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by pavan vadavalli <pa...@gmail.com>.
my first search was for any getter or setter available and it wasnt 
there,
My quick fix was to change the access specifier of the variable to get 
it running and test it.

One more option i can think of  is  providing the 
ButtonPressListnerList for access to an extended class as protected or 
a public getter.

Any other alternative solution is most welcome, basically i need to 
override the functionality of default Listners for these buttons.

Thanks and Regards,
Pavan

On Thursday, 15 December 2011 4:47:03 AM, Sandro Martini wrote:
> Hi Pavan,
>
>> Updates to Access specifier:
>> If you can get the access specifier to be Protected for 2.0.1, it would make it easy for me to upgrade to 2.0.1 quickly.
> Good, but I have a question:
>> I have taken the approach of upgrading  the access specifier  of Minimize and Maximize buttons of TerraFrameSkin to Protected.
> you have changed from
>      private FrameButton minimizeButton = null;
>      private FrameButton maximizeButton = null;
> to
>      protected FrameButton minimizeButton = null;
>      protected FrameButton maximizeButton = null;
> ??
>
> I was thinking you changed getter methods, because I don't think it's
> a good thing change directly attribute properties in this way, even
> because those attributes are specific implementations of the Terra
> Skin. Searching inside wtk-terra I haven't found a trick like this, so
> really I think we should change the solution ...
>
> An alternative could be instead of using FrameButton (implemented in
> the Terra Skin), maybe use PushButton (generic, and from Wtk) instead
> ... because
>      public static class FrameButton extends PushButton {
> and add protected getter (and maybe even setter), but I have to see if
> this is enough (and doesn't give problems in other parts) ...
>
> Chris (and other Pivot Developers), what do you think ?
>
> If we don't find a quick (and robust) solution in a few days we have
> to delay it to 2.0.2 or 2.1 ... sorry.
>
>
>> Learning Points for Pivot
>> One painful area for me in learning Pivot was a good documentation about the Life Cycle API for example when layout , paint methods would be called.
> I understand :-) ... in 2.0.1 we have do some improvement in JavaDocs
> (thanks even to some our users), have you tried to update to the
> latest trunk and see if is enough ? Or if it is't, any suggestion is
> welcome :-) .
>
>> I am just getting hold of Pivot now, sure i will start compiling the list as i move along .
> Very good.
>
>> Will update about once i finish the MDI implementation .I have to take complete this on my spare time . Once i am done i will submit the code to Core group and would seek your suggestions improving the same.
> Ok, let's wait your suggestions, and we have time for 2.1, don't worry.
>
>
> Bye,
> Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by pavan vadavalli <pa...@gmail.com>.
my first search was for any getter or setter available and it wasnt 
there,
My quick fix was to change the access specifier of the variable to get 
it running and test it.

One more option i can think of  is  providing the 
ButtonPressListnerList for access to an extended class as protected or 
a public getter.

Any other alternative solution is most welcome, basically i need to 
override the functionality of default Listners for these buttons.

Thanks and Regards,
Pavan

On Thursday, 15 December 2011 4:47:03 AM, Sandro Martini wrote:
> Hi Pavan,
>
>> Updates to Access specifier:
>> If you can get the access specifier to be Protected for 2.0.1, it would make it easy for me to upgrade to 2.0.1 quickly.
> Good, but I have a question:
>> I have taken the approach of upgrading  the access specifier  of Minimize and Maximize buttons of TerraFrameSkin to Protected.
> you have changed from
>      private FrameButton minimizeButton = null;
>      private FrameButton maximizeButton = null;
> to
>      protected FrameButton minimizeButton = null;
>      protected FrameButton maximizeButton = null;
> ??
>
> I was thinking you changed getter methods, because I don't think it's
> a good thing change directly attribute properties in this way, even
> because those attributes are specific implementations of the Terra
> Skin. Searching inside wtk-terra I haven't found a trick like this, so
> really I think we should change the solution ...
>
> An alternative could be instead of using FrameButton (implemented in
> the Terra Skin), maybe use PushButton (generic, and from Wtk) instead
> ... because
>      public static class FrameButton extends PushButton {
> and add protected getter (and maybe even setter), but I have to see if
> this is enough (and doesn't give problems in other parts) ...
>
> Chris (and other Pivot Developers), what do you think ?
>
> If we don't find a quick (and robust) solution in a few days we have
> to delay it to 2.0.2 or 2.1 ... sorry.
>
>
>> Learning Points for Pivot
>> One painful area for me in learning Pivot was a good documentation about the Life Cycle API for example when layout , paint methods would be called.
> I understand :-) ... in 2.0.1 we have do some improvement in JavaDocs
> (thanks even to some our users), have you tried to update to the
> latest trunk and see if is enough ? Or if it is't, any suggestion is
> welcome :-) .
>
>> I am just getting hold of Pivot now, sure i will start compiling the list as i move along .
> Very good.
>
>> Will update about once i finish the MDI implementation .I have to take complete this on my spare time . Once i am done i will submit the code to Core group and would seek your suggestions improving the same.
> Ok, let's wait your suggestions, and we have time for 2.1, don't worry.
>
>
> Bye,
> Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by Sandro Martini <sa...@gmail.com>.
Hi Pavan,

>Updates to Access specifier:
>If you can get the access specifier to be Protected for 2.0.1, it would make it easy for me to upgrade to 2.0.1 quickly.
Good, but I have a question:
> I have taken the approach of upgrading  the access specifier  of Minimize and Maximize buttons of TerraFrameSkin to Protected.
you have changed from
    private FrameButton minimizeButton = null;
    private FrameButton maximizeButton = null;
to
    protected FrameButton minimizeButton = null;
    protected FrameButton maximizeButton = null;
??

I was thinking you changed getter methods, because I don't think it's
a good thing change directly attribute properties in this way, even
because those attributes are specific implementations of the Terra
Skin. Searching inside wtk-terra I haven't found a trick like this, so
really I think we should change the solution ...

An alternative could be instead of using FrameButton (implemented in
the Terra Skin), maybe use PushButton (generic, and from Wtk) instead
... because
    public static class FrameButton extends PushButton {
and add protected getter (and maybe even setter), but I have to see if
this is enough (and doesn't give problems in other parts) ...

Chris (and other Pivot Developers), what do you think ?

If we don't find a quick (and robust) solution in a few days we have
to delay it to 2.0.2 or 2.1 ... sorry.


>Learning Points for Pivot
>One painful area for me in learning Pivot was a good documentation about the Life Cycle API for example when layout , paint methods would be called.
I understand :-) ... in 2.0.1 we have do some improvement in JavaDocs
(thanks even to some our users), have you tried to update to the
latest trunk and see if is enough ? Or if it is't, any suggestion is
welcome :-) .

>I am just getting hold of Pivot now, sure i will start compiling the list as i move along .
Very good.

>Will update about once i finish the MDI implementation .I have to take complete this on my spare time . Once i am done i will submit the code to Core group and would seek your suggestions improving the same.
Ok, let's wait your suggestions, and we have time for 2.1, don't worry.


Bye,
Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by Sandro Martini <sa...@gmail.com>.
Hi Pavan,

>Updates to Access specifier:
>If you can get the access specifier to be Protected for 2.0.1, it would make it easy for me to upgrade to 2.0.1 quickly.
Good, but I have a question:
> I have taken the approach of upgrading  the access specifier  of Minimize and Maximize buttons of TerraFrameSkin to Protected.
you have changed from
    private FrameButton minimizeButton = null;
    private FrameButton maximizeButton = null;
to
    protected FrameButton minimizeButton = null;
    protected FrameButton maximizeButton = null;
??

I was thinking you changed getter methods, because I don't think it's
a good thing change directly attribute properties in this way, even
because those attributes are specific implementations of the Terra
Skin. Searching inside wtk-terra I haven't found a trick like this, so
really I think we should change the solution ...

An alternative could be instead of using FrameButton (implemented in
the Terra Skin), maybe use PushButton (generic, and from Wtk) instead
... because
    public static class FrameButton extends PushButton {
and add protected getter (and maybe even setter), but I have to see if
this is enough (and doesn't give problems in other parts) ...

Chris (and other Pivot Developers), what do you think ?

If we don't find a quick (and robust) solution in a few days we have
to delay it to 2.0.2 or 2.1 ... sorry.


>Learning Points for Pivot
>One painful area for me in learning Pivot was a good documentation about the Life Cycle API for example when layout , paint methods would be called.
I understand :-) ... in 2.0.1 we have do some improvement in JavaDocs
(thanks even to some our users), have you tried to update to the
latest trunk and see if is enough ? Or if it is't, any suggestion is
welcome :-) .

>I am just getting hold of Pivot now, sure i will start compiling the list as i move along .
Very good.

>Will update about once i finish the MDI implementation .I have to take complete this on my spare time . Once i am done i will submit the code to Core group and would seek your suggestions improving the same.
Ok, let's wait your suggestions, and we have time for 2.1, don't worry.


Bye,
Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by Pavan Vadavalli <pa...@gmail.com>.
Thanks Sandro,

Regd MDI :

Will update about once i finish the MDI implementation .I have to take
complete this on my spare time . Once i am done i will submit the code to
Core group and would seek your suggestions improving the same.

Updates to Access specifier:
If you can get the access specifier to be Protected for 2.0.1, it would
make it easy for me to upgrade to 2.0.1 quickly.

Learning Points for Pivot
One painful area for me in learning Pivot was a good documentation about
the Life Cycle API for example when layout , paint methods would be called.

I am just getting hold of Pivot now, sure i will start compiling the list
as i move along .

Thanks and Regards,
Pavan

On Tue, Dec 13, 2011 at 12:06 AM, Sandro Martini
<sa...@gmail.com>wrote:

> Hi Pavan,
>
> > Attached is the snapshot of nascent MDI implementation using Pivot.
> Looks very good :-) ... congratulations.
>
> > Still to add boundaries  and limit checks code and then beautification.
> Let us see your progress ...
>
> > I have taken the approach of upgrading  the access specifier  of
> Minimize and Maximize buttons of TerraFrameSkin to Protected.
> >
> > Thus got access to remove existing listeners and add my Listeners  to
> the Buttons in the extended Skin.
> >
> > would this be an acceptable change for Pivot Core or can you please any
> other approach here?
> For me this small api change (but with little impact, and safe) could
> be done, even for the upcoming 2.0.1, unless there are objections from
> others ... but please anwser in one/max two days.
>
> Tell me.
>
>
> To track this little change I could add a new issue (related to this,
> for 2.1, https://issues.apache.org/jira/browse/PIVOT-463 ) and resolve
> in 2.1
>
>
>
> Pavan, if you have some suggestion of api change/improvement fro a
> mid/long-term implementation, please share your comments (and use
> cases) with us ... or maybe add a ticket for 2.1 ( or add some info in
> the issue just seen ) so we can keep all info (and maybe even code) in
> the same place.
>
>
> Bye,
> Sandro
>



-- 
Thanks and Regards,
Pavan

Re: Maximizing Frame overrides the Set Limits

Posted by Sandro Martini <sa...@gmail.com>.
Hi Pavan,

> Attached is the snapshot of nascent MDI implementation using Pivot.
Looks very good :-) ... congratulations.

> Still to add boundaries  and limit checks code and then beautification.
Let us see your progress ...

> I have taken the approach of upgrading  the access specifier  of Minimize and Maximize buttons of TerraFrameSkin to Protected.
>
> Thus got access to remove existing listeners and add my Listeners  to the Buttons in the extended Skin.
>
> would this be an acceptable change for Pivot Core or can you please any other approach here?
For me this small api change (but with little impact, and safe) could
be done, even for the upcoming 2.0.1, unless there are objections from
others ... but please anwser in one/max two days.

Tell me.


To track this little change I could add a new issue (related to this,
for 2.1, https://issues.apache.org/jira/browse/PIVOT-463 ) and resolve
in 2.1



Pavan, if you have some suggestion of api change/improvement fro a
mid/long-term implementation, please share your comments (and use
cases) with us ... or maybe add a ticket for 2.1 ( or add some info in
the issue just seen ) so we can keep all info (and maybe even code) in
the same place.


Bye,
Sandro

Re: Maximizing Frame overrides the Set Limits

Posted by pavan vadavalli <pa...@gmail.com>.
Attached is the snapshot of nascent MDI implementation using Pivot.

Still to add boundaries  and limit checks code and then beautification.

I have taken the approach of upgrading  the access specifier  of 
Minimize and Maximize buttons of TerraFrameSkin to Protected.

Thus got access to remove existing listeners and add my Listeners  to 
the Buttons in the extended Skin.

would this be an acceptable change for Pivot Core or can you please any 
other approach here?

Thanks and Regards,
Pavan


On 11/12/2011 9:50 AM, Chris Bartlett wrote:
> Here is an old thread that has a demo app with a custom component
> (ImageView)&  skin which might be of use if you do write a custom
> skin.
>
> http://apache-pivot-users.399431.n3.nabble.com/KeyListeners-on-ImageView-tp2600622p2602733.html
> (See the zip file at the end of the post)

Re: Maximizing Frame overrides the Set Limits

Posted by Chris Bartlett <cb...@gmail.com>.
Here is an old thread that has a demo app with a custom component
(ImageView) & skin which might be of use if you do write a custom
skin.

http://apache-pivot-users.399431.n3.nabble.com/KeyListeners-on-ImageView-tp2600622p2602733.html
(See the zip file at the end of the post)

Re: Maximizing Frame overrides the Set Limits

Posted by Chris Bartlett <cb...@gmail.com>.
On 11 December 2011 05:35, pavan vadavalli <pa...@gmail.com> wrote:
> Hi Chris,
> Thanks for the response , the option of overwriting the setMaximized is
> feasible since i have already extended Frame. I will let you know the
> results.
>
> Attached is a simple demo of java Frame maximize respecting the Bounds set
> in the form of Rectangle.

Maybe I have misunderstood that you want to do?

Do you just want to disable the maximize functionality of the Frame?
If so you can hide the maximize button by setting the
'showMaximizeButton' style to false (or override the
setMaximized(boolean) method as mentioned in my last email)

Or maybe you want to have the maximize button, but when pressed, it
would never expand beyond the preferred width/height that you
previously supplied?

Chris

Re: Maximizing Frame overrides the Set Limits

Posted by Sandro Martini <sa...@gmail.com>.
Hi all,
we could look at this as an improvement for 2.1 if a small api
change/addition has to be done.

A related jira issue would be welcome (if possible adding the same attach
granted as usable in asf derived work).

Bye
 Il giorno 10/dic/2011 23:36, "pavan vadavalli" <pa...@gmail.com>
ha scritto:

> Hi Chris,
> Thanks for the response , the option of overwriting the setMaximized is
> feasible since i have already extended Frame. I will let you know the
> results.
>
> Attached is a simple demo of java Frame maximize respecting the Bounds set
> in the form of Rectangle.
>
> Thanks and Regards,
> Pavan
> On Sunday, 11 December 2011 9:20:49 AM, Chris Bartlett wrote:
>
>>
>> On 11 December 2011 05:02, pavan vadavalli<pa...@gmail.com>>
>> wrote:
>>
>>>
>>> I have looked at the TerraframeSkin, there is no specific plug points
>>> where
>>> i can plugin the code for Maximize button functionality at the
>>> Customization
>>> skin without touching the Pivot code.
>>>
>>
>>
>> Creating a custom skin (and component) that extends an existing Pivot
>> one does not have to be difficult, but unfortunately it is not
>> something that has been documented as far as I am aware. I know I
>> have posted example apps to the mailing lists in the past that use
>> custom skins, so I will try to find one and point you to it as a
>> reference.
>>
>> After a very quick scan of the TerraFrameSkin source, it looks like
>> the ButtonPressListener on line 314 is what you would need to modify
>> to alter the current behaviour.
>>
>> However, you might be able to listen for the maximized event of the
>> Frame and insert some custom code in the listener, but I don't have
>> time to look into it to confirm.
>> http://pivot.apache.org/2.0/**docs/api/org/apache/pivot/wtk/**
>> WindowListener.html#**maximizedChanged(org.apache.**pivot.wtk.Window)<http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/WindowListener.html#maximizedChanged(org.apache.pivot.wtk.Window)>
>>
>> What about extending Frame and overriding setMaximized() there?
>> http://pivot.apache.org/2.0/**docs/api/org/apache/pivot/wtk/**
>> Window.html#setMaximized(**boolean)<http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/Window.html#setMaximized(boolean)>
>>
>>
>>
>>> By the way , Dont you think this a bug from API perspective that Max
>>> limits
>>> are not considered?
>>>
>>
>>
>> I don't think so myself, but that is just my opinion. I understand
>> your point of view though and would be interested to know what other
>> OSs and UI toolkits do in this scenario.
>>
>>
>>
>>
>>
>>>
>>> Thanks and Regards
>>> Pavan
>>>
>>>
>>> On Sunday, 11 December 2011 8:51:09 AM, Chris Bartlett wrote:
>>>
>>>>
>>>>
>>>> On 11 December 2011 04:33, pavan vadavalli<pa...@gmail.com>
>>>> >
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> Hi,
>>>>> I have tried to set the Height and Width limits for a Frame.
>>>>> But when i click on the Maximize button , these limits are not
>>>>> considered
>>>>> and the Frame is expanded to the limits of Display.
>>>>>
>>>>> Is there any other way to limit this?
>>>>>
>>>>> Basically i was trying to restrict the length and width of the Frame to
>>>>> not
>>>>> to cross a specific components limits.
>>>>>
>>>>> Thanks and Regards,
>>>>> Pavan
>>>>>
>>>>
>>>>
>>>>
>>>> As you noted, Pivot's built in maximized Window functionality won't help
>>>> you.
>>>>
>>>> You should be able to override the behaviour of the maximize/minimize
>>>> button and run some custom code to resize/relocate the Frame according
>>>> to your specific requirements.
>>>>
>>>> The source for the default Frame skin is here
>>>>
>>>> http://svn.apache.org/repos/**asf/pivot/trunk/wtk-terra/src/**
>>>> org/apache/pivot/wtk/skin/**terra/TerraFrameSkin.java<http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java>
>>>>
>>>> Chris
>>>>
>>>

Re: Maximizing Frame overrides the Set Limits

Posted by pavan vadavalli <pa...@gmail.com>.
Hi Chris,
Thanks for the response , the option of overwriting the setMaximized is 
feasible since i have already extended Frame. I will let you know the 
results.

Attached is a simple demo of java Frame maximize respecting the Bounds 
set in the form of Rectangle.

Thanks and Regards,
Pavan
On Sunday, 11 December 2011 9:20:49 AM, Chris Bartlett wrote:
>
> On 11 December 2011 05:02, pavan vadavalli<pa...@gmail.com> 
> wrote:
>>
>> I have looked at the TerraframeSkin, there is no specific plug points 
>> where
>> i can plugin the code for Maximize button functionality at the 
>> Customization
>> skin without touching the Pivot code.
>
>
> Creating a custom skin (and component) that extends an existing Pivot
> one does not have to be difficult, but unfortunately it is not
> something that has been documented as far as I am aware. I know I
> have posted example apps to the mailing lists in the past that use
> custom skins, so I will try to find one and point you to it as a
> reference.
>
> After a very quick scan of the TerraFrameSkin source, it looks like
> the ButtonPressListener on line 314 is what you would need to modify
> to alter the current behaviour.
>
> However, you might be able to listen for the maximized event of the
> Frame and insert some custom code in the listener, but I don't have
> time to look into it to confirm.
> http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/WindowListener.html#maximizedChanged(org.apache.pivot.wtk.Window)
>
> What about extending Frame and overriding setMaximized() there?
> http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/Window.html#setMaximized(boolean)
>
>
>>
>> By the way , Dont you think this a bug from API perspective that Max 
>> limits
>> are not considered?
>
>
> I don't think so myself, but that is just my opinion. I understand
> your point of view though and would be interested to know what other
> OSs and UI toolkits do in this scenario.
>
>
>
>
>>
>>
>> Thanks and Regards
>> Pavan
>>
>>
>> On Sunday, 11 December 2011 8:51:09 AM, Chris Bartlett wrote:
>>>
>>>
>>> On 11 December 2011 04:33, pavan vadavalli<pa...@gmail.com>
>>> wrote:
>>>>
>>>>
>>>> Hi,
>>>> I have tried to set the Height and Width limits for a Frame.
>>>> But when i click on the Maximize button , these limits are not 
>>>> considered
>>>> and the Frame is expanded to the limits of Display.
>>>>
>>>> Is there any other way to limit this?
>>>>
>>>> Basically i was trying to restrict the length and width of the Frame to
>>>> not
>>>> to cross a specific components limits.
>>>>
>>>> Thanks and Regards,
>>>> Pavan
>>>
>>>
>>>
>>> As you noted, Pivot's built in maximized Window functionality won't help
>>> you.
>>>
>>> You should be able to override the behaviour of the maximize/minimize
>>> button and run some custom code to resize/relocate the Frame according
>>> to your specific requirements.
>>>
>>> The source for the default Frame skin is here
>>>
>>> http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
>>>
>>> Chris

Re: Maximizing Frame overrides the Set Limits

Posted by Chris Bartlett <cb...@gmail.com>.
On 11 December 2011 05:02, pavan vadavalli <pa...@gmail.com> wrote:
> I have looked at the TerraframeSkin, there is no specific plug points where
> i can plugin the code for Maximize button functionality at the Customization
> skin without touching the Pivot code.

Creating a custom skin (and component) that extends an existing Pivot
one does not have to be difficult, but unfortunately it is not
something that has been documented as far as I am aware.  I know I
have posted example apps to the mailing lists in the past that use
custom skins, so I will try to find one and point you to it as a
reference.

After a very quick scan of the TerraFrameSkin source, it looks like
the ButtonPressListener on line 314 is what you would need to modify
to alter the current behaviour.

However, you might be able to listen for the maximized event of the
Frame and insert some custom code in the listener, but I don't have
time to look into it to confirm.
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/WindowListener.html#maximizedChanged(org.apache.pivot.wtk.Window)

What about extending Frame and overriding setMaximized() there?
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/Window.html#setMaximized(boolean)


> By the way , Dont you think this a bug from API perspective that Max limits
> are not considered?

I don't think so myself, but that is just my opinion.  I understand
your point of view though and would be interested to know what other
OSs and UI toolkits do in this scenario.




>
> Thanks and Regards
> Pavan
>
>
> On Sunday, 11 December 2011 8:51:09 AM, Chris Bartlett wrote:
>>
>> On 11 December 2011 04:33, pavan vadavalli<pa...@gmail.com>
>>  wrote:
>>>
>>> Hi,
>>> I have tried to set the Height and Width limits for  a Frame.
>>> But when i click on the Maximize button , these limits are not considered
>>> and the Frame is expanded to the limits of Display.
>>>
>>> Is there any other way to limit this?
>>>
>>> Basically i was trying to restrict the length and width of the Frame to
>>> not
>>> to cross a specific components limits.
>>>
>>> Thanks and Regards,
>>> Pavan
>>
>>
>> As you noted, Pivot's built in maximized Window functionality won't help
>> you.
>>
>> You should be able to override the behaviour of the maximize/minimize
>> button and run some custom code to resize/relocate the Frame according
>> to your specific requirements.
>>
>> The source for the default Frame skin is here
>>
>> http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
>>
>> Chris

Re: Maximizing Frame overrides the Set Limits

Posted by pavan vadavalli <pa...@gmail.com>.
I have looked at the TerraframeSkin, there is no specific plug points 
where i can plugin the code for Maximize button functionality at the 
Customization skin without touching the Pivot code.

By the way , Dont you think this a bug from API perspective that Max 
limits are not considered?

Thanks and Regards
Pavan

On Sunday, 11 December 2011 8:51:09 AM, Chris Bartlett wrote:
> On 11 December 2011 04:33, pavan vadavalli<pa...@gmail.com>  wrote:
>> Hi,
>> I have tried to set the Height and Width limits for  a Frame.
>> But when i click on the Maximize button , these limits are not considered
>> and the Frame is expanded to the limits of Display.
>>
>> Is there any other way to limit this?
>>
>> Basically i was trying to restrict the length and width of the Frame to not
>> to cross a specific components limits.
>>
>> Thanks and Regards,
>> Pavan
>
> As you noted, Pivot's built in maximized Window functionality won't help you.
>
> You should be able to override the behaviour of the maximize/minimize
> button and run some custom code to resize/relocate the Frame according
> to your specific requirements.
>
> The source for the default Frame skin is here
> http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
>
> Chris

Re: Maximizing Frame overrides the Set Limits

Posted by Chris Bartlett <cb...@gmail.com>.
On 11 December 2011 04:33, pavan vadavalli <pa...@gmail.com> wrote:
> Hi,
> I have tried to set the Height and Width limits for  a Frame.
> But when i click on the Maximize button , these limits are not considered
> and the Frame is expanded to the limits of Display.
>
> Is there any other way to limit this?
>
> Basically i was trying to restrict the length and width of the Frame to not
> to cross a specific components limits.
>
> Thanks and Regards,
> Pavan

As you noted, Pivot's built in maximized Window functionality won't help you.

You should be able to override the behaviour of the maximize/minimize
button and run some custom code to resize/relocate the Frame according
to your specific requirements.

The source for the default Frame skin is here
http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java

Chris