Package com.storedobject.ui
Class ImageMap.Area
java.lang.Object
com.storedobject.ui.ImageMap.Area
- Enclosing class:
ImageMap
A clickable rectangular area in an image map.
Instances are created using
ImageMap.addArea(int, int, int, int)
.-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addClickListener
(com.vaadin.flow.component.ComponentEventListener<ImageMap.AreaClickEvent> listener) Adds a click listener that is invoked whenever this area is clicked.setBackground
(String background) Sets the CSS background definition to use for this area when it is not hovered.Sets the CSS border definition to use for this area when it is not hovered.setHeight
(int height) Sets the height of this area.setHoverBackground
(String hoverBackground) Sets the CSS background definition to use for this area when it is hovered.setHoverBorder
(String hoverBorder) Sets the CSS border definition to use for this area when it is hovered.setLeft
(int left) Sets the position of the left edge of this area, relative to the left edge of the image map.Sets the title of this area.setTop
(int top) Sets the position of the top edge of this area, relative to the top edge of the image map.setWidth
(int width) Sets the width of this area.
-
Method Details
-
setLeft
Sets the position of the left edge of this area, relative to the left edge of the image map.- Parameters:
left
- The left edge position, in pixels- Returns:
- this area, for chaining
-
setTop
Sets the position of the top edge of this area, relative to the top edge of the image map.- Parameters:
top
- The top edge position, in pixels- Returns:
- this area, for chaining
-
setWidth
Sets the width of this area.- Parameters:
width
- The area width, in pixels- Returns:
- this area, for chaining
-
setHeight
Sets the height of this area.- Parameters:
height
- The area height, in pixels- Returns:
- this area, for chaining
-
addClickListener
public com.vaadin.flow.shared.Registration addClickListener(com.vaadin.flow.component.ComponentEventListener<ImageMap.AreaClickEvent> listener) Adds a click listener that is invoked whenever this area is clicked.- Parameters:
listener
- The listener to add, notnull
- Returns:
- a registration for removing the listener
-
setTitle
Sets the title of this area. The title is typically shown as a tooltip.- Parameters:
title
- The title to set, or""
to remove any previously set title. Not null.- Returns:
- this area, for chaining
-
setBackground
Sets the CSS background definition to use for this area when it is not hovered. If no value is set, then the value set usingImageMap.setAreaBackground(String)
is used as the default.- Parameters:
background
- The CSS background definition, ornull
to clear any set value and use the default- Returns:
- this area, for chaining
-
setHoverBackground
Sets the CSS background definition to use for this area when it is hovered. If no value is set, then the value set usingsetBackground(String)
is used as the default.- Parameters:
hoverBackground
- The CSS background definition, ornull
to clear any set value and use the default- Returns:
- this area, for chaining
-
setBorder
Sets the CSS border definition to use for this area when it is not hovered. If no value is set, then the value set usingImageMap.setAreaBorder(String)
is used as the default.- Parameters:
border
- The CSS border definition, ornull
to clear any set value and use the default- Returns:
- this area, for chaining
-
setHoverBorder
Sets the CSS border definition to use for this area when it is hovered. If no value is set, then the value set usingImageMap.setHoverBorder(String)
is used as the default.- Parameters:
hoverBorder
- The CSS border definition, ornull
to clear any set value and use the default- Returns:
- this area, for chaining
-