public Piece(Image image, final double correctX, final double correctY,
            boolean topTab, boolean leftTab, boolean bottomTab, boolean rightTab,
            final double deskWidth, final double deskHeight) {
        this.correctX = correctX;
        this.correctY = correctY;
        this.hasTopTab = topTab;
        this.hasLeftTab = leftTab;
        this.hasBottomTab = bottomTab;
        this.hasRightTab = rightTab;
        // configure clip
        pieceClip = createPiece();
        pieceClip.setFill(Color.WHITE);
        pieceClip.setStroke(null);
        // add a stroke
        pieceStroke = createPiece();
        pieceStroke.setFill(null);
        pieceStroke.setStroke(Color.BLACK);
        // create image view
        imageView.setImage(image);
        imageView.setFitWidth(550);
        imageView.setPreserveRatio(true);
        imageView.setClip(pieceClip);
        setFocusTraversable(true);
        getChildren().addAll(imageView, pieceStroke);
        // turn on caching so the jigsaw piece is fasr to draw when dragging
        setCache(true);
        // start in inactive state
        setInactive();
        // add listeners to support dragging
        setOnMousePressed((MouseEvent me) -> {
            toFront();
            startDragX = getTranslateX();
            startDragY = getTranslateY();
            dragAnchor = new Point2D(me.getSceneX(), me.getSceneY());
        });

        setOnMouseReleased((MouseEvent me) -> {
            if (getTranslateX() < (10) && getTranslateX() > (- 10)
                    && getTranslateY() < (10) && getTranslateY() > (- 10)) {
                setTranslateX(0);
                setTranslateY(0);
                setInactive();
            }
        });

        setOnMouseDragged((MouseEvent me) -> {
            double newTranslateX = startDragX
                    + me.getSceneX() - dragAnchor.getX();
            double newTranslateY = startDragY
                    + me.getSceneY() - dragAnchor.getY();
            double minTranslateX = -45f - correctX;
            double maxTranslateX = (deskWidth - Piece.SIZE + 50f) - correctX;
            double minTranslateY = -30f - correctY;
            double maxTranslateY = (deskHeight - Piece.SIZE + 70f) - correctY;
            if ((newTranslateX > minTranslateX)
                    && (newTranslateX < maxTranslateX)
                    && (newTranslateY > minTranslateY)
                    && (newTranslateY < maxTranslateY)) {
                setTranslateX(newTranslateX);
                setTranslateY(newTranslateY);
            }
        });
    }