Your question is confused.
Start by reading the Graphics View Framework - it will explain the general way things work.

Then, if your have specific questions about that, it will be easier to give you an answer.