MVCfx
org.scalafx.extras.mvcfx.MVCfx
MVCfx is the "root" class for creation of UI components using MVCfx pattern. It instantiates and binds together the model, the controller, and the view (FXML).
The implementation of a class that extends MVCfx is very simple, it only needs instance of the model and information about location of the FXML resource. For example:
import org.scalafx.extras.mvcfx.MVCfx
class StopWatch(val model: StopWatchModel = new StopWatchModel())
extends MVCfx[StopWatchController]("StopWatch.fxml"):
def controllerInstance: StopWatchController = new StopWatchController(model)
The implementation will include:
StopWatchextends MVCfxStopWatchModelextends ModelFXStopWatchControllerextends ControllerFXStopWatch.fxml
The complete example in in demo module.
See more details on MVCfx see MVCfx Pattern wiki.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ProgressStatus
Members list
In this article