├── .gitignore ├── FXRibbon-samples ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── pixelduke │ │ └── control │ │ ├── ChangeAccentColorSample.java │ │ ├── ChangeStyleRibbonInCSSFileSample.java │ │ ├── CompleteRibbonSample.java │ │ ├── QuickAccessBarSample.java │ │ ├── RibbonCreatedThroughFXMLSample.java │ │ ├── RibbonGroupWithMenuButtonSample.java │ │ ├── RibbonWithGroupSample.java │ │ └── RibbonWithGroupsSample.java │ └── resources │ └── com │ └── pixelduke │ └── control │ ├── CompleteRibbonFXML.fxml │ ├── RibbonFXML.fxml │ ├── icons8_Bold_32px.png │ ├── icons8_Bold_48px.png │ ├── icons8_Change_Theme_16px.png │ ├── icons8_Change_Theme_48px.png │ ├── icons8_File_32px_1.png │ ├── icons8_File_48px_1.png │ ├── icons8_Globe_32px.png │ ├── icons8_Globe_48px.png │ ├── icons8_Help_32px.png │ ├── icons8_Help_48px.png │ ├── icons8_Info_32px.png │ ├── icons8_Info_48px.png │ ├── icons8_Italic_32px.png │ ├── icons8_Italic_48px.png │ ├── icons8_Location_16px.png │ ├── icons8_Location_48px.png │ ├── icons8_Lock_16px.png │ ├── icons8_Lock_48px.png │ ├── icons8_Open_32px_3.png │ ├── icons8_Open_48px_3.png │ ├── icons8_Redo_16px.png │ ├── icons8_Redo_48px.png │ ├── icons8_Save_16px.png │ ├── icons8_Save_32px.png │ ├── icons8_Save_48px.png │ ├── icons8_Save_as_32px.png │ ├── icons8_Save_as_48px.png │ ├── icons8_Underline_32px.png │ ├── icons8_Underline_48px.png │ ├── icons8_Undo_16px.png │ ├── icons8_Undo_48px.png │ ├── ribbon_sample.css │ └── util │ ├── fa-regular-400.ttf │ └── fontawesome-webfont.ttf ├── FXRibbon ├── build.gradle └── src │ └── main │ ├── java │ ├── com │ │ └── pixelduke │ │ │ └── control │ │ │ ├── Ribbon.java │ │ │ └── ribbon │ │ │ ├── Column.java │ │ │ ├── QuickAccessBar.java │ │ │ ├── RibbonGroup.java │ │ │ ├── RibbonItem.java │ │ │ └── RibbonTab.java │ └── impl │ │ └── com │ │ └── pixelduke │ │ └── skin │ │ ├── RibbonSkin.java │ │ └── ribbon │ │ ├── QuickAccessBarSkin.java │ │ ├── RibbonGroupSkin.java │ │ └── RibbonItemSkin.java │ └── resources │ └── com │ └── pixelduke │ └── control │ └── fxribbon.css ├── README.md ├── Ribbon.png ├── build.gradle ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Package Files # 4 | *.jar 5 | *.war 6 | *.ear 7 | 8 | # OS generated files # 9 | .DS_Store 10 | .DS_Store? 11 | ._* 12 | .Spotlight-V100 13 | .Trashes 14 | ehthumbs.db 15 | Thumbs.db 16 | 17 | # Scene builder backup files 18 | *.bak 19 | 20 | # ScenicView files 21 | scenicView.properties 22 | 23 | # windows thumbnail files 24 | *.db 25 | 26 | # Intellij IDEA files 27 | .idea/ 28 | *.iml 29 | 30 | # Intellij IDEA output dir 31 | out/ 32 | 33 | # Intellij user files 34 | .idea/workspace.xml 35 | tasks.xml 36 | 37 | # Scenic View auxiliary file 38 | scenicView.properties 39 | 40 | # libraries includind JUnit and ScenicView 41 | lib/ 42 | 43 | # Gradle 44 | .gradle/ 45 | .nb-gradle/ 46 | 47 | # Gradle output dir 48 | build/ 49 | -------------------------------------------------------------------------------- /FXRibbon-samples/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | 3 | mainClassName = 'com.pixelduke.control.AdvancedRibbon2Test' 4 | 5 | dependencies { 6 | compile project(':fxribbon') 7 | // compile name: 'ScenicView' 8 | compile 'org.jfxtras:jmetro:4.6' 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | // flatDir { 14 | // dirs 'lib' 15 | // } 16 | } 17 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/java/com/pixelduke/control/ChangeAccentColorSample.java: -------------------------------------------------------------------------------- 1 | package com.pixelduke.control; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | import jfxtras.styles.jmetro8.JMetro; 9 | 10 | import java.net.URL; 11 | 12 | public class ChangeAccentColorSample extends Application { 13 | private static final String RESOURCE = "CompleteRibbonFXML.fxml"; 14 | 15 | @Override 16 | public void start(Stage primaryStage) throws Exception 17 | { 18 | URL resource = ChangeAccentColorSample.class.getResource(RESOURCE); 19 | Parent root = FXMLLoader.load(resource); 20 | 21 | Ribbon ribbon = (Ribbon) root.lookup(".ribbon"); 22 | ribbon.setStyle("ACCENT_COLOR: #10893e"); // A green color 23 | 24 | Scene scene = new Scene(root); 25 | 26 | // ScenicView.show(scene); 27 | new JMetro(JMetro.Style.LIGHT).applyTheme(scene); 28 | 29 | 30 | primaryStage.setMaximized(true); 31 | primaryStage.setScene(scene); 32 | primaryStage.show(); 33 | } 34 | 35 | public static void main(String[] args) 36 | { 37 | launch(args); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/java/com/pixelduke/control/ChangeStyleRibbonInCSSFileSample.java: -------------------------------------------------------------------------------- 1 | package com.pixelduke.control; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | import jfxtras.styles.jmetro8.JMetro; 9 | 10 | import java.net.URL; 11 | 12 | public class ChangeStyleRibbonInCSSFileSample extends Application { 13 | private static final String RESOURCE = "CompleteRibbonFXML.fxml"; 14 | private static final String CSS_FILE = "ribbon_sample.css"; 15 | 16 | @Override 17 | public void start(Stage primaryStage) throws Exception 18 | { 19 | URL resource = ChangeStyleRibbonInCSSFileSample.class.getResource(RESOURCE); 20 | Parent root = FXMLLoader.load(resource); 21 | 22 | Scene scene = new Scene(root); 23 | 24 | // ScenicView.show(scene); 25 | new JMetro(JMetro.Style.LIGHT).applyTheme(scene); 26 | 27 | scene.getStylesheets().add(ChangeStyleRibbonInCSSFileSample.class.getResource(CSS_FILE).toExternalForm()); 28 | 29 | primaryStage.setMaximized(true); 30 | primaryStage.setScene(scene); 31 | primaryStage.show(); 32 | } 33 | 34 | public static void main(String[] args) 35 | { 36 | launch(args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/java/com/pixelduke/control/CompleteRibbonSample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2018 Pixel Duke (Pedro Duque Vieira - www.pixelduke.com) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Pixel Duke, any associated website, nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL PIXEL DUKE BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.pixelduke.control; 29 | 30 | import javafx.application.Application; 31 | import javafx.fxml.FXMLLoader; 32 | import javafx.scene.Parent; 33 | import javafx.scene.Scene; 34 | import javafx.stage.Stage; 35 | import jfxtras.styles.jmetro8.JMetro; 36 | //import org.scenicview.ScenicView; 37 | 38 | import java.net.URL; 39 | 40 | public class CompleteRibbonSample extends Application { 41 | private static final String RESOURCE = "CompleteRibbonFXML.fxml"; 42 | 43 | @Override 44 | public void start(Stage primaryStage) throws Exception 45 | { 46 | URL resource = CompleteRibbonSample.class.getResource(RESOURCE); 47 | Parent root = FXMLLoader.load(resource); 48 | Scene scene = new Scene(root); 49 | 50 | // ScenicView.show(scene); 51 | new JMetro(JMetro.Style.LIGHT).applyTheme(scene); 52 | 53 | primaryStage.setMaximized(true); 54 | primaryStage.setScene(scene); 55 | primaryStage.show(); 56 | } 57 | 58 | public static void main(String[] args) 59 | { 60 | launch(args); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/java/com/pixelduke/control/QuickAccessBarSample.java: -------------------------------------------------------------------------------- 1 | package com.pixelduke.control; 2 | 3 | import com.pixelduke.control.ribbon.QuickAccessBar; 4 | import com.pixelduke.control.ribbon.RibbonGroup; 5 | import com.pixelduke.control.ribbon.RibbonTab; 6 | import javafx.application.Application; 7 | import javafx.scene.Scene; 8 | import javafx.scene.control.Button; 9 | import javafx.scene.control.ContentDisplay; 10 | import javafx.scene.image.Image; 11 | import javafx.scene.image.ImageView; 12 | import javafx.scene.layout.BorderPane; 13 | import javafx.stage.Stage; 14 | 15 | public class QuickAccessBarSample extends Application { 16 | 17 | @Override 18 | public void start(Stage primaryStage) { 19 | BorderPane rootNode = new BorderPane(); 20 | Ribbon ribbon = new Ribbon(); 21 | RibbonTab ribbonTab = new RibbonTab("Notes"); 22 | RibbonGroup ribbonGroup = new RibbonGroup(); 23 | 24 | rootNode.setTop(ribbon); 25 | 26 | Image image = new Image(QuickAccessBarSample.class.getResource("icons8_Bold_32px.png").toExternalForm()); 27 | ImageView imageView = new ImageView(image); 28 | Button iconButton = new Button("Bold", imageView); 29 | iconButton.setContentDisplay(ContentDisplay.TOP); 30 | ribbonGroup.getNodes().add(iconButton); 31 | 32 | image = new Image(QuickAccessBarSample.class.getResource("icons8_Italic_32px.png").toExternalForm()); 33 | imageView = new ImageView(image); 34 | iconButton = new Button("Italic", imageView); 35 | iconButton.setContentDisplay(ContentDisplay.TOP); 36 | ribbonGroup.getNodes().add(iconButton); 37 | 38 | image = new Image(QuickAccessBarSample.class.getResource("icons8_Underline_32px.png").toExternalForm()); 39 | imageView = new ImageView(image); 40 | iconButton = new Button("Underline", imageView); 41 | iconButton.setContentDisplay(ContentDisplay.TOP); 42 | iconButton.setMinSize(Button.USE_PREF_SIZE, Button.USE_PREF_SIZE); 43 | ribbonGroup.getNodes().add(iconButton); 44 | ribbonTab.getRibbonGroups().add(ribbonGroup); 45 | 46 | ribbon.getTabs().add(ribbonTab); 47 | 48 | QuickAccessBar quickAccessBar = new QuickAccessBar(); 49 | // Save 50 | Button saveButton = new Button(); 51 | image = new Image(QuickAccessBarSample.class.getResource("icons8_Save_16px.png").toExternalForm()); 52 | imageView = new ImageView(image); 53 | saveButton.setGraphic(imageView); 54 | 55 | // Undo 56 | Button undoButton = new Button(); 57 | image = new Image(QuickAccessBarSample.class.getResource("icons8_Undo_16px.png").toExternalForm()); 58 | imageView = new ImageView(image); 59 | undoButton.setGraphic(imageView); 60 | 61 | // Redo 62 | Button redoButton = new Button(); 63 | image = new Image(QuickAccessBarSample.class.getResource("icons8_Redo_16px.png").toExternalForm()); 64 | imageView = new ImageView(image); 65 | redoButton.setGraphic(imageView); 66 | 67 | quickAccessBar.getButtons().addAll(saveButton, undoButton, redoButton); 68 | 69 | ribbon.setQuickAccessBar(quickAccessBar); 70 | 71 | Scene scene = new Scene(rootNode); 72 | primaryStage.setScene(scene); 73 | primaryStage.show(); 74 | } 75 | 76 | public static void main(String[] args) { 77 | launch(args); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/java/com/pixelduke/control/RibbonCreatedThroughFXMLSample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2018 Pixel Duke (Pedro Duque Vieira - www.pixelduke.com) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Pixel Duke, any associated website, nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL PIXEL DUKE BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.pixelduke.control; 29 | 30 | import javafx.application.Application; 31 | import javafx.fxml.FXMLLoader; 32 | import javafx.scene.Parent; 33 | import javafx.scene.Scene; 34 | import javafx.stage.Stage; 35 | 36 | import java.net.URL; 37 | 38 | public class RibbonCreatedThroughFXMLSample extends Application { 39 | private static final String RESOURCE = "RibbonFXML.fxml"; 40 | 41 | @Override 42 | public void start(Stage primaryStage) throws Exception 43 | { 44 | URL resource = RibbonCreatedThroughFXMLSample.class.getResource(RESOURCE); 45 | Parent root = FXMLLoader.load(resource); 46 | Scene scene = new Scene(root); 47 | 48 | // ScenicView.show(scene); 49 | 50 | primaryStage.setScene(scene); 51 | primaryStage.show(); 52 | } 53 | 54 | public static void main(String[] args) 55 | { 56 | launch(args); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/java/com/pixelduke/control/RibbonGroupWithMenuButtonSample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2018 Pixel Duke (Pedro Duque Vieira - www.pixelduke.com) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Pixel Duke, any associated website, nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL PIXEL DUKE BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.pixelduke.control; 29 | 30 | import com.pixelduke.control.ribbon.RibbonGroup; 31 | import javafx.application.Application; 32 | import javafx.scene.Scene; 33 | import javafx.scene.control.MenuButton; 34 | import javafx.scene.control.MenuItem; 35 | import javafx.scene.layout.BorderPane; 36 | import javafx.stage.Stage; 37 | 38 | public class RibbonGroupWithMenuButtonSample extends Application { 39 | 40 | @Override 41 | public void start(Stage primaryStage) { 42 | BorderPane rootNode = new BorderPane(); 43 | RibbonGroup ribbonGroup = new RibbonGroup(); 44 | 45 | rootNode.setTop(ribbonGroup); 46 | 47 | MenuButton number = new MenuButton("Number"); 48 | 49 | number.getItems().addAll(new MenuItem("test1"), new MenuItem("test2"), new MenuItem("test3"), new MenuItem("test4")); 50 | ribbonGroup.getNodes().addAll(number); 51 | 52 | Scene scene = new Scene(rootNode); 53 | // ScenicView.show(scene); 54 | primaryStage.setScene(scene); 55 | primaryStage.show(); 56 | } 57 | 58 | public static void main(String[] args) { 59 | launch(args); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/java/com/pixelduke/control/RibbonWithGroupSample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2018 Pixel Duke (Pedro Duque Vieira - www.pixelduke.com) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Pixel Duke, any associated website, nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL PIXEL DUKE BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.pixelduke.control; 29 | 30 | import com.pixelduke.control.ribbon.RibbonGroup; 31 | import com.pixelduke.control.ribbon.RibbonTab; 32 | import javafx.application.Application; 33 | import javafx.scene.Scene; 34 | import javafx.scene.control.Button; 35 | import javafx.scene.control.ContentDisplay; 36 | import javafx.scene.image.Image; 37 | import javafx.scene.image.ImageView; 38 | import javafx.scene.layout.BorderPane; 39 | import javafx.stage.Stage; 40 | 41 | public class RibbonWithGroupSample extends Application { 42 | 43 | @Override 44 | public void start(Stage primaryStage) { 45 | BorderPane rootNode = new BorderPane(); 46 | Ribbon ribbon = new Ribbon(); 47 | RibbonTab ribbonTab = new RibbonTab("Test"); 48 | RibbonGroup ribbonGroup = new RibbonGroup(); 49 | 50 | rootNode.setTop(ribbon); 51 | 52 | Image image = new Image(QuickAccessBarSample.class.getResource("icons8_Bold_32px.png").toExternalForm()); 53 | ImageView imageView = new ImageView(image); 54 | Button iconButton = new Button("Bold", imageView); 55 | iconButton.setContentDisplay(ContentDisplay.TOP); 56 | ribbonGroup.getNodes().add(iconButton); 57 | 58 | 59 | ribbonTab.getRibbonGroups().add(ribbonGroup); 60 | ribbon.getTabs().add(ribbonTab); 61 | 62 | Scene scene = new Scene(rootNode); 63 | primaryStage.setScene(scene); 64 | primaryStage.show(); 65 | } 66 | 67 | public static void main(String[] args) { 68 | launch(args); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/java/com/pixelduke/control/RibbonWithGroupsSample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2018 Pixel Duke (Pedro Duque Vieira - www.pixelduke.com) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Pixel Duke, any associated website, nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL PIXEL DUKE BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.pixelduke.control; 29 | 30 | import com.pixelduke.control.ribbon.RibbonGroup; 31 | import com.pixelduke.control.ribbon.RibbonTab; 32 | import javafx.application.Application; 33 | import javafx.scene.Scene; 34 | import javafx.scene.control.Button; 35 | import javafx.scene.control.ContentDisplay; 36 | import javafx.scene.image.Image; 37 | import javafx.scene.image.ImageView; 38 | import javafx.scene.layout.BorderPane; 39 | import javafx.stage.Stage; 40 | 41 | public class RibbonWithGroupsSample extends Application{ 42 | 43 | @Override 44 | public void start(Stage primaryStage) { 45 | BorderPane rootNode = new BorderPane(); 46 | Ribbon ribbon = new Ribbon(); 47 | RibbonTab ribbonTab = new RibbonTab("Test"); 48 | RibbonGroup ribbonGroup = new RibbonGroup(); 49 | 50 | rootNode.setTop(ribbon); 51 | 52 | Image image = new Image(QuickAccessBarSample.class.getResource("icons8_Bold_32px.png").toExternalForm()); 53 | ImageView imageView = new ImageView(image); 54 | Button iconButton = new Button("Bold", imageView); 55 | iconButton.setContentDisplay(ContentDisplay.TOP); 56 | ribbonGroup.getNodes().add(iconButton); 57 | 58 | image = new Image(QuickAccessBarSample.class.getResource("icons8_Italic_32px.png").toExternalForm()); 59 | imageView = new ImageView(image); 60 | iconButton = new Button("Italic", imageView); 61 | iconButton.setContentDisplay(ContentDisplay.TOP); 62 | ribbonGroup.getNodes().add(iconButton); 63 | 64 | image = new Image(QuickAccessBarSample.class.getResource("icons8_Underline_32px.png").toExternalForm()); 65 | imageView = new ImageView(image); 66 | iconButton = new Button("Underline", imageView); 67 | iconButton.setContentDisplay(ContentDisplay.TOP); 68 | iconButton.setMinSize(Button.USE_PREF_SIZE, Button.USE_PREF_SIZE); 69 | ribbonGroup.getNodes().add(iconButton); 70 | 71 | 72 | ribbonTab.getRibbonGroups().add(ribbonGroup); 73 | 74 | 75 | ribbonGroup = new RibbonGroup(); 76 | 77 | image = new Image(QuickAccessBarSample.class.getResource("icons8_Save_32px.png").toExternalForm()); 78 | imageView = new ImageView(image); 79 | iconButton = new Button("Save Results", imageView); 80 | iconButton.setContentDisplay(ContentDisplay.TOP); 81 | ribbonGroup.getNodes().add(iconButton); 82 | 83 | ribbonTab.getRibbonGroups().add(ribbonGroup); 84 | 85 | 86 | ribbon.getTabs().add(ribbonTab); 87 | 88 | Scene scene = new Scene(rootNode); 89 | primaryStage.setScene(scene); 90 | primaryStage.show(); 91 | } 92 | 93 | public static void main(String[] args) { 94 | launch(args); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/CompleteRibbonFXML.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 56 | 63 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 85 | 92 | 99 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 205 | 212 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/RibbonFXML.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 52 | 59 | 66 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Bold_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Bold_32px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Bold_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Bold_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Change_Theme_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Change_Theme_16px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Change_Theme_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Change_Theme_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_File_32px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_File_32px_1.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_File_48px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_File_48px_1.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Globe_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Globe_32px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Globe_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Globe_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Help_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Help_32px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Help_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Help_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Info_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Info_32px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Info_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Info_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Italic_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Italic_32px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Italic_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Italic_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Location_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Location_16px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Location_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Location_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Lock_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Lock_16px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Lock_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Lock_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Open_32px_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Open_32px_3.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Open_48px_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Open_48px_3.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Redo_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Redo_16px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Redo_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Redo_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_16px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_32px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_as_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_as_32px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_as_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Save_as_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Underline_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Underline_32px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Underline_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Underline_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Undo_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Undo_16px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Undo_48px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/icons8_Undo_48px.png -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/ribbon_sample.css: -------------------------------------------------------------------------------- 1 | .ribbon { 2 | ACCENT_COLOR: #10893e; 3 | } -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/util/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/util/fa-regular-400.ttf -------------------------------------------------------------------------------- /FXRibbon-samples/src/main/resources/com/pixelduke/control/util/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dukke/FXRibbon/af336547a7a379551779001c5713bdc8f38426fd/FXRibbon-samples/src/main/resources/com/pixelduke/control/util/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /FXRibbon/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.jfrog.bintray" version "1.7.3" 3 | id "java-library" 4 | id "maven-publish" 5 | } 6 | 7 | sourceCompatibility = '1.8' 8 | 9 | version = '1.2.2' 10 | def versionDescription = 'FXRibbon' 11 | 12 | 13 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' 14 | 15 | jar { 16 | manifest { 17 | attributes( 'Implementation-Title': project.name, 18 | 'Implementation-Version': project.version) 19 | } 20 | } 21 | 22 | task javadocJar(type: Jar) { 23 | classifier = 'javadoc' 24 | from javadoc 25 | } 26 | 27 | javadoc { 28 | options.addStringOption('javafx', '-quiet') 29 | } 30 | 31 | task sourceJar(type: Jar) { 32 | from sourceSets.main.allJava 33 | classifier "sources" 34 | } 35 | 36 | artifacts { 37 | archives sourceJar 38 | archives javadocJar 39 | } 40 | 41 | /* Publishing */ 42 | bintray { 43 | user = System.getenv('BINTRAY_USER') 44 | key = System.getenv('BINTRAY_KEY') 45 | pkg { 46 | repo = 'maven' 47 | name = project.name 48 | //userOrg = 'dukke' 49 | licenses = ['BSD New'] 50 | vcsUrl = 'https://github.com/dukke/FXRibbon.git' 51 | publications = ['mavenJava'] 52 | websiteUrl = 'https://www.pixelduke.com/fxribbon' 53 | issueTrackerUrl = 'https://github.com/dukke/FXRibbon/issues' 54 | publicDownloadNumbers = true 55 | version { 56 | name = project.version 57 | desc = versionDescription // Version description 58 | vcsTag = project.version 59 | mavenCentralSync { 60 | sync = true 61 | user = System.getenv('MAVEN_USERNAME') 62 | password = System.getenv('MAVEN_PASSWORD') 63 | } 64 | } 65 | } 66 | } 67 | 68 | def pomConfig = { 69 | packaging 'jar' 70 | name project.name 71 | url 'https://pixelduke.com/fxribbon/' 72 | inceptionYear '2014' 73 | licenses { 74 | license([:]) { 75 | name 'BSD New' 76 | url 'https://opensource.org/licenses/BSD-3-Clause' 77 | distribution 'repo' 78 | } 79 | } 80 | scm { 81 | url 'https://github.com/dukke/FXRibbon.git' 82 | } 83 | developers { 84 | [ 85 | dukke: 'Pedro Duque Vieira', 86 | ].each { devId, devName -> 87 | developer { 88 | id devId 89 | name devName 90 | roles { 91 | role 'Developer' 92 | } 93 | } 94 | } 95 | } 96 | } 97 | 98 | publishing { 99 | publications { 100 | mavenJava(MavenPublication) { 101 | from components.java 102 | artifact sourceJar { 103 | classifier "sources" 104 | } 105 | artifact javadocJar { 106 | classifier "javadoc" 107 | } 108 | 109 | pom.withXml { 110 | asNode().children().last() + pomConfig 111 | asNode().appendNode('description', "Ribbon control for Java, created in JavaFX") 112 | } 113 | } 114 | } 115 | } 116 | 117 | -------------------------------------------------------------------------------- /FXRibbon/src/main/java/com/pixelduke/control/Ribbon.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2018 Pixel Duke (Pedro Duque Vieira - www.pixelduke.com) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Pixel Duke, any associated website, nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL PIXEL DUKE BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.pixelduke.control; 29 | 30 | import com.pixelduke.control.ribbon.QuickAccessBar; 31 | import com.pixelduke.control.ribbon.RibbonTab; 32 | import impl.com.pixelduke.skin.RibbonSkin; 33 | import javafx.beans.property.SimpleObjectProperty; 34 | import javafx.collections.FXCollections; 35 | import javafx.collections.ListChangeListener; 36 | import javafx.collections.ObservableList; 37 | import javafx.scene.control.Control; 38 | import javafx.scene.control.Skin; 39 | 40 | import java.util.Collection; 41 | import java.util.HashMap; 42 | 43 | public class Ribbon extends Control{ 44 | private final static String DEFAULT_STYLE_CLASS = "ribbon"; 45 | 46 | private final ObservableList tabs; 47 | 48 | private QuickAccessBar quickAccessBar; 49 | 50 | public Ribbon() 51 | { 52 | quickAccessBar = new QuickAccessBar(); 53 | 54 | tabs = FXCollections.observableArrayList(); 55 | 56 | getStyleClass().setAll(DEFAULT_STYLE_CLASS); 57 | } 58 | 59 | public ObservableList getTabs(){ 60 | return tabs; 61 | } 62 | 63 | 64 | /*************************************************************************** 65 | * * 66 | * Properties * 67 | * * 68 | **************************************************************************/ 69 | 70 | /** Selected Ribbon Tab **/ 71 | private final SimpleObjectProperty selectedRibbonTab = new SimpleObjectProperty<>(); 72 | 73 | public SimpleObjectProperty selectedRibbonTabProperty() 74 | { 75 | return selectedRibbonTab; 76 | } 77 | public RibbonTab getSelectedRibbonTab() 78 | { 79 | return selectedRibbonTab.get(); 80 | } 81 | public void setSelectedRibbonTab(RibbonTab ribbonTab) 82 | { 83 | selectedRibbonTab.set(ribbonTab); 84 | } 85 | 86 | 87 | public QuickAccessBar getQuickAccessBar() 88 | { 89 | return quickAccessBar; 90 | } 91 | public void setQuickAccessBar(QuickAccessBar qAccessBar) 92 | { 93 | quickAccessBar = qAccessBar; 94 | } 95 | 96 | 97 | @Override 98 | public String getUserAgentStylesheet() { 99 | return Ribbon.class.getResource("fxribbon.css").toExternalForm(); 100 | } 101 | 102 | @Override 103 | protected Skin createDefaultSkin() { 104 | return new RibbonSkin(this); 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /FXRibbon/src/main/java/com/pixelduke/control/ribbon/Column.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2016, 2018 Pixel Duke (Pedro Duque Vieira - www.pixelduke.com) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of Pixel Duke, any associated website, nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL PIXEL DUKE BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | package com.pixelduke.control.ribbon; 30 | 31 | import javafx.scene.layout.VBox; 32 | 33 | public class Column extends VBox{ 34 | private final static String DEFAULT_STYLE_CLASS = "column"; 35 | 36 | public Column() 37 | { 38 | getStyleClass().setAll(DEFAULT_STYLE_CLASS); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /FXRibbon/src/main/java/com/pixelduke/control/ribbon/QuickAccessBar.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2016, 2018 Pixel Duke (Pedro Duque Vieira - www.pixelduke.com) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of Pixel Duke, any associated website, nor the 14 | * names of its contributors may be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL PIXEL DUKE BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | package com.pixelduke.control.ribbon; 30 | 31 | import impl.com.pixelduke.skin.ribbon.QuickAccessBarSkin; 32 | import javafx.collections.FXCollections; 33 | import javafx.collections.ObservableList; 34 | import javafx.scene.control.Button; 35 | import javafx.scene.control.Control; 36 | import javafx.scene.control.Skin; 37 | 38 | public class QuickAccessBar extends Control { 39 | private final static String DEFAULT_STYLE_CLASS = "quick-access-bar"; 40 | 41 | public QuickAccessBar() 42 | { 43 | buttons = FXCollections.observableArrayList(); 44 | rightButtons = FXCollections.observableArrayList(); 45 | 46 | getStyleClass().setAll(DEFAULT_STYLE_CLASS); 47 | } 48 | 49 | 50 | private final ObservableList