repaint();
PlotPanel.this.repaint();
	  public void mouseClicked(MouseEvent e) {	    	    if ((m_sIndex == 2 || m_sIndex == 3) && 		(m_createShape || 		 (e.getModifiers() & e.BUTTON1_MASK) == e.BUTTON1_MASK)) {	      if (m_createShape) {		//then it has been started already.		Graphics g = getGraphics();		g.setColor(Color.black);		g.setXORMode(Color.white);		if ((e.getModifiers() & e.BUTTON1_MASK) == e.BUTTON1_MASK) {		  m_shapePoints.addElement(new 		    Double(convertToAttribX(e.getX())));		  		  m_shapePoints.addElement(new 		    Double(convertToAttribY(e.getY())));		  		  m_newMousePos.width = e.getX();		  m_newMousePos.height = e.getY();		  g.drawLine((int)Math.ceil			     (convertToPanelX			      (((Double)m_shapePoints.				elementAt(m_shapePoints.size() - 2)).			       doubleValue())),			     			     (int)Math.ceil			     (convertToPanelY			      (((Double)m_shapePoints.				elementAt(m_shapePoints.size() - 1)).			       doubleValue())),			     m_newMousePos.width, m_newMousePos.height);		  		}		else if (m_sIndex == 3) {		  //then extend the lines to infinity 		  //(100000 or so should be enough).		  //the area is selected by where the user right clicks 		  //the mouse button		  		  m_createShape = false;		  if (m_shapePoints.size() >= 5) {		    double cx = Math.ceil		      (convertToPanelX		       (((Double)m_shapePoints.elementAt			 (m_shapePoints.size() - 4)).doubleValue()));		    		    double cx2 = Math.ceil		      (convertToPanelX		       (((Double)m_shapePoints.elementAt			 (m_shapePoints.size() - 2)).doubleValue())) - 		      cx;		    		    cx2 *= 50000;		    		    double cy = Math.ceil		      (convertToPanelY(((Double)m_shapePoints.elementAt					(m_shapePoints.size() - 3)).				       doubleValue()));		    double cy2 = Math.ceil		      (convertToPanelY(((Double)m_shapePoints.elementAt					(m_shapePoints.size() - 1)).				       doubleValue())) - cy;		    cy2 *= 50000;			    		    		    double cxa = Math.ceil(convertToPanelX					   (((Double)m_shapePoints.					     elementAt(3)).					    doubleValue()));		    double cxa2 = Math.ceil(convertToPanelX					    (((Double)m_shapePoints.					      elementAt(1)).					     doubleValue())) - cxa;		    cxa2 *= 50000;		    		    		    double cya = Math.ceil		      (convertToPanelY		       (((Double)m_shapePoints.elementAt(4)).			doubleValue()));		    double cya2 = Math.ceil		      (convertToPanelY		       (((Double)m_shapePoints.elementAt(2)).			doubleValue())) - cya;		    		    cya2 *= 50000;		    		    m_shapePoints.setElementAt		      (new Double(convertToAttribX(cxa2 + cxa)), 1);		    		    m_shapePoints.setElementAt		      (new Double(convertToAttribY(cy2 + cy)), 		       m_shapePoints.size() - 1);		    		    m_shapePoints.setElementAt		      (new Double(convertToAttribX(cx2 + cx)), 		       m_shapePoints.size() - 2);		    		    m_shapePoints.setElementAt		      (new Double(convertToAttribY(cya2 + cya)), 2);		    		    		    //determine how infinity line should be built		    		    cy = Double.POSITIVE_INFINITY;		    cy2 = Double.NEGATIVE_INFINITY;		    if (((Double)m_shapePoints.elementAt(1)).			doubleValue() > 			((Double)m_shapePoints.elementAt(3)).			doubleValue()) {		      if (((Double)m_shapePoints.elementAt(2)).			  doubleValue() == 			  ((Double)m_shapePoints.elementAt(4)).			  doubleValue()) {			cy = ((Double)m_shapePoints.elementAt(2)).			  doubleValue();		      }		    }		    if (((Double)m_shapePoints.elementAt			 (m_shapePoints.size() - 2)).doubleValue() > 			((Double)m_shapePoints.elementAt			 (m_shapePoints.size() - 4)).doubleValue()) {		      if (((Double)m_shapePoints.elementAt			   (m_shapePoints.size() - 3)).			  doubleValue() == 			  ((Double)m_shapePoints.elementAt			   (m_shapePoints.size() - 1)).doubleValue()) {			cy2 = ((Double)m_shapePoints.lastElement()).			  doubleValue();		      }		    }		    m_shapePoints.addElement(new Double(cy));		    m_shapePoints.addElement(new Double(cy2));		    		    if (!inPolyline(m_shapePoints, convertToAttribX				    (e.getX()), 				    convertToAttribY(e.getY()))) {		      Double tmp = (Double)m_shapePoints.			elementAt(m_shapePoints.size() - 2);		      m_shapePoints.setElementAt			(m_shapePoints.lastElement(), 			 m_shapePoints.size() - 2);		      m_shapePoints.setElementAt			(tmp, m_shapePoints.size() - 1);		    }		    		    if (m_shapes == null) {		      m_shapes = new FastVector(4);		    }		    m_shapes.addElement(m_shapePoints);		    m_submit.setText("Submit");		    m_submit.setActionCommand("Submit");		    		    m_submit.setEnabled(true);		  }		  		  m_shapePoints = null;		  repaint();		  		}		else {		  //then close the shape		  m_createShape = false;		  if (m_shapePoints.size() >= 7) {		    m_shapePoints.addElement(m_shapePoints.elementAt(1));		    m_shapePoints.addElement(m_shapePoints.elementAt(2));		    if (m_shapes == null) {		      m_shapes = new FastVector(4);		    }		    m_shapes.addElement(m_shapePoints);			   		    m_submit.setText("Submit");		    m_submit.setActionCommand("Submit");		    		    m_submit.setEnabled(true);		  }		  m_shapePoints = null;		  repaint();		}		g.dispose();		//repaint();	      }	      else if ((e.getModifiers() & e.BUTTON1_MASK) == e.BUTTON1_MASK) {		//then this is the first point		m_createShape = true;		m_shapePoints = new FastVector(17);		m_shapePoints.addElement(new Double(m_sIndex));		m_shapePoints.addElement(new 		  Double(convertToAttribX(e.getX())));      //the new point		m_shapePoints.addElement(new 		  Double(convertToAttribY(e.getY())));		m_newMousePos.width = e.getX();      //the temp mouse point		m_newMousePos.height = e.getY();		Graphics g = getGraphics();		g.setColor(Color.black);		g.setXORMode(Color.white);		g.drawLine((int)Math.ceil			   (convertToPanelX(((Double)m_shapePoints.					     elementAt(1)).doubleValue())),			   (int)Math.ceil			   (convertToPanelY(((Double)m_shapePoints.					     elementAt(2)).doubleValue())),			   m_newMousePos.width, m_newMousePos.height);		g.dispose();	      }	    }	    else {	      if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == 		  InputEvent.BUTTON1_MASK) {				searchPoints(e.getX(),e.getY(), false);	      } else {		searchPoints(e.getX(), e.getY(), true);	      }	    }	  }