This tutorial shows how to create a new plug-in that adds a distance tool to the uDig application.
Resources: