use of javafx.scene.Node in project Smartcity-Smarthouse by TechnionYP5777.
the class Controller method printUpdateMessage.
private void printUpdateMessage() {
final ObservableList<Node> children = console.getChildren();
Text text = new Text("Sending update message: {on: ");
text.setStyle(STYLE_REG);
children.add(0, text);
text = new Text(on + "");
text.setStyle(on ? STYLE_ON : STYLE_OFF);
children.add(1, text);
text = new Text(", temperature: ");
text.setStyle(STYLE_REG);
children.add(2, text);
text = new Text((int) tempSlider.getValue() + "");
text.setStyle(STYLE_TEMP);
children.add(3, text);
text = new Text("}\n");
text.setStyle(STYLE_REG);
children.add(4, text);
}
use of javafx.scene.Node in project Smartcity-Smarthouse by TechnionYP5777.
the class MessageViewController method buildStreamModePane.
void buildStreamModePane() {
streamFieldMap = new HashMap<>();
int currentRow = 0;
streamMode.add(new Label("Name"), 0, currentRow);
streamMode.add(new Label("From"), 1, currentRow);
streamMode.add(new Label("To"), 2, currentRow++);
for (final SensorField ¢ : currentSensor.getFields()) {
streamMode.add(new Label(¢.getName()), 0, currentRow);
final List<Node> nodes = new ArrayList<>();
if (¢.getType() == Types.BOOLEAN) {
final ComboBox<BooleanValues> b = new ComboBox<>();
b.getItems().addAll(BooleanValues.values());
streamMode.add(b, 1, currentRow);
nodes.add(b);
} else {
final TextField t1 = new TextField(), t2 = new TextField();
streamMode.add(t1, 1, currentRow);
nodes.add(t1);
if (¢.getType() != Types.STRING) {
streamMode.add(t2, 2, currentRow);
nodes.add(t2);
}
}
streamFieldMap.put(¢, nodes);
++currentRow;
}
streamMode.add(new Label("Send Interval(integer only):"), 0, currentRow);
final TextField t1 = new TextField(), t2 = new TextField();
streamMode.add(t1, 1, currentRow);
streamMode.add(t2, 2, currentRow);
timeInput = new Pair<>(t1, t2);
}
use of javafx.scene.Node in project Smartcity-Smarthouse by TechnionYP5777.
the class SystemPresenter method loadPresenter.
private static PresenterInfo loadPresenter(final FXMLLoader l) throws Exception {
final Node n = l.load();
final Object child = l.getController();
if (!SystemPresenter.class.isAssignableFrom(child.getClass()))
throw new Exception("Child (" + child.getClass() + ") must extend " + SystemPresenter.class);
return new PresenterInfo(n, (SystemPresenter) child);
}
use of javafx.scene.Node in project VocabHunter by VocabHunter.
the class SessionStateHandler method addSession.
public SessionModel addSession(final SessionState state) {
SessionViewTool viewTool = new SessionViewTool();
SessionModelTool sessionTool = new SessionModelTool(state, model.getFilterSettings(), viewTool.selectedProperty(), settingsManager.getWindowSettings().orElseGet(WindowSettings::new));
SessionModel sessionModel = sessionTool.buildModel();
ControllerAndView<SessionController, Node> cav = sessionProvider.get();
SessionController controller = cav.getController();
controller.initialise(guiTaskHandler, sessionModel);
viewTool.setTabContent(SessionTab.ANALYSIS, cav.getView());
viewTool.setTabContent(SessionTab.PROGRESS, progressView(sessionModel));
mainBorderPane.setCenter(viewTool.getView());
sessionActions = controller.getSessionActions();
return sessionModel;
}
use of javafx.scene.Node in project VocabHunter by VocabHunter.
the class ProgressProvider method get.
@Override
public ControllerAndView<ProgressController, Node> get() {
FXMLLoader loader = loaderProvider.get();
Node root = ViewFxml.PROGRESS.loadNode(loader);
ProgressController controller = loader.getController();
return new ControllerAndView<>(controller, root);
}
Aggregations