public final class StreetsideLayer extends org.openstreetmap.josm.gui.layer.AbstractModifiableLayer implements org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener, StreetsideDataListener
| Modifier and Type | Class and Description |
|---|---|
private static class |
StreetsideLayer.NearestImgToTargetComparator |
org.openstreetmap.josm.gui.layer.Layer.LayerAction, org.openstreetmap.josm.gui.layer.Layer.LayerGpxExportAction, org.openstreetmap.josm.gui.layer.Layer.LayerSaveAction, org.openstreetmap.josm.gui.layer.Layer.LayerSaveAsAction, org.openstreetmap.josm.gui.layer.Layer.MultiLayerAction, org.openstreetmap.josm.gui.layer.Layer.SeparatorLayerActionorg.openstreetmap.josm.gui.layer.AbstractMapViewPaintable.CompatibilityModeLayerPainterorg.openstreetmap.josm.gui.layer.MapViewPaintable.LayerPainter, org.openstreetmap.josm.gui.layer.MapViewPaintable.MapViewEvent, org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationEvent, org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationListener| Modifier and Type | Field and Description |
|---|---|
private static int |
CA_INDICATOR_ANGLE
The angle of the circular sector that indicates the camera angle
|
private static int |
CA_INDICATOR_RADIUS
The radius of the circular sector that indicates the camera angle
|
private StreetsideData |
data
StreetsideData object that stores the database. |
private static org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter |
DATASET_LISTENER |
private java.awt.TexturePaint |
hatched |
private static int |
IMG_MARKER_RADIUS
The radius of the image marker
|
private static StreetsideLayer |
instance
Unique instance of the class.
|
private StreetsideLocationChangeset |
locationChangeset |
(package private) static org.apache.log4j.Logger |
logger |
AbstractMode |
mode
Mode of the layer.
|
private StreetsideImage[] |
nearestImages
The nearest images to the selected image from different sequences sorted by distance from selection.
|
| Modifier | Constructor and Description |
|---|---|
private |
StreetsideLayer() |
| Modifier and Type | Method and Description |
|---|---|
void |
activeOrEditLayerChanged(org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent e) |
private static void |
clearInstance() |
private void |
createHatchTexture()
Initialize the hatch pattern used to paint the non-downloaded area.
|
void |
destroy() |
private void |
drawImageMarker(java.awt.Graphics2D g,
StreetsideAbstractImage img)
Draws an image marker onto the given Graphics context.
|
StreetsideData |
getData()
Returns the
StreetsideData object, which acts as the database of the
Layer. |
javax.swing.Icon |
getIcon() |
java.lang.Object |
getInfoComponent() |
static StreetsideLayer |
getInstance()
Returns the unique instance of this class.
|
StreetsideLocationChangeset |
getLocationChangeset()
Returns the
StreetsideLocationChangeset object, which acts as the database of the
Layer. |
javax.swing.Action[] |
getMenuEntries() |
private StreetsideImage[] |
getNearestImagesFromDifferentSequences(StreetsideAbstractImage target,
int limit)
Returns the closest images belonging to a different sequence and
different from the specified target image.
|
StreetsideImage |
getNNearestImage(int n)
Returns the n-nearest image, for n=1 the nearest one is returned, for n=2 the second nearest one and so on.
|
java.lang.String |
getToolTipText() |
static boolean |
hasInstance() |
void |
imagesAdded()
Fired when any image is added to the database.
|
private void |
init()
Initializes the Layer.
|
static void |
invalidateInstance() |
boolean |
isMergable(org.openstreetmap.josm.gui.layer.Layer other) |
boolean |
isModified() |
void |
mergeFrom(org.openstreetmap.josm.gui.layer.Layer from) |
void |
paint(java.awt.Graphics2D g,
org.openstreetmap.josm.gui.MapView mv,
org.openstreetmap.josm.data.Bounds box) |
void |
selectedImageChanged(StreetsideAbstractImage oldImage,
StreetsideAbstractImage newImage)
Fired when the selected image is changed by something different from
manually clicking on the icon.
|
void |
setMode(AbstractMode mode)
Changes the mode the the given one.
|
void |
setVisible(boolean visible) |
private void |
updateNearestImages() |
void |
visitBoundingBox(org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor v) |
createUploadTask, getUploadDialog, isDownloadable, isLocked, isUploadable, isUploadDiscouraged, isUploadInProgress, lock, onPostSaveToFile, onPostUploadToServer, requiresSaveToFile, requiresUploadToServer, unlockaddPropertyChangeListener, checkSaveConditions, createAndOpenSaveFileChooser, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getBaseColorProperty, getColorProperty, getDefaultLayerPosition, getName, getOpacity, getViewProjectionBounds, hookUpMapView, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, toggleVisible, toStringaddInvalidationListener, attachToMapView, createMapViewPainter, invalidate, removeInvalidationListenerstatic final org.apache.log4j.Logger logger
private static final int IMG_MARKER_RADIUS
private static final int CA_INDICATOR_RADIUS
private static final int CA_INDICATOR_ANGLE
private static final org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter DATASET_LISTENER
private static StreetsideLayer instance
private StreetsideImage[] nearestImages
private final StreetsideData data
StreetsideData object that stores the database.public AbstractMode mode
private volatile java.awt.TexturePaint hatched
private final StreetsideLocationChangeset locationChangeset
private StreetsideLayer()
private void init()
public static void invalidateInstance()
public void setMode(AbstractMode mode)
mode - The mode that is going to be activated.private static void clearInstance()
public static StreetsideLayer getInstance()
public static boolean hasInstance()
public StreetsideData getData()
StreetsideData object, which acts as the database of the
Layer.StreetsideData object that stores the database.public StreetsideLocationChangeset getLocationChangeset()
StreetsideLocationChangeset object, which acts as the database of the
Layer.StreetsideData object that stores the database.public StreetsideImage getNNearestImage(int n)
n - the index for picking from the list of "nearest images", beginning from 1public void destroy()
destroy in interface org.openstreetmap.josm.tools.Destroyabledestroy in class org.openstreetmap.josm.gui.layer.Layerpublic boolean isModified()
isModified in class org.openstreetmap.josm.gui.layer.AbstractModifiableLayerpublic void setVisible(boolean visible)
setVisible in class org.openstreetmap.josm.gui.layer.Layerprivate void createHatchTexture()
public void paint(java.awt.Graphics2D g, org.openstreetmap.josm.gui.MapView mv, org.openstreetmap.josm.data.Bounds box)
paint in interface org.openstreetmap.josm.gui.layer.MapViewPaintableprivate void drawImageMarker(java.awt.Graphics2D g, StreetsideAbstractImage img)
g - the Graphics contextimg - the image to be drawn onto the Graphics contextpublic javax.swing.Icon getIcon()
getIcon in class org.openstreetmap.josm.gui.layer.Layerpublic boolean isMergable(org.openstreetmap.josm.gui.layer.Layer other)
isMergable in class org.openstreetmap.josm.gui.layer.Layerpublic void mergeFrom(org.openstreetmap.josm.gui.layer.Layer from)
mergeFrom in class org.openstreetmap.josm.gui.layer.Layerpublic javax.swing.Action[] getMenuEntries()
getMenuEntries in class org.openstreetmap.josm.gui.layer.Layerpublic java.lang.Object getInfoComponent()
getInfoComponent in class org.openstreetmap.josm.gui.layer.Layerpublic java.lang.String getToolTipText()
getToolTipText in class org.openstreetmap.josm.gui.layer.Layerpublic void activeOrEditLayerChanged(org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent e)
activeOrEditLayerChanged in interface org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListenerpublic void visitBoundingBox(org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor v)
visitBoundingBox in class org.openstreetmap.josm.gui.layer.Layerpublic void imagesAdded()
StreetsideDataListenerimagesAdded in interface StreetsideDataListenerpublic void selectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)
StreetsideDataListenerselectedImageChanged in interface StreetsideDataListeneroldImage - Old selected StreetsideAbstractImagenewImage - New selected StreetsideAbstractImageprivate StreetsideImage[] getNearestImagesFromDifferentSequences(StreetsideAbstractImage target, int limit)
target - the image for which you want to find the nearest other imageslimit - the maximum length of the returned arrayprivate void updateNearestImages()