use of com.canoo.platform.samples.distribution.client.view.ToDoView in project dolphin-platform-examples by canoo.
the class DistributionClient method connect.
private void connect(final Stage primaryStage, final URI endpoint) {
final ClientContextFactory clientContextFactory = PlatformClient.getService(ClientContextFactory.class);
final ClientContext clientContext = clientContextFactory.create(PlatformClient.getClientConfiguration(), endpoint);
clientContext.connect().handle((v, e) -> {
if (e != null) {
e.printStackTrace();
System.exit(-1);
}
Platform.runLater(() -> {
try {
ToDoView viewController = new ToDoView(clientContext);
Scene scene = new Scene(viewController.getParent());
scene.getStylesheets().add(DistributionClient.class.getResource("style.css").toExternalForm());
primaryStage.setScene(scene);
} catch (Exception e1) {
e1.printStackTrace();
System.exit(-1);
}
});
return null;
});
}
Aggregations