public class NoteLayer extends AbstractModifiableLayer implements MouseListener
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction| Modifier and Type | Field and Description |
|---|---|
private NoteData |
noteData |
FILTER_STATE_PROP, 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(Collection<Note> notes,
String name)
Create a new note layer with a set of notes
|
| Modifier and Type | Method and Description |
|---|---|
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. |
Icon |
getIcon()
Return a representative small image for this layer.
|
Object |
getInfoComponent() |
Action[] |
getMenuEntries()
Returns list of actions.
|
NoteData |
getNoteData()
Returns the note data store being used by this layer
|
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(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
paint(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, estimateMemoryUsage, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, isBackgroundLayer, isChanged, isInfoResizable, isProjectionSupported, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisiblepublic NoteLayer(Collection<Note> notes, String name)
notes - A list of notes to show in this layername - The name of the layer. Typically "Notes"public NoteLayer()
public void hookUpMapView()
LayerestimateMemoryUsage method and give a hint.
This allows for preemptive warning message for user, instead of failing later on
Remember to call super.hookUpMapView() when overriding this methodhookUpMapView 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(Graphics2D g, MapView mv, Bounds box)
Layerpaint in interface MapViewPaintablepaint in class Layerg - Graphicsmv - The object that can translate GeoPoints to screen coordinates.box - Bounding boxpublic Icon getIcon()
Layerpublic 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 Object getInfoComponent()
getInfoComponent in class Layerpublic Action[] getMenuEntries()
LayerLayer.SeparatorLayerAction.INSTANCE instead of new JSeparatorgetMenuEntries in class Layerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic 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 class AbstractModifiableLayermonitor - The progress monitorAbstractIOTask for uploading data, or null if not applicablepublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListener