javafx.scene.shape.RectangleBuilder Java Examples
The following examples show how to use
javafx.scene.shape.RectangleBuilder.
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: Curbstone3D.java From SmartCity-ParkingManagement with Apache License 2.0 | 6 votes |
public Curbstone(final double size, final Color color, final double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(2 * size).height(size).fill(color.deriveColor(0.0, 1.0, 1 - 0.5 * shade, 1.0)) .translateX(-0.5 * size).translateY(-0.5 * size).translateZ(0.5 * size).build(), RectangleBuilder.create() // bottom face .width(2 * size).height(size).fill(color.deriveColor(0.0, 1.0, 1 - 0.4 * shade, 1.0)) .translateX(-0.5 * size).translateY(0).rotationAxis(Rotate.X_AXIS).rotate(90).build(), RectangleBuilder.create() // right face .width(size).height(size).fill(Color.GRAY.deriveColor(0.0, 1.0, 1 - 0.3 * shade, 1.0)) .translateX(-1 * size).translateY(-0.5 * size).rotationAxis(Rotate.Y_AXIS).rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size).fill(Color.GRAY.deriveColor(0.0, 1.0, 1 - 0.2 * shade, 1.0)) .translateX(size).translateY(-0.5 * size).rotationAxis(Rotate.Y_AXIS).rotate(90).build(), RectangleBuilder.create() // top face .width(2 * size).height(size).fill(color.deriveColor(0.0, 1.0, 1 - 0.1 * shade, 1.0)) .translateX(-0.5 * size).translateY(-1 * size).rotationAxis(Rotate.X_AXIS).rotate(90) .build(), RectangleBuilder.create() // top face .width(2 * size).height(size).fill(color).translateX(-0.5 * size).translateY(-0.5 * size) .translateZ(-0.5 * size).build()); }
Example #2
Source File: CubeSystemSample.java From marathonv5 with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #3
Source File: AudioVisualizerSample.java From marathonv5 with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx, s); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #4
Source File: XylophoneSample.java From marathonv5 with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #5
Source File: CubeSample.java From marathonv5 with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #6
Source File: CubeSystemSample.java From marathonv5 with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #7
Source File: AudioVisualizerSample.java From marathonv5 with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx, s); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #8
Source File: XylophoneSample.java From marathonv5 with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #9
Source File: CubeSample.java From marathonv5 with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #10
Source File: Cube3D.java From netbeans with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #11
Source File: CubeSystem3D.java From netbeans with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #12
Source File: AudioVisualizer3D.java From netbeans with Apache License 2.0 | 4 votes |
public Cube(double size, Color color, double shade) { getTransforms().addAll(rz, ry, rx, s); getChildren().addAll( RectangleBuilder.create() // back face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.5*shade), 1.0)) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(0.5*size) .build(), RectangleBuilder.create() // bottom face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.4*shade), 1.0)) .translateX(-0.5*size) .translateY(0) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // right face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.3*shade), 1.0)) .translateX(-1*size) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // left face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.2*shade), 1.0)) .translateX(0) .translateY(-0.5*size) .rotationAxis(Rotate.Y_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color.deriveColor(0.0, 1.0, (1 - 0.1*shade), 1.0)) .translateX(-0.5*size) .translateY(-1*size) .rotationAxis(Rotate.X_AXIS) .rotate(90) .build(), RectangleBuilder.create() // top face .width(size).height(size) .fill(color) .translateX(-0.5*size) .translateY(-0.5*size) .translateZ(-0.5*size) .build() ); }
Example #13
Source File: DemoUtil.java From RadialFx with GNU Lesser General Public License v3.0 | 4 votes |
public void addGraphicControl(final String title, final ObjectProperty<Node> graphicProperty) { final Node circle = CircleBuilder.create().radius(4).fill(Color.ORANGE).build(); final Node square = RectangleBuilder.create().width(8).height(8).build(); final Node text = TextBuilder.create().text("test").build(); final ComboBox<Node> choices = new ComboBox<Node>(FXCollections.observableArrayList(circle, square, text)); choices.setCellFactory(new Callback<ListView<Node>, ListCell<Node>>() { @Override public ListCell<Node> call(final ListView<Node> param) { final ListCell<Node> cell = new ListCell<Node>() { @Override public void updateItem(final Node item, final boolean empty) { super.updateItem(item, empty); if (item != null) { setText(item.getClass().getSimpleName()); } else { setText(null); } } }; return cell; } }); choices.getSelectionModel().select(0); graphicProperty.bind(choices.valueProperty()); final VBox box = new VBox(); final Text titleText = new Text(title); titleText.textProperty().bind(new StringBinding() { { super.bind(choices.selectionModelProperty()); } @Override protected String computeValue() { return title + " : " + String.valueOf(choices.selectionModelProperty().get().getSelectedItem().getClass().getSimpleName()); } }); box.getChildren().addAll(titleText, choices); getChildren().add(box); }