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

The following examples show how to use javafx.scene.paint.Color#ORANGE . 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: CubeSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override public Node create3dContent() {
    Cube c = new Cube(50,Color.RED,1);
    c.rx.setAngle(45);
    c.ry.setAngle(45);
    Cube c2 = new Cube(50,Color.GREEN,1);
    c2.setTranslateX(100);
    c2.rx.setAngle(45);
    c2.ry.setAngle(45);
    Cube c3 = new Cube(50,Color.ORANGE,1);
    c3.setTranslateX(-100);
    c3.rx.setAngle(45);
    c3.ry.setAngle(45);

    animation = new Timeline();
    animation.getKeyFrames().addAll(
            new KeyFrame(Duration.ZERO,
                    new KeyValue(c.ry.angleProperty(), 0d),
                    new KeyValue(c2.rx.angleProperty(), 0d),
                    new KeyValue(c3.rz.angleProperty(), 0d)
            ),
            new KeyFrame(Duration.seconds(1),
                    new KeyValue(c.ry.angleProperty(), 360d),
                    new KeyValue(c2.rx.angleProperty(), 360d),
                    new KeyValue(c3.rz.angleProperty(), 360d)
            ));
    animation.setCycleCount(Animation.INDEFINITE);

    return new Group(c,c2,c3);
}
 
Example 2
Source File: CubeSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override public Node create3dContent() {
    Cube c = new Cube(50,Color.RED,1);
    c.rx.setAngle(45);
    c.ry.setAngle(45);
    Cube c2 = new Cube(50,Color.GREEN,1);
    c2.setTranslateX(100);
    c2.rx.setAngle(45);
    c2.ry.setAngle(45);
    Cube c3 = new Cube(50,Color.ORANGE,1);
    c3.setTranslateX(-100);
    c3.rx.setAngle(45);
    c3.ry.setAngle(45);

    animation = new Timeline();
    animation.getKeyFrames().addAll(
            new KeyFrame(Duration.ZERO,
                    new KeyValue(c.ry.angleProperty(), 0d),
                    new KeyValue(c2.rx.angleProperty(), 0d),
                    new KeyValue(c3.rz.angleProperty(), 0d)
            ),
            new KeyFrame(Duration.seconds(1),
                    new KeyValue(c.ry.angleProperty(), 360d),
                    new KeyValue(c2.rx.angleProperty(), 360d),
                    new KeyValue(c3.rz.angleProperty(), 360d)
            ));
    animation.setCycleCount(Animation.INDEFINITE);

    return new Group(c,c2,c3);
}
 
Example 3
Source File: Cube3D.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Node create3dContent() {
    Cube c = new Cube(50,Color.RED,1);
    c.rx.setAngle(45);
    c.ry.setAngle(45);
    Cube c2 = new Cube(50,Color.GREEN,1);
    c2.setTranslateX(100);
    c2.rx.setAngle(45);
    c2.ry.setAngle(45);
    Cube c3 = new Cube(50,Color.ORANGE,1);
    c3.setTranslateX(-100);
    c3.rx.setAngle(45);
    c3.ry.setAngle(45);

    animation = new Timeline();
    animation.getKeyFrames().addAll(
            new KeyFrame(Duration.ZERO,
                    new KeyValue(c.ry.angleProperty(), 0d),
                    new KeyValue(c2.rx.angleProperty(), 0d),
                    new KeyValue(c3.rz.angleProperty(), 0d)
            ),
            new KeyFrame(Duration.seconds(1),
                    new KeyValue(c.ry.angleProperty(), 360d),
                    new KeyValue(c2.rx.angleProperty(), 360d),
                    new KeyValue(c3.rz.angleProperty(), 360d)
            ));
    animation.setCycleCount(Animation.INDEFINITE);

    return new Group(c,c2,c3);
}
 
Example 4
Source File: TargetEditorController.java    From ShootOFF with GNU General Public License v3.0 5 votes vote down vote up
public static Color createColor(final String name) {
	switch (name) {
	case "black":
		return Color.BLACK;
	case "blue":
		return Color.BLUE;
	case "brown":
		return Color.SADDLEBROWN;
	case "gray":
		return DARK_GRAY;
	case "green":
		return Color.GREEN;
	case "orange":
		return Color.ORANGE;
	case "red":
		return Color.RED;
	case "white":
		return Color.WHITE;
	default:
		if (name.startsWith("#")) {
			try {
				return Color.web(name);
			} catch (IllegalArgumentException e) {
				return Color.CORNSILK;
			}
		} else {
			return Color.CORNSILK;	
		}
	}
}
 
Example 5
Source File: ShipImage.java    From logbook-kai with MIT License 5 votes vote down vote up
/**
 * 補給ゲージ(燃料・弾薬)を取得します
 *
 * @param ship 艦娘
 * @return 補給ゲージ
 */
static Image getSupplyGauge(Ship ship) {
    Canvas canvas = new Canvas(36, 12);
    GraphicsContext gc = canvas.getGraphicsContext2D();

    Optional<ShipMst> mstOpt = Ships.shipMst(ship);
    if (mstOpt.isPresent()) {
        double width = canvas.getWidth();

        ShipMst mst = mstOpt.get();
        double fuelPer = (double) ship.getFuel() / (double) mst.getFuelMax();
        double ammoPer = (double) ship.getBull() / (double) mst.getBullMax();

        gc.setFill(Color.GRAY);
        gc.fillRect(0, 3, width, 2);

        gc.setFill(Color.GRAY);
        gc.fillRect(0, 10, width, 2);

        Color fuelColor = fuelPer >= 0.5D ? Color.GREEN : fuelPer >= 0.4D ? Color.ORANGE : Color.RED;
        Color ammoColor = ammoPer >= 0.5D ? Color.SADDLEBROWN : ammoPer >= 0.4D ? Color.ORANGE : Color.RED;

        gc.setFill(fuelColor);
        gc.fillRect(0, 0, width * fuelPer, 4);

        gc.setFill(ammoColor);
        gc.fillRect(0, 7, width * ammoPer, 4);
    }
    SnapshotParameters sp = new SnapshotParameters();
    sp.setFill(Color.TRANSPARENT);

    return canvas.snapshot(sp, null);
}