Class VectorLayer

All Implemented Interfaces:
JMapEventDispatcher, ILayer, IVectorLayer, LayerConstants, LayerNode, Shareable, Serializable, Cloneable, Comparable<Layer>
Direct Known Subclasses:
PersonalVectorLayer

public class VectorLayer extends Layer implements IVectorLayer, Shareable
A class that represents a layer of vector map elements. Map elements are instances of K2DElement. A vector layer has a tile set (TileSet) that actually contains the elements grouped together in tiles.
See Also:
  • Field Details

    • displayFilters

      protected Vector<DisplayFilter> displayFilters
    • queryFilters

      protected Vector<QueryFilter> queryFilters
    • tileSet

      protected TileSet tileSet
    • offset

      protected Point offset
      The offset is an instance of Point. Each element of the layer will be translated by the amount contained in the offset. It is used to keep double precision coordinates for the elements while using floats.
    • attribMetaData

      protected Attribute[] attribMetaData
    • mouseOverConfiguration

      protected MouseOverConfiguration mouseOverConfiguration
    • labelsConfig

      protected LabelsConfiguration labelsConfig
    • thematics

      protected Thematic[] thematics
    • selection

      protected Vector<K2DElement> selection
    • requestMode

      public int requestMode
    • queryFiltersChanged

      @Deprecated protected boolean queryFiltersChanged
      Deprecated.
      use invalidate() instead.
    • forms

      protected List<FormInfo> forms
    • subForms

      protected List<SubFormInfo> subForms
    • idAttributeName

      protected String idAttributeName
    • keyAttributeName

      protected String keyAttributeName
    • creationTimeColumnName

      protected String creationTimeColumnName
    • modificationTimeColumnName

      protected String modificationTimeColumnName
    • authorColumnName

      protected String authorColumnName
  • Constructor Details

    • VectorLayer

      public VectorLayer(VectorLayerInfo layerInfo)
      Creates a new VectorLayer using the specified VectorLayerInfo.
      Parameters:
      layerInfo - the new layer configuration.
    • VectorLayer

      @Deprecated public VectorLayer(int id, int geometryType, int elementType, String name, boolean isVisible)
      Deprecated.
      Creates a new VectorLayer using the specified parameters.
      The new layer will be configured with one infinite tile.
      Parameters:
      id - the id of the new layer.
      geometryType - the geometry type.
      elementType - the element type.
      name - the name.
      isVisible - whether this layer is visible.
    • VectorLayer

      public VectorLayer(int id, String name, int elementType)
      Creates a new VectorLayer using the specified parameters.
      The new layer will be configured with one infinite tile.
      Parameters:
      id - the id of the new layer.
      name - the name.
      elementType - the element type.
      See Also:
    • VectorLayer

      @Deprecated public VectorLayer(int id, int geometryType, int elementType, String name, boolean isVisible, int col, int row, Rectangle extent)
      Deprecated.
      Creates a new VectorLayer using the specified parameters.
      Parameters:
      id - the id of the new layer.
      geometryType - the geometry type.
      elementType - the element type.
      name - the name.
      isVisible - whether this layer is visible.
      col - the number of columns in the tiles grid.
      row - the number of rows in the tiles grid.
      extent - the layer extent.
    • VectorLayer

      public VectorLayer(int id, String name, int elementType, int col, int row, Rectangle extent)
      Creates a new VectorLayer using the specified parameters.
      Parameters:
      id - the id of the new layer.
      name - the name.
      elementType - the element type.
      col - the number of columns in the tiles grid.
      row - the number of rows in the tiles grid.
      extent - the layer extent.
      See Also:
  • Method Details

    • getAttributeMetaData

      public Attribute[] getAttributeMetaData()
      Returns bound attributes on this layer.
      Specified by:
      getAttributeMetaData in interface IVectorLayer
      Returns:
      an attribute of bound attributes. If there is no bound attribute, an empty non-null array is returned.
    • getAttributeIndex

      public int getAttributeIndex(Attribute attrib)
      Returns the index of the specified attribute in the current metadata attributes array.
      Parameters:
      attrib - the attribute to search in the metadata attributes.
      Returns:
      the index of the specified attribute, or -1 if the attribute was not found.
    • setAttributeMetaData

      public void setAttributeMetaData(Attribute[] attribMetaData)
      Replaces the current attribute array of the layer with the one specified.
      Specified by:
      setAttributeMetaData in interface IVectorLayer
      Parameters:
      attribMetaData - the new attribute table of the layer
    • getTiles

      public TileSet getTiles()
      Returns the TileSet object associated with the layer.
      Specified by:
      getTiles in interface IVectorLayer
      Returns:
      the tile set of the layer
      See Also:
    • getUpdateLock

      public LockManager getUpdateLock()
    • setTiles

      public void setTiles(TileSet tileSet)
      Sets the tile set for this layer.
      Specified by:
      setTiles in interface IVectorLayer
      Parameters:
      tileSet - the tile set
      See Also:
    • getThematics

      public Thematic[] getThematics()
      Return all thematics added to this layer. All thematics will be returned, including thematics which are not currently displayed.
      Specified by:
      getThematics in interface IVectorLayer
      Returns:
      all thematics added to this layer.
    • getThematic

      public Thematic getThematic(int id)
      Parameters:
      id -
      Returns:
      Since:
      7.0
    • getEnabledThematics

      public Thematic[] getEnabledThematics()
      Return an array of enabled thematic (displayed thematic).
      Returns:
      all enabled thematics in the layer.
    • setThematics

      public void setThematics(Thematic[] thematics)
      Sets all thematics of this layer.
      Specified by:
      setThematics in interface IVectorLayer
      Parameters:
      thematics - the thematics array to set
    • enableThematic

      public void enableThematic(int thematicIx, boolean isEnabled)
      Enables or disables a thematic configured in the current layer.
      Parameters:
      thematicIx - the index of the thematic.
      isEnabled - whether to enable it.
    • enableThematic

      public void enableThematic(Thematic thematic, boolean isEnabled)
      Enables or disables a thematic configured in the current layer.
      Parameters:
      thematic - the thematic to enable.
      isEnabled - whether to enable it.
    • enableThematics

      public void enableThematics(boolean isEnabled)
      Enables or disables all thematics configured in the current layer.
      Parameters:
      isEnabled - whether to enable them.
    • swapThematic

      public void swapThematic(Thematic thematic, int index)
      Moves a thematic to a specific position in the layer's thematics.
      Parameters:
      thematic - the thematic to move.
      index - the new index where the thematic has to move.
    • addThematic

      public void addThematic(Thematic thematic)
      Adds a thematic to this layer.
      Parameters:
      thematic - the thematic to add.
    • removeThematic

      public void removeThematic(Thematic thematic)
      Removes a thematic from this layer.
      Parameters:
      thematic - the thematic to remove.
    • draw

      public void draw(GraphicsRef gr, ViewState viewState, OrientedRectangle region, double scale, DrawParameters drawParameters)
      Draws all elements contained in the specified region to the specified graphics object and applying the specified transformation.
      Specified by:
      draw in class Layer
      Parameters:
      gr - the graphics wrapper object to use.
      viewState - the view state.
      region - the world coordinate region to redraw.
      scale - the scale of the current View.
      drawParameters - drawParameters to use.
      See Also:
    • draw

      protected void draw(GraphicsRef gr, ViewState viewState, Vector<Tile> tileVec, OrientedRectangle region, double scale, DrawParameters drawParameters)
      Draws all elements contained in the specified tiles and intersecting with the specified region to the specified graphics object and applying the specified transformation.
      Parameters:
      gr - the graphic reference to draw the elements.
      viewState - the view state that provides context information to draw the layer.
      tileVec - the vector containing the tiles to be drawn.
      region - the world coordinate region to redraw.
      scale - the scale of the current View.
      drawParameters - draw parameters to use.
      See Also:
    • draw

      @Deprecated protected void draw(GraphicsRef gr, ViewState viewState, Vector<Tile> tileVec, OrientedRectangle region, double scale, int drawOptions)
      Draws all elements contained in the specified tiles and intersecting with the specified region to the specified graphics object and applying the specified transformation.
      Parameters:
      gr - the graphic reference to draw the elements.
      viewState - the view state that provides context information to draw the layer.
      tileVec - the vector containing the tiles to be drawn.
      region - the world coordinate region to redraw.
      scale - the scale of the current View.
      drawOptions - draw options to use. Options can be retrieved with bitwise operations using LayerManager.DRAW_* constants.
      See Also:
    • requestUnsyncData

      public void requestUnsyncData(GraphicsRef gr, ViewState viewState, Vector<Tile> reqTiles, OrientedRectangle region)
    • prepareSyncData

      public void prepareSyncData(GraphicsRef gr, ViewState viewState, Vector<Tile> tileVec, OrientedRectangle region)
    • drawImpl

      @Deprecated protected void drawImpl(GraphicsRef gr, ViewState viewState, Vector<Tile> tileVec, OrientedRectangle region, double scale, int drawOptions)
    • drawImpl

      protected void drawImpl(GraphicsRef gr, ViewState viewState, Vector<Tile> tileVec, OrientedRectangle region, double scale, DrawParameters drawParameters)
    • drawGrid

      public void drawGrid(GraphicsRef gr, K2DTransform t)
      Draws a grid representing the tiles configuration of the layer.
      Specified by:
      drawGrid in class Layer
      Parameters:
      gr - the graphics wrapper to use.
      t - the transformation matrix of the view.
    • clone

      public Object clone()
      Returns a deep clone of the current LayerInfo instance.
      Specified by:
      clone in interface ILayer
      Specified by:
      clone in interface IVectorLayer
      Specified by:
      clone in interface LayerNode
      Specified by:
      clone in class Layer
      Returns:
      a clone of the current instance.
    • update

      public void update(ILayer layer)
      Overrides:
      update in class Layer
    • toLayerInfo

      public VectorLayerInfo toLayerInfo()
      Specified by:
      toLayerInfo in class Layer
    • share

      public Shareable share()
      Creates a deep copy of the current layer, excluding geometries in elements of the layer which remain the same instances in all shared layers.
      Specified by:
      share in interface Shareable
      Returns:
      the new instance of the shared layer.
    • cloneImpl

      protected void cloneImpl(IVectorLayer newLayer, boolean sharedGeometry)
      Share method implementation.
      Parameters:
      newLayer - the new shared layer.
    • getElementsInSurface

      @Deprecated public Enumeration<K2DElement> getElementsInSurface(Surface wcSurface, View view, boolean onlyIfVisible)
      Returns the enumeration of elements that are contained completely or partially in the specified world coordinate surface.
      Parameters:
      wcSurface - the world coordinate region to look into
      view - the view in which the test is done
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      the enumeration of contained elements
    • getElementsInSurface

      public Enumeration<K2DElement> getElementsInSurface(Surface wcSurface, ViewState viewState, boolean onlyIfVisible)
      Returns the enumeration of elements that are contained copmpletely or partially in the specified world coordinate surface.
      Parameters:
      wcSurface - the world coordinate region to look into
      viewState - the current view state.
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      the enumeration of contained elements
      Since:
      JMap 4.0
    • getElementsOnLine

      @Deprecated public Enumeration<K2DElement> getElementsOnLine(LineString wcLine, View view, boolean onlyIfVisible)
      Returns the enumeration of elements that are contained completely or partially on the specified world coordinate line.
      Parameters:
      wcLine - the world coordinate line to look onto
      view - the view in which the test is done
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      the enumeration of contained elements
    • getElementsOnLine

      public Enumeration<K2DElement> getElementsOnLine(LineString wcLine, ViewState viewState, boolean onlyIfVisible)
      Returns the enumeration of elements that are contained completely or partially on the specified world coordinate line.
      Parameters:
      wcLine - the world coordinate line to look onto
      viewState - the current view state.
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      the enumeration of contained elements
      Since:
      JMap 4.0
    • getElementsInCircle

      @Deprecated public Enumeration<K2DElement> getElementsInCircle(Point WCCoord, View view, double radius, boolean onlyIfVisible)
      Returns the enumeration of elements that are contained completely or partially in the specified world coordinate circle.
      Parameters:
      WCCoord - the center of the circle in world coordinate
      view - the view in which the test is done
      radius - the radius of the circle
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      the enumeration of contained elements
    • getElementsInCircle

      public Enumeration<K2DElement> getElementsInCircle(Point WCCoord, ViewState viewState, double radius, boolean onlyIfVisible)
      Returns the enumeration of elements that are contained completely or partially in the specified world coordinate circle.
      Parameters:
      WCCoord - the center of the circle in world coordinate
      viewState - the current view state.
      radius - the radius of the circle
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      the enumeration of contained elements
      Since:
      JMap 4.0
    • getElementsAtPoint

      @Deprecated public Enumeration<K2DElement> getElementsAtPoint(Point WCCoord, View view, boolean onlyIfVisible)
      Returns all the elements found at the specified point in world coordinate system or null if none is found.
      Parameters:
      WCCoord - the coordinate where to look for elements
      view - the view in which the test is done
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      all the elements found at the specified point.
    • getElementsAtPoint

      public Enumeration<K2DElement> getElementsAtPoint(Point WCCoord, ViewState viewState, boolean onlyIfVisible)
      Returns all the elements found at the specified point in world coordinate system or null if none is found.
      Parameters:
      WCCoord - the coordinate where to look for elements
      viewState - the current view state.
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      an enumeration of all the elements found at the specified point
      Since:
      JMap 4.0
    • getElementAtPoint

      @Deprecated public K2DElement getElementAtPoint(Point WCCoord, View view, boolean onlyIfVisible)
      Returns the first element found at the specified point in world coordinate system or null if none is found.
      Parameters:
      WCCoord - the coordinate where to look for elements
      view - the view in which the test is done
      onlyIfVisible - specifies whether only a visible element should be returned.
      Returns:
      the first visible element found at the specified point.
    • getElementAtPoint

      public K2DElement getElementAtPoint(Point WCCoord, ViewState viewState, boolean onlyIfVisible)
      Returns the first element found at the specified point in world coordinate system or null if none is found.
      Parameters:
      WCCoord - the coordinate where to look for elements
      viewState - the current view state.
      onlyIfVisible - specifies whether only a visible element should be returned.
      Returns:
      the first visible element found at the specified point.
      Since:
      JMap 4.0
    • addElement

      public void addElement(K2DElement elem)
      Adds the specified element to the layer and then fires a LayerElementsAddedEvent.
      Parameters:
      elem - the element to add
      See Also:
    • addElement

      public void addElement(K2DElement element, boolean fireEvent)
      Adds the specified element (K2DElement) to the layer.
      Parameters:
      element - the element to add
      fireEvent - indicates whether a LayerElementsAddedEvent is fired
      See Also:
    • addElements

      public void addElements(K2DElement[] elements)
      Adds the specified elements to the layer and then fires a LayerElementsAddedEvent.
      Parameters:
      elements - the elements to add
      See Also:
    • addElements

      public void addElements(K2DElement[] elements, boolean fireEvent)
      Adds the specified elements (K2DElement) to the layer.
      Parameters:
      elements - the elements to add
      fireEvent - indicates whether a LayerElementsAddedEvent is fired
      See Also:
    • fireElementsAddedEvent

      protected void fireElementsAddedEvent(K2DElement[] elements)
    • fireElementsChangedEvent

      public void fireElementsChangedEvent(K2DElement[] elements)
    • validateTiling

      public void validateTiling(K2DElement[] elements)
    • removeElement

      public boolean removeElement(K2DElement elem)
      Removes the specified element (K2DElement) from the layer.
      Parameters:
      elem - the element to remove
      Returns:
      true if the element was properly removed, false otherwise.
      See Also:
    • removeElement

      public boolean removeElement(K2DElement elem, boolean fireEvent)
      Removes the specified element (K2DElement) from the layer.
      Parameters:
      elem - the element to remove
      fireEvent - indicates whether an event should be fired after removing the element
      Returns:
      true if the element was properly removed, false otherwise.
      See Also:
    • removeElements

      public boolean removeElements(K2DElement[] aElements)
      Removes the specified elements from the layer.
      Parameters:
      aElements - the element to remove
      Returns:
      true if one of the elements was properly removed, false otherwise.
      See Also:
    • removeElements

      public boolean removeElements(K2DElement[] aElements, boolean fireEvent)
      Removes the specified elements from the layer.
      Parameters:
      aElements - the elements to remove
      fireEvent - indicates whether an event should be fired after removing the elements
      Returns:
      true if one of the elements was properly removed, false otherwise.
      See Also:
    • removeElement

      public boolean removeElement(long elemId)
      Removes the element that has the specified id from the layer.
      Parameters:
      elemId - the id of the element to be removed.
      Returns:
      true if the element was properly removed false otherwise.
    • removeElement

      public boolean removeElement(long elemId, boolean fireEvent)
      Removes the element that has the specified id from the layer.
      Parameters:
      elemId - the id of the element to be removed.
      fireEvent - indicates whether an event should be fired after removing the element
      Returns:
      true if the element was properly removed false otherwise.
    • fireElementRemovedEvent

      protected void fireElementRemovedEvent(K2DElement[] elements)
    • getElementCount

      public int getElementCount()
      Returns the number of elements contained by the layer. The element filters don't influence the result.
      Returns:
      the number of elements contained by the layer
    • removeAllElements

      public void removeAllElements()
      Removes all the elements from this layer and fires an fireElementRemovedEvent event.
    • removeAllElements

      public void removeAllElements(boolean fireEvent)
      Removes all the elements from this layer.
      Parameters:
      fireEvent - if a fireElementRemovedEvent has to be fired
    • getElementLabel

      public String getElementLabel(K2DElement elem)
      Returns the label string from the layer label column for the specified element.
      Parameters:
      elem - the element for which the label string must be returned
      Returns:
      the label string for the specified element
    • getElementLabel

      public String getElementLabel(K2DElement elem, Project project)
      Returns the label string from the layer label column for the specified element.
      Parameters:
      elem - the element for which the label string must be returned
      project - the project related to the specified element
      Returns:
      the label string for the specified element
    • getAllElements

      @Deprecated public K2DElement[] getAllElements()
      Deprecated.
      use getElements() instead
      Returns:
      An array containing all elements present on the layer and that pass the display filters of the layer..
    • getElements

      public Collection<K2DElement> getElements()
      Returns:
      A collection containing all the elements present on the layer and that pass the display filters of the layer.
    • getElement

      public K2DElement getElement(long id)
      Returns the element having the specified id or null if it does not exist. This method is slower than getElement(int tileIx, int elemIx) because it has to scan the elements.
      Parameters:
      id - the id of the element to retrieve.
      Returns:
      the element having the specified id, null if none was found.
    • getElement

      public K2DElement getElement(int tileIx, int elemIx)
      Returns the element contained in the specified tile at the specified position. The filters re applied.
      Parameters:
      tileIx - specifies the tile that is supposed to contain the requested element
      elemIx - specifies the element position in the tile
      Returns:
      the requested element or null if it is not found
    • addToSelection

      public void addToSelection(K2DElement elem)
      Adds the specified element to the selection of the layer. Fires a LayerSelChangedEvent.
      Parameters:
      elem - the element to add to the selection.
      See Also:
    • addToSelection

      public void addToSelection(K2DElement elem, boolean fireEvent)
      Adds the specified element to the selection of the layer. Fires a LayerSelChangedEvent.
      Parameters:
      elem - the element to add to the selection.
      fireEvent - whether to fire the selection event.
      See Also:
    • addToSelection

      public void addToSelection(Collection<K2DElement> elems)
      Adds the specified elements to the selection of the layer. Fires a LayerSelChangedEvent.
      Parameters:
      elems - the elements to add to the selection.
      See Also:
    • addToSelection

      public void addToSelection(Collection<K2DElement> elems, boolean fireEvent)
      Adds the specified elements to the selection of the layer. Fires a LayerSelChangedEvent.
      Parameters:
      elems - the elements to add to the selection.
      fireEvent - whether to fire the selection event.
      See Also:
    • getSelection

      public Collection<K2DElement> getSelection()
      Gets the selected elements
      Returns:
      an Enumeration of the selected elements of the layer.
    • getSelectedElements

      public K2DElement[] getSelectedElements()
      Gets the selected elements
      Returns:
      an Array of the selected elements of the layer.
    • getSelectionSize

      public int getSelectionSize()
      Gets the selection count
      Returns:
      the number of selected elements of the layer.
    • getDefaultSelectionStyle

      public Style getDefaultSelectionStyle()
      Gets the default selection style
      Returns:
      the style of selected elements of the layer.
    • getDisplaySelectedBounds

      @Deprecated public Rectangle getDisplaySelectedBounds(View view)
      Returns the DC bounding box of the current selection of the layer.
      Parameters:
      view - the view to use when calculating the bounding box.
      Returns:
      the bounding box of the selection or null if no elements are selected
    • getDisplaySelectedBounds

      public Rectangle getDisplaySelectedBounds(ViewState viewState)
      Returns the DC bounding box of the current selection of the layer.
      Parameters:
      viewState - the current view state.
      Returns:
      the bounding box of the selection or null if no elements are selected
      Since:
      JMap 4.0
    • getDisplaySelectedBounds

      public Rectangle getDisplaySelectedBounds(ViewState viewState, boolean zoomed)
      Returns the DC bounding box of the current selection of the layer.
      Parameters:
      viewState - the current view state.
      zoomed - defines if display selected bounds should be computed with the transformation matrix scaled at the geometry extent (zoomed) or at the current scale (not zoomed).
      Returns:
      the bounding box of the selection or null if no elements are selected
      Since:
      JMap 4.0.2
    • drawSelection

      public void drawSelection(GraphicsRef gr, ViewState viewState, double scale)
      Draws the selected elements of the layer.
      Parameters:
      gr - the Graphics wrapper object used to draw the selected elements
      viewState - the view state
      scale - the scale of the current View.
    • clearSelection

      public void clearSelection()
      Empties the selection of the layer. Fires a LayerSelChangedEvent.
      See Also:
    • invertSelection

      public void invertSelection()
      Inverts the selection on this layer. All selected elements get unselected while all unselected elements become selected. Fires selection events.
    • selectAll

      public void selectAll()
    • unselectElement

      @Deprecated public void unselectElement(K2DElement elem)
      Deprecated.
      Use removeFromSelection(K2DElement) instead.
      Removes the specified element from the selection of the layer. Fires a LayerSelChangedEvent.
      Parameters:
      elem - the element to remove from the selection
      See Also:
    • removeFromSelection

      public void removeFromSelection(K2DElement elem)
      Removes the specified element from the selection of the layer. Fires a LayerSelChangedEvent.
      Parameters:
      elem - the element to remove from the selection
      See Also:
    • unselectElement

      @Deprecated public void unselectElement(K2DElement elem, boolean fireEvent)
      Deprecated.
      Use removeFromSelection(K2DElement, boolean) instead.
      Removes the specified element from the selection of the layer. Fires a LayerSelChangedEvent if the specified boolean parameter is true..
      Parameters:
      elem - the element to remove from the selection
      fireEvent - whether to fire a layer selection event.
      See Also:
    • removeFromSelection

      public void removeFromSelection(K2DElement elem, boolean fireEvent)
      Removes the specified element from the selection of the layer. Fires a LayerSelChangedEvent if the specified boolean parameter is true.
      Parameters:
      elem - the element to remove from the selection
      fireEvent - whether to fire a layer selection event.
      See Also:
    • removeFromSelection

      public void removeFromSelection(Vector<K2DElement> elements, boolean fireEvent)
      Removes the specified elements from the selection of the layer. Fires a LayerSelChangedEvent if the specified boolean parameter is true.
      Parameters:
      elements - the elements to remove from the selection
      fireEvent - whether to fire a layer selection event.
      See Also:
    • removeFromSelection

      public void removeFromSelection(Vector<K2DElement> elements)
      Removes the specified elements from the selection of the layer. Fires a LayerSelChangedEvent.
      Parameters:
      elements - the elements to remove from the selection
      See Also:
    • fireDataRequestedEvent

      protected void fireDataRequestedEvent(OrientedRectangle region, boolean sync)
    • fireDataRequestedEvent

      protected void fireDataRequestedEvent(Vector<Tile> reqTiles, boolean sync)
    • fireSelChangedEvent

      protected void fireSelChangedEvent(Vector<K2DElement> elems, int operType)
    • fireSelChangedEvent

      protected void fireSelChangedEvent(K2DElement elem, int operType)
    • fireDisplayFilterChangedEvent

      protected void fireDisplayFilterChangedEvent(LayerDisplayFilterChangedEvent event)
    • fireAttributeMetadataChangedEvent

      protected void fireAttributeMetadataChangedEvent(LayerAttributeMetadataChangedEvent event)
    • fireQueryfilterChangedEvent

      protected void fireQueryfilterChangedEvent(LayerQueryFilterChangedEvent event)
    • addQueryFilter

      public void addQueryFilter(QueryFilter filter)
      Adds a new query filter to the list of filters for the layer.
      Parameters:
      filter - the filter to add
    • removeQueryFilter

      public void removeQueryFilter(QueryFilter filter)
      Removes the specified query filter from the list of filters for the layer.
      Parameters:
      filter - the filter to remove
    • getQueryFilters

      public QueryFilter[] getQueryFilters()
      Returns:
      an array containing the current query filters for the layer
    • removeAllQueryFilters

      public void removeAllQueryFilters()
      Remove all query filters from the layer
    • addDisplayFilter

      public void addDisplayFilter(DisplayFilter filter)
      Adds a new filter to the list of display filters for the layer. Filters are applied in the order they are added.
      Parameters:
      filter - the filter to add
    • removeDisplayFilter

      public void removeDisplayFilter(DisplayFilter filter)
      Removes the specified filter from the list of display filters for the layer.
      Parameters:
      filter - the filter to remove
    • getDisplayFilters

      public DisplayFilter[] getDisplayFilters()
      Returns:
      an array containing the current display filters for the layer
    • removeAllDisplayFilters

      public void removeAllDisplayFilters()
      Remove all display filters from the layer
    • applyFilters

      public boolean applyFilters(K2DElement elem)
      Returns whether the specified element was accepted by the current display filters configured in the layer.
      Parameters:
      elem - the element to test.
      Returns:
      whether the element should be displayed.
    • alwayDrawSelection

      public boolean alwayDrawSelection()
      Returns whether the layer selection will always be drawn.
      If enabled, the selection will be drawn at any scale, even if the layer is not visible.
      Returns:
      a boolean that specifies if the layer selection will always be drawn
    • setAlwayDrawSelection

      public void setAlwayDrawSelection(boolean isTrue)
      Enables layer selection to always be drawn.
      If enabled, the selection will be drawn at any scale, even if the layer is not visible.
      Parameters:
      isTrue - a boolean value
    • getExtent

      public Rectangle getExtent()
      Returns a clone of the layer extent.
      Specified by:
      getExtent in interface ILayer
      Specified by:
      getExtent in class Layer
      Returns:
      the layer extent.
    • getSelectedExtent

      public Rectangle getSelectedExtent()
      Returns the extent created from selected element geometries in the current layer.
      Returns:
      the bounding box of the selected element geometries in the layer.
    • computeExtent

      public Rectangle computeExtent(Collection<K2DElement> elements)
    • computeDisplayBounds

      public Rectangle computeDisplayBounds(ViewState viewState, Collection<K2DElement> elements, boolean onlyIfVisible)
    • computeZoomedDisplayBounds

      public Rectangle computeZoomedDisplayBounds(ViewState viewState, Collection<K2DElement> elements, boolean onlyIfVisible)
    • setOffset

      public void setOffset(Point offset)
      Sets the Offset
      Specified by:
      setOffset in interface IVectorLayer
      Parameters:
      offset - the corresponding offset
    • getOffset

      public Point getOffset()
      Gets the offset
      Specified by:
      getOffset in interface IVectorLayer
      Returns:
      the offset of the layer
    • getUseClientCache

      public boolean getUseClientCache()
      Gets the useClientCache boolean flag
      Specified by:
      getUseClientCache in interface IVectorLayer
      Returns:
      true if the use of cache on the client is enabled, false otherwise
    • setUseClientCache

      public void setUseClientCache(boolean flag)
      Sets useClientCache boolean flag
      Specified by:
      setUseClientCache in interface IVectorLayer
      Parameters:
      flag - the boolean value to be set.
    • getOffsetTransform

      public K2DTransform getOffsetTransform(K2DTransform t)
      Gets the offset transformation matrix
      Parameters:
      t - the transformation that is applied
      Returns:
      the new transformation matrix that also translates the elements by the offset
      See Also:
    • close

      public void close()
      Clears all elements in the layer and removes all configured listeners.
      Specified by:
      close in class Layer
    • setEditing

      public void setEditing(boolean flag)
    • isEditing

      public boolean isEditing()
    • setEditable

      public void setEditable(boolean editable)
      Adds or removes edition permissions on the layer: Permission.ADD_LAYER_ELEMENT, Permission.EDIT_LAYER_ELEMENT, Permission.DELETE_LAYER_ELEMENT and Permission.EDIT_LAYER_ATTRIBUTE_VALUES.
      Parameters:
      editable - whether this layer is editable.
    • isEditable

      public boolean isEditable()
      Returns whether this layer is editable.
      Specified by:
      isEditable in interface IVectorLayer
      Returns:
      the boolean value whether this layer is editable.
    • sendToBack

      public void sendToBack(K2DElement[] elements)
      Moves the specified elements to the lowest z order position. Only allowed on layers with the universe tile as the only tile.
      Parameters:
      elements - the elements to send to back
    • bringToFront

      public void bringToFront(K2DElement[] elements)
      Moves the specified elements to the highest z order position. Only allowed on layers with the universe tile as the only tile.
      Parameters:
      elements - the elements to bring to front
    • bringForward

      public void bringForward(K2DElement[] elements)
      Moves the specified elements one z order position up. Only allowed on layers with the universe tile as the only tile.
      Parameters:
      elements - the elements to bring forward
    • sendBackward

      public void sendBackward(K2DElement[] elements)
      Moves the specified elements one z order position down. Only allowed on layers with the universe tile as the only tile.
      Parameters:
      elements - the elements to send backward
    • getStyle

      public Style getStyle(K2DElement elem, double scale)
      Returns the current style for the specified element. The current style is based on the element selection state, enabled thematics in the layer and the specified scale.
      If the specified element has no style for any enabled thematics in the layer, null is returned.
      Parameters:
      elem - the element.
      scale - the current scale of the view.
      Returns:
      the current element style. If the element should not be drawn, null is returned.
    • getSelectionStyle

      public Style getSelectionStyle(K2DElement elem, double scale)
      Returns the current selection style for the specified element. The selection style is based on enabled thematics in the layer and the specified scale.
      If the specified element has no style for any enabled thematics in the layer, null is returned.
      Parameters:
      elem - the element.
      scale - the current scale.
      Returns:
      the current selection element style. If the element should not be drawn, null is returned.
    • getSelectionStyle

      public Style getSelectionStyle()
      Returns the default selection style object associated with the layer.
      Note: If this layer has more than one style (depending on the view scale), the lowest scale selection style is returned.
      If the layer is editable, the default edition style of the layer will be returned.
      Overrides:
      getSelectionStyle in class Layer
      Returns:
      the default selection style of the layer
      See Also:
    • getSelectionStyle

      public Style getSelectionStyle(double scale)
      Returns the selection style object associated with the layer for the specified scale.
      If the layer is editable, the edition style of the layer corresponding to the specified scale will be returned.
      Overrides:
      getSelectionStyle in class Layer
      Parameters:
      scale - the scale of the current View.
      Returns:
      the selection style of the layer for the specified scale.
      See Also:
    • getRequestMode

      public int getRequestMode()
      Description copied from class: Layer
      Returns the request mode for this layer. The request mode can be either by tile (REQUEST_MODE_TILE) or by random region (REQUEST_MODE_REGION). When using requests by tile, predimensionned tiles are exchanged between JMapServer and the client application. When using requests by region, random regions of data are exchanged depending on the region the user is viewing. Requests by tiles are generally more performant because they allow caching on the server and client sides. Requests by region are useful when data must always be up-to-date, as it will be requested each time from the spatial data source.
      Specified by:
      getRequestMode in interface IVectorLayer
      Specified by:
      getRequestMode in class Layer
      Returns:
      the current request mode in use by this layer.
    • setRequestMode

      public void setRequestMode(int requestMode)
      Sets the request mode for this layer.
      Specified by:
      setRequestMode in interface IVectorLayer
      Parameters:
      requestMode - the request mode to use ( LayerInfo.REQUEST_MODE_BY_TILE or LayerInfo.REQUEST_MODE_BY_REGION).
    • getLabelsConfig

      public LabelsConfiguration getLabelsConfig()
      Returns the labels configuration for this layer.
      Specified by:
      getLabelsConfig in interface IVectorLayer
      Returns:
      the labels configuration.
    • setLabelsConfig

      public void setLabelsConfig(LabelsConfiguration labelsConfig)
      Sets the labels configuration for this layer.
      Specified by:
      setLabelsConfig in interface IVectorLayer
      Parameters:
      labelsConfig - the label configuration.
    • getHyperlinks

      public Hyperlink[] getHyperlinks()
      Specified by:
      getHyperlinks in interface IVectorLayer
    • setHyperlinks

      public void setHyperlinks(Hyperlink[] hyperlinks)
      Specified by:
      setHyperlinks in interface IVectorLayer
    • setLastTransform

      @Deprecated public void setLastTransform(K2DTransform t, GraphicsRef gr)
      Deprecated.
      Sets the last view transformation matrix that was used to draw the layer.
      Parameters:
      t - the view transformation matrix.
      gr - the view graphics reference instance.
      See Also:
    • loadData

      public void loadData(Geometry bounds, boolean sync)
      This method automatically loads the data tiles intersecting with the specified geometry.
      Specified by:
      loadData in class Layer
      Parameters:
      bounds - the geometry used to delimit the bounds of the data to load
      sync - whether his method is blocking (true) or non blocking (false)
    • getMouseOverConfiguration

      public MouseOverConfiguration getMouseOverConfiguration()
      Specified by:
      getMouseOverConfiguration in interface IVectorLayer
      Returns:
      the mouse over configuration
    • setMouseOverConfiguration

      public void setMouseOverConfiguration(MouseOverConfiguration mouseOverConfiguration)
      Specified by:
      setMouseOverConfiguration in interface IVectorLayer
      Parameters:
      mouseOverConfiguration -
    • getForms

      public List<FormInfo> getForms()
      Specified by:
      getForms in interface IVectorLayer
    • setForms

      public void setForms(List<FormInfo> forms)
      Specified by:
      setForms in interface IVectorLayer
    • getSubForms

      public List<SubFormInfo> getSubForms()
      Specified by:
      getSubForms in interface IVectorLayer
    • setSubForms

      public void setSubForms(List<SubFormInfo> subForms)
      Specified by:
      setSubForms in interface IVectorLayer
    • getForm

      public AbstractFormInfo getForm(int id)
      Returns the form or subfom with the specified id.
      Parameters:
      id -
      Returns:
    • hasElementsInSurface

      public boolean hasElementsInSurface(Surface wcSurface, ViewState viewState, boolean onlyIfVisible)
      Returns whether at least one element is contained completely or partially in the specified world coordinate surface.
      Parameters:
      wcSurface - the world coordinate region to look into
      viewState - the current view state.
      onlyIfVisible - specifies whether only visible elements should be returned.
      Returns:
      true if the specified surface contains elements, false otherwise
      Since:
      JMap 4.0.2
    • getAcl

      public final Acl getAcl()
      Specified by:
      getAcl in interface IVectorLayer
      Returns:
      acl for VectorLayers
    • setAcl

      public final void setAcl(Acl acl)
      Specified by:
      setAcl in interface IVectorLayer
      Parameters:
      acl - for VectorLayers
    • invalidate

      public void invalidate()
      Invalidates the current layer. NOTE: This does not invalidate the DiskCache. To invalidate the disk cache, call the invalidateLayer method of the LayerManager containing the layer
      Overrides:
      invalidate in class Layer
      Since:
      6.5
    • getDisplayStrategyManager

      public VectorDisplayStrategyManager getDisplayStrategyManager()
    • getHeatMapDisplayStrategyInfo

      public HeatMapDisplayStrategyInfo getHeatMapDisplayStrategyInfo()
      Specified by:
      getHeatMapDisplayStrategyInfo in interface IVectorLayer
    • setHeatMapDisplayStrategyInfo

      public void setHeatMapDisplayStrategyInfo(HeatMapDisplayStrategyInfo heatMapDisplayStrategyInfo)
      Specified by:
      setHeatMapDisplayStrategyInfo in interface IVectorLayer
    • getClusterDisplayStrategyInfo

      public ClusterDisplayStrategyInfo getClusterDisplayStrategyInfo()
      Specified by:
      getClusterDisplayStrategyInfo in interface IVectorLayer
    • setClusterDisplayStrategyInfo

      public void setClusterDisplayStrategyInfo(ClusterDisplayStrategyInfo clusterDisplayStrategyInfo)
      Specified by:
      setClusterDisplayStrategyInfo in interface IVectorLayer