Views
4 months ago

tornadofx-guide

7. Layouts and Menus

7. Layouts and Menus next to it. You can control the size of the content area further using the maxContentSize and fixedContentSize properties of Drawer . Depending on the dockingSide , those properties will constrain either the width or the height of the content area. The Workspace features built in support for the Drawer control. The leftDrawer , rightDrawer and bottomDrawer properties of any Workspace will let you dock drawer items into them. Read more about this in the Workspace chapter. Converting observable list items and binding to layouts TODO Summary By now you should have the tools to quickly create complex UI's with layouts, tabbed panes, as well as other controls to manage controls. Using these in conjunction with the data controls, you should be able to turn around UI's in a fraction of the time. When it comes to builders, you have reached the top of the peak and have everything you need to be productive. All that is left to cover are charts and shapes, which we will cover in the next two chapters. 120

8. Charts Charts JavaFX comes with a handy set of charts to quickly display data visualizations. While there are more comprehensive charting libraries like JFreeChart and Orson Charts which work fine with TornadoFX, the built-in JavaFX charts satisfy a majority of visualization needs. They also have elegant animations when data is populated or changed. TornadoFX comes with a few builders to streamline the declaration of charts using functional constructs. PieChart The PieChart is a common visual aid to illustrate proportions of a whole. It is structurally simpler than XY charts which we will learn about later. Inside a piechart() builder you can call the data() function to pass multiple category-value pairs (Figure 8.1). piechart("Desktop/Laptop OS Market Share") { data("Windows", 77.62) data("OS X", 9.52) data("Other", 3.06) data("Linux", 1.55) data("Chrome OS", 0.55) } Figure 8.1 121

GUIDE
Guide
GUIDE
Guide
Guide
Guide
GUIDE
GUIDE
Guide
GUIDE
GUIDE
GUIDE