implementation of isOfType for components and shapes