minor fix and moved to 1.1.1 version (now loading image is removed after that the orientation has been retrieved from the server side)
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/image-previewer-widget@130977 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8cbed3e7cd
commit
b25cac6a72
|
@ -1,4 +1,7 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
|
<Changeset component="org.gcube.portlets-widgets.image-previewer-widget.1-1-1" date="2016-11-02">
|
||||||
|
<Change>Minor fix</Change>
|
||||||
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portlets-widgets.image-previewer-widget.1-1-0" date="2016-04-02">
|
<Changeset component="org.gcube.portlets-widgets.image-previewer-widget.1-1-0" date="2016-04-02">
|
||||||
<Change>Removed GWT Standard css</Change>
|
<Change>Removed GWT Standard css</Change>
|
||||||
<Change>Style changes</Change>
|
<Change>Style changes</Change>
|
||||||
|
|
3
pom.xml
3
pom.xml
|
@ -12,8 +12,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.portlets.widgets</groupId>
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
<artifactId>image-previewer-widget</artifactId>
|
<artifactId>image-previewer-widget</artifactId>
|
||||||
<packaging>jar</packaging>
|
<version>1.1.1-SNAPSHOT</version>
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
|
||||||
<name>gCube Image previewer widget</name>
|
<name>gCube Image previewer widget</name>
|
||||||
<description>
|
<description>
|
||||||
gCube Image Previewer widget is a GWT Widget that can be used to show a preview of one or more images
|
gCube Image Previewer widget is a GWT Widget that can be used to show a preview of one or more images
|
||||||
|
|
|
@ -333,26 +333,7 @@ public class Carousel extends Composite{
|
||||||
shownImage.setVisible(false);
|
shownImage.setVisible(false);
|
||||||
|
|
||||||
final EnhancedImage imageToShow = listOfAttachmentsToShow.get(index);
|
final EnhancedImage imageToShow = listOfAttachmentsToShow.get(index);
|
||||||
String url = imageToShow.getImageUrl();
|
final String url = imageToShow.getImageUrl();
|
||||||
|
|
||||||
// call only if undefined
|
|
||||||
if(imageToShow.getOrientation().equals(Orientation.UNDEFINED)){
|
|
||||||
|
|
||||||
imageServices.getImageOrientation(url, new AsyncCallback<Orientation>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Orientation result) {
|
|
||||||
setOrientation(imageToShow, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
setOrientation(imageToShow, Orientation.DO_NOT_ROTATE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}else
|
|
||||||
setOrientation(imageToShow, imageToShow.getOrientation());
|
|
||||||
|
|
||||||
// when image is downloaded ...
|
// when image is downloaded ...
|
||||||
shownImage.addLoadHandler(new LoadHandler() {
|
shownImage.addLoadHandler(new LoadHandler() {
|
||||||
|
@ -360,10 +341,28 @@ public class Carousel extends Composite{
|
||||||
@Override
|
@Override
|
||||||
public void onLoad(LoadEvent event) {
|
public void onLoad(LoadEvent event) {
|
||||||
|
|
||||||
// swap
|
// call only if undefined
|
||||||
shownImage.setVisible(true);
|
if(imageToShow.getOrientation().equals(Orientation.UNDEFINED)){
|
||||||
loadingImage.setVisible(false);
|
|
||||||
|
|
||||||
|
imageServices.getImageOrientation(url, new AsyncCallback<Orientation>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Orientation result) {
|
||||||
|
setOrientation(imageToShow, result);
|
||||||
|
removeLoader();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
setOrientation(imageToShow, Orientation.DO_NOT_ROTATE);
|
||||||
|
removeLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}else{
|
||||||
|
setOrientation(imageToShow, imageToShow.getOrientation());
|
||||||
|
removeLoader();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -388,6 +387,14 @@ public class Carousel extends Composite{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove image loader
|
||||||
|
*/
|
||||||
|
protected void removeLoader() {
|
||||||
|
shownImage.setVisible(true);
|
||||||
|
loadingImage.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the orientation
|
* Set the orientation
|
||||||
* @param img
|
* @param img
|
||||||
|
|
Loading…
Reference in New Issue