MATLAB Object-Oriented Programming

(Joyce) #1

Customize Display of Scalar Objects


In this section...
“Objective” on page 18-32
“Design Of Custom Display” on page 18-32
“displayScalarObject Method Override” on page 18-33
“getPropertyGroups Override” on page 18-34

Objective


Customize the display of scalar objects.

Design Of Custom Display


NoteThis example uses the EmployeeInfo class described in the “Class with Default
Object Display” on page 18-14 section.

The objective of this customized display is to:


  • Modify the header to include the department name obtained from the Department
    property

  • Group properties into two categories titled Public Info and Personal Info.

  • Modify which properties are displayed

  • Modify the values displayed for Personal Info category

  • Use the default displayed for nonscalar objects, including empty arrays, and scalar
    deleted handles


For example, here is the customized display of an object of the EmployeeInfo class.

Emp123 =

EmployeeInfo Dept: Product Development

Public Info
Name: 'Bill Tork'
JobTitle: 'Software Engineer'

18 Customizing Object Display

Free download pdf