Interface Layer

    • Method Detail

      • getName

        java.lang.String getName()
        Gets the name of the layer.
        Returns:
        the name
      • setName

        void setName​(java.lang.String name)
        Sets the name for this layer.
        Parameters:
        name - the name of the layer
      • isVisible

        boolean isVisible()
        Checks whether this layer is currently visible.
        Returns:
      • setVisible

        void setVisible​(boolean v)
        Sets the visibility of this layer.
        Parameters:
        v -
      • clear

        void clear()
        Clears all contents of this layer.
      • handleEvent

        boolean handleEvent​(java.util.EventObject evt)
        The main method that performs event handling for this tool. Returns whether the event should be propagated to other layers down stream (further down the layer stack) after the event has been handled.
        Parameters:
        evt -
      • update

        void update​(long elapsedTime)
        updates the contents data model or structure.
        Parameters:
        elapsedTime - The elapsed time since last update.
      • render

        long render​(java.awt.Graphics2D g)
        Renders the layer contents to the given Graphics.
        Parameters:
        g - the graphics object
        Returns:
        the rendering time in milliseconds.
      • hitTest

        java.util.List<GeoObject> hitTest​(int x,
                                          int y,
                                          int granularity)
        Performs a hit test for the given mouse location (x,y). All the geo-objects that pass the hit test will be returned.
        Parameters:
        x - mouse location x
        y - mouse location y
        Returns:
        a list of features that pass the hit test; if no feature passes the hit test, the list is empty.
      • hitTest

        java.util.List<GeoObject> hitTest​(java.awt.geom.Rectangle2D box,
                                          int granularity)
        Performs a hit test for the given rectangle. All the geo-objects that are either inside or intersect the rectangle will be returned.
        Parameters:
        box - the test rectangle, in device coordinates
        Returns:
        a list of features that pass the box hit test; if no feature passes the hit test, the list is empty.
      • setCanvas

        void setCanvas​(MapCanvas parent)
        Sets the map canvas on which this layer is displayed.
      • getCanvas

        MapCanvas getCanvas()
        Gets the map canvas that this layer is displayed on.
      • mapRegionChanged

        void mapRegionChanged​(MapRegionEvent e)
        When the associated canvas's map region is changed, this method is called to notify the layer of the change. Note that either a device window change (as a result of resizing the application window) or a data window change can cause this method to be invoked. Query the canvas' MapRegion object to get the changed values. Inside a mapRegionChanged() implementation, the layer typically needs to update its data contents accordingly.
      • repaint

        void repaint()
        Tells the layer to repaint itself immediately. Typically called when a layer's rendering uses a buffered image, and that image might be in an inconsistent state or should be updated.
      • getIcon

        javax.swing.Icon getIcon()
      • getSRID

        int getSRID()
        Gets the SRID of the Layer, 0 if it doesn't have an associated SRID
        Returns:
      • setSRID

        void setSRID​(int srid)
        Sets the SRID of the Layer
      • getDataMBR

        java.awt.geom.Rectangle2D getDataMBR()
        Gets the minimum bounding rectangle of all the data in this layer.
      • getFullExtent

        java.awt.geom.Rectangle2D getFullExtent()
      • added

        void added​(java.lang.Object source)
        The function called when the layer is added to either a MapCanvas or an EditSession (typically both, MapCanvas first, EditSession later)
      • removed

        void removed​(java.lang.Object source)
        The function called when the layer is removed from either a MapCanvas or an EditSession (typically both, MapCanvas first, EditSession later)
      • toXMLElement

        org.w3c.dom.Element toXMLElement()
        Returns an XML representation of the layer
        Returns:
      • fromXMLElement

        void fromXMLElement​(org.w3c.dom.Element element)
        Loads the content from an XML representation
        Parameters:
        element -
      • getProviderID

        java.lang.String getProviderID()
        Returns the provider ID
        Returns:
      • setProviderID

        void setProviderID​(java.lang.String providerID)
        Sets the provider ID
        Parameters:
        providerID -