public class JFXRootView extends Object implements DMXView
This class represents root view of JavaFX application. All views added to application are rooted in this view.
This view does not have any data associated, but merely serves as a container for other views. When multiple subviews are added to this views,they will be stacked on top of each other, with the last view being on top. Views are stacked in Z-order, so that only last added view is visible.
It is possible to control the placement of the views by specifying view placement constraint. This constraint is positive integer. The higher the value, the higher view will be in Z-order. Thus, view with the highest placement constraint value will be on top.
Modifier and Type | Field and Description |
---|---|
static String |
JFX_ROOT_VIEW_ID
View ID of the root view.
|
Constructor and Description |
---|
JFXRootView(javafx.stage.Stage stage)
Create new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildView(DMXView child)
Adds specified view as a child of this view.
|
void |
constructUI()
This method should be used for initial creation of user interface.
|
String |
getParentViewId()
Returns ID of parent view of this view.
|
Set<String> |
getViewDataIds()
Returns IDs of model data objects that are associated with this view.
|
String |
getViewId()
Returns this view ID.
|
Object |
getViewUI()
Returns an object that represents actual UI presentation of this view.
|
void |
render()
Renders this view for display.
|
void |
setViewActive(String id,
boolean state)
Activates or deactivates the view which is the child of this view, based on the value of parameter
state . |
void |
updateFromModel(Map<String,Object> dataMap)
Update this view with data from model.
|
Object |
viewPlacementConstraint()
Returns an object that represents layout constraint which should be
respected when placing this view.
|
public static final String JFX_ROOT_VIEW_ID
public JFXRootView(javafx.stage.Stage stage)
stage
- JavaFX stagepublic void render()
DMXView
public String getViewId()
DMXView
public String getParentViewId()
DMXView
getParentViewId
in interface DMXView
public Object viewPlacementConstraint()
DMXView
viewPlacementConstraint
in interface DMXView
public void addChildView(DMXView child)
DMXView
addChildView
in interface DMXView
child
- view to add as a childpublic Set<String> getViewDataIds()
DMXView
getViewDataIds
in interface DMXView
public void updateFromModel(Map<String,Object> dataMap)
DMXView
updateFromModel
in interface DMXView
dataMap
- model data mappublic Object getViewUI()
DMXView
public void constructUI()
DMXView
This method should be used for initial creation of user interface. It will be invoked from view manager to initially create UI. In order to maintain platform compatibility, it will be invoked on UI thread of the underlying platform.
Important: Implementing classes should use this method exclusively for initial UI construction.
constructUI
in interface DMXView
public void setViewActive(String id, boolean state)
DMXView
Activates or deactivates the view which is the child of this view, based on the value of parameter
state
. When view is active, it means it is visible and has
precedence over other view in the same position. For example, if views are
stacked in vertical order, active view is placed on the top of the view hierarchy.
setViewActive
in interface DMXView
id
- ID of the child view to activate or deactivatestate
- if true
, activate view. Otherwise, deactivate itCopyright © 2012-2014 Vektor Software. All Rights Reserved.