/** * Translates current screen tiles grid to avoid actual view point transformation. Such grid * translating leads to view point changing without any geo recalculations. This method also fires * view point changed event if <code>isLast</code> param is true. * * @param x Amount of offset in screen coordinate space along horizontal axis. * @param y Amount of offset in screen coordinate space along vertical axis. * @param isLast Flag, indicating that this translate call is last call in some sequence. If true, * view point change event will be fired. * @throws Exception */ @Override public void translateGrid(int x, int y, boolean isLast) throws Exception { super.translateGrid(x, y, isLast); if (isLast) { Point2D.Double screenCenterBefore = screen2Cartesian(new Point(0, 0)); Point2D.Double screenCenterAfter = screen2Cartesian(new Point(x, y)); fireViewTranslated( screenCenterAfter.x - screenCenterBefore.x, screenCenterAfter.y - screenCenterBefore.y, aoiToGeoGeometry(), aoiToCartesianGeometry()); } }
@Override protected void paintScreenContext(Graphics2D g) { if (screenContext != null) { synchronized (screenContext) { try { // let's paint selection and phanton layers screenRenderer.setMapContent(screenContext); Rectangle clip = g.getClipBounds(); Point2D.Double lu = screen2Cartesian(clip.getLocation()); Point2D.Double br = screen2Cartesian(new Point(clip.x + clip.width, clip.y + clip.height)); Geometry aoiGeometry = constructRectyPolygonGeometry(lu, br); Envelope aoiEnvelope = new ReferencedEnvelope( aoiGeometry.getEnvelopeInternal(), screenContext.getCoordinateReferenceSystem()); screenRenderer.paint(g, clip, aoiEnvelope, cartesian2Screen); } catch (NoninvertibleTransformException ex) { Logger.getLogger(JGeoPane.class.getName()).log(Level.SEVERE, null, ex); } } } super.paintScreenContext(g); }
@Override public synchronized void repaint() { super.repaint(); }