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 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 * This class allows to build the image to show within the carousel. It contains:
* the following other information:
* <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>
* <li>tooltip : a tooltip shown on image hover event;</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 { public class EnhancedImage {
/**
* The image to show.
*/
private Image image;
/** /**
* Title to show in the header of the carousel. * Title to show in the header of the carousel.
*/ */
@ -49,40 +41,24 @@ public class EnhancedImage {
public EnhancedImage(String imageUrl){ public EnhancedImage(String imageUrl){
super(); super();
this.image = new Image(imageUrl);
this.titleToShow = imageUrl; this.titleToShow = imageUrl;
this.toolTipToShow = imageUrl; this.toolTipToShow = imageUrl;
this.downloadUrl = 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. * Build an enhanced image from an image but allows to customize the title of the image and its tooltip.
* @param image * @param image
* @param titleToShow * @param titleToShow
* @param toolTipToShow * @param toolTipToShow
*/ */
public EnhancedImage(Image image, String titleToShow, String toolTipToShow) { public EnhancedImage(String url, String titleToShow, String toolTipToShow) {
super(); super();
this.image = image;
this.titleToShow = titleToShow; this.titleToShow = titleToShow;
this.toolTipToShow = toolTipToShow; this.toolTipToShow = toolTipToShow;
this.downloadUrl = image.getUrl(); this.downloadUrl = url;
} }
@ -93,48 +69,41 @@ public class EnhancedImage {
* @param toolTipToShow * @param toolTipToShow
* @param download url * @param download url
*/ */
public EnhancedImage(Image image, String titleToShow, String toolTipToShow, String downloadUrl) { public EnhancedImage(String url, String titleToShow, String toolTipToShow, String downloadUrl) {
super(); super();
this.image = image;
this.titleToShow = titleToShow; this.titleToShow = titleToShow;
this.toolTipToShow = toolTipToShow; 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() { 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(){ public String getImageUrl(){
return this.image.getUrl(); return this.downloadUrl;
} }
@ -160,13 +129,11 @@ public class EnhancedImage {
this.orientation = orientation; this.orientation = orientation;
} }
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override @Override
public String toString() { public String toString() {
return "EnhancedImage [image=" + image + ", titleToShow=" + titleToShow return "EnhancedImage [titleToShow=" + titleToShow + ", toolTipToShow="
+ ", toolTipToShow=" + toolTipToShow + ", downloadUrl=" + toolTipToShow + ", downloadUrl=" + downloadUrl
+ downloadUrl + ", orientation=" + orientation + "]"; + ", orientation=" + orientation + "]";
} }
} }