public class EditToolFactory {
public static ICommand createCommand(ShapeEditor editor, IEditTool tool) {
// none selected
if (tool instanceof ModifyBoundsTool) {
return new ModifyBoundsCommand(editor);
} else if (tool instanceof ModifyVerticesTool) {
return new ModifyVerticesCommand(editor);
} else if (tool instanceof CreateLineTool) {
return new CreateLineCommand(editor);
} else if (tool instanceof CreatePolyLineTool) {