Class TransitionEvent
java.lang.Object
java.util.EventObject
javafx.event.Event
javafx.css.TransitionEvent
- All Implemented Interfaces:
Serializable
,Cloneable
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
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EventType
<TransitionEvent> Common supertype for allTransitionEvent
types.static final EventType
<TransitionEvent> This event occurs when a running transition was cancelled before it has reached the end of its active period.static final EventType
<TransitionEvent> This event occurs when a running transition has reached the end of its active period.static final EventType
<TransitionEvent> This event occurs when a transition has been created and added to the list of running transitions of aNode
.static final EventType
<TransitionEvent> This event occurs when a running transition enters its active period, which happens at the end of the delay phase.Fields declared in class javafx.event.Event
consumed, eventType, NULL_SOURCE_TARGET, target
Fields declared in class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionTransitionEvent
(EventType<? extends Event> eventType, StyleableProperty<?> property, String propertyName, Duration elapsedTime) Creates a new instance of theTransitionEvent
class.TransitionEvent
(EventType<? extends Event> eventType, StyleableProperty<?> property, Duration elapsedTime) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionGets the time that has elapsed since the transition has entered its active period, not including the time spent in the delay phase.Gets theStyleableProperty
that is targeted by the transition.Gets the name of the CSS property or sub-property that is targeted by the transition.Methods declared in class javafx.event.Event
clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed
Methods declared in class java.util.EventObject
getSource, toString
-
Field Details
-
ANY
Common supertype for allTransitionEvent
types. -
RUN
This event occurs when a transition has been created and added to the list of running transitions of aNode
. -
START
This event occurs when a running transition enters its active period, which happens at the end of the delay phase. -
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. -
CANCEL
This event occurs when a running transition was cancelled before it has reached the end of its active period.
-
-
Constructor Details
-
TransitionEvent
@Deprecated(since="24", forRemoval=true) public TransitionEvent(EventType<? extends Event> eventType, StyleableProperty<?> property, Duration elapsedTime) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new instance of theTransitionEvent
class.- Parameters:
eventType
- the event typeproperty
- theStyleableProperty
that is targeted by the transitionelapsedTime
- the time that has elapsed since the transition has entered its active period- Throws:
NullPointerException
- ifeventType
,property
orelapsedTime
isnull
-
TransitionEvent
public TransitionEvent(EventType<? extends Event> eventType, StyleableProperty<?> property, String propertyName, Duration elapsedTime) Creates a new instance of theTransitionEvent
class.- Parameters:
eventType
- the event typeproperty
- theStyleableProperty
that is targeted by the transitionpropertyName
- the name of the targeted CSS property or sub-propertyelapsedTime
- the time that has elapsed since the transition has entered its active period- Throws:
NullPointerException
- if any of the arguments isnull
- Since:
- 24
-
-
Method Details
-
getProperty
Gets theStyleableProperty
that is targeted by the transition.- Returns:
- the
StyleableProperty
-
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 theStyleableProperty
that is targeted by the transition. For example, if a transition targetsRegion.borderProperty()
, the name of the CSS property might be-fx-border-color
,-fx-border-radius
, etc.- Returns:
- the CSS property or sub-property name
- Since:
- 24
-
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:
- the elapsed time, or zero if the transition has not entered its active period
-
TransitionEvent(EventType, StyleableProperty, String, Duration)
instead