Search in sources :

Example 26 with Scene

use of javafx.scene.Scene in project Entitas-Java by Rubentxu.

the class VisualDebbuger method start.

@Override
public void start(Stage primaryStage) throws Exception {
    FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("VisualDebbuger.fxml"));
    Parent root = loader.load();
    primaryStage.setTitle("CodeGenerator");
    primaryStage.setScene(new Scene(root, 560, 575));
    primaryStage.setResizable(false);
    primaryStage.show();
    stage = primaryStage;
    client = new JmxClient("localhost", 1313);
    Set<ObjectName> names = client.getBeanNames();
    beanNames.setText(names.stream().map(n -> n.getKeyPropertyListString()).reduce(String::concat).get());
//        MBeanAttributeInfo[] attributeInfos =
//                client.getAttributesInfo(objectName);
//        MBeanOperationInfo[] operationInfos =
//                client.getOperationsInfo(objectName);
}
Also used : Scene(javafx.scene.Scene) Initializable(javafx.fxml.Initializable) Properties(java.util.Properties) javafx.scene.control(javafx.scene.control) URL(java.net.URL) MBeanOperationInfo(javax.management.MBeanOperationInfo) MBeanAttributeInfo(javax.management.MBeanAttributeInfo) Set(java.util.Set) JmxClient(com.j256.simplejmx.client.JmxClient) ObjectName(javax.management.ObjectName) Application(javafx.application.Application) FXML(javafx.fxml.FXML) Parent(javafx.scene.Parent) ActionEvent(javafx.event.ActionEvent) Stage(javafx.stage.Stage) java.io(java.io) ResourceBundle(java.util.ResourceBundle) FXMLLoader(javafx.fxml.FXMLLoader) DirectoryChooser(javafx.stage.DirectoryChooser) Parent(javafx.scene.Parent) JmxClient(com.j256.simplejmx.client.JmxClient) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) ObjectName(javax.management.ObjectName)

Example 27 with Scene

use of javafx.scene.Scene in project Smartcity-Smarthouse by TechnionYP5777.

the class ShutterSensorSimulator method start.

@Override
public void start(final Stage primaryStage) throws Exception {
    final Parent root = FXMLLoader.load(getClass().getResource("/sensors/shutter/shutter_ui.fxml"));
    final Scene scene = new Scene(root);
    primaryStage.setTitle("Shutter Sensor Simulator");
    primaryStage.setScene(scene);
    primaryStage.show();
}
Also used : Parent(javafx.scene.Parent) Scene(javafx.scene.Scene)

Example 28 with Scene

use of javafx.scene.Scene in project Smartcity-Smarthouse by TechnionYP5777.

the class SosSensorSimulator method start.

@Override
public void start(final Stage s) throws Exception {
    sensor = new SosSensor(Random.sensorId(), 40001);
    for (boolean res = false; !res; ) res = sensor.register();
    final Image sosImage = new Image(getClass().getResourceAsStream("/sensors/sos/sos_icon.png"), 320, 0, true, true);
    final Button sosButton = new Button();
    sosButton.setId("sosButton");
    sosButton.setGraphic(new ImageView(sosImage));
    sosButton.setStyle("-fx-focus-color: transparent;");
    sosButton.setOnAction(event -> sensor.updateSystem());
    final StackPane layout = new StackPane();
    layout.getChildren().add(sosButton);
    s.setScene(new Scene(layout, 320, 268));
    s.setTitle("SOS Sensor Simulator");
    s.show();
}
Also used : SosSensor(il.ac.technion.cs.smarthouse.sensors.sos.SosSensor) Button(javafx.scene.control.Button) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 29 with Scene

use of javafx.scene.Scene in project Smartcity-Smarthouse by TechnionYP5777.

the class Controller method openConfiguration.

private void openConfiguration(Integer position) {
    try {
        URL location = getClass().getClassLoader().getResource("dashboard_configuration_ui.fxml");
        // System.out.println(location);todo: ELIA why is this the location?
        final FXMLLoader fxmlLoader = new FXMLLoader(location);
        final Parent root1 = (Parent) fxmlLoader.load();
        final Stage stage = new Stage();
        ConfigurationController controller = fxmlLoader.getController();
        controller.SetCallback(() -> updateTile(controller.getChosenType(), controller.getChosenPath(), position));
        stage.setScene(new Scene(root1));
        stage.show();
    } catch (final Exception $) {
        // TODO: handle error
        System.out.println("Oops...");
        $.printStackTrace();
    }
}
Also used : Parent(javafx.scene.Parent) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) URL(java.net.URL) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 30 with Scene

use of javafx.scene.Scene in project Smartcity-Smarthouse by TechnionYP5777.

the class TempDashboard method start.

@Override
public void start(Stage stage) throws Exception {
    pane = new FlowPane(Orientation.HORIZONTAL, 1, 1, textTile);
    pane.setPadding(new Insets(5));
    pane.setPrefSize(150, 150);
    pane.setBackground(new Background(new BackgroundFill(Tile.BACKGROUND.darker(), CornerRadii.EMPTY, Insets.EMPTY)));
    Scene scene = new Scene(pane);
    stage.setTitle("Dashboard Configuration in Action");
    stage.setScene(scene);
    stage.show();
}
Also used : Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) FlowPane(javafx.scene.layout.FlowPane) Scene(javafx.scene.Scene)

Aggregations

Scene (javafx.scene.Scene)262 Stage (javafx.stage.Stage)58 BorderPane (javafx.scene.layout.BorderPane)56 Group (javafx.scene.Group)44 KeyCode (javafx.scene.input.KeyCode)39 StackPane (javafx.scene.layout.StackPane)35 PerspectiveCamera (javafx.scene.PerspectiveCamera)31 Button (javafx.scene.control.Button)30 FXMLLoader (javafx.fxml.FXMLLoader)28 Rotate (javafx.scene.transform.Rotate)28 Insets (javafx.geometry.Insets)27 Label (javafx.scene.control.Label)27 MouseEvent (javafx.scene.input.MouseEvent)27 Parent (javafx.scene.Parent)26 PointLight (javafx.scene.PointLight)24 IOException (java.io.IOException)23 VBox (javafx.scene.layout.VBox)20 ArrayList (java.util.ArrayList)18 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)16 AnimationTimer (javafx.animation.AnimationTimer)14