Example usage for javafx.scene.paint Color AZURE

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

Introduction

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

Prototype

Color AZURE

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

Click Source Link

Document

The color azure with an RGB value of #F0FFFF

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Circle circle = new Circle(40);
    circle.setFill(Color.RED);/* www.j av  a2 s  . c  o  m*/
    circle.setStroke(Color.BLACK);
    circle.setStrokeWidth(2.0);

    Rectangle rect = new Rectangle(120, 75);
    rect.setFill(Color.RED);

    // Create a line
    Line line = new Line(0, 0, 150, 50);
    line.setStrokeWidth(5.0);
    line.setStroke(Color.GREEN);

    // Create a parallelogram
    Polygon parallelogram = new Polygon();
    parallelogram.getPoints().addAll(30.0, 0.0, 130.0, 0.0, 120.00, 50.0, 0.0, 50.0);
    parallelogram.setFill(Color.AZURE);
    parallelogram.setStroke(Color.BLACK);

    // Create a hexagon
    Polyline hexagon = new Polyline(100.0, 0.0, 120.0, 20.0, 110.0, 140.0, 100.0, 60.0, 80.0, 40.0, 80.0, 120.0,
            100.0, 0.0);
    hexagon.setFill(Color.WHITE);
    hexagon.setStroke(Color.BLACK);

    // A CHORD arc with no fill and a stroke
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.TRANSPARENT);
    arc.setStroke(Color.BLACK);
    arc.setType(ArcType.CHORD);

    // Add all shapes to an HBox
    HBox root = new HBox(circle, rect, line, parallelogram, hexagon, arc);
    root.setSpacing(10);
    root.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(root);
    stage.setScene(scene);
    stage.setTitle("2D Shapes");
    stage.show();
}

From source file:com.gmail.frogocomics.schematic.gui.Main.java

@Override
public void start(Stage primaryStage) throws Exception {
    this.primaryStage = primaryStage;
    this.root = new GridPane();
    this.primaryScene = new Scene(this.root, 1000, 600, Color.AZURE);

    Label title = new Label("Schematic Utilities");
    title.setId("schematic-utilities");
    title.setPrefWidth(this.primaryScene.getWidth() + 500);
    this.root.add(title, 0, 0);

    filesSelected.setId("files-selected");
    this.root.add(filesSelected, 0, 1);

    Region spacer1 = new Region();
    spacer1.setPrefWidth(30);/*from  w w  w.java  2  s .c o  m*/
    spacer1.setPrefHeight(30);

    Region spacer2 = new Region();
    spacer2.setPrefWidth(30);
    spacer2.setPrefHeight(30);

    Region spacer3 = new Region();
    spacer3.setPrefWidth(30);
    spacer3.setPrefHeight(250);

    Region spacer4 = new Region();
    spacer4.setPrefWidth(1000);
    spacer4.setPrefHeight(10);

    Region spacer5 = new Region();
    spacer5.setPrefWidth(30);
    spacer5.setPrefHeight(30);

    Region spacer6 = new Region();
    spacer6.setPrefWidth(1000);
    spacer6.setPrefHeight(10);

    Region spacer7 = new Region();
    spacer7.setPrefWidth(1000);
    spacer7.setPrefHeight(100);

    Region spacer8 = new Region();
    spacer8.setPrefWidth(30);
    spacer8.setPrefHeight(30);

    this.root.add(spacer4, 0, 3);

    listView.setId("schematic-list");
    listView.setEditable(false);
    listView.setPrefWidth(500);
    listView.setPrefHeight(250);
    this.root.add(new HBox(spacer3, listView), 0, 4);

    uploadFiles.setPadding(new Insets(5, 5, 5, 5));
    uploadFiles.setPrefWidth(120);
    uploadFiles.setPrefHeight(30);
    uploadFiles.setOnAction((event) -> {
        FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle("Select schematic(s)");
        fileChooser.getExtensionFilters().addAll(
                new FileChooser.ExtensionFilter("MCEdit Schematic File", "*.schematic"),
                new FileChooser.ExtensionFilter("Biome World Object Version 2", "*.bo2"));
        List<File> selectedFiles = fileChooser.showOpenMultipleDialog(this.primaryStage);
        if (selectedFiles != null) {
            if (selectedFiles.size() == 1) {
                filesSelected.setText("There is currently 1 file selected");
            } else {
                filesSelected.setText(
                        "There are currently " + String.valueOf(selectedFiles.size()) + " files selected");
            }
            ObservableList<SchematicLocation> selectedSchematicFiles = FXCollections.observableArrayList();
            selectedSchematicFiles.addAll(selectedFiles.stream().map(f -> new SchematicLocation(f, f.getName()))
                    .collect(Collectors.toList()));
            listView.setItems(selectedSchematicFiles);
            this.schematics = selectedSchematicFiles;
        }

    });
    this.root.add(new HBox(spacer1, uploadFiles, spacer2,
            new Label("Only .schematic files are allowed at this point!")), 0, 2);

    editing.setPadding(new Insets(5, 5, 5, 5));
    editing.setPrefWidth(240);
    editing.setPrefHeight(30);
    editing.setDisable(true);
    editing.setOnAction(event -> this.primaryStage.setScene(Editing.getScene()));
    this.root.add(new HBox(spacer8, editing), 0, 8);

    loadSchematics.setPadding(new Insets(5, 5, 5, 5));
    loadSchematics.setPrefWidth(120);
    loadSchematics.setPrefHeight(30);
    loadSchematics.setOnAction(event -> {
        if (this.schematics != null) {
            ((Runnable) () -> {
                for (SchematicLocation location : this.schematics) {
                    if (FilenameUtils.isExtension(location.getLocation().getName(), "schematic")) {
                        try {
                            Schematics.schematics.add(McEditSchematicObject.load(location.getLocation()));
                        } catch (ParseException | ClassicNotSupportedException | IOException e) {
                            e.printStackTrace();
                        }
                    } else if (FilenameUtils.isExtension(location.getLocation().getName(), "bo2")) {
                        try {
                            Schematics.schematics.add(BiomeWorldV2Object.load(location.getLocation()));
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }).run();
            loadSchematics.setDisable(true);
            uploadFiles.setDisable(true);
            listView.setDisable(true);
            editing.setDisable(false);
        }
    });
    this.root.add(spacer6, 0, 5);
    this.root.add(new HBox(spacer5, loadSchematics), 0, 6);
    this.root.add(spacer7, 0, 7);

    this.primaryScene.getStylesheets()
            .add("https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800");
    this.primaryScene.getStylesheets().add(new File("style.css").toURI().toURL().toExternalForm());
    this.primaryStage.setScene(this.primaryScene);
    this.primaryStage.setResizable(false);
    this.primaryStage.setTitle("Schematic Utilities - by frogocomics");
    this.primaryStage.show();
}