Example usage for javafx.scene Cursor DEFAULT

List of usage examples for javafx.scene Cursor DEFAULT

Introduction

In this page you can find the example usage for javafx.scene Cursor DEFAULT.

Prototype

Cursor DEFAULT

To view the source code for javafx.scene Cursor DEFAULT.

Click Source Link

Document

The default cursor type (gets set if no cursor is defined).

Usage

From source file:at.ac.tuwien.qse.sepm.gui.control.ImageTile.java

public ImageTile() {
    getStyleClass().add("imageTile");

    Group overlay = new Group();
    HBox overlayBox = new HBox();
    overlayBox.getStyleClass().add("hoverlay");
    overlayBox.getChildren().addAll(overLayIcon, name);
    overlay.getChildren().add(overlayBox);

    StackPane.setAlignment(overlay, Pos.CENTER);

    placeHolder.setGlyphSize(ImageSize.LARGE.pixels() * 0.6);

    setMinHeight(0);//w  w w. j a va 2s . com
    setMinWidth(0);
    imageView.setPreserveRatio(false);

    getChildren().add(placeHolder);
    getChildren().add(imageView);
    getChildren().add(overlay);

    setAlignment(overlay, Pos.CENTER);

    setOnMouseEntered((event) -> {
        if (photos.size() > 0) {
            setCursor(Cursor.HAND);
        }
    });

    setOnMouseExited((event -> setCursor(Cursor.DEFAULT)));

    imageView.visibleProperty().bind(photosProperty.emptyProperty().not());
    overlay.visibleProperty().bind(photosProperty.emptyProperty().not().and(name.textProperty().isNotEmpty()));
    placeHolder.visibleProperty().bind(photosProperty.emptyProperty());

    heightProperty().addListener(this::handleSizeChange);
    widthProperty().addListener(this::handleSizeChange);
}

From source file:calendarioSeries.vistas.NewSerieController.java

@FXML
public void handleOk() {
    String tituloAux = titulo.getText().replaceAll(" ", "+").toLowerCase();
    String toJson = readUrl(BASE + tituloAux + "&type=series" + "&r=json");
    resultados.getChildren().clear();/*  w w w.  ja  v  a2  s  . c  om*/
    try {
        JSONObject busqueda = new JSONObject(toJson);
        if (busqueda.getString("Response").equals("True")) {
            JSONArray res = busqueda.getJSONArray("Search");
            resultados.setPrefRows(res.length());
            for (int i = 0; i < res.length(); i++) {
                JSONObject resActual = new JSONObject(res.get(i).toString());
                HBox resultadoActual = new HBox(50);
                resultadoActual.setMaxWidth(Double.MAX_VALUE);
                resultadoActual.setAlignment(Pos.CENTER_LEFT);
                ImageView posterActual = new ImageView();

                try {
                    Image image = new Image(resActual.getString("Poster"));
                    posterActual.setImage(image);
                    posterActual.setFitHeight(240);
                    posterActual.setFitWidth(180);
                    posterActual.setPreserveRatio(false);
                    resultadoActual.getChildren().add(posterActual);
                } catch (IllegalArgumentException e) {
                    //                        System.out.println("Bad url");
                    Image image = new Image(
                            MainApp.class.getResource("resources/no-image.png").toExternalForm());
                    posterActual.setImage(image);
                    posterActual.setFitHeight(240);
                    posterActual.setFitWidth(180);
                    posterActual.setPreserveRatio(false);
                    resultadoActual.getChildren().add(posterActual);
                }

                String details;
                String nomSerie = new String(resActual.getString("Title").getBytes(), "UTF-8");
                String anoSerie = new String(resActual.getString("Year").getBytes(), "UTF-8");
                if (nomSerie.length() > 15) {
                    details = "%-12.12s...\t\t Ao: %-10s";
                } else {
                    details = "%-12s\t\t Ao: %-10s";
                }
                details = String.format(details, nomSerie, anoSerie);
                Label elemento = new Label(details);
                elemento.setMaxWidth(Double.MAX_VALUE);
                elemento.setMaxHeight(Double.MAX_VALUE);
                resultadoActual.getChildren().add(elemento);

                posterActual.setId(resActual.getString("imdbID"));
                posterActual.setOnMouseClicked(new EventHandler<MouseEvent>() {
                    @Override
                    public void handle(MouseEvent event) {
                        ImageView clickedButton = (ImageView) event.getSource();
                        Stage stage = (Stage) clickedButton.getScene().getWindow();
                        Task task = new Task() {
                            @Override
                            protected Object call() throws Exception {
                                mainController.mainApp.scene.setCursor(Cursor.WAIT);
                                Serie toAdd = new Serie(clickedButton.getId());
                                boolean possible = true;
                                for (Serie serie : mainController.getSeries()) {
                                    if (serie.equals(toAdd))
                                        possible = false;
                                }
                                if (possible)
                                    mainController.getSeries().add(toAdd);

                                try {
                                    mainController.populateImagenes();
                                    mainController.showDetallesMes(mainController.getMesActual());
                                } catch (Exception e) {
                                    e.printStackTrace();
                                } finally {
                                    mainController.mainApp.scene.setCursor(Cursor.DEFAULT);

                                    return mainController.getSeries();
                                }
                            }
                        };
                        Thread th = new Thread(task);
                        th.setDaemon(true);
                        th.start();
                        stage.close();
                    }
                });
                resultados.getChildren().add(resultadoActual);
            }
        } else {
            resultados.getChildren().add(new Label("La busqueda no obtuvo resultados"));
        }
    } catch (JSONException e) {
        e.printStackTrace();
    } catch (UnsupportedEncodingException ex) {
        Logger.getLogger(NewSerieController.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:dpfmanager.shell.interfaces.gui.component.report.ReportsView.java

private void addHeaders() {
    TableColumn colDate = new TableColumn(bundle.getString("colDate"));
    setMinMaxWidth(colDate, 75);//from  www.  j  av  a  2 s. com
    colDate.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("date"));

    TableColumn colTime = new TableColumn(bundle.getString("colTime"));
    setMinMaxWidth(colTime, 75);
    colTime.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("time"));

    TableColumn colN = new TableColumn(bundle.getString("colN"));
    setMinMaxWidth(colN, 70);
    colN.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("nfiles"));

    TableColumn colFile = new TableColumn(bundle.getString("colFile"));
    setMinMaxWidth(colFile, 160);
    colFile.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("input"));

    TableColumn colErrors = new TableColumn(bundle.getString("colErrors"));
    setMinMaxWidth(colErrors, 65);
    colErrors.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("errors"));

    TableColumn colWarnings = new TableColumn(bundle.getString("colWarnings"));
    setMinMaxWidth(colWarnings, 85);
    colWarnings.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("warnings"));

    TableColumn colPassed = new TableColumn(bundle.getString("colPassed"));
    setMinMaxWidth(colPassed, 65);
    colPassed.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("passed"));

    colScore = new TableColumn(bundle.getString("colScore"));
    setMinMaxWidth(colScore, 75);
    colScore.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("score"));

    colFormats = new TableColumn(bundle.getString("colFormats"));
    setMinMaxWidth(colFormats, 120);
    colFormats
            .setCellValueFactory(new PropertyValueFactory<ReportRow, ObservableMap<String, String>>("formats"));

    colDelete = new TableColumn(bundle.getString("colDelete"));
    setMinMaxWidth(colDelete, 30);
    colDelete.setVisible(true);
    colDelete.setCellValueFactory(new PropertyValueFactory<>("delete"));

    tabReports.skinProperty().addListener((obs, oldSkin, newSkin) -> {
        TableHeaderRow header = (TableHeaderRow) tabReports.lookup("TableHeaderRow");
        header.reorderingProperty().addListener((o, oldVal, newVal) -> header.setReordering(false));
    });

    tabReports.setPrefWidth(840.0);
    tabReports.setFixedCellSize(28.0);
    tabReports.getColumns().addAll(colDate, colTime, colN, colFile, colErrors, colWarnings, colPassed, colScore,
            colFormats, colDelete);
    tabReports.setCursor(Cursor.DEFAULT);
    tabReports.setEditable(false);
    tabReports.setMaxHeight(470.0);

    // Change column colors
    changeColumnTextColor(colDate, Color.LIGHTGRAY);
    changeColumnTextColor(colTime, Color.LIGHTGRAY);
    changeColumnTextColor(colFile, Color.LIGHTGRAY);
    changeColumnTextColor(colN, Color.CYAN);
    changeColumnTextColor(colErrors, Color.RED);
    changeColumnTextColor(colWarnings, Color.ORANGE);
    changeColumnTextColor(colPassed, Color.GREENYELLOW);
    changeColumnTextColor(colScore, Color.LIGHTGRAY);

    // Columns factories
    Bindings.size(tabReports.getItems()).addListener(new ChangeListener<Number>() {
        @Override
        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
            resizeTable();
        }
    });
    addChartScore();
    addFormatIcons();
    addDeleteIcon();
}

