Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<groupId>com.flowingcode.vaadin.addons</groupId>
<artifactId>zoomist-addon</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.3.0-SNAPSHOT</version>
<name>Zoomist Add-on</name>
<description>Zoomist Add-on for Vaadin Flow</description>
<url>https://www.flowingcode.com/en/open-source/</url>

<properties>
<vaadin.version>24.1.4</vaadin.version>
<vaadin.version>24.8.17</vaadin.version>
<selenium.version>4.10.0</selenium.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/flowingcode/vaadin/addons/zoomist/Zoomist.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand Down