JPopupMenu menu = PopupMenuFactory.getMenu(node); if(menu != null) { Point2D position = e.getPosition(); e.getCamera().viewToLocal(position); int offsetX = (int)Math.round(position.getX()); int offsetY = (int)Math.round(position.getY());   PCanvas canvas = (PCanvas)e.getComponent(); menu.show(canvas,offsetX,offsetY); }
Thumbnail t = (Thumbnail)node; BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); agent.loadImage(t);
        public void execute(PInputEvent e)        {            PNode node = e.getPickedNode();            JPopupMenu menu = PopupMenuFactory.getMenu(node);            if(menu != null)            {                Point2D position = e.getPosition();                e.getCamera().viewToLocal(position);                int offsetX = (int)Math.round(position.getX());                int offsetY = (int)Math.round(position.getY());                                // this could be error prone, but hopefully not in context                PCanvas canvas = (PCanvas)e.getComponent();                menu.show(canvas,offsetX,offsetY);            }        }