Example usage for javafx.scene.paint Color GOLD

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

Introduction

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

Prototype

Color GOLD

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

Click Source Link

Document

The color gold with an RGB value of #FFD700

Usage

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 *///from   w ww.ja v  a  2s  .com
private static void creeLoupe() {
    apLoupe.getChildren().clear();
    if (strPositLoupe.equals("gauche")) {
        apLoupe.setLayoutX(35);
    }
    if (strPositLoupe.equals("droite")) {
        apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
    }
    apLoupe.setLayoutY(35);

    Line lig1 = new Line(getiTailleLoupe() / 2 + 10, 10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() + 10);
    lig1.setStroke(Color.GOLD);
    Line lig2 = new Line(10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() + 10, getiTailleLoupe() / 2 + 10);
    lig2.setStroke(Color.GOLD);
    Circle circ1 = new Circle(getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 10,
            getiTailleLoupe() / 2 + 6);
    circ1.setStroke(Color.GOLDENROD);
    circ1.setFill(Color.GOLDENROD);
    Circle circ2 = new Circle(getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 10,
            getiTailleLoupe() / 2 + 5);
    circ2.setStroke(Color.GOLD);
    circ2.setFill(Color.GOLD);
    Circle circ3 = new Circle(getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 10,
            getiTailleLoupe() / 2 + 2);
    circ3.setStroke(Color.GOLDENROD);
    circ3.setFill(Color.GOLDENROD);
    Circle circ4 = new Circle(getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2 + 10, getiTailleLoupe() / 2);
    circ4.setStroke(Color.BLACK);
    circ4.setFill(Color.BLACK);
    apLoupe.getChildren().addAll(circ1, circ2, circ3, circ4, ivLoupe, lig1, lig2);
    apLoupe.setOnMouseMoved((me) -> {
        if (strPositLoupe.equals("gauche")) {
            apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
            strPositLoupe = "droite";
        }
        if (strPositLoupe.equals("droite")) {
            apLoupe.setLayoutX(35);
            strPositLoupe = "gauche";
        }
    });
    apLoupe.setOnMouseEntered((me) -> {
        if (strPositLoupe.equals("gauche")) {
            apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5);
            strPositLoupe = "droite";
        }
        if (strPositLoupe.equals("droite")) {
            apLoupe.setLayoutX(35);
            strPositLoupe = "gauche";
        }
    });
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param iNumZone numro de la zone//from  ww w  .  j a v a2 s  .c  o m
 * @param points liste de points du polygone
 * @return ancres du polygone
 */
private static ObservableList<AncreForme> olCreeAncresPourPolygone(int iNumZone,
        final ObservableList<Double> points) {
    ObservableList<AncreForme> olAnchors = FXCollections.observableArrayList();

    for (int i = 0; i < points.size(); i += 2) {
        final int idx = i;

        DoubleProperty xProperty = new SimpleDoubleProperty(points.get(i));
        DoubleProperty yProperty = new SimpleDoubleProperty(points.get(i + 1));

        xProperty.addListener((ObservableValue<? extends Number> ov, Number oldX, Number x) -> {
            points.set(idx, (double) x);
            String chaine = "";
            chaine = points.stream().map((point) -> point.toString() + ",").reduce(chaine, String::concat);
            chaine = chaine.substring(0, chaine.length() - 1);
            zones[iNumZone].setStrCoordonneesZone(chaine);
        });

        yProperty.addListener((ObservableValue<? extends Number> ov, Number oldY, Number y) -> {
            points.set(idx + 1, (double) y);
            String chaine = "";
            chaine = points.stream().map((point) -> point.toString() + ",").reduce(chaine, String::concat);
            chaine = chaine.substring(0, chaine.length() - 1);
            zones[iNumZone].setStrCoordonneesZone(chaine);
        });

        olAnchors.add(new AncreForme(Color.GOLD, xProperty, yProperty));
    }

    return olAnchors;
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param iNumZone numro de la zone/*  w ww  . java2  s . c o m*/
 * @param cercle cercle concern
 * @return ancres cercles
 */
private static ObservableList<AncreForme> olCreeAncresPourCercle(int iNumZone, Circle cercle) {
    ObservableList<AncreForme> olAnchors = FXCollections.observableArrayList();

    DoubleProperty xProperty1 = new SimpleDoubleProperty(cercle.getCenterX());
    DoubleProperty yProperty1 = new SimpleDoubleProperty(cercle.getCenterY());
    olAnchors.add(new AncreForme(Color.GOLD, xProperty1, yProperty1));
    DoubleProperty xProperty2 = new SimpleDoubleProperty(cercle.getCenterX() + cercle.getRadius());
    DoubleProperty yProperty2 = new SimpleDoubleProperty(cercle.getCenterY());
    final AncreForme ancRayon = new AncreForme(Color.BLUEVIOLET, xProperty2, yProperty2);
    olAnchors.add(ancRayon);
    xProperty1.addListener((ObservableValue<? extends Number> ov, Number oldX, Number x) -> {
        double dX = (double) x - cercle.getCenterX();
        double rayon = Math.sqrt(Math.pow(cercle.getCenterX() - xProperty2.get(), 2.d)
                + Math.pow(cercle.getCenterY() - yProperty2.get(), 2.d));
        cercle.setCenterX((double) x);
        ancRayon.setCenterX(ancRayon.getCenterX() + dX);
        String chaine = Math.round(cercle.getCenterX() * 10) / 10 + ","
                + Math.round(cercle.getCenterY() * 10) / 10 + "," + Math.round(rayon * 10) / 10;
        zones[iNumZone].setStrCoordonneesZone(chaine);

    });

    yProperty1.addListener((ObservableValue<? extends Number> ov, Number oldY, Number y) -> {
        double dY = -cercle.getCenterY() + (double) y;
        double rayon = Math.sqrt(Math.pow(cercle.getCenterX() - xProperty2.get(), 2.d)
                + Math.pow(cercle.getCenterY() - yProperty2.get(), 2.d));
        cercle.setCenterY((double) y);
        ancRayon.setCenterY(ancRayon.getCenterY() + dY);
        String chaine = Math.round(cercle.getCenterX() * 10) / 10 + ","
                + Math.round(cercle.getCenterY() * 10) / 10 + "," + Math.round(rayon * 10) / 10;
        zones[iNumZone].setStrCoordonneesZone(chaine);
    });
    xProperty2.addListener((ObservableValue<? extends Number> ov, Number oldX, Number x) -> {
        double rayon = Math.sqrt(Math.pow(cercle.getCenterX() - (double) x, 2.d)
                + Math.pow(cercle.getCenterY() - yProperty2.get(), 2.d));
        cercle.setRadius(rayon);
        String chaine = Math.round(cercle.getCenterX() * 10) / 10 + ","
                + Math.round(cercle.getCenterY() * 10) / 10 + "," + Math.round(rayon * 10) / 10;
        zones[iNumZone].setStrCoordonneesZone(chaine);
    });

    yProperty2.addListener((ObservableValue<? extends Number> ov, Number oldY, Number y) -> {
        double rayon = Math.sqrt(Math.pow(cercle.getCenterX() - xProperty2.get(), 2.d)
                + Math.pow(cercle.getCenterY() - (double) y, 2.d));
        cercle.setRadius(rayon);
        String chaine = Math.round(cercle.getCenterX() * 10) / 10 + ","
                + Math.round(cercle.getCenterY() * 10) / 10 + "," + Math.round(rayon * 10) / 10;
        zones[iNumZone].setStrCoordonneesZone(chaine);
    });

    return olAnchors;
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param iNumZone numero de la zone//  w  w  w . j  a  va  2 s  . co  m
 * @param rect rectangle concern
 * @return ancres rectangle
 */
private static ObservableList<AncreForme> olCreeAncresPourRectangle(int iNumZone, Rectangle rect) {
    ObservableList<AncreForme> olAnchors = FXCollections.observableArrayList();

    DoubleProperty xProperty1 = new SimpleDoubleProperty(rect.getX());
    DoubleProperty yProperty1 = new SimpleDoubleProperty(rect.getY());
    DoubleProperty xProperty2 = new SimpleDoubleProperty(rect.getWidth() + rect.getX());
    DoubleProperty yProperty2 = new SimpleDoubleProperty(rect.getHeight() + rect.getY());
    olAnchors.add(new AncreForme(Color.GOLD, xProperty1, yProperty1));
    AncreForme ancrePoint2 = new AncreForme(Color.BLUEVIOLET, xProperty2, yProperty2);
    olAnchors.add(ancrePoint2);
    xProperty1.addListener((ObservableValue<? extends Number> ov, Number oldX, Number x) -> {
        double dX = -rect.getX() + (double) x;
        rect.setX((double) x);
        ancrePoint2.setCenterX(ancrePoint2.getCenterX() + dX);
        String chaine = Math.round(rect.getX() * 10) / 10 + "," + Math.round(rect.getY() * 10) / 10 + ","
                + Math.round((rect.getX() + rect.getWidth()) * 10) / 10 + ","
                + Math.round((rect.getY() + rect.getHeight()) * 10) / 10;
        zones[iNumZone].setStrCoordonneesZone(chaine);
    });

    yProperty1.addListener((ObservableValue<? extends Number> ov, Number oldY, Number y) -> {
        double dY = -rect.getY() + (double) y;
        rect.setY((double) y);
        ancrePoint2.setCenterY(ancrePoint2.getCenterY() + dY);
        String chaine = Math.round(rect.getX() * 10) / 10 + "," + Math.round(rect.getY() * 10) / 10 + ","
                + Math.round((rect.getX() + rect.getWidth()) * 10) / 10 + ","
                + Math.round((rect.getY() + rect.getHeight()) * 10) / 10;
        zones[iNumZone].setStrCoordonneesZone(chaine);
    });
    xProperty2.addListener((ObservableValue<? extends Number> ov, Number oldX, Number x) -> {
        rect.setWidth((double) x - rect.getX());
        String chaine = Math.round(rect.getX() * 10) / 10 + "," + Math.round(rect.getY() * 10) / 10 + ","
                + Math.round((rect.getX() + rect.getWidth()) * 10) / 10 + ","
                + Math.round((rect.getY() + rect.getHeight()) * 10) / 10;
        zones[iNumZone].setStrCoordonneesZone(chaine);
    });

    yProperty2.addListener((ObservableValue<? extends Number> ov, Number oldY, Number y) -> {
        rect.setHeight((double) y - rect.getY());
        String chaine = Math.round(rect.getX() * 10) / 10 + "," + Math.round(rect.getY() * 10) / 10 + ","
                + Math.round((rect.getX() + rect.getWidth()) * 10) / 10 + ","
                + Math.round((rect.getY() + rect.getHeight()) * 10) / 10;
        zones[iNumZone].setStrCoordonneesZone(chaine);
    });

    return olAnchors;
}