From source file:editeurpanovisu.EquiCubeDialogController.java

public Task tskTraitement() {
    return new Task() {
        @Override//from ww  w . ja  va 2  s . com
        protected Object call() throws Exception {
            apTransformations.setCursor(Cursor.WAIT);
            Platform.runLater(() -> {
                for (int ij = 0; ij < lvListeFichier.getItems().size(); ij++) {
                    String strNomFich1 = (String) lvListeFichier.getItems().get(ij);
                    lvListeFichier.getItems().set(ij, "A Traiter => " + strNomFich1);
                }
            });
            updateProgress(0.0001f, lvListeFichier.getItems().size());
            for (int i1 = 0; i1 < lvListeFichier.getItems().size(); i1++) {
                Thread.sleep(200);
                updateMessage("Traitement en cours " + (i1 + 1) + "/" + lvListeFichier.getItems().size());
                String strNomFich = ((String) lvListeFichier.getItems().get(i1)).split("> ")[1];
                final int ii = i1;
                Platform.runLater(() -> {
                    lvListeFichier.getItems().set(ii, "Traitement en cours => " + strNomFich);
                });
                traiteFichier(strNomFich, i1);
                Thread.sleep(100);

                updateProgress(i1 + 1, lvListeFichier.getItems().size());
                Platform.runLater(() -> {
                    lvListeFichier.getItems().set(ii, "Trait => " + strNomFich);
                });
                Thread.sleep(100);
            }
            apTransformations.setCursor(Cursor.DEFAULT);
            return true;
        }

        @Override
        protected void succeeded() {
            super.succeeded();
            pbBarreAvancement.progressProperty().unbind();
            lblTermine.textProperty().unbind();
            lblTermine.setText("Traitement Termin");
            pbBarreAvancement.setProgress(0.001d);
            pbBarreAvancement.setVisible(false);
            pbBarreImage.setVisible(false);
            bTraitementEffectue = true;
            lblDragDropE2C.setVisible(true);
        }

    };
}

From source file:org.jevis.jeconfig.JEConfig.java

/**
 * Inform the user the some precess is working
 *
 * @param working/*from   w ww .j  ava 2 s .c  om*/
 */
public static void loadNotification(final boolean working) {
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            if (working) {
                getStage().getScene().setCursor(Cursor.WAIT);
            } else {
                getStage().getScene().setCursor(Cursor.DEFAULT);
            }
        }
    });

}

From source file:com.github.drbookings.ui.controller.MainController.java

private void setWorkingFX(final boolean working, final boolean success) {
    // if (!working) {
    // return;/*from  w  ww.  j av a 2 s . co  m*/
    // }
    buttonAddBooking.getScene().getRoot().setCursor(Cursor.WAIT);
    progressBar.setVisible(working);
    if (success) {
        progressLabel.setVisible(working);
        progressLabel.getStyleClass().remove("warning");
    } else {
        progressLabel.getStyleClass().add("warning");
    }
    buttonAddBooking.setDisable(working);
    buttonGoHome.setDisable(working);
    buttonSelectCurrentMonth.setDisable(working);
    buttonSelectLastMonth.setDisable(working);
    buttonSelectLastThreeMonth.setDisable(working);
    buttonSelectPrevMonth.setDisable(working);
    buttonSelectNextMonth.setDisable(working);
    clearFilterButton.setDisable(working);

    filterBookingsLabel.setDisable(working);
    guestNameFilterInput.setDisable(working);
    tableView.setDisable(working);
    statusLabel.setDisable(working);
    guestNameFilterInput.setDisable(working);
    progressLabel.textProperty().unbind();
    progressBar.getScene().getRoot().setCursor(Cursor.DEFAULT);

}

From source file:de.bayern.gdi.gui.Controller.java

/**
 * Select a service according to service url textfield.
 *
 * @param downloadConf Loaded download config, null if a service is chosen
 *    from an URL or the service List/* w  w w  .  j  a  v a2  s  . c  om*/
 */
protected void doSelectService(DownloadConfig downloadConf) {
    log.info("Using download config: " + downloadConf);
    dataBean.resetSelectedService();
    serviceSelection.setDisable(true);
    serviceURL.getScene().setCursor(Cursor.WAIT);
    serviceURL.setDisable(true);
    resetGui();
    new Thread(() -> {
        try {
            ServiceModel serviceModel = (ServiceModel) serviceList.getSelectionModel().getSelectedItems()
                    .get(0);
            Service service = null;
            if (serviceModel != null && serviceModel.getUrl().toString().equals(serviceURL.getText())) {
                if (ServiceChecker.isReachable(serviceModel.getItem().getServiceURL())) {
                    service = serviceModel.getItem();
                    service.setPassword(servicePW.getText());
                    service.setUsername(serviceUser.getText());
                }
            } else {
                URL sURL = new URL(serviceURL.getText());
                if (ServiceChecker.isReachable(sURL)) {
                    service = new Service(sURL, "", true, serviceUser.getText(), servicePW.getText());
                }
            }
            if (service == null) {
                setStatusTextUI(I18n.format("status.service-timeout"));
                dataBean.setSelectedService(null);
                serviceSelection.setDisable(false);
                serviceURL.setDisable(false);
                serviceURL.getScene().setCursor(Cursor.DEFAULT);
                return;
            }
            serviceSelection.setDisable(true);
            serviceURL.getScene().setCursor(Cursor.WAIT);
            setStatusTextUI(I18n.format("status.checking-auth"));
            serviceURL.setDisable(true);
            Service finalService = service;
            Task task = new Task() {
                protected Integer call() {
                    try {
                        boolean serviceSelected = selectService(finalService);
                        if (serviceSelected) {
                            chooseSelectedService(downloadConf);
                        }
                        return 0;
                    } finally {
                        serviceSelection.setDisable(false);
                        serviceURL.getScene().setCursor(Cursor.DEFAULT);
                        serviceURL.setDisable(false);
                        validateChainContainerItems();
                    }
                }
            };
            Thread th = new Thread(task);
            th.setDaemon(true);
            th.start();
        } catch (MalformedURLException e) {
            setStatusTextUI(I18n.format("status.no-url"));
            log.error(e.getMessage(), e);
            serviceSelection.setDisable(false);
            serviceURL.getScene().setCursor(Cursor.DEFAULT);
            serviceURL.setDisable(false);
        }
    }).start();
}

From source file:de.dkfz.roddy.client.fxuiclient.RoddyUIController.java

private void switchExecutionStateProcessIndicator() {
    boolean runningTasks = RoddyUITask.getActiveTaskCount() > 0;
    executionService_activityIndicator.setVisible(runningTasks);
    if (runningTasks)
        App.instance.primaryStage.getScene().setCursor(Cursor.WAIT);
    else//from w  w  w  . j ava  2  s.  c o  m
        App.instance.primaryStage.getScene().setCursor(Cursor.DEFAULT);
}

From source file:de.bayern.gdi.gui.Controller.java

/**
 * Handle the service selection.//from w w  w .  j a v  a2 s  .co  m
 *
 * @param event The mouse click event.
 */
@FXML
protected void handleServiceSelect(MouseEvent event) {
    if (event.getEventType().equals(MouseEvent.MOUSE_CLICKED)) {
        if (event.getClickCount() == 1) {
            clearUserNamePassword();
            ServiceModel serviceModel = (ServiceModel) this.serviceList.getSelectionModel().getSelectedItems()
                    .get(0);
            if (serviceModel != null) {
                serviceSelection.setDisable(true);
                serviceURL.getScene().setCursor(Cursor.WAIT);
                setStatusTextUI(I18n.format("status.checking-auth"));
                Task task = new Task() {
                    protected Integer call() {
                        try {
                            selectService(serviceModel.getItem());
                            return 0;
                        } finally {
                            serviceSelection.setDisable(false);
                            serviceURL.getScene().setCursor(Cursor.DEFAULT);
                        }
                    }
                };
                Thread th = new Thread(task);
                th.setDaemon(true);
                th.start();
            }
        } else if (event.getClickCount() > 1) {
            clearUserNamePassword();
            resetGui();
        }
    }
}

From source file:ui.main.MainViewController.java

private synchronized void paintReceivedPhotoLoad(Chat chat, File recievedFile, String time) {
    //this method paints the recieved picture message
    Task<HBox> recievedMessages = new Task<HBox>() {
        @Override// w w w .ja  v  a  2 s  .c om
        protected HBox call() throws Exception {
            Thread.sleep(100);
            VBox vbox = new VBox(); //to add text

            ImageView imageRec = new ImageView(chatterAvatar.getImage()); //image
            imageRec.setFitHeight(60);
            imageRec.setFitWidth(50);

            String strChatterName = chat.getParticipant(); //add name of the chatter with light color
            strChatterName = Character.toUpperCase(strChatterName.charAt(0))
                    + strChatterName.substring(1, strChatterName.indexOf("@"));
            Label chatterName = new Label(strChatterName);
            chatterName.setDisable(true);

            Label timeL = new Label(time);
            timeL.setDisable(true);
            timeL.setFont(new Font("Arial", 10));

            try {
                Image recievedImage = SwingFXUtils.toFXImage(ImageIO.read(recievedFile), null);
                ImageView receivedImageView = new ImageView(recievedImage);
                receivedImageView.setFitHeight(300);
                receivedImageView.setFitWidth(300);
                receivedImageView.setPreserveRatio(true);

                receivedImageView.setOnMouseClicked(new EventHandler<MouseEvent>() {
                    @Override
                    public void handle(MouseEvent event) {
                        if (event.getButton() == MouseButton.PRIMARY) {
                            Desktop dt = Desktop.getDesktop();
                            try {
                                dt.open(recievedFile);
                            } catch (IOException ex) {
                                Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null,
                                        ex);
                            }
                        }
                    }
                });

                receivedImageView.setOnMouseEntered(new EventHandler<MouseEvent>() {
                    @Override
                    public void handle(MouseEvent event) {
                        chatList.getScene().setCursor(Cursor.HAND);
                    }
                });

                receivedImageView.setOnMouseExited(new EventHandler<MouseEvent>() {
                    @Override
                    public void handle(MouseEvent event) {
                        chatList.getScene().setCursor(Cursor.DEFAULT);
                    }
                });

                vbox.getChildren().addAll(chatterName, receivedImageView, timeL);
            } catch (IOException e) {
                e.printStackTrace();
            }
            vbox.setAlignment(Pos.CENTER_RIGHT);
            HBox hbox = new HBox();
            //bbl.setBubbleSpec(BubbleSpec.FACE_LEFT_CENTER);
            hbox.getChildren().addAll(imageRec, vbox);
            return hbox;
        }
    };

    recievedMessages.setOnSucceeded(event -> {
        chatList.getChildren().add(recievedMessages.getValue());
    });

    if (chat.getParticipant().contains(currentChat.getParticipant())) {
        Thread t = new Thread(recievedMessages);
        t.start();
        try {
            t.join();
        } catch (InterruptedException ex) {
            Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}