Bugfix the entity was selected always in spite of the selection condition when changing the type of an entity has been reverted.
1. Reselect a new entry instance only when selected.
2. Encapsulate the view.renderer.
3. Some refactoring.