Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Query regarding the Box interface in the net.refractions.udig.printing.model project

Hi List,
This is Stephen here and have been studying the printing plug-in source for sometime.
While going through the source code of Box and BoxImpl in the 'net.refractions.udig.printing.model' project, I noticed that the BoxImpl class provides an implementation for the 'getAdapter()' method, even though the IAdaptable interface is  nowhere present in its nor in the heirarchy of the Box interface.

Also the BoxPart (package: net.refractions.udig.printing.ui.internal.editor.parts) class in its implementation of getAdapter() checks if the Box object it references is an instance of type 'IAdaptable', (before it forwards the request to getAdaptable() of the Box object) but as this interface does not exist in the type hierarchy of the Box interface and the BoxImpl class, the check is always going to fail, so the request is never forwarded to the 'BoxPrinter' object as it seems to be the intent.

So what I would like to know is, if I want the getAdapter() request to be forwarded from the BoxElement to my Custom BoxPrinter objects, what exactly should I do, add IAdaptable to type heirarchy of Box or directly to BoxImpl or just remove the 'instanceof' IAdaptable check in the getAdapter() method of BoxPart  ???

Thanks in Advance

-----------------------------
Stephen D'Souza


Back to the top