@Override
	public void mousePressed(MouseEvent e) {		
		if(e.getButton() == 1) {
			if(!pv.hasFocus()) pv.requestFocus();
			
			if(pv.act == SELECT) {
				if(isKeyDown(KeyEvent.VK_CONTROL)) {
					for(int i = 0; i < pv.tables.size(); i++) {
						Table t = pv.tables.get(i);
						if(t.contains(lastMouse)) {
							if(!pv.selected.contains(t)) {
								pv.selected.add(t);
							} else {
								pv.selected.remove(t);
							}
						}
					}
				} else if(pv.selected.isEmpty()) {
					for(int i = 0; i < pv.tables.size(); i++) {
						Table t = pv.tables.get(i);
						if(t.contains(lastMouse)) {
							pv.selected.add(t);
							break;
						}
					}
				} else {
					boolean unselect = true;
					for(int i = 0; i < pv.selected.size(); i++) {
						Table t = pv.selected.get(i);
						if(t.contains(lastMouse)) {
							unselect = false;
							break;
						}
					}
					if(unselect) {
						pv.selected.clear();
						for(int i = 0; i < pv.tables.size(); i++) {
							Table t = pv.tables.get(i);
							if(t.contains(lastMouse)) {
								pv.selected.add(t);
								break;
							}
						}
					}
				}
				
				pv.info.update();
			} else if(pv.act == PARTNER) {
				for(int i = 0; i < pv.tables.size(); i++) {
					Table t = pv.tables.get(i);
					
					if(t.contains(lastMouse) && !pv.selected.contains(t)) {
						pv.selected.get(0).setPartner(t);
						if(t.getPartner() != null) {
							t.getPartner().setPartner(null);
						}
						t.setPartner(pv.selected.get(0));
						System.out.println(pv.selected.get(0) + " partner = " + t);
						pv.act = SELECT;
						break;
					}
				}
			}
		}
	}