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>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
<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>
|
<attributes>
|
||||||
<attribute name="owner.project.facets" value="java"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="${webappDirectory}/WEB-INF/classes"/>
|
<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:
|
* This class allows to build the image to show within the carousel. It contains:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>title to show: a title to show in the header of the carousel;</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>
|
* <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>
|
* <li>download url: in case of a file, this field can be used to download it.
|
||||||
|
* <li>thumbnailUrl for the thumbnail
|
||||||
* </ul>
|
* </ul>
|
||||||
* If tooltip/download url/title to show is not specified, its value will be equal to the image url.
|
* 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)
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||||
|
@ -29,6 +30,11 @@ public class EnhancedImage {
|
||||||
*/
|
*/
|
||||||
private String downloadUrl;
|
private String downloadUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The url of the image to show
|
||||||
|
*/
|
||||||
|
private String thumbnailUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The orientation
|
* The orientation
|
||||||
*/
|
*/
|
||||||
|
@ -44,6 +50,7 @@ public class EnhancedImage {
|
||||||
this.titleToShow = imageUrl;
|
this.titleToShow = imageUrl;
|
||||||
this.toolTipToShow = imageUrl;
|
this.toolTipToShow = imageUrl;
|
||||||
this.downloadUrl = imageUrl;
|
this.downloadUrl = imageUrl;
|
||||||
|
this.thumbnailUrl = downloadUrl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,12 +60,13 @@ public class EnhancedImage {
|
||||||
* @param titleToShow
|
* @param titleToShow
|
||||||
* @param toolTipToShow
|
* @param toolTipToShow
|
||||||
*/
|
*/
|
||||||
public EnhancedImage(String url, String titleToShow, String toolTipToShow) {
|
public EnhancedImage(String downloadUrl, String titleToShow, String toolTipToShow) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
this.titleToShow = titleToShow;
|
this.titleToShow = titleToShow;
|
||||||
this.toolTipToShow = toolTipToShow;
|
this.toolTipToShow = toolTipToShow;
|
||||||
this.downloadUrl = url;
|
this.downloadUrl = downloadUrl;
|
||||||
|
this.thumbnailUrl = downloadUrl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,42 +77,37 @@ public class EnhancedImage {
|
||||||
* @param toolTipToShow
|
* @param toolTipToShow
|
||||||
* @param download url
|
* @param download url
|
||||||
*/
|
*/
|
||||||
public EnhancedImage(String url, String titleToShow, String toolTipToShow, String downloadUrl) {
|
public EnhancedImage(String thumbnailUrl, String titleToShow, String toolTipToShow, String downloadUrl) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
this.titleToShow = titleToShow;
|
this.titleToShow = titleToShow;
|
||||||
this.toolTipToShow = toolTipToShow;
|
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() {
|
public String getTitleToShow() {
|
||||||
|
|
||||||
return titleToShow;
|
return titleToShow;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitleToShow(String titleToShow) {
|
public void setTitleToShow(String titleToShow) {
|
||||||
|
|
||||||
this.titleToShow = titleToShow;
|
this.titleToShow = titleToShow;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToolTipToShow() {
|
public String getToolTipToShow() {
|
||||||
|
|
||||||
return toolTipToShow;
|
return toolTipToShow;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setToolTipToShow(String toolTipToShow) {
|
public void setToolTipToShow(String toolTipToShow) {
|
||||||
|
|
||||||
this.toolTipToShow = toolTipToShow;
|
this.toolTipToShow = toolTipToShow;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getImageUrl(){
|
|
||||||
|
|
||||||
return this.downloadUrl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDownloadUrl() {
|
public String getDownloadUrl() {
|
||||||
|
@ -115,6 +118,10 @@ public class EnhancedImage {
|
||||||
this.downloadUrl = downloadUrl;
|
this.downloadUrl = downloadUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getImageUrl(){
|
||||||
|
return this.thumbnailUrl != null? this.thumbnailUrl: this.downloadUrl;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the orientation
|
* @return the orientation
|
||||||
*/
|
*/
|
||||||
|
@ -133,7 +140,8 @@ public class EnhancedImage {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "EnhancedImage [titleToShow=" + titleToShow + ", toolTipToShow="
|
return "EnhancedImage [titleToShow=" + titleToShow + ", toolTipToShow="
|
||||||
+ toolTipToShow + ", downloadUrl=" + downloadUrl
|
+ 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){
|
public void show(EnhancedImage image){
|
||||||
GWT.log("image=" + image.getDownloadUrl());
|
GWT.log("image=" + image.getDownloadUrl());
|
||||||
|
GWT.log("image=" + image.getThumbnailUrl());
|
||||||
// evaluate where this image is
|
// evaluate where this image is
|
||||||
int index = evaluateImagePosition(image);
|
int index = evaluateImagePosition(image);
|
||||||
GWT.log("index=" + index);
|
GWT.log("index=" + index);
|
||||||
|
@ -388,8 +389,6 @@ public class Carousel extends Composite implements CarouselInterface {
|
||||||
// fetch the image from the url
|
// fetch the image from the url
|
||||||
shownImage.setUrl(url);
|
shownImage.setUrl(url);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// change image tooltip
|
// change image tooltip
|
||||||
shownImage.setTitle(imageToShow.getToolTipToShow());
|
shownImage.setTitle(imageToShow.getToolTipToShow());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue