editor refactored to implement painter interface