Java Code Examples for javafx.scene.shape.Shape#setLayoutY()

The following examples show how to use javafx.scene.shape.Shape#setLayoutY() . 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: Piece.java    From DevToolBox with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Shape createPiece() {
    Shape shape = createPieceRectangle();
    if (hasRightTab) {
        shape = Shape.union(shape,
                createPieceTab(69.5f, 0f, 10f, 17.5f, 50f, -12.5f, 11.5f,
                        25f, 56.25f, -14f, 6.25f, 56.25f, 14f, 6.25f));
    }
    if (hasBottomTab) {
        shape = Shape.union(shape,
                createPieceTab(0f, 69.5f, 17.5f, 10f, -12.5f, 50f, 25f,
                        11f, -14f, 56.25f, 6.25f, 14f, 56.25f, 6.25f));
    }
    if (hasLeftTab) {
        shape = Shape.subtract(shape,
                createPieceTab(-31f, 0f, 10f, 17.5f, -50f, -12.5f, 11f,
                        25f, -43.75f, -14f, 6.25f, -43.75f, 14f, 6.25f));
    }
    if (hasTopTab) {
        shape = Shape.subtract(shape,
                createPieceTab(0f, -31f, 17.5f, 10f, -12.5f, -50f, 25f,
                        12.5f, -14f, -43.75f, 6.25f, 14f, -43.75f, 6.25f));
    }
    shape.setTranslateX(correctX);
    shape.setTranslateY(correctY);
    shape.setLayoutX(50f);
    shape.setLayoutY(50f);
    return shape;
}