public EditorPanel(EditorMain parent) {
		addMouseWheelListener(new MouseWheelListener() {
			public void mouseWheelMoved(MouseWheelEvent e) {
				offy += e.getWheelRotation() * GRID_SIZE * 2;
				repaint();
			}
		});
		myparent = parent;
		addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				if (e.getButton() == MouseEvent.BUTTON3) {
					Class itstype = level.remove(e.getX() + offx, e.getY() + offy);
					if (itstype != null) {
						for (EntityTypes v : EntityTypes.values()) {
							if (v.type.equals(itstype)) {
								type = v;
								myparent.getComboBox().setSelectedItem(v);
								break;
							}
						}
						repaint();
					}
				}
				if (e.getButton() == MouseEvent.BUTTON1) {
					Entity en = null;
					
					level.add(type, e.getX() - (e.getX() % GRID_SIZE) + offx, e.getY() - (e.getY() % GRID_SIZE) + offy, metadata);
					repaint();
				}
			}
		});
		addMouseMotionListener(new MouseMotionAdapter() {
			@Override
			public void mouseMoved(MouseEvent e) {
				repaint();
			}
		});
		level = new Level();
		
		setPreferredSize(new Dimension(640, 480));
	}