Example usage for javafx.scene.paint Color ORANGE

List of usage examples for javafx.scene.paint Color ORANGE

Introduction

In this page you can find the example usage for javafx.scene.paint Color ORANGE.

Prototype

Color ORANGE

To view the source code for javafx.scene.paint Color ORANGE.

Click Source Link

Document

The color orange with an RGB value of #FFA500

Usage

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("Xylophone");

    camOffset.getChildren().add(cam);//from  ww w. ja  va2s  .  c  o  m
    resetCam();

    final Scene scene = new Scene(camOffset, 800, 600, true);
    scene.setFill(new RadialGradient(225, 0.85, 300, 300, 500, false, CycleMethod.NO_CYCLE,
            new Stop[] { new Stop(0f, Color.BLUE), new Stop(1f, Color.LIGHTBLUE) }));
    scene.setCamera(new PerspectiveCamera());

    final AudioClip bar1Note = new AudioClip(Main.class.getResource("audio/Note1.wav").toString());
    final AudioClip bar2Note = new AudioClip(Main.class.getResource("audio/Note2.wav").toString());
    final AudioClip bar3Note = new AudioClip(Main.class.getResource("audio/Note3.wav").toString());
    final AudioClip bar4Note = new AudioClip(Main.class.getResource("audio/Note4.wav").toString());
    final AudioClip bar5Note = new AudioClip(Main.class.getResource("audio/Note5.wav").toString());
    final AudioClip bar6Note = new AudioClip(Main.class.getResource("audio/Note6.wav").toString());
    final AudioClip bar7Note = new AudioClip(Main.class.getResource("audio/Note7.wav").toString());
    final AudioClip bar8Note = new AudioClip(Main.class.getResource("audio/Note8.wav").toString());

    Group rectangleGroup = new Group();
    rectangleGroup.getTransforms().add(shear);
    rectangleGroup.setDepthTest(DepthTest.ENABLE);

    double xStart = 260.0;
    double xOffset = 30.0;
    double yPos = 300.0;
    double zPos = 0.0;
    double barWidth = 22.0;
    double barDepth = 7.0;

    // Base1
    Cube base1Cube = new Cube(1.0, new Color(0.2, 0.12, 0.1, 1.0), 1.0);
    base1Cube.setTranslateX(xStart + 135);
    base1Cube.setTranslateZ(yPos + 20.0);
    base1Cube.setTranslateY(11.0);
    base1Cube.setScaleX(barWidth * 11.5);
    base1Cube.setScaleZ(10.0);
    base1Cube.setScaleY(barDepth * 2.0);

    // Base2
    Cube base2Cube = new Cube(1.0, new Color(0.2, 0.12, 0.1, 1.0), 1.0);
    base2Cube.setTranslateX(xStart + 135);
    base2Cube.setTranslateZ(yPos - 20.0);
    base2Cube.setTranslateY(11.0);
    base2Cube.setScaleX(barWidth * 11.5);
    base2Cube.setScaleZ(10.0);
    base2Cube.setScaleY(barDepth * 2.0);

    // Bar1
    Cube bar1Cube = new Cube(1.0, Color.PURPLE, 1.0);
    bar1Cube.setTranslateX(xStart + 1 * xOffset);
    bar1Cube.setTranslateZ(yPos);
    bar1Cube.setScaleX(barWidth);
    bar1Cube.setScaleZ(100.0);
    bar1Cube.setScaleY(barDepth);

    // Bar2
    Cube bar2Cube = new Cube(1.0, Color.BLUEVIOLET, 1.0);
    bar2Cube.setTranslateX(xStart + 2 * xOffset);
    bar2Cube.setTranslateZ(yPos);
    bar2Cube.setScaleX(barWidth);
    bar2Cube.setScaleZ(95.0);
    bar2Cube.setScaleY(barDepth);

    // Bar3
    Cube bar3Cube = new Cube(1.0, Color.BLUE, 1.0);
    bar3Cube.setTranslateX(xStart + 3 * xOffset);
    bar3Cube.setTranslateZ(yPos);
    bar3Cube.setScaleX(barWidth);
    bar3Cube.setScaleZ(90.0);
    bar3Cube.setScaleY(barDepth);

    // Bar4
    Cube bar4Cube = new Cube(1.0, Color.GREEN, 1.0);
    bar4Cube.setTranslateX(xStart + 4 * xOffset);
    bar4Cube.setTranslateZ(yPos);
    bar4Cube.setScaleX(barWidth);
    bar4Cube.setScaleZ(85.0);
    bar4Cube.setScaleY(barDepth);

    // Bar5
    Cube bar5Cube = new Cube(1.0, Color.GREENYELLOW, 1.0);
    bar5Cube.setTranslateX(xStart + 5 * xOffset);
    bar5Cube.setTranslateZ(yPos);
    bar5Cube.setScaleX(barWidth);
    bar5Cube.setScaleZ(80.0);
    bar5Cube.setScaleY(barDepth);

    // Bar6
    Cube bar6Cube = new Cube(1.0, Color.YELLOW, 1.0);
    bar6Cube.setTranslateX(xStart + 6 * xOffset);
    bar6Cube.setTranslateZ(yPos);
    bar6Cube.setScaleX(barWidth);
    bar6Cube.setScaleZ(75.0);
    bar6Cube.setScaleY(barDepth);

    // Bar7
    Cube bar7Cube = new Cube(1.0, Color.ORANGE, 1.0);
    bar7Cube.setTranslateX(xStart + 7 * xOffset);
    bar7Cube.setTranslateZ(yPos);
    bar7Cube.setScaleX(barWidth);
    bar7Cube.setScaleZ(70.0);
    bar7Cube.setScaleY(barDepth);

    // Bar8
    Cube bar8Cube = new Cube(1.0, Color.RED, 1.0);
    bar8Cube.setTranslateX(xStart + 8 * xOffset);
    bar8Cube.setTranslateZ(yPos);
    bar8Cube.setScaleX(barWidth);
    bar8Cube.setScaleZ(65.0);
    bar8Cube.setScaleY(barDepth);

    bar1Cube.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            bar1Note.play();
        }
    });
    bar2Cube.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            bar2Note.play();
        }
    });
    bar3Cube.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            bar3Note.play();
        }
    });
    bar4Cube.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            bar4Note.play();
        }
    });
    bar5Cube.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            bar5Note.play();
        }
    });
    bar6Cube.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            bar6Note.play();
        }
    });
    bar7Cube.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            bar7Note.play();
        }
    });
    bar8Cube.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            bar8Note.play();
        }
    });

    rectangleGroup.getChildren().addAll(base1Cube, base2Cube, bar1Cube, bar2Cube, bar3Cube, bar4Cube, bar5Cube,
            bar6Cube, bar7Cube, bar8Cube);
    rectangleGroup.setScaleX(2.5);
    rectangleGroup.setScaleY(2.5);
    rectangleGroup.setScaleZ(2.5);
    cam.getChildren().add(rectangleGroup);

    double halfSceneWidth = 375; // scene.getWidth()/2.0;
    double halfSceneHeight = 275; // scene.getHeight()/2.0;
    cam.p.setX(halfSceneWidth);
    cam.ip.setX(-halfSceneWidth);
    cam.p.setY(halfSceneHeight);
    cam.ip.setY(-halfSceneHeight);

    frameCam(stage, scene);

    scene.setOnMousePressed(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            mousePosX = me.getX();
            mousePosY = me.getY();
            mouseOldX = me.getX();
            mouseOldY = me.getY();
            //System.out.println("scene.setOnMousePressed " + me);
        }
    });
    scene.setOnMouseDragged(new EventHandler<MouseEvent>() {
        public void handle(MouseEvent me) {
            mouseOldX = mousePosX;
            mouseOldY = mousePosY;
            mousePosX = me.getX();
            mousePosY = me.getY();
            mouseDeltaX = mousePosX - mouseOldX;
            mouseDeltaY = mousePosY - mouseOldY;
            if (me.isAltDown() && me.isShiftDown() && me.isPrimaryButtonDown()) {
                double rzAngle = cam.rz.getAngle();
                cam.rz.setAngle(rzAngle - mouseDeltaX);
            } else if (me.isAltDown() && me.isPrimaryButtonDown()) {
                double ryAngle = cam.ry.getAngle();
                cam.ry.setAngle(ryAngle - mouseDeltaX);
                double rxAngle = cam.rx.getAngle();
                cam.rx.setAngle(rxAngle + mouseDeltaY);
            } else if (me.isShiftDown() && me.isPrimaryButtonDown()) {
                double yShear = shear.getY();
                shear.setY(yShear + mouseDeltaY / 1000.0);
                double xShear = shear.getX();
                shear.setX(xShear + mouseDeltaX / 1000.0);
            } else if (me.isAltDown() && me.isSecondaryButtonDown()) {
                double scale = cam.s.getX();
                double newScale = scale + mouseDeltaX * 0.01;
                cam.s.setX(newScale);
                cam.s.setY(newScale);
                cam.s.setZ(newScale);
            } else if (me.isAltDown() && me.isMiddleButtonDown()) {
                double tx = cam.t.getX();
                double ty = cam.t.getY();
                cam.t.setX(tx + mouseDeltaX);
                cam.t.setY(ty + mouseDeltaY);
            }
        }
    });
    scene.setOnKeyPressed(new EventHandler<KeyEvent>() {
        public void handle(KeyEvent ke) {
            if (KeyCode.A.equals(ke.getCode())) {
                resetCam();
                shear.setX(0.0);
                shear.setY(0.0);
            }
            if (KeyCode.F.equals(ke.getCode())) {
                frameCam(stage, scene);
                shear.setX(0.0);
                shear.setY(0.0);
            }
            if (KeyCode.SPACE.equals(ke.getCode())) {
                if (stage.isFullScreen()) {
                    stage.setFullScreen(false);
                    frameCam(stage, scene);
                } else {
                    stage.setFullScreen(true);
                    frameCam(stage, scene);
                }
            }
        }
    });

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

static Node dropShadow() {
    Group g = new Group();
    DropShadow ds = new DropShadow();
    ds.setOffsetY(3.0f);/*ww w .j av a  2s.  c  o m*/
    ds.setColor(Color.color(0.4f, 0.4f, 0.4f));

    Text t = new Text();
    t.setEffect(ds);
    t.setCache(true);
    t.setX(10.0f);
    t.setY(270.0f);
    t.setFill(Color.RED);
    t.setText("JavaFX drop shadow...");
    t.setFont(Font.font("null", FontWeight.BOLD, 32));

    DropShadow ds1 = new DropShadow();
    ds1.setOffsetY(4.0f);

    Circle c = new Circle();
    c.setEffect(ds1);
    c.setCenterX(50.0f);
    c.setCenterY(325.0f);
    c.setRadius(30.0f);
    c.setFill(Color.ORANGE);
    c.setCache(true);

    g.getChildren().add(t);
    g.getChildren().add(c);
    return g;
}

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  ww w .ja  v a2s.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.EditeurPanovisu.java

private void ajouteAffichageLignes() {
    double largeur = imagePanoramique.getFitWidth();
    double hauteur = largeur / 2.0d;
    Line ligne;//from w  ww  .  j  a  v a  2s  .c  o  m
    int x, y;
    int nl = 0;
    for (int i = -180; i < 180; i += 10) {
        x = (int) (largeur / 2.0f + largeur / 360.0f * (float) i + imagePanoramique.getLayoutX());
        ligne = new Line(x, 0, x, hauteur);
        ligne.setId("ligne" + nl);
        nl++;
        ligne.setStroke(Color.ORANGE);
        if (i == 0) {
            ligne.setStroke(Color.WHITE);
            ligne.setStrokeWidth(0.5);
        } else {
            if ((i % 20) == 0) {
                ligne.setStroke(Color.WHITE);
                ligne.setStrokeWidth(0.25);
            } else {
                ligne.setStroke(Color.GRAY);
                ligne.setStrokeWidth(0.25);
            }
        }
        pano.getChildren().add(ligne);
    }
    for (int i = -90; i < 90; i += 10) {
        y = (int) (hauteur / 2.0f + hauteur / 180.0f * (float) i);
        ligne = new Line(imagePanoramique.getLayoutX(), y, largeur + imagePanoramique.getLayoutX(), y);
        ligne.setId("ligne" + nl);
        nl++;
        if (i == 0) {
            ligne.setStroke(Color.WHITE);
            ligne.setStrokeWidth(0.5);
        } else {
            if ((i % 20) == 0) {
                ligne.setStroke(Color.WHITE);
                ligne.setStrokeWidth(0.25);
            } else {
                ligne.setStroke(Color.GRAY);
                ligne.setStrokeWidth(0.25);
            }
        }

        pano.getChildren().add(ligne);
    }

}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param strLstPano/*ww  w  . ja v a 2  s  .  com*/
 * @param iNumPano
 * @return
 */
