Package com.jbstrap.jbmap.layers.layer
Class DivPoint
- All Implemented Interfaces:
com.jbstrap.core.event.handlers.BrowserEventHandler
,DelayedInit
,LayerHideEventHandler
,PopupDrawnEventHandler
,PopupHideEventHandler
,ContainerLayer<DivPoint>
,TooltipLayer<DivPoint>
public class DivPoint
extends BaseLayer<DivPoint>
implements ContainerLayer<DivPoint>, DelayedInit, LayerHideEventHandler, PopupDrawnEventHandler, PopupHideEventHandler, 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:
-
Field Summary
Fields inherited from class com.jbstrap.jbmap.layers.BaseLayer
COORDINATES, layerStyle, NAME, POINT, POINT_TYPE, popup, POPUP_CONTENT, POPUP_ENABLED, POPUP_OPENED, TYPE
Fields inherited from class com.jbstrap.jbmap.layers.Layer
componentContent, params, parent
Fields inherited from interface com.jbstrap.jbmap.layers.TooltipLayer
TOOLTIP_CONTENT, TOOLTIP_ENABLED, TOOLTIP_OPENED
-
Constructor Summary
ConstructorDescriptionDivPoint
(String name, Coordinates coordinates) Creates a DivPoint that can be assigned to a point on the map with designated coordinates. -
Method Summary
Modifier and TypeMethodDescriptiondraw()
Sets the DivPoint content.Gets the anchor (offset coordinates relative to the DivPoint).Gets the horizontal anchor (offset coordinates relative to the DivPoint).Gets the vertical anchor (offset coordinates relative to the DivPoint).Gets the DivPoint border color.int
Gets the DivPoint border widthint
Gets the DivPoint border radius.Gets the DivPoint border style.Gets the custom CSS class assigned to the DivPoint.Gets the upper left corner coordinates of the DivPoint.Gets the DivPoint background color.Gets the DivPoint's height.double
Gets the DivPoint opacity value.Gets the popup anchor (offset coordinates relative to the DivPoint).int
Gets the horizontal popup anchor (offset coordinates relative to the DivPoint).int
Gets the vertical popup anchor (offset coordinates relative to the DivPoint).Gets the tooltip anchor relative to the DivPoint coordinates.int
Gets the horizontal tooltip anchor (offset coordinates relative to the DivPoint).int
Gets the vertical tooltip anchor (offset coordinates relative to the DivPoint).getWidth()
Gets the DivPoint's width.boolean
isShadow()
Checks if the shadow is displayed on the DivPoint.void
onLayerDrawn
(LayerDrawnEvent event) Registering the events for the DivPoint draw event in the DivPoint component.void
onLayerHide
(LayerHideEvent event) Registering the events for the popup hide event in the popup component.void
onPopupDrawn
(PopupDrawnEvent event) Registering the events for the popup draw event in the popup component.void
onPopupHide
(PopupHideEvent event) Registering the events for the popup hide event in the popup component.Sets the anchor (offset coordinates relative to the DivPoint).setBorderLineColor
(String borderLineColor) Sets the DivPoint border color.setBorderLineWidth
(int borderLineWidth) Sets the DivPoint border width.setBorderRadius
(int borderRadius) Sets the DivPoint border radius.setBorderStyle
(BorderStyle borderStyle) Sets the DivPoint border style.setClassName
(String className) Adds a custom CSS class to the DivPoint.setCoordinates
(Coordinates coordinates) Sets the upper left corner coordinates of the DivPoint.setFillColor
(String fillColor) Sets the DivPoint border color.Sets the DivPoint height.setOpacity
(double opacity) Sets the DivPoint opacity value.setPopupAnchor
(int x, int y) Sets the popup anchor (offset coordinates relative to the DivPoint).setShadow
(boolean shadow) Sets if there should be a shadow on the DivPoint.setTooltipAnchor
(int x, int y) Gets the tooltip anchor relative to the DivPoint coordinates.Sets the DivPoint's width.Methods inherited from class com.jbstrap.jbmap.layers.BaseLayer
addClickHandler, addCustomParam, addMouseOutHandler, addMouseOverHandler, closePopup, getClickHandlers, getCustomParams, getGeometry, getMouseOutHandlers, getMouseOverHandlers, getName, getParams, getParent, getPopup, getPopupContent, getProperties, getTitle, hide, isPopupEnabled, isShown, openPopup, removeClickHandler, removeCustomParam, removeMouseOutHandler, removeMouseOverHandler, runJSLayer, runJSLayerGroup, setCoordinates, setCustomParams, setParent, setPopupContent, setPopupEnabled, setTitle, show
Methods inherited from class com.jbstrap.jbmap.layers.Layer
getContent, runAfterDrawOnLayer, runOnHideOnLayer, runOnShowOnLayer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.jbmap.layers.ContainerLayer
addComponent, addComponents, getComponentById, getComponents, getComponents, getComponentsByClass, removeAllComponents, removeComponent, removeComponent, removeComponents, replaceComponent
Methods inherited from interface com.jbstrap.jbmap.layers.TooltipLayer
closeTooltip, getTooltipContent, isTooltipEnabled, isTooltipOpened, openTooltip, setTooltipContent, setTooltipEnabled
-
Constructor Details
-
DivPoint
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 theLayerGroup
coordinates
- The upper left corner coordinates of the DivPoint- Throws:
NullPointerException
- Thrown if the value of thename
orcoordinates
parameter isnull
-
-
Method Details
-
getCoordinates
Gets the upper left corner coordinates of the DivPoint.- Returns:
- The upper left corner coordinates of the DivPoint
-
setCoordinates
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
Gets the DivPoint's width.- Returns:
- DivPoint width
-
setWidth
Sets the DivPoint's width.- Parameters:
width
- DivPoint width in pixels- Returns:
- DivPoint class instance
-
getHeight
Gets the DivPoint's height.- Returns:
- DivPoint height
-
setHeight
Sets the DivPoint height.- Parameters:
height
- DivPoint height in pixels- Returns:
- DivPoint class instance
-
getBorderStyle
Gets the DivPoint border style.- Returns:
- DivPoint border style enum
BorderStyle
-
setBorderStyle
Sets the DivPoint border style.- Parameters:
borderStyle
- DivPoint border style enumBorderStyle
- Returns:
- DivPoint class instance
-
getBorderRadius
public int getBorderRadius()Gets the DivPoint border radius.- Returns:
- DivPoint border radius
-
setBorderRadius
Sets the DivPoint border radius.- Parameters:
borderRadius
- DivPoint border radius in pixels- Returns:
- DivPoint class instance
-
getBorderLineColor
Gets the DivPoint border color.- Returns:
- DivPoint border color
-
setBorderLineColor
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
Sets the DivPoint border width.- Parameters:
borderLineWidth
- DivPoint border width in pixels- Returns:
- DivPoint class instance
-
getFillColor
Gets the DivPoint background color.- Returns:
- DivPoint background color
-
setFillColor
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
Sets the DivPoint opacity value.- Parameters:
opacity
- DivPoint opacity between 0 and 1- Returns:
- DivPoint class instance
-
getClassName
Gets the custom CSS class assigned to the DivPoint.- Returns:
- DivPoint custom CSS class
-
setClassName
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
Sets if there should be a shadow on the DivPoint. The default setting is that shadow is displayed on the DivPoint.- Parameters:
shadow
- Iftrue
is specified, a shadow is displayed on the DivPoint Iffalse
, no shadow is displayed.- Returns:
- DivPoint class instance
-
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
Gets the horizontal anchor (offset coordinates relative to the DivPoint).- Returns:
- Horizontal anchor
-
getAnchorY
Gets the vertical anchor (offset coordinates relative to the DivPoint).- Returns:
- Vertical anchor
-
setAnchor
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 coordinatesy
- Vertical offset in pixels, calculated from the point designated with the coordinates- Returns:
- DivPoint class instance
-
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
Gets the tooltip anchor relative to the DivPoint coordinates.- Parameters:
x
- Horizontal offset in pixelsy
- Vertical offset in pixels- Returns:
- DivPoint class instance
-
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
Sets the popup anchor (offset coordinates relative to the DivPoint).- Parameters:
x
- Horizontal offset in pixelsy
- Vertical offset in pixels- Returns:
- DivPoint class instance
-
onLayerDrawn
Registering the events for the DivPoint draw event in the DivPoint component.- Specified by:
onLayerDrawn
in interfaceDelayedInit
- Parameters:
event
- A layer drawn event component
-
onLayerHide
Registering the events for the popup hide event in the popup component.- Specified by:
onLayerHide
in interfaceLayerHideEventHandler
- Parameters:
event
- The popupPoint or divPoint hide event component
-
draw
Sets the DivPoint content.- Specified by:
draw
in interfaceContainerLayer<DivPoint>
- Returns:
- The layer class instance
-
onPopupDrawn
Registering the events for the popup draw event in the popup component.- Specified by:
onPopupDrawn
in interfacePopupDrawnEventHandler
- Parameters:
event
- The popup drawn event component
-
onPopupHide
Registering the events for the popup hide event in the popup component.- Specified by:
onPopupHide
in interfacePopupHideEventHandler
- Parameters:
event
- The popup hide event component
-