Package ca.nengo.ui.actions

Examples of ca.nengo.ui.actions.PasteAction


      if (clipboardNames.size() == 1) {
        selectionName = clipboardNames.get(0);
      } else {
        selectionName = "selection";
      }
      PasteAction pasteAction = new PasteAction("Paste '" + selectionName + "' here", (NodeContainer)this, false);
      pasteAction.setPosition(posX, posY);
      menu.addAction(pasteAction);
    }
    menu.addAction(new ZoomToFitAction("Zoom to fit", this));
    /*MenuBuilder windowsMenu = menu.addSubMenu("Windows");
    windowsMenu.addAction(new CloseAllWindows("Close all"));
View Full Code Here


                @Override
                protected void action() {
                    // look for the active mouse handler. If it exists, it should contain
                    // the current mouse position (from the mousemoved event), so use this
                    // to create a new PasteEvent
                    PasteAction a;
                    MouseHandler mh = MouseHandler.getActiveMouseHandler();
                    if (mh != null) {
                        a = new PasteAction("Paste", (NodeContainer)mh.getWorld(), true);
                        Point2D pos = mh.getMouseMovedRelativePosition();
                        if (pos != null) {
                            a.setPosition(pos.getX(), pos.getY());
                        }
                    } else {
                        a = new PasteAction("Paste", NengoGraphics.getInstance(), true);
                    }
                    a.doAction();
                }
            };
        } else {
            pasteAction = new DisabledAction("Paste", "No object is in the clipboard");
        }
View Full Code Here

TOP

Related Classes of ca.nengo.ui.actions.PasteAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.