}
public void updateScene(int xpos, int ypos)
{
Primitive pickedShape = null;
pickCanvas.setShapeLocation(xpos,ypos);
PickResult pResult = pickCanvas.pickClosest();
if (pResult != null)
{
pickedShape = (Primitive) pResult.getNode(PickResult.PRIMITIVE);
}
if (pickedShape != null)
{
if (pickedShape.getUserData()=="box")
{
//The cube has been picked. The starting time of its rotation
//must be set to now.
alphas[0].setStartTime(System.currentTimeMillis()-alphas[0].getTriggerTime());
}
else
{
if (pickedShape.getUserData()=="sphere")
{
//The cube has been picked. The correct transformation
//(shrinking or growing) should be chosen. The starting time of
//the corresponding transformation must be set to now.
if (shrink)