added thumbnailUrl parameter and fixed showMethod
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/image-previewer-widget@149321 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f4b1414c7c
commit
52ccc192ec
|
@ -28,9 +28,9 @@
|
|||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="${webappDirectory}/WEB-INF/classes"/>
|
||||
|
|
|
@ -5,9 +5,10 @@ import org.gcube.portlets.widgets.imagepreviewerwidget.shared.Orientation;
|
|||
/**
|
||||
* This class allows to build the image to show within the carousel. It contains:
|
||||
* <ul>
|
||||
* <li>title to show: a title to show in the header of the carousel;</li>
|
||||
* <li>tooltip : a tooltip shown on image hover event;</li>
|
||||
* <li>download url: in case of a file, this field can be used to download it.</li>
|
||||
* <li>title to show: a title to show in the header of the carousel;
|
||||
* <li>tooltip : a tooltip shown on image hover event;
|
||||
* <li>download url: in case of a file, this field can be used to download it.
|
||||
* <li>thumbnailUrl for the thumbnail
|
||||
* </ul>
|
||||
* If tooltip/download url/title to show is not specified, its value will be equal to the image url.
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
|
@ -29,6 +30,11 @@ public class EnhancedImage {
|
|||
*/
|
||||
private String downloadUrl;
|
||||
|
||||
/**
|
||||
* The url of the image to show
|
||||
*/
|
||||
private String thumbnailUrl;
|
||||
|
||||
/**
|
||||
* The orientation
|
||||
*/
|
||||
|
@ -44,6 +50,7 @@ public class EnhancedImage {
|
|||
this.titleToShow = imageUrl;
|
||||
this.toolTipToShow = imageUrl;
|
||||
this.downloadUrl = imageUrl;
|
||||
this.thumbnailUrl = downloadUrl;
|
||||
|
||||
}
|
||||
|
||||
|
@ -53,12 +60,13 @@ public class EnhancedImage {
|
|||
* @param titleToShow
|
||||
* @param toolTipToShow
|
||||
*/
|
||||
public EnhancedImage(String url, String titleToShow, String toolTipToShow) {
|
||||
public EnhancedImage(String downloadUrl, String titleToShow, String toolTipToShow) {
|
||||
|
||||
super();
|
||||
this.titleToShow = titleToShow;
|
||||
this.toolTipToShow = toolTipToShow;
|
||||
this.downloadUrl = url;
|
||||
this.downloadUrl = downloadUrl;
|
||||
this.thumbnailUrl = downloadUrl;
|
||||
|
||||
}
|
||||
|
||||
|
@ -69,42 +77,37 @@ public class EnhancedImage {
|
|||
* @param toolTipToShow
|
||||
* @param download url
|
||||
*/
|
||||
public EnhancedImage(String url, String titleToShow, String toolTipToShow, String downloadUrl) {
|
||||
public EnhancedImage(String thumbnailUrl, String titleToShow, String toolTipToShow, String downloadUrl) {
|
||||
|
||||
super();
|
||||
this.titleToShow = titleToShow;
|
||||
this.toolTipToShow = toolTipToShow;
|
||||
this.downloadUrl = url;
|
||||
this.thumbnailUrl = thumbnailUrl;
|
||||
this.downloadUrl = downloadUrl;
|
||||
}
|
||||
|
||||
public String getThumbnailUrl() {
|
||||
return thumbnailUrl;
|
||||
}
|
||||
|
||||
public void setThumbnailUrl(String thumbnailUrl) {
|
||||
this.thumbnailUrl = thumbnailUrl;
|
||||
}
|
||||
|
||||
public String getTitleToShow() {
|
||||
|
||||
return titleToShow;
|
||||
|
||||
}
|
||||
|
||||
public void setTitleToShow(String titleToShow) {
|
||||
|
||||
this.titleToShow = titleToShow;
|
||||
|
||||
}
|
||||
|
||||
public String getToolTipToShow() {
|
||||
|
||||
return toolTipToShow;
|
||||
|
||||
}
|
||||
|
||||
public void setToolTipToShow(String toolTipToShow) {
|
||||
|
||||
this.toolTipToShow = toolTipToShow;
|
||||
|
||||
}
|
||||
|
||||
public String getImageUrl(){
|
||||
|
||||
return this.downloadUrl;
|
||||
|
||||
}
|
||||
|
||||
public String getDownloadUrl() {
|
||||
|
@ -115,6 +118,10 @@ public class EnhancedImage {
|
|||
this.downloadUrl = downloadUrl;
|
||||
}
|
||||
|
||||
public String getImageUrl(){
|
||||
return this.thumbnailUrl != null? this.thumbnailUrl: this.downloadUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the orientation
|
||||
*/
|
||||
|
@ -133,7 +140,8 @@ public class EnhancedImage {
|
|||
public String toString() {
|
||||
return "EnhancedImage [titleToShow=" + titleToShow + ", toolTipToShow="
|
||||
+ toolTipToShow + ", downloadUrl=" + downloadUrl
|
||||
+ ", orientation=" + orientation + "]";
|
||||
+ ", thumbnailUrl=" + thumbnailUrl + ", orientation="
|
||||
+ orientation + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -278,6 +278,7 @@ public class Carousel extends Composite implements CarouselInterface {
|
|||
*/
|
||||
public void show(EnhancedImage image){
|
||||
GWT.log("image=" + image.getDownloadUrl());
|
||||
GWT.log("image=" + image.getThumbnailUrl());
|
||||
// evaluate where this image is
|
||||
int index = evaluateImagePosition(image);
|
||||
GWT.log("index=" + index);
|
||||
|
@ -388,8 +389,6 @@ public class Carousel extends Composite implements CarouselInterface {
|
|||
// fetch the image from the url
|
||||
shownImage.setUrl(url);
|
||||
|
||||
|
||||
|
||||
// change image tooltip
|
||||
shownImage.setTitle(imageToShow.getToolTipToShow());
|
||||
|
||||
|
|
Loading…
Reference in New Issue