From 67331921dea6a0a7b9ccb98e8e936ff5d1646cf2 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Fri, 16 Jun 2017 16:49:22 +0200
Subject: [PATCH] imports organized

---
 .../annotation/cache/WebPageDownloader.java   |  5 ++---
 .../bioEntity/BioEntityConverter.java         |  1 -
 .../reaction/ReactionConverterTest.java       |  3 ---
 .../mapviewer/model/map/species/Element.java  |  4 ++--
 .../chemicals/ChemicalController.java         |  1 -
 .../api/projects/drugs/DrugRestImpl.java      |  2 --
 .../bioEntities/BioEntitiesController.java    |  2 +-
 .../reactions/ReactionsRestImpl.java          |  1 -
 .../publications/PublicationsRestImpl.java    | 11 +++-------
 .../projects/overlays/OverlayController.java  |  8 +++----
 .../mapviewer/services/impl/ModelService.java |  2 --
 .../services/interfaces/IModelService.java    |  1 -
 .../services/interfaces/IUserService.java     |  1 -
 .../services/search/SearchResultFactory.java  | 21 ++++---------------
 14 files changed, 16 insertions(+), 47 deletions(-)

diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/WebPageDownloader.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/WebPageDownloader.java
index 9a7e8d6fe3..80d2c2f7a7 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/WebPageDownloader.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/WebPageDownloader.java
@@ -4,7 +4,6 @@ import java.io.BufferedReader;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.net.ConnectException;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -85,8 +84,8 @@ public class WebPageDownloader {
 					urlConn.setRequestMethod("GET");
 					urlConn.addRequestProperty("User-Agent", "minerva-framework");
 					try {
-					urlConn.connect();
-					code = urlConn.getResponseCode();
+						urlConn.connect();
+						code = urlConn.getResponseCode();
 					} catch (FileNotFoundException e) {
 						code = HttpURLConnection.HTTP_NOT_FOUND;
 					} catch (IOException e) {
diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/BioEntityConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/BioEntityConverter.java
index b8a32ba776..6f9714b2cf 100644
--- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/BioEntityConverter.java
+++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/BioEntityConverter.java
@@ -19,7 +19,6 @@ import lcsb.mapviewer.model.map.reaction.ReactionNode;
 import lcsb.mapviewer.model.map.species.Complex;
 import lcsb.mapviewer.model.map.species.Element;
 import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.modelutils.map.ElementUtils;
 
 /**
  * This interface defines what operations should be possible to convert
diff --git a/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverterTest.java b/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverterTest.java
index 6d2fe4eb5e..4623a64019 100644
--- a/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverterTest.java
+++ b/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverterTest.java
@@ -7,21 +7,18 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import java.awt.Color;
-import java.awt.Desktop;
 import java.awt.FontMetrics;
 import java.awt.Graphics2D;
 import java.awt.geom.GeneralPath;
 import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
-import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
 import javax.imageio.ImageIO;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.junit.After;
 import org.junit.Before;
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Element.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Element.java
index 80530dda25..b9b09c03c2 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Element.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Element.java
@@ -1096,8 +1096,8 @@ public abstract class Element implements AnnotatedObject, Serializable {
 		this.zoomLevelVisibility = zoomLevelVisibility;
 	}
 
-	public String getSemanticZoomLevelVisibility(){
-		return this.zoomLevelVisibility; 
+	public String getSemanticZoomLevelVisibility() {
+		return this.zoomLevelVisibility;
 	}
 
 }
\ No newline at end of file
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/chemicals/ChemicalController.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/chemicals/ChemicalController.java
index 95cdfe87f7..427b20fb2a 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/chemicals/ChemicalController.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/chemicals/ChemicalController.java
@@ -1,6 +1,5 @@
 package lcsb.mapviewer.api.projects.chemicals;
 
-import java.awt.geom.Point2D;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/drugs/DrugRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/drugs/DrugRestImpl.java
index f7ec8bcfb8..75f01d1125 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/drugs/DrugRestImpl.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/drugs/DrugRestImpl.java
@@ -21,8 +21,6 @@ import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.species.Element;
-import lcsb.mapviewer.persist.dao.map.ReactionDao;
-import lcsb.mapviewer.persist.dao.map.species.ElementDao;
 import lcsb.mapviewer.services.SecurityException;
 import lcsb.mapviewer.services.interfaces.IModelService;
 import lcsb.mapviewer.services.interfaces.IUserService;
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/BioEntitiesController.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/BioEntitiesController.java
index 9f8bd3fe86..2c96827f47 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/BioEntitiesController.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/BioEntitiesController.java
@@ -68,7 +68,7 @@ public class BioEntitiesController extends BaseController {
 
 	@RequestMapping(value = "/projects/{projectId}/models/{modelId}/bioEntities/suggestedQueryList", method = { RequestMethod.GET, RequestMethod.POST },
 			produces = { MediaType.APPLICATION_JSON_VALUE })
-	public String[] getSuggestedQueryList( //
+	public String[] getSuggestedQueryList(//
 			@PathVariable(value = "projectId") String projectId, //
 			@CookieValue(value = Configuration.AUTH_TOKEN) String token//
 	) throws SecurityException {
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/reactions/ReactionsRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/reactions/ReactionsRestImpl.java
index c1305c1437..3529d79e68 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/reactions/ReactionsRestImpl.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/reactions/ReactionsRestImpl.java
@@ -1,6 +1,5 @@
 package lcsb.mapviewer.api.projects.models.bioEntities.reactions;
 
-import java.awt.geom.PathIterator;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/publications/PublicationsRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/publications/PublicationsRestImpl.java
index a17deb3669..50f9b69189 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/publications/PublicationsRestImpl.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/publications/PublicationsRestImpl.java
@@ -16,27 +16,21 @@ import org.springframework.transaction.annotation.Transactional;
 import lcsb.mapviewer.annotation.services.PubmedParser;
 import lcsb.mapviewer.api.BaseRestImpl;
 import lcsb.mapviewer.api.QueryException;
-import lcsb.mapviewer.common.exception.InvalidStateException;
 import lcsb.mapviewer.model.map.AnnotatedObject;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.species.Element;
 import lcsb.mapviewer.services.SecurityException;
-import lcsb.mapviewer.services.interfaces.ILayoutService;
 import lcsb.mapviewer.services.interfaces.IModelService;
 import lcsb.mapviewer.services.interfaces.ISearchService;
 import lcsb.mapviewer.services.interfaces.IUserService;
-import lcsb.mapviewer.services.search.data.ElementIdentifier.ElementIdentifierType;
 import lcsb.mapviewer.services.view.AnnotationViewFactory;
-import lcsb.mapviewer.services.view.AuthenticationToken;
 import lcsb.mapviewer.services.view.OverviewImageViewFactory;
 
 @Transactional(value = "txManager")
-public class PublicationsRestImpl extends BaseRestImpl{
+public class PublicationsRestImpl extends BaseRestImpl {
 
 	Logger													 logger	= Logger.getLogger(PublicationsRestImpl.class);
 
@@ -158,7 +152,8 @@ public class PublicationsRestImpl extends BaseRestImpl{
 		this.factory = factory;
 	}
 
-	public Map<String, Object> getPublications(String projectId, String modelId, String token, String startString, Integer length) throws SecurityException, QueryException {
+	public Map<String, Object> getPublications(String projectId, String modelId, String token, String startString, Integer length)
+			throws SecurityException, QueryException {
 		List<Model> models = getModels(projectId, modelId, token);
 
 		Integer start = Math.max(0, Integer.valueOf(startString));
diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayController.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayController.java
index 45a4ada00d..815d1b9aff 100644
--- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayController.java
+++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayController.java
@@ -90,7 +90,7 @@ public class OverlayController extends BaseController {
 	}
 
 	@RequestMapping(value = "/projects/{projectId}/overlays/", method = { RequestMethod.POST }, produces = { MediaType.APPLICATION_JSON_VALUE })
-	public LayoutView addOverlay( //
+	public LayoutView addOverlay(//
 			@CookieValue(value = Configuration.AUTH_TOKEN) String token, //
 			@PathVariable(value = "projectId") String projectId, //
 			@RequestParam(value = "name") String name, //
@@ -103,7 +103,7 @@ public class OverlayController extends BaseController {
 	}
 
 	@RequestMapping(value = "/projects/{projectId}/overlays/{overlayId}", method = { RequestMethod.DELETE }, produces = { MediaType.APPLICATION_JSON_VALUE })
-	public Map<String, Object> removeOverlay( //
+	public Map<String, Object> removeOverlay(//
 			@CookieValue(value = Configuration.AUTH_TOKEN) String token, //
 			@PathVariable(value = "projectId") String projectId, //
 			@PathVariable(value = "overlayId") String overlayId //
@@ -112,7 +112,7 @@ public class OverlayController extends BaseController {
 	}
 
 	@RequestMapping(value = "/projects/{projectId}/overlays/{overlayId}", method = { RequestMethod.PATCH }, produces = { MediaType.APPLICATION_JSON_VALUE })
-	public LayoutView updateOverlay( //
+	public LayoutView updateOverlay(//
 			@RequestBody String body, //
 			@PathVariable(value = "projectId") String projectId, //
 			@PathVariable(value = "overlayId") String overlayId, //
@@ -125,7 +125,7 @@ public class OverlayController extends BaseController {
 
 	@RequestMapping(value = "/projects/{projectId}/overlays/{overlayId}:downloadSource", method = { RequestMethod.GET },
 			produces = { MediaType.APPLICATION_JSON_VALUE })
-	public ResponseEntity<byte[]> getOverlaySource( //
+	public ResponseEntity<byte[]> getOverlaySource(//
 			@CookieValue(value = Configuration.AUTH_TOKEN) String token, //
 			@PathVariable(value = "projectId") String projectId, //
 			@PathVariable(value = "overlayId") String overlayId //
diff --git a/service/src/main/java/lcsb/mapviewer/services/impl/ModelService.java b/service/src/main/java/lcsb/mapviewer/services/impl/ModelService.java
index 9544bbeb5b..ed690aaad7 100644
--- a/service/src/main/java/lcsb/mapviewer/services/impl/ModelService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/impl/ModelService.java
@@ -38,8 +38,6 @@ import lcsb.mapviewer.persist.dao.map.ModelDao;
 import lcsb.mapviewer.services.interfaces.ILayoutService;
 import lcsb.mapviewer.services.interfaces.IModelService;
 import lcsb.mapviewer.services.interfaces.IUserService;
-import lcsb.mapviewer.services.search.data.FullAliasView;
-import lcsb.mapviewer.services.search.data.FullAliasViewFactory;
 import lcsb.mapviewer.services.search.data.LightAliasView;
 import lcsb.mapviewer.services.search.data.LightAliasViewFactory;
 import lcsb.mapviewer.services.search.data.LightReactionView;
diff --git a/service/src/main/java/lcsb/mapviewer/services/interfaces/IModelService.java b/service/src/main/java/lcsb/mapviewer/services/interfaces/IModelService.java
index 67952223b4..43cc0ff508 100644
--- a/service/src/main/java/lcsb/mapviewer/services/interfaces/IModelService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/interfaces/IModelService.java
@@ -7,7 +7,6 @@ import lcsb.mapviewer.common.Pair;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelData;
 import lcsb.mapviewer.model.user.User;
-import lcsb.mapviewer.services.search.data.FullAliasView;
 import lcsb.mapviewer.services.search.data.LightAliasView;
 import lcsb.mapviewer.services.search.data.LightReactionView;
 import lcsb.mapviewer.services.view.AuthenticationToken;
diff --git a/service/src/main/java/lcsb/mapviewer/services/interfaces/IUserService.java b/service/src/main/java/lcsb/mapviewer/services/interfaces/IUserService.java
index 704b6abb7a..bc59fb9104 100644
--- a/service/src/main/java/lcsb/mapviewer/services/interfaces/IUserService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/interfaces/IUserService.java
@@ -4,7 +4,6 @@ import java.util.Collection;
 import java.util.List;
 
 import lcsb.mapviewer.commands.ColorExtractor;
-import lcsb.mapviewer.model.Project;
 import lcsb.mapviewer.model.user.BasicPrivilege;
 import lcsb.mapviewer.model.user.PrivilegeType;
 import lcsb.mapviewer.model.user.User;
diff --git a/service/src/main/java/lcsb/mapviewer/services/search/SearchResultFactory.java b/service/src/main/java/lcsb/mapviewer/services/search/SearchResultFactory.java
index e1a59f32d3..ee446efa7e 100644
--- a/service/src/main/java/lcsb/mapviewer/services/search/SearchResultFactory.java
+++ b/service/src/main/java/lcsb/mapviewer/services/search/SearchResultFactory.java
@@ -1,26 +1,16 @@
 package lcsb.mapviewer.services.search;
 
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
 import lcsb.mapviewer.annotation.data.Article;
-import lcsb.mapviewer.annotation.data.TargetType;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.species.Element;
-import lcsb.mapviewer.model.map.species.Complex;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.Species;
 import lcsb.mapviewer.services.search.data.ElementIdentifier;
 import lcsb.mapviewer.services.search.data.ElementIdentifier.ElementIdentifierType;
 import lcsb.mapviewer.services.search.db.GeneRow;
@@ -62,10 +52,10 @@ public abstract class SearchResultFactory<T, S extends ISearchResultView> extend
 	 * {@link lcsb.mapviewer.services.view.AnnotationView} elements.
 	 */
 	@Autowired
-	private AnnotationViewFactory annotationViewFactory;
+	private AnnotationViewFactory	annotationViewFactory;
 
 	@Autowired
-	private ElementMatcher elementMatcher;
+	private ElementMatcher				elementMatcher;
 
 	/**
 	 * Returns detailed information about element respective to the set of targets
@@ -114,12 +104,10 @@ public abstract class SearchResultFactory<T, S extends ISearchResultView> extend
 		return null;
 	}
 
-
 	protected boolean elementMatch(TargetView target, Element element) {
 		return elementMatcher.elementMatch(target, element);
 	}
 
-
 	/**
 	 * @return the annotationViewFactory
 	 * @see #annotationViewFactory
@@ -137,7 +125,6 @@ public abstract class SearchResultFactory<T, S extends ISearchResultView> extend
 		this.annotationViewFactory = annotationViewFactory;
 	}
 
-
 	/**
 	 * @return the elementMatcher
 	 * @see #elementMatcher
@@ -146,9 +133,9 @@ public abstract class SearchResultFactory<T, S extends ISearchResultView> extend
 		return elementMatcher;
 	}
 
-
 	/**
-	 * @param elementMatcher the elementMatcher to set
+	 * @param elementMatcher
+	 *          the elementMatcher to set
 	 * @see #elementMatcher
 	 */
 	public void setElementMatcher(ElementMatcher elementMatcher) {
-- 
GitLab