Java Code Examples for javafx.scene.paint.Color#DARKGRAY

The following examples show how to use javafx.scene.paint.Color#DARKGRAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RadialGradientSample.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
public RadialGradientSample() {
    //create simple radial gradient
    RadialGradient gradient1 = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0, Color.DODGERBLUE),
        new Stop(1, Color.BLACK)
    });
    Circle circle1 = new Circle(45, 45, 40, gradient1);

    //create complex radial gradient
    RadialGradient gradient2 = new RadialGradient(20, 1, 0.5, 0.5, 0.6, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0,  Color.TRANSPARENT),
        new Stop(0.5,  Color.DARKGRAY),
        new Stop(0.64, Color.WHITESMOKE),
        new Stop(0.65, Color.YELLOW),
        new Stop(1, Color.GOLD)
    });
    Circle circle2 = new Circle(145, 45, 40, gradient2);

    HBox hb = new HBox(10);
    hb.getChildren().addAll(circle1, circle2);
    
    // show the circles
    getChildren().addAll(hb);
}
 
Example 2
Source File: RadialGradientSample.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
public RadialGradientSample() {
    //create simple radial gradient
    RadialGradient gradient1 = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0, Color.DODGERBLUE),
        new Stop(1, Color.BLACK)
    });
    Circle circle1 = new Circle(45, 45, 40, gradient1);

    //create complex radial gradient
    RadialGradient gradient2 = new RadialGradient(20, 1, 0.5, 0.5, 0.6, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0,  Color.TRANSPARENT),
        new Stop(0.5,  Color.DARKGRAY),
        new Stop(0.64, Color.WHITESMOKE),
        new Stop(0.65, Color.YELLOW),
        new Stop(1, Color.GOLD)
    });
    Circle circle2 = new Circle(145, 45, 40, gradient2);

    HBox hb = new HBox(10);
    hb.getChildren().addAll(circle1, circle2);
    
    // show the circles
    getChildren().addAll(hb);
}
 
Example 3
Source File: Demo.java    From Enzo with Apache License 2.0 6 votes vote down vote up
@Override public void start(Stage stage) {
    HBox matrixSegmentPane = new HBox();
    matrixSegmentPane.setSpacing(5);
    matrixSegmentPane.setPadding(new Insets(10, 10, 10, 10));
    matrixSegmentPane.getChildren().setAll(seg1, seg2, seg3, seg4, seg5, seg6);

    HBox squareMatrixSegmentPane = new HBox();
    squareMatrixSegmentPane.setSpacing(0);
    squareMatrixSegmentPane.setPadding(new Insets(10, 10, 10, 10));
    squareMatrixSegmentPane.getChildren().setAll(seg7, seg8, seg9, seg10, seg11, seg12);

    VBox pane = new VBox();
    pane.setSpacing(10);
    pane.getChildren().addAll(matrixSegmentPane, squareMatrixSegmentPane);

    Scene scene = new Scene(pane, Color.DARKGRAY);

    stage.setTitle("Enzo MatrixSegment");
    stage.setScene(scene);
    stage.show();

    timer.start();
}
 
Example 4
Source File: Demo.java    From Enzo with Apache License 2.0 6 votes vote down vote up
@Override public void start(Stage stage) {
    GridPane pane = new GridPane();
    pane.setHgap(10);
    pane.setVgap(10);
    pane.add(german, 0, 0);
    pane.add(english, 1, 0);
    pane.add(french, 2, 0);
    pane.add(spanish, 0, 1);
    pane.add(dutch, 1, 1);
    pane.add(german1, 2, 1);

    Scene scene = new Scene(pane, Color.DARKGRAY);

    stage.setTitle("JavaFX QlockTwo");
    stage.setScene(scene);
    stage.show();
}
 
Example 5
Source File: Demo.java    From Enzo with Apache License 2.0 5 votes vote down vote up
@Override public void start(Stage stage) {
    StackPane pane = new StackPane();
    pane.getChildren().setAll(control);

    Scene scene = new Scene(pane, Color.DARKGRAY);

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

    timer.start();
}
 
Example 6
Source File: Demo.java    From Enzo with Apache License 2.0 5 votes vote down vote up
@Override public void start(Stage stage) {
    StackPane pane = new StackPane();
    pane.getChildren().setAll(control);

    Scene scene = new Scene(pane, 400, 400, Color.DARKGRAY);

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

    timer.start();
}
 
Example 7
Source File: GraphPanel.java    From charts with Apache License 2.0 4 votes vote down vote up
private void init() {
    width              = PREFERRED_WIDTH;
    height             = PREFERRED_HEIGHT;
    mouseHandler       = this::handleMouseEvents;
    lastTimerCall      = System.nanoTime();
    _physicsActive     = true;
    _forceInverted     = false;

    setInitialPosition((int)width, (int)height);

    timer              = new AnimationTimer() {
        @Override public void handle(final long now) {
            if (now > lastTimerCall + REFRESH_PERIOD) {
                fruchtermanReingold();
                lastTimerCall = now;
                redraw();
            }
        }
    };

    nodeChangeListener    = (o, ov, nv) -> redraw();
    temp                  = BASE_TEMPERATURE;
    area                  = width * height;
    k                     = Math.sqrt(area / nodeEdgeModel.getNodes().size());
    distanceScalingFactor = new SimpleDoubleProperty(DISTANCE_SCALING_FACTOR);
    _edgeColor            = Color.DARKGRAY;
    _edgeWidthFactor = 2;
    //_nodeBorderColor       = Color.WHITE;
    _nodeHighlightingColor = Color.RED;
    _nodeBorderWidth       = 3;
    _selectedNodeFillColor   = Color.BLACK;
    _selectedNodeBorderColor = Color.LIME;
    maxXPosition = 1;
    maxYPosition = 1;
    minXPosition = -1;
    minYPosition = -1;


    if(null != nodeEdgeModel.getCurrentGroupKey()){
        GROUPING_KEY = nodeEdgeModel.getCurrentGroupKey();
    } else{
        GROUPING_KEY = NodeEdgeModel.DEFAULT;
    }

    popup                    = new InfoPopup();


    initGraphics();
    registerListeners();
    timer.start();
}
 
Example 8
Source File: AsteroidsMainMenu.java    From FXGLGames with MIT License 4 votes vote down vote up
@Override
protected Node createBackground(double width, double height) {
    return new Rectangle(width, height, Color.DARKGRAY);
}
 
Example 9
Source File: AsteroidsMainMenu.java    From FXGLGames with MIT License 4 votes vote down vote up
@Override
protected Node createBackground(double width, double height) {
    return new Rectangle(width, height, Color.DARKGRAY);
}