Class DivPoint

All Implemented Interfaces:
com.jbstrap.core.event.handlers.BrowserEventHandler, DelayedInit, LayerHideEventHandler, PopupDrawnEventHandler, PopupHideEventHandler, ContainerLayer<DivPoint>, TooltipLayer<DivPoint>

This class represents a Div component on the map with designated coordinates. Add further components to the Div component by using the methods of the ContainerLayer class. You can add a tooltip to the Div component. Read more about tooltip configuration in the TooltipLayer class.
Since:
4.0
See Also:
  • Constructor Details

    • DivPoint

      public DivPoint(String name, Coordinates coordinates)
      Creates a DivPoint that can be assigned to a point on the map with designated coordinates.
      Parameters:
      name - A unique ID that that identifies the layer in the LayerGroup
      coordinates - The upper left corner coordinates of the DivPoint
      Throws:
      NullPointerException - Thrown if the value of the name or coordinates parameter is null
  • Method Details

    • getCoordinates

      public Coordinates getCoordinates()
      Gets the upper left corner coordinates of the DivPoint.
      Returns:
      The upper left corner coordinates of the DivPoint
    • setCoordinates

      public DivPoint setCoordinates(Coordinates coordinates)
      Sets the upper left corner coordinates of the DivPoint.
      Parameters:
      coordinates - A Coordinates object that contains the longitude and latitude coordinates of the DivPoint's upper left corner
      Returns:
      DivPoint class instance
    • getWidth

      public Integer getWidth()
      Gets the DivPoint's width.
      Returns:
      DivPoint width
    • setWidth

      public DivPoint setWidth(Integer width)
      Sets the DivPoint's width.
      Parameters:
      width - DivPoint width in pixels
      Returns:
      DivPoint class instance
    • getHeight

      public Integer getHeight()
      Gets the DivPoint's height.
      Returns:
      DivPoint height
    • setHeight

      public DivPoint setHeight(Integer height)
      Sets the DivPoint height.
      Parameters:
      height - DivPoint height in pixels
      Returns:
      DivPoint class instance
    • getBorderStyle

      public BorderStyle getBorderStyle()
      Gets the DivPoint border style.
      Returns:
      DivPoint border style enum BorderStyle
    • setBorderStyle

      public DivPoint setBorderStyle(BorderStyle borderStyle)
      Sets the DivPoint border style.
      Parameters:
      borderStyle - DivPoint border style enum BorderStyle
      Returns:
      DivPoint class instance
    • getBorderRadius

      public int getBorderRadius()
      Gets the DivPoint border radius.
      Returns:
      DivPoint border radius
    • setBorderRadius

      public DivPoint setBorderRadius(int borderRadius)
      Sets the DivPoint border radius.
      Parameters:
      borderRadius - DivPoint border radius in pixels
      Returns:
      DivPoint class instance
    • getBorderLineColor

      public String getBorderLineColor()
      Gets the DivPoint border color.
      Returns:
      DivPoint border color
    • setBorderLineColor

      public DivPoint setBorderLineColor(String borderLineColor)
      Sets the DivPoint border color.
      Parameters:
      borderLineColor - DivPoint border color
      Returns:
      DivPoint class instance
    • getBorderLineWidth

      public int getBorderLineWidth()
      Gets the DivPoint border width
      Returns:
      DivPoint border width
    • setBorderLineWidth

      public DivPoint setBorderLineWidth(int borderLineWidth)
      Sets the DivPoint border width.
      Parameters:
      borderLineWidth - DivPoint border width in pixels
      Returns:
      DivPoint class instance
    • getFillColor

      public String getFillColor()
      Gets the DivPoint background color.
      Returns:
      DivPoint background color
    • setFillColor

      public DivPoint setFillColor(String fillColor)
      Sets the DivPoint border color.
      Parameters:
      fillColor - DivPoint background color
      Returns:
      DivPoint class instance
    • getOpacity

      public double getOpacity()
      Gets the DivPoint opacity value.
      Returns:
      DivPoint opacity
    • setOpacity

      public DivPoint setOpacity(double opacity)
      Sets the DivPoint opacity value.
      Parameters:
      opacity - DivPoint opacity between 0 and 1
      Returns:
      DivPoint class instance
    • getClassName

      public String getClassName()
      Gets the custom CSS class assigned to the DivPoint.
      Returns:
      DivPoint custom CSS class
    • setClassName

      public DivPoint setClassName(String className)
      Adds a custom CSS class to the DivPoint.
      Parameters:
      className - Custom CSS class
      Returns:
      DivPoint class instance
    • isShadow

      public boolean isShadow()
      Checks if the shadow is displayed on the DivPoint.
      Returns:
      If true, the shadow is displayed on the DivPoint Otherwise the shadow is not displayed.
    • setShadow

      public DivPoint setShadow(boolean shadow)
      Sets if there should be a shadow on the DivPoint. The default setting is that shadow is displayed on the DivPoint.
      Parameters:
      shadow - If true is specified, a shadow is displayed on the DivPoint If false, no shadow is displayed.
      Returns:
      DivPoint class instance
    • getAnchor

      public List<Integer> getAnchor()
      Gets the anchor (offset coordinates relative to the DivPoint).
      Returns:
      Horizontal and vertical anchor In the list, the first item is X and the second one is Y.
    • getAnchorX

      public Integer getAnchorX()
      Gets the horizontal anchor (offset coordinates relative to the DivPoint).
      Returns:
      Horizontal anchor
    • getAnchorY

      public Integer getAnchorY()
      Gets the vertical anchor (offset coordinates relative to the DivPoint).
      Returns:
      Vertical anchor
    • setAnchor

      public DivPoint setAnchor(Integer x, Integer y)
      Sets the anchor (offset coordinates relative to the DivPoint). If left unspecified, the default setting is that the DivPoint's horizontal offset is equal to the Div width (to the left) and the vertical offset is equal to the Div height (upwards).
      Parameters:
      x - Horizontal offset in pixels, calculated from the point designated with the coordinates
      y - Vertical offset in pixels, calculated from the point designated with the coordinates
      Returns:
      DivPoint class instance
    • getTooltipAnchor

      public List<Integer> getTooltipAnchor()
      Gets the tooltip anchor relative to the DivPoint coordinates.
      Returns:
      Horizontal and vertical anchor In the list, the first item is X and the second one is Y.
    • getTooltipAnchorX

      public int getTooltipAnchorX()
      Gets the horizontal tooltip anchor (offset coordinates relative to the DivPoint).
      Returns:
      Horizontal anchor
    • getTooltipAnchorY

      public int getTooltipAnchorY()
      Gets the vertical tooltip anchor (offset coordinates relative to the DivPoint).
      Returns:
      Vertical anchor
    • setTooltipAnchor

      public DivPoint setTooltipAnchor(int x, int y)
      Gets the tooltip anchor relative to the DivPoint coordinates.
      Parameters:
      x - Horizontal offset in pixels
      y - Vertical offset in pixels
      Returns:
      DivPoint class instance
    • getPopupAnchor

      public List<Integer> getPopupAnchor()
      Gets the popup anchor (offset coordinates relative to the DivPoint).
      Returns:
      Horizontal and vertical anchor In the list, the first item is X and the second one is Y.
    • getPopupAnchorX

      public int getPopupAnchorX()
      Gets the horizontal popup anchor (offset coordinates relative to the DivPoint).
      Returns:
      Horizontal anchor
    • getPopupAnchorY

      public int getPopupAnchorY()
      Gets the vertical popup anchor (offset coordinates relative to the DivPoint).
      Returns:
      Vertical anchor
    • setPopupAnchor

      public DivPoint setPopupAnchor(int x, int y)
      Sets the popup anchor (offset coordinates relative to the DivPoint).
      Parameters:
      x - Horizontal offset in pixels
      y - Vertical offset in pixels
      Returns:
      DivPoint class instance
    • onLayerDrawn

      public void onLayerDrawn(LayerDrawnEvent event)
      Registering the events for the DivPoint draw event in the DivPoint component.
      Specified by:
      onLayerDrawn in interface DelayedInit
      Parameters:
      event - A layer drawn event component
    • onLayerHide

      public void onLayerHide(LayerHideEvent event)
      Registering the events for the popup hide event in the popup component.
      Specified by:
      onLayerHide in interface LayerHideEventHandler
      Parameters:
      event - The popupPoint or divPoint hide event component
    • draw

      public DivPoint draw()
      Sets the DivPoint content.
      Specified by:
      draw in interface ContainerLayer<DivPoint>
      Returns:
      The layer class instance
    • onPopupDrawn

      public void onPopupDrawn(PopupDrawnEvent event)
      Registering the events for the popup draw event in the popup component.
      Specified by:
      onPopupDrawn in interface PopupDrawnEventHandler
      Parameters:
      event - The popup drawn event component
    • onPopupHide

      public void onPopupHide(PopupHideEvent event)
      Registering the events for the popup hide event in the popup component.
      Specified by:
      onPopupHide in interface PopupHideEventHandler
      Parameters:
      event - The popup hide event component