mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-24 06:28:41 +00:00
Only call resizing if really necessary
This commit is contained in:
+20
-15
@@ -299,22 +299,27 @@ public class ImagesListComposite extends Composite {
|
||||
}
|
||||
|
||||
protected void callResizingService(ImageResizingTaskDTO resizingTask, ImageDTO originalImage) {
|
||||
sailingService.resizeImage(resizingTask, new AsyncCallback<ImageDTO[]>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Notification.notify(stringMessages.resizeUnsuccessfull(), NotificationType.ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ImageDTO[] result) {
|
||||
for (int i = 0; i < result.length; i++) {
|
||||
imageListDataProvider.getList().add(result[i]);
|
||||
if (resizingTask.getResizingTask().size() != 0) {
|
||||
sailingService.resizeImage(resizingTask, new AsyncCallback<ImageDTO[]>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Notification.notify(stringMessages.resizeUnsuccessfull(), NotificationType.ERROR);
|
||||
}
|
||||
imageListDataProvider.getList().remove(originalImage);
|
||||
updateTableVisisbilty();
|
||||
Notification.notify(stringMessages.resizeSuccessfull(), NotificationType.SUCCESS);
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onSuccess(ImageDTO[] result) {
|
||||
for (int i = 0; i < result.length; i++) {
|
||||
imageListDataProvider.getList().add(result[i]);
|
||||
}
|
||||
imageListDataProvider.getList().remove(originalImage);
|
||||
updateTableVisisbilty();
|
||||
Notification.notify(stringMessages.resizeSuccessfull(), NotificationType.SUCCESS);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
imageListDataProvider.getList().remove(originalImage);
|
||||
imageListDataProvider.getList().add(resizingTask.getImage());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTableVisisbilty() {
|
||||
|
||||
-2
@@ -6,8 +6,6 @@ import java.util.List;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HasValue;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
@@ -14,6 +14,7 @@ We distinguish two cases: adding a 3rd-party bundle to the target platform and a
|
||||
* Go to directory 'java/com.sap.sailing.targetplatform/scripts'
|
||||
* Rebuild the base target platform by running the script 'createLocalBaseP2repository.sh'
|
||||
* Generate the target definition for this local repository by running the script 'createLocalTargetDef.sh'
|
||||
* Currently this scripts work for the cygwin shell and the git bash, if the path to your files in the target definition is incorrect, this may be the reason.
|
||||
* Test the new overall target platform
|
||||
* by setting the race-analysis-p2-local.target as target platform in the IDE
|
||||
* by running the local maven build via ''buildAndUpdateProduct.sh -v build'' (the ''-v'' switch builds and uses the local p2 repository)
|
||||
|
||||
Reference in New Issue
Block a user