I'm looking to supply my own implementation of CanvasElement class. This class is instantiated in HTMLGraphicsCanvas class in the PlayN stack.
What is the ideal way of doing this? There are 2 ways that I've tried but failed:
A) Subclassing HTMLGraphics and HTMLPlatform? --this doesn't seem to be possible.
B) The GWT module mechanism seems to require that my custom implementation of a GWT-supplied class be of the same package. So take for example this XML snippet:
<replace-with class="com.google.gwt.dom.client.DOMImplOpera">
<when-type-is class="com.google.gwt.dom.client.DOMImpl"/>
<when-property-is name="user.agent" value="opera"/>
</replace-with>
If I do something like:
<replace-with class="com.domain.example.CustomCanvasElement">
<when-type-is class="com.google.gwt.dom.client.CanvasElement"/>
<when-property-is name="user.agent" value="opera"/>
</replace-with>
...it does not seem to work because the packages are different. At least that's what I think is happening.
Any other ideas? Much appreciated.