[ 
https://issues.apache.org/jira/browse/PIVOT-783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13076011#comment-13076011
 ] 

Chris Bartlett commented on PIVOT-783:
--------------------------------------

I'm not trying to be obstructive in any way - just explaining how I understand 
the way Decorators were supposed to work.  If the result of an API call is not 
as expected by the user base, regardless of the intent, then it could qualify 
as a improvement in my eyes, and maybe should qualify as an fix :)

Maybe we need an explicit 'documentation' JIRA category if there is not one 
already?  (not necessarily for this ticket, but in general)  In the spirit of 
that, I'm sure that any patches, even if they are 'merely' documentation, would 
be welcomed.

And as you rightly say, if invalidate() is called by the parent, it wouldn't 
lead to a paint() loop.  Invalidate() might be a fairly heavyweight task though 
(forgive me for my premature optimisation), so if there were to be a call to 
force a 'refresh' of a decorator, it would probably just be a direct 
repaint(...) call on the target component. Layout & painting are really not my 
area of expertise though...

> Calling setScale on scaleDecorator doesn't update the display
> -------------------------------------------------------------
>
>                 Key: PIVOT-783
>                 URL: https://issues.apache.org/jira/browse/PIVOT-783
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 2.0
>            Reporter: Bill van Melle
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> When you call setScale on a scaleDecorator that's already in the display 
> tree, the display does not update. You can't see the effect of the change 
> until something else causes a repaint. 
> Looking at the code, isn't this an issue for decorators in general? I don't 
> see any mechanism for decorators to notify the component (or components?) 
> that they are attached to that they've changed. If you're not going to 
> notify, then shouldn't decorators be immutable objects? (Of course, that 
> would break a lot of code.) 
> FWIW, a demonstration: 
> <Window title="Scale change" maximized="true"
>   xmlns:bxml="http://pivot.apache.org/bxml";
>   xmlns:effects="org.apache.pivot.wtk.effects"
>   xmlns="org.apache.pivot.wtk">
>   <BoxPane orientation="vertical" preferredWidth="300">
>     <PushButton buttonData="Change">
>       <buttonPressListeners>
>         function buttonPressed(button) {
>           scaleDecorator.setScale(2.0);
>         }
>       </buttonPressListeners>
>     </PushButton>
>     <Label text="This text should get twice as big when I push the button">
>       <decorators>
>         <effects:ScaleDecorator bxml:id="scaleDecorator" 
>           horizontalAlignment="left" verticalAlignment="top" />
>       </decorators>
>     </Label>
>   </BoxPane>
> </Window>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to