1. Introduction

WeatherIcons gives you scalable vector icons. This plugin enables toolkit specific icon support.

Currently supported WeatherIcons version is 2.0.1.

WeatherIcons Font by Lukas Bischoff and Erik Flowers

Font License: SIL OFL 1.1 (http://scripts.sil.org/OFL)
Applies to all font files

Code License: MIT (http://opensource.org/licenses/mit-license.html)
Applies to icons and artwork

Griffon version: 2.3.0

2. Usage

2.1. Swing

The griffon-weathericons-swing:2.1.0 JAR provides a new Icon class: griffon.swing.support.weathericons.WeatherIcon. You may use this class with any Swing component that supports an Icon property.

2.2. JavaFX

The griffon-weathericons-javafx:2.1.0 JAR provides a new Node class: griffon.javafx.support.weathericons.WeatherIcon. You may use this class with any JavaFX control that accepts a graphic property. You may also use the icon directly as it is a subclass of javafx.scene.control.Label. The icon class can be used inside an FXML file too.

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.GridPane?>
<?import griffon.javafx.support.weathericons.WeatherIcon?>

<GridPane prefHeight="60.0" prefWidth="200.0"
          xmlns:fx="http://javafx.com/fxml"
          fx:controller="org.example.AppController">
    <children>
        <Button fx:id="preferencesActionTarget"
                GridPane.columnIndex="0" GridPane.rowIndex="0"
                mnemonicParsing="false"
                prefWidth="200.0">
            <graphic>
                <WeatherIcon weatherIcon="WI_WINDY" iconSize="64"/>
            </graphic>
        </Button>
    </children>
</GridPane>

The JavaFX icon requires the usage of the WeatherIcon enum value.

2.3. Action Resources

Action icons can be set using resources files if the following format is used:

iconClassName|name:size:color

size and color are optional.

Here’s an example using the Swing icon

griffon-app/i18n/messages.properties
org.example.AppController.action.Preferences.small_icon=griffon.swing.support.weathericons.WeatherIcon|wi-windy:64

The JavaFX version for the same icon value is

griffon-app/i18n/messages.properties
org.example.AppController.action.Preferences.icon=griffon.javafx.support.weathericons.WeatherIcon|wi-windy:64

3. Configuration

The plugin delivers artifacts for both Swing and JavaFX. It also contains Groovy enhancements that can be used in combination with the respective UI toolkit DSL (SwingBuilder and GroovyFX).

3.1. Gradle

You have two options for configuring this plugin: automatic and manual.

3.1.1. Automatic

As long as the project has the org.codehaus.griffon.griffon plugin applied to it you may include the following snippet in build.gradle

dependencies {
    griffon 'org.codehaus.griffon.plugins:griffon-weathericons-plugin:2.1.0'
}

The griffon plugin will take care of the rest given its configuration.

3.1.2. Manual

You will need to configure any of the following blocks depending on your setup

Java + Swing
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-weathericons-swing:2.1.0'
}
Java + JavaFX
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-weathericons-javafx:2.1.0'
}
Groovy + Swing
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-weathericons-swing-groovy:2.1.0'
}
Groovy + JavaFX
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-weathericons-javafx-groovy:2.1.0'
}

3.2. Maven

First configure the griffon-weathericons-plugin BOM in your POM file, by placing the following snippet before the <build> element

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.griffon.plugins</groupId>
            <artifactId>griffon-weathericons-plugin</artifactId>
            <version>2.1.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Next configure dependencies as required by your particular setup

Java + Swing
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-weathericons-swing</artifactId>
</dependency>
Java + JavaFX
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-weathericons-javafx</artifactId>
</dependency>
Groovy + Swing
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-weathericons-swing-groovy</artifactId>
</dependency>
Groovy + JavaFX
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-weathericons-javafx-groovy</artifactId>
</dependency>

4. Modules

The following sections display all bindings per module. Use this information to successfully override a binding on your own modules or to troubleshoot a module binding if the wrong type has been applied by the Griffon runtime.

4.1. JavaFX

Module name: weathericons-javafx-groovy

Depends on: javafx-groovy

bind(BuilderCustomizer.class)
    .to(WeatherIconsJavaFXBuilderCustomizer.class)
    .asSingleton();

The following nodes will become available on a Groovy View

