Class TLcyModelReferenceAddOn
Furthermore, it adds a menu item to create a directory.ref file. If such a file is present in a directory, all data files in that directory that don't have a model reference will use that model reference.
The predefined references the user can choose from can be specified in the configuration file, or can be set directly using
setGeodeticReferences
and/or setGridReferences
.
The add-on also registers default ILcdModelReferenceParser
instances on the Lucy back-end.
The registered ILcdModelReferenceParser
instances will be used by e.g. the GML model decoder to parse model references.
See ILcyLucyEnv.addService(Object)
for more information.
A help ID (see ALcyHelpManager
) is registered to
allow to display context sensitive help for the panel that allows to choose
a reference: "com.luciad.lucy.addons.modelreference.TLcyModelReferenceAddOn.ModelReferenceChooser"
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the set of predefined grid references the user can choose from.boolean
Deprecated.This method has been deprecated.void
plugInto
(ILcyLucyEnv aLucyEnv) Adds aILcdModelReferenceDecoder
to the givenILcyLucyEnv
that pops up a dialog to ask the user to specify the reference.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.void
setGeodeticReferences
(ILcdGeodeticReference[] aGeodeticReferences) Sets the list of predefined geodetic references.void
setGridReferences
(ILcdGridReference[] aGridReferences) Sets the list of predefined grid references.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.showModelReferenceChooser
(Component aParentComponent) Presents a model reference chooser UI to the user in a modal dialog.showModelReferenceChooser
(Component aParentComponent, boolean aIncludeGeodeticReferences, boolean aIncludeGridReferences) Presents a model reference chooser UI to the user in a modal dialog.void
unplugFrom
(ILcyLucyEnv aLucyEnv) Removes the addedILcdModelReferenceDecoder
and menu item.Methods inherited from class com.luciad.lucy.addons.ALcyAddOn
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
-
Field Details
-
MODEL_REFERENCE_GROUP_DESCRIPTOR
-
-
Constructor Details
-
TLcyModelReferenceAddOn
public TLcyModelReferenceAddOn()
-
-
Method Details
-
setClassTraceOn
Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
plugInto
Adds aILcdModelReferenceDecoder
to the givenILcyLucyEnv
that pops up a dialog to ask the user to specify the reference. TheILcdModelReferenceDecoder
should be used a last resort, when all other attempts to find a reference have failed. -
unplugFrom
Removes the addedILcdModelReferenceDecoder
and menu item.- Specified by:
unplugFrom
in classALcyAddOn
- Parameters:
aLucyEnv
- The lucy environment that was passed in plugInto.- See Also:
-
getGeodeticReferences
-
setGeodeticReferences
Sets the list of predefined geodetic references. A geodetic reference can be modfied if it is an instance ofTLcyGeodeticReference
and its editable property is true.- Parameters:
aGeodeticReferences
- The list of geodetic references.
-
getGridReferences
Returns the set of predefined grid references the user can choose from.- Returns:
- the set of predefined grid references the user can choose from.
-
setGridReferences
Sets the list of predefined grid references. A grid reference can be modified if it is an instance ofTLcyGridReference
and its editable property is true.- Parameters:
aGridReferences
- The list of grid references.
-
showModelReferenceChooser
Presents a model reference chooser UI to the user in a modal dialog. The chosen model reference will be returned.
Calling this method is equivalent to calling
showModelReferenceChooser( aParentComponent, true, true ).
Note: this method should be called on the Event Dispatch Thread and only when this add-on is plugged in. This method only returns after the user selected a reference or cancelled the dialog.
- Parameters:
aParentComponent
- Parent component for the dialog- Returns:
- the chosen model reference, or
null
when the user cancelled. - See Also:
-
showModelReferenceChooser
public ILcdGeoReference showModelReferenceChooser(Component aParentComponent, boolean aIncludeGeodeticReferences, boolean aIncludeGridReferences) Presents a model reference chooser UI to the user in a modal dialog. The chosen model reference will be returned.
Calling this method is equivalent to calling
showModelReferenceChooser( aParentComponent, true, true ).
Note: this method should be called on the Event Dispatch Thread and only when this add-on is plugged in. This method only returns after the user selected a reference or cancelled the dialog.
- Parameters:
aParentComponent
- Parent component for the dialogaIncludeGeodeticReferences
- whentrue
, geodetic references will be included in the chooser. Whenfalse
, geodetic references will not be shown. Note that eitheraIncludeGeodeticReferences
oraIncludeGridReferences
must betrue
aIncludeGridReferences
- whentrue
, grid references will be included in the chooser. Whenfalse
, grid references will not be shown. Note that eitheraIncludeGeodeticReferences
oraIncludeGridReferences
must betrue
- Returns:
- the chosen model reference, or
null
when the user cancelled.
-