public class TLcyModelReferenceAddOn extends ALcyAddOn
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"
Modifier and Type | Field and Description |
---|---|
static TLcyGroupDescriptor |
MODEL_REFERENCE_GROUP_DESCRIPTOR |
Constructor and Description |
---|
TLcyModelReferenceAddOn() |
Modifier and Type | Method and Description |
---|---|
ILcdGeodeticReference[] |
getGeodeticReferences() |
ILcdGridReference[] |
getGridReferences()
Returns the set of predefined grid references the user can choose from.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
plugInto(ILcyLucyEnv aLucyEnv)
Adds a
ILcdModelReferenceDecoder to the given
ILcyLucyEnv that pops up a dialog to ask the user to specify
the reference. |
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
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. It is recommended to use the
standard Java logging framework directly.
|
ILcdGeoReference |
showModelReferenceChooser(Component aParentComponent)
Presents a model reference chooser UI to the user in a modal dialog.
|
ILcdGeoReference |
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 added
ILcdModelReferenceDecoder and menu item. |
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
public static final TLcyGroupDescriptor MODEL_REFERENCE_GROUP_DESCRIPTOR
@Deprecated public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.@Deprecated public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.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.@Deprecated public boolean isTraceOn()
true
if tracing is enabled for this class.public void plugInto(ILcyLucyEnv aLucyEnv)
ILcdModelReferenceDecoder
to the given
ILcyLucyEnv
that pops up a dialog to ask the user to specify
the reference. The ILcdModelReferenceDecoder
should be used a
last resort, when all other attempts to find a reference have failed.Furthermore it adds a menu item that allows to create a .ref file on demand. If the file is named directory.ref, all data files in that directory will use that reference.
plugInto
in class ALcyAddOn
aLucyEnv
- The lucy environment to plug into.ALcyAddOn.unplugFrom(com.luciad.lucy.ILcyLucyEnv)
public void unplugFrom(ILcyLucyEnv aLucyEnv)
ILcdModelReferenceDecoder
and menu item.unplugFrom
in class ALcyAddOn
aLucyEnv
- The lucy environment that was passed in plugInto.ALcyAddOn.plugInto(com.luciad.lucy.ILcyLucyEnv)
public ILcdGeodeticReference[] getGeodeticReferences()
public void setGeodeticReferences(ILcdGeodeticReference[] aGeodeticReferences)
TLcyGeodeticReference
and its editable property
is true.The geodetic references should be set before the addon is plugged.
aGeodeticReferences
- The list of geodetic references.public ILcdGridReference[] getGridReferences()
public void setGridReferences(ILcdGridReference[] aGridReferences)
TLcyGridReference
and its editable property
is true. The grid references should be set before the addon is plugged.
aGridReferences
- The list of grid references.public ILcdGeoReference showModelReferenceChooser(Component aParentComponent)
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.
aParentComponent
- Parent component for the dialognull
when the user cancelled.showModelReferenceChooser(java.awt.Component, boolean, boolean)
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.
aParentComponent
- Parent component for the dialogaIncludeGeodeticReferences
- when true
, geodetic references will be included in the chooser.
When false
, geodetic references will not be shown.
Note that either aIncludeGeodeticReferences
or aIncludeGridReferences
must be true
aIncludeGridReferences
- when true
, grid references will be included in the chooser.
When false
, grid references will not be shown.
Note that either aIncludeGeodeticReferences
or aIncludeGridReferences
must be true
null
when the user cancelled.