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, onPostUploadToServeraddPropertyChangeListener, checkSaveConditions, destroy, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, isBackgroundLayer, isChanged, isInfoResizable, isProjectionSupported, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisiblepublic 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()
LayerhookUpMapView in class Layerpublic NoteData getNoteData()
public boolean isModified()
AbstractModifiableLayerisModified in class AbstractModifiableLayerpublic boolean requiresUploadToServer()
AbstractModifiableLayerrequiresUploadToServer in class AbstractModifiableLayerpublic boolean isSavable()
Layerpublic boolean requiresSaveToFile()
AbstractModifiableLayerrequiresSaveToFile in class AbstractModifiableLayerpublic void paint(java.awt.Graphics2D g, MapView mv, Bounds box)
Layerpaint in interface MapViewPaintablepaint in class Layermv - The object that can translate GeoPoints to screen coordinates.public 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()
LayergetMenuEntries 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 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