Package-level declarations

Types

Link copied to clipboard
open class Action(val command: Command, val lambda: (ActionEvent) -> Unit?)

An Action how a Command is implemented, i.e. the code that runs when a GUI element is pressed. One action is often shared by multiple GUI Nodes. For example, an 'Undo' button in a ToolBar can use the same Action as an 'Undo' menu item in a Menu.

Link copied to clipboard
open class Actions

Actions define the behaviours of Commands, i.e. the code that executed when a button, menu-item etc. is pressed. The Actions can then be used to build the buttons, menu items etc.

Link copied to clipboard
class Command(val commands: Commands, val name: String, text: String, keyCombination: KeyCombination? = null, var tooltip: String? = null)

Command defines an instruction from the user to the program, such a saving the current document. It does NOT define HOW that instruction is performed, that is the job of Action.

Link copied to clipboard
abstract class Commands(var icons: NamedImages?)

GUI applications can get messy, the classes in this package help reduce the messiness when defining Buttons, ToggleButtons, PropertyRadioButtons, Menus, MenuItems, SubMenus, ToggleMenuItem. It also simplifies keyboard shortcuts.

Link copied to clipboard
class PropertyRadioAction<V, P : Property<V>>(val property: P, definition: Command, val value: V, val lambda: (ActionEvent) -> Unit?) : Action
Link copied to clipboard
class PropertyToggleAction<V, P : Property<V?>>(val property: P, definition: Command, val value: V, val lambda: (ActionEvent) -> Unit?) : Action
Link copied to clipboard
class ToggleAction(definition: Command, val selectedProperty: BooleanProperty, val lambda: (ActionEvent) -> Unit?) : Action

A ToggleAction is a Action with an extra selectedProperty. Used with ToggleButton and ToggleMenuItem, where their selectedProperty is bound bidirectionally to this one.