
|
Re: APIs for setting themes and painters on per-component level

Some parts of this message have been removed.
Learn more about Nabble's security policy.
in 4.3, you can set a specific component's theme
like this:
component.putClientProperty(SubstanceLookAndFeel.THEME_PROPERTY, new
SubstanceTheme());
you'll have to do this for all of your specific
instances (ie each JTableHeader, JMenuItem and JSlider you have in the app). i
don't know of a way to tell the UIManager to to draw all JTableHeaders, etc
that way.
-mark
----- Original Message -----
Sent: Wednesday, April 23, 2008 9:57
AM
Subject: APIs for setting themes and
painters on per-component level
Hello Kirill,
in your blog http://www.pushing-pixels.org/?p=295
you wrote about the changes for substance 5: "Removed the client properties
and APIs for setting themes and painters on per-component level. Use
colorization client property and per-window skins for custom
tweaking.".
Maybe you could explain how these settings/APIs can be used
in substance 4.3?
I'm trying to set a different Skin (actually Themes
from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the
main Theme for the rest of my App should remain the same.
Firstly I've
tried to override getTheme(Component comp, ComponentState state, boolean
toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing
something wrong there. My Menus are looking different but pretty shity,
JTableHeader remains unchanged and JSliders are looking kinda different but
not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin
is applied to all Components in my App, but I want it only for 3 of
them.
Any
ideas?
Thanks, Sergiy
Express yourself wherever you are. Mobilize!
|

|
Re: APIs for setting themes and painters on per-component level

Some parts of this message have been removed.
Learn more about Nabble's security policy.
Hi, The THEME_PROPERTY can be installed on a specific component and is used to override the current theme for that component. This should work for sliders. Menu items and table headers use highlight themes for the rollover / selection / arm events. So, you can try to override the getHighlightTheme as well, but the implementation is not really built with this in mind. In general, i would suggest not trying to force the theming mechanism into doing something that it is not built for. A skin defines a number of decoration areas, and each decoration area has its themes and highlight themes. These are applied to all controls in that specific area. Version 4.3 does not have per-window skinning. It does have per-component
theming with THEME_PROPERTY and COLORIZATION_FACTOR. Thanks Kirill ----- Original Message ---- From: Sergiy Michka < smichka@...> To: users@...Sent: Wednesday, April 23, 2008 6:57:08 AM Subject: APIs for setting themes and painters on per-component level
Hello Kirill, in your blog http://www.pushing-pixels.org/?p=295 you wrote about the changes for substance 5: "Removed the client properties and APIs for setting themes and painters
on per-component level. Use colorization client property and per-window
skins for custom tweaking.". Maybe you could explain how these settings/APIs can be used in substance 4.3? I'm trying to set a different Skin (actually Themes from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the main Theme for the rest of my App should remain the same.
Firstly I've tried to override getTheme(Component comp, ComponentState state, boolean toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing something wrong there. My Menus are looking different but pretty shity, JTableHeader remains unchanged and JSliders are looking kinda different but not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin is applied to all Components in my App, but I want it only for 3 of them.
Any ideas? Thanks, Sergiy
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
|

|
Re: APIs for setting themes and painters on per-component level
Thanks guys! Seems to work. But I have another question in this matter: I'm trying to change BorderPainter for my menus, because black menus on black background are hardly recognizable. If you'll start substance demo app and would set the skin to Business and directly after that set theme to Ebony, all elements will get white border. But I couldnt achieve the same result in my code without doing these steps :(
Is it a nice good looking side effect, or did I missunderstood something? Thanks again, Sergiy 2008/4/23 Kirill Grouchnikov < kirillcool@...>:
Hi, The THEME_PROPERTY can be installed on a specific component and is used to override the current theme for that component. This should work for sliders. Menu items and table headers use highlight themes for the rollover / selection / arm events. So, you can try to override the getHighlightTheme as well, but the implementation is not really built with this in mind.
In general, i would suggest not trying to force the theming mechanism into doing something that it is not built for. A skin defines a number of decoration areas, and each decoration area has its themes and highlight themes. These are applied to all controls in that specific area.
Version 4.3 does not have per-window skinning. It does have per-component
theming with THEME_PROPERTY and COLORIZATION_FACTOR. Thanks Kirill Sent: Wednesday, April 23, 2008 6:57:08 AM Subject: APIs for setting themes and painters on per-component level
Hello Kirill, in your blog http://www.pushing-pixels.org/?p=295 you wrote about the changes for substance 5: "Removed the client properties and APIs for setting themes and painters
on per-component level. Use colorization client property and per-window
skins for custom tweaking.". Maybe you could explain how these settings/APIs can be used in substance 4.3? I'm trying to set a different Skin (actually Themes from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the main Theme for the rest of my App should remain the same.
Firstly I've tried to override getTheme(Component comp, ComponentState state, boolean toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing something wrong there. My Menus are looking different but pretty shity, JTableHeader remains unchanged and JSliders are looking kinda different but not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin is applied to all Components in my App, but I want it only for 3 of them.
Any ideas? Thanks, Sergiy
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
|

|
Re: APIs for setting themes and painters on per-component level

Some parts of this message have been removed.
Learn more about Nabble's security policy.
Hi, Sergiy In order to have lighter borders under dark skins in version 4.3, you can use a ClassicInnerBorderPainter that is shifted with TINT parameter (second parameter in the constructor). This instructs the border painter to take the control theme and shift it to the white color (the first parameter specifies the amount of shift). This is what you see when you use a border painter from Business skin and the Ebony theme. Note that this only works on *Inner* painters, and if you want to use it on another type of painter, you'll have to implement the SubstanceBorderPainter interface and use that in your custom skin. In version 5.0, you simply specify a border color scheme to be used on the controls in the specific
decoration area (look at SubstanceColorSchemeBundle.registerBorderColorScheme method). The documentation will be available in the following weeks. Thanks Kirill ----- Original Message ---- From: Sergiy Michka < smichka@...> To: users@...Sent: Monday, April 28, 2008 2:31:52 AM Subject: Re: APIs for setting themes and painters on per-component level
Thanks guys! Seems to work. But I have another question in this matter: I'm trying to change BorderPainter for my menus, because black menus on black background are hardly recognizable. If you'll start substance demo app and would set the skin to Business and directly after that set theme to Ebony, all elements will get white border. But I couldnt achieve the same result in my code without doing these steps :(
Is it a nice good looking side effect, or did I missunderstood something? Thanks again, Sergiy 2008/4/23 Kirill Grouchnikov < kirillcool@...>:
Hi, The THEME_PROPERTY can be installed on a specific component and is used to override the current theme for that component. This should work for sliders. Menu items and table headers use highlight themes for the rollover / selection / arm events. So, you can try to override the getHighlightTheme as well, but the implementation is not really built with this in mind.
In general, i would suggest not trying to force the theming mechanism into doing something that it is not built for. A skin defines a number of decoration areas, and each decoration area has its themes and highlight themes. These are applied to all controls in that specific area.
Version 4.3 does not have per-window skinning. It does have per-component
theming with THEME_PROPERTY and COLORIZATION_FACTOR. Thanks Kirill Sent: Wednesday, April 23, 2008 6:57:08 AM Subject: APIs for setting themes and painters on per-component level
Hello Kirill, in your blog http://www.pushing-pixels.org/?p=295 you wrote about the changes for substance 5: "Removed the client properties and APIs for setting themes and painters
on per-component level. Use colorization client property and per-window
skins for custom tweaking.". Maybe you could explain how these settings/APIs can be used in substance 4.3? I'm trying to set a different Skin (actually Themes from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the main Theme for the rest of my App should remain the same.
Firstly I've tried to override getTheme(Component comp, ComponentState state, boolean toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing something wrong there. My Menus are looking different but pretty shity, JTableHeader remains unchanged and JSliders are looking kinda different but not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin is applied to all Components in my App, but I want it only for 3 of them.
Any ideas? Thanks, Sergiy
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
|

|
Re: APIs for setting themes and painters on per-component level
Hello Kirill, thanks for the explanation. If I use the BorderPainter from Business skin, I have the white border in all components. But Im trying to set it only for JMenuItem's and derived classes. My actual problem is to apply it for menus only, my previous mail was somewhat uninformative, I'm sorry.
Is it possible to use the border for menus but not using it in the rest of the app.? The problem is when using a skin all skin Painters are set for the whole app in the set() method, so I can't work with DecorationAreaType.HEADER here. Stuff like BORDER_PAINTER_PROPERTY is great but doesnt work for menus.
Next try could be to implement my own BorderPainter and handle menus different than another components. But all this tries are against current substance design and quite time heavy. The real problem with dark themes is, that the users/QA folks of my app are complaining that some components are not good viewable. It was the case with sliders and table headers but now they are complaining about the menus :(
I can't use 5.0 because I can't use JDK 6.0. Thanks, Sergiy 2008/4/28 Kirill Grouchnikov < kirillcool@...>:
Hi, Sergiy In order to have lighter borders under dark skins in version 4.3, you can use a ClassicInnerBorderPainter that is shifted with TINT parameter (second parameter in the constructor). This instructs the border painter to take the control theme and shift it to the white color (the first parameter specifies the amount of shift). This is what you see when you use a border painter from Business skin and the Ebony theme. Note that this only works on *Inner* painters, and if you want to use it on another type of painter, you'll have to implement the SubstanceBorderPainter interface and use that in your custom skin.
In version 5.0, you simply specify a border color scheme to be used on the controls in the specific
decoration area (look at SubstanceColorSchemeBundle.registerBorderColorScheme method). The documentation will be available in the following weeks. Thanks Kirill
Sent: Monday, April 28, 2008 2:31:52 AM Subject: Re: APIs for setting themes and painters on per-component level
Thanks guys! Seems to work. But I have another question in this matter: I'm trying to change BorderPainter for my menus, because black menus on black background are hardly recognizable. If you'll start substance demo app and would set the skin to Business and directly after that set theme to Ebony, all elements will get white border. But I couldnt achieve the same result in my code without doing these steps :(
Is it a nice good looking side effect, or did I missunderstood something? Thanks again, Sergiy 2008/4/23 Kirill Grouchnikov < kirillcool@...>:
Hi, The THEME_PROPERTY can be installed on a specific component and is used to override the current theme for that component. This should work for sliders. Menu items and table headers use highlight themes for the rollover / selection / arm events. So, you can try to override the getHighlightTheme as well, but the implementation is not really built with this in mind.
In general, i would suggest not trying to force the theming mechanism into doing something that it is not built for. A skin defines a number of decoration areas, and each decoration area has its themes and highlight themes. These are applied to all controls in that specific area.
Version 4.3 does not have per-window skinning. It does have per-component
theming with THEME_PROPERTY and COLORIZATION_FACTOR. Thanks Kirill Sent: Wednesday, April 23, 2008 6:57:08 AM Subject: APIs for setting themes and painters on per-component level
Hello Kirill, in your blog http://www.pushing-pixels.org/?p=295 you wrote about the changes for substance 5: "Removed the client properties and APIs for setting themes and painters
on per-component level. Use colorization client property and per-window
skins for custom tweaking.". Maybe you could explain how these settings/APIs can be used in substance 4.3? I'm trying to set a different Skin (actually Themes from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the main Theme for the rest of my App should remain the same.
Firstly I've tried to override getTheme(Component comp, ComponentState state, boolean toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing something wrong there. My Menus are looking different but pretty shity, JTableHeader remains unchanged and JSliders are looking kinda different but not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin is applied to all Components in my App, but I want it only for 3 of them.
Any ideas? Thanks, Sergiy
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
|

|
Re: APIs for setting themes and painters on per-component level

Some parts of this message have been removed.
Learn more about Nabble's security policy.
Hi, Sergiy Can you attach a screenshot that illustrates the problem in the specific skin that you are using? Are you talking about the border of the menu itself (the popup menu) or a single highlighted menu in menu bar / menu item in popup menu? If it is a single highlighted entry, then you can try playing with the highlight theme / alpha settings of your skin to provide more contrast (something like Windows Media Player-esque dark blue highlight theme to visually offset the armed item). Thanks Kirill ----- Original Message ---- From: Sergiy Michka < smichka@...> To: users@...Sent: Tuesday,
April 29, 2008 9:44:12 AM Subject: Re: APIs for setting themes and painters on per-component level
Hello Kirill, thanks for the explanation. If I use the BorderPainter from Business skin, I have the white border in all components. But Im trying to set it only for JMenuItem's and derived classes. My actual problem is to apply it for menus only, my previous mail was somewhat uninformative, I'm sorry.
Is it possible to use the border for menus but not using it in the rest of the app.? The problem is when using a skin all skin Painters are set for the whole app in the set() method, so I can't work with DecorationAreaType.HEADER here. Stuff like BORDER_PAINTER_PROPERTY is great but doesnt work for menus.
Next try could be to implement my own BorderPainter and handle menus different than another components. But all this tries are against current substance design and quite time heavy. The real problem with dark themes is, that the users/QA folks of my app are complaining that some components are not good viewable. It was the case with sliders and table headers but now they are complaining about the menus :(
I can't use 5.0 because I can't use JDK 6.0. Thanks, Sergiy 2008/4/28 Kirill Grouchnikov < kirillcool@...>:
Hi, Sergiy In order to have lighter borders under dark skins in version 4.3, you can use a ClassicInnerBorderPainter that is shifted with TINT parameter (second parameter in the constructor). This instructs the border painter to take the control theme and shift it to the white color (the first parameter specifies the amount of shift). This is what you see when you use a border painter from Business skin and the Ebony theme. Note that this only works on *Inner* painters, and if you want to use it on another type of painter, you'll have to implement the SubstanceBorderPainter interface and use that in your custom skin.
In version 5.0, you simply specify a border color scheme to be used on the controls in the specific
decoration area (look at SubstanceColorSchemeBundle.registerBorderColorScheme method). The documentation will be available in the following weeks. Thanks Kirill
Sent: Monday, April 28, 2008 2:31:52 AM Subject: Re: APIs for setting themes and painters on per-component level
Thanks guys! Seems to work. But I have another question in this matter: I'm trying to change BorderPainter for my menus, because black menus on black background are hardly recognizable. If you'll start substance demo app and would set the skin to Business and directly after that set theme to Ebony, all elements will get white border. But I couldnt achieve the same result in my code without doing these steps :(
Is it a nice good looking side effect, or did I missunderstood something? Thanks again, Sergiy 2008/4/23 Kirill Grouchnikov < kirillcool@...>:
Hi, The THEME_PROPERTY can be installed on a specific component and is used to override the current theme for that component. This should work for sliders. Menu items and table headers use highlight themes for the rollover / selection / arm events. So, you can try to override the getHighlightTheme as well, but the implementation is not really built with this in mind.
In general, i would suggest not trying to force the theming mechanism into doing something that it is not built for. A skin defines a number of decoration areas, and each decoration area has its themes and highlight themes. These are applied to all controls in that specific area.
Version 4.3 does not have per-window skinning. It does have per-component
theming with THEME_PROPERTY and COLORIZATION_FACTOR. Thanks Kirill Sent: Wednesday, April 23, 2008 6:57:08 AM Subject: APIs for setting themes and painters on per-component level
Hello Kirill, in your blog http://www.pushing-pixels.org/?p=295 you wrote about the changes for substance 5: "Removed the client properties and APIs for setting themes and painters
on per-component level. Use colorization client property and per-window
skins for custom tweaking.". Maybe you could explain how these settings/APIs can be used in substance 4.3? I'm trying to set a different Skin (actually Themes from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the main Theme for the rest of my App should remain the same.
Firstly I've tried to override getTheme(Component comp, ComponentState state, boolean toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing something wrong there. My Menus are looking different but pretty shity, JTableHeader remains unchanged and JSliders are looking kinda different but not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin is applied to all Components in my App, but I want it only for 3 of them.
Any ideas? Thanks, Sergiy
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
|

|
Re: APIs for setting themes and painters on per-component level
Hi Kirill,
Can you attach a screenshot that illustrates the problem in the specific skin that you are using?
Yep, first one I've made by setting RavenGraphiteGlass theme, then Business skin and Ebony theme as last.
The second without Business skin inbetween. In my real app, Im using something like Raven+Ebony with few small extras and the BorderPainter from Business skin for sliders and table headers.
If I could get the white border for my menus from business screenhot it would be great, but the skin applies the border for each element in the app.
Are you talking about the border of the menu itself (the popup menu) or a single highlighted menu in menu bar / menu item in popup menu?
About border of the menu itself, not the single menu items. Strong white border for each menu item and for menu in addition will look pretty bad, I have had it already in one of my tests.
If it is a single highlighted entry, then you can try playing with the highlight theme / alpha settings of your skin to provide more contrast (something like Windows Media Player-esque dark blue highlight theme to visually offset the armed item).
Nop, unfortunately not, I had quite good results while playing with highlight theme but it was not what I was trying to achieve.
Thanks, Sergiy
Sent: Tuesday,
April 29, 2008 9:44:12 AM Subject: Re: APIs for setting themes and painters on per-component level
Hello Kirill, thanks for the explanation. If I use the BorderPainter from Business skin, I have the white border in all components. But Im trying to set it only for JMenuItem's and derived classes. My actual problem is to apply it for menus only, my previous mail was somewhat uninformative, I'm sorry.
Is it possible to use the border for menus but not using it in the rest of the app.? The problem is when using a skin all skin Painters are set for the whole app in the set() method, so I can't work with DecorationAreaType.HEADER here. Stuff like BORDER_PAINTER_PROPERTY is great but doesnt work for menus.
Next try could be to implement my own BorderPainter and handle menus different than another components. But all this tries are against current substance design and quite time heavy. The real problem with dark themes is, that the users/QA folks of my app are complaining that some components are not good viewable. It was the case with sliders and table headers but now they are complaining about the menus :(
I can't use 5.0 because I can't use JDK 6.0. Thanks, Sergiy 2008/4/28 Kirill Grouchnikov < kirillcool@...>:
Hi, Sergiy In order to have lighter borders under dark skins in version 4.3, you can use a ClassicInnerBorderPainter that is shifted with TINT parameter (second parameter in the constructor). This instructs the border painter to take the control theme and shift it to the white color (the first parameter specifies the amount of shift). This is what you see when you use a border painter from Business skin and the Ebony theme. Note that this only works on *Inner* painters, and if you want to use it on another type of painter, you'll have to implement the SubstanceBorderPainter interface and use that in your custom skin.
In version 5.0, you simply specify a border color scheme to be used on the controls in the specific
decoration area (look at SubstanceColorSchemeBundle.registerBorderColorScheme method). The documentation will be available in the following weeks. Thanks Kirill
Sent: Monday, April 28, 2008 2:31:52 AM Subject: Re: APIs for setting themes and painters on per-component level
Thanks guys! Seems to work. But I have another question in this matter: I'm trying to change BorderPainter for my menus, because black menus on black background are hardly recognizable. If you'll start substance demo app and would set the skin to Business and directly after that set theme to Ebony, all elements will get white border. But I couldnt achieve the same result in my code without doing these steps :(
Is it a nice good looking side effect, or did I missunderstood something? Thanks again, Sergiy 2008/4/23 Kirill Grouchnikov < kirillcool@...>:
Hi, The THEME_PROPERTY can be installed on a specific component and is used to override the current theme for that component. This should work for sliders. Menu items and table headers use highlight themes for the rollover / selection / arm events. So, you can try to override the getHighlightTheme as well, but the implementation is not really built with this in mind.
In general, i would suggest not trying to force the theming mechanism into doing something that it is not built for. A skin defines a number of decoration areas, and each decoration area has its themes and highlight themes. These are applied to all controls in that specific area.
Version 4.3 does not have per-window skinning. It does have per-component
theming with THEME_PROPERTY and COLORIZATION_FACTOR. Thanks Kirill Sent: Wednesday, April 23, 2008 6:57:08 AM Subject: APIs for setting themes and painters on per-component level
Hello Kirill, in your blog http://www.pushing-pixels.org/?p=295 you wrote about the changes for substance 5: "Removed the client properties and APIs for setting themes and painters
on per-component level. Use colorization client property and per-window
skins for custom tweaking.". Maybe you could explain how these settings/APIs can be used in substance 4.3? I'm trying to set a different Skin (actually Themes from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the main Theme for the rest of my App should remain the same.
Firstly I've tried to override getTheme(Component comp, ComponentState state, boolean toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing something wrong there. My Menus are looking different but pretty shity, JTableHeader remains unchanged and JSliders are looking kinda different but not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin is applied to all Components in my App, but I want it only for 3 of them.
Any ideas? Thanks, Sergiy
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...
|

|
Re: APIs for setting themes and painters on per-component level

Some parts of this message have been removed.
Learn more about Nabble's security policy.
Hi, Sergiy I would say that you have two options. One is to create a wrapper border painter to delegate the actual painting based on the control class ("lighter" implementation for JMenus and the usual implementation for everything else). Another is to set a non-UIResource border on your JMenus (which would then be respected and not overriden by Substance). Thanks Kirill ----- Original Message ---- From: Sergiy Michka < smichka@...> To: users@...Sent: Wednesday, April 30, 2008 2:49:52 AM Subject: Re: APIs for setting themes and painters on per-component level
Hi Kirill,
Can you attach a screenshot that illustrates the problem in the specific skin that you are using?
Yep, first one I've made by setting RavenGraphiteGlass theme, then Business skin and Ebony theme as last.
The second without Business skin inbetween. In my real app, Im using something like Raven+Ebony with few small extras and the BorderPainter from Business skin for sliders and table headers.
If I could get the white border for my menus from business screenhot it would be great, but the skin applies the border for each element in the app.
Are you talking about the border of the menu itself (the popup menu) or a single highlighted menu in menu bar / menu item in popup menu?
About border of the menu itself, not the single menu items. Strong white border for each menu item and for menu in addition will look pretty bad, I have had it already in one of my tests.
If it is a single highlighted entry, then you can try playing with the highlight theme / alpha settings of your skin to provide more contrast (something like Windows Media Player-esque dark blue highlight theme to visually offset the armed item).
Nop, unfortunately not, I had quite good results while playing with highlight theme but it was not what I was trying to achieve.
Thanks, Sergiy
Sent: Tuesday,
April 29, 2008 9:44:12 AM Subject: Re: APIs for setting themes and painters on per-component level
Hello Kirill, thanks for the explanation. If I use the BorderPainter from Business skin, I have the white border in all components. But Im trying to set it only for JMenuItem's and derived classes. My actual problem is to apply it for menus only, my previous mail was somewhat uninformative, I'm sorry.
Is it possible to use the border for menus but not using it in the rest of the app.? The problem is when using a skin all skin Painters are set for the whole app in the set() method, so I can't work with DecorationAreaType.HEADER here. Stuff like BORDER_PAINTER_PROPERTY is great but doesnt work for menus.
Next try could be to implement my own BorderPainter and handle menus different than another components. But all this tries are against current substance design and quite time heavy. The real problem with dark themes is, that the users/QA folks of my app are complaining that some components are not good viewable. It was the case with sliders and table headers but now they are complaining about the menus :(
I can't use 5.0 because I can't use JDK 6.0. Thanks, Sergiy 2008/4/28 Kirill Grouchnikov < kirillcool@...>:
Hi, Sergiy In order to have lighter borders under dark skins in version 4.3, you can use a ClassicInnerBorderPainter that is shifted with TINT parameter (second parameter in the constructor). This instructs the border painter to take the control theme and shift it to the white color (the first parameter specifies the amount of shift). This is what you see when you use a border painter from Business skin and the Ebony theme. Note that this only works on *Inner* painters, and if you want to use it on another type of painter, you'll have to implement the SubstanceBorderPainter interface and use that in your custom skin.
In version 5.0, you simply specify a border color scheme to be used on the controls in the specific
decoration area (look at SubstanceColorSchemeBundle.registerBorderColorScheme method). The documentation will be available in the following weeks. Thanks Kirill
Sent: Monday, April 28, 2008 2:31:52 AM Subject: Re: APIs for setting themes and painters on per-component level
Thanks guys! Seems to work. But I have another question in this matter: I'm trying to change BorderPainter for my menus, because black menus on black background are hardly recognizable. If you'll start substance demo app and would set the skin to Business and directly after that set theme to Ebony, all elements will get white border. But I couldnt achieve the same result in my code without doing these steps :(
Is it a nice good looking side effect, or did I missunderstood something? Thanks again, Sergiy 2008/4/23 Kirill Grouchnikov < kirillcool@...>:
Hi, The THEME_PROPERTY can be installed on a specific component and is used to override the current theme for that component. This should work for sliders. Menu items and table headers use highlight themes for the rollover / selection / arm events. So, you can try to override the getHighlightTheme as well, but the implementation is not really built with this in mind.
In general, i would suggest not trying to force the theming mechanism into doing something that it is not built for. A skin defines a number of decoration areas, and each decoration area has its themes and highlight themes. These are applied to all controls in that specific area.
Version 4.3 does not have per-window skinning. It does have per-component
theming with THEME_PROPERTY and COLORIZATION_FACTOR. Thanks Kirill Sent: Wednesday, April 23, 2008 6:57:08 AM Subject: APIs for setting themes and painters on per-component level
Hello Kirill, in your blog http://www.pushing-pixels.org/?p=295 you wrote about the changes for substance 5: "Removed the client properties and APIs for setting themes and painters
on per-component level. Use colorization client property and per-window
skins for custom tweaking.". Maybe you could explain how these settings/APIs can be used in substance 4.3? I'm trying to set a different Skin (actually Themes from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the main Theme for the rest of my App should remain the same.
Firstly I've tried to override getTheme(Component comp, ComponentState state, boolean toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing something wrong there. My Menus are looking different but pretty shity, JTableHeader remains unchanged and JSliders are looking kinda different but not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin is applied to all Components in my App, but I want it only for 3 of them.
Any ideas? Thanks, Sergiy
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@...For additional commands, e-mail: users-help@...
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
|

|
Re: APIs for setting themes and painters on per-component level
Hello Kirill, I have my own "mixed wrapper BorderPainter" now and it works great :) Thanks a lot! Sergiy 2008/4/30 Kirill Grouchnikov < kirillcool@...>:
Hi, Sergiy I would say that you have two options. One is to create a wrapper border painter to delegate the actual painting based on the control class ("lighter" implementation for JMenus and the usual implementation for everything else). Another is to set a non-UIResource border on your JMenus (which would then be respected and not overriden by Substance).
Thanks Kirill Sent: Wednesday, April 30, 2008 2:49:52 AM Subject: Re: APIs for setting themes and painters on per-component level
Hi Kirill,
Can you attach a screenshot that illustrates the problem in the specific skin that you are using?
Yep, first one I've made by setting RavenGraphiteGlass theme, then Business skin and Ebony theme as last.
The second without Business skin inbetween. In my real app, Im using something like Raven+Ebony with few small extras and the BorderPainter from Business skin for sliders and table headers.
If I could get the white border for my menus from business screenhot it would be great, but the skin applies the border for each element in the app.
Are you talking about the border of the menu itself (the popup menu) or a single highlighted menu in menu bar / menu item in popup menu?
About border of the menu itself, not the single menu items. Strong white border for each menu item and for menu in addition will look pretty bad, I have had it already in one of my tests.
If it is a single highlighted entry, then you can try playing with the highlight theme / alpha settings of your skin to provide more contrast (something like Windows Media Player-esque dark blue highlight theme to visually offset the armed item).
Nop, unfortunately not, I had quite good results while playing with highlight theme but it was not what I was trying to achieve.
Thanks, Sergiy
Sent: Tuesday,
April 29, 2008 9:44:12 AM Subject: Re: APIs for setting themes and painters on per-component level
Hello Kirill, thanks for the explanation. If I use the BorderPainter from Business skin, I have the white border in all components. But Im trying to set it only for JMenuItem's and derived classes. My actual problem is to apply it for menus only, my previous mail was somewhat uninformative, I'm sorry.
Is it possible to use the border for menus but not using it in the rest of the app.? The problem is when using a skin all skin Painters are set for the whole app in the set() method, so I can't work with DecorationAreaType.HEADER here. Stuff like BORDER_PAINTER_PROPERTY is great but doesnt work for menus.
Next try could be to implement my own BorderPainter and handle menus different than another components. But all this tries are against current substance design and quite time heavy. The real problem with dark themes is, that the users/QA folks of my app are complaining that some components are not good viewable. It was the case with sliders and table headers but now they are complaining about the menus :(
I can't use 5.0 because I can't use JDK 6.0. Thanks, Sergiy 2008/4/28 Kirill Grouchnikov < kirillcool@...>:
Hi, Sergiy In order to have lighter borders under dark skins in version 4.3, you can use a ClassicInnerBorderPainter that is shifted with TINT parameter (second parameter in the constructor). This instructs the border painter to take the control theme and shift it to the white color (the first parameter specifies the amount of shift). This is what you see when you use a border painter from Business skin and the Ebony theme. Note that this only works on *Inner* painters, and if you want to use it on another type of painter, you'll have to implement the SubstanceBorderPainter interface and use that in your custom skin.
In version 5.0, you simply specify a border color scheme to be used on the controls in the specific
decoration area (look at SubstanceColorSchemeBundle.registerBorderColorScheme method). The documentation will be available in the following weeks. Thanks Kirill
Sent: Monday, April 28, 2008 2:31:52 AM Subject: Re: APIs for setting themes and painters on per-component level
Thanks guys! Seems to work. But I have another question in this matter: I'm trying to change BorderPainter for my menus, because black menus on black background are hardly recognizable. If you'll start substance demo app and would set the skin to Business and directly after that set theme to Ebony, all elements will get white border. But I couldnt achieve the same result in my code without doing these steps :(
Is it a nice good looking side effect, or did I missunderstood something? Thanks again, Sergiy 2008/4/23 Kirill Grouchnikov < kirillcool@...>:
Hi, The THEME_PROPERTY can be installed on a specific component and is used to override the current theme for that component. This should work for sliders. Menu items and table headers use highlight themes for the rollover / selection / arm events. So, you can try to override the getHighlightTheme as well, but the implementation is not really built with this in mind.
In general, i would suggest not trying to force the theming mechanism into doing something that it is not built for. A skin defines a number of decoration areas, and each decoration area has its themes and highlight themes. These are applied to all controls in that specific area.
Version 4.3 does not have per-window skinning. It does have per-component
theming with THEME_PROPERTY and COLORIZATION_FACTOR. Thanks Kirill Sent: Wednesday, April 23, 2008 6:57:08 AM Subject: APIs for setting themes and painters on per-component level
Hello Kirill, in your blog http://www.pushing-pixels.org/?p=295 you wrote about the changes for substance 5: "Removed the client properties and APIs for setting themes and painters
on per-component level. Use colorization client property and per-window
skins for custom tweaking.". Maybe you could explain how these settings/APIs can be used in substance 4.3? I'm trying to set a different Skin (actually Themes from the Skin) for 3 Components (JTableHeader, JMenuItem and JSlider) but the main Theme for the rest of my App should remain the same.
Firstly I've tried to override getTheme(Component comp, ComponentState state, boolean toIgnoreHighlights) from SubstanceTheme in my custom Theme. But I'm doing something wrong there. My Menus are looking different but pretty shity, JTableHeader remains unchanged and JSliders are looking kinda different but not as expected. When I'm using SubstanceLookAndFeel.setSkin(mySkin), mySkin is applied to all Components in my App, but I want it only for 3 of them.
Any ideas? Thanks, Sergiy
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@...For additional commands, e-mail: users-help@...
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
|

|
Re: APIs for setting themes and painters on per-component level
by Kirill Grouchnikov
::
Rate this Message:
|