Node Type

weatherIcon

griffon.javafx.support.weathericons.WeatherIcon

4.2. Swing

Module name: weathericons-swing-groovy

Depends on: swing-groovy

bind(BuilderCustomizer.class)
    .to(WeatherIconsSwingBuilderCustomizer.class)
    .asSingleton();

The following nodes will become available on a Groovy View

Node Type

weatherIcon

griffon.swing.support.weathericons.WeatherIcon

6. Icon Cheat Sheet

The following tables show all available icons.

Enum Name Icon

WI_ALIEN

wi-alien

WI_BAROMETER

wi-barometer

WI_CELSIUS

wi-celsius

WI_CLOUD

wi-cloud

WI_CLOUDY

wi-cloudy

WI_CLOUDY_GUSTS

wi-cloudy-gusts

WI_CLOUDY_WINDY

wi-cloudy-windy

WI_CLOUD_DOWN

wi-cloud-down

WI_CLOUD_REFRESH

wi-cloud-refresh

WI_CLOUD_UP

wi-cloud-up

WI_DAY_CLOUDY

wi-day-cloudy

WI_DAY_CLOUDY_GUSTS

wi-day-cloudy-gusts

WI_DAY_CLOUDY_HIGH

wi-day-cloudy-high

WI_DAY_CLOUDY_WINDY

wi-day-cloudy-windy

WI_DAY_FOG

wi-day-fog

WI_DAY_HAIL

wi-day-hail

WI_DAY_HAZE

wi-day-haze

WI_DAY_LIGHTNING

wi-day-lightning

WI_DAY_LIGHT_WIND

wi-day-light-wind

WI_DAY_RAIN

wi-day-rain

WI_DAY_RAIN_MIX

wi-day-rain-mix

WI_DAY_RAIN_WIND

wi-day-rain-wind

WI_DAY_SHOWERS

wi-day-showers

WI_DAY_SLEET

wi-day-sleet

WI_DAY_SLEET_STORM

wi-day-sleet-storm

WI_DAY_SNOW

wi-day-snow

WI_DAY_SNOW_THUNDERSTORM

wi-day-snow-thunderstorm

WI_DAY_SNOW_WIND

wi-day-snow-wind

WI_DAY_SPRINKLE

wi-day-sprinkle

WI_DAY_STORM_SHOWERS

wi-day-storm-showers

WI_DAY_SUNNY

wi-day-sunny

WI_DAY_SUNNY_OVERCAST

wi-day-sunny-overcast

WI_DAY_THUNDERSTORM

wi-day-thunderstorm

WI_DAY_WINDY

wi-day-windy

WI_DEGREES

wi-degrees

WI_DIRECTION_DOWN

wi-direction-down

WI_DIRECTION_DOWN_LEFT

wi-direction-down-left

WI_DIRECTION_DOWN_RIGHT

wi-direction-down-right

WI_DIRECTION_LEFT

wi-direction-left

WI_DIRECTION_RIGHT

wi-direction-right

WI_DIRECTION_UP

wi-direction-up

WI_DIRECTION_UP_LEFT

wi-direction-up-left

WI_DIRECTION_UP_RIGHT

wi-direction-up-right

WI_DUST

wi-dust

WI_EARTHQUAKE

wi-earthquake

WI_FAHRENHEIT

wi-fahrenheit

WI_FIRE

wi-fire

WI_FLOOD

wi-flood

WI_FOG

wi-fog

WI_GALE_WARNING

wi-gale-warning

WI_HAIL

wi-hail

WI_HORIZON

wi-horizon

WI_HORIZON_ALT

wi-horizon-alt

WI_HOT

wi-hot

WI_HUMIDITY

wi-humidity

WI_HURRICANE

wi-hurricane

WI_HURRICANE_WARNING

wi-hurricane-warning

WI_LIGHTNING

wi-lightning

WI_LUNAR_ECLIPSE

wi-lunar-eclipse

WI_METEOR

wi-meteor

WI_MOONRISE

wi-moonrise

WI_MOONSET

wi-moonset

WI_MOON_FULL

wi-moon-full

WI_MOON_NEW

wi-moon-new

WI_MOON_WANING_CRESCENT_1

wi-moon-waning-crescent-1

WI_MOON_WANING_CRESCENT_2

wi-moon-waning-crescent-2

WI_MOON_WANING_CRESCENT_3

wi-moon-waning-crescent-3

WI_MOON_WANING_CRESCENT_4

wi-moon-waning-crescent-4

WI_MOON_WANING_CRESCENT_5

wi-moon-waning-crescent-5

WI_MOON_WANING_CRESCENT_6

wi-moon-waning-crescent-6

WI_MOON_WANING_GIBBOUS_1

wi-moon-waning-gibbous-1

WI_MOON_WANING_GIBBOUS_2

wi-moon-waning-gibbous-2

WI_MOON_WANING_GIBBOUS_3

wi-moon-waning-gibbous-3

WI_MOON_WANING_GIBBOUS_4

wi-moon-waning-gibbous-4

WI_MOON_WANING_GIBBOUS_5

wi-moon-waning-gibbous-5

WI_MOON_WANING_GIBBOUS_6

wi-moon-waning-gibbous-6

WI_MOON_WAXING_CRESENT_1

wi-moon-waxing-cresent-1

WI_MOON_WAXING_CRESENT_2

wi-moon-waxing-cresent-2

WI_MOON_WAXING_CRESENT_3

wi-moon-waxing-cresent-3

WI_MOON_WAXING_CRESENT_4

wi-moon-waxing-cresent-4

WI_MOON_WAXING_CRESENT_5

wi-moon-waxing-cresent-5

WI_MOON_WAXING_CRESENT_6

wi-moon-waxing-cresent-6

WI_MOON_WAXING_GIBBOUS_1

wi-moon-waxing-gibbous-1

WI_MOON_WAXING_GIBBOUS_2

wi-moon-waxing-gibbous-2

WI_MOON_WAXING_GIBBOUS_3

wi-moon-waxing-gibbous-3

WI_MOON_WAXING_GIBBOUS_4

wi-moon-waxing-gibbous-4

WI_MOON_WAXING_GIBBOUS_5

wi-moon-waxing-gibbous-5

WI_MOON_WAXING_GIBBOUS_6

wi-moon-waxing-gibbous-6

WI_NA

wi-na

WI_NIGHT_ALT_CLOUDY

wi-night-alt-cloudy

WI_NIGHT_ALT_CLOUDY_GUSTS

wi-night-alt-cloudy-gusts

WI_NIGHT_ALT_CLOUDY_HIGH

wi-night-alt-cloudy-high

WI_NIGHT_ALT_CLOUDY_WINDY

wi-night-alt-cloudy-windy

WI_NIGHT_ALT_HAIL

wi-night-alt-hail

WI_NIGHT_ALT_LIGHTNING

wi-night-alt-lightning

WI_NIGHT_ALT_PARTLY_CLOUDY

wi-night-alt-partly-cloudy

WI_NIGHT_ALT_RAIN

wi-night-alt-rain

WI_NIGHT_ALT_RAIN_MIX

wi-night-alt-rain-mix

WI_NIGHT_ALT_RAIN_WIND

wi-night-alt-rain-wind

WI_NIGHT_ALT_SHOWERS

wi-night-alt-showers

WI_NIGHT_ALT_SLEET

wi-night-alt-sleet

WI_NIGHT_ALT_SLEET_STORM

wi-night-alt-sleet-storm

WI_NIGHT_ALT_SNOW

wi-night-alt-snow

WI_NIGHT_ALT_SNOW_THUNDERSTORM

wi-night-alt-snow-thunderstorm

WI_NIGHT_ALT_SNOW_WIND

wi-night-alt-snow-wind

WI_NIGHT_ALT_SPRINKLE

wi-night-alt-sprinkle

WI_NIGHT_ALT_STORM_SHOWERS

wi-night-alt-storm-showers

WI_NIGHT_ALT_THUNDERSTORM

wi-night-alt-thunderstorm

WI_NIGHT_CLEAR

wi-night-clear

WI_NIGHT_CLOUDY

wi-night-cloudy

WI_NIGHT_CLOUDY_GUSTS

wi-night-cloudy-gusts

WI_NIGHT_CLOUDY_HIGH

wi-night-cloudy-high

WI_NIGHT_CLOUDY_WINDY

wi-night-cloudy-windy

WI_NIGHT_FOG

wi-night-fog

WI_NIGHT_HAIL

wi-night-hail

WI_NIGHT_LIGHTNING

wi-night-lightning

WI_NIGHT_PARTLY_CLOUDY

wi-night-partly-cloudy

WI_NIGHT_RAIN

wi-night-rain

WI_NIGHT_RAIN_MIX

wi-night-rain-mix

WI_NIGHT_RAIN_WIND

wi-night-rain-wind

WI_NIGHT_SHOWERS

wi-night-showers

WI_NIGHT_SLEET

wi-night-sleet

WI_NIGHT_SLEET_STORM

wi-night-sleet-storm

WI_NIGHT_SNOW

wi-night-snow

WI_NIGHT_SNOW_THUNDERSTORM

wi-night-snow-thunderstorm

WI_NIGHT_SNOW_WIND

wi-night-snow-wind

WI_NIGHT_SPRINKLE

wi-night-sprinkle

WI_NIGHT_STORM_SHOWERS

wi-night-storm-showers

WI_NIGHT_THUNDERSTORM

wi-night-thunderstorm

WI_RAIN

wi-rain

WI_RAINDROP

wi-raindrop

WI_RAINDROPS

wi-raindrops

WI_RAIN_MIX

wi-rain-mix

WI_RAIN_WIND

wi-rain-wind

WI_REFRESH

wi-refresh

WI_REFRESH_ALT

wi-refresh-alt

WI_SANDSTORM

wi-sandstorm

WI_SHOWERS

wi-showers

WI_SLEET

wi-sleet

WI_SMALL_CRAFT_ADVISORY

wi-small-craft-advisory

WI_SMOG

wi-smog

WI_SMOKE

wi-smoke

WI_SNOW

wi-snow

WI_SNOWFLAKE_COLD

wi-snowflake-cold

WI_SNOW_WIND

wi-snow-wind

WI_SOLAR_ECLIPSE

wi-solar-eclipse

WI_SPRINKLE

wi-sprinkle

WI_STARS

wi-stars

WI_STORM_SHOWERS

wi-storm-showers

WI_STORM_WARNING

wi-storm-warning

WI_STRONG_WIND

wi-strong-wind

WI_SUNRISE

wi-sunrise

WI_SUNSET

wi-sunset

WI_THERMOMETER

wi-thermometer

WI_THERMOMETER_EXTERIOR

wi-thermometer-exterior

WI_THERMOMETER_INTERNAL

wi-thermometer-internal

WI_THUNDERSTORM

wi-thunderstorm

WI_TIME_1

wi-time-1

WI_TIME_10

wi-time-10

WI_TIME_11

wi-time-11

WI_TIME_12

wi-time-12

WI_TIME_2

wi-time-2

WI_TIME_3

wi-time-3

WI_TIME_4

wi-time-4

WI_TIME_5

wi-time-5

WI_TIME_6

wi-time-6

WI_TIME_7

wi-time-7

WI_TIME_8

wi-time-8

WI_TIME_9

wi-time-9

WI_TORNADO

wi-tornado

WI_TRAIN

wi-train

WI_TSUNAMI

wi-tsunami

WI_UMBRELLA

wi-umbrella

WI_VOLCANO

wi-volcano

WI_WINDY

wi-windy

WI_WIND_BEAUFORT_0

wi-wind-beaufort-0

WI_WIND_BEAUFORT_1

wi-wind-beaufort-1

WI_WIND_BEAUFORT_10

wi-wind-beaufort-10

WI_WIND_BEAUFORT_11

wi-wind-beaufort-11

WI_WIND_BEAUFORT_12

wi-wind-beaufort-12

WI_WIND_BEAUFORT_2

wi-wind-beaufort-2

WI_WIND_BEAUFORT_3

wi-wind-beaufort-3

WI_WIND_BEAUFORT_4

wi-wind-beaufort-4

WI_WIND_BEAUFORT_5

wi-wind-beaufort-5

WI_WIND_BEAUFORT_6

wi-wind-beaufort-6

WI_WIND_BEAUFORT_7

wi-wind-beaufort-7

WI_WIND_BEAUFORT_8

wi-wind-beaufort-8

WI_WIND_BEAUFORT_9

wi-wind-beaufort-9

WI_WIND_DIRECTION

wi-wind-direction