|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.image.io.mosaic.MosaicController
public class MosaicController
The default controller for mosaic parameters.
Controllers are implemented by objects that can determine the settings of IIOParam
objects, either by putting up a GUI to obtain values from a user, or by other means. Whether
the controller puts up a GUI or merely computes a set of values is irrelevant to this class.
Two kinds of IIOParam
can be setup by MosaicController
:
MosaicImageReadParam
or MosaicImageWriteParam
) are setup
by activate(javax.imageio.IIOParam)
.ImageReadParam
or
ImageWriteParam
of arbitrary class) are setup by activateForTile(javax.imageio.IIOParam)
.
The activate
methods are executed only when explicitly invoked, typically through a
call to IIOParam.activateController()
. They are not invoked automatically
by mosaic image reader or writer.
This is different than configure(org.geotools.image.io.mosaic.Tile, javax.imageio.IIOParam)
, which is always invoked automatically by the
above.
Users can create a subclass of MosaicController
and pass it to
IIOParam.setController(javax.imageio.IIOParamController)
in order to control the configuration of a mosaic to be read or
written.
Constructor Summary | |
---|---|
protected |
MosaicController()
Creates a default mosaic controller. |
Method Summary | |
---|---|
boolean |
activate(javax.imageio.IIOParam parameters)
Activates the mosaic controller. |
protected boolean |
activateForTile(javax.imageio.IIOParam parameters)
Invoked by activate for every
tile read parameters or
tile write parameters. |
protected void |
configure(Tile tile,
javax.imageio.IIOParam parameters)
Automatically invoked by MosaicImageReader or MosaicImageWriter when a tile
is about to be read or written. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected MosaicController()
MosaicImageReadParam.getDefaultController()
.
Method Detail |
---|
public boolean activate(javax.imageio.IIOParam parameters)
IIOParam.activateController()
is invoked explicitly.
When reading, the default implementation creates parameters for tile readers if not already done, then delegates the activation to
their controllers. It returns true
only if activation succeed for every tile readers.
When writting, the default implementation creates parameters for tile writers if not already done, then delegates the activation to
their controllers. It returns true
only if activation succeed for every tile writers.
activate
in interface javax.imageio.IIOParamController
parameters
- The parameters to be modified. It should be an instance of
MosaicImageReadParam
or MosaicImageWriteParam
,
but this is not mandatory.
true
if the parameters are ready for use, or
false
if the user canceled the operation.protected boolean activateForTile(javax.imageio.IIOParam parameters)
activate
for every
tile read parameters or
tile write parameters.
Note that this method is not necessarly invoked for every tiles, but only for every readers
or writers to be used with tiles. For example this method is invoked only once if every
tiles are to be read with the same image reader.
The default implementation delegates to IIOParam.activateController()
.
Subclasses can override this method is more control is wanted.
parameters
- The parameters to be used for reading tiles. This is not the same
than the parameters given to activate(javax.imageio.IIOParam)
, and is usually unrelated to mosaic
parameters.
true
if the parameters are ready for use, or
false
if the user canceled the operation.protected void configure(Tile tile, javax.imageio.IIOParam parameters)
MosaicImageReader
or MosaicImageWriter
when a tile
is about to be read or written. The parameters setting are determined by reader or writer
before to invoke this method and usually don't need to be changed. This method is provided
as a hook allowing subclasses to performs additional setting.
The default implementation does nothing.
tile
- The tile which is about to be read or written.parameters
- The parameter to be given to the image reader or writer.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |