14a15,15 > import CH.ifa.draw.contrib.zoom.ZoomDrawingView; 166a168,187 > // Calculate position on physical screen based > // on x,y coordinates > Point newLocation; > try { > newLocation = comp.getLocationOnScreen(); > } catch (IllegalComponentStateException e) { > // For some reason, the component > // apparently isn't showing on the > // screen (huh?). Never mind - don't > // show the popup.. > return; > } > // If this is a ZoomDrawingView, we'll need to > // compensate here too: > if (comp instanceof ZoomDrawingView) { > double scale = ((ZoomDrawingView) comp).getScale(); > x *= scale; > y *= scale; > } > newLocation.translate(x,y); 167,169d167 < // calculate offsets for internal MDI frames < Point newLocation = new Point(x, y); < adjustOffsets(comp.getParent(), newLocation); 176,188d193 < /** < * Internal MDI frames have offsets where a popup menu should be < * shown (in JDK 1.2). < * This method sums up iteratively all x and y offsets of all < * parent compontents until the top parent component is reached. < */ < private void adjustOffsets(Component comp, Point offsetPoint) { < if (comp != null) { < Point compLocation = comp.getLocation(); < offsetPoint.translate(compLocation.x, compLocation.y); < adjustOffsets(comp.getParent(), offsetPoint); < } < }