removed useless image into enhanced image class

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/image-previewer-widget@134426 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-11-21 11:25:00 +00:00
parent 4019447587
commit 28a73aedaf
1 changed files with 14 additions and 47 deletions

View File

@ -2,11 +2,8 @@ package org.gcube.portlets.widgets.imagepreviewerwidget.client;
import org.gcube.portlets.widgets.imagepreviewerwidget.shared.Orientation;
import com.github.gwtbootstrap.client.ui.Image;
/**
* This class allows to build the image to show within the carousel. Along the image itself, there are
* the following other information:
* 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>
@ -17,11 +14,6 @@ import com.github.gwtbootstrap.client.ui.Image;
*/
public class EnhancedImage {
/**
* The image to show.
*/
private Image image;
/**
* Title to show in the header of the carousel.
*/
@ -49,40 +41,24 @@ public class EnhancedImage {
public EnhancedImage(String imageUrl){
super();
this.image = new Image(imageUrl);
this.titleToShow = imageUrl;
this.toolTipToShow = imageUrl;
this.downloadUrl = imageUrl;
}
/**
* Build an enhanced image from another image.
* @param image the image to show
*/
public EnhancedImage(Image image){
super();
this.image = image;
this.titleToShow = image.getUrl();
this.toolTipToShow = image.getUrl();
this.downloadUrl = image.getUrl();
}
/**
* Build an enhanced image from an image but allows to customize the title of the image and its tooltip.
* @param image
* @param titleToShow
* @param toolTipToShow
*/
public EnhancedImage(Image image, String titleToShow, String toolTipToShow) {
public EnhancedImage(String url, String titleToShow, String toolTipToShow) {
super();
this.image = image;
this.titleToShow = titleToShow;
this.toolTipToShow = toolTipToShow;
this.downloadUrl = image.getUrl();
this.downloadUrl = url;
}
@ -93,48 +69,41 @@ public class EnhancedImage {
* @param toolTipToShow
* @param download url
*/
public EnhancedImage(Image image, String titleToShow, String toolTipToShow, String downloadUrl) {
public EnhancedImage(String url, String titleToShow, String toolTipToShow, String downloadUrl) {
super();
this.image = image;
this.titleToShow = titleToShow;
this.toolTipToShow = toolTipToShow;
this.downloadUrl = downloadUrl;
this.downloadUrl = url;
}
public Image getImage() {
return image;
}
public void setImage(Image image) {
this.image = image;
}
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.image.getUrl();
return this.downloadUrl;
}
@ -160,13 +129,11 @@ public class EnhancedImage {
this.orientation = orientation;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "EnhancedImage [image=" + image + ", titleToShow=" + titleToShow
+ ", toolTipToShow=" + toolTipToShow + ", downloadUrl="
+ downloadUrl + ", orientation=" + orientation + "]";
return "EnhancedImage [titleToShow=" + titleToShow + ", toolTipToShow="
+ toolTipToShow + ", downloadUrl=" + downloadUrl
+ ", orientation=" + orientation + "]";
}
}