|Inherit from PolygonImpl [message #990575]
||Thu, 13 December 2012 09:25
| Karol Desnos
Registered: October 2012
I'm currently designing a GUI based on Graphiti that will use triangular shapes for different purposes.
The problem I have with polygons is that they do not provide a "simple" way to resize them. By simple, I mean that using the GaService.setSize() has no apparent effect on Polygons.
I saw a few topics on this issue on this forum, where the advised solution is usually to create a specific "ResizeFeature" to change the size of the Polygon. However, since I'm planning to use triangles in many places, I fear that this will result in creating specific ResizeFeature for each triangle use. Moreover, I think is would be more natural to resize my triangles using the same methods as the one used to resize a Rectangle or an Ellipse.
Consequently, I created a Triangle class that inherits from the "PolygonImpl" class, and that implements the setWidth and setHeight methods.
The code of this class is attached to this post.
My class seems to work correctly, despite the following warning:
Discouraged access: The type PolygonImpl is not accessible due to restriction on required library.
What is the reason for discouraging the inheritance to PolygonImpl while authorizing the custom implementation of the Polygon interface?
What do you think would be the best solution for this issue?
Powered by FUDForum
. Page generated in 0.02567 seconds