I am working with the JavaFX Shape subclasses, and I have run into what I believe is a rather strange issue. My goal is to extend several of these shape subclasses (i.e. Rectangle, Circle) in order to add my own attributes to these objects. For example, the extension of the Rectangle subclass would look like this:
However, when I try to create service classes that reference these subclasses of Rectangle and Circle, it seems as though I cannot do so generically. Essentially, the problem arises when I need to utilize attributes and methods from both the Shape subclasses and the SpecialInterface interface:
The issue here is that I cannot create a superclass for my extended shapes that would replace <Undefined> above. Specifically, if I create a superclass, I cannot extend the specific shapes that I want to extend in my subclasses due to a lack of multiple inheritance. If I replace <Undefined> with Shape, though, I then lose access to the methods in SpecialInterface.
I'm sure that this sort of multiple-inheritance problem has been solved before, but I cannot find the solution. I appreciate any and all suggestions on how to handle this situation.