Is it possible to extend graphics objects' functionality through inheritance?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
per isakson
2011년 5월 26일
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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!