Package javafx.scene.paint

Examples of javafx.scene.paint.LinearGradient


                new Stop(0.85d, Color.LIGHTGRAY), new Stop(0.97d, Color.DARKGRAY.darker()))
                : Color.BLACK);
    this.minorTickMarkFillProperty = new SimpleObjectProperty<Paint>(Color.GRAY.brighter());
    this.majorTickMarkFillProperty = new SimpleObjectProperty<Paint>(Color.WHITE);
    this.tickMarkLabelFillProperty = new SimpleObjectProperty<Paint>(Color.WHITE);
    this.tickValueDisplayFillProperty = new SimpleObjectProperty<Paint>(new LinearGradient(
        0, 0, 0, 1d, true, CycleMethod.NO_CYCLE,
        new Stop(0, Color.DARKGRAY.darker()), new Stop(0.4d, Color.BLACK)));
    this.tickValueDisplayTextFillProperty = new SimpleObjectProperty<Paint>(Color.WHITE);
    this.outerRimFillProperty = new SimpleObjectProperty<Paint>(Color.BLACK);
    this.outerRimEffectFillProperty = new SimpleObjectProperty<Color>(Color.LIGHTCYAN);
View Full Code Here


    final Shape highlight = Shape.intersect(shape1, shape2);
   
    highlight.setCache(true);
    highlight.setCacheHint(CacheHint.SPEED);
    highlight.setOpacity(0.07d);
    highlightFillProperty.set(new LinearGradient(cx, cy, centerX, centerY,
        false, CycleMethod.NO_CYCLE, new Stop(0.8d, Color.WHITE),
        new Stop(1d, Color.TRANSPARENT)));
    Bindings.bindBidirectional(highlight.fillProperty(), highlightFillProperty);
    return highlight;
  }
View Full Code Here

        // Create and set a gradient for the inside of the button
        final Stop[] mainStops = new Stop[] {
            new Stop(0.0, boolProperty.get() ? Color.BLUE : Color.GRAY),
            new Stop(1.0, boolProperty.get() ? Color.DODGERBLUE : Color.DARKGRAY)
        };
        final LinearGradient mainLG =
            new LinearGradient(0, 0, 0, 1, true, CycleMethod.NO_CYCLE, mainStops);
        mainRec.setFill(mainLG);
        middleRec.setX(boolProperty.get() ? (mainRec.getWidth() / 2) : mainRec.getX());
  }
View Full Code Here

        // Create and set a gradient for the inside of the button
        Stop[] middleStops = new Stop[] {
            new Stop(0.0, Color.WHITE),
            new Stop(1.0, Color.GRAY)
        };
        LinearGradient middleLG =
            new LinearGradient(0, 0, 0, 1, true, CycleMethod.NO_CYCLE, middleStops);
        middleRec.setFill(middleLG);
       
        getChildren().setAll(mainRec, textView, middleRec);
    }
View Full Code Here

        root.getChildren().addAll(world);
        addListeners();
    }

    public static Paint createFill() {
        LinearGradient gradient = new LinearGradient(0f, 0f, 0f, 1f, true, CycleMethod.NO_CYCLE, new Stop[]{
                    new Stop(0.0, Color.web("#64c2f8")),
                    new Stop(1, Color.web("#f8bd55")),});
        return gradient;
    }
View Full Code Here

        clockBox.setLayoutY(375);

        Pane pane = new Pane(dayBox, dateBox, monthBox, clockBox);
        pane.setPadding(new Insets(10, 10, 10, 10));

        Scene scene = new Scene(pane, 1280, 800, new LinearGradient(0, 0, 0, 800, false, CycleMethod.NO_CYCLE,
                                                                    new Stop(0.0, Color.rgb(28, 27, 22)),
                                                                    new Stop(0.25, Color.rgb(38, 37, 32)),
                                                                    new Stop(1.0, Color.rgb(28, 27, 22))));
        stage.setScene(scene);
        stage.show();
View Full Code Here

        canvas.setHeight(size);

        ctx.clearRect(0, 0, size, size);

        if (isFrameVisible()) { //frame
            Paint frame = new LinearGradient(0.14 * size, 0.14 * size,
                                             0.84 * size, 0.84 * size,
                                             false, CycleMethod.NO_CYCLE,
                                             new Stop(0.0, Color.rgb(20, 20, 20, 0.65)),
                                             new Stop(0.15, Color.rgb(20, 20, 20, 0.65)),
                                             new Stop(0.26, Color.rgb(41, 41, 41, 0.65)),
                                             new Stop(0.26, Color.rgb(41, 41, 41, 0.64)),
                                             new Stop(0.85, Color.rgb(200, 200, 200, 0.41)),
                                             new Stop(1.0, Color.rgb(200, 200, 200, 0.35)));
            ctx.setFill(frame);
            ctx.fillOval(0, 0, size, size);
        }

        InnerShadow innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 0.07 * size, 0, 0, 0);
        if (isOn()) { //on
            ctx.save();
            Paint on = new LinearGradient(0.25 * size, 0.25 * size,
                                          0.74 * size, 0.74 * size,
                                          false, CycleMethod.NO_CYCLE,
                                          new Stop(0.0, ledColor.get().deriveColor(0d, 1d, 0.77, 1d)),
                                          new Stop(0.49, ledColor.get().deriveColor(0d, 1d, 0.5, 1d)),
                                          new Stop(1.0, ledColor.get()));
            innerShadow.setInput(new DropShadow(BlurType.TWO_PASS_BOX, ledColor.get(), 0.36 * size, 0, 0, 0));
            ctx.setEffect(innerShadow);
            ctx.setFill(on);
            ctx.fillOval(0.14 * size, 0.14 * size, 0.72 * size, 0.72 * size);
            ctx.restore();
        } else { // off
            ctx.save();
            Paint off = new LinearGradient(0.25 * size, 0.25 * size,
                                           0.74 * size, 0.74 * size,
                                           false, CycleMethod.NO_CYCLE,
                                           new Stop(0.0, ledColor.get().deriveColor(0d, 1d, 0.20, 1d)),
                                           new Stop(0.49, ledColor.get().deriveColor(0d, 1d, 0.13, 1d)),
                                           new Stop(1.0, ledColor.get().deriveColor(0d, 1d, 0.2, 1d)));
View Full Code Here

    private void initGraphics() {                       
        innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), PREFERRED_HEIGHT * 0.1, 0, 0, 0);
        Color color = gradientLookup.getColorAt(getSkinnable().getValue() / (getSkinnable().getMaxValue() - getSkinnable().getMinValue()));
        background = new Circle(0.5 * PREFERRED_WIDTH, 0.5 * PREFERRED_HEIGHT, 0.5 * PREFERRED_WIDTH);
        background.setFill(new LinearGradient(0, 0, 0, PREFERRED_HEIGHT,
                                              false, CycleMethod.NO_CYCLE,
                                              new Stop(0, color.deriveColor(0, 1, 0.8, 1)),
                                              new Stop(1, color.deriveColor(0, 1, 0.6, 1))));
        background.setEffect(innerShadow);

View Full Code Here

        drawTickMarks(ticks);
    }
  
    private void adjustBackgroundColor() {
        Color color = gradientLookup.getColorAt(getSkinnable().getValue() / (getSkinnable().getMaxValue() - getSkinnable().getMinValue()));
        background.setFill(new LinearGradient(0, 0, 0, size,
                                              false, CycleMethod.NO_CYCLE,
                                              new Stop(0, color.deriveColor(0, 1, 0.8, 1)),
                                              new Stop(1, color.deriveColor(0, 1, 0.6, 1))));                       
    }
View Full Code Here

        canvas.setHeight(size);

        ctx.clearRect(0, 0, size, size);

        if (isFrameVisible()) { //frame
            Paint frame = new LinearGradient(0.14 * size, 0.14 * size,
                                             0.84 * size, 0.84 * size,
                                             false, CycleMethod.NO_CYCLE,
                                             new Stop(0.0, Color.rgb(20, 20, 20, 0.65)),
                                             new Stop(0.15, Color.rgb(20, 20, 20, 0.65)),
                                             new Stop(0.26, Color.rgb(41, 41, 41, 0.65)),
                                             new Stop(0.26, Color.rgb(41, 41, 41, 0.64)),
                                             new Stop(0.85, Color.rgb(200, 200, 200, 0.41)),
                                             new Stop(1.0, Color.rgb(200, 200, 200, 0.35)));
            ctx.setFill(frame);
            ctx.fillOval(0, 0, size, size);
        }

        InnerShadow innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 0.07 * size, 0, 0, 0);
        if (isOn()) { //on
            ctx.save();
            Paint on = new LinearGradient(0.25 * size, 0.25 * size,
                                          0.74 * size, 0.74 * size,
                                          false, CycleMethod.NO_CYCLE,
                                          new Stop(0.0, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.77, 1d)),
                                          new Stop(0.49, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.5, 1d)),
                                          new Stop(1.0, ((Color)ledColor.get())));
            innerShadow.setInput(new DropShadow(BlurType.TWO_PASS_BOX, (Color)ledColor.get(), 0.36 * size, 0, 0, 0));
            ctx.setEffect(innerShadow);
            ctx.setFill(on);
            ctx.fillOval(0.14 * size, 0.14 * size, 0.72 * size, 0.72 * size);
            ctx.restore();
        } else { // off
            ctx.save();
            Paint off = new LinearGradient(0.25 * size, 0.25 * size,
                                           0.74 * size, 0.74 * size,
                                           false, CycleMethod.NO_CYCLE,
                                           new Stop(0.0, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.20, 1d)),
                                           new Stop(0.49, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.13, 1d)),
                                           new Stop(1.0, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.2, 1d)));
View Full Code Here

TOP

Related Classes of javafx.scene.paint.LinearGradient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.