Is it possible to extend graphics objects' functionality through inheritance?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I extended the functionality of a line object using a class which takes a line handle as an input argument to its constructor. This class then creates a WindowMouseMotion listener to detect a mouseover the line which highlights the line and displays a panel containing controls for setting some line/data properties. This is working well.
I am now trying to make this class detect and respond to the line being deleted by listening for the line's ObjectBeingDestroyed event. My question is whether linking this class to the line object by storing the line's handle is the best solution or is it possible to extend the line class by inheriting from it? I have looked through the MATLAB documentation and searched online but can't find definitive information on inheriting from graphics classes.
This question was also asked at StackOverflow: http://stackoverflow.com/questions/6035029/is-it-possible-to-extend-graphics-objects-functionality-through-inheritance
0 commentaires
Réponses (1)
per isakson
le 26 Mai 2011
There is no documented way to inherit from (/subclass) handle graphic objects. I guess the rule is that if you cannot find it in the documentation it is not supported.
AFAIK, the solution you tried is the documented way to do it.
- per
0 commentaires
Voir également
Catégories
En savoir plus sur Graphics Objects dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!