Skip to main content

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

On 01/04/2010, at 10:24 PM, Stephen wrote:

> Hi List,
> This is Stephen here and have been studying the printing plug-in source for sometime.

Any suggestions you have are welcome; thanks for starting discussion on the email list.

> 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.

I suspect the developer started implementing IAdaptable and did not finish; you can throw a patch our way if you like.

> 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.

Gak that sounds confusing.
> 
> 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  ???

Let us think.... I would prefer  to add IAdaptable to the Box hierarchy that seems the most consistent.

Jody




Back to the top