Package com.jbstrap.jbmap
Class DivLayer
- All Implemented Interfaces:
ContainerLayer<DivLayer>
This class represent a Div to be placed on the map.
This class is not part of the map's coordinate system. It is a part of the map's enclosing container and you can place it in the container, anchored to one of its corners.
Add further components to the DivLayer component by using the methods of the
ContainerLayer
class.- Since:
- 4.0
-
Field Summary
Fields inherited from class com.jbstrap.jbmap.layers.Layer
componentContent, params, parent
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondraw()
The layer component content drawing.getAlign()
Gets the DivLayer’s layout.Gets the DivLayer's background color.Gets the DivLayer's border color.int
Gets the DivLayer border width.int
Gets the DivLayer's border radius.Gets the DivLayer border style.Gets a custom CSS class.Gets the DivLayer's height.getHtml()
Gets the DivLayer's HTML content.Gets the DivLayer opacity value.getName()
Gets the DivLayer's unique name.protected com.jbstrap.core.Parameters
Gets the parameters of the DivLayer instance.getWidth()
Gets the DivLayer height.boolean
isShadow()
Checks if the DivLayer shadow is enabled.protected void
setAlign
(DivLayerAlign divLayerAlign) Sets the DivLayer’s layout.setBgColor
(String fillColor) Sets the DivLayer's border color.setBorderColor
(String color) Sets the DivLayer's border color.setBorderLineWidth
(int borderLineWidth) Sets the DivLayer border width.setBorderRadius
(int radius) Sets the DivLayer's border radius.setBorderStyle
(BorderStyle borderStyle) Sets the DivLayer border style.setClassName
(String className) Sets a custom CSS class.protected void
setComponent
(com.jbstrap.ui.Component<JBMap> component) Passes the JBMap component to the DivLayer class instance.Sets the DivPoint height.setLayerOpacity
(double opacity) Sets the DivLayer opacity value.setShadow
(boolean shadow) DivLayer visibility setting.Sets the DivLayer height.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
-
Constructor Details
-
DivLayer
Creates a DivLayer instance.- Parameters:
name
- DivLayer unique name- Throws:
NullPointerException
- Thrown if the value of thename
parameter isnull
-
-
Method Details
-
setComponent
Passes the JBMap component to the DivLayer class instance.- Parameters:
component
- The JBMap component
-
getParams
protected com.jbstrap.core.Parameters getParams()Gets the parameters of the DivLayer instance.- Returns:
- DivLayer parameters
-
getName
Gets the DivLayer's unique name. Use this name to identify a DivLayer. Two DivLayers cannot have the same name.- Returns:
- Unique DivLayer name
-
getWidth
Gets the DivLayer height.- Returns:
- DivLayer width value
-
setWidth
Sets the DivLayer height.- Parameters:
width
- DivLayer width in pixels ornull
;
0
for automatic setting Default:
null
.
- Returns:
- DivLayer instance
-
getHeight
Gets the DivLayer's height.- Returns:
- DivLayer height
-
setHeight
Sets the DivPoint height.- Parameters:
height
- DivLayer height in pixels ornull
;
0
for the automatic setting Default:null
.
- Returns:
- DivLayer instance
-
getAlign
Gets the DivLayer’s layout.- Returns:
- DivLayer alignment
DivLayerAlign
- See Also:
-
setAlign
Sets the DivLayer’s layout.- Parameters:
divLayerAlign
- DivLayer alignment The available list of enums is:DivLayerAlign
. Default valueDivLayerAling.TOP_RIGHT
- Returns:
- DivLayer instance
-
getHtml
Gets the DivLayer's HTML content.- Returns:
- DivLayer HTML content
-
getBgColor
Gets the DivLayer's background color.- Returns:
- DivLayer background color Default value
"rgba(255, 255, 255, .8)"
-
setBgColor
Sets the DivLayer's border color. You can use any standard CSS3 color.- Parameters:
fillColor
- DivLayer background color Default value"rgba(255, 255, 255, .8)"
- Returns:
- DivLayer instance
-
getBorderColor
Gets the DivLayer's border color.- Returns:
- DivLayer border color Default value
"rgba(0,0,0,0.2)"
-
setBorderColor
Sets the DivLayer's border color. You can use any standard CSS3 color.- Parameters:
color
- DivLayer border color Default value"rgba(0,0,0,0.2)"
- Returns:
- DivLayer instance
-
getBorderRadius
public int getBorderRadius()Gets the DivLayer's border radius.- Returns:
- DivLayer border radius Default value
5
-
setBorderRadius
Sets the DivLayer's border radius.- Parameters:
radius
- DivLayer border radius Default value5
- Returns:
- DivLayer instance
-
getBorderStyle
Gets the DivLayer border style.- Returns:
- DivLayer border style
BorderStyle
Default valueBorderStyle.SOLID
-
setBorderStyle
Sets the DivLayer border style.- Parameters:
borderStyle
- DivLayer border style The available list of enums is:BorderStyle
. Default valueBorderStyle.SOLID
- Returns:
- DivLayer instance
-
getBorderLineWidth
public int getBorderLineWidth()Gets the DivLayer border width.- Returns:
- DivLayer border width Default value
1
-
setBorderLineWidth
Sets the DivLayer border width.- Parameters:
borderLineWidth
- DivLayer border width Default value1
- Returns:
- DivLayer instance
-
getLayerOpacity
Gets the DivLayer opacity value.- Returns:
- DivLayer opacity Default value
1
-
setLayerOpacity
Sets the DivLayer opacity value.- Parameters:
opacity
- DivLayer between0
and1
. Default value1
- Returns:
- DivLayer instance
-
getClassName
Gets a custom CSS class.- Returns:
- Custom CSS class name
-
setClassName
Sets a custom CSS class.- Parameters:
className
- Custom CSS class name- Returns:
- DivLayer instance
-
isShadow
public boolean isShadow()Checks if the DivLayer shadow is enabled.- Returns:
- If
true
, the shadow is enabled, otherwise not Default value1
-
setShadow
DivLayer visibility setting.- Parameters:
shadow
- DivLayer shadow visibility Default valuetrue
- Returns:
- DivLayer instance
-
runJS
- Parameters:
script
- JavaScript
-
draw
Description copied from interface:ContainerLayer
The layer component content drawing.- Specified by:
draw
in interfaceContainerLayer<DivLayer>
- Returns:
- The layer class instance
-