diff --git a/pom.xml b/pom.xml index aa41e3d..9959e7a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,13 +4,13 @@ com.flowingcode.vaadin.addons zoomist-addon - 1.2.1-SNAPSHOT + 1.3.0-SNAPSHOT Zoomist Add-on Zoomist Add-on for Vaadin Flow https://www.flowingcode.com/en/open-source/ - 24.1.4 + 24.8.17 4.10.0 17 17 diff --git a/src/main/java/com/flowingcode/vaadin/addons/zoomist/Zoomist.java b/src/main/java/com/flowingcode/vaadin/addons/zoomist/Zoomist.java index cbe923a..7b02661 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/zoomist/Zoomist.java +++ b/src/main/java/com/flowingcode/vaadin/addons/zoomist/Zoomist.java @@ -27,6 +27,8 @@ import com.vaadin.flow.component.dependency.NpmPackage; import com.vaadin.flow.function.SerializableConsumer; import com.vaadin.flow.server.AbstractStreamResource; +import com.vaadin.flow.server.StreamResourceRegistry; +import com.vaadin.flow.server.streams.DownloadHandler; import com.vaadin.flow.shared.Registration; import elemental.json.Json; import elemental.json.JsonObject; @@ -85,6 +87,15 @@ public Zoomist(String src) { setSrc(src); } + /** + * Creates a new instance of Zoomist for the specified source image. + * + * @param src the source image + */ + public Zoomist(DownloadHandler src) { + setSrc(src); + } + /** * Creates a new instance of Zoomist for the specified source image. * @@ -94,6 +105,15 @@ public Zoomist(AbstractStreamResource src) { setSrc(src); } + /** + * Sets the source url of image. + * + * @param src the source image + */ + public void setSrc(DownloadHandler src) { + setSrc(new StreamResourceRegistry.ElementStreamResource(src, getElement())); + } + /** * Sets the source url of image. *