"Gary L. Graf" wrote:
>
> Hi - Why does the TextureLoader constructors require a Component object
> for reference.  I am trying to use 'good' object oriented programming
> and build some class collections of shapes and what not to use in
> different programs.  I would like to define the textures as part of my
> class but very few of the Java3D classes are extended from Component.
> That means I end up having to do the TextureLoads with a reference to
> Canvas3D which may be unrelated to my object construct.


The extra component information is there for the ImageObserver
information.

_However_, it is not a required parameter, so you can pass in null if
you want to.

Because the low level code provides the option to supply an observer,
the abstracted APIs such as the texture loader leave that option for
you. That is, they are following good OO principles by not denying you
the flexibility provided by lower layers. If you are 110% sure that you
will never need an observer (do you ever want to have a GUI display that
indicates the percentage of an image loaded?) then feel free to ignore
the parameter in your toolkit and pass null to the texture loader.

--
Justin Couch                                   Author, Java Hacker
Snr Software Engineer                     [EMAIL PROTECTED]
ADI Ltd, Systems Group              http://www.vlc.com.au/~justin/
Java3D FAQ:       http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
 Turn it or move it, and a new set of arrangements appears... is it
 a single light or many lights, lights that one must know how to
 distinguish, recognise and appreciate? Is it one light with many
 frames or one frame for many lights?"      -Subcomandante Marcos
-------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to