org.openstreetmap.josm.gui.layer
Class ValidatorLayer

java.lang.Object
  extended by org.openstreetmap.josm.gui.layer.Layer
      extended by org.openstreetmap.josm.gui.layer.ValidatorLayer
All Implemented Interfaces:
ProjectionChangeListener, MapViewPaintable, MapView.LayerChangeListener, Destroyable

public class ValidatorLayer
extends Layer
implements MapView.LayerChangeListener

A layer showing error messages.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
 
Field Summary
private  int updateCount
           
 
Fields inherited from class org.openstreetmap.josm.gui.layer.Layer
ICON_SIZE, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
 
Constructor Summary
ValidatorLayer()
           
 
Method Summary
 void activeLayerChange(Layer oldLayer, Layer newLayer)
          Notifies this listener that the active layer has changed.
 void destroy()
          Called, when the layer is removed from the mapview and is going to be destroyed.
 javax.swing.Icon getIcon()
          Return a static icon.
 java.lang.Object getInfoComponent()
           
 javax.swing.Action[] getMenuEntries()
          Returns list of actions.
 java.lang.String getToolTipText()
           
 boolean isChanged()
          Check changed status of layer
 boolean isMergable(Layer other)
           
 void layerAdded(Layer newLayer)
          Notifies this listener that a layer has been added.
 void layerRemoved(Layer oldLayer)
          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)
           
 
Methods inherited from class org.openstreetmap.josm.gui.layer.Layer
addPropertyChangeListener, checkSaveConditions, createAndOpenSaveFileChooser, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, hookUpMapView, isBackgroundLayer, isProjectionSupported, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

updateCount

private int updateCount
Constructor Detail

ValidatorLayer

public ValidatorLayer()
Method Detail

getIcon

public javax.swing.Icon getIcon()
Return a static icon.

Specified by:
getIcon in class Layer

paint

public 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). Draw nodes last to overlap the ways they belong to.

Specified by:
paint in interface MapViewPaintable
Specified by:
paint in class Layer
mv - The object that can translate GeoPoints to screen coordinates.

getToolTipText

public java.lang.String getToolTipText()
Specified by:
getToolTipText in class Layer
Returns:
A small tooltip hint about some statistics for this layer.

mergeFrom

public void mergeFrom(Layer from)
Description copied from class: Layer
Merges the given layer into this layer. Throws if the layer types are incompatible.

Specified by:
mergeFrom in class Layer
Parameters:
from - The layer that get merged into this one. After the merge, the other layer is not usable anymore and passing to one others mergeFrom should be one of the last things to do with a layer.

isMergable

public boolean isMergable(Layer other)
Specified by:
isMergable in class Layer
Parameters:
other - The other layer that is tested to be mergable with this.
Returns:
Whether the other layer can be merged into this layer.

isChanged

public boolean isChanged()
Description copied from class: Layer
Check changed status of layer

Overrides:
isChanged in class Layer
Returns:
True if layer was changed since last paint

visitBoundingBox

public void visitBoundingBox(BoundingXYVisitor v)
Specified by:
visitBoundingBox in class Layer

getInfoComponent

public java.lang.Object getInfoComponent()
Specified by:
getInfoComponent in class Layer

getMenuEntries

public javax.swing.Action[] getMenuEntries()
Description copied from class: Layer
Returns list of actions. Action can implement LayerAction interface when it needs to be represented by other menu component than JMenuItem or when it supports multiple layers. Actions that support multiple layers should also have correct equals implementation. Use SeparatorLayerAction.INSTANCE instead of new JSeparator

Specified by:
getMenuEntries in class Layer

destroy

public void destroy()
Description copied from class: Layer
Called, when the layer is removed from the mapview and is going to be destroyed. This is because the Layer constructor can not add itself safely as listener to the layerlist dialog, because there may be no such dialog yet (loaded via command line parameter).

Specified by:
destroy in interface Destroyable
Overrides:
destroy in class Layer

activeLayerChange

public void activeLayerChange(Layer oldLayer,
                              Layer newLayer)
Description copied from interface: MapView.LayerChangeListener
Notifies this listener that the active layer has changed.

Specified by:
activeLayerChange in interface MapView.LayerChangeListener
Parameters:
oldLayer - The previous active layer
newLayer - The new activer layer

layerAdded

public void layerAdded(Layer newLayer)
Description copied from interface: MapView.LayerChangeListener
Notifies this listener that a layer has been added.

Specified by:
layerAdded in interface MapView.LayerChangeListener
Parameters:
newLayer - The new added layer

layerRemoved

public void layerRemoved(Layer oldLayer)
If layer is the OSM Data layer, remove all errors

Specified by:
layerRemoved in interface MapView.LayerChangeListener
Parameters:
oldLayer - The old removed layer


JOSM