Module org.jhotdraw8.application
Package org.jhotdraw8.application
Class AbstractFileBasedApplication
java.lang.Object
javafx.application.Application
org.jhotdraw8.application.AbstractApplication
org.jhotdraw8.application.AbstractFileBasedApplication
- All Implemented Interfaces:
Application,FileBasedApplication,PropertyBean,Disableable
public abstract class AbstractFileBasedApplication
extends AbstractApplication
implements FileBasedApplication
An
AbstractFileBasedApplication handles the life-cycle of FileBasedActivity objects and
provides stages to present them on screen.
This implementation supports the following command line parameters:
[path ...]
- path
- The URI to a file. Opens a
FileBasedActivityfor each provided path.
- Author:
- Werner Randelshofer
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyObjectProperty<Activity> Provides the currently active activities.Properties inherited from class org.jhotdraw8.application.AbstractApplication
actions, activities, activityFactory, disabled, maxNumberOfRecentUris, menuBarFactory, preferences, recentUris, resources, stylesheetsProperties inherited from interface org.jhotdraw8.application.Application
actions, activities, activityFactory, maxNumberOfRecentUris, menuBarFactory, preferences, recentUris, resources, stylesheetsProperties inherited from interface org.jhotdraw8.fxbase.control.Disableable
disabled -
Nested Class Summary
Nested classes/interfaces inherited from class javafx.application.Application
javafx.application.Application.Parameters -
Field Summary
FieldsFields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENAFields inherited from interface org.jhotdraw8.application.Application
ACTIONS_PROPERTY, ACTIVITIES_PROPERTY, ACTIVITY_FACTORY_PROPERTY, COPYRIGHT_KEY, LICENSE_KEY, MAX_NUMBER_OF_RECENT_URIS_PROPERTY, MENU_BAR_FACTORY_PROPERTY, NAME_KEY, PREFERENCES_PROPERTY, RECENT_URIS_PROPERTY, RESOURCE_BUNDLE_PROPERTY, STYLESHEETS_PROPERTY, VERSION_KEYFields inherited from interface org.jhotdraw8.fxbase.control.Disableable
DISABLED_PROPERTYFields inherited from interface org.jhotdraw8.application.FileBasedApplication
ALLOW_MULTIPLE_ACTIVITIES_WITH_SAME_URI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ReadOnlyObjectProperty<Activity> Provides the currently active activities.protected @Nullable javafx.scene.control.MenuBarcreateMenuBar(@Nullable FileBasedActivity activity, @Nullable javafx.stage.Stage stage, @NonNull Map<String, Action> actions) Creates a menu bar and sets it to the stage or to the system menu.protected @NonNull javafx.stage.StagecreateStage(@NonNull FileBasedActivity activity) voidexit()Exits the application.final voidinit()protected voidinitActions(@NonNull javafx.collections.ObservableMap<String, Action> map) protected voidprotected voidprotected voidprotected voidstatic voidprotected voidCalled immediately when a views needs to be activated.protected voidonActivityAdded(@NonNull FileBasedActivity activity) Called immediately after a view has been added to the views property.protected voidCalled immediately when a view needs to be deactivated.protected voidonActivityRemoved(@NonNull FileBasedActivity activity) Called immediately after a view has been removed from the views property.protected voidonTitleChanged(javafx.beans.Observable obs) voidstart(javafx.stage.Stage primaryStage) Methods inherited from class org.jhotdraw8.application.AbstractApplication
actionsProperty, activitiesProperty, activityFactoryProperty, disabledProperty, disablers, getExecutor, getProperties, loadRecentUris, maxNumberOfRecentUrisProperty, menuBarFactoryProperty, preferencesProperty, recentUrisProperty, resourcesProperty, stylesheetsPropertyMethods inherited from class javafx.application.Application
getHostServices, getParameters, getUserAgentStylesheet, launch, launch, notifyPreloader, setUserAgentStylesheet, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.application.Application
actionsProperty, activitiesProperty, activityFactoryProperty, createActivity, getActions, getActiveActivity, getActivities, getActivityFactory, getExecutor, getMaxNumberOfRecentUris, getMenuBarFactory, getNode, getPreferences, getRecentUris, getResources, getStylesheets, maxNumberOfRecentUrisProperty, menuBarFactoryProperty, preferencesProperty, recentUrisProperty, resourcesProperty, setActivityFactory, setMaxNumberOfRecentUris, setMenuBarFactory, setPreferences, setResources, stylesheetsPropertyMethods 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
-
activeActivity
- Specified by:
activeActivityPropertyin interfaceApplication- Returns:
- The active activities.
- See Also:
-
-
Field Details
-
WINDOW_MENU_ID
- See Also:
-
FILE_OPEN_RECENT_MENU
- See Also:
-
-
Constructor Details
-
AbstractFileBasedApplication
public AbstractFileBasedApplication()
-
-
Method Details
-
main
- Parameters:
args- the command line arguments
-
activeActivityProperty
Description copied from interface:ApplicationProvides the currently active activities. This is the last activities which was focus owner. Returns null, if the application has no views.- Specified by:
activeActivityPropertyin interfaceApplication- Returns:
- the
activeActivityproperty
-
createMenuBar
protected @Nullable javafx.scene.control.MenuBar createMenuBar(@Nullable FileBasedActivity activity, @Nullable javafx.stage.Stage stage, @NonNull Map<String, Action> actions) Creates a menu bar and sets it to the stage or to the system menu.- Parameters:
stage- the stage, or null to set the system menuactions- the action map- Returns:
- the menu bar
-
exit
public void exit()Description copied from interface:ApplicationExits the application.- Specified by:
exitin interfaceApplication
-
onActivityActivated
Called immediately when a views needs to be activated.- Parameters:
view- the view
-
onActivityAdded
Called immediately after a view has been added to the views property.- Parameters:
activity- the activity
-
createStage
-
onActivityDeactivated
Called immediately when a view needs to be deactivated.- Parameters:
view- the view
-
onActivityRemoved
Called immediately after a view has been removed from the views property.- Parameters:
activity- the view
-
onTitleChanged
protected void onTitleChanged(javafx.beans.Observable obs) -
start
public void start(javafx.stage.Stage primaryStage) - Specified by:
startin classjavafx.application.Application
-
getUrisToOpen
-
init
public final void init()- Overrides:
initin classjavafx.application.Application
-
initTheme
protected void initTheme() -
initResourceBundle
protected void initResourceBundle() -
initProperties
protected void initProperties() -
initFactories
protected void initFactories() -
initActions
-