public boolean determineLocation(MouseEvent e) { Projection projection = getProjection(); if (cache != null && projection != null) { LatLonPoint ll = projection.inverse(e.getX(), e.getY(), new LatLonPoint.Double()); location = new DTEDLocation(e.getX(), e.getY()); location.setElevation(cache.getElevation((float) ll.getY(), (float) ll.getX())); location.generate(projection); repaint(); return true; } return false; }
/** * Paints the layer. * * @param g the Graphics context for painting */ public void paint(java.awt.Graphics g) { Debug.message("dted", getName() + "|DTEDLayer.paint()"); super.paint(g); if (location != null) location.render(g); location = null; }