Hi Ted,
I think others have shown how you can easily achieve the effect you want
by using different SampleModels and DataBuffers with offsets defined and
that is the best way to do this, but I wanted to address a philosophical
issue that you raised in the way that you used subclassing here.
> To display other 2D slices of the 3D data, I was planning to override
> methods of PixelInterleavedSampleModel. So in my class,
> MyPixelInterleavedSampleModel, I have overridden several methods of
> PixelInterleavedSampleModel, ComponentSampleModel, and SampleModel itself.
In general I think that this statement boils down to "I was planning
on overriding some of the methods on PixelInterleavedSampleModel (PISM)
to do something other than what the class is documented and intended
to do". In other words, "I was overriding some of PISM's methods to
break the contract it has defined with the agents who use it".
We recognize this particular class and we take it as a contract that
you want a particular type of formula used to convert from an X,Y
coordinate pair to an index into the data array. As a subclass, you
should be focussed on implementing a special case of the more general
operation that PISM implements, but instead you have implemented a
more general formula than your superclass (a formula that has a concept
of "slices" that its parent cannot describe or account for). The proper
place in the hierarchy for your new class so that you don't violate
the contract of PISM would be a superclass of PISM...
...jim
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".