public class OffsetBookmark extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.List<OffsetBookmark> |
allBookmarks |
private double |
center_lat |
private double |
center_lon |
private double |
dx |
private double |
dy |
private java.lang.String |
imagery_id |
private java.lang.String |
imagery_name
Imagery localized name.
|
private java.lang.String |
name |
private java.lang.String |
projection_code |
Constructor and Description |
---|
OffsetBookmark()
Construct new empty OffsetBookmark.
|
OffsetBookmark(java.lang.String projectionCode,
java.lang.String imageryId,
java.lang.String imageryName,
java.lang.String name,
double dx,
double dy)
Create a new
OffsetBookmark object using (0, 0) as center |
OffsetBookmark(java.lang.String projectionCode,
java.lang.String imageryId,
java.lang.String imageryName,
java.lang.String name,
double dx,
double dy,
double centerLon,
double centerLat)
Create a new
OffsetBookmark by specifying all values. |
OffsetBookmark(java.lang.String projectionCode,
java.lang.String imageryId,
java.lang.String imageryName,
java.lang.String name,
EastNorth displacement,
ILatLon center)
Create a new
OffsetBookmark object |
Modifier and Type | Method and Description |
---|---|
static boolean |
addBookmark(OffsetBookmark ob)
Adds a bookmark.
|
static void |
bookmarkOffset(java.lang.String name,
AbstractTileSourceLayer<?> layer)
Add a bookmark for the displacement of that layer
|
static OffsetBookmark |
fromPropertiesMap(java.util.Map<java.lang.String,java.lang.String> properties)
Creates an offset bookmark from a properties map.
|
static OffsetBookmark |
getBookmarkByIndex(int index)
Returns the bookmark at the given index.
|
static OffsetBookmark |
getBookmarkByName(ImageryLayer layer,
java.lang.String name)
Gets a bookmark that is usable on the given layer by it's name.
|
static java.util.List<OffsetBookmark> |
getBookmarks()
Returns all bookmarks.
|
static int |
getBookmarksSize()
Returns the number of bookmarks.
|
LatLon |
getCenter()
Get center/reference point of the bookmark.
|
EastNorth |
getDisplacement()
Get displacement in EastNorth coordinates of the original projection.
|
EastNorth |
getDisplacement(Projection proj)
Get displacement in EastNorth coordinates of a given projection.
|
java.lang.String |
getImageryId()
Get the id of the imagery for which this bookmark was created.
|
java.lang.String |
getImageryName()
Get the name of the imagery for which this bookmark was created.
|
java.lang.String |
getName()
Get the name of this bookmark.
|
java.lang.String |
getProjectionCode()
Get the projection code for which this bookmark was created.
|
boolean |
hasCenter()
Check if bookmark has a valid center.
|
boolean |
isUsable(ImageryLayer layer)
Test if an image is usable for the given imagery layer.
|
static void |
loadBookmarks()
Load the global list of bookmarks from preferences.
|
static boolean |
removeBookmark(OffsetBookmark ob)
Removes a bookmark.
|
(package private) static void |
sanitizeBookmarks(java.util.List<OffsetBookmark> bookmarks) |
static void |
saveBookmarks()
Stores the bookmakrs in the settings.
|
void |
setDisplacement(EastNorth displacement)
Update the displacement of this imagery.
|
void |
setImageryId(java.lang.String imageryId)
Sets the id of the imagery
|
void |
setImageryName(java.lang.String imageryName)
Sets the name of the imagery
|
void |
setName(java.lang.String name)
Set the name of the bookmark
|
void |
setProjectionCode(java.lang.String projectionCode)
Set the projection code for which this bookmark was created
|
java.util.Map<java.lang.String,java.lang.String> |
toPropertiesMap()
Converts the offset bookmark to a properties map.
|
private static final java.util.List<OffsetBookmark> allBookmarks
private java.lang.String projection_code
private java.lang.String imagery_id
private java.lang.String imagery_name
imagery_id
is preferred.private java.lang.String name
private double dx
private double dy
private double center_lon
private double center_lat
public OffsetBookmark()
public OffsetBookmark(java.lang.String projectionCode, java.lang.String imageryId, java.lang.String imageryName, java.lang.String name, double dx, double dy)
OffsetBookmark
object using (0, 0) as center
The use of the OffsetBookmark(String, String, String, String, EastNorth, ILatLon)
constructor is preferred.
projectionCode
- The projection for which this object was createdimageryId
- The id of the imagery on the layer (locale insensitive)imageryName
- The name of the imagery on the layer (locale sensitive)name
- The name of the new bookmarkdx
- The x displacementdy
- The y displacementpublic OffsetBookmark(java.lang.String projectionCode, java.lang.String imageryId, java.lang.String imageryName, java.lang.String name, EastNorth displacement, ILatLon center)
OffsetBookmark
objectprojectionCode
- The projection for which this object was createdimageryId
- The id of the imagery on the layer (locale insensitive)imageryName
- The name of the imagery on the layer (locale sensitive)name
- The name of the new bookmarkdisplacement
- The displacement in east/north space.center
- The point on earth that was used as reference to align the image.public OffsetBookmark(java.lang.String projectionCode, java.lang.String imageryId, java.lang.String imageryName, java.lang.String name, double dx, double dy, double centerLon, double centerLat)
OffsetBookmark
by specifying all values.
The use of the OffsetBookmark(String, String, String, String, EastNorth, ILatLon)
constructor is preferred.
projectionCode
- The projection for which this object was createdimageryId
- The id of the imagery on the layer (locale insensitive)imageryName
- The name of the imagery on the layer (locale sensitive)name
- The name of the new bookmarkdx
- The x displacementdy
- The y displacementcenterLon
- The point on earth that was used as reference to align the image.centerLat
- The point on earth that was used as reference to align the image.public boolean isUsable(ImageryLayer layer)
layer
- The layer to use the image attrue
if it is usable on the projection of the layer and the imagery name matches.public java.lang.String getProjectionCode()
public java.lang.String getName()
public java.lang.String getImageryId()
public java.lang.String getImageryName()
public EastNorth getDisplacement()
getProjectionCode()
public EastNorth getDisplacement(Projection proj)
proj
- the projectionpublic LatLon getCenter()
hasCenter()
, in which
case a dummy center (0,0) will be returned.public boolean hasCenter()
public void setProjectionCode(java.lang.String projectionCode)
projectionCode
- The projectionpublic void setName(java.lang.String name)
name
- The namegetName()
public void setImageryName(java.lang.String imageryName)
imageryName
- The namegetImageryName()
public void setImageryId(java.lang.String imageryId)
imageryId
- The identifiergetImageryId()
public void setDisplacement(EastNorth displacement)
displacement
- The displacementpublic static void loadBookmarks()
static void sanitizeBookmarks(java.util.List<OffsetBookmark> bookmarks)
public static void saveBookmarks()
public static java.util.List<OffsetBookmark> getBookmarks()
public static int getBookmarksSize()
public static boolean addBookmark(OffsetBookmark ob)
ob
- bookmark to addtrue
public static boolean removeBookmark(OffsetBookmark ob)
ob
- bookmark to removetrue
if this list contained the specified elementpublic static OffsetBookmark getBookmarkByIndex(int index)
index
- bookmark indexjava.lang.IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()
)public static OffsetBookmark getBookmarkByName(ImageryLayer layer, java.lang.String name)
layer
- The layer to use the bookmark atname
- The name of the bookmarknull
if not.public static void bookmarkOffset(java.lang.String name, AbstractTileSourceLayer<?> layer)
name
- The bookmark namelayer
- The layer to store the bookmark forpublic java.util.Map<java.lang.String,java.lang.String> toPropertiesMap()
fromPropertiesMap(java.util.Map)
public static OffsetBookmark fromPropertiesMap(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- the properties maptoPropertiesMap()