classdef MyClass < nelson.mixin.CustomDisplay
| Parameter | Description |
|---|---|
| obj | an object of a class deriving from nelson.mixin.CustomDisplay. |
| Parameter | Description |
|---|---|
| txt | custom display text produced by the derived class methods. |
Derive from nelson.mixin.CustomDisplay to customize how instances of a class are displayed. A subclass may override any of these protected methods and let the default composition render the rest:
getHeader(obj) - the header text (a char vector or a string scalar). Default: the class name followed by with properties:.
getFooter(obj) - the footer text (char or string). Default: empty.
getPropertyGroups(obj) - an array of nelson.mixin.util.PropertyGroup objects describing which properties are shown and how they are grouped. Default: one group with all public properties.
displayScalarObject(obj), displayNonScalarObject(obj) and displayEmptyObject(obj) - take full control of the display of a scalar object, an object array, or an empty object array respectively.
When none of the display methods is overridden, the object is shown as getHeader, then the property groups, then getFooter.
classdef Point < nelson.mixin.CustomDisplay
properties
X = 0
Y = 0
end
methods (Access = protected)
function h = getHeader(obj)
h = "A 2-D point:";
end
function f = getFooter(obj)
f = '(cartesian)';
end
end
end
| Version | Description |
|---|---|
| 2.0.0 | initial version |