Package javafx.scene.paint

Examples of javafx.scene.paint.Color


        double emptyOffset = (emptyRange * 0.5) * angleFactor;

        double minFraction = 1.0;
        double maxFraction = 0.0;
        Color  minFractionColor = Color.TRANSPARENT;
        Color  maxFractionColor = Color.TRANSPARENT;

        for (Stop stop : getSkinnable().getBarGradient()) {
            double fraction = stop.getOffset();
            if (fraction < minFraction) {
                minFraction      = fraction;
View Full Code Here


    }

    public Image getImage(final double WIDTH, final double HEIGHT) {
        int   width  = (int) WIDTH  <= 0 ? 100 : (int) WIDTH;
        int   height = (int) HEIGHT <= 0 ? 100 : (int) HEIGHT;
        Color color  = Color.TRANSPARENT;
        final WritableImage RASTER       = new WritableImage(width, height);
        final PixelWriter   PIXEL_WRITER = RASTER.getPixelWriter();
        if (null == center) {
            center = new Point2D(width / 2, height / 2);
        }
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);

        ticksCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        ticksCanvas.setMouseTransparent(true);
        ticks = ticksCanvas.getGraphicsContext2D();
View Full Code Here

        valueIndicatorRotate.setAngle(targetAngle);
        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

    public static Image createGrayNoise(final double WIDTH, final double HEIGHT, final Color COLOR, final int VARIATION) {
        int red   = (int) (255 * COLOR.getRed());
        int green = (int) (255 * COLOR.getRed());
        int blue  = (int) (255 * COLOR.getRed());
        int variation = clamp(0, 255, VARIATION) / 2;
        Color darkColor   = Color.rgb(clamp(0, 255, red - variation), clamp(0, 255, green - variation), clamp(0, 255, blue - variation));
        Color brightColor = Color.rgb(clamp(0, 255, red + variation), clamp(0, 255, green + variation), clamp(0, 255, blue + variation));
        return createGrayNoise(WIDTH, HEIGHT, darkColor, brightColor);
    }
View Full Code Here

    public final ListProperty<Color> ledColorsProperty() {
        return ledColors;
    }

    public final Color getLedColor(final int INDEX) {
        Color ledColor;
        if (INDEX < 0) {
            ledColor = ledColors.get().get(0);
        } else if (INDEX > getNoOfLeds() - 1) {
            ledColor = ledColors.get().get(getNoOfLeds() - 1);
        } else {
View Full Code Here

            double scaledShare = timeShare * IMAGE_WIDTH;
            double xStart = IMAGE_WIDTH - scaledShare;
            context.setFill(Color.GREEN);
            context.fillRect(xStart, 0, scaledShare, IMAGE_HEIGHT);

            Color color = timeShare > 0.5 ? WHEAT : RED;
            context.setFill(color);
            context.fillText(renderTimeShare(timeShare), TEXT_HORIZONTAL_INSET, TEXT_VERTICAL_INSET);

            setGraphic(canvas);
        }
View Full Code Here

        refreshLines(gc.getCanvas().getWidth(), gc.getCanvas().getHeight());
        drawScreen(gc);
    }

    private void drawScreen(GraphicsContext gc) {
        final Color bgColor = Color.BLACK;
        final Color textColor = Color.rgb(0x00, 0xFF, 0x00);

        gc.setFill(bgColor);
        gc.fillRect(0, 0, gc.getCanvas().getWidth(), gc.getCanvas().getHeight());

        gc.setFont(font);
View Full Code Here

        super(new AnchorPane());
        controller = new FxDecorateController(this);
        pane = (AnchorPane) getRoot();
        this.stage = stage;

        Color edges = Color.TRANSPARENT;

        // Align content
        this.content = content;
        pane.getChildren().add(content);
        AnchorPane.setLeftAnchor(content, 0d);
        AnchorPane.setTopAnchor(content, 0d);
        AnchorPane.setRightAnchor(content, 0d);
        AnchorPane.setBottomAnchor(content, 0d);

        // Align west resize handle
        resizeWest = new Rectangle();
        resizeWest.setCursor(Cursor.W_RESIZE);
        resizeWest.setFill(edges);
        pane.getChildren().add(resizeWest);
        resizeWest.widthProperty().bind(edgeSize);
        resizeWest.heightProperty().bind(heightProperty());
        AnchorPane.setLeftAnchor(resizeWest, 0d);
        AnchorPane.setTopAnchor(resizeWest, 0d);
        controller.setResizeableHandle(resizeWest);

        // Align top border
        resizeNorth = new Rectangle();
        resizeNorth.setCursor(Cursor.N_RESIZE);
        resizeNorth.setFill(edges);
        pane.getChildren().add(resizeNorth);
        resizeNorth.widthProperty().bind(widthProperty());
        resizeNorth.heightProperty().bind(edgeSize);
        AnchorPane.setLeftAnchor(resizeNorth, 0d);
        AnchorPane.setTopAnchor(resizeNorth, 0d);
        controller.setResizeableHandle(resizeNorth);

        // Align right border
        resizeEast = new Rectangle();
        resizeEast.setCursor(Cursor.E_RESIZE);
        resizeEast.setFill(edges);
        pane.getChildren().add(resizeEast);
        resizeEast.widthProperty().bind(edgeSize);
        resizeEast.heightProperty().bind(heightProperty());
        AnchorPane.setTopAnchor(resizeEast, 0d);
        AnchorPane.setRightAnchor(resizeEast, 0d);
        controller.setResizeableHandle(resizeEast);

        // Align bottom border
        resizeSouth = new Rectangle();
        resizeSouth.setCursor(Cursor.S_RESIZE);
        resizeSouth.setFill(edges);
        pane.getChildren().add(resizeSouth);
        resizeSouth.widthProperty().bind(widthProperty());
        resizeSouth.heightProperty().bind(edgeSize);
        AnchorPane.setLeftAnchor(resizeSouth, 0d);
        AnchorPane.setBottomAnchor(resizeSouth, 0d);
        controller.setResizeableHandle(resizeSouth);

        Color corners = Color.TRANSPARENT;

        // Align north-west resize handle
        resizeNorthWest = new Rectangle();
        resizeNorthWest.setCursor(Cursor.NW_RESIZE);
        resizeNorthWest.setFill(corners);
View Full Code Here

                @Override
                protected Paint computeValue() {
                    Presence presence = contactItem.presence.get();
                    if (presence != null && presence.isAvailable()) {
                        return new Color(0.52, 0.84, 0.27, 1);
                    }
                    return Color.LIGHTGREY;
                }
            });
            getChildren().add(imageView);
View Full Code Here

TOP

Related Classes of javafx.scene.paint.Color

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.