Personnaliser l’affichage des objets pour les classes
Personnaliser la manière dont MATLAB® affiche les objets de votre classe dans la fenêtre de commande
La classe CustomDisplay
définit une interface qui vous permet de personnaliser la manière dont MATLAB affiche les objets. Pour une présentation de l’interface, consultez Custom Display Interface. Par ailleurs, la classe CustomCompactDisplayProvider
vous permet de personnaliser l’affichage des objets dans les conteneurs tels que les structs et les tables. Pour une présentation de l’interface, consultez Custom Compact Display Interface.
Fonctions
details | Display array details |
Classes
matlab.mixin.CustomDisplay | Interface for customizing object display |
matlab.mixin.util.PropertyGroup | Custom property list for object display |
matlab.mixin.CustomCompactDisplayProvider | Interface for customizing object display within containers (depuis R2021b) |
matlab.display.CompactDisplayRepresentation | Base class for representing compact display of object array (depuis R2021b) |
matlab.display.DisplayConfiguration | Describe display environment and settings (depuis R2021b) |
matlab.display.DimensionsAndClassNameRepresentation | Compact display representation using dimensions and class name (depuis R2021b) |
matlab.display.PlainTextRepresentation | Compact display representation using data in object array (depuis R2021b) |
Rubriques
Personnaliser la classe et les méthodes de l’interface d’affichage
- Custom Display Interface
TheCustomDisplay
class provides an API for customizing the display of objects of your class. - How CustomDisplay Works
MATLAB determines the state of an object and then calls specific methods for that state to display the object. - Class with Default Object Display
This example class customizes various aspects of object display. - Role of size Function in Custom Displays
MATLAB uses the size function to help determine the state of the object to display.
Techniques spécifiques pour personnaliser l’affichage des objets
- Choose a Technique for Display Customization
You can customize object display based on the state of the object and you can change different parts of the display. - Customize Property Display
Change the order and number of properties displayed for an object of your class. - Customize Header, Property List, and Footer
Customize each of the three parts of the display — header, property groups, and footer. - Customize Display of Scalar Objects
Customize the display of scalar objects. - Customize Display of Object Arrays
Customize the display of nonscalar objects, including empty object arrays. - Customize Display for Heterogeneous Arrays
You can call only sealed methods on nonscalar heterogeneous arrays. - Overloading the disp Function
Overloading thedisp
function provides limited display customization.
Personnaliser les affichages compacts
- Custom Compact Display Interface
Customize the representation of objects in compact display scenarios.