public void keyPressed(KeyEvent e) { if (no_input) return; // TODO Auto-generated method stub if (e.getKeyCode() == KeyEvent.VK_CONTROL) ctrl_pressed = true; if (e.getKeyCode() == KeyEvent.VK_SHIFT) { shift_pressed = true; for (WorldAlignementContainer cont : conts) { gui.remove(cont); } conts.clear(); } if (e.getKeyCode() == KeyEvent.VK_SPACE) { clearSelection(); float x = renderer.getCamera().getScreenToWorldX(renderer.getCamera().getMousePosition().x); float y = renderer.getCamera().getScreenToWorldY(renderer.getCamera().getMousePosition().y); sim.addObject(new Planet(sim, new Vector2D(x, y), 100, 1, 1, 1, 50)); } }
private void clearSelection() { selected_planets.clear(); for (WorldAlignementContainer cont : conts) gui.remove(cont); conts.clear(); }