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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(PropertyChangeListener aPropertyChangeListener) Associate aPropertyChangeListenerto thisILcdLayer.voidaddSelectionListener(ILcdSelectionListener aSelectionListener) This layer does not support selection.intapplyOnInteract(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.voidclearSelection(int aDispatchEventMode) This layer does not support selection.voidThis layer does not support selection.getBounds(int aMode, ILcdGXYView aGXYView) Always throws a TLcdNoBoundsException.getColor()Returns the outline color of the 100.000m squaresReturns theColorto 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 theColorfor the labels.Gets theFontfor the labels.Returns the color of the halo effect.intReturns the thickness of the halo effect for the grid labels.Always returns null.getModel()ReturnsTLcdGrid2Gridclass.Always returns null.intThis layer does not support selection.booleanThis layer does not support editing.booleanThis layer does not support editing.booleanReturns whether objects should be represented as text.booleanReturns whether this layer supports representing objects as text.booleanReturns whether the painter will add a halo effect around the grid labels.booleanThis layer does not support selection.booleanThis layer does not support selection.booleanisSelected(Object aObject) This layer does not support selection.booleanDeprecated.This method has been deprecated.booleanReturns whether or not the layer's content is painted.voidpaint(Graphics aGraphics, int aMode, ILcdGXYView aGXYView) Paints the combined representation of the layer's objects for a view, taking into account the mode.voidremovePropertyChangeListener(PropertyChangeListener aPropertyChangeListener) If thePropertyChangeListeneraPropertyChangeListener is associated to thisILcdLayer, it will not be associated to thisILcdLayerafter-wards.voidremoveSelectionListener(ILcdSelectionListener aSelectionListener) This layer does not support selection.This layer does not support selection.voidselectObject(Object aObject, boolean aSelection, int aDispatchEventMode) This layer does not support selection.static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidSets the outline color of the 100.000m squares.voidsetColorScales(Color aColorScales) Sets theColorto be used by this painter to paint the scales within the 100.000m squares.voidsetEditable(boolean aEditable) This layer does not support editing.voidsetGridZoneColor(Color aColor) Sets the outline color of the grid zonesvoidEmpty implementation.voidSets the textual representation of thisILcdLayer.voidsetLabelColor(Color aLabelColor) Sets theColorfor the labels.voidsetLabeled(boolean aLabeled) Sets whether objects should be represented as text.voidsetLabelFont(Font aLabelFont) Sets theFontfor the labels.voidsetLabelHaloColor(Color aHaloColor) Sets the color of the halo effect for the grid labels.voidsetLabelHaloEnabled(boolean aHaloEnabled) Determines whether the painter will add a halo effect around the grid labels.voidsetLabelHaloThickness(int aHaloThickness) Sets the thickness defined in pixels of the halo effect for the grid labels.voidsetSelectable(boolean aSelectable) This layer does not support selection.voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.voidsetVisible(boolean aVisible) Sets whether or not the layer's content is painted.voidInform 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, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYLayer
getLabelMapScaleRange, getMapScaleRangeMethods 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 istruethen 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 eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen 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.Returnstrueif tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
paint
Description copied from interface:ILcdGXYLayerPaints 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
painterfor that object, when the LABELS mode is passed, painting shall be delegated to thelabelpainterfor 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
stopPaintingis called, the current painting operation should be aborted.- Specified by:
paintin 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 theColorto paint the scales within the 100.000m squares. -
setColorScales
Sets theColorto be used by this painter to paint the scales within the 100.000m squares. -
getLabelColor
Returns theColorfor the labels. -
setLabelColor
Sets theColorfor 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 theFontfor the labels. -
setLabelFont
Sets theFontfor the labels. -
applyOnInteract
public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView) Description copied from interface:ILcdGXYLayerApplies 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
truefor 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:
applyOnInteractin 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, theILcdFunctionshall 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:
getBoundsin 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:ILcdGXYLayerInform the layer that it should terminate the current paint operation. This method can be useful when the paint method is executed in a specificThreadand needs to be stopped in a safe state from another Thread.- Specified by:
stopPaintingin interfaceILcdGXYLayer- See Also:
-
getScaleRange
Always returns null.- Specified by:
getScaleRangein interfaceILcdGXYLayer- Returns:
- null
- See Also:
-
getLabelScaleRange
Always returns null.- Specified by:
getLabelScaleRangein interfaceILcdGXYLayer- Returns:
- null
- See Also:
-
getGXYPainter
Always returns null.- Specified by:
getGXYPainterin interfaceILcdGXYLayer- Parameters:
aObject- the object to retrieve a painter for.- Returns:
- null
-
getGXYEditor
Always returns null.- Specified by:
getGXYEditorin interfaceILcdGXYLayer- Parameters:
aObject- the object to retrieve an editor for.- Returns:
- null
-
getGXYLabelPainter
Always returns null.- Specified by:
getGXYLabelPainterin interfaceILcdGXYLayer- Parameters:
aObject- not taken into account.- Returns:
- null
-
getGXYPen
Description copied from interface:ILcdGXYLayerReturns the pen to use when performing basic painting operations for objects in this layers model.- Specified by:
getGXYPenin 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
ReturnsTLcdGrid2Gridclass.- Specified by:
getModelXYWorldTransfoClassin interfaceILcdGXYLayer- Returns:
- TLcdGrid2Grid.class
-
isLabeledSupported
public boolean isLabeledSupported()Description copied from interface:ILcdGXYLayerReturns whether this layer supports representing objects as text. If not, no effort should be made trying to represent the objects with labels.- Specified by:
isLabeledSupportedin interfaceILcdGXYLayer- Returns:
- whether this layer supports representing objects as text.
-
isLabeled
public boolean isLabeled()Description copied from interface:ILcdGXYLayerReturns whether objects should be represented as text. Note that this property shall not be taken into account whenILcdGXYLayer.isLabeledSupported()returns false.- Specified by:
isLabeledin interfaceILcdGXYLayer- Returns:
- whether objects should be represented as text.
- See Also:
-
setLabeled
public void setLabeled(boolean aLabeled) Description copied from interface:ILcdGXYLayerSets 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:
setLabeledin 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:ILcdLayerA short textual representation of thisILcdLayer. -
setLabel
Description copied from interface:ILcdLayerSets the textual representation of thisILcdLayer. -
isVisible
public boolean isVisible()Description copied from interface:ILcdLayerReturns whether or not the layer's content is painted. -
setVisible
public void setVisible(boolean aVisible) Description copied from interface:ILcdLayerSets whether or not the layer's content is painted.- Specified by:
setVisiblein interfaceILcdLayer- Parameters:
aVisible-trueif the layer should be visible,falseotherwise.- See Also:
-
isSelectableSupported
public boolean isSelectableSupported()This layer does not support selection. Always returns false.- Specified by:
isSelectableSupportedin interfaceILcdLayer- Returns:
- false
- See Also:
-
isSelectable
public boolean isSelectable()This layer does not support selection. Always returns false.- Specified by:
isSelectablein interfaceILcdLayer- Returns:
- false
- See Also:
-
setSelectable
public void setSelectable(boolean aSelectable) This layer does not support selection. Empty implementation.- Specified by:
setSelectablein interfaceILcdLayer- Parameters:
aSelectable- has no influence.- See Also:
-
isEditableSupported
public boolean isEditableSupported()This layer does not support editing. Always returns false.- Specified by:
isEditableSupportedin interfaceILcdLayer- Returns:
- false
- See Also:
-
isEditable
public boolean isEditable()This layer does not support editing. Always returns false.- Specified by:
isEditablein interfaceILcdLayer- Returns:
- false
- See Also:
-
setEditable
public void setEditable(boolean aEditable) This layer does not support editing. Empty implementation.- Specified by:
setEditablein interfaceILcdLayer- Parameters:
aEditable- of no influence.- See Also:
-
selectObject
This layer does not support selection. Empty implementation.- Specified by:
selectObjectin 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:
fireCollectedSelectionChangesin interfaceILcdLayer
-
clearSelection
public void clearSelection(int aDispatchEventMode) This layer does not support selection. Empty implementation.- Specified by:
clearSelectionin interfaceILcdLayer- Parameters:
aDispatchEventMode- shall be one amongILcdFireEventMode.FIRE_NOW,ILcdFireEventMode.FIRE_LATER,ILcdFireEventMode.NO_EVENT- See Also:
-
addPropertyChangeListener
Associate aPropertyChangeListenerto thisILcdLayer.- Specified by:
addPropertyChangeListenerin interfaceILcdPropertyChangeSource- Parameters:
aPropertyChangeListener- a listener to be notified of changes of properties of this layer.- See Also:
-
removePropertyChangeListener
If thePropertyChangeListeneraPropertyChangeListener is associated to thisILcdLayer, it will not be associated to thisILcdLayerafter-wards.- Specified by:
removePropertyChangeListenerin 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:
getSelectionCountin interfaceILcdSelection<Object>- Returns:
- 0
-
selectedObjects
This layer does not support selection. Always returns null.- Specified by:
selectedObjectsin interfaceILcdSelection<Object>- Returns:
- null
-
isSelected
This layer does not support selection. Always returns false.- Specified by:
isSelectedin 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:
addSelectionListenerin interfaceILcdSelection<Object>- Parameters:
aSelectionListener- not of influence.
-
removeSelectionListener
This layer does not support selection. Empty implementation.- Specified by:
removeSelectionListenerin interfaceILcdSelection<Object>- Parameters:
aSelectionListener- not of influence.
-