Package javafx.scene.canvas

Examples of javafx.scene.canvas.GraphicsContext.fillRect()


            double timeShare = profileNode.getTotalTimeShare();
            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);

View Full Code Here


            final double scaledShare = timeShare * width;

            Canvas canvas = new Canvas(width, height);
            GraphicsContext context = canvas.getGraphicsContext2D();
            context.setFill(timeTakenColor);
            context.fillRect(0, 0, scaledShare, height);
            setGraphic(canvas);
        }
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.