public void commitEvent (Event event) {
if (event instanceof KeyEvent3D) {
KeyEvent key = (KeyEvent) ((KeyEvent3D)event).getAwtEvent();
if (key.getKeyCode()==KeyEvent.VK_EQUALS) {
zoom(cameraZoom);
viewMoved(new CellTransform(viewRot, viewTranslation));
} else if (key.getKeyCode()==KeyEvent.VK_MINUS) {
zoom(-cameraZoom);
viewMoved(new CellTransform(viewRot, viewTranslation));
}
} else if (event instanceof MouseEvent3D) {
MouseEvent mouse = (MouseEvent)((MouseEvent3D)event).getAwtEvent();
if (mouse instanceof MouseWheelEvent) {
int clicks = ((MouseWheelEvent)mouse).getWheelRotation();
zoom(-cameraZoom*clicks);
viewMoved(new CellTransform(viewRot, viewTranslation));
} else if (mouse.isControlDown()) {
int diffX = mouse.getX() - mouseX;
int diffY = mouse.getY() - mouseY;
float scale = mouse.isShiftDown()? 4f : 16f;