public static Pane paneAffichageHS(String strLstPano, int iNumPano) {

    Pane paneHotSpots = new Pane();
    paneHotSpots.setTranslateY(10);
    paneHotSpots.setTranslateX(10);
    VBox vbHotspots = new VBox(5);
    paneHotSpots.getChildren().add(vbHotspots);
    Label lblPoint;
    int io;
    for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspots(); io++) {
        Label lblSep = new Label(" ");
        Label lblSep1 = new Label(" ");
        VBox vbPanneauHS = new VBox();
        double deplacement = 0;
        vbPanneauHS.setLayoutX(deplacement);
        Pane paneHsPanoramique = new Pane(vbPanneauHS);
        paneHsPanoramique.setPrefHeight(300);
        paneHsPanoramique.setMinHeight(300);
        paneHsPanoramique.setMaxHeight(300);

        int iNum1 = io;
        Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (ActionEvent event) -> {
            Circle c1 = (Circle) panePanoramique.lookup("#point" + iNum1);
            if (c1 != null) {
                if (c1.getFill() == Color.RED) {
                    c1.setFill(Color.YELLOW);
                    c1.setStroke(Color.RED);
                } else {
                    c1.setFill(Color.RED);
                    c1.setStroke(Color.YELLOW);
                }
            }
        }));
        timBouge.setCycleCount(Timeline.INDEFINITE);
        timBouge.pause();
        paneHsPanoramique.setOnMouseEntered((e) -> {
            timBouge.play();
        });
        paneHsPanoramique.setOnMouseExited((e) -> {
            timBouge.pause();
            Circle c1 = (Circle) panePanoramique.lookup("#point" + iNum1);
            if (c1 != null) {
                c1.setFill(Color.YELLOW);
                c1.setStroke(Color.RED);
            }
        });
        paneHsPanoramique
                .setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;");
        paneHsPanoramique.setId("HS" + io);
        lblPoint = new Label("Point #" + (io + 1));
        lblPoint.setPadding(new Insets(5, 10, 5, 5));
        lblPoint.setTranslateX(-deplacement);
        lblPoint.getStyleClass().add("titreOutil");
        Separator sepHotspots = new Separator(Orientation.HORIZONTAL);
        sepHotspots.setTranslateX(-deplacement);
        sepHotspots.setPrefWidth(321);
        sepHotspots.setTranslateX(2);
        paneHsPanoramique.setPrefWidth(325);
        vbPanneauHS.getChildren().addAll(lblPoint, sepHotspots);
        if (strLstPano != null) {

            Label lblLien = new Label(rbLocalisation.getString("main.panoramiqueDestination"));
            lblLien.setTranslateX(10);
            ComboBox cbDestPano = new ComboBox();
            String[] strListe = strLstPano.split(";");
            cbDestPano.getItems().addAll(Arrays.asList(strListe));
            int iNum11 = getPanoramiquesProjet()[iNumPano].getHotspot(io).getNumeroPano();
            cbDestPano.setTranslateX(10);
            cbDestPano.setId("cbpano" + io);
            cbDestPano.getSelectionModel().select(iNum11);
            cbDestPano.getSelectionModel().selectedIndexProperty().addListener((ov, t, t1) -> {
                valideHS();
                if (dejaCharge) {
                    dejaCharge = false;
                    retireAffichageHotSpots();
                    Pane affHS1 = paneAffichageHS(strListePano(), iNumPano);
                    affHS1.setId("labels");
                    vbVisuHotspots.getChildren().add(affHS1);
                }
            });
            if (iNum11 != -1) {
                int iNumPan = iNum11;
                ImageView ivAfficheVignettePano = new ImageView(
                        getPanoramiquesProjet()[iNum11].getImgPanoRect());
                ivAfficheVignettePano.setPreserveRatio(true);
                ivAfficheVignettePano.setFitWidth(300);
                ivAfficheVignettePano.setLayoutY(10);
                ivAfficheVignettePano.setCursor(Cursor.HAND);
                ivAfficheVignettePano.setOnMouseClicked((e) -> {
                    affichePanoChoisit(iNumPan);
                });
                AnchorPane apVisuVignettePano = new AnchorPane(ivAfficheVignettePano);
                apVisuVignettePano.setPrefHeight(170);
                apVisuVignettePano.setTranslateX(10);
                vbPanneauHS.getChildren().addAll(lblLien, cbDestPano, apVisuVignettePano, lblSep);
            } else {
                vbPanneauHS.getChildren().addAll(lblLien, cbDestPano, lblSep);
            }

        }
        Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot"));
        lblTexteHS.setTranslateX(10);
        TextField tfTexteHS = new TextField();
        if (getPanoramiquesProjet()[iNumPano].getHotspot(io).getStrInfo() != null) {
            tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspot(io).getStrInfo());
        }
        tfTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable,
                final String oldValue, final String newValue) -> {
            valideHS();
        });

        tfTexteHS.setId("txtHS" + io);
        tfTexteHS.setPrefSize(200, 25);
        tfTexteHS.setMaxSize(200, 20);
        tfTexteHS.setTranslateX(60);
        vbPanneauHS.getChildren().addAll(lblTexteHS, tfTexteHS, lblSep1);
        vbHotspots.getChildren().addAll(paneHsPanoramique, lblSep);
    }
    int iNbHS = io;
    int iTaillePane = io * 325;
    for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspotImage(); io++) {
        Label lblSep = new Label(" ");
        Label lblSep1 = new Label(" ");
        VBox vbPanneauHsImage = new VBox();
        Pane paneHsImage = new Pane(vbPanneauHsImage);
        int iNum = io;
        Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (ActionEvent event) -> {
            Circle c1 = (Circle) panePanoramique.lookup("#img" + iNum);
            if (c1 != null) {
                if (c1.getFill() == Color.BLUE) {
                    c1.setFill(Color.YELLOW);
                    c1.setStroke(Color.BLUE);
                } else {
                    c1.setFill(Color.BLUE);
                    c1.setStroke(Color.YELLOW);
                }
            }
        }));
        timBouge.setCycleCount(Timeline.INDEFINITE);
        timBouge.pause();
        paneHsImage.setOnMouseEntered((e) -> {
            timBouge.play();
        });
        paneHsImage.setOnMouseExited((e) -> {
            Circle c1 = (Circle) panePanoramique.lookup("#img" + iNum);
            if (c1 != null) {

                c1.setFill(Color.BLUE);
                c1.setStroke(Color.YELLOW);
            }
            timBouge.pause();
        });
        paneHsImage.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;");
        paneHsImage.setId("HSImg" + io);
        lblPoint = new Label("Image #" + (io + 1));
        lblPoint.setPadding(new Insets(5, 10, 5, 5));
        lblPoint.getStyleClass().add("titreOutil");
        Separator sepHS = new Separator(Orientation.HORIZONTAL);
        sepHS.setPrefWidth(321);
        sepHS.setTranslateX(2);

        paneHsImage.setPrefWidth(325);
        vbPanneauHsImage.getChildren().addAll(lblPoint, sepHS);
        Label lblLien = new Label(rbLocalisation.getString("main.imageChoisie"));
        lblLien.setTranslateX(10);

        String strF1XML = getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrLienImg();
        Image imgChoisie = new Image(
                "file:" + getStrRepertTemp() + File.separator + "images" + File.separator + strF1XML);
        ImageView ivChoisie = new ImageView(imgChoisie);
        ivChoisie.setTranslateX(100);
        ivChoisie.setFitWidth(100);
        ivChoisie.setFitHeight(imgChoisie.getHeight() / imgChoisie.getWidth() * 100);

        vbPanneauHsImage.getChildren().addAll(lblLien, ivChoisie, lblSep);
        Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot"));
        lblTexteHS.setTranslateX(10);

        TextField tfTexteHS = new TextField();
        if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrInfo() != null) {
            tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrInfo());
        }
        tfTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable,
                final String oldValue, final String newValue) -> {
            valideHS();
        });

        tfTexteHS.setId("txtHSImage" + io);
        tfTexteHS.setPrefSize(200, 25);
        tfTexteHS.setMaxSize(200, 20);
        tfTexteHS.setTranslateX(60);
        vbPanneauHsImage.getChildren().addAll(lblTexteHS, tfTexteHS, lblSep1);
        Label lblCoulFond = new Label(rbLocalisation.getString("diapo.couleurFond"));
        lblCoulFond.setTranslateX(10);
        Label lblOpacite = new Label(rbLocalisation.getString("diapo.opacite"));
        lblOpacite.setTranslateX(10);
        if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrCouleurFond().equals("")) {
            getPanoramiquesProjet()[iNumPano].getHotspotImage(io).setStrCouleurFond(
                    "#" + getGestionnaireInterface().getCouleurFondTheme().toString().substring(2, 8));
        }
        ColorPicker cpCouleurFond = new ColorPicker(
                Color.valueOf(getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrCouleurFond()));
        if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getOpacite() == -1) {
            getPanoramiquesProjet()[iNumPano].getHotspotImage(io)
                    .setOpacite(getGestionnaireInterface().getOpaciteTheme());
        }
        cpCouleurFond.setTranslateX(100);
        int i = io;
        cpCouleurFond.valueProperty().addListener((ov, av, nv) -> {
            if (getiNombrePanoramiques() != 0) {
                setbDejaSauve(false);
                getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
            }
            getPanoramiquesProjet()[iNumPano].getHotspotImage(i)
                    .setStrCouleurFond("#" + cpCouleurFond.getValue().toString().substring(2, 8));
        });
        Slider slOpacite = new Slider(0, 1, getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getOpacite());
        slOpacite.valueProperty().addListener((ov, av, nv) -> {
            if (getiNombrePanoramiques() != 0) {
                setbDejaSauve(false);
                getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
            }
            getPanoramiquesProjet()[iNumPano].getHotspotImage(i).setOpacite(slOpacite.getValue());
        });
        slOpacite.setTranslateX(100);
        slOpacite.setPrefWidth(130);
        slOpacite.setMinWidth(130);
        slOpacite.setMaxWidth(130);
        vbPanneauHsImage.getChildren().addAll(lblCoulFond, cpCouleurFond, lblOpacite, slOpacite);

        vbHotspots.getChildren().addAll(paneHsImage, lblSep);
        iTaillePane += 225 + ivChoisie.getFitHeight();
        paneHsImage.setPrefHeight(200 + ivChoisie.getFitHeight());
        paneHsImage.setMinHeight(200 + ivChoisie.getFitHeight());
        paneHsImage.setMaxHeight(200 + ivChoisie.getFitHeight());
    }

    iNbHS += io;

    for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspotHTML(); io++) {
        Label lblSep = new Label(" ");
        int iNum = io;
        VBox vbPanneauHS = new VBox();
        Pane paneHsHtml = new Pane(vbPanneauHS);
        Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (ActionEvent event) -> {
            Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum);
            if (c1 != null) {

                if (c1.getFill() == Color.DARKGREEN) {
                    c1.setFill(Color.YELLOWGREEN);
                    c1.setStroke(Color.DARKGREEN);
                } else {
                    c1.setFill(Color.DARKGREEN);
                    c1.setStroke(Color.YELLOWGREEN);
                }
            }
        }));
        timBouge.setCycleCount(Timeline.INDEFINITE);
        timBouge.pause();
        paneHsHtml.setOnMouseEntered((e) -> {
            timBouge.play();
        });
        paneHsHtml.setOnMouseExited((e) -> {
            timBouge.pause();
            Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum);
            if (c1 != null) {
                c1.setFill(Color.DARKGREEN);
                c1.setStroke(Color.YELLOWGREEN);
            }
        });
        paneHsHtml.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;");
        paneHsHtml.setId("HSHTML" + io);
        lblPoint = new Label("Hotspot HTML #" + (io + 1));
        lblPoint.setPadding(new Insets(5, 10, 5, 5));
        lblPoint.getStyleClass().add("titreOutil");
        Separator sepHS = new Separator(Orientation.HORIZONTAL);
        sepHS.setPrefWidth(321);
        sepHS.setTranslateX(2);
        paneHsHtml.setPrefWidth(325);
        Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot"));
        lblTexteHS.setTranslateX(10);
        TextField tfTexteHS = new TextField();
        if (getPanoramiquesProjet()[iNumPano].getHotspotHTML(io).getStrInfo() != null) {
            tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotHTML(io).getStrInfo());
        }
        tfTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable,
                final String oldValue, final String newValue) -> {
            valideHS();
        });

        tfTexteHS.setId("txtHSHTML" + io);
        tfTexteHS.setPrefSize(200, 25);
        tfTexteHS.setMaxSize(200, 20);
        tfTexteHS.setTranslateX(60);
        vbPanneauHS.getChildren().addAll(lblPoint, sepHS, lblTexteHS, tfTexteHS);
        Button btnEditeHSHTML = new Button(rbLocalisation.getString("main.editeHTML"));
        btnEditeHSHTML.setPrefWidth(80);
        btnEditeHSHTML.setTranslateX(paneHsHtml.getPrefWidth() - btnEditeHSHTML.getPrefWidth() - 10);
        vbPanneauHS.getChildren().addAll(btnEditeHSHTML);
        btnEditeHSHTML.setOnAction((e) -> {
            EditeurHTML editHTML = new EditeurHTML();
            HotspotHTML HS = getPanoramiquesProjet()[iNumPano].getHotspotHTML(iNum);
            editHTML.setHsHTML(HS);
            Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
            int iHauteur = (int) tailleEcran.getHeight() - 100;
            int iLargeur = (int) tailleEcran.getWidth() - 100;
            editHTML.affiche(iLargeur, iHauteur);
            editHTML.addPropertyChangeListener("bValide", (ev) -> {
                if (ev.getNewValue().toString().equals("true")) {
                    getPanoramiquesProjet()[iNumPano].setHotspotHTML(editHTML.getHsHTML(), iNum);
                    dejaCharge = false;
                    retireAffichageHotSpots();
                    Pane affHS1 = paneAffichageHS(strListePano(), iNumPano);
                    affHS1.setId("labels");
                    vbVisuHotspots.getChildren().add(affHS1);
                }
            });

        });

        vbHotspots.getChildren().addAll(paneHsHtml, lblSep);
        paneHsHtml.setPrefHeight(120);
        paneHsHtml.setMinHeight(120);
        paneHsHtml.setMaxHeight(120);
        iTaillePane += 145;
    }
    iNbHS += io;
    for (io = 0; io < getPanoramiquesProjet()[iNumPano].getiNombreHotspotDiapo(); io++) {
        Label lblSep = new Label(" ");
        int iNum = io;
        VBox vbPanneauHS = new VBox();
        Pane paneHsDiapo = new Pane(vbPanneauHS);
        Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (ActionEvent event) -> {
            Circle c1 = (Circle) panePanoramique.lookup("#dia" + iNum);
            if (c1 != null) {

                if (c1.getFill() == Color.TURQUOISE) {
                    c1.setFill(Color.ORANGE);
                    c1.setStroke(Color.TURQUOISE);
                } else {
                    c1.setFill(Color.TURQUOISE);
                    c1.setStroke(Color.ORANGE);
                }
            }
        }));
        timBouge.setCycleCount(Timeline.INDEFINITE);
        timBouge.pause();
        paneHsDiapo.setOnMouseEntered((e) -> {
            timBouge.play();
        });
        paneHsDiapo.setOnMouseExited((e) -> {
            timBouge.pause();
            Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum);
            if (c1 != null) {
                c1.setFill(Color.TURQUOISE);
                c1.setStroke(Color.ORANGE);
            }
        });
        paneHsDiapo.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;");
        paneHsDiapo.setId("DIAPO" + io);
        lblPoint = new Label("Hotspot Diaporama #" + (io + 1));
        lblPoint.setPadding(new Insets(5, 10, 5, 5));
        lblPoint.getStyleClass().add("titreOutil");
        Separator sepHS = new Separator(Orientation.HORIZONTAL);
        sepHS.setPrefWidth(321);
        sepHS.setTranslateX(2);
        paneHsDiapo.setPrefWidth(325);
        Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot"));
        lblTexteHS.setTranslateX(10);
        TextField tfTexteHS = new TextField();
        if (getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getStrInfo() != null) {
            tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getStrInfo());
        }
        tfTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable,
                final String oldValue, final String newValue) -> {
            valideHS();
        });

        tfTexteHS.setId("txtDIA" + io);
        tfTexteHS.setPrefSize(200, 25);
        tfTexteHS.setMaxSize(200, 20);
        tfTexteHS.setTranslateX(60);
        vbPanneauHS.getChildren().addAll(lblPoint, sepHS, lblTexteHS, tfTexteHS);
        ComboBox cbListeDiapo = new ComboBox();
        for (int i = 0; i < getiNombreDiapo(); i++) {
            cbListeDiapo.getItems().add(diaporamas[i].getStrNomDiaporama());
        }
        cbListeDiapo.getSelectionModel()
                .select(getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getiNumDiapo());
        int iii = io;
        cbListeDiapo.getSelectionModel().selectedIndexProperty().addListener((ov, av, nv) -> {
            getPanoramiquesProjet()[iNumPano].getHotspotDiapo(iii).setiNumDiapo((int) nv);
        });
        cbListeDiapo.setTranslateX(60);
        vbPanneauHS.getChildren().addAll(cbListeDiapo);
        //Ajouter Liste Diaporamas
        vbHotspots.getChildren().addAll(paneHsDiapo, lblSep);
        paneHsDiapo.setPrefHeight(120);
        paneHsDiapo.setMinHeight(120);
        paneHsDiapo.setMaxHeight(120);
        iTaillePane += 145;
    }
    valideHS();
    iNbHS += io;
    dejaCharge = true;
    paneHotSpots.setPrefHeight(iTaillePane);
    paneHotSpots.setMinHeight(iTaillePane);
    paneHotSpots.setMaxHeight(iTaillePane);
    paneHotSpots.setId("labels");
    apVisuHS.setPrefHeight(paneHotSpots.getPrefHeight());
    apVisuHS.setMinHeight(paneHotSpots.getPrefHeight());
    apVisuHS.setMaxHeight(paneHotSpots.getPrefHeight());
    vbVisuHotspots.setPrefHeight(paneHotSpots.getPrefHeight());
    vbVisuHotspots.setMinHeight(paneHotSpots.getPrefHeight());
    vbVisuHotspots.setMaxHeight(paneHotSpots.getPrefHeight());

    return paneHotSpots;
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param i// ww w. j av  a 2 s .c o m
 * @param longitude
 * @param latitude
 */
