Class TLcdUPSGridLayer
- All Implemented Interfaces:
ILcdPropertyChangeSource
,ILcdSelection<Object>
,ILcdGXYLayer
,ILcdNotLabelDeconflictableLayer
,ILcdLayer
,Serializable
TLcdUPSGridLayer
is an ILcdGXYLayer
that can be
added in an ILcdGXYView
to display a Universal Polar Stereographic MGRS grid.
This grid consists of two polar zones.
It is recommended to use TLcdMGRSGridLayer
instead: it combines
a UPS and UTM grid with better performance and more fine-grained customization options.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) Associate aPropertyChangeListener
to thisILcdLayer
.void
addSelectionListener
(ILcdSelectionListener aSelectionListener) This layer does not support selection.int
applyOnInteract
(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView) Applies the function to (at the least) all objects that are contained (partially or completely) in the bounds of the view.void
clearSelection
(int aDispatchEventMode) This layer does not support selection.void
This layer does not support selection.getBounds
(int aMode, ILcdGXYView aGXYView) Always throws a TLcdNoBoundsException.getColor()
Returns the outline color of the 100.000m squaresReturns theColor
to paint the scales within the 100.000m squares.Returns the outline color of the grid zonesgetGXYEditor
(Object aObject) Always returns null.getGXYLabelPainter
(Object aObject) Always returns null.getGXYPainter
(Object aObject) Always returns null.Returns the pen to use when performing basic painting operations for objects in this layers model.getIcon()
Returns null.getLabel()
A short textual representation of thisILcdLayer
.Returns theColor
for the labels.Gets theFont
for the labels.Returns the color of the halo effect.int
Returns the thickness of the halo effect for the grid labels.Always returns null.getModel()
ReturnsTLcdGrid2Grid
class.Always returns null.int
This layer does not support selection.boolean
This layer does not support editing.boolean
This layer does not support editing.boolean
Returns whether objects should be represented as text.boolean
Returns whether this layer supports representing objects as text.boolean
Returns whether the painter will add a halo effect around the grid labels.boolean
This layer does not support selection.boolean
This layer does not support selection.boolean
isSelected
(Object aObject) This layer does not support selection.boolean
Deprecated.This method has been deprecated.boolean
Returns whether or not the layer's content is painted.void
paint
(Graphics aGraphics, int aMode, ILcdGXYView aGXYView) Paints the combined representation of the layer's objects for a view, taking into account the mode.void
removePropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) If thePropertyChangeListener
aPropertyChangeListener is associated to thisILcdLayer
, it will not be associated to thisILcdLayer
after-wards.void
removeSelectionListener
(ILcdSelectionListener aSelectionListener) This layer does not support selection.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.void
Sets the outline color of the 100.000m squares.void
setColorScales
(Color aColorScales) Sets theColor
to be used by this painter to paint the scales within the 100.000m squares.void
setEditable
(boolean aEditable) This layer does not support editing.void
setGridZoneColor
(Color aColor) Sets the outline color of the grid zonesvoid
Empty implementation.void
Sets the textual representation of thisILcdLayer
.void
setLabelColor
(Color aLabelColor) Sets theColor
for the labels.void
setLabeled
(boolean aLabeled) Sets whether objects should be represented as text.void
setLabelFont
(Font aLabelFont) Sets theFont
for the labels.void
setLabelHaloColor
(Color aHaloColor) Sets the color of the halo effect for the grid labels.void
setLabelHaloEnabled
(boolean aHaloEnabled) Determines whether the painter will add a halo effect around the grid labels.void
setLabelHaloThickness
(int aHaloThickness) Sets the thickness defined in pixels of the halo effect for the grid labels.void
setSelectable
(boolean aSelectable) This layer does not support selection.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.void
setVisible
(boolean aVisible) Sets whether or not the layer's content is painted.void
Inform the layer that it should terminate the current paint operation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYLayer
getLabelMapScaleRange, getMapScaleRange
Methods inherited from interface com.luciad.util.ILcdSelection
getSelectedObjects
-
Constructor Details
-
TLcdUPSGridLayer
public TLcdUPSGridLayer() -
TLcdUPSGridLayer
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) 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
public void setTraceOn(boolean aTraceOn) 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
public boolean 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.
-
paint
Description copied from interface:ILcdGXYLayer
Paints the combined representation of the layer's objects for a view, taking into account the mode.The mode indicates what objects of the model should be taken into account and what representation should be provided. The objects to be taken into account shall be one of:
- ALL: all the objects in the layer's model, or
- SELECTION: all the objects in the layer's selection.
Note that the combined representation may contain less than the representation of all objects that were taken into account, as some objects may be disregarded for various reasons (filters, scale, ... ). When the views scale is outside the scale range (BODIES or HANDLES mode) or the label scale range (LABELS mode) nothing shall be painted.
The representations provided shall be one or more of:
- BODIES: the combination of geometric representations of the objects,
- HANDLES: the handles for the objects. These are the parts of the objects representation on which user interaction can be applied. For example, for a circle this can be the center point, allowing to move the circle.
- LABELS: the combination of the textual representations of the objects.
The mode supplied shall be a bitwise or combination of a constant of the first group and one or more of the second group. When painting in BODIES or HANDLES mode, painting of an object shall be delegated to the
painter
for that object, when the LABELS mode is passed, painting shall be delegated to thelabelpainter
for that object.The view is passed to provide contextual information: some of the objects may have a different representation depending on the view, or depending on a property of the view, for example, the scale of the view.
The combined representation of the objects has to be painted on the Graphics supplied, as these may be different from the Graphics provided by the view (due to double buffering, for example).
When
stopPainting
is called, the current painting operation should be aborted.- Specified by:
paint
in interfaceILcdGXYLayer
- Parameters:
aGraphics
- the Graphics to paint on.aMode
- indicates what should be painted and how it should be painted.aGXYView
- the view to paint for.- See Also:
-
getGridZoneColor
Returns the outline color of the grid zones- Returns:
- the outline color of the grid zones
-
setGridZoneColor
Sets the outline color of the grid zones- Parameters:
aColor
- the outline color of the grid zones
-
getColor
Returns the outline color of the 100.000m squares- Returns:
- the outline color of the 100.000m squares
-
setColor
Sets the outline color of the 100.000m squares.- Parameters:
aColor
- the outline color of the 100.000m squares
-
getColorScales
Returns theColor
to paint the scales within the 100.000m squares. -
setColorScales
Sets theColor
to be used by this painter to paint the scales within the 100.000m squares. -
getLabelColor
Returns theColor
for the labels. -
setLabelColor
Sets theColor
for the labels. -
isLabelHaloEnabled
public boolean isLabelHaloEnabled()Returns whether the painter will add a halo effect around the grid labels.- Returns:
- whether the painter will add a halo effect around the grid labels.
- See Also:
-
setLabelHaloEnabled
public void setLabelHaloEnabled(boolean aHaloEnabled) Determines whether the painter will add a halo effect around the grid labels. By default, this property is set tofalse
.- Parameters:
aHaloEnabled
- a flag indicating whether to add a halo effect around the grid labels.- See Also:
-
getLabelHaloThickness
public int getLabelHaloThickness()Returns the thickness of the halo effect for the grid labels.- Returns:
- the thickness of the halo effect for the grid labels.
- See Also:
-
setLabelHaloThickness
public void setLabelHaloThickness(int aHaloThickness) Sets the thickness defined in pixels of the halo effect for the grid labels. By default, this property is set to1
.- Parameters:
aHaloThickness
- the thickness defined in pixels of the halo effect for the grid labels.- See Also:
-
getLabelHaloColor
Returns the color of the halo effect.- Returns:
- the color of the halo effect.
- See Also:
-
setLabelHaloColor
Sets the color of the halo effect for the grid labels. By default, this property is set toColor.white
.- Parameters:
aHaloColor
- the color of the halo effect for the grid labels.- See Also:
-
getLabelFont
Gets theFont
for the labels. -
setLabelFont
Sets theFont
for the labels. -
applyOnInteract
public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView) Description copied from interface:ILcdGXYLayer
Applies the function to (at the least) all objects that are contained (partially or completely) in the bounds of the view.The function shall be applied successively to all objects in the bounds as long as the function returns
true
for an object. This allows developers to indicate a stop condition. Note that the order in which the objects are passed to the function is not specified.When strict interaction is required, only objects whose representation lies within the given bounds, completely or partially, are candidates to be passed to the function. An object whose representation does not interact with the bounds should not be passed to the function. Applying non strict interaction can be useful to avoid heavy computations to determine whether an objects representation lies within the bounds.
This method behaves similar to the paint method, and as such is allowed to omit small or invisible objects for performance reasons.
- Specified by:
applyOnInteract
in interfaceILcdGXYLayer
- Parameters:
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
- iftrue
, theILcdFunction
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.- Returns:
- the number of objects the function was applied on.
-
getBounds
Always throws a TLcdNoBoundsException.- Specified by:
getBounds
in interfaceILcdGXYLayer
- Parameters:
aMode
- the mode to calculate the bounds in.aGXYView
- the view to calculate the bounds in.- Returns:
- never returns.
- Throws:
TLcdNoBoundsException
- is always thrown
-
stopPainting
public void stopPainting()Description copied from interface:ILcdGXYLayer
Inform the layer that it should terminate the current paint operation. This method can be useful when the paint method is executed in a specificThread
and needs to be stopped in a safe state from another Thread.- Specified by:
stopPainting
in interfaceILcdGXYLayer
- See Also:
-
getScaleRange
Always returns null.- Specified by:
getScaleRange
in interfaceILcdGXYLayer
- Returns:
- null
- See Also:
-
getLabelScaleRange
Always returns null.- Specified by:
getLabelScaleRange
in interfaceILcdGXYLayer
- Returns:
- null
- See Also:
-
getGXYPainter
Always returns null.- Specified by:
getGXYPainter
in interfaceILcdGXYLayer
- Parameters:
aObject
- the object to retrieve a painter for.- Returns:
- null
-
getGXYEditor
Always returns null.- Specified by:
getGXYEditor
in interfaceILcdGXYLayer
- Parameters:
aObject
- the object to retrieve an editor for.- Returns:
- null
-
getGXYLabelPainter
Always returns null.- Specified by:
getGXYLabelPainter
in interfaceILcdGXYLayer
- Parameters:
aObject
- not taken into account.- Returns:
- null
-
getGXYPen
Description copied from interface:ILcdGXYLayer
Returns the pen to use when performing basic painting operations for objects in this layers model.- Specified by:
getGXYPen
in interfaceILcdGXYLayer
- Returns:
- the pen to use when performing basic painting operations for objects in this layers model.
-
getIcon
Returns null. No icon is defined for this layer. -
getModelXYWorldTransfoClass
ReturnsTLcdGrid2Grid
class.- Specified by:
getModelXYWorldTransfoClass
in interfaceILcdGXYLayer
- Returns:
- TLcdGrid2Grid.class
-
isLabeledSupported
public boolean isLabeledSupported()Description copied from interface:ILcdGXYLayer
Returns whether this layer supports representing objects as text. If not, no effort should be made trying to represent the objects with labels.- Specified by:
isLabeledSupported
in interfaceILcdGXYLayer
- Returns:
- whether this layer supports representing objects as text.
-
isLabeled
public boolean isLabeled()Description copied from interface:ILcdGXYLayer
Returns whether objects should be represented as text. Note that this property shall not be taken into account whenILcdGXYLayer.isLabeledSupported()
returns false.- Specified by:
isLabeled
in interfaceILcdGXYLayer
- Returns:
- whether objects should be represented as text.
- See Also:
-
setLabeled
public void setLabeled(boolean aLabeled) Description copied from interface:ILcdGXYLayer
Sets whether objects should be represented as text. The value set for this property shall have no effect as long asILcdGXYLayer.isLabeledSupported()
returns false.- Specified by:
setLabeled
in interfaceILcdGXYLayer
- Parameters:
aLabeled
- true to have a textual representation of the objects in the model, false to have no such representation.
-
setIcon
Empty implementation. Setting the icon has no effect. -
getModel
-
getLabel
Description copied from interface:ILcdLayer
A short textual representation of thisILcdLayer
. -
setLabel
Description copied from interface:ILcdLayer
Sets the textual representation of thisILcdLayer
. -
isVisible
public boolean isVisible()Description copied from interface:ILcdLayer
Returns whether or not the layer's content is painted. -
setVisible
public void setVisible(boolean aVisible) Description copied from interface:ILcdLayer
Sets whether or not the layer's content is painted.- Specified by:
setVisible
in interfaceILcdLayer
- Parameters:
aVisible
-true
if the layer should be visible,false
otherwise.- See Also:
-
isSelectableSupported
public boolean isSelectableSupported()This layer does not support selection. Always returns false.- Specified by:
isSelectableSupported
in interfaceILcdLayer
- Returns:
- false
- See Also:
-
isSelectable
public boolean isSelectable()This layer does not support selection. Always returns false.- Specified by:
isSelectable
in interfaceILcdLayer
- Returns:
- false
- See Also:
-
setSelectable
public void setSelectable(boolean aSelectable) This layer does not support selection. Empty implementation.- Specified by:
setSelectable
in interfaceILcdLayer
- Parameters:
aSelectable
- has no influence.- See Also:
-
isEditableSupported
public boolean isEditableSupported()This layer does not support editing. Always returns false.- Specified by:
isEditableSupported
in interfaceILcdLayer
- Returns:
- false
- See Also:
-
isEditable
public boolean isEditable()This layer does not support editing. Always returns false.- Specified by:
isEditable
in interfaceILcdLayer
- Returns:
- false
- See Also:
-
setEditable
public void setEditable(boolean aEditable) This layer does not support editing. Empty implementation.- Specified by:
setEditable
in interfaceILcdLayer
- Parameters:
aEditable
- of no influence.- See Also:
-
selectObject
This layer does not support selection. Empty implementation.- Specified by:
selectObject
in interfaceILcdLayer
- Parameters:
aObject
- the object to (de)select.aSelection
- the new selection state of the object in the layer.aDispatchEventMode
- whether notification of the selection should be immediate, later or never.- See Also:
-
fireCollectedSelectionChanges
public void fireCollectedSelectionChanges()This layer does not support selection. Empty implementation.- Specified by:
fireCollectedSelectionChanges
in interfaceILcdLayer
-
clearSelection
public void clearSelection(int aDispatchEventMode) This layer does not support selection. Empty implementation.- Specified by:
clearSelection
in interfaceILcdLayer
- Parameters:
aDispatchEventMode
- shall be one amongILcdFireEventMode.FIRE_NOW
,ILcdFireEventMode.FIRE_LATER
,ILcdFireEventMode.NO_EVENT
- See Also:
-
addPropertyChangeListener
Associate aPropertyChangeListener
to thisILcdLayer
.- Specified by:
addPropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aPropertyChangeListener
- a listener to be notified of changes of properties of this layer.- See Also:
-
removePropertyChangeListener
If thePropertyChangeListener
aPropertyChangeListener is associated to thisILcdLayer
, it will not be associated to thisILcdLayer
after-wards.- Specified by:
removePropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aPropertyChangeListener
- a listener no longer to be notified of changes of properties of this layer.- See Also:
-
getSelectionCount
public int getSelectionCount()This layer does not support selection. Always returns 0.- Specified by:
getSelectionCount
in interfaceILcdSelection<Object>
- Returns:
- 0
-
selectedObjects
This layer does not support selection. Always returns null.- Specified by:
selectedObjects
in interfaceILcdSelection<Object>
- Returns:
- null
-
isSelected
This layer does not support selection. Always returns false.- Specified by:
isSelected
in interfaceILcdSelection<Object>
- Parameters:
aObject
- the object to check the selection state of.- Returns:
- false
-
addSelectionListener
This layer does not support selection. Empty implementation.- Specified by:
addSelectionListener
in interfaceILcdSelection<Object>
- Parameters:
aSelectionListener
- not of influence.
-
removeSelectionListener
This layer does not support selection. Empty implementation.- Specified by:
removeSelectionListener
in interfaceILcdSelection<Object>
- Parameters:
aSelectionListener
- not of influence.
-