Disable Rollover Animation for Specific Items in JList

View: New views
3 Messages — Rating Filter:   Alert me  

Disable Rollover Animation for Specific Items in JList

by Mohammad Noor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
I've currently got a JList with items which are disabled/enabled as they are selected by the User - the disabled/enabled nature is defined by the Object model powering the List item.
 
I currently have a custom CellRenderer to change the colour of the Items within the list to reflect whether or not they're disabled.
 
However, I can't work out how to modify the rollover behaviour on an item by item basis within the JList.
 
What I want to do is disable the rollover animation for items which are disabled within the list. I can't work out how I'd attempt to do this - is this possible? If so.. how would I approach it?
 
Thanks in advance.
 
Mohammad Noor

---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.


Parent Message unknown Re: Disable Rollover Animation for Specific Items in JList

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Right now there are two options (all said below is for version 5.0dev):

1. Have the enabled cells painted by a subclass of SubstanceDefaultListCellRenderer and disabled cells painted by a class which is not a subclass of SubstanceDefaultListCellRenderer.
2. Use the FadeConfigurationManager APIs to disable rollover and selection animations on the specific list [1].

The first solution relies on the current internal implementation, and the second will remove rollover / selection effects from all list cells. One possible way to address this (as long as the renderer extends SubstanceDefaultListCellRenderer) would be to honor the enabled status of the renderer itself. Then, if the renderer is disabled, the code will not show any rollover / selection highlights on that cell.

How does this approach sound (i'll need to make the change in Substance itself)?

Thanks
Kirill

[1] https://laf-widget.dev.java.net/docs/animations.html

----- Original Message ----
From: Mohammad Noor <mohammad.noor@...>
To: users@...
Sent: Thursday, July 10, 2008 4:06:02 AM
Subject: Disable Rollover Animation for Specific Items in JList

Hi,
 
I've currently got a JList with items which are disabled/enabled as they are selected by the User - the disabled/enabled nature is defined by the Object model powering the List item.
 
I currently have a custom CellRenderer to change the colour of the Items within the list to reflect whether or not they're disabled.
 
However, I can't work out how to modify the rollover behaviour on an item by item basis within the JList.
 
What I want to do is disable the rollover animation for items which are disabled within the list. I can't work out how I'd attempt to do this - is this possible? If so.. how would I approach it?
 
Thanks in advance.
 
Mohammad Noor

---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.



Parent Message unknown Re: Disable Rollover Animation for Specific Items in JList

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
The latest 5.0dev drop respects the disabled cell renderers that extend SubstanceDefaultListCellRenderer and does not show any rollover / selection animation sequences. You can still select the "disabled" cell - you'd have to install a custom list selection model. I don't think that it's a LAF's job to enforce that based on renderer enabled / disabled status.

I'll have to think about extending this to trees and tables. I'm especially reluctant in extending this to trees because of the whole possible "mess" with functionality of expansion / leaf.

Thanks
Kirill

----- Original Message ----
From: Mohammad Noor <mohammad.noor@...>
To: users@...
Sent: Thursday, July 10, 2008 4:06:02 AM
Subject: Disable Rollover Animation for Specific Items in JList

Hi,
 
I've currently got a JList with items which are disabled/enabled as they are selected by the User - the disabled/enabled nature is defined by the Object model powering the List item.
 
I currently have a custom CellRenderer to change the colour of the Items within the list to reflect whether or not they're disabled.
 
However, I can't work out how to modify the rollover behaviour on an item by item basis within the JList.
 
What I want to do is disable the rollover animation for items which are disabled within the list. I can't work out how I'd attempt to do this - is this possible? If so.. how would I approach it?
 
Thanks in advance.
 
Mohammad Noor

---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.