Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void MouseReleased(MouseEvent e) {
- Point position = e.getPoint();
- ((GraphDocumentView) documentView).transformationToUserSpace(position);
- if (e.getButton() == MouseEvent.BUTTON1) {
- Decision novi = new Decision(new Point2D.Double(
- position.getX() - 50, position.getY() - 50), new Dimension(
- 100, 100));
- if (allowElement(novi)) {
- setCursorX();
- getDocumentView().getCommandManager()
- .executeCommand(
- new AddElementCommand(novi,
- (GraphDiagram) getDocumentView()
- .getDocument()));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement