private void pan(final Zoomable dst, final double rx, final double ry, final int dt) { if (dst == null) return; final RectangularShape src = dst.getZoom(); zoom( dst, new Rectangle2D.Double( src.getX() + src.getWidth() * rx, src.getY() + src.getHeight() * ry, src.getWidth(), src.getHeight()), dt); }
boolean render(Graphics2D map) { double diff = (System.nanoTime() - created) / 1000 / 1000; if (diff > timeAlive) return true; map.setColor(new Color(100, 100, 100, (int) (255 - (diff / timeAlive * 250)))); for (int i = 0; i < particles.length; i++) { RectangularShape tmp = (RectangularShape) particles[i][0]; double xD = (Double) particles[i][1]; double yD = (Double) particles[i][2]; tmp.setFrame( (double) tmp.getX() + xD / delta, (double) tmp.getY() + yD / delta, tmp.getWidth(), tmp.getHeight()); map.draw(tmp); } return false; }