public void mousePressed(MouseEvent e)
			{
				x1 = e.getX();  // store where mouse is when clicked
				y1 = e.getY();

				if (!e.isPopupTrigger() && mode == Mode.NONE) // left click and
				{									   // not in a special mode
					int newsel = getSelected(x1, y1);  // find shape mouse is
					if(selindex>=0)
						unSelect();
					selindex = newsel;
					repaint();						 // clicked on
				}
				else if (e.isPopupTrigger() && selindex >= 0)  // if button is
				{								               // the popup menu
					popper.show(ShapePanel.this, x1, y1);      // trigger, show
				}											   // the popup menu
			}