substance look and feel

20
Substance look and feel JavaOne 2007 Community Corner

Upload: kasper-edwards

Post on 01-Jan-2016

47 views

Category:

Documents


0 download

DESCRIPTION

Substance look and feel. JavaOne 2007 Community Corner. An application before Substance. Same application with Substance. Same application with Substance. Using Substance in you app. Go to https://substance.dev.java.net Download the latest substance.jar Use one of the three options: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Substance look and feel

Substance look and feelJavaOne 2007 Community Corner

Page 2: Substance look and feel

An application before Substance

Page 3: Substance look and feel

Same application with Substance

Page 4: Substance look and feel

Same application with Substance

Page 5: Substance look and feel

Using Substance in you appGo to

https://substance.dev.java.netDownload the latest substance.jarUse one of the three options:

◦ UIManager.setLookAndFeel( new SubstanceLookAndFeel())

◦ UIManager.setLookAndFeel( “org.jvnet.substance.SubstanceLookAndFeel”)

◦ -Dswing.defaultlaf= org.jvnet.substance.SubstanceLookAndFeel

Page 6: Substance look and feel

Substance themesContains information on control

colors for different visual states (disabled, default, active)

Base class – SubstanceThemeUse bundled core themesUse APIs to create derived

themesExtend and create a custom

theme

Page 7: Substance look and feel

Substance simple themes

SubstanceAquaTheme SubstanceBottleGreenTheme

SubstancePurpleTheme SubstanceOliveTheme

Page 8: Substance look and feel

Substance derived themesInvert, negate, saturate, hue-shift

and color-blindExample of hue-shift:SubstanceTheme theme = SubstanceLookAndFeel.getTheme();SubstanceTheme shifted = theme.hueShift(-0.5);SubstanceLookAndFeel.setCurrentTheme(shifted);

Page 9: Substance look and feel

Substance watermarksSimple watermarksImage-based watermarks

SubstanceBinaryWatermark SubstanceWoodWatermark

SubstanceImageWatermark + APP_TILE

Page 10: Substance look and feel

Substance skinsA collection of various settings

(theme, watermark, painters, shapers etc).

In org.jvnet.substance.skin package

Can set as◦SubstanceLookAndFeel.setSkin(…)◦Derived look and feel classes based

on a specific skin (set with UIManager or VM flag)

Page 11: Substance look and feel

Substance toned-down skins

SubstanceBusinessLookAndFeel

SubstanceCremeLookAndFeel

SubstanceBusinessBlackSteelLookAndFeel

SubstanceSaharaLookAndFeel

Page 12: Substance look and feel

Substance dark skins

SubstanceRavenGraphiteLookAndFeel

SubstanceEmeraldDuskLookAndFeel

SubstanceRavenLookAndFeel

SubstanceChallengerDeepLookAndFeel

Page 13: Substance look and feel

Substance saturated skins

SubstanceOfficeBlue2007LookAndFeel

SubstanceGreenMagicLookAndFeel

SubstanceFieldOfWheatLookAndFeel

SubstanceFindingNemoLookAndFeel

Page 14: Substance look and feel

Configuring animationsLafWidget.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 look and feel

Custom appearanceTheme – extend SubstanceTheme

or use derivation APIsWatermark – implement SubstanceWatermark

Skin – implement SubstanceSkin or extend SubstanceAbstractSkin (provides basic functionality)

See existing core implementation and test app for examples

Page 16: Substance look and feel

Additional UI elementsSubstance provides additional

“feel” part for some Swing components

These are called widgetsSome widgets are turned on by

defaultMost widgets are configurableSome widgets are not visible –

behavior only

Page 17: Substance look and feel

Widget examplesMenu search panel on big menusLock icon on non-editable text

componentsAuto-completion on editable

comboboxesPassword strength checkerTab overview panelTree smart scroll

Page 18: Substance look and feel

Substance pluginsSubstance 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 look and feel

SwingX pluginProvides 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 look and feel

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