Type | Property and Description |
---|---|
javafx.beans.property.ObjectProperty<View> |
currentView
Property representing the currently set view inside this ViewManager instance.
|
Constructor and Description |
---|
ViewManager()
Creates a new ViewManager instance - this should not be called by users,
and instead should be left to Particle to manage.
|
Modifier and Type | Method and Description |
---|---|
javafx.beans.property.ObjectProperty<View> |
currentViewProperty()
Property representing the currently set view inside this ViewManager instance.
|
void |
dispose()
This method is called on application shutdown so that the views can be disposed.
|
View |
getCurrentView()
Gets the value of the property currentView.
|
void |
init()
This method is called on application startup so that the views can be
correctly initialised.
|
void |
registerView(java.lang.Class<? extends View> viewClass)
Registers the given view class - the name that will be used will be read
from the
ParticleView.name() value. |
void |
setCurrentView(View value)
Sets the value of the property currentView.
|
void |
switchView(java.lang.Class<? extends View> viewCls)
This will attempt to remove the current view, and replace it with the
given view class.
|
void |
switchView(java.lang.String viewName)
This will attempt to remove the current view, and replace it with the view
with the given name.
|
void |
unregisterView(java.lang.Class<? extends View> viewClass)
Removes the given view from the view manager, and disposes it if it has
previously be instantiated.
|
public final javafx.beans.property.ObjectProperty<View> currentViewProperty
getCurrentView()
,
setCurrentView(View)
public ViewManager()
public final View getCurrentView()
public final void setCurrentView(View value)
public final javafx.beans.property.ObjectProperty<View> currentViewProperty()
getCurrentView()
,
setCurrentView(View)
public void init()
public void dispose()
public void switchView(java.lang.Class<? extends View> viewCls)
public void switchView(java.lang.String viewName)
public void registerView(java.lang.Class<? extends View> viewClass)
ParticleView.name()
value. Note that this method only
needs to be called in instances where Views are not automatically discovered
due to their @ParticleView
annotation (so, only in rare
cases is this method needing to be called).public void unregisterView(java.lang.Class<? extends View> viewClass)