Class ValidatorLayer

    • Field Detail

      • invalidator

        private final java.lang.Runnable invalidator
    • Constructor Detail

      • ValidatorLayer

        public ValidatorLayer()
        Constructs a new Validator layer
    • Method Detail

      • getIcon

        public javax.swing.Icon getIcon()
        Return a static icon.
        Specified by:
        getIcon in class Layer
        Returns:
        layer icon
      • 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
        Parameters:
        g - Graphics
        mv - The object that can translate GeoPoints to screen coordinates.
        bounds - Bounding box
      • getToolTipText

        public java.lang.String getToolTipText()
        Description copied from class: Layer
        Returns a small tooltip hint about some statistics for this layer.
        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)
        Description copied from class: Layer
        Determines if the other layer can be merged into this layer.
        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.
      • visitBoundingBox

        public void visitBoundingBox​(BoundingXYVisitor v)
        Description copied from class: Layer
        Visits the content bounds of this layer. The behavior of this method depends on the layer, but each implementation should attempt to cover the relevant content of the layer in this method.
        Specified by:
        visitBoundingBox in class Layer
        Parameters:
        v - The visitor that gets notified about the contents of this layer.
      • getInfoComponent

        public java.lang.Object getInfoComponent()
        Description copied from class: Layer
        Gets the layer information to display to the user. This is used if the user requests information about this layer. It should display a description of the layer content.
        Specified by:
        getInfoComponent in class Layer
        Returns:
        Either a String or a Component describing the 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 Layer.SeparatorLayerAction.INSTANCE instead of new JSeparator

        Specified by:
        getMenuEntries in class Layer
        Returns:
        menu actions for this layer
      • isSavable

        public boolean isSavable()
        Description copied from class: Layer
        Replies the savable state of this layer (i.e., if it can be saved through a "File → Save" dialog).
        Overrides:
        isSavable in class Layer
        Returns:
        true if this layer can be saved to a file
      • checkSaveConditions

        public boolean checkSaveConditions()
        Description copied from class: Layer
        Checks whether it is ok to launch a save (whether we have data, there is no conflict etc.)
        Overrides:
        checkSaveConditions in class Layer
        Returns:
        true, if it is safe to save.
      • 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 cannot add itself safely as a 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