- All Superinterfaces:
Disableable,PropertyBean
- All Known Subinterfaces:
FileBasedActivity
- All Known Implementing Classes:
AbstractActivity,AbstractFileBasedActivity
Application.
The life-cycle of an Activity is managed by an Application,
it consists of the following steps:
- Creation
The user invokes anActionthat instantiates a newActivityfor theApplication, which is passed as an argument to the constructor of theActivity. - Initialisation
TheActionadds theActivityto theApplication.
TheApplicationinvokesinit().
TheApplicationretrievesActions from theActivityand creates user interface elements for them. TheApplicationretrieves theNodefrom theActivityand adds it to one of its scene graphs. - Start
TheApplicationinvokesstart(), to inform the activity that it can start (or resume) execution. - Stop
TheApplicationinvokesstop(), to inform the activity that it should stop (or suspend) execution.
TheApplicationcan invokestart()again, to resume execution. - Destruction
When the view is no longer needed, theApplicationensures that the activity is destroyed.
TheApplicationinvokesdestroy().
TheApplicationremoves theNodeof theActivityfrom its scene graph.
TheApplicationsets theapplicationProperty()to null.
An activity can be disabled. See Disableable.
Actions can store arbitrary transient data in the activity.
This facility is provided by extending the interface PropertyBean.
- Author:
- Werner Randelshofer
-
Property Summary
PropertiesTypePropertyDescription@NonNull javafx.beans.property.ObjectProperty<Application> The application property is maintained by theApplicationthat manages this activity.@NonNull javafx.beans.property.IntegerPropertyUsed by the application to display unique titles if multiple activities have the same title.@NonNull javafx.beans.property.StringPropertyThe title of the activity as displayed in the title bars of the activity’s windows and in alert dialogs related to the activity.Properties inherited from interface org.jhotdraw8.fxbase.control.Disableable
disabled -
Field Summary
FieldsFields inherited from interface org.jhotdraw8.fxbase.control.Disableable
DISABLED_PROPERTY -
Method Summary
Modifier and TypeMethodDescription@NonNull javafx.beans.property.ObjectProperty<Application> The application property is maintained by theApplicationthat manages this activity.voiddestroy()Destroys the activity.@NonNull javafx.beans.property.IntegerPropertyUsed by the application to display unique titles if multiple activities have the same title.Gets the value of theactionsproperty.default @NonNull ApplicationGets the value of theapplicationproperty.default intGets the value of thedisambiguationproperty.javafx.scene.NodegetNode()Returns a JavaFX node that provides a user interface for the activity.getTitle()Gets the value of thetitleproperty.voidinit()Initializes the activity.default voidsetApplication(@NonNull Application application) Sets the value of theapplicationproperty.default voidsetDisambiguation(int newValue) Sets the value of thedisambiguationproperty.default voidSets the value of thetitleproperty.voidstart()Starts the activity.voidstop()Stops the activity.@NonNull javafx.beans.property.StringPropertyThe title of the activity as displayed in the title bars of the activity’s windows and in alert dialogs related to the activity.Methods inherited from interface org.jhotdraw8.fxbase.control.Disableable
addDisabler, disabledProperty, disablers, isDisabled, removeDisablerMethods inherited from interface org.jhotdraw8.fxbase.beans.PropertyBean
get, getNonNull, getProperties, getProperty, put, remove, set, setNonNull, valueAt
-
Property Details
-
actions
- See Also:
-
application
@NonNull javafx.beans.property.ObjectProperty<Application> applicationPropertyThe application property is maintained by theApplicationthat manages this activity.The value is set to the application before
init()is called.The value is set to null after
destroy()has been called.- See Also:
-
disambiguation
@NonNull javafx.beans.property.IntegerProperty disambiguationPropertyUsed by the application to display unique titles if multiple activities have the same title.- See Also:
-
title
@NonNull javafx.beans.property.StringProperty titlePropertyThe title of the activity as displayed in the title bars of the activity’s windows and in alert dialogs related to the activity.If the activity can be associated to a name, then the title should be that name. If the name has not been assigned yet, the title should be 'unnamed'.
- See Also:
-
-
Field Details
-
APPLICATION_PROPERTY
- See Also:
-
DISAMBIGUATION_PROPERTY
- See Also:
-
TITLE_PROPERTY
- See Also:
-
-
Method Details
-
actionsProperty
- Returns:
- the activities
- See Also:
-
getActions
Gets the value of theactionsproperty. -
applicationProperty
@NonNull javafx.beans.property.ObjectProperty<Application> applicationProperty()The application property is maintained by theApplicationthat manages this activity.The value is set to the application before
init()is called.The value is set to null after
destroy()has been called.- Returns:
- the property
- See Also:
-
disambiguationProperty
@NonNull javafx.beans.property.IntegerProperty disambiguationProperty()Used by the application to display unique titles if multiple activities have the same title.- Returns:
- the property
- See Also:
-
setApplication
Sets the value of theapplicationproperty.- Property description:
- The application property is maintained by the
Applicationthat manages this activity.The value is set to the application before
init()is called.The value is set to null after
destroy()has been called. - Parameters:
application- the value for theapplicationproperty- See Also:
-
getApplication
Gets the value of theapplicationproperty.- Property description:
- The application property is maintained by the
Applicationthat manages this activity.The value is set to the application before
init()is called.The value is set to null after
destroy()has been called. - Returns:
- the value of the
applicationproperty - See Also:
-
getDisambiguation
default int getDisambiguation()Gets the value of thedisambiguationproperty.- Property description:
- Used by the application to display unique titles if multiple activities have the same title.
- Returns:
- the value of the
disambiguationproperty - See Also:
-
setDisambiguation
default void setDisambiguation(int newValue) Sets the value of thedisambiguationproperty.- Property description:
- Used by the application to display unique titles if multiple activities have the same title.
- Parameters:
newValue- the value for thedisambiguationproperty- See Also:
-
getNode
javafx.scene.Node getNode()Returns a JavaFX node that provides a user interface for the activity.- Returns:
- the node
-
getTitle
Gets the value of thetitleproperty.- Property description:
- The title of the activity as displayed in the title bars of the
activity’s windows and in alert dialogs related to the activity.
If the activity can be associated to a name, then the title should be that name. If the name has not been assigned yet, the title should be 'unnamed'.
- Returns:
- the value of the
titleproperty - See Also:
-
setTitle
Sets the value of thetitleproperty.- Property description:
- The title of the activity as displayed in the title bars of the
activity’s windows and in alert dialogs related to the activity.
If the activity can be associated to a name, then the title should be that name. If the name has not been assigned yet, the title should be 'unnamed'.
- Parameters:
newValue- the value for thetitleproperty- See Also:
-
init
void init()Initializes the activity.See life-cycle in
Activity. -
start
void start()Starts the activity.See life-cycle in
Activity. -
stop
void stop()Stops the activity.See life-cycle in
Activity. -
destroy
void destroy()Destroys the activity.See life-cycle in
Activity. -
titleProperty
@NonNull javafx.beans.property.StringProperty titleProperty()The title of the activity as displayed in the title bars of the activity’s windows and in alert dialogs related to the activity.If the activity can be associated to a name, then the title should be that name. If the name has not been assigned yet, the title should be 'unnamed'.
- Returns:
- the title of the activity
- See Also:
-