GenericPane

org.scalafx.extras.generic_pane.GenericPane
class GenericPane(val lastDirectoryHandler: LastDirectoryHandler) extends GenericPaneBase

A helper for crating custom panes. Particularly suited for creation of input controls.

There are 4 steps to using a generic pane:

  1. Creation, where elements of the pane are appended vertically using add*(...) methods, * for instance, addStringField(label, defaultText)

  2. Adding the pane to the UI

  3. User interaction, after the pane is displayed

  4. Optionally, reading of input. Pane editable content can be read using next*() methods. Content is read in the order it is added. The whole pane content can be read multiple tiles. Remember to call resetReadout() to ensure that reading is restarted from the beginning of the pane.

Example:

 // Build a pane
 val gp = new GenericPane()
 gp.addDirectoryField("Input", "images")
 gp.addDirectoryField("Output", "output")

 // Use it in some other control
 ...

 // Later ...
 // Print its content
 gp.resetReadout()
 println(s"Input dir : ${gp.nextString()}")
 println(s"Output dir: ${gp.nextString()}")

Value parameters

lastDirectoryHandler

customize how directory selections are remembered between uses of the dialog. Used with addDirectoryField and addFileField.

Attributes

See also

GenericDialogFX

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def pane: Node

Attributes

Definition Classes
override def parentWindow: Option[Window]

Attributes

Definition Classes
override def resetReadout(): Unit

Attributes

Definition Classes

Inherited methods

def addCheckbox(label: String, defaultValue: Boolean): Unit

Adds a checkbox.

Adds a checkbox.

Value parameters

defaultValue

the initial state

label

the label

Attributes

Inherited from:
GenericPaneBase
def addChoice(label: String, items: Seq[String], defaultItem: String): Unit

Adds a choice list.

Adds a choice list.

Value parameters

defaultItem

the initial item, must be equal to one of the items

items

items on the list

label

the label

Attributes

Inherited from:
GenericPaneBase
def addChoice(label: String, items: Array[String], defaultItem: String): Unit

Attributes

Inherited from:
GenericPaneBase
def addDirectoryField(label: String, defaultPath: String, columns: Int): Unit

Adds a directory text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the directory path.

Adds a directory text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the directory path.

Value parameters

columns

width of the text field

defaultPath

initial path

label

the label

Attributes

Inherited from:
GenericPaneBase
def addDirectoryField(label: String, defaultPath: String): Unit

Adds a directory text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the directory path.

Adds a directory text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the directory path.

Value parameters

defaultPath

initial path

label

the label

Attributes

Inherited from:
GenericPaneBase
def addFileField(label: String, defaultPath: String, columns: Int): Unit

Adds a file text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the file path.

Adds a file text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the file path.

Value parameters

columns

width of the text field

defaultPath

initial path

label

the label

Attributes

Inherited from:
GenericPaneBase
def addMessage(message: String, font: Option[Font]): Unit

Adds a message consisting of one or more lines of text.

Adds a message consisting of one or more lines of text.

That message cannot be edited, cannot be edited with a next*()

Value parameters

font

Optional font used to render the message

message

message

Attributes

Inherited from:
GenericPaneBase
def addMessage(message: String, font: Font): Unit

Adds a message consisting of one or more lines of text.

Adds a message consisting of one or more lines of text.

That message cannot be edited, cannot be edited with a next*()

Value parameters

font

font used to render the message

message

message

Attributes

Inherited from:
GenericPaneBase
def addNode(label: String, node: Node): Unit

Add a custom node

Add a custom node

Value parameters

label

the label

node

custom node. It is not included in next*() readouts, needs to be handled by the creator

Attributes

Inherited from:
GenericPaneBase
def addNode(node: Node): Unit

Add a custom node that will occupy a whole row

Add a custom node that will occupy a whole row

Attributes

Inherited from:
GenericPaneBase
def addNumericField(label: String, defaultValue: Double, decimalPlaces: Int, columnWidth: Int, units: String): Unit

Add a numeric field.

Add a numeric field.

Value parameters

columnWidth

number of columns used to display the number

decimalPlaces

number of decimal places to display

defaultValue

the initial value

label

the label

units

text displayed after the number

Attributes

Inherited from:
GenericPaneBase
def addNumericField(label: String, defaultValue: Double): Unit

Add a numeric field.

Add a numeric field.

Value parameters

defaultValue

the initial value

label

the label

Attributes

Inherited from:
GenericPaneBase
def addStringField(label: String, defaultText: String, columns: Int): Unit

Adds a text field.

Adds a text field.

Value parameters

columns

width of the text field

defaultText

text initially displayed

label

the label

Attributes

Inherited from:
GenericPaneBase
def addStringField(label: String, defaultText: String): Unit

Adds an 8 column text field.

Adds an 8 column text field.

Value parameters

defaultText

the text initially displayed

label

the label

Attributes

Inherited from:
GenericPaneBase

Returns the state of the next checkbox

Returns the state of the next checkbox

Attributes

Inherited from:
GenericPaneBase

Attributes

Inherited from:
GenericPaneBase

Returns the value of the next number

Returns the value of the next number

Attributes

Inherited from:
GenericPaneBase

Returns the value of the next string

Returns the value of the next string

Attributes

Inherited from:
GenericPaneBase
protected def requestFocusOnFirstLabeled(): Unit

Attributes

Inherited from:
GenericPaneBase

Concrete fields

Customize how directory selections are remembered between uses of the dialog. Used with addDirectoryField and addFileField

Customize how directory selections are remembered between uses of the dialog. Used with addDirectoryField and addFileField

Attributes