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
Table of Contents Introduction Part
Part 1: TornadoFX Fundamentals Part
1. Why TornadoFX? how Kotlin can si
1. Why TornadoFX? tableview { items
2. Setting Up 1.8 Then this goes
3. Components However, we might wan
3. Components Specify the name of y
3. Components class MyApp: App(MyVi
3. Components import javafx.scene.c
3. Components Here is a simple exam
3. Components The VBox contains a L
3. Components Argument Type Descrip
3. Components Argument Type Descrip
3. Components import tornadofx.* cl
3. Components Sometimes it is neces
4. Basic Controls Basic Controls On
4. Basic Controls 3. The Button is
4. Basic Controls If you need to sa
4. Basic Controls Figure 4.4 You ca
4. Basic Controls You do not need t
4. Basic Controls radiobutton("Powe
4. Basic Controls ProgressBar A Pro
4. Basic Controls Like most other c
4. Basic Controls Keep in mind that
4. Basic Controls button("Commit")
4. Basic Controls 51
5. Data Controls val greekLetters =
5. Data Controls class Person(id: I
5. Data Controls tableview(persons)
5. Data Controls This more closely
5. Data Controls The rowExpander()
5. Data Controls Let's break this d
5. Data Controls data class Departm
5. Data Controls val tableData = ma
11. Editing Models and Validation E
11. Editing Models and Validation d
11. Editing Models and Validation i
12. TornadoFX IDEA Plugin 13. Torna
12. TornadoFX IDEA Plugin You will
12. TornadoFX IDEA Plugin A generat
12. TornadoFX IDEA Plugin Injecting
12. TornadoFX IDEA Plugin Generatin
12. TornadoFX IDEA Plugin You will
Part 2: TornadoFX Advanced Features
Property Delegates class MyView: Vi
Property Delegates class Bar { var
Advanced Data Controls Advanced Dat
Advanced Data Controls This fine-tu
Advanced Data Controls This setting
Advanced Data Controls class MyView
Advanced Data Controls Assign If Nu
Advanced Data Controls 205
OSGi The dynamic nature of OSGi len
OSGi class Dashboard : View() { ove
OSGi Requirements To run TornadoFX
Scopes Scopes Scope is a simple con
Scopes Now whenever you access the
Scopes Testing with Scopes Since Sc
EventBus A button in the UI can fir
EventBus When you create a subclass
EventBus Many feel that events migh
Workspaces Workspaces Java Business
Workspaces To keep things focused,
Workspaces fun TabPane.connectWorks
Workspaces Modifying the default wo
Workspaces Title and heading When a
Workspaces Navigating between docke
Workspaces We can see that the titl
Workspaces workspace.dockInNewScope
Workspaces A Workspace in Tabs mode
Workspaces // A Form based View we
Workspaces This could be a good ide
Layout Debugger Layout Debugger Whe
Layout Debugger yet, submit a pull
Internationalization You can add a
Config Settings and State Config se
Config Settings and State If the re
Config Settings and State var bool:
JSON and REST } } with(json) { add(
JSON and REST Basic operations Ther
JSON and REST To configure authenti
Dependency Injection Dependency Inj
Dependency Injection This initializ
Wizard class BasicData : View("Basi
Wizard When the Next or Finish butt
Wizard val wizard = find() wizard.s
Wizard class CustomerWizard : Wizar
Wizard Structural modifications The