public class NoteLayer extends AbstractModifiableLayer implements java.awt.event.MouseListener
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerActionAbstractMapViewPaintable.CompatibilityModeLayerPainterMapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, MapViewPaintable.PaintableInvalidationListener| Modifier and Type | Field and Description |
|---|---|
private NoteData |
noteData |
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP| Constructor and Description |
|---|
NoteLayer()
Convenience constructor that creates a layer with an empty note list
|
NoteLayer(java.util.Collection<Note> notes,
java.lang.String name)
Create a new note layer with a set of notes
|
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
createAndOpenSaveFileChooser()
Creates a new "Save" dialog for this layer and makes it visible.
When the user has chosen a file, checks the file extension, and confirms overwrite if needed. |
AbstractIOTask |
createUploadTask(ProgressMonitor monitor)
Creates a new
AbstractIOTask for uploading data. |
javax.swing.Icon |
getIcon()
Return a representative small image for this layer.
|
java.lang.Object |
getInfoComponent() |
javax.swing.Action[] |
getMenuEntries()
Returns list of actions.
|
NoteData |
getNoteData()
Returns the note data store being used by this layer
|
java.lang.String |
getToolTipText() |
void |
hookUpMapView()
Initialization code, that depends on Main.map.mapView.
|
boolean |
isMergable(Layer other) |
boolean |
isModified()
Determines if data managed by this layer has been modified.
|
boolean |
isSavable()
Replies the savable state of this layer (i.e if it can be saved through a "File->Save" dialog).
|
boolean |
isUploadable()
Determines if the layer is able to upload data and implements the
UploadToServer interface. |
void |
mergeFrom(Layer from)
Merges the given layer into this layer.
|
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
paint(java.awt.Graphics2D g,
MapView mv,
Bounds box)
Paint the dataset using the engine set.
|
boolean |
requiresSaveToFile()
Determines if the data managed by this layer needs to be saved to
a file.
|
boolean |
requiresUploadToServer()
Determines if the data managed by this layer needs to be uploaded to
the server because it contains modified data.
|
void |
visitBoundingBox(BoundingXYVisitor v) |
getUploadDialog, isUploadDiscouraged, onPostSaveToFile, onPostUploadToServeraddPropertyChangeListener, checkSaveConditions, destroy, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getBaseColorProperty, getColorProperty, getDefaultLayerPosition, getName, getOpacity, getViewProjectionBounds, isBackgroundLayer, isChanged, isInfoResizable, isProjectionSupported, isRenamed, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible, toStringaddInvalidationListener, attachToMapView, createMapViewPainter, invalidate, removeInvalidationListenerpublic NoteLayer(java.util.Collection<Note> notes, java.lang.String name)
notes - A list of notes to show in this layername - The name of the layer. Typically "Notes"public NoteLayer()
public void hookUpMapView()
LayerAbstractMapViewPaintable.attachToMapView(org.openstreetmap.josm.gui.layer.MapViewPaintable.MapViewEvent)hookUpMapView in class Layerpublic NoteData getNoteData()
public boolean isModified()
AbstractModifiableLayerisModified in class AbstractModifiableLayerpublic boolean isUploadable()
AbstractModifiableLayerUploadToServer interface.isUploadable in interface UploadToServerisUploadable in class AbstractModifiableLayerpublic boolean requiresUploadToServer()
AbstractModifiableLayerrequiresUploadToServer in interface UploadToServerrequiresUploadToServer in class AbstractModifiableLayerpublic boolean isSavable()
LayerisSavable in interface SaveToFileisSavable in class Layerpublic boolean requiresSaveToFile()
AbstractModifiableLayerrequiresSaveToFile in interface SaveToFilerequiresSaveToFile in class AbstractModifiableLayerpublic void paint(java.awt.Graphics2D g, MapView mv, Bounds box)
MapViewPaintablepaint in interface MapViewPaintableg - Graphicsmv - The object that can translate GeoPoints to screen coordinates.box - Bounding boxpublic javax.swing.Icon getIcon()
Layerpublic java.lang.String getToolTipText()
getToolTipText in class Layerpublic void mergeFrom(Layer from)
Layerpublic boolean isMergable(Layer other)
isMergable in class Layerother - The other layer that is tested to be mergable with this.public void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox in class Layerpublic java.lang.Object getInfoComponent()
getInfoComponent in class Layerpublic javax.swing.Action[] getMenuEntries()
LayerLayer.SeparatorLayerAction.INSTANCE instead of new JSeparatorgetMenuEntries in class Layerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic java.io.File createAndOpenSaveFileChooser()
LayercreateAndOpenSaveFileChooser in class LayerFileSaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)public AbstractIOTask createUploadTask(ProgressMonitor monitor)
AbstractModifiableLayerAbstractIOTask for uploading data.createUploadTask in interface UploadToServercreateUploadTask in class AbstractModifiableLayermonitor - The progress monitorAbstractIOTask for uploading data, or null if not applicablepublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListener