shemnon avatar shemnon committed 8c7efca

move samples into a subproject

Comments (0)

Files changed (67)

 apply plugin: 'idea'
 apply plugin: 'java'
 apply plugin: 'maven'
-apply plugin: 'application'
 
 apply from: 'mavenPublish.gradle'
-apply from: 'javafx.plugin'
 
 group = 'org.controlsfx'
 version = '8.0.3-SNAPSHOT'
 
-applicationName = 'FXSampler'
-mainClassName = "fxsampler.FXSampler"
 sourceCompatibility = '1.8'
 targetCompatibility = '1.8'
 
 configurations {
-    samples {extendsFrom mainRuntime}
     jdk
 }
 
     main {
         compileClasspath += configurations.jdk
     }
-    samples {
-        java {
-            compileClasspath += main.output
-            compileClasspath += configurations.jdk
-            compileClasspath += configurations.compile
-            runtimeClasspath += samples.output
-            runtimeClasspath += main.output
-            runtimeClasspath += configurations.jdk
-            runtimeClasspath += javadocJar.output
-            runtimeClasspath += configurations.runtime
-        }
-    }
 }
 
 dependencies {
-    samplesCompile "fxsampler:fxsampler:1.0.0-SNAPSHOT"
-    
     try {
         jdk files(jfxrtJar)
     } catch (MissingPropertyException pne) {
     }
 }
 
-// Samples should be on the class path to run FXSampler
-run {
-  classpath += sourceSets.samples.output
-}
-
 javadoc {
     exclude 'impl/*'
     failOnError = false
     exclude '**/oxygen/svg/*'
 }
 
-task samplesJar (type: Jar) {
-    classifier='samples'
-    from sourceSets.samples.output
-//    manifest {
-//        attributes(
-//            'Manifest-Version': '1.0',
-//        )
-//    }
-}
-
 task sourceJar(type: Jar) {
     from sourceSets.main.java
     from sourceSets.main.resources
 artifacts {
     archives sourceJar
     archives javadocJar
-    archives samplesJar
 }
 
-// enumerate the samples at build time
-task enumerateSamples() {
-    doLast {
-        def samplesList = []
-        sourceSets.samples.java.visit {
-            // could be improved:  we could load the class and check the hierarchy
-            if (!it.directory && it.file.text.contains(' extends SampleBase ') && it.path.contains("samples")) {
-                samplesList += it.path
-            }
-        }
-        File outputFile = new File(sourceSets.samples.output.resourcesDir, 'fxsampler/samples/samples.txt')
-        outputFile.parentFile.mkdirs()
-        outputFile.text = samplesList.join('\n')
-    }
-}
-processSamplesResources.dependsOn(enumerateSamples)
-gradle.taskGraph.whenReady {
-    enumerateSamples.enabled = gradle.taskGraph.hasTask(":jfxDeploy") 
-}
-
-
-jfxJar {
-    classpath = files(
-        (project.sourceSets.samples.compileClasspath .files
-            - project.configurations['providedCompile'].files.findAll {it.file}) 
-        + jar.archivePath            
-    )
-}
-
-javafx {
-    try {
-        jfxrtJar = ext.jfxrtJar
-    } catch (MissingPropertyException pne) {
-        // ignore
-    }
-    
-    sourceSet = 'samples'
-
-    appID 'HelloControlsFX'
-    appName 'Hello ControlsFX'
-    mainClass 'fxsampler.FXSampler'
-
-    javaRuntime = '<NO RUNTIME>' // for now don't bundle a VM
-
-    // deplpy/info attributes
-    category = 'JavaFX Demos'
-    copyright = 'Copyright (c) 2013 Jonathan Giles and others'
-    description = 'This is a sample of all of the ControlsFX controls'
-    licenseType = '3 clause BSD'
-    vendor = 'FX Experience'
-}

controlsfx-samples/build.gradle

+apply plugin: 'idea'
+apply plugin: 'java'
+apply plugin: 'maven'
+apply plugin: 'application'
+
+apply from: '../mavenPublish.gradle'
+apply from: '../javafx.plugin'
+
+group = 'org.controlsfx'
+version = '8.0.3-SNAPSHOT'
+
+applicationName = 'FXSampler'
+mainClassName = "fxsampler.FXSampler"
+sourceCompatibility = '1.8'
+targetCompatibility = '1.8'
+
+configurations {
+    jdk
+}
+
+sourceSets {
+    main {
+        compileClasspath += configurations.jdk
+    }
+}
+
+dependencies {
+    compile "org.controlsfx:fxsampler:1.0.0-SNAPSHOT"
+    compile "org.controlsfx:controlsfx:8.0.3-SNAPSHOT"
+
+    try {
+        jdk files(jfxrtJar)
+    } catch (MissingPropertyException pne) {
+        // javafx plugin will provide in this case
+    }
+}
+
+
+task sourceJar(type: Jar) {
+    from sourceSets.main.java
+    from sourceSets.main.resources
+    classifier = 'sources'
+}
+
+artifacts {
+    archives sourceJar
+    //archives javadocJar
+}
+
+// enumerate the samples at build time
+task enumerateSamples() {
+    doLast {
+        def samplesList = []
+        sourceSets.main.java.visit {
+            // could be improved:  we could load the class and check the hierarchy
+            if (!it.directory && it.file.text.contains(' extends SampleBase ') && it.path.contains("samples")) {
+                samplesList += it.path
+            }
+        }
+        println samplesList
+        File outputFile = new File(sourceSets.main.output.resourcesDir, 'fxsampler/samples/samples.txt')
+        outputFile.parentFile.mkdirs()
+        outputFile.text = samplesList.join('\n')
+    }
+}
+
+processResources.dependsOn(enumerateSamples)
+gradle.taskGraph.whenReady {
+    enumerateSamples.enabled = gradle.taskGraph.hasTask(":$project.name:jfxDeploy")
+}
+
+
+jfxJar {
+    classpath = files(
+            (project.sourceSets.main.compileClasspath .files
+                    - project.configurations['providedCompile'].files.findAll {it.file})
+                    + jar.archivePath
+    )
+}
+
+javafx {
+    try {
+        jfxrtJar = ext.jfxrtJar
+    } catch (MissingPropertyException pne) {
+        // ignore
+    }
+
+    appID 'HelloControlsFX'
+    appName 'Hello ControlsFX'
+    mainClass 'fxsampler.FXSampler'
+
+    javaRuntime = '<NO RUNTIME>' // for now don't bundle a VM
+
+    // deplpy/info attributes
+    category = 'JavaFX Demos'
+    copyright = 'Copyright (c) 2013 Jonathan Giles and others'
+    description = 'This is a sample of all of the ControlsFX controls'
+    licenseType = '3 clause BSD'
+    vendor = 'FX Experience'
+}
Add a comment to this file

controlsfx-samples/src/deploy/package/shortcut-128.png

Added
New image
Add a comment to this file

controlsfx-samples/src/deploy/package/volume-128.png

Added
New image

controlsfx-samples/src/main/java/org/controlsfx/dialog/DialogsAccessor.java

+package org.controlsfx.dialog;
+
+import org.controlsfx.dialog.Dialog;
+
+public class DialogsAccessor {
+
+    public static void setWindows(boolean b) {
+        Dialog.setWindows(b);
+    }
+    
+    public static void setMacOS(boolean b) {
+        Dialog.setMacOS(b);
+    }
+    
+    public static void setLinux(boolean b) {
+        Dialog.setLinux(b);
+    }
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloButtonBar.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import static org.controlsfx.control.ButtonBar.ButtonType.APPLY;
+import static org.controlsfx.control.ButtonBar.ButtonType.BACK_PREVIOUS;
+import static org.controlsfx.control.ButtonBar.ButtonType.CANCEL_CLOSE;
+import static org.controlsfx.control.ButtonBar.ButtonType.FINISH;
+import static org.controlsfx.control.ButtonBar.ButtonType.HELP;
+import static org.controlsfx.control.ButtonBar.ButtonType.HELP_2;
+import static org.controlsfx.control.ButtonBar.ButtonType.LEFT;
+import static org.controlsfx.control.ButtonBar.ButtonType.NEXT_FORWARD;
+import static org.controlsfx.control.ButtonBar.ButtonType.NO;
+import static org.controlsfx.control.ButtonBar.ButtonType.OK_DONE;
+import static org.controlsfx.control.ButtonBar.ButtonType.OTHER;
+import static org.controlsfx.control.ButtonBar.ButtonType.RIGHT;
+import static org.controlsfx.control.ButtonBar.ButtonType.YES;
+import javafx.application.Application;
+import javafx.beans.binding.StringBinding;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.geometry.Insets;
+import javafx.geometry.Pos;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.Label;
+import javafx.scene.control.ScrollPane;
+import javafx.scene.control.Slider;
+import javafx.scene.control.ToggleButton;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Priority;
+import javafx.scene.layout.Region;
+import javafx.scene.layout.VBox;
+import javafx.scene.paint.Color;
+import javafx.stage.Stage;
+
+import org.controlsfx.control.ButtonBar;
+import org.controlsfx.control.ButtonBar.ButtonType;
+import org.controlsfx.control.SegmentedButton;
+
+import fxsampler.Sample;
+import fxsampler.SampleBase;
+
+public class HelloButtonBar extends SampleBase {
+    
+    @Override public String getSampleName() {
+        return "ButtonBar";
+    }
+    
+    @Override public String getJavaDocURL() {
+        return Utils.JAVADOC_BASE + "org/controlsfx/control/ButtonBar.html";
+    }
+    
+    @Override public boolean isVisible() {
+        return true;
+    }
+    
+    private ToggleButton createToggle( final String caption, final ButtonBar buttonBar, final String buttonBarOrder ) {
+        final ToggleButton btn = new ToggleButton(caption);
+        btn.selectedProperty().addListener(new ChangeListener<Boolean>() {
+            @Override public void changed(ObservableValue<? extends Boolean> arg0, Boolean oldValue, Boolean newValue) {
+                if ( newValue) buttonBar.setButtonOrder(buttonBarOrder);
+            }});
+        return btn;
+    }
+    
+    
+    @Override public Node getPanel(final Stage stage) {
+        VBox root = new VBox(10);
+        root.setPadding(new Insets(10, 10, 10, 10));
+        root.setMaxHeight(Double.MAX_VALUE);
+        
+        final ButtonBar buttonBar = new ButtonBar();
+        
+        // explanation text
+        Label details = new Label("The ButtonBar allows for buttons to be positioned" +
+        		" in a way that is OS-specific (or in any way that suits your use case." +
+        		" For example, try toggling the OS toggle buttons below (note, you'll want " +
+        		"to increase the width of this window first!)\n\n");
+        details.setWrapText(true);
+        root.getChildren().add(details);
+        
+        final ToggleButton windowsBtn = createToggle("Windows", buttonBar, ButtonBar.BUTTON_ORDER_WINDOWS);
+        final ToggleButton macBtn = createToggle("Mac OS", buttonBar, ButtonBar.BUTTON_ORDER_MAC_OS);
+        final ToggleButton linuxBtn = createToggle("Linux", buttonBar, ButtonBar.BUTTON_ORDER_LINUX);
+        windowsBtn.selectedProperty().set(true);
+        
+        SegmentedButton osChoice = new SegmentedButton(FXCollections.observableArrayList(windowsBtn, macBtn, linuxBtn));
+        root.getChildren().add(osChoice);
+        VBox.setVgrow(osChoice, Priority.NEVER);
+        
+        // uniform size
+        final CheckBox uniformButtonBtn = new CheckBox("Set all buttons to a uniform size");
+        uniformButtonBtn.selectedProperty().bindBidirectional( buttonBar.buttonUniformSizeProperty());
+        root.getChildren().add( uniformButtonBtn);
+        
+        // minimum size slider / label
+        final Slider minSizeSlider = new Slider(0, 200, 0);
+        Label pixelCountLabel = new Label();
+        pixelCountLabel.textProperty().bind(new StringBinding() {
+            { bind(minSizeSlider.valueProperty()); }
+            
+            @Override protected String computeValue() {
+                return (int)minSizeSlider.getValue() + "px";
+            }
+        });
+        HBox minSizeBox = new HBox(10, new Label("Button min size:"), minSizeSlider, pixelCountLabel);
+        minSizeBox.setAlignment(Pos.BASELINE_LEFT);
+        buttonBar.buttonMinWidthProperty().bind(minSizeSlider.valueProperty());
+        root.getChildren().add(minSizeBox);
+        
+        
+        // spacer to push button bar to bottom
+        Region spacer = new Region();
+        VBox.setVgrow(spacer, Priority.ALWAYS);
+        root.getChildren().add(spacer);
+        
+        // create button bar
+        buttonBar.getButtons().addAll(
+            createButton("OK", OK_DONE),
+            createButton("Cancel", CANCEL_CLOSE),
+            createButton("Left 1", LEFT),
+            createButton("Left 2", LEFT),
+            createButton("Left 3", LEFT),
+            createButton("Right 1", RIGHT),
+            createButton("Unknown 1", OTHER),
+            createButton("Help(R)", HELP),
+            createButton("Help(L)", HELP_2),
+            createButton("Unknown 2 xxxxxxxxxx", OTHER),
+            createButton("Yes", YES),
+            createButton("No", NO),
+            createButton("Next", NEXT_FORWARD),
+            createButton("Unknown 3", OTHER),
+            createButton("Back", BACK_PREVIOUS),
+            createButton("Right 2", RIGHT),
+            createButton("Finish", FINISH),
+            createButton("Right 3", RIGHT),
+            createButton("Apply", APPLY)
+        );
+        
+        // put the ButtonBar inside a ScrollPane so that the user can scroll horizontally
+        // when the button width is large
+        ScrollPane sp = new ScrollPane(buttonBar);
+        sp.setStyle("-fx-background-color: -fx-background; -fx-background-insets: 0");
+        
+        root.getChildren().add(sp);
+        VBox.setVgrow(sp, Priority.ALWAYS);
+        
+        return root;
+    }
+    
+    @Override public void start(Stage stage) throws Exception {
+        stage.setTitle("ButtonBar Demo");
+        
+        Scene scene = new Scene((Parent)getPanel(stage), 1300, 300);
+        scene.setFill(Color.WHITE);
+        
+        stage.setScene(scene);
+        stage.show();
+    }
+     
+    private Button createButton( String title, ButtonType type) {
+        Button button = new Button(title);
+        ButtonBar.setType(button, type);
+        return button;
+    }
+    
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloGlyphFont.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import static org.controlsfx.glyphfont.GlyphFontRegistry.glyph;
+
+import java.util.Map;
+
+import javafx.application.Application;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.ToolBar;
+import javafx.scene.layout.VBox;
+import javafx.scene.paint.Color;
+import javafx.stage.Stage;
+
+import org.controlsfx.glyphfont.FontAwesome;
+import org.controlsfx.glyphfont.GlyphFont;
+import org.controlsfx.glyphfont.GlyphFontRegistry;
+
+import fxsampler.Sample;
+import fxsampler.SampleBase;
+
+public class HelloGlyphFont extends SampleBase {
+
+	private GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome");
+
+	private GlyphFont icoMoon = new GlyphFont("icomoon", 16, getClass()
+			.getResourceAsStream("icomoon.ttf")){
+
+				@Override
+				public Map<String, Character> getGlyphs() {
+					return null;
+				}};
+
+//	private static char FAW_TRASH = '\uf014';
+	private static char FAW_GEAR  = '\uf013';
+//	private static char FAW_STAR  = '\uf005';
+
+	private static char IM_BOLD        = '\ue027';
+	private static char IM_UNDERSCORED = '\ue02b';
+	private static char IM_ITALIC      = '\ue13e';
+
+	@Override
+	public String getSampleName() {
+		return "Glyph Font";
+	}
+
+	@Override
+	public String getJavaDocURL() {
+		return Utils.JAVADOC_BASE + "org/controlsfx/glyphfont/GlyphFont.html";
+	}
+	
+	@Override
+	public boolean isVisible() {
+		return true;
+	}
+
+	@Override
+	public Node getPanel(final Stage stage) {
+
+		VBox root = new VBox(10);
+		
+		root.setPadding(new Insets(10, 10, 10, 10));
+		root.setMaxHeight(Double.MAX_VALUE);
+		Label title = new Label("Using FontAwesome(CDN)");
+		root.getChildren().add(title);
+		ToolBar toolbar = new ToolBar(
+				new Button("", glyph("FontAwesome|TRASH")), 
+				new Button("", glyph("FontAwesome|STAR")),
+				new Button("", FontAwesome.Glyph.ANCHOR.create()),
+				new Button("", fontAwesome.fontColor(Color.RED).create(FAW_GEAR)) 
+        );
+		root.getChildren().add(toolbar);
+		title = new Label("Using IcoMoon (Local)");
+		root.getChildren().add(title);
+		toolbar = new ToolBar(
+				new Button("", icoMoon.fontSize(16).create(IM_BOLD)),
+				new Button("", icoMoon.fontColor(Color.GREEN).fontSize(32).create(IM_UNDERSCORED)), 
+				new Button("", icoMoon.fontSize(48).create(IM_ITALIC)));
+		root.getChildren().add(toolbar);
+		return root;
+
+	}
+
+	@Override
+	public void start(Stage stage) throws Exception {
+		stage.setTitle("Glyph Font Demo");
+
+		Scene scene = new Scene((Parent) getPanel(stage), 1300, 300);
+		scene.setFill(Color.WHITE);
+
+		stage.setScene(scene);
+		stage.show();
+	}
+
+	public static void main(String[] args) {
+		launch(args);
+	}
+
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloGridView.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import java.util.Random;
+
+import javafx.application.Application;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.ToolBar;
+import javafx.scene.image.Image;
+import javafx.scene.layout.VBox;
+import javafx.scene.paint.Color;
+import javafx.stage.Stage;
+import javafx.util.Callback;
+
+import org.controlsfx.control.GridCell;
+import org.controlsfx.control.GridView;
+import org.controlsfx.control.SegmentedButton;
+import org.controlsfx.control.action.AbstractAction;
+import org.controlsfx.control.action.ActionUtils;
+import org.controlsfx.control.cell.ColorGridCell;
+import org.controlsfx.control.cell.ImageGridCell;
+
+import fxsampler.Sample;
+import fxsampler.SampleBase;
+
+public class HelloGridView extends SampleBase {
+
+    private GridView<?> myGrid;
+    private final VBox root = new VBox();
+    
+    public static void main(String[] args) {
+        launch();
+    }
+    
+    @Override public String getSampleName() {
+        return "GridView";
+    }
+    
+    @Override public String getJavaDocURL() {
+        return Utils.JAVADOC_BASE + "org/controlsfx/control/GridView.html";
+    }
+    
+    @Override public boolean isVisible() {
+        return true;
+    }
+    
+    
+    private GridView<?> getColorGrid() {
+        final ObservableList<Color> list = FXCollections.<Color>observableArrayList();
+        
+        GridView<Color> colorGrid = new GridView<>(list);
+        
+        colorGrid.setCellFactory(new Callback<GridView<Color>, GridCell<Color>>() {
+            @Override public GridCell<Color> call(GridView<Color> arg0) {
+                return new ColorGridCell();
+            }
+        });
+        Random r = new Random(System.currentTimeMillis());
+        for(int i = 0; i < 500; i++) {
+            list.add(new Color(r.nextDouble(), r.nextDouble(), r.nextDouble(), 1.0));
+        }
+        return colorGrid;
+    }
+    
+    private GridView<?> getImageGrid( final boolean preserveImageProperties ) {
+        
+        final Image image = new Image("/org/controlsfx/samples/flowers.png", 200, 0, true, true);
+        final ObservableList<Image> list = FXCollections.<Image>observableArrayList();
+        
+        GridView<Image> colorGrid = new GridView<>(list);
+        
+        colorGrid.setCellFactory(new Callback<GridView<Image>, GridCell<Image>>() {
+            @Override public GridCell<Image> call(GridView<Image> arg0) {
+                return new ImageGridCell(preserveImageProperties);
+            }
+        });
+        for(int i = 0; i < 50; i++) {
+            list.add(image);
+        }
+        return colorGrid;
+    }    
+    
+    
+    @Override public Node getPanel(Stage stage) {
+        SegmentedButton selector = ActionUtils.createSegmentedButton(
+            new ActionShowGrid("Colors", getColorGrid()),
+            new ActionShowGrid("Images", getImageGrid(false)),
+            new ActionShowGrid("Images (preserve properties)", getImageGrid(true))
+        );
+        root.getChildren().clear();
+        root.getChildren().add(new ToolBar(selector));
+        selector.getButtons().get(0).fire();
+        return root;
+    }
+
+    @Override public void start(Stage primaryStage) throws Exception {
+        primaryStage.setTitle("GridView");
+        Scene scene = new Scene((Parent) getPanel(primaryStage), 540, 210);
+        primaryStage.setScene(scene);
+        primaryStage.show();
+    }
+    
+    class ActionShowGrid extends AbstractAction {
+
+        GridView<?> grid;
+        
+        public ActionShowGrid(String text, GridView<?> grid) {
+            super(text);
+            this.grid = grid;
+        }
+
+        @Override public void execute(ActionEvent ae) {
+            if ( myGrid != null ) {
+                root.getChildren().remove(myGrid);
+            }
+            myGrid = grid;
+            root.getChildren().add(myGrid);
+        }
+        
+    }
+    
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloHyperlinkLabel.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import javafx.application.Application;
+import javafx.beans.binding.StringBinding;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Hyperlink;
+import javafx.scene.control.TextField;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+
+import org.controlsfx.control.HyperlinkLabel;
+
+import fxsampler.Sample;
+import fxsampler.SampleBase;
+
+public class HelloHyperlinkLabel extends SampleBase {
+    
+    private HyperlinkLabel label;
+    
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+    @Override public String getSampleName() {
+        return "Hyperlink Label";
+    }
+    
+    @Override public String getJavaDocURL() {
+        return Utils.JAVADOC_BASE + "org/controlsfx/control/HyperlinkLabel.html";
+    }
+    
+    @Override public boolean isVisible() {
+        return true;
+    }
+    
+    @Override public Node getPanel(Stage stage) {
+        VBox root = new VBox(20);
+        root.setPadding(new Insets(30, 30, 30, 30));
+        
+        final TextField textToShowField = new TextField();
+        textToShowField.setMaxWidth(Double.MAX_VALUE);
+        textToShowField.setPromptText("Type text in here to display - use [] to indicate a hyperlink - e.g. [hello]");
+        root.getChildren().add(textToShowField);
+        
+        final TextField selectedLinkField = new TextField();
+        selectedLinkField.setMaxWidth(Double.MAX_VALUE);
+        selectedLinkField.setEditable(false);
+        selectedLinkField.setPromptText("Click a link - I'll show you which one you clicked :-)");
+        root.getChildren().add(selectedLinkField);
+        
+        label = new HyperlinkLabel();
+        label.textProperty().bind(new StringBinding() {
+            {
+                bind(textToShowField.textProperty());
+            }
+            
+            @Override protected String computeValue() {
+                final String str = textToShowField.getText();
+                if (str == null || str.isEmpty()) {
+                    return "Hello [world]! I [wonder] what hyperlink [you] [will] [click]";
+                }
+                return str;
+            }
+        });
+        label.setOnAction(new EventHandler<ActionEvent>() {
+            @Override public void handle(ActionEvent event) {
+                Hyperlink link = (Hyperlink)event.getSource();
+                final String str = link == null ? "" : "You clicked on '" + link.getText() + "'";
+                selectedLinkField.setText(str);
+            }
+        });
+        root.getChildren().add(label);
+        
+        return root;
+    }
+    
+    @Override public void start(Stage stage) {
+        stage.setTitle("HyperlinkLabel Demo");
+
+        Scene scene = new Scene((Parent) getPanel(stage), 520, 360);
+
+        stage.setScene(scene);
+        stage.show();
+        
+        label.requestFocus();
+    }
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloNotificationPane.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import javafx.application.Application;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.TextField;
+import javafx.scene.image.ImageView;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+
+import org.controlsfx.control.NotificationPane;
+import org.controlsfx.control.action.AbstractAction;
+
+import fxsampler.Sample;
+import fxsampler.SampleBase;
+
+public class HelloNotificationPane extends SampleBase {
+    
+    private NotificationPane notificationPane;
+    private CheckBox cbUseDarkTheme;
+    private TextField textField;
+    
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+    @Override public String getSampleName() {
+        return "Notification Pane";
+    }
+    
+    @Override public String getJavaDocURL() {
+        return Utils.JAVADOC_BASE + "org/controlsfx/control/NotificationPane.html";
+    }
+    
+    @Override public boolean isVisible() {
+        return true;
+    }
+    
+    @Override public Node getPanel(Stage stage) {
+        notificationPane = new NotificationPane();
+        
+        String imagePath = HelloNotificationPane.class.getResource("notification-pane-warning.png").toExternalForm();
+        ImageView image = new ImageView(imagePath);
+        notificationPane.setGraphic(image);
+        
+        notificationPane.getActions().addAll(new AbstractAction("Sync") {
+            @Override public void execute(ActionEvent ae) {
+                // do sync
+                
+                // then hide...
+                notificationPane.hide();
+            }
+        });
+        
+        Button showBtn = new Button("Show / Hide");
+        showBtn.setOnAction(new EventHandler<ActionEvent>() {
+            @Override public void handle(ActionEvent arg0) {
+                if (notificationPane.isShowing()) {
+                    notificationPane.hide();
+                } else {
+                    notificationPane.show();
+                }
+            }
+        });
+        
+        CheckBox cbSlideFromTop = new CheckBox("Slide from top");
+        cbSlideFromTop.setSelected(true);
+        notificationPane.showFromTopProperty().bind(cbSlideFromTop.selectedProperty());
+        
+        cbUseDarkTheme = new CheckBox("Use dark theme");
+        cbUseDarkTheme.setSelected(false);
+        cbUseDarkTheme.setOnAction(new EventHandler<ActionEvent>() {
+            @Override public void handle(ActionEvent arg0) {
+                updateBar();
+            }
+        });
+        
+        textField = new TextField();
+        textField.setPromptText("Type text to display and press Enter");
+        textField.setOnAction(new EventHandler<ActionEvent>() {
+            @Override public void handle(ActionEvent arg0) {
+                notificationPane.show(textField.getText());
+            }
+        });
+        
+        VBox root = new VBox(10);
+        root.setPadding(new Insets(50, 0, 0, 10));
+        root.getChildren().addAll(showBtn, cbSlideFromTop, cbUseDarkTheme, textField);
+        
+        notificationPane.setContent(root);
+        updateBar();
+        
+        return notificationPane;
+    }
+    
+    private void updateBar() {
+        boolean useDarkTheme = cbUseDarkTheme.isSelected();
+        
+        if (useDarkTheme) {
+            notificationPane.setText("Hello World! Using the dark theme");
+            notificationPane.getStyleClass().add(NotificationPane.STYLE_CLASS_DARK);
+        } else {
+            notificationPane.setText("Hello World! Using the light theme");
+            notificationPane.getStyleClass().remove(NotificationPane.STYLE_CLASS_DARK);
+        }
+    }
+    
+    @Override public void start(Stage stage) {
+        stage.setTitle("NotificationPane Demo");
+
+        Scene scene = new Scene((Parent) getPanel(stage), 520, 360);
+
+        stage.setScene(scene);
+        stage.show();
+    }
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloPropertySheet.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import java.time.LocalDate;
+import java.time.Month;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.concurrent.Service;
+import javafx.concurrent.Task;
+import javafx.concurrent.WorkerStateEvent;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.TextField;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+
+import org.controlsfx.control.PropertySheet;
+import org.controlsfx.control.PropertySheet.Item;
+import org.controlsfx.control.PropertySheet.Mode;
+import org.controlsfx.control.SegmentedButton;
+import org.controlsfx.control.action.AbstractAction;
+import org.controlsfx.control.action.ActionUtils;
+import org.controlsfx.property.BeanPropertyUtils;
+
+import fxsampler.SampleBase;
+
+public class HelloPropertySheet extends SampleBase {
+
+    private static Map<String,Object> customDataMap = new LinkedHashMap<>();
+    
+    static {
+        customDataMap.put("1. Name#First Name", "Jonathan");
+        customDataMap.put("1. Name#Last Name", "Giles");
+        customDataMap.put("1. Name#Birthday",  LocalDate.of(1985, Month.JANUARY, 12));
+        customDataMap.put("2. Billing Address#Address 1", "");
+        customDataMap.put("2. Billing Address#Address 2", "");
+        customDataMap.put("2. Billing Address#City", "");
+        customDataMap.put("2. Billing Address#State", "");
+        customDataMap.put("2. Billing Address#Zip", "");
+        customDataMap.put("3. Phone#Home", "123-123-1234");
+        customDataMap.put("3. Phone#Mobile", "234-234-2345");
+        customDataMap.put("3. Phone#Work", "");
+    }
+    
+    private PropertySheet propertySheet = new PropertySheet();
+    
+    public static void main(String[] args) {
+        launch();
+    }
+    
+    @Override public String getSampleName() {
+        return "Property Sheet";
+    }
+    
+    @Override
+    public String getSampleDescription() {
+        return "The PropertySheet control is useful when you want to present a number"
+                + " of properties to a user for them to edit.";
+    }
+    
+    @Override public String getJavaDocURL() {
+        return Utils.JAVADOC_BASE + "org/controlsfx/control/PropertySheet.html";
+    }
+    
+    @Override public boolean isVisible() {
+        return true;
+    }
+
+    class CustomPropertyItem implements Item {
+
+        private String key;
+        private String category, name;
+        
+        public CustomPropertyItem(String key) {
+            this.key = key;
+            String[] skey = key.split("#");
+            category = skey[0];
+            name  = skey[1];
+        }
+        
+        @Override public Class<?> getType() {
+            return customDataMap.get(key).getClass();
+        }
+
+        @Override public String getCategory() {
+            return category;
+        }
+
+        @Override public String getName() {
+            return name;
+        }
+
+        @Override public String getDescription() {
+            return null;
+        }
+
+        @Override public Object getValue() {
+            return customDataMap.get(key);
+        }
+
+        @Override public void setValue(Object value) {
+            customDataMap.put(key, value);
+        }
+        
+    }
+    
+
+    class ActionShowInPropertySheet extends AbstractAction {
+        
+        private Object bean;
+
+        public ActionShowInPropertySheet( String title, Object bean ) {
+            super(title);
+            this.bean = bean;
+        }
+        
+        private ObservableList<Item> getCustomModelProperties() {
+            ObservableList<Item> list = FXCollections.observableArrayList();
+            for (String key : customDataMap.keySet() ) {
+                list.add(new CustomPropertyItem(key));
+            }
+            return list;
+        }
+
+        @Override public void execute(ActionEvent ae) {
+            
+            // retrieving bean properties may take some time
+            // so we have to put it on separate thread to keep UI responsive
+
+            Service<?> service = new Service<ObservableList<Item>>() {
+
+                @Override protected Task<ObservableList<Item>> createTask() {
+                    return new Task<ObservableList<Item>>() {
+                        @Override protected ObservableList<Item> call() throws Exception {
+                            return bean == null? getCustomModelProperties(): BeanPropertyUtils.getProperties(bean);
+                        }
+                    };
+                }
+
+            };
+            service.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
+
+                @SuppressWarnings("unchecked") @Override public void handle(WorkerStateEvent e) {
+                    propertySheet.getItems().setAll((ObservableList<Item>) e.getSource().getValue());
+
+                }
+            });
+            service.start();
+            
+        }
+        
+    }
+    
+    @Override public Node getPanel(Stage stage) {
+        return propertySheet;
+    }
+    
+    @Override public Node getControlPanel() {
+        VBox infoPane = new VBox(10);
+        
+        Button button = new Button("Title");
+        TextField textField = new TextField();
+        SegmentedButton segmentedButton = ActionUtils.createSegmentedButton(
+                new ActionShowInPropertySheet( "Bean: Button", button ),
+                new ActionShowInPropertySheet( "Bean: TextField", textField ),
+                new ActionShowInPropertySheet( "Custom Model", null )
+            );
+        segmentedButton.getStyleClass().add(SegmentedButton.STYLE_CLASS_DARK);
+        segmentedButton.getButtons().get(0).fire();
+        
+        CheckBox toolbarModeVisible = new CheckBox("Show Mode Buttons");
+        toolbarModeVisible.selectedProperty().bindBidirectional( propertySheet.modeSwitcherVisibleProperty() );
+        
+
+        CheckBox toolbarSeacrhVisible = new CheckBox("Show Search Field");
+        toolbarSeacrhVisible.selectedProperty().bindBidirectional( propertySheet.searchBoxVisibleProperty() );
+        
+        infoPane.getChildren().add(toolbarModeVisible);
+        infoPane.getChildren().add(toolbarSeacrhVisible);
+        infoPane.getChildren().add(segmentedButton);
+        infoPane.getChildren().add(button);
+        infoPane.getChildren().add(textField);
+        
+        return infoPane;
+    }
+    
+    class ActionModeChange extends AbstractAction {
+        
+        private Mode mode;
+        
+        public ActionModeChange( String title, Mode mode ) {
+            super( title );
+            this.mode = mode;
+        }
+
+        @Override public void execute(ActionEvent ae) {
+            propertySheet.modeProperty().set(mode);
+        }
+        
+    }
+    
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloRangeSlider.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import javafx.application.Application;
+import javafx.geometry.Insets;
+import javafx.geometry.Orientation;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.TextField;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Region;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+
+import org.controlsfx.control.RangeSlider;
+
+import fxsampler.Sample;
+import fxsampler.SampleBase;
+
+public class HelloRangeSlider extends SampleBase {
+    
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+    @Override public String getSampleName() {
+        return "RangeSlider";
+    }
+    
+    @Override public String getJavaDocURL() {
+        return Utils.JAVADOC_BASE + "org/controlsfx/control/RangeSlider.html";
+    }
+    
+    @Override public boolean isVisible() {
+        return true;
+    }
+    
+    @Override public Node getPanel(Stage stage) {
+        VBox root = new VBox(15);
+        
+        Region horizontalRangeSlider = createHorizontalSlider();
+        Region verticalRangeSlider = createVerticalSlider();
+        root.getChildren().addAll(horizontalRangeSlider, verticalRangeSlider);
+        
+        return root;
+    }
+    
+    @Override public String getSampleDescription() {
+        return "The Slider control in JavaFX is great for selecting a single "
+                + "value between a min and max value, but it isn't so great for "
+                + "letting users select a range - that's where RangeSlider comes in!";
+    }
+    
+    @Override public void start(Stage stage) {
+//        setUserAgentStylesheet(STYLESHEET_CASPIAN);
+        stage.setTitle("RangeSlider Demo");
+
+        Scene scene = new Scene((Parent)getPanel(stage), 520, 360);
+
+        stage.setScene(scene);
+        stage.show();
+    }
+    
+    Region createHorizontalSlider() {
+        final TextField minField = new TextField();
+        minField.setPrefColumnCount(5);
+        final TextField maxField = new TextField();
+        maxField.setPrefColumnCount(5);
+
+        final RangeSlider hSlider = new RangeSlider(0, 100, 10, 90);
+        hSlider.setShowTickMarks(true);
+        hSlider.setShowTickLabels(true);
+        hSlider.setBlockIncrement(10);
+        hSlider.setPrefWidth(200);
+
+        minField.setText("" + hSlider.getLowValue());
+        maxField.setText("" + hSlider.getHighValue());
+
+        minField.setEditable(false);
+        minField.setPromptText("Min");
+
+        maxField.setEditable(false);
+        maxField.setPromptText("Max");
+
+        minField.textProperty().bind(hSlider.lowValueProperty().asString("%.2f"));
+        maxField.textProperty().bind(hSlider.highValueProperty().asString("%.2f"));
+
+        HBox box = new HBox(10);
+        box.getChildren().addAll(minField, hSlider, maxField);
+        box.setPadding(new Insets(20,0,0,20));
+        box.setFillHeight(false);
+
+        return box;
+    }
+    
+    
+    Region createVerticalSlider() {
+        final TextField minField = new TextField();
+        minField.setPrefColumnCount(5);
+        final TextField maxField = new TextField();
+        maxField.setPrefColumnCount(5);
+
+        final RangeSlider vSlider = new RangeSlider(0, 200, 30, 150);
+        vSlider.setOrientation(Orientation.VERTICAL);
+        vSlider.setPrefHeight(200);
+        vSlider.setBlockIncrement(10);
+        vSlider.setShowTickMarks(true);
+        vSlider.setShowTickLabels(true);
+
+        minField.setText("" + vSlider.getLowValue());
+        maxField.setText("" + vSlider.getHighValue());
+
+        minField.setEditable(false);
+        minField.setPromptText("Min");
+
+        maxField.setEditable(false);
+        maxField.setPromptText("Max");
+
+        minField.textProperty().bind(vSlider.lowValueProperty().asString("%.2f"));
+        maxField.textProperty().bind(vSlider.highValueProperty().asString("%.2f"));
+
+        VBox box = new VBox(10);
+        box.setPadding(new Insets(0,0,0, 20));
+//        box.setAlignment(Pos.CENTER);
+        box.setFillWidth(false);
+        box.getChildren().addAll(maxField, vSlider, minField);
+        return box;
+    }
+    
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloRating.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.geometry.Insets;
+import javafx.geometry.Orientation;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+
+import org.controlsfx.control.Rating;
+
+import fxsampler.SampleBase;
+
+public class HelloRating extends SampleBase {
+    
+    private Rating rating;
+    
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+    @Override public String getSampleName() {
+        return "Rating";
+    }
+    
+    @Override public String getJavaDocURL() {
+        return Utils.JAVADOC_BASE + "org/controlsfx/control/Rating.html";
+    }
+    
+    @Override public String getSampleDescription() {
+        return "TODO";
+    }
+    
+    
+    @Override public Node getPanel(Stage stage) {
+        VBox root = new VBox(20);
+        root.setPadding(new Insets(30, 30, 30, 30));
+        rating = new Rating();
+        root.getChildren().addAll(rating);
+        
+        rating.ratingProperty().addListener(new ChangeListener<Number>() {
+            @Override public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
+                System.out.println("Rating = " + t1);
+            }
+        });
+        
+        return root;
+    }
+    
+    @Override public Node getControlPanel() {
+        VBox root = new VBox(20);
+        root.setPadding(new Insets(30, 30, 30, 30));
+        
+        // controls, row 1
+        HBox controls_row1 = new HBox(5);
+        ChoiceBox<Orientation> orientation = new ChoiceBox<Orientation>(FXCollections.observableArrayList(Orientation.values()));
+        orientation.getSelectionModel().select(Orientation.HORIZONTAL);
+        rating.orientationProperty().bind(orientation.getSelectionModel().selectedItemProperty());
+        
+        ChoiceBox<Double> ratingValue = new ChoiceBox<Double>(FXCollections.observableArrayList(0D, 1D, 2D, 3D, 4D, 5D, 6D, 7D, 8D, 9D, 10D));
+        ratingValue.getSelectionModel().select(rating.getRating());
+//        rating.ratingProperty().bind(ratingValue.getSelectionModel().selectedItemProperty());
+        
+        ChoiceBox<Integer> maxValue = new ChoiceBox<Integer>(FXCollections.observableArrayList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+        maxValue.getSelectionModel().select(rating.getMax());
+        rating.maxProperty().bind(maxValue.getSelectionModel().selectedItemProperty());
+        
+        controls_row1.getChildren().addAll(orientation, ratingValue, maxValue);
+        
+        // controls, row 2
+        CheckBox partialRating = new CheckBox("Allow partial ratings");
+        partialRating.selectedProperty().bindBidirectional(rating.partialRatingProperty());
+        
+        // controls, row 3
+        CheckBox updateOnHover = new CheckBox("Update rating on hover");
+        updateOnHover.selectedProperty().bindBidirectional(rating.updateOnHoverProperty());
+        
+        root.getChildren().addAll(controls_row1, partialRating, updateOnHover);
+        
+        return root;
+    }
+    
+    @Override public void start(Stage stage) {
+        stage.setTitle("Rating Demo");
+
+        Scene scene = new Scene((Parent) getPanel(stage), 520, 360);
+
+        stage.setScene(scene);
+        stage.show();
+    }
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloSegmentedButton.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.controlsfx.samples;
+
+import javafx.application.Application;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.control.ToggleButton;
+import javafx.scene.control.ToggleGroup;
+import javafx.scene.layout.GridPane;
+import javafx.scene.layout.HBox;
+import javafx.stage.Stage;
+
+import org.controlsfx.control.SegmentedButton;
+
+import fxsampler.Sample;
+import fxsampler.SampleBase;
+
+public class HelloSegmentedButton extends SampleBase {
+    
+    @Override public String getSampleName() {
+        return "SegmentedButton";
+    }
+    
+    @Override public String getJavaDocURL() {
+        return Utils.JAVADOC_BASE + "org/controlsfx/control/SegmentedButton.html";
+    }
+    
+    @Override public boolean isVisible() {
+        return true;
+    }
+    
+    @Override public Node getPanel(Stage stage) {
+        GridPane grid = new GridPane();
+        grid.setVgap(10);
+        grid.setHgap(10);
+        grid.setPadding(new Insets(30, 30, 0, 30));
+        
+        // without segmented button
+        grid.add(new Label("Without SegmentedButton (with 10px spacing): "), 0, 0);
+        
+        ToggleButton without_b1 = new ToggleButton("day"); 
+        ToggleButton without_b2 = new ToggleButton("week");
+        ToggleButton without_b3 = new ToggleButton("month");
+        ToggleButton without_b4 = new ToggleButton("year");
+        
+        final ToggleGroup group = new ToggleGroup();
+        group.getToggles().addAll(without_b1, without_b2, without_b3, without_b4);
+        
+        HBox toggleButtons = new HBox(without_b1, without_b2, without_b3, without_b4);
+        toggleButtons.setSpacing(10);
+        grid.add(toggleButtons, 1, 0);
+        
+        
+        // Using modena segmented button
+        grid.add(new Label("With SegmentedButton (with default (modena) styling): "), 0, 1);
+        
+        ToggleButton modena_b1 = new ToggleButton("day");
+        ToggleButton modena_b2 = new ToggleButton("week");
+        ToggleButton modena_b3 = new ToggleButton("month");
+        ToggleButton modena_b4 = new ToggleButton("year");
+        SegmentedButton segmentedButton_modena = new SegmentedButton(modena_b1, modena_b2, modena_b3, modena_b4); 
+        grid.add(segmentedButton_modena, 1, 1);
+        
+        
+        // with segmented button and dark styling
+        grid.add(new Label("With SegmentedButton (using dark styling): "), 0, 2);
+        
+        ToggleButton dark_b1 = new ToggleButton("day");
+        ToggleButton dark_b2 = new ToggleButton("week");
+        ToggleButton dark_b3 = new ToggleButton("month");
+        ToggleButton dark_b4 = new ToggleButton("year");
+        
+        SegmentedButton segmentedButton_dark = new SegmentedButton(dark_b1, dark_b2, dark_b3, dark_b4);   
+        segmentedButton_dark.getStyleClass().add(SegmentedButton.STYLE_CLASS_DARK);
+        grid.add(segmentedButton_dark, 1, 2);
+        
+
+        return grid;
+    }
+    
+    @Override public void start(Stage stage) throws Exception {
+        stage.setTitle("SegmentedButton Demo");
+        
+        
+        Scene scene = new Scene((Parent) getPanel(stage), 350, 150);
+//        scene.getStylesheets().addAll(SegmentedButton.class.getResource("segmentedbutton.css").toExternalForm());
+        stage.setScene(scene);
+        stage.show();
+    }
+    
+    public static void main(String[] args) {
+        launch(args);
+    }
+    
+}

controlsfx-samples/src/main/java/org/controlsfx/samples/HelloSpreadsheetView.java

+/**
+ * Copyright (c) 2013, ControlsFX
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *     * Neither the name of ControlsFX, any associated website, nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.controlsfx.samples;
+
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javafx.application.Application;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.control.Label;
+import javafx.scene.layout.BorderPane;
+import javafx.scene.layout.GridPane;
+import javafx.stage.Stage;
+
+import org.controlsfx.control.spreadsheet.GridBase;
+import org.controlsfx.control.spreadsheet.SpreadsheetCell;
+import org.controlsfx.control.spreadsheet.SpreadsheetCellType;
+import org.controlsfx.control.spreadsheet.SpreadsheetView;
+
+import fxsampler.Sample;
+import fxsampler.SampleBase;
+
+/**
+ *
+ * Build the UI and launch the Application
+ */
+public class HelloSpreadsheetView extends SampleBase {
+
+	public static void main(String[] args) {
+		launch(args);
+	}
+
+	@Override
+	public String getSampleName() {
+		return "SpreadsheetView";
+	}
+
+	@Override
+	public Node getPanel(Stage stage) {
+		BorderPane borderPane = new BorderPane();
+		
+		int rowCount = 50;
+		int columnCount = 10;
+		GridBase grid = new GridBase(rowCount, columnCount);
+		normalGrid(grid);
+		buildBothGrid(grid);
+
+		SpreadsheetView spreadSheetView = new SpreadsheetView(grid);
+		
+		borderPane.setCenter(spreadSheetView);
+
+		borderPane.setLeft(buildCommonControlGrid(spreadSheetView, borderPane,"Both"));
+		
+		return borderPane;
+	}
+