Substance - JavaOne 2007 Community Corner

download Substance - JavaOne 2007 Community Corner

of 20

Transcript of Substance - JavaOne 2007 Community Corner

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    1/20

    Substance look and feelSubstance look and feelJavaOne 2007 Community Corner

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    2/20

    An application before SubstanceAn application before Substance

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    3/20

    Same application with SubstanceSame application with Substance

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    4/20

    Same application with SubstanceSame application with Substance

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    5/20

    Using Substance in you appUsing Substance in you app

    y Go to https://substance.dev.java.net

    y Download the latest substance.jar

    y U

    se one of the three options: UIManager.setLookAndFeel(new SubstanceLookAndFeel())

    UIManager.setLookAndFeel(

    org.jvnet.substance.SubstanceLookAndFeel)

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

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    6/20

    Substance themesSubstance themes

    y Contains information on control colorsfor different visual states (disabled, default,

    active)

    y Base class SubstanceTheme

    y Use bundled core themes

    y UseAPIs to create derived themes

    y Extend and create a custom theme

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    7/20

    Substance simple themesSubstance simple themes

    SubstanceAquaTheme SubstanceBottleGreenTheme

    SubstancePurpleTheme SubstanceOliveTheme

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    8/20

    Substance derived themesSubstance derived themes

    y Invert, negate, saturate, hue-shift andcolor-blind

    Example of hue-shift:

    SubstanceTheme theme = SubstanceLookAndFeel.getTheme();SubstanceTheme shifted = theme.hueShift(-0.5);

    SubstanceLookAndFeel.setCurrentTheme(shifted);

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    9/20

    Substance watermarksSubstance watermarks

    y Simple watermarks

    y Image-based watermarks

    SubstanceBinaryWatermark SubstanceWoodWatermark

    SubstanceImageWatermark + APP_TILE

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    10/20

    Substance skinsSubstance skins

    y A collection of various settings (theme,watermark, painters, shapers etc).

    y In org.jvnet.substance.skin

    package

    y Can set as

    SubstanceLookAndFeel.setSkin()

    Derived look and feel classes based on aspecific skin (set with UIManager or VM flag)

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    11/20

    Substance tonedSubstance toned--down skinsdown skins

    SubstanceBusinessLookAndFeel

    SubstanceCremeLookAndFeel

    SubstanceBusinessBlackSteelLookAndFeel

    SubstanceSaharaLookAndFeel

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    12/20

    Substance dark skinsSubstance dark skins

    SubstanceRavenGraphiteLookAndFeel

    SubstanceEmeraldDuskLookAndFeel

    SubstanceRavenLookAndFeel

    SubstanceChallengerDeepLookAndFeel

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    13/20

    Substance saturated skinsSubstance saturated skins

    SubstanceOfficeBlue2007LookAndFeel

    SubstanceGreenMagicLookAndFeel

    SubstanceFieldOfWheatLookAndFeel

    SubstanceFindingNemoLookAndFeel

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    14/20

    Configuring animationsConfiguring animations

    y LafWidget.ANIMATION_KIND

    controls animation speed (0.5 sec for a

    transition by default)

    y FadeConfigurationManager APIs

    to enable / disable animations

    On a specific control

    On control class (JTree, for example) Globally

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    15/20

    Custom appearanceCustom appearance

    y Theme extend SubstanceTheme or

    use derivationAPIs

    yWatermark implementSubstanceWatermark

    y Skin implement SubstanceSkin orextend SubstanceAbstractSkin

    (provides basic functionality)y See existing core implementation and test

    app for examples

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    16/20

    Additional UI elementsAdditional UI elements

    y Substance provides additional feel partfor some Swing components

    y These are called widgets

    y Some widgets are turned on by default

    y Most widgets are configurable

    y Some widgets are not visible behavior

    only

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    17/20

    Widget examplesWidget examples

    y Menu search panel on big menus

    y Lock icon on non-editable text

    components

    y Auto-completion on editablecomboboxes

    y Password strength checker

    y Tab overview panel

    y Tree smart scroll

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    18/20

    SubstanceSubstance pluginsplugins

    y Substance provides a plugin mechanismfor third-party components

    y No need to change the code just dropthe plugin jar in the classpath

    y 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

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    19/20

    SwingXSwingX pluginplugin

    y Provides consistent appearance (colors,fonts, animation) for

    Task pane container and task panes

    Status bar

    Month view

    Date picker

    Translucency on JXPanely More to come as SwingX matures and

    reaches the first release

  • 8/6/2019 Substance - JavaOne 2007 Community Corner

    20/20

    Q&AQ&A

    Visit https://substance.dev.java.net

    Mail [email protected]

    See http://javootoo.com for a list of otherthird-party look and feels