Advertisement
Guest User

b

a guest
Dec 26th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. public void MouseReleased(MouseEvent e) {
  2.         Point position = e.getPoint();
  3.         ((GraphDocumentView) documentView).transformationToUserSpace(position);
  4.         if (e.getButton() == MouseEvent.BUTTON1) {
  5.             Decision novi = new Decision(new Point2D.Double(
  6.                     position.getX() - 50, position.getY() - 50), new Dimension(
  7.                     100, 100));
  8.             if (allowElement(novi)) {
  9.                 setCursorX();
  10.                 getDocumentView().getCommandManager()
  11.                         .executeCommand(
  12.                                 new AddElementCommand(novi,
  13.                                         (GraphDiagram) getDocumentView()
  14.                                                 .getDocument()));
  15.             }
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement