Affine
class made as extending Transform
class in JavaFX
.
This makes an illusion, that there can be some types of transforms, other than affine.
UPDATE
In JavaFX 2.x
Transform
class contains only getters for specific matrix elements, which includes 12 elements of 3x4 matrix for 3D affine transform. Any class usage can rely only on these elements, so any represented transformation is affine.
This means that 2.x version has bad design, because basic class can represent only affine transforms, while Affine
is made it's subclass. This is wrong, since Affine
should be made basic class.
In JavaFX 8
Transform
class has better design. Additionally to getters, it has indexed access to matrix elements and determination of matrix type. Also it has transform()
methods, which do actual transformation.
This means, that usage can rely both on transform()
methods, or on matrix element getters.
If it can be guaranteed, that all internal parts of JavaFX
rely on transform()
methods, then this class can be extended and perspective transformation can be implemented. May be it even can be implemented in release version of JavaFX8
.
The question is: can it be guaranteed, that JavaFX
relies only on transform()
methods?