private static void afficheHSDiapo(int i, double longitude, double latitude) {
    double largeur = ivImagePanoramique.getFitWidth();
    double X = (longitude + 180.0d) * largeur / 360.0d + ivImagePanoramique.getLayoutX();
    double Y = (90.0d - latitude) * largeur / 360.0d;
    Circle circPoint = new Circle(X, Y, 5);
    circPoint.setFill(Color.TURQUOISE);
    circPoint.setStroke(Color.ORANGE);
    circPoint.setId("dia" + i);
    circPoint.setCursor(Cursor.DEFAULT);
    panePanoramique.getChildren().add(circPoint);
    Tooltip tltpHSImage = new Tooltip("Diaporama #" + (i + 1));
    tltpHSImage.setStyle(getStrTooltipStyle());
    Tooltip.install(circPoint, tltpHSImage);
    circPoint.setOnDragDetected((mouseEvent1) -> {
        circPoint.setFill(Color.ORANGE);
        circPoint.setStroke(Color.TURQUOISE);
        bDragDrop = true;
        mouseEvent1.consume();

    });
    circPoint.setOnMouseDragged((mouseEvent1) -> {
        double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
        if (XX < 0) {
            XX = 0;
        }
        if (XX > ivImagePanoramique.getFitWidth()) {
            XX = ivImagePanoramique.getFitWidth();
        }
        circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
        double YY = mouseEvent1.getY();
        if (YY < 0) {
            YY = 0;
        }
        if (YY > ivImagePanoramique.getFitHeight()) {
            YY = ivImagePanoramique.getFitHeight();
        }
        circPoint.setCenterY(YY);
        afficheLoupe(XX, YY);
        mouseEvent1.consume();

    });
    circPoint.setOnMouseReleased((mouseEvent1) -> {
        String strPoint = circPoint.getId();
        strPoint = strPoint.substring(3, strPoint.length());
        int iNumeroPoint = Integer.parseInt(strPoint);
        double X1 = mouseEvent1.getSceneX();
        double Y1 = mouseEvent1.getSceneY();
        double mouseX = X1 - ivImagePanoramique.getLayoutX();
        if (mouseX < 0) {
            mouseX = 0;
        }
        if (mouseX > ivImagePanoramique.getFitWidth()) {
            mouseX = ivImagePanoramique.getFitWidth();
        }
        double mouseY = Y1 - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
        if (mouseY < 0) {
            mouseY = 0;
        }
        if (mouseY > ivImagePanoramique.getFitHeight()) {
            mouseY = ivImagePanoramique.getFitHeight();
        }

        double longit, lat;
        double larg = ivImagePanoramique.getFitWidth();
        String strLong, strLat;
        longit = 360.0f * mouseX / larg - 180;
        lat = 90.0d - 2.0f * mouseY / larg * 180.0f;
        getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(iNumeroPoint).setLatitude(lat);
        getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(iNumeroPoint).setLongitude(longit);
        circPoint.setFill(Color.TURQUOISE);
        circPoint.setStroke(Color.ORANGE);
        mouseEvent1.consume();

    });

    circPoint.setOnMouseClicked((mouseEvent1) -> {
        String strPoint = circPoint.getId();
        strPoint = strPoint.substring(3, strPoint.length());
        int iNum = Integer.parseInt(strPoint);
        Node nodePointDiapo;
        nodePointDiapo = (Node) panePanoramique.lookup("#dia" + strPoint);

        if (mouseEvent1.isControlDown()) {
            valideHS();
            setbDejaSauve(false);
            getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
            panePanoramique.getChildren().remove(nodePointDiapo);

            for (int io = iNum + 1; io < getiNumDiapo(); io++) {
                nodePointDiapo = (Node) panePanoramique.lookup("#dia" + Integer.toString(io));
                nodePointDiapo.setId("dia" + Integer.toString(io - 1));
            }
            /**
             * on retire les anciennes indication de HS
             */
            retireAffichageHotSpots();
            setiNumDiapo(getiNumDiapo() - 1);
            getPanoramiquesProjet()[getiPanoActuel()].removeHotspotdiapo(iNum);
            /**
             * On les cre les nouvelles
             */
            ajouteAffichageHotspots();
            mouseEvent1.consume();
        } else {
            if (!bDragDrop) {
                List<String> choixDiapo1 = new ArrayList<>();
                for (int ii = 0; ii < getiNombreDiapo(); ii++) {
                    choixDiapo1.add(diaporamas[ii].getStrNomDiaporama());
                }
                ChoiceDialog<String> dialog1 = new ChoiceDialog<>(
                        diaporamas[getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(iNum)
                                .getiNumDiapo()].getStrNomDiaporama(),
                        choixDiapo1);
                dialog1.setTitle(rbLocalisation.getString("main.choixDiapo"));
                dialog1.setHeaderText(null);
                dialog1.setContentText(rbLocalisation.getString("main.diapos"));

                // Traditional way to get the response value.
                Optional<String> result1 = dialog1.showAndWait();
                if (result1.isPresent()) {
                    boolean bTrouve = false;
                    int iTrouve = -1;
                    for (int ii = 0; ii < getiNombreDiapo(); ii++) {
                        if (diaporamas[ii].getStrNomDiaporama().equals(result1.get())) {
                            bTrouve = true;
                            iTrouve = ii;
                        }
                    }
                    if (bTrouve) {
                        retireAffichageHotSpots();
                        getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(iNum).setiNumDiapo(iTrouve);
                        valideHS();
                        ajouteAffichageHotspots();
                    }
                }
            } else {
                bDragDrop = false;
            }
            mouseEvent1.consume();
        }

    });
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param X//from w ww.  ja v  a 2  s.  c  o  m
 * @param Y
 */
private static void panoAjouteDiaporama(double X, double Y) {
    if (X > 0 && X < ivImagePanoramique.getFitWidth()) {
        valideHS();
        setbDejaSauve(false);
        getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
        double mouseX = X;
        double mouseY = Y - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
        double longitude, latitude;
        double largeur = ivImagePanoramique.getFitWidth();
        longitude = 360.0f * mouseX / largeur - 180;
        latitude = 90.0d - 2.0f * mouseY / largeur * 180.0f;
        Circle circPoint = new Circle(mouseX + ivImagePanoramique.getLayoutX(), mouseY, 5);
        circPoint.setFill(Color.TURQUOISE);
        circPoint.setStroke(Color.ORANGE);
        circPoint.setId("dia" + getiNumDiapo());
        circPoint.setCursor(Cursor.DEFAULT);
        panePanoramique.getChildren().add(circPoint);
        Tooltip tltpImage = new Tooltip("Diaporama n " + (getiNumDiapo() + 1));
        tltpImage.setStyle(getStrTooltipStyle());
        Tooltip.install(circPoint, tltpImage);
        HotspotDiaporama HS = new HotspotDiaporama();
        HS.setLongitude(longitude);
        HS.setLatitude(latitude);
        List<String> choixDiapo = new ArrayList<>();
        for (int i = 0; i < getiNombreDiapo(); i++) {
            choixDiapo.add(diaporamas[i].getStrNomDiaporama());
        }
        ChoiceDialog<String> dialog = new ChoiceDialog<>(diaporamas[0].getStrNomDiaporama(), choixDiapo);
        dialog.setTitle(rbLocalisation.getString("main.choixDiapo"));
        dialog.setHeaderText(null);
        dialog.setContentText(rbLocalisation.getString("main.diapos"));

        Optional<String> result = dialog.showAndWait();
        if (result.isPresent()) {
            boolean bTrouve = false;
            int iTrouve = -1;
            for (int i = 0; i < getiNombreDiapo(); i++) {
                if (diaporamas[i].getStrNomDiaporama().equals(result.get())) {
                    bTrouve = true;
                    iTrouve = i;
                }
            }
            if (bTrouve) {
                HS.setiNumDiapo(iTrouve);
                retireAffichageHotSpots();
                getPanoramiquesProjet()[getiPanoActuel()].addHotspotDiapo(HS);
                setiNumDiapo(getiNumDiapo() + 1);
                valideHS();
                dejaCharge = false;
                Pane affHS1 = paneAffichageHS(strListePano(), getiPanoActuel());
                affHS1.setId("labels");
                vbVisuHotspots.getChildren().add(affHS1);

                spPanneauOutils.setVvalue(spPanneauOutils.getVvalue() + 145);

            }
        }
        circPoint.setOnDragDetected((mouseEvent1) -> {
            circPoint.setFill(Color.ORANGE);
            circPoint.setStroke(Color.TURQUOISE);
            bDragDrop = true;
            mouseEvent1.consume();

        });
        circPoint.setOnMouseDragged((mouseEvent1) -> {
            double XX = mouseEvent1.getX() - ivImagePanoramique.getLayoutX();
            if (XX < 0) {
                XX = 0;
            }
            if (XX > ivImagePanoramique.getFitWidth()) {
                XX = ivImagePanoramique.getFitWidth();
            }
            circPoint.setCenterX(XX + ivImagePanoramique.getLayoutX());
            double YY = mouseEvent1.getY();
            if (YY < 0) {
                YY = 0;
            }
            if (YY > ivImagePanoramique.getFitHeight()) {
                YY = ivImagePanoramique.getFitHeight();
            }
            circPoint.setCenterY(YY);
            afficheLoupe(XX, YY);
            mouseEvent1.consume();
        });
        circPoint.setOnMouseReleased((mouseEvent1) -> {
            setbDejaSauve(false);
            getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
            String strPoint = circPoint.getId();
            strPoint = strPoint.substring(3, strPoint.length());
            int iNumeroPoint = Integer.parseInt(strPoint);
            double X1 = mouseEvent1.getSceneX();
            double Y1 = mouseEvent1.getSceneY();
            double mouseX1 = X1 - ivImagePanoramique.getLayoutX();
            if (mouseX1 < 0) {
                mouseX1 = 0;
            }
            if (mouseX1 > ivImagePanoramique.getFitWidth()) {
                mouseX1 = ivImagePanoramique.getFitWidth();
            }

            double mouseY1 = Y1 - panePanoramique.getLayoutY() - 130 - getiDecalageMac();
            if (mouseY1 < 0) {
                mouseY1 = 0;
            }
            if (mouseY1 > ivImagePanoramique.getFitHeight()) {
                mouseY1 = ivImagePanoramique.getFitHeight();
            }

            double longit, lat;
            double larg = ivImagePanoramique.getFitWidth();
            longit = 360.0f * mouseX1 / larg - 180;
            lat = 90.0d - 2.0f * mouseY1 / larg * 180.0f;
            getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(iNumeroPoint).setLatitude(lat);
            getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(iNumeroPoint).setLongitude(longit);
            circPoint.setFill(Color.TURQUOISE);
            circPoint.setStroke(Color.ORANGE);
            mouseEvent1.consume();

        });

        circPoint.setOnMouseClicked((mouseEvent1) -> {
            String strPoint = circPoint.getId();
            strPoint = strPoint.substring(3, strPoint.length());
            int iNum = Integer.parseInt(strPoint);
            if (mouseEvent1.isControlDown()) {
                setbDejaSauve(false);
                getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
                Node nodeImage;
                nodeImage = (Node) panePanoramique.lookup("#dia" + strPoint);
                panePanoramique.getChildren().remove(nodeImage);

                for (int io = iNum + 1; io < getiNumDiapo(); io++) {
                    nodeImage = (Node) panePanoramique.lookup("#dia" + Integer.toString(io));
                    nodeImage.setId("dia" + Integer.toString(io - 1));
                    Tooltip tltpImage1 = new Tooltip("Diaporama n " + io);
                    tltpImage1.setStyle(getStrTooltipStyle());
                    Tooltip.install(nodeImage, tltpImage1);

                }
                /**
                 * on retire les anciennes indication de HS
                 */
                retireAffichageHotSpots();
                setiNumDiapo(getiNumDiapo() - 1);
                getPanoramiquesProjet()[getiPanoActuel()].removeHotspotdiapo(iNum);
                /**
                 * On les cre les nouvelles
                 */
                ajouteAffichageHotspots();
            } else {
                if (!bDragDrop) {
                    setbDejaSauve(false);
                    getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *");
                    List<String> choixDiapo1 = new ArrayList<>();
                    for (int i = 0; i < getiNombreDiapo(); i++) {
                        choixDiapo1.add(diaporamas[i].getStrNomDiaporama());
                    }
                    ChoiceDialog<String> dialog1 = new ChoiceDialog<>(
                            diaporamas[getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(iNum)
                                    .getiNumDiapo()].getStrNomDiaporama(),
                            choixDiapo1);
                    dialog1.setTitle(rbLocalisation.getString("main.choixDiapo"));
                    dialog1.setHeaderText(null);
                    dialog1.setContentText(rbLocalisation.getString("main.diapos"));

                    Optional<String> result1 = dialog1.showAndWait();
                    if (result1.isPresent()) {
                        boolean bTrouve = false;
                        int iTrouve = -1;
                        for (int i = 0; i < getiNombreDiapo(); i++) {
                            if (diaporamas[i].getStrNomDiaporama().equals(result1.get())) {
                                bTrouve = true;
                                iTrouve = i;
                            }
                        }
                        if (bTrouve) {
                            retireAffichageHotSpots();
                            getPanoramiquesProjet()[getiPanoActuel()].getHotspotDiapo(iNum)
                                    .setiNumDiapo(iTrouve);
                            valideHS();
                            ajouteAffichageHotspots();
                        }
                    }

                } else {
                    bDragDrop = false;
                }
                mouseEvent1.consume();
            }
            valideHS();
            mouseEvent1.consume();
        });

    }
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 *///from w ww.  j a  va  2 s . c  o m
private static void ajouteAffichageLignes() {
    double largeur = ivImagePanoramique.getFitWidth();
    double hauteur = largeur / 2.0d;
    Line lineCoordonnees;
    int iX, iY;
    int iNl = 0;
    for (int i = -180; i < 180; i += 10) {
        iX = (int) (largeur / 2.0f + largeur / 360.0f * (float) i + ivImagePanoramique.getLayoutX());
        lineCoordonnees = new Line(iX, 0, iX, hauteur);
        lineCoordonnees.setId("ligne" + iNl);
        iNl++;
        lineCoordonnees.setStroke(Color.ORANGE);
        if (i == 0) {
            lineCoordonnees.setStroke(Color.WHITE);
            lineCoordonnees.setStrokeWidth(0.5);
        } else {
            if ((i % 20) == 0) {
                lineCoordonnees.setStroke(Color.WHITE);
                lineCoordonnees.setStrokeWidth(0.25);
            } else {
                lineCoordonnees.setStroke(Color.GRAY);
                lineCoordonnees.setStrokeWidth(0.25);
            }
        }
        panePanoramique.getChildren().add(lineCoordonnees);
    }
    for (int i = -90; i < 90; i += 10) {
        iY = (int) (hauteur / 2.0f + hauteur / 180.0f * (float) i);
        lineCoordonnees = new Line(ivImagePanoramique.getLayoutX(), iY,
                largeur + ivImagePanoramique.getLayoutX(), iY);
        lineCoordonnees.setId("ligne" + iNl);
        iNl++;
        if (i == 0) {
            lineCoordonnees.setStroke(Color.WHITE);
            lineCoordonnees.setStrokeWidth(0.5);
        } else {
            if ((i % 20) == 0) {
                lineCoordonnees.setStroke(Color.WHITE);
                lineCoordonnees.setStrokeWidth(0.25);
            } else {
                lineCoordonnees.setStroke(Color.GRAY);
                lineCoordonnees.setStrokeWidth(0.25);
            }
        }

        panePanoramique.getChildren().add(lineCoordonnees);
    }

}

From source file:net.sourceforge.pmd.util.fxdesigner.XPathPanelController.java

private static TextFlow highlightXPathSuggestion(String text, String match) {
    int filterIndex = text.toLowerCase(Locale.ROOT).indexOf(match.toLowerCase(Locale.ROOT));

    Text textBefore = new Text(text.substring(0, filterIndex));
    Text textAfter = new Text(text.substring(filterIndex + match.length()));
    Text textFilter = new Text(text.substring(filterIndex, filterIndex + match.length())); //instead of "filter" to keep all "case sensitive"
    textFilter.setFill(Color.ORANGE);
    return new TextFlow(textBefore, textFilter, textAfter);
}

From source file:org.openbase.display.DisplayView.java

/**
 * {@inheritDoc}//from   www . j a v  a  2 s .com
 *
 * @param presetId
 * @throws org.openbase.jul.exception.CouldNotPerformException
 */
@Override
public Future<Void> showWarnText(final String presetId) throws CouldNotPerformException {
    return displayHTML(htmlLoader.loadTextView(presetId, Color.ORANGE), true);
}