minor fixes
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/image-previewer-widget@134980 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
aaa5ed3c25
commit
c0f2daf232
|
@ -2,8 +2,6 @@ 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. It contains:
|
* This class allows to build the image to show within the carousel. It contains:
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -36,11 +34,6 @@ public class EnhancedImage {
|
||||||
*/
|
*/
|
||||||
private Orientation orientation = Orientation.UNDEFINED;
|
private Orientation orientation = Orientation.UNDEFINED;
|
||||||
|
|
||||||
/**
|
|
||||||
* The cached image (once downloaded)
|
|
||||||
*/
|
|
||||||
private Image cachedImage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build an enhanced image from a url.
|
* Build an enhanced image from a url.
|
||||||
* @param imageUrl the url of the image.
|
* @param imageUrl the url of the image.
|
||||||
|
@ -136,14 +129,6 @@ public class EnhancedImage {
|
||||||
this.orientation = orientation;
|
this.orientation = orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Image getCachedImage() {
|
|
||||||
return cachedImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCachedImage(Image cachedImage) {
|
|
||||||
this.cachedImage = cachedImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "EnhancedImage [titleToShow=" + titleToShow + ", toolTipToShow="
|
return "EnhancedImage [titleToShow=" + titleToShow + ", toolTipToShow="
|
||||||
|
|
|
@ -333,14 +333,6 @@ public class Carousel extends Composite{
|
||||||
|
|
||||||
final EnhancedImage imageToShow = listOfAttachmentsToShow.get(index);
|
final EnhancedImage imageToShow = listOfAttachmentsToShow.get(index);
|
||||||
|
|
||||||
// check if it was already shown before and cached...
|
|
||||||
if(imageToShow.getCachedImage() != null){
|
|
||||||
|
|
||||||
shownImage = imageToShow.getCachedImage();
|
|
||||||
setOrientation(imageToShow, imageToShow.getOrientation());
|
|
||||||
|
|
||||||
}else{
|
|
||||||
|
|
||||||
final String url = imageToShow.getImageUrl();
|
final String url = imageToShow.getImageUrl();
|
||||||
|
|
||||||
// when image is downloaded ...
|
// when image is downloaded ...
|
||||||
|
@ -370,16 +362,13 @@ public class Carousel extends Composite{
|
||||||
}else{
|
}else{
|
||||||
setOrientation(imageToShow, imageToShow.getOrientation());
|
setOrientation(imageToShow, imageToShow.getOrientation());
|
||||||
}
|
}
|
||||||
|
|
||||||
// cache it
|
|
||||||
imageToShow.setCachedImage(shownImage);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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