/** * Set the camera associated with this canvas. All input events from this * canvas go through this camera. And this is the camera that paints this * canvas. * * @param newCamera the camera which this PCanvas should view the scene */ public void setCamera(final PCamera newCamera) { if (camera != null) { camera.setComponent(null); } camera = newCamera; if (camera != null) { camera.setComponent(this); camera.setBounds(0, 0, getWidth(), getHeight()); } }
g2.fillRect(0, 0, getWidth(), getHeight());
final double nodeRatio = ((double) getWidth()) / ((double) getHeight()); final double scale; if (nodeRatio <= clipRatio) {