autolayout for "hand"

I have just written an autolayout function for the “hand”:
Plz notice the button autolyout

i dont have a branch yet, because I developed on trunk and have just asked for branch write permissions.

This started from a copy of, which does something similar - rearrange cards

Heres my question:

I have this prototyping code which i need to get rid of:

[code] for (GamePiece p : pieces) {

		String type = null;
		// TODO get type in a generic way from gamepiece
		if (p.getType().contains("Strategy Card")) {
			type = "strategy card";
		} else if (p.getType().contains("Battle Card")) {
			type = "battle card";
		} else {
			// ignore other types

How can I get the prototype name in a generic way?
Btw. the GamePiece class type is: “SetGlobalProperty”

Just for the hannibal game, which is not from me, a proto is called “Strategy Card”, and another one “Battle Card”