public SceneComponent() {
		shapes = new ArrayList<SceneShape>();
		selectS = null;

		addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent e) {
				boolean clicked = false;
				mousePoint = e.getPoint();
				for (SceneShape s : shapes) {
					if (s.contains(mousePoint)) {
						s.setSelected(true);
						clicked = true;
					}
				}
				if (!clicked) {
					for (SceneShape s : shapes) {
						s.setSelected(false);
					}
					selectS = new SelectionShape(mousePoint.getX(),
							mousePoint.getY());
				}
				repaint();
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				selectS = null;
				repaint();
			}
		});

		addMouseMotionListener(new MouseMotionAdapter() {
			@Override
			public void mouseDragged(MouseEvent e) {
				Point lastMousePoint = mousePoint;
				mousePoint = e.getPoint();
				if (selectS == null) {
					for (SceneShape s : shapes) {
						if (s.isSelected()) {
							double dx = mousePoint.getX()
									- lastMousePoint.getX();
							double dy = mousePoint.getY()
									- lastMousePoint.getY();
							s.translate((int) dx, (int) dy);
						}
					}
				} else {
					selectS.setCorner(mousePoint.getX(), mousePoint.getY());
					for (SceneShape s : shapes) {
						if (selectS.contains(s.getSelectionArea())) {
							s.setSelected(true);
						} else {
							s.setSelected(false);
						}
					}
				}
				repaint();
			}
		});
	}