public class ValidatorLayer extends Layer implements LayerManager.LayerChangeListener
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 java.lang.Runnable |
invalidator |
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
Constructor and Description |
---|
ValidatorLayer()
Constructs a new Validator layer
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkSaveConditions()
Checks whether it is ok to launch a save (whether we have data, there is no conflict etc.)
|
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. |
void |
destroy()
Called, when the layer is removed from the mapview and is going to be destroyed.
|
java.lang.String |
getChangesetSourceTag()
Get the source for the layer
|
LayerPositionStrategy |
getDefaultLayerPosition()
Gets the strategy that specifies where this layer should be inserted in a layer list.
|
javax.swing.Icon |
getIcon()
Return a static icon.
|
java.lang.Object |
getInfoComponent()
Gets the layer information to display to the user.
|
javax.swing.Action[] |
getMenuEntries()
Returns list of actions.
|
java.lang.String |
getToolTipText() |
boolean |
isMergable(Layer other) |
boolean |
isSavable()
Replies the savable state of this layer (i.e if it can be saved through a "File->Save" dialog).
|
void |
layerAdded(LayerManager.LayerAddEvent e)
Notifies this listener that a layer has been added.
|
void |
layerOrderChanged(LayerManager.LayerOrderChangeEvent e)
Notifies this listener that the order of layers was changed.
|
void |
layerRemoving(LayerManager.LayerRemoveEvent e)
If layer is the OSM Data layer, remove all errors
|
void |
mergeFrom(Layer from)
Merges the given layer into this layer.
|
void |
paint(java.awt.Graphics2D g,
MapView mv,
Bounds bounds)
Draw all primitives in this layer but do not draw modified ones (they
are drawn by the edit layer).
|
void |
visitBoundingBox(BoundingXYVisitor v)
Visits the content bounds of this layer.
|
addPropertyChangeListener, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, getViewProjectionBounds, hasColor, hookUpMapView, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setColor, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible, toString
addInvalidationListener, attachToMapView, createMapViewPainter, invalidate, removeInvalidationListener
private final java.lang.Runnable invalidator
public ValidatorLayer()
public javax.swing.Icon getIcon()
public void paint(java.awt.Graphics2D g, MapView mv, Bounds bounds)
paint
in interface MapViewPaintable
g
- Graphicsmv
- The object that can translate GeoPoints to screen coordinates.bounds
- Bounding boxpublic 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)
Layer
visitBoundingBox
in class Layer
v
- The visitor that gets notified about the contents of this layer.public java.lang.Object getInfoComponent()
Layer
getInfoComponent
in class Layer
Component
describing the layer.public javax.swing.Action[] getMenuEntries()
Layer
Layer.SeparatorLayerAction.INSTANCE
instead of new JSeparatorgetMenuEntries
in class Layer
public boolean isSavable()
Layer
public boolean checkSaveConditions()
Layer
checkSaveConditions
in class Layer
true
, if it is safe to save.public java.io.File createAndOpenSaveFileChooser()
Layer
createAndOpenSaveFileChooser
in class Layer
File
SaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)
public void layerOrderChanged(LayerManager.LayerOrderChangeEvent e)
LayerManager.LayerChangeListener
Listeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
layerOrderChanged
in interface LayerManager.LayerChangeListener
e
- The order change event.public void layerAdded(LayerManager.LayerAddEvent e)
LayerManager.LayerChangeListener
Listeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
layerAdded
in interface LayerManager.LayerChangeListener
e
- The new added layer eventpublic void layerRemoving(LayerManager.LayerRemoveEvent e)
layerRemoving
in interface LayerManager.LayerChangeListener
e
- The layer to be removed (as event)public LayerPositionStrategy getDefaultLayerPosition()
Layer
getDefaultLayerPosition
in class Layer
public void destroy()
Layer
destroy
in interface Destroyable
destroy
in class Layer
public java.lang.String getChangesetSourceTag()
Layer
getChangesetSourceTag
in class Layer
null