public class ValidatorLayer extends Layer implements LayerManager.LayerChangeListener
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 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.
|
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, getBaseColorProperty, getColorProperty, getName, getOpacity, getViewProjectionBounds, hookUpMapView, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible, toStringaddInvalidationListener, attachToMapView, createMapViewPainter, invalidate, removeInvalidationListenerprivate 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 MapViewPaintableg - Graphicsmv - The object that can translate GeoPoints to screen coordinates.bounds - Bounding boxpublic 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)
LayervisitBoundingBox in class Layerv - The visitor that gets notified about the contents of this layer.public java.lang.Object getInfoComponent()
LayergetInfoComponent in class LayerComponent describing the layer.public javax.swing.Action[] getMenuEntries()
LayerLayer.SeparatorLayerAction.INSTANCE instead of new JSeparatorgetMenuEntries in class Layerpublic boolean isSavable()
Layerpublic boolean checkSaveConditions()
LayercheckSaveConditions in class Layertrue, if it is safe to save.public java.io.File createAndOpenSaveFileChooser()
LayercreateAndOpenSaveFileChooser in class LayerFileSaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)public void layerOrderChanged(LayerManager.LayerOrderChangeEvent e)
LayerManager.LayerChangeListenerListeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
layerOrderChanged in interface LayerManager.LayerChangeListenere - The order change event.public void layerAdded(LayerManager.LayerAddEvent e)
LayerManager.LayerChangeListenerListeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
layerAdded in interface LayerManager.LayerChangeListenere - The new added layer eventpublic void layerRemoving(LayerManager.LayerRemoveEvent e)
layerRemoving in interface LayerManager.LayerChangeListenere - The layer to be removed (as event)public LayerPositionStrategy getDefaultLayerPosition()
LayergetDefaultLayerPosition in class Layerpublic void destroy()
Layerdestroy in interface Destroyabledestroy in class Layer