super(new AnchorPane());
controller = new FxDecorateController(this);
pane = (AnchorPane) getRoot();
this.stage = stage;
Color edges = Color.TRANSPARENT;
// Align content
this.content = content;
pane.getChildren().add(content);
AnchorPane.setLeftAnchor(content, 0d);
AnchorPane.setTopAnchor(content, 0d);
AnchorPane.setRightAnchor(content, 0d);
AnchorPane.setBottomAnchor(content, 0d);
// Align west resize handle
resizeWest = new Rectangle();
resizeWest.setCursor(Cursor.W_RESIZE);
resizeWest.setFill(edges);
pane.getChildren().add(resizeWest);
resizeWest.widthProperty().bind(edgeSize);
resizeWest.heightProperty().bind(heightProperty());
AnchorPane.setLeftAnchor(resizeWest, 0d);
AnchorPane.setTopAnchor(resizeWest, 0d);
controller.setResizeableHandle(resizeWest);
// Align top border
resizeNorth = new Rectangle();
resizeNorth.setCursor(Cursor.N_RESIZE);
resizeNorth.setFill(edges);
pane.getChildren().add(resizeNorth);
resizeNorth.widthProperty().bind(widthProperty());
resizeNorth.heightProperty().bind(edgeSize);
AnchorPane.setLeftAnchor(resizeNorth, 0d);
AnchorPane.setTopAnchor(resizeNorth, 0d);
controller.setResizeableHandle(resizeNorth);
// Align right border
resizeEast = new Rectangle();
resizeEast.setCursor(Cursor.E_RESIZE);
resizeEast.setFill(edges);
pane.getChildren().add(resizeEast);
resizeEast.widthProperty().bind(edgeSize);
resizeEast.heightProperty().bind(heightProperty());
AnchorPane.setTopAnchor(resizeEast, 0d);
AnchorPane.setRightAnchor(resizeEast, 0d);
controller.setResizeableHandle(resizeEast);
// Align bottom border
resizeSouth = new Rectangle();
resizeSouth.setCursor(Cursor.S_RESIZE);
resizeSouth.setFill(edges);
pane.getChildren().add(resizeSouth);
resizeSouth.widthProperty().bind(widthProperty());
resizeSouth.heightProperty().bind(edgeSize);
AnchorPane.setLeftAnchor(resizeSouth, 0d);
AnchorPane.setBottomAnchor(resizeSouth, 0d);
controller.setResizeableHandle(resizeSouth);
Color corners = Color.TRANSPARENT;
// Align north-west resize handle
resizeNorthWest = new Rectangle();
resizeNorthWest.setCursor(Cursor.NW_RESIZE);
resizeNorthWest.setFill(corners);