Top Description Fields Constructors Methods
javafx.css

public final Class TransitionEvent

extends Event
Class Inheritance
Imports
javafx.animation.Transition, javafx.event.Event, .EventType, javafx.scene.Node, javafx.scene.layout.Region, javafx.util.Duration, java.util.Objects

An event that signals the creation, beginning, completion and cancellation of implicit CSS transitions.

Note that this event is not raised for explicit transitions that are created using the Transition class.

Since
23

Field Summary

Modifier and TypeField and Description
public static final EventType<TransitionEvent>
ANY

Hides javafx.event.Event.ANY.

Common supertype for all TransitionEvent types.
public static final EventType<TransitionEvent>
CANCEL

This event occurs when a running transition was cancelled before it has reached the end of its active period.

private final Duration
elapsedTime

The time that has elapsed since the transition has entered its active period, not including the time spent in the delay phase.

public static final EventType<TransitionEvent>
END

This event occurs when a running transition has reached the end of its active period.

private final StyleableProperty<?>
property

The StyleableProperty that is targeted by the transition.

private final String
propertyName

The name of the CSS property or sub-property that is targeted by the transition.

public static final EventType<TransitionEvent>
RUN

This event occurs when a transition has been created and added to the list of running transitions of a Node.

private static final long
public static final EventType<TransitionEvent>
START

This event occurs when a running transition enters its active period, which happens at the end of the delay phase.

Inherited from javafx.event.Event:
consumedeventTypeNULL_SOURCE_TARGETtarget

Constructor Summary

AccessConstructor and Description
public
TransitionEvent(EventType<? extends Event>
the event type
eventType
,
StyleableProperty<?>
the StyleableProperty that is targeted by the transition
property
,
Duration
the time that has elapsed since the transition has entered its active period
elapsedTime
)
Deprecated for removal since 24. use TransitionEvent(EventType, StyleableProperty, String, Duration) instead

Creates a new instance of the TransitionEvent class.

public
TransitionEvent(EventType<? extends Event>
the event type
eventType
,
StyleableProperty<?>
the StyleableProperty that is targeted by the transition
property
,
String
the name of the targeted CSS property or sub-property
propertyName
,
Duration
the time that has elapsed since the transition has entered its active period
elapsedTime
)

Creates a new instance of the TransitionEvent class.

Method Summary

Modifier and TypeMethod and Description
public Duration

Returns:

the elapsed time, or zero if the transition has not entered its active period
getElapsedTime
()

Gets the time that has elapsed since the transition has entered its active period, not including the time spent in the delay phase.

public StyleableProperty<?>

Returns:

the StyleableProperty
getProperty
()

Gets the StyleableProperty that is targeted by the transition.

public String

Returns:

the CSS property or sub-property name
getPropertyName
()

Gets the name of the CSS property or sub-property that is targeted by the transition.

Inherited from javafx.event.Event:
cloneconsumecopyForfireEventgetEventTypegetTargetisConsumed

Field Detail

ANYback to summary
public static final EventType<TransitionEvent> ANY

Hides javafx.event.Event.ANY.

Common supertype for all TransitionEvent types.

CANCELback to summary
public static final EventType<TransitionEvent> CANCEL

This event occurs when a running transition was cancelled before it has reached the end of its active period.

elapsedTimeback to summary
private final Duration elapsedTime

The time that has elapsed since the transition has entered its active period, not including the time spent in the delay phase.

ENDback to summary
public static final EventType<TransitionEvent> END

This event occurs when a running transition has reached the end of its active period. If the transition is cancelled prior to reaching the end of its active period, this event does not occur.

propertyback to summary
private final StyleableProperty<?> property

The StyleableProperty that is targeted by the transition.

propertyNameback to summary
private final String propertyName

The name of the CSS property or sub-property that is targeted by the transition.

RUNback to summary
public static final EventType<TransitionEvent> RUN

This event occurs when a transition has been created and added to the list of running transitions of a Node.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javafx.event.Event.serialVersionUID.

STARTback to summary
public static final EventType<TransitionEvent> START

This event occurs when a running transition enters its active period, which happens at the end of the delay phase.

Constructor Detail

TransitionEventback to summary
public TransitionEvent(EventType<? extends Event> eventType, StyleableProperty<?> property, Duration elapsedTime)

Deprecated

for removal since 24.

use TransitionEvent(EventType, StyleableProperty, String, Duration) instead

Creates a new instance of the TransitionEvent class.

Parameters
eventType:EventType<? extends Event>

the event type

property:StyleableProperty<?>

the StyleableProperty that is targeted by the transition

elapsedTime:Duration

the time that has elapsed since the transition has entered its active period

Annotations
@Deprecated
since:24
forRemoval:true
Exceptions
NullPointerException:
if eventType, property or elapsedTime is null
TransitionEventback to summary
public TransitionEvent(EventType<? extends Event> eventType, StyleableProperty<?> property, String propertyName, Duration elapsedTime)

Creates a new instance of the TransitionEvent class.

Parameters
eventType:EventType<? extends Event>

the event type

property:StyleableProperty<?>

the StyleableProperty that is targeted by the transition

propertyName:String

the name of the targeted CSS property or sub-property

elapsedTime:Duration

the time that has elapsed since the transition has entered its active period

Exceptions
NullPointerException:
if any of the arguments is null
Since
24

Method Detail

getElapsedTimeback to summary
public Duration getElapsedTime()

Gets the time that has elapsed since the transition has entered its active period, not including the time spent in the delay phase.

Returns:Duration

the elapsed time, or zero if the transition has not entered its active period

getPropertyback to summary
public StyleableProperty<?> getProperty()

Gets the StyleableProperty that is targeted by the transition.

Returns:StyleableProperty<?>

the StyleableProperty

getPropertyNameback to summary
public String getPropertyName()

Gets the name of the CSS property or sub-property that is targeted by the transition.

The name of the CSS property under transition can be a long-hand property name, which is different from the name returned by CssMetaData#getProperty() of the StyleableProperty that is targeted by the transition. For example, if a transition targets Region#borderProperty(), the name of the CSS property might be -fx-border-color, -fx-border-radius, etc.

Returns:String

the CSS property or sub-property name

Since
24