You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Chris Bartlett (JIRA)" <ji...@apache.org> on 2010/08/25 14:27:17 UTC

[jira] Created: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Creation of an application wide 'focus decorator' which would be applied to the focused Component
-------------------------------------------------------------------------------------------------

                 Key: PIVOT-607
                 URL: https://issues.apache.org/jira/browse/PIVOT-607
             Project: Pivot
          Issue Type: New Feature
          Components: wtk
         Environment: n/a
            Reporter: Chris Bartlett
            Priority: Minor
             Fix For: 2.0


Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
By default the Decorator would be 'null' and therefore not added to the focused component.

It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.

I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910401#action_12910401 ] 

Greg Brown commented on PIVOT-607:
----------------------------------

I think it is a good idea. However, it is fairly easily done at the application level via ComponentClassListener, so we probably don't need to go out of our way to support it.

OTOH, it would be nice to be able to turn it on/off like debug paint, so if you want to add it, feel free (though I'd suggest using the listener rather than modifying the Component class - not sure how you have coded it).


> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg, highlighed-listview.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Chris Bartlett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914491#action_12914491 ] 

Chris Bartlett commented on PIVOT-607:
--------------------------------------

Sandro,

In short,  I was just keeping things simple

Allowing    -Dorg.apache.pivot.wtk.debugfocuscolor=#ff0000   would be a trivial addition (just rely on Color.decode()) , but  I didn't want to over engineer this so kept things simple while still offering a little flexibility.   We could allow as many different encodings of color values as you want.

Someone might also want to use a decorator other than ShadeDecorator, or a different opacity setting than the default, but we can't  really cater for every possibility.
A user would be free to replicate this code inside of their own app and then call Component.setFocusDecorator(xxx) if they required more flexibility.


If the supplied color name is not one of the 3 'valid' values, then nothing happens (just as would happen if they mis-typed the property name)
Once again it would be trivial to add a warning but unnecessary IMHO.
Users would discover this feature through our documentation, and that would specify the valid color names.
If they specify a color but the focused component is not decorated once the app starts, then it should be fairly straighforward what has happened.

I am happy to add either or both of the above if they are wanted.


> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Assignee: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg, highlighed-listview.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown reassigned PIVOT-607:
--------------------------------

    Assignee: Chris Bartlett

> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Assignee: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg, highlighed-listview.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Chris Bartlett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910398#action_12910398 ] 

Chris Bartlett commented on PIVOT-607:
--------------------------------------

Is there any interest in this?
I can add my code if there is, but otherwise I'll close the ticket.

> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg, highlighed-listview.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Chris Bartlett (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914625#action_12914625 ] 

Chris Bartlett commented on PIVOT-607:
--------------------------------------

As discussed on the dev list, reverted changes to Component & refactored into ApplicationContext.
Also changed the 'org.apache.pivot.wtk.debugfocuscolor' property to a boolean property named 'org.apache.pivot.wtk.debugfocus'

Example    -Dorg.apache.pivot.wtk.debugfocus=true

> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Assignee: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg, highlighed-listview.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914479#action_12914479 ] 

Sandro Martini commented on PIVOT-607:
--------------------------------------

Hi Chris,
excuse me I haven't seen the code for this, but instead of hard-coding 3 colors, why not pass into the command line the color value in hex format ? Like:

-Dorg.apache.pivot.wtk.debugfocuscolor=#ff0000

What do you think ?

And last, in case of a wrong given value what happens ?
As a sample, there is a similar condition when a custom json colors file is not found.

Tell me if I can give you more info ..

Bye,
Sandro


> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Assignee: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg, highlighed-listview.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Chris Bartlett (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Bartlett resolved PIVOT-607.
----------------------------------

    Resolution: Fixed

ApplicationContext now checks for a 'org.apache.pivot.wtk.debugfocuscolor'  system property specifying one of 3 colors by name for use with a ShadeDecorator.
Color names are case insensitive.

-Dorg.apache.pivot.wtk.debugfocuscolor=red
-Dorg.apache.pivot.wtk.debugfocuscolor=green
-Dorg.apache.pivot.wtk.debugfocuscolor=blue

Setting a focus decorator as follows will add/remove a focus listener which will in turn apply the decorator when focus changes
Component.setFocusDecorator(new ShadeDecorator(0.2f, focusColor));
Component.setFocusDecorator(new BorderDecorator());
Component.setFocusDecorator(null);  // Disable



> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Assignee: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg, highlighed-listview.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Chris Bartlett (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Bartlett updated PIVOT-607:
---------------------------------

    Attachment: highlighed-listbutton.jpg

Highlighted ListButton (in opened state)

> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-607) Creation of an application wide 'focus decorator' which would be applied to the focused Component

Posted by "Chris Bartlett (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Bartlett updated PIVOT-607:
---------------------------------

    Attachment: highlighed-listview.jpg

Highlighted ListView

> Creation of an application wide 'focus decorator' which would be applied to the focused Component
> -------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-607
>                 URL: https://issues.apache.org/jira/browse/PIVOT-607
>             Project: Pivot
>          Issue Type: New Feature
>          Components: wtk
>         Environment: n/a
>            Reporter: Chris Bartlett
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: highlighed-listbutton.jpg, highlighed-listview.jpg
>
>
> Apply a user specified Decorator (such as a ShadeDecorator) to the currently focused component to make it more visible.
> This would be useful when debugging focus traversal issues and possibly from an accessibility perspective.
> By default the Decorator would be 'null' and therefore not added to the focused component.
> It could be set through a static method on org.apache.pivot.wtk.Component (allowing it to be changed at run time), and/or via a system property (like org.apache.pivot.wtk.debugpaint) or startup argument.
> I have already developed this to satisfy my own requirement for the static methods on Component, but can add the other code and submit if deemed useful.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.