Class TransitionEvent
- All Implemented Interfaces:
-
Serializable,Cloneable
public final class TransitionEvent extends Event
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 Type | Field | Description |
|---|---|---|
static final EventType |
ANY |
Common supertype for all TransitionEvent types. |
static final EventType |
CANCEL |
This event occurs when a running transition was cancelled before it has reached the end of its active period. |
static final EventType |
END |
This event occurs when a running transition has reached the end of its active period. |
static final EventType |
RUN |
This event occurs when a transition has been created and added to the list of running transitions of a Node. |
static final EventType |
START |
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
| Constructor | Description |
|---|---|
TransitionEvent |
Creates a new instance of the TransitionEvent class. |
TransitionEvent |
Deprecated, for removal: This API element is subject to removal in a future version. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
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. |
StyleableProperty |
getProperty() |
Gets the StyleableProperty that is targeted by the transition. |
String |
getPropertyName() |
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
public static final EventType<TransitionEvent> ANY
TransitionEvent types.RUN
public static final EventType<TransitionEvent> RUN
Node.START
public static final EventType<TransitionEvent> START
END
public static final EventType<TransitionEvent> END
CANCEL
public static final EventType<TransitionEvent> CANCEL
Constructor Details
TransitionEvent
@Deprecated(since="24", forRemoval=true) public TransitionEvent(EventType<? extends Event> eventType, StyleableProperty<?> property, Duration elapsedTime)
TransitionEvent class.- Parameters:
-
eventType- the event type -
property- theStyleablePropertythat is targeted by the transition -
elapsedTime- the time that has elapsed since the transition has entered its active period - Throws:
-
NullPointerException- ifeventType,propertyorelapsedTimeisnull
TransitionEvent
public TransitionEvent(EventType<? extends Event> eventType, StyleableProperty<?> property, String propertyName, Duration elapsedTime)
TransitionEvent class.- Parameters:
-
eventType- the event type -
property- theStyleablePropertythat is targeted by the transition -
propertyName- the name of the targeted CSS property or sub-property -
elapsedTime- 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
public StyleableProperty<?> getProperty()
StyleableProperty that is targeted by the transition.- Returns:
- the
StyleableProperty
getPropertyName
public String getPropertyName()
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:
- the CSS property or sub-property name
- Since:
- 24
getElapsedTime
public Duration getElapsedTime()
- Returns:
- the elapsed time, or zero if the transition has not entered its active period
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
TransitionEvent(EventType, StyleableProperty, String, Duration)instead