Search in sources :

Example 11 with Node

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);
}
Also used : Node(javafx.scene.Node) Text(javafx.scene.text.Text)

Example 12 with Node

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);
}
Also used : SensorField(il.ac.technion.cs.smarthouse.simulator.model.SensorField) ComboBox(javafx.scene.control.ComboBox) Node(javafx.scene.Node) Label(javafx.scene.control.Label) ArrayList(java.util.ArrayList) TextField(javafx.scene.control.TextField)

Example 13 with Node

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);
}
Also used : Node(javafx.scene.Node)

Example 14 with Node

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;
}
Also used : SessionModel(io.github.vocabhunter.gui.model.SessionModel) Node(javafx.scene.Node) SessionViewTool(io.github.vocabhunter.gui.view.SessionViewTool)

Example 15 with Node

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);
}
Also used : Node(javafx.scene.Node) ControllerAndView(io.github.vocabhunter.gui.common.ControllerAndView) FXMLLoader(javafx.fxml.FXMLLoader)

Aggregations

Node (javafx.scene.Node)118 Label (javafx.scene.control.Label)18 Stage (javafx.stage.Stage)17 Parent (javafx.scene.Parent)16 Button (javafx.scene.control.Button)16 ArrayList (java.util.ArrayList)15 ObservableList (javafx.collections.ObservableList)14 FXML (javafx.fxml.FXML)14 List (java.util.List)12 BorderPane (javafx.scene.layout.BorderPane)12 HBox (javafx.scene.layout.HBox)11 IOException (java.io.IOException)10 Platform (javafx.application.Platform)10 Insets (javafx.geometry.Insets)10 Color (javafx.scene.paint.Color)10 FXCollections (javafx.collections.FXCollections)9 MouseEvent (javafx.scene.input.MouseEvent)9 VBox (javafx.scene.layout.VBox)9 FadeTransition (javafx.animation.FadeTransition)8 MenuItem (javafx.scene.control.MenuItem)8