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 <[email protected]> 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

Reply via email to