public static String getIdentifier(GUIComponent c)
{
- return identifierPerComponent.get(c);
+ if (identifierPerComponent.containsKey(c))
+ return identifierPerComponent.get(c);
+ return "class:" + c.getClass().getCanonicalName();
}
public void duplicate()
case OFF:
break;
case ABSOLUTE:
- newP.x -= newP.x % snapX;
- newP.y -= newP.y % snapY;
+ newP.x = (int) (newP.x / snapX + .5) * snapX;
+ newP.y = (int) (newP.y / snapY + .5) * snapY;
break;
default:
break;