public class TLcdUTMGridLayer extends Object implements ILcdGXYLayer, ILcdNotLabelDeconflictableLayer
TLcdUTMGridLayer
is an ILcdGXYLayer
that can be
added in an ILcdGXYView
to display a UTM MGRS grid.
This grid consists of 60 UTM-MGRS zones.
To paint the different UTM-MGRS zones a dedicated ILcdGXYPainter
,
TLcdUTMZonePainter
, is used.
It is recommended to use TLcdMGRSGridLayer
instead: it combines
a UPS and UTM grid with better performance and more fine-grained customization options.
TLcdUTMZone
,
TLcdUTMZonePainter
,
Serialized FormConstructor and Description |
---|
TLcdUTMGridLayer()
Constructs a layer depicting a WGS-84 UTM grid, with "UTMGrid" as label.
|
TLcdUTMGridLayer(String aLabel)
Constructs a layer depicting a WGS-84 UTM grid, with the given label.
|
TLcdUTMGridLayer(String aLabel,
ILcdGeodeticDatum aGeodeticDatum)
Constructs a layer depicting a UTM grid based on the given geodetic datum, with the given label.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Notify the listener passed of any changes to properties of this instance.
|
void |
addSelectionListener(ILcdSelectionListener aSelectionListener)
This layer does not support selection.
|
int |
applyOnInteract(ILcdFunction aFunction,
Rectangle aBounds,
boolean aStrictInteract,
ILcdGXYView aGXYView)
No interaction is possible with this type of layer.
|
void |
clearSelection(int aDispatchEventMode)
This layer does not support selection.
|
void |
fireCollectedSelectionChanges()
This layer does not support selection.
|
void |
firePropertyChangeEvent(PropertyChangeEvent aPropertyChangeEvent)
Notifies all property change listeners of a change to a property of this instance.
|
ILcdBounds |
getBounds(int aMode,
ILcdGXYView aGXYView)
This method returns the view bounds of this
TLcdUTMGridLayer , taking
into account the XYWorldReference of the given ILcdGXYView aGXYView. |
ILcdGXYEditor |
getGXYEditor(Object aObject)
This layer does not support editing.
|
ILcdGXYLabelPainter |
getGXYLabelPainter(Object aObject)
Labeling is handled in the UTM zone painter used to paint the zones.
|
ILcdGXYPainter |
getGXYPainter(Object aObject)
Painting of this layer is handled by the UTM zone painter set.
|
ILcdGXYPen |
getGXYPen()
Returns the pen used to render the grid lines.
|
ILcdIcon |
getIcon()
Returns the icon to represent this layer.
|
String |
getLabel()
Returns the textual representation of this layer.
|
ILcdInterval |
getLabelScaleRange()
The label scale range is the same as the scale range.
|
ILcdModel |
getModel()
The model of this layer does not contain any elements.
|
Class |
getModelXYWorldTransfoClass()
Returns the transformation class that to use to transform points and bounds from model space to world space and
back.
|
ILcdInterval |
getScaleRange()
Returns the toolkit scale range for which to display elements of the model.
|
int |
getSelectionCount()
This layer does not support selection.
|
TLcdUTMZonePainter |
getUTMZonePainter()
Returns the painter used to render a zone of a UTM grid.
|
boolean |
hasUserPen()
Deprecated.
This method is used nowhere in this class and may be removed in the future.
|
boolean |
isEditable()
This layer does not support editing.
|
boolean |
isEditableSupported()
This layer does not support editing.
|
boolean |
isLabeled()
Returns whether the grids labels will be painted when the grid is painted.
|
boolean |
isLabeledSupported()
This layer supports labels.
|
boolean |
isSelectable()
This layer does not support selection.
|
boolean |
isSelectableSupported()
This layer does not support selection.
|
boolean |
isSelected(Object aObject)
This layer does not support selection.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
boolean |
isVisible()
Whether or not this layer should be rendered.
|
void |
paint(Graphics aGraphics,
int aMode,
ILcdGXYView aGXYView)
The paint will rely on the UTMZonePainter to paint each of the UTM-MGRS zones,
held by this
TLcdUTMGridLayer . |
String |
painterMode(int aPainterMode)
Deprecated.
this is a debug method that will be removed in the future. Do not use this method.
|
void |
removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
No longer notify the listener passed of any changes to properties of this instance.
|
void |
removeSelectionListener(ILcdSelectionListener aSelectionListener)
This layer does not support selection.
|
Enumeration |
selectedObjects()
This layer does not support selection.
|
void |
selectObject(Object aObject,
boolean aSelection,
int aDispatchEventMode)
This layer does not support selection.
|
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setEditable(boolean aEditable)
This layer does not support editing.
|
void |
setIcon(ILcdIcon aIcon)
Sets the icon to represent this layer.
|
void |
setLabel(String aLabel)
Sets the textual representation of this layer.
|
void |
setLabeled(boolean aLabeled)
Sets whether labels should be painted for the grid or not.
|
void |
setScaleRange(ILcdInterval aScaleRange)
Sets the range of scales outside of which nothing of this layer should be rendered.
|
void |
setSelectable(boolean aSelectable)
This layer does not support selection.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setUTMZonePainter(TLcdUTMZonePainter aUTMZonePainter)
Sets the painter that will be used to render a zone of a UTM grid.
|
void |
setVisible(boolean aVisible)
Sets whether or not the layer's content is painted.
|
void |
stopPainting()
Inform the layer that it should terminate the current paint operation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLabelMapScaleRange, getMapScaleRange
getSelectedObjects
public TLcdUTMGridLayer()
public TLcdUTMGridLayer(String aLabel)
aLabel
- the textual representation of this layer.public TLcdUTMGridLayer(String aLabel, ILcdGeodeticDatum aGeodeticDatum)
aLabel
- the textual representation of this layer.aGeodeticDatum
- the datum on which the UTM grid is located.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.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.public boolean isTraceOn()
true
if tracing is enabled for this class.public ILcdGXYPainter getGXYPainter(Object aObject)
getGXYPainter
in interface ILcdGXYLayer
aObject
- the object to find a painter for.setUTMZonePainter(com.luciad.view.map.painter.TLcdUTMZonePainter)
,
getUTMZonePainter()
public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject)
getGXYLabelPainter
in interface ILcdGXYLayer
aObject
- the object to find a label painter for.public ILcdGXYEditor getGXYEditor(Object aObject)
getGXYEditor
in interface ILcdGXYLayer
aObject
- the object to find an editor for.public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView)
applyOnInteract
in interface ILcdGXYLayer
aFunction
- the function to apply. When the function returns false, no more objects should be passed to
the function.aBounds
- all objects who lie partially or completely in this area in the view are candidates to be passed to
the function.aStrictInteract
- if true
, the ILcdFunction
shall be applied only to the objects
interacting with the given bounds. When false is passed, other objects may be taken into account too.
When applying the function to an object consumes less time than checking whether an objects representation
interacts with the bounds, non-strict interaction is generally faster.aGXYView
- the view in whose bounds the objects representations should be in order to be passed to the
function.public ILcdIcon getIcon()
getIcon
in interface ILcdLayer
setIcon(com.luciad.gui.ILcdIcon)
public void setIcon(ILcdIcon aIcon)
public ILcdGXYPen getGXYPen()
getGXYPen
in interface ILcdGXYLayer
public boolean hasUserPen()
false
public void setUTMZonePainter(TLcdUTMZonePainter aUTMZonePainter)
aUTMZonePainter
- the painter to use to render one zone of a UTM grid. The painter contains
defines, amongst others, the color of the grid.getUTMZonePainter()
public TLcdUTMZonePainter getUTMZonePainter()
TLcdUTMZonePainter
.public void setScaleRange(ILcdInterval aScaleRange)
aScaleRange
- the range of scales outside of which nothing of this layer should be rendered.setVisible(boolean)
public ILcdInterval getScaleRange()
ILcdGXYLayer
view.getScale()
< getScaleRange().getMin()
or
view.getScale()
>= getScaleRange().getMax()
.
This does not imply that all objects in the model should be painted when the scale is inside this range as
other restrictions may apply. For example, a layer may have a filter which defines which objects should be painted.
For most use cases, we recommended using the unitless map scale range
instead.
This property is mutually exclusive with the map scale range:
only one of them has a non-null
value.getScaleRange
in interface ILcdGXYLayer
ILcdInterval
containing the minimum and maximum value of view scales for which objects
should be rendered, excluding the maximum. null
if the scale constraints are determined by ILcdGXYLayer.getMapScaleRange()
.
The scales are expressed in toolkit pixels/world unit.setScaleRange(com.luciad.util.ILcdInterval)
public ILcdInterval getLabelScaleRange()
getLabelScaleRange
in interface ILcdGXYLayer
ILcdInterval
containing the minimum and maximum value of view scales for which
labels should be rendered, excluding the maximum.
null
if the scale constraints are determined by ILcdGXYLayer.getLabelMapScaleRange()
The scales are expressed in toolkit pixels/world unit.setScaleRange(com.luciad.util.ILcdInterval)
public ILcdBounds getBounds(int aMode, ILcdGXYView aGXYView)
TLcdUTMGridLayer
, taking
into account the XYWorldReference of the given ILcdGXYView
aGXYView.getBounds
in interface ILcdGXYLayer
aMode
- a bitwise combination of ALL or SELECTION and one or more of BODIES and HANDLES.
The ILcdGXYLayer.LABELS
mode is not supported.aGXYView
- the view in which the layer could be placed. This enables taking into account the views settings,
for example the scale.public void paint(Graphics aGraphics, int aMode, ILcdGXYView aGXYView)
TLcdUTMGridLayer
.paint
in interface ILcdGXYLayer
aGraphics
- the Graphics to paint on.aMode
- indicates what should be painted and how it should be painted.aGXYView
- the view to paint for.ILcdGXYLayer.getGXYPainter(Object)
,
ILcdGXYLayer.getGXYLabelPainter(Object)
,
ILcdGXYLayer.getScaleRange()
,
ILcdGXYLayer.getLabelScaleRange()
,
ILcdGXYLayer.stopPainting()
public String painterMode(int aPainterMode)
aPainterMode
- a mode passed to the paint method.public void stopPainting()
ILcdGXYLayer
Thread
and needs to be
stopped in a safe state from another Thread.stopPainting
in interface ILcdGXYLayer
paint
public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
addPropertyChangeListener
in interface ILcdPropertyChangeSource
aPropertyChangeListener
- the listener to notify of any changes to properties of this UTM grid layer.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
removePropertyChangeListener
in interface ILcdPropertyChangeSource
aPropertyChangeListener
- the listener that should no longer be notified of any changes to properties of
this UTM grid layer.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void firePropertyChangeEvent(PropertyChangeEvent aPropertyChangeEvent)
aPropertyChangeEvent
- contains information on the change of the propertyaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
removePropertyChangeListener(java.beans.PropertyChangeListener)
public ILcdModel getModel()
public void setVisible(boolean aVisible)
ILcdLayer
setVisible
in interface ILcdLayer
aVisible
- true
if the layer should be visible, false
otherwise.ILcdLayer.isVisible()
public boolean isVisible()
isVisible
in interface ILcdLayer
ILcdLayer.setVisible(boolean)
public boolean isEditableSupported()
isEditableSupported
in interface ILcdLayer
ILcdLayer.setEditable(boolean)
public boolean isEditable()
isEditable
in interface ILcdLayer
ILcdLayer.setEditable(boolean)
public void setEditable(boolean aEditable)
setEditable
in interface ILcdLayer
aEditable
- true if the layer content can be editedILcdLayer.isEditableSupported()
,
ILcdLayer.isEditable()
public boolean isSelectableSupported()
isSelectableSupported
in interface ILcdLayer
ILcdLayer.setSelectable(boolean)
,
ILcdLayer.selectObject(java.lang.Object, boolean, int)
public boolean isSelectable()
isSelectable
in interface ILcdLayer
ILcdSelection
,
ILcdLayer.setSelectable(boolean)
public void setSelectable(boolean aSelectable)
setSelectable
in interface ILcdLayer
aSelectable
- true
if the layer allows selection, false
otherwise.ILcdLayer.isSelectable()
,
ILcdLayer.isSelectableSupported()
public boolean isLabeledSupported()
isLabeledSupported
in interface ILcdGXYLayer
public boolean isLabeled()
isLabeled
in interface ILcdGXYLayer
setUTMZonePainter(com.luciad.view.map.painter.TLcdUTMZonePainter)
public void setLabeled(boolean aLabeled)
setLabeled
in interface ILcdGXYLayer
aLabeled
- true to have a textual representation of the objects in the model, false to have no such
representation.isLabeled()
public String getLabel()
getLabel
in interface ILcdLayer
setLabel(String)
public void setLabel(String aLabel)
setLabel
in interface ILcdLayer
aLabel
- the the textual representation to use for this ILcdLayer
.getLabel()
public int getSelectionCount()
getSelectionCount
in interface ILcdSelection<Object>
public Enumeration selectedObjects()
selectedObjects
in interface ILcdSelection<Object>
TLcdEmptyEnumeration.getInstance
().public boolean isSelected(Object aObject)
isSelected
in interface ILcdSelection<Object>
aObject
- the Object
to be checked.false
.public void selectObject(Object aObject, boolean aSelection, int aDispatchEventMode)
selectObject
in interface ILcdLayer
aObject
- the Object
to select or deselect. The object should be in the model
of this layer. The implementation of this method is not responsible for checking this.aSelection
- the selection state, true
to select, false
to deselect.aDispatchEventMode
- shall be one among ILcdFireEventMode.FIRE_NOW
,
ILcdFireEventMode.FIRE_LATER
, ILcdFireEventMode.NO_EVENT
ILcdFireEventMode
public void fireCollectedSelectionChanges()
fireCollectedSelectionChanges
in interface ILcdLayer
public void clearSelection(int aDispatchEventMode)
clearSelection
in interface ILcdLayer
aDispatchEventMode
- shall be one among ILcdFireEventMode.FIRE_NOW
,
ILcdFireEventMode.FIRE_LATER
, ILcdFireEventMode.NO_EVENT
ILcdFireEventMode
public void addSelectionListener(ILcdSelectionListener aSelectionListener)
addSelectionListener
in interface ILcdSelection<Object>
aSelectionListener
- the ILcdSelectionListener
to be added.public void removeSelectionListener(ILcdSelectionListener aSelectionListener)
removeSelectionListener
in interface ILcdSelection<Object>
aSelectionListener
- the ILcdSelectionListener
to be removed.public Class getModelXYWorldTransfoClass()
ILcdGXYLayer
getModelXYWorldTransfoClass
in interface ILcdGXYLayer