substance java one 2007 community corner
DESCRIPTION
JavaOne 2007 Community Corner presentation on Substance look-and-feelTRANSCRIPT
![Page 1: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/1.jpg)
Substance look and feelJavaOne 2007 Community Corner
![Page 2: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/2.jpg)
An application before Substance
![Page 3: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/3.jpg)
Same application with Substance
![Page 4: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/4.jpg)
Same application with Substance
![Page 5: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/5.jpg)
Using Substance in you app
Go to https://substance.dev.java.net
Download the latest substance.jar
Use one of the three options:◦ UIManager.setLookAndFeel(
new SubstanceLookAndFeel())
◦ UIManager.setLookAndFeel(“org.jvnet.substance.SubstanceLookAndFeel”)
◦ -Dswing.defaultlaf=org.jvnet.substance.SubstanceLookAndFeel
![Page 6: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/6.jpg)
Substance themes
Contains information on control colors
for different visual states (disabled,
default, active)
Base class – SubstanceTheme
Use bundled core themes
Use APIs to create derived themes
Extend and create a custom theme
![Page 7: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/7.jpg)
Substance simple themes
SubstanceAquaTheme SubstanceBottleGreenTheme
SubstancePurpleTheme SubstanceOliveTheme
![Page 8: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/8.jpg)
Substance derived themes
Invert, negate, saturate, hue-shift and
color-blind
Example of hue-shift:SubstanceTheme theme = SubstanceLookAndFeel.getTheme();SubstanceTheme shifted = theme.hueShift(-0.5);SubstanceLookAndFeel.setCurrentTheme(shifted);
![Page 9: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/9.jpg)
Substance watermarks
Simple watermarks
Image-based watermarks
SubstanceBinaryWatermark SubstanceWoodWatermark
SubstanceImageWatermark + APP_TILE
![Page 10: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/10.jpg)
Substance skins
A collection of various settings (theme,
watermark, painters, shapers etc).
In org.jvnet.substance.skinpackage
Can set as
◦ SubstanceLookAndFeel.setSkin(…)
◦ Derived look and feel classes based on a
specific skin (set with UIManager or VM
flag)
![Page 11: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/11.jpg)
Substance toned-down skins
SubstanceBusinessLookAndFeel
SubstanceCremeLookAndFeel
SubstanceBusinessBlackSteelLookAndFeel
SubstanceSaharaLookAndFeel
![Page 12: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/12.jpg)
Substance dark skins
SubstanceRavenGraphiteLookAndFeel
SubstanceEmeraldDuskLookAndFeel
SubstanceRavenLookAndFeel
SubstanceChallengerDeepLookAndFeel
![Page 13: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/13.jpg)
Substance saturated skins
SubstanceOfficeBlue2007LookAndFeel
SubstanceGreenMagicLookAndFeel
SubstanceFieldOfWheatLookAndFeel
SubstanceFindingNemoLookAndFeel
![Page 14: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/14.jpg)
Configuring animations
LafWidget.ANIMATION_KIND –
controls animation speed (0.5 sec for
a transition by default)
FadeConfigurationManager APIs –
to enable / disable animations
◦ On a specific control
◦ On control class (JTree, for example)
◦ Globally
![Page 15: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/15.jpg)
Custom appearance
Theme – extend SubstanceTheme or
use derivation APIs
Watermark – implement SubstanceWatermark
Skin – implement SubstanceSkin or
extend SubstanceAbstractSkin(provides basic functionality)
See existing core implementation and
test app for examples
![Page 16: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/16.jpg)
Additional UI elements
Substance provides additional “feel”
part for some Swing components
These are called widgets
Some widgets are turned on by default
Most widgets are configurable
Some widgets are not visible –
behavior only
![Page 17: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/17.jpg)
Widget examples
Menu search panel on big menus
Lock icon on non-editable text
components
Auto-completion on editable
comboboxes
Password strength checker
Tab overview panel
Tree smart scroll
![Page 18: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/18.jpg)
Substance plugins
Substance provides a plugin
mechanism for third-party components
No need to change the code – just
drop the plugin jar in the classpath
Available plugins for:
◦ NetBeans – module supports 5.0 and 5.5
◦ SwingX at https://swingx.dev.java.net
◦ Flamingo at https://flamingo.dev.java.net
![Page 19: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/19.jpg)
SwingX plugin
Provides consistent appearance
(colors, fonts, animation) for
◦ Task pane container and task panes
◦ Status bar
◦ Month view
◦ Date picker
◦ Translucency on JXPanel
More to come as SwingX matures and
reaches the first release
![Page 20: Substance Java One 2007 Community Corner](https://reader034.vdocuments.us/reader034/viewer/2022052619/5554b850b4c90559398b4915/html5/thumbnails/20.jpg)
Q&A
Visit https://substance.dev.java.net
Mail [email protected]
See http://javootoo.com for a list of
other third-party look and feels