Class TLcyFormatTool
- All Implemented Interfaces:
ILcdPropertyChangeSource
Support class to plug the format-related objects created by an ALcyFormat
(e.g.
ILcdGXYLayerFactory
) into the ILcyLucyEnv
. Call the plugInto(ILcyLucyEnv)
method to plug all the format-related objects of the
given ALcyFormat
into the Lucy back-end.
Using this TLcyFormatTool
to plug in an ALcyFormat
will register
most objects as service to the Lucy back-end. As a consequence, everything that is plugged in
using this TLcyFormatTool
should be unplugged using a TLcyFormatTool
as well.
- See Also:
-
Constructor Summary
ConstructorDescriptionTLcyFormatTool
(ALcyFormat aFormat) Creates aTLcyFormatTool
for the givenALcyFormat
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ALcyFormat
findBaseFormat
(ALcyFormat aFormat) Utility method to, in a chain of wrapped formats, find the deepest format.static <T extends ALcyFormat>
TfindFormat
(ALcyFormat aFormat, Class<T> aFormatClass) Utility method to find anALcyFormat
(orALcyFormatWrapper
) of the given class.Returns theALcyFormat
for which this tool was created.void
plugInto
(ILcyLucyEnv aLucyEnv) Plugs this tool.void
unplugFrom
(ILcyLucyEnv aLucyEnv) Unplugs this tool.Methods inherited from class com.luciad.lucy.util.ALcyTool
addPropertyChangeListener, addPropertyChangeListener, assertPlugged, firePropertyChange, getLongPrefix, getLongPrefixWithClassName, getLucyEnv, getShortPrefix, removePropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcyFormatTool
Creates a
TLcyFormatTool
for the givenALcyFormat
.- Parameters:
aFormat
- TheALcyFormat
whose contents needs to be plugged into the Lucy backend. Must not benull
.
-
-
Method Details
-
getFormat
Returns the
ALcyFormat
for which this tool was created.- Returns:
- The
ALcyFormat
for which this tool was created. Nevernull
.
-
plugInto
Plugs this tool. This method is usually called from
ALcyAddOn#plugInto
.Lets the format create all the format-related objects and plugs them into the given Lucy backend.
-
unplugFrom
Description copied from class:ALcyTool
Unplugs this tool. This method is usually called from
ALcyAddOn#unplugFrom
.- Overrides:
unplugFrom
in classALcyTool
- Parameters:
aLucyEnv
- The environment to unplug from, must be identical to the environment given toplugInto
.
-
findFormat
Utility method to find an
ALcyFormat
(orALcyFormatWrapper
) of the given class. This can be useful to, in a chain of wrapped formats, retrieve a format of the given class.To do so, it assumes every format wrapper extends from
ALcyFormatWrapper
.Consider for example this chain of formats:
A call toALcyFormat format = new TLcyAsynchronousFormatWrapper( new TLcySafeGuardFormatWrapper( new MyFormat() ) )
will return thefindFormat(format, TLcySafeGuardFormatWrapper.class)
TLcySafeGuardFormatWrapper
instance. A call to
will returnfindFormat(format, TLcyMutableFileFormatWrapper.class)
null
.- Parameters:
aFormat
- The format to start looking from.aFormatClass
- The class to find.- Returns:
null
if no such format was found, or an instance of (a subclass of) the givenaFormatClass
.
-
findBaseFormat
Utility method to, in a chain of wrapped formats, find the deepest format.
To do so, it assumes every format wrapper extends from
ALcyFormatWrapper
.Consider for example this chain of formats:
A call toALcyFormat format = new TLcyAsynchronousFormatWrapper( new TLcySafeGuardFormatWrapper( new MyFormat() ) )
will return thefindBaseFormat(format)
MyFormat
instance.- Parameters:
aFormat
- The format to find the base format of.- Returns:
- The base format of the given
aFormat
.
-