JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

expand all

Profile: desktop, common

Overview

Represents a container of a single state variable in a design. State variable can hold at maximum one particular state at a time. The actual state is held in actual field. It is required to set timelines field. Then you can switch between states using actual field directly or any helper method e.g. previous or next. Optionally you can set names field to navigate to states using their names.

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicactualInteger

Holds the actual state index.

Holds the actual state index. The defined indices are [0 .. < sizeof names]. Any other index is taken as undefined. Default actual state index is -1. When a new actual state index is set, then based on onActualStateChanged a new timeline is started and onActualStateChanged method is called.

 
public-initcreateTimelinefunction(:int):Timeline

This function should create a timeline for a specified actual state.

This function should create a timeline for a specified actual state. Default implementation returns a timeline stored timelines sequence at actual position.

 
public-initnamesString[]

Contains a sequence of names.

Contains a sequence of names. Each name is assigned to a particular state represented by an index starting from zero. For getting an index from a specified name, you can use findIndex method.

 
publiconActualStateChangedfunction(:int,:int):Void

This is a notification method called when the actual state is changed.

public-initstateChangeTypeObject[]

Defines how the timelines should be stop/started when the actual state is changed.

Defines how the timelines should be stop/started when the actual state is changed. Default value is PAUSE_AND_PLAY_FROM_START. If null value is set, IllegalArgumentException is thrown.

 
public-inittimelinesTimeline[]

Contains a sequence of timelines.

Contains a sequence of timelines. Each timeline is assigned to a particular state represented by an index starting from zero. A timeline sets various properties of components in a design to specific value. At the end of the timeline, the design should look as designed for a specific state.

 

Inherited Variables

Function Summary

public findIndex(name: java.lang.String) : Integer

Returns a state index by a state name which can be found in names field.

Returns a state index by a state name which can be found in names field.

Parameters
name
the state name to search for
Returns
Integer
the state index or <code>-1</code> if not found.
 
public bound isFirst() : Boolean

Returns whether the actual state index is 0 or less.

Returns whether the actual state index is 0 or less.

Returns
Boolean
true, if actual state index <= 0
 
public bound isLast() : Boolean

Returns whether the actual state index is equal or greater than the last defined index.

Returns whether the actual state index is equal or greater than the last defined index.

Returns
Boolean
true, if actual state index >= sizeof names - 1
 
public next() : Void

If possible, sets the actual state index to next state index i.e.

If possible, sets the actual state index to next state index i.e. increments the actual state index by 1. The function cares about the upper limit and disables increment when the new actual state index would be undefined index.

 
public nextWrapped() : Integer

If possible, sets the actual state index to next state index in a loop i.e.

If possible, sets the actual state index to next state index in a loop i.e. increments the actual state index by 1 in a loop of defined indices. If the new actual state index would be undefined index, the first defined index is set instead.

Returns
Integer
 
public previous() : Void

If possible, sets the actual state index to previous state index i.e.

If possible, sets the actual state index to previous state index i.e. decrements the actual state index by 1. The function cares about the lower limit and disables decrement when the new actual state index would be undefined index.

 
public previousWrapped() : Integer

If possible, sets the actual state index to previous state index in a loop i.e.

If possible, sets the actual state index to previous state index in a loop i.e. decrements the actual state index by 1 in a loop of defined indices. If the new actual state index would be undefined index, the last defined index is set instead.

Returns
Integer
 

Inherited Functions