public final class StreetsideLayer extends AbstractModifiableLayer implements MainLayerManager.ActiveLayerChangeListener, StreetsideDataListener
Modifier and Type | Class and Description |
---|---|
private static class |
StreetsideLayer.NearestImgToTargetComparator
Action used to delete images.
|
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
AbstractMapViewPaintable.CompatibilityModeLayerPainter
MapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, 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 DataSetListenerAdapter |
DATASET_LISTENER |
private 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 |
AbstractMode |
mode
Mode of the layer.
|
private StreetsideImage[] |
nearestImages
The nearest images to the selected image from different sequences sorted by distance from selection.
|
private static double |
TRAFFIC_SIGN_HEIGHT_3RD
A third of the height of the sign, for easier calculations
|
private static int |
TRAFFIC_SIGN_SIZE
Length of the edge of the small sign, which indicates that traffic signs have been found in an image.
|
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
Modifier | Constructor and Description |
---|---|
private |
StreetsideLayer() |
Modifier and Type | Method and Description |
---|---|
void |
activeOrEditLayerChanged(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(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. |
Icon |
getIcon() |
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. |
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.
|
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(Layer other) |
boolean |
isModified() |
void |
mergeFrom(Layer from) |
void |
paint(Graphics2D g,
MapView mv,
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(BoundingXYVisitor v) |
createUploadTask, getUploadDialog, isDownloadable, isLocked, isUploadable, isUploadDiscouraged, isUploadInProgress, lock, onPostSaveToFile, onPostUploadToServer, requiresSaveToFile, requiresUploadToServer, unlock
addPropertyChangeListener, 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, toString
addInvalidationListener, attachToMapView, createMapViewPainter, invalidate, removeInvalidationListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isSavable
private static final int IMG_MARKER_RADIUS
private static final int CA_INDICATOR_RADIUS
private static final int CA_INDICATOR_ANGLE
private static final int TRAFFIC_SIGN_SIZE
private static final double TRAFFIC_SIGN_HEIGHT_3RD
private static final 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 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 Destroyable
destroy
in class Layer
public boolean isModified()
isModified
in class AbstractModifiableLayer
public void setVisible(boolean visible)
setVisible
in class Layer
private void createHatchTexture()
public void paint(Graphics2D g, MapView mv, Bounds box)
paint
in interface MapViewPaintable
private void drawImageMarker(Graphics2D g, StreetsideAbstractImage img)
g
- the Graphics contextimg
- the image to be drawn onto the Graphics contextpublic boolean isMergable(Layer other)
isMergable
in class Layer
public Action[] getMenuEntries()
getMenuEntries
in class Layer
public Object getInfoComponent()
getInfoComponent
in class Layer
public String getToolTipText()
getToolTipText
in class Layer
public void activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
activeOrEditLayerChanged
in interface MainLayerManager.ActiveLayerChangeListener
public void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox
in class Layer
public void imagesAdded()
StreetsideDataListener
imagesAdded
in interface StreetsideDataListener
public void selectedImageChanged(StreetsideAbstractImage oldImage, StreetsideAbstractImage newImage)
StreetsideDataListener
selectedImageChanged
in interface StreetsideDataListener
oldImage
- Old selected StreetsideAbstractImage
newImage
- New selected StreetsideAbstractImage
private 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()