Example usage for javafx.scene.paint Color GRAY

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

Introduction

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

Prototype

Color GRAY

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

Click Source Link

Document

The color gray with an RGB value of #808080

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Drawing Lines");

    Group root = new Group();
    Scene scene = new Scene(root, 300, 150, Color.GRAY);

    Line redLine = new Line(10, 10, 200, 10);

    redLine.setStroke(Color.RED);
    redLine.setStrokeWidth(10);/*from ww  w  .j  a  v a  2  s .c o  m*/
    redLine.setStrokeLineCap(StrokeLineCap.BUTT);

    redLine.getStrokeDashArray().addAll(15d, 5d, 15d, 15d, 20d);
    redLine.setStrokeDashOffset(10);

    root.getChildren().add(redLine);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.GRAY);
    arc.setStroke(Color.BLACK);//from   www .j  a  v a  2  s .c om
    arc.setType(ArcType.ROUND);

    HBox box = new HBox(arc);

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.GRAY);
    arc.setStroke(Color.BLACK);/*from  w  w w. j a v  a 2s .co  m*/
    arc.setType(ArcType.ROUND);

    HBox box = new HBox(arc);

    box.setSpacing(10);
    box.setStyle("-fx-padding: 10;" + "-fx-border-style: solid inside;" + "-fx-border-width: 2;"
            + "-fx-border-insets: 5;" + "-fx-border-radius: 5;" + "-fx-border-color: blue;");

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.GRAY);
    arc.setStroke(Color.BLACK);/*from   w  w  w.j  ava2s.c  o  m*/
    arc.setType(ArcType.ROUND);

    Arc arc1 = new Arc(0, 0, 50, 100, 0, 90);
    arc1.setFill(Color.GRAY);
    arc1.setStroke(Color.BLACK);
    arc1.setType(ArcType.ROUND);

    HBox box = new HBox(arc, arc1);

    box.setSpacing(10);

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {

    Group root = new Group();

    Scene scene = new Scene(root, 300, 150, Color.GRAY);

    Line redLine = new Line(10, 10, 200, 10);

    redLine.setStroke(Color.RED);
    redLine.setStrokeWidth(10);/*from w w w. j av  a2s  .c o m*/
    redLine.setStrokeLineCap(StrokeLineCap.BUTT);

    redLine.getStrokeDashArray().addAll(10d, 5d, 15d, 5d, 20d);
    redLine.setStrokeDashOffset(0);

    root.getChildren().add(redLine);

    Text offsetText = new Text("Stroke Dash Offset: 0.0");
    offsetText.setX(10);
    offsetText.setY(80);
    offsetText.setStroke(Color.WHITE);

    root.getChildren().add(offsetText);

    Slider slider = new Slider(0, 100, 0);
    slider.setLayoutX(10);
    slider.setLayoutY(95);

    redLine.strokeDashOffsetProperty().bind(slider.valueProperty());

    slider.valueProperty().addListener(
            (ov, curVal, newVal) -> offsetText.setText("Stroke Dash Offset: " + slider.getValue()));

    root.getChildren().add(slider);

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

From source file:deincraftlauncher.InstallController.java

@Override
public void initialize(URL url, ResourceBundle rb) {
    instance = this;

    System.out.println("Starting Installer UI...");

    int saveX = 393;
    int cancelY = 165;
    int saveY = 200;
    int sizeX = 481;

    Rectangle separator = new Rectangle();
    separator.setWidth(sizeX);//from  w  w w  .  ja  va2  s .  co m
    separator.setHeight(separatorSizeY);
    separator.setLayoutY(separatorY);
    separator.setFill(blueColor);
    mainPanel.getChildren().add(separator);
    mainPanel.setBackground(Background.EMPTY);

    TextButton cancel = new TextButton(saveX, cancelY, "cancel", Color.RED, mainPanel);
    cancel.setOnClick((TextButton tile) -> {
        cancel();
    });

    save = new TextButton(saveX, saveY, "Weiter", Color.GRAY, mainPanel);
    save.setFocusable(false);
    save.setOnClick((TextButton tile) -> {
        Continue();
    });

    login = new TextButton(14, 151, "Login", Color.BLUE, mainPanel);
    login.setOnClick((TextButton tile) -> {
        doLogin(null);
    });

    Label Title = new Label();
    Title.setText("Installer");
    Title.setPrefSize(sizeX, separatorY);
    Title.setTextFill(Color.WHITESMOKE);
    Title.setTextAlignment(TextAlignment.CENTER);
    Title.setFont(DesignHelpers.getFocusFont(42));
    Title.setAlignment(Pos.CENTER);
    mainPanel.getChildren().add(Title);

    pathLabel.setBackground(new Background(new BackgroundFill(Color.rgb(170, 170, 170), radii, insets)));
    //ContinueButton.setBackground(new Background(new BackgroundFill(Color.rgb(100, 190, 100), radii, insets))); //Green Version

    setDefaultPath();
    System.out.println("starting done");
}

From source file:editeurpanovisu.EditeurPanovisu.java

private void ajouteAffichageLignes() {
    double largeur = imagePanoramique.getFitWidth();
    double hauteur = largeur / 2.0d;
    Line ligne;/*ww  w  . j  a  v a 2s.  co 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

/**
 *
 *//* www . j  a  v  a2 s.co  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:org.mskcc.shenkers.control.alignment.VerticalOverlayNGTest.java

@Override
public void start(Stage stage) throws Exception {
    Pane r1 = new Pane();
    Text lbl = new Text("H");

    List<Node> collect = "ABcDEFGHIJKL".chars().mapToObj(new IntFunction<StretchStringPane>() {

        @Override/*w  ww  .  ja  v a2  s  .co m*/
        public StretchStringPane apply(int value) {
            return new StretchStringPane("" + ((char) value));
        }
    }).collect(Collectors.toList());

    VerticalOverlay ao = new VerticalOverlay();
    ao.setChildren(collect);
    ao.flip();

    Scene scene = new Scene(ao.getContent(), 300, 300, Color.GRAY);
    stage.setTitle("JavaFX Scene Graph Demo");
    stage.setScene(scene);
    stage.show();
}

From source file:org.mskcc.shenkers.control.track.fasta.FastaViewNGTest.java

@Test
public void testGetGraphic() throws InterruptedException {
    String title = "";
    CountDownLatch l = new CountDownLatch(1);
    Platform.runLater(() -> {//from  w ww. ja  v  a2s. com
        String st = "CGATCGCCATTGAGCAAGTAAGCCAACTTTCGGCTCGCGTGTACGCGATAAGTAGGTGCCCTCTGCATCCGACGCACTTCAGCCGAACCACTTGCGGGAATTTGGGGGAGTGCTGATACGACGGCATAGGAATGGAGCTCTTTAAGTGCGTCTACACACGGACCGTACTTGGCCAAATCGGCAGTCAGTTGTATT";
        FastaView tp = new FastaView();
        tp.flip.setValue(true);
        tp.setSequence(0, st);

        Scene scene = new Scene(tp, 300, 300, Color.GRAY);
        Stage stage = new Stage();
        stage.setScene(scene);

        stage.setOnHidden(e -> {
            l.countDown();
        });
        stage.show();

    });
    l.await();
}