I am developing a javafx sketching application. I have created a borderpane and dividing it into three regions:
- The first region(top region): for menubar.
- The second region(center region): is used as a canvas.
- The third region(bottom region): is created to represent toolbar items.
The toolbar includes a group of pens and other items. it has created using pane class.The problem in my application is when I draw on the canvas, the drawn line can overcome its boundary when I drag on mouse, and drawn on toolbar.
So is there another pane (for toolbar items) that is used to hide these drawn lines?
Part of the code:
public Paint(){
p1 = new BorderPane();
toolsBar = new Pane();
freePane = new Pane();
p1.setBottom(toolsBar);
p1.setCenter(freePane);
toolsBar.setCursor(Cursor.HAND);
toolsBar.setId("toolsBar");
}
Circle can be drawn in toolbar pane: