public class NoteLayer extends AbstractModifiableLayer implements java.awt.event.MouseListener
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
Modifier and Type | Field and Description |
---|---|
private NoteData |
noteData |
ICON_SIZE, 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.List<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. |
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).
|
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) |
createUploadTask, getUploadDialog, isUploadDiscouraged, onPostSaveToFile, onPostUploadToServer
addPropertyChangeListener, checkSaveConditions, destroy, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, isBackgroundLayer, isChanged, isInfoResizable, isProjectionSupported, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisible
public NoteLayer(java.util.List<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()
Layer
hookUpMapView
in class Layer
public NoteData getNoteData()
public boolean isModified()
AbstractModifiableLayer
isModified
in class AbstractModifiableLayer
public boolean requiresUploadToServer()
AbstractModifiableLayer
requiresUploadToServer
in class AbstractModifiableLayer
public boolean isSavable()
Layer
public boolean requiresSaveToFile()
AbstractModifiableLayer
requiresSaveToFile
in class AbstractModifiableLayer
public void paint(java.awt.Graphics2D g, MapView mv, Bounds box)
Layer
paint
in interface MapViewPaintable
paint
in class Layer
mv
- The object that can translate GeoPoints to screen coordinates.public javax.swing.Icon getIcon()
Layer
public java.lang.String getToolTipText()
getToolTipText
in class Layer
public void mergeFrom(Layer from)
Layer
public boolean isMergable(Layer other)
isMergable
in class Layer
other
- The other layer that is tested to be mergable with this.public void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox
in class Layer
public java.lang.Object getInfoComponent()
getInfoComponent
in class Layer
public javax.swing.Action[] getMenuEntries()
Layer
getMenuEntries
in class Layer
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public java.io.File createAndOpenSaveFileChooser()
Layer
createAndOpenSaveFileChooser
in class Layer
File
SaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener