if(menuIconShape != null) { if(menuIconShape.contains(pos)) {  backingModel.selectThumbnail(parentThumbnail); JPopupMenu popup = PopupMenuFactory.getThumbnailMenu(backingModel); Component component = (PCanvas)event.getComponent(); int x = (int)Math.round(getOffset().getX())+8; int y = (int)Math.round(getOffset().getY())+36; popup.show(component,x,y); } }
    public void respondMouseClick(PInputEvent event)    {        Point2D pos = event.getPositionRelativeTo(this);        if(prevImageShape != null)        {            if(prevImageShape.contains(pos))            {                parentThumbnail.showPreviousImage();                setImage(thumbnailImages[parentThumbnail.getMultipleImageIndex()]);                setBounds(border);                repaint();                return;            }        }        if(nextImageShape != null)        {            if(nextImageShape.contains(pos))            {                parentThumbnail.showNextImage();                setImage(thumbnailImages[parentThumbnail.getMultipleImageIndex()]);                setBounds(border);                repaint();                return;            }        }        if(openIconShape != null)        {            if(openIconShape.contains(pos))            {                BrowserEnvironment env = BrowserEnvironment.getInstance();                BrowserAgent agent = env.getBrowserAgent();                agent.loadImage(parentThumbnail);                return;            }        }        if(closeIconShape != null)        {            if(closeIconShape.contains(pos))            {                getParent().removeChild(this);            }        }        if(annotateIconShape != null)        {            if(annotateIconShape.contains(pos))            {                PiccoloAction action =                     PiccoloActionFactory.getAnnotateImageAction(parentThumbnail,                                                                absoluteLocation);                action.execute();            }        }    }