Class TLcdMultilevelGridCoordinate
java.lang.Object
com.luciad.view.map.multilevelgrid.TLcdMultilevelGridCoordinate
- All Implemented Interfaces:
ILcdEditableMultilevelGridCoordinate
,ILcdMultilevelGridCoordinate
public class TLcdMultilevelGridCoordinate
extends Object
implements ILcdEditableMultilevelGridCoordinate
An implementation of an
ILcdEditableMultilevelGridCoordinate
that
dynamically adapts the number of levels.- Since:
- 7.0
-
Constructor Summary
ConstructorDescriptionConstructs an editable multilevel grid coordinate with 5 levels and 2 axes.TLcdMultilevelGridCoordinate
(int aInitialLevelCount) Constructs an editable multilevel grid coordinate with the given number of levels and 2 axes. -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this object that can be edited.int
getCoordinate
(int aLevel, int aAxis) Returns the value of the coordinate at the given level and axis.int
Returns how many levels of this coordinate are taken into account.void
setCoordinate
(int aLevel, int aAxis, int aCoordinate) Sets the value of the coordinate at the given level for the given axis.void
setCoordinateLevelCount
(int aLevelCount) Sets how many levels of this coordinates are taken into account.toString()
Returns a string containing the number of levels up to which the multilevel grid coordinate is specified and the coordinates grouped per level.
-
Constructor Details
-
TLcdMultilevelGridCoordinate
public TLcdMultilevelGridCoordinate()Constructs an editable multilevel grid coordinate with 5 levels and 2 axes. -
TLcdMultilevelGridCoordinate
public TLcdMultilevelGridCoordinate(int aInitialLevelCount) Constructs an editable multilevel grid coordinate with the given number of levels and 2 axes.- Parameters:
aInitialLevelCount
- the number of levels the multilevel grid coordinate should contain on initialization.
-
-
Method Details
-
setCoordinate
public void setCoordinate(int aLevel, int aAxis, int aCoordinate) Sets the value of the coordinate at the given level for the given axis. When the level passed is higher than the number of levels the number of available levels is adapted. Note that this does not change the number of levels of this coordinate which are taken into account by other methods. For this you have to callsetCoordinateLevelCount(int)
.- Specified by:
setCoordinate
in interfaceILcdEditableMultilevelGridCoordinate
- Parameters:
aLevel
- the level for which to set the valueaAxis
- the axis for which to set the valueaCoordinate
- the new value of the coordinate- See Also:
-
setCoordinateLevelCount
public void setCoordinateLevelCount(int aLevelCount) Sets how many levels of this coordinates are taken into account. This means that all levels of this coordinate are taken into account up to, but not including, the specified value. If the number of levels is higher than the number of levels available, the coordinate will adapt internally.- Specified by:
setCoordinateLevelCount
in interfaceILcdEditableMultilevelGridCoordinate
- Parameters:
aLevelCount
- the number of levels which should be taken into account for this multilevel grid coordinate.- See Also:
-
getCoordinate
public int getCoordinate(int aLevel, int aAxis) Returns the value of the coordinate at the given level and axis. Note that this method does not adapt the number of levels available for the coordinate.- Specified by:
getCoordinate
in interfaceILcdMultilevelGridCoordinate
- Parameters:
aLevel
- the level for which to retrieve the coordinate value for.aAxis
- the axis for which to retrieve the coordinate value for.- Returns:
- the value of the coordinate at the given level and axis.
- See Also:
-
getCoordinateLevelCount
public int getCoordinateLevelCount()Description copied from interface:ILcdMultilevelGridCoordinate
Returns how many levels of this coordinate are taken into account. This means that all levels of this coordinate are taken into account up to, but not including, the returned value. Note that this is not necessarily the total number of levels which could be specified for this coordinate. The methodILcdMultilevelGridCoordinate.getCoordinate(int, int)
should only be called for levels strictly smaller than the count returned by this method.- Specified by:
getCoordinateLevelCount
in interfaceILcdMultilevelGridCoordinate
- Returns:
- the number of levels taken into account for this multilevel grid coordinate.
-
cloneAsEditableMultilevelCoordinate
Description copied from interface:ILcdMultilevelGridCoordinate
Returns a copy of this object that can be edited. Changing the coordinates or number of specified levels of the copy should not change the coordinates of the original.- Specified by:
cloneAsEditableMultilevelCoordinate
in interfaceILcdMultilevelGridCoordinate
- Returns:
- a copy of this object that can be edited.
-
toString
Returns a string containing the number of levels up to which the multilevel grid coordinate is specified and the coordinates grouped per level.
-