Class to handle tree drawing with collapse and expand properties.