graphic.getGraphic().distance(e.getX(), e.getY()) > 2) || graphic.getGraphic().distanceToEdge(e.getX(), e.getY()) > 2) {  graphic.getStateMachine().setUnselected();     } else if (graphic.getCanGrabGraphic()) {   Debug.message("eomg", "GraphicStateMachine|selected state|mousePressed - graphic held"); graphic.getStateMachine().setEdit();
graphic.getGraphic().distance(e.getX(), e.getY()) <= 2) || graphic.getGraphic().distanceToEdge(e.getX(), e.getY()) <= 2) {
    public boolean mousePressed(MouseEvent e) {	Debug.message("eomg", "GraphicStateMachine|selected state|mousePressed");	GrabPoint mp = graphic.getMovingPoint(e);	// If the graphic itself was clicked on, then just go to selected	// mode.	if (mp == null) {	    if ((graphic.getGraphic().getRenderType() != OMGraphic.RENDERTYPE_LATLON &&		 graphic.getGraphic().distance(e.getX(), e.getY()) > 2) ||		graphic.getGraphic().distanceToEdge(e.getX(), e.getY()) > 2) {		// if the graphic isn't picked, then unselect the graphic.		graphic.getStateMachine().setUnselected();//  		graphic.setMovingPoint(new GrabPoint(e.getX(), e.getY()));//  		graphic.fireEvent(EOMGCursors.DEFAULT, "");//  		graphic.setMovingPoint(null);//  		graphic.redraw(e, true);	    } else if (graphic.getCanGrabGraphic()) {		// No point was selected, but the graphic was.  Get ready		// to move the graphic.		Debug.message("eomg", "GraphicStateMachine|selected state|mousePressed - graphic held");		graphic.getStateMachine().setEdit();		// This is the only difference in this method from the		// GraphicSelectedState.mousePressed method.		graphic.fireEvent(EOMGCursors.EDIT, "");		////////		graphic.move(e);	    } else {		graphic.fireEvent(EOMGCursors.DEFAULT, "");		graphic.redraw(e, true);	    }	} else {	    // else, if the moving point is set, go to edit mode.  If	    // the mouse is released, we'll consider ourselves	    // unselected agin.	    graphic.getStateMachine().setEdit();	    graphic.fireEvent(EOMGCursors.EDIT, "");	}	return getMapMouseListenerResponse();    }