From 0eff3a993fe91673ee402dee3ea1ff835a5ac8c2 Mon Sep 17 00:00:00 2001
From: "piotr.gawron" <piotr.gawron@uni-new>
Date: Mon, 26 Sep 2016 11:10:15 +0200
Subject: [PATCH] temp commit - species alias is abstract and there are
 specific alias classes for all species

---
 .../copypaste/CopyPasteAbstractAction.java    |  370 +-
 .../cache/ApplicationLevelCache.java          |  286 +-
 .../annotation/cache/CachableInterface.java   |  512 +--
 .../annotation/cache/CacheException.java      |   50 +-
 .../cache/GeneralCacheWithExclusion.java      |  186 +-
 .../cache/PermanentDatabaseLevelCache.java    | 1122 ++---
 .../PermanentDatabaseLevelCacheInterface.java |  102 +-
 .../annotation/cache/SourceNotAvailable.java  |   98 +-
 .../annotation/cache/XmlSerializer.java       |  198 +-
 .../lcsb/mapviewer/annotation/data/Drug.java  |  576 +--
 .../lcsb/mapviewer/annotation/data/MeSH.java  |  338 +-
 .../mapviewer/annotation/data/Target.java     |  458 +-
 .../mapviewer/annotation/data/TargetType.java |  106 +-
 .../services/ChemicalSearchException.java     |   96 +-
 .../annotation/services/DrugAnnotation.java   |  226 +-
 .../services/DrugSearchException.java         |   96 +-
 .../services/DrugbankXMLParser.java           |  806 ++--
 .../services/ExternalServiceStatus.java       |  182 +-
 .../services/ExternalServiceStatusType.java   |  130 +-
 .../annotation/services/MeSHParser.java       |  474 +--
 .../services/MiRNASearchException.java        |   94 +-
 .../annotation/services/MiriamConnector.java  |  562 +--
 .../services/ProblematicAnnotation.java       |   34 +-
 .../services/TaxonomySearchException.java     |   60 +-
 .../services/annotators/EnsemblAnnotator.java |   13 +-
 .../services/annotators/EntrezAnnotator.java  |    8 +-
 .../services/annotators/HgncAnnotator.java    |    5 +-
 .../services/annotators/ReconAnnotator.java   |    4 +-
 .../annotation/cache/AllCacheTests.java       |   38 +-
 .../cache/ApplicationLevelCacheTest.java      |  242 +-
 .../cache/CachableInterfaceTest.java          |  228 +-
 .../annotation/cache/GeneralCacheTest.java    |  274 +-
 .../cache/GeneralCacheWithExclusionTest.java  |  266 +-
 .../annotation/cache/MockCacheInterface.java  |   66 +-
 .../cache/SourceNotAvailableTest.java         |   60 +-
 .../cache/WebPageDownloaderTest.java          |  130 +-
 .../data/ArticleCitationComparatorTest.java   |   94 +-
 .../data/ChemicalDirectEvidenceTest.java      |   62 +-
 .../annotation/data/ChemicalTest.java         |  134 +-
 .../mapviewer/annotation/data/DrugTest.java   |  236 +-
 .../mapviewer/annotation/data/MeSHTest.java   |  180 +-
 .../mapviewer/annotation/data/TargetTest.java |  130 +-
 .../annotation/data/TargetTypeTest.java       |   64 +-
 .../annotation/services/AllServicesTests.java |   68 +-
 .../services/ChemicalSearchExceptionTest.java |   60 +-
 .../services/DrugAnnotationTest.java          |  144 +-
 .../services/DrugbankXMLParserTest.java       |  292 +-
 .../services/ExternalServiceStatusTest.java   |   68 +-
 .../ExternalServiceStatusTypeTest.java        |   66 +-
 .../services/ImproperAnnotationsTest.java     |   10 +-
 .../annotation/services/MeSHParserTest.java   |  438 +-
 .../services/MiRNASearchExceptionTest.java    |   78 +-
 .../services/MiriamConnectorTest.java         |  764 ++--
 .../services/MissingAnnotationTest.java       |    6 +-
 .../MissingRequiredAnnotationsTest.java       |    8 +-
 .../services/ModelAnnotatorTest.java          |   13 +-
 .../annotators/ChebiAnnotatorTest.java        |   65 +-
 .../annotators/ElementAnnotatorTest.java      |   12 +-
 .../annotators/EnsemblAnnotatorTest.java      |   13 +-
 .../annotators/EntrezAnnotatorTest.java       |    9 +-
 .../annotators/HgncAnnotatorTest.java         |   13 +-
 .../annotators/ReconAnnotatorTest.java        |    5 +-
 .../annotators/UniprotAnnotatorTest.java      |   22 +-
 .../common/geometry/LineTransformation.java   |  398 +-
 .../lcsb/mapviewer/run/ConsoleConverter.java  |   27 +-
 .../java/lcsb/mapviewer/run/DiabetesTest.java |   26 +-
 .../celldesigner/CellDesignerXmlParser.java   | 1338 +++---
 .../alias/ComplexAliasXmlParser.java          |  564 +--
 .../alias/SpeciesAliasXmlParser.java          |  482 ++-
 .../annotation/RestAnnotationParser.java      |   18 +
 .../ProteinCellDesignerAliasConverter.java    |  441 +-
 .../species/AntisenseRnaXmlParser.java        |    3 +-
 .../celldesigner/species/GeneXmlParser.java   |    3 +-
 .../species/ProteinXmlParser.java             |    2 +-
 .../celldesigner/species/RnaXmlParser.java    |    3 +-
 .../species/SpeciesCollectionXmlParser.java   |    3 +-
 .../celldesigner/species/SpeciesMapping.java  |  332 +-
 .../species/SpeciesSbmlParser.java            |    3 +-
 .../CellDesignerTestFunctions.java            |  456 +-
 .../CellDesignerXmlParserTest.java            |   29 +-
 .../celldesigner/ComplexParserTests.java      |  753 ++--
 .../celldesigner/LayerXmlParserTest.java      |  917 ++--
 .../alias/AliasCollectionXmlParserTest.java   |  646 +--
 .../alias/ComplexAliasXmlParserTest.java      |  157 +-
 .../alias/SpeciesAliasXmlParserTest.java      |  674 +--
 .../annotation/RestAnnotationParserTest.java  |   28 +-
 ...bstractCellDesignerAliasConverterTest.java |  165 +-
 ...enseRnaCellDesignerAliasConverterTest.java |  115 +-
 .../CellDesignerAliasConverterTest.java       |   99 +-
 ...egradedCellDesignerAliasConverterTest.java |  113 +-
 .../GeneCellDesignerAliasConverterTest.java   |  146 +-
 .../IonCellDesignerAliasConverterTest.java    |  114 +-
 ...ProteinCellDesignerAliasConverterTest.java |  143 +-
 .../geometry/ProteinConverterTest.java        |  106 +-
 .../RnaCellDesignerAliasConverterTest.java    |  115 +-
 ...oleculeCellDesignerAliasConverterTest.java |  191 +-
 ...UnknownCellDesignerAliasConverterTest.java |   99 +-
 .../ReactionCollectionXmlParserTest.java      |  488 +--
 .../reaction/ReactionFromXmlTest.java         | 1490 ++++---
 .../reaction/ReactionParserTests.java         | 3673 +++++++++--------
 .../reaction/ReactionToXmlTest.java           |  484 ++-
 .../species/ComplexParserTest.java            |  797 ++--
 .../species/SpeciesCollectionTest.java        |  241 +-
 .../SpeciesCollectionXmlParserTest.java       | 1207 +++---
 .../species/SpeciesSbmlParserTest.java        | 2360 +++++------
 .../types/ModifierTypeUtilsTest.java          |  533 +--
 .../model/sbgnml/SbgnmlXmlParser.java         | 3109 +++++++-------
 .../converter/graphics/AliasConverter.java    |  480 +--
 .../converter/graphics/IAliasConverter.java   |  146 +-
 .../graphics/species/ComplexConverter.java    |  356 +-
 .../graphics/species/ProteinConverter.java    |  876 ++--
 .../graphics/species/SpeciesConverter.java    | 1190 +++---
 .../graphics/NormalImageGeneratorTest.java    |  479 ++-
 .../graphics/PdfImageGeneratorTest.java       |    3 +-
 .../species/SpeciesConverterTest.java         |  389 +-
 .../converter/zip/ZipEntryFileFactory.java    |  468 +--
 .../converter/ComplexZipConverterTest.java    |   36 +-
 .../commands/ColorModelCommandTest.java       |   23 +-
 .../commands/CommandTestFunctions.java        |   20 +-
 .../mapviewer/commands/CopyCommandTest.java   |   25 +-
 .../ChangeElementMiriamDataCommandTest.java   |  176 +-
 .../mapviewer/model/cache/BigFileEntry.java   |  232 +-
 .../lcsb/mapviewer/model/cache/CacheType.java |  204 +-
 .../lcsb/mapviewer/model/cache/FileEntry.java |  344 +-
 .../model/cache/UploadedFileEntry.java        |   80 +-
 .../model/graphics/ArrowTypeData.java         |  368 +-
 .../model/graphics/PolylineData.java          | 1070 ++---
 .../graphics/PolylineDataComparator.java      |  262 +-
 .../lcsb/mapviewer/model/log/LogType.java     |  120 +-
 .../mapviewer/model/map/AnnotatedObject.java  |  284 +-
 .../model/map/ElementComparator.java          |  368 +-
 .../model/map/MiriamRelationType.java         |  224 +-
 .../lcsb/mapviewer/model/map/MiriamType.java  | 1308 +++---
 .../mapviewer/model/map/OverviewImage.java    |  462 +--
 .../model/map/OverviewImageLink.java          |  154 +-
 .../model/map/OverviewLinkComparator.java     |  218 +-
 .../model/map/OverviewModelLink.java          |  370 +-
 .../model/map/OverviewSearchLink.java         |  148 +-
 .../map/layout/alias/AntisenseRnaAlias.java   |   38 +
 .../alias/AntisenseRnaAliasComparator.java    |   83 +
 .../model/map/layout/alias/ChemicalAlias.java |   23 +
 .../layout/alias/ChemicalAliasComparator.java |   92 +
 .../model/map/layout/alias/ComplexAlias.java  |  323 +-
 .../model/map/layout/alias/DegradedAlias.java |   37 +
 .../layout/alias/DegradedAliasComparator.java |   83 +
 .../model/map/layout/alias/DrugAlias.java     |   31 +
 .../map/layout/alias/DrugAliasComparator.java |   83 +
 .../model/map/layout/alias/GeneAlias.java     |   37 +
 .../map/layout/alias/GeneAliasComparator.java |   83 +
 .../map/layout/alias/GenericProteinAlias.java |   36 +
 .../alias/GenericProteinAliasComparator.java  |   84 +
 .../model/map/layout/alias/IonAlias.java      |   32 +
 .../map/layout/alias/IonAliasComparator.java  |   83 +
 .../layout/alias/IonChannelProteinAlias.java  |   32 +
 .../IonChannelProteinAliasComparator.java     |   83 +
 .../map/layout/alias/PhenotypeAlias.java      |   32 +
 .../alias/PhenotypeAliasComparator.java       |   83 +
 .../model/map/layout/alias/ProteinAlias.java  |   29 +
 .../layout/alias/ProteinAliasComparator.java  |  100 +
 .../layout/alias/ReceptorProteinAlias.java    |   32 +
 .../alias/ReceptorProteinAliasComparator.java |   83 +
 .../model/map/layout/alias/RnaAlias.java      |   32 +
 .../map/layout/alias/RnaAliasComparator.java  |   83 +
 .../map/layout/alias/SimpleMoleculeAlias.java |   37 +
 .../alias/SimpleMoleculeAliasComparator.java  |   83 +
 .../model/map/layout/alias/SpeciesAlias.java  |  614 +--
 .../layout/alias/SpeciesAliasComparator.java  |  288 +-
 .../layout/alias/TruncatedProteinAlias.java   |   32 +
 .../TruncatedProteinAliasComparator.java      |   83 +
 .../model/map/layout/alias/UnknownAlias.java  |   32 +
 .../layout/alias/UnknownAliasComparator.java  |   83 +
 .../model/map/reaction/Modifier.java          |  132 +-
 .../mapviewer/model/map/reaction/Product.java |  132 +-
 .../model/map/reaction/Reactant.java          |  130 +-
 .../model/map/reaction/Reaction.java          | 1760 ++++----
 .../model/map/species/AntisenseRna.java       |  312 +-
 .../map/species/AntisenseRnaComparator.java   |  206 +-
 .../model/map/species/ComplexSpecies.java     |  340 +-
 .../map/species/ComplexSpeciesComparator.java |  382 +-
 .../mapviewer/model/map/species/Degraded.java |  106 +-
 .../model/map/species/DegradedComparator.java |  164 +-
 .../mapviewer/model/map/species/Drug.java     |  106 +-
 .../model/map/species/DrugComparator.java     |  162 +-
 .../mapviewer/model/map/species/Gene.java     |  250 +-
 .../model/map/species/GeneComparator.java     |  210 +-
 .../model/map/species/GenericProtein.java     |   94 +-
 .../lcsb/mapviewer/model/map/species/Ion.java |  108 +-
 .../model/map/species/IonComparator.java      |  166 +-
 .../model/map/species/Phenotype.java          |  212 +-
 .../map/species/PhenotypeComparator.java      |  212 +-
 .../mapviewer/model/map/species/Protein.java  |  320 +-
 .../lcsb/mapviewer/model/map/species/Rna.java |  306 +-
 .../model/map/species/RnaComparator.java      |  210 +-
 .../model/map/species/SimpleMolecule.java     |  122 +-
 .../map/species/SimpleMoleculeComparator.java |  224 +-
 .../mapviewer/model/map/species/Species.java  |  952 ++---
 .../mapviewer/model/map/species/Unknown.java  |  102 +-
 .../model/map/species/UnknownComparator.java  |  164 +-
 .../mapviewer/model/user/PrivilegeType.java   |  320 +-
 .../user/UserClassRequiredAnnotations.java    |  460 +--
 .../mapviewer/model/cache/AllCacheTests.java  |   32 +-
 .../model/cache/BigFileEntryTest.java         |  132 +-
 .../mapviewer/model/cache/CacheQueryTest.java |  138 +-
 .../mapviewer/model/cache/CacheTypeTest.java  |  100 +-
 .../model/cache/UploadedFileEntryTest.java    |   66 +-
 .../model/graphics/AllGraphicsTests.java      |   36 +-
 .../graphics/ArrowTypeDataComparatorTest.java |  144 +-
 .../model/graphics/ArrowTypeDataTest.java     |  158 +-
 .../model/graphics/ArrowTypeTest.java         |   58 +-
 .../model/graphics/LineTypeTest.java          |   60 +-
 .../graphics/PolylineDataComparatorTest.java  |  222 +-
 .../model/graphics/PolylineDataTest.java      |  842 ++--
 .../lcsb/mapviewer/model/log/LogTypeTest.java |   58 +-
 .../mapviewer/model/log/ObjectLogTest.java    |  130 +-
 .../map/AliasInFewParentsExceptionTest.java   |   56 +-
 .../lcsb/mapviewer/model/map/AllMapTests.java |   96 +-
 .../lcsb/mapviewer/model/map/CommentTest.java |  180 +-
 .../model/map/ElementComparatorTest.java      |  506 +--
 .../lcsb/mapviewer/model/map/ElementTest.java |  326 +-
 .../map/InconsistentModelExceptionTest.java   |   56 +-
 .../model/map/LayoutComparatorTest.java       |  278 +-
 .../mapviewer/model/map/MiriamDataTest.java   |  250 +-
 .../model/map/MiriamRelationTypeTest.java     |   76 +-
 .../map/MiriamTypeNameComparatorTest.java     |   92 +-
 .../mapviewer/model/map/MiriamTypeTest.java   |  246 +-
 .../map/OverviewImageComparatorTest.java      |  184 +-
 .../map/OverviewImageLinkComparatorTest.java  |  156 +-
 .../model/map/OverviewImageLinkTest.java      |  126 +-
 .../model/map/OverviewImageTest.java          |  164 +-
 .../model/map/OverviewLinkComparatorTest.java |  186 +-
 .../mapviewer/model/map/OverviewLinkTest.java |  146 +-
 .../map/OverviewModelLinkComparatorTest.java  |  178 +-
 .../model/map/OverviewModelLinkTest.java      |  196 +-
 .../model/map/OverviewSearchLinkTest.java     |  174 +-
 .../agregator/CompartmentComparatorTest.java  |  242 +-
 .../model/map/agregator/CompartmentTest.java  |  294 +-
 .../map/layout/alias/AliasComparatorTest.java |  196 +-
 .../map/layout/alias/AliasGroupTest.java      |  126 +-
 .../model/map/layout/alias/AliasTest.java     |  602 +--
 .../alias/CompartmentAliasComparatorTest.java |  440 +-
 .../layout/alias/CompartmentAliasTest.java    |  850 ++--
 .../alias/ComplexAliasComparatorTest.java     |  399 +-
 .../map/layout/alias/ComplexAliasTest.java    |  303 +-
 .../map/layout/alias/SearchIndexTest.java     |  250 +-
 .../alias/SpeciesAliasComparatorTest.java     |  318 +-
 .../map/layout/alias/SpeciesAliasTest.java    |  138 +-
 ...AliasSubmodelConnectionComparatorTest.java |  266 +-
 .../model/map/model/ModelComparatorTest.java  | 1132 ++---
 .../model/map/model/ModelDataTest.java        |  908 ++--
 .../model/map/model/ModelFullIndexedTest.java |   81 +-
 ...ModelSubmodelConnectionComparatorTest.java |  231 +-
 .../mapviewer/model/map/model/ModelTest.java  |   47 +-
 .../SubmodelConnectionComparatorTest.java     |  387 +-
 .../model/map/modifier/CatalysisTest.java     |  181 +-
 .../model/map/modifier/InhibitionTest.java    |  182 +-
 .../model/map/modifier/ModulationTest.java    |  180 +-
 .../map/modifier/PhysicalStimulationTest.java |  181 +-
 .../model/map/modifier/TriggerTest.java       |  181 +-
 .../map/modifier/UnknownCatalysisTest.java    |  181 +-
 .../map/modifier/UnknownInhibitionTest.java   |  180 +-
 .../reaction/NodeOperatorComparatorTest.java  |  328 +-
 .../map/reaction/ReactionComparatorTest.java  |   21 +-
 .../reaction/ReactionNodeComparatorTest.java  |  251 +-
 .../model/map/reaction/ReactionTest.java      |  857 ++--
 .../species/AntisenseRnaComparatorTest.java   |  228 +-
 .../model/map/species/AntisenseRnaTest.java   |  326 +-
 .../species/ComplexSpeciesComparatorTest.java |  600 +--
 .../model/map/species/ComplexSpeciesTest.java |  278 +-
 .../map/species/DegradedComparatorTest.java   |  200 +-
 .../model/map/species/DegradedTest.java       |  168 +-
 .../model/map/species/DrugComparatorTest.java |  184 +-
 .../mapviewer/model/map/species/DrugTest.java |  172 +-
 .../model/map/species/GeneComparatorTest.java |  234 +-
 .../mapviewer/model/map/species/GeneTest.java |  264 +-
 .../model/map/species/GenericProteinTest.java |  144 +-
 .../map/species/IonChannelProteinTest.java    |  146 +-
 .../model/map/species/IonComparatorTest.java  |  182 +-
 .../mapviewer/model/map/species/IonTest.java  |  172 +-
 .../map/species/PhenotypeComparatorTest.java  |  266 +-
 .../model/map/species/PhenotypeTest.java      |  198 +-
 .../map/species/ProteinComparatorTest.java    |  222 +-
 .../model/map/species/ProteinTest.java        |  302 +-
 .../map/species/ReceptorProteinTest.java      |  146 +-
 .../model/map/species/RnaComparatorTest.java  |  232 +-
 .../species/SimpleMoleculeComparatorTest.java |  262 +-
 .../model/map/species/SimpleMoleculeTest.java |  172 +-
 .../map/species/SpeciesComparatorTest.java    |  356 +-
 .../map/species/TruncatedProteinTest.java     |  146 +-
 .../map/species/UnknownComparatorTest.java    |  184 +-
 .../model/map/species/UnknownTest.java        |  168 +-
 .../mapviewer/model/user/AllUserTests.java    |   46 +-
 .../model/user/BasicPrivilegeTest.java        |  130 +-
 .../user/ConfigurationElementTypeTest.java    |   60 +-
 .../model/user/ExternalProjectTest.java       |   84 +-
 .../model/user/ObjectPrivilegeTest.java       |  192 +-
 .../model/user/PrivilegeTypeTest.java         |   68 +-
 .../model/user/UserAnnotationSchemaTest.java  |  396 +-
 .../model/user/UserClassAnnotatorsTest.java   |  142 +-
 .../UserClassRequiredAnnotationsTest.java     |  194 +-
 .../user/UserClassValidAnnotationsTest.java   |  160 +-
 .../lcsb/mapviewer/model/user/UserTest.java   |  204 +-
 .../modelutils/map/AllMapUtilTests.java       |   28 +-
 .../modelutils/map/ClassTreeNodeTest.java     |   86 +-
 .../map/RequireAnnotationMapTest.java         |   58 +-
 .../wikipathway/XML/BiopaxParser.java         |  528 +--
 .../wikipathway/XML/DataNodeParser.java       |  400 +-
 .../wikipathway/XML/EdgeLineParser.java       |  184 +-
 .../mapviewer/wikipathway/XML/EdgeParser.java | 1158 +++---
 .../wikipathway/XML/ElementGpmlParser.java    |  278 +-
 .../wikipathway/XML/GPMLToModel.java          |  124 +-
 .../mapviewer/wikipathway/XML/GpmlParser.java | 1314 +++---
 .../XML/GraphicalPathwayElementParser.java    |  154 +-
 .../wikipathway/XML/LabelParser.java          |  356 +-
 .../wikipathway/XML/ModelContructor.java      |   12 +-
 .../wikipathway/XML/PointDataParser.java      |  136 +-
 .../wikipathway/XML/ReferenceParser.java      |  324 +-
 .../wikipathway/XML/ShapeParser.java          |  392 +-
 .../wikipathway/XML/StateParser.java          |  342 +-
 .../mapviewer/wikipathway/model/Edge.java     |  938 ++---
 .../wikipathway/model/InteractionMapping.java | 1028 ++---
 .../wikipathway/XML/BiopaxParserTest.java     |  124 +-
 .../mapviewer/wikipathway/XML/BugTest.java    |  138 +-
 .../wikipathway/XML/DataNodeParserTest.java   |  118 +-
 .../wikipathway/XML/EdgeLineParserTest.java   |  110 +-
 .../XML/ElementGpmlParserTest.java            |  108 +-
 .../wikipathway/XML/GpmlParserTest.java       |  300 +-
 .../wikipathway/XML/LabelParserTest.java      |  144 +-
 .../wikipathway/XML/ModelToGPMLTest.java      |  200 +-
 .../wikipathway/XML/ReferenceParserTest.java  |  316 +-
 .../wikipathway/XML/ShapeParserTest.java      |  430 +-
 .../wikipathway/XML/StateParserTest.java      |   88 +-
 persist/src/db/10.0.2/fix_db_20160926.sql     |   35 +
 .../lcsb/mapviewer/persist/dao/BaseDao.java   |  586 +--
 .../persist/dao/ConfigurationDao.java         |  104 +-
 .../mapviewer/persist/dao/ProjectDao.java     |  134 +-
 .../persist/mapper/Point2DMapper.java         |  252 +-
 .../resources/applicationContext-persist.xml  |   15 +
 .../mapviewer/persist/dao/AllDaoTests.java    |   50 +-
 .../mapviewer/persist/dao/BaseDaoTest.java    |   90 +-
 .../persist/dao/ConfigurationDaoTest.java     |  100 +-
 .../mapviewer/persist/dao/ProjectDaoTest.java |  557 +--
 .../persist/dao/map/CommentDaoTest.java       |  423 +-
 .../persist/dao/map/LayoutDaoTest.java        |  511 +--
 .../persist/dao/map/ModelDaoTest.java         |  966 ++---
 .../dao/map/layout/alias/AliasDaoTest.java    |  321 +-
 .../dao/map/species/AntisenseRnaTest.java     |  192 +-
 .../persist/dao/map/species/RnaTest.java      |  190 +-
 .../dao/map/species/SpeciesDaoTest.java       |  670 +--
 .../persist/mapper/Point2DMapperTest.java     |  120 +-
 .../mapviewer/reactome/utils/ElementUtil.java |  202 +-
 .../reactome/utils/ReactomeConnector.java     | 1552 +++----
 .../services/impl/DataMiningService.java      | 1060 ++---
 .../services/impl/ExporterService.java        | 2222 +++++-----
 .../interfaces/IDataMiningService.java        |  304 +-
 .../services/interfaces/ILayoutService.java   |  988 ++---
 .../services/interfaces/ISearchService.java   |  640 +--
 .../services/search/ISearchResultView.java    |   62 +-
 .../services/search/SearchResultFactory.java  |  440 +-
 .../search/comment/FullCommentView.java       |  194 +-
 .../search/data/LightReactionView.java        |  396 +-
 .../search/data/SearchElementResult.java      |  258 +-
 .../services/utils/ColorSchemaReader.java     | 1350 +++---
 .../services/utils/ColorSchemaXlsxReader.java |  674 +--
 .../services/utils/CreateProjectParams.java   | 1406 +++----
 .../services/utils/SearchIndexer.java         |  382 +-
 .../view/ReferenceGenomeGeneMappingView.java  |  250 +-
 ...ReferenceGenomeGeneMappingViewFactory.java |  118 +-
 .../services/view/ReferenceGenomeView.java    |  386 +-
 .../view/ReferenceGenomeViewFactory.java      |  148 +-
 .../services/view/UserViewFactory.java        |  476 +--
 .../services/impl/AllImplServiceTests.java    |   48 +-
 .../services/impl/DataMiningServiceTest.java  |  387 +-
 .../services/impl/DataMiningServiceTest2.java |  404 +-
 .../impl/ExternalServicesServiceTest.java     |  134 +-
 .../services/impl/FailServiceMock.java        |   32 +-
 .../services/impl/LayoutServiceTest.java      |  922 ++---
 .../services/impl/ModelServiceTest.java       |  326 +-
 .../services/impl/OkServiceMock.java          |   32 +-
 .../services/impl/SearchServiceTest.java      |  998 +++--
 .../services/impl/UserServiceTest.java        |  904 ++--
 .../services/search/AllSearchTests.java       |   40 +-
 .../search/SearchResultFactoryTest.java       |  122 +-
 .../search/data/FullAliasViewFactoryTest.java |  516 +--
 .../data/LightAliasViewFactoryTest.java       |   85 +-
 .../search/db/drug/DrugServiceTest.java       |  653 +--
 .../FullLayoutAliasViewFactoryTest.java       |  104 +-
 .../LightLayoutAliasViewFactoryTest.java      |   93 +-
 .../services/utils/AllUtilsTests.java         |   40 +-
 .../services/utils/ColorSchemaReaderTest.java |  492 +--
 .../utils/ColorSchemaReaderXlsTest.java       |  270 +-
 .../utils/ColorSchemaReaderXlsxTest.java      |  270 +-
 ...renceGenomeGeneMappingViewFactoryTest.java |  110 +-
 .../view/ReferenceGenomeViewFactoryTest.java  |  110 +-
 .../JsfAjaxAccessControlAllowFilter.java      |   88 +-
 .../bean/utils/XFrameAccessControlFilter.java |  102 +-
 395 files changed, 59057 insertions(+), 57251 deletions(-)
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/AntisenseRnaAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/AntisenseRnaAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ChemicalAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ChemicalAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DegradedAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DegradedAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DrugAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DrugAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GeneAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GeneAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GenericProteinAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GenericProteinAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonChannelProteinAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonChannelProteinAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/PhenotypeAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/PhenotypeAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ProteinAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ProteinAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ReceptorProteinAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ReceptorProteinAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/RnaAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/RnaAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SimpleMoleculeAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SimpleMoleculeAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/TruncatedProteinAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/TruncatedProteinAliasComparator.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/UnknownAlias.java
 create mode 100644 model/src/main/java/lcsb/mapviewer/model/map/layout/alias/UnknownAliasComparator.java
 create mode 100644 persist/src/db/10.0.2/fix_db_20160926.sql

diff --git a/CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/CopyPasteAbstractAction.java b/CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/CopyPasteAbstractAction.java
index e9ae8a4ab6..e42071cd28 100644
--- a/CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/CopyPasteAbstractAction.java
+++ b/CellDesigner-plugin/src/main/java/lcsb/mapviewer/cdplugin/copypaste/CopyPasteAbstractAction.java
@@ -1,186 +1,186 @@
-package lcsb.mapviewer.cdplugin.copypaste;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import jp.sbi.celldesigner.MainWindow;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.XmlParser;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.converter.model.celldesigner.annotation.XmlAnnotationParser;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-
-import org.apache.log4j.Logger;
-
-/**
- * This abstract class defines common function for {@link CopyAction} and
- * {@link PasteAction}.
- * 
- * @author Piotr Gawron
- * 
- */
-public class CopyPasteAbstractAction extends XmlParser {
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private final Logger				logger	= Logger.getLogger(CopyPasteAbstractAction.class);
-
-	/**
-	 * Prefix used for serialization/deserialization of {@link MiriamData} to
-	 * string stored in system clipboard.
-	 */
-	private static final String	PREFIX	= "[MIRIAM]";
-	/**
-	 * Plugin object which ran this action. This object is used to update
-	 * information about species
-	 */
-	private CopyPastePlugin			plug;
-	/**
-	 * Object of CellDesigner main form.
-	 */
-	private MainWindow					window;
-
-	/**
-	 * Serializes {@link MiriamData} into string that will be stored into system
-	 * clipboard.
-	 * 
-	 * @param md
-	 *          object to serialize
-	 * @return string representation of {@link MiriamData}
-	 */
-	protected String serialize(MiriamData md) {
-		return PREFIX + "\t" + md.getRelationType().getStringRepresentation() + "\t" + md.getDataType().getUris().get(0) + "\t" + md.getResource();
-	}
-
-	/**
-	 * Deserialize {@link MiriamData} from string creted by
-	 * {@link #serialize(MiriamData)} method.
-	 * 
-	 * @param string
-	 *          string representation of {@link MiriamData}
-	 * @return {@link MiriamData} obtained from input string
-	 */
-	protected MiriamData deserialize(String string) {
-		if (string == null) {
-			return null;
-		}
-		String[] tmp = string.split("\t");
-
-		// CHECKSTYLE:OFF
-		if (tmp.length == 4) {
-			if (PREFIX.equals(tmp[0])) {
-				String relation = tmp[1];
-				String uri = tmp[2];
-				String resource = tmp[3];
-				MiriamType mt = MiriamType.getTypeByUri(uri);
-				MiriamRelationType mrt = MiriamRelationType.getTypeByStringRepresentation(relation);
-				if (mt == null || mrt == null) {
-					return null;
-				}
-				return new MiriamData(mrt, mt, resource);
-			}
-		}
-		// CHECKSTYLE:ON
-		return null;
-	}
-
-	/**
-	 * Returns serialized string of annotations and notes.
-	 * 
-	 * @param annotationString
-	 *          xml string representing annotations in CellDesigner
-	 * @param notesString
-	 *          flat notes String
-	 * @return serialized string
-	 * @throws InvalidXmlSchemaException
-	 *           thrown when xmlString is invalid
-	 */
-	protected String getCopyString(String annotationString, String notesString) throws InvalidXmlSchemaException {
-		XmlAnnotationParser xap = new XmlAnnotationParser();
-		Set<MiriamData> set = xap.parse(annotationString);
-		StringBuilder result = new StringBuilder();
-		for (MiriamData md : set) {
-			result.append(serialize(md) + "\n");
-		}
-		result.append(notesString);
-		return result.toString();
-	}
-
-	/**
-	 * Deserialize string created by {@link #getCopyString(String, String)}
-	 * method. Used to create {@link MiriamData} set and notes from clipboard.
-	 * 
-	 * @param value
-	 *          string for deserialization
-	 * 
-	 * @return {@link Pair} of {@link MiriamData} set and notes string
-	 */
-	protected Pair<Set<MiriamData>, String> getAnnotationDataFromClipboardString(String value) {
-		if (value == null) {
-			return new Pair<Set<MiriamData>, String>(null, null);
-		}
-		String[] rows = value.split("\n");
-
-		StringBuilder sb = new StringBuilder("");
-
-		boolean miriam = true;
-
-		Set<MiriamData> set = new HashSet<MiriamData>();
-		for (int i = 0; i < rows.length; i++) {
-			String row = rows[i];
-			if (miriam) {
-				MiriamData md = deserialize(row);
-				if (md != null) {
-					set.add(md);
-				} else {
-					miriam = false;
-				}
-			}
-			if (!miriam) {
-				sb.append(row);
-				sb.append("\n");
-			}
-		}
-		String notes = sb.toString().trim();
-
-		return new Pair<Set<MiriamData>, String>(set, notes);
-	}
-
-	/**
-	 * @return the plug
-	 * @see #plug
-	 */
-	protected CopyPastePlugin getPlug() {
-		return plug;
-	}
-
-	/**
-	 * @param plug
-	 *          the plug to set
-	 * @see #plug
-	 */
-	protected void setPlug(CopyPastePlugin plug) {
-		this.plug = plug;
-	}
-
-	/**
-	 * @return the window
-	 * @see #window
-	 */
-	protected MainWindow getWindow() {
-		return window;
-	}
-
-	/**
-	 * @param window
-	 *          the window to set
-	 * @see #window
-	 */
-	protected void setWindow(MainWindow window) {
-		this.window = window;
-	}
-
+package lcsb.mapviewer.cdplugin.copypaste;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import jp.sbi.celldesigner.MainWindow;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.XmlParser;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.converter.model.celldesigner.annotation.XmlAnnotationParser;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This abstract class defines common function for {@link CopyAction} and
+ * {@link PasteAction}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class CopyPasteAbstractAction extends XmlParser {
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private final Logger				logger	= Logger.getLogger(CopyPasteAbstractAction.class);
+
+	/**
+	 * Prefix used for serialization/deserialization of {@link MiriamData} to
+	 * string stored in system clipboard.
+	 */
+	private static final String	PREFIX	= "[MIRIAM]";
+	/**
+	 * Plugin object which ran this action. This object is used to update
+	 * information about species
+	 */
+	private CopyPastePlugin			plug;
+	/**
+	 * Object of CellDesigner main form.
+	 */
+	private MainWindow					window;
+
+	/**
+	 * Serializes {@link MiriamData} into string that will be stored into system
+	 * clipboard.
+	 * 
+	 * @param md
+	 *          object to serialize
+	 * @return string representation of {@link MiriamData}
+	 */
+	protected String serialize(MiriamData md) {
+		return PREFIX + "\t" + md.getRelationType().getStringRepresentation() + "\t" + md.getDataType().getUris().get(0) + "\t" + md.getResource();
+	}
+
+	/**
+	 * Deserialize {@link MiriamData} from string creted by
+	 * {@link #serialize(MiriamData)} method.
+	 * 
+	 * @param string
+	 *          string representation of {@link MiriamData}
+	 * @return {@link MiriamData} obtained from input string
+	 */
+	protected MiriamData deserialize(String string) {
+		if (string == null) {
+			return null;
+		}
+		String[] tmp = string.split("\t");
+
+		// CHECKSTYLE:OFF
+		if (tmp.length == 4) {
+			if (PREFIX.equals(tmp[0])) {
+				String relation = tmp[1];
+				String uri = tmp[2];
+				String resource = tmp[3];
+				MiriamType mt = MiriamType.getTypeByUri(uri);
+				MiriamRelationType mrt = MiriamRelationType.getTypeByStringRepresentation(relation);
+				if (mt == null || mrt == null) {
+					return null;
+				}
+				return new MiriamData(mrt, mt, resource);
+			}
+		}
+		// CHECKSTYLE:ON
+		return null;
+	}
+
+	/**
+	 * Returns serialized string of annotations and notes.
+	 * 
+	 * @param annotationString
+	 *          xml string representing annotations in CellDesigner
+	 * @param notesString
+	 *          flat notes String
+	 * @return serialized string
+	 * @throws InvalidXmlSchemaException
+	 *           thrown when xmlString is invalid
+	 */
+	protected String getCopyString(String annotationString, String notesString) throws InvalidXmlSchemaException {
+		XmlAnnotationParser xap = new XmlAnnotationParser();
+		Set<MiriamData> set = xap.parse(annotationString);
+		StringBuilder result = new StringBuilder();
+		for (MiriamData md : set) {
+			result.append(serialize(md) + "\n");
+		}
+		result.append(notesString);
+		return result.toString();
+	}
+
+	/**
+	 * Deserialize string created by {@link #getCopyString(String, String)}
+	 * method. Used to create {@link MiriamData} set and notes from clipboard.
+	 * 
+	 * @param value
+	 *          string for deserialization
+	 * 
+	 * @return {@link Pair} of {@link MiriamData} set and notes string
+	 */
+	protected Pair<Set<MiriamData>, String> getAnnotationDataFromClipboardString(String value) {
+		if (value == null) {
+			return new Pair<Set<MiriamData>, String>(null, null);
+		}
+		String[] rows = value.split("\n");
+
+		StringBuilder sb = new StringBuilder("");
+
+		boolean miriam = true;
+
+		Set<MiriamData> set = new HashSet<MiriamData>();
+		for (int i = 0; i < rows.length; i++) {
+			String row = rows[i];
+			if (miriam) {
+				MiriamData md = deserialize(row);
+				if (md != null) {
+					set.add(md);
+				} else {
+					miriam = false;
+				}
+			}
+			if (!miriam) {
+				sb.append(row);
+				sb.append("\n");
+			}
+		}
+		String notes = sb.toString().trim();
+
+		return new Pair<Set<MiriamData>, String>(set, notes);
+	}
+
+	/**
+	 * @return the plug
+	 * @see #plug
+	 */
+	protected CopyPastePlugin getPlug() {
+		return plug;
+	}
+
+	/**
+	 * @param plug
+	 *          the plug to set
+	 * @see #plug
+	 */
+	protected void setPlug(CopyPastePlugin plug) {
+		this.plug = plug;
+	}
+
+	/**
+	 * @return the window
+	 * @see #window
+	 */
+	protected MainWindow getWindow() {
+		return window;
+	}
+
+	/**
+	 * @param window
+	 *          the window to set
+	 * @see #window
+	 */
+	protected void setWindow(MainWindow window) {
+		this.window = window;
+	}
+
 }
\ No newline at end of file
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCache.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCache.java
index b23ec8a198..5da894ab32 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCache.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCache.java
@@ -1,143 +1,143 @@
-package lcsb.mapviewer.annotation.cache;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.XmlParser;
-import lcsb.mapviewer.model.cache.CacheType;
-
-/**
- * Implementation of cache that stores everything in application memory. Data is
- * lost when application restarts. It implements singleton pattern. All method
- * are synchronized (so there are no issues when few thread are trying to access
- * data at the same time),
- * 
- * @author Piotr Gawron
- * 
- */
-public final class ApplicationLevelCache extends XmlParser implements QueryCacheInterface {
-
-	/**
-	 * How many values should be stored in cache before we even try to consider
-	 * releasing object due to huge memory usage.
-	 */
-	static final int										 MIN_CACHED_VALUES_BEFORE_CLEAN	= 100;
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger								 logger													= Logger.getLogger(ApplicationLevelCache.class);
-
-	/**
-	 * Cached nodes stored locally and identified by string.
-	 */
-	private static Map<String, Node>		 cachedQueryNodes								= new HashMap<String, Node>();
-
-	/**
-	 * Cached strings stored locally and identified by string.
-	 */
-	private static Map<String, String>	 cachedQueryString							= new HashMap<String, String>();
-
-	/**
-	 * Global instance of cache.
-	 */
-	private static ApplicationLevelCache cache													= null;
-
-	/**
-	 * Returns single instance of global application cache (singleton pattern).
-	 * 
-	 * @return single instance of global application cache
-	 */
-	public static ApplicationLevelCache getInstance() {
-		if (Configuration.isApplicationCacheOn()) {
-			if (cache == null) {
-				cache = new ApplicationLevelCache();
-			}
-			return cache;
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 * Default constructor. Prevents instatiation.
-	 */
-	private ApplicationLevelCache() {
-
-	}
-
-	@Override
-	public synchronized Node getXmlNodeByQuery(String query, CacheType type) {
-		Node result = null;
-		result = cachedQueryNodes.get(type.getId() + "\n" + query);
-		return result;
-	}
-
-	@Override
-	public synchronized String getStringByQuery(String query, CacheType type) {
-		String result = null;
-		result = cachedQueryString.get(type.getId() + "\n" + query);
-		return result;
-	}
-
-	@Override
-	public synchronized void setCachedQuery(String query, CacheType type, Object object) {
-		performMemoryBalance();
-
-		if (object instanceof String) {
-			cachedQueryString.put(type.getId() + "\n" + query, (String) object);
-		} else if (object instanceof Node) {
-			cachedQueryNodes.put(type.getId() + "\n" + query, (Node) object);
-		} else if (object == null) {
-			cachedQueryString.put(type.getId() + "\n" + query, (String) object);
-		} else {
-			throw new CacheException("Unknown object type: " + object.getClass());
-		}
-	}
-
-	/**
-	 * Method that clean cache if memory usage is too high.
-	 */
-	synchronized void performMemoryBalance() {
-		long cacheCount = 0;
-		cacheCount += cachedQueryString.size();
-		cacheCount += cachedQueryNodes.size();
-		// check memory usage only if we have some data to clear
-		if (cacheCount > MIN_CACHED_VALUES_BEFORE_CLEAN) {
-			Runtime runtime = Runtime.getRuntime();
-			long maxMem = runtime.maxMemory();
-			long useMem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
-			// if free memory is less than 10% then we clear cache
-			if (useMem > maxMem * Configuration.getMemorySaturationRatioTriggerClean()) {
-				logger.info("Cache will be cleared");
-				logger.info("Memory usage: " + useMem + " out of " + maxMem + " is used. Exceeded: " + maxMem * Configuration.getMemorySaturationRatioTriggerClean());
-				logger.info("Elements in cache: " + cacheCount);
-				clearCache();
-				System.gc();
-			}
-		}
-	}
-
-	@Override
-	public synchronized void removeByQuery(String query, CacheType type) {
-		cachedQueryString.remove(type.getId() + "\n" + query);
-		cachedQueryNodes.remove(type.getId() + "\n" + query);
-	}
-
-	@Override
-	public synchronized void clearCache() {
-		logger.info("Clearing application cache");
-		cachedQueryNodes.clear();
-		cachedQueryString.clear();
-	}
-
-	@Override
-	public void invalidateByQuery(String query, CacheType type) {
-		removeByQuery(query, type);
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.XmlParser;
+import lcsb.mapviewer.model.cache.CacheType;
+
+/**
+ * Implementation of cache that stores everything in application memory. Data is
+ * lost when application restarts. It implements singleton pattern. All method
+ * are synchronized (so there are no issues when few thread are trying to access
+ * data at the same time),
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public final class ApplicationLevelCache extends XmlParser implements QueryCacheInterface {
+
+	/**
+	 * How many values should be stored in cache before we even try to consider
+	 * releasing object due to huge memory usage.
+	 */
+	static final int										 MIN_CACHED_VALUES_BEFORE_CLEAN	= 100;
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger								 logger													= Logger.getLogger(ApplicationLevelCache.class);
+
+	/**
+	 * Cached nodes stored locally and identified by string.
+	 */
+	private static Map<String, Node>		 cachedQueryNodes								= new HashMap<String, Node>();
+
+	/**
+	 * Cached strings stored locally and identified by string.
+	 */
+	private static Map<String, String>	 cachedQueryString							= new HashMap<String, String>();
+
+	/**
+	 * Global instance of cache.
+	 */
+	private static ApplicationLevelCache cache													= null;
+
+	/**
+	 * Returns single instance of global application cache (singleton pattern).
+	 * 
+	 * @return single instance of global application cache
+	 */
+	public static ApplicationLevelCache getInstance() {
+		if (Configuration.isApplicationCacheOn()) {
+			if (cache == null) {
+				cache = new ApplicationLevelCache();
+			}
+			return cache;
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Default constructor. Prevents instatiation.
+	 */
+	private ApplicationLevelCache() {
+
+	}
+
+	@Override
+	public synchronized Node getXmlNodeByQuery(String query, CacheType type) {
+		Node result = null;
+		result = cachedQueryNodes.get(type.getId() + "\n" + query);
+		return result;
+	}
+
+	@Override
+	public synchronized String getStringByQuery(String query, CacheType type) {
+		String result = null;
+		result = cachedQueryString.get(type.getId() + "\n" + query);
+		return result;
+	}
+
+	@Override
+	public synchronized void setCachedQuery(String query, CacheType type, Object object) {
+		performMemoryBalance();
+
+		if (object instanceof String) {
+			cachedQueryString.put(type.getId() + "\n" + query, (String) object);
+		} else if (object instanceof Node) {
+			cachedQueryNodes.put(type.getId() + "\n" + query, (Node) object);
+		} else if (object == null) {
+			cachedQueryString.put(type.getId() + "\n" + query, (String) object);
+		} else {
+			throw new CacheException("Unknown object type: " + object.getClass());
+		}
+	}
+
+	/**
+	 * Method that clean cache if memory usage is too high.
+	 */
+	synchronized void performMemoryBalance() {
+		long cacheCount = 0;
+		cacheCount += cachedQueryString.size();
+		cacheCount += cachedQueryNodes.size();
+		// check memory usage only if we have some data to clear
+		if (cacheCount > MIN_CACHED_VALUES_BEFORE_CLEAN) {
+			Runtime runtime = Runtime.getRuntime();
+			long maxMem = runtime.maxMemory();
+			long useMem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
+			// if free memory is less than 10% then we clear cache
+			if (useMem > maxMem * Configuration.getMemorySaturationRatioTriggerClean()) {
+				logger.info("Cache will be cleared");
+				logger.info("Memory usage: " + useMem + " out of " + maxMem + " is used. Exceeded: " + maxMem * Configuration.getMemorySaturationRatioTriggerClean());
+				logger.info("Elements in cache: " + cacheCount);
+				clearCache();
+				System.gc();
+			}
+		}
+	}
+
+	@Override
+	public synchronized void removeByQuery(String query, CacheType type) {
+		cachedQueryString.remove(type.getId() + "\n" + query);
+		cachedQueryNodes.remove(type.getId() + "\n" + query);
+	}
+
+	@Override
+	public synchronized void clearCache() {
+		logger.info("Clearing application cache");
+		cachedQueryNodes.clear();
+		cachedQueryString.clear();
+	}
+
+	@Override
+	public void invalidateByQuery(String query, CacheType type) {
+		removeByQuery(query, type);
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/CachableInterface.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/CachableInterface.java
index 5aa2ce99cd..f271d6c39a 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/CachableInterface.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/CachableInterface.java
@@ -1,256 +1,256 @@
-package lcsb.mapviewer.annotation.cache;
-
-import java.io.IOException;
-
-import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.common.XmlParser;
-import lcsb.mapviewer.model.cache.CacheType;
-import lcsb.mapviewer.persist.dao.cache.CacheTypeDao;
-
-/**
- * Interface used for retrieveng data that are no longer valid in the cache
- * (their expire date was reached).
- * 
- * @author Piotr Gawron
- * 
- */
-public abstract class CachableInterface extends XmlParser {
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger logger = Logger.getLogger(CachableInterface.class);
-
-	/**
-	 * Refresh cache data from original source.
-	 * 
-	 * @param query
-	 *          text used to identify the resource
-	 * @return newly obtained data from the source
-	 * @throws SourceNotAvailable
-	 *           thrown when original source is unavailable
-	 */
-	public abstract Object refreshCacheQuery(Object query) throws SourceNotAvailable;
-
-	/**
-	 * String containing class name of the class that extends
-	 * {@link CachableInterface}. String name is used because cache layer doesn't
-	 * have access to every possible cacheable interface, therefore it cannot
-	 * enlist it.
-	 */
-	private String								cacheIdentifier;
-
-	/**
-	 * Type of the cache elements associated with this interface.
-	 */
-	private CacheType							cacheType;
-
-	/**
-	 * Cache mechanism used to speed up computation.
-	 */
-	@Autowired
-	private GeneralCacheInterface	cache;
-
-	/**
-	 * Cache mechanism used to speed up computation.
-	 */
-	@Autowired
-	private CacheTypeDao					cacheTypeDao;
-
-	/**
-	 * This object downloads webpages.
-	 */
-	private WebPageDownloader			webPageDownloader	= new WebPageDownloader();
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param clazz
-	 *          type that defines this interface
-	 */
-	public CachableInterface(final Class<? extends CachableInterface> clazz) {
-		this.cacheIdentifier = clazz.getCanonicalName();
-	}
-
-	/**
-	 * Puts some string value into cache.
-	 * 
-	 * @param key
-	 *          string that identifies value
-	 * @param result
-	 *          value to put into cache
-	 */
-	protected final void setCacheValue(String key, String result) {
-		if (cache != null) {
-			cache.setCachedQuery(key, getCacheType(), result);
-		}
-	}
-
-	/**
-	 * Retrieves string from cache.
-	 * 
-	 * @param key
-	 *          string that identifies xml node
-	 * @return string from cache
-	 */
-	protected final String getCacheValue(String key) {
-		if (cache != null) {
-			return cache.getStringByQuery(key, getCacheType());
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 * @return the cacheType
-	 * @see #cacheType
-	 */
-	public final CacheType getCacheType() {
-		if (cacheType == null) {
-			cacheType = getCacheTypeDao().getByClassName(cacheIdentifier);
-		}
-		return cacheType;
-	}
-
-	/**
-	 * Retrieves xml node from cache.
-	 * 
-	 * @param key
-	 *          string that identifies xml node
-	 * @return xml node from cache
-	 */
-	protected final Node getCacheNode(String key) {
-		if (cache != null) {
-			return cache.getXmlNodeByQuery(key, getCacheType());
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 * Saves xml node in the cache.
-	 * 
-	 * @param id
-	 *          identifier of the node
-	 * @param item
-	 *          node to save
-	 */
-	protected void setCacheNode(String id, Node item) {
-		if (cache != null) {
-			cache.setCachedQuery(id, getCacheType(), item);
-		}
-	}
-
-	/**
-	 * @return the cache
-	 * @see #cache
-	 */
-	public final GeneralCacheInterface getCache() {
-		return cache;
-	}
-
-	/**
-	 * @param cache
-	 *          the cache to set
-	 * @see #cache
-	 */
-	public final void setCache(GeneralCacheInterface cache) {
-		this.cache = cache;
-	}
-
-	/**
-	 * Returns a content of the webpage for a given url.
-	 * 
-	 * @param accessUrl
-	 *          webpage url address
-	 * @return content of the webpage
-	 * @throws IOException
-	 *           thrown when there are problems with connection to ChEMBL database
-	 */
-	protected final String getWebPageContent(String accessUrl) throws IOException {
-		// check if we have the page in our internal cache
-
-		String result = getCacheValue(accessUrl);
-		if (result == null) {
-			result = webPageDownloader.getFromNetwork(accessUrl);
-			if (result != null) {
-				setCacheValue(accessUrl, result);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Removes html tags from text.
-	 * 
-	 * @param text
-	 *          text text to clean
-	 * @return text without html tags
-	 */
-	public String cleanHtml(String text) {
-		int startIndex;
-		int endIndex;
-		// and now clean the descripton from html tags (should be somehow
-		// improved...)
-
-		StringBuilder result = new StringBuilder();
-
-		int oldEndIndex = 0;
-		startIndex = text.indexOf("<");
-		while (startIndex >= 0) {
-			endIndex = text.indexOf(">", startIndex);
-			result.append(text.substring(oldEndIndex, startIndex));
-			if (endIndex < 0) {
-				logger.warn("Problem with html code: " + text);
-				oldEndIndex = text.length();
-				break;
-			} else {
-				oldEndIndex = endIndex + 1;
-			}
-
-			startIndex = text.indexOf("<", oldEndIndex);
-		}
-
-		result.append(text.substring(oldEndIndex));
-		return StringEscapeUtils.unescapeHtml4(result.toString().replaceAll("[\n\r]+", " "));
-	}
-
-	/**
-	 * @return the cacheTypeDao
-	 * @see #cacheTypeDao
-	 */
-	public CacheTypeDao getCacheTypeDao() {
-		return cacheTypeDao;
-	}
-
-	/**
-	 * @param cacheTypeDao
-	 *          the cacheTypeDao to set
-	 * @see #cacheTypeDao
-	 */
-	public void setCacheTypeDao(CacheTypeDao cacheTypeDao) {
-		this.cacheTypeDao = cacheTypeDao;
-	}
-
-	/**
-	 * @return the webPageDownloader
-	 * @see #webPageDownloader
-	 */
-	protected WebPageDownloader getWebPageDownloader() {
-		return webPageDownloader;
-	}
-
-	/**
-	 * @param webPageDownloader
-	 *          the webPageDownloader to set
-	 * @see #webPageDownloader
-	 */
-	protected void setWebPageDownloader(WebPageDownloader webPageDownloader) {
-		this.webPageDownloader = webPageDownloader;
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.common.XmlParser;
+import lcsb.mapviewer.model.cache.CacheType;
+import lcsb.mapviewer.persist.dao.cache.CacheTypeDao;
+
+/**
+ * Interface used for retrieveng data that are no longer valid in the cache
+ * (their expire date was reached).
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public abstract class CachableInterface extends XmlParser {
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger logger = Logger.getLogger(CachableInterface.class);
+
+	/**
+	 * Refresh cache data from original source.
+	 * 
+	 * @param query
+	 *          text used to identify the resource
+	 * @return newly obtained data from the source
+	 * @throws SourceNotAvailable
+	 *           thrown when original source is unavailable
+	 */
+	public abstract Object refreshCacheQuery(Object query) throws SourceNotAvailable;
+
+	/**
+	 * String containing class name of the class that extends
+	 * {@link CachableInterface}. String name is used because cache layer doesn't
+	 * have access to every possible cacheable interface, therefore it cannot
+	 * enlist it.
+	 */
+	private String								cacheIdentifier;
+
+	/**
+	 * Type of the cache elements associated with this interface.
+	 */
+	private CacheType							cacheType;
+
+	/**
+	 * Cache mechanism used to speed up computation.
+	 */
+	@Autowired
+	private GeneralCacheInterface	cache;
+
+	/**
+	 * Cache mechanism used to speed up computation.
+	 */
+	@Autowired
+	private CacheTypeDao					cacheTypeDao;
+
+	/**
+	 * This object downloads webpages.
+	 */
+	private WebPageDownloader			webPageDownloader	= new WebPageDownloader();
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param clazz
+	 *          type that defines this interface
+	 */
+	public CachableInterface(final Class<? extends CachableInterface> clazz) {
+		this.cacheIdentifier = clazz.getCanonicalName();
+	}
+
+	/**
+	 * Puts some string value into cache.
+	 * 
+	 * @param key
+	 *          string that identifies value
+	 * @param result
+	 *          value to put into cache
+	 */
+	protected final void setCacheValue(String key, String result) {
+		if (cache != null) {
+			cache.setCachedQuery(key, getCacheType(), result);
+		}
+	}
+
+	/**
+	 * Retrieves string from cache.
+	 * 
+	 * @param key
+	 *          string that identifies xml node
+	 * @return string from cache
+	 */
+	protected final String getCacheValue(String key) {
+		if (cache != null) {
+			return cache.getStringByQuery(key, getCacheType());
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * @return the cacheType
+	 * @see #cacheType
+	 */
+	public final CacheType getCacheType() {
+		if (cacheType == null) {
+			cacheType = getCacheTypeDao().getByClassName(cacheIdentifier);
+		}
+		return cacheType;
+	}
+
+	/**
+	 * Retrieves xml node from cache.
+	 * 
+	 * @param key
+	 *          string that identifies xml node
+	 * @return xml node from cache
+	 */
+	protected final Node getCacheNode(String key) {
+		if (cache != null) {
+			return cache.getXmlNodeByQuery(key, getCacheType());
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Saves xml node in the cache.
+	 * 
+	 * @param id
+	 *          identifier of the node
+	 * @param item
+	 *          node to save
+	 */
+	protected void setCacheNode(String id, Node item) {
+		if (cache != null) {
+			cache.setCachedQuery(id, getCacheType(), item);
+		}
+	}
+
+	/**
+	 * @return the cache
+	 * @see #cache
+	 */
+	public final GeneralCacheInterface getCache() {
+		return cache;
+	}
+
+	/**
+	 * @param cache
+	 *          the cache to set
+	 * @see #cache
+	 */
+	public final void setCache(GeneralCacheInterface cache) {
+		this.cache = cache;
+	}
+
+	/**
+	 * Returns a content of the webpage for a given url.
+	 * 
+	 * @param accessUrl
+	 *          webpage url address
+	 * @return content of the webpage
+	 * @throws IOException
+	 *           thrown when there are problems with connection to ChEMBL database
+	 */
+	protected final String getWebPageContent(String accessUrl) throws IOException {
+		// check if we have the page in our internal cache
+
+		String result = getCacheValue(accessUrl);
+		if (result == null) {
+			result = webPageDownloader.getFromNetwork(accessUrl);
+			if (result != null) {
+				setCacheValue(accessUrl, result);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Removes html tags from text.
+	 * 
+	 * @param text
+	 *          text text to clean
+	 * @return text without html tags
+	 */
+	public String cleanHtml(String text) {
+		int startIndex;
+		int endIndex;
+		// and now clean the descripton from html tags (should be somehow
+		// improved...)
+
+		StringBuilder result = new StringBuilder();
+
+		int oldEndIndex = 0;
+		startIndex = text.indexOf("<");
+		while (startIndex >= 0) {
+			endIndex = text.indexOf(">", startIndex);
+			result.append(text.substring(oldEndIndex, startIndex));
+			if (endIndex < 0) {
+				logger.warn("Problem with html code: " + text);
+				oldEndIndex = text.length();
+				break;
+			} else {
+				oldEndIndex = endIndex + 1;
+			}
+
+			startIndex = text.indexOf("<", oldEndIndex);
+		}
+
+		result.append(text.substring(oldEndIndex));
+		return StringEscapeUtils.unescapeHtml4(result.toString().replaceAll("[\n\r]+", " "));
+	}
+
+	/**
+	 * @return the cacheTypeDao
+	 * @see #cacheTypeDao
+	 */
+	public CacheTypeDao getCacheTypeDao() {
+		return cacheTypeDao;
+	}
+
+	/**
+	 * @param cacheTypeDao
+	 *          the cacheTypeDao to set
+	 * @see #cacheTypeDao
+	 */
+	public void setCacheTypeDao(CacheTypeDao cacheTypeDao) {
+		this.cacheTypeDao = cacheTypeDao;
+	}
+
+	/**
+	 * @return the webPageDownloader
+	 * @see #webPageDownloader
+	 */
+	protected WebPageDownloader getWebPageDownloader() {
+		return webPageDownloader;
+	}
+
+	/**
+	 * @param webPageDownloader
+	 *          the webPageDownloader to set
+	 * @see #webPageDownloader
+	 */
+	protected void setWebPageDownloader(WebPageDownloader webPageDownloader) {
+		this.webPageDownloader = webPageDownloader;
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/CacheException.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/CacheException.java
index b171e2a1cc..505b07ca27 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/CacheException.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/CacheException.java
@@ -1,25 +1,25 @@
-package lcsb.mapviewer.annotation.cache;
-
-/**
- * Thrown when query to the database is of wrong type.
- * 
- * @author Piotr Gawron
- * 
- */
-public class CacheException extends RuntimeException {
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Constructor receives some kind of message.
-	 * 
-	 * @param string
-	 *          message associated with exception
-	 */
-	public CacheException(final String string) {
-		super(string);
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+/**
+ * Thrown when query to the database is of wrong type.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class CacheException extends RuntimeException {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Constructor receives some kind of message.
+	 * 
+	 * @param string
+	 *          message associated with exception
+	 */
+	public CacheException(final String string) {
+		super(string);
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/GeneralCacheWithExclusion.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/GeneralCacheWithExclusion.java
index 326e34ac0e..8bf1c1add7 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/GeneralCacheWithExclusion.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/GeneralCacheWithExclusion.java
@@ -1,93 +1,93 @@
-package lcsb.mapviewer.annotation.cache;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.cache.CacheType;
-
-/**
- * This implementation of cache works as a nomral cache except of the fact that
- * first few query requests are ignored (return null). It's used when refreshing
- * data from cache. Object of this class is injected into a
- * {@link CachableInterface} and after that normal call is performed. First
- * query to database will be ignored (so it won't be taken from cache), the rest
- * will go to cache.
- * 
- * @author Piotr Gawron
- *
- */
-public class GeneralCacheWithExclusion implements GeneralCacheInterface {
-	
-	/**
-	 * Default class logger.
-	 */
-	private Logger								logger	= Logger.getLogger(GeneralCacheWithExclusion.class);
-
-	/**
-	 * How many queries should be ignored.
-	 */
-	private int										counter	= 0;
-
-	/**
-	 * Original cache object.
-	 */
-	private GeneralCacheInterface	cache;
-
-	/**
-	 * Constructor that creates cache.
-	 * 
-	 * @param originalCache
-	 *          {@link #cache}
-	 * @param exclusionCount
-	 *          {@link #counter}
-	 */
-	public GeneralCacheWithExclusion(GeneralCacheInterface originalCache, int exclusionCount) {
-		if (originalCache == null) {
-			throw new InvalidArgumentException("Cache passed as argument cannot be null");
-		}
-		this.counter = exclusionCount;
-		this.cache = originalCache;
-	}
-
-	@Override
-	public Node getXmlNodeByQuery(String identifier, CacheType type) {
-		if (counter > 0) {
-			counter--;
-			logger.debug("Ignoring cache query due to cache refresh: " + identifier + ", " + type);
-			return null;
-		}
-		return cache.getXmlNodeByQuery(identifier, type);
-	}
-
-	@Override
-	public String getStringByQuery(String identifier, CacheType type) {
-		if (counter > 0) {
-			counter--;
-			logger.debug("Ignoring cache query due to cache refresh: " + identifier + ", " + type);
-			return null;
-		}
-		return cache.getStringByQuery(identifier, type);
-	}
-
-	@Override
-	public void setCachedQuery(String identifier, CacheType type, Object value) {
-		cache.setCachedQuery(identifier, type, value);
-	}
-
-	@Override
-	public void clearCache() {
-		cache.clearCache();
-
-	}
-
-	@Override
-	public void removeByQuery(String identifier, CacheType type) {
-		cache.removeByQuery(identifier, type);
-	}
-
-	@Override
-	public void invalidateByQuery(String identifier, CacheType type) {
-		cache.invalidateByQuery(identifier, type);
-	}
-}
+package lcsb.mapviewer.annotation.cache;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.cache.CacheType;
+
+/**
+ * This implementation of cache works as a nomral cache except of the fact that
+ * first few query requests are ignored (return null). It's used when refreshing
+ * data from cache. Object of this class is injected into a
+ * {@link CachableInterface} and after that normal call is performed. First
+ * query to database will be ignored (so it won't be taken from cache), the rest
+ * will go to cache.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class GeneralCacheWithExclusion implements GeneralCacheInterface {
+	
+	/**
+	 * Default class logger.
+	 */
+	private Logger								logger	= Logger.getLogger(GeneralCacheWithExclusion.class);
+
+	/**
+	 * How many queries should be ignored.
+	 */
+	private int										counter	= 0;
+
+	/**
+	 * Original cache object.
+	 */
+	private GeneralCacheInterface	cache;
+
+	/**
+	 * Constructor that creates cache.
+	 * 
+	 * @param originalCache
+	 *          {@link #cache}
+	 * @param exclusionCount
+	 *          {@link #counter}
+	 */
+	public GeneralCacheWithExclusion(GeneralCacheInterface originalCache, int exclusionCount) {
+		if (originalCache == null) {
+			throw new InvalidArgumentException("Cache passed as argument cannot be null");
+		}
+		this.counter = exclusionCount;
+		this.cache = originalCache;
+	}
+
+	@Override
+	public Node getXmlNodeByQuery(String identifier, CacheType type) {
+		if (counter > 0) {
+			counter--;
+			logger.debug("Ignoring cache query due to cache refresh: " + identifier + ", " + type);
+			return null;
+		}
+		return cache.getXmlNodeByQuery(identifier, type);
+	}
+
+	@Override
+	public String getStringByQuery(String identifier, CacheType type) {
+		if (counter > 0) {
+			counter--;
+			logger.debug("Ignoring cache query due to cache refresh: " + identifier + ", " + type);
+			return null;
+		}
+		return cache.getStringByQuery(identifier, type);
+	}
+
+	@Override
+	public void setCachedQuery(String identifier, CacheType type, Object value) {
+		cache.setCachedQuery(identifier, type, value);
+	}
+
+	@Override
+	public void clearCache() {
+		cache.clearCache();
+
+	}
+
+	@Override
+	public void removeByQuery(String identifier, CacheType type) {
+		cache.removeByQuery(identifier, type);
+	}
+
+	@Override
+	public void invalidateByQuery(String identifier, CacheType type) {
+		cache.invalidateByQuery(identifier, type);
+	}
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/PermanentDatabaseLevelCache.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/PermanentDatabaseLevelCache.java
index 1d2e11b52c..985aa13906 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/PermanentDatabaseLevelCache.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/PermanentDatabaseLevelCache.java
@@ -1,562 +1,562 @@
-package lcsb.mapviewer.annotation.cache;
-
-import java.lang.reflect.Constructor;
-import java.util.Calendar;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadFactory;
-
-import javax.annotation.PostConstruct;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.transaction.annotation.Transactional;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.common.XmlParser;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.model.cache.CacheQuery;
-import lcsb.mapviewer.model.cache.CacheType;
-import lcsb.mapviewer.persist.DbUtils;
-import lcsb.mapviewer.persist.dao.cache.CacheQueryDao;
-
-/**
- * Implementation of database level cache (
- * {@link PermanentDatabaseLevelCacheInterface}). The bean implements
- * {@link ApplicationContextAware} to be able to inject dependencies into
- * {@link CachableInterface} classes that are responsible for specific parts of
- * the cache. Every single task in this implementation is performed in new
- * transaction (and separate thread).
- * 
- * @author Piotr Gawron
- * 
- */
-@Transactional(value = "txManager")
-public class PermanentDatabaseLevelCache extends XmlParser implements PermanentDatabaseLevelCacheInterface, ApplicationContextAware {
-
-	/**
-	 * This class represents new thread task for quering database.
-	 * 
-	 * @author Piotr Gawron
-	 * 
-	 */
-	private final class QueryTask implements Callable<CacheQuery> {
-
-		/**
-		 * Identifier of cached entry.
-		 * 
-		 * @see CacheQuery#query
-		 */
-		private String		query;
-
-		/**
-		 * Type of cached entry.
-		 * 
-		 * @see CacheQuery#type
-		 */
-		private CacheType	type;
-
-		/**
-		 * Default constructor.
-		 * 
-		 * @param query
-		 *          {@link #query}
-		 * @param type
-		 *          {@link #type}
-		 */
-		private QueryTask(String query, CacheType type) {
-			logger.debug("Query task start");
-			this.query = query;
-			this.type = type;
-		}
-
-		@Override
-		public CacheQuery call() throws Exception {
-			logger.debug("Query task call");
-			dbUtils.createSessionForCurrentThread();
-			logger.debug("Query task session started");
-			CacheQuery entry = getCacheQueryDao().getByQuery((String) query, type);
-			logger.debug("Query task data retrieved");
-			dbUtils.closeSessionForCurrentThread();
-			logger.debug("Query task return");
-			return entry;
-		}
-
-	}
-
-	/**
-	 * This class represents new thread task for refreshing element in db.
-	 * 
-	 * @author Piotr Gawron
-	 * 
-	 */
-	private final class RefreshTask implements Callable<CacheQuery> {
-
-		/**
-		 * Identifier of cached entry.
-		 * 
-		 * @see CacheQuery#query
-		 */
-		private String		query;
-
-		/**
-		 * Type of cached entry.
-		 * 
-		 * @see CacheQuery#type
-		 */
-		private CacheType	type;
-
-		/**
-		 * Default constructor.
-		 * 
-		 * @param query
-		 *          {@link #query}
-		 * @param type
-		 *          {@link #type}
-		 */
-		private RefreshTask(String query, CacheType type) {
-			logger.debug("Refresh task start (query: " + query + ")");
-			this.query = query;
-			this.type = type;
-		}
-
-		@Override
-		public CacheQuery call() throws Exception {
-			logger.debug("Refresh task call");
-			CachableInterface cachableInterface = null;
-			try {
-				Constructor<?> ctor;
-				Class<?> clazz = Class.forName(type.getClassName());
-				ctor = clazz.getConstructor();
-				Object object = ctor.newInstance();
-				if (object instanceof CachableInterface) {
-					cachableInterface = (CachableInterface) object;
-				} else {
-					logger.fatal("Invalid class type: " + object.getClass() + ". Class cannot be cast into " + CachableInterface.class);
-				}
-				applicationContext.getAutowireCapableBeanFactory().autowireBean(object);
-
-			} catch (Exception e) {
-				logger.fatal("Problem with creating cache query updater", e);
-			}
-			if (cachableInterface != null) {
-				cachableInterface.setCache(new GeneralCacheWithExclusion(cachableInterface.getCache(), 1));
-				dbUtils.createSessionForCurrentThread();
-				logger.debug("Refresh task session started");
-				try {
-					Object result = cachableInterface.refreshCacheQuery(query);
-					if (result == null) {
-						removeByQuery(query, type);
-					} else {
-						setCachedQuery(query, type, result);
-
-					}
-				} catch (SourceNotAvailable e) {
-					logger.error("Cannot refresh cache", e);
-				} catch (InvalidArgumentException e) {
-					removeByQuery(query, type);
-					logger.error("Problem with refreshing. Invalid data to refresh", e);
-				} catch (Exception e) {
-					logger.error("Severe problem in cache", e);
-				} finally {
-					// close the transaction for this thread
-					dbUtils.closeSessionForCurrentThread();
-					logger.debug("Refresh task session closed");
-				}
-			}
-			logger.debug("Refresh task finish");
-			final Future<CacheQuery> task = service.submit(new QueryTask(query, type));
-			return task.get();
-		}
-
-	}
-
-	/**
-	 * This class represents new thread task for adding entry to database.
-	 * 
-	 * @author Piotr Gawron
-	 * 
-	 */
-	private final class AddTask implements Callable<CacheQuery> {
-
-		/**
-		 * Identifier of cached entry.
-		 * 
-		 * @see CacheQuery#query
-		 */
-		private String		query;
-
-		/**
-		 * Type of cached entry.
-		 * 
-		 * @see CacheQuery#type
-		 */
-		private CacheType	type;
-
-		/**
-		 * Value to cache.
-		 * 
-		 * @see CacheQuery#value
-		 */
-		private String		value;
-
-		/**
-		 * Default constructor.
-		 * 
-		 * @param query
-		 *          {@link #query}
-		 * @param type
-		 *          {@link #type}
-		 * @param value
-		 *          {@link #value}
-		 */
-		private AddTask(String query, CacheType type, String value) {
-			logger.debug("Add task start");
-			this.query = query;
-			this.type = type;
-			this.value = value;
-		}
-
-		@Override
-		public CacheQuery call() throws Exception {
-			logger.debug("Add task call");
-			dbUtils.createSessionForCurrentThread();
-			CacheQuery entry = getCacheQueryDao().getByQuery((String) query, type);
-
-			if (entry == null) {
-				entry = new CacheQuery();
-				entry.setQuery((String) query);
-				entry.setAccessed(Calendar.getInstance());
-			} else {
-				entry.setAccessed(Calendar.getInstance());
-			}
-			entry.setValue(value);
-			entry.setType(type);
-			Calendar expires = Calendar.getInstance();
-			expires.add(Calendar.DAY_OF_MONTH, type.getValidity());
-			entry.setExpires(expires);
-
-			getCacheQueryDao().add(entry);
-			dbUtils.closeSessionForCurrentThread();
-			return entry;
-		}
-
-	}
-
-	/**
-	 * This class represents new thread task for removing entry from database.
-	 * 
-	 * @author Piotr Gawron
-	 * 
-	 */
-	private final class RemoveTask implements Callable<CacheQuery> {
-
-		/**
-		 * Identifier of cached entry.
-		 * 
-		 * @see CacheQuery#query
-		 */
-		private String		query;
-
-		/**
-		 * Type of cached entry.
-		 * 
-		 * @see CacheQuery#type
-		 */
-		private CacheType	type;
-
-		/**
-		 * Default constructor.
-		 * 
-		 * @param query
-		 *          {@link #query}
-		 * @param type
-		 *          {@link #type}
-		 */
-		private RemoveTask(String query, CacheType type) {
-			logger.debug("Remove task start");
-			this.query = query;
-			this.type = type;
-		}
-
-		@Override
-		public CacheQuery call() throws Exception {
-			logger.debug("Remove task call");
-			dbUtils.createSessionForCurrentThread();
-			CacheQuery entry = getCacheQueryDao().getByQuery((String) query, type);
-			if (entry != null) {
-				getCacheQueryDao().delete(entry);
-			}
-			dbUtils.closeSessionForCurrentThread();
-			return entry;
-		}
-
-	}
-
-	/**
-	 * This class represents new thread task for invalidating entry in database.
-	 * 
-	 * @author Piotr Gawron
-	 * 
-	 */
-	private final class InvalidateTask implements Callable<CacheQuery> {
-
-		/**
-		 * Identifier of cached entry.
-		 */
-		private String		query;
-
-		/**
-		 * Type of cached entry.
-		 */
-		private CacheType	type;
-
-		/**
-		 * Default constructor.
-		 * 
-		 * @param query
-		 *          {@link #query}
-		 * @param type
-		 *          {@link #type}
-		 */
-		private InvalidateTask(String query, CacheType type) {
-			logger.debug("Invalidate task start");
-			this.query = query;
-			this.type = type;
-		}
-
-		@Override
-		public CacheQuery call() throws Exception {
-			logger.debug("Invalidate task call");
-			dbUtils.createSessionForCurrentThread();
-			try {
-				Calendar date = Calendar.getInstance();
-
-				date.add(Calendar.DATE, -1);
-
-				CacheQuery entry = getCacheQueryDao().getByQuery(query, type);
-				if (entry != null) {
-					entry.setExpires(date);
-					getCacheQueryDao().update(entry);
-					cacheRefreshService.submit(new RefreshTask(query, type));
-				}
-				return entry;
-			} finally {
-				// close session even when we had a problem
-				dbUtils.closeSessionForCurrentThread();
-			}
-		}
-
-	}
-
-	/**
-	 * Spring application context.
-	 */
-	private static ApplicationContext	applicationContext;
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger							logger = Logger.getLogger(PermanentDatabaseLevelCache.class);
-
-	/**
-	 * Data access object for query entries accessed by string key.
-	 */
-	@Autowired
-	private CacheQueryDao							cacheQueryDao;
-
-	/**
-	 * Utils that help to manage the sessions in custom multithreaded
-	 * implementation.
-	 */
-	@Autowired
-	private DbUtils										dbUtils;
-
-	/**
-	 * Service used for executing database tasks in separate thread.
-	 */
-	private ExecutorService						service;
-
-	/**
-	 * This service is used for execution and queue of the refresh entries in the
-	 * database.
-	 */
-	private ExecutorService						cacheRefreshService;
-
-	/**
-	 * Post init spring method used for initialization of {@link #service} used
-	 * for execution of db tasks.
-	 */
-	@PostConstruct
-	public void init() {
-		// the executor is a daemon thread so that it will get killed automatically
-		// when the main program exits
-		service = Executors.newScheduledThreadPool(1, new ThreadFactory() {
-			@Override
-			public Thread newThread(Runnable r) {
-				Thread t = new Thread(r);
-				t.setDaemon(true);
-				return t;
-			}
-		});
-		cacheRefreshService = Executors.newScheduledThreadPool(1, new ThreadFactory() {
-			@Override
-			public Thread newThread(Runnable r) {
-				Thread t = new Thread(r);
-				t.setDaemon(true);
-				return t;
-			}
-		});
-
-		// put in the queue empty task to make sure that everything was initializedd
-		// (additional managing thread was createed)
-		service.submit(new Callable<Object>() {
-			@Override
-			public Object call() throws Exception {
-				return null;
-			}
-		});
-		cacheRefreshService.submit(new Callable<Object>() {
-			@Override
-			public Object call() throws Exception {
-				return null;
-			}
-		});
-	}
-
-	@Override
-	public void clearCache() {
-		cacheQueryDao.clearTable();
-	}
-
-	@Override
-	public Node getXmlNodeByQuery(String query, CacheType type) {
-		final Future<CacheQuery> task = service.submit(new QueryTask(query, type));
-		CacheQuery entry = executeTask(task);
-
-		if (entry == null) {
-			return null;
-		}
-		try {
-			Document document = getXmlDocumentFromString(entry.getValue());
-			Calendar currentDate = Calendar.getInstance();
-			if (currentDate.before(entry.getExpires())) {
-				return document.getFirstChild();
-			} else {
-				cacheRefreshService.submit(new RefreshTask(query, type));
-				return document.getFirstChild();
-			}
-		} catch (InvalidXmlSchemaException e) {
-			logger.warn("Invalid xml for query: " + query);
-			logger.warn("xml: " + entry.getValue());
-			removeByQuery(query, type);
-			return null;
-		}
-	}
-
-	@Override
-	public String getStringByQuery(String query, CacheType type) {
-		Calendar currentDate = Calendar.getInstance();
-		final Future<CacheQuery> task = service.submit(new QueryTask(query, type));
-		CacheQuery entry = executeTask(task);
-		if (entry == null) {
-			return null;
-		}
-		if (currentDate.before(entry.getExpires())) {
-			return entry.getValue();
-		} else {
-			cacheRefreshService.submit(new RefreshTask(query, type));
-			return entry.getValue();
-		}
-	}
-
-	@Override
-	public void setCachedQuery(String query, CacheType type, Object object) {
-		String value = null;
-		if (object instanceof String) {
-			value = (String) object;
-		} else if (object instanceof Node) {
-			value = nodeToString((Node) object, true);
-		} else if (object == null) {
-			value = null;
-		} else {
-			throw new CacheException("Unknown object type: " + object.getClass());
-		}
-		if (value == null) {
-			removeByQuery(query, type);
-		} else {
-			final Future<CacheQuery> task = service.submit(new AddTask(query, type, value));
-			executeTask(task);
-		}
-	}
-
-	@Override
-	public void removeByQuery(String query, CacheType type) {
-		final Future<CacheQuery> task = service.submit(new RemoveTask(query, type));
-		executeTask(task);
-	}
-
-	@Override
-	public void invalidateByQuery(String query, CacheType type) {
-		final Future<CacheQuery> task = service.submit(new InvalidateTask(query, type));
-		executeTask(task);
-	}
-
-	/**
-	 * Executes and returns result of the task provided in the parameter. This
-	 * method is blocking (it's waiting for the results).
-	 * 
-	 * @param task
-	 *          task to be executed
-	 * @return value returned by the task
-	 */
-	private CacheQuery executeTask(final Future<CacheQuery> task) {
-		try {
-			return task.get();
-		} catch (InterruptedException e1) {
-			logger.error(e1, e1);
-		} catch (ExecutionException e1) {
-			logger.error(e1, e1);
-		}
-		return null;
-	}
-
-	@Override
-	public void setApplicationContext(ApplicationContext arg0) {
-		applicationContext = arg0;
-	}
-
-	@Override
-	public int getRefreshPendingQueueSize() {
-		return ((ScheduledThreadPoolExecutor) cacheRefreshService).getQueue().size();
-	}
-
-	@Override
-	public boolean refreshIsBusy() {
-		return getRefreshPendingQueueSize() != 0 || getRefreshExecutingTasksSize() != 0;
-	}
-
-	@Override
-	public int getRefreshExecutingTasksSize() {
-		return ((ScheduledThreadPoolExecutor) cacheRefreshService).getActiveCount();
-	}
-
-	@Override
-	public CacheQueryDao getCacheQueryDao() {
-		return cacheQueryDao;
-	}
-
-	@Override
-	public void setCacheQueryDao(CacheQueryDao cacheQueryDao) {
-		this.cacheQueryDao = cacheQueryDao;
-	}
-
+package lcsb.mapviewer.annotation.cache;
+
+import java.lang.reflect.Constructor;
+import java.util.Calendar;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+
+import javax.annotation.PostConstruct;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.transaction.annotation.Transactional;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.common.XmlParser;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.model.cache.CacheQuery;
+import lcsb.mapviewer.model.cache.CacheType;
+import lcsb.mapviewer.persist.DbUtils;
+import lcsb.mapviewer.persist.dao.cache.CacheQueryDao;
+
+/**
+ * Implementation of database level cache (
+ * {@link PermanentDatabaseLevelCacheInterface}). The bean implements
+ * {@link ApplicationContextAware} to be able to inject dependencies into
+ * {@link CachableInterface} classes that are responsible for specific parts of
+ * the cache. Every single task in this implementation is performed in new
+ * transaction (and separate thread).
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Transactional(value = "txManager")
+public class PermanentDatabaseLevelCache extends XmlParser implements PermanentDatabaseLevelCacheInterface, ApplicationContextAware {
+
+	/**
+	 * This class represents new thread task for quering database.
+	 * 
+	 * @author Piotr Gawron
+	 * 
+	 */
+	private final class QueryTask implements Callable<CacheQuery> {
+
+		/**
+		 * Identifier of cached entry.
+		 * 
+		 * @see CacheQuery#query
+		 */
+		private String		query;
+
+		/**
+		 * Type of cached entry.
+		 * 
+		 * @see CacheQuery#type
+		 */
+		private CacheType	type;
+
+		/**
+		 * Default constructor.
+		 * 
+		 * @param query
+		 *          {@link #query}
+		 * @param type
+		 *          {@link #type}
+		 */
+		private QueryTask(String query, CacheType type) {
+			logger.debug("Query task start");
+			this.query = query;
+			this.type = type;
+		}
+
+		@Override
+		public CacheQuery call() throws Exception {
+			logger.debug("Query task call");
+			dbUtils.createSessionForCurrentThread();
+			logger.debug("Query task session started");
+			CacheQuery entry = getCacheQueryDao().getByQuery((String) query, type);
+			logger.debug("Query task data retrieved");
+			dbUtils.closeSessionForCurrentThread();
+			logger.debug("Query task return");
+			return entry;
+		}
+
+	}
+
+	/**
+	 * This class represents new thread task for refreshing element in db.
+	 * 
+	 * @author Piotr Gawron
+	 * 
+	 */
+	private final class RefreshTask implements Callable<CacheQuery> {
+
+		/**
+		 * Identifier of cached entry.
+		 * 
+		 * @see CacheQuery#query
+		 */
+		private String		query;
+
+		/**
+		 * Type of cached entry.
+		 * 
+		 * @see CacheQuery#type
+		 */
+		private CacheType	type;
+
+		/**
+		 * Default constructor.
+		 * 
+		 * @param query
+		 *          {@link #query}
+		 * @param type
+		 *          {@link #type}
+		 */
+		private RefreshTask(String query, CacheType type) {
+			logger.debug("Refresh task start (query: " + query + ")");
+			this.query = query;
+			this.type = type;
+		}
+
+		@Override
+		public CacheQuery call() throws Exception {
+			logger.debug("Refresh task call");
+			CachableInterface cachableInterface = null;
+			try {
+				Constructor<?> ctor;
+				Class<?> clazz = Class.forName(type.getClassName());
+				ctor = clazz.getConstructor();
+				Object object = ctor.newInstance();
+				if (object instanceof CachableInterface) {
+					cachableInterface = (CachableInterface) object;
+				} else {
+					logger.fatal("Invalid class type: " + object.getClass() + ". Class cannot be cast into " + CachableInterface.class);
+				}
+				applicationContext.getAutowireCapableBeanFactory().autowireBean(object);
+
+			} catch (Exception e) {
+				logger.fatal("Problem with creating cache query updater", e);
+			}
+			if (cachableInterface != null) {
+				cachableInterface.setCache(new GeneralCacheWithExclusion(cachableInterface.getCache(), 1));
+				dbUtils.createSessionForCurrentThread();
+				logger.debug("Refresh task session started");
+				try {
+					Object result = cachableInterface.refreshCacheQuery(query);
+					if (result == null) {
+						removeByQuery(query, type);
+					} else {
+						setCachedQuery(query, type, result);
+
+					}
+				} catch (SourceNotAvailable e) {
+					logger.error("Cannot refresh cache", e);
+				} catch (InvalidArgumentException e) {
+					removeByQuery(query, type);
+					logger.error("Problem with refreshing. Invalid data to refresh", e);
+				} catch (Exception e) {
+					logger.error("Severe problem in cache", e);
+				} finally {
+					// close the transaction for this thread
+					dbUtils.closeSessionForCurrentThread();
+					logger.debug("Refresh task session closed");
+				}
+			}
+			logger.debug("Refresh task finish");
+			final Future<CacheQuery> task = service.submit(new QueryTask(query, type));
+			return task.get();
+		}
+
+	}
+
+	/**
+	 * This class represents new thread task for adding entry to database.
+	 * 
+	 * @author Piotr Gawron
+	 * 
+	 */
+	private final class AddTask implements Callable<CacheQuery> {
+
+		/**
+		 * Identifier of cached entry.
+		 * 
+		 * @see CacheQuery#query
+		 */
+		private String		query;
+
+		/**
+		 * Type of cached entry.
+		 * 
+		 * @see CacheQuery#type
+		 */
+		private CacheType	type;
+
+		/**
+		 * Value to cache.
+		 * 
+		 * @see CacheQuery#value
+		 */
+		private String		value;
+
+		/**
+		 * Default constructor.
+		 * 
+		 * @param query
+		 *          {@link #query}
+		 * @param type
+		 *          {@link #type}
+		 * @param value
+		 *          {@link #value}
+		 */
+		private AddTask(String query, CacheType type, String value) {
+			logger.debug("Add task start");
+			this.query = query;
+			this.type = type;
+			this.value = value;
+		}
+
+		@Override
+		public CacheQuery call() throws Exception {
+			logger.debug("Add task call");
+			dbUtils.createSessionForCurrentThread();
+			CacheQuery entry = getCacheQueryDao().getByQuery((String) query, type);
+
+			if (entry == null) {
+				entry = new CacheQuery();
+				entry.setQuery((String) query);
+				entry.setAccessed(Calendar.getInstance());
+			} else {
+				entry.setAccessed(Calendar.getInstance());
+			}
+			entry.setValue(value);
+			entry.setType(type);
+			Calendar expires = Calendar.getInstance();
+			expires.add(Calendar.DAY_OF_MONTH, type.getValidity());
+			entry.setExpires(expires);
+
+			getCacheQueryDao().add(entry);
+			dbUtils.closeSessionForCurrentThread();
+			return entry;
+		}
+
+	}
+
+	/**
+	 * This class represents new thread task for removing entry from database.
+	 * 
+	 * @author Piotr Gawron
+	 * 
+	 */
+	private final class RemoveTask implements Callable<CacheQuery> {
+
+		/**
+		 * Identifier of cached entry.
+		 * 
+		 * @see CacheQuery#query
+		 */
+		private String		query;
+
+		/**
+		 * Type of cached entry.
+		 * 
+		 * @see CacheQuery#type
+		 */
+		private CacheType	type;
+
+		/**
+		 * Default constructor.
+		 * 
+		 * @param query
+		 *          {@link #query}
+		 * @param type
+		 *          {@link #type}
+		 */
+		private RemoveTask(String query, CacheType type) {
+			logger.debug("Remove task start");
+			this.query = query;
+			this.type = type;
+		}
+
+		@Override
+		public CacheQuery call() throws Exception {
+			logger.debug("Remove task call");
+			dbUtils.createSessionForCurrentThread();
+			CacheQuery entry = getCacheQueryDao().getByQuery((String) query, type);
+			if (entry != null) {
+				getCacheQueryDao().delete(entry);
+			}
+			dbUtils.closeSessionForCurrentThread();
+			return entry;
+		}
+
+	}
+
+	/**
+	 * This class represents new thread task for invalidating entry in database.
+	 * 
+	 * @author Piotr Gawron
+	 * 
+	 */
+	private final class InvalidateTask implements Callable<CacheQuery> {
+
+		/**
+		 * Identifier of cached entry.
+		 */
+		private String		query;
+
+		/**
+		 * Type of cached entry.
+		 */
+		private CacheType	type;
+
+		/**
+		 * Default constructor.
+		 * 
+		 * @param query
+		 *          {@link #query}
+		 * @param type
+		 *          {@link #type}
+		 */
+		private InvalidateTask(String query, CacheType type) {
+			logger.debug("Invalidate task start");
+			this.query = query;
+			this.type = type;
+		}
+
+		@Override
+		public CacheQuery call() throws Exception {
+			logger.debug("Invalidate task call");
+			dbUtils.createSessionForCurrentThread();
+			try {
+				Calendar date = Calendar.getInstance();
+
+				date.add(Calendar.DATE, -1);
+
+				CacheQuery entry = getCacheQueryDao().getByQuery(query, type);
+				if (entry != null) {
+					entry.setExpires(date);
+					getCacheQueryDao().update(entry);
+					cacheRefreshService.submit(new RefreshTask(query, type));
+				}
+				return entry;
+			} finally {
+				// close session even when we had a problem
+				dbUtils.closeSessionForCurrentThread();
+			}
+		}
+
+	}
+
+	/**
+	 * Spring application context.
+	 */
+	private static ApplicationContext	applicationContext;
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger							logger = Logger.getLogger(PermanentDatabaseLevelCache.class);
+
+	/**
+	 * Data access object for query entries accessed by string key.
+	 */
+	@Autowired
+	private CacheQueryDao							cacheQueryDao;
+
+	/**
+	 * Utils that help to manage the sessions in custom multithreaded
+	 * implementation.
+	 */
+	@Autowired
+	private DbUtils										dbUtils;
+
+	/**
+	 * Service used for executing database tasks in separate thread.
+	 */
+	private ExecutorService						service;
+
+	/**
+	 * This service is used for execution and queue of the refresh entries in the
+	 * database.
+	 */
+	private ExecutorService						cacheRefreshService;
+
+	/**
+	 * Post init spring method used for initialization of {@link #service} used
+	 * for execution of db tasks.
+	 */
+	@PostConstruct
+	public void init() {
+		// the executor is a daemon thread so that it will get killed automatically
+		// when the main program exits
+		service = Executors.newScheduledThreadPool(1, new ThreadFactory() {
+			@Override
+			public Thread newThread(Runnable r) {
+				Thread t = new Thread(r);
+				t.setDaemon(true);
+				return t;
+			}
+		});
+		cacheRefreshService = Executors.newScheduledThreadPool(1, new ThreadFactory() {
+			@Override
+			public Thread newThread(Runnable r) {
+				Thread t = new Thread(r);
+				t.setDaemon(true);
+				return t;
+			}
+		});
+
+		// put in the queue empty task to make sure that everything was initializedd
+		// (additional managing thread was createed)
+		service.submit(new Callable<Object>() {
+			@Override
+			public Object call() throws Exception {
+				return null;
+			}
+		});
+		cacheRefreshService.submit(new Callable<Object>() {
+			@Override
+			public Object call() throws Exception {
+				return null;
+			}
+		});
+	}
+
+	@Override
+	public void clearCache() {
+		cacheQueryDao.clearTable();
+	}
+
+	@Override
+	public Node getXmlNodeByQuery(String query, CacheType type) {
+		final Future<CacheQuery> task = service.submit(new QueryTask(query, type));
+		CacheQuery entry = executeTask(task);
+
+		if (entry == null) {
+			return null;
+		}
+		try {
+			Document document = getXmlDocumentFromString(entry.getValue());
+			Calendar currentDate = Calendar.getInstance();
+			if (currentDate.before(entry.getExpires())) {
+				return document.getFirstChild();
+			} else {
+				cacheRefreshService.submit(new RefreshTask(query, type));
+				return document.getFirstChild();
+			}
+		} catch (InvalidXmlSchemaException e) {
+			logger.warn("Invalid xml for query: " + query);
+			logger.warn("xml: " + entry.getValue());
+			removeByQuery(query, type);
+			return null;
+		}
+	}
+
+	@Override
+	public String getStringByQuery(String query, CacheType type) {
+		Calendar currentDate = Calendar.getInstance();
+		final Future<CacheQuery> task = service.submit(new QueryTask(query, type));
+		CacheQuery entry = executeTask(task);
+		if (entry == null) {
+			return null;
+		}
+		if (currentDate.before(entry.getExpires())) {
+			return entry.getValue();
+		} else {
+			cacheRefreshService.submit(new RefreshTask(query, type));
+			return entry.getValue();
+		}
+	}
+
+	@Override
+	public void setCachedQuery(String query, CacheType type, Object object) {
+		String value = null;
+		if (object instanceof String) {
+			value = (String) object;
+		} else if (object instanceof Node) {
+			value = nodeToString((Node) object, true);
+		} else if (object == null) {
+			value = null;
+		} else {
+			throw new CacheException("Unknown object type: " + object.getClass());
+		}
+		if (value == null) {
+			removeByQuery(query, type);
+		} else {
+			final Future<CacheQuery> task = service.submit(new AddTask(query, type, value));
+			executeTask(task);
+		}
+	}
+
+	@Override
+	public void removeByQuery(String query, CacheType type) {
+		final Future<CacheQuery> task = service.submit(new RemoveTask(query, type));
+		executeTask(task);
+	}
+
+	@Override
+	public void invalidateByQuery(String query, CacheType type) {
+		final Future<CacheQuery> task = service.submit(new InvalidateTask(query, type));
+		executeTask(task);
+	}
+
+	/**
+	 * Executes and returns result of the task provided in the parameter. This
+	 * method is blocking (it's waiting for the results).
+	 * 
+	 * @param task
+	 *          task to be executed
+	 * @return value returned by the task
+	 */
+	private CacheQuery executeTask(final Future<CacheQuery> task) {
+		try {
+			return task.get();
+		} catch (InterruptedException e1) {
+			logger.error(e1, e1);
+		} catch (ExecutionException e1) {
+			logger.error(e1, e1);
+		}
+		return null;
+	}
+
+	@Override
+	public void setApplicationContext(ApplicationContext arg0) {
+		applicationContext = arg0;
+	}
+
+	@Override
+	public int getRefreshPendingQueueSize() {
+		return ((ScheduledThreadPoolExecutor) cacheRefreshService).getQueue().size();
+	}
+
+	@Override
+	public boolean refreshIsBusy() {
+		return getRefreshPendingQueueSize() != 0 || getRefreshExecutingTasksSize() != 0;
+	}
+
+	@Override
+	public int getRefreshExecutingTasksSize() {
+		return ((ScheduledThreadPoolExecutor) cacheRefreshService).getActiveCount();
+	}
+
+	@Override
+	public CacheQueryDao getCacheQueryDao() {
+		return cacheQueryDao;
+	}
+
+	@Override
+	public void setCacheQueryDao(CacheQueryDao cacheQueryDao) {
+		this.cacheQueryDao = cacheQueryDao;
+	}
+
 }
\ No newline at end of file
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/PermanentDatabaseLevelCacheInterface.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/PermanentDatabaseLevelCacheInterface.java
index 5d40eeb0c3..8a33101cbf 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/PermanentDatabaseLevelCacheInterface.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/PermanentDatabaseLevelCacheInterface.java
@@ -1,51 +1,51 @@
-package lcsb.mapviewer.annotation.cache;
-
-import lcsb.mapviewer.persist.dao.cache.CacheQueryDao;
-
-/**
- * Interface describing database level cache. It has the same functionality as
- * {@link QueryCacheInterface}. It allows to cache data within application
- * scope. After application restarts everything is lost.
- * 
- * @author Piotr Gawron
- * 
- */
-public interface PermanentDatabaseLevelCacheInterface extends QueryCacheInterface {
-
-	/**
-	 * Returns how many tasks are pending for refreshing.
-	 * 
-	 * @return how many tasks are pending for refreshing.
-	 */
-	int getRefreshPendingQueueSize();
-
-	/**
-	 * Returns true if refreshing of entries in database is in progress.
-	 * 
-	 * @return true if refreshing of entries in database is in progress.
-	 */
-	boolean refreshIsBusy();
-
-	/**
-	 * Returns aproximate number of refresh tasks that are currently executed.
-	 * 
-	 * @return aproximate number of refresh tasks that are currently executed.
-	 */
-	int getRefreshExecutingTasksSize();
-
-	/**
-	 * Returns {@link CacheQueryDao} used by the cache.
-	 * 
-	 * @return {@link CacheQueryDao} used by the cache
-	 */
-	CacheQueryDao getCacheQueryDao();
-
-	/**
-	 * Sets {@link CacheQueryDao}.
-	 * 
-	 * @param cacheQueryDao
-	 *          new {@link CacheQueryDao} used by the cache
-	 */
-	void setCacheQueryDao(CacheQueryDao cacheQueryDao);
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import lcsb.mapviewer.persist.dao.cache.CacheQueryDao;
+
+/**
+ * Interface describing database level cache. It has the same functionality as
+ * {@link QueryCacheInterface}. It allows to cache data within application
+ * scope. After application restarts everything is lost.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public interface PermanentDatabaseLevelCacheInterface extends QueryCacheInterface {
+
+	/**
+	 * Returns how many tasks are pending for refreshing.
+	 * 
+	 * @return how many tasks are pending for refreshing.
+	 */
+	int getRefreshPendingQueueSize();
+
+	/**
+	 * Returns true if refreshing of entries in database is in progress.
+	 * 
+	 * @return true if refreshing of entries in database is in progress.
+	 */
+	boolean refreshIsBusy();
+
+	/**
+	 * Returns aproximate number of refresh tasks that are currently executed.
+	 * 
+	 * @return aproximate number of refresh tasks that are currently executed.
+	 */
+	int getRefreshExecutingTasksSize();
+
+	/**
+	 * Returns {@link CacheQueryDao} used by the cache.
+	 * 
+	 * @return {@link CacheQueryDao} used by the cache
+	 */
+	CacheQueryDao getCacheQueryDao();
+
+	/**
+	 * Sets {@link CacheQueryDao}.
+	 * 
+	 * @param cacheQueryDao
+	 *          new {@link CacheQueryDao} used by the cache
+	 */
+	void setCacheQueryDao(CacheQueryDao cacheQueryDao);
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/SourceNotAvailable.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/SourceNotAvailable.java
index 29c7bf36fb..506296dadb 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/SourceNotAvailable.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/SourceNotAvailable.java
@@ -1,49 +1,49 @@
-package lcsb.mapviewer.annotation.cache;
-
-/**
- * Exception thrown when source of the data that is stored in database is no
- * longer available.
- * 
- * @author Piotr Gawron
- * 
- */
-public class SourceNotAvailable extends Exception {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Public constructor with parent exception that was catched.
-	 * 
-	 * @param e
-	 *          parent exception
-	 */
-	public SourceNotAvailable(Exception e) {
-		super(e);
-	}
-
-	/**
-	 * Constructor receives some kind of message.
-	 * 
-	 * @param message
-	 *          message associated with exception
-	 */
-	public SourceNotAvailable(String message) {
-		super(message);
-	}
-
-	/**
-	 * Public constructor with parent exception that was catched.
-	 * 
-	 * @param message
-	 *          message associated with exception
-	 * @param e
-	 *          parent exception
-	 */
-	public SourceNotAvailable(String message, Exception e) {
-		super(message, e);
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+/**
+ * Exception thrown when source of the data that is stored in database is no
+ * longer available.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class SourceNotAvailable extends Exception {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Public constructor with parent exception that was catched.
+	 * 
+	 * @param e
+	 *          parent exception
+	 */
+	public SourceNotAvailable(Exception e) {
+		super(e);
+	}
+
+	/**
+	 * Constructor receives some kind of message.
+	 * 
+	 * @param message
+	 *          message associated with exception
+	 */
+	public SourceNotAvailable(String message) {
+		super(message);
+	}
+
+	/**
+	 * Public constructor with parent exception that was catched.
+	 * 
+	 * @param message
+	 *          message associated with exception
+	 * @param e
+	 *          parent exception
+	 */
+	public SourceNotAvailable(String message, Exception e) {
+		super(message, e);
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/XmlSerializer.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/XmlSerializer.java
index b32d72dd52..1a9866cae4 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/XmlSerializer.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/XmlSerializer.java
@@ -1,99 +1,99 @@
-package lcsb.mapviewer.annotation.cache;
-
-import java.io.StringWriter;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.commons.lang3.SerializationException;
-import org.w3c.dom.Node;
-
-/**
- * This class allos to serialize and deserialize object of class T into xml
- * {@link String}.
- * 
- * @author Piotr Gawron
- *
- * @param <T>
- *          type of the object to serialize
- */
-public class XmlSerializer<T> {
-
-	/**
-	 * Class of the object that DAO works on.
-	 */
-	private Class<? extends T> clazz;
-
-	/**
-	 * Java Architecture for XML Binding (JAXB) class that allows transforming T
-	 * object into xml.
-	 */
-	private Marshaller				 jaxbMarshaller;
-
-	/**
-	 * Java Architecture for XML Binding (JAXB) class that allows transforming xml
-	 * describing T into T object.
-	 */
-	private Unmarshaller			 jaxbUnmarshaller;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param theClass
-	 *          class of the object that DAO will work on
-	 */
-	public XmlSerializer(Class<? extends T> theClass) {
-		this.clazz = theClass;
-		try {
-			JAXBContext jaxbContext;
-			jaxbContext = JAXBContext.newInstance(clazz);
-			jaxbMarshaller = jaxbContext.createMarshaller();
-			jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
-			jaxbUnmarshaller = jaxbContext.createUnmarshaller();
-		} catch (JAXBException e) {
-			throw new SerializationException();
-		}
-	}
-
-	/**
-	 * Transforms object into xml string.
-	 * 
-	 * @param object
-	 *          object to transform
-	 * @return xml string representing object
-	 */
-	public String objectToString(T object) {
-		if (object == null) {
-			return null;
-		}
-		StringWriter sw = new StringWriter();
-		try {
-			jaxbMarshaller.marshal(object, sw);
-		} catch (JAXBException e) {
-			throw new SerializationException(e);
-		}
-		return sw.toString();
-	}
-
-	/**
-	 * Creates object from xml node.
-	 * 
-	 * @param node
-	 *          xml node
-	 * @return object corresponding to xml node
-	 */
-	@SuppressWarnings("unchecked")
-	public T xmlToObject(Node node) {
-		if (node == null) {
-			return null;
-		}
-		try {
-			return (T) jaxbUnmarshaller.unmarshal(node);
-		} catch (JAXBException e) {
-			throw new SerializationException(e);
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import java.io.StringWriter;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.commons.lang3.SerializationException;
+import org.w3c.dom.Node;
+
+/**
+ * This class allos to serialize and deserialize object of class T into xml
+ * {@link String}.
+ * 
+ * @author Piotr Gawron
+ *
+ * @param <T>
+ *          type of the object to serialize
+ */
+public class XmlSerializer<T> {
+
+	/**
+	 * Class of the object that DAO works on.
+	 */
+	private Class<? extends T> clazz;
+
+	/**
+	 * Java Architecture for XML Binding (JAXB) class that allows transforming T
+	 * object into xml.
+	 */
+	private Marshaller				 jaxbMarshaller;
+
+	/**
+	 * Java Architecture for XML Binding (JAXB) class that allows transforming xml
+	 * describing T into T object.
+	 */
+	private Unmarshaller			 jaxbUnmarshaller;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param theClass
+	 *          class of the object that DAO will work on
+	 */
+	public XmlSerializer(Class<? extends T> theClass) {
+		this.clazz = theClass;
+		try {
+			JAXBContext jaxbContext;
+			jaxbContext = JAXBContext.newInstance(clazz);
+			jaxbMarshaller = jaxbContext.createMarshaller();
+			jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+			jaxbUnmarshaller = jaxbContext.createUnmarshaller();
+		} catch (JAXBException e) {
+			throw new SerializationException();
+		}
+	}
+
+	/**
+	 * Transforms object into xml string.
+	 * 
+	 * @param object
+	 *          object to transform
+	 * @return xml string representing object
+	 */
+	public String objectToString(T object) {
+		if (object == null) {
+			return null;
+		}
+		StringWriter sw = new StringWriter();
+		try {
+			jaxbMarshaller.marshal(object, sw);
+		} catch (JAXBException e) {
+			throw new SerializationException(e);
+		}
+		return sw.toString();
+	}
+
+	/**
+	 * Creates object from xml node.
+	 * 
+	 * @param node
+	 *          xml node
+	 * @return object corresponding to xml node
+	 */
+	@SuppressWarnings("unchecked")
+	public T xmlToObject(Node node) {
+		if (node == null) {
+			return null;
+		}
+		try {
+			return (T) jaxbUnmarshaller.unmarshal(node);
+		} catch (JAXBException e) {
+			throw new SerializationException(e);
+		}
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/data/Drug.java b/annotation/src/main/java/lcsb/mapviewer/annotation/data/Drug.java
index 0c2d705778..9af4d917b8 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/data/Drug.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/data/Drug.java
@@ -1,289 +1,289 @@
-package lcsb.mapviewer.annotation.data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.model.map.MiriamData;
-
-/**
- * Desribes information about drug retrieved from external database.
- * 
- * @author Piotr Gawron
- * 
- */
-@XmlRootElement
-public class Drug implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger			logger						= Logger.getLogger(Drug.class);
-
-	/**
-	 * Source of the data.
-	 */
-	private List<MiriamData>	sources						= new ArrayList<MiriamData>();
-
-	/**
-	 * Name of the drug.
-	 */
-	private String						name;
-
-	/**
-	 * Description of the drug.
-	 */
-	private String						description;
-
-	/**
-	 * Status of blood brain barries for the drug.
-	 */
-	private String						bloodBrainBarrier	= "N/A";
-
-	/**
-	 * Known brand names.
-	 */
-	private List<String>			brandNames				= new ArrayList<String>();
-
-	/**
-	 * Known targets.
-	 */
-	private List<Target>			targets						= new ArrayList<Target>();
-
-	/**
-	 * Known synonyms.
-	 */
-	private List<String>			synonyms					= new ArrayList<String>();
-
-	/**
-	 * Default constructor.
-	 */
-	public Drug() {
-
-	}
-
-	/**
-	 * Constructor that initializes object with the same information as parameter.
-	 * 
-	 * @param drug
-	 *          original drug
-	 */
-	public Drug(Drug drug) {
-		if (drug == null) {
-			return;
-		}
-		this.sources.addAll(drug.getSources());
-		this.description = drug.description;
-		this.brandNames.addAll(drug.getBrandNames());
-		this.synonyms.addAll(drug.getSynonyms());
-		this.targets.addAll(drug.getTargets());
-		this.bloodBrainBarrier = drug.getBloodBrainBarrier();
-	}
-
-	@Override
-	public String toString() {
-		StringBuilder result = new StringBuilder("");
-		for (MiriamData md : sources) {
-			result.append("source: " + md.getDataType() + ", drugId: " + md.getResource() + "\n");
-		}
-		result.append(", name: " + name + "\nDescription:\n" + description + "\nSynonyms:");
-		for (String s : synonyms) {
-			result.append(s + "|");
-		}
-		result.append("\nTargets:");
-		for (Target t : targets) {
-			if (t.getSource() != null) {
-				result.append(t.getSource().getResource() + "|" + t.getName() + "|" + t.getGenes());
-			}
-			result.append("\nReferences:");
-			for (MiriamData md : t.getReferences()) {
-				result.append(md.getResource());
-			}
-		}
-		return result.toString();
-	}
-
-	/**
-	 * @return the name
-	 * @see #name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * @param name
-	 *          the name to set
-	 * @see #name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * @return the description
-	 * @see #description
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * @param description
-	 *          the description to set
-	 * @see #description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	/**
-	 * @return the bloodBrainBarrier
-	 * @see #bloodBrainBarrier
-	 */
-	public String getBloodBrainBarrier() {
-		return bloodBrainBarrier;
-	}
-
-	/**
-	 * @param bloodBrainBarrier
-	 *          the bloodBrainBarrier to set
-	 * @see #bloodBrainBarrier
-	 */
-	public void setBloodBrainBarrier(String bloodBrainBarrier) {
-		this.bloodBrainBarrier = bloodBrainBarrier;
-	}
-
-	/**
-	 * @return the brandNames
-	 * @see #brandNames
-	 */
-	public List<String> getBrandNames() {
-		return brandNames;
-	}
-
-	/**
-	 * @param brandNames
-	 *          the brandNames to set
-	 * @see #brandNames
-	 */
-	public void setBrandNames(List<String> brandNames) {
-		this.brandNames = brandNames;
-	}
-
-	/**
-	 * @return the targets
-	 * @see #targets
-	 */
-	@XmlElement(name = "target")
-	public List<Target> getTargets() {
-		return targets;
-	}
-
-	/**
-	 * @param targets
-	 *          the targets to set
-	 * @see #targets
-	 */
-	public void setTargets(List<Target> targets) {
-		this.targets = targets;
-	}
-
-	/**
-	 * @return the synonyms
-	 * @see #synonyms
-	 */
-	public List<String> getSynonyms() {
-		return synonyms;
-	}
-
-	/**
-	 * @param synonyms
-	 *          the synonyms to set
-	 * @see #synonyms
-	 */
-	public void setSynonyms(List<String> synonyms) {
-		this.synonyms = synonyms;
-	}
-
-	/**
-	 * Adds brand name into {@link #brandNames}.
-	 * 
-	 * @param brandName
-	 *          object to add
-	 */
-	public void addBrandName(String brandName) {
-		this.brandNames.add(brandName);
-	}
-
-	/**
-	 * Adds synonym into {@link #synonyms}.
-	 * 
-	 * @param synonym
-	 *          object to add
-	 */
-	public void addSynonym(String synonym) {
-		if (synonyms.contains(synonym)) {
-			logger.warn("Synonym already exists in the drug: " + synonym);
-		} else {
-			this.synonyms.add(synonym);
-		}
-	}
-
-	/**
-	 * Adds target into {@link #targets} list.
-	 * 
-	 * @param target
-	 *          object to add
-	 */
-	public void addTarget(Target target) {
-		this.targets.add(target);
-	}
-
-	/**
-	 * @param source
-	 *          the source to add
-	 * @see #sources
-	 */
-	public void addSource(MiriamData source) {
-		this.sources.add(source);
-	}
-
-	/**
-	 * @return the sources
-	 * @see #sources
-	 */
-	public List<MiriamData> getSources() {
-		return sources;
-	}
-
-	/**
-	 * @param sources
-	 *          the sources to set
-	 * @see #sources
-	 */
-	public void setSources(List<MiriamData> sources) {
-		this.sources = sources;
-	}
-
-	/**
-	 * Adds targets to the drug.
-	 * 
-	 * @param targets2
-	 *          list of targets to add
-	 */
-	public void addTargets(List<Target> targets2) {
-		this.targets.addAll(targets2);
-	}
-
+package lcsb.mapviewer.annotation.data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.model.map.MiriamData;
+
+/**
+ * Desribes information about drug retrieved from external database.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@XmlRootElement
+public class Drug implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger			logger						= Logger.getLogger(Drug.class);
+
+	/**
+	 * Source of the data.
+	 */
+	private List<MiriamData>	sources						= new ArrayList<MiriamData>();
+
+	/**
+	 * Name of the drug.
+	 */
+	private String						name;
+
+	/**
+	 * Description of the drug.
+	 */
+	private String						description;
+
+	/**
+	 * Status of blood brain barries for the drug.
+	 */
+	private String						bloodBrainBarrier	= "N/A";
+
+	/**
+	 * Known brand names.
+	 */
+	private List<String>			brandNames				= new ArrayList<String>();
+
+	/**
+	 * Known targets.
+	 */
+	private List<Target>			targets						= new ArrayList<Target>();
+
+	/**
+	 * Known synonyms.
+	 */
+	private List<String>			synonyms					= new ArrayList<String>();
+
+	/**
+	 * Default constructor.
+	 */
+	public Drug() {
+
+	}
+
+	/**
+	 * Constructor that initializes object with the same information as parameter.
+	 * 
+	 * @param drug
+	 *          original drug
+	 */
+	public Drug(Drug drug) {
+		if (drug == null) {
+			return;
+		}
+		this.sources.addAll(drug.getSources());
+		this.description = drug.description;
+		this.brandNames.addAll(drug.getBrandNames());
+		this.synonyms.addAll(drug.getSynonyms());
+		this.targets.addAll(drug.getTargets());
+		this.bloodBrainBarrier = drug.getBloodBrainBarrier();
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder result = new StringBuilder("");
+		for (MiriamData md : sources) {
+			result.append("source: " + md.getDataType() + ", drugId: " + md.getResource() + "\n");
+		}
+		result.append(", name: " + name + "\nDescription:\n" + description + "\nSynonyms:");
+		for (String s : synonyms) {
+			result.append(s + "|");
+		}
+		result.append("\nTargets:");
+		for (Target t : targets) {
+			if (t.getSource() != null) {
+				result.append(t.getSource().getResource() + "|" + t.getName() + "|" + t.getGenes());
+			}
+			result.append("\nReferences:");
+			for (MiriamData md : t.getReferences()) {
+				result.append(md.getResource());
+			}
+		}
+		return result.toString();
+	}
+
+	/**
+	 * @return the name
+	 * @see #name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * @param name
+	 *          the name to set
+	 * @see #name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * @return the description
+	 * @see #description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * @param description
+	 *          the description to set
+	 * @see #description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * @return the bloodBrainBarrier
+	 * @see #bloodBrainBarrier
+	 */
+	public String getBloodBrainBarrier() {
+		return bloodBrainBarrier;
+	}
+
+	/**
+	 * @param bloodBrainBarrier
+	 *          the bloodBrainBarrier to set
+	 * @see #bloodBrainBarrier
+	 */
+	public void setBloodBrainBarrier(String bloodBrainBarrier) {
+		this.bloodBrainBarrier = bloodBrainBarrier;
+	}
+
+	/**
+	 * @return the brandNames
+	 * @see #brandNames
+	 */
+	public List<String> getBrandNames() {
+		return brandNames;
+	}
+
+	/**
+	 * @param brandNames
+	 *          the brandNames to set
+	 * @see #brandNames
+	 */
+	public void setBrandNames(List<String> brandNames) {
+		this.brandNames = brandNames;
+	}
+
+	/**
+	 * @return the targets
+	 * @see #targets
+	 */
+	@XmlElement(name = "target")
+	public List<Target> getTargets() {
+		return targets;
+	}
+
+	/**
+	 * @param targets
+	 *          the targets to set
+	 * @see #targets
+	 */
+	public void setTargets(List<Target> targets) {
+		this.targets = targets;
+	}
+
+	/**
+	 * @return the synonyms
+	 * @see #synonyms
+	 */
+	public List<String> getSynonyms() {
+		return synonyms;
+	}
+
+	/**
+	 * @param synonyms
+	 *          the synonyms to set
+	 * @see #synonyms
+	 */
+	public void setSynonyms(List<String> synonyms) {
+		this.synonyms = synonyms;
+	}
+
+	/**
+	 * Adds brand name into {@link #brandNames}.
+	 * 
+	 * @param brandName
+	 *          object to add
+	 */
+	public void addBrandName(String brandName) {
+		this.brandNames.add(brandName);
+	}
+
+	/**
+	 * Adds synonym into {@link #synonyms}.
+	 * 
+	 * @param synonym
+	 *          object to add
+	 */
+	public void addSynonym(String synonym) {
+		if (synonyms.contains(synonym)) {
+			logger.warn("Synonym already exists in the drug: " + synonym);
+		} else {
+			this.synonyms.add(synonym);
+		}
+	}
+
+	/**
+	 * Adds target into {@link #targets} list.
+	 * 
+	 * @param target
+	 *          object to add
+	 */
+	public void addTarget(Target target) {
+		this.targets.add(target);
+	}
+
+	/**
+	 * @param source
+	 *          the source to add
+	 * @see #sources
+	 */
+	public void addSource(MiriamData source) {
+		this.sources.add(source);
+	}
+
+	/**
+	 * @return the sources
+	 * @see #sources
+	 */
+	public List<MiriamData> getSources() {
+		return sources;
+	}
+
+	/**
+	 * @param sources
+	 *          the sources to set
+	 * @see #sources
+	 */
+	public void setSources(List<MiriamData> sources) {
+		this.sources = sources;
+	}
+
+	/**
+	 * Adds targets to the drug.
+	 * 
+	 * @param targets2
+	 *          list of targets to add
+	 */
+	public void addTargets(List<Target> targets2) {
+		this.targets.addAll(targets2);
+	}
+
 }
\ No newline at end of file
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/data/MeSH.java b/annotation/src/main/java/lcsb/mapviewer/annotation/data/MeSH.java
index 4bf88648b8..ce15b5c344 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/data/MeSH.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/data/MeSH.java
@@ -1,169 +1,169 @@
-package lcsb.mapviewer.annotation.data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
-
-/**
- * This class represents <a href="http://www.nlm.nih.gov/cgi/mesh//">MeSH</a>
- * object.
- * 
- * @author Ayan Rota
- * 
- */
-@XmlRootElement
-public class MeSH implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger			logger					 = Logger.getLogger(MeSH.class);
-
-	/**
-	 * short name.
-	 */
-	private String						name;
-
-	/**
-	 * MeSH identifier.
-	 */
-	private String						meSHId;
-
-	/**
-	 * Detailed description of the MeSH object.
-	 */
-	private String						description;
-
-	/**
-	 * List of synonyms.
-	 */
-	private List<String>			synonyms				 = new ArrayList<String>();
-
-	/**
-	 * Default constructor.
-	 */
-	public MeSH() {
-
-	}
-
-	/**
-	 * @param name
-	 *          short name.
-	 * @param meSHId
-	 *          database identifier.
-	 * @param description
-	 *          long description.
-	 * @param synonyms
-	 *          list of terms used as names for this object.
-	 */
-	public MeSH(String meSHId, String name, String description, List<String> synonyms) {
-		super();
-		this.name = name;
-		this.meSHId = meSHId;
-		this.description = description;
-		this.synonyms = synonyms;
-	}
-
-	/**
-	 * @return the name
-	 * @see #name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * @param name
-	 *          the name to set
-	 * @see #name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * @return the synonyms
-	 * @see #synonyms
-	 */
-	public List<String> getSynonyms() {
-		return synonyms;
-	}
-
-	/**
-	 * @param synonyms
-	 *          the synonyms to set
-	 * @see #synonyms
-	 */
-	public void setSynonyms(List<String> synonyms) {
-		this.synonyms = synonyms;
-	}
-
-	/**
-	 * @return database identifier.
-	 */
-	public String getMeSHId() {
-		return meSHId;
-	}
-
-	/**
-	 * @return description of the object.
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * @param meSHId
-	 *          database identifier
-	 */
-	public void setMeSHId(String meSHId) {
-		this.meSHId = meSHId;
-	}
-
-	/**
-	 * @param description
-	 *          long description.
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	@Override
-	public String toString() {
-		StringBuffer result = new StringBuffer();
-		result.append("\nid: " + meSHId);
-		result.append("\nname: " + name);
-		result.append("\ndescription:" + description);
-		result.append("\nsynonyms:" + getSynonymsString());
-		return result.toString();
-	}
-
-	/**
-	 * @return list of synonyms as string.
-	 */
-	public String getSynonymsString() {
-		return StringUtils.join(synonyms, ",");
-	}
-
-	/**
-	 * Adds synonym to the synonym list.
-	 * 
-	 * @param synonym
-	 *          synonym to add
-	 */
-	public void addSynonym(String synonym) {
-		synonyms.add(synonym);
-	}
-
-}
+package lcsb.mapviewer.annotation.data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+
+/**
+ * This class represents <a href="http://www.nlm.nih.gov/cgi/mesh//">MeSH</a>
+ * object.
+ * 
+ * @author Ayan Rota
+ * 
+ */
+@XmlRootElement
+public class MeSH implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger			logger					 = Logger.getLogger(MeSH.class);
+
+	/**
+	 * short name.
+	 */
+	private String						name;
+
+	/**
+	 * MeSH identifier.
+	 */
+	private String						meSHId;
+
+	/**
+	 * Detailed description of the MeSH object.
+	 */
+	private String						description;
+
+	/**
+	 * List of synonyms.
+	 */
+	private List<String>			synonyms				 = new ArrayList<String>();
+
+	/**
+	 * Default constructor.
+	 */
+	public MeSH() {
+
+	}
+
+	/**
+	 * @param name
+	 *          short name.
+	 * @param meSHId
+	 *          database identifier.
+	 * @param description
+	 *          long description.
+	 * @param synonyms
+	 *          list of terms used as names for this object.
+	 */
+	public MeSH(String meSHId, String name, String description, List<String> synonyms) {
+		super();
+		this.name = name;
+		this.meSHId = meSHId;
+		this.description = description;
+		this.synonyms = synonyms;
+	}
+
+	/**
+	 * @return the name
+	 * @see #name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * @param name
+	 *          the name to set
+	 * @see #name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * @return the synonyms
+	 * @see #synonyms
+	 */
+	public List<String> getSynonyms() {
+		return synonyms;
+	}
+
+	/**
+	 * @param synonyms
+	 *          the synonyms to set
+	 * @see #synonyms
+	 */
+	public void setSynonyms(List<String> synonyms) {
+		this.synonyms = synonyms;
+	}
+
+	/**
+	 * @return database identifier.
+	 */
+	public String getMeSHId() {
+		return meSHId;
+	}
+
+	/**
+	 * @return description of the object.
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * @param meSHId
+	 *          database identifier
+	 */
+	public void setMeSHId(String meSHId) {
+		this.meSHId = meSHId;
+	}
+
+	/**
+	 * @param description
+	 *          long description.
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	@Override
+	public String toString() {
+		StringBuffer result = new StringBuffer();
+		result.append("\nid: " + meSHId);
+		result.append("\nname: " + name);
+		result.append("\ndescription:" + description);
+		result.append("\nsynonyms:" + getSynonymsString());
+		return result.toString();
+	}
+
+	/**
+	 * @return list of synonyms as string.
+	 */
+	public String getSynonymsString() {
+		return StringUtils.join(synonyms, ",");
+	}
+
+	/**
+	 * Adds synonym to the synonym list.
+	 * 
+	 * @param synonym
+	 *          synonym to add
+	 */
+	public void addSynonym(String synonym) {
+		synonyms.add(synonym);
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/data/Target.java b/annotation/src/main/java/lcsb/mapviewer/annotation/data/Target.java
index 7536e114bf..c96e195ec0 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/data/Target.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/data/Target.java
@@ -1,229 +1,229 @@
-package lcsb.mapviewer.annotation.data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.MiriamData;
-
-/**
- * Describes element targetted by an element from external database. It could be
- * a {@link Drug} or {@link Chemical} or {@link MiRNA}.
- * 
- * @author Piotr Gawron
- * 
- */
-public class Target implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long				serialVersionUID = 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	private static transient Logger	logger					 = Logger.getLogger(Target.class);
-
-	/**
-	 * Database from which target was received.
-	 */
-	private MiriamData							source;
-
-	/**
-	 * Name of the target.
-	 */
-	private String									name;
-
-	/**
-	 * Organism in which target is located.
-	 */
-	private MiriamData							organism;
-
-	/**
-	 * List of genes located in a target.
-	 */
-	private List<MiriamData>				genes						 = new ArrayList<MiriamData>();
-
-	/**
-	 * List of references describing target.
-	 */
-	private List<MiriamData>				references			 = new ArrayList<MiriamData>();
-
-	/**
-	 * Type of target.
-	 */
-	private TargetType							type;
-
-	/**
-	 * Default constructor.
-	 */
-	public Target() {
-
-	}
-
-	/**
-	 * Constructor that initializes target with some data.
-	 * 
-	 * @param source
-	 *          from where the information about target was retrieved
-	 * @param gene
-	 *          {@link MiriamData} that identifies gene
-	 * @param references
-	 *          list of references that support this target
-	 */
-	public Target(MiriamData source, MiriamData gene, Collection<MiriamData> references) {
-		this.source = source;
-		if (gene != null) {
-			addGene(gene);
-		}
-		addReferences(references);
-		if (genes.size() == 1) {
-			setType(TargetType.SINGLE_PROTEIN);
-		}
-	}
-
-	/**
-	 * @return the type
-	 * @see #type
-	 */
-	public TargetType getType() {
-		return type;
-	}
-
-	/**
-	 * @param type
-	 *          the type to set
-	 * @see #type
-	 */
-	public void setType(TargetType type) {
-		this.type = type;
-	}
-
-	/**
-	 * 
-	 * @return {@link #references} list
-	 */
-	@XmlElement(name = "pubmed")
-	public List<MiriamData> getReferences() {
-		return references;
-	}
-
-	/**
-	 * 
-	 * @param md
-	 *          new {@link #references} list
-	 */
-	public void addReference(MiriamData md) {
-		if (this.references.contains(md)) {
-			logger.warn("Target " + getName() + " already has MiriamData: " + md);
-		} else {
-			this.references.add(md);
-		}
-	}
-
-	/**
-	 * Adds gene to the gene list.
-	 * 
-	 * @param gene
-	 *          object to add
-	 */
-	public void addGene(MiriamData gene) {
-		if (gene == null) {
-			throw new InvalidArgumentException("Cannot add null element");
-		}
-		this.genes.add(gene);
-	}
-
-	/**
-	 * @return the name
-	 * @see #name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * @param name
-	 *          the name to set
-	 * @see #name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * @return the organism
-	 * @see #organism
-	 */
-	public MiriamData getOrganism() {
-		return organism;
-	}
-
-	/**
-	 * @param organism
-	 *          the organism to set
-	 * @see #organism
-	 */
-	public void setOrganism(MiriamData organism) {
-		this.organism = organism;
-	}
-
-	/**
-	 * @return the geneCardId
-	 * @see #genes
-	 */
-	public List<MiriamData> getGenes() {
-		return genes;
-	}
-
-	/**
-	 * @param genes
-	 *          the genes to set
-	 * @see #genes
-	 */
-	public void setGenes(List<MiriamData> genes) {
-		this.genes = genes;
-	}
-
-	/**
-	 * @return the source
-	 * @see #source
-	 */
-	public MiriamData getSource() {
-		return source;
-	}
-
-	/**
-	 * @param source
-	 *          the source to set
-	 * @see #source
-	 */
-	public void setSource(MiriamData source) {
-		this.source = source;
-	}
-
-	/**
-	 * Adds set of references to the target.
-	 * 
-	 * @param references
-	 *          objects to add
-	 * 
-	 * @see #references
-	 */
-	public void addReferences(Collection<MiriamData> references) {
-		this.references.addAll(references);
-	}
-
-	@Override
-	public String toString() {
-		return "[" + this.getClass().getSimpleName() + "]: " + name + ", source: " + source + ", organism: " + organism + "; ";
-	}
-
-}
+package lcsb.mapviewer.annotation.data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.MiriamData;
+
+/**
+ * Describes element targetted by an element from external database. It could be
+ * a {@link Drug} or {@link Chemical} or {@link MiRNA}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class Target implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long				serialVersionUID = 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	private static transient Logger	logger					 = Logger.getLogger(Target.class);
+
+	/**
+	 * Database from which target was received.
+	 */
+	private MiriamData							source;
+
+	/**
+	 * Name of the target.
+	 */
+	private String									name;
+
+	/**
+	 * Organism in which target is located.
+	 */
+	private MiriamData							organism;
+
+	/**
+	 * List of genes located in a target.
+	 */
+	private List<MiriamData>				genes						 = new ArrayList<MiriamData>();
+
+	/**
+	 * List of references describing target.
+	 */
+	private List<MiriamData>				references			 = new ArrayList<MiriamData>();
+
+	/**
+	 * Type of target.
+	 */
+	private TargetType							type;
+
+	/**
+	 * Default constructor.
+	 */
+	public Target() {
+
+	}
+
+	/**
+	 * Constructor that initializes target with some data.
+	 * 
+	 * @param source
+	 *          from where the information about target was retrieved
+	 * @param gene
+	 *          {@link MiriamData} that identifies gene
+	 * @param references
+	 *          list of references that support this target
+	 */
+	public Target(MiriamData source, MiriamData gene, Collection<MiriamData> references) {
+		this.source = source;
+		if (gene != null) {
+			addGene(gene);
+		}
+		addReferences(references);
+		if (genes.size() == 1) {
+			setType(TargetType.SINGLE_PROTEIN);
+		}
+	}
+
+	/**
+	 * @return the type
+	 * @see #type
+	 */
+	public TargetType getType() {
+		return type;
+	}
+
+	/**
+	 * @param type
+	 *          the type to set
+	 * @see #type
+	 */
+	public void setType(TargetType type) {
+		this.type = type;
+	}
+
+	/**
+	 * 
+	 * @return {@link #references} list
+	 */
+	@XmlElement(name = "pubmed")
+	public List<MiriamData> getReferences() {
+		return references;
+	}
+
+	/**
+	 * 
+	 * @param md
+	 *          new {@link #references} list
+	 */
+	public void addReference(MiriamData md) {
+		if (this.references.contains(md)) {
+			logger.warn("Target " + getName() + " already has MiriamData: " + md);
+		} else {
+			this.references.add(md);
+		}
+	}
+
+	/**
+	 * Adds gene to the gene list.
+	 * 
+	 * @param gene
+	 *          object to add
+	 */
+	public void addGene(MiriamData gene) {
+		if (gene == null) {
+			throw new InvalidArgumentException("Cannot add null element");
+		}
+		this.genes.add(gene);
+	}
+
+	/**
+	 * @return the name
+	 * @see #name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * @param name
+	 *          the name to set
+	 * @see #name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * @return the organism
+	 * @see #organism
+	 */
+	public MiriamData getOrganism() {
+		return organism;
+	}
+
+	/**
+	 * @param organism
+	 *          the organism to set
+	 * @see #organism
+	 */
+	public void setOrganism(MiriamData organism) {
+		this.organism = organism;
+	}
+
+	/**
+	 * @return the geneCardId
+	 * @see #genes
+	 */
+	public List<MiriamData> getGenes() {
+		return genes;
+	}
+
+	/**
+	 * @param genes
+	 *          the genes to set
+	 * @see #genes
+	 */
+	public void setGenes(List<MiriamData> genes) {
+		this.genes = genes;
+	}
+
+	/**
+	 * @return the source
+	 * @see #source
+	 */
+	public MiriamData getSource() {
+		return source;
+	}
+
+	/**
+	 * @param source
+	 *          the source to set
+	 * @see #source
+	 */
+	public void setSource(MiriamData source) {
+		this.source = source;
+	}
+
+	/**
+	 * Adds set of references to the target.
+	 * 
+	 * @param references
+	 *          objects to add
+	 * 
+	 * @see #references
+	 */
+	public void addReferences(Collection<MiriamData> references) {
+		this.references.addAll(references);
+	}
+
+	@Override
+	public String toString() {
+		return "[" + this.getClass().getSimpleName() + "]: " + name + ", source: " + source + ", organism: " + organism + "; ";
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/data/TargetType.java b/annotation/src/main/java/lcsb/mapviewer/annotation/data/TargetType.java
index 6b695531bb..7d2dfa4b08 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/data/TargetType.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/data/TargetType.java
@@ -1,53 +1,53 @@
-package lcsb.mapviewer.annotation.data;
-
-/**
- * Type of the {@link Target}.
- * 
- * @author Piotr Gawron
- * 
- */
-public enum TargetType {
-
-	/**
-	 * Target is a single protein.
-	 */
-	SINGLE_PROTEIN("Single protein"),
-	
-	/**
-	 * Target is a complex.
-	 */
-	COMPLEX_PROTEIN("Complex protein"),
-	
-	/**
-	 * Target is a protein family.
-	 */
-	PROTEIN_FAMILY("Protein family"),
-	
-	/**
-	 * Target is of other type.
-	 */
-	OTHER("Other");
-
-	/**
-	 * Human readable name.
-	 */
-	private String commonName;
-
-	/**
-	 * Default constructor that creates enum position.
-	 * 
-	 * @param commonName
-	 *          {@link #commonName}
-	 */
-	TargetType(String commonName) {
-		this.commonName = commonName;
-	}
-
-	/**
-	 * 
-	 * @return {@link #commonName}
-	 */
-	public String getCommonName() {
-		return commonName;
-	}
-}
+package lcsb.mapviewer.annotation.data;
+
+/**
+ * Type of the {@link Target}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public enum TargetType {
+
+	/**
+	 * Target is a single protein.
+	 */
+	SINGLE_PROTEIN("Single protein"),
+	
+	/**
+	 * Target is a complex.
+	 */
+	COMPLEX_PROTEIN("Complex protein"),
+	
+	/**
+	 * Target is a protein family.
+	 */
+	PROTEIN_FAMILY("Protein family"),
+	
+	/**
+	 * Target is of other type.
+	 */
+	OTHER("Other");
+
+	/**
+	 * Human readable name.
+	 */
+	private String commonName;
+
+	/**
+	 * Default constructor that creates enum position.
+	 * 
+	 * @param commonName
+	 *          {@link #commonName}
+	 */
+	TargetType(String commonName) {
+		this.commonName = commonName;
+	}
+
+	/**
+	 * 
+	 * @return {@link #commonName}
+	 */
+	public String getCommonName() {
+		return commonName;
+	}
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ChemicalSearchException.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ChemicalSearchException.java
index 6c06b5320f..bc6e7d8f50 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ChemicalSearchException.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ChemicalSearchException.java
@@ -1,48 +1,48 @@
-package lcsb.mapviewer.annotation.services;
-
-/**
- * Exception thrown when there was a problem when searching for a chemical.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ChemicalSearchException extends Exception {
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param string
-	 *          exception message
-	 */
-	public ChemicalSearchException(String string) {
-		super(string);
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param e
-	 *          parent exception
-	 */
-	public ChemicalSearchException(Exception e) {
-		super(e);
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param message
-	 *          exception message
-	 * @param e
-	 *          source exception
-	 */
-	public ChemicalSearchException(String message, Exception e) {
-		super(message, e);
-	}
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-}
+package lcsb.mapviewer.annotation.services;
+
+/**
+ * Exception thrown when there was a problem when searching for a chemical.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ChemicalSearchException extends Exception {
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param string
+	 *          exception message
+	 */
+	public ChemicalSearchException(String string) {
+		super(string);
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param e
+	 *          parent exception
+	 */
+	public ChemicalSearchException(Exception e) {
+		super(e);
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param message
+	 *          exception message
+	 * @param e
+	 *          source exception
+	 */
+	public ChemicalSearchException(String message, Exception e) {
+		super(message, e);
+	}
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugAnnotation.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugAnnotation.java
index 2ddb578961..64d4f11adc 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugAnnotation.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugAnnotation.java
@@ -1,113 +1,113 @@
-package lcsb.mapviewer.annotation.services;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import lcsb.mapviewer.annotation.cache.CachableInterface;
-import lcsb.mapviewer.annotation.cache.XmlSerializer;
-import lcsb.mapviewer.annotation.data.Drug;
-import lcsb.mapviewer.model.map.MiriamData;
-
-/**
- * Abstract class with some functionalities used by class accessing drug
- * databases.
- * 
- * @author Piotr Gawron
- * 
- */
-public abstract class DrugAnnotation extends CachableInterface {
-
-	/**
-	 * Object that allows to serialize {@link Drug} elements into xml string and
-	 * deserialize xml into {@link Drug} objects.
-	 */
-	private XmlSerializer<Drug> drugSerializer;
-
-	/**
-	 * Default constructor. Initializes structures used for transforming
-	 * {@link Drug} from/to xml.
-	 * 
-	 * @param clazz
-	 *          class that identfies this {@link CachableInterface}
-	 */
-	public DrugAnnotation(final Class<? extends DrugAnnotation> clazz) {
-		super(clazz);
-		drugSerializer = new XmlSerializer<>(Drug.class);
-	}
-
-	/**
-	 * Returns a drug for given name.
-	 * 
-	 * @param name
-	 *          name of the drug
-	 * @return drug for a given name
-	 * @throws DrugSearchException
-	 *           thrown when there are problems with finding drug
-	 */
-	public abstract Drug findDrug(String name) throws DrugSearchException;
-
-	/**
-	 * Returns list of drugs that target protein.
-	 * 
-	 * @param target
-	 *          {@link MiriamData} describing target
-	 * @return list of drugs
-	 * @throws DrugSearchException
-	 *           thrown when there are problems with finding drug
-	 */
-
-	public abstract List<Drug> getDrugListByTarget(MiriamData target) throws DrugSearchException;
-
-	/**
-	 * Returns list of drugs that target at least one protein from the parameter
-	 * list.
-	 * 
-	 * @param targets
-	 *          list of {@link MiriamData} describing targets
-	 * @return list of drugs
-	 * @throws DrugSearchException
-	 *           thrown when there are problems with connection to drug database
-	 */
-	public List<Drug> getDrugListByTargets(Collection<MiriamData> targets) throws DrugSearchException {
-		List<Drug> result = new ArrayList<Drug>();
-		Set<String> set = new HashSet<String>();
-		Set<MiriamData> searchedResult = new HashSet<MiriamData>();
-		for (MiriamData md : targets) {
-			if (searchedResult.contains(md)) {
-				continue;
-			}
-			searchedResult.add(md);
-			List<Drug> drugs = getDrugListByTarget(md);
-			for (Drug drug : drugs) {
-				if (!set.contains(drug.getSources().get(0).getResource())) {
-					result.add(drug);
-					set.add(drug.getSources().get(0).getResource());
-				} else {
-					continue;
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * @return the drugSerializer
-	 * @see #drugSerializer
-	 */
-	protected XmlSerializer<Drug> getDrugSerializer() {
-		return drugSerializer;
-	}
-
-	/**
-	 * @param drugSerializer
-	 *          the drugSerializer to set
-	 * @see #drugSerializer
-	 */
-	protected void setDrugSerializer(XmlSerializer<Drug> drugSerializer) {
-		this.drugSerializer = drugSerializer;
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import lcsb.mapviewer.annotation.cache.CachableInterface;
+import lcsb.mapviewer.annotation.cache.XmlSerializer;
+import lcsb.mapviewer.annotation.data.Drug;
+import lcsb.mapviewer.model.map.MiriamData;
+
+/**
+ * Abstract class with some functionalities used by class accessing drug
+ * databases.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public abstract class DrugAnnotation extends CachableInterface {
+
+	/**
+	 * Object that allows to serialize {@link Drug} elements into xml string and
+	 * deserialize xml into {@link Drug} objects.
+	 */
+	private XmlSerializer<Drug> drugSerializer;
+
+	/**
+	 * Default constructor. Initializes structures used for transforming
+	 * {@link Drug} from/to xml.
+	 * 
+	 * @param clazz
+	 *          class that identfies this {@link CachableInterface}
+	 */
+	public DrugAnnotation(final Class<? extends DrugAnnotation> clazz) {
+		super(clazz);
+		drugSerializer = new XmlSerializer<>(Drug.class);
+	}
+
+	/**
+	 * Returns a drug for given name.
+	 * 
+	 * @param name
+	 *          name of the drug
+	 * @return drug for a given name
+	 * @throws DrugSearchException
+	 *           thrown when there are problems with finding drug
+	 */
+	public abstract Drug findDrug(String name) throws DrugSearchException;
+
+	/**
+	 * Returns list of drugs that target protein.
+	 * 
+	 * @param target
+	 *          {@link MiriamData} describing target
+	 * @return list of drugs
+	 * @throws DrugSearchException
+	 *           thrown when there are problems with finding drug
+	 */
+
+	public abstract List<Drug> getDrugListByTarget(MiriamData target) throws DrugSearchException;
+
+	/**
+	 * Returns list of drugs that target at least one protein from the parameter
+	 * list.
+	 * 
+	 * @param targets
+	 *          list of {@link MiriamData} describing targets
+	 * @return list of drugs
+	 * @throws DrugSearchException
+	 *           thrown when there are problems with connection to drug database
+	 */
+	public List<Drug> getDrugListByTargets(Collection<MiriamData> targets) throws DrugSearchException {
+		List<Drug> result = new ArrayList<Drug>();
+		Set<String> set = new HashSet<String>();
+		Set<MiriamData> searchedResult = new HashSet<MiriamData>();
+		for (MiriamData md : targets) {
+			if (searchedResult.contains(md)) {
+				continue;
+			}
+			searchedResult.add(md);
+			List<Drug> drugs = getDrugListByTarget(md);
+			for (Drug drug : drugs) {
+				if (!set.contains(drug.getSources().get(0).getResource())) {
+					result.add(drug);
+					set.add(drug.getSources().get(0).getResource());
+				} else {
+					continue;
+				}
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @return the drugSerializer
+	 * @see #drugSerializer
+	 */
+	protected XmlSerializer<Drug> getDrugSerializer() {
+		return drugSerializer;
+	}
+
+	/**
+	 * @param drugSerializer
+	 *          the drugSerializer to set
+	 * @see #drugSerializer
+	 */
+	protected void setDrugSerializer(XmlSerializer<Drug> drugSerializer) {
+		this.drugSerializer = drugSerializer;
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugSearchException.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugSearchException.java
index f52c229c3e..ba889c3ab2 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugSearchException.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugSearchException.java
@@ -1,48 +1,48 @@
-package lcsb.mapviewer.annotation.services;
-
-/**
- * Exception thrown when there was a problem when searching for a drug.
- * 
- * @author Piotr Gawron
- * 
- */
-public class DrugSearchException extends Exception {
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param string
-	 *          exception message
-	 */
-	public DrugSearchException(String string) {
-		super(string);
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param e
-	 *          parent exception
-	 */
-	public DrugSearchException(Exception e) {
-		super(e);
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param message
-	 *          exception message
-	 * @param e
-	 *          source exception
-	 */
-	public DrugSearchException(String message, Exception e) {
-		super(message, e);
-	}
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-}
+package lcsb.mapviewer.annotation.services;
+
+/**
+ * Exception thrown when there was a problem when searching for a drug.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class DrugSearchException extends Exception {
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param string
+	 *          exception message
+	 */
+	public DrugSearchException(String string) {
+		super(string);
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param e
+	 *          parent exception
+	 */
+	public DrugSearchException(Exception e) {
+		super(e);
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param message
+	 *          exception message
+	 * @param e
+	 *          source exception
+	 */
+	public DrugSearchException(String message, Exception e) {
+		super(message, e);
+	}
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankXMLParser.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankXMLParser.java
index 3c46d45801..de7fd5928b 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankXMLParser.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankXMLParser.java
@@ -1,404 +1,404 @@
-package lcsb.mapviewer.annotation.services;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.annotation.data.Drug;
-import lcsb.mapviewer.annotation.data.Target;
-import lcsb.mapviewer.annotation.data.TargetType;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-
-/**
- * Class used for parsing and accessing data from xml drugbank database. Parser
- * was developed by Janek. I tried to comment it as best as I could, but...
- * 
- * @author Piotr Gawron
- * 
- */
-public class DrugbankXMLParser {
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger		 logger									 = Logger.getLogger(DrugbankXMLParser.class);
-
-	/**
-	 * ???
-	 */
-	private static final int RELATED_INFORMATION_TAG = 3;
-
-	/**
-	 * Node identifing drug.
-	 */
-	static final String			 DRUG										 = "drug";
-
-	/**
-	 * Node identifing drug identifier.
-	 */
-	static final String			 DID										 = "drugbank-id";
-
-	/**
-	 * Node identifing drug name.
-	 */
-	static final String			 NAME										 = "name";
-
-	/**
-	 * Node identifing drug description.
-	 */
-	static final String			 DES										 = "description";
-
-	/**
-	 * Node identifing single synonym.
-	 */
-	static final String			 SY											 = "synonym";
-
-	/**
-	 * Node identifing list of synonym.
-	 */
-	static final String			 SYS										 = "synonyms";
-
-	/**
-	 * Node identifing single target.
-	 */
-	static final String			 TAR										 = "target";
-
-	/**
-	 * Node identifing list of targets.
-	 */
-	static final String			 TARGETS								 = "targets";
-
-	/**
-	 * File with the drugbank xml file.
-	 */
-	private String					 dbFile									 = null;
-
-	/**
-	 * Object used to access information about organism taxonomy.
-	 */
-	private TaxonomyBackend	 taxonomyBackend;
-
-	/**
-	 * List of drugs found in the xml file.
-	 */
-	private List<Drug>			 drugList								 = null;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param file
-	 *          file where data is stored
-	 * @param backend
-	 *          {@link #taxonomyBackend}
-	 */
-	public DrugbankXMLParser(String file, TaxonomyBackend backend) {
-		this.dbFile = file;
-		this.taxonomyBackend = backend;
-	}
-
-	/**
-	 * Transforms string representing pubmed identifiers into {@link MiriamData}
-	 * objects and set them to {@link Target}.
-	 * 
-	 * @param target
-	 *          where the data should be put
-	 * @param referencesString
-	 *          string with pubmed identifiers
-	 */
-	void getPubmedFromRef(Target target, String referencesString) {
-		int position = 0;
-		int length = "/pubmed/".length();
-		while ((position = referencesString.indexOf("/pubmed/", position)) > 0) {
-			position += length;
-			StringBuilder tmp = new StringBuilder("");
-			while (position < referencesString.length() && referencesString.charAt(position) >= '0' && referencesString.charAt(position) <= '9') {
-				tmp.append(referencesString.charAt(position));
-				position++;
-			}
-			target.addReference(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, tmp.toString()));
-		}
-	}
-
-	/**
-	 * Adds gene identifiers to the target.
-	 * 
-	 * @param reader
-	 *          xml reader used for parsing xml
-	 * @param target
-	 *          where the data should be added
-	 * @throws XMLStreamException
-	 *           thrown when there is a problem with xml
-	 */
-	public void getGeneCardId(XMLStreamReader reader, Target target) throws XMLStreamException {
-		boolean relevant = false;
-		int event;
-		while (true) {
-			event = reader.next();
-			if (event == XMLStreamConstants.CHARACTERS) {
-				if (reader.getText().trim().equals("GeneCards")) {
-					relevant = true;
-				} else if (relevant && !reader.getText().trim().equals("")) {
-					String identifier = reader.getText().trim();
-					target.addGene(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.HGNC_SYMBOL, identifier));
-					relevant = false;
-				}
-			} else if (event == XMLStreamConstants.END_ELEMENT) {
-				if (reader.getLocalName().equals("external-identifiers")) {
-					break;
-				}
-			}
-		}
-	}
-
-	/**
-	 * This function is magic...
-	 * 
-	 * @param localName
-	 *          ???
-	 * @param tagContent
-	 *          ???
-	 * @param tagName
-	 *          ???
-	 * @param rel
-	 *          ???
-	 * @param target
-	 *          ???
-	 * @param drug
-	 *          ???
-	 * @return ???
-	 * @throws DrugSearchException
-	 *           thrown when there is a problem with data coming from external
-	 *           databases
-	 */
-	public int targetEndElement(String localName, String tagContent, String tagName, Boolean rel, Target target, Drug drug) throws DrugSearchException {
-		if (localName.equals("id")) {
-			if (rel) {
-				MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.DRUGBANK_TARGET_V4, tagContent);
-				target.setSource(md);
-				return 0;
-			}
-		} else if (localName.equals("name")) {
-			if (rel) {
-				target.setName(tagContent);
-				return 0;
-			}
-		} else if (localName.equals("organism")) {
-			if (rel) {
-				try {
-					target.setOrganism(taxonomyBackend.getByName(tagContent));
-				} catch (TaxonomySearchException e) {
-					throw new DrugSearchException(e);
-				}
-				return 0;
-			}
-
-		} else if (localName.equals("references")) {
-			if (rel) {
-				return 1;
-			}
-		} else if (localName.equals(TAR)) {
-			if (rel) {
-				drug.addTarget(target);
-				return 0;
-			}
-
-		} else if (localName.equals(TARGETS)) {
-			return 2;
-		} else if (localName.equals(tagName)) {
-			return RELATED_INFORMATION_TAG;
-		}
-		return 0;
-	}
-
-	/**
-	 * Adds target to a drug.
-	 * 
-	 * @param reader
-	 *          xml reader used for parsing xml
-	 * @param drug
-	 *          where target should be added
-	 * @throws XMLStreamException
-	 *           thrown when there is a problem with xml
-	 * @throws DrugSearchException
-	 *           thrown when there is a problem with data coming from external
-	 *           databases
-	 */
-	public void addTargetToDrug(XMLStreamReader reader, Drug drug) throws XMLStreamException, DrugSearchException {
-		boolean relatedInformation = true;
-		String tagName = null;
-		String tagContent = null;
-		Target target = null;
-		boolean readingReferences = false;
-		while (true) {
-			int event = reader.next();
-
-			if (event == XMLStreamConstants.START_ELEMENT) {
-				if (relatedInformation) {
-					if (TAR.equals(reader.getLocalName())) {
-						target = new Target();
-						target.setType(TargetType.SINGLE_PROTEIN);
-					} else {
-						relatedInformation = false;
-						tagName = reader.getLocalName();
-						if ("id".equals(tagName) || "name".equals(tagName) || "organism".equals(tagName)) {
-							relatedInformation = true;
-						}
-						if ("references".equals(tagName)) {
-							relatedInformation = true;
-							readingReferences = true;
-						}
-						if ("components".equals(tagName)) {
-							relatedInformation = true;
-							getGeneCardId(reader, target);
-						}
-					}
-				}
-			}
-			if (event == XMLStreamConstants.CHARACTERS) {
-				tagContent = reader.getText().trim();
-				if (readingReferences) {
-					getPubmedFromRef(target, tagContent);
-				}
-			}
-
-			if (event == XMLStreamConstants.END_ELEMENT) {
-				int what = targetEndElement(reader.getLocalName(), tagContent, tagName, relatedInformation, target, drug);
-				if (what == 1) {
-					readingReferences = false;
-				} else if (what == 2) {
-					break;
-				} else if (what == RELATED_INFORMATION_TAG) {
-					relatedInformation = true;
-				}
-			}
-		}
-
-	}
-
-	/**
-	 * Checks if tag is important for us or not.
-	 * 
-	 * @param tagName
-	 *          name of the tag
-	 * @return true if tag is relevant, <code>false</code> otherwise
-	 */
-	public Boolean tagNameRelated(String tagName) {
-		if ("drugs".equals(tagName) || DID.equals(tagName) || NAME.equals(tagName) || DES.equals(tagName) || DES.equals(tagName) || SY.equals(tagName)
-				|| SYS.equals(tagName)) {
-			return true;
-		}
-		return false;
-
-	}
-
-	/**
-	 * Gets drug from xml database.
-	 * 
-	 * @param drugName
-	 *          name of the drug
-	 * @return drug from the database
-	 * @throws DrugSearchException
-	 *           thrown when there is a problem with finding drug
-	 */
-	public Drug findDrug(String drugName) throws DrugSearchException {
-		for (Drug drug : getDrugList()) {
-			if (drug.getName().equalsIgnoreCase(drugName)) {
-				return drug;
-			}
-			for (String string : drug.getSynonyms()) {
-				if (string.equalsIgnoreCase(drugName)) {
-					return drug;
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Gets drug list from xml database.
-	 * 
-	 * @return drug list from the database
-	 * @throws DrugSearchException
-	 *           thrown when there is problem with finding drug
-	 */
-	public List<Drug> getDrugList() throws DrugSearchException {
-		if (drugList != null) {
-			return drugList;
-		}
-		drugList = new ArrayList<Drug>();
-		/*************** INIT ******************************/
-		try {
-			XMLInputFactory f = XMLInputFactory.newInstance();
-			FileInputStream temp = new FileInputStream(dbFile);
-			XMLStreamReader reader = f.createXMLStreamReader(temp);
-
-			Drug drug = null;
-			String tagContent = null;
-			boolean relevant = true;
-			String tagName = null;
-			/*************** END OF INIT ***********************/
-			while (reader.hasNext()) {
-				int event = reader.next();
-
-				if (event == XMLStreamConstants.START_ELEMENT) {
-					if (relevant) {
-						if (DRUG.equals(reader.getLocalName())) {
-							drug = new Drug();
-						} else {
-							relevant = false;
-							tagName = reader.getLocalName();
-							if (tagNameRelated(tagName)) {
-								relevant = true;
-							}
-							if (TARGETS.equals(tagName)) {
-								relevant = true;
-								addTargetToDrug(reader, drug);
-							}
-						}
-					}
-				} else if (event == XMLStreamConstants.CHARACTERS) {
-					tagContent = reader.getText().trim();
-				} else if (event == XMLStreamConstants.END_ELEMENT) {
-					if (reader.getLocalName().equals(DID)) {
-						if (relevant) {
-							MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.DRUGBANK, tagContent);
-							drug.addSource(md);
-						}
-					} else if (reader.getLocalName().equals(NAME)) {
-						if (relevant) {
-							drug.setName(tagContent);
-						}
-					} else if (reader.getLocalName().equals(DES)) {
-						if (relevant && (!"".equals(tagContent.trim()))) {
-							drug.setDescription(tagContent);
-						}
-					} else if (reader.getLocalName().equals(DRUG)) {
-						if (relevant) {
-							drugList.add(drug);
-						}
-					} else if (reader.getLocalName().equals(SY)) {
-						if (relevant) {
-							drug.addSynonym(tagContent);
-						}
-					} else if (!relevant && tagName.equals(reader.getLocalName())) {
-						relevant = true;
-					}
-				}
-			}
-
-		} catch (XMLStreamException | FileNotFoundException e) {
-			throw new DrugSearchException("Problem with processing input file", e);
-		}
-		return drugList;
-	}
+package lcsb.mapviewer.annotation.services;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.annotation.data.Drug;
+import lcsb.mapviewer.annotation.data.Target;
+import lcsb.mapviewer.annotation.data.TargetType;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+
+/**
+ * Class used for parsing and accessing data from xml drugbank database. Parser
+ * was developed by Janek. I tried to comment it as best as I could, but...
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class DrugbankXMLParser {
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger		 logger									 = Logger.getLogger(DrugbankXMLParser.class);
+
+	/**
+	 * ???
+	 */
+	private static final int RELATED_INFORMATION_TAG = 3;
+
+	/**
+	 * Node identifing drug.
+	 */
+	static final String			 DRUG										 = "drug";
+
+	/**
+	 * Node identifing drug identifier.
+	 */
+	static final String			 DID										 = "drugbank-id";
+
+	/**
+	 * Node identifing drug name.
+	 */
+	static final String			 NAME										 = "name";
+
+	/**
+	 * Node identifing drug description.
+	 */
+	static final String			 DES										 = "description";
+
+	/**
+	 * Node identifing single synonym.
+	 */
+	static final String			 SY											 = "synonym";
+
+	/**
+	 * Node identifing list of synonym.
+	 */
+	static final String			 SYS										 = "synonyms";
+
+	/**
+	 * Node identifing single target.
+	 */
+	static final String			 TAR										 = "target";
+
+	/**
+	 * Node identifing list of targets.
+	 */
+	static final String			 TARGETS								 = "targets";
+
+	/**
+	 * File with the drugbank xml file.
+	 */
+	private String					 dbFile									 = null;
+
+	/**
+	 * Object used to access information about organism taxonomy.
+	 */
+	private TaxonomyBackend	 taxonomyBackend;
+
+	/**
+	 * List of drugs found in the xml file.
+	 */
+	private List<Drug>			 drugList								 = null;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param file
+	 *          file where data is stored
+	 * @param backend
+	 *          {@link #taxonomyBackend}
+	 */
+	public DrugbankXMLParser(String file, TaxonomyBackend backend) {
+		this.dbFile = file;
+		this.taxonomyBackend = backend;
+	}
+
+	/**
+	 * Transforms string representing pubmed identifiers into {@link MiriamData}
+	 * objects and set them to {@link Target}.
+	 * 
+	 * @param target
+	 *          where the data should be put
+	 * @param referencesString
+	 *          string with pubmed identifiers
+	 */
+	void getPubmedFromRef(Target target, String referencesString) {
+		int position = 0;
+		int length = "/pubmed/".length();
+		while ((position = referencesString.indexOf("/pubmed/", position)) > 0) {
+			position += length;
+			StringBuilder tmp = new StringBuilder("");
+			while (position < referencesString.length() && referencesString.charAt(position) >= '0' && referencesString.charAt(position) <= '9') {
+				tmp.append(referencesString.charAt(position));
+				position++;
+			}
+			target.addReference(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, tmp.toString()));
+		}
+	}
+
+	/**
+	 * Adds gene identifiers to the target.
+	 * 
+	 * @param reader
+	 *          xml reader used for parsing xml
+	 * @param target
+	 *          where the data should be added
+	 * @throws XMLStreamException
+	 *           thrown when there is a problem with xml
+	 */
+	public void getGeneCardId(XMLStreamReader reader, Target target) throws XMLStreamException {
+		boolean relevant = false;
+		int event;
+		while (true) {
+			event = reader.next();
+			if (event == XMLStreamConstants.CHARACTERS) {
+				if (reader.getText().trim().equals("GeneCards")) {
+					relevant = true;
+				} else if (relevant && !reader.getText().trim().equals("")) {
+					String identifier = reader.getText().trim();
+					target.addGene(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.HGNC_SYMBOL, identifier));
+					relevant = false;
+				}
+			} else if (event == XMLStreamConstants.END_ELEMENT) {
+				if (reader.getLocalName().equals("external-identifiers")) {
+					break;
+				}
+			}
+		}
+	}
+
+	/**
+	 * This function is magic...
+	 * 
+	 * @param localName
+	 *          ???
+	 * @param tagContent
+	 *          ???
+	 * @param tagName
+	 *          ???
+	 * @param rel
+	 *          ???
+	 * @param target
+	 *          ???
+	 * @param drug
+	 *          ???
+	 * @return ???
+	 * @throws DrugSearchException
+	 *           thrown when there is a problem with data coming from external
+	 *           databases
+	 */
+	public int targetEndElement(String localName, String tagContent, String tagName, Boolean rel, Target target, Drug drug) throws DrugSearchException {
+		if (localName.equals("id")) {
+			if (rel) {
+				MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.DRUGBANK_TARGET_V4, tagContent);
+				target.setSource(md);
+				return 0;
+			}
+		} else if (localName.equals("name")) {
+			if (rel) {
+				target.setName(tagContent);
+				return 0;
+			}
+		} else if (localName.equals("organism")) {
+			if (rel) {
+				try {
+					target.setOrganism(taxonomyBackend.getByName(tagContent));
+				} catch (TaxonomySearchException e) {
+					throw new DrugSearchException(e);
+				}
+				return 0;
+			}
+
+		} else if (localName.equals("references")) {
+			if (rel) {
+				return 1;
+			}
+		} else if (localName.equals(TAR)) {
+			if (rel) {
+				drug.addTarget(target);
+				return 0;
+			}
+
+		} else if (localName.equals(TARGETS)) {
+			return 2;
+		} else if (localName.equals(tagName)) {
+			return RELATED_INFORMATION_TAG;
+		}
+		return 0;
+	}
+
+	/**
+	 * Adds target to a drug.
+	 * 
+	 * @param reader
+	 *          xml reader used for parsing xml
+	 * @param drug
+	 *          where target should be added
+	 * @throws XMLStreamException
+	 *           thrown when there is a problem with xml
+	 * @throws DrugSearchException
+	 *           thrown when there is a problem with data coming from external
+	 *           databases
+	 */
+	public void addTargetToDrug(XMLStreamReader reader, Drug drug) throws XMLStreamException, DrugSearchException {
+		boolean relatedInformation = true;
+		String tagName = null;
+		String tagContent = null;
+		Target target = null;
+		boolean readingReferences = false;
+		while (true) {
+			int event = reader.next();
+
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (relatedInformation) {
+					if (TAR.equals(reader.getLocalName())) {
+						target = new Target();
+						target.setType(TargetType.SINGLE_PROTEIN);
+					} else {
+						relatedInformation = false;
+						tagName = reader.getLocalName();
+						if ("id".equals(tagName) || "name".equals(tagName) || "organism".equals(tagName)) {
+							relatedInformation = true;
+						}
+						if ("references".equals(tagName)) {
+							relatedInformation = true;
+							readingReferences = true;
+						}
+						if ("components".equals(tagName)) {
+							relatedInformation = true;
+							getGeneCardId(reader, target);
+						}
+					}
+				}
+			}
+			if (event == XMLStreamConstants.CHARACTERS) {
+				tagContent = reader.getText().trim();
+				if (readingReferences) {
+					getPubmedFromRef(target, tagContent);
+				}
+			}
+
+			if (event == XMLStreamConstants.END_ELEMENT) {
+				int what = targetEndElement(reader.getLocalName(), tagContent, tagName, relatedInformation, target, drug);
+				if (what == 1) {
+					readingReferences = false;
+				} else if (what == 2) {
+					break;
+				} else if (what == RELATED_INFORMATION_TAG) {
+					relatedInformation = true;
+				}
+			}
+		}
+
+	}
+
+	/**
+	 * Checks if tag is important for us or not.
+	 * 
+	 * @param tagName
+	 *          name of the tag
+	 * @return true if tag is relevant, <code>false</code> otherwise
+	 */
+	public Boolean tagNameRelated(String tagName) {
+		if ("drugs".equals(tagName) || DID.equals(tagName) || NAME.equals(tagName) || DES.equals(tagName) || DES.equals(tagName) || SY.equals(tagName)
+				|| SYS.equals(tagName)) {
+			return true;
+		}
+		return false;
+
+	}
+
+	/**
+	 * Gets drug from xml database.
+	 * 
+	 * @param drugName
+	 *          name of the drug
+	 * @return drug from the database
+	 * @throws DrugSearchException
+	 *           thrown when there is a problem with finding drug
+	 */
+	public Drug findDrug(String drugName) throws DrugSearchException {
+		for (Drug drug : getDrugList()) {
+			if (drug.getName().equalsIgnoreCase(drugName)) {
+				return drug;
+			}
+			for (String string : drug.getSynonyms()) {
+				if (string.equalsIgnoreCase(drugName)) {
+					return drug;
+				}
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Gets drug list from xml database.
+	 * 
+	 * @return drug list from the database
+	 * @throws DrugSearchException
+	 *           thrown when there is problem with finding drug
+	 */
+	public List<Drug> getDrugList() throws DrugSearchException {
+		if (drugList != null) {
+			return drugList;
+		}
+		drugList = new ArrayList<Drug>();
+		/*************** INIT ******************************/
+		try {
+			XMLInputFactory f = XMLInputFactory.newInstance();
+			FileInputStream temp = new FileInputStream(dbFile);
+			XMLStreamReader reader = f.createXMLStreamReader(temp);
+
+			Drug drug = null;
+			String tagContent = null;
+			boolean relevant = true;
+			String tagName = null;
+			/*************** END OF INIT ***********************/
+			while (reader.hasNext()) {
+				int event = reader.next();
+
+				if (event == XMLStreamConstants.START_ELEMENT) {
+					if (relevant) {
+						if (DRUG.equals(reader.getLocalName())) {
+							drug = new Drug();
+						} else {
+							relevant = false;
+							tagName = reader.getLocalName();
+							if (tagNameRelated(tagName)) {
+								relevant = true;
+							}
+							if (TARGETS.equals(tagName)) {
+								relevant = true;
+								addTargetToDrug(reader, drug);
+							}
+						}
+					}
+				} else if (event == XMLStreamConstants.CHARACTERS) {
+					tagContent = reader.getText().trim();
+				} else if (event == XMLStreamConstants.END_ELEMENT) {
+					if (reader.getLocalName().equals(DID)) {
+						if (relevant) {
+							MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.DRUGBANK, tagContent);
+							drug.addSource(md);
+						}
+					} else if (reader.getLocalName().equals(NAME)) {
+						if (relevant) {
+							drug.setName(tagContent);
+						}
+					} else if (reader.getLocalName().equals(DES)) {
+						if (relevant && (!"".equals(tagContent.trim()))) {
+							drug.setDescription(tagContent);
+						}
+					} else if (reader.getLocalName().equals(DRUG)) {
+						if (relevant) {
+							drugList.add(drug);
+						}
+					} else if (reader.getLocalName().equals(SY)) {
+						if (relevant) {
+							drug.addSynonym(tagContent);
+						}
+					} else if (!relevant && tagName.equals(reader.getLocalName())) {
+						relevant = true;
+					}
+				}
+			}
+
+		} catch (XMLStreamException | FileNotFoundException e) {
+			throw new DrugSearchException("Problem with processing input file", e);
+		}
+		return drugList;
+	}
 }
\ No newline at end of file
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ExternalServiceStatus.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ExternalServiceStatus.java
index dd45fbfd58..15cf7a96d6 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ExternalServiceStatus.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ExternalServiceStatus.java
@@ -1,91 +1,91 @@
-package lcsb.mapviewer.annotation.services;
-
-/**
- * This class represents status of the service that access data from external
- * resources (database, webpage, etc.).
- * 
- * @author Piotr Gawron
- * 
- */
-public class ExternalServiceStatus {
-
-	/**
-	 * Name of the service.
-	 */
-	private String										name;
-
-	/**
-	 * Status of the external resource.
-	 */
-	private ExternalServiceStatusType	status;
-
-	/**
-	 * Webpage associated with external resource.
-	 */
-	private String										page;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param name
-	 *          name of the service
-	 * @param page
-	 *          webpage associated with the external resource
-	 */
-	public ExternalServiceStatus(String name, String page) {
-		this.setName(name);
-		this.setPage(page);
-	}
-
-	/**
-	 * @return the name
-	 * @see #name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * @param name
-	 *          the name to set
-	 * @see #name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * @return the status
-	 * @see #status
-	 */
-	public ExternalServiceStatusType getStatus() {
-		return status;
-	}
-
-	/**
-	 * @param status
-	 *          the status to set
-	 * @see #status
-	 */
-	public void setStatus(ExternalServiceStatusType status) {
-		this.status = status;
-	}
-
-	/**
-	 * @return the page
-	 * @see #page
-	 */
-	public String getPage() {
-		return page;
-	}
-
-	/**
-	 * @param page
-	 *          the page to set
-	 * @see #page
-	 */
-	public void setPage(String page) {
-		this.page = page;
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+/**
+ * This class represents status of the service that access data from external
+ * resources (database, webpage, etc.).
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ExternalServiceStatus {
+
+	/**
+	 * Name of the service.
+	 */
+	private String										name;
+
+	/**
+	 * Status of the external resource.
+	 */
+	private ExternalServiceStatusType	status;
+
+	/**
+	 * Webpage associated with external resource.
+	 */
+	private String										page;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param name
+	 *          name of the service
+	 * @param page
+	 *          webpage associated with the external resource
+	 */
+	public ExternalServiceStatus(String name, String page) {
+		this.setName(name);
+		this.setPage(page);
+	}
+
+	/**
+	 * @return the name
+	 * @see #name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * @param name
+	 *          the name to set
+	 * @see #name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * @return the status
+	 * @see #status
+	 */
+	public ExternalServiceStatusType getStatus() {
+		return status;
+	}
+
+	/**
+	 * @param status
+	 *          the status to set
+	 * @see #status
+	 */
+	public void setStatus(ExternalServiceStatusType status) {
+		this.status = status;
+	}
+
+	/**
+	 * @return the page
+	 * @see #page
+	 */
+	public String getPage() {
+		return page;
+	}
+
+	/**
+	 * @param page
+	 *          the page to set
+	 * @see #page
+	 */
+	public void setPage(String page) {
+		this.page = page;
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusType.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusType.java
index 2e3092188b..d22f58e0e3 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusType.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusType.java
@@ -1,65 +1,65 @@
-package lcsb.mapviewer.annotation.services;
-
-/**
- * Status of the external service.
- * 
- * @author Piotr Gawron
- * 
- */
-public enum ExternalServiceStatusType {
-	
-	/**
-	 * Service is ok and access method is ok.
-	 */
-	OK("Ok", 0),
-	
-	/**
-	 * Service is down (we don't know anything about access method).
-	 */
-	DOWN("Not available", 1),
-	
-	/**
-	 * Service is up, but access method changed.
-	 */
-	CHANGED("Specification changed", 2);
-
-	/**
-	 * Common name of the status.
-	 */
-	private String	commonName;
-	
-	/**
-	 * Severity level of the status (the higher the worse).
-	 */
-	private int			level;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param commonName
-	 *          name of the status
-	 * @param level
-	 *          severity level of the status
-	 */
-	ExternalServiceStatusType(String commonName, int level) {
-		this.commonName = commonName;
-		this.level = level;
-	}
-
-	/**
-	 * @return the commonName
-	 * @see #commonName
-	 */
-	public String getCommonName() {
-		return commonName;
-	}
-
-	/**
-	 * @return the level
-	 * @see #level
-	 */
-	public int getLevel() {
-		return level;
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+/**
+ * Status of the external service.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public enum ExternalServiceStatusType {
+	
+	/**
+	 * Service is ok and access method is ok.
+	 */
+	OK("Ok", 0),
+	
+	/**
+	 * Service is down (we don't know anything about access method).
+	 */
+	DOWN("Not available", 1),
+	
+	/**
+	 * Service is up, but access method changed.
+	 */
+	CHANGED("Specification changed", 2);
+
+	/**
+	 * Common name of the status.
+	 */
+	private String	commonName;
+	
+	/**
+	 * Severity level of the status (the higher the worse).
+	 */
+	private int			level;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param commonName
+	 *          name of the status
+	 * @param level
+	 *          severity level of the status
+	 */
+	ExternalServiceStatusType(String commonName, int level) {
+		this.commonName = commonName;
+		this.level = level;
+	}
+
+	/**
+	 * @return the commonName
+	 * @see #commonName
+	 */
+	public String getCommonName() {
+		return commonName;
+	}
+
+	/**
+	 * @return the level
+	 * @see #level
+	 */
+	public int getLevel() {
+		return level;
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/MeSHParser.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/MeSHParser.java
index 1d38d76590..c445c709fd 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/MeSHParser.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/MeSHParser.java
@@ -1,237 +1,237 @@
-package lcsb.mapviewer.annotation.services;
-
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.annotation.cache.CachableInterface;
-import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
-import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
-import lcsb.mapviewer.annotation.cache.WebPageDownloader;
-import lcsb.mapviewer.annotation.cache.XmlSerializer;
-import lcsb.mapviewer.annotation.data.MeSH;
-import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-
-/**
- * Class used for accessing and parsing data from MeSH database.
- * 
- * @author Ayan Rota
- * 
- */
-public class MeSHParser extends CachableInterface implements IExternalService {
-
-	/**
-	 * Url used for searching drugs by name. This page accepts only post paramters
-	 * and returns html that must be parsed.
-	 */
-	private static final String	URL_MESH_DATABASE	= "https://www.nlm.nih.gov/cgi/mesh/2014/MB_cgi?exact=Find+Exact+Term&field=uid&term=";
-
-	/**
-	 * Prefix used in the DB to identify the cache entry.
-	 */
-	static final String					MESH_PREFIX				= "mesh:";
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private Logger							logger						= Logger.getLogger(MeSHParser.class);
-
-	/**
-	 * Object that allows to serialize {@link MeSH} elements into xml string and
-	 * deserialize xml into {@link MeSH} objects.
-	 */
-	private XmlSerializer<MeSH>	meshSerializer;
-
-	/**
-	 * Default constructor.
-	 */
-	public MeSHParser() {
-		super(MeSHParser.class);
-		meshSerializer = new XmlSerializer<>(MeSH.class);
-	}
-
-	@Override
-	public String refreshCacheQuery(Object query) throws SourceNotAvailable {
-		String result = null;
-		try {
-			if (query instanceof String) {
-				String identifier = (String) query;
-				if (identifier.startsWith(MESH_PREFIX)) {
-					String[] ids = identifier.split("\\:");
-					if (ids.length == 2) {
-						MiriamData meshID = new MiriamData(MiriamType.MESH_2012, ids[1]);
-						MeSH mesh = getMeSHByIdFromDB(meshID);
-						result = meshSerializer.objectToString(mesh);
-					} else {
-						throw new InvalidArgumentException("Problematic query: \"" + query + "\"");
-					}
-				} else {
-					throw new InvalidArgumentException("Don't know what to do with string \"" + query + "\"");
-				}
-			} else {
-				throw new InvalidArgumentException("Don't know what to do with class: " + query.getClass());
-			}
-		} catch (IOException e) {
-			throw new SourceNotAvailable("Problem with accessing Mesh database", e);
-		}
-		return result;
-	}
-
-	/**
-	 * @param meshID
-	 *          miriam type id.
-	 * @return returns object.
-	 * @throws AnnotatorException
-	 *           thrown when there is a problem with accessing mesh database
-	 */
-	public MeSH getMeSH(MiriamData meshID) throws AnnotatorException {
-		if (meshID == null || meshID.getResource() == null) {
-			throw new InvalidArgumentException("mesh cannot be null ");
-		}
-
-		MeSH mesh = null;
-		// look for Mesh in the cache
-		String id = getIdentifier(meshID);
-		Node meshNode = super.getCacheNode(id);
-		if (meshNode != null && meshNode.hasChildNodes()) {
-			mesh = meshSerializer.xmlToObject(meshNode);
-		} else {
-			try {
-				mesh = getMeSHByIdFromDB(meshID);
-			} catch (IOException e) {
-				throw new AnnotatorException("Problem with accessing MeSH database", e);
-			}
-			if (mesh != null) {
-				super.setCacheValue(id, this.meshSerializer.objectToString(mesh));
-			}
-		}
-
-		return mesh;
-	}
-
-	/**
-	 * @param meshID
-	 *          id as miriam data.
-	 * @return return the object.
-	 */
-	public String getIdentifier(MiriamData meshID) {
-		return MESH_PREFIX + meshID.getResource();
-	}
-
-	/**
-	 * @param meshID
-	 *          mesh id as Miriam data.
-	 * @return return as mesh object.
-	 * @throws IOException
-	 *           thrown when there is problem with accessing web page
-	 * @throws AnnotatorException
-	 *           thrown when there is a problem with accessing mesh db
-	 */
-	private MeSH getMeSHByIdFromDB(MiriamData meshID) throws IOException {
-		if (meshID == null || meshID.getResource() == null) {
-			throw new InvalidArgumentException("Mesh cannot be null");
-		}
-
-		MeSH result = new MeSH();
-
-		String page = getWebPageContent(URL_MESH_DATABASE + meshID.getResource());
-
-		String str = "<TH align=left>MeSH Heading</TH><TD colspan=1>";
-		int i = page.indexOf(str);
-		int j = 0;
-		if (i > 0) {
-			i += str.length();
-			j = page.indexOf("</TD>", i);
-			result.setName(cleanHtml(page.substring(i, j)));
-		} else {
-			str = "<TR><TH align=left>Name of Substance</TH><TD colspan=1>";
-			i = page.indexOf(str);
-			if (i > 0) {
-				i += str.length();
-				j = page.indexOf("</TD>", i);
-				result.setName(cleanHtml(page.substring(i, j)));
-			}
-		}
-		i = j;
-		str = "<TH align=left>Scope Note</TH>";
-		i = page.indexOf(str, i);
-		if (i > 0) {
-			i += str.length();
-			j = page.indexOf("</TD>", i);
-			result.setDescription(cleanHtml(page.substring(i, j)));
-		} else {
-			result.setDescription("");
-		}
-		i = j;
-		str = "<TR><TH align=left>Entry Term</TH><TD colspan=1>";
-		i = page.indexOf(str, i);
-		while (i >= 0) {
-			i += str.length();
-			j = page.indexOf("</TD>", i);
-			result.addSynonym(cleanHtml(page.substring(i, j)));
-			i = j;
-			i = page.indexOf(str, i);
-		}
-		i = j;
-
-		str = "<TR><TH align=left>Unique ID</TH><TD colspan=1>";
-		i = page.indexOf(str, i);
-		if (i > 0) {
-			i += str.length();
-			j = page.indexOf("</TD>", i);
-			result.setMeSHId(cleanHtml(page.substring(i, j)));
-		}
-		return result;
-	}
-
-	@Override
-	public ExternalServiceStatus getServiceStatus() {
-		GeneralCacheInterface cacheCopy = getCache();
-		this.setCache(null);
-		ExternalServiceStatus status = new ExternalServiceStatus(MiriamType.MESH_2012.getCommonName(), MiriamType.MESH_2012.getDbHomepage());
-		try {
-			status.setStatus(ExternalServiceStatusType.OK);
-			MiriamData meshId = new MiriamData(MiriamType.MESH_2012, "D010300");
-			MeSH mesh = getMeSH(meshId);
-			if (mesh == null || (mesh != null && !mesh.getMeSHId().equals(meshId.getResource()))) {
-				status.setStatus(ExternalServiceStatusType.CHANGED);
-			}
-		} catch (Exception e) {
-			status.setStatus(ExternalServiceStatusType.DOWN);
-		}
-		this.setCache(cacheCopy);
-		return status;
-	}
-
-	/**
-	 * Checks if the mesh identifier is valid.
-	 * 
-	 * @param meshId
-	 *          mesh id
-	 * @return <code>true</code> if it's valid
-	 * @throws AnnotatorException
-	 *           thrown when there is problem with accessing mesh db
-	 */
-	public boolean isValidMeshId(MiriamData meshId) throws AnnotatorException {
-		if (meshId == null) {
-			return false;
-		}
-		return getMeSH(meshId) != null;
-	}
-
-	@Override
-	protected WebPageDownloader getWebPageDownloader() {
-		return super.getWebPageDownloader();
-	}
-
-	@Override
-	protected void setWebPageDownloader(WebPageDownloader webPageDownloader) {
-		super.setWebPageDownloader(webPageDownloader);
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.annotation.cache.CachableInterface;
+import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
+import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
+import lcsb.mapviewer.annotation.cache.WebPageDownloader;
+import lcsb.mapviewer.annotation.cache.XmlSerializer;
+import lcsb.mapviewer.annotation.data.MeSH;
+import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+
+/**
+ * Class used for accessing and parsing data from MeSH database.
+ * 
+ * @author Ayan Rota
+ * 
+ */
+public class MeSHParser extends CachableInterface implements IExternalService {
+
+	/**
+	 * Url used for searching drugs by name. This page accepts only post paramters
+	 * and returns html that must be parsed.
+	 */
+	private static final String	URL_MESH_DATABASE	= "https://www.nlm.nih.gov/cgi/mesh/2014/MB_cgi?exact=Find+Exact+Term&field=uid&term=";
+
+	/**
+	 * Prefix used in the DB to identify the cache entry.
+	 */
+	static final String					MESH_PREFIX				= "mesh:";
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private Logger							logger						= Logger.getLogger(MeSHParser.class);
+
+	/**
+	 * Object that allows to serialize {@link MeSH} elements into xml string and
+	 * deserialize xml into {@link MeSH} objects.
+	 */
+	private XmlSerializer<MeSH>	meshSerializer;
+
+	/**
+	 * Default constructor.
+	 */
+	public MeSHParser() {
+		super(MeSHParser.class);
+		meshSerializer = new XmlSerializer<>(MeSH.class);
+	}
+
+	@Override
+	public String refreshCacheQuery(Object query) throws SourceNotAvailable {
+		String result = null;
+		try {
+			if (query instanceof String) {
+				String identifier = (String) query;
+				if (identifier.startsWith(MESH_PREFIX)) {
+					String[] ids = identifier.split("\\:");
+					if (ids.length == 2) {
+						MiriamData meshID = new MiriamData(MiriamType.MESH_2012, ids[1]);
+						MeSH mesh = getMeSHByIdFromDB(meshID);
+						result = meshSerializer.objectToString(mesh);
+					} else {
+						throw new InvalidArgumentException("Problematic query: \"" + query + "\"");
+					}
+				} else {
+					throw new InvalidArgumentException("Don't know what to do with string \"" + query + "\"");
+				}
+			} else {
+				throw new InvalidArgumentException("Don't know what to do with class: " + query.getClass());
+			}
+		} catch (IOException e) {
+			throw new SourceNotAvailable("Problem with accessing Mesh database", e);
+		}
+		return result;
+	}
+
+	/**
+	 * @param meshID
+	 *          miriam type id.
+	 * @return returns object.
+	 * @throws AnnotatorException
+	 *           thrown when there is a problem with accessing mesh database
+	 */
+	public MeSH getMeSH(MiriamData meshID) throws AnnotatorException {
+		if (meshID == null || meshID.getResource() == null) {
+			throw new InvalidArgumentException("mesh cannot be null ");
+		}
+
+		MeSH mesh = null;
+		// look for Mesh in the cache
+		String id = getIdentifier(meshID);
+		Node meshNode = super.getCacheNode(id);
+		if (meshNode != null && meshNode.hasChildNodes()) {
+			mesh = meshSerializer.xmlToObject(meshNode);
+		} else {
+			try {
+				mesh = getMeSHByIdFromDB(meshID);
+			} catch (IOException e) {
+				throw new AnnotatorException("Problem with accessing MeSH database", e);
+			}
+			if (mesh != null) {
+				super.setCacheValue(id, this.meshSerializer.objectToString(mesh));
+			}
+		}
+
+		return mesh;
+	}
+
+	/**
+	 * @param meshID
+	 *          id as miriam data.
+	 * @return return the object.
+	 */
+	public String getIdentifier(MiriamData meshID) {
+		return MESH_PREFIX + meshID.getResource();
+	}
+
+	/**
+	 * @param meshID
+	 *          mesh id as Miriam data.
+	 * @return return as mesh object.
+	 * @throws IOException
+	 *           thrown when there is problem with accessing web page
+	 * @throws AnnotatorException
+	 *           thrown when there is a problem with accessing mesh db
+	 */
+	private MeSH getMeSHByIdFromDB(MiriamData meshID) throws IOException {
+		if (meshID == null || meshID.getResource() == null) {
+			throw new InvalidArgumentException("Mesh cannot be null");
+		}
+
+		MeSH result = new MeSH();
+
+		String page = getWebPageContent(URL_MESH_DATABASE + meshID.getResource());
+
+		String str = "<TH align=left>MeSH Heading</TH><TD colspan=1>";
+		int i = page.indexOf(str);
+		int j = 0;
+		if (i > 0) {
+			i += str.length();
+			j = page.indexOf("</TD>", i);
+			result.setName(cleanHtml(page.substring(i, j)));
+		} else {
+			str = "<TR><TH align=left>Name of Substance</TH><TD colspan=1>";
+			i = page.indexOf(str);
+			if (i > 0) {
+				i += str.length();
+				j = page.indexOf("</TD>", i);
+				result.setName(cleanHtml(page.substring(i, j)));
+			}
+		}
+		i = j;
+		str = "<TH align=left>Scope Note</TH>";
+		i = page.indexOf(str, i);
+		if (i > 0) {
+			i += str.length();
+			j = page.indexOf("</TD>", i);
+			result.setDescription(cleanHtml(page.substring(i, j)));
+		} else {
+			result.setDescription("");
+		}
+		i = j;
+		str = "<TR><TH align=left>Entry Term</TH><TD colspan=1>";
+		i = page.indexOf(str, i);
+		while (i >= 0) {
+			i += str.length();
+			j = page.indexOf("</TD>", i);
+			result.addSynonym(cleanHtml(page.substring(i, j)));
+			i = j;
+			i = page.indexOf(str, i);
+		}
+		i = j;
+
+		str = "<TR><TH align=left>Unique ID</TH><TD colspan=1>";
+		i = page.indexOf(str, i);
+		if (i > 0) {
+			i += str.length();
+			j = page.indexOf("</TD>", i);
+			result.setMeSHId(cleanHtml(page.substring(i, j)));
+		}
+		return result;
+	}
+
+	@Override
+	public ExternalServiceStatus getServiceStatus() {
+		GeneralCacheInterface cacheCopy = getCache();
+		this.setCache(null);
+		ExternalServiceStatus status = new ExternalServiceStatus(MiriamType.MESH_2012.getCommonName(), MiriamType.MESH_2012.getDbHomepage());
+		try {
+			status.setStatus(ExternalServiceStatusType.OK);
+			MiriamData meshId = new MiriamData(MiriamType.MESH_2012, "D010300");
+			MeSH mesh = getMeSH(meshId);
+			if (mesh == null || (mesh != null && !mesh.getMeSHId().equals(meshId.getResource()))) {
+				status.setStatus(ExternalServiceStatusType.CHANGED);
+			}
+		} catch (Exception e) {
+			status.setStatus(ExternalServiceStatusType.DOWN);
+		}
+		this.setCache(cacheCopy);
+		return status;
+	}
+
+	/**
+	 * Checks if the mesh identifier is valid.
+	 * 
+	 * @param meshId
+	 *          mesh id
+	 * @return <code>true</code> if it's valid
+	 * @throws AnnotatorException
+	 *           thrown when there is problem with accessing mesh db
+	 */
+	public boolean isValidMeshId(MiriamData meshId) throws AnnotatorException {
+		if (meshId == null) {
+			return false;
+		}
+		return getMeSH(meshId) != null;
+	}
+
+	@Override
+	protected WebPageDownloader getWebPageDownloader() {
+		return super.getWebPageDownloader();
+	}
+
+	@Override
+	protected void setWebPageDownloader(WebPageDownloader webPageDownloader) {
+		super.setWebPageDownloader(webPageDownloader);
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/MiRNASearchException.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/MiRNASearchException.java
index e63f663df4..eaaa99c929 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/MiRNASearchException.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/MiRNASearchException.java
@@ -1,47 +1,47 @@
-package lcsb.mapviewer.annotation.services;
-
-/**
- * Exception thrown when there was a problem when searching for a mirna.
- * 
- * @author Piotr Gawron
- * 
- */
-public class MiRNASearchException extends Exception {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param string
-	 *          exception message
-	 */
-	public MiRNASearchException(String string) {
-		super(string);
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param e
-	 *          parent exception
-	 */
-	public MiRNASearchException(Exception e) {
-		super(e);
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param message
-	 *          exception message
-	 * @param e
-	 *          source exception
-	 */
-	public MiRNASearchException(String message, Exception e) {
-		super(message, e);
-	}
-}
+package lcsb.mapviewer.annotation.services;
+
+/**
+ * Exception thrown when there was a problem when searching for a mirna.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class MiRNASearchException extends Exception {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param string
+	 *          exception message
+	 */
+	public MiRNASearchException(String string) {
+		super(string);
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param e
+	 *          parent exception
+	 */
+	public MiRNASearchException(Exception e) {
+		super(e);
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param message
+	 *          exception message
+	 * @param e
+	 *          source exception
+	 */
+	public MiRNASearchException(String message, Exception e) {
+		super(message, e);
+	}
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/MiriamConnector.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/MiriamConnector.java
index 8ceabdc008..f90874d5d3 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/MiriamConnector.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/MiriamConnector.java
@@ -1,281 +1,281 @@
-package lcsb.mapviewer.annotation.services;
-
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-import org.hibernate.AnnotationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.annotation.cache.CachableInterface;
-import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
-import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
-import lcsb.mapviewer.annotation.cache.WebPageDownloader;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import uk.ac.ebi.miriam.lib.MiriamLink;
-
-/**
- * Class responsible for connection to Miriam DB. It allows to update URI of
- * database being used and retreive urls for miriam uri.
- * 
- * @author Piotr Gawron
- * 
- */
-public final class MiriamConnector extends CachableInterface implements IExternalService {
-
-	/**
-	 * String used to distinguish cached data for links.
-	 */
-	static final String						LINK_DB_PREFIX	 = "Link: ";
-
-	/**
-	 * String used to distinguish cached data for checking if uri is valid.
-	 */
-	protected static final String	VALID_URI_PREFIX = "Validity: ";
-
-	/**
-	 * String describing invalid miriam entries that will be put into db (instead
-	 * of null).
-	 */
-	private static final String		INVALID_LINK		 = "INVALID";
-
-	/**
-	 * Default class logger.
-	 */
-	private Logger								logger					 = Logger.getLogger(MiriamConnector.class.getName());
-
-	/**
-	 * Miriam Registry API.
-	 */
-	private MiriamLink						link;
-
-	/**
-	 * Default class constructor. Prevent initialization.
-	 */
-	public MiriamConnector() {
-		super(MiriamConnector.class);
-		link = new MiriamLink();
-	}
-
-	/**
-	 * Returns url to the webpage represented by {@link MiriamData} param.
-	 * 
-	 * @param miriamData
-	 *          miriam data
-	 * @return url to resource pointed by miriam data
-	 */
-	public String getUrlString(MiriamData miriamData) {
-		if (miriamData.getDataType() == null) {
-			throw new InvalidArgumentException("Data type cannot be empty.");
-		} else if (miriamData.getDataType().getUris().size() == 0) {
-			throw new InvalidArgumentException("Url for " + miriamData.getDataType() + " cannot be retreived.");
-		}
-		String query = LINK_DB_PREFIX + miriamData.getDataType().getUris().get(0) + "\n" + miriamData.getResource();
-		String result = getCacheValue(query);
-		if (result != null) {
-			if (INVALID_LINK.equals(result)) {
-				return null;
-			}
-			return result;
-		}
-		// hardcoded specific treatment for mesh
-		if (MiriamType.MESH_2012.equals(miriamData.getDataType())) {
-			result = "http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=" + miriamData.getResource();
-		} else {
-			String uri = miriamData.getDataType().getUris().get(0) + ":" + miriamData.getResource();
-			String[] urls = getLink().getLocations(uri);
-			if (urls == null) {
-				result = null;
-			} else if (urls.length > 0) {
-				result = urls[0];
-			}
-		}
-		if (result != null) {
-			setCacheValue(query, result);
-			return result;
-		} else {
-			logger.warn("Cannot find url for miriam: " + miriamData);
-			setCacheValue(query, INVALID_LINK);
-			return null;
-		}
-	}
-
-	@Override
-	public ExternalServiceStatus getServiceStatus() {
-		ExternalServiceStatus status = new ExternalServiceStatus("MIRIAM Registry", "http://www.ebi.ac.uk/miriam/main/");
-		GeneralCacheInterface cacheCopy = getCache();
-		this.setCache(null);
-
-		try {
-			String url = getUrlString(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, "3453"));
-			status.setStatus(ExternalServiceStatusType.OK);
-			if (url == null) {
-				status.setStatus(ExternalServiceStatusType.DOWN);
-			}
-		} catch (Exception e) {
-			logger.error(status.getName() + " is down", e);
-			status.setStatus(ExternalServiceStatusType.DOWN);
-		}
-		this.setCache(cacheCopy);
-		return status;
-	}
-
-	/**
-	 * Check if identifier can be transformed into {@link MiriamData}.
-	 * 
-	 * @param string
-	 *          identifier in the format NAME:IDENTIFIER. Where NAME is the name
-	 *          from {@link MiriamType#commonName} and IDENTIFIER is resource
-	 *          identifier.
-	 * @return <code>true</code> if identifier can be transformed into
-	 *         {@link MiriamData}
-	 */
-	public boolean isValidIdentifier(String string) {
-		try {
-			MiriamType.getMiriamDataFromIdentifier(string);
-			return true;
-		} catch (InvalidArgumentException e) {
-			return false;
-		}
-	}
-
-	@Override
-	public String refreshCacheQuery(Object query) throws SourceNotAvailable {
-		String result = null;
-		if (query instanceof String) {
-			String name = (String) query;
-			if (name.startsWith(LINK_DB_PREFIX)) {
-				String tmp = name.substring(LINK_DB_PREFIX.length());
-				String[] rows = tmp.split("\n");
-				if (rows.length != 2) {
-					throw new InvalidArgumentException("Miriam link query is invalid: " + query);
-				}
-				MiriamType dataType = MiriamType.getTypeByUri(rows[0]);
-				String resource = rows[1];
-				result = getUrlString(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, dataType, resource));
-			} else if (name.startsWith(VALID_URI_PREFIX)) {
-				String tmp = name.substring(VALID_URI_PREFIX.length());
-				result = "" + isValid(tmp);
-			} else if (name.startsWith("http")) {
-				try {
-					result = getWebPageContent(name);
-				} catch (IOException e) {
-					throw new SourceNotAvailable(e);
-				}
-			} else {
-				throw new InvalidArgumentException("Don't know what to do with string \"" + query + "\"");
-			}
-		} else {
-			throw new InvalidArgumentException("Don't know what to do with class: " + query.getClass());
-		}
-
-		return result;
-	}
-
-	/**
-	 * Checks if uri (like the one defined in {@link MiriamType#uris}) is valid.
-	 * 
-	 * @param uri
-	 *          uri to check
-	 * @return <code>true</code> if uri in parameter is valid, <code>false</code>
-	 *         otherwise
-	 */
-	public boolean isValid(String uri) {
-		String query = VALID_URI_PREFIX + uri;
-		String val = getCacheValue(query);
-		if (val != null) {
-			return "true".equalsIgnoreCase(val);
-		}
-
-		boolean result = false;
-		String name = getLink().getName(uri);
-		if (name == null) {
-			result = false;
-		} else {
-			result = !name.isEmpty();
-		}
-		setCacheValue(query, "" + result);
-		return result;
-	}
-
-	/**
-	 * This is alternative versopm od {@link #getUrlString(MiriamData)} method
-	 * that is around 30% fatsre. But it refers to beta version of
-	 * <a href="http://www.ebi.ac.uk/miriamws/main/rest/">miriam Rest API</a>.
-	 * 
-	 * @param md
-	 *          miriam data for which access url will be returned
-	 * @return url to resource pointed by miriam data
-	 * @throws AnnotationException
-	 *           thrown when there is a problem with accessing miriam REST API
-	 */
-	protected String getUrlString2(MiriamData md) throws AnnotationException {
-		try {
-			String result = null;
-			String uri = md.getDataType().getUris().get(0) + ":" + md.getResource();
-			String query = "http://www.ebi.ac.uk/miriamws/main/rest/resolve/" + uri;
-			String page;
-			page = getWebPageContent(query);
-			Document document = getXmlDocumentFromString(page);
-			Node uris = document.getFirstChild();
-			NodeList nodes = uris.getChildNodes();
-			for (int i = 0; i < nodes.getLength(); i++) {
-				Node node = nodes.item(i);
-				if (Node.ELEMENT_NODE == node.getNodeType()) {
-					if (getNodeAttr("deprecated", node).equals("")) {
-						result = node.getTextContent();
-					}
-				}
-			}
-			return result;
-		} catch (IOException e) {
-			throw new AnnotationException("Problem with accessing miriam REST API", e);
-		} catch (InvalidXmlSchemaException e) {
-			throw new AnnotationException("Problem with parsing miriam REST API response", e);
-		}
-	}
-
-	/**
-	 * Returns uri to miriam resource.
-	 * 
-	 * @param md
-	 *          {@link MiriamData} object for which uri should be returned
-	 * @return uri to miriam resource
-	 */
-	public String miriamDataToUri(MiriamData md) {
-		return md.getDataType().getUris().get(0) + ":" + md.getResource();
-	}
-
-	@Override
-	protected WebPageDownloader getWebPageDownloader() {
-		return super.getWebPageDownloader();
-	}
-
-	@Override
-	protected void setWebPageDownloader(WebPageDownloader webPageDownloader) {
-		super.setWebPageDownloader(webPageDownloader);
-	}
-
-	/**
-	 * @return the link
-	 * @see #link
-	 */
-	MiriamLink getLink() {
-		return link;
-	}
-
-	/**
-	 * @param link
-	 *          the link to set
-	 * @see #link
-	 */
-	void setLink(MiriamLink link) {
-		this.link = link;
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+import org.hibernate.AnnotationException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.annotation.cache.CachableInterface;
+import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
+import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
+import lcsb.mapviewer.annotation.cache.WebPageDownloader;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import uk.ac.ebi.miriam.lib.MiriamLink;
+
+/**
+ * Class responsible for connection to Miriam DB. It allows to update URI of
+ * database being used and retreive urls for miriam uri.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public final class MiriamConnector extends CachableInterface implements IExternalService {
+
+	/**
+	 * String used to distinguish cached data for links.
+	 */
+	static final String						LINK_DB_PREFIX	 = "Link: ";
+
+	/**
+	 * String used to distinguish cached data for checking if uri is valid.
+	 */
+	protected static final String	VALID_URI_PREFIX = "Validity: ";
+
+	/**
+	 * String describing invalid miriam entries that will be put into db (instead
+	 * of null).
+	 */
+	private static final String		INVALID_LINK		 = "INVALID";
+
+	/**
+	 * Default class logger.
+	 */
+	private Logger								logger					 = Logger.getLogger(MiriamConnector.class.getName());
+
+	/**
+	 * Miriam Registry API.
+	 */
+	private MiriamLink						link;
+
+	/**
+	 * Default class constructor. Prevent initialization.
+	 */
+	public MiriamConnector() {
+		super(MiriamConnector.class);
+		link = new MiriamLink();
+	}
+
+	/**
+	 * Returns url to the webpage represented by {@link MiriamData} param.
+	 * 
+	 * @param miriamData
+	 *          miriam data
+	 * @return url to resource pointed by miriam data
+	 */
+	public String getUrlString(MiriamData miriamData) {
+		if (miriamData.getDataType() == null) {
+			throw new InvalidArgumentException("Data type cannot be empty.");
+		} else if (miriamData.getDataType().getUris().size() == 0) {
+			throw new InvalidArgumentException("Url for " + miriamData.getDataType() + " cannot be retreived.");
+		}
+		String query = LINK_DB_PREFIX + miriamData.getDataType().getUris().get(0) + "\n" + miriamData.getResource();
+		String result = getCacheValue(query);
+		if (result != null) {
+			if (INVALID_LINK.equals(result)) {
+				return null;
+			}
+			return result;
+		}
+		// hardcoded specific treatment for mesh
+		if (MiriamType.MESH_2012.equals(miriamData.getDataType())) {
+			result = "http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=" + miriamData.getResource();
+		} else {
+			String uri = miriamData.getDataType().getUris().get(0) + ":" + miriamData.getResource();
+			String[] urls = getLink().getLocations(uri);
+			if (urls == null) {
+				result = null;
+			} else if (urls.length > 0) {
+				result = urls[0];
+			}
+		}
+		if (result != null) {
+			setCacheValue(query, result);
+			return result;
+		} else {
+			logger.warn("Cannot find url for miriam: " + miriamData);
+			setCacheValue(query, INVALID_LINK);
+			return null;
+		}
+	}
+
+	@Override
+	public ExternalServiceStatus getServiceStatus() {
+		ExternalServiceStatus status = new ExternalServiceStatus("MIRIAM Registry", "http://www.ebi.ac.uk/miriam/main/");
+		GeneralCacheInterface cacheCopy = getCache();
+		this.setCache(null);
+
+		try {
+			String url = getUrlString(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, "3453"));
+			status.setStatus(ExternalServiceStatusType.OK);
+			if (url == null) {
+				status.setStatus(ExternalServiceStatusType.DOWN);
+			}
+		} catch (Exception e) {
+			logger.error(status.getName() + " is down", e);
+			status.setStatus(ExternalServiceStatusType.DOWN);
+		}
+		this.setCache(cacheCopy);
+		return status;
+	}
+
+	/**
+	 * Check if identifier can be transformed into {@link MiriamData}.
+	 * 
+	 * @param string
+	 *          identifier in the format NAME:IDENTIFIER. Where NAME is the name
+	 *          from {@link MiriamType#commonName} and IDENTIFIER is resource
+	 *          identifier.
+	 * @return <code>true</code> if identifier can be transformed into
+	 *         {@link MiriamData}
+	 */
+	public boolean isValidIdentifier(String string) {
+		try {
+			MiriamType.getMiriamDataFromIdentifier(string);
+			return true;
+		} catch (InvalidArgumentException e) {
+			return false;
+		}
+	}
+
+	@Override
+	public String refreshCacheQuery(Object query) throws SourceNotAvailable {
+		String result = null;
+		if (query instanceof String) {
+			String name = (String) query;
+			if (name.startsWith(LINK_DB_PREFIX)) {
+				String tmp = name.substring(LINK_DB_PREFIX.length());
+				String[] rows = tmp.split("\n");
+				if (rows.length != 2) {
+					throw new InvalidArgumentException("Miriam link query is invalid: " + query);
+				}
+				MiriamType dataType = MiriamType.getTypeByUri(rows[0]);
+				String resource = rows[1];
+				result = getUrlString(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, dataType, resource));
+			} else if (name.startsWith(VALID_URI_PREFIX)) {
+				String tmp = name.substring(VALID_URI_PREFIX.length());
+				result = "" + isValid(tmp);
+			} else if (name.startsWith("http")) {
+				try {
+					result = getWebPageContent(name);
+				} catch (IOException e) {
+					throw new SourceNotAvailable(e);
+				}
+			} else {
+				throw new InvalidArgumentException("Don't know what to do with string \"" + query + "\"");
+			}
+		} else {
+			throw new InvalidArgumentException("Don't know what to do with class: " + query.getClass());
+		}
+
+		return result;
+	}
+
+	/**
+	 * Checks if uri (like the one defined in {@link MiriamType#uris}) is valid.
+	 * 
+	 * @param uri
+	 *          uri to check
+	 * @return <code>true</code> if uri in parameter is valid, <code>false</code>
+	 *         otherwise
+	 */
+	public boolean isValid(String uri) {
+		String query = VALID_URI_PREFIX + uri;
+		String val = getCacheValue(query);
+		if (val != null) {
+			return "true".equalsIgnoreCase(val);
+		}
+
+		boolean result = false;
+		String name = getLink().getName(uri);
+		if (name == null) {
+			result = false;
+		} else {
+			result = !name.isEmpty();
+		}
+		setCacheValue(query, "" + result);
+		return result;
+	}
+
+	/**
+	 * This is alternative versopm od {@link #getUrlString(MiriamData)} method
+	 * that is around 30% fatsre. But it refers to beta version of
+	 * <a href="http://www.ebi.ac.uk/miriamws/main/rest/">miriam Rest API</a>.
+	 * 
+	 * @param md
+	 *          miriam data for which access url will be returned
+	 * @return url to resource pointed by miriam data
+	 * @throws AnnotationException
+	 *           thrown when there is a problem with accessing miriam REST API
+	 */
+	protected String getUrlString2(MiriamData md) throws AnnotationException {
+		try {
+			String result = null;
+			String uri = md.getDataType().getUris().get(0) + ":" + md.getResource();
+			String query = "http://www.ebi.ac.uk/miriamws/main/rest/resolve/" + uri;
+			String page;
+			page = getWebPageContent(query);
+			Document document = getXmlDocumentFromString(page);
+			Node uris = document.getFirstChild();
+			NodeList nodes = uris.getChildNodes();
+			for (int i = 0; i < nodes.getLength(); i++) {
+				Node node = nodes.item(i);
+				if (Node.ELEMENT_NODE == node.getNodeType()) {
+					if (getNodeAttr("deprecated", node).equals("")) {
+						result = node.getTextContent();
+					}
+				}
+			}
+			return result;
+		} catch (IOException e) {
+			throw new AnnotationException("Problem with accessing miriam REST API", e);
+		} catch (InvalidXmlSchemaException e) {
+			throw new AnnotationException("Problem with parsing miriam REST API response", e);
+		}
+	}
+
+	/**
+	 * Returns uri to miriam resource.
+	 * 
+	 * @param md
+	 *          {@link MiriamData} object for which uri should be returned
+	 * @return uri to miriam resource
+	 */
+	public String miriamDataToUri(MiriamData md) {
+		return md.getDataType().getUris().get(0) + ":" + md.getResource();
+	}
+
+	@Override
+	protected WebPageDownloader getWebPageDownloader() {
+		return super.getWebPageDownloader();
+	}
+
+	@Override
+	protected void setWebPageDownloader(WebPageDownloader webPageDownloader) {
+		super.setWebPageDownloader(webPageDownloader);
+	}
+
+	/**
+	 * @return the link
+	 * @see #link
+	 */
+	MiriamLink getLink() {
+		return link;
+	}
+
+	/**
+	 * @param link
+	 *          the link to set
+	 * @see #link
+	 */
+	void setLink(MiriamLink link) {
+		this.link = link;
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ProblematicAnnotation.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ProblematicAnnotation.java
index 90e41d1cfe..8734327cb7 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ProblematicAnnotation.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ProblematicAnnotation.java
@@ -1,17 +1,17 @@
-package lcsb.mapviewer.annotation.services;
-
-/**
- * Interface that describes annotation that is problematic.
- * 
- * @author Piotr Gawron
- *
- */
-public interface ProblematicAnnotation {
-
-	/**
-	 * Returns error message.
-	 * 
-	 * @return problem error message
-	 */
-	String getMessage();
-}
+package lcsb.mapviewer.annotation.services;
+
+/**
+ * Interface that describes annotation that is problematic.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public interface ProblematicAnnotation {
+
+	/**
+	 * Returns error message.
+	 * 
+	 * @return problem error message
+	 */
+	String getMessage();
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomySearchException.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomySearchException.java
index ce90c04e61..e429e11888 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomySearchException.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomySearchException.java
@@ -1,30 +1,30 @@
-package lcsb.mapviewer.annotation.services;
-
-/**
- * Exception that should be thrown when there is a problem with finding
- * information about taxonomy.
- * 
- * @author Piotr Gawron
- *
- */
-public class TaxonomySearchException extends Exception {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Constructs a new exception with the specified detail message and cause.
-	 *
-	 * @param message
-	 *          the detail message
-	 * @param cause
-	 *          the cause (A <tt>null</tt> value is permitted, and indicates that
-	 *          the cause is nonexistent or unknown.)
-	 */
-	public TaxonomySearchException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+/**
+ * Exception that should be thrown when there is a problem with finding
+ * information about taxonomy.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class TaxonomySearchException extends Exception {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Constructs a new exception with the specified detail message and cause.
+	 *
+	 * @param message
+	 *          the detail message
+	 * @param cause
+	 *          the cause (A <tt>null</tt> value is permitted, and indicates that
+	 *          the cause is nonexistent or unknown.)
+	 */
+	public TaxonomySearchException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+}
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/EnsemblAnnotator.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/EnsemblAnnotator.java
index 8931870e6e..948a8c9c66 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/EnsemblAnnotator.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/EnsemblAnnotator.java
@@ -24,6 +24,7 @@ import lcsb.mapviewer.model.map.AnnotatedObject;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.species.Gene;
 import lcsb.mapviewer.model.map.species.GenericProtein;
@@ -113,13 +114,13 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
 
 		try {
 
-			GenericProtein species = new GenericProtein();
-			species.addMiriamData(new MiriamData(MiriamType.ENSEMBL, "ENSG00000157764"));
+			GenericProtein protein = new GenericProtein();
+			protein.addMiriamData(new MiriamData(MiriamType.ENSEMBL, "ENSG00000157764"));
 
-			SpeciesAlias proteinAlias = new SpeciesAlias(species);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			annotateElement(proteinAlias);
 
-			if (species.getFullName() == null || species.getFullName().isEmpty()) {
+			if (protein.getFullName() == null || protein.getFullName().isEmpty()) {
 				status.setStatus(ExternalServiceStatusType.CHANGED);
 			} else {
 				status.setStatus(ExternalServiceStatusType.OK);
@@ -283,8 +284,8 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
 		if (!MiriamType.ENSEMBL.equals(miriamData.getDataType())) {
 			throw new InvalidArgumentException("Only " + MiriamType.ENSEMBL + " identifier is accepted as an input");
 		}
-		Protein protein = new GenericProtein();
-		SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+		GenericProtein protein = new GenericProtein();
+		GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 		annotateElement(proteinAlias, miriamData, "");
 		for (MiriamData md : protein.getMiriamData()) {
 			if (MiriamType.ENTREZ.equals(md.getDataType())) {
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/EntrezAnnotator.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/EntrezAnnotator.java
index 3d71502480..af530042f3 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/EntrezAnnotator.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/EntrezAnnotator.java
@@ -28,7 +28,7 @@ import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamRelationType;
 import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.species.Gene;
 import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Protein;
@@ -133,7 +133,7 @@ public class EntrezAnnotator extends ElementAnnotator implements IExternalServic
 		try {
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.ENTREZ, "9999"));
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			annotateElement(proteinAlias);
 
 			if (protein.getFullName() == null || protein.getFullName().equals("")) {
@@ -345,8 +345,8 @@ public class EntrezAnnotator extends ElementAnnotator implements IExternalServic
 		String key = CACHE_HGNC_ID_PREFIX + miriamData.getResource();
 		String value = getCacheValue(key);
 		if (value == null) {
-			Protein protein = new GenericProtein();
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProtein protein = new GenericProtein();
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			annotateElement(proteinAlias, miriamData, "");
 			for (MiriamData md : protein.getMiriamData()) {
 				if (MiriamType.HGNC.equals(md.getDataType())) {
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/HgncAnnotator.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/HgncAnnotator.java
index fc211be6a7..2d6779d5d2 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/HgncAnnotator.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/HgncAnnotator.java
@@ -16,12 +16,11 @@ import lcsb.mapviewer.annotation.services.IExternalService;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
 import lcsb.mapviewer.model.map.AnnotatedObject;
-import lcsb.mapviewer.model.map.Element;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamRelationType;
 import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.species.Gene;
 import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Protein;
@@ -94,7 +93,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService
 		try {
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.HGNC_SYMBOL, "SNCA"));
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			annotateElement(proteinAlias);
 
 			if (protein.getFullName() == null || protein.getFullName().equals("")) {
diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ReconAnnotator.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ReconAnnotator.java
index f3e76fe098..fbf251c219 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ReconAnnotator.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ReconAnnotator.java
@@ -20,7 +20,7 @@ import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.model.map.AnnotatedObject;
 import lcsb.mapviewer.model.map.Element;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.species.Chemical;
 import lcsb.mapviewer.model.map.species.SimpleMolecule;
@@ -94,7 +94,7 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
 		try {
 			SimpleMolecule sm = new SimpleMolecule();
 			sm.setName("h2o");
-			SpeciesAlias smallMoleculeAlias = new SpeciesAlias(sm);
+			SimpleMoleculeAlias smallMoleculeAlias = new SimpleMoleculeAlias(sm);
 			annotateElement(smallMoleculeAlias);
 			status.setStatus(ExternalServiceStatusType.OK);
 			if (sm.getMiriamData().size() == 0) {
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/AllCacheTests.java b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/AllCacheTests.java
index 6d7c27f99a..85c9607662 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/AllCacheTests.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/AllCacheTests.java
@@ -1,19 +1,19 @@
-package lcsb.mapviewer.annotation.cache;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ ApplicationLevelCacheTest.class, //
-		BigFileCacheTest.class, //
-		CachableInterfaceTest.class, //
-		GeneralCacheTest.class, //
-		GeneralCacheWithExclusionTest.class, //
-		PermanentDatabaseLevelCacheTest.class, //
-		SourceNotAvailableTest.class, //
-		WebPageDownloaderTest.class, //
-})
-public class AllCacheTests {
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ ApplicationLevelCacheTest.class, //
+		BigFileCacheTest.class, //
+		CachableInterfaceTest.class, //
+		GeneralCacheTest.class, //
+		GeneralCacheWithExclusionTest.class, //
+		PermanentDatabaseLevelCacheTest.class, //
+		SourceNotAvailableTest.class, //
+		WebPageDownloaderTest.class, //
+})
+public class AllCacheTests {
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCacheTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCacheTest.java
index 2a41636316..19ea32563b 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCacheTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/ApplicationLevelCacheTest.java
@@ -1,121 +1,121 @@
-package lcsb.mapviewer.annotation.cache;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.annotation.services.PubmedParser;
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.model.cache.CacheType;
-
-public class ApplicationLevelCacheTest extends AnnotationTestFunctions {
-
-	Logger	logger = Logger.getLogger(ApplicationLevelCacheTest.class);
-
-	boolean	status;
-
-	@Before
-	public void setUp() throws Exception {
-		status = Configuration.isApplicationCacheOn();
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		Configuration.setApplicationCacheOn(status);
-	}
-
-	@Test
-	public void testApplicationCacheByQuery() {
-		try {
-			CacheType type = cacheTypeDao.getByClassName(PubmedParser.class.getCanonicalName());
-			String xml = "<hello/>";
-			String query = "blabla";
-			Node sourceNode = getNodeFromXmlString(xml);
-			ApplicationLevelCache cache = ApplicationLevelCache.getInstance();
-			cache.clearCache();
-
-			Node node = cache.getXmlNodeByQuery(query, type);
-			assertNull(node);
-
-			cache.setCachedQuery(query, type, sourceNode);
-			node = cache.getXmlNodeByQuery(query, type);
-			assertNotNull(node);
-
-			cache.clearCache();
-			node = cache.getXmlNodeByQuery(query, type);
-			assertNull(node);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testApplicationCacheOff() {
-		boolean value = Configuration.isApplicationCacheOn();
-
-		try {
-			Configuration.setApplicationCacheOn(false);
-			assertNull(ApplicationLevelCache.getInstance());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			Configuration.setApplicationCacheOn(value);
-		}
-	}
-
-	@Test
-	public void testSetInvalidValue() {
-		try {
-			ApplicationLevelCache cache = ApplicationLevelCache.getInstance();
-			cache.setCachedQuery("bla", null, new Object());
-		} catch (CacheException e) {
-			assertTrue(e.getMessage().contains("Unknown object type"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testClearCacheWhenMemoryUsageIsHigh() throws Exception {
-		Double oldVal = Configuration.getMemorySaturationRatioTriggerClean();
-		try {
-			CacheType type = new CacheType();
-			type.setId(-13);
-			ApplicationLevelCache cache = ApplicationLevelCache.getInstance();
-			cache.setCachedQuery("bla", type, "test");
-
-			assertNotNull(cache.getStringByQuery("bla", type));
-			// fill cache with some dumb data
-			for (int i = 0; i < ApplicationLevelCache.MIN_CACHED_VALUES_BEFORE_CLEAN; i++) {
-				cache.setCachedQuery("bla" + i, type, "test");
-			}
-			assertNotNull(cache.getStringByQuery("bla", type));
-
-			Configuration.setMemorySaturationRatioTriggerClean(0.0);
-			cache.performMemoryBalance();
-			assertNull(cache.getStringByQuery("bla", type));
-
-		} catch (CacheException e) {
-			assertTrue(e.getMessage().contains("Unknown object type"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			// restore old value
-			Configuration.setMemorySaturationRatioTriggerClean(oldVal);
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.annotation.services.PubmedParser;
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.model.cache.CacheType;
+
+public class ApplicationLevelCacheTest extends AnnotationTestFunctions {
+
+	Logger	logger = Logger.getLogger(ApplicationLevelCacheTest.class);
+
+	boolean	status;
+
+	@Before
+	public void setUp() throws Exception {
+		status = Configuration.isApplicationCacheOn();
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		Configuration.setApplicationCacheOn(status);
+	}
+
+	@Test
+	public void testApplicationCacheByQuery() {
+		try {
+			CacheType type = cacheTypeDao.getByClassName(PubmedParser.class.getCanonicalName());
+			String xml = "<hello/>";
+			String query = "blabla";
+			Node sourceNode = getNodeFromXmlString(xml);
+			ApplicationLevelCache cache = ApplicationLevelCache.getInstance();
+			cache.clearCache();
+
+			Node node = cache.getXmlNodeByQuery(query, type);
+			assertNull(node);
+
+			cache.setCachedQuery(query, type, sourceNode);
+			node = cache.getXmlNodeByQuery(query, type);
+			assertNotNull(node);
+
+			cache.clearCache();
+			node = cache.getXmlNodeByQuery(query, type);
+			assertNull(node);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testApplicationCacheOff() {
+		boolean value = Configuration.isApplicationCacheOn();
+
+		try {
+			Configuration.setApplicationCacheOn(false);
+			assertNull(ApplicationLevelCache.getInstance());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			Configuration.setApplicationCacheOn(value);
+		}
+	}
+
+	@Test
+	public void testSetInvalidValue() {
+		try {
+			ApplicationLevelCache cache = ApplicationLevelCache.getInstance();
+			cache.setCachedQuery("bla", null, new Object());
+		} catch (CacheException e) {
+			assertTrue(e.getMessage().contains("Unknown object type"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testClearCacheWhenMemoryUsageIsHigh() throws Exception {
+		Double oldVal = Configuration.getMemorySaturationRatioTriggerClean();
+		try {
+			CacheType type = new CacheType();
+			type.setId(-13);
+			ApplicationLevelCache cache = ApplicationLevelCache.getInstance();
+			cache.setCachedQuery("bla", type, "test");
+
+			assertNotNull(cache.getStringByQuery("bla", type));
+			// fill cache with some dumb data
+			for (int i = 0; i < ApplicationLevelCache.MIN_CACHED_VALUES_BEFORE_CLEAN; i++) {
+				cache.setCachedQuery("bla" + i, type, "test");
+			}
+			assertNotNull(cache.getStringByQuery("bla", type));
+
+			Configuration.setMemorySaturationRatioTriggerClean(0.0);
+			cache.performMemoryBalance();
+			assertNull(cache.getStringByQuery("bla", type));
+
+		} catch (CacheException e) {
+			assertTrue(e.getMessage().contains("Unknown object type"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			// restore old value
+			Configuration.setMemorySaturationRatioTriggerClean(oldVal);
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/CachableInterfaceTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/CachableInterfaceTest.java
index 2d6aee2272..f8b08ad58c 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/CachableInterfaceTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/CachableInterfaceTest.java
@@ -1,114 +1,114 @@
-package lcsb.mapviewer.annotation.cache;
-
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.when;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.model.cache.CacheType;
-import lcsb.mapviewer.persist.dao.cache.CacheTypeDao;
-
-
-public class CachableInterfaceTest extends AnnotationTestFunctions {
-	Logger logger = Logger.getLogger(CachableInterfaceTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetWebPage() throws Exception {
-		try {
-			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
-			String result = ci.getWebPageContent("http://www.drugbank.ca/biodb/polypeptides/P21728");
-			assertNotNull(result);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetWebPage2() throws Exception {
-		try {
-			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
-			String result = ci.getWebPageContent("http://www.drugbank.ca/drugs/DB00091");
-			assertNotNull(result);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetNode() throws Exception {
-		try {
-			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
-			
-			CacheTypeDao mock = Mockito.mock(CacheTypeDao.class);
-			when(mock.getByClassName(anyString())).thenReturn(new CacheType());
-			ci.setCacheTypeDao(mock);
-			
-			String xml = "<xml><child/></xml>";
-			ci.setCache(new GeneralCache());
-			ci.setCacheNode("id", super.getNodeFromXmlString(xml));
-			
-			Node node = ci.getCacheNode("id");
-			assertNotNull(node);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testNewLinesGetWebPage() throws Exception {
-		try {
-			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
-			ci.setCache(null);
-			String result = ci.getWebPageContent("http://google.com/");
-			assertNotNull(result);
-			assertTrue(result.contains("\n"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCleanHtml() throws Exception {
-		try {
-			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
-			String res = ci.cleanHtml("blabla <invalid_tag");
-			assertEquals("blabla ",res);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCleanHtml2() throws Exception {
-		try {
-			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
-			String res = ci.cleanHtml("blabla <valid_tag> etc");
-			assertEquals("blabla  etc",res);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.when;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.model.cache.CacheType;
+import lcsb.mapviewer.persist.dao.cache.CacheTypeDao;
+
+
+public class CachableInterfaceTest extends AnnotationTestFunctions {
+	Logger logger = Logger.getLogger(CachableInterfaceTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetWebPage() throws Exception {
+		try {
+			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
+			String result = ci.getWebPageContent("http://www.drugbank.ca/biodb/polypeptides/P21728");
+			assertNotNull(result);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetWebPage2() throws Exception {
+		try {
+			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
+			String result = ci.getWebPageContent("http://www.drugbank.ca/drugs/DB00091");
+			assertNotNull(result);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetNode() throws Exception {
+		try {
+			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
+			
+			CacheTypeDao mock = Mockito.mock(CacheTypeDao.class);
+			when(mock.getByClassName(anyString())).thenReturn(new CacheType());
+			ci.setCacheTypeDao(mock);
+			
+			String xml = "<xml><child/></xml>";
+			ci.setCache(new GeneralCache());
+			ci.setCacheNode("id", super.getNodeFromXmlString(xml));
+			
+			Node node = ci.getCacheNode("id");
+			assertNotNull(node);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testNewLinesGetWebPage() throws Exception {
+		try {
+			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
+			ci.setCache(null);
+			String result = ci.getWebPageContent("http://google.com/");
+			assertNotNull(result);
+			assertTrue(result.contains("\n"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCleanHtml() throws Exception {
+		try {
+			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
+			String res = ci.cleanHtml("blabla <invalid_tag");
+			assertEquals("blabla ",res);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCleanHtml2() throws Exception {
+		try {
+			CachableInterfaceMock ci = new CachableInterfaceMock(CachableInterface.class);
+			String res = ci.cleanHtml("blabla <valid_tag> etc");
+			assertEquals("blabla  etc",res);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/GeneralCacheTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/GeneralCacheTest.java
index 8f2a7fe427..1ce7927eaa 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/GeneralCacheTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/GeneralCacheTest.java
@@ -1,137 +1,137 @@
-package lcsb.mapviewer.annotation.cache;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.cache.CacheType;
-
-public class GeneralCacheTest extends AnnotationTestFunctions {
-	Logger															 logger	= Logger.getLogger(GeneralCacheTest.class);
-
-	GeneralCache												 cache	= new GeneralCache();
-
-	@Autowired
-	PermanentDatabaseLevelCacheInterface databaseLevelCache;
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-		cache.setCache2(databaseLevelCache);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testClear() {
-		QueryCacheInterface origianlCache = cache.getCache2();
-		try {
-			CacheType type = new CacheType();
-			type.setId(-1);
-			cache.setCache2(ApplicationLevelCache.getInstance());
-			ApplicationLevelCache.getInstance().setCachedQuery("str", type, "val");
-			assertNotNull(cache.getStringByQuery("str", type));
-			cache.clearCache();
-			assertNull(cache.getStringByQuery("str", type));
-		} finally {
-			cache.setCache2(origianlCache);
-		}
-	}
-
-	@Test
-	public void testGetXmlNodeByQueryForInvalidType() {
-		try {
-			cache.getXmlNodeByQuery("str", null);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache type cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetCachedQueryForInvalidType() {
-		try {
-			cache.setCachedQuery("str", null, null);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache type cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveByQueryForInvalidType() {
-		try {
-			cache.removeByQuery("str", null);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache type cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidateByQueryForInvalidType() {
-		try {
-			cache.invalidateByQuery("str", null);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache type cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testGetStringByQueryForInvalidType() {
-		try {
-			cache.getStringByQuery("str", null);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache type cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-
-	@Test
-	public void testRemoveByQuery() {
-		try {
-			CacheType type = new CacheType();
-			cache.setCachedQuery("str", type, "val");
-			assertNotNull(cache.getStringByQuery("str", type));
-			cache.removeByQuery("str", type);
-			assertNull(cache.getStringByQuery("str", type));
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache type cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.cache.CacheType;
+
+public class GeneralCacheTest extends AnnotationTestFunctions {
+	Logger															 logger	= Logger.getLogger(GeneralCacheTest.class);
+
+	GeneralCache												 cache	= new GeneralCache();
+
+	@Autowired
+	PermanentDatabaseLevelCacheInterface databaseLevelCache;
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		cache.setCache2(databaseLevelCache);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testClear() {
+		QueryCacheInterface origianlCache = cache.getCache2();
+		try {
+			CacheType type = new CacheType();
+			type.setId(-1);
+			cache.setCache2(ApplicationLevelCache.getInstance());
+			ApplicationLevelCache.getInstance().setCachedQuery("str", type, "val");
+			assertNotNull(cache.getStringByQuery("str", type));
+			cache.clearCache();
+			assertNull(cache.getStringByQuery("str", type));
+		} finally {
+			cache.setCache2(origianlCache);
+		}
+	}
+
+	@Test
+	public void testGetXmlNodeByQueryForInvalidType() {
+		try {
+			cache.getXmlNodeByQuery("str", null);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache type cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetCachedQueryForInvalidType() {
+		try {
+			cache.setCachedQuery("str", null, null);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache type cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveByQueryForInvalidType() {
+		try {
+			cache.removeByQuery("str", null);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache type cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidateByQueryForInvalidType() {
+		try {
+			cache.invalidateByQuery("str", null);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache type cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	@Test
+	public void testGetStringByQueryForInvalidType() {
+		try {
+			cache.getStringByQuery("str", null);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache type cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+
+	@Test
+	public void testRemoveByQuery() {
+		try {
+			CacheType type = new CacheType();
+			cache.setCachedQuery("str", type, "val");
+			assertNotNull(cache.getStringByQuery("str", type));
+			cache.removeByQuery("str", type);
+			assertNull(cache.getStringByQuery("str", type));
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache type cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/GeneralCacheWithExclusionTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/GeneralCacheWithExclusionTest.java
index 6d3aa26c67..81c914488d 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/GeneralCacheWithExclusionTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/GeneralCacheWithExclusionTest.java
@@ -1,133 +1,133 @@
-package lcsb.mapviewer.annotation.cache;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.cache.CacheType;
-
-public class GeneralCacheWithExclusionTest extends AnnotationTestFunctions {
-	Logger logger = Logger.getLogger(GeneralCacheWithExclusionTest.class);
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testConstructorWithInvalidParams() {
-		try {
-			new GeneralCacheWithExclusion(null, 1);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
-		}
-	}
-
-	@Test
-	public void testExclusion() throws Exception {
-		try {
-			CacheType type = new CacheType();
-			GeneralCache cache = new GeneralCache();
-			cache.setCache2(ApplicationLevelCache.getInstance());
-			GeneralCacheWithExclusion cacheWithExclusion = new GeneralCacheWithExclusion(cache, 2);
-
-			cacheWithExclusion.setCachedQuery("str", type, super.getNodeFromXmlString("<val/>"));
-
-			// after two tries we should get the data that was set
-			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
-			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
-			assertNotNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
-
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testClear() throws Exception {
-		try {
-			CacheType type = new CacheType();
-			GeneralCache cache = new GeneralCache();
-			cache.setCache2(ApplicationLevelCache.getInstance());
-			GeneralCacheWithExclusion cacheWithExclusion = new GeneralCacheWithExclusion(cache, 0);
-
-			cacheWithExclusion.setCachedQuery("str", type, super.getNodeFromXmlString("<val/>"));
-
-			assertNotNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
-			cacheWithExclusion.clearCache();
-			
-			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
-
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemove() throws Exception {
-		try {
-			CacheType type = new CacheType();
-			GeneralCache cache = new GeneralCache();
-			cache.setCache2(ApplicationLevelCache.getInstance());
-			GeneralCacheWithExclusion cacheWithExclusion = new GeneralCacheWithExclusion(cache, 0);
-
-			cacheWithExclusion.setCachedQuery("str", type, super.getNodeFromXmlString("<val/>"));
-
-
-			assertNotNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
-			cacheWithExclusion.removeByQuery("str", type);
-			
-			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
-
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidate() throws Exception {
-		try {
-			CacheType type = new CacheType();
-			GeneralCache cache = new GeneralCache();
-			cache.setCache2(ApplicationLevelCache.getInstance());
-			GeneralCacheWithExclusion cacheWithExclusion = new GeneralCacheWithExclusion(cache, 0);
-
-			cacheWithExclusion.setCachedQuery("str", type, super.getNodeFromXmlString("<val/>"));
-			cacheWithExclusion.invalidateByQuery("str", type);
-
-			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.cache.CacheType;
+
+public class GeneralCacheWithExclusionTest extends AnnotationTestFunctions {
+	Logger logger = Logger.getLogger(GeneralCacheWithExclusionTest.class);
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testConstructorWithInvalidParams() {
+		try {
+			new GeneralCacheWithExclusion(null, 1);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
+		}
+	}
+
+	@Test
+	public void testExclusion() throws Exception {
+		try {
+			CacheType type = new CacheType();
+			GeneralCache cache = new GeneralCache();
+			cache.setCache2(ApplicationLevelCache.getInstance());
+			GeneralCacheWithExclusion cacheWithExclusion = new GeneralCacheWithExclusion(cache, 2);
+
+			cacheWithExclusion.setCachedQuery("str", type, super.getNodeFromXmlString("<val/>"));
+
+			// after two tries we should get the data that was set
+			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
+			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
+			assertNotNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
+
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testClear() throws Exception {
+		try {
+			CacheType type = new CacheType();
+			GeneralCache cache = new GeneralCache();
+			cache.setCache2(ApplicationLevelCache.getInstance());
+			GeneralCacheWithExclusion cacheWithExclusion = new GeneralCacheWithExclusion(cache, 0);
+
+			cacheWithExclusion.setCachedQuery("str", type, super.getNodeFromXmlString("<val/>"));
+
+			assertNotNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
+			cacheWithExclusion.clearCache();
+			
+			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
+
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemove() throws Exception {
+		try {
+			CacheType type = new CacheType();
+			GeneralCache cache = new GeneralCache();
+			cache.setCache2(ApplicationLevelCache.getInstance());
+			GeneralCacheWithExclusion cacheWithExclusion = new GeneralCacheWithExclusion(cache, 0);
+
+			cacheWithExclusion.setCachedQuery("str", type, super.getNodeFromXmlString("<val/>"));
+
+
+			assertNotNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
+			cacheWithExclusion.removeByQuery("str", type);
+			
+			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
+
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidate() throws Exception {
+		try {
+			CacheType type = new CacheType();
+			GeneralCache cache = new GeneralCache();
+			cache.setCache2(ApplicationLevelCache.getInstance());
+			GeneralCacheWithExclusion cacheWithExclusion = new GeneralCacheWithExclusion(cache, 0);
+
+			cacheWithExclusion.setCachedQuery("str", type, super.getNodeFromXmlString("<val/>"));
+			cacheWithExclusion.invalidateByQuery("str", type);
+
+			assertNull(cacheWithExclusion.getXmlNodeByQuery("str", type));
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cache passed as argument cannot be null"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/MockCacheInterface.java b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/MockCacheInterface.java
index 31d47d8a99..ff36274cfa 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/MockCacheInterface.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/MockCacheInterface.java
@@ -1,33 +1,33 @@
-package lcsb.mapviewer.annotation.cache;
-
-/**
- * Mock implementation of {@link CachableInterface}. It's used for invalid cache
- * elements: {@link lcsb.mapviewer.model.cache.CacheType#INVALID_CACHE}.
- * 
- * @author Piotr Gawron
- * 
- */
-public final class MockCacheInterface extends CachableInterface {
-
-	public static RuntimeException exceptionToThrow = null;
-	public static Error errorToThrow;
-
-	/**
-	 * Defsault constructor.
-	 */
-	public MockCacheInterface() {
-		super(MockCacheInterface.class);
-	}
-
-	@Override
-	public String refreshCacheQuery(Object query) throws SourceNotAvailable {
-		if (exceptionToThrow != null) {
-			throw exceptionToThrow;
-		}
-		if (errorToThrow != null) {
-			throw errorToThrow;
-		}
-		return "<node>[" + query + "] Random: " + Math.random() + "</node>";
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+/**
+ * Mock implementation of {@link CachableInterface}. It's used for invalid cache
+ * elements: {@link lcsb.mapviewer.model.cache.CacheType#INVALID_CACHE}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public final class MockCacheInterface extends CachableInterface {
+
+	public static RuntimeException exceptionToThrow = null;
+	public static Error errorToThrow;
+
+	/**
+	 * Defsault constructor.
+	 */
+	public MockCacheInterface() {
+		super(MockCacheInterface.class);
+	}
+
+	@Override
+	public String refreshCacheQuery(Object query) throws SourceNotAvailable {
+		if (exceptionToThrow != null) {
+			throw exceptionToThrow;
+		}
+		if (errorToThrow != null) {
+			throw errorToThrow;
+		}
+		return "<node>[" + query + "] Random: " + Math.random() + "</node>";
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/SourceNotAvailableTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/SourceNotAvailableTest.java
index ac982ca9ff..642e83ab5e 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/SourceNotAvailableTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/SourceNotAvailableTest.java
@@ -1,30 +1,30 @@
-package lcsb.mapviewer.annotation.cache;
-
-import static org.junit.Assert.assertTrue;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class SourceNotAvailableTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testConstructor() {
-		Exception e = new SourceNotAvailable("meessage");
-		assertTrue(e.getMessage().contains("meessage"));
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class SourceNotAvailableTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testConstructor() {
+		Exception e = new SourceNotAvailable("meessage");
+		assertTrue(e.getMessage().contains("meessage"));
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/WebPageDownloaderTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/WebPageDownloaderTest.java
index 912e4504a3..8f58a75c42 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/cache/WebPageDownloaderTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/cache/WebPageDownloaderTest.java
@@ -1,65 +1,65 @@
-package lcsb.mapviewer.annotation.cache;
-
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.UnknownHostException;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-public class WebPageDownloaderTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testConnectionProblems() {
-		WebPageDownloader downloader = new WebPageDownloader() {
-			@Override
-			public HttpURLConnection openConnection(String url) throws IOException {
-				HttpURLConnection result = Mockito.mock(HttpURLConnection.class);
-				Mockito.doReturn(HttpURLConnection.HTTP_INTERNAL_ERROR).when(result).getResponseCode();
-				Mockito.doThrow(new IOException()).when(result).getInputStream();
-				return result;
-			}
-		};
-		try {
-			downloader.getFromNetwork("https://www.google.pl/?gws_rd=ssl");
-			fail("Exceptio expected");
-		} catch (IOException e) {
-		}
-	}
-
-	@Test
-	public void testConnectionProblems2() {
-		WebPageDownloader downloader = new WebPageDownloader() {
-			@Override
-			public HttpURLConnection openConnection(String url) throws IOException {
-				HttpURLConnection result = Mockito.mock(HttpURLConnection.class);
-				Mockito.doReturn(HttpURLConnection.HTTP_OK).when(result).getResponseCode();
-				Mockito.doThrow(new UnknownHostException()).when(result).getInputStream();
-				return result;
-			}
-		};
-		try {
-			downloader.getFromNetwork("https://www.google.pl/?gws_rd=ssl");
-			fail("Exceptio expected");
-		} catch (IOException e) {
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.cache;
+
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.UnknownHostException;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+public class WebPageDownloaderTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testConnectionProblems() {
+		WebPageDownloader downloader = new WebPageDownloader() {
+			@Override
+			public HttpURLConnection openConnection(String url) throws IOException {
+				HttpURLConnection result = Mockito.mock(HttpURLConnection.class);
+				Mockito.doReturn(HttpURLConnection.HTTP_INTERNAL_ERROR).when(result).getResponseCode();
+				Mockito.doThrow(new IOException()).when(result).getInputStream();
+				return result;
+			}
+		};
+		try {
+			downloader.getFromNetwork("https://www.google.pl/?gws_rd=ssl");
+			fail("Exceptio expected");
+		} catch (IOException e) {
+		}
+	}
+
+	@Test
+	public void testConnectionProblems2() {
+		WebPageDownloader downloader = new WebPageDownloader() {
+			@Override
+			public HttpURLConnection openConnection(String url) throws IOException {
+				HttpURLConnection result = Mockito.mock(HttpURLConnection.class);
+				Mockito.doReturn(HttpURLConnection.HTTP_OK).when(result).getResponseCode();
+				Mockito.doThrow(new UnknownHostException()).when(result).getInputStream();
+				return result;
+			}
+		};
+		try {
+			downloader.getFromNetwork("https://www.google.pl/?gws_rd=ssl");
+			fail("Exceptio expected");
+		} catch (IOException e) {
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/data/ArticleCitationComparatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/data/ArticleCitationComparatorTest.java
index 7d12657ef9..f77fcba6e5 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/data/ArticleCitationComparatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/data/ArticleCitationComparatorTest.java
@@ -1,47 +1,47 @@
-package lcsb.mapviewer.annotation.data;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ArticleCitationComparatorTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCompare() {
-		Article a1 = new Article();
-		a1.setCitationCount(2);
-		Article a2 = new Article();
-		a2.setCitationCount(10);
-		Article a3 = new Article();
-		a3.setCitationCount(5);
-		List<Article> list = new ArrayList<>();
-		list.add(a1);
-		list.add(a2);
-		list.add(a3);
-		
-		list.sort(new ArticleCitationComparator());
-		
-		assertEquals(a2,list.get(0));
-		assertEquals(a3,list.get(1));
-		assertEquals(a1,list.get(2));
-	}
-
-}
+package lcsb.mapviewer.annotation.data;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ArticleCitationComparatorTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCompare() {
+		Article a1 = new Article();
+		a1.setCitationCount(2);
+		Article a2 = new Article();
+		a2.setCitationCount(10);
+		Article a3 = new Article();
+		a3.setCitationCount(5);
+		List<Article> list = new ArrayList<>();
+		list.add(a1);
+		list.add(a2);
+		list.add(a3);
+		
+		list.sort(new ArticleCitationComparator());
+		
+		assertEquals(a2,list.get(0));
+		assertEquals(a3,list.get(1));
+		assertEquals(a1,list.get(2));
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/data/ChemicalDirectEvidenceTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/data/ChemicalDirectEvidenceTest.java
index 157d62127c..8d409693ce 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/data/ChemicalDirectEvidenceTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/data/ChemicalDirectEvidenceTest.java
@@ -1,31 +1,31 @@
-package lcsb.mapviewer.annotation.data;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ChemicalDirectEvidenceTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValues() {
-		for (ChemicalDirectEvidence value : ChemicalDirectEvidence.values()) {
-			assertNotNull(ChemicalDirectEvidence.valueOf(value.toString()));
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.data;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ChemicalDirectEvidenceTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValues() {
+		for (ChemicalDirectEvidence value : ChemicalDirectEvidence.values()) {
+			assertNotNull(ChemicalDirectEvidence.valueOf(value.toString()));
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/data/ChemicalTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/data/ChemicalTest.java
index b89bfb937a..8cde3ee31e 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/data/ChemicalTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/data/ChemicalTest.java
@@ -1,67 +1,67 @@
-package lcsb.mapviewer.annotation.data;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.MiriamData;
-
-public class ChemicalTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetters() {
-		List<Target> inferenceNetwork = new ArrayList<>();
-		List<String> synonyms = new ArrayList<>();
-		List<MiriamData> directEvidencePublication = new ArrayList<>();
-		Chemical chemical = new Chemical();
-		chemical.setInferenceNetwork(inferenceNetwork);
-		chemical.setDirectEvidencePublication(directEvidencePublication);
-		chemical.setSynonyms(synonyms);
-
-		assertEquals(inferenceNetwork, chemical.getInferenceNetwork());
-		assertEquals(directEvidencePublication, chemical.getDirectEvidencePublication());
-		assertEquals(synonyms, chemical.getSynonyms());
-		
-	}
-
-	@Test
-	public void testGetSynonymsString() {
-		Chemical chemical = new Chemical();
-		assertEquals("", chemical.getSynonymsString());
-		chemical.getSynonyms().add("12");
-		assertEquals("12", chemical.getSynonymsString());
-		chemical.getSynonyms().add("qwe");
-		assertEquals("12,qwe", chemical.getSynonymsString());
-		chemical.getSynonyms().add("zc");
-		assertEquals("12,qwe,zc", chemical.getSynonymsString());
-	}
-
-	@Test
-	public void testToString() {
-		
-		Chemical chemical = new Chemical();
-		chemical.getInferenceNetwork().add(new Target());
-		chemical.getDirectEvidencePublication().add(new MiriamData());
-		assertNotNull(chemical.toString());
-	}
-
-}
+package lcsb.mapviewer.annotation.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.MiriamData;
+
+public class ChemicalTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetters() {
+		List<Target> inferenceNetwork = new ArrayList<>();
+		List<String> synonyms = new ArrayList<>();
+		List<MiriamData> directEvidencePublication = new ArrayList<>();
+		Chemical chemical = new Chemical();
+		chemical.setInferenceNetwork(inferenceNetwork);
+		chemical.setDirectEvidencePublication(directEvidencePublication);
+		chemical.setSynonyms(synonyms);
+
+		assertEquals(inferenceNetwork, chemical.getInferenceNetwork());
+		assertEquals(directEvidencePublication, chemical.getDirectEvidencePublication());
+		assertEquals(synonyms, chemical.getSynonyms());
+		
+	}
+
+	@Test
+	public void testGetSynonymsString() {
+		Chemical chemical = new Chemical();
+		assertEquals("", chemical.getSynonymsString());
+		chemical.getSynonyms().add("12");
+		assertEquals("12", chemical.getSynonymsString());
+		chemical.getSynonyms().add("qwe");
+		assertEquals("12,qwe", chemical.getSynonymsString());
+		chemical.getSynonyms().add("zc");
+		assertEquals("12,qwe,zc", chemical.getSynonymsString());
+	}
+
+	@Test
+	public void testToString() {
+		
+		Chemical chemical = new Chemical();
+		chemical.getInferenceNetwork().add(new Target());
+		chemical.getDirectEvidencePublication().add(new MiriamData());
+		assertNotNull(chemical.toString());
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/data/DrugTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/data/DrugTest.java
index b4afe6785c..13d31788a1 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/data/DrugTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/data/DrugTest.java
@@ -1,118 +1,118 @@
-package lcsb.mapviewer.annotation.data;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.annotation.services.TaxonomyBackend;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-
-public class DrugTest extends AnnotationTestFunctions {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Drug());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			Drug d = new Drug();
-			d.setDescription("x");
-			Drug copy = new Drug(d);
-			assertEquals("x", copy.getDescription());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor2() {
-		try {
-			Drug d = new Drug(null);
-			assertNull(d.getName());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToString() {
-		try {
-			Drug d = new Drug();
-			d.addSynonym("Synonym");
-			d.addBrandName("bname");
-			d.addSource(new MiriamData(MiriamType.DRUGBANK, "xxx"));
-			Target target = new Target();
-			target.setSource(new MiriamData());
-			target.addReference(TaxonomyBackend.HUMAN_TAXONOMY);
-			d.addTarget(target);
-
-			assertTrue(d.toString().contains("Synonym"));
-			assertFalse(d.toString().contains("bname"));
-			assertTrue(d.toString().contains("xxx"));
-			assertTrue(d.toString().contains(TaxonomyBackend.HUMAN_TAXONOMY.getResource()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddSynonym() {
-		try {
-			Drug d = new Drug();
-			d.addSynonym("Synonym");
-			d.addSynonym("Synonym");
-
-			assertEquals(1, d.getSynonyms().size());
-			assertEquals(1, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Drug d = new Drug();
-			List<Target> targets = new ArrayList<>();
-			List<MiriamData> sources = new ArrayList<>();
-			d.setTargets(targets);
-			d.setSources(sources);
-
-			assertEquals(targets, d.getTargets());
-			assertEquals(sources, d.getSources());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.annotation.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.annotation.services.TaxonomyBackend;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+
+public class DrugTest extends AnnotationTestFunctions {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Drug());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			Drug d = new Drug();
+			d.setDescription("x");
+			Drug copy = new Drug(d);
+			assertEquals("x", copy.getDescription());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			Drug d = new Drug(null);
+			assertNull(d.getName());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToString() {
+		try {
+			Drug d = new Drug();
+			d.addSynonym("Synonym");
+			d.addBrandName("bname");
+			d.addSource(new MiriamData(MiriamType.DRUGBANK, "xxx"));
+			Target target = new Target();
+			target.setSource(new MiriamData());
+			target.addReference(TaxonomyBackend.HUMAN_TAXONOMY);
+			d.addTarget(target);
+
+			assertTrue(d.toString().contains("Synonym"));
+			assertFalse(d.toString().contains("bname"));
+			assertTrue(d.toString().contains("xxx"));
+			assertTrue(d.toString().contains(TaxonomyBackend.HUMAN_TAXONOMY.getResource()));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddSynonym() {
+		try {
+			Drug d = new Drug();
+			d.addSynonym("Synonym");
+			d.addSynonym("Synonym");
+
+			assertEquals(1, d.getSynonyms().size());
+			assertEquals(1, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Drug d = new Drug();
+			List<Target> targets = new ArrayList<>();
+			List<MiriamData> sources = new ArrayList<>();
+			d.setTargets(targets);
+			d.setSources(sources);
+
+			assertEquals(targets, d.getTargets());
+			assertEquals(sources, d.getSources());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/data/MeSHTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/data/MeSHTest.java
index d499ed1b2f..a73374ab5b 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/data/MeSHTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/data/MeSHTest.java
@@ -1,90 +1,90 @@
-package lcsb.mapviewer.annotation.data;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class MeSHTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new MeSH("is", "name", "desc", new ArrayList<>()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			MeSH mesh = new MeSH();
-			List<String> synonyms = new ArrayList<>();
-
-			mesh.setSynonyms(synonyms);
-
-			assertEquals(synonyms, mesh.getSynonyms());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToString() {
-		try {
-			MeSH mesh = new MeSH("is", "nam3e", "des3c", new ArrayList<>());
-
-			String serial = mesh.toString();
-
-			assertTrue(serial.contains("is"));
-			assertTrue(serial.contains("nam3e"));
-			assertTrue(serial.contains("des3c"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSynonymsToString() {
-		try {
-			MeSH mesh = new MeSH();
-
-			assertEquals("", mesh.getSynonymsString());
-
-			mesh.getSynonyms().add("synon");
-			assertEquals("synon", mesh.getSynonymsString());
-
-			mesh.getSynonyms().add("bla");
-			mesh.getSynonyms().add("qwe");
-			assertEquals("synon,bla,qwe", mesh.getSynonymsString());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class MeSHTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new MeSH("is", "name", "desc", new ArrayList<>()));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			MeSH mesh = new MeSH();
+			List<String> synonyms = new ArrayList<>();
+
+			mesh.setSynonyms(synonyms);
+
+			assertEquals(synonyms, mesh.getSynonyms());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToString() {
+		try {
+			MeSH mesh = new MeSH("is", "nam3e", "des3c", new ArrayList<>());
+
+			String serial = mesh.toString();
+
+			assertTrue(serial.contains("is"));
+			assertTrue(serial.contains("nam3e"));
+			assertTrue(serial.contains("des3c"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSynonymsToString() {
+		try {
+			MeSH mesh = new MeSH();
+
+			assertEquals("", mesh.getSynonymsString());
+
+			mesh.getSynonyms().add("synon");
+			assertEquals("synon", mesh.getSynonymsString());
+
+			mesh.getSynonyms().add("bla");
+			mesh.getSynonyms().add("qwe");
+			assertEquals("synon,bla,qwe", mesh.getSynonymsString());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/data/TargetTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/data/TargetTest.java
index 633ff9d56d..49b41ea930 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/data/TargetTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/data/TargetTest.java
@@ -1,65 +1,65 @@
-package lcsb.mapviewer.annotation.data;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.MiriamData;
-
-public class TargetTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Target());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			List<MiriamData> genes = new ArrayList<>();
-			Target target = new Target();
-			target.setGenes(genes);
-
-			assertEquals(genes, target.getGenes());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddInvalidGene() {
-		try {
-			Target target = new Target();
-			target.addGene(null);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Cannot add null element"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.annotation.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.MiriamData;
+
+public class TargetTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Target());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			List<MiriamData> genes = new ArrayList<>();
+			Target target = new Target();
+			target.setGenes(genes);
+
+			assertEquals(genes, target.getGenes());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddInvalidGene() {
+		try {
+			Target target = new Target();
+			target.addGene(null);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Cannot add null element"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/data/TargetTypeTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/data/TargetTypeTest.java
index 5cd268ced9..52c5e54406 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/data/TargetTypeTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/data/TargetTypeTest.java
@@ -1,32 +1,32 @@
-package lcsb.mapviewer.annotation.data;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TargetTypeTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValues() {
-		for (TargetType type : TargetType.values()) {
-			assertNotNull(type.getCommonName());
-			assertNotNull(TargetType.valueOf(type.toString()));
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.data;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TargetTypeTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValues() {
+		for (TargetType type : TargetType.values()) {
+			assertNotNull(type.getCommonName());
+			assertNotNull(TargetType.valueOf(type.toString()));
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/AllServicesTests.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/AllServicesTests.java
index 1a6650a25e..0a71da9f23 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/AllServicesTests.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/AllServicesTests.java
@@ -1,34 +1,34 @@
-package lcsb.mapviewer.annotation.services;
-
-import lcsb.mapviewer.annotation.services.annotators.AllAnnotatorTests;
-import lcsb.mapviewer.annotation.services.genome.AllGenomeTests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ AllAnnotatorTests.class, //
-		AllGenomeTests.class, //
-		ChEMBLParserTest.class, //
-		ChemicalParserTest.class, //
-		ChemicalSearchExceptionTest.class, //
-		DrugAnnotationTest.class, //
-		DrugbankHTMLParserTest.class, //
-		DrugbankXMLParserTest.class, //
-		ExternalServiceStatusTest.class, //
-		ExternalServiceStatusTypeTest.class, //
-		ImproperAnnotationsTest.class, //
-		MeSHParserTest.class, //
-		MiriamConnectorTest.class, //
-		MiRNASearchExceptionTest.class, //
-		MissingAnnotationTest.class, //
-		MissingRequiredAnnotationsTest.class, //
-		MiRNAParserTest.class, //
-		ModelAnnotatorTest.class, //
-		PubmedParserTest.class, //
-		TaxonomyBackendTest.class,//
-})
-public class AllServicesTests {
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import lcsb.mapviewer.annotation.services.annotators.AllAnnotatorTests;
+import lcsb.mapviewer.annotation.services.genome.AllGenomeTests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ AllAnnotatorTests.class, //
+		AllGenomeTests.class, //
+		ChEMBLParserTest.class, //
+		ChemicalParserTest.class, //
+		ChemicalSearchExceptionTest.class, //
+		DrugAnnotationTest.class, //
+		DrugbankHTMLParserTest.class, //
+		DrugbankXMLParserTest.class, //
+		ExternalServiceStatusTest.class, //
+		ExternalServiceStatusTypeTest.class, //
+		ImproperAnnotationsTest.class, //
+		MeSHParserTest.class, //
+		MiriamConnectorTest.class, //
+		MiRNASearchExceptionTest.class, //
+		MissingAnnotationTest.class, //
+		MissingRequiredAnnotationsTest.class, //
+		MiRNAParserTest.class, //
+		ModelAnnotatorTest.class, //
+		PubmedParserTest.class, //
+		TaxonomyBackendTest.class,//
+})
+public class AllServicesTests {
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ChemicalSearchExceptionTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ChemicalSearchExceptionTest.java
index 48e93bd829..d96d0a8d0f 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ChemicalSearchExceptionTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ChemicalSearchExceptionTest.java
@@ -1,30 +1,30 @@
-package lcsb.mapviewer.annotation.services;
-
-import static org.junit.Assert.*;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ChemicalSearchExceptionTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testConstructor() {
-		ChemicalSearchException e = new ChemicalSearchException("msg");
-		assertEquals("msg", e.getMessage());
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ChemicalSearchExceptionTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testConstructor() {
+		ChemicalSearchException e = new ChemicalSearchException("msg");
+		assertEquals("msg", e.getMessage());
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugAnnotationTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugAnnotationTest.java
index 88864be8e1..d80c1c51c6 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugAnnotationTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugAnnotationTest.java
@@ -1,72 +1,72 @@
-package lcsb.mapviewer.annotation.services;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
-import lcsb.mapviewer.annotation.data.Drug;
-import lcsb.mapviewer.model.map.MiriamData;
-
-public class DrugAnnotationTest extends AnnotationTestFunctions {
-	Logger										 logger	= Logger.getLogger(DrugAnnotationTest.class);
-
-	@Autowired
-	private DrugbankHTMLParser drugBankHTMLParser;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testXmlSerialization() throws Exception {
-		try {
-			DrugAnnotation drugAnnotation = new DrugAnnotation(DrugAnnotation.class) {
-
-				@Override
-				public Object refreshCacheQuery(Object query) throws SourceNotAvailable {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public Drug findDrug(String name) {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public List<Drug> getDrugListByTarget(MiriamData target) {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-			};
-			Drug drug = drugBankHTMLParser.findDrug("aspirin");
-
-			String xml = drugAnnotation.getDrugSerializer().objectToString(drug);
-
-			Drug drug2 = drugAnnotation.getDrugSerializer().xmlToObject(getNodeFromXmlString(xml));
-
-			assertEquals(drug.getTargets().size(), drug2.getTargets().size());
-			assertEquals(drug.getTargets().get(0).getGenes().size(), drug2.getTargets().get(0).getGenes().size());
-			assertEquals(drug.getTargets().get(0).getReferences().size(), drug2.getTargets().get(0).getReferences().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
+import lcsb.mapviewer.annotation.data.Drug;
+import lcsb.mapviewer.model.map.MiriamData;
+
+public class DrugAnnotationTest extends AnnotationTestFunctions {
+	Logger										 logger	= Logger.getLogger(DrugAnnotationTest.class);
+
+	@Autowired
+	private DrugbankHTMLParser drugBankHTMLParser;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testXmlSerialization() throws Exception {
+		try {
+			DrugAnnotation drugAnnotation = new DrugAnnotation(DrugAnnotation.class) {
+
+				@Override
+				public Object refreshCacheQuery(Object query) throws SourceNotAvailable {
+					// TODO Auto-generated method stub
+					return null;
+				}
+
+				@Override
+				public Drug findDrug(String name) {
+					// TODO Auto-generated method stub
+					return null;
+				}
+
+				@Override
+				public List<Drug> getDrugListByTarget(MiriamData target) {
+					// TODO Auto-generated method stub
+					return null;
+				}
+
+			};
+			Drug drug = drugBankHTMLParser.findDrug("aspirin");
+
+			String xml = drugAnnotation.getDrugSerializer().objectToString(drug);
+
+			Drug drug2 = drugAnnotation.getDrugSerializer().xmlToObject(getNodeFromXmlString(xml));
+
+			assertEquals(drug.getTargets().size(), drug2.getTargets().size());
+			assertEquals(drug.getTargets().get(0).getGenes().size(), drug2.getTargets().get(0).getGenes().size());
+			assertEquals(drug.getTargets().get(0).getReferences().size(), drug2.getTargets().get(0).getReferences().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugbankXMLParserTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugbankXMLParserTest.java
index 7f6c68fa26..1d347d5989 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugbankXMLParserTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugbankXMLParserTest.java
@@ -1,146 +1,146 @@
-package lcsb.mapviewer.annotation.services;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.when;
-
-import org.apache.log4j.Logger;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.annotation.data.Drug;
-import lcsb.mapviewer.annotation.data.Target;
-import lcsb.mapviewer.model.map.MiriamType;
-
-public class DrugbankXMLParserTest extends AnnotationTestFunctions {
-	Logger									 logger	= Logger.getLogger(DrugbankXMLParserTest.class);
-
-	String									 file		= "testFiles/target_drugbank/small_drugbank.xml";
-
-	@Autowired
-	TaxonomyBackend					 taxonomyBackend;
-
-	// this should be improved, but now for performance it's done via static field
-	static DrugbankXMLParser read;
-
-	@Before
-	public void setup() {
-		if (read == null) {
-			read = new DrugbankXMLParser(file, taxonomyBackend);
-		}
-	}
-
-	@Test
-	public void test1FindDrug() throws Exception {
-		Drug test = read.findDrug("Urokinase");
-		assertEquals(MiriamType.DRUGBANK, test.getSources().get(0).getDataType());
-		assertEquals("DB00013", test.getSources().get(0).getResource());
-		assertEquals("Urokinase", test.getName());
-		assertEquals(
-				"Low molecular weight form of human urokinase, that consists of an A chain of 2,000 daltons linked by a sulfhydryl bond to a B chain of 30,400 daltons. Recombinant urokinase plasminogen activator",
-				test.getDescription());
-		assertEquals(10, test.getTargets().size());
-
-		// test.write();
-	}
-
-	@Test
-	public void test2FindDrug() throws Exception {
-		Drug test = read.findDrug("diazoxide");
-		assertEquals("Diazoxide", test.getName());
-		assertEquals("DB01119", test.getSources().get(0).getResource());
-		assertEquals(
-				"A benzothiadiazine derivative that is a peripheral vasodilator used for hypertensive emergencies. It lacks diuretic effect, apparently because it lacks a sulfonamide group. [PubChem]",
-				test.getDescription());
-		assertEquals(6, test.getTargets().size());
-	}
-
-	@Test
-	public void test3FindDrug() throws Exception {
-		// finding synonym
-		Drug test = read.findDrug("Rapamycin");
-		assertEquals("Sirolimus", test.getName());
-		assertEquals("DB00877", test.getSources().get(0).getResource());
-		assertEquals(
-				"A macrolide compound obtained from Streptomyces hygroscopicus that acts by selectively blocking the transcriptional activation of cytokines thereby inhibiting cytokine production. It is bioactive only when bound to immunophilins. Sirolimus is a potent immunosuppressant and possesses both antifungal and antineoplastic properties. [PubChem]",
-				test.getDescription());
-		assertEquals(3, test.getTargets().size());
-	}
-
-	@Test
-	public void test4FindDrug() throws Exception {
-		Drug test = read.findDrug("Methylamine");
-		assertEquals("Methylamine", test.getName());
-		assertEquals("DB01828", test.getSources().get(0).getResource());
-		assertEquals(null, test.getDescription());
-		assertEquals(1, test.getTargets().size());
-
-		for (Target t : test.getTargets()) {
-			assertEquals("Ammonia channel", t.getName());
-			assertEquals("BE0001338", t.getSource().getResource());
-			assertEquals(MiriamType.DRUGBANK_TARGET_V4, t.getSource().getDataType());
-			assertEquals(2, t.getReferences().size());
-			assertEquals(0, t.getGenes().size());
-		}
-
-		// test.write();
-	}
-
-	@Test
-	public void test5FindDrug() throws Exception {
-		Drug test = read.findDrug("Amantadine");
-		assertEquals("Amantadine", test.getName());
-		assertEquals("DB00915", test.getSources().get(0).getResource());
-		assertEquals(
-				"An antiviral that is used in the prophylactic or symptomatic treatment of influenza A. It is also used as an antiparkinsonian agent, to treat extrapyramidal reactions, and for postherpetic neuralgia. The mechanisms of its effects in movement disorders are not well understood but probably reflect an increase in synthesis and release of dopamine, with perhaps some inhibition of dopamine uptake. [PubChem]",
-				test.getDescription());
-		assertEquals(3, test.getTargets().size());
-	}
-
-	@Test
-	public void test6FindDrug() throws Exception {
-
-		Drug test = read.findDrug("qwertyuiop");
-		assertEquals(null, test);
-	}
-
-	@Test
-	public void test7FindDrug() throws Exception {
-		Drug test = read.findDrug("Aluminum hydroxide");
-		assertEquals("Aluminum hydroxide", test.getName());
-		assertEquals("DB06723", test.getSources().get(0).getResource());
-		assertEquals(
-				"Aluminum hydroxide is an inorganic salt used as an antacid. It is a basic compound that acts by neutralizing hydrochloric acid in gastric secretions. Subsequent increases in pH may inhibit the action of pepsin. An increase in bicarbonate ions and prostaglandins may also confer cytoprotective effects.",
-				test.getDescription());
-		assertEquals(0, test.getTargets().size());
-	}
-
-	@Test
-	public void testFindDrugInInvalidFile() throws Exception {
-		try {
-			new DrugbankXMLParser("unknown.file.bla", taxonomyBackend).findDrug("unk");
-			fail("Exception expected");
-
-		} catch (DrugSearchException e) {
-			assertTrue(e.getMessage().contains("Problem with processing input file"));
-		}
-	}
-
-	@Test
-	public void testFindDrugWithTaxnomyBackendBroken() throws Exception {
-		try {
-			TaxonomyBackend taxonomyMock = Mockito.mock(TaxonomyBackend.class);
-			when(taxonomyMock.getByName(anyString())).thenThrow(new TaxonomySearchException(null, null));
-			new DrugbankXMLParser(file, taxonomyMock).findDrug("Amantadine");
-			fail("Exception expected");
-
-		} catch (DrugSearchException e) {
-			assertEquals(TaxonomySearchException.class, e.getCause().getClass());
-		}
-	}
-}
+package lcsb.mapviewer.annotation.services;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.when;
+
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.annotation.data.Drug;
+import lcsb.mapviewer.annotation.data.Target;
+import lcsb.mapviewer.model.map.MiriamType;
+
+public class DrugbankXMLParserTest extends AnnotationTestFunctions {
+	Logger									 logger	= Logger.getLogger(DrugbankXMLParserTest.class);
+
+	String									 file		= "testFiles/target_drugbank/small_drugbank.xml";
+
+	@Autowired
+	TaxonomyBackend					 taxonomyBackend;
+
+	// this should be improved, but now for performance it's done via static field
+	static DrugbankXMLParser read;
+
+	@Before
+	public void setup() {
+		if (read == null) {
+			read = new DrugbankXMLParser(file, taxonomyBackend);
+		}
+	}
+
+	@Test
+	public void test1FindDrug() throws Exception {
+		Drug test = read.findDrug("Urokinase");
+		assertEquals(MiriamType.DRUGBANK, test.getSources().get(0).getDataType());
+		assertEquals("DB00013", test.getSources().get(0).getResource());
+		assertEquals("Urokinase", test.getName());
+		assertEquals(
+				"Low molecular weight form of human urokinase, that consists of an A chain of 2,000 daltons linked by a sulfhydryl bond to a B chain of 30,400 daltons. Recombinant urokinase plasminogen activator",
+				test.getDescription());
+		assertEquals(10, test.getTargets().size());
+
+		// test.write();
+	}
+
+	@Test
+	public void test2FindDrug() throws Exception {
+		Drug test = read.findDrug("diazoxide");
+		assertEquals("Diazoxide", test.getName());
+		assertEquals("DB01119", test.getSources().get(0).getResource());
+		assertEquals(
+				"A benzothiadiazine derivative that is a peripheral vasodilator used for hypertensive emergencies. It lacks diuretic effect, apparently because it lacks a sulfonamide group. [PubChem]",
+				test.getDescription());
+		assertEquals(6, test.getTargets().size());
+	}
+
+	@Test
+	public void test3FindDrug() throws Exception {
+		// finding synonym
+		Drug test = read.findDrug("Rapamycin");
+		assertEquals("Sirolimus", test.getName());
+		assertEquals("DB00877", test.getSources().get(0).getResource());
+		assertEquals(
+				"A macrolide compound obtained from Streptomyces hygroscopicus that acts by selectively blocking the transcriptional activation of cytokines thereby inhibiting cytokine production. It is bioactive only when bound to immunophilins. Sirolimus is a potent immunosuppressant and possesses both antifungal and antineoplastic properties. [PubChem]",
+				test.getDescription());
+		assertEquals(3, test.getTargets().size());
+	}
+
+	@Test
+	public void test4FindDrug() throws Exception {
+		Drug test = read.findDrug("Methylamine");
+		assertEquals("Methylamine", test.getName());
+		assertEquals("DB01828", test.getSources().get(0).getResource());
+		assertEquals(null, test.getDescription());
+		assertEquals(1, test.getTargets().size());
+
+		for (Target t : test.getTargets()) {
+			assertEquals("Ammonia channel", t.getName());
+			assertEquals("BE0001338", t.getSource().getResource());
+			assertEquals(MiriamType.DRUGBANK_TARGET_V4, t.getSource().getDataType());
+			assertEquals(2, t.getReferences().size());
+			assertEquals(0, t.getGenes().size());
+		}
+
+		// test.write();
+	}
+
+	@Test
+	public void test5FindDrug() throws Exception {
+		Drug test = read.findDrug("Amantadine");
+		assertEquals("Amantadine", test.getName());
+		assertEquals("DB00915", test.getSources().get(0).getResource());
+		assertEquals(
+				"An antiviral that is used in the prophylactic or symptomatic treatment of influenza A. It is also used as an antiparkinsonian agent, to treat extrapyramidal reactions, and for postherpetic neuralgia. The mechanisms of its effects in movement disorders are not well understood but probably reflect an increase in synthesis and release of dopamine, with perhaps some inhibition of dopamine uptake. [PubChem]",
+				test.getDescription());
+		assertEquals(3, test.getTargets().size());
+	}
+
+	@Test
+	public void test6FindDrug() throws Exception {
+
+		Drug test = read.findDrug("qwertyuiop");
+		assertEquals(null, test);
+	}
+
+	@Test
+	public void test7FindDrug() throws Exception {
+		Drug test = read.findDrug("Aluminum hydroxide");
+		assertEquals("Aluminum hydroxide", test.getName());
+		assertEquals("DB06723", test.getSources().get(0).getResource());
+		assertEquals(
+				"Aluminum hydroxide is an inorganic salt used as an antacid. It is a basic compound that acts by neutralizing hydrochloric acid in gastric secretions. Subsequent increases in pH may inhibit the action of pepsin. An increase in bicarbonate ions and prostaglandins may also confer cytoprotective effects.",
+				test.getDescription());
+		assertEquals(0, test.getTargets().size());
+	}
+
+	@Test
+	public void testFindDrugInInvalidFile() throws Exception {
+		try {
+			new DrugbankXMLParser("unknown.file.bla", taxonomyBackend).findDrug("unk");
+			fail("Exception expected");
+
+		} catch (DrugSearchException e) {
+			assertTrue(e.getMessage().contains("Problem with processing input file"));
+		}
+	}
+
+	@Test
+	public void testFindDrugWithTaxnomyBackendBroken() throws Exception {
+		try {
+			TaxonomyBackend taxonomyMock = Mockito.mock(TaxonomyBackend.class);
+			when(taxonomyMock.getByName(anyString())).thenThrow(new TaxonomySearchException(null, null));
+			new DrugbankXMLParser(file, taxonomyMock).findDrug("Amantadine");
+			fail("Exception expected");
+
+		} catch (DrugSearchException e) {
+			assertEquals(TaxonomySearchException.class, e.getCause().getClass());
+		}
+	}
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusTest.java
index 7953bf1799..4d445dc838 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusTest.java
@@ -1,34 +1,34 @@
-package lcsb.mapviewer.annotation.services;
-
-import static org.junit.Assert.*;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ExternalServiceStatusTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetters() {
-		String name = "b";
-		String page = "page";
-
-		ExternalServiceStatus status = new ExternalServiceStatus(name, page);
-		assertEquals(name, status.getName());
-		assertEquals(page, status.getPage());
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ExternalServiceStatusTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetters() {
+		String name = "b";
+		String page = "page";
+
+		ExternalServiceStatus status = new ExternalServiceStatus(name, page);
+		assertEquals(name, status.getName());
+		assertEquals(page, status.getPage());
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusTypeTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusTypeTest.java
index 1eb86e29c9..471f026614 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusTypeTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ExternalServiceStatusTypeTest.java
@@ -1,33 +1,33 @@
-package lcsb.mapviewer.annotation.services;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ExternalServiceStatusTypeTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValues() {
-		for (ExternalServiceStatusType type : ExternalServiceStatusType.values()) {
-			assertNotNull(type.getCommonName());
-			assertNotNull(type.getLevel());
-			assertNotNull(ExternalServiceStatusType.valueOf(type.toString()));
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ExternalServiceStatusTypeTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValues() {
+		for (ExternalServiceStatusType type : ExternalServiceStatusType.values()) {
+			assertNotNull(type.getCommonName());
+			assertNotNull(type.getLevel());
+			assertNotNull(ExternalServiceStatusType.valueOf(type.toString()));
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ImproperAnnotationsTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ImproperAnnotationsTest.java
index 64f51a4fc4..281fc56f92 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ImproperAnnotationsTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ImproperAnnotationsTest.java
@@ -15,8 +15,8 @@ import org.junit.Test;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 
 public class ImproperAnnotationsTest {
 
@@ -37,7 +37,7 @@ public class ImproperAnnotationsTest {
 		try {
 			List<MiriamData> list = new ArrayList<>();
 			list.add(new MiriamData(MiriamType.CAS, "a"));
-			ImproperAnnotations ie = new ImproperAnnotations(new SpeciesAlias(new Species()), list);
+			ImproperAnnotations ie = new ImproperAnnotations(new GenericProteinAlias(new GenericProtein()), list);
 			assertNotNull(ie.toString());
 		} catch (InvalidArgumentException e) {
 			assertTrue(e.getMessage().contains("Only miriam data from elements are accepted"));
@@ -47,8 +47,8 @@ public class ImproperAnnotationsTest {
 	@Test
 	public void testConstructor4() {
 		try {
-			new ImproperAnnotations(new SpeciesAlias(), new ArrayList<>());
-			fail("Exceptione expected");
+			new ImproperAnnotations(new GenericProteinAlias(new GenericProtein()), new ArrayList<>());
+			fail("Exception expected");
 		} catch (InvalidArgumentException e) {
 			assertTrue(e.getMessage().contains("List of improper annotations cannot be null"));
 		}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MeSHParserTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MeSHParserTest.java
index 9bfce336b2..7cfb337896 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MeSHParserTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MeSHParserTest.java
@@ -1,219 +1,219 @@
-package lcsb.mapviewer.annotation.services;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.when;
-
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
-import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
-import lcsb.mapviewer.annotation.cache.WebPageDownloader;
-import lcsb.mapviewer.annotation.data.MeSH;
-import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-
-public class MeSHParserTest extends AnnotationTestFunctions {
-	Logger		 logger	= Logger.getLogger(MeSHParserTest.class);
-
-	@Autowired
-	MeSHParser meshParser;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	/**
-	 * @throws Exception
-	 */
-	/**
-	 * @throws Exception
-	 */
-	@Test
-	public void testCreateChemicalListFromDB() throws Exception {
-		try {
-			// Parkinson disease
-			MiriamData meshID = new MiriamData(MiriamType.MESH_2012, "D004298");
-			MeSH mesh = meshParser.getMeSH(meshID);
-			assertTrue(mesh != null);
-			assertTrue(mesh.getMeSHId() != null);
-			assertTrue(mesh.getName() != null);
-			assertTrue(mesh.getName().toLowerCase().equals("dopamine"));
-			assertTrue(mesh.getDescription() != null);
-			assertTrue(mesh.getSynonyms().size() > 0);
-
-			// Rotenone disease -no synonyms
-			meshID = new MiriamData(MiriamType.MESH_2012, "D012402");
-			mesh = meshParser.getMeSH(meshID);
-			assertTrue(mesh != null);
-			assertTrue(mesh.getMeSHId() != null);
-			assertTrue(mesh.getName() != null);
-			assertTrue(mesh.getName().toLowerCase().equals("rotenone"));
-			assertTrue(mesh.getDescription() != null);
-			assertTrue(mesh.getSynonyms().size() == 0);
-
-			// One synonyms
-			meshID = new MiriamData(MiriamType.MESH_2012, "C503102");
-			mesh = meshParser.getMeSH(meshID);
-			assertTrue(mesh != null);
-			assertTrue(mesh.getMeSHId() != null);
-			assertTrue(mesh.getName() != null);
-			assertTrue(mesh.getName().toLowerCase().contains("1-(3-(2-(1-benzothiophen-5-yl) ethoxy) propyl)-3-azetidinol maleate"));
-			assertTrue(mesh.getDescription() != null);
-			assertTrue(mesh.getSynonyms().size() == 1);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetMEshWithNetworkProblems() throws Exception {
-		try {
-			// Parkinson disease
-			MiriamData meshID = new MiriamData(MiriamType.MESH_2012, "D004298");
-			MeSHParser parserUnderTest = new MeSHParser();
-			WebPageDownloader webPageDownloader = Mockito.mock(WebPageDownloader.class);
-			when(webPageDownloader.getFromNetwork(anyString())).thenThrow(new IOException());
-			parserUnderTest.setWebPageDownloader(webPageDownloader);
-
-			parserUnderTest.getMeSH(meshID);
-			fail("Exception expected");
-		} catch (AnnotatorException e) {
-			assertTrue(e.getMessage().contains("Problem with accessing MeSH database"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	/**
-	 * @throws Exception
-	 */
-	@Test
-	public void testExternalDBStatus() throws Exception {
-		ExternalServiceStatus status = meshParser.getServiceStatus();
-		logger.debug("Status of MeSH DB : " + status.getStatus().name());
-		assertTrue(status.getStatus().equals(ExternalServiceStatusType.OK));
-	}
-
-	@Test
-	public void testCachableInterfaceInvalidateChemical() throws Exception {
-		try {
-			MiriamData meshID = new MiriamData(MiriamType.MESH_2012, "D010300");
-			MeSH mesh = meshParser.getMeSH(meshID);
-			assertNotNull(mesh);
-
-			waitForRefreshCacheQueueToEmpty();
-
-			cache.invalidateByQuery(meshParser.getIdentifier(meshID), meshParser.getCacheType());
-
-			waitForRefreshCacheQueueToEmpty();
-
-			MeSH mesh2 = meshParser.getMeSH(meshID);
-			assertNotNull(mesh2);
-
-			assertFalse("Value wasn't refreshed from db", mesh.equals(mesh2));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCleanHtml() {
-		try {
-			String withouthHtml = meshParser.cleanHtml("<TD colspan=1>One of the catecholamine <A href=\"/cgi/mesh/2014/MB_cgi?mode=&term=NEUROTRANSMITTERS\">");
-			assertFalse(withouthHtml.contains("<"));
-			assertFalse(withouthHtml.contains(">"));
-			assertTrue(withouthHtml.contains("catecholamine"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testRefreshInvalidCacheQuery() throws Exception {
-		try {
-			meshParser.refreshCacheQuery("invalid_query");
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Don't know what to do"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRefreshInvalidCacheQuery2() throws Exception {
-		try {
-			meshParser.refreshCacheQuery(new Object());
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Don't know what to do"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRefreshInvalidCacheQuery3() throws Exception {
-		try {
-			String query = MeSHParser.MESH_PREFIX + "::::::";
-			meshParser.refreshCacheQuery(query);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Problematic query"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRefreshWhenProblemWithSourceDb() throws Exception {
-		WebPageDownloader downloader = meshParser.getWebPageDownloader();
-		GeneralCacheInterface cache = meshParser.getCache();
-		try {
-			meshParser.setCache(null);
-			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
-			when(mockDownloader.getFromNetwork(anyString())).thenThrow(new IOException());
-			meshParser.setWebPageDownloader(mockDownloader);
-
-			MiriamData meshID = new MiriamData(MiriamType.MESH_2012, "D010300");
-
-			meshParser.refreshCacheQuery(meshParser.getIdentifier(meshID));
-			fail("Exception expected");
-		} catch (SourceNotAvailable e) {
-			assertTrue(e.getMessage().contains("Problem with accessing Mesh database"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			meshParser.setWebPageDownloader(downloader);
-			meshParser.setCache(cache);
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
+import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
+import lcsb.mapviewer.annotation.cache.WebPageDownloader;
+import lcsb.mapviewer.annotation.data.MeSH;
+import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+
+public class MeSHParserTest extends AnnotationTestFunctions {
+	Logger		 logger	= Logger.getLogger(MeSHParserTest.class);
+
+	@Autowired
+	MeSHParser meshParser;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	/**
+	 * @throws Exception
+	 */
+	/**
+	 * @throws Exception
+	 */
+	@Test
+	public void testCreateChemicalListFromDB() throws Exception {
+		try {
+			// Parkinson disease
+			MiriamData meshID = new MiriamData(MiriamType.MESH_2012, "D004298");
+			MeSH mesh = meshParser.getMeSH(meshID);
+			assertTrue(mesh != null);
+			assertTrue(mesh.getMeSHId() != null);
+			assertTrue(mesh.getName() != null);
+			assertTrue(mesh.getName().toLowerCase().equals("dopamine"));
+			assertTrue(mesh.getDescription() != null);
+			assertTrue(mesh.getSynonyms().size() > 0);
+
+			// Rotenone disease -no synonyms
+			meshID = new MiriamData(MiriamType.MESH_2012, "D012402");
+			mesh = meshParser.getMeSH(meshID);
+			assertTrue(mesh != null);
+			assertTrue(mesh.getMeSHId() != null);
+			assertTrue(mesh.getName() != null);
+			assertTrue(mesh.getName().toLowerCase().equals("rotenone"));
+			assertTrue(mesh.getDescription() != null);
+			assertTrue(mesh.getSynonyms().size() == 0);
+
+			// One synonyms
+			meshID = new MiriamData(MiriamType.MESH_2012, "C503102");
+			mesh = meshParser.getMeSH(meshID);
+			assertTrue(mesh != null);
+			assertTrue(mesh.getMeSHId() != null);
+			assertTrue(mesh.getName() != null);
+			assertTrue(mesh.getName().toLowerCase().contains("1-(3-(2-(1-benzothiophen-5-yl) ethoxy) propyl)-3-azetidinol maleate"));
+			assertTrue(mesh.getDescription() != null);
+			assertTrue(mesh.getSynonyms().size() == 1);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetMEshWithNetworkProblems() throws Exception {
+		try {
+			// Parkinson disease
+			MiriamData meshID = new MiriamData(MiriamType.MESH_2012, "D004298");
+			MeSHParser parserUnderTest = new MeSHParser();
+			WebPageDownloader webPageDownloader = Mockito.mock(WebPageDownloader.class);
+			when(webPageDownloader.getFromNetwork(anyString())).thenThrow(new IOException());
+			parserUnderTest.setWebPageDownloader(webPageDownloader);
+
+			parserUnderTest.getMeSH(meshID);
+			fail("Exception expected");
+		} catch (AnnotatorException e) {
+			assertTrue(e.getMessage().contains("Problem with accessing MeSH database"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	/**
+	 * @throws Exception
+	 */
+	@Test
+	public void testExternalDBStatus() throws Exception {
+		ExternalServiceStatus status = meshParser.getServiceStatus();
+		logger.debug("Status of MeSH DB : " + status.getStatus().name());
+		assertTrue(status.getStatus().equals(ExternalServiceStatusType.OK));
+	}
+
+	@Test
+	public void testCachableInterfaceInvalidateChemical() throws Exception {
+		try {
+			MiriamData meshID = new MiriamData(MiriamType.MESH_2012, "D010300");
+			MeSH mesh = meshParser.getMeSH(meshID);
+			assertNotNull(mesh);
+
+			waitForRefreshCacheQueueToEmpty();
+
+			cache.invalidateByQuery(meshParser.getIdentifier(meshID), meshParser.getCacheType());
+
+			waitForRefreshCacheQueueToEmpty();
+
+			MeSH mesh2 = meshParser.getMeSH(meshID);
+			assertNotNull(mesh2);
+
+			assertFalse("Value wasn't refreshed from db", mesh.equals(mesh2));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCleanHtml() {
+		try {
+			String withouthHtml = meshParser.cleanHtml("<TD colspan=1>One of the catecholamine <A href=\"/cgi/mesh/2014/MB_cgi?mode=&term=NEUROTRANSMITTERS\">");
+			assertFalse(withouthHtml.contains("<"));
+			assertFalse(withouthHtml.contains(">"));
+			assertTrue(withouthHtml.contains("catecholamine"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testRefreshInvalidCacheQuery() throws Exception {
+		try {
+			meshParser.refreshCacheQuery("invalid_query");
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Don't know what to do"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRefreshInvalidCacheQuery2() throws Exception {
+		try {
+			meshParser.refreshCacheQuery(new Object());
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Don't know what to do"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRefreshInvalidCacheQuery3() throws Exception {
+		try {
+			String query = MeSHParser.MESH_PREFIX + "::::::";
+			meshParser.refreshCacheQuery(query);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Problematic query"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRefreshWhenProblemWithSourceDb() throws Exception {
+		WebPageDownloader downloader = meshParser.getWebPageDownloader();
+		GeneralCacheInterface cache = meshParser.getCache();
+		try {
+			meshParser.setCache(null);
+			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
+			when(mockDownloader.getFromNetwork(anyString())).thenThrow(new IOException());
+			meshParser.setWebPageDownloader(mockDownloader);
+
+			MiriamData meshID = new MiriamData(MiriamType.MESH_2012, "D010300");
+
+			meshParser.refreshCacheQuery(meshParser.getIdentifier(meshID));
+			fail("Exception expected");
+		} catch (SourceNotAvailable e) {
+			assertTrue(e.getMessage().contains("Problem with accessing Mesh database"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			meshParser.setWebPageDownloader(downloader);
+			meshParser.setCache(cache);
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MiRNASearchExceptionTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MiRNASearchExceptionTest.java
index 9e191033dc..7aa4e069c5 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MiRNASearchExceptionTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MiRNASearchExceptionTest.java
@@ -1,39 +1,39 @@
-package lcsb.mapviewer.annotation.services;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class MiRNASearchExceptionTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testConstructor1() {
-		MiRNASearchException exception = new MiRNASearchException(new IOException());
-		assertTrue(exception.getCause().getClass().equals(IOException.class));
-	}
-
-	@Test
-	public void testConstructor2() {
-		MiRNASearchException exception = new MiRNASearchException("xsd");
-		assertEquals("xsd", exception.getMessage());
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class MiRNASearchExceptionTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testConstructor1() {
+		MiRNASearchException exception = new MiRNASearchException(new IOException());
+		assertTrue(exception.getCause().getClass().equals(IOException.class));
+	}
+
+	@Test
+	public void testConstructor2() {
+		MiRNASearchException exception = new MiRNASearchException("xsd");
+		assertEquals("xsd", exception.getMessage());
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MiriamConnectorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MiriamConnectorTest.java
index ea66a41a87..8814930e8d 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MiriamConnectorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MiriamConnectorTest.java
@@ -1,382 +1,382 @@
-package lcsb.mapviewer.annotation.services;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.when;
-
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-import org.hibernate.AnnotationException;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.annotation.AnnotationTestFunctions;
-import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
-import lcsb.mapviewer.annotation.cache.GeneralCacheWithExclusion;
-import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
-import lcsb.mapviewer.annotation.cache.WebPageDownloader;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import uk.ac.ebi.miriam.lib.MiriamLink;
-
-public class MiriamConnectorTest extends AnnotationTestFunctions {
-	Logger								logger = Logger.getLogger(MiriamConnectorTest.class);
-
-	@Autowired
-	MiriamConnector				miriamConnector;
-
-	GeneralCacheInterface	cache;
-
-	@Before
-	public void setUp() throws Exception {
-		cache = miriamConnector.getCache();
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		miriamConnector.setCache(cache);
-	}
-
-	@Test
-	public void testGoUri() throws Exception {
-		try {
-			assertFalse(MiriamType.GO.getUris().size() == 1);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test(timeout = 15000)
-	public void testMeshUrl() throws Exception {
-		try {
-			// exclude first cached value
-			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
-			MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.MESH_2012, "D004249");
-
-			String pageContent = getWebpage(miriamConnector.getUrlString(md));
-			assertTrue(pageContent.contains("DNA Damage"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetUrl() throws Exception {
-		try {
-			// exclude first cached value
-			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
-			MiriamData md = TaxonomyBackend.HUMAN_TAXONOMY;
-
-			String url = miriamConnector.getUrlString(md);
-			assertNotNull(url);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetUrlForInvalidMiriam() throws Exception {
-		try {
-			miriamConnector.getUrlString(new MiriamData());
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Data type cannot be empty"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetUrlForInvalidMiriam2() throws Exception {
-		try {
-			miriamConnector.getUrlString(new MiriamData(MiriamType.UNKNOWN,""));
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("cannot be retreived"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetUrlForInvalidMiriam3() throws Exception {
-		try {
-			String url = miriamConnector.getUrlString(new MiriamData(MiriamType.ENTREZ,"abc"));
-			assertNull(url);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testIsValidIdentifier() throws Exception {
-		try {
-			assertTrue(miriamConnector.isValidIdentifier(MiriamType.ENTREZ.getCommonName()+":"+"1234"));
-			assertFalse(miriamConnector.isValidIdentifier("blablabla"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testResolveUrl() throws Exception {
-		try {
-			// exclude first cached value
-			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
-			for (MiriamType mt : MiriamType.values()) {
-				if (!MiriamType.UNKNOWN.equals(mt)) {
-					assertTrue("Invalid URI for MiriamType: " + mt, miriamConnector.isValid(mt.getUris().get(0)));
-				}
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRefresh() throws Exception {
-		String query = MiriamConnector.VALID_URI_PREFIX + MiriamType.HGNC.getUris().get(0);
-		try {
-			String res = miriamConnector.refreshCacheQuery(query);
-			assertNotNull(res);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRefresh2() throws Exception {
-		MiriamData md = TaxonomyBackend.HUMAN_TAXONOMY;
-		String query = MiriamConnector.LINK_DB_PREFIX + md.getDataType().getUris().get(0) + "\n" + md.getResource();
-		try {
-			String res = miriamConnector.refreshCacheQuery(query);
-			assertNotNull(res);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRefresh3() throws Exception {
-		try {
-			String res = miriamConnector.refreshCacheQuery("https://www.google.pl/");
-			assertNotNull(res);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetUrl2() throws Exception {
-		try {
-			// exclude first cached value
-			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
-			MiriamData md = TaxonomyBackend.HUMAN_TAXONOMY;
-
-			String url = miriamConnector.getUrlString2(md);
-			assertNotNull(url);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testMiriamDataToUri() throws Exception {
-		try {
-			assertNotNull(miriamConnector.miriamDataToUri(TaxonomyBackend.HUMAN_TAXONOMY));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetUrl2WithInvalidApiResponse() throws Exception {
-		WebPageDownloader downloader = miriamConnector.getWebPageDownloader();
-		GeneralCacheInterface cache = miriamConnector.getCache();
-		try {
-			// exclude first cached value
-			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
-			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
-			when(mockDownloader.getFromNetwork(anyString())).thenThrow(new IOException());
-			miriamConnector.setWebPageDownloader(mockDownloader);
-
-			miriamConnector.getUrlString2(TaxonomyBackend.HUMAN_TAXONOMY);
-
-		} catch (AnnotationException e) {
-			assertTrue(e.getMessage().contains("Problem with accessing miriam REST API"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			miriamConnector.setWebPageDownloader(downloader);
-			miriamConnector.setCache(cache);
-		}
-	}
-
-	@Test
-	public void testGetUrl2WithInvalidApiResponse2() throws Exception {
-		WebPageDownloader downloader = miriamConnector.getWebPageDownloader();
-		GeneralCacheInterface cache = miriamConnector.getCache();
-		try {
-			// exclude first cached value
-			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
-			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
-			when(mockDownloader.getFromNetwork(anyString())).thenReturn("");
-			miriamConnector.setWebPageDownloader(mockDownloader);
-
-			miriamConnector.getUrlString2(TaxonomyBackend.HUMAN_TAXONOMY);
-
-		} catch (AnnotationException e) {
-			assertTrue(e.getMessage().contains("Problem with parsing miriam REST API response"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			miriamConnector.setWebPageDownloader(downloader);
-			miriamConnector.setCache(cache);
-		}
-	}
-
-
-	@Test
-	public void testRefreshCacheQueryNotAvailable() throws Exception {
-		WebPageDownloader downloader = miriamConnector.getWebPageDownloader();
-		try {
-			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
-			when(mockDownloader.getFromNetwork(anyString())).thenThrow(new IOException());
-			miriamConnector.setWebPageDownloader(mockDownloader);
-			miriamConnector.refreshCacheQuery("http://google.pl/");
-			fail("Exception expected");
-		} catch (SourceNotAvailable e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			miriamConnector.setWebPageDownloader(downloader);
-		}
-	}
-
-	@Test
-	public void testRefreshInvalidCacheQuery() throws Exception {
-		try {
-			miriamConnector.refreshCacheQuery("invalid_query");
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Don't know what to do"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRefreshInvalidCacheQuery2() throws Exception {
-		try {
-			miriamConnector.refreshCacheQuery(new Object());
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Don't know what to do"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRefreshInvalidCacheQuery3() throws Exception {
-		try {
-			miriamConnector.refreshCacheQuery(MiriamConnector.LINK_DB_PREFIX);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Miriam link query is invalid"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCheckValidyOfEmptyUri() throws Exception {
-		try {
-			//user connector without cache
-			boolean value = new MiriamConnector().isValid("");
-			assertFalse(value);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testStatus() throws Exception {
-		try {
-			assertEquals(ExternalServiceStatusType.OK, miriamConnector.getServiceStatus().getStatus());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSimulateDownStatus() throws Exception {
-		MiriamLink link = miriamConnector.getLink();
-		try {
-			MiriamLink mockDownloader = Mockito.mock(MiriamLink.class);
-			when(mockDownloader.getLocations(any())).thenThrow(new InvalidStateException());
-			miriamConnector.setLink(mockDownloader);
-			assertEquals(ExternalServiceStatusType.DOWN, miriamConnector.getServiceStatus().getStatus());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			miriamConnector.setLink(link);
-		}
-	}
-
-	@Test
-	public void testSimulateDownStatus2() throws Exception {
-		MiriamLink link = miriamConnector.getLink();
-		try {
-			MiriamLink mockDownloader = Mockito.mock(MiriamLink.class);
-			when(mockDownloader.getLocations(any())).thenReturn(null);
-			miriamConnector.setLink(mockDownloader);
-			assertEquals(ExternalServiceStatusType.DOWN, miriamConnector.getServiceStatus().getStatus());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			miriamConnector.setLink(link);
-		}
-	}
-
-}
+package lcsb.mapviewer.annotation.services;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+import org.hibernate.AnnotationException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.annotation.AnnotationTestFunctions;
+import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
+import lcsb.mapviewer.annotation.cache.GeneralCacheWithExclusion;
+import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
+import lcsb.mapviewer.annotation.cache.WebPageDownloader;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import uk.ac.ebi.miriam.lib.MiriamLink;
+
+public class MiriamConnectorTest extends AnnotationTestFunctions {
+	Logger								logger = Logger.getLogger(MiriamConnectorTest.class);
+
+	@Autowired
+	MiriamConnector				miriamConnector;
+
+	GeneralCacheInterface	cache;
+
+	@Before
+	public void setUp() throws Exception {
+		cache = miriamConnector.getCache();
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		miriamConnector.setCache(cache);
+	}
+
+	@Test
+	public void testGoUri() throws Exception {
+		try {
+			assertFalse(MiriamType.GO.getUris().size() == 1);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test(timeout = 15000)
+	public void testMeshUrl() throws Exception {
+		try {
+			// exclude first cached value
+			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
+			MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.MESH_2012, "D004249");
+
+			String pageContent = getWebpage(miriamConnector.getUrlString(md));
+			assertTrue(pageContent.contains("DNA Damage"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetUrl() throws Exception {
+		try {
+			// exclude first cached value
+			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
+			MiriamData md = TaxonomyBackend.HUMAN_TAXONOMY;
+
+			String url = miriamConnector.getUrlString(md);
+			assertNotNull(url);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetUrlForInvalidMiriam() throws Exception {
+		try {
+			miriamConnector.getUrlString(new MiriamData());
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Data type cannot be empty"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetUrlForInvalidMiriam2() throws Exception {
+		try {
+			miriamConnector.getUrlString(new MiriamData(MiriamType.UNKNOWN,""));
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("cannot be retreived"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetUrlForInvalidMiriam3() throws Exception {
+		try {
+			String url = miriamConnector.getUrlString(new MiriamData(MiriamType.ENTREZ,"abc"));
+			assertNull(url);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testIsValidIdentifier() throws Exception {
+		try {
+			assertTrue(miriamConnector.isValidIdentifier(MiriamType.ENTREZ.getCommonName()+":"+"1234"));
+			assertFalse(miriamConnector.isValidIdentifier("blablabla"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testResolveUrl() throws Exception {
+		try {
+			// exclude first cached value
+			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
+			for (MiriamType mt : MiriamType.values()) {
+				if (!MiriamType.UNKNOWN.equals(mt)) {
+					assertTrue("Invalid URI for MiriamType: " + mt, miriamConnector.isValid(mt.getUris().get(0)));
+				}
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRefresh() throws Exception {
+		String query = MiriamConnector.VALID_URI_PREFIX + MiriamType.HGNC.getUris().get(0);
+		try {
+			String res = miriamConnector.refreshCacheQuery(query);
+			assertNotNull(res);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRefresh2() throws Exception {
+		MiriamData md = TaxonomyBackend.HUMAN_TAXONOMY;
+		String query = MiriamConnector.LINK_DB_PREFIX + md.getDataType().getUris().get(0) + "\n" + md.getResource();
+		try {
+			String res = miriamConnector.refreshCacheQuery(query);
+			assertNotNull(res);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRefresh3() throws Exception {
+		try {
+			String res = miriamConnector.refreshCacheQuery("https://www.google.pl/");
+			assertNotNull(res);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetUrl2() throws Exception {
+		try {
+			// exclude first cached value
+			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
+			MiriamData md = TaxonomyBackend.HUMAN_TAXONOMY;
+
+			String url = miriamConnector.getUrlString2(md);
+			assertNotNull(url);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testMiriamDataToUri() throws Exception {
+		try {
+			assertNotNull(miriamConnector.miriamDataToUri(TaxonomyBackend.HUMAN_TAXONOMY));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetUrl2WithInvalidApiResponse() throws Exception {
+		WebPageDownloader downloader = miriamConnector.getWebPageDownloader();
+		GeneralCacheInterface cache = miriamConnector.getCache();
+		try {
+			// exclude first cached value
+			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
+			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
+			when(mockDownloader.getFromNetwork(anyString())).thenThrow(new IOException());
+			miriamConnector.setWebPageDownloader(mockDownloader);
+
+			miriamConnector.getUrlString2(TaxonomyBackend.HUMAN_TAXONOMY);
+
+		} catch (AnnotationException e) {
+			assertTrue(e.getMessage().contains("Problem with accessing miriam REST API"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			miriamConnector.setWebPageDownloader(downloader);
+			miriamConnector.setCache(cache);
+		}
+	}
+
+	@Test
+	public void testGetUrl2WithInvalidApiResponse2() throws Exception {
+		WebPageDownloader downloader = miriamConnector.getWebPageDownloader();
+		GeneralCacheInterface cache = miriamConnector.getCache();
+		try {
+			// exclude first cached value
+			miriamConnector.setCache(new GeneralCacheWithExclusion(cache, 1));
+			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
+			when(mockDownloader.getFromNetwork(anyString())).thenReturn("");
+			miriamConnector.setWebPageDownloader(mockDownloader);
+
+			miriamConnector.getUrlString2(TaxonomyBackend.HUMAN_TAXONOMY);
+
+		} catch (AnnotationException e) {
+			assertTrue(e.getMessage().contains("Problem with parsing miriam REST API response"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			miriamConnector.setWebPageDownloader(downloader);
+			miriamConnector.setCache(cache);
+		}
+	}
+
+
+	@Test
+	public void testRefreshCacheQueryNotAvailable() throws Exception {
+		WebPageDownloader downloader = miriamConnector.getWebPageDownloader();
+		try {
+			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
+			when(mockDownloader.getFromNetwork(anyString())).thenThrow(new IOException());
+			miriamConnector.setWebPageDownloader(mockDownloader);
+			miriamConnector.refreshCacheQuery("http://google.pl/");
+			fail("Exception expected");
+		} catch (SourceNotAvailable e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			miriamConnector.setWebPageDownloader(downloader);
+		}
+	}
+
+	@Test
+	public void testRefreshInvalidCacheQuery() throws Exception {
+		try {
+			miriamConnector.refreshCacheQuery("invalid_query");
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Don't know what to do"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRefreshInvalidCacheQuery2() throws Exception {
+		try {
+			miriamConnector.refreshCacheQuery(new Object());
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Don't know what to do"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRefreshInvalidCacheQuery3() throws Exception {
+		try {
+			miriamConnector.refreshCacheQuery(MiriamConnector.LINK_DB_PREFIX);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Miriam link query is invalid"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCheckValidyOfEmptyUri() throws Exception {
+		try {
+			//user connector without cache
+			boolean value = new MiriamConnector().isValid("");
+			assertFalse(value);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testStatus() throws Exception {
+		try {
+			assertEquals(ExternalServiceStatusType.OK, miriamConnector.getServiceStatus().getStatus());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSimulateDownStatus() throws Exception {
+		MiriamLink link = miriamConnector.getLink();
+		try {
+			MiriamLink mockDownloader = Mockito.mock(MiriamLink.class);
+			when(mockDownloader.getLocations(any())).thenThrow(new InvalidStateException());
+			miriamConnector.setLink(mockDownloader);
+			assertEquals(ExternalServiceStatusType.DOWN, miriamConnector.getServiceStatus().getStatus());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			miriamConnector.setLink(link);
+		}
+	}
+
+	@Test
+	public void testSimulateDownStatus2() throws Exception {
+		MiriamLink link = miriamConnector.getLink();
+		try {
+			MiriamLink mockDownloader = Mockito.mock(MiriamLink.class);
+			when(mockDownloader.getLocations(any())).thenReturn(null);
+			miriamConnector.setLink(mockDownloader);
+			assertEquals(ExternalServiceStatusType.DOWN, miriamConnector.getServiceStatus().getStatus());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			miriamConnector.setLink(link);
+		}
+	}
+
+}
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MissingAnnotationTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MissingAnnotationTest.java
index c09b9977ad..6afdb47bb1 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MissingAnnotationTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MissingAnnotationTest.java
@@ -7,8 +7,8 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
 
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 
 public class MissingAnnotationTest {
 
@@ -26,7 +26,7 @@ public class MissingAnnotationTest {
 
 	@Test
 	public void test() {
-		MissingAnnotation annotation = new MissingAnnotation(new SpeciesAlias(new Species()));
+		MissingAnnotation annotation = new MissingAnnotation(new GenericProteinAlias(new GenericProtein()));
 		assertTrue(annotation.toString().contains("misses annotations"));
 	}
 
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MissingRequiredAnnotationsTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MissingRequiredAnnotationsTest.java
index f10a257d01..a5f48926e5 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/MissingRequiredAnnotationsTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/MissingRequiredAnnotationsTest.java
@@ -12,8 +12,8 @@ import org.junit.Test;
 
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 
 public class MissingRequiredAnnotationsTest {
 
@@ -32,7 +32,7 @@ public class MissingRequiredAnnotationsTest {
 	@Test
 	public void testConstructorWithInvalidParams() {
 		try {
-			new MissingRequiredAnnotations(new SpeciesAlias(), new ArrayList<>());
+			new MissingRequiredAnnotations(new GenericProteinAlias(null, null), new ArrayList<>());
 		} catch (InvalidArgumentException e) {
 			assertTrue(e.getMessage().contains("List of improper annotations cannot be null"));
 		}
@@ -43,7 +43,7 @@ public class MissingRequiredAnnotationsTest {
 		try {
 			List<MiriamType> list = new ArrayList<>();
 			list.add(MiriamType.CAS);
-			MissingRequiredAnnotations mre = new MissingRequiredAnnotations(new SpeciesAlias(new Species()), list);
+			MissingRequiredAnnotations mre = new MissingRequiredAnnotations(new GenericProteinAlias(new GenericProtein()), list);
 			assertTrue(mre.toString().contains("misses one of the following annotations"));
 		} catch (InvalidArgumentException e) {
 			assertTrue(e.getMessage().contains("List of improper annotations cannot be null"));
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ModelAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ModelAnnotatorTest.java
index 9dce60f1b8..e77140f462 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/ModelAnnotatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/ModelAnnotatorTest.java
@@ -34,6 +34,7 @@ import lcsb.mapviewer.model.map.Element;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamRelationType;
 import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelFullIndexed;
@@ -71,22 +72,22 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
 	public void testAnnotateModel() {
 		try {
 			Model model = new ModelFullIndexed(null);
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setName("SNCA");
 			protein.setElementId("id1");
 			model.addElement(protein);
 
-			Protein protein2 = new Protein();
+			GenericProtein protein2 = new GenericProtein();
 			protein2.setName("PDK1");
 			protein2.setElementId("id2");
 			protein2.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CAS, "c"));
 			model.addElement(protein2);
 			model.addReaction(new Reaction());
 			
-			SpeciesAlias proteinAlias1 = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias1 = new GenericProteinAlias(protein);
 			proteinAlias1.setAliasId("a1");
 			
-			SpeciesAlias proteinAlias2 = new SpeciesAlias(protein2);
+			SpeciesAlias proteinAlias2 = new GenericProteinAlias(protein2);
 			proteinAlias2.setAliasId("a2");
 			
 			model.addAlias(proteinAlias1);
@@ -107,12 +108,12 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
 	public void testAnnotateModelWithGivenAnnotators() {
 		try {
 			Model model = new ModelFullIndexed(null);
-			Protein species = new Protein();
+			Protein species = new GenericProtein();
 			species.setName("SNCA");
 			species.setElementId("id1");
 			model.addElement(species);
 
-			Protein species2 = new Protein();
+			Protein species2 = new GenericProtein();
 			species2.setName("PDK1");
 			species2.setElementId("id2");
 			species2.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CAS, "c"));
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ChebiAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ChebiAnnotatorTest.java
index 09cc9d16f3..d7524dddf6 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ChebiAnnotatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ChebiAnnotatorTest.java
@@ -28,6 +28,7 @@ import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamRelationType;
 import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.species.Chemical;
 import lcsb.mapviewer.model.map.species.SimpleMolecule;
@@ -318,16 +319,16 @@ public class ChebiAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testAnnotateChemical() throws Exception {
 		try {
-			Chemical chemical = new SimpleMolecule();
-			chemical.setName("water");
+			SimpleMolecule simpleMolecule = new SimpleMolecule();
+			simpleMolecule.setName("water");
 
-			backend.annotateElement(new SpeciesAlias(chemical));
+			backend.annotateElement(new SimpleMoleculeAlias(simpleMolecule));
 
-			assertFalse(chemical.getFullName().equals(""));
-			assertFalse(chemical.getInChI().equals(""));
-			assertFalse(chemical.getInChIKey().equals(""));
-			assertFalse(chemical.getSmiles().equals(""));
-			assertFalse(chemical.getSynonyms().size() == 0);
+			assertFalse(simpleMolecule.getFullName().equals(""));
+			assertFalse(simpleMolecule.getInChI().equals(""));
+			assertFalse(simpleMolecule.getInChIKey().equals(""));
+			assertFalse(simpleMolecule.getSmiles().equals(""));
+			assertFalse(simpleMolecule.getSynonyms().size() == 0);
 
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -338,8 +339,8 @@ public class ChebiAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testAnnotateWhenConnectionFails() throws Exception {
 		try {
-			Chemical chemical = new SimpleMolecule();
-			chemical.setName("water");
+			SimpleMolecule simpleMolecule = new SimpleMolecule();
+			simpleMolecule.setName("water");
 
 			ChebiWebServiceClient chebiWebServiceClient = Mockito.mock(ChebiWebServiceClient.class);
 
@@ -357,7 +358,7 @@ public class ChebiAnnotatorTest extends AnnotationTestFunctions {
 			backend.setClient(chebiWebServiceClient);
 
 			backend.setCache(null);
-			backend.annotateElement(new SpeciesAlias(chemical));
+			backend.annotateElement(new SimpleMoleculeAlias(simpleMolecule));
 
 			fail("Exceptione expected");
 		} catch (AnnotatorException e) {
@@ -374,10 +375,10 @@ public class ChebiAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testAnnotateChemicalWithInvalidName() throws Exception {
 		try {
-			Chemical chemical = new SimpleMolecule();
-			chemical.setName("blasdh");
+			SimpleMolecule simpleMolecule = new SimpleMolecule();
+			simpleMolecule.setName("blasdh");
 
-			backend.annotateElement(new SpeciesAlias(chemical));
+			backend.annotateElement(new SimpleMoleculeAlias(simpleMolecule));
 
 			assertEquals(1, getWarnings().size());
 
@@ -390,17 +391,17 @@ public class ChebiAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testUpdateChemicalFromDb() throws Exception {
 		try {
-			Chemical chemical = new SimpleMolecule();
-			chemical.setName("water");
-			chemical.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "CHEBI:15377"));
+			SimpleMolecule simpleMolecule = new SimpleMolecule();
+			simpleMolecule.setName("water");
+			simpleMolecule.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "CHEBI:15377"));
 
-			backend.annotateElement(new SpeciesAlias(chemical));
+			backend.annotateElement(new SimpleMoleculeAlias(simpleMolecule));
 
-			assertFalse("".equals(chemical.getFullName()));
-			assertFalse(chemical.getInChI().equals(""));
-			assertFalse(chemical.getInChIKey().equals(""));
-			assertFalse(chemical.getSmiles().equals(""));
-			assertFalse(chemical.getSynonyms().size() == 0);
+			assertFalse("".equals(simpleMolecule.getFullName()));
+			assertFalse(simpleMolecule.getInChI().equals(""));
+			assertFalse(simpleMolecule.getInChIKey().equals(""));
+			assertFalse(simpleMolecule.getSmiles().equals(""));
+			assertFalse(simpleMolecule.getSynonyms().size() == 0);
 
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -411,16 +412,16 @@ public class ChebiAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testUpdateChemicalFromDbWithDifferentData() throws Exception {
 		try {
-			Chemical chemical = new SimpleMolecule();
-			chemical.setName("water");
-			chemical.setFullName("xxx");
-			chemical.setInChI("x");
-			chemical.setInChIKey("x");
-			chemical.setSmiles("x");
-			chemical.addSynonym("x");
-			chemical.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "CHEBI:15377"));
+			SimpleMolecule simpleMolecule = new SimpleMolecule();
+			simpleMolecule.setName("water");
+			simpleMolecule.setFullName("xxx");
+			simpleMolecule.setInChI("x");
+			simpleMolecule.setInChIKey("x");
+			simpleMolecule.setSmiles("x");
+			simpleMolecule.addSynonym("x");
+			simpleMolecule.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "CHEBI:15377"));
 
-			backend.annotateElement(new SpeciesAlias(chemical));
+			backend.annotateElement(new SimpleMoleculeAlias(simpleMolecule));
 
 			assertEquals(5, getWarnings().size());
 
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ElementAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ElementAnnotatorTest.java
index 5e6019ac4d..1c3e0b8e95 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ElementAnnotatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ElementAnnotatorTest.java
@@ -12,8 +12,10 @@ import lcsb.mapviewer.annotation.AnnotationTestFunctions;
 import lcsb.mapviewer.annotation.cache.CachableInterface;
 import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
 import lcsb.mapviewer.model.map.AnnotatedObject;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Ion;
 import lcsb.mapviewer.model.map.species.Species;
 
@@ -60,10 +62,10 @@ public class ElementAnnotatorTest extends AnnotationTestFunctions {
 	}
 
 	@Test
-	public void testSetNotMathcingSymbol() {
-		Species species = new Species();
+	public void testSetNotMatchingSymbol() {
+		GenericProtein species = new GenericProtein();
 		species.setSymbol("X");
-		SpeciesAlias speciesAlias = new SpeciesAlias(species);
+		GenericProteinAlias speciesAlias = new GenericProteinAlias(species);
 		annotator.setSymbol(speciesAlias, "Y", null);
 
 		assertEquals(1, getWarnings().size());
@@ -80,9 +82,9 @@ public class ElementAnnotatorTest extends AnnotationTestFunctions {
 
 	@Test
 	public void testSetNotMatchingNotes() {
-		Species species = new Species();
+		GenericProtein species = new GenericProtein();
 		species.setNotes("X");
-		SpeciesAlias speciesAlias = new SpeciesAlias(species);
+		GenericProteinAlias speciesAlias = new GenericProteinAlias(species);
 		annotator.setDescription(speciesAlias, "Y");
 
 		assertEquals(0, getWarnings().size());
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/EnsemblAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/EnsemblAnnotatorTest.java
index 013debe583..fa62f51d7d 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/EnsemblAnnotatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/EnsemblAnnotatorTest.java
@@ -26,6 +26,7 @@ import lcsb.mapviewer.annotation.services.WrongResponseCodeIOException;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Species;
@@ -49,7 +50,7 @@ public class EnsemblAnnotatorTest extends AnnotationTestFunctions {
 			MiriamData nsmf = new MiriamData(MiriamType.ENSEMBL, "ENSG00000157764");
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(nsmf);
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			ensemblAnnotator.annotateElement(proteinAlias);
 			assertNotNull(protein.getSymbol());
 			assertNotNull(protein.getFullName());
@@ -93,7 +94,7 @@ public class EnsemblAnnotatorTest extends AnnotationTestFunctions {
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(nsmf);
 			protein.addMiriamData(nsmf1);
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			ensemblAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(1, getWarnings().size());
@@ -108,7 +109,7 @@ public class EnsemblAnnotatorTest extends AnnotationTestFunctions {
 	public void testGetAnnotationsWhenNoIdFound() throws Exception {
 		try {
 			GenericProtein protein = new GenericProtein();
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			ensemblAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(1, getWarnings().size());
@@ -125,7 +126,7 @@ public class EnsemblAnnotatorTest extends AnnotationTestFunctions {
 			MiriamData nsmf = new MiriamData(MiriamType.ENSEMBL, "blabla");
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(nsmf);
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			ensemblAnnotator.annotateElement(proteinAlias);
 
 			assertEquals("There should be warning about invalid ensembl identifier", 1, getWarnings().size());
@@ -286,9 +287,9 @@ public class EnsemblAnnotatorTest extends AnnotationTestFunctions {
 			WebPageDownloader mockDownloader = Mockito.mock(WebPageDownloader.class);
 			when(mockDownloader.getFromNetwork(anyString())).thenThrow(new WrongResponseCodeIOException(null, 0));
 			ensemblAnnotator.setWebPageDownloader(mockDownloader);
-			Species element = new GenericProtein();
+			GenericProtein element = new GenericProtein();
 			element.addMiriamData(new MiriamData(MiriamType.ENSEMBL, "1234"));
-			SpeciesAlias proteinAlias = new SpeciesAlias(element);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(element);
 			ensemblAnnotator.annotateElement(proteinAlias);
 			fail("Exception expected");
 		} catch (AnnotatorException e) {
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/EntrezAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/EntrezAnnotatorTest.java
index 90a81413d5..d0e86237ac 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/EntrezAnnotatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/EntrezAnnotatorTest.java
@@ -30,6 +30,7 @@ import lcsb.mapviewer.annotation.services.WrongResponseCodeIOException;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.species.GenericProtein;
 
@@ -52,7 +53,7 @@ public class EntrezAnnotatorTest extends AnnotationTestFunctions {
 			MiriamData nsmf = new MiriamData(MiriamType.ENTREZ, "84532");
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(nsmf);
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			entrezAnnotator.annotateElement(proteinAlias);
 			assertNotNull(protein.getSymbol());
 			assertNotNull(protein.getFullName());
@@ -90,7 +91,7 @@ public class EntrezAnnotatorTest extends AnnotationTestFunctions {
 			MiriamData nsmf = new MiriamData(MiriamType.ENTREZ, "blabla");
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(nsmf);
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			entrezAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(1, getWarnings().size());
@@ -313,7 +314,7 @@ public class EntrezAnnotatorTest extends AnnotationTestFunctions {
 	public void testAnnotateElementWithoutId() throws Exception {
 		try {
 			GenericProtein protein = new GenericProtein();
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			entrezAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(1, getWarnings().size());
@@ -330,7 +331,7 @@ public class EntrezAnnotatorTest extends AnnotationTestFunctions {
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(new MiriamData(MiriamType.ENTREZ, "6647"));
 			protein.addMiriamData(new MiriamData(MiriamType.ENTREZ, "6648"));
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			entrezAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(1, getWarnings().size());
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/HgncAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/HgncAnnotatorTest.java
index 28d8a2c8cb..041ded3c7a 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/HgncAnnotatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/HgncAnnotatorTest.java
@@ -18,6 +18,7 @@ import lcsb.mapviewer.annotation.AnnotationTestFunctions;
 import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.species.GenericProtein;
 
@@ -42,7 +43,7 @@ public class HgncAnnotatorTest extends AnnotationTestFunctions {
 			MiriamData nsmf = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(nsmf);
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			hgncAnnotator.annotateElement(proteinAlias);
 			assertNotNull(protein.getSymbol());
 			assertTrue(protein.getFormerSymbols().size() > 0);
@@ -92,7 +93,7 @@ public class HgncAnnotatorTest extends AnnotationTestFunctions {
 			MiriamData nsmf = new MiriamData(MiriamType.HGNC, "11138");
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(nsmf);
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			hgncAnnotator.annotateElement(proteinAlias);
 			assertNotNull(protein.getSymbol());
 			assertTrue(protein.getFormerSymbols().size() > 0);
@@ -136,7 +137,7 @@ public class HgncAnnotatorTest extends AnnotationTestFunctions {
 		try {
 			GenericProtein protein = new GenericProtein();
 			protein.setName("SNCA");
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProteinAlias proteinAlias = new GenericProteinAlias(protein);
 			hgncAnnotator.annotateElement(proteinAlias);
 			assertNotNull(protein.getSymbol());
 			assertNotNull(protein.getName());
@@ -181,7 +182,7 @@ public class HgncAnnotatorTest extends AnnotationTestFunctions {
 		try {
 			GenericProtein protein = new GenericProtein();
 			protein.setName("UNKNNOWNASD asd");
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			hgncAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(1, getWarnings().size());
@@ -197,7 +198,7 @@ public class HgncAnnotatorTest extends AnnotationTestFunctions {
 		try {
 			GenericProtein protein = new GenericProtein();
 			protein.setName("cAMP/cGMP-dependent protein kinase");
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			hgncAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(1, getWarnings().size());
@@ -253,7 +254,7 @@ public class HgncAnnotatorTest extends AnnotationTestFunctions {
 			GenericProtein protein = new GenericProtein();
 			protein.addMiriamData(md1);
 			protein.addMiriamData(md2);
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			hgncAnnotator.annotateElement(proteinAlias);
 			assertEquals(1, getWarnings().size());
 			assertEquals("SNCA", protein.getName());
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ReconAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ReconAnnotatorTest.java
index 6c67b162ed..5472923d14 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ReconAnnotatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/ReconAnnotatorTest.java
@@ -21,6 +21,7 @@ import lcsb.mapviewer.annotation.AnnotationTestFunctions;
 import lcsb.mapviewer.annotation.cache.WebPageDownloader;
 import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.species.SimpleMolecule;
@@ -57,7 +58,7 @@ public class ReconAnnotatorTest extends AnnotationTestFunctions {
 		try {
 			SimpleMolecule smallMolecule = new SimpleMolecule();
 			smallMolecule.setAbbreviation("h2o");
-			SpeciesAlias smallMoleculeAlias = new SpeciesAlias(smallMolecule);
+			SimpleMoleculeAlias smallMoleculeAlias = new SimpleMoleculeAlias(smallMolecule);
 			reconAnnotator.annotateElement(smallMoleculeAlias);
 			assertTrue("No new annotations from recon db imported", smallMolecule.getMiriamData().size() > 0);
 			assertEquals(0, getWarnings().size());
@@ -72,7 +73,7 @@ public class ReconAnnotatorTest extends AnnotationTestFunctions {
 		try {
 			SimpleMolecule smallMolecule = new SimpleMolecule();
 			smallMolecule.setAbbreviation("P5CRm");
-			SpeciesAlias smallMoleculeAlias = new SpeciesAlias(smallMolecule);
+			SpeciesAlias smallMoleculeAlias = new SimpleMoleculeAlias(smallMolecule);
 			reconAnnotator.annotateElement(smallMoleculeAlias);
 			assertEquals(0, smallMolecule.getMiriamData().size());
 			assertFalse(getWarnings().size() == 0);
diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java
index 41304c4ae2..c97bb9f369 100644
--- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java
+++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java
@@ -21,13 +21,14 @@ import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 
 public class UniprotAnnotatorTest extends AnnotationTestFunctions {
 
 	@Autowired
-	UniprotAnnotator	uniprotAnnotator;
+	UniprotAnnotator uniprotAnnotator;
 
 	@Before
 	public void setUp() throws Exception {
@@ -40,10 +41,10 @@ public class UniprotAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testAnnotate1() throws Exception {
 		try {
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setName("P01308");
 
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			uniprotAnnotator.annotateElement(proteinAlias);
 
 			assertTrue(protein.getMiriamData().size() > 0);
@@ -75,10 +76,10 @@ public class UniprotAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testAnnotate2() throws Exception {
 		try {
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setName("bla");
 			protein.addMiriamData(new MiriamData(MiriamType.UNIPROT, "P01308"));
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			uniprotAnnotator.annotateElement(proteinAlias);
 
 			assertTrue(protein.getMiriamData().size() > 1);
@@ -110,10 +111,10 @@ public class UniprotAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testAnnotateInvalidUniprot() throws Exception {
 		try {
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setName("bla");
 			protein.addMiriamData(new MiriamData(MiriamType.UNIPROT, "bla"));
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			uniprotAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(1, protein.getMiriamData().size());
@@ -130,9 +131,9 @@ public class UniprotAnnotatorTest extends AnnotationTestFunctions {
 	@Test
 	public void testAnnotateInvalid() throws Exception {
 		try {
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setName("bla");
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			uniprotAnnotator.annotateElement(proteinAlias);
 
 			assertEquals(0, protein.getMiriamData().size());
@@ -232,6 +233,7 @@ public class UniprotAnnotatorTest extends AnnotationTestFunctions {
 			uniprotAnnotator.setWebPageDownloader(downloader);
 		}
 	}
+
 	@Test
 	public void testSimulateChangedStatus() throws Exception {
 		WebPageDownloader downloader = uniprotAnnotator.getWebPageDownloader();
diff --git a/commons/src/main/java/lcsb/mapviewer/common/geometry/LineTransformation.java b/commons/src/main/java/lcsb/mapviewer/common/geometry/LineTransformation.java
index b701a0387f..89dc7109f7 100644
--- a/commons/src/main/java/lcsb/mapviewer/common/geometry/LineTransformation.java
+++ b/commons/src/main/java/lcsb/mapviewer/common/geometry/LineTransformation.java
@@ -1,199 +1,199 @@
-package lcsb.mapviewer.common.geometry;
-
-import java.awt.geom.Line2D;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-
-import lcsb.mapviewer.common.Configuration;
-
-import org.apache.log4j.Logger;
-
-/**
- * Class with basic operators on lines.
- * 
- * @author Piotr Gawron
- * 
- */
-public class LineTransformation {
-
-	/**
-	 * Which value in the PathIterartor segment information array corrsepond to X
-	 * coordinate in the cubicTo type.
-	 */
-	private static final int	SEG_CUBICTO_END_Y_COORDINATE_INDEX		= 5;
-	/**
-	 * Which value in the PathIterartor segment information array corrsepond to Y
-	 * coordinate in the cubicTo type.
-	 */
-	private static final int	SEG_CUBICTO_END_X_COORDINATE_INDEX		= 4;
-	/**
-	 * Length of the PathIterartor segment information array.
-	 */
-	private static final int	PATH_ITERATOR_COORDINATES_STRUCT_SIZE	= 6;
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger			logger																= Logger.getLogger(LineTransformation.class.getName());
-
-	/**
-	 * Returns a cross point between path and a line.
-	 * 
-	 * @param line
-	 *          line for which we are looking for the intersection
-	 * @param pi
-	 *          PathIterator for which we are looking for the intersection
-	 * @return point of intersection beteewn path and line if the points doesn't
-	 *         exist then null is returned
-	 */
-	public Point2D getIntersectionWithPathIterator(final Line2D line, final PathIterator pi) {
-		if (pi == null) {
-			return null;
-		}
-		double[] coordinates = new double[PATH_ITERATOR_COORDINATES_STRUCT_SIZE];
-		Point2D first = null;
-		Point2D last = null;
-		Point2D actual = null;
-		while (!pi.isDone()) {
-			int type = pi.currentSegment(coordinates);
-			last = actual;
-			actual = new Point2D.Double(coordinates[0], coordinates[1]);
-			switch (type) {
-				case PathIterator.SEG_MOVETO:
-					break;
-				case PathIterator.SEG_LINETO:
-					break;
-				case PathIterator.SEG_QUADTO:
-					break;
-				case PathIterator.SEG_CUBICTO:
-
-					// in case when there is an arc we define only end points of the arc
-					// as a border
-					actual = new Point2D.Double(coordinates[SEG_CUBICTO_END_X_COORDINATE_INDEX], coordinates[SEG_CUBICTO_END_Y_COORDINATE_INDEX]);
-					break;
-				case PathIterator.SEG_CLOSE:
-					actual = first;
-					break;
-				default:
-					break;
-			}
-			if (first == null) {
-				first = actual;
-
-				// check if the two following points are not the same (this could cause
-				// NaN values)
-			} else if (last.distance(actual) > Configuration.EPSILON) {
-				double x1 = last.getX();
-				double y1 = last.getY();
-				double x2 = actual.getX();
-				double y2 = actual.getY();
-				double x3 = line.getX1();
-				double y3 = line.getY1();
-				double x4 = line.getX2();
-				double y4 = line.getY2();
-				if (Line2D.linesIntersect(x1, y1, x2, y2, x3, y3, x4, y4)) {
-					double d = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
-					double xi = ((x3 - x4) * (x1 * y2 - y1 * x2) - (x1 - x2) * (x3 * y4 - y3 * x4)) / d;
-					double yi = ((y3 - y4) * (x1 * y2 - y1 * x2) - (y1 - y2) * (x3 * y4 - y3 * x4)) / d;
-					return new Point2D.Double(xi, yi);
-				}
-			}
-
-			pi.next();
-		}
-		return null;
-	}
-
-	/**
-	 * Returns a distance between line segment and a point.
-	 * 
-	 * @param line
-	 *          line segment to which we are looking the shortest distance
-	 * @param point
-	 *          point from which are looking the shortest distance
-	 * @return distance between line and a point
-	 */
-	public double distBetweenPointAndLineSegment(final Line2D line, final Point2D point) {
-		return distBetweenPointAndLineSegment(line.getP1(), line.getP2(), point);
-	}
-
-	/**
-	 * Returns a distance between line segment (defined by v and w points) and a
-	 * point.
-	 * 
-	 * @param v
-	 *          start point of the line
-	 * @param w
-	 *          end point of the line
-	 * @param point
-	 *          point from which we want to find a distance
-	 * @return distance between point and line segment
-	 */
-	public double distBetweenPointAndLineSegment(final Point2D v, final Point2D w, final Point2D point) {
-		// Return minimum distance between line segment vw and point p
-		double l2 = v.distanceSq(w); // i.e. |w-v|^2 - avoid a sqrt
-		if (l2 == 0.0) {
-			return point.distance(v); // v == w case
-		}
-		// Consider the line extending the segment, parameterized as v + t (w - v).
-		// We find projection of point p onto the line.
-		// It falls where t = [(p-v) . (w-v)] / |w-v|^2
-		double t = ((point.getX() - v.getX()) * (w.getX() - v.getX()) + (point.getY() - v.getY()) * (w.getY() - v.getY())) / l2;
-		if (t < 0.0) {
-			return point.distance(v); // Beyond the 'v' end of the segment
-		} else if (t > 1.0) {
-			return point.distance(w); // Beyond the 'w' end of the segment
-		}
-		// Projection falls on the segment
-		return point.distance(v.getX() + t * (w.getX() - v.getX()), v.getY() + t * (w.getY() - v.getY()));
-	}
-
-	/**
-	 * Returns a point that is on the line and is as close as possible to the
-	 * point.
-	 * 
-	 * @param line
-	 *          line on which the point should be found
-	 * @param point
-	 *          point to which the result should be as close as possible
-	 * @return point on the line that is as close as possible to the parameter
-	 *         point
-	 */
-	public Point2D closestPointOnSegmentLineToPoint(final Line2D line, final Point2D point) {
-		Point2D result = closestPointOnSegmentLineToPoint(line.getP1(), line.getP2(), point);
-		return result;
-	}
-
-	/**
-	 * Returns a point that is on the line (v-w) and is as close as possible to
-	 * the point.
-	 * 
-	 * @param v
-	 *          start of the line segment
-	 * @param w
-	 *          end of the line segment
-	 * @param p
-	 *          point to which the result should be as close as possible
-	 * @return point on the line (v-w) that is as close as possible to the
-	 *         parameter point
-	 */
-	public Point2D closestPointOnSegmentLineToPoint(final Point2D v, final Point2D w, final Point2D p) {
-		// Return minimum distance between line segment vw and point p
-		double l2 = v.distanceSq(w); // i.e. |w-v|^2 - avoid a sqrt
-		if (l2 == 0.0) {
-			return v; // v == w case
-		}
-		// Consider the line extending the segment, parameterized as v + t (w - v).
-		// We find projection of point p onto the line.
-		// It falls where t = [(p-v) . (w-v)] / |w-v|^2
-		double t = ((p.getX() - v.getX()) * (w.getX() - v.getX()) + (p.getY() - v.getY()) * (w.getY() - v.getY())) / l2;
-		if (t < 0.0) {
-			return v; // Beyond the 'v' end of the segment
-		} else if (t > 1.0) {
-			return w; // Beyond the 'w' end of the segment
-		}
-		// Projection falls on the segment
-		return new Point2D.Double(v.getX() + t * (w.getX() - v.getX()), v.getY() + t * (w.getY() - v.getY()));
-	}
-
-}
+package lcsb.mapviewer.common.geometry;
+
+import java.awt.geom.Line2D;
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+
+import lcsb.mapviewer.common.Configuration;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Class with basic operators on lines.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class LineTransformation {
+
+	/**
+	 * Which value in the PathIterartor segment information array corrsepond to X
+	 * coordinate in the cubicTo type.
+	 */
+	private static final int	SEG_CUBICTO_END_Y_COORDINATE_INDEX		= 5;
+	/**
+	 * Which value in the PathIterartor segment information array corrsepond to Y
+	 * coordinate in the cubicTo type.
+	 */
+	private static final int	SEG_CUBICTO_END_X_COORDINATE_INDEX		= 4;
+	/**
+	 * Length of the PathIterartor segment information array.
+	 */
+	private static final int	PATH_ITERATOR_COORDINATES_STRUCT_SIZE	= 6;
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger			logger																= Logger.getLogger(LineTransformation.class.getName());
+
+	/**
+	 * Returns a cross point between path and a line.
+	 * 
+	 * @param line
+	 *          line for which we are looking for the intersection
+	 * @param pi
+	 *          PathIterator for which we are looking for the intersection
+	 * @return point of intersection beteewn path and line if the points doesn't
+	 *         exist then null is returned
+	 */
+	public Point2D getIntersectionWithPathIterator(final Line2D line, final PathIterator pi) {
+		if (pi == null) {
+			return null;
+		}
+		double[] coordinates = new double[PATH_ITERATOR_COORDINATES_STRUCT_SIZE];
+		Point2D first = null;
+		Point2D last = null;
+		Point2D actual = null;
+		while (!pi.isDone()) {
+			int type = pi.currentSegment(coordinates);
+			last = actual;
+			actual = new Point2D.Double(coordinates[0], coordinates[1]);
+			switch (type) {
+				case PathIterator.SEG_MOVETO:
+					break;
+				case PathIterator.SEG_LINETO:
+					break;
+				case PathIterator.SEG_QUADTO:
+					break;
+				case PathIterator.SEG_CUBICTO:
+
+					// in case when there is an arc we define only end points of the arc
+					// as a border
+					actual = new Point2D.Double(coordinates[SEG_CUBICTO_END_X_COORDINATE_INDEX], coordinates[SEG_CUBICTO_END_Y_COORDINATE_INDEX]);
+					break;
+				case PathIterator.SEG_CLOSE:
+					actual = first;
+					break;
+				default:
+					break;
+			}
+			if (first == null) {
+				first = actual;
+
+				// check if the two following points are not the same (this could cause
+				// NaN values)
+			} else if (last.distance(actual) > Configuration.EPSILON) {
+				double x1 = last.getX();
+				double y1 = last.getY();
+				double x2 = actual.getX();
+				double y2 = actual.getY();
+				double x3 = line.getX1();
+				double y3 = line.getY1();
+				double x4 = line.getX2();
+				double y4 = line.getY2();
+				if (Line2D.linesIntersect(x1, y1, x2, y2, x3, y3, x4, y4)) {
+					double d = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
+					double xi = ((x3 - x4) * (x1 * y2 - y1 * x2) - (x1 - x2) * (x3 * y4 - y3 * x4)) / d;
+					double yi = ((y3 - y4) * (x1 * y2 - y1 * x2) - (y1 - y2) * (x3 * y4 - y3 * x4)) / d;
+					return new Point2D.Double(xi, yi);
+				}
+			}
+
+			pi.next();
+		}
+		return null;
+	}
+
+	/**
+	 * Returns a distance between line segment and a point.
+	 * 
+	 * @param line
+	 *          line segment to which we are looking the shortest distance
+	 * @param point
+	 *          point from which are looking the shortest distance
+	 * @return distance between line and a point
+	 */
+	public double distBetweenPointAndLineSegment(final Line2D line, final Point2D point) {
+		return distBetweenPointAndLineSegment(line.getP1(), line.getP2(), point);
+	}
+
+	/**
+	 * Returns a distance between line segment (defined by v and w points) and a
+	 * point.
+	 * 
+	 * @param v
+	 *          start point of the line
+	 * @param w
+	 *          end point of the line
+	 * @param point
+	 *          point from which we want to find a distance
+	 * @return distance between point and line segment
+	 */
+	public double distBetweenPointAndLineSegment(final Point2D v, final Point2D w, final Point2D point) {
+		// Return minimum distance between line segment vw and point p
+		double l2 = v.distanceSq(w); // i.e. |w-v|^2 - avoid a sqrt
+		if (l2 == 0.0) {
+			return point.distance(v); // v == w case
+		}
+		// Consider the line extending the segment, parameterized as v + t (w - v).
+		// We find projection of point p onto the line.
+		// It falls where t = [(p-v) . (w-v)] / |w-v|^2
+		double t = ((point.getX() - v.getX()) * (w.getX() - v.getX()) + (point.getY() - v.getY()) * (w.getY() - v.getY())) / l2;
+		if (t < 0.0) {
+			return point.distance(v); // Beyond the 'v' end of the segment
+		} else if (t > 1.0) {
+			return point.distance(w); // Beyond the 'w' end of the segment
+		}
+		// Projection falls on the segment
+		return point.distance(v.getX() + t * (w.getX() - v.getX()), v.getY() + t * (w.getY() - v.getY()));
+	}
+
+	/**
+	 * Returns a point that is on the line and is as close as possible to the
+	 * point.
+	 * 
+	 * @param line
+	 *          line on which the point should be found
+	 * @param point
+	 *          point to which the result should be as close as possible
+	 * @return point on the line that is as close as possible to the parameter
+	 *         point
+	 */
+	public Point2D closestPointOnSegmentLineToPoint(final Line2D line, final Point2D point) {
+		Point2D result = closestPointOnSegmentLineToPoint(line.getP1(), line.getP2(), point);
+		return result;
+	}
+
+	/**
+	 * Returns a point that is on the line (v-w) and is as close as possible to
+	 * the point.
+	 * 
+	 * @param v
+	 *          start of the line segment
+	 * @param w
+	 *          end of the line segment
+	 * @param p
+	 *          point to which the result should be as close as possible
+	 * @return point on the line (v-w) that is as close as possible to the
+	 *         parameter point
+	 */
+	public Point2D closestPointOnSegmentLineToPoint(final Point2D v, final Point2D w, final Point2D p) {
+		// Return minimum distance between line segment vw and point p
+		double l2 = v.distanceSq(w); // i.e. |w-v|^2 - avoid a sqrt
+		if (l2 == 0.0) {
+			return v; // v == w case
+		}
+		// Consider the line extending the segment, parameterized as v + t (w - v).
+		// We find projection of point p onto the line.
+		// It falls where t = [(p-v) . (w-v)] / |w-v|^2
+		double t = ((p.getX() - v.getX()) * (w.getX() - v.getX()) + (p.getY() - v.getY()) * (w.getY() - v.getY())) / l2;
+		if (t < 0.0) {
+			return v; // Beyond the 'v' end of the segment
+		} else if (t > 1.0) {
+			return w; // Beyond the 'w' end of the segment
+		}
+		// Projection falls on the segment
+		return new Point2D.Double(v.getX() + t * (w.getX() - v.getX()), v.getY() + t * (w.getY() - v.getY()));
+	}
+
+}
diff --git a/console/src/main/java/lcsb/mapviewer/run/ConsoleConverter.java b/console/src/main/java/lcsb/mapviewer/run/ConsoleConverter.java
index ffe85ab03a..c0b76acea0 100644
--- a/console/src/main/java/lcsb/mapviewer/run/ConsoleConverter.java
+++ b/console/src/main/java/lcsb/mapviewer/run/ConsoleConverter.java
@@ -18,16 +18,17 @@ import org.apache.log4j.Logger;
 import lcsb.mapviewer.annotation.services.MiriamConnector;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.converter.InvalidInputDataExecption;
 import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
 import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.AnnotatedObject;
 import lcsb.mapviewer.model.map.Element;
 import lcsb.mapviewer.model.map.InconsistentModelException;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.agregator.Compartment;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelFullIndexed;
@@ -36,6 +37,7 @@ import lcsb.mapviewer.model.map.reaction.Modifier;
 import lcsb.mapviewer.model.map.reaction.Product;
 import lcsb.mapviewer.model.map.reaction.Reactant;
 import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Species;
 import lcsb.mapviewer.modelutils.map.ElementUtils;
 
@@ -51,7 +53,7 @@ public class ConsoleConverter {
 	/**
 	 * Default class logger.
 	 */
-	private final Logger		logger				= Logger.getLogger(ConsoleConverter.class);
+	private final Logger		logger			 = Logger.getLogger(ConsoleConverter.class);
 
 	/**
 	 * Options from the input.
@@ -61,12 +63,12 @@ public class ConsoleConverter {
 	/**
 	 * Connector used for accessing data from miriam registry.
 	 */
-	private MiriamConnector	mc = new MiriamConnector();
+	private MiriamConnector	mc					 = new MiriamConnector();
 
 	/**
 	 * Util class used to access some information about {@link Element}.
 	 */
-	private ElementUtils		elementUtils	= new ElementUtils();
+	private ElementUtils		elementUtils = new ElementUtils();
 
 	/**
 	 * Default constructor.
@@ -85,9 +87,9 @@ public class ConsoleConverter {
 	 *          parameters with which the program was run
 	 */
 	public static void main(String[] args) {
-//		ApplicationContextLoader.loadApplicationContext("consoleApplicationContext.xml");
+		// ApplicationContextLoader.loadApplicationContext("consoleApplicationContext.xml");
 		ConsoleConverter main = new ConsoleConverter(args);
-//		ApplicationContextLoader.injectDependencies(main);
+		// ApplicationContextLoader.injectDependencies(main);
 		try {
 			main.run();
 		} catch (InvalidInputDataExecption e) {
@@ -134,7 +136,14 @@ public class ConsoleConverter {
 			double x = 0;
 
 			for (Species species : model.getSpecies()) {
-				SpeciesAlias alias = new SpeciesAlias(species);
+				SpeciesAlias alias = null;
+				if (species instanceof GenericProtein) {
+					alias = new GenericProteinAlias((GenericProtein) species);
+				} else {
+					// TODO fix after refactoring
+					throw new NotImplementedException("Don't know how to deal with class: " + species.getClass());
+				}
+
 				alias.setAliasId("al" + species.getElementId());
 				alias.setWidth(inputOptions.getAliasWidth());
 				alias.setHeight(inputOptions.getAliasHeight());
@@ -243,7 +252,7 @@ public class ConsoleConverter {
 				}
 
 				String className = cols[typeColumn];
-				Class<? > clazz = elementUtils.getClassByName(className);
+				Class<?> clazz = elementUtils.getClassByName(className);
 				if (clazz == null) {
 					throw new InvalidInputDataExecption("Unknown element type: " + className, filename);
 				}
@@ -403,7 +412,7 @@ public class ConsoleConverter {
 				}
 
 				String className = cols[typeColumn];
-				Class<? > clazz = elementUtils.getClassByName(className);
+				Class<?> clazz = elementUtils.getClassByName(className);
 				if (clazz == null) {
 					throw new InvalidInputDataExecption("Unknown element type: " + className, filename);
 				}
diff --git a/console/src/main/java/lcsb/mapviewer/run/DiabetesTest.java b/console/src/main/java/lcsb/mapviewer/run/DiabetesTest.java
index b677af82d7..913b48991f 100644
--- a/console/src/main/java/lcsb/mapviewer/run/DiabetesTest.java
+++ b/console/src/main/java/lcsb/mapviewer/run/DiabetesTest.java
@@ -10,6 +10,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
 import lcsb.mapviewer.model.graphics.PolylineData;
 import lcsb.mapviewer.model.map.InconsistentModelException;
@@ -17,6 +18,7 @@ import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.agregator.Compartment;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelFullIndexed;
@@ -164,7 +166,13 @@ public class DiabetesTest {
 		double size = model.getSpecies().size();
 		double x = 0;
 		for (Species species : model.getSpecies()) {
-			SpeciesAlias alias = new SpeciesAlias(species);
+			SpeciesAlias alias = null;
+			if (species instanceof GenericProtein) {
+				alias = new GenericProteinAlias((GenericProtein) species);
+			} else {
+				// TODO fix after refactoring
+				throw new NotImplementedException("Don't know how to deal with class: " + species.getClass());
+			}
 			alias.setAliasId("al" + x);
 			alias.setWidth(ALIAS_WIDTH);
 			alias.setHeight(ALIAS_HEIGHT);
@@ -285,7 +293,13 @@ public class DiabetesTest {
 		double size = model.getSpecies().size();
 		double x = 0;
 		for (Species species : model.getSpecies()) {
-			SpeciesAlias alias = new SpeciesAlias(species);
+			SpeciesAlias alias = null;
+			if (species instanceof GenericProtein) {
+				alias = new GenericProteinAlias((GenericProtein) species);
+			} else {
+				// TODO fix after refactoring
+				throw new NotImplementedException("Don't know how to deal with class: " + species.getClass());
+			}
 			alias.setAliasId("al" + x);
 			alias.setWidth(ALIAS_WIDTH);
 			alias.setHeight(ALIAS_HEIGHT);
@@ -412,7 +426,13 @@ public class DiabetesTest {
 		double size = model.getSpecies().size();
 		double x = 0;
 		for (Species species : model.getSpecies()) {
-			SpeciesAlias alias = new SpeciesAlias(species);
+			SpeciesAlias alias = null;
+			if (species instanceof GenericProtein) {
+				alias = new GenericProteinAlias((GenericProtein) species);
+			} else {
+				// TODO fix after refactoring
+				throw new NotImplementedException("Don't know how to deal with class: " + species.getClass());
+			}
 			alias.setAliasId("al" + x);
 			alias.setWidth(ALIAS_WIDTH);
 			alias.setHeight(ALIAS_HEIGHT);
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerXmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerXmlParser.java
index d08b474f47..b658854412 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerXmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerXmlParser.java
@@ -1,669 +1,669 @@
-package lcsb.mapviewer.converter.model.celldesigner;
-
-import java.awt.geom.Line2D;
-import java.awt.geom.Rectangle2D;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.log4j.Logger;
-import org.apache.xerces.parsers.DOMParser;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.EventStorageLoggerAppender;
-import lcsb.mapviewer.common.MimeType;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.XmlParser;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.converter.ConverterParams;
-import lcsb.mapviewer.converter.IConverter;
-import lcsb.mapviewer.converter.InvalidInputDataExecption;
-import lcsb.mapviewer.converter.model.celldesigner.alias.AliasCollectionXmlParser;
-import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
-import lcsb.mapviewer.converter.model.celldesigner.compartment.CompartmentCollectionXmlParser;
-import lcsb.mapviewer.converter.model.celldesigner.reaction.ReactionCollectionXmlParser;
-import lcsb.mapviewer.converter.model.celldesigner.reaction.UnknownReactionClassException;
-import lcsb.mapviewer.converter.model.celldesigner.species.InternalModelSpeciesData;
-import lcsb.mapviewer.converter.model.celldesigner.species.SpeciesCollectionXmlParser;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.InconsistentModelException;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.layout.graphics.LayerOval;
-import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
-import lcsb.mapviewer.model.map.layout.graphics.LayerText;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-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;
-
-/**
- * This class is a parser for CellDesigner files. There are two typical use
- * cases:
- * <ul>
- * <li>CellDesigner xml -> our model. To perform this action
- * {@link #createModel(Params)} method should be called.</li>
- * <li>our model -> CellDesigner xml. To perform this action
- * {@link #toXml(Model)} method should be called.</li>
- * </ul>
- * <p/>
- * CellDEsigner format is the extension of <a href="http://sbml.org">SBML</a>.
- * More information about this format could be found <a href=
- * "http://www.celldesigner.org/documents/CellDesigner4ExtensionTagSpecificationE.pdf"
- * >here</a>.
- * 
- * @author Piotr Gawron
- * 
- */
-public class CellDesignerXmlParser extends XmlParser implements IConverter {
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger									 logger													= Logger.getLogger(CellDesignerXmlParser.class.getName());
-
-	/**
-	 * CellDesigner parser for layers.
-	 */
-	private LayerXmlParser								 layerParser										= new LayerXmlParser();
-
-	/**
-	 * CellDesigner parser for compartments collections.
-	 */
-	private CompartmentCollectionXmlParser compartmentCollectionXmlParser	= new CompartmentCollectionXmlParser();
-
-	/**
-	 * CellDesigner parser for species collections.
-	 */
-	private SpeciesCollectionXmlParser		 speciesSbmlParser;
-
-	/**
-	 * CellDesigner parser for alias collections.
-	 */
-	private AliasCollectionXmlParser			 aliasCollectionParser;
-
-	@Override
-	public Model createModel(ConverterParams params) throws InvalidInputDataExecption {
-		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
-		try {
-			Logger.getRootLogger().addAppender(appender);
-			Model model = new ModelFullIndexed(null);
-			model.setSbgnFormat(params.isSbgnFormat());
-
-			if (params.getFilename() != null) {
-				model.setName(FilenameUtils.getBaseName(params.getFilename()));
-			}
-			speciesSbmlParser = new SpeciesCollectionXmlParser(model);
-			aliasCollectionParser = new AliasCollectionXmlParser(model);
-
-			DOMParser parser = new DOMParser();
-			try {
-				parser.parse(params.getSource());
-			} catch (IOException e) {
-				throw new InvalidInputDataExecption("IO Problem with a file: " + params.getSource().getSystemId(), e);
-			}
-			Document doc = parser.getDocument();
-			try {
-
-				// Get the document's root XML node
-				NodeList root = doc.getChildNodes();
-
-				// Navigate down the hierarchy to get to the CEO node
-				Node sbmlNode = getNode("SBML", root);
-				if (sbmlNode == null) {
-					throw new InvalidInputDataExecption("No SBML node");
-				}
-
-				Node modelNode = getNode("model", sbmlNode.getChildNodes());
-				if (modelNode == null) {
-					throw new InvalidInputDataExecption("No model node in SBML");
-				}
-				// we ignore metaid - it's useless and obstruct data model
-				// model.setMetaId(getNodeAttr("metaId", modelNode));
-				model.setIdModel(getNodeAttr("id", modelNode));
-
-				Node compartmentNode = getNode("listOfCompartments", modelNode.getChildNodes());
-				if (compartmentNode != null) {
-					List<Compartment> compartments = compartmentCollectionXmlParser.parseXmlCompartmentCollection(compartmentNode);
-					model.addElements(compartments);
-				}
-
-				InternalModelSpeciesData modelData = new InternalModelSpeciesData();
-
-				Node speciesNode = getNode("listOfSpecies", modelNode.getChildNodes());
-				if (speciesNode != null) {
-					List<Pair<String, ? extends Species>> species = speciesSbmlParser.parseSbmlSpeciesCollection(speciesNode);
-					modelData.updateSpecies(species);
-				}
-				Node reactionsNode = null;
-
-				NodeList nodes = modelNode.getChildNodes();
-				for (int x = 0; x < nodes.getLength(); x++) {
-					Node node = nodes.item(x);
-					if (node.getNodeType() == Node.ELEMENT_NODE) {
-						if (node.getNodeName().equalsIgnoreCase("annotation")) {
-							continue;
-						} else if (node.getNodeName().equalsIgnoreCase("listOfSpecies")) {
-							continue;
-						} else if (node.getNodeName().equalsIgnoreCase("listOfReactions")) {
-							reactionsNode = node;
-						} else if (node.getNodeName().equalsIgnoreCase("listOfCompartments")) {
-							// we already parsed compartemnts
-							continue;
-						} else if (node.getNodeName().equalsIgnoreCase("notes")) {
-							RestAnnotationParser rap = new RestAnnotationParser();
-							String notes = rap.getNotes(node);
-							if (notes != null) {
-								notes = StringEscapeUtils.unescapeHtml4(notes);
-							}
-							model.setNotes(notes);
-						} else if (node.getNodeName().equalsIgnoreCase("listOfUnitDefinitions")) {
-							continue; // we can ignore unit definitions
-						} else {
-							throw new InvalidInputDataExecption("Unknown element of model: " + node.getNodeName());
-						}
-					}
-				}
-
-				Node annotationNode = getNode("annotation", modelNode.getChildNodes());
-				if (annotationNode == null) {
-					throw new InvalidInputDataExecption("No annotation node in SBML/model");
-				}
-
-				parseAnnotation(model, annotationNode, modelData);
-
-				if (speciesNode != null) {
-					List<Pair<String, ? extends Species>> species = speciesSbmlParser.parseSbmlSpeciesCollection(speciesNode);
-					modelData.updateSpecies(species);
-				}
-
-				if (reactionsNode != null) {
-					ReactionCollectionXmlParser reactionCollectionXmlParser = new ReactionCollectionXmlParser(model);
-					List<Reaction> reactions = reactionCollectionXmlParser.parseXmlReactionCollection(reactionsNode);
-					model.addReactions(reactions);
-				}
-
-				if (params.isSizeAutoAdjust()) {
-					Rectangle2D bound = getModelBound(model);
-					double width = bound.getWidth() + 2 * (Math.max(0, bound.getX()));
-					double height = bound.getHeight() + 2 * (Math.max(0, bound.getY()));
-
-					model.setWidth(width);
-					model.setHeight(height);
-				}
-			} catch (InvalidXmlSchemaException e) {
-				throw new InvalidInputDataExecption(e);
-			} catch (UnknownReactionClassException e) {
-				String type = e.getReactionType();
-				String reactionId = e.getReactionId();
-				String newType = null;
-				if ("CATALYSIS".equalsIgnoreCase(type)) {
-					newType = "positive influence";
-				} else if ("INHIBITION".equalsIgnoreCase(type)) {
-					newType = "negative influence";
-				} else if ("UNKNOWN_CATALYSIS".equalsIgnoreCase(type)) {
-					newType = "unknown positive influence";
-				} else if ("UNKNOWN_INHIBITION".equalsIgnoreCase(type)) {
-					newType = "unknown negative influence";
-				} else if ("PHYSICAL_STIMULATION".equalsIgnoreCase(type)) {
-					newType = "reduced physical stimulation";
-				} else if ("MODULATION".equalsIgnoreCase(type)) {
-					newType = "reduced modulation";
-				} else if ("TRIGGER".equalsIgnoreCase(type)) {
-					newType = "reduced trigger";
-				} else {
-					throw new InvalidInputDataExecption(e);
-				}
-				throw new InvalidInputDataExecption(
-						"Reaction type \"" + type + "\" is inappropriate for reaction " + reactionId + ". Suggested type: " + newType
-								+ " in the \"Reduced\" notation of CellDesigner.",
-						e);
-			} catch (CellDesignerParserException e) {
-				throw new InvalidInputDataExecption(e);
-			}
-
-			Logger.getRootLogger().removeAppender(appender);
-			model.addLoggingInfo(appender);
-			return model;
-		} finally {
-			Logger.getRootLogger().removeAppender(appender);
-		}
-	}
-
-	/**
-	 * Computes bound of the model.
-	 * 
-	 * @param model
-	 *          object for which computaion is done
-	 * @return bound of the model
-	 */
-	Rectangle2D getModelBound(Model model) {
-		double maxX = 0;
-		double maxY = 0;
-		double minX = model.getWidth();
-		double minY = model.getHeight();
-		for (Alias alias : model.getAliases()) {
-			maxX = Math.max(maxX, alias.getWidth() + alias.getX());
-			maxY = Math.max(maxY, alias.getHeight() + alias.getY());
-
-			minX = Math.min(minX, alias.getX());
-			minY = Math.min(minY, alias.getY());
-
-		}
-
-		for (Reaction reaction : model.getReactions()) {
-			for (Line2D line : reaction.getLines()) {
-				maxX = Math.max(maxX, line.getX1());
-				maxX = Math.max(maxX, line.getX2());
-				maxY = Math.max(maxY, line.getY1());
-				maxY = Math.max(maxY, line.getY2());
-
-				minX = Math.min(minX, line.getX1());
-				minX = Math.min(minX, line.getX2());
-				minY = Math.min(minY, line.getY1());
-				minY = Math.min(minY, line.getY2());
-			}
-		}
-
-		for (Layer layer : model.getLayers()) {
-			for (PolylineData lline : layer.getLines()) {
-				for (Line2D line : lline.getLines()) {
-					maxX = Math.max(maxX, line.getX1());
-					maxX = Math.max(maxX, line.getX2());
-					maxY = Math.max(maxY, line.getY1());
-					maxY = Math.max(maxY, line.getY2());
-
-					minX = Math.min(minX, line.getX1());
-					minX = Math.min(minX, line.getX2());
-					minY = Math.min(minY, line.getY1());
-					minY = Math.min(minY, line.getY2());
-				}
-			}
-			for (LayerRect rect : layer.getRectangles()) {
-				maxX = Math.max(maxX, rect.getX());
-				maxX = Math.max(maxX, rect.getX() + rect.getWidth());
-				maxY = Math.max(maxY, rect.getY());
-				maxY = Math.max(maxY, rect.getY() + rect.getHeight());
-
-				minX = Math.min(minX, rect.getX());
-				minX = Math.min(minX, rect.getX() + rect.getWidth());
-				minY = Math.min(minY, rect.getY());
-				minY = Math.min(minY, rect.getY() + rect.getHeight());
-			}
-			for (LayerOval oval : layer.getOvals()) {
-				maxX = Math.max(maxX, oval.getX());
-				maxX = Math.max(maxX, oval.getX() + oval.getWidth());
-				maxY = Math.max(maxY, oval.getY());
-				maxY = Math.max(maxY, oval.getY() + oval.getHeight());
-
-				minX = Math.min(minX, oval.getX());
-				minX = Math.min(minX, oval.getX() + oval.getWidth());
-				minY = Math.min(minY, oval.getY());
-				minY = Math.min(minY, oval.getY() + oval.getHeight());
-			}
-			for (LayerText text : layer.getTexts()) {
-				maxX = Math.max(maxX, text.getX());
-				maxX = Math.max(maxX, text.getX() + text.getWidth());
-				maxY = Math.max(maxY, text.getY());
-				maxY = Math.max(maxY, text.getY() + text.getHeight());
-
-				minX = Math.min(minX, text.getX());
-				minX = Math.min(minX, text.getX() + text.getWidth());
-				minY = Math.min(minY, text.getY());
-				minY = Math.min(minY, text.getY() + text.getHeight());
-			}
-		}
-
-		Rectangle2D result = new Rectangle2D.Double(minX, minY, maxX - minX, maxY - minY);
-		return result;
-	}
-
-	/**
-	 * Parse annotation part of CellDesigner xml.
-	 * 
-	 * @param model
-	 *          model that is parsed (and will be updated)
-	 * @param modelData
-	 *          object conmtaining infoirmation about species during CellDesigner
-	 *          parsing
-	 * @param annotationNode
-	 *          xml node to parse
-	 * @throws InvalidXmlSchemaException
-	 *           thrown when xmlString is invalid
-	 */
-	private void parseAnnotation(Model model, Node annotationNode, InternalModelSpeciesData modelData) throws InvalidXmlSchemaException {
-		SpeciesCollectionXmlParser parser = new SpeciesCollectionXmlParser(model);
-
-		Node extensionNode = getNode("celldesigner:extension", annotationNode.getChildNodes());
-		if (extensionNode == null) {
-			throw new InvalidXmlSchemaException("No celldesigner:extension node in SBML/model/annotation");
-		}
-
-		NodeList nodes = extensionNode.getChildNodes();
-		Node includedSpecies = null;
-		Node listofSpeciesAlias = null;
-		Node listOfComplexSpeciesAlias = null;
-		Node listOfComparmentAlias = null;
-		Node listOfProteins = null;
-		Node listOfGenes = null;
-		Node listOfRnas = null;
-		Node listOfGroups = null;
-		Node listOfAntisenseRnas = null;
-		for (int x = 0; x < nodes.getLength(); x++) {
-			Node node = nodes.item(x);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if (node.getNodeName().equalsIgnoreCase("celldesigner:modelVersion")) {
-					// we ignore map version (there is no use for us)
-					// model.setVersion(getNodeValue(node));
-					continue;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:modelDisplay")) {
-					model.setWidth(getNodeAttr("sizeX", node));
-					model.setHeight(getNodeAttr("sizeY", node));
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfSpeciesAliases")) {
-					listofSpeciesAlias = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfComplexSpeciesAliases")) {
-					listOfComplexSpeciesAlias = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfProteins")) {
-					listOfProteins = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfGenes")) {
-					listOfGenes = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfRNAs")) {
-					listOfRnas = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfAntisenseRNAs")) {
-					listOfAntisenseRnas = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfIncludedSpecies")) {
-					includedSpecies = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfCompartmentAliases")) {
-					listOfComparmentAlias = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfLayers")) {
-					model.addLayers(layerParser.parseLayers(node));
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfGroups")) {
-					listOfGroups = node;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfBlockDiagrams")) {
-					layerParser.parseBlocks(model, node);
-				} else {
-					throw new InvalidXmlSchemaException("Unknown element of annotation: " + node.getNodeName());
-				}
-			}
-		}
-
-		if (listOfComparmentAlias != null) {
-			List<CompartmentAlias> aliases = aliasCollectionParser.parseXmlCompartmentAliasCollection(listOfComparmentAlias);
-			model.addAliases(aliases);
-		}
-
-		if (includedSpecies != null) {
-			List<Pair<String, ? extends Species>> species = parser.parseIncludedSpeciesCollection(includedSpecies);
-			modelData.updateSpecies(species);
-		}
-
-		if (listOfProteins != null) {
-			List<Pair<String, ? extends Species>> species = parser.parseXmlProteinCollection(listOfProteins);
-			modelData.updateSpecies(species);
-		}
-		if (listOfGenes != null) {
-			List<Pair<String, ? extends Species>> species = parser.parseXmlGeneCollection(listOfGenes);
-			modelData.updateSpecies(species);
-		}
-		if (listOfRnas != null) {
-			List<Pair<String, ? extends Species>> species = parser.parseXmlRnaCollection(listOfRnas);
-			modelData.updateSpecies(species);
-		}
-		if (listOfAntisenseRnas != null) {
-			List<Pair<String, ? extends Species>> species = parser.parseXmlAntisenseRnaCollection(listOfAntisenseRnas);
-			modelData.updateSpecies(species);
-		}
-
-		for (Species species : modelData.getAll()) {
-			if (!species.getElementId().equals("")) {
-				model.addElement(species);
-			} else {
-				model.addCreationWarning(
-						"Species (class: " + species.getClass().getName() + ", name: " + species.getName()
-								+ ") exists in CD file, but is never instantiated. It's CellDesigner file problem.");
-			}
-		}
-
-		if (listOfComplexSpeciesAlias != null) {
-			List<ComplexAlias> aliases = aliasCollectionParser.parseXmlComplexAliasCollection(listOfComplexSpeciesAlias);
-			model.addAliases(aliases);
-		}
-
-		if (listofSpeciesAlias != null) {
-			List<SpeciesAlias> aliases = aliasCollectionParser.parseXmlSpeciesAliasCollection(listofSpeciesAlias);
-			model.addAliases(aliases);
-		}
-
-		if (includedSpecies != null) {
-			parseAnnotationAliasesConnections(model, getNode("celldesigner:listOfSpeciesAliases", nodes));
-			parseAnnotationComplexAliasesConnections(model, getNode("celldesigner:listOfComplexSpeciesAliases", nodes));
-		}
-
-		if (includedSpecies != null) {
-			parser.addConnectionBetweenIncludedSpecies(includedSpecies);
-		}
-
-		if (listOfGroups != null) {
-			layerParser.parseGroups(model, listOfGroups);
-		}
-
-	}
-
-	/**
-	 * Parses celldesigner:listOfComplexSpeciesAliases node for annotation part of
-	 * the CellDEsigner format.
-	 * 
-	 * @param model
-	 *          model that is parsed
-	 * @param aliasNode
-	 *          node to parse
-	 * @throws InvalidXmlSchemaException
-	 *           thrown when xml node contains data that is not supported by xml
-	 *           schema
-	 */
-	void parseAnnotationComplexAliasesConnections(Model model, Node aliasNode) throws InvalidXmlSchemaException {
-		NodeList nodes = aliasNode.getChildNodes();
-		for (int x = 0; x < nodes.getLength(); x++) {
-			Node node = nodes.item(x);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if (node.getNodeName().equalsIgnoreCase("celldesigner:complexSpeciesAlias")) {
-					String aliasId = getNodeAttr("id", node);
-					String complexId = getNodeAttr("complexSpeciesAlias", node);
-					ComplexAlias alias = (ComplexAlias) model.getAliasByAliasId(aliasId);
-					if (alias == null) {
-						throw new InvalidXmlSchemaException("Alias does not exist " + aliasId);
-					}
-					ComplexAlias complex = (ComplexAlias) model.getAliasByAliasId(complexId);
-					if (complex != null) {
-						complex.addAlias(alias);
-						alias.setParent(complex);
-					}
-				} else {
-					throw new InvalidXmlSchemaException("Unknown element of celldesigner:listOfComplexSpeciesAliases: " + node.getNodeName());
-				}
-			}
-		}
-
-	}
-
-	/**
-	 * Parses celldesigner:listOfSpeciesAliases node for annotation part of the
-	 * CellDesigner format.
-	 * 
-	 * @param model
-	 *          model that is parsed
-	 * @param aliasNode
-	 *          node to parse
-	 * @throws InvalidXmlSchemaException
-	 *           thrown when xml node contains data that is not supported by xml
-	 *           schema
-	 */
-	void parseAnnotationAliasesConnections(Model model, Node aliasNode) throws InvalidXmlSchemaException {
-		NodeList nodes = aliasNode.getChildNodes();
-		for (int x = 0; x < nodes.getLength(); x++) {
-			Node node = nodes.item(x);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if (node.getNodeName().equalsIgnoreCase("celldesigner:speciesAlias")) {
-					String aliasId = getNodeAttr("id", node);
-					String complexId = getNodeAttr("complexSpeciesAlias", node);
-					Alias alias = model.getAliasByAliasId(aliasId);
-					if (alias == null) {
-						throw new InvalidXmlSchemaException("Alias does not exist " + aliasId);
-					} else if (alias instanceof SpeciesAlias) {
-						ComplexAlias complex = (ComplexAlias) model.getAliasByAliasId(complexId);
-						if (complex != null) {
-							alias.setParent(complex);
-							complex.addAlias((SpeciesAlias) alias);
-						}
-					}
-				} else {
-					throw new InvalidXmlSchemaException("Unknown element of celldesigner:listOfSpeciesAliases: " + node.getNodeName());
-				}
-			}
-		}
-	}
-
-	/**
-	 * Transforms model into CellDesigner xml.
-	 * 
-	 * @param model
-	 *          model that should be transformed
-	 * @return CellDesigner xml string for the model
-	 * @throws InconsistentModelException
-	 *           thrown when then model is invalid
-	 */
-	public String toXml(Model model) throws InconsistentModelException {
-
-		SpeciesCollectionXmlParser speciesCollectionXmlParser = new SpeciesCollectionXmlParser(model);
-		ReactionCollectionXmlParser reactionCollectionXmlParser = new ReactionCollectionXmlParser(model);
-		aliasCollectionParser = new AliasCollectionXmlParser(model);
-
-		StringBuilder result = new StringBuilder();
-		result.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
-		result.append(
-				"<sbml xmlns=\"http://www.sbml.org/sbml/level2/version4\" "
-						+ "xmlns:celldesigner=\"http://www.sbml.org/2001/ns/celldesigner\" level=\"2\" version=\"4\">\n");
-		// metaid is a strang cell designer id, usually it's model id and as far as
-		// we can tell it's not used at all
-		result.append("<model metaid=\"" + model.getIdModel() + "\" id=\"" + model.getIdModel() + "\">\n");
-
-		if (model.getNotes() != null) {
-			result.append("<notes>");
-			result.append(escapeXml(model.getNotes()));
-			result.append("</notes>");
-		}
-
-		result.append(annotationToXml(model));
-
-		result.append(compartmentCollectionXmlParser.toXml(model.getCompartments()));
-
-		result.append(speciesCollectionXmlParser.speciesCollectionToSbmlString(model.getSpecies()));
-
-		result.append(reactionCollectionXmlParser.reactionCollectionToXmlString(model.getReactions()));
-
-		result.append("</model>");
-		result.append("</sbml>");
-		return result.toString();
-	}
-
-	/**
-	 * Generates xml node that should be in annotation part of the model.
-	 * 
-	 * @param model
-	 *          model to transform
-	 * @return annotation xml string for the model
-	 */
-	private String annotationToXml(Model model) {
-		SpeciesCollectionXmlParser speciesCollectionXmlParser = new SpeciesCollectionXmlParser(model);
-
-		StringBuilder result = new StringBuilder();
-		result.append("<annotation>\n");
-		result.append("<celldesigner:extension>\n");
-		result.append("<celldesigner:modelVersion>4.0</celldesigner:modelVersion>\n");
-		result.append("<celldesigner:modelDisplay sizeX=\"" + model.getWidth().intValue() + "\" sizeY=\"" + model.getHeight().intValue() + "\"/>\n");
-
-		result.append(speciesCollectionXmlParser.speciesCollectionToXmlIncludedString(model.getSpecies()));
-
-		result.append(aliasCollectionParser.compartmentAliasCollectionToXmlString(model.getCompartmentsAliases()));
-		result.append(aliasCollectionParser.complexAliasCollectionToXmlString(model.getComplexAliases()));
-		result.append(aliasCollectionParser.speciesAliasCollectionToXmlString(model.getSpeciesAliases()));
-
-		List<Protein> proteins = new ArrayList<Protein>();
-		List<Gene> genes = new ArrayList<Gene>();
-		List<Rna> rnas = new ArrayList<Rna>();
-		List<AntisenseRna> antisenseRnas = new ArrayList<AntisenseRna>();
-		for (Element element : model.getElements()) {
-			if (element instanceof Protein) {
-				proteins.add((Protein) element);
-			} else if (element instanceof Gene) {
-				genes.add((Gene) element);
-			} else if (element instanceof AntisenseRna) {
-				antisenseRnas.add((AntisenseRna) element);
-			} else if (element instanceof Rna) {
-				rnas.add((Rna) element);
-			}
-		}
-
-		result.append(speciesCollectionXmlParser.proteinCollectionToXmlString(proteins));
-		result.append(speciesCollectionXmlParser.geneCollectionToXmlString(genes));
-		result.append(speciesCollectionXmlParser.rnaCollectionToXmlString(rnas));
-		result.append(speciesCollectionXmlParser.antisenseRnaCollectionToXmlString(antisenseRnas));
-		result.append(layerParser.layerCollectionToXml(model.getLayers()));
-
-		result.append("</celldesigner:extension>\n");
-		result.append("</annotation>\n");
-		return result.toString();
-	}
-
-	@Override
-	public InputStream exportModelToInputStream(Model model) throws InconsistentModelException {
-		String exportedString = toXml(model);
-		InputStream inputStream = new ByteArrayInputStream(exportedString.getBytes());
-		return inputStream;
-	}
-
-	@Override
-	public File exportModelToFile(Model model, String filePath) throws InconsistentModelException, IOException {
-		File file = new File(filePath);
-		String exportedString = toXml(model);
-		FileWriter fileWriter = new FileWriter(file);
-		fileWriter.write(exportedString);
-		fileWriter.flush();
-		fileWriter.close();
-
-		return file;
-	}
-
-	@Override
-	public String getCommonName() {
-		return "CellDesigner SBML";
-	}
-
-	@Override
-	public MimeType getMimeType() {
-		return MimeType.SBML;
-	}
-
-	@Override
-	public String getFileExtension() {
-		return "xml";
-	}
-}
+package lcsb.mapviewer.converter.model.celldesigner;
+
+import java.awt.geom.Line2D;
+import java.awt.geom.Rectangle2D;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.log4j.Logger;
+import org.apache.xerces.parsers.DOMParser;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.EventStorageLoggerAppender;
+import lcsb.mapviewer.common.MimeType;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.XmlParser;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.converter.ConverterParams;
+import lcsb.mapviewer.converter.IConverter;
+import lcsb.mapviewer.converter.InvalidInputDataExecption;
+import lcsb.mapviewer.converter.model.celldesigner.alias.AliasCollectionXmlParser;
+import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
+import lcsb.mapviewer.converter.model.celldesigner.compartment.CompartmentCollectionXmlParser;
+import lcsb.mapviewer.converter.model.celldesigner.reaction.ReactionCollectionXmlParser;
+import lcsb.mapviewer.converter.model.celldesigner.reaction.UnknownReactionClassException;
+import lcsb.mapviewer.converter.model.celldesigner.species.InternalModelSpeciesData;
+import lcsb.mapviewer.converter.model.celldesigner.species.SpeciesCollectionXmlParser;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.InconsistentModelException;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.layout.graphics.LayerOval;
+import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
+import lcsb.mapviewer.model.map.layout.graphics.LayerText;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+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;
+
+/**
+ * This class is a parser for CellDesigner files. There are two typical use
+ * cases:
+ * <ul>
+ * <li>CellDesigner xml -> our model. To perform this action
+ * {@link #createModel(Params)} method should be called.</li>
+ * <li>our model -> CellDesigner xml. To perform this action
+ * {@link #toXml(Model)} method should be called.</li>
+ * </ul>
+ * <p/>
+ * CellDEsigner format is the extension of <a href="http://sbml.org">SBML</a>.
+ * More information about this format could be found <a href=
+ * "http://www.celldesigner.org/documents/CellDesigner4ExtensionTagSpecificationE.pdf"
+ * >here</a>.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class CellDesignerXmlParser extends XmlParser implements IConverter {
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger									 logger													= Logger.getLogger(CellDesignerXmlParser.class.getName());
+
+	/**
+	 * CellDesigner parser for layers.
+	 */
+	private LayerXmlParser								 layerParser										= new LayerXmlParser();
+
+	/**
+	 * CellDesigner parser for compartments collections.
+	 */
+	private CompartmentCollectionXmlParser compartmentCollectionXmlParser	= new CompartmentCollectionXmlParser();
+
+	/**
+	 * CellDesigner parser for species collections.
+	 */
+	private SpeciesCollectionXmlParser		 speciesSbmlParser;
+
+	/**
+	 * CellDesigner parser for alias collections.
+	 */
+	private AliasCollectionXmlParser			 aliasCollectionParser;
+
+	@Override
+	public Model createModel(ConverterParams params) throws InvalidInputDataExecption {
+		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
+		try {
+			Logger.getRootLogger().addAppender(appender);
+			Model model = new ModelFullIndexed(null);
+			model.setSbgnFormat(params.isSbgnFormat());
+
+			if (params.getFilename() != null) {
+				model.setName(FilenameUtils.getBaseName(params.getFilename()));
+			}
+			speciesSbmlParser = new SpeciesCollectionXmlParser(model);
+			aliasCollectionParser = new AliasCollectionXmlParser(model);
+
+			DOMParser parser = new DOMParser();
+			try {
+				parser.parse(params.getSource());
+			} catch (IOException e) {
+				throw new InvalidInputDataExecption("IO Problem with a file: " + params.getSource().getSystemId(), e);
+			}
+			Document doc = parser.getDocument();
+			try {
+
+				// Get the document's root XML node
+				NodeList root = doc.getChildNodes();
+
+				// Navigate down the hierarchy to get to the CEO node
+				Node sbmlNode = getNode("SBML", root);
+				if (sbmlNode == null) {
+					throw new InvalidInputDataExecption("No SBML node");
+				}
+
+				Node modelNode = getNode("model", sbmlNode.getChildNodes());
+				if (modelNode == null) {
+					throw new InvalidInputDataExecption("No model node in SBML");
+				}
+				// we ignore metaid - it's useless and obstruct data model
+				// model.setMetaId(getNodeAttr("metaId", modelNode));
+				model.setIdModel(getNodeAttr("id", modelNode));
+
+				Node compartmentNode = getNode("listOfCompartments", modelNode.getChildNodes());
+				if (compartmentNode != null) {
+					List<Compartment> compartments = compartmentCollectionXmlParser.parseXmlCompartmentCollection(compartmentNode);
+					model.addElements(compartments);
+				}
+
+				InternalModelSpeciesData modelData = new InternalModelSpeciesData();
+
+				Node speciesNode = getNode("listOfSpecies", modelNode.getChildNodes());
+				if (speciesNode != null) {
+					List<Pair<String, ? extends Species>> species = speciesSbmlParser.parseSbmlSpeciesCollection(speciesNode);
+					modelData.updateSpecies(species);
+				}
+				Node reactionsNode = null;
+
+				NodeList nodes = modelNode.getChildNodes();
+				for (int x = 0; x < nodes.getLength(); x++) {
+					Node node = nodes.item(x);
+					if (node.getNodeType() == Node.ELEMENT_NODE) {
+						if (node.getNodeName().equalsIgnoreCase("annotation")) {
+							continue;
+						} else if (node.getNodeName().equalsIgnoreCase("listOfSpecies")) {
+							continue;
+						} else if (node.getNodeName().equalsIgnoreCase("listOfReactions")) {
+							reactionsNode = node;
+						} else if (node.getNodeName().equalsIgnoreCase("listOfCompartments")) {
+							// we already parsed compartemnts
+							continue;
+						} else if (node.getNodeName().equalsIgnoreCase("notes")) {
+							RestAnnotationParser rap = new RestAnnotationParser();
+							String notes = rap.getNotes(node);
+							if (notes != null) {
+								notes = StringEscapeUtils.unescapeHtml4(notes);
+							}
+							model.setNotes(notes);
+						} else if (node.getNodeName().equalsIgnoreCase("listOfUnitDefinitions")) {
+							continue; // we can ignore unit definitions
+						} else {
+							throw new InvalidInputDataExecption("Unknown element of model: " + node.getNodeName());
+						}
+					}
+				}
+
+				Node annotationNode = getNode("annotation", modelNode.getChildNodes());
+				if (annotationNode == null) {
+					throw new InvalidInputDataExecption("No annotation node in SBML/model");
+				}
+
+				parseAnnotation(model, annotationNode, modelData);
+
+				if (speciesNode != null) {
+					List<Pair<String, ? extends Species>> species = speciesSbmlParser.parseSbmlSpeciesCollection(speciesNode);
+					modelData.updateSpecies(species);
+				}
+
+				if (reactionsNode != null) {
+					ReactionCollectionXmlParser reactionCollectionXmlParser = new ReactionCollectionXmlParser(model);
+					List<Reaction> reactions = reactionCollectionXmlParser.parseXmlReactionCollection(reactionsNode);
+					model.addReactions(reactions);
+				}
+
+				if (params.isSizeAutoAdjust()) {
+					Rectangle2D bound = getModelBound(model);
+					double width = bound.getWidth() + 2 * (Math.max(0, bound.getX()));
+					double height = bound.getHeight() + 2 * (Math.max(0, bound.getY()));
+
+					model.setWidth(width);
+					model.setHeight(height);
+				}
+			} catch (InvalidXmlSchemaException e) {
+				throw new InvalidInputDataExecption(e);
+			} catch (UnknownReactionClassException e) {
+				String type = e.getReactionType();
+				String reactionId = e.getReactionId();
+				String newType = null;
+				if ("CATALYSIS".equalsIgnoreCase(type)) {
+					newType = "positive influence";
+				} else if ("INHIBITION".equalsIgnoreCase(type)) {
+					newType = "negative influence";
+				} else if ("UNKNOWN_CATALYSIS".equalsIgnoreCase(type)) {
+					newType = "unknown positive influence";
+				} else if ("UNKNOWN_INHIBITION".equalsIgnoreCase(type)) {
+					newType = "unknown negative influence";
+				} else if ("PHYSICAL_STIMULATION".equalsIgnoreCase(type)) {
+					newType = "reduced physical stimulation";
+				} else if ("MODULATION".equalsIgnoreCase(type)) {
+					newType = "reduced modulation";
+				} else if ("TRIGGER".equalsIgnoreCase(type)) {
+					newType = "reduced trigger";
+				} else {
+					throw new InvalidInputDataExecption(e);
+				}
+				throw new InvalidInputDataExecption(
+						"Reaction type \"" + type + "\" is inappropriate for reaction " + reactionId + ". Suggested type: " + newType
+								+ " in the \"Reduced\" notation of CellDesigner.",
+						e);
+			} catch (CellDesignerParserException e) {
+				throw new InvalidInputDataExecption(e);
+			}
+
+			Logger.getRootLogger().removeAppender(appender);
+			model.addLoggingInfo(appender);
+			return model;
+		} finally {
+			Logger.getRootLogger().removeAppender(appender);
+		}
+	}
+
+	/**
+	 * Computes bound of the model.
+	 * 
+	 * @param model
+	 *          object for which computaion is done
+	 * @return bound of the model
+	 */
+	Rectangle2D getModelBound(Model model) {
+		double maxX = 0;
+		double maxY = 0;
+		double minX = model.getWidth();
+		double minY = model.getHeight();
+		for (Alias alias : model.getAliases()) {
+			maxX = Math.max(maxX, alias.getWidth() + alias.getX());
+			maxY = Math.max(maxY, alias.getHeight() + alias.getY());
+
+			minX = Math.min(minX, alias.getX());
+			minY = Math.min(minY, alias.getY());
+
+		}
+
+		for (Reaction reaction : model.getReactions()) {
+			for (Line2D line : reaction.getLines()) {
+				maxX = Math.max(maxX, line.getX1());
+				maxX = Math.max(maxX, line.getX2());
+				maxY = Math.max(maxY, line.getY1());
+				maxY = Math.max(maxY, line.getY2());
+
+				minX = Math.min(minX, line.getX1());
+				minX = Math.min(minX, line.getX2());
+				minY = Math.min(minY, line.getY1());
+				minY = Math.min(minY, line.getY2());
+			}
+		}
+
+		for (Layer layer : model.getLayers()) {
+			for (PolylineData lline : layer.getLines()) {
+				for (Line2D line : lline.getLines()) {
+					maxX = Math.max(maxX, line.getX1());
+					maxX = Math.max(maxX, line.getX2());
+					maxY = Math.max(maxY, line.getY1());
+					maxY = Math.max(maxY, line.getY2());
+
+					minX = Math.min(minX, line.getX1());
+					minX = Math.min(minX, line.getX2());
+					minY = Math.min(minY, line.getY1());
+					minY = Math.min(minY, line.getY2());
+				}
+			}
+			for (LayerRect rect : layer.getRectangles()) {
+				maxX = Math.max(maxX, rect.getX());
+				maxX = Math.max(maxX, rect.getX() + rect.getWidth());
+				maxY = Math.max(maxY, rect.getY());
+				maxY = Math.max(maxY, rect.getY() + rect.getHeight());
+
+				minX = Math.min(minX, rect.getX());
+				minX = Math.min(minX, rect.getX() + rect.getWidth());
+				minY = Math.min(minY, rect.getY());
+				minY = Math.min(minY, rect.getY() + rect.getHeight());
+			}
+			for (LayerOval oval : layer.getOvals()) {
+				maxX = Math.max(maxX, oval.getX());
+				maxX = Math.max(maxX, oval.getX() + oval.getWidth());
+				maxY = Math.max(maxY, oval.getY());
+				maxY = Math.max(maxY, oval.getY() + oval.getHeight());
+
+				minX = Math.min(minX, oval.getX());
+				minX = Math.min(minX, oval.getX() + oval.getWidth());
+				minY = Math.min(minY, oval.getY());
+				minY = Math.min(minY, oval.getY() + oval.getHeight());
+			}
+			for (LayerText text : layer.getTexts()) {
+				maxX = Math.max(maxX, text.getX());
+				maxX = Math.max(maxX, text.getX() + text.getWidth());
+				maxY = Math.max(maxY, text.getY());
+				maxY = Math.max(maxY, text.getY() + text.getHeight());
+
+				minX = Math.min(minX, text.getX());
+				minX = Math.min(minX, text.getX() + text.getWidth());
+				minY = Math.min(minY, text.getY());
+				minY = Math.min(minY, text.getY() + text.getHeight());
+			}
+		}
+
+		Rectangle2D result = new Rectangle2D.Double(minX, minY, maxX - minX, maxY - minY);
+		return result;
+	}
+
+	/**
+	 * Parse annotation part of CellDesigner xml.
+	 * 
+	 * @param model
+	 *          model that is parsed (and will be updated)
+	 * @param modelData
+	 *          object conmtaining infoirmation about species during CellDesigner
+	 *          parsing
+	 * @param annotationNode
+	 *          xml node to parse
+	 * @throws InvalidXmlSchemaException
+	 *           thrown when xmlString is invalid
+	 */
+	private void parseAnnotation(Model model, Node annotationNode, InternalModelSpeciesData modelData) throws InvalidXmlSchemaException {
+		SpeciesCollectionXmlParser parser = new SpeciesCollectionXmlParser(model);
+
+		Node extensionNode = getNode("celldesigner:extension", annotationNode.getChildNodes());
+		if (extensionNode == null) {
+			throw new InvalidXmlSchemaException("No celldesigner:extension node in SBML/model/annotation");
+		}
+
+		NodeList nodes = extensionNode.getChildNodes();
+		Node includedSpecies = null;
+		Node listofSpeciesAlias = null;
+		Node listOfComplexSpeciesAlias = null;
+		Node listOfComparmentAlias = null;
+		Node listOfProteins = null;
+		Node listOfGenes = null;
+		Node listOfRnas = null;
+		Node listOfGroups = null;
+		Node listOfAntisenseRnas = null;
+		for (int x = 0; x < nodes.getLength(); x++) {
+			Node node = nodes.item(x);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if (node.getNodeName().equalsIgnoreCase("celldesigner:modelVersion")) {
+					// we ignore map version (there is no use for us)
+					// model.setVersion(getNodeValue(node));
+					continue;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:modelDisplay")) {
+					model.setWidth(getNodeAttr("sizeX", node));
+					model.setHeight(getNodeAttr("sizeY", node));
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfSpeciesAliases")) {
+					listofSpeciesAlias = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfComplexSpeciesAliases")) {
+					listOfComplexSpeciesAlias = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfProteins")) {
+					listOfProteins = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfGenes")) {
+					listOfGenes = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfRNAs")) {
+					listOfRnas = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfAntisenseRNAs")) {
+					listOfAntisenseRnas = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfIncludedSpecies")) {
+					includedSpecies = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfCompartmentAliases")) {
+					listOfComparmentAlias = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfLayers")) {
+					model.addLayers(layerParser.parseLayers(node));
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfGroups")) {
+					listOfGroups = node;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:listOfBlockDiagrams")) {
+					layerParser.parseBlocks(model, node);
+				} else {
+					throw new InvalidXmlSchemaException("Unknown element of annotation: " + node.getNodeName());
+				}
+			}
+		}
+
+		if (listOfComparmentAlias != null) {
+			List<CompartmentAlias> aliases = aliasCollectionParser.parseXmlCompartmentAliasCollection(listOfComparmentAlias);
+			model.addAliases(aliases);
+		}
+
+		if (includedSpecies != null) {
+			List<Pair<String, ? extends Species>> species = parser.parseIncludedSpeciesCollection(includedSpecies);
+			modelData.updateSpecies(species);
+		}
+
+		if (listOfProteins != null) {
+			List<Pair<String, ? extends Species>> species = parser.parseXmlProteinCollection(listOfProteins);
+			modelData.updateSpecies(species);
+		}
+		if (listOfGenes != null) {
+			List<Pair<String, ? extends Species>> species = parser.parseXmlGeneCollection(listOfGenes);
+			modelData.updateSpecies(species);
+		}
+		if (listOfRnas != null) {
+			List<Pair<String, ? extends Species>> species = parser.parseXmlRnaCollection(listOfRnas);
+			modelData.updateSpecies(species);
+		}
+		if (listOfAntisenseRnas != null) {
+			List<Pair<String, ? extends Species>> species = parser.parseXmlAntisenseRnaCollection(listOfAntisenseRnas);
+			modelData.updateSpecies(species);
+		}
+
+		for (Species species : modelData.getAll()) {
+			if (!species.getElementId().equals("")) {
+				model.addElement(species);
+			} else {
+				model.addCreationWarning(
+						"Species (class: " + species.getClass().getName() + ", name: " + species.getName()
+								+ ") exists in CD file, but is never instantiated. It's CellDesigner file problem.");
+			}
+		}
+
+		if (listOfComplexSpeciesAlias != null) {
+			List<ComplexAlias> aliases = aliasCollectionParser.parseXmlComplexAliasCollection(listOfComplexSpeciesAlias);
+			model.addAliases(aliases);
+		}
+
+		if (listofSpeciesAlias != null) {
+			List<SpeciesAlias> aliases = aliasCollectionParser.parseXmlSpeciesAliasCollection(listofSpeciesAlias);
+			model.addAliases(aliases);
+		}
+
+		if (includedSpecies != null) {
+			parseAnnotationAliasesConnections(model, getNode("celldesigner:listOfSpeciesAliases", nodes));
+			parseAnnotationComplexAliasesConnections(model, getNode("celldesigner:listOfComplexSpeciesAliases", nodes));
+		}
+
+		if (includedSpecies != null) {
+			parser.addConnectionBetweenIncludedSpecies(includedSpecies);
+		}
+
+		if (listOfGroups != null) {
+			layerParser.parseGroups(model, listOfGroups);
+		}
+
+	}
+
+	/**
+	 * Parses celldesigner:listOfComplexSpeciesAliases node for annotation part of
+	 * the CellDEsigner format.
+	 * 
+	 * @param model
+	 *          model that is parsed
+	 * @param aliasNode
+	 *          node to parse
+	 * @throws InvalidXmlSchemaException
+	 *           thrown when xml node contains data that is not supported by xml
+	 *           schema
+	 */
+	void parseAnnotationComplexAliasesConnections(Model model, Node aliasNode) throws InvalidXmlSchemaException {
+		NodeList nodes = aliasNode.getChildNodes();
+		for (int x = 0; x < nodes.getLength(); x++) {
+			Node node = nodes.item(x);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if (node.getNodeName().equalsIgnoreCase("celldesigner:complexSpeciesAlias")) {
+					String aliasId = getNodeAttr("id", node);
+					String complexId = getNodeAttr("complexSpeciesAlias", node);
+					ComplexAlias alias = (ComplexAlias) model.getAliasByAliasId(aliasId);
+					if (alias == null) {
+						throw new InvalidXmlSchemaException("Alias does not exist " + aliasId);
+					}
+					ComplexAlias complex = (ComplexAlias) model.getAliasByAliasId(complexId);
+					if (complex != null) {
+						complex.addAlias(alias);
+						alias.setParent(complex);
+					}
+				} else {
+					throw new InvalidXmlSchemaException("Unknown element of celldesigner:listOfComplexSpeciesAliases: " + node.getNodeName());
+				}
+			}
+		}
+
+	}
+
+	/**
+	 * Parses celldesigner:listOfSpeciesAliases node for annotation part of the
+	 * CellDesigner format.
+	 * 
+	 * @param model
+	 *          model that is parsed
+	 * @param aliasNode
+	 *          node to parse
+	 * @throws InvalidXmlSchemaException
+	 *           thrown when xml node contains data that is not supported by xml
+	 *           schema
+	 */
+	void parseAnnotationAliasesConnections(Model model, Node aliasNode) throws InvalidXmlSchemaException {
+		NodeList nodes = aliasNode.getChildNodes();
+		for (int x = 0; x < nodes.getLength(); x++) {
+			Node node = nodes.item(x);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if (node.getNodeName().equalsIgnoreCase("celldesigner:speciesAlias")) {
+					String aliasId = getNodeAttr("id", node);
+					String complexId = getNodeAttr("complexSpeciesAlias", node);
+					Alias alias = model.getAliasByAliasId(aliasId);
+					if (alias == null) {
+						throw new InvalidXmlSchemaException("Alias does not exist " + aliasId);
+					} else if (alias instanceof SpeciesAlias) {
+						ComplexAlias complex = (ComplexAlias) model.getAliasByAliasId(complexId);
+						if (complex != null) {
+							alias.setParent(complex);
+							complex.addAlias((SpeciesAlias) alias);
+						}
+					}
+				} else {
+					throw new InvalidXmlSchemaException("Unknown element of celldesigner:listOfSpeciesAliases: " + node.getNodeName());
+				}
+			}
+		}
+	}
+
+	/**
+	 * Transforms model into CellDesigner xml.
+	 * 
+	 * @param model
+	 *          model that should be transformed
+	 * @return CellDesigner xml string for the model
+	 * @throws InconsistentModelException
+	 *           thrown when then model is invalid
+	 */
+	public String toXml(Model model) throws InconsistentModelException {
+
+		SpeciesCollectionXmlParser speciesCollectionXmlParser = new SpeciesCollectionXmlParser(model);
+		ReactionCollectionXmlParser reactionCollectionXmlParser = new ReactionCollectionXmlParser(model);
+		aliasCollectionParser = new AliasCollectionXmlParser(model);
+
+		StringBuilder result = new StringBuilder();
+		result.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+		result.append(
+				"<sbml xmlns=\"http://www.sbml.org/sbml/level2/version4\" "
+						+ "xmlns:celldesigner=\"http://www.sbml.org/2001/ns/celldesigner\" level=\"2\" version=\"4\">\n");
+		// metaid is a strang cell designer id, usually it's model id and as far as
+		// we can tell it's not used at all
+		result.append("<model metaid=\"" + model.getIdModel() + "\" id=\"" + model.getIdModel() + "\">\n");
+
+		if (model.getNotes() != null) {
+			result.append("<notes>");
+			result.append(escapeXml(model.getNotes()));
+			result.append("</notes>");
+		}
+
+		result.append(annotationToXml(model));
+
+		result.append(compartmentCollectionXmlParser.toXml(model.getCompartments()));
+
+		result.append(speciesCollectionXmlParser.speciesCollectionToSbmlString(model.getSpecies()));
+
+		result.append(reactionCollectionXmlParser.reactionCollectionToXmlString(model.getReactions()));
+
+		result.append("</model>");
+		result.append("</sbml>");
+		return result.toString();
+	}
+
+	/**
+	 * Generates xml node that should be in annotation part of the model.
+	 * 
+	 * @param model
+	 *          model to transform
+	 * @return annotation xml string for the model
+	 */
+	private String annotationToXml(Model model) {
+		SpeciesCollectionXmlParser speciesCollectionXmlParser = new SpeciesCollectionXmlParser(model);
+
+		StringBuilder result = new StringBuilder();
+		result.append("<annotation>\n");
+		result.append("<celldesigner:extension>\n");
+		result.append("<celldesigner:modelVersion>4.0</celldesigner:modelVersion>\n");
+		result.append("<celldesigner:modelDisplay sizeX=\"" + model.getWidth().intValue() + "\" sizeY=\"" + model.getHeight().intValue() + "\"/>\n");
+
+		result.append(speciesCollectionXmlParser.speciesCollectionToXmlIncludedString(model.getSpecies()));
+
+		result.append(aliasCollectionParser.compartmentAliasCollectionToXmlString(model.getCompartmentsAliases()));
+		result.append(aliasCollectionParser.complexAliasCollectionToXmlString(model.getComplexAliases()));
+		result.append(aliasCollectionParser.speciesAliasCollectionToXmlString(model.getSpeciesAliases()));
+
+		List<Protein> proteins = new ArrayList<Protein>();
+		List<Gene> genes = new ArrayList<Gene>();
+		List<Rna> rnas = new ArrayList<Rna>();
+		List<AntisenseRna> antisenseRnas = new ArrayList<AntisenseRna>();
+		for (Element element : model.getElements()) {
+			if (element instanceof Protein) {
+				proteins.add((Protein) element);
+			} else if (element instanceof Gene) {
+				genes.add((Gene) element);
+			} else if (element instanceof AntisenseRna) {
+				antisenseRnas.add((AntisenseRna) element);
+			} else if (element instanceof Rna) {
+				rnas.add((Rna) element);
+			}
+		}
+
+		result.append(speciesCollectionXmlParser.proteinCollectionToXmlString(proteins));
+		result.append(speciesCollectionXmlParser.geneCollectionToXmlString(genes));
+		result.append(speciesCollectionXmlParser.rnaCollectionToXmlString(rnas));
+		result.append(speciesCollectionXmlParser.antisenseRnaCollectionToXmlString(antisenseRnas));
+		result.append(layerParser.layerCollectionToXml(model.getLayers()));
+
+		result.append("</celldesigner:extension>\n");
+		result.append("</annotation>\n");
+		return result.toString();
+	}
+
+	@Override
+	public InputStream exportModelToInputStream(Model model) throws InconsistentModelException {
+		String exportedString = toXml(model);
+		InputStream inputStream = new ByteArrayInputStream(exportedString.getBytes());
+		return inputStream;
+	}
+
+	@Override
+	public File exportModelToFile(Model model, String filePath) throws InconsistentModelException, IOException {
+		File file = new File(filePath);
+		String exportedString = toXml(model);
+		FileWriter fileWriter = new FileWriter(file);
+		fileWriter.write(exportedString);
+		fileWriter.flush();
+		fileWriter.close();
+
+		return file;
+	}
+
+	@Override
+	public String getCommonName() {
+		return "CellDesigner SBML";
+	}
+
+	@Override
+	public MimeType getMimeType() {
+		return MimeType.SBML;
+	}
+
+	@Override
+	public String getFileExtension() {
+		return "xml";
+	}
+}
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/alias/ComplexAliasXmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/alias/ComplexAliasXmlParser.java
index d37f75c47b..788b24ef6b 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/alias/ComplexAliasXmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/alias/ComplexAliasXmlParser.java
@@ -1,280 +1,284 @@
-package lcsb.mapviewer.converter.model.celldesigner.alias;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.structure.View;
-import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.species.Species;
-
-/**
- * Parser of CellDesigner xml used for parsing complex aliases. Important: Only
- * one instance per model should be used.
- * 
- * @author Piotr Gawron
- * 
- * @see ComplexAlias
- */
-public class ComplexAliasXmlParser extends AbstractAliasXmlParser<ComplexAlias> {
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private Logger										logger								= Logger.getLogger(ComplexAliasXmlParser.class.getName());
-
-	/**
-	 * Because of the CellDesigner xml model we have to store information about
-	 * all processed Complexes. This infomrmation later on is used for connecting
-	 * complexes in hierarchical view.
-	 */
-	private Map<String, ComplexAlias>	complexAliasesMapById	= new HashMap<String, ComplexAlias>();
-
-	/**
-	 * Because of the CellDesigner xml model we have to store information about
-	 * parents of all Complexes. This infomrmation later on is used for connecting
-	 * complexes in hierarchical view. We cannot do it immediatelly because some
-	 * complexes doesn't exist yet.
-	 */
-	private Map<String, String>				parents								= new HashMap<String, String>();
-
-	/**
-	 * Model for which we are parsing aliases.
-	 */
-	private Model											model									= null;
-
-	/**
-	 * Default constructor with model object for which we parse data.
-	 * 
-	 * @param model
-	 *          model for which we parse elements
-	 */
-	public ComplexAliasXmlParser(Model model) {
-		this.model = model;
-	}
-
-	@Override
-	ComplexAlias parseXmlAlias(Node aliasNode) throws InvalidXmlSchemaException {
-		ComplexAlias result = new ComplexAlias();
-		result.setAliasId(getNodeAttr("id", aliasNode));
-
-		String speciesId = getNodeAttr("species", aliasNode);
-		Species species = model.getSpeciesBySpeciesId(speciesId);
-		if (species == null) {
-			throw new InvalidXmlSchemaException("No species with id=\"" + speciesId + "\" for complex alias \"" + result.getAliasId() + "\"");
-		}
-		result.setSpecies(species);
-
-		String state = "usual";
-		NodeList nodes = aliasNode.getChildNodes();
-		View usualView = null;
-		View briefView = null;
-		for (int x = 0; x < nodes.getLength(); x++) {
-			Node node = nodes.item(x);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if (node.getNodeName().equalsIgnoreCase("celldesigner:activity")) {
-					result.setActivity(getNodeValue(node).equalsIgnoreCase("active"));
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:bounds")) {
-					result.setX(getNodeAttr("X", node));
-					result.setY(getNodeAttr("Y", node));
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:font")) {
-					result.setFontSize(getNodeAttr("size", node));
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:view")) {
-					state = getNodeAttr("state", node);
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:usualView")) {
-					usualView = getCommonParser().getView(node);
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:briefView")) {
-					briefView = getCommonParser().getView(node);
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:backupView")) {
-					// not handled
-					continue;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:info")) {
-					processAliasState(node, result);
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:backupSize")) {
-					// not handled
-					continue;
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:structuralState")) {
-					// not handled
-					continue;
-				} else {
-					throw new InvalidXmlSchemaException("Unknown element of celldesigner:speciesAlias: " + node.getNodeName());
-				}
-			}
-		}
-
-		View view = null;
-		if (state.equalsIgnoreCase("usual")) {
-			view = usualView;
-		} else if (state.equalsIgnoreCase("brief")) {
-			view = briefView;
-		} else if (state.equalsIgnoreCase("complexparentbrief")) {
-			view = briefView;
-		}
-
-		if (view != null) {
-			// inner position defines the position in compartment or complexAlias
-			// result.moveBy(view.innerPosition);
-			result.setWidth(view.getBoxSize().width);
-			result.setHeight(view.getBoxSize().height);
-			result.setLineWidth(view.getSingleLine().getWidth());
-			result.setColor(view.getColor());
-		} else if (!state.equalsIgnoreCase("complexnoborder")) {
-			throw new InvalidXmlSchemaException("No view (" + state + ") in ComplexAlias for " + result.getAliasId());
-		}
-		result.setState(state);
-		String compartmentAliasId = getNodeAttr("compartmentAlias", aliasNode);
-		if (!compartmentAliasId.isEmpty()) {
-			CompartmentAlias ca = model.getCompartmentAliasByCompartmentAliasId(compartmentAliasId);
-			if (ca == null) {
-				throw new InvalidXmlSchemaException("CompartmentAlias does not exist: " + compartmentAliasId);
-			} else {
-				result.setParent(ca);
-				ca.addAlias(result);
-			}
-		}
-		String complexSpeciesAliasId = getNodeAttr("complexSpeciesAlias", aliasNode);
-		if (!complexSpeciesAliasId.equals("")) {
-			parents.put(result.getAliasId(), complexSpeciesAliasId);
-		}
-		complexAliasesMapById.put(result.getAliasId(), result);
-		return result;
-	}
-
-	/**
-	 * Process node with information about alias state and puts data into alias.
-	 * 
-	 * @param node
-	 *          node where information about alias state is stored
-	 * @param alias
-	 *          alias object to be modified if necessary
-	 */
-	private void processAliasState(Node node, SpeciesAlias alias) {
-		String state = getNodeAttr("state", node);
-		if ("open".equalsIgnoreCase(state)) {
-			String prefix = getNodeAttr("prefix", node);
-			String label = getNodeAttr("label", node);
-			alias.setAliasStatePrefix(prefix);
-			alias.setAliasStateLabel(label);
-		} else if ("empty".equalsIgnoreCase(state)) {
-			return;
-		} else if (state == null || state.isEmpty()) {
-			return;
-		} else {
-			throw new NotImplementedException("[Alias: " + alias.getAliasId() + "] Unkown alias state: " + state);
-		}
-
-	}
-
-	/**
-	 * Adds parent reference for the complexAlias.
-	 * 
-	 * @param alias
-	 *          alias for which we want to add parent information
-	 */
-	public void addReference(ComplexAlias alias) {
-		String parentId = parents.get(alias.getAliasId());
-		if (parentId != null) {
-			ComplexAlias ca = complexAliasesMapById.get(parentId);
-			if (ca == null) {
-				throw new InvalidArgumentException("Parent complex alias does not exist: " + parentId + " for alias: " + alias.getAliasId());
-			} else {
-				alias.setParent(ca);
-				ca.addAlias(alias);
-			}
-		}
-	}
-
-	@Override
-	public String toXml(ComplexAlias alias) {
-		Species species = alias.getSpecies();
-		CompartmentAlias ca = null;
-		// we have to exclude artifitial compartment aliases, becuase they aren't
-		// exported to CellDesigner file
-		if (alias.getParent() instanceof CompartmentAlias && !(alias.getParent() instanceof ArtifitialCompartmentAlias)) {
-			ca = (CompartmentAlias) alias.getParent();
-		} else if (alias.getCompartmentAlias() != null && !(alias.getCompartmentAlias() instanceof ArtifitialCompartmentAlias)) {
-			ca = alias.getCompartmentAlias();
-		} else if (alias.getComplexAlias() == null) {
-			ModelData modelData = alias.getModelData();
-			if (modelData != null) {
-				for (CompartmentAlias cAlias : modelData.getModel().getCompartmentsAliases()) {
-					if (!(cAlias instanceof ArtifitialCompartmentAlias) && cAlias.cross(alias)) {
-						if (ca == null) {
-							ca = cAlias;
-						} else if (ca.getSize() > cAlias.getSize()) {
-							ca = cAlias;
-						}
-					}
-				}
-			}
-		}
-
-		ComplexAlias complexAlias = null;
-		if (alias.getParent() instanceof ComplexAlias) {
-			complexAlias = (ComplexAlias) alias.getParent();
-		}
-
-		String compartmentAliasId = null;
-		if (ca != null) {
-			compartmentAliasId = ca.getAliasId();
-		}
-		StringBuilder sb = new StringBuilder("");
-		sb.append("<celldesigner:complexSpeciesAlias ");
-		sb.append("id=\"" + alias.getAliasId() + "\" ");
-		sb.append("species=\"" + species.getElementId() + "\" ");
-		if (compartmentAliasId != null) {
-			sb.append("compartmentAlias=\"" + compartmentAliasId + "\" ");
-		}
-		if (complexAlias != null) {
-			sb.append("complexSpeciesAlias=\"" + complexAlias.getAliasId() + "\"");
-		}
-		sb.append(">\n");
-
-		if (alias.getActivity() != null) {
-			if (alias.getActivity()) {
-				sb.append("<celldesigner:activity>active</celldesigner:activity>\n");
-			} else {
-				sb.append("<celldesigner:activity>inactive</celldesigner:activity>\n");
-			}
-		}
-
-		sb.append("<celldesigner:bounds ");
-		sb.append("x=\"" + alias.getX() + "\" ");
-		sb.append("y=\"" + alias.getY() + "\" ");
-		sb.append("w=\"" + alias.getWidth() + "\" ");
-		sb.append("h=\"" + alias.getHeight() + "\" ");
-		sb.append("/>\n");
-
-		sb.append("<celldesigner:font size=\"" + alias.getFontSize() + "\"/>");
-
-		sb.append("<celldesigner:view state=\"usual\"/>\n");
-		sb.append("<celldesigner:usualView>");
-		sb.append("<celldesigner:innerPosition x=\"" + alias.getX() + "\" y=\"" + alias.getY() + "\"/>");
-		sb.append("<celldesigner:boxSize width=\"" + alias.getWidth() + "\" height=\"" + alias.getHeight() + "\"/>");
-		sb.append("<celldesigner:singleLine width=\"" + alias.getLineWidth() + "\"/>");
-		sb.append("<celldesigner:paint color=\"" + colorToString(alias.getColor()) + "\" scheme=\"Color\"/>");
-		sb.append("</celldesigner:usualView>\n");
-		sb.append("<celldesigner:briefView>");
-		sb.append("<celldesigner:innerPosition x=\"" + alias.getX() + "\" y=\"" + alias.getY() + "\"/>");
-		sb.append("<celldesigner:boxSize width=\"" + alias.getWidth() + "\" height=\"" + alias.getHeight() + "\"/>");
-		sb.append("<celldesigner:singleLine width=\"" + alias.getWidth() + "\"/>");
-		sb.append("<celldesigner:paint color=\"" + colorToString(alias.getColor()) + "\" scheme=\"Color\"/>");
-		sb.append("</celldesigner:briefView>\n");
-
-		sb.append("</celldesigner:complexSpeciesAlias>\n");
-		return sb.toString();
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.alias;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.structure.View;
+import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Species;
+
+/**
+ * Parser of CellDesigner xml used for parsing complex aliases. Important: Only
+ * one instance per model should be used.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see ComplexAlias
+ */
+public class ComplexAliasXmlParser extends AbstractAliasXmlParser<ComplexAlias> {
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private Logger										logger								= Logger.getLogger(ComplexAliasXmlParser.class.getName());
+
+	/**
+	 * Because of the CellDesigner xml model we have to store information about
+	 * all processed Complexes. This infomrmation later on is used for connecting
+	 * complexes in hierarchical view.
+	 */
+	private Map<String, ComplexAlias>	complexAliasesMapById	= new HashMap<String, ComplexAlias>();
+
+	/**
+	 * Because of the CellDesigner xml model we have to store information about
+	 * parents of all Complexes. This infomrmation later on is used for connecting
+	 * complexes in hierarchical view. We cannot do it immediatelly because some
+	 * complexes doesn't exist yet.
+	 */
+	private Map<String, String>				parents								= new HashMap<String, String>();
+
+	/**
+	 * Model for which we are parsing aliases.
+	 */
+	private Model											model									= null;
+
+	/**
+	 * Default constructor with model object for which we parse data.
+	 * 
+	 * @param model
+	 *          model for which we parse elements
+	 */
+	public ComplexAliasXmlParser(Model model) {
+		this.model = model;
+	}
+
+	@Override
+	ComplexAlias parseXmlAlias(Node aliasNode) throws InvalidXmlSchemaException {
+
+		String aliasId = getNodeAttr("id", aliasNode);
+
+		String speciesId = getNodeAttr("species", aliasNode);
+		Species species = model.getSpeciesBySpeciesId(speciesId);
+		if (species == null) {
+			throw new InvalidXmlSchemaException("No species with id=\"" + speciesId + "\" for complex alias \"" + aliasId + "\"");
+		} else if (!(species instanceof ComplexSpecies)) {
+			throw new InvalidXmlSchemaException("Species with id" + speciesId + " should be complex for alias:  " + aliasId + ". Found: " + species.getClass());
+		}
+		ComplexAlias result = new ComplexAlias((ComplexSpecies) species);
+		result.setAliasId(aliasId);
+
+		String state = "usual";
+		NodeList nodes = aliasNode.getChildNodes();
+		View usualView = null;
+		View briefView = null;
+		for (int x = 0; x < nodes.getLength(); x++) {
+			Node node = nodes.item(x);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if (node.getNodeName().equalsIgnoreCase("celldesigner:activity")) {
+					result.setActivity(getNodeValue(node).equalsIgnoreCase("active"));
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:bounds")) {
+					result.setX(getNodeAttr("X", node));
+					result.setY(getNodeAttr("Y", node));
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:font")) {
+					result.setFontSize(getNodeAttr("size", node));
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:view")) {
+					state = getNodeAttr("state", node);
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:usualView")) {
+					usualView = getCommonParser().getView(node);
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:briefView")) {
+					briefView = getCommonParser().getView(node);
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:backupView")) {
+					// not handled
+					continue;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:info")) {
+					processAliasState(node, result);
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:backupSize")) {
+					// not handled
+					continue;
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:structuralState")) {
+					// not handled
+					continue;
+				} else {
+					throw new InvalidXmlSchemaException("Unknown element of celldesigner:speciesAlias: " + node.getNodeName());
+				}
+			}
+		}
+
+		View view = null;
+		if (state.equalsIgnoreCase("usual")) {
+			view = usualView;
+		} else if (state.equalsIgnoreCase("brief")) {
+			view = briefView;
+		} else if (state.equalsIgnoreCase("complexparentbrief")) {
+			view = briefView;
+		}
+
+		if (view != null) {
+			// inner position defines the position in compartment or complexAlias
+			// result.moveBy(view.innerPosition);
+			result.setWidth(view.getBoxSize().width);
+			result.setHeight(view.getBoxSize().height);
+			result.setLineWidth(view.getSingleLine().getWidth());
+			result.setColor(view.getColor());
+		} else if (!state.equalsIgnoreCase("complexnoborder")) {
+			throw new InvalidXmlSchemaException("No view (" + state + ") in ComplexAlias for " + result.getAliasId());
+		}
+		result.setState(state);
+		String compartmentAliasId = getNodeAttr("compartmentAlias", aliasNode);
+		if (!compartmentAliasId.isEmpty()) {
+			CompartmentAlias ca = model.getCompartmentAliasByCompartmentAliasId(compartmentAliasId);
+			if (ca == null) {
+				throw new InvalidXmlSchemaException("CompartmentAlias does not exist: " + compartmentAliasId);
+			} else {
+				result.setParent(ca);
+				ca.addAlias(result);
+			}
+		}
+		String complexSpeciesAliasId = getNodeAttr("complexSpeciesAlias", aliasNode);
+		if (!complexSpeciesAliasId.equals("")) {
+			parents.put(result.getAliasId(), complexSpeciesAliasId);
+		}
+		complexAliasesMapById.put(result.getAliasId(), result);
+		return result;
+	}
+
+	/**
+	 * Process node with information about alias state and puts data into alias.
+	 * 
+	 * @param node
+	 *          node where information about alias state is stored
+	 * @param alias
+	 *          alias object to be modified if necessary
+	 */
+	private void processAliasState(Node node, SpeciesAlias alias) {
+		String state = getNodeAttr("state", node);
+		if ("open".equalsIgnoreCase(state)) {
+			String prefix = getNodeAttr("prefix", node);
+			String label = getNodeAttr("label", node);
+			alias.setAliasStatePrefix(prefix);
+			alias.setAliasStateLabel(label);
+		} else if ("empty".equalsIgnoreCase(state)) {
+			return;
+		} else if (state == null || state.isEmpty()) {
+			return;
+		} else {
+			throw new NotImplementedException("[Alias: " + alias.getAliasId() + "] Unkown alias state: " + state);
+		}
+
+	}
+
+	/**
+	 * Adds parent reference for the complexAlias.
+	 * 
+	 * @param alias
+	 *          alias for which we want to add parent information
+	 */
+	public void addReference(ComplexAlias alias) {
+		String parentId = parents.get(alias.getAliasId());
+		if (parentId != null) {
+			ComplexAlias ca = complexAliasesMapById.get(parentId);
+			if (ca == null) {
+				throw new InvalidArgumentException("Parent complex alias does not exist: " + parentId + " for alias: " + alias.getAliasId());
+			} else {
+				alias.setParent(ca);
+				ca.addAlias(alias);
+			}
+		}
+	}
+
+	@Override
+	public String toXml(ComplexAlias alias) {
+		Species species = alias.getSpecies();
+		CompartmentAlias ca = null;
+		// we have to exclude artifitial compartment aliases, becuase they aren't
+		// exported to CellDesigner file
+		if (alias.getParent() instanceof CompartmentAlias && !(alias.getParent() instanceof ArtifitialCompartmentAlias)) {
+			ca = (CompartmentAlias) alias.getParent();
+		} else if (alias.getCompartmentAlias() != null && !(alias.getCompartmentAlias() instanceof ArtifitialCompartmentAlias)) {
+			ca = alias.getCompartmentAlias();
+		} else if (alias.getComplexAlias() == null) {
+			ModelData modelData = alias.getModelData();
+			if (modelData != null) {
+				for (CompartmentAlias cAlias : modelData.getModel().getCompartmentsAliases()) {
+					if (!(cAlias instanceof ArtifitialCompartmentAlias) && cAlias.cross(alias)) {
+						if (ca == null) {
+							ca = cAlias;
+						} else if (ca.getSize() > cAlias.getSize()) {
+							ca = cAlias;
+						}
+					}
+				}
+			}
+		}
+
+		ComplexAlias complexAlias = null;
+		if (alias.getParent() instanceof ComplexAlias) {
+			complexAlias = (ComplexAlias) alias.getParent();
+		}
+
+		String compartmentAliasId = null;
+		if (ca != null) {
+			compartmentAliasId = ca.getAliasId();
+		}
+		StringBuilder sb = new StringBuilder("");
+		sb.append("<celldesigner:complexSpeciesAlias ");
+		sb.append("id=\"" + alias.getAliasId() + "\" ");
+		sb.append("species=\"" + species.getElementId() + "\" ");
+		if (compartmentAliasId != null) {
+			sb.append("compartmentAlias=\"" + compartmentAliasId + "\" ");
+		}
+		if (complexAlias != null) {
+			sb.append("complexSpeciesAlias=\"" + complexAlias.getAliasId() + "\"");
+		}
+		sb.append(">\n");
+
+		if (alias.getActivity() != null) {
+			if (alias.getActivity()) {
+				sb.append("<celldesigner:activity>active</celldesigner:activity>\n");
+			} else {
+				sb.append("<celldesigner:activity>inactive</celldesigner:activity>\n");
+			}
+		}
+
+		sb.append("<celldesigner:bounds ");
+		sb.append("x=\"" + alias.getX() + "\" ");
+		sb.append("y=\"" + alias.getY() + "\" ");
+		sb.append("w=\"" + alias.getWidth() + "\" ");
+		sb.append("h=\"" + alias.getHeight() + "\" ");
+		sb.append("/>\n");
+
+		sb.append("<celldesigner:font size=\"" + alias.getFontSize() + "\"/>");
+
+		sb.append("<celldesigner:view state=\"usual\"/>\n");
+		sb.append("<celldesigner:usualView>");
+		sb.append("<celldesigner:innerPosition x=\"" + alias.getX() + "\" y=\"" + alias.getY() + "\"/>");
+		sb.append("<celldesigner:boxSize width=\"" + alias.getWidth() + "\" height=\"" + alias.getHeight() + "\"/>");
+		sb.append("<celldesigner:singleLine width=\"" + alias.getLineWidth() + "\"/>");
+		sb.append("<celldesigner:paint color=\"" + colorToString(alias.getColor()) + "\" scheme=\"Color\"/>");
+		sb.append("</celldesigner:usualView>\n");
+		sb.append("<celldesigner:briefView>");
+		sb.append("<celldesigner:innerPosition x=\"" + alias.getX() + "\" y=\"" + alias.getY() + "\"/>");
+		sb.append("<celldesigner:boxSize width=\"" + alias.getWidth() + "\" height=\"" + alias.getHeight() + "\"/>");
+		sb.append("<celldesigner:singleLine width=\"" + alias.getWidth() + "\"/>");
+		sb.append("<celldesigner:paint color=\"" + colorToString(alias.getColor()) + "\" scheme=\"Color\"/>");
+		sb.append("</celldesigner:briefView>\n");
+
+		sb.append("</celldesigner:complexSpeciesAlias>\n");
+		return sb.toString();
+	}
+
+}
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/alias/SpeciesAliasXmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/alias/SpeciesAliasXmlParser.java
index 0ddff28c70..8f79d94262 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/alias/SpeciesAliasXmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/alias/SpeciesAliasXmlParser.java
@@ -1,242 +1,240 @@
-package lcsb.mapviewer.converter.model.celldesigner.alias;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.structure.View;
-import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Species;
-
-/**
- * Parser of CellDesigner xml used for parsing SpeciesAlias.
- * 
- * @author Piotr Gawron
- * 
- * @see ComplexAlias
- */
-public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<SpeciesAlias> {
-	/**
-	 * Default class logger.
-	 */
-	private Logger logger	= Logger.getLogger(SpeciesAliasXmlParser.class.getName());
-
-	/**
-	 * Model for which we are parsing aliases.
-	 */
-	private Model	 model	= null;
-
-	/**
-	 * Default constructor with model object for which we parse data.
-	 * 
-	 * @param model
-	 *          model for which we parse elements
-	 */
-	public SpeciesAliasXmlParser(Model model) {
-		this.model = model;
-	}
-
-	@Override
-	SpeciesAlias parseXmlAlias(Node aliasNode) throws InvalidXmlSchemaException {
-		SpeciesAlias result = new SpeciesAlias();
-
-		String speciesId = getNodeAttr("species", aliasNode);
-		String aliasId = getNodeAttr("id", aliasNode);
-		Species species = model.getSpeciesBySpeciesId(speciesId);
-		if (species == null) {
-			throw new InvalidXmlSchemaException("Unknown species for alias (speciesId: " + speciesId + ")");
-		}
-		if (species instanceof ComplexSpecies) {
-			logger.warn("[" + speciesId + "," + aliasId + "]\tSpecies is defined as a complex, but alias is not a complex. Changing alias to complex.");
-			result = new ComplexAlias();
-		}
-		result.setSpecies(species);
-
-		result.setAliasId(aliasId);
-
-		String state = "usual";
-		NodeList nodes = aliasNode.getChildNodes();
-		View usualView = null;
-		View briefView = null;
-		for (int x = 0; x < nodes.getLength(); x++) {
-			Node node = nodes.item(x);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if (node.getNodeName().equalsIgnoreCase("celldesigner:activity")) {
-					result.setActivity(getNodeValue(node).equalsIgnoreCase("active"));
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:bounds")) {
-					result.setX(getNodeAttr("X", node));
-					result.setY(getNodeAttr("Y", node));
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:font")) {
-					result.setFontSize(getNodeAttr("size", node));
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:view")) {
-					state = getNodeAttr("state", node);
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:usualView")) {
-					usualView = getCommonParser().getView(node);
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:briefView")) {
-					briefView = getCommonParser().getView(node);
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:info")) {
-					processAliasState(node, result);
-				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:structuralState")) {
-					// not handled
-					continue;
-				} else {
-					throw new InvalidXmlSchemaException("Unknown element of celldesigner:speciesAlias: " + node.getNodeName());
-				}
-			}
-		}
-
-		View view = null;
-		if (state.equalsIgnoreCase("usual")) {
-			view = usualView;
-		} else if (state.equalsIgnoreCase("brief")) {
-			view = briefView;
-		}
-
-		if (view != null) {
-			// inner position defines the position in compartment
-			// result.moveBy(view.innerPosition);
-			result.setWidth(view.getBoxSize().width);
-			result.setHeight(view.getBoxSize().height);
-			result.setLineWidth(view.getSingleLine().getWidth());
-			result.setColor(view.getColor());
-		} else {
-			throw new InvalidXmlSchemaException("No view in Alias");
-		}
-		result.setState(state);
-		String compartmentAliasId = getNodeAttr("compartmentAlias", aliasNode);
-		if (!compartmentAliasId.isEmpty()) {
-			CompartmentAlias ca = model.getCompartmentAliasByCompartmentAliasId(compartmentAliasId);
-			if (ca == null) {
-				throw new InvalidXmlSchemaException("CompartmentAlias does not exist: " + compartmentAliasId);
-			} else {
-				result.setParent(ca);
-			}
-		}
-		String complexAliasId = getNodeAttr("complexSpeciesAlias", aliasNode);
-		if (!complexAliasId.isEmpty()) {
-			ComplexAlias alias = (ComplexAlias) model.getAliasByAliasId(complexAliasId);
-			if (alias == null) {
-				throw new InvalidXmlSchemaException("ComplexAlias does not exist: " + complexAliasId + ", current: " + result.getAliasId());
-			} else {
-				result.setParent(alias);
-				alias.addAlias(result);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Process node with information about alias state and puts data into alias.
-	 * 
-	 * @param node
-	 *          node where information about alias state is stored
-	 * @param alias
-	 *          alias object to be modified if necessary
-	 */
-	private void processAliasState(Node node, SpeciesAlias alias) {
-		String state = getNodeAttr("state", node);
-		if ("open".equalsIgnoreCase(state)) {
-			String prefix = getNodeAttr("prefix", node);
-			String label = getNodeAttr("label", node);
-			alias.setAliasStatePrefix(prefix);
-			alias.setAliasStateLabel(label);
-		} else if ("empty".equalsIgnoreCase(state)) {
-			return;
-		} else if (state == null || state.isEmpty()) {
-			return;
-		} else {
-			throw new NotImplementedException("[Alias: " + alias.getAliasId() + "] Unkown alias state: " + state);
-		}
-
-	}
-
-	@Override
-	public String toXml(SpeciesAlias alias) {
-		Species species = alias.getSpecies();
-		CompartmentAlias ca = null;
-		// artifitial compartment aliases should be excluded
-		if (alias.getParent() instanceof CompartmentAlias && !(alias.getParent() instanceof ArtifitialCompartmentAlias)) {
-			ca = (CompartmentAlias) alias.getParent();
-		} else if (alias.getComplexAlias() == null) {
-			ModelData model = alias.getModelData();
-			if (model != null) {
-				for (CompartmentAlias cAlias : model.getModel().getCompartmentsAliases()) {
-					if (!(cAlias instanceof ArtifitialCompartmentAlias) && cAlias.cross(alias)) {
-						if (ca == null) {
-							ca = cAlias;
-						} else if (ca.getSize() > cAlias.getSize()) {
-							ca = cAlias;
-						}
-					}
-				}
-			}
-		}
-
-		ComplexAlias complexAlias = null;
-		if (alias.getParent() instanceof ComplexAlias) {
-			complexAlias = (ComplexAlias) alias.getParent();
-		}
-
-		String compartmentAliasId = null;
-		if (ca != null) {
-			compartmentAliasId = ca.getAliasId();
-		}
-		StringBuilder sb = new StringBuilder("");
-		sb.append("<celldesigner:speciesAlias ");
-		sb.append("id=\"" + alias.getAliasId() + "\" ");
-		sb.append("species=\"" + species.getElementId() + "\" ");
-		if (compartmentAliasId != null) {
-			sb.append("compartmentAlias=\"" + compartmentAliasId + "\" ");
-		}
-
-		if (complexAlias != null) {
-			sb.append("complexSpeciesAlias=\"" + complexAlias.getAliasId() + "\" ");
-		}
-		sb.append(">\n");
-
-		if (alias.getActivity() != null) {
-			if (alias.getActivity()) {
-				sb.append("<celldesigner:activity>active</celldesigner:activity>\n");
-			} else {
-				sb.append("<celldesigner:activity>inactive</celldesigner:activity>\n");
-			}
-		}
-
-		sb.append("<celldesigner:bounds ");
-		sb.append("x=\"" + alias.getX() + "\" ");
-		sb.append("y=\"" + alias.getY() + "\" ");
-		sb.append("w=\"" + alias.getWidth() + "\" ");
-		sb.append("h=\"" + alias.getHeight() + "\" ");
-		sb.append("/>\n");
-
-		sb.append("<celldesigner:font size=\"" + alias.getFontSize() + "\"/>\n");
-
-		// TODO to be improved
-		sb.append("<celldesigner:view state=\"usual\"/>\n");
-		sb.append("<celldesigner:usualView>");
-		sb.append("<celldesigner:innerPosition x=\"" + alias.getX() + "\" y=\"" + alias.getY() + "\"/>");
-		sb.append("<celldesigner:boxSize width=\"" + alias.getWidth() + "\" height=\"" + alias.getHeight() + "\"/>");
-		sb.append("<celldesigner:singleLine width=\"" + alias.getLineWidth() + "\"/>");
-		sb.append("<celldesigner:paint color=\"" + colorToString(alias.getColor()) + "\" scheme=\"Color\"/>");
-		sb.append("</celldesigner:usualView>\n");
-		sb.append("<celldesigner:briefView>");
-		sb.append("<celldesigner:innerPosition x=\"" + alias.getX() + "\" y=\"" + alias.getY() + "\"/>");
-		sb.append("<celldesigner:boxSize width=\"" + alias.getWidth() + "\" height=\"" + alias.getHeight() + "\"/>");
-		sb.append("<celldesigner:singleLine width=\"" + alias.getLineWidth() + "\"/>");
-		sb.append("<celldesigner:paint color=\"" + colorToString(alias.getColor()) + "\" scheme=\"Color\"/>");
-		sb.append("</celldesigner:briefView>\n");
-		if (alias.getAliasStateLabel() != null || alias.getAliasStatePrefix() != null) {
-			sb.append("<celldesigner:info state=\"open\" prefix=\"" + alias.getAliasStatePrefix() + "\" label=\"" + alias.getAliasStateLabel() + "\"/>\n");
-		}
-		sb.append("</celldesigner:speciesAlias>\n");
-		return sb.toString();
-	}
-}
+package lcsb.mapviewer.converter.model.celldesigner.alias;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.structure.View;
+import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Species;
+
+/**
+ * Parser of CellDesigner xml used for parsing SpeciesAlias.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see ComplexAlias
+ */
+public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<SpeciesAlias> {
+	/**
+	 * Default class logger.
+	 */
+	private Logger logger	= Logger.getLogger(SpeciesAliasXmlParser.class.getName());
+
+	/**
+	 * Model for which we are parsing aliases.
+	 */
+	private Model	 model	= null;
+
+	/**
+	 * Default constructor with model object for which we parse data.
+	 * 
+	 * @param model
+	 *          model for which we parse elements
+	 */
+	public SpeciesAliasXmlParser(Model model) {
+		this.model = model;
+	}
+
+	@Override
+	SpeciesAlias parseXmlAlias(Node aliasNode) throws InvalidXmlSchemaException {
+
+		String speciesId = getNodeAttr("species", aliasNode);
+		String aliasId = getNodeAttr("id", aliasNode);
+		Species species = model.getSpeciesBySpeciesId(speciesId);
+		if (species == null) {
+			throw new InvalidXmlSchemaException("Unknown species for alias (speciesId: " + speciesId + ")");
+		}
+		if (species instanceof ComplexSpecies) {
+			logger.warn("[" + speciesId + "," + aliasId + "]\tSpecies is defined as a complex, but alias is not a complex. Changing alias to complex.");
+		}
+		
+		SpeciesAlias result = SpeciesAlias.createAlias(species);
+		result.setAliasId(aliasId);
+
+		String state = "usual";
+		NodeList nodes = aliasNode.getChildNodes();
+		View usualView = null;
+		View briefView = null;
+		for (int x = 0; x < nodes.getLength(); x++) {
+			Node node = nodes.item(x);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if (node.getNodeName().equalsIgnoreCase("celldesigner:activity")) {
+					result.setActivity(getNodeValue(node).equalsIgnoreCase("active"));
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:bounds")) {
+					result.setX(getNodeAttr("X", node));
+					result.setY(getNodeAttr("Y", node));
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:font")) {
+					result.setFontSize(getNodeAttr("size", node));
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:view")) {
+					state = getNodeAttr("state", node);
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:usualView")) {
+					usualView = getCommonParser().getView(node);
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:briefView")) {
+					briefView = getCommonParser().getView(node);
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:info")) {
+					processAliasState(node, result);
+				} else if (node.getNodeName().equalsIgnoreCase("celldesigner:structuralState")) {
+					// not handled
+					continue;
+				} else {
+					throw new InvalidXmlSchemaException("Unknown element of celldesigner:speciesAlias: " + node.getNodeName());
+				}
+			}
+		}
+
+		View view = null;
+		if (state.equalsIgnoreCase("usual")) {
+			view = usualView;
+		} else if (state.equalsIgnoreCase("brief")) {
+			view = briefView;
+		}
+
+		if (view != null) {
+			// inner position defines the position in compartment
+			// result.moveBy(view.innerPosition);
+			result.setWidth(view.getBoxSize().width);
+			result.setHeight(view.getBoxSize().height);
+			result.setLineWidth(view.getSingleLine().getWidth());
+			result.setColor(view.getColor());
+		} else {
+			throw new InvalidXmlSchemaException("No view in Alias");
+		}
+		result.setState(state);
+		String compartmentAliasId = getNodeAttr("compartmentAlias", aliasNode);
+		if (!compartmentAliasId.isEmpty()) {
+			CompartmentAlias ca = model.getCompartmentAliasByCompartmentAliasId(compartmentAliasId);
+			if (ca == null) {
+				throw new InvalidXmlSchemaException("CompartmentAlias does not exist: " + compartmentAliasId);
+			} else {
+				result.setParent(ca);
+			}
+		}
+		String complexAliasId = getNodeAttr("complexSpeciesAlias", aliasNode);
+		if (!complexAliasId.isEmpty()) {
+			ComplexAlias alias = (ComplexAlias) model.getAliasByAliasId(complexAliasId);
+			if (alias == null) {
+				throw new InvalidXmlSchemaException("ComplexAlias does not exist: " + complexAliasId + ", current: " + result.getAliasId());
+			} else {
+				result.setParent(alias);
+				alias.addAlias(result);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Process node with information about alias state and puts data into alias.
+	 * 
+	 * @param node
+	 *          node where information about alias state is stored
+	 * @param alias
+	 *          alias object to be modified if necessary
+	 */
+	private void processAliasState(Node node, SpeciesAlias alias) {
+		String state = getNodeAttr("state", node);
+		if ("open".equalsIgnoreCase(state)) {
+			String prefix = getNodeAttr("prefix", node);
+			String label = getNodeAttr("label", node);
+			alias.setAliasStatePrefix(prefix);
+			alias.setAliasStateLabel(label);
+		} else if ("empty".equalsIgnoreCase(state)) {
+			return;
+		} else if (state == null || state.isEmpty()) {
+			return;
+		} else {
+			throw new NotImplementedException("[Alias: " + alias.getAliasId() + "] Unkown alias state: " + state);
+		}
+
+	}
+
+	@Override
+	public String toXml(SpeciesAlias alias) {
+		Species species = alias.getSpecies();
+		CompartmentAlias ca = null;
+		// artifitial compartment aliases should be excluded
+		if (alias.getParent() instanceof CompartmentAlias && !(alias.getParent() instanceof ArtifitialCompartmentAlias)) {
+			ca = (CompartmentAlias) alias.getParent();
+		} else if (alias.getComplexAlias() == null) {
+			ModelData model = alias.getModelData();
+			if (model != null) {
+				for (CompartmentAlias cAlias : model.getModel().getCompartmentsAliases()) {
+					if (!(cAlias instanceof ArtifitialCompartmentAlias) && cAlias.cross(alias)) {
+						if (ca == null) {
+							ca = cAlias;
+						} else if (ca.getSize() > cAlias.getSize()) {
+							ca = cAlias;
+						}
+					}
+				}
+			}
+		}
+
+		ComplexAlias complexAlias = null;
+		if (alias.getParent() instanceof ComplexAlias) {
+			complexAlias = (ComplexAlias) alias.getParent();
+		}
+
+		String compartmentAliasId = null;
+		if (ca != null) {
+			compartmentAliasId = ca.getAliasId();
+		}
+		StringBuilder sb = new StringBuilder("");
+		sb.append("<celldesigner:speciesAlias ");
+		sb.append("id=\"" + alias.getAliasId() + "\" ");
+		sb.append("species=\"" + species.getElementId() + "\" ");
+		if (compartmentAliasId != null) {
+			sb.append("compartmentAlias=\"" + compartmentAliasId + "\" ");
+		}
+
+		if (complexAlias != null) {
+			sb.append("complexSpeciesAlias=\"" + complexAlias.getAliasId() + "\" ");
+		}
+		sb.append(">\n");
+
+		if (alias.getActivity() != null) {
+			if (alias.getActivity()) {
+				sb.append("<celldesigner:activity>active</celldesigner:activity>\n");
+			} else {
+				sb.append("<celldesigner:activity>inactive</celldesigner:activity>\n");
+			}
+		}
+
+		sb.append("<celldesigner:bounds ");
+		sb.append("x=\"" + alias.getX() + "\" ");
+		sb.append("y=\"" + alias.getY() + "\" ");
+		sb.append("w=\"" + alias.getWidth() + "\" ");
+		sb.append("h=\"" + alias.getHeight() + "\" ");
+		sb.append("/>\n");
+
+		sb.append("<celldesigner:font size=\"" + alias.getFontSize() + "\"/>\n");
+
+		// TODO to be improved
+		sb.append("<celldesigner:view state=\"usual\"/>\n");
+		sb.append("<celldesigner:usualView>");
+		sb.append("<celldesigner:innerPosition x=\"" + alias.getX() + "\" y=\"" + alias.getY() + "\"/>");
+		sb.append("<celldesigner:boxSize width=\"" + alias.getWidth() + "\" height=\"" + alias.getHeight() + "\"/>");
+		sb.append("<celldesigner:singleLine width=\"" + alias.getLineWidth() + "\"/>");
+		sb.append("<celldesigner:paint color=\"" + colorToString(alias.getColor()) + "\" scheme=\"Color\"/>");
+		sb.append("</celldesigner:usualView>\n");
+		sb.append("<celldesigner:briefView>");
+		sb.append("<celldesigner:innerPosition x=\"" + alias.getX() + "\" y=\"" + alias.getY() + "\"/>");
+		sb.append("<celldesigner:boxSize width=\"" + alias.getWidth() + "\" height=\"" + alias.getHeight() + "\"/>");
+		sb.append("<celldesigner:singleLine width=\"" + alias.getLineWidth() + "\"/>");
+		sb.append("<celldesigner:paint color=\"" + colorToString(alias.getColor()) + "\" scheme=\"Color\"/>");
+		sb.append("</celldesigner:briefView>\n");
+		if (alias.getAliasStateLabel() != null || alias.getAliasStatePrefix() != null) {
+			sb.append("<celldesigner:info state=\"open\" prefix=\"" + alias.getAliasStatePrefix() + "\" label=\"" + alias.getAliasStateLabel() + "\"/>\n");
+		}
+		sb.append("</celldesigner:speciesAlias>\n");
+		return sb.toString();
+	}
+}
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java
index 7a24eea2f9..897444a1c1 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java
@@ -26,7 +26,10 @@ import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamRelationType;
 import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.ProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.Protein;
 import lcsb.mapviewer.model.map.species.Species;
 import lcsb.mapviewer.modelutils.map.ElementUtils;
 
@@ -692,4 +695,19 @@ public class RestAnnotationParser extends XmlParser {
 		}
 	}
 
+	public void processNotes(Node node, Species element) {
+		String notes = getNotes(node);
+		if (element.getClass().equals(Protein.class)) {
+			processNotes(notes, new ProteinAlias((Protein) element) {
+
+				@Override
+				public SpeciesAlias copy() {
+					throw new NotImplementedException();
+				}
+			});
+		} else {
+			processNotes(notes, SpeciesAlias.createAlias(element));
+		}
+	}
+
 }
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinCellDesignerAliasConverter.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinCellDesignerAliasConverter.java
index a58f05b382..4964216086 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinCellDesignerAliasConverter.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinCellDesignerAliasConverter.java
@@ -1,218 +1,223 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-import java.awt.geom.RoundRectangle2D;
-import java.util.ArrayList;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.IonChannelProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.ReceptorProtein;
-import lcsb.mapviewer.model.map.species.TruncatedProtein;
-
-/**
- * Class that provides CellDesigner specific graphical information for Protein.
- * It's used for conversion from xml to normal x,y coordinates.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ProteinCellDesignerAliasConverter extends AbstractCellDesignerAliasConverter<SpeciesAlias> {
-	/**
-	 * Default class logger.
-	 */
-	private static Logger		 logger																		 = Logger.getLogger(ProteinCellDesignerAliasConverter.class);
-
-	/**
-	 * How big should be the arc in rectangle for generic protein representation.
-	 */
-	private static final int GENERIC_PROTEIN_RECTANGLE_CORNER_ARC_SIZE = 10;
-
-	@Override
-	public Point2D getPointCoordinates(SpeciesAlias alias, CellDesignerAnchor anchor) {
-		Point2D result = null;
-		if (invalidAnchorPosition(alias, anchor)) {
-			result = alias.getCenter();
-		} else {
-			Protein protein = (Protein) alias.getSpecies();
-			int homodir = protein.getHomodimer();
-
-			alias.setWidth(alias.getWidth() - AbstractCellDesignerAliasConverter.HOMODIMER_OFFSET * (homodir - 1));
-			alias.setHeight(alias.getHeight() - AbstractCellDesignerAliasConverter.HOMODIMER_OFFSET * (homodir - 1));
-
-			if (alias.getSpecies() instanceof GenericProtein) {
-				result = getRectangleTransformation().getPointOnRectangleByAnchor(alias.getX(), alias.getY(), alias.getWidth(), alias.getHeight(), anchor);
-			} else if (alias.getSpecies() instanceof ReceptorProtein) {
-				ArrayList<Point2D> points = getReceptorPoints(alias);
-				result = getPolygonTransformation().getPointOnPolygonByAnchor(points, anchor);
-			} else if (alias.getSpecies() instanceof IonChannelProtein) {
-				result = getRectangleTransformation().getPointOnRectangleByAnchor(alias.getX(), alias.getY(), alias.getWidth(), alias.getHeight(), anchor);
-			} else if (alias.getSpecies() instanceof TruncatedProtein) {
-				ArrayList<Point2D> points = getTruncatedPoints(alias);
-				result = getPolygonTransformation().getPointOnPolygonByAnchor(points, anchor);
-			} else {
-				logger.warn("Unknown type: " + alias.getSpecies().getClass() + ", " + alias.getSpecies().getElementId());
-				result = alias.getCenter();
-			}
-
-			alias.setWidth(alias.getWidth() + AbstractCellDesignerAliasConverter.HOMODIMER_OFFSET * (homodir - 1));
-			alias.setHeight(alias.getHeight() + AbstractCellDesignerAliasConverter.HOMODIMER_OFFSET * (homodir - 1));
-		}
-		return result;
-	}
-
-	@Override
-	public PathIterator getBoundPathIterator(SpeciesAlias alias) {
-		if (alias.getSpecies() instanceof GenericProtein) {
-			return getGenericShape(alias).getPathIterator(new AffineTransform());
-		} else if (alias.getSpecies() instanceof ReceptorProtein) {
-			return getReceptorShape(alias).getPathIterator(new AffineTransform());
-		} else if (alias.getSpecies() instanceof IonChannelProtein) {
-			return getGenericShape(alias).getPathIterator(new AffineTransform());
-		} else if (alias.getSpecies() instanceof TruncatedProtein) {
-			return getTruncatedShape(alias).getPathIterator(new AffineTransform());
-		} else {
-			throw new NotImplementedException(
-					"Not implemented protein converter for type: " + alias.getSpecies().getClass() + "; " + "Alias id: " + alias.getAliasId() + ";" + "Species id: "
-							+ alias.getSpecies().getElementId());
-		}
-	}
-
-	/**
-	 * Returns shape of generic protein.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return Shape object defining given alias
-	 */
-	private Shape getGenericShape(Alias alias) {
-		return new RoundRectangle2D.Double(
-				alias.getX(), alias.getY(), alias.getWidth(), alias.getHeight(), GENERIC_PROTEIN_RECTANGLE_CORNER_ARC_SIZE, GENERIC_PROTEIN_RECTANGLE_CORNER_ARC_SIZE);
-	}
-
-	/**
-	 * Returns shape of the Truncated protein as a list of points.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return list of points defining border of the given alias
-	 */
-	private ArrayList<Point2D> getTruncatedPoints(Alias alias) {
-		double x = alias.getX();
-		double y = alias.getY();
-		double width = alias.getWidth();
-		double height = alias.getHeight();
-		ArrayList<Point2D> points = new ArrayList<Point2D>();
-		// CHECKSTYLE:OFF
-		points.add(new Point2D.Double(x, y + height / 2));
-		points.add(new Point2D.Double(x, y + height / 4));
-		points.add(new Point2D.Double(x, y));
-		points.add(new Point2D.Double(x + width / 4, y));
-		points.add(new Point2D.Double(x + width / 2, y));
-		points.add(new Point2D.Double(x + width * 3 / 4, y));
-		points.add(new Point2D.Double(x + width, y));
-		points.add(new Point2D.Double(x + width, y + height * 3 / 10));
-		points.add(new Point2D.Double(x + width, y + height * 3 / 5));
-		points.add(new Point2D.Double(x + width * 4 / 5, y + height * 2 / 5));
-		points.add(new Point2D.Double(x + width * 4 / 5, y + height * 7 / 10));
-		points.add(new Point2D.Double(x + width * 4 / 5, y + height));
-		points.add(new Point2D.Double(x + width / 2, y + height));
-		points.add(new Point2D.Double(x + width / 4, y + height));
-		points.add(new Point2D.Double(x, y + height));
-		points.add(new Point2D.Double(x, y + height * 3 / 4));
-
-		// CHECKSTYLE:ON
-
-		return points;
-	}
-
-	/**
-	 * Returns shape of receptor protein.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return Shape object defining given alias
-	 */
-	protected Shape getReceptorShape(Alias alias) {
-		Shape shape;
-		GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
-		ArrayList<Point2D> points = getReceptorPoints(alias);
-		path.moveTo(points.get(0).getX(), points.get(0).getY());
-		for (int i = 1; i < points.size(); i++) {
-			path.lineTo(points.get(i).getX(), points.get(i).getY());
-		}
-		path.closePath();
-		shape = path;
-		return shape;
-	}
-
-	/**
-	 * Returns shape of truncated protein.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return Shape object defining given alias
-	 */
-	protected Shape getTruncatedShape(Alias alias) {
-		Shape shape;
-		GeneralPath path = new GeneralPath();
-
-		// CHECKSTYLE:OFF
-		path.moveTo(alias.getX() + 10, alias.getY());
-		path.lineTo(alias.getX() + alias.getWidth(), alias.getY());
-		path.lineTo(alias.getX() + alias.getWidth(), alias.getY() + alias.getHeight() * 3 / 5);
-		path.lineTo(alias.getX() + alias.getWidth() * 4 / 5, alias.getY() + alias.getHeight() * 2 / 5);
-		path.lineTo(alias.getX() + alias.getWidth() * 4 / 5, alias.getY() + alias.getHeight());
-		path.lineTo(alias.getX() + 10, alias.getY() + alias.getHeight());
-		path.curveTo(
-				alias.getX() + 5, alias.getY() + alias.getHeight() - 2, alias.getX() + 2, alias.getY() + alias.getHeight() - 5, alias.getX(),
-				alias.getY() + alias.getHeight() - 10);
-		path.lineTo(alias.getX(), alias.getY() + 10);
-		path.curveTo(alias.getX() + 2, alias.getY() + 5, alias.getX() + 5, alias.getY() + 2, alias.getX() + 10, alias.getY());
-
-		// CHECKSTYLE:ON
-
-		path.closePath();
-		shape = path;
-		return shape;
-	}
-
-	/**
-	 * Returns shape of receptor protein as a list of points.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return list of points defining border of the given alias
-	 */
-	private ArrayList<Point2D> getReceptorPoints(Alias alias) {
-		double x = alias.getX();
-		double y = alias.getY();
-		double width = alias.getWidth();
-		double height = alias.getHeight();
-		ArrayList<Point2D> points = new ArrayList<Point2D>();
-
-		// CHECKSTYLE:OFF
-		points.add(new Point2D.Double(x, y + height * 2 / 5));
-		points.add(new Point2D.Double(x, y));
-		points.add(new Point2D.Double(x + width / 2, y + height / 5));
-		points.add(new Point2D.Double(x + width, y));
-		points.add(new Point2D.Double(x + width, y + height * 2 / 5));
-		points.add(new Point2D.Double(x + width, y + height * 4 / 5));
-		points.add(new Point2D.Double(x + width / 2, y + height));
-		points.add(new Point2D.Double(x, y + height * 4 / 5));
-		// CHECKSTYLE:ON
-
-		return points;
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+import java.awt.geom.RoundRectangle2D;
+import java.util.ArrayList;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.IonChannelProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.ReceptorProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.alias.TruncatedProteinAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.IonChannelProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.ReceptorProtein;
+import lcsb.mapviewer.model.map.species.TruncatedProtein;
+import lcsb.mapviewer.modelutils.map.ElementUtils;
+
+/**
+ * Class that provides CellDesigner specific graphical information for Protein.
+ * It's used for conversion from xml to normal x,y coordinates.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ProteinCellDesignerAliasConverter extends AbstractCellDesignerAliasConverter<SpeciesAlias> {
+	/**
+	 * Default class logger.
+	 */
+	private static Logger		 logger																		 = Logger.getLogger(ProteinCellDesignerAliasConverter.class);
+
+	/**
+	 * How big should be the arc in rectangle for generic protein representation.
+	 */
+	private static final int GENERIC_PROTEIN_RECTANGLE_CORNER_ARC_SIZE = 10;
+
+	ElementUtils						 eu																				 = new ElementUtils();
+
+	@Override
+	public Point2D getPointCoordinates(SpeciesAlias alias, CellDesignerAnchor anchor) {
+		Point2D result = null;
+		if (invalidAnchorPosition(alias, anchor)) {
+			result = alias.getCenter();
+		} else {
+			Protein protein = (Protein) alias.getSpecies();
+			int homodir = protein.getHomodimer();
+
+			alias.setWidth(alias.getWidth() - AbstractCellDesignerAliasConverter.HOMODIMER_OFFSET * (homodir - 1));
+			alias.setHeight(alias.getHeight() - AbstractCellDesignerAliasConverter.HOMODIMER_OFFSET * (homodir - 1));
+
+			if (alias.getSpecies() instanceof GenericProtein) {
+				result = getRectangleTransformation().getPointOnRectangleByAnchor(alias.getX(), alias.getY(), alias.getWidth(), alias.getHeight(), anchor);
+			} else if (alias.getSpecies() instanceof ReceptorProtein) {
+				ArrayList<Point2D> points = getReceptorPoints(alias);
+				result = getPolygonTransformation().getPointOnPolygonByAnchor(points, anchor);
+			} else if (alias.getSpecies() instanceof IonChannelProtein) {
+				result = getRectangleTransformation().getPointOnRectangleByAnchor(alias.getX(), alias.getY(), alias.getWidth(), alias.getHeight(), anchor);
+			} else if (alias.getSpecies() instanceof TruncatedProtein) {
+				ArrayList<Point2D> points = getTruncatedPoints(alias);
+				result = getPolygonTransformation().getPointOnPolygonByAnchor(points, anchor);
+			} else {
+				logger.warn("Unknown type: " + alias.getSpecies().getClass() + ", " + alias.getSpecies().getElementId());
+				result = alias.getCenter();
+			}
+
+			alias.setWidth(alias.getWidth() + AbstractCellDesignerAliasConverter.HOMODIMER_OFFSET * (homodir - 1));
+			alias.setHeight(alias.getHeight() + AbstractCellDesignerAliasConverter.HOMODIMER_OFFSET * (homodir - 1));
+		}
+		return result;
+	}
+
+	@Override
+	public PathIterator getBoundPathIterator(SpeciesAlias alias) {
+		if (alias instanceof GenericProteinAlias) {
+			return getGenericShape(alias).getPathIterator(new AffineTransform());
+		} else if (alias instanceof ReceptorProteinAlias) {
+			return getReceptorShape(alias).getPathIterator(new AffineTransform());
+		} else if (alias instanceof IonChannelProteinAlias) {
+			return getGenericShape(alias).getPathIterator(new AffineTransform());
+		} else if (alias instanceof TruncatedProteinAlias) {
+			return getTruncatedShape(alias).getPathIterator(new AffineTransform());
+		} else {
+			throw new NotImplementedException(eu.getElementTag(alias) + "Not implemented protein converter for type: " + alias.getClass());
+		}
+	}
+
+	/**
+	 * Returns shape of generic protein.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return Shape object defining given alias
+	 */
+	private Shape getGenericShape(Alias alias) {
+		return new RoundRectangle2D.Double(
+				alias.getX(), alias.getY(), alias.getWidth(), alias.getHeight(), GENERIC_PROTEIN_RECTANGLE_CORNER_ARC_SIZE, GENERIC_PROTEIN_RECTANGLE_CORNER_ARC_SIZE);
+	}
+
+	/**
+	 * Returns shape of the Truncated protein as a list of points.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return list of points defining border of the given alias
+	 */
+	private ArrayList<Point2D> getTruncatedPoints(Alias alias) {
+		double x = alias.getX();
+		double y = alias.getY();
+		double width = alias.getWidth();
+		double height = alias.getHeight();
+		ArrayList<Point2D> points = new ArrayList<Point2D>();
+		// CHECKSTYLE:OFF
+		points.add(new Point2D.Double(x, y + height / 2));
+		points.add(new Point2D.Double(x, y + height / 4));
+		points.add(new Point2D.Double(x, y));
+		points.add(new Point2D.Double(x + width / 4, y));
+		points.add(new Point2D.Double(x + width / 2, y));
+		points.add(new Point2D.Double(x + width * 3 / 4, y));
+		points.add(new Point2D.Double(x + width, y));
+		points.add(new Point2D.Double(x + width, y + height * 3 / 10));
+		points.add(new Point2D.Double(x + width, y + height * 3 / 5));
+		points.add(new Point2D.Double(x + width * 4 / 5, y + height * 2 / 5));
+		points.add(new Point2D.Double(x + width * 4 / 5, y + height * 7 / 10));
+		points.add(new Point2D.Double(x + width * 4 / 5, y + height));
+		points.add(new Point2D.Double(x + width / 2, y + height));
+		points.add(new Point2D.Double(x + width / 4, y + height));
+		points.add(new Point2D.Double(x, y + height));
+		points.add(new Point2D.Double(x, y + height * 3 / 4));
+
+		// CHECKSTYLE:ON
+
+		return points;
+	}
+
+	/**
+	 * Returns shape of receptor protein.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return Shape object defining given alias
+	 */
+	protected Shape getReceptorShape(Alias alias) {
+		Shape shape;
+		GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
+		ArrayList<Point2D> points = getReceptorPoints(alias);
+		path.moveTo(points.get(0).getX(), points.get(0).getY());
+		for (int i = 1; i < points.size(); i++) {
+			path.lineTo(points.get(i).getX(), points.get(i).getY());
+		}
+		path.closePath();
+		shape = path;
+		return shape;
+	}
+
+	/**
+	 * Returns shape of truncated protein.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return Shape object defining given alias
+	 */
+	protected Shape getTruncatedShape(Alias alias) {
+		Shape shape;
+		GeneralPath path = new GeneralPath();
+
+		// CHECKSTYLE:OFF
+		path.moveTo(alias.getX() + 10, alias.getY());
+		path.lineTo(alias.getX() + alias.getWidth(), alias.getY());
+		path.lineTo(alias.getX() + alias.getWidth(), alias.getY() + alias.getHeight() * 3 / 5);
+		path.lineTo(alias.getX() + alias.getWidth() * 4 / 5, alias.getY() + alias.getHeight() * 2 / 5);
+		path.lineTo(alias.getX() + alias.getWidth() * 4 / 5, alias.getY() + alias.getHeight());
+		path.lineTo(alias.getX() + 10, alias.getY() + alias.getHeight());
+		path.curveTo(
+				alias.getX() + 5, alias.getY() + alias.getHeight() - 2, alias.getX() + 2, alias.getY() + alias.getHeight() - 5, alias.getX(),
+				alias.getY() + alias.getHeight() - 10);
+		path.lineTo(alias.getX(), alias.getY() + 10);
+		path.curveTo(alias.getX() + 2, alias.getY() + 5, alias.getX() + 5, alias.getY() + 2, alias.getX() + 10, alias.getY());
+
+		// CHECKSTYLE:ON
+
+		path.closePath();
+		shape = path;
+		return shape;
+	}
+
+	/**
+	 * Returns shape of receptor protein as a list of points.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return list of points defining border of the given alias
+	 */
+	private ArrayList<Point2D> getReceptorPoints(Alias alias) {
+		double x = alias.getX();
+		double y = alias.getY();
+		double width = alias.getWidth();
+		double height = alias.getHeight();
+		ArrayList<Point2D> points = new ArrayList<Point2D>();
+
+		// CHECKSTYLE:OFF
+		points.add(new Point2D.Double(x, y + height * 2 / 5));
+		points.add(new Point2D.Double(x, y));
+		points.add(new Point2D.Double(x + width / 2, y + height / 5));
+		points.add(new Point2D.Double(x + width, y));
+		points.add(new Point2D.Double(x + width, y + height * 2 / 5));
+		points.add(new Point2D.Double(x + width, y + height * 4 / 5));
+		points.add(new Point2D.Double(x + width / 2, y + height));
+		points.add(new Point2D.Double(x, y + height * 4 / 5));
+		// CHECKSTYLE:ON
+
+		return points;
+	}
+
+}
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/AntisenseRnaXmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/AntisenseRnaXmlParser.java
index e2850f1b46..568c860d94 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/AntisenseRnaXmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/AntisenseRnaXmlParser.java
@@ -7,6 +7,7 @@ import org.w3c.dom.NodeList;
 import lcsb.mapviewer.common.Pair;
 import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
 import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
+import lcsb.mapviewer.model.map.layout.alias.AntisenseRnaAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.species.AntisenseRna;
 import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
@@ -36,7 +37,7 @@ public class AntisenseRnaXmlParser extends AbstractElementXmlParser<AntisenseRna
 			Node node = list.item(i);
 			if (node.getNodeType() == Node.ELEMENT_NODE) {
 				if (node.getNodeName().equals("celldesigner:notes")) {
-					SpeciesAlias antisenseRnaAlias = new SpeciesAlias(antisenseRna);
+					SpeciesAlias antisenseRnaAlias = new AntisenseRnaAlias(antisenseRna);
 					getRap().processNotes(node, antisenseRnaAlias);
 				} else if (node.getNodeName().equals("celldesigner:listOfRegions")) {
 					NodeList residueList = node.getChildNodes();
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/GeneXmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/GeneXmlParser.java
index 7620293ce5..8280c4b87d 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/GeneXmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/GeneXmlParser.java
@@ -7,6 +7,7 @@ import org.w3c.dom.NodeList;
 import lcsb.mapviewer.common.Pair;
 import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
 import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
+import lcsb.mapviewer.model.map.layout.alias.GeneAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.species.Gene;
 import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
@@ -35,7 +36,7 @@ public class GeneXmlParser extends AbstractElementXmlParser<Gene> {
 			Node node = list.item(i);
 			if (node.getNodeType() == Node.ELEMENT_NODE) {
 				if (node.getNodeName().equals("celldesigner:notes")) {
-					SpeciesAlias geneAlias = new SpeciesAlias(gene);
+					SpeciesAlias geneAlias = new GeneAlias(gene);
 					getRap().processNotes(node, geneAlias);
 				} else if (node.getNodeName().equals("celldesigner:listOfRegions")) {
 					NodeList residueList = node.getChildNodes();
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/ProteinXmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/ProteinXmlParser.java
index 41fb7a8147..01012a11b0 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/ProteinXmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/ProteinXmlParser.java
@@ -57,7 +57,7 @@ public class ProteinXmlParser extends AbstractElementXmlParser<Protein> {
 						}
 					}
 				} else if (node.getNodeName().equals("celldesigner:notes")) {
-					SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+					SpeciesAlias proteinAlias = SpeciesAlias.createAlias(protein);
 					getRap().processNotes(node, proteinAlias);
 				} else {
 					throw new InvalidXmlSchemaException("Unknown element of celldesigner:protein " + node.getNodeName());
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/RnaXmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/RnaXmlParser.java
index 8d7102a2c7..6e54fa52a4 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/RnaXmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/RnaXmlParser.java
@@ -7,6 +7,7 @@ import org.w3c.dom.NodeList;
 import lcsb.mapviewer.common.Pair;
 import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
 import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
+import lcsb.mapviewer.model.map.layout.alias.RnaAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.species.Rna;
 import lcsb.mapviewer.model.map.species.fields.RnaRegion;
@@ -36,7 +37,7 @@ public class RnaXmlParser extends AbstractElementXmlParser<Rna> {
 			Node node = list.item(i);
 			if (node.getNodeType() == Node.ELEMENT_NODE) {
 				if (node.getNodeName().equals("celldesigner:notes")) {
-					SpeciesAlias rnaAlias = new SpeciesAlias(rna);
+					SpeciesAlias rnaAlias = new RnaAlias(rna);
 					getRap().processNotes(node, rnaAlias);
 				} else if (node.getNodeName().equals("celldesigner:listOfRegions")) {
 					NodeList residueList = node.getChildNodes();
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParser.java
index b2e4529792..b91e51809b 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParser.java
@@ -398,8 +398,7 @@ public class SpeciesCollectionXmlParser extends XmlParser {
 								Species sp = row.getRight();
 								sp.setElementId(idIncluded);
 								sp.setName(helpParser.decodeName(nameIncluded));
-								SpeciesAlias speciesAlias = new SpeciesAlias(sp);
-								rap.processNotes(notesNode, speciesAlias);
+								rap.processNotes(notesNode, sp);
 
 								result.add(row);
 							} else {
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesMapping.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesMapping.java
index eb5e6b1901..aad1844f4b 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesMapping.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesMapping.java
@@ -1,166 +1,166 @@
-package lcsb.mapviewer.converter.model.celldesigner.species;
-
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Degraded;
-import lcsb.mapviewer.model.map.species.Drug;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.Ion;
-import lcsb.mapviewer.model.map.species.Phenotype;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.Unknown;
-
-/**
- * This enum contains information about mapping between CellDesigner xml nodes
- * and classes that extend {@link Species}.
- * 
- * @author Piotr Gawron
- * 
- */
-public enum SpeciesMapping {
-	/**
-	 * {@link Protein}.
-	 */
-	PROTEIN(Protein.class, "PROTEIN"), //
-	
-	/**
-	 * {@link Gene}.
-	 */
-	GENE(Gene.class, "GENE"), //
-	
-	/**
-	 * {@link ComplexSpecies}.
-	 */
-	COMPLEX(ComplexSpecies.class, "COMPLEX"), //
-	
-	/**
-	 * {@link SimpleMolecule}.
-	 */
-	SIMPLE_MOLECULE(SimpleMolecule.class, "SIMPLE_MOLECULE"), //
-	
-	/**
-	 * {@link Ion}.
-	 */
-	ION(Ion.class, "ION"), //
-	
-	/**
-	 * {@link Phenotype}.
-	 */
-	PHENOTYPE(Phenotype.class, "PHENOTYPE"), //
-	
-	/**
-	 * {@link Drug}.
-	 */
-	DRUG(Drug.class, "DRUG"), //
-	
-	/**
-	 * {@link Rna}.
-	 */
-	RNA(Rna.class, "RNA"), //
-	
-	/**
-	 * {@link AntisenseRna}.
-	 */
-	ANTISENSE_RNA(AntisenseRna.class, "ANTISENSE_RNA"), //
-	
-	/**
-	 * {@link Unknown}.
-	 */
-	UNKNOWN(Unknown.class, "UNKNOWN"), //
-	
-	/**
-	 * {@link Degraded}.
-	 */
-	DEGRADED(Degraded.class, "DEGRADED");
-
-	/**
-	 * CellDesigner xml node type.
-	 */
-	private String										cellDesignerString;
-	/**
-	 * Class that should be used to represent cell designer node.
-	 */
-	private Class<? extends Species>	clazz;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param clazz
-	 *          {@link #clazz}
-	 * @param cellDesignerString
-	 *          {@link #cellDesignerString}
-	 */
-	SpeciesMapping(Class<? extends Species> clazz, String cellDesignerString) {
-		this.cellDesignerString = cellDesignerString;
-		this.clazz = clazz;
-	}
-
-	/**
-	 * @return the cellDesignerString
-	 * @see #cellDesignerString
-	 */
-	public String getCellDesignerString() {
-		return cellDesignerString;
-	}
-
-	/**
-	 * @return the clazz
-	 * @see #clazz
-	 */
-	public Class<? extends Species> getClazz() {
-		return clazz;
-	}
-
-	/**
-	 * Creates instance of {@link Species} specific for this
-	 * {@link SpeciesMapping}.
-	 * 
-	 * @param result
-	 *          parameter that should be passed to the constructor
-	 * @return new instance of {@link Species} specific for this
-	 *         {@link SpeciesMapping}.
-	 */
-	public Species createSpecies(Species result) {
-		try {
-			return clazz.getConstructor(Species.class).newInstance(result);
-		} catch (Exception e) {
-			throw new InvalidStateException(e);
-		}
-	}
-
-	/**
-	 * Returns {@link SpeciesMapping} for given CellDesigner xml node name.
-	 * 
-	 * @param string
-	 *          CellDesigner xml node name
-	 * @return {@link SpeciesMapping} for given CellDesigner xml node name
-	 */
-	public static SpeciesMapping getMappingByString(String string) {
-		for (SpeciesMapping mapping : SpeciesMapping.values()) {
-			if (mapping.getCellDesignerString().equals(string)) {
-				return mapping;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns {@link SpeciesMapping} for given {@link Species} class.
-	 * 
-	 * @param searchClazz
-	 *          {@link Species} class
-	 * @return {@link SpeciesMapping} for given {@link Species} class
-	 */
-	public static SpeciesMapping getMappingByClass(Class<? extends Species> searchClazz) {
-		for (SpeciesMapping mapping : SpeciesMapping.values()) {
-			if (mapping.getClazz().isAssignableFrom(searchClazz)) {
-				return mapping;
-			}
-		}
-		return null;
-	}
-}
+package lcsb.mapviewer.converter.model.celldesigner.species;
+
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Degraded;
+import lcsb.mapviewer.model.map.species.Drug;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.Ion;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.Unknown;
+
+/**
+ * This enum contains information about mapping between CellDesigner xml nodes
+ * and classes that extend {@link Species}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public enum SpeciesMapping {
+	/**
+	 * {@link Protein}.
+	 */
+	PROTEIN(Protein.class, "PROTEIN"), //
+	
+	/**
+	 * {@link Gene}.
+	 */
+	GENE(Gene.class, "GENE"), //
+	
+	/**
+	 * {@link ComplexSpecies}.
+	 */
+	COMPLEX(ComplexSpecies.class, "COMPLEX"), //
+	
+	/**
+	 * {@link SimpleMolecule}.
+	 */
+	SIMPLE_MOLECULE(SimpleMolecule.class, "SIMPLE_MOLECULE"), //
+	
+	/**
+	 * {@link Ion}.
+	 */
+	ION(Ion.class, "ION"), //
+	
+	/**
+	 * {@link Phenotype}.
+	 */
+	PHENOTYPE(Phenotype.class, "PHENOTYPE"), //
+	
+	/**
+	 * {@link Drug}.
+	 */
+	DRUG(Drug.class, "DRUG"), //
+	
+	/**
+	 * {@link Rna}.
+	 */
+	RNA(Rna.class, "RNA"), //
+	
+	/**
+	 * {@link AntisenseRna}.
+	 */
+	ANTISENSE_RNA(AntisenseRna.class, "ANTISENSE_RNA"), //
+	
+	/**
+	 * {@link Unknown}.
+	 */
+	UNKNOWN(Unknown.class, "UNKNOWN"), //
+	
+	/**
+	 * {@link Degraded}.
+	 */
+	DEGRADED(Degraded.class, "DEGRADED");
+
+	/**
+	 * CellDesigner xml node type.
+	 */
+	private String										cellDesignerString;
+	/**
+	 * Class that should be used to represent cell designer node.
+	 */
+	private Class<? extends Species>	clazz;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param clazz
+	 *          {@link #clazz}
+	 * @param cellDesignerString
+	 *          {@link #cellDesignerString}
+	 */
+	SpeciesMapping(Class<? extends Species> clazz, String cellDesignerString) {
+		this.cellDesignerString = cellDesignerString;
+		this.clazz = clazz;
+	}
+
+	/**
+	 * @return the cellDesignerString
+	 * @see #cellDesignerString
+	 */
+	public String getCellDesignerString() {
+		return cellDesignerString;
+	}
+
+	/**
+	 * @return the clazz
+	 * @see #clazz
+	 */
+	public Class<? extends Species> getClazz() {
+		return clazz;
+	}
+
+	/**
+	 * Creates instance of {@link Species} specific for this
+	 * {@link SpeciesMapping}.
+	 * 
+	 * @param result
+	 *          parameter that should be passed to the constructor
+	 * @return new instance of {@link Species} specific for this
+	 *         {@link SpeciesMapping}.
+	 */
+	public Species createSpecies(Species result) {
+		try {
+			return clazz.getConstructor(result.getClass()).newInstance(result);
+		} catch (Exception e) {
+			throw new InvalidStateException(e);
+		}
+	}
+
+	/**
+	 * Returns {@link SpeciesMapping} for given CellDesigner xml node name.
+	 * 
+	 * @param string
+	 *          CellDesigner xml node name
+	 * @return {@link SpeciesMapping} for given CellDesigner xml node name
+	 */
+	public static SpeciesMapping getMappingByString(String string) {
+		for (SpeciesMapping mapping : SpeciesMapping.values()) {
+			if (mapping.getCellDesignerString().equals(string)) {
+				return mapping;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Returns {@link SpeciesMapping} for given {@link Species} class.
+	 * 
+	 * @param searchClazz
+	 *          {@link Species} class
+	 * @return {@link SpeciesMapping} for given {@link Species} class
+	 */
+	public static SpeciesMapping getMappingByClass(Class<? extends Species> searchClazz) {
+		for (SpeciesMapping mapping : SpeciesMapping.values()) {
+			if (mapping.getClazz().isAssignableFrom(searchClazz)) {
+				return mapping;
+			}
+		}
+		return null;
+	}
+}
diff --git a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesSbmlParser.java b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesSbmlParser.java
index 1860ed1845..d7c24478fb 100644
--- a/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesSbmlParser.java
+++ b/converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesSbmlParser.java
@@ -154,8 +154,7 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<Species> {
 		}
 
 		if (notesNode != null) {
-			SpeciesAlias speciesAlias = new SpeciesAlias(species);
-			getRap().processNotes(notesNode, speciesAlias);
+			getRap().processNotes(notesNode, species);
 		}
 
 		if (rdfNode != null) {
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerTestFunctions.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerTestFunctions.java
index 1b82c92951..4710799adc 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerTestFunctions.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerTestFunctions.java
@@ -1,228 +1,228 @@
-package lcsb.mapviewer.converter.model.celldesigner;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.spi.LoggingEvent;
-import org.junit.After;
-import org.junit.Before;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.EventStorageLoggerAppender;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.converter.ConverterParams;
-import lcsb.mapviewer.model.map.model.Model;
-
-public abstract class CellDesignerTestFunctions {
-	private Logger										 logger	 = Logger.getLogger(CellDesignerTestFunctions.class);
-
-	protected static double						 EPSILON = Configuration.EPSILON;
-
-	private EventStorageLoggerAppender appender;
-
-	@Before
-	public final void _setUp() throws Exception {
-		Logger.getRootLogger().removeAppender(appender);
-		appender = new EventStorageLoggerAppender();
-		Logger.getRootLogger().addAppender(appender);
-	}
-
-	@After
-	public final void _tearDown() throws Exception {
-		Logger.getRootLogger().removeAppender(appender);
-	}
-
-	protected List<LoggingEvent> getWarnings() {
-		return appender.getWarnings();
-	}
-
-	protected String readFile(String file) throws IOException {
-		StringBuilder stringBuilder = new StringBuilder();
-		BufferedReader reader = new BufferedReader(new FileReader(file));
-		try {
-			String line = null;
-			String ls = System.getProperty("line.separator");
-
-			while ((line = reader.readLine()) != null) {
-				stringBuilder.append(line);
-				stringBuilder.append(ls);
-			}
-		} finally {
-			reader.close();
-		}
-
-		return stringBuilder.toString();
-	}
-
-	protected Node getNodeFromXmlString(String text) throws InvalidXmlSchemaException {
-		InputSource is = new InputSource();
-		is.setCharacterStream(new StringReader(text));
-		return getXmlDocumentFromInputSource(is).getChildNodes().item(0);
-	}
-
-	protected Document getXmlDocumentFromFile(String fileName) throws InvalidXmlSchemaException, IOException {
-		File file = new File(fileName);
-		InputStream inputStream = new FileInputStream(file);
-		Reader reader = null;
-		try {
-			reader = new InputStreamReader(inputStream, "UTF-8");
-			InputSource is = new InputSource(reader);
-
-			Document result = getXmlDocumentFromInputSource(is);
-			inputStream.close();
-			return result;
-		} catch (UnsupportedEncodingException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	protected Document getXmlDocumentFromInputSource(InputSource stream) throws InvalidXmlSchemaException {
-		DocumentBuilder db;
-		try {
-			db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-		} catch (ParserConfigurationException e) {
-			throw new InvalidXmlSchemaException("Problem with xml parser");
-		}
-		Document doc = null;
-		try {
-			doc = db.parse(stream);
-		} catch (SAXException e) {
-			logger.error(e);
-		} catch (IOException e) {
-			logger.error(e);
-		}
-		return doc;
-	}
-
-	protected Model getModelForFile(String fileName) throws Exception {
-		CellDesignerXmlParser parser = new CellDesignerXmlParser();
-		return parser.createModel(new ConverterParams().filename(fileName).sizeAutoAdjust(false));
-	}
-
-	protected String createTmpFileName() {
-		try {
-			File f = File.createTempFile("prefix", ".txt");
-			String filename = f.getName();
-			f.delete();
-			return filename;
-		} catch (IOException e) {
-			e.printStackTrace();
-			return null;
-		}
-	}
-
-	protected String nodeToString(Node node) {
-		return nodeToString(node, false);
-	}
-
-	protected String nodeToString(Node node, boolean includeHeadNode) {
-		if (node == null)
-			return null;
-		StringWriter sw = new StringWriter();
-		try {
-			Transformer t = TransformerFactory.newInstance().newTransformer();
-			t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
-			t.setOutputProperty(OutputKeys.INDENT, "yes");
-			t.setOutputProperty(OutputKeys.METHOD, "xml");
-
-			NodeList list = node.getChildNodes();
-			for (int i = 0; i < list.getLength(); i++) {
-				Node element = list.item(i);
-				t.transform(new DOMSource(element), new StreamResult(sw));
-			}
-		} catch (TransformerException te) {
-			logger.debug("nodeToString Transformer Exception");
-		}
-		if (includeHeadNode) {
-			return "<" + node.getNodeName() + ">" + sw.toString() + "</" + node.getNodeName() + ">";
-		}
-		return sw.toString();
-	}
-
-	protected boolean equalFiles(String fileA, String fileB) throws IOException {
-		int BLOCK_SIZE = 65536;
-		FileInputStream inputStreamA = new FileInputStream(fileA);
-		FileInputStream inputStreamB = new FileInputStream(fileB);
-		// vary BLOCK_SIZE to suit yourself.
-		// it should probably a factor or multiple of the size of a disk
-		// sector/cluster.
-		// Note that your max heap size may need to be adjused
-		// if you have a very big block size or lots of these comparators.
-
-		// assume inputStreamA and inputStreamB are streams from your two files.
-		byte[] streamABlock = new byte[BLOCK_SIZE];
-		byte[] streamBBlock = new byte[BLOCK_SIZE];
-		boolean match = true;
-		int bytesReadA = 0;
-		int bytesReadB = 0;
-		do {
-			bytesReadA = inputStreamA.read(streamABlock);
-			bytesReadB = inputStreamB.read(streamBBlock);
-			match = ((bytesReadA == bytesReadB) && Arrays.equals(streamABlock, streamBBlock));
-		} while (match && (bytesReadA > -1));
-		inputStreamA.close();
-		inputStreamB.close();
-		return match;
-	}
-
-	public File createTempDirectory() throws IOException {
-		final File temp;
-
-		temp = File.createTempFile("temp", Long.toString(System.nanoTime()));
-
-		if (!(temp.delete())) {
-			throw new IOException("Could not delete temp file: " + temp.getAbsolutePath());
-		}
-
-		if (!(temp.mkdir())) {
-			throw new IOException("Could not create temp directory: " + temp.getAbsolutePath());
-		}
-
-		return (temp);
-	}
-
-	protected String getWebpage(String accessUrl) throws IOException {
-		String inputLine;
-		StringBuilder tmp = new StringBuilder();
-		URL url = new URL(accessUrl);
-		URLConnection urlConn = url.openConnection();
-		BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
-
-		while ((inputLine = in.readLine()) != null) {
-			tmp.append(inputLine);
-		}
-		in.close();
-		return tmp.toString();
-	}
-}
+package lcsb.mapviewer.converter.model.celldesigner;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.spi.LoggingEvent;
+import org.junit.After;
+import org.junit.Before;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.EventStorageLoggerAppender;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.converter.ConverterParams;
+import lcsb.mapviewer.model.map.model.Model;
+
+public abstract class CellDesignerTestFunctions {
+	private Logger										 logger	 = Logger.getLogger(CellDesignerTestFunctions.class);
+
+	protected static double						 EPSILON = Configuration.EPSILON;
+
+	private EventStorageLoggerAppender appender;
+
+	@Before
+	public final void _setUp() throws Exception {
+		Logger.getRootLogger().removeAppender(appender);
+		appender = new EventStorageLoggerAppender();
+		Logger.getRootLogger().addAppender(appender);
+	}
+
+	@After
+	public final void _tearDown() throws Exception {
+		Logger.getRootLogger().removeAppender(appender);
+	}
+
+	protected List<LoggingEvent> getWarnings() {
+		return appender.getWarnings();
+	}
+
+	protected String readFile(String file) throws IOException {
+		StringBuilder stringBuilder = new StringBuilder();
+		BufferedReader reader = new BufferedReader(new FileReader(file));
+		try {
+			String line = null;
+			String ls = System.getProperty("line.separator");
+
+			while ((line = reader.readLine()) != null) {
+				stringBuilder.append(line);
+				stringBuilder.append(ls);
+			}
+		} finally {
+			reader.close();
+		}
+
+		return stringBuilder.toString();
+	}
+
+	protected Node getNodeFromXmlString(String text) throws InvalidXmlSchemaException {
+		InputSource is = new InputSource();
+		is.setCharacterStream(new StringReader(text));
+		return getXmlDocumentFromInputSource(is).getChildNodes().item(0);
+	}
+
+	protected Document getXmlDocumentFromFile(String fileName) throws InvalidXmlSchemaException, IOException {
+		File file = new File(fileName);
+		InputStream inputStream = new FileInputStream(file);
+		Reader reader = null;
+		try {
+			reader = new InputStreamReader(inputStream, "UTF-8");
+			InputSource is = new InputSource(reader);
+
+			Document result = getXmlDocumentFromInputSource(is);
+			inputStream.close();
+			return result;
+		} catch (UnsupportedEncodingException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	protected Document getXmlDocumentFromInputSource(InputSource stream) throws InvalidXmlSchemaException {
+		DocumentBuilder db;
+		try {
+			db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+		} catch (ParserConfigurationException e) {
+			throw new InvalidXmlSchemaException("Problem with xml parser");
+		}
+		Document doc = null;
+		try {
+			doc = db.parse(stream);
+		} catch (SAXException e) {
+			logger.error(e);
+		} catch (IOException e) {
+			logger.error(e);
+		}
+		return doc;
+	}
+
+	protected Model getModelForFile(String fileName) throws Exception {
+		CellDesignerXmlParser parser = new CellDesignerXmlParser();
+		return parser.createModel(new ConverterParams().filename(fileName).sizeAutoAdjust(false));
+	}
+
+	protected String createTmpFileName() {
+		try {
+			File f = File.createTempFile("prefix", ".txt");
+			String filename = f.getName();
+			f.delete();
+			return filename;
+		} catch (IOException e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	protected String nodeToString(Node node) {
+		return nodeToString(node, false);
+	}
+
+	protected String nodeToString(Node node, boolean includeHeadNode) {
+		if (node == null)
+			return null;
+		StringWriter sw = new StringWriter();
+		try {
+			Transformer t = TransformerFactory.newInstance().newTransformer();
+			t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+			t.setOutputProperty(OutputKeys.INDENT, "yes");
+			t.setOutputProperty(OutputKeys.METHOD, "xml");
+
+			NodeList list = node.getChildNodes();
+			for (int i = 0; i < list.getLength(); i++) {
+				Node element = list.item(i);
+				t.transform(new DOMSource(element), new StreamResult(sw));
+			}
+		} catch (TransformerException te) {
+			logger.debug("nodeToString Transformer Exception");
+		}
+		if (includeHeadNode) {
+			return "<" + node.getNodeName() + ">" + sw.toString() + "</" + node.getNodeName() + ">";
+		}
+		return sw.toString();
+	}
+
+	protected boolean equalFiles(String fileA, String fileB) throws IOException {
+		int BLOCK_SIZE = 65536;
+		FileInputStream inputStreamA = new FileInputStream(fileA);
+		FileInputStream inputStreamB = new FileInputStream(fileB);
+		// vary BLOCK_SIZE to suit yourself.
+		// it should probably a factor or multiple of the size of a disk
+		// sector/cluster.
+		// Note that your max heap size may need to be adjused
+		// if you have a very big block size or lots of these comparators.
+
+		// assume inputStreamA and inputStreamB are streams from your two files.
+		byte[] streamABlock = new byte[BLOCK_SIZE];
+		byte[] streamBBlock = new byte[BLOCK_SIZE];
+		boolean match = true;
+		int bytesReadA = 0;
+		int bytesReadB = 0;
+		do {
+			bytesReadA = inputStreamA.read(streamABlock);
+			bytesReadB = inputStreamB.read(streamBBlock);
+			match = ((bytesReadA == bytesReadB) && Arrays.equals(streamABlock, streamBBlock));
+		} while (match && (bytesReadA > -1));
+		inputStreamA.close();
+		inputStreamB.close();
+		return match;
+	}
+
+	public File createTempDirectory() throws IOException {
+		final File temp;
+
+		temp = File.createTempFile("temp", Long.toString(System.nanoTime()));
+
+		if (!(temp.delete())) {
+			throw new IOException("Could not delete temp file: " + temp.getAbsolutePath());
+		}
+
+		if (!(temp.mkdir())) {
+			throw new IOException("Could not create temp directory: " + temp.getAbsolutePath());
+		}
+
+		return (temp);
+	}
+
+	protected String getWebpage(String accessUrl) throws IOException {
+		String inputLine;
+		StringBuilder tmp = new StringBuilder();
+		URL url = new URL(accessUrl);
+		URLConnection urlConn = url.openConnection();
+		BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
+
+		while ((inputLine = in.readLine()) != null) {
+			tmp.append(inputLine);
+		}
+		in.close();
+		return tmp.toString();
+	}
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerXmlParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerXmlParserTest.java
index 74f4148f4f..c83697ccda 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerXmlParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerXmlParserTest.java
@@ -31,6 +31,8 @@ import lcsb.mapviewer.model.graphics.PolylineData;
 import lcsb.mapviewer.model.map.Element;
 import lcsb.mapviewer.model.map.agregator.Compartment;
 import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.layout.graphics.Layer;
 import lcsb.mapviewer.model.map.layout.graphics.LayerOval;
@@ -42,7 +44,6 @@ import lcsb.mapviewer.model.map.model.ModelFullIndexed;
 import lcsb.mapviewer.model.map.species.ComplexSpecies;
 import lcsb.mapviewer.model.map.species.Gene;
 import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
 import lcsb.mapviewer.model.map.species.SimpleMolecule;
 import lcsb.mapviewer.model.map.species.Species;
 
@@ -452,30 +453,30 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
 			model.setIdModel("as");
 			model.setWidth(10);
 			model.setHeight(10);
-			Protein species = new GenericProtein();
-			SpeciesAlias speciesAlias = new SpeciesAlias(species);
-			species.setName("ROS");
-			species.setElementId("id1");
+			GenericProtein protein = new GenericProtein();
+			SpeciesAlias speciesAlias = new GenericProteinAlias(protein);
+			protein.setName("ROS");
+			protein.setElementId("id1");
 			RestAnnotationParser rap = new RestAnnotationParser();
 			rap.processNotes(
 					"Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\nDescription: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\nPrevious Symbols:\r\nSynonyms: ROS, MCF3",
 					speciesAlias);
-			model.addElement(species);
+			model.addElement(protein);
 
-			SpeciesAlias alias = new SpeciesAlias(species);
+			GenericProteinAlias alias = new GenericProteinAlias(protein);
 			alias.setAliasId("id");
 			model.addAlias(alias);
 
-			SimpleMolecule species2 = new SimpleMolecule();
-			SpeciesAlias speciesAlias2 = new SpeciesAlias(species2);
-			species2.setName("PDK1");
-			species2.setElementId("id2");
+			SimpleMolecule simpleMolecule = new SimpleMolecule();
+			SimpleMoleculeAlias speciesAlias2 = new SimpleMoleculeAlias(simpleMolecule);
+			simpleMolecule.setName("PDK1");
+			simpleMolecule.setElementId("id2");
 			rap.processNotes(
 					"Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\nDescription: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\nPrevious Symbols:\r\nSynonyms: ROS, MCF3",
 					speciesAlias2);
-			model.addElement(species2);
+			model.addElement(simpleMolecule);
 
-			SpeciesAlias alias2 = new SpeciesAlias(species2);
+			SimpleMoleculeAlias alias2 = new SimpleMoleculeAlias(simpleMolecule);
 			alias2.setAliasId("id2");
 			model.addAlias(alias2);
 
@@ -531,7 +532,7 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
 			GenericProtein protein = new GenericProtein();
 			protein.setElementId("s");
 			protein.setName("AA");
-			SpeciesAlias alias = new SpeciesAlias(protein);
+			SpeciesAlias alias = new GenericProteinAlias(protein);
 			alias.setAliasId("a");
 			model.addAlias(alias);
 			model.addElement(protein);
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/ComplexParserTests.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/ComplexParserTests.java
index fd116835df..682e6e0d2d 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/ComplexParserTests.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/ComplexParserTests.java
@@ -1,376 +1,377 @@
-package lcsb.mapviewer.converter.model.celldesigner;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.HashSet;
-import java.util.Set;
-
-import lcsb.mapviewer.converter.ConverterParams;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelComparator;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ComplexParserTests extends CellDesignerTestFunctions {
-	Logger logger = Logger.getLogger(ComplexParserTests.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseCompartmens() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\centeredAnchorInModifier.xml");
-
-			// there should always be default compartment;
-			assertNotNull(model.getCompartmentByCompartmentId("default"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseBubbles() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/bubbles.xml");
-
-			Species species = model.getSpeciesBySpeciesId("s3488");
-			assertNotNull(species);
-			Protein protein = (Protein) species;
-			assertTrue(protein.getModificationResidues().size() > 0);
-			assertNotNull(protein.getStructuralState());
-			assertFalse(protein.getStructuralState().equals(""));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseCompartmensRelation() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/problematic/elements_in_compartments.xml");
-
-			for (Alias alias : model.getAliases()) {
-				if (alias instanceof SpeciesAlias) {
-					Element species = alias.getElement();
-					assertNotNull(species.getElementId() + " does not contain info about compartment", species.getParent());
-				}
-			}
-
-			for (Element element : model.getElements())
-				if (element instanceof Species) {
-					assertNotNull(element.getElementId() + " does not contain info about compartment", element.getParent());
-				}
-
-			// there should always be default compartment;
-			assertNotNull(model.getCompartmentByCompartmentId("default"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseProteins() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/problematic/acetyled_protein.xml");
-
-			Set<ModificationState> residues = new HashSet<ModificationState>();
-			for (Element element : model.getElements()) {
-				if (element instanceof Species) {
-					Species species = (Species) element;
-					Protein p = (Protein) species;
-					for (ModificationResidue mr : p.getModificationResidues()) {
-						residues.add(mr.getState());
-					}
-				}
-			}
-			// we have a protein which is acetylated and not acetylated so two types
-			// of residues
-			assertEquals(2, residues.size());
-
-			assertEquals(ModificationState.ACETYLATED, ((Protein) model.getSpeciesBySpeciesId("s1800")).getModificationResidues().get(0).getState());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testNotesComplexesInNested() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/includedSpecies.xml");
-			Species species = model.getSpeciesBySpeciesId("s2");
-			assertNotNull(species);
-			assertNotNull(species.getNotes());
-			assertTrue("Wrong notes: " + species.getNotes(), species.getNotes().contains("hello world"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testHypotheticalComplex() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/problematic/hypothetical_complex.xml");
-			ComplexSpecies species = (ComplexSpecies) model.getSpeciesBySpeciesId("s1");
-			assertTrue(species.isHypothetical());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicAcetylation() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/problematic/problematic_acetylation.xml");
-			Protein p1 = (Protein) model.getSpeciesBySpeciesId("s445");
-			Protein p2 = (Protein) model.getSpeciesBySpeciesId("s411");
-			assertEquals(ModificationState.ACETYLATED, p1.getModificationResidues().get(0).getState());
-			assertFalse(ModificationState.ACETYLATED.equals(p2.getModificationResidues().get(0).getState()));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDuplicateMiriam() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/problematic/duplicated_miriam.xml");
-			Protein p1 = (Protein) model.getSpeciesBySpeciesId("s2447");
-			Set<String> ids = new HashSet<String>();
-
-			assertTrue(p1.getMiriamData().size() > 0);
-			for (MiriamData md : p1.getMiriamData()) {
-				if (md.getDataType().equals(MiriamType.PUBMED)) {
-					assertFalse("Protein contains double pubmed annotation for pubmed id: " + md.getResource(), ids.contains(md.getResource()));
-					ids.add(md.getResource());
-				}
-			}
-			assertTrue(ids.size() > 0);
-			assertEquals(4,getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testKappaInDescription() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/problematic/kappa_example.xml");
-
-			Species species = model.getSpeciesBySpeciesId("s1");
-
-			assertFalse(species.getName().toLowerCase().contains("kappa"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testMissingXmlNodes() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/missing_xml_nodes.xml");
-
-			assertTrue(model.getSpeciesBySpeciesId("s6").isHypothetical());
-			assertTrue(model.getSpeciesBySpeciesId("s7").isHypothetical());
-			assertTrue(model.getSpeciesBySpeciesId("s8").isHypothetical());
-
-			assertFalse(model.getSpeciesBySpeciesId("s16").isHypothetical());
-			assertFalse(model.getSpeciesBySpeciesId("s17").isHypothetical());
-			assertFalse(model.getSpeciesBySpeciesId("s18").isHypothetical());
-			assertFalse(model.getSpeciesBySpeciesId("s19").isHypothetical());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParsingSpecialCharactersInName() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			model.addCompartment(new Compartment("default"));
-			model.setIdModel("as");
-			model.setWidth(100);
-			model.setHeight(100);
-			Protein protein = new GenericProtein();
-			protein.setElementId("aaa");
-			protein.setName("name & no-name");
-			SpeciesAlias alias = new SpeciesAlias(protein);
-			alias.setAliasId("aid");
-			model.addElement(protein);
-			model.addAlias(alias);
-
-			CellDesignerXmlParser parser = new CellDesignerXmlParser();
-			String string = parser.toXml(model);
-
-			InputStream stream = new ByteArrayInputStream(string.getBytes(StandardCharsets.UTF_8));
-
-			ConverterParams params = new ConverterParams().inputStream(stream).sizeAutoAdjust(false);
-
-			Model model2 = parser.createModel(params);
-
-			ModelComparator comparator = new ModelComparator();
-
-			assertEquals(0, comparator.compare(model, model2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParsingEndLineInName() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			model.addCompartment(new Compartment("default"));
-			model.setIdModel("as");
-			model.setWidth(100);
-			model.setHeight(100);
-			Protein protein = new GenericProtein();
-			protein.setElementId("aaa");
-			protein.setName("name\rno-name");
-			SpeciesAlias alias = new SpeciesAlias(protein);
-			alias.setAliasId("aid");
-			model.addElement(protein);
-			model.addAlias(alias);
-
-			CellDesignerXmlParser parser = new CellDesignerXmlParser();
-			String string = parser.toXml(model);
-
-			InputStream stream = new ByteArrayInputStream(string.getBytes(StandardCharsets.UTF_8));
-
-			ConverterParams params = new ConverterParams().inputStream(stream).sizeAutoAdjust(false);
-
-			Model model2 = parser.createModel(params);
-
-			ModelComparator comparator = new ModelComparator();
-
-			assertEquals(0, comparator.compare(model, model2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testWarningInParser() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/problematic/invalid_elements_name.xml");
-			assertTrue(model.getCreationWarnings().size() > 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRnaWithRegion() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/rnaWithRegion.xml");
-			for (Species species : model.getSpecies()) {
-				Rna rna = (Rna) species;
-				assertEquals(1, rna.getRegions().size());
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProtinWithModifications() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/proteinWithEverPossibleModification.xml");
-			Protein protein = (Protein) model.getSpeciesBySpeciesId("s1");
-			assertEquals(14, protein.getModificationResidues().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAntisenseRnaWithRegion() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/antisenseRnaWithRegion.xml");
-			for (Species species : model.getSpecies()) {
-				AntisenseRna rna = (AntisenseRna) species;
-				assertEquals(1, rna.getRegions().size());
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testPhosporylatedProteinToXml() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/problematic/phosphorylated_protein.xml");
-			model.setName(null);
-			CellDesignerXmlParser p = new CellDesignerXmlParser();
-			String xml = p.toXml(model);
-			InputStream is = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8));
-			Model model2 = p.createModel(new ConverterParams().inputStream(is).sizeAutoAdjust(false));
-			ModelComparator comparator = new ModelComparator();
-			assertEquals(0, comparator.compare(model, model2));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.converter.model.celldesigner;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.converter.ConverterParams;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelComparator;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+
+public class ComplexParserTests extends CellDesignerTestFunctions {
+	Logger logger = Logger.getLogger(ComplexParserTests.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseCompartmens() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\centeredAnchorInModifier.xml");
+
+			// there should always be default compartment;
+			assertNotNull(model.getCompartmentByCompartmentId("default"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseBubbles() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/bubbles.xml");
+
+			Species species = model.getSpeciesBySpeciesId("s3488");
+			assertNotNull(species);
+			Protein protein = (Protein) species;
+			assertTrue(protein.getModificationResidues().size() > 0);
+			assertNotNull(protein.getStructuralState());
+			assertFalse(protein.getStructuralState().equals(""));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseCompartmensRelation() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/problematic/elements_in_compartments.xml");
+
+			for (Alias alias : model.getAliases()) {
+				if (alias instanceof SpeciesAlias) {
+					Element species = alias.getElement();
+					assertNotNull(species.getElementId() + " does not contain info about compartment", species.getParent());
+				}
+			}
+
+			for (Element element : model.getElements())
+				if (element instanceof Species) {
+					assertNotNull(element.getElementId() + " does not contain info about compartment", element.getParent());
+				}
+
+			// there should always be default compartment;
+			assertNotNull(model.getCompartmentByCompartmentId("default"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseProteins() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/problematic/acetyled_protein.xml");
+
+			Set<ModificationState> residues = new HashSet<ModificationState>();
+			for (Element element : model.getElements()) {
+				if (element instanceof Species) {
+					Species species = (Species) element;
+					Protein p = (Protein) species;
+					for (ModificationResidue mr : p.getModificationResidues()) {
+						residues.add(mr.getState());
+					}
+				}
+			}
+			// we have a protein which is acetylated and not acetylated so two types
+			// of residues
+			assertEquals(2, residues.size());
+
+			assertEquals(ModificationState.ACETYLATED, ((Protein) model.getSpeciesBySpeciesId("s1800")).getModificationResidues().get(0).getState());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testNotesComplexesInNested() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/includedSpecies.xml");
+			Species species = model.getSpeciesBySpeciesId("s2");
+			assertNotNull(species);
+			assertNotNull(species.getNotes());
+			assertTrue("Wrong notes: " + species.getNotes(), species.getNotes().contains("hello world"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testHypotheticalComplex() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/problematic/hypothetical_complex.xml");
+			ComplexSpecies species = (ComplexSpecies) model.getSpeciesBySpeciesId("s1");
+			assertTrue(species.isHypothetical());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicAcetylation() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/problematic/problematic_acetylation.xml");
+			Protein p1 = (Protein) model.getSpeciesBySpeciesId("s445");
+			Protein p2 = (Protein) model.getSpeciesBySpeciesId("s411");
+			assertEquals(ModificationState.ACETYLATED, p1.getModificationResidues().get(0).getState());
+			assertFalse(ModificationState.ACETYLATED.equals(p2.getModificationResidues().get(0).getState()));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDuplicateMiriam() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/problematic/duplicated_miriam.xml");
+			Protein p1 = (Protein) model.getSpeciesBySpeciesId("s2447");
+			Set<String> ids = new HashSet<String>();
+
+			assertTrue(p1.getMiriamData().size() > 0);
+			for (MiriamData md : p1.getMiriamData()) {
+				if (md.getDataType().equals(MiriamType.PUBMED)) {
+					assertFalse("Protein contains double pubmed annotation for pubmed id: " + md.getResource(), ids.contains(md.getResource()));
+					ids.add(md.getResource());
+				}
+			}
+			assertTrue(ids.size() > 0);
+			assertEquals(4,getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testKappaInDescription() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/problematic/kappa_example.xml");
+
+			Species species = model.getSpeciesBySpeciesId("s1");
+
+			assertFalse(species.getName().toLowerCase().contains("kappa"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testMissingXmlNodes() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/missing_xml_nodes.xml");
+
+			assertTrue(model.getSpeciesBySpeciesId("s6").isHypothetical());
+			assertTrue(model.getSpeciesBySpeciesId("s7").isHypothetical());
+			assertTrue(model.getSpeciesBySpeciesId("s8").isHypothetical());
+
+			assertFalse(model.getSpeciesBySpeciesId("s16").isHypothetical());
+			assertFalse(model.getSpeciesBySpeciesId("s17").isHypothetical());
+			assertFalse(model.getSpeciesBySpeciesId("s18").isHypothetical());
+			assertFalse(model.getSpeciesBySpeciesId("s19").isHypothetical());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParsingSpecialCharactersInName() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			model.addCompartment(new Compartment("default"));
+			model.setIdModel("as");
+			model.setWidth(100);
+			model.setHeight(100);
+			GenericProtein protein = new GenericProtein();
+			protein.setElementId("aaa");
+			protein.setName("name & no-name");
+			GenericProteinAlias alias = new GenericProteinAlias(protein);
+			alias.setAliasId("aid");
+			model.addElement(protein);
+			model.addAlias(alias);
+
+			CellDesignerXmlParser parser = new CellDesignerXmlParser();
+			String string = parser.toXml(model);
+
+			InputStream stream = new ByteArrayInputStream(string.getBytes(StandardCharsets.UTF_8));
+
+			ConverterParams params = new ConverterParams().inputStream(stream).sizeAutoAdjust(false);
+
+			Model model2 = parser.createModel(params);
+
+			ModelComparator comparator = new ModelComparator();
+
+			assertEquals(0, comparator.compare(model, model2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParsingEndLineInName() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			model.addCompartment(new Compartment("default"));
+			model.setIdModel("as");
+			model.setWidth(100);
+			model.setHeight(100);
+			GenericProtein protein = new GenericProtein();
+			protein.setElementId("aaa");
+			protein.setName("name\rno-name");
+			GenericProteinAlias alias = new GenericProteinAlias(protein);
+			alias.setAliasId("aid");
+			model.addElement(protein);
+			model.addAlias(alias);
+
+			CellDesignerXmlParser parser = new CellDesignerXmlParser();
+			String string = parser.toXml(model);
+
+			InputStream stream = new ByteArrayInputStream(string.getBytes(StandardCharsets.UTF_8));
+
+			ConverterParams params = new ConverterParams().inputStream(stream).sizeAutoAdjust(false);
+
+			Model model2 = parser.createModel(params);
+
+			ModelComparator comparator = new ModelComparator();
+
+			assertEquals(0, comparator.compare(model, model2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testWarningInParser() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/problematic/invalid_elements_name.xml");
+			assertTrue(model.getCreationWarnings().size() > 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRnaWithRegion() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/rnaWithRegion.xml");
+			for (Species species : model.getSpecies()) {
+				Rna rna = (Rna) species;
+				assertEquals(1, rna.getRegions().size());
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProtinWithModifications() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/proteinWithEverPossibleModification.xml");
+			Protein protein = (Protein) model.getSpeciesBySpeciesId("s1");
+			assertEquals(14, protein.getModificationResidues().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAntisenseRnaWithRegion() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/antisenseRnaWithRegion.xml");
+			for (Species species : model.getSpecies()) {
+				AntisenseRna rna = (AntisenseRna) species;
+				assertEquals(1, rna.getRegions().size());
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testPhosporylatedProteinToXml() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/problematic/phosphorylated_protein.xml");
+			model.setName(null);
+			CellDesignerXmlParser p = new CellDesignerXmlParser();
+			String xml = p.toXml(model);
+			InputStream is = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8));
+			Model model2 = p.createModel(new ConverterParams().inputStream(is).sizeAutoAdjust(false));
+			ModelComparator comparator = new ModelComparator();
+			assertEquals(0, comparator.compare(model, model2));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/LayerXmlParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/LayerXmlParserTest.java
index fd9ac32348..c0674e09d7 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/LayerXmlParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/LayerXmlParserTest.java
@@ -1,463 +1,454 @@
-package lcsb.mapviewer.converter.model.celldesigner;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.geom.Rectangle2D;
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.graphics.PolylineDataComparator;
-import lcsb.mapviewer.model.map.layout.alias.AliasGroup;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.layout.graphics.LayerComparator;
-import lcsb.mapviewer.model.map.layout.graphics.LayerOval;
-import lcsb.mapviewer.model.map.layout.graphics.LayerOvalComparator;
-import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
-import lcsb.mapviewer.model.map.layout.graphics.LayerRectComparator;
-import lcsb.mapviewer.model.map.layout.graphics.LayerText;
-import lcsb.mapviewer.model.map.layout.graphics.LayerTextComparator;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class LayerXmlParserTest extends CellDesignerTestFunctions {
-	Logger				 logger	= Logger.getLogger(LayerXmlParserTest.class);
-
-	LayerXmlParser parser	= new LayerXmlParser();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseLayers() throws Exception {
-		LayerComparator comparator = new LayerComparator();
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Collection<Layer> layers = parser.parseLayers(node);
-			assertNotNull(layers);
-			assertEquals(1, layers.size());
-
-			xmlString = parser.layerCollectionToXml(layers);
-			node = getNodeFromXmlString(xmlString);
-			Collection<Layer> layers2 = parser.parseLayers(node);
-			assertNotNull(layers2);
-			assertEquals(1, layers2.size());
-			assertEquals(0, comparator.compare(layers.iterator().next(), layers2.iterator().next()));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayers() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseLayers(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfLayers"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseBlockDiagrams() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/block_diagrams.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseBlocks(model, node);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidBlockDiagrams() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			String xmlString = readFile("testFiles/invalid/block_diagrams.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseBlocks(model, node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfBlockDiagrams"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidGroups() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			String xmlString = readFile("testFiles/invalid/group_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseGroups(model, node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfGroups"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidGroups2() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			String xmlString = readFile("testFiles/invalid/group_collection2.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseGroups(model, node);
-			fail("Exception expected");
-		} catch (InvalidGroupException e) {
-			assertTrue(e.getMessage().contains("such alias doesn't exist in the model"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidGroups3() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Species species = new Protein();
-			SpeciesAlias alias = new SpeciesAlias("sa1");
-			alias.setElement(species);
-			model.addAlias(alias);
-
-			String xmlString = readFile("testFiles/invalid/group_collection3.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseGroups(model, node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:group"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLayer() throws Exception {
-		LayerComparator comparator = new LayerComparator();
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Layer layer = parser.getLayer(node);
-			assertNotNull(layer);
-
-			xmlString = parser.layerToXml(layer);
-			node = getNodeFromXmlString(xmlString);
-			Layer layers2 = parser.getLayer(node);
-			assertNotNull(layers2);
-			assertEquals(0, comparator.compare(layer, layers2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayer() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayer(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfTexts"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayer2() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer2.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayer(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown celldesigner:layerCompartmentAlias type"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayer3() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer3.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayer(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfSquares"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayer4() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer4.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayer(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfFreeLines"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayer5() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer5.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayer(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layer"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLayerRect() throws Exception {
-		try {
-			LayerRectComparator comparator = new LayerRectComparator();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_square.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			LayerRect layer = parser.getLayerRect(node);
-			assertNotNull(layer);
-
-			xmlString = parser.layerRectToXml(layer);
-			node = getNodeFromXmlString(xmlString);
-			LayerRect layers2 = parser.getLayerRect(node);
-			assertNotNull(layers2);
-			assertEquals(0, comparator.compare(layer, layers2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayerRect() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer_square.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayerRect(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layerCompartmentAlias"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLayerLine() {
-		try {
-			PolylineDataComparator comparator = new PolylineDataComparator();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_line.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			PolylineData layer = parser.getLayerLine(node);
-			assertNotNull(layer);
-
-			xmlString = parser.layerLineToXml(layer);
-			node = getNodeFromXmlString(xmlString);
-			PolylineData layers2 = parser.getLayerLine(node);
-			assertNotNull(layers2);
-			assertEquals(0, comparator.compare(layer, layers2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayerLine() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer_line.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayerLine(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layerFreeLine"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLayerOval() {
-		try {
-			LayerOvalComparator comparator = new LayerOvalComparator();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_oval.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			LayerOval layer = parser.getLayerOval(node);
-			assertNotNull(layer);
-
-			xmlString = parser.layerOvalToXml(layer);
-			node = getNodeFromXmlString(xmlString);
-			LayerOval layers2 = parser.getLayerOval(node);
-			assertNotNull(layers2);
-			assertEquals(0, comparator.compare(layer, layers2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayerOval() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer_oval.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayerOval(node);
-			fail("Exception expected");
-
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layerCompartmentAlias"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLayerText() {
-		try {
-			LayerTextComparator comparator = new LayerTextComparator();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_text.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			LayerText layer = parser.getLayerText(node);
-			assertNotNull(layer);
-
-			xmlString = parser.layerTextToXml(layer);
-			node = getNodeFromXmlString(xmlString);
-			LayerText layers2 = parser.getLayerText(node);
-			assertNotNull(layers2);
-			assertEquals(0, comparator.compare(layer, layers2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testParseInvalidLayerText() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/layer_text.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.getLayerText(node);
-			fail("Exception expected");
-
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layerSpeciesAlias"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAliasGroup() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Protein protein = new Protein();
-			protein.setElementId("id1");
-			model.addElement(protein);
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setAliasId("sa1035");
-			alias.setSpecies(protein);
-			model.addAlias(alias);
-
-			alias = new SpeciesAlias();
-			alias.setAliasId("sa1036");
-			alias.setSpecies(protein);
-			model.addAlias(alias);
-
-			alias = new SpeciesAlias();
-			alias.setAliasId("sa1037");
-			alias.setSpecies(protein);
-			model.addAlias(alias);
-
-			alias = new SpeciesAlias();
-			alias.setAliasId("sa1038");
-			alias.setSpecies(protein);
-			model.addAlias(alias);
-
-			String string = "<celldesigner:group id=\"g74\" members=\"sa1035,sa1036,sa1037,sa1038\"/>";
-			Node node = getNodeFromXmlString(string);
-			AliasGroup group = parser.getAliasGroup(node, model);
-			assertNotNull(group);
-
-			assertEquals(4, group.getAliases().size());
-
-			assertEquals("g74", group.getIdGroup());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testLayerTextToXml() throws Exception {
-		try {
-			LayerText text = new LayerText(new Rectangle2D.Double(1, 2, 3, 4), "DF");
-			String xml = parser.layerTextToXml(text);
-			assertNotNull(xml);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.geom.Rectangle2D;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.graphics.PolylineDataComparator;
+import lcsb.mapviewer.model.map.layout.alias.AliasGroup;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.layout.graphics.LayerComparator;
+import lcsb.mapviewer.model.map.layout.graphics.LayerOval;
+import lcsb.mapviewer.model.map.layout.graphics.LayerOvalComparator;
+import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
+import lcsb.mapviewer.model.map.layout.graphics.LayerRectComparator;
+import lcsb.mapviewer.model.map.layout.graphics.LayerText;
+import lcsb.mapviewer.model.map.layout.graphics.LayerTextComparator;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class LayerXmlParserTest extends CellDesignerTestFunctions {
+	Logger				 logger	= Logger.getLogger(LayerXmlParserTest.class);
+
+	LayerXmlParser parser	= new LayerXmlParser();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseLayers() throws Exception {
+		LayerComparator comparator = new LayerComparator();
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Collection<Layer> layers = parser.parseLayers(node);
+			assertNotNull(layers);
+			assertEquals(1, layers.size());
+
+			xmlString = parser.layerCollectionToXml(layers);
+			node = getNodeFromXmlString(xmlString);
+			Collection<Layer> layers2 = parser.parseLayers(node);
+			assertNotNull(layers2);
+			assertEquals(1, layers2.size());
+			assertEquals(0, comparator.compare(layers.iterator().next(), layers2.iterator().next()));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayers() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseLayers(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfLayers"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseBlockDiagrams() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/block_diagrams.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseBlocks(model, node);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidBlockDiagrams() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			String xmlString = readFile("testFiles/invalid/block_diagrams.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseBlocks(model, node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfBlockDiagrams"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidGroups() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			String xmlString = readFile("testFiles/invalid/group_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseGroups(model, node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfGroups"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidGroups2() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			String xmlString = readFile("testFiles/invalid/group_collection2.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseGroups(model, node);
+			fail("Exception expected");
+		} catch (InvalidGroupException e) {
+			assertTrue(e.getMessage().contains("such alias doesn't exist in the model"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidGroups3() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			GenericProtein protein = new GenericProtein();
+			GenericProteinAlias alias = new GenericProteinAlias("sa1", protein);
+			model.addAlias(alias);
+
+			String xmlString = readFile("testFiles/invalid/group_collection3.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseGroups(model, node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:group"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLayer() throws Exception {
+		LayerComparator comparator = new LayerComparator();
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Layer layer = parser.getLayer(node);
+			assertNotNull(layer);
+
+			xmlString = parser.layerToXml(layer);
+			node = getNodeFromXmlString(xmlString);
+			Layer layers2 = parser.getLayer(node);
+			assertNotNull(layers2);
+			assertEquals(0, comparator.compare(layer, layers2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayer() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayer(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfTexts"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayer2() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer2.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayer(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown celldesigner:layerCompartmentAlias type"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayer3() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer3.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayer(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfSquares"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayer4() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer4.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayer(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfFreeLines"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayer5() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer5.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayer(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layer"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLayerRect() throws Exception {
+		try {
+			LayerRectComparator comparator = new LayerRectComparator();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_square.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			LayerRect layer = parser.getLayerRect(node);
+			assertNotNull(layer);
+
+			xmlString = parser.layerRectToXml(layer);
+			node = getNodeFromXmlString(xmlString);
+			LayerRect layers2 = parser.getLayerRect(node);
+			assertNotNull(layers2);
+			assertEquals(0, comparator.compare(layer, layers2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayerRect() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer_square.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayerRect(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layerCompartmentAlias"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLayerLine() {
+		try {
+			PolylineDataComparator comparator = new PolylineDataComparator();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_line.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			PolylineData layer = parser.getLayerLine(node);
+			assertNotNull(layer);
+
+			xmlString = parser.layerLineToXml(layer);
+			node = getNodeFromXmlString(xmlString);
+			PolylineData layers2 = parser.getLayerLine(node);
+			assertNotNull(layers2);
+			assertEquals(0, comparator.compare(layer, layers2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayerLine() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer_line.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayerLine(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layerFreeLine"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLayerOval() {
+		try {
+			LayerOvalComparator comparator = new LayerOvalComparator();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_oval.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			LayerOval layer = parser.getLayerOval(node);
+			assertNotNull(layer);
+
+			xmlString = parser.layerOvalToXml(layer);
+			node = getNodeFromXmlString(xmlString);
+			LayerOval layers2 = parser.getLayerOval(node);
+			assertNotNull(layers2);
+			assertEquals(0, comparator.compare(layer, layers2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayerOval() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer_oval.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayerOval(node);
+			fail("Exception expected");
+
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layerCompartmentAlias"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLayerText() {
+		try {
+			LayerTextComparator comparator = new LayerTextComparator();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/layer_text.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			LayerText layer = parser.getLayerText(node);
+			assertNotNull(layer);
+
+			xmlString = parser.layerTextToXml(layer);
+			node = getNodeFromXmlString(xmlString);
+			LayerText layers2 = parser.getLayerText(node);
+			assertNotNull(layers2);
+			assertEquals(0, comparator.compare(layer, layers2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testParseInvalidLayerText() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/layer_text.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.getLayerText(node);
+			fail("Exception expected");
+
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:layerSpeciesAlias"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAliasGroup() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			GenericProtein protein = new GenericProtein();
+			protein.setElementId("id1");
+			model.addElement(protein);
+			SpeciesAlias alias = new GenericProteinAlias("sa1035", protein);
+			model.addAlias(alias);
+
+			alias = new GenericProteinAlias("sa1036",protein);
+			model.addAlias(alias);
+
+			alias = new GenericProteinAlias("sa1037",protein);
+			model.addAlias(alias);
+
+			alias = new GenericProteinAlias("sa1038",protein);
+			model.addAlias(alias);
+
+			String string = "<celldesigner:group id=\"g74\" members=\"sa1035,sa1036,sa1037,sa1038\"/>";
+			Node node = getNodeFromXmlString(string);
+			AliasGroup group = parser.getAliasGroup(node, model);
+			assertNotNull(group);
+
+			assertEquals(4, group.getAliases().size());
+
+			assertEquals("g74", group.getIdGroup());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testLayerTextToXml() throws Exception {
+		try {
+			LayerText text = new LayerText(new Rectangle2D.Double(1, 2, 3, 4), "DF");
+			String xml = parser.layerTextToXml(text);
+			assertNotNull(xml);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/AliasCollectionXmlParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/AliasCollectionXmlParserTest.java
index 7e90f85781..193d7db924 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/AliasCollectionXmlParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/AliasCollectionXmlParserTest.java
@@ -1,322 +1,324 @@
-package lcsb.mapviewer.converter.model.celldesigner.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.converter.model.celldesigner.species.ModelMock;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class AliasCollectionXmlParserTest extends CellDesignerTestFunctions {
-
-	AliasCollectionXmlParser parser;
-	Model										 model;
-	Logger									 logger	= Logger.getLogger(AliasCollectionXmlParserTest.class.getName());
-
-	@Before
-	public void setUp() throws Exception {
-		model = new ModelMock();
-		Species species;
-
-		species = new Protein();
-		species.setElementId("s2594");
-		((ModelMock) model).addSpecies(species);
-
-		species = new Protein();
-		species.setElementId("s2506");
-		((ModelMock) model).addSpecies(species);
-
-		species = new Protein();
-		species.setElementId("s2595");
-		((ModelMock) model).addSpecies(species);
-
-		species = new Protein();
-		species.setElementId("s2596");
-		((ModelMock) model).addSpecies(species);
-
-		species = new Protein();
-		species.setElementId("s2597");
-		((ModelMock) model).addSpecies(species);
-
-		species = new Protein();
-		species.setElementId("s2598");
-		((ModelMock) model).addSpecies(species);
-
-		species = new Protein();
-		species.setElementId("s2599");
-		((ModelMock) model).addSpecies(species);
-
-		parser = new AliasCollectionXmlParser(model);
-
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseXmlSpeciesAliasCollection() {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_species_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			List<SpeciesAlias> list = parser.parseXmlSpeciesAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-			assertNotNull(list);
-			assertEquals(4, list.size());
-			SpeciesAlias aliasSa8 = null;
-			SpeciesAlias aliasSa9 = null;
-			SpeciesAlias aliasSa10 = null;
-			SpeciesAlias aliasSa11 = null;
-			for (SpeciesAlias alias : list) {
-				if (alias.getAliasId().equals("sa8"))
-					aliasSa8 = alias;
-				if (alias.getAliasId().equals("sa9"))
-					aliasSa9 = alias;
-				if (alias.getAliasId().equals("sa10"))
-					aliasSa10 = alias;
-				if (alias.getAliasId().equals("sa11"))
-					aliasSa11 = alias;
-			}
-			assertNotNull(aliasSa8);
-			assertNotNull(aliasSa9);
-			assertNotNull(aliasSa10);
-			assertNotNull(aliasSa11);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unexpected exception occured");
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlSpeciesAliasCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/species_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseXmlSpeciesAliasCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfSpeciesAliases"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlComplexAliasCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/complex_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseXmlComplexAliasCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfComplexSpeciesAliases"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlCompartmentAliasCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/compartment_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseXmlCompartmentAliasCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfCompartmentAliases"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSpeciesAliasCollectionToXmlString() {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_species_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			List<SpeciesAlias> list = parser.parseXmlSpeciesAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-			String xmlString2 = parser.speciesAliasCollectionToXmlString(list);
-			assertNotNull(xmlString2);
-
-			node = getNodeFromXmlString(xmlString2);
-			list = parser.parseXmlSpeciesAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-			assertNotNull(list);
-			assertEquals(4, list.size());
-			SpeciesAlias aliasSa8 = null;
-			SpeciesAlias aliasSa9 = null;
-			SpeciesAlias aliasSa10 = null;
-			SpeciesAlias aliasSa11 = null;
-			for (SpeciesAlias alias : list) {
-				if (alias.getAliasId().equals("sa8"))
-					aliasSa8 = alias;
-				if (alias.getAliasId().equals("sa9"))
-					aliasSa9 = alias;
-				if (alias.getAliasId().equals("sa10"))
-					aliasSa10 = alias;
-				if (alias.getAliasId().equals("sa11"))
-					aliasSa11 = alias;
-			}
-			assertNotNull(aliasSa8);
-			assertNotNull(aliasSa9);
-			assertNotNull(aliasSa10);
-			assertNotNull(aliasSa11);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unexpected exception occured");
-		}
-	}
-
-	@Test
-	public void testParseXmlComplexAliasCollection() {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_complex_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			List<ComplexAlias> list = parser.parseXmlComplexAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-			assertNotNull(list);
-			assertEquals(3, list.size());
-			ComplexAlias aliasSa1 = null;
-			ComplexAlias aliasSa2 = null;
-			ComplexAlias aliasSa3 = null;
-			for (ComplexAlias alias : list) {
-				if (alias.getAliasId().equals("csa1"))
-					aliasSa1 = alias;
-				if (alias.getAliasId().equals("csa2"))
-					aliasSa2 = alias;
-				if (alias.getAliasId().equals("csa3"))
-					aliasSa3 = alias;
-			}
-			assertNotNull(aliasSa1);
-			assertNotNull(aliasSa2);
-			assertNotNull(aliasSa3);
-
-		} catch (Exception e) {
-			fail("Unexpected exception occured");
-		}
-	}
-
-	@Test
-	public void testComplexAliasCollectionToXmlString() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_complex_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			List<ComplexAlias> list = parser.parseXmlComplexAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-			String xmlString2 = parser.complexAliasCollectionToXmlString(list);
-			assertNotNull(xmlString2);
-
-			node = getNodeFromXmlString(xmlString2);
-			list = parser.parseXmlComplexAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-			assertNotNull(list);
-			assertEquals(3, list.size());
-			ComplexAlias aliasSa1 = null;
-			ComplexAlias aliasSa2 = null;
-			ComplexAlias aliasSa3 = null;
-			for (ComplexAlias alias : list) {
-				if (alias.getAliasId().equals("csa1"))
-					aliasSa1 = alias;
-				if (alias.getAliasId().equals("csa2"))
-					aliasSa2 = alias;
-				if (alias.getAliasId().equals("csa3"))
-					aliasSa3 = alias;
-			}
-			assertNotNull(aliasSa1);
-			assertNotNull(aliasSa2);
-			assertNotNull(aliasSa3);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlCompartmentAliasCollection() {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_compartment_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			List<CompartmentAlias> list = parser.parseXmlCompartmentAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-			assertNotNull(list);
-			assertEquals(3, list.size());
-			CompartmentAlias aliasCa1 = null;
-			CompartmentAlias aliasCa2 = null;
-			CompartmentAlias aliasCa3 = null;
-			for (CompartmentAlias alias : list) {
-				if (alias.getAliasId().equals("ca1"))
-					aliasCa1 = alias;
-				if (alias.getAliasId().equals("ca2"))
-					aliasCa2 = alias;
-				if (alias.getAliasId().equals("ca3"))
-					aliasCa3 = alias;
-			}
-			assertNotNull(aliasCa1);
-			assertNotNull(aliasCa2);
-			assertNotNull(aliasCa3);
-
-		} catch (Exception e) {
-			fail("Unexpected exception occured");
-		}
-	}
-
-	@Test
-	public void testCompartmentAliasCollectionToXmlString() {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_compartment_alias_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			List<CompartmentAlias> list = parser.parseXmlCompartmentAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-
-			String xmlString2 = parser.compartmentAliasCollectionToXmlString(list);
-			assertNotNull(xmlString2);
-
-			node = getNodeFromXmlString(xmlString2);
-			list = parser.parseXmlCompartmentAliasCollection(node);
-			assertEquals(0, getWarnings().size());
-
-			assertNotNull(list);
-			assertEquals(3, list.size());
-			CompartmentAlias aliasSa1 = null;
-			CompartmentAlias aliasSa2 = null;
-			CompartmentAlias aliasSa3 = null;
-			for (CompartmentAlias alias : list) {
-				if (alias.getAliasId().equals("ca1"))
-					aliasSa1 = alias;
-				if (alias.getAliasId().equals("ca2"))
-					aliasSa2 = alias;
-				if (alias.getAliasId().equals("ca3"))
-					aliasSa3 = alias;
-			}
-			assertNotNull(aliasSa1);
-			assertNotNull(aliasSa2);
-			assertNotNull(aliasSa3);
-
-		} catch (Exception e) {
-			fail("Unexpected exception occured");
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.converter.model.celldesigner.species.ModelMock;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class AliasCollectionXmlParserTest extends CellDesignerTestFunctions {
+
+	AliasCollectionXmlParser parser;
+	Model										 model;
+	Logger									 logger	= Logger.getLogger(AliasCollectionXmlParserTest.class.getName());
+
+	@Before
+	public void setUp() throws Exception {
+		model = new ModelMock();
+		Species species;
+
+		species = new GenericProtein();
+		species.setElementId("s2594");
+		((ModelMock) model).addSpecies(species);
+
+		species = new GenericProtein();
+		species.setElementId("s2506");
+		((ModelMock) model).addSpecies(species);
+
+		species = new GenericProtein();
+		species.setElementId("s2595");
+		((ModelMock) model).addSpecies(species);
+
+		species = new GenericProtein();
+		species.setElementId("s2596");
+		((ModelMock) model).addSpecies(species);
+
+		species = new ComplexSpecies();
+		species.setElementId("s2597");
+		((ModelMock) model).addSpecies(species);
+
+		species = new ComplexSpecies();
+		species.setElementId("s2598");
+		((ModelMock) model).addSpecies(species);
+
+		species = new ComplexSpecies();
+		species.setElementId("s2599");
+		((ModelMock) model).addSpecies(species);
+
+		parser = new AliasCollectionXmlParser(model);
+
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseXmlSpeciesAliasCollection() {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_species_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			List<SpeciesAlias> list = parser.parseXmlSpeciesAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+			assertNotNull(list);
+			assertEquals(4, list.size());
+			SpeciesAlias aliasSa8 = null;
+			SpeciesAlias aliasSa9 = null;
+			SpeciesAlias aliasSa10 = null;
+			SpeciesAlias aliasSa11 = null;
+			for (SpeciesAlias alias : list) {
+				if (alias.getAliasId().equals("sa8"))
+					aliasSa8 = alias;
+				if (alias.getAliasId().equals("sa9"))
+					aliasSa9 = alias;
+				if (alias.getAliasId().equals("sa10"))
+					aliasSa10 = alias;
+				if (alias.getAliasId().equals("sa11"))
+					aliasSa11 = alias;
+			}
+			assertNotNull(aliasSa8);
+			assertNotNull(aliasSa9);
+			assertNotNull(aliasSa10);
+			assertNotNull(aliasSa11);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unexpected exception occured");
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlSpeciesAliasCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/species_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseXmlSpeciesAliasCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfSpeciesAliases"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlComplexAliasCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/complex_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseXmlComplexAliasCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfComplexSpeciesAliases"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlCompartmentAliasCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/compartment_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseXmlCompartmentAliasCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfCompartmentAliases"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSpeciesAliasCollectionToXmlString() {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_species_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			List<SpeciesAlias> list = parser.parseXmlSpeciesAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+			String xmlString2 = parser.speciesAliasCollectionToXmlString(list);
+			assertNotNull(xmlString2);
+
+			node = getNodeFromXmlString(xmlString2);
+			list = parser.parseXmlSpeciesAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+			assertNotNull(list);
+			assertEquals(4, list.size());
+			SpeciesAlias aliasSa8 = null;
+			SpeciesAlias aliasSa9 = null;
+			SpeciesAlias aliasSa10 = null;
+			SpeciesAlias aliasSa11 = null;
+			for (SpeciesAlias alias : list) {
+				if (alias.getAliasId().equals("sa8"))
+					aliasSa8 = alias;
+				if (alias.getAliasId().equals("sa9"))
+					aliasSa9 = alias;
+				if (alias.getAliasId().equals("sa10"))
+					aliasSa10 = alias;
+				if (alias.getAliasId().equals("sa11"))
+					aliasSa11 = alias;
+			}
+			assertNotNull(aliasSa8);
+			assertNotNull(aliasSa9);
+			assertNotNull(aliasSa10);
+			assertNotNull(aliasSa11);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unexpected exception occured");
+		}
+	}
+
+	@Test
+	public void testParseXmlComplexAliasCollection() {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_complex_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			List<ComplexAlias> list = parser.parseXmlComplexAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+			assertNotNull(list);
+			assertEquals(3, list.size());
+			ComplexAlias aliasSa1 = null;
+			ComplexAlias aliasSa2 = null;
+			ComplexAlias aliasSa3 = null;
+			for (ComplexAlias alias : list) {
+				if (alias.getAliasId().equals("csa1"))
+					aliasSa1 = alias;
+				if (alias.getAliasId().equals("csa2"))
+					aliasSa2 = alias;
+				if (alias.getAliasId().equals("csa3"))
+					aliasSa3 = alias;
+			}
+			assertNotNull(aliasSa1);
+			assertNotNull(aliasSa2);
+			assertNotNull(aliasSa3);
+
+		} catch (Exception e) {
+			fail("Unexpected exception occured");
+		}
+	}
+
+	@Test
+	public void testComplexAliasCollectionToXmlString() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_complex_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			List<ComplexAlias> list = parser.parseXmlComplexAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+			String xmlString2 = parser.complexAliasCollectionToXmlString(list);
+			assertNotNull(xmlString2);
+
+			node = getNodeFromXmlString(xmlString2);
+			list = parser.parseXmlComplexAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+			assertNotNull(list);
+			assertEquals(3, list.size());
+			ComplexAlias aliasSa1 = null;
+			ComplexAlias aliasSa2 = null;
+			ComplexAlias aliasSa3 = null;
+			for (ComplexAlias alias : list) {
+				if (alias.getAliasId().equals("csa1"))
+					aliasSa1 = alias;
+				if (alias.getAliasId().equals("csa2"))
+					aliasSa2 = alias;
+				if (alias.getAliasId().equals("csa3"))
+					aliasSa3 = alias;
+			}
+			assertNotNull(aliasSa1);
+			assertNotNull(aliasSa2);
+			assertNotNull(aliasSa3);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlCompartmentAliasCollection() {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_compartment_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			List<CompartmentAlias> list = parser.parseXmlCompartmentAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+			assertNotNull(list);
+			assertEquals(3, list.size());
+			CompartmentAlias aliasCa1 = null;
+			CompartmentAlias aliasCa2 = null;
+			CompartmentAlias aliasCa3 = null;
+			for (CompartmentAlias alias : list) {
+				if (alias.getAliasId().equals("ca1"))
+					aliasCa1 = alias;
+				if (alias.getAliasId().equals("ca2"))
+					aliasCa2 = alias;
+				if (alias.getAliasId().equals("ca3"))
+					aliasCa3 = alias;
+			}
+			assertNotNull(aliasCa1);
+			assertNotNull(aliasCa2);
+			assertNotNull(aliasCa3);
+
+		} catch (Exception e) {
+			fail("Unexpected exception occured");
+		}
+	}
+
+	@Test
+	public void testCompartmentAliasCollectionToXmlString() {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_compartment_alias_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			List<CompartmentAlias> list = parser.parseXmlCompartmentAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+
+			String xmlString2 = parser.compartmentAliasCollectionToXmlString(list);
+			assertNotNull(xmlString2);
+
+			node = getNodeFromXmlString(xmlString2);
+			list = parser.parseXmlCompartmentAliasCollection(node);
+			assertEquals(0, getWarnings().size());
+
+			assertNotNull(list);
+			assertEquals(3, list.size());
+			CompartmentAlias aliasSa1 = null;
+			CompartmentAlias aliasSa2 = null;
+			CompartmentAlias aliasSa3 = null;
+			for (CompartmentAlias alias : list) {
+				if (alias.getAliasId().equals("ca1"))
+					aliasSa1 = alias;
+				if (alias.getAliasId().equals("ca2"))
+					aliasSa2 = alias;
+				if (alias.getAliasId().equals("ca3"))
+					aliasSa3 = alias;
+			}
+			assertNotNull(aliasSa1);
+			assertNotNull(aliasSa2);
+			assertNotNull(aliasSa3);
+
+		} catch (Exception e) {
+			fail("Unexpected exception occured");
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/ComplexAliasXmlParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/ComplexAliasXmlParserTest.java
index 1ed1153670..e844b11d2c 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/ComplexAliasXmlParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/ComplexAliasXmlParserTest.java
@@ -1,78 +1,79 @@
-package lcsb.mapviewer.converter.model.celldesigner.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.converter.model.celldesigner.species.ModelMock;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ComplexAliasXmlParserTest extends CellDesignerTestFunctions {
-	Model													model;
-	private ComplexAliasXmlParser	parser;
-
-	@Before
-	public void setUp() throws Exception {
-		model = new ModelMock();
-		Species species = new Protein();
-		species.setElementId("s2597");
-		((ModelMock) model).addSpecies(species);
-		parser = new ComplexAliasXmlParser(model);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testToXml() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_complex_alias.xml");
-			ComplexAlias alias = (ComplexAlias) parser.parseXmlAlias(xmlString);
-			assertEquals(0, getWarnings().size());
-			String xmlString2 = parser.toXml(alias);
-			assertNotNull(xmlString2);
-			ComplexAlias alias2 = (ComplexAlias) parser.parseXmlAlias(xmlString2);
-			assertEquals(0, getWarnings().size());
-
-			assertEquals(alias.getAliasId(), alias2.getAliasId());
-			assertNotNull(alias.getSpecies());
-			assertEquals(alias.getFontSize(), alias2.getFontSize(), 1e-6);
-			assertEquals(alias.getHeight(), alias2.getHeight(), 1e-6);
-			assertEquals(alias.getWidth(), alias2.getWidth(), 1e-6);
-			assertEquals(alias.getX(), alias2.getX(), 1e-6);
-			assertEquals(alias.getY(), alias2.getY(), 1e-6);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlAliasNode() {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_complex_alias.xml");
-			ComplexAlias alias = (ComplexAlias) parser.parseXmlAlias(xmlString);
-			assertEquals(0, getWarnings().size());
-			assertEquals(false, alias.getActivity());
-			assertEquals("csa1", alias.getAliasId());
-			assertEquals(12.0, alias.getFontSize(), 1e-6);
-			assertEquals(120.0, alias.getHeight(), 1e-6);
-			assertEquals("s2597", alias.getSpecies().getElementId());
-			assertEquals(100.0, alias.getWidth(), 1e-6);
-			assertEquals(744.0, alias.getX(), 1e-6);
-			assertEquals(0.0, alias.getY(), 1e-6);
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unexpected exception occurred");
-		}
-	}
-}
+package lcsb.mapviewer.converter.model.celldesigner.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.converter.model.celldesigner.species.ModelMock;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class ComplexAliasXmlParserTest extends CellDesignerTestFunctions {
+	Model													model;
+	private ComplexAliasXmlParser	parser;
+
+	@Before
+	public void setUp() throws Exception {
+		model = new ModelMock();
+		Species species = new ComplexSpecies();
+		species.setElementId("s2597");
+		((ModelMock) model).addSpecies(species);
+		parser = new ComplexAliasXmlParser(model);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testToXml() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_complex_alias.xml");
+			ComplexAlias alias = (ComplexAlias) parser.parseXmlAlias(xmlString);
+			assertEquals(0, getWarnings().size());
+			String xmlString2 = parser.toXml(alias);
+			assertNotNull(xmlString2);
+			ComplexAlias alias2 = (ComplexAlias) parser.parseXmlAlias(xmlString2);
+			assertEquals(0, getWarnings().size());
+
+			assertEquals(alias.getAliasId(), alias2.getAliasId());
+			assertNotNull(alias.getSpecies());
+			assertEquals(alias.getFontSize(), alias2.getFontSize(), 1e-6);
+			assertEquals(alias.getHeight(), alias2.getHeight(), 1e-6);
+			assertEquals(alias.getWidth(), alias2.getWidth(), 1e-6);
+			assertEquals(alias.getX(), alias2.getX(), 1e-6);
+			assertEquals(alias.getY(), alias2.getY(), 1e-6);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlAliasNode() {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/cd_complex_alias.xml");
+			ComplexAlias alias = (ComplexAlias) parser.parseXmlAlias(xmlString);
+			assertEquals(0, getWarnings().size());
+			assertEquals(false, alias.getActivity());
+			assertEquals("csa1", alias.getAliasId());
+			assertEquals(12.0, alias.getFontSize(), 1e-6);
+			assertEquals(120.0, alias.getHeight(), 1e-6);
+			assertEquals("s2597", alias.getSpecies().getElementId());
+			assertEquals(100.0, alias.getWidth(), 1e-6);
+			assertEquals(744.0, alias.getX(), 1e-6);
+			assertEquals(0.0, alias.getY(), 1e-6);
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unexpected exception occurred");
+		}
+	}
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/SpeciesAliasXmlParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/SpeciesAliasXmlParserTest.java
index 1c8fb81fc0..a4954b7c05 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/SpeciesAliasXmlParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/SpeciesAliasXmlParserTest.java
@@ -1,337 +1,337 @@
-package lcsb.mapviewer.converter.model.celldesigner.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.converter.model.celldesigner.species.ModelMock;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class SpeciesAliasXmlParserTest extends CellDesignerTestFunctions {
-	static Logger									logger									= Logger.getLogger(SpeciesAliasXmlParser.class);
-
-	Model													model;
-	private SpeciesAliasXmlParser	parser;
-
-	private String								testCompartmentId2			= "s1";
-	private String								testCompartmentId				= "s2";
-	private String								testCompartmentAliasId2	= "s3";
-	private String								testCompartmentAliasId	= "s4";
-	private String								testSpeciesId						= "s5";
-	private String								testAliasId							= "s6";
-
-	@Before
-	public void setUp() throws Exception {
-		model = new ModelMock();
-		Species species = new Protein();
-		species.setElementId("s78");
-		((ModelMock) model).addSpecies(species);
-		parser = new SpeciesAliasXmlParser(model);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseXmlAliasNode() {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias.xml");
-			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
-			assertEquals(0, getWarnings().size());
-			assertEquals(false, alias.getActivity());
-			assertEquals("sa36", alias.getAliasId());
-			assertEquals(16.0, alias.getFontSize(), 1e-6);
-			assertEquals(25.0, alias.getHeight(), 1e-6);
-			assertEquals("s78", alias.getSpecies().getElementId());
-			assertEquals(80, alias.getWidth(), 1e-6);
-			assertEquals(11813.0, alias.getX(), 1e-6);
-			assertEquals(2840.5, alias.getY(), 1e-6);
-			assertEquals("ca1", alias.getParent().getAliasId());
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unexpected exception occurred");
-		}
-	}
-
-	@Test
-	public void testParseXmlAliasFont() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias_with_font.xml");
-			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
-			assertEquals(30.0, alias.getFontSize(), 1e-6);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXml() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias.xml");
-			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
-			assertEquals(0, getWarnings().size());
-			String xmlString2 = parser.toXml(alias);
-			assertNotNull(xmlString2);
-			SpeciesAlias alias2 = parser.parseXmlAlias(xmlString2);
-			assertEquals(0, getWarnings().size());
-
-			assertEquals(alias.getActivity(), alias2.getActivity());
-			assertEquals(alias.getAliasId(), alias2.getAliasId());
-			assertEquals(alias.getFontSize(), alias2.getFontSize(), 1e-6);
-			assertEquals(alias.getHeight(), alias2.getHeight(), 1e-6);
-			assertEquals(alias.getSpecies().getElementId(), alias2.getSpecies().getElementId());
-			assertEquals(alias.getWidth(), alias2.getWidth(), 1e-6);
-			assertEquals(alias.getX(), alias2.getX(), 1e-6);
-			assertEquals(alias.getY(), alias2.getY(), 1e-6);
-			assertEquals(alias.getParent().getAliasId(), alias2.getParent().getAliasId());
-			assertEquals("Alias state label different", alias.getAliasStateLabel(), alias2.getAliasStateLabel());
-			assertEquals("Alias state prefix different", alias.getAliasStatePrefix(), alias2.getAliasStatePrefix());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlAliasWithStateNode() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias_with_state.xml");
-			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
-			assertEquals(0, getWarnings().size());
-			String xmlString2 = parser.toXml(alias);
-			assertNotNull(xmlString2);
-			SpeciesAlias alias2 = parser.parseXmlAlias(xmlString2);
-			assertEquals(0, getWarnings().size());
-
-			assertEquals("Alias state label different", alias.getAliasStateLabel(), alias2.getAliasStateLabel());
-			assertEquals("Alias state prefix different", alias.getAliasStatePrefix(), alias2.getAliasStatePrefix());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlAliasWithStateNode() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias_with_state.xml");
-			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
-			assertEquals(0, getWarnings().size());
-			assertNotNull(alias);
-			assertEquals("test", alias.getAliasStateLabel());
-			assertEquals("free input", alias.getAliasStatePrefix());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlAliasWithoutStateNode() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias_without_state.xml");
-			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
-			assertEquals(0, getWarnings().size());
-			assertNotNull(alias);
-			assertNull(alias.getAliasStateLabel());
-			assertNull(alias.getAliasStatePrefix());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlAliasNode() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/species_alias.xml");
-			parser.parseXmlAlias(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown species for alias"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlAliasNode2() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/species_alias2.xml");
-			parser.parseXmlAlias(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:speciesAlias"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlAliasNode3() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/species_alias3.xml");
-			parser.parseXmlAlias(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("No view in Alias"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlAliasNode4() throws Exception {
-		try {
-			model = new ModelFullIndexed(null);
-			Species species = new Protein();
-			species.setElementId("s78");
-			model.addElement(species);
-			parser = new SpeciesAliasXmlParser(model);
-
-			String xmlString = readFile("testFiles/invalid/species_alias4.xml");
-			parser.parseXmlAlias(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("CompartmentAlias does not exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlAliasNode5() throws Exception {
-		try {
-			model = new ModelFullIndexed(null);
-			Species species = new Protein();
-			species.setElementId("s78");
-			model.addElement(species);
-			parser = new SpeciesAliasXmlParser(model);
-
-			String xmlString = readFile("testFiles/invalid/species_alias5.xml");
-			parser.parseXmlAlias(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("ComplexAlias does not exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlAliasNode6() throws Exception {
-		try {
-			model = new ModelFullIndexed(null);
-			Species species = new Protein();
-			species.setElementId("s78");
-			model.addElement(species);
-			parser = new SpeciesAliasXmlParser(model);
-
-			String xmlString = readFile("testFiles/invalid/species_alias6.xml");
-			parser.parseXmlAlias(xmlString);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Unkown alias state"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlWithUnknownCompartment() throws Exception {
-		try {
-			Model model = Mockito.mock(ModelFullIndexed.class);
-			ModelData md = new ModelData();
-			md.setModel(model);
-
-			Compartment compartment2 = new Compartment();
-			compartment2.setElementId(testCompartmentId2);
-			CompartmentAlias ca2 = new CompartmentAlias();
-			ca2.setAliasId(testCompartmentAliasId2);
-			ca2.setX(6);
-			ca2.setY(6);
-			ca2.setWidth(190);
-			ca2.setHeight(190);
-			ca2.setElement(compartment2);
-
-			Compartment compartment = new Compartment();
-			compartment.setElementId(testCompartmentId);
-			CompartmentAlias ca = new CompartmentAlias();
-			ca.setAliasId(testCompartmentAliasId);
-			ca.setX(5);
-			ca.setY(5);
-			ca.setWidth(200);
-			ca.setHeight(200);
-			ca.setElement(compartment);
-
-			List<CompartmentAlias> list = new ArrayList<>();
-			list.add(ca);
-			list.add(ca2);
-
-			// ensure that we return list (firts bigger compartment, then smaller)
-			when(model.getCompartmentsAliases()).thenReturn(list);
-			when(model.getModelData()).thenReturn(md);
-
-			Element element = new ComplexSpecies();
-			element.setElementId(testSpeciesId);
-
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setX(10);
-			alias.setY(10);
-			alias.setWidth(100);
-			alias.setHeight(100);
-			alias.setAliasId(testAliasId);
-			alias.setElement(element);
-			alias.setModel(model);
-			alias.setActivity(true);
-
-			model.addElement(element);
-			model.addAlias(alias);
-			SpeciesAliasXmlParser parser = new SpeciesAliasXmlParser(model);
-
-			String xml = parser.toXml(alias);
-
-			assertTrue(xml.contains(testSpeciesId));
-			assertTrue(xml.contains(testAliasId));
-			assertTrue(xml.contains(testCompartmentAliasId2));
-			assertTrue(xml.contains("<celldesigner:activity>active</celldesigner:activity>"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.converter.model.celldesigner.species.ModelMock;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class SpeciesAliasXmlParserTest extends CellDesignerTestFunctions {
+	static Logger									logger									= Logger.getLogger(SpeciesAliasXmlParser.class);
+
+	Model													model;
+	private SpeciesAliasXmlParser	parser;
+
+	private String								testCompartmentId2			= "s1";
+	private String								testCompartmentId				= "s2";
+	private String								testCompartmentAliasId2	= "s3";
+	private String								testCompartmentAliasId	= "s4";
+	private String								testSpeciesId						= "s5";
+	private String								testAliasId							= "s6";
+
+	@Before
+	public void setUp() throws Exception {
+		model = new ModelMock();
+		Species species = new GenericProtein();
+		species.setElementId("s78");
+		((ModelMock) model).addSpecies(species);
+		parser = new SpeciesAliasXmlParser(model);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseXmlAliasNode() {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias.xml");
+			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
+			assertEquals(0, getWarnings().size());
+			assertEquals(false, alias.getActivity());
+			assertEquals("sa36", alias.getAliasId());
+			assertEquals(16.0, alias.getFontSize(), 1e-6);
+			assertEquals(25.0, alias.getHeight(), 1e-6);
+			assertEquals("s78", alias.getSpecies().getElementId());
+			assertEquals(80, alias.getWidth(), 1e-6);
+			assertEquals(11813.0, alias.getX(), 1e-6);
+			assertEquals(2840.5, alias.getY(), 1e-6);
+			assertEquals("ca1", alias.getParent().getAliasId());
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unexpected exception occurred");
+		}
+	}
+
+	@Test
+	public void testParseXmlAliasFont() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias_with_font.xml");
+			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
+			assertEquals(30.0, alias.getFontSize(), 1e-6);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXml() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias.xml");
+			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
+			assertEquals(0, getWarnings().size());
+			String xmlString2 = parser.toXml(alias);
+			assertNotNull(xmlString2);
+			SpeciesAlias alias2 = parser.parseXmlAlias(xmlString2);
+			assertEquals(0, getWarnings().size());
+
+			assertEquals(alias.getActivity(), alias2.getActivity());
+			assertEquals(alias.getAliasId(), alias2.getAliasId());
+			assertEquals(alias.getFontSize(), alias2.getFontSize(), 1e-6);
+			assertEquals(alias.getHeight(), alias2.getHeight(), 1e-6);
+			assertEquals(alias.getSpecies().getElementId(), alias2.getSpecies().getElementId());
+			assertEquals(alias.getWidth(), alias2.getWidth(), 1e-6);
+			assertEquals(alias.getX(), alias2.getX(), 1e-6);
+			assertEquals(alias.getY(), alias2.getY(), 1e-6);
+			assertEquals(alias.getParent().getAliasId(), alias2.getParent().getAliasId());
+			assertEquals("Alias state label different", alias.getAliasStateLabel(), alias2.getAliasStateLabel());
+			assertEquals("Alias state prefix different", alias.getAliasStatePrefix(), alias2.getAliasStatePrefix());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlAliasWithStateNode() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias_with_state.xml");
+			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
+			assertEquals(0, getWarnings().size());
+			String xmlString2 = parser.toXml(alias);
+			assertNotNull(xmlString2);
+			SpeciesAlias alias2 = parser.parseXmlAlias(xmlString2);
+			assertEquals(0, getWarnings().size());
+
+			assertEquals("Alias state label different", alias.getAliasStateLabel(), alias2.getAliasStateLabel());
+			assertEquals("Alias state prefix different", alias.getAliasStatePrefix(), alias2.getAliasStatePrefix());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlAliasWithStateNode() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias_with_state.xml");
+			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
+			assertEquals(0, getWarnings().size());
+			assertNotNull(alias);
+			assertEquals("test", alias.getAliasStateLabel());
+			assertEquals("free input", alias.getAliasStatePrefix());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlAliasWithoutStateNode() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/species_alias_without_state.xml");
+			SpeciesAlias alias = parser.parseXmlAlias(xmlString);
+			assertEquals(0, getWarnings().size());
+			assertNotNull(alias);
+			assertNull(alias.getAliasStateLabel());
+			assertNull(alias.getAliasStatePrefix());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlAliasNode() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/species_alias.xml");
+			parser.parseXmlAlias(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown species for alias"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlAliasNode2() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/species_alias2.xml");
+			parser.parseXmlAlias(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:speciesAlias"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlAliasNode3() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/species_alias3.xml");
+			parser.parseXmlAlias(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("No view in Alias"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlAliasNode4() throws Exception {
+		try {
+			model = new ModelFullIndexed(null);
+			Species species = new GenericProtein();
+			species.setElementId("s78");
+			model.addElement(species);
+			parser = new SpeciesAliasXmlParser(model);
+
+			String xmlString = readFile("testFiles/invalid/species_alias4.xml");
+			parser.parseXmlAlias(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("CompartmentAlias does not exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlAliasNode5() throws Exception {
+		try {
+			model = new ModelFullIndexed(null);
+			Species species = new GenericProtein();
+			species.setElementId("s78");
+			model.addElement(species);
+			parser = new SpeciesAliasXmlParser(model);
+
+			String xmlString = readFile("testFiles/invalid/species_alias5.xml");
+			parser.parseXmlAlias(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("ComplexAlias does not exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlAliasNode6() throws Exception {
+		try {
+			model = new ModelFullIndexed(null);
+			Species species = new GenericProtein();
+			species.setElementId("s78");
+			model.addElement(species);
+			parser = new SpeciesAliasXmlParser(model);
+
+			String xmlString = readFile("testFiles/invalid/species_alias6.xml");
+			parser.parseXmlAlias(xmlString);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Unkown alias state"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlWithUnknownCompartment() throws Exception {
+		try {
+			Model model = Mockito.mock(ModelFullIndexed.class);
+			ModelData md = new ModelData();
+			md.setModel(model);
+
+			Compartment compartment2 = new Compartment();
+			compartment2.setElementId(testCompartmentId2);
+			CompartmentAlias ca2 = new CompartmentAlias();
+			ca2.setAliasId(testCompartmentAliasId2);
+			ca2.setX(6);
+			ca2.setY(6);
+			ca2.setWidth(190);
+			ca2.setHeight(190);
+			ca2.setElement(compartment2);
+
+			Compartment compartment = new Compartment();
+			compartment.setElementId(testCompartmentId);
+			CompartmentAlias ca = new CompartmentAlias();
+			ca.setAliasId(testCompartmentAliasId);
+			ca.setX(5);
+			ca.setY(5);
+			ca.setWidth(200);
+			ca.setHeight(200);
+			ca.setElement(compartment);
+
+			List<CompartmentAlias> list = new ArrayList<>();
+			list.add(ca);
+			list.add(ca2);
+
+			// ensure that we return list (firts bigger compartment, then smaller)
+			when(model.getCompartmentsAliases()).thenReturn(list);
+			when(model.getModelData()).thenReturn(md);
+
+			ComplexSpecies element = new ComplexSpecies();
+			element.setElementId(testSpeciesId);
+
+			SpeciesAlias alias = new ComplexAlias(element);
+			alias.setX(10);
+			alias.setY(10);
+			alias.setWidth(100);
+			alias.setHeight(100);
+			alias.setAliasId(testAliasId);
+			alias.setModel(model);
+			alias.setActivity(true);
+
+			model.addElement(element);
+			model.addAlias(alias);
+			SpeciesAliasXmlParser parser = new SpeciesAliasXmlParser(model);
+
+			String xml = parser.toXml(alias);
+
+			assertTrue(xml.contains(testSpeciesId));
+			assertTrue(xml.contains(testAliasId));
+			assertTrue(xml.contains(testCompartmentAliasId2));
+			assertTrue(xml.contains("<celldesigner:activity>active</celldesigner:activity>"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParserTest.java
index 30699c2dd7..da9a4e10a8 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParserTest.java
@@ -27,9 +27,11 @@ import lcsb.mapviewer.model.map.Element;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamRelationType;
 import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Protein;
 import lcsb.mapviewer.model.map.species.Species;
 
@@ -71,8 +73,8 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
 		try {
 			RestAnnotationParser parser = new RestAnnotationParser();
 			Document node = getXmlDocumentFromFile("testFiles/xmlNodeTestExamples/notes.xml");
-			Protein protein = new Protein();
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProtein protein = new GenericProtein();
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			parser.processNotes(node.getFirstChild(), proteinAlias);
 			String notes = protein.getNotes();
 			assertNotNull(notes);
@@ -95,8 +97,8 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
 		try {
 			RestAnnotationParser parser = new RestAnnotationParser();
 			Document node = getXmlDocumentFromFile("testFiles/xmlNodeTestExamples/notes3.xml");
-			Protein protein = new Protein();
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			GenericProtein protein = new GenericProtein();
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			parser.processNotes(node.getFirstChild(), proteinAlias);
 			String notes = protein.getNotes();
 			assertNotNull(notes);
@@ -119,9 +121,9 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
 		try {
 			RestAnnotationParser parser = new RestAnnotationParser();
 			Document node = getXmlDocumentFromFile("testFiles/xmlNodeTestExamples/notes4.xml");
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setNotes("text");
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			parser.processNotes(node.getFirstChild(), proteinAlias);
 			String notes = protein.getNotes();
 			assertNotNull(notes);
@@ -144,7 +146,7 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
 		try {
 			RestAnnotationParser parser = new RestAnnotationParser();
 			Document node = getXmlDocumentFromFile("testFiles/xmlNodeTestExamples/notes2.xml");
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setElementId("pr_id1");
 			protein.addSynonym("a1");
 			protein.addFormerSymbol("a1");
@@ -153,7 +155,7 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
 			protein.setCharge(9);
 			protein.setSymbol("D");
 
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			parser.processNotes(node.getFirstChild(), proteinAlias);
 			assertEquals(1, protein.getSynonyms().size());
 			assertEquals(1, protein.getFormerSymbols().size());
@@ -171,9 +173,9 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
 		try {
 			RestAnnotationParser parser = new RestAnnotationParser();
 			Document node = getXmlDocumentFromFile("testFiles/xmlNodeTestExamples/notes_invalid_charge.xml");
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			parser.processNotes(node.getFirstChild(), proteinAlias);
 
 			assertEquals(1, getWarnings().size());
@@ -237,12 +239,12 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
 	public void testProcessRdfDescription() throws Exception {
 		try {
 			RestAnnotationParser rap = new RestAnnotationParser();
-			Species species = new Species();
+			GenericProtein species = new GenericProtein();
 			species.setNotes(
 					"begining\n" + "<rdf:RDF>" + "<rdf:Description rdf:about=\"#s2157\">\n" + "<bqmodel:is>\n" + "<rdf:Bag>\n"
 							+ "<rdf:li rdf:resource=\"urn:miriam:obo.chebi:CHEBI%3A17515\"/>\n" + "</rdf:Bag>\n" + "</bqmodel:is>\n" + "</rdf:Description>\n" + "</rdf:RDF>"
 							+ "\nend ending");
-			SpeciesAlias speciesAlias = new SpeciesAlias(species);
+			SpeciesAlias speciesAlias = new GenericProteinAlias(species);
 			rap.processRdfDescription(speciesAlias);
 			assertEquals("begining\n\nend ending", species.getNotes());
 		} catch (Exception e) {
@@ -439,7 +441,7 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
 			RestAnnotationParser parser = new RestAnnotationParser();
 			String str = super.readFile("testFiles/xmlNodeTestExamples/notes5.xml");
 
-			parser.processNotes(str, new SpeciesAlias(new Species()));
+			parser.processNotes(str, new GenericProteinAlias(new GenericProtein()));
 
 			assertEquals(1, getWarnings().size());
 
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/AbstractCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/AbstractCellDesignerAliasConverterTest.java
index 4b2585be83..47fca46049 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/AbstractCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/AbstractCellDesignerAliasConverterTest.java
@@ -1,81 +1,84 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertEquals;
-
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.EventStorageLoggerAppender;
-import lcsb.mapviewer.common.geometry.LineTransformation;
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerEllipseTransformation;
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerPolygonTransformation;
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerRectangleTransformation;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-
-public class AbstractCellDesignerAliasConverterTest {
-
-	AbstractCellDesignerAliasConverter<SpeciesAlias> converter = new AbstractCellDesignerAliasConverter<SpeciesAlias>() {
-
-		@Override
-		public Point2D getPointCoordinates(SpeciesAlias alias, CellDesignerAnchor anchor) {
-			return null;
-		}
-
-		@Override
-		protected PathIterator getBoundPathIterator(SpeciesAlias alias) {
-			return null;
-		}
-	};
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetAnchorPointCoordinatesForInvalidImplementation() {
-		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
-		Logger.getRootLogger().addAppender(appender);
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setWidth(1);
-			alias.setHeight(1);
-			converter.getAnchorPointCoordinates(alias, 0);
-			assertEquals(1, appender.getWarnings().size());
-		} finally {
-			Logger.getRootLogger().removeAppender(appender);
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		CellDesignerEllipseTransformation ellipseTransformation = new CellDesignerEllipseTransformation();
-		LineTransformation lineTransformation = new LineTransformation();
-		CellDesignerPolygonTransformation polygonTransformation = new CellDesignerPolygonTransformation();
-		CellDesignerRectangleTransformation rectangleTransformation = new CellDesignerRectangleTransformation();
-		converter.setEllipseTransformation(ellipseTransformation);
-		converter.setLineTransformation(lineTransformation);
-		converter.setPolygonTransformation(polygonTransformation);
-		converter.setRectangleTransformation(rectangleTransformation);
-
-		assertEquals(ellipseTransformation, converter.getEllipseTransformation());
-		assertEquals(lineTransformation, converter.getLineTransformation());
-		assertEquals(polygonTransformation, converter.getPolygonTransformation());
-		assertEquals(rectangleTransformation, converter.getRectangleTransformation());
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertEquals;
+
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.EventStorageLoggerAppender;
+import lcsb.mapviewer.common.geometry.LineTransformation;
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerEllipseTransformation;
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerPolygonTransformation;
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerRectangleTransformation;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.ProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class AbstractCellDesignerAliasConverterTest {
+
+	AbstractCellDesignerAliasConverter<SpeciesAlias> converter = new AbstractCellDesignerAliasConverter<SpeciesAlias>() {
+
+		@Override
+		public Point2D getPointCoordinates(SpeciesAlias alias, CellDesignerAnchor anchor) {
+			return null;
+		}
+
+		@Override
+		protected PathIterator getBoundPathIterator(SpeciesAlias alias) {
+			return null;
+		}
+	};
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetAnchorPointCoordinatesForInvalidImplementation() {
+		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
+		Logger.getRootLogger().addAppender(appender);
+		try {
+			ProteinAlias alias = new GenericProteinAlias(new GenericProtein());
+			alias.setWidth(1);
+			alias.setHeight(1);
+			converter.getAnchorPointCoordinates(alias, 0);
+			assertEquals(1, appender.getWarnings().size());
+		} finally {
+			Logger.getRootLogger().removeAppender(appender);
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		CellDesignerEllipseTransformation ellipseTransformation = new CellDesignerEllipseTransformation();
+		LineTransformation lineTransformation = new LineTransformation();
+		CellDesignerPolygonTransformation polygonTransformation = new CellDesignerPolygonTransformation();
+		CellDesignerRectangleTransformation rectangleTransformation = new CellDesignerRectangleTransformation();
+		converter.setEllipseTransformation(ellipseTransformation);
+		converter.setLineTransformation(lineTransformation);
+		converter.setPolygonTransformation(polygonTransformation);
+		converter.setRectangleTransformation(rectangleTransformation);
+
+		assertEquals(ellipseTransformation, converter.getEllipseTransformation());
+		assertEquals(lineTransformation, converter.getLineTransformation());
+		assertEquals(polygonTransformation, converter.getPolygonTransformation());
+		assertEquals(rectangleTransformation, converter.getRectangleTransformation());
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/AntisenseRnaCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/AntisenseRnaCellDesignerAliasConverterTest.java
index 1c7c8c9b98..27184e4a23 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/AntisenseRnaCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/AntisenseRnaCellDesignerAliasConverterTest.java
@@ -1,57 +1,58 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-public class AntisenseRnaCellDesignerAliasConverterTest {
-	AntisenseRnaCellDesignerAliasConverter converter = new AntisenseRnaCellDesignerAliasConverter();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetPointCoordinatesForSbgn() {
-		Model model = new ModelFullIndexed(null);
-		model.setSbgnFormat(true);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(10);
-		alias.setModel(model);
-		Point2D point = converter.getPointCoordinates(alias, CellDesignerAnchor.E);
-		assertNotNull(point);
-	}
-
-	@Test
-	public void testGetAntisebseRnaPathForSbgn() {
-		Model model = new ModelFullIndexed(null);
-		model.setSbgnFormat(true);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(10);
-		alias.setModel(model);
-		PathIterator path = converter.getBoundPathIterator(alias);
-		assertNotNull(path);
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class AntisenseRnaCellDesignerAliasConverterTest {
+	AntisenseRnaCellDesignerAliasConverter converter = new AntisenseRnaCellDesignerAliasConverter();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetPointCoordinatesForSbgn() {
+		Model model = new ModelFullIndexed(null);
+		model.setSbgnFormat(true);
+		SpeciesAlias alias = new GenericProteinAlias(null,null);
+		alias.setWidth(10);
+		alias.setHeight(10);
+		alias.setModel(model);
+		Point2D point = converter.getPointCoordinates(alias, CellDesignerAnchor.E);
+		assertNotNull(point);
+	}
+
+	@Test
+	public void testGetAntisenseRnaPathForSbgn() {
+		Model model = new ModelFullIndexed(null);
+		model.setSbgnFormat(true);
+		SpeciesAlias alias = new GenericProteinAlias(null,null);
+		alias.setWidth(10);
+		alias.setHeight(10);
+		alias.setModel(model);
+		PathIterator path = converter.getBoundPathIterator(alias);
+		assertNotNull(path);
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/CellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/CellDesignerAliasConverterTest.java
index 5521fa1561..0d43ab1fa2 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/CellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/CellDesignerAliasConverterTest.java
@@ -1,49 +1,50 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class CellDesignerAliasConverterTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testConstructorWithInvalidArg() {
-		try {
-			new CellDesignerAliasConverter(null);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("alias cannot be null"));
-		}
-	}
-
-	@Test
-	public void testConstructorWithInvalidArg2() {
-		try {
-			new CellDesignerAliasConverter(new SpeciesAlias(new Species()));
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown converter for class"));
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+
+public class CellDesignerAliasConverterTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testConstructorWithInvalidArg() {
+		try {
+			new CellDesignerAliasConverter(null);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("alias cannot be null"));
+		}
+	}
+
+	@Test
+	public void testConstructorWithInvalidArg2() {
+		try {
+			SpeciesAlias alias = Mockito.mock(SpeciesAlias.class);
+			new CellDesignerAliasConverter(alias);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unknown converter for class"));
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/DegradedCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/DegradedCellDesignerAliasConverterTest.java
index 545dc6e917..659a850d0d 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/DegradedCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/DegradedCellDesignerAliasConverterTest.java
@@ -1,56 +1,57 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-
-public class DegradedCellDesignerAliasConverterTest {
-
-	DegradedCellDesignerAliasConverter converter = new DegradedCellDesignerAliasConverter();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetAnchorPointCoordinatesForInvalidAlias() {
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setWidth(-1);
-		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
-		assertNotNull(point);
-	}
-
-	@Test
-	public void testGetAnchorPointCoordinatesForInvalidAlias2() {
-		SpeciesAlias alias = new SpeciesAlias();
-		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
-		assertNotNull(point);
-	}
-
-	@Test
-	public void testNotImplementedMethod() {
-		try {
-			converter.getBoundPathIterator(null);
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("This class doesn't have bound"));
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.layout.alias.DegradedAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+
+public class DegradedCellDesignerAliasConverterTest {
+
+	DegradedCellDesignerAliasConverter converter = new DegradedCellDesignerAliasConverter();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetAnchorPointCoordinatesForInvalidAlias() {
+		DegradedAlias alias = new DegradedAlias(null,null);
+		alias.setWidth(-1);
+		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
+		assertNotNull(point);
+	}
+
+	@Test
+	public void testGetAnchorPointCoordinatesForInvalidAlias2() {
+		SpeciesAlias alias = new DegradedAlias(null,null);
+		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
+		assertNotNull(point);
+	}
+
+	@Test
+	public void testNotImplementedMethod() {
+		try {
+			converter.getBoundPathIterator(null);
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("This class doesn't have bound"));
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/GeneCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/GeneCellDesignerAliasConverterTest.java
index 317975a749..dafbf72ab1 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/GeneCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/GeneCellDesignerAliasConverterTest.java
@@ -1,72 +1,74 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.awt.geom.PathIterator;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-public class GeneCellDesignerAliasConverterTest {
-
-	GeneCellDesignerAliasConverter converter = new GeneCellDesignerAliasConverter();
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetInvalidAliasPointCoordinates() {
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setX(1);
-		alias.setY(12);
-		alias.setWidth(10);
-		alias.setHeight(10);
-		assertNotNull(converter.getPointCoordinates(alias, null));
-	}
-
-	@Test
-	public void testGetPath() {
-		Model model = new ModelFullIndexed(null);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setX(1);
-		alias.setY(12);
-		alias.setWidth(10);
-		alias.setHeight(10);
-		
-		alias.setModel(model);
-		PathIterator path = converter.getBoundPathIterator(alias);
-		
-		assertNotNull(path);
-	}
-
-	@Test
-	public void testGetPath2() {
-		Model model = new ModelFullIndexed(null);
-		model.setSbgnFormat(true);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setX(1);
-		alias.setY(12);
-		alias.setWidth(10);
-		alias.setHeight(10);
-		
-		alias.setModel(model);
-		PathIterator path = converter.getBoundPathIterator(alias);
-		
-		assertNotNull(path);
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.awt.geom.PathIterator;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.layout.alias.GeneAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class GeneCellDesignerAliasConverterTest {
+
+	GeneCellDesignerAliasConverter converter = new GeneCellDesignerAliasConverter();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetInvalidAliasPointCoordinates() {
+		SpeciesAlias alias = new GeneAlias(null, null);
+		alias.setX(1);
+		alias.setY(12);
+		alias.setWidth(10);
+		alias.setHeight(10);
+		assertNotNull(converter.getPointCoordinates(alias, null));
+	}
+
+	@Test
+	public void testGetPath() {
+		Model model = new ModelFullIndexed(null);
+		SpeciesAlias alias = new GeneAlias(null, null);
+		alias.setX(1);
+		alias.setY(12);
+		alias.setWidth(10);
+		alias.setHeight(10);
+
+		alias.setModel(model);
+		PathIterator path = converter.getBoundPathIterator(alias);
+
+		assertNotNull(path);
+	}
+
+	@Test
+	public void testGetPath2() {
+		Model model = new ModelFullIndexed(null);
+		model.setSbgnFormat(true);
+		SpeciesAlias alias = new GeneAlias(null, null);
+		alias.setX(1);
+		alias.setY(12);
+		alias.setWidth(10);
+		alias.setHeight(10);
+
+		alias.setModel(model);
+		PathIterator path = converter.getBoundPathIterator(alias);
+
+		assertNotNull(path);
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/IonCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/IonCellDesignerAliasConverterTest.java
index 6f9afebe9d..96d01c6ddc 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/IonCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/IonCellDesignerAliasConverterTest.java
@@ -1,56 +1,58 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-
-public class IonCellDesignerAliasConverterTest {
-
-	IonCellDesignerAliasConverter converter = new IonCellDesignerAliasConverter();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetAnchorPointCoordinatesForInvalidAlias() {
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setWidth(-1);
-		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
-		assertNotNull(point);
-	}
-
-	@Test
-	public void testGetAnchorPointCoordinatesForInvalidAlias2() {
-		SpeciesAlias alias = new SpeciesAlias();
-		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
-		assertNotNull(point);
-	}
-
-	@Test
-	public void testNotImplementedMethod() {
-		try {
-			converter.getBoundPathIterator(null);
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("This class doesn't have bound"));
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.layout.alias.IonAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.species.Ion;
+
+public class IonCellDesignerAliasConverterTest {
+
+	IonCellDesignerAliasConverter converter = new IonCellDesignerAliasConverter();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetAnchorPointCoordinatesForInvalidAlias() {
+		SpeciesAlias alias = new IonAlias(new Ion());
+		alias.setWidth(-1);
+		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
+		assertNotNull(point);
+	}
+
+	@Test
+	public void testGetAnchorPointCoordinatesForInvalidAlias2() {
+		SpeciesAlias alias = new IonAlias(new Ion());
+		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
+		assertNotNull(point);
+	}
+
+	@Test
+	public void testNotImplementedMethod() {
+		try {
+			converter.getBoundPathIterator(null);
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("This class doesn't have bound"));
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinCellDesignerAliasConverterTest.java
index aa4c512d8a..73fb1926d1 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinCellDesignerAliasConverterTest.java
@@ -1,69 +1,74 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Point2D;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.EventStorageLoggerAppender;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ProteinCellDesignerAliasConverterTest {
-
-	ProteinCellDesignerAliasConverter converter = new ProteinCellDesignerAliasConverter();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetPointCoordinates() {
-		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
-		Logger.getRootLogger().addAppender(appender);
-
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			Protein species = new Protein();
-			alias.setWidth(1);
-			alias.setHeight(1);
-			alias.setSpecies(species);
-			Point2D point = converter.getPointCoordinates(alias, CellDesignerAnchor.E);
-			assertNotNull(point);
-			assertEquals(1, appender.getWarnings().size());
-		} finally {
-			Logger.getRootLogger().removeAppender(appender);
-		}
-	}
-
-	@Test
-	public void testNotImplementedMethod() {
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			Species species = new Species();
-			alias.setSpecies(species);
-			converter.getBoundPathIterator(alias);
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Not implemented protein converter for type"));
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Point2D;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import lcsb.mapviewer.common.EventStorageLoggerAppender;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.ProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+
+public class ProteinCellDesignerAliasConverterTest {
+
+	ProteinCellDesignerAliasConverter converter = new ProteinCellDesignerAliasConverter();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetPointCoordinates() {
+		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
+		Logger.getRootLogger().addAppender(appender);
+
+		try {
+			Protein species = new Protein();
+			SpeciesAlias alias = new ProteinAlias(species){
+				@Override
+				public SpeciesAlias copy() {
+					// TODO Auto-generated method stub
+					return null;
+				}};
+			alias.setWidth(1);
+			alias.setHeight(1);
+			Point2D point = converter.getPointCoordinates(alias, CellDesignerAnchor.E);
+			assertNotNull(point);
+			assertEquals(1, appender.getWarnings().size());
+		} finally {
+			Logger.getRootLogger().removeAppender(appender);
+		}
+	}
+
+	@Test
+	public void testNotImplementedMethod() {
+		try {
+			SpeciesAlias alias = Mockito.mock(SpeciesAlias.class);
+			converter.getBoundPathIterator(alias);
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Not implemented protein converter for type"));
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinConverterTest.java
index a09811fd5a..b80000606c 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/ProteinConverterTest.java
@@ -1,54 +1,52 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertEquals;
-
-import java.awt.geom.Point2D;
-
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ProteinConverterTest extends CellDesignerTestFunctions{
-	static Logger logger = Logger.getLogger(ProteinConverterTest .class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetAnchorForAlias() throws Exception {
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setWidth(200);
-			alias.setHeight(300);
-			alias.setX(100.0);
-			alias.setY(50.0);
-			
-			Protein protein = new GenericProtein();
-			alias.setSpecies(protein);
-			
-			CellDesignerAliasConverter converter = new CellDesignerAliasConverter(alias);
-			
-			for (CellDesignerAnchor anchor: CellDesignerAnchor.values()) {
-				Point2D point = converter.getPointCoordinates(alias, anchor);
-				CellDesignerAnchor newAnchor = converter.getAnchorForCoordinates(alias, point);
-				assertEquals(anchor, newAnchor);
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertEquals;
+
+import java.awt.geom.Point2D;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class ProteinConverterTest extends CellDesignerTestFunctions {
+	static Logger logger = Logger.getLogger(ProteinConverterTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetAnchorForAlias() throws Exception {
+		try {
+
+			GenericProtein protein = new GenericProtein();
+			GenericProteinAlias alias = new GenericProteinAlias(protein);
+			alias.setWidth(200);
+			alias.setHeight(300);
+			alias.setX(100.0);
+			alias.setY(50.0);
+
+			CellDesignerAliasConverter converter = new CellDesignerAliasConverter(alias);
+
+			for (CellDesignerAnchor anchor : CellDesignerAnchor.values()) {
+				Point2D point = converter.getPointCoordinates(alias, anchor);
+				CellDesignerAnchor newAnchor = converter.getAnchorForCoordinates(alias, point);
+				assertEquals(anchor, newAnchor);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/RnaCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/RnaCellDesignerAliasConverterTest.java
index 899bc44aab..88a73006eb 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/RnaCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/RnaCellDesignerAliasConverterTest.java
@@ -1,57 +1,58 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-public class RnaCellDesignerAliasConverterTest {
-	RnaCellDesignerAliasConverter converter = new RnaCellDesignerAliasConverter();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetPointCoordinatesForSbgn() {
-		Model model = new ModelFullIndexed(null);
-		model.setSbgnFormat(true);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(10);
-		alias.setModel(model);
-		Point2D point = converter.getPointCoordinates(alias, CellDesignerAnchor.E);
-		assertNotNull(point);
-	}
-
-	@Test
-	public void testGetAntisebseRnaPathForSbgn() {
-		Model model = new ModelFullIndexed(null);
-		model.setSbgnFormat(true);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(10);
-		alias.setModel(model);
-		PathIterator path = converter.getBoundPathIterator(alias);
-		assertNotNull(path);
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class RnaCellDesignerAliasConverterTest {
+	RnaCellDesignerAliasConverter converter = new RnaCellDesignerAliasConverter();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetPointCoordinatesForSbgn() {
+		Model model = new ModelFullIndexed(null);
+		model.setSbgnFormat(true);
+		SpeciesAlias alias = new GenericProteinAlias(null, null);
+		alias.setWidth(10);
+		alias.setHeight(10);
+		alias.setModel(model);
+		Point2D point = converter.getPointCoordinates(alias, CellDesignerAnchor.E);
+		assertNotNull(point);
+	}
+
+	@Test
+	public void testGetAntisebseRnaPathForSbgn() {
+		Model model = new ModelFullIndexed(null);
+		model.setSbgnFormat(true);
+		SpeciesAlias alias = new GenericProteinAlias(null, null);
+		alias.setWidth(10);
+		alias.setHeight(10);
+		alias.setModel(model);
+		PathIterator path = converter.getBoundPathIterator(alias);
+		assertNotNull(path);
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/SimpleMoleculeCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/SimpleMoleculeCellDesignerAliasConverterTest.java
index 3597653cd6..f30c1240a8 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/SimpleMoleculeCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/SimpleMoleculeCellDesignerAliasConverterTest.java
@@ -1,95 +1,96 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-public class SimpleMoleculeCellDesignerAliasConverterTest {
-
-	SimpleMoleculeCellDesignerAliasConverter converter = new SimpleMoleculeCellDesignerAliasConverter();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testPathIterator() {
-		try {
-			converter.getBoundPathIterator(null);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		}
-	}
-
-	@Test
-	public void testGetSbgnPointCoordinates() {
-		Model model = new ModelFullIndexed(null);
-		model.setSbgnFormat(true);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setX(4);
-		alias.setY(5);
-		alias.setWidth(6);
-		alias.setHeight(7);
-		alias.setModel(model);
-
-		Point2D point = converter.getPointCoordinates(alias, CellDesignerAnchor.E);
-		assertNotNull(point);
-
-	}
-
-	@Test
-	public void testGetSbgnAnchorPointCoordinates() {
-		Model model = new ModelFullIndexed(null);
-		model.setSbgnFormat(true);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setX(4);
-		alias.setY(5);
-		alias.setWidth(6);
-		alias.setHeight(7);
-		alias.setModel(model);
-
-		Point2D point = converter.getAnchorPointCoordinates(alias, 2);
-		assertNotNull(point);
-
-	}
-
-	@Test
-	public void testGetAnchorPointCoordinatesForEmptyAlias() {
-		Model model = new ModelFullIndexed(null);
-		model.setSbgnFormat(true);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setX(4);
-		alias.setY(5);
-		alias.setWidth(0);
-		alias.setHeight(0);
-		alias.setModel(model);
-
-		Point2D point = converter.getAnchorPointCoordinates(alias, 2);
-		assertEquals(0.0, point.distance(new Point2D.Double(4, 5)), Configuration.EPSILON);
-
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.geometry.helper.CellDesignerAnchor;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class SimpleMoleculeCellDesignerAliasConverterTest {
+
+	SimpleMoleculeCellDesignerAliasConverter converter = new SimpleMoleculeCellDesignerAliasConverter();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testPathIterator() {
+		try {
+			converter.getBoundPathIterator(null);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		}
+	}
+
+	@Test
+	public void testGetSbgnPointCoordinates() {
+		Model model = new ModelFullIndexed(null);
+		model.setSbgnFormat(true);
+		SpeciesAlias alias = new SimpleMoleculeAlias(null,null);
+		alias.setX(4);
+		alias.setY(5);
+		alias.setWidth(6);
+		alias.setHeight(7);
+		alias.setModel(model);
+
+		Point2D point = converter.getPointCoordinates(alias, CellDesignerAnchor.E);
+		assertNotNull(point);
+
+	}
+
+	@Test
+	public void testGetSbgnAnchorPointCoordinates() {
+		Model model = new ModelFullIndexed(null);
+		model.setSbgnFormat(true);
+		SpeciesAlias alias = new SimpleMoleculeAlias(null,null);
+		alias.setX(4);
+		alias.setY(5);
+		alias.setWidth(6);
+		alias.setHeight(7);
+		alias.setModel(model);
+
+		Point2D point = converter.getAnchorPointCoordinates(alias, 2);
+		assertNotNull(point);
+
+	}
+
+	@Test
+	public void testGetAnchorPointCoordinatesForEmptyAlias() {
+		Model model = new ModelFullIndexed(null);
+		model.setSbgnFormat(true);
+		SpeciesAlias alias = new SimpleMoleculeAlias(null,null);
+		alias.setX(4);
+		alias.setY(5);
+		alias.setWidth(0);
+		alias.setHeight(0);
+		alias.setModel(model);
+
+		Point2D point = converter.getAnchorPointCoordinates(alias, 2);
+		assertEquals(0.0, point.distance(new Point2D.Double(4, 5)), Configuration.EPSILON);
+
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/UnknownCellDesignerAliasConverterTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/UnknownCellDesignerAliasConverterTest.java
index a203abcb2a..8d51695c4b 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/UnknownCellDesignerAliasConverterTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/geometry/UnknownCellDesignerAliasConverterTest.java
@@ -1,49 +1,50 @@
-package lcsb.mapviewer.converter.model.celldesigner.geometry;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-
-public class UnknownCellDesignerAliasConverterTest {
-	UnknownCellDesignerAliasConverter converter = new UnknownCellDesignerAliasConverter();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetBoundPathIterator() {
-		try {
-			converter.getBoundPathIterator(null);
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("This class doesn't provide boundPath"));
-		}
-	}
-
-	@Test
-	public void testGetAnchorPointCoordinates() {
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setWidth(0);
-		alias.setHeight(0);
-		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
-		assertNotNull(point);
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.geometry;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+
+public class UnknownCellDesignerAliasConverterTest {
+	UnknownCellDesignerAliasConverter converter = new UnknownCellDesignerAliasConverter();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetBoundPathIterator() {
+		try {
+			converter.getBoundPathIterator(null);
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("This class doesn't provide boundPath"));
+		}
+	}
+
+	@Test
+	public void testGetAnchorPointCoordinates() {
+		SpeciesAlias alias = new GenericProteinAlias(null, null);
+		alias.setWidth(0);
+		alias.setHeight(0);
+		Point2D point = converter.getAnchorPointCoordinates(alias, 0);
+		assertNotNull(point);
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionCollectionXmlParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionCollectionXmlParserTest.java
index 714a748dc1..b4482f926e 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionCollectionXmlParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionCollectionXmlParserTest.java
@@ -1,244 +1,244 @@
-package lcsb.mapviewer.converter.model.celldesigner.reaction;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.awt.geom.Line2D;
-import java.util.List;
-
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-public class ReactionCollectionXmlParserTest extends CellDesignerTestFunctions {
-	Logger	logger	= Logger.getLogger(ReactionCollectionXmlParserTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseXmlReactionCollection() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-
-			ReactionCollectionXmlParser parser = new ReactionCollectionXmlParser(model);
-
-			String xmlString = readFile("testFiles/reactions/listOfReactions.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			List<Reaction> reactions = parser.parseXmlReactionCollection(node);
-
-			assertEquals(3, reactions.size());
-
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionCollectionToXmlString() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-
-			ReactionCollectionXmlParser parser = new ReactionCollectionXmlParser(model);
-
-			String xmlString = readFile("testFiles/reactions/listOfReactions.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			List<Reaction> reactions = parser.parseXmlReactionCollection(node);
-
-			parser = new ReactionCollectionXmlParser(model);
-			String xmlString2 = parser.reactionCollectionToXmlString(reactions);
-			assertNotNull(xmlString2);
-
-			parser = new ReactionCollectionXmlParser(model);
-			node = getNodeFromXmlString(xmlString2);
-			List<Reaction> reactions2 = parser.parseXmlReactionCollection(node);
-
-			assertEquals(reactions.size(), reactions2.size());
-			for (int i = 0; i < reactions.size(); i++) {
-				Reaction a = reactions.get(0);
-				Reaction b = reactions2.get(0);
-
-				List<Line2D> linesA = a.getLines();
-				List<Line2D> linesB = b.getLines();
-				for (int j = 0; j < linesA.size(); j++) {
-					Line2D lineA = linesA.get(j);
-					Line2D lineB = linesB.get(j);
-					assertEquals(lineA.getX1(), lineB.getX1(), EPSILON);
-					assertEquals(lineA.getY1(), lineB.getY1(), EPSILON);
-					assertEquals(lineA.getX2(), lineB.getX2(), EPSILON);
-					assertEquals(lineA.getY2(), lineB.getY2(), EPSILON);
-				}
-			}
-
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	private Model getModelFilledWithSpecies() {
-		Model model = new ModelFullIndexed(null);
-		Protein s1 = new GenericProtein();
-		s1.setElementId("s1");
-		model.addElement(s1);
-
-		SpeciesAlias sa1 = new SpeciesAlias("sa1");
-		sa1.setSpecies(s1);
-		sa1.setX(100.0);
-		sa1.setY(200.0);
-		sa1.setWidth(300.0);
-		sa1.setHeight(400.0);
-		model.addAlias(sa1);
-
-		Protein s2 = new GenericProtein();
-		s2.setElementId("s2");
-		model.addElement(s2);
-
-		SpeciesAlias sa2 = new SpeciesAlias("sa2");
-		sa2.setX(1050.0);
-		sa2.setY(2050.0);
-		sa2.setWidth(300.0);
-		sa2.setHeight(450.0);
-		sa2.setSpecies(s2);
-		model.addAlias(sa2);
-
-		Protein s3 = new GenericProtein();
-		s3.setElementId("s3");
-		model.addElement(s3);
-
-		SpeciesAlias sa3 = new SpeciesAlias("sa3");
-		sa3.setSpecies(s3);
-		sa3.setX(600.0);
-		sa3.setY(250.0);
-		sa3.setWidth(300.0);
-		sa3.setHeight(400.0);
-		model.addAlias(sa3);
-
-		Protein s4 = new GenericProtein();
-		s4.setElementId("s4");
-		model.addElement(s4);
-
-		SpeciesAlias sa4 = new SpeciesAlias("sa4");
-		sa4.setX(550.0);
-		sa4.setY(350.0);
-		sa4.setWidth(300.0);
-		sa4.setHeight(450.0);
-		sa4.setSpecies(s4);
-		model.addAlias(sa4);
-
-		Protein s5 = new GenericProtein();
-		s5.setElementId("s5");
-		model.addElement(s5);
-
-		SpeciesAlias sa5 = new SpeciesAlias("sa5");
-		sa5.setX(10.0);
-		sa5.setY(250.0);
-		sa5.setWidth(300.0);
-		sa5.setHeight(450.0);
-		sa5.setSpecies(s5);
-		model.addAlias(sa5);
-
-		Protein s6 = new GenericProtein();
-		s6.setElementId("s6");
-		model.addElement(s6);
-
-		SpeciesAlias sa6 = new SpeciesAlias("sa6");
-		sa6.setX(10.0);
-		sa6.setY(250.0);
-		sa6.setWidth(300.0);
-		sa6.setHeight(450.0);
-		sa6.setSpecies(s6);
-		model.addAlias(sa6);
-
-		Protein s10 = new GenericProtein();
-		s10.setElementId("s10");
-		model.addElement(s10);
-
-		SpeciesAlias sa10 = new SpeciesAlias("sa10");
-		sa10.setX(210.0);
-		sa10.setY(220.0);
-		sa10.setWidth(320.0);
-		sa10.setHeight(250.0);
-		sa10.setSpecies(s10);
-		model.addAlias(sa10);
-
-		Protein s11 = new GenericProtein();
-		s11.setElementId("s11");
-		model.addElement(s11);
-
-		SpeciesAlias sa11 = new SpeciesAlias("sa11");
-		sa11.setX(11.0);
-		sa11.setY(320.0);
-		sa11.setWidth(321.0);
-		sa11.setHeight(150.0);
-		sa11.setSpecies(s11);
-		model.addAlias(sa11);
-
-		Protein s12 = new GenericProtein();
-		s12.setElementId("s12");
-		model.addElement(s12);
-
-		SpeciesAlias sa12 = new SpeciesAlias("sa12");
-		sa12.setX(12.0);
-		sa12.setY(20.0);
-		sa12.setWidth(321.0);
-		sa12.setHeight(150.0);
-		sa12.setSpecies(s12);
-		model.addAlias(sa12);
-
-		Protein s13 = new GenericProtein();
-		s13.setElementId("s13");
-		model.addElement(s13);
-
-		SpeciesAlias sa13 = new SpeciesAlias("sa13");
-		sa13.setX(513.0);
-		sa13.setY(20.0);
-		sa13.setWidth(321.0);
-		sa13.setHeight(150.0);
-		sa13.setSpecies(s13);
-		model.addAlias(sa13);
-
-		Protein s14 = new GenericProtein();
-		s14.setElementId("s14");
-		model.addElement(s14);
-
-		SpeciesAlias sa14 = new SpeciesAlias("sa14");
-		sa14.setX(14.0);
-		sa14.setY(820.0);
-		sa14.setWidth(321.0);
-		sa14.setHeight(150.0);
-		sa14.setSpecies(s14);
-		model.addAlias(sa14);
-
-		Protein s15 = new GenericProtein();
-		s15.setElementId("s15");
-		model.addElement(s15);
-
-		SpeciesAlias sa15 = new SpeciesAlias("sa15");
-		sa15.setX(815.0);
-		sa15.setY(620.0);
-		sa15.setWidth(321.0);
-		sa15.setHeight(150.0);
-		sa15.setSpecies(s15);
-		model.addAlias(sa15);
-
-		return model;
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.reaction;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.awt.geom.Line2D;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class ReactionCollectionXmlParserTest extends CellDesignerTestFunctions {
+	Logger logger = Logger.getLogger(ReactionCollectionXmlParserTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseXmlReactionCollection() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+
+			ReactionCollectionXmlParser parser = new ReactionCollectionXmlParser(model);
+
+			String xmlString = readFile("testFiles/reactions/listOfReactions.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			List<Reaction> reactions = parser.parseXmlReactionCollection(node);
+
+			assertEquals(3, reactions.size());
+
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionCollectionToXmlString() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+
+			ReactionCollectionXmlParser parser = new ReactionCollectionXmlParser(model);
+
+			String xmlString = readFile("testFiles/reactions/listOfReactions.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			List<Reaction> reactions = parser.parseXmlReactionCollection(node);
+
+			parser = new ReactionCollectionXmlParser(model);
+			String xmlString2 = parser.reactionCollectionToXmlString(reactions);
+			assertNotNull(xmlString2);
+
+			parser = new ReactionCollectionXmlParser(model);
+			node = getNodeFromXmlString(xmlString2);
+			List<Reaction> reactions2 = parser.parseXmlReactionCollection(node);
+
+			assertEquals(reactions.size(), reactions2.size());
+			for (int i = 0; i < reactions.size(); i++) {
+				Reaction a = reactions.get(0);
+				Reaction b = reactions2.get(0);
+
+				List<Line2D> linesA = a.getLines();
+				List<Line2D> linesB = b.getLines();
+				for (int j = 0; j < linesA.size(); j++) {
+					Line2D lineA = linesA.get(j);
+					Line2D lineB = linesB.get(j);
+					assertEquals(lineA.getX1(), lineB.getX1(), EPSILON);
+					assertEquals(lineA.getY1(), lineB.getY1(), EPSILON);
+					assertEquals(lineA.getX2(), lineB.getX2(), EPSILON);
+					assertEquals(lineA.getY2(), lineB.getY2(), EPSILON);
+				}
+			}
+
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	private Model getModelFilledWithSpecies() {
+		Model model = new ModelFullIndexed(null);
+		GenericProtein s1 = new GenericProtein();
+		s1.setElementId("s1");
+		model.addElement(s1);
+
+		SpeciesAlias sa1 = new GenericProteinAlias("sa1", s1);
+		sa1.setSpecies(s1);
+		sa1.setX(100.0);
+		sa1.setY(200.0);
+		sa1.setWidth(300.0);
+		sa1.setHeight(400.0);
+		model.addAlias(sa1);
+
+		GenericProtein s2 = new GenericProtein();
+		s2.setElementId("s2");
+		model.addElement(s2);
+
+		SpeciesAlias sa2 = new GenericProteinAlias("sa2", s2);
+		sa2.setX(1050.0);
+		sa2.setY(2050.0);
+		sa2.setWidth(300.0);
+		sa2.setHeight(450.0);
+		sa2.setSpecies(s2);
+		model.addAlias(sa2);
+
+		GenericProtein s3 = new GenericProtein();
+		s3.setElementId("s3");
+		model.addElement(s3);
+
+		SpeciesAlias sa3 = new GenericProteinAlias("sa3", s3);
+		sa3.setSpecies(s3);
+		sa3.setX(600.0);
+		sa3.setY(250.0);
+		sa3.setWidth(300.0);
+		sa3.setHeight(400.0);
+		model.addAlias(sa3);
+
+		GenericProtein s4 = new GenericProtein();
+		s4.setElementId("s4");
+		model.addElement(s4);
+
+		SpeciesAlias sa4 = new GenericProteinAlias("sa4", s4);
+		sa4.setX(550.0);
+		sa4.setY(350.0);
+		sa4.setWidth(300.0);
+		sa4.setHeight(450.0);
+		sa4.setSpecies(s4);
+		model.addAlias(sa4);
+
+		GenericProtein s5 = new GenericProtein();
+		s5.setElementId("s5");
+		model.addElement(s5);
+
+		SpeciesAlias sa5 = new GenericProteinAlias("sa5", s5);
+		sa5.setX(10.0);
+		sa5.setY(250.0);
+		sa5.setWidth(300.0);
+		sa5.setHeight(450.0);
+		sa5.setSpecies(s5);
+		model.addAlias(sa5);
+
+		GenericProtein s6 = new GenericProtein();
+		s6.setElementId("s6");
+		model.addElement(s6);
+
+		SpeciesAlias sa6 = new GenericProteinAlias("sa6", s6);
+		sa6.setX(10.0);
+		sa6.setY(250.0);
+		sa6.setWidth(300.0);
+		sa6.setHeight(450.0);
+		sa6.setSpecies(s6);
+		model.addAlias(sa6);
+
+		GenericProtein s10 = new GenericProtein();
+		s10.setElementId("s10");
+		model.addElement(s10);
+
+		SpeciesAlias sa10 = new GenericProteinAlias("sa10", s10);
+		sa10.setX(210.0);
+		sa10.setY(220.0);
+		sa10.setWidth(320.0);
+		sa10.setHeight(250.0);
+		sa10.setSpecies(s10);
+		model.addAlias(sa10);
+
+		GenericProtein s11 = new GenericProtein();
+		s11.setElementId("s11");
+		model.addElement(s11);
+
+		SpeciesAlias sa11 = new GenericProteinAlias("sa11", s11);
+		sa11.setX(11.0);
+		sa11.setY(320.0);
+		sa11.setWidth(321.0);
+		sa11.setHeight(150.0);
+		sa11.setSpecies(s11);
+		model.addAlias(sa11);
+
+		GenericProtein s12 = new GenericProtein();
+		s12.setElementId("s12");
+		model.addElement(s12);
+
+		SpeciesAlias sa12 = new GenericProteinAlias("sa12", s12);
+		sa12.setX(12.0);
+		sa12.setY(20.0);
+		sa12.setWidth(321.0);
+		sa12.setHeight(150.0);
+		sa12.setSpecies(s12);
+		model.addAlias(sa12);
+
+		GenericProtein s13 = new GenericProtein();
+		s13.setElementId("s13");
+		model.addElement(s13);
+
+		SpeciesAlias sa13 = new GenericProteinAlias("sa13", s13);
+		sa13.setX(513.0);
+		sa13.setY(20.0);
+		sa13.setWidth(321.0);
+		sa13.setHeight(150.0);
+		sa13.setSpecies(s13);
+		model.addAlias(sa13);
+
+		GenericProtein s14 = new GenericProtein();
+		s14.setElementId("s14");
+		model.addElement(s14);
+
+		SpeciesAlias sa14 = new GenericProteinAlias("sa14", s14);
+		sa14.setX(14.0);
+		sa14.setY(820.0);
+		sa14.setWidth(321.0);
+		sa14.setHeight(150.0);
+		sa14.setSpecies(s14);
+		model.addAlias(sa14);
+
+		GenericProtein s15 = new GenericProtein();
+		s15.setElementId("s15");
+		model.addElement(s15);
+
+		SpeciesAlias sa15 = new GenericProteinAlias("sa15", s15);
+		sa15.setX(815.0);
+		sa15.setY(620.0);
+		sa15.setWidth(321.0);
+		sa15.setHeight(150.0);
+		sa15.setSpecies(s15);
+		model.addAlias(sa15);
+
+		return model;
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionFromXmlTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionFromXmlTest.java
index bed3dd80c2..dbbc534110 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionFromXmlTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionFromXmlTest.java
@@ -1,747 +1,743 @@
-package lcsb.mapviewer.converter.model.celldesigner.reaction;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.type.TwoProductReactionInterface;
-import lcsb.mapviewer.model.map.reaction.type.TwoReactantReactionInterface;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ReactionFromXmlTest extends CellDesignerTestFunctions {
-	ReactionXmlParser	parser = new ReactionXmlParser();
-	Model							model	 = new ModelFullIndexed(null);
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setAliasId("sa1");
-		Species species = new GenericProtein();
-		species.setElementId("s1");
-		alias.setElement(species);
-		model.addElement(species);
-		model.addAlias(alias);
-
-		alias = new SpeciesAlias();
-		alias.setAliasId("sa2");
-		species = new GenericProtein();
-		species.setElementId("s2");
-		alias.setElement(species);
-		model.addElement(species);
-		model.addAlias(alias);
-
-		alias = new SpeciesAlias();
-		alias.setAliasId("sa3");
-		species = new GenericProtein();
-		species.setElementId("s3");
-		alias.setElement(species);
-		model.addElement(species);
-		model.addAlias(alias);
-
-		alias = new SpeciesAlias();
-		alias.setAliasId("sa4");
-		species = new GenericProtein();
-		species.setElementId("s4");
-		alias.setElement(species);
-		model.addElement(species);
-		model.addAlias(alias);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testInvalid() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("kineticLaw node doesn't have math subnode"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid2() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction2.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("invalid value in math xmlns attrib"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid3() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction3.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Unknown element of reaction"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid4() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction4.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("No annotation node in reaction"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid5() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction5.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Problem with parsing RDF"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid6() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction6.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Unknown element of reaction/annotation"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid7() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction7.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:baseReactants"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid8() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction8.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:baseProducts"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid9() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction9.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:connectScheme"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid10() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction10.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Unknown element of reaction/celldesigner:extension"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid11() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction11.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("No connectScheme node"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid12() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction12.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Unknown node type"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid13() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction13.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Too many gate members"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid14() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction14.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Missing gate member connecting members"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid15() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction15.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Couldn't find type of BOOLEAN_LOGIC_GATE"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid16() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction16.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfReactantLinks"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid17() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction17.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:reactantLink"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid18() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction18.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Species doesn't exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid19() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction19.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Alias doesn't exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid20() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction20.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfProductLinks"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid21() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction21.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:reactantLink"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid22() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction22.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Species doesn't exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid23() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction23.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Alias doesn't exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid24() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction24.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfModification"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid25() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction25.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown species"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid26() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction26.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown alias"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid27() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction27.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Invalid number of species/alias in the modification"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid28() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction28.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:connectScheme"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid29() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction29.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfModification"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid30() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction30.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of reaction/celldesigner:baseReactant"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid31() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction31.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Alias with id"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid32() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction32.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Species with id"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid33() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction33.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of reaction/celldesigner:baseReactant"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid34() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction34.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Alias with id"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid35() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction35.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Species with id"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid36() throws Exception {
-		try {
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction36.xml")), model);
-			fail("Exception expected");
-		} catch (ReactionParserException e) {
-			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of reaction/celldesigner:baseProduct"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidReaction() throws Exception {
-		try {
-			// test situation when createProperTypeReaction returns reaction of
-			// unknown type
-			ReactionFromXml parser = new ReactionFromXml() {
-				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
-					return result;
-				}
-			};
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_transport.xml")), model);
-			fail("Exception expected");
-
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Problem with parsing lines. Unknown reaction"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidReaction2() throws Exception {
-		try {
-			// test situation when createProperTypeReaction returns reaction of
-			// unknown type that implements TwoProductReactionInterface
-
-			class NewReactionType extends Reaction implements TwoProductReactionInterface {
-				private static final long serialVersionUID = 1L;
-
-				public NewReactionType(Reaction r) {
-					super(r);
-				}
-			}
-
-			ReactionFromXml parser = new ReactionFromXml() {
-				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
-					return new NewReactionType(result);
-				}
-			};
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_dissociation_with_addition.xml")), model);
-			fail("Exception expected");
-
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Invalid reaction type"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidReaction3() throws Exception {
-		try {
-			// test situation when createOperatorsForTwoProductReaction encounter
-			// reaction with two many base reactants
-
-			ReactionFromXml parser = new ReactionFromXml() {
-				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
-					Reaction r = super.createProperTypeReaction(type, result);
-					r.addReactant(new Reactant());
-					return r;
-				}
-			};
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_dissociation_with_addition.xml")), model);
-			fail("Exception expected");
-
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Reaction has more than one reactant"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidReaction4() throws Exception {
-		try {
-			// test situation when createOperatorsForTwoProductReaction encounter
-			// reaction with two many base products
-
-			ReactionFromXml parser = new ReactionFromXml() {
-				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
-					Reaction r = super.createProperTypeReaction(type, result);
-					r.addProduct(new Product());
-					return r;
-				}
-			};
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_dissociation_with_addition.xml")), model);
-			fail("Exception expected");
-
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Too many products"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidReaction5() throws Exception {
-		try {
-			// test situation when createProperTypeReaction returns reaction of
-			// unknown type that implements TwoReactantReactionInterface
-
-			class NewReactionType extends Reaction implements TwoReactantReactionInterface {
-				private static final long serialVersionUID = 1L;
-
-				public NewReactionType(Reaction r) {
-					super(r);
-				}
-			}
-
-			ReactionFromXml parser = new ReactionFromXml() {
-				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
-					return new NewReactionType(result);
-				}
-			};
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml")), model);
-			fail("Exception expected");
-
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Unknown class type with two reactants"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidReaction6() throws Exception {
-		try {
-			// test situation when createOperatorsForTwoReactantReaction encounter
-			// reaction with two many base reactants
-
-			ReactionFromXml parser = new ReactionFromXml() {
-				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
-					Reaction r = super.createProperTypeReaction(type, result);
-					r.addReactant(new Reactant());
-					return r;
-				}
-			};
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml")), model);
-			fail("Exception expected");
-
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Too many reactants"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidReaction7() throws Exception {
-		try {
-			// test situation when createOperatorsForTwoReactantReaction encounter
-			// reaction with two many base products
-
-			ReactionFromXml parser = new ReactionFromXml() {
-				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
-					Reaction r = super.createProperTypeReaction(type, result);
-					r.addProduct(new Product());
-					return r;
-				}
-			};
-			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml")), model);
-			fail("Exception expected");
-
-		} catch (ReactionParserException e) {
-			assertTrue(e.getMessage().contains("Reaction has more than one product"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidEditPointsString() throws Exception {
-		try {
-			ReactionFromXml parser = new ReactionFromXml();
-
-			parser.parseEditPointsString("1");
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Invalid editPoint string"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidEditPointsString2() throws Exception {
-		try {
-			ReactionFromXml parser = new ReactionFromXml();
-
-			parser.parseEditPointsString("1,Infinity");
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Invalid point parsed from input string"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.reaction;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.TwoProductReactionInterface;
+import lcsb.mapviewer.model.map.reaction.type.TwoReactantReactionInterface;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class ReactionFromXmlTest extends CellDesignerTestFunctions {
+	ReactionXmlParser	parser = new ReactionXmlParser();
+	Model							model	 = new ModelFullIndexed(null);
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+
+		GenericProtein species = new GenericProtein();
+		SpeciesAlias alias = new GenericProteinAlias(species);
+		alias.setAliasId("sa1");
+		species.setElementId("s1");
+		model.addElement(species);
+		model.addAlias(alias);
+
+		species = new GenericProtein();
+		alias = new GenericProteinAlias(species);
+		alias.setAliasId("sa2");
+		species.setElementId("s2");
+		model.addElement(species);
+		model.addAlias(alias);
+
+		species = new GenericProtein();
+		alias = new GenericProteinAlias(species);
+		alias.setAliasId("sa3");
+		species.setElementId("s3");
+		model.addElement(species);
+		model.addAlias(alias);
+
+		species = new GenericProtein();
+		alias = new GenericProteinAlias(species);
+		alias.setAliasId("sa4");
+		species.setElementId("s4");
+		model.addElement(species);
+		model.addAlias(alias);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testInvalid() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("kineticLaw node doesn't have math subnode"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid2() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction2.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("invalid value in math xmlns attrib"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid3() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction3.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Unknown element of reaction"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid4() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction4.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("No annotation node in reaction"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid5() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction5.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Problem with parsing RDF"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid6() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction6.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Unknown element of reaction/annotation"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid7() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction7.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:baseReactants"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid8() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction8.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:baseProducts"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid9() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction9.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:connectScheme"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid10() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction10.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Unknown element of reaction/celldesigner:extension"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid11() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction11.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("No connectScheme node"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid12() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction12.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Unknown node type"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid13() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction13.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Too many gate members"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid14() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction14.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Missing gate member connecting members"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid15() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction15.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Couldn't find type of BOOLEAN_LOGIC_GATE"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid16() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction16.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfReactantLinks"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid17() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction17.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:reactantLink"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid18() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction18.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Species doesn't exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid19() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction19.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Alias doesn't exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid20() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction20.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfProductLinks"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid21() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction21.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:reactantLink"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid22() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction22.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Species doesn't exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid23() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction23.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Alias doesn't exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid24() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction24.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfModification"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid25() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction25.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown species"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid26() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction26.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown alias"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid27() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction27.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Invalid number of species/alias in the modification"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid28() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction28.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:connectScheme"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid29() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction29.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of celldesigner:listOfModification"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid30() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction30.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of reaction/celldesigner:baseReactant"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid31() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction31.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Alias with id"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid32() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction32.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Species with id"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid33() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction33.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of reaction/celldesigner:baseReactant"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid34() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction34.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Alias with id"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid35() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction35.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Species with id"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid36() throws Exception {
+		try {
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/invalid/reaction36.xml")), model);
+			fail("Exception expected");
+		} catch (ReactionParserException e) {
+			assertTrue("Invalid message: " + e.getMessage(), e.getMessage().contains("Unknown element of reaction/celldesigner:baseProduct"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidReaction() throws Exception {
+		try {
+			// test situation when createProperTypeReaction returns reaction of
+			// unknown type
+			ReactionFromXml parser = new ReactionFromXml() {
+				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
+					return result;
+				}
+			};
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_transport.xml")), model);
+			fail("Exception expected");
+
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Problem with parsing lines. Unknown reaction"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidReaction2() throws Exception {
+		try {
+			// test situation when createProperTypeReaction returns reaction of
+			// unknown type that implements TwoProductReactionInterface
+
+			class NewReactionType extends Reaction implements TwoProductReactionInterface {
+				private static final long serialVersionUID = 1L;
+
+				public NewReactionType(Reaction r) {
+					super(r);
+				}
+			}
+
+			ReactionFromXml parser = new ReactionFromXml() {
+				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
+					return new NewReactionType(result);
+				}
+			};
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_dissociation_with_addition.xml")), model);
+			fail("Exception expected");
+
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Invalid reaction type"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidReaction3() throws Exception {
+		try {
+			// test situation when createOperatorsForTwoProductReaction encounter
+			// reaction with two many base reactants
+
+			ReactionFromXml parser = new ReactionFromXml() {
+				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
+					Reaction r = super.createProperTypeReaction(type, result);
+					r.addReactant(new Reactant());
+					return r;
+				}
+			};
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_dissociation_with_addition.xml")), model);
+			fail("Exception expected");
+
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Reaction has more than one reactant"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidReaction4() throws Exception {
+		try {
+			// test situation when createOperatorsForTwoProductReaction encounter
+			// reaction with two many base products
+
+			ReactionFromXml parser = new ReactionFromXml() {
+				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
+					Reaction r = super.createProperTypeReaction(type, result);
+					r.addProduct(new Product());
+					return r;
+				}
+			};
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_dissociation_with_addition.xml")), model);
+			fail("Exception expected");
+
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Too many products"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidReaction5() throws Exception {
+		try {
+			// test situation when createProperTypeReaction returns reaction of
+			// unknown type that implements TwoReactantReactionInterface
+
+			class NewReactionType extends Reaction implements TwoReactantReactionInterface {
+				private static final long serialVersionUID = 1L;
+
+				public NewReactionType(Reaction r) {
+					super(r);
+				}
+			}
+
+			ReactionFromXml parser = new ReactionFromXml() {
+				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
+					return new NewReactionType(result);
+				}
+			};
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml")), model);
+			fail("Exception expected");
+
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Unknown class type with two reactants"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidReaction6() throws Exception {
+		try {
+			// test situation when createOperatorsForTwoReactantReaction encounter
+			// reaction with two many base reactants
+
+			ReactionFromXml parser = new ReactionFromXml() {
+				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
+					Reaction r = super.createProperTypeReaction(type, result);
+					r.addReactant(new Reactant());
+					return r;
+				}
+			};
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml")), model);
+			fail("Exception expected");
+
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Too many reactants"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidReaction7() throws Exception {
+		try {
+			// test situation when createOperatorsForTwoReactantReaction encounter
+			// reaction with two many base products
+
+			ReactionFromXml parser = new ReactionFromXml() {
+				Reaction createProperTypeReaction(String type, Reaction result) throws UnknownReactionClassException {
+					Reaction r = super.createProperTypeReaction(type, result);
+					r.addProduct(new Product());
+					return r;
+				}
+			};
+			parser.getReaction(super.getNodeFromXmlString(readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml")), model);
+			fail("Exception expected");
+
+		} catch (ReactionParserException e) {
+			assertTrue(e.getMessage().contains("Reaction has more than one product"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidEditPointsString() throws Exception {
+		try {
+			ReactionFromXml parser = new ReactionFromXml();
+
+			parser.parseEditPointsString("1");
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Invalid editPoint string"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidEditPointsString2() throws Exception {
+		try {
+			ReactionFromXml parser = new ReactionFromXml();
+
+			parser.parseEditPointsString("1,Infinity");
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Invalid point parsed from input string"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionParserTests.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionParserTests.java
index 71c831b43e..7ee57ad817 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionParserTests.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionParserTests.java
@@ -1,1836 +1,1837 @@
-package lcsb.mapviewer.converter.model.celldesigner.reaction;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Line2D;
-import java.awt.geom.Point2D;
-import java.io.ByteArrayInputStream;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.converter.ConverterParams;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
-import lcsb.mapviewer.model.graphics.ArrowType;
-import lcsb.mapviewer.model.graphics.LineType;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelComparator;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.AndOperator;
-import lcsb.mapviewer.model.map.reaction.AssociationOperator;
-import lcsb.mapviewer.model.map.reaction.DissociationOperator;
-import lcsb.mapviewer.model.map.reaction.Modifier;
-import lcsb.mapviewer.model.map.reaction.NandOperator;
-import lcsb.mapviewer.model.map.reaction.NodeOperator;
-import lcsb.mapviewer.model.map.reaction.OrOperator;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.SplitOperator;
-import lcsb.mapviewer.model.map.reaction.TruncationOperator;
-import lcsb.mapviewer.model.map.reaction.UnknownOperator;
-import lcsb.mapviewer.model.map.reaction.type.BooleanLogicGateReaction;
-import lcsb.mapviewer.model.map.reaction.type.DissociationReaction;
-import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
-import lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction;
-import lcsb.mapviewer.model.map.reaction.type.ReactionRect;
-import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
-import lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction;
-import lcsb.mapviewer.model.map.reaction.type.TranslationReaction;
-import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
-import lcsb.mapviewer.model.map.reaction.type.TruncationReaction;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ReactionParserTests extends CellDesignerTestFunctions {
-
-	private Logger		logger;
-	ReactionXmlParser	parser = new ReactionXmlParser();
-
-	@Before
-	public void setUp() throws Exception {
-		logger = Logger.getLogger(ReactionParserTests.class.getName());
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testColorReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/colorfull_reaction.xml");
-			Reaction reaction = model.getReactionByReactionId("re1");
-			PolylineData line = reaction.getReactants().get(0).getLine();
-			assertFalse("000".equals(line.getColor().getRed() + "" + line.getColor().getGreen() + "" + line.getColor().getBlue()));
-			line = reaction.getProducts().get(0).getLine();
-			assertFalse("000".equals(line.getColor().getRed() + "" + line.getColor().getGreen() + "" + line.getColor().getBlue()));
-			line = reaction.getModifiers().get(0).getLine();
-			assertFalse("000".equals(line.getColor().getRed() + "" + line.getColor().getGreen() + "" + line.getColor().getBlue()));
-			line = reaction.getOperators().get(0).getLine();
-			assertFalse("000".equals(line.getColor().getRed() + "" + line.getColor().getGreen() + "" + line.getColor().getBlue()));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testMissingLines() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/problematic/pd_map_with_problematic_reaction_line.xml");
-			assertTrue(model.getSpeciesBySpeciesId("s6025") instanceof GenericProtein);
-			Set<Reaction> list = model.getReactions();
-			for (Reaction reaction : list) {
-				// reaction re1607 in this model was problematic, but in fact the
-				// problem
-				// can be in any reaction line
-				// if (reaction.getId().equals("re1607")) {
-				List<Line2D> lines = reaction.getLines();
-				for (Line2D line2d : lines) {
-					assertFalse(Double.isNaN(line2d.getX1()));
-					assertFalse(Double.isNaN(line2d.getX2()));
-					assertFalse(Double.isNaN(line2d.getY1()));
-					assertFalse(Double.isNaN(line2d.getY2()));
-				}
-				// }
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTransitionReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\transition.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof StateTransitionReaction);
-			assertEquals(1, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			
-			assertTrue(reaction.isReversible());
-			assertEquals(ArrowType.FULL, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(3, reactant.getLine().getLines().size());
-
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(2, product.getLine().getLines().size());
-
-			assertTrue(reactant.getLine().getEndPoint().distance(product.getLine().getPoints().get(0)) < 20);
-			assertNotNull(reaction.getReactionRect());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCenterLineInSimpleReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\transition.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			Reactant reactant = reaction.getReactants().get(0);
-
-			Product product = reaction.getProducts().get(0);
-
-			// center of the line should be different than edge points of
-			// reactant/product description
-			assertFalse(reaction.getCenterLine().getP1().distance(reactant.getLine().getEndPoint()) < 1e-6);
-			assertFalse(reaction.getCenterLine().getP2().distance(product.getLine().getBeginPoint()) < 1e-6);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTransition2() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\transitionWithAdditionalNodes.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(2, reaction.getOperators().size());
-			for (Reactant reactant : reaction.getReactants()) {
-				assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-				assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-
-				assertTrue(reactant.getLine().getEndPoint().distance(reaction.getReactants().get(0).getLine().getEndPoint()) < 1e-6);
-			}
-
-			for (Product product : reaction.getProducts()) {
-				assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-				assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-
-				assertTrue(product.getLine().getBeginPoint().distance(reaction.getProducts().get(0).getLine().getBeginPoint()) < 1e-6);
-			}
-			assertNotNull(reaction.getReactionRect());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTransiotionOmitted() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\transition_omitted.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(0, reaction.getOperators().size());
-			assertEquals(KnownTransitionOmittedReaction.class, reaction.getClass());
-			assertNotNull(reaction.getReactionRect());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUnknownTransition() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\unknown_transition.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertNotNull(reaction.getReactionRect());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTranscription() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\transCRIPTION.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof TranscriptionReaction);
-			assertEquals(1, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(LineType.DASH_DOT_DOT, reactant.getLine().getType());
-			assertEquals(1, reactant.getLine().getLines().size());
-
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(1, product.getLine().getLines().size());
-
-			assertTrue(reactant.getLine().getEndPoint().distance(product.getLine().getPoints().get(0)) < 20);
-			assertNotNull(reaction.getReactionRect());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTranscription2() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\transCRIPTION_with_additions.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof TranscriptionReaction);
-			assertEquals(2, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(LineType.DASH_DOT_DOT, reactant.getLine().getType());
-			assertEquals(1, reactant.getLine().getLines().size());
-			NodeOperator operator = null;
-			for (NodeOperator operator2 : reaction.getOperators()) {
-				if (operator2 instanceof SplitOperator)
-					operator = operator2;
-			}
-			assertEquals(LineType.DASH_DOT_DOT, operator.getLine().getType());
-
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(1, product.getLine().getLines().size());
-
-			assertNotNull(reaction.getReactionRect());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTranslation() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\translation.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof TranslationReaction);
-			assertEquals(2, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(LineType.DASH_DOT, reactant.getLine().getType());
-			assertEquals(1, reactant.getLine().getLines().size());
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertEquals(LineType.DASH_DOT, operator.getLine().getType());
-
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(1, product.getLine().getLines().size());
-
-			assertNotNull(reaction.getReactionRect());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTransport() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\transport.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof TransportReaction);
-			assertEquals(1, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(1, reactant.getLine().getLines().size());
-
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL_CROSSBAR, product.getLine().getEndAtd().getArrowType());
-			assertEquals(1, product.getLine().getLines().size());
-
-			assertNotNull(reaction.getReactionRect());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testHeterodimer() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\heterodimer.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof HeterodimerAssociationReaction);
-			assertEquals(2, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(2, reactant.getLine().getLines().size());
-			reactant = reaction.getReactants().get(1);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(3, reactant.getLine().getLines().size());
-
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(3, product.getLine().getLines().size());
-
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertEquals(LineType.SOLID, operator.getLine().getType());
-			assertEquals(7, operator.getLine().getLines().size());
-
-			assertNotNull(reaction.getReactionRect());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testHeterodimerWithAdditions() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\heterodimerWithAdditions.xml");
-
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof HeterodimerAssociationReaction);
-			assertEquals(3, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(2, reactant.getLine().getLines().size());
-			reactant = reaction.getReactants().get(1);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(3, reactant.getLine().getLines().size());
-
-			for (Product product : reaction.getProducts()) {
-				assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-				assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			}
-
-			assertEquals(3, reaction.getOperators().size());
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertEquals(LineType.SOLID, operator.getLine().getType());
-			assertEquals(7, operator.getLine().getLines().size());
-
-			assertNotNull(reaction.getReactionRect());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDissociation() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\dissociation.xml");
-			assertEquals(2, model.getReactions().size());
-			Reaction reaction = null;
-			for (Reaction reaction2 : model.getReactions()) {
-				if (reaction2.getIdReaction().equals("re1"))
-					reaction = reaction2;
-			}
-			assertTrue(reaction instanceof DissociationReaction);
-			assertEquals(1, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(2, reactant.getLine().getLines().size());
-
-			assertEquals(2, reaction.getProducts().size());
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(5, product.getLine().getLines().size());
-			product = reaction.getProducts().get(1);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(4, product.getLine().getLines().size());
-
-			assertEquals(1, reaction.getOperators().size());
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertEquals(LineType.SOLID, operator.getLine().getType());
-			assertEquals(5, operator.getLine().getLines().size());
-
-			assertNotNull(reaction.getReactionRect());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDissociationWithAddition() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\dissociationWithAddition.xml");
-			assertEquals(2, model.getReactions().size());
-			Reaction reaction = null;
-			for (Reaction reaction2 : model.getReactions()) {
-				if (reaction2.getIdReaction().equals("re1"))
-					reaction = reaction2;
-			}
-			assertTrue(reaction instanceof DissociationReaction);
-			assertEquals(2, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(2, reactant.getLine().getLines().size());
-
-			assertEquals(3, reaction.getProducts().size());
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(5, product.getLine().getLines().size());
-			product = reaction.getProducts().get(1);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(4, product.getLine().getLines().size());
-
-			assertEquals(3, reaction.getOperators().size());
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertEquals(LineType.SOLID, operator.getLine().getType());
-			assertEquals(5, operator.getLine().getLines().size());
-			assertEquals(DissociationOperator.class, operator.getClass());
-
-			assertNotNull(reaction.getReactionRect());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTruncation() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\truncation.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof TruncationReaction);
-			assertEquals(1, reaction.getReactants().size());
-			Reactant reactant = reaction.getReactants().get(0);
-			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
-			assertEquals(2, reactant.getLine().getLines().size());
-
-			assertEquals(2, reaction.getProducts().size());
-			Product product = reaction.getProducts().get(0);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(3, product.getLine().getLines().size());
-			product = reaction.getProducts().get(1);
-			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
-			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
-			assertEquals(4, product.getLine().getLines().size());
-
-			assertEquals(1, reaction.getOperators().size());
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertEquals(LineType.SOLID, operator.getLine().getType());
-			assertEquals(1, operator.getLine().getLines().size());
-			assertEquals(TruncationOperator.class, operator.getClass());
-			assertEquals(reaction.getReactionRect(), ReactionRect.RECT_BOLT);
-
-			assertNotNull(reaction.getReactionRect());
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTruncationWithModifier() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\truncationWithModifier.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			Modifier m = reaction.getModifiers().get(0);
-			assertEquals(ArrowType.CIRCLE, m.getLine().getEndAtd().getArrowType());
-
-			m = reaction.getModifiers().get(1);
-			assertEquals(ArrowType.CROSSBAR, m.getLine().getEndAtd().getArrowType());
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testComplexModifier1() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\complexModifier1.xml");
-
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(1, reaction.getOperators().size());
-			assertEquals(2, reaction.getModifiers().size());
-
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertTrue(operator.isModifierOperator());
-			assertEquals(AndOperator.class, operator.getClass());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testComplexModifier2() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\complexModifier2.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(1, reaction.getOperators().size());
-			assertEquals(2, reaction.getModifiers().size());
-
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertTrue(operator.isModifierOperator());
-			assertEquals(OrOperator.class, operator.getClass());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testComplexModifier3() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\complexModifier3.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(1, reaction.getOperators().size());
-			assertEquals(2, reaction.getModifiers().size());
-
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertTrue(operator.isModifierOperator());
-			assertEquals(NandOperator.class, operator.getClass());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testComplexModifier4() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\complexModifier4.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(1, reaction.getOperators().size());
-			assertEquals(2, reaction.getModifiers().size());
-
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertTrue(operator.isModifierOperator());
-			assertEquals(UnknownOperator.class, operator.getClass());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testComplexReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\complexReaction.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(0, reaction.getModifiers().size());
-			assertEquals(2, reaction.getOperators().size());
-			assertEquals(2, reaction.getProducts().size());
-			assertEquals(2, reaction.getReactants().size());
-
-			NodeOperator operator = reaction.getOperators().iterator().next();
-			assertEquals(AndOperator.class, operator.getClass());
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0,false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testComplexModifiers5() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\complexModifier5.xml");
-
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(4, reaction.getModifiers().size());
-			assertEquals(1, reaction.getOperators().size());
-			assertEquals(2, reaction.getOperators().iterator().next().getInputs().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicAnchors() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\problemWithAnchors2.xml");
-
-			Reaction reaction1 = null;
-			Reaction reaction2 = null;
-			for (Reaction reaction : model.getReactions()) {
-				if (reaction.getIdReaction().equals("re2"))
-					reaction1 = reaction;
-				if (reaction.getIdReaction().equals("re3"))
-					reaction2 = reaction;
-			}
-			Reactant reactant = reaction1.getReactants().get(0);
-			Alias alias1 = reaction1.getReactants().get(0).getAlias();
-			Alias alias2 = reaction1.getProducts().get(0).getAlias();
-			Product product = reaction1.getProducts().get(0);
-			Point2D point = new Point2D.Double(alias1.getX() + alias1.getWidth() / 2, alias1.getY() + alias1.getHeight());
-			Point2D point2 = new Point2D.Double(alias2.getX(), alias2.getY() + alias2.getHeight() / 2);
-			assertTrue(point.distance(reactant.getLine().getPoints().get(0)) < 1);
-			assertTrue(point2.distance(product.getLine().getEndPoint()) < 1);
-
-			reactant = reaction2.getReactants().get(0);
-			alias1 = reaction2.getReactants().get(0).getAlias();
-			alias2 = reaction2.getProducts().get(0).getAlias();
-			product = reaction2.getProducts().get(0);
-			point = new Point2D.Double(alias1.getX() + alias1.getWidth(), alias1.getY() + alias1.getHeight() / 2);
-			point2 = new Point2D.Double(alias2.getX(), alias2.getY() + alias2.getHeight() / 2);
-			assertTrue(point.distance(reactant.getLine().getPoints().get(0)) < 1);
-			assertTrue(point2.distance(product.getLine().getEndPoint()) < 1);
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0, false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicAnchors3() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\problemWithAnchors3.xml");
-			Reaction reaction = null;
-			for (Reaction reaction2 : model.getReactions()) {
-				if (reaction2.getIdReaction().equals("re3"))
-					reaction = reaction2;
-			}
-			Point2D point = new Point2D.Double(164.85583789974368, 86.060142902597);
-			Point2D point2 = new Point2D.Double(397.06477630152193, 284.99999999999994);
-
-			assertTrue(point.distance(reaction.getModifiers().get(0).getLine().getPoints().get(0)) < 1);
-			assertTrue(point2.distance(reaction.getModifiers().get(1).getLine().getPoints().get(0)) < 1);
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0, false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testPositiveInfluence() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\positive_influence.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertNull(reaction.getReactionRect());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicAnchors2() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\complexReactionWithModifier.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			assertEquals(reaction.getProducts().get(0).getLine().length(), reaction.getReactants().get(0).getLine().length(), 1e-6);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicAnchorsWithTwoReactantReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles\\reactions\\centeredAnchorInModifier.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			Reactant r = null;
-			for (Reactant reactant : reaction.getReactants()) {
-				if (((Species) reactant.getElement()).getName().equals("s3"))
-					r = reactant;
-			}
-			assertNotNull(r);
-			// I think there is still a bug becaue it should work with smaller delta
-			// :)
-			assertEquals(r.getLine().getPoints().get(1).getX(), r.getLine().getPoints().get(2).getX(), 1);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionWithModifiers() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/reactions/reactionWithModifiers.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			List<Modifier> modifiers = reaction.getModifiers();
-			Modifier s3 = null;
-			Modifier s4 = null;
-			for (Modifier modifier : modifiers) {
-				if (modifier.getAlias().getElement().getElementId().equals("s3"))
-					s3 = modifier;
-				if (modifier.getAlias().getElement().getElementId().equals("s4"))
-					s4 = modifier;
-			}
-			assertEquals(s3.getLine().getPoints().get(0).distance(new Point2D.Double(101.9591678008944, 68.0)), 0, EPSILON);
-			assertEquals(s3.getLine().getPoints().get(1).distance(new Point2D.Double(101.86750788643532, 112.89589905362774)), 0, EPSILON);
-			assertEquals(s3.getLine().getPoints().get(2).distance(new Point2D.Double(190.66666666666666, 117.66666666666667)), 0, EPSILON);
-
-			assertEquals(s4.getLine().getPoints().get(0).distance(new Point2D.Double(267.7075561388218, 54.00000000000001)), 0, EPSILON);
-			assertEquals(s4.getLine().getPoints().get(1).distance(new Point2D.Double(298.3735877669656, 71.67109819284718)), 0, EPSILON);
-			assertEquals(s4.getLine().getPoints().get(2).distance(new Point2D.Double(190.66666666666666, 117.66666666666667)), 0, EPSILON);
-
-			// new NormalImageGenerator(1, 0, 0, 1024, 1024, model, true, false, 0,
-			// false).saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionOperatorsWithOperators() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/reactions/reactionWithOperators.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-			NodeOperator operator1 = reaction.getOperators().get(0);
-			NodeOperator operator2 = reaction.getOperators().get(1);
-			NodeOperator operator3 = reaction.getOperators().get(2);
-
-			// new NormalImageGenerator(1, 0, 0, 1024, 1024, model, true, false, 0,
-			// false).saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-			assertEquals(operator1.getLine().getPoints().get(0).distance(new Point2D.Double(287.0, 242.00000000000009)), 0, EPSILON);
-			assertEquals(operator1.getLine().getPoints().get(1).distance(new Point2D.Double(287.97349260719136, 204.40292958328325)), 0, EPSILON);
-			assertEquals(operator1.getLine().getPoints().get(2).distance(new Point2D.Double(372.9868291110932, 203.8558964441427)), 0, EPSILON);
-
-			assertEquals(operator2.getLine().getPoints().get(0).distance(new Point2D.Double(359.1840955643148, 203.94471254019686)), 0, EPSILON);
-			assertEquals(operator2.getLine().getPoints().get(1).distance(new Point2D.Double(372.9868291110932, 203.8558964441427)), 0, EPSILON);
-
-			assertEquals(operator3.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
-			assertEquals(operator3.getLine().getPoints().get(1).distance(new Point2D.Double(380.9866634960982, 203.80442011470782)), 0, EPSILON);
-
-			Product product1 = reaction.getProducts().get(0);
-			Product product2 = reaction.getProducts().get(1);
-
-			assertEquals(product1.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
-			assertEquals(product1.getLine().getPoints().get(1).distance(new Point2D.Double(466.0, 203.25738697556727)), 0, EPSILON);
-
-			assertEquals(product2.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
-			assertEquals(product2.getLine().getPoints().get(1).distance(new Point2D.Double(452.96894321929705, 107.00000000000001)), 0, EPSILON);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionProductsWithOperators() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/reactions/reactionWithOperators.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-
-			Product product1 = reaction.getProducts().get(0);
-			Product product2 = reaction.getProducts().get(1);
-
-			assertEquals(product1.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
-			assertEquals(product1.getLine().getPoints().get(1).distance(new Point2D.Double(466.0, 203.25738697556727)), 0, EPSILON);
-
-			assertEquals(product2.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
-			assertEquals(product2.getLine().getPoints().get(1).distance(new Point2D.Double(452.96894321929705, 107.00000000000001)), 0, EPSILON);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionReactantsWithOperators() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/reactions/reactionWithOperators.xml");
-			Reaction reaction = model.getReactions().iterator().next();
-
-			Reactant reactant1 = reaction.getReactants().get(0);
-			Reactant reactant2 = reaction.getReactants().get(1);
-			Reactant reactant3 = reaction.getReactants().get(2);
-
-			assertEquals(reactant1.getLine().getPoints().get(0).distance(new Point2D.Double(112.53618421052632, 167.46381578947367)), 0, EPSILON);
-			assertEquals(reactant1.getLine().getPoints().get(1).distance(new Point2D.Double(287.0, 242.00000000000009)), 0, EPSILON);
-
-			assertEquals(reactant2.getLine().getPoints().get(0).distance(new Point2D.Double(121.0, 242.0)), 0, EPSILON);
-			assertEquals(reactant2.getLine().getPoints().get(1).distance(new Point2D.Double(287.0, 242.00000000000009)), 0, EPSILON);
-
-			assertEquals(reactant3.getLine().getPoints().get(0).distance(new Point2D.Double(116.65392247520951, 72.34607752479052)), 0, EPSILON);
-			assertEquals(reactant3.getLine().getPoints().get(1).distance(new Point2D.Double(359.1840955643148, 203.94471254019686)), 0, EPSILON);
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0, false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTransitionReactionToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transition.xml");
-
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-			assertEquals(reaction1.getReactants().size(), reaction2.getReactants().size());
-			Reactant reactant1 = reaction1.getReactants().get(0);
-			Reactant reactant2 = reaction2.getReactants().get(0);
-			assertEquals(reactant1.getLine().getBeginAtd().getArrowType(), reactant2.getLine().getBeginAtd().getArrowType());
-			assertEquals(reactant1.getLine().getEndAtd().getArrowType(), reactant2.getLine().getEndAtd().getArrowType());
-			assertEquals(reactant1.getLine().getLines().size(), reactant2.getLine().getLines().size());
-
-			Product product1 = reaction1.getProducts().get(0);
-			Product product2 = reaction2.getProducts().get(0);
-			assertEquals(product1.getLine().getBeginAtd().getArrowType(), product2.getLine().getBeginAtd().getArrowType());
-			assertEquals(product1.getLine().getEndAtd().getArrowType(), product2.getLine().getEndAtd().getArrowType());
-			assertEquals(product1.getLine().getLines().size(), product2.getLine().getLines().size());
-
-			assertEquals(reactant1.getLine().getEndPoint().getX(), reactant2.getLine().getEndPoint().getX(), EPSILON);
-			assertEquals(reactant1.getLine().getEndPoint().getY(), reactant2.getLine().getEndPoint().getY(), EPSILON);
-
-			assertEquals(reaction1.getReactionRect(), reaction2.getReactionRect());
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-
-			assertEquals(product1.getLine().getColor(), product2.getLine().getColor());
-			assertEquals(product1.getLine().getWidth(), product2.getLine().getWidth(), 1e-6);
-
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTransitionWidthAdditionalNodelReactionToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transitionWithAdditionalNodes.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-			assertEquals(reaction1.getReactants().size(), reaction2.getReactants().size());
-			Reactant reactant1 = reaction1.getReactants().get(1);
-			Reactant reactant2 = reaction2.getReactants().get(1);
-			assertEquals(reactant1.getLine().getBeginAtd().getArrowType(), reactant2.getLine().getBeginAtd().getArrowType());
-			assertEquals(reactant1.getLine().getEndAtd().getArrowType(), reactant2.getLine().getEndAtd().getArrowType());
-			assertEquals(reactant1.getLine().getLines().size(), reactant2.getLine().getLines().size());
-
-			Product product1 = reaction1.getProducts().get(1);
-			Product product2 = reaction2.getProducts().get(1);
-			assertEquals(product1.getLine().getBeginAtd().getArrowType(), product2.getLine().getBeginAtd().getArrowType());
-			assertEquals(product1.getLine().getEndAtd().getArrowType(), product2.getLine().getEndAtd().getArrowType());
-			assertEquals(product1.getLine().getLines().size(), product2.getLine().getLines().size());
-
-			assertTrue(reactant1.getLine().getEndPoint().distance(reactant2.getLine().getEndPoint()) < 1e-6);
-			assertEquals(reaction1.getReactionRect(), reaction2.getReactionRect());
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-
-			assertEquals(product1.getLine().getColor(), product2.getLine().getColor());
-			assertEquals(product1.getLine().getWidth(), product2.getLine().getWidth(), 1e-6);
-
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTranslationToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_translation.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-			assertEquals(reaction1.getReactants().size(), reaction2.getReactants().size());
-			Reactant reactant1 = reaction1.getReactants().get(1);
-			Reactant reactant2 = reaction2.getReactants().get(1);
-			assertEquals(reactant1.getLine().getBeginAtd().getArrowType(), reactant2.getLine().getBeginAtd().getArrowType());
-			assertEquals(reactant1.getLine().getEndAtd().getArrowType(), reactant2.getLine().getEndAtd().getArrowType());
-			assertEquals(reactant1.getLine().getLines().size(), reactant2.getLine().getLines().size());
-
-			Product product1 = reaction1.getProducts().get(1);
-			Product product2 = reaction2.getProducts().get(1);
-			assertEquals(product1.getLine().getBeginAtd().getArrowType(), product2.getLine().getBeginAtd().getArrowType());
-			assertEquals(product1.getLine().getEndAtd().getArrowType(), product2.getLine().getEndAtd().getArrowType());
-			assertEquals(product1.getLine().getLines().size(), product2.getLine().getLines().size());
-
-			assertTrue(reactant1.getLine().getEndPoint().distance(reactant2.getLine().getEndPoint()) < 1e-6);
-			assertEquals(reaction1.getReactionRect(), reaction2.getReactionRect());
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-
-			assertEquals(product1.getLine().getColor(), product2.getLine().getColor());
-			assertEquals(product1.getLine().getWidth(), product2.getLine().getWidth(), 1e-6);
-
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTransportToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transport.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-			assertEquals(reaction1.getMiriamData().size(), reaction2.getMiriamData().size());
-			assertEquals(reaction1.getNotes().trim(), reaction2.getNotes().trim());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTruncationToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_truncation.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTruncationWithModifierToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_truncationWithModifier.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUnknownTransitionToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_unknown_transition.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTransitionOmittedToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transition_omitted.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTranscriptionToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transcription.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTranscriptionWithAdditionsToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transcription_with_additions.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionWithOperatorsToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_with_operators.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionWithModifiersToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_with_modifiers.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionPositiveInfluenceToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_positive_influence.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionHeterodimerWithAdditionsToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer_with_additions.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			assertEquals(reaction1.getNodes().size(), reaction2.getNodes().size());
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionHeterodimerToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			assertEquals(reaction1.getNodes().size(), reaction2.getNodes().size());
-
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testOperatorInReactionHeterodimer() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-			for (NodeOperator operator : reaction1.getOperators()) {
-				assertTrue(operator instanceof AssociationOperator);
-			}
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionDissociationWithAdditionToXml() throws Exception {
-		try {
-			Model model = getModelFilledWithSpecies();
-			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_dissociation_with_addition.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			Reaction reaction1 = parser.getReaction(node, model);
-
-			String xmlString2 = parser.toXml(reaction1);
-			assertNotNull(xmlString2);
-			// logger.debug(xmlString2);
-			Node node2 = getNodeFromXmlString(xmlString2);
-			Reaction reaction2 = parser.getReaction(node2, model);
-
-			assertEquals(reaction1.getName(), reaction2.getName());
-			assertNotNull(reaction1.getName());
-			assertFalse(reaction1.getName().trim().equals(""));
-			List<Line2D> lines1 = reaction1.getLines();
-			List<Line2D> lines2 = reaction2.getLines();
-
-			for (int i = 0; i < lines1.size(); i++) {
-				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
-				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
-				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
-				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
-			}
-			assertEquals(reaction1.getClass(), reaction2.getClass());
-		} catch (Exception e) {
-			logger.error(e.getMessage(), e);
-			throw e;
-		}
-	}
-
-	private Model getModelFilledWithSpecies() {
-		Model model = new ModelFullIndexed(null);
-		Protein s1 = new GenericProtein();
-		s1.setElementId("s1");
-		model.addElement(s1);
-
-		SpeciesAlias sa1 = new SpeciesAlias("sa1");
-		sa1.setSpecies(s1);
-		sa1.setX(100.0);
-		sa1.setY(200.0);
-		sa1.setWidth(300.0);
-		sa1.setHeight(400.0);
-		model.addAlias(sa1);
-
-		Protein s2 = new GenericProtein();
-		s2.setElementId("s2");
-		model.addElement(s2);
-
-		SpeciesAlias sa2 = new SpeciesAlias("sa2");
-		sa2.setX(1050.0);
-		sa2.setY(2050.0);
-		sa2.setWidth(300.0);
-		sa2.setHeight(450.0);
-		sa2.setSpecies(s2);
-		model.addAlias(sa2);
-
-		Protein s3 = new GenericProtein();
-		s3.setElementId("s3");
-		model.addElement(s3);
-
-		SpeciesAlias sa3 = new SpeciesAlias("sa3");
-		sa3.setSpecies(s3);
-		sa3.setX(600.0);
-		sa3.setY(250.0);
-		sa3.setWidth(300.0);
-		sa3.setHeight(400.0);
-		model.addAlias(sa3);
-
-		Protein s4 = new GenericProtein();
-		s4.setElementId("s4");
-		model.addElement(s4);
-
-		SpeciesAlias sa4 = new SpeciesAlias("sa4");
-		sa4.setX(550.0);
-		sa4.setY(350.0);
-		sa4.setWidth(300.0);
-		sa4.setHeight(450.0);
-		sa4.setSpecies(s4);
-		model.addAlias(sa4);
-
-		Protein s5 = new GenericProtein();
-		s5.setElementId("s5");
-		model.addElement(s5);
-
-		SpeciesAlias sa5 = new SpeciesAlias("sa5");
-		sa5.setX(10.0);
-		sa5.setY(250.0);
-		sa5.setWidth(300.0);
-		sa5.setHeight(450.0);
-		sa5.setSpecies(s5);
-		model.addAlias(sa5);
-
-		Protein s6 = new GenericProtein();
-		s6.setElementId("s6");
-		model.addElement(s6);
-
-		SpeciesAlias sa6 = new SpeciesAlias("sa6");
-		sa6.setX(10.0);
-		sa6.setY(250.0);
-		sa6.setWidth(300.0);
-		sa6.setHeight(450.0);
-		sa6.setSpecies(s6);
-		model.addAlias(sa6);
-
-		Protein s10 = new GenericProtein();
-		s10.setElementId("s10");
-		model.addElement(s10);
-
-		SpeciesAlias sa10 = new SpeciesAlias("sa10");
-		sa10.setX(210.0);
-		sa10.setY(220.0);
-		sa10.setWidth(320.0);
-		sa10.setHeight(250.0);
-		sa10.setSpecies(s10);
-		model.addAlias(sa10);
-
-		Protein s11 = new GenericProtein();
-		s11.setElementId("s11");
-		model.addElement(s11);
-
-		SpeciesAlias sa11 = new SpeciesAlias("sa11");
-		sa11.setX(11.0);
-		sa11.setY(320.0);
-		sa11.setWidth(321.0);
-		sa11.setHeight(150.0);
-		sa11.setSpecies(s11);
-		model.addAlias(sa11);
-
-		Protein s12 = new GenericProtein();
-		s12.setElementId("s12");
-		model.addElement(s12);
-
-		SpeciesAlias sa12 = new SpeciesAlias("sa12");
-		sa12.setX(12.0);
-		sa12.setY(20.0);
-		sa12.setWidth(321.0);
-		sa12.setHeight(150.0);
-		sa12.setSpecies(s12);
-		model.addAlias(sa12);
-
-		Protein s13 = new GenericProtein();
-		s13.setElementId("s13");
-		model.addElement(s13);
-
-		SpeciesAlias sa13 = new SpeciesAlias("sa13");
-		sa13.setX(513.0);
-		sa13.setY(20.0);
-		sa13.setWidth(321.0);
-		sa13.setHeight(150.0);
-		sa13.setSpecies(s13);
-		model.addAlias(sa13);
-
-		Protein s14 = new GenericProtein();
-		s14.setElementId("s14");
-		model.addElement(s14);
-
-		SpeciesAlias sa14 = new SpeciesAlias("sa14");
-		sa14.setX(14.0);
-		sa14.setY(820.0);
-		sa14.setWidth(321.0);
-		sa14.setHeight(150.0);
-		sa14.setSpecies(s14);
-		model.addAlias(sa14);
-
-		Protein s15 = new GenericProtein();
-		s15.setElementId("s15");
-		model.addElement(s15);
-
-		SpeciesAlias sa15 = new SpeciesAlias("sa15");
-		sa15.setX(815.0);
-		sa15.setY(620.0);
-		sa15.setWidth(321.0);
-		sa15.setHeight(150.0);
-		sa15.setSpecies(s15);
-		model.addAlias(sa15);
-
-		return model;
-	}
-
-	@Test
-	public void testLogiGateAndReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/reactions/logicGateAnd.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof BooleanLogicGateReaction);
-			assertEquals(1, reaction.getOperators().size());
-			assertTrue(reaction.getOperators().get(0) instanceof AndOperator);
-			assertEquals(2, reaction.getReactants().size());
-			assertEquals(1, reaction.getProducts().size());
-
-			assertEquals(0.0, reaction.getReactants().get(0).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
-			assertEquals(0.0, reaction.getReactants().get(1).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
-			assertEquals(0.0, reaction.getProducts().get(0).getLine().getBeginPoint().distance(200.0, 127.0), EPSILON);
-
-			CellDesignerXmlParser cellDesignerXmlParser = new CellDesignerXmlParser();
-
-			model.setName(null);
-			String xmlString = cellDesignerXmlParser.toXml(model);
-
-			ByteArrayInputStream bais = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
-			Model model2 = cellDesignerXmlParser.createModel(new ConverterParams().inputStream(bais).sizeAutoAdjust(false));
-
-			ModelComparator mc = new ModelComparator();
-			assertEquals("After CellDesigner xml serialization models are different", 0, mc.compare(model, model2));
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0, false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testLogiGateOrReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/reactions/logicGateOr.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof BooleanLogicGateReaction);
-			assertEquals(1, reaction.getOperators().size());
-			assertTrue(reaction.getOperators().get(0) instanceof OrOperator);
-			assertEquals(2, reaction.getReactants().size());
-			assertEquals(1, reaction.getProducts().size());
-
-			assertEquals(0.0, reaction.getReactants().get(0).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
-			assertEquals(0.0, reaction.getReactants().get(1).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
-			assertEquals(0.0, reaction.getProducts().get(0).getLine().getBeginPoint().distance(200.0, 127.0), EPSILON);
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0, false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testLogiGateNotReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/reactions/logicGateNot.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof BooleanLogicGateReaction);
-			assertEquals(1, reaction.getOperators().size());
-			assertTrue(reaction.getOperators().get(0) instanceof NandOperator);
-			assertEquals(2, reaction.getReactants().size());
-			assertEquals(1, reaction.getProducts().size());
-
-			assertEquals(0.0, reaction.getReactants().get(0).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
-			assertEquals(0.0, reaction.getReactants().get(1).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
-			assertEquals(0.0, reaction.getProducts().get(0).getLine().getBeginPoint().distance(200.0, 127.0), EPSILON);
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0, false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testLogiGateUnknownReaction() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/reactions/logicGateUnknown.xml");
-			assertEquals(1, model.getReactions().size());
-			Reaction reaction = model.getReactions().iterator().next();
-			assertTrue(reaction instanceof BooleanLogicGateReaction);
-			assertEquals(1, reaction.getOperators().size());
-			assertTrue(reaction.getOperators().get(0) instanceof UnknownOperator);
-			assertEquals(2, reaction.getReactants().size());
-			assertEquals(1, reaction.getProducts().size());
-
-			assertEquals(0.0, reaction.getReactants().get(0).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
-			assertEquals(0.0, reaction.getReactants().get(1).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
-			assertEquals(0.0, reaction.getProducts().get(0).getLine().getBeginPoint().distance(200.0, 127.0), EPSILON);
-
-			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
-			// 1024, 1024, model, true, false, 0, false);
-			// generator.saveToPNG("tmp.png");
-			// Desktop.getDesktop().open(new File("tmp.png"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicDrawing() throws Exception {
-		Model model;
-		try {
-			model = getModelForFile("testFiles/problematic/reaction_drawing_problem.xml");
-			Reaction reaction = model.getReactionByReactionId("re1");
-			assertEquals(0, reaction.getCenterPoint().distance(new Point2D.Double(258.5, 145.0)), EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProteinsInsideComplex() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/problematic/proteins_inside_complex.xml");
-			for (Element el : model.getElements()) {
-				assertFalse(el.getClass().equals(Protein.class));
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.reaction;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.io.ByteArrayInputStream;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.converter.ConverterParams;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
+import lcsb.mapviewer.model.graphics.ArrowType;
+import lcsb.mapviewer.model.graphics.LineType;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelComparator;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.AndOperator;
+import lcsb.mapviewer.model.map.reaction.AssociationOperator;
+import lcsb.mapviewer.model.map.reaction.DissociationOperator;
+import lcsb.mapviewer.model.map.reaction.Modifier;
+import lcsb.mapviewer.model.map.reaction.NandOperator;
+import lcsb.mapviewer.model.map.reaction.NodeOperator;
+import lcsb.mapviewer.model.map.reaction.OrOperator;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.SplitOperator;
+import lcsb.mapviewer.model.map.reaction.TruncationOperator;
+import lcsb.mapviewer.model.map.reaction.UnknownOperator;
+import lcsb.mapviewer.model.map.reaction.type.BooleanLogicGateReaction;
+import lcsb.mapviewer.model.map.reaction.type.DissociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction;
+import lcsb.mapviewer.model.map.reaction.type.ReactionRect;
+import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
+import lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction;
+import lcsb.mapviewer.model.map.reaction.type.TranslationReaction;
+import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
+import lcsb.mapviewer.model.map.reaction.type.TruncationReaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class ReactionParserTests extends CellDesignerTestFunctions {
+
+	private Logger		logger;
+	ReactionXmlParser	parser = new ReactionXmlParser();
+
+	@Before
+	public void setUp() throws Exception {
+		logger = Logger.getLogger(ReactionParserTests.class.getName());
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testColorReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/colorfull_reaction.xml");
+			Reaction reaction = model.getReactionByReactionId("re1");
+			PolylineData line = reaction.getReactants().get(0).getLine();
+			assertFalse("000".equals(line.getColor().getRed() + "" + line.getColor().getGreen() + "" + line.getColor().getBlue()));
+			line = reaction.getProducts().get(0).getLine();
+			assertFalse("000".equals(line.getColor().getRed() + "" + line.getColor().getGreen() + "" + line.getColor().getBlue()));
+			line = reaction.getModifiers().get(0).getLine();
+			assertFalse("000".equals(line.getColor().getRed() + "" + line.getColor().getGreen() + "" + line.getColor().getBlue()));
+			line = reaction.getOperators().get(0).getLine();
+			assertFalse("000".equals(line.getColor().getRed() + "" + line.getColor().getGreen() + "" + line.getColor().getBlue()));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testMissingLines() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/problematic/pd_map_with_problematic_reaction_line.xml");
+			assertTrue(model.getSpeciesBySpeciesId("s6025") instanceof GenericProtein);
+			Set<Reaction> list = model.getReactions();
+			for (Reaction reaction : list) {
+				// reaction re1607 in this model was problematic, but in fact the
+				// problem
+				// can be in any reaction line
+				// if (reaction.getId().equals("re1607")) {
+				List<Line2D> lines = reaction.getLines();
+				for (Line2D line2d : lines) {
+					assertFalse(Double.isNaN(line2d.getX1()));
+					assertFalse(Double.isNaN(line2d.getX2()));
+					assertFalse(Double.isNaN(line2d.getY1()));
+					assertFalse(Double.isNaN(line2d.getY2()));
+				}
+				// }
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTransitionReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\transition.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof StateTransitionReaction);
+			assertEquals(1, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+
+			assertTrue(reaction.isReversible());
+			assertEquals(ArrowType.FULL, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(3, reactant.getLine().getLines().size());
+
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(2, product.getLine().getLines().size());
+
+			assertTrue(reactant.getLine().getEndPoint().distance(product.getLine().getPoints().get(0)) < 20);
+			assertNotNull(reaction.getReactionRect());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCenterLineInSimpleReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\transition.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			Reactant reactant = reaction.getReactants().get(0);
+
+			Product product = reaction.getProducts().get(0);
+
+			// center of the line should be different than edge points of
+			// reactant/product description
+			assertFalse(reaction.getCenterLine().getP1().distance(reactant.getLine().getEndPoint()) < 1e-6);
+			assertFalse(reaction.getCenterLine().getP2().distance(product.getLine().getBeginPoint()) < 1e-6);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTransition2() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\transitionWithAdditionalNodes.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(2, reaction.getOperators().size());
+			for (Reactant reactant : reaction.getReactants()) {
+				assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+				assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+
+				assertTrue(reactant.getLine().getEndPoint().distance(reaction.getReactants().get(0).getLine().getEndPoint()) < 1e-6);
+			}
+
+			for (Product product : reaction.getProducts()) {
+				assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+				assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+
+				assertTrue(product.getLine().getBeginPoint().distance(reaction.getProducts().get(0).getLine().getBeginPoint()) < 1e-6);
+			}
+			assertNotNull(reaction.getReactionRect());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTransiotionOmitted() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\transition_omitted.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(0, reaction.getOperators().size());
+			assertEquals(KnownTransitionOmittedReaction.class, reaction.getClass());
+			assertNotNull(reaction.getReactionRect());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUnknownTransition() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\unknown_transition.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertNotNull(reaction.getReactionRect());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTranscription() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\transCRIPTION.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof TranscriptionReaction);
+			assertEquals(1, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(LineType.DASH_DOT_DOT, reactant.getLine().getType());
+			assertEquals(1, reactant.getLine().getLines().size());
+
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(1, product.getLine().getLines().size());
+
+			assertTrue(reactant.getLine().getEndPoint().distance(product.getLine().getPoints().get(0)) < 20);
+			assertNotNull(reaction.getReactionRect());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTranscription2() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\transCRIPTION_with_additions.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof TranscriptionReaction);
+			assertEquals(2, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(LineType.DASH_DOT_DOT, reactant.getLine().getType());
+			assertEquals(1, reactant.getLine().getLines().size());
+			NodeOperator operator = null;
+			for (NodeOperator operator2 : reaction.getOperators()) {
+				if (operator2 instanceof SplitOperator)
+					operator = operator2;
+			}
+			assertEquals(LineType.DASH_DOT_DOT, operator.getLine().getType());
+
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(1, product.getLine().getLines().size());
+
+			assertNotNull(reaction.getReactionRect());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTranslation() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\translation.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof TranslationReaction);
+			assertEquals(2, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(LineType.DASH_DOT, reactant.getLine().getType());
+			assertEquals(1, reactant.getLine().getLines().size());
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertEquals(LineType.DASH_DOT, operator.getLine().getType());
+
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(1, product.getLine().getLines().size());
+
+			assertNotNull(reaction.getReactionRect());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTransport() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\transport.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof TransportReaction);
+			assertEquals(1, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(1, reactant.getLine().getLines().size());
+
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL_CROSSBAR, product.getLine().getEndAtd().getArrowType());
+			assertEquals(1, product.getLine().getLines().size());
+
+			assertNotNull(reaction.getReactionRect());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testHeterodimer() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\heterodimer.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof HeterodimerAssociationReaction);
+			assertEquals(2, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(2, reactant.getLine().getLines().size());
+			reactant = reaction.getReactants().get(1);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(3, reactant.getLine().getLines().size());
+
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(3, product.getLine().getLines().size());
+
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertEquals(LineType.SOLID, operator.getLine().getType());
+			assertEquals(7, operator.getLine().getLines().size());
+
+			assertNotNull(reaction.getReactionRect());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testHeterodimerWithAdditions() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\heterodimerWithAdditions.xml");
+
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof HeterodimerAssociationReaction);
+			assertEquals(3, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(2, reactant.getLine().getLines().size());
+			reactant = reaction.getReactants().get(1);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(3, reactant.getLine().getLines().size());
+
+			for (Product product : reaction.getProducts()) {
+				assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+				assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			}
+
+			assertEquals(3, reaction.getOperators().size());
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertEquals(LineType.SOLID, operator.getLine().getType());
+			assertEquals(7, operator.getLine().getLines().size());
+
+			assertNotNull(reaction.getReactionRect());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDissociation() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\dissociation.xml");
+			assertEquals(2, model.getReactions().size());
+			Reaction reaction = null;
+			for (Reaction reaction2 : model.getReactions()) {
+				if (reaction2.getIdReaction().equals("re1"))
+					reaction = reaction2;
+			}
+			assertTrue(reaction instanceof DissociationReaction);
+			assertEquals(1, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(2, reactant.getLine().getLines().size());
+
+			assertEquals(2, reaction.getProducts().size());
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(5, product.getLine().getLines().size());
+			product = reaction.getProducts().get(1);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(4, product.getLine().getLines().size());
+
+			assertEquals(1, reaction.getOperators().size());
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertEquals(LineType.SOLID, operator.getLine().getType());
+			assertEquals(5, operator.getLine().getLines().size());
+
+			assertNotNull(reaction.getReactionRect());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDissociationWithAddition() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\dissociationWithAddition.xml");
+			assertEquals(2, model.getReactions().size());
+			Reaction reaction = null;
+			for (Reaction reaction2 : model.getReactions()) {
+				if (reaction2.getIdReaction().equals("re1"))
+					reaction = reaction2;
+			}
+			assertTrue(reaction instanceof DissociationReaction);
+			assertEquals(2, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(2, reactant.getLine().getLines().size());
+
+			assertEquals(3, reaction.getProducts().size());
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(5, product.getLine().getLines().size());
+			product = reaction.getProducts().get(1);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(4, product.getLine().getLines().size());
+
+			assertEquals(3, reaction.getOperators().size());
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertEquals(LineType.SOLID, operator.getLine().getType());
+			assertEquals(5, operator.getLine().getLines().size());
+			assertEquals(DissociationOperator.class, operator.getClass());
+
+			assertNotNull(reaction.getReactionRect());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTruncation() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\truncation.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof TruncationReaction);
+			assertEquals(1, reaction.getReactants().size());
+			Reactant reactant = reaction.getReactants().get(0);
+			assertEquals(ArrowType.NONE, reactant.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.NONE, reactant.getLine().getEndAtd().getArrowType());
+			assertEquals(2, reactant.getLine().getLines().size());
+
+			assertEquals(2, reaction.getProducts().size());
+			Product product = reaction.getProducts().get(0);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(3, product.getLine().getLines().size());
+			product = reaction.getProducts().get(1);
+			assertEquals(ArrowType.NONE, product.getLine().getBeginAtd().getArrowType());
+			assertEquals(ArrowType.FULL, product.getLine().getEndAtd().getArrowType());
+			assertEquals(4, product.getLine().getLines().size());
+
+			assertEquals(1, reaction.getOperators().size());
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertEquals(LineType.SOLID, operator.getLine().getType());
+			assertEquals(1, operator.getLine().getLines().size());
+			assertEquals(TruncationOperator.class, operator.getClass());
+			assertEquals(reaction.getReactionRect(), ReactionRect.RECT_BOLT);
+
+			assertNotNull(reaction.getReactionRect());
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTruncationWithModifier() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\truncationWithModifier.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			Modifier m = reaction.getModifiers().get(0);
+			assertEquals(ArrowType.CIRCLE, m.getLine().getEndAtd().getArrowType());
+
+			m = reaction.getModifiers().get(1);
+			assertEquals(ArrowType.CROSSBAR, m.getLine().getEndAtd().getArrowType());
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testComplexModifier1() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\complexModifier1.xml");
+
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(1, reaction.getOperators().size());
+			assertEquals(2, reaction.getModifiers().size());
+
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertTrue(operator.isModifierOperator());
+			assertEquals(AndOperator.class, operator.getClass());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testComplexModifier2() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\complexModifier2.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(1, reaction.getOperators().size());
+			assertEquals(2, reaction.getModifiers().size());
+
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertTrue(operator.isModifierOperator());
+			assertEquals(OrOperator.class, operator.getClass());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testComplexModifier3() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\complexModifier3.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(1, reaction.getOperators().size());
+			assertEquals(2, reaction.getModifiers().size());
+
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertTrue(operator.isModifierOperator());
+			assertEquals(NandOperator.class, operator.getClass());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testComplexModifier4() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\complexModifier4.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(1, reaction.getOperators().size());
+			assertEquals(2, reaction.getModifiers().size());
+
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertTrue(operator.isModifierOperator());
+			assertEquals(UnknownOperator.class, operator.getClass());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testComplexReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\complexReaction.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(0, reaction.getModifiers().size());
+			assertEquals(2, reaction.getOperators().size());
+			assertEquals(2, reaction.getProducts().size());
+			assertEquals(2, reaction.getReactants().size());
+
+			NodeOperator operator = reaction.getOperators().iterator().next();
+			assertEquals(AndOperator.class, operator.getClass());
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0,false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testComplexModifiers5() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\complexModifier5.xml");
+
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(4, reaction.getModifiers().size());
+			assertEquals(1, reaction.getOperators().size());
+			assertEquals(2, reaction.getOperators().iterator().next().getInputs().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicAnchors() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\problemWithAnchors2.xml");
+
+			Reaction reaction1 = null;
+			Reaction reaction2 = null;
+			for (Reaction reaction : model.getReactions()) {
+				if (reaction.getIdReaction().equals("re2"))
+					reaction1 = reaction;
+				if (reaction.getIdReaction().equals("re3"))
+					reaction2 = reaction;
+			}
+			Reactant reactant = reaction1.getReactants().get(0);
+			Alias alias1 = reaction1.getReactants().get(0).getAlias();
+			Alias alias2 = reaction1.getProducts().get(0).getAlias();
+			Product product = reaction1.getProducts().get(0);
+			Point2D point = new Point2D.Double(alias1.getX() + alias1.getWidth() / 2, alias1.getY() + alias1.getHeight());
+			Point2D point2 = new Point2D.Double(alias2.getX(), alias2.getY() + alias2.getHeight() / 2);
+			assertTrue(point.distance(reactant.getLine().getPoints().get(0)) < 1);
+			assertTrue(point2.distance(product.getLine().getEndPoint()) < 1);
+
+			reactant = reaction2.getReactants().get(0);
+			alias1 = reaction2.getReactants().get(0).getAlias();
+			alias2 = reaction2.getProducts().get(0).getAlias();
+			product = reaction2.getProducts().get(0);
+			point = new Point2D.Double(alias1.getX() + alias1.getWidth(), alias1.getY() + alias1.getHeight() / 2);
+			point2 = new Point2D.Double(alias2.getX(), alias2.getY() + alias2.getHeight() / 2);
+			assertTrue(point.distance(reactant.getLine().getPoints().get(0)) < 1);
+			assertTrue(point2.distance(product.getLine().getEndPoint()) < 1);
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0, false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicAnchors3() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\problemWithAnchors3.xml");
+			Reaction reaction = null;
+			for (Reaction reaction2 : model.getReactions()) {
+				if (reaction2.getIdReaction().equals("re3"))
+					reaction = reaction2;
+			}
+			Point2D point = new Point2D.Double(164.85583789974368, 86.060142902597);
+			Point2D point2 = new Point2D.Double(397.06477630152193, 284.99999999999994);
+
+			assertTrue(point.distance(reaction.getModifiers().get(0).getLine().getPoints().get(0)) < 1);
+			assertTrue(point2.distance(reaction.getModifiers().get(1).getLine().getPoints().get(0)) < 1);
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0, false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testPositiveInfluence() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\positive_influence.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertNull(reaction.getReactionRect());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicAnchors2() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\complexReactionWithModifier.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			assertEquals(reaction.getProducts().get(0).getLine().length(), reaction.getReactants().get(0).getLine().length(), 1e-6);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicAnchorsWithTwoReactantReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles\\reactions\\centeredAnchorInModifier.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			Reactant r = null;
+			for (Reactant reactant : reaction.getReactants()) {
+				if (((Species) reactant.getElement()).getName().equals("s3"))
+					r = reactant;
+			}
+			assertNotNull(r);
+			// I think there is still a bug becaue it should work with smaller delta
+			// :)
+			assertEquals(r.getLine().getPoints().get(1).getX(), r.getLine().getPoints().get(2).getX(), 1);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionWithModifiers() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/reactions/reactionWithModifiers.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			List<Modifier> modifiers = reaction.getModifiers();
+			Modifier s3 = null;
+			Modifier s4 = null;
+			for (Modifier modifier : modifiers) {
+				if (modifier.getAlias().getElement().getElementId().equals("s3"))
+					s3 = modifier;
+				if (modifier.getAlias().getElement().getElementId().equals("s4"))
+					s4 = modifier;
+			}
+			assertEquals(s3.getLine().getPoints().get(0).distance(new Point2D.Double(101.9591678008944, 68.0)), 0, EPSILON);
+			assertEquals(s3.getLine().getPoints().get(1).distance(new Point2D.Double(101.86750788643532, 112.89589905362774)), 0, EPSILON);
+			assertEquals(s3.getLine().getPoints().get(2).distance(new Point2D.Double(190.66666666666666, 117.66666666666667)), 0, EPSILON);
+
+			assertEquals(s4.getLine().getPoints().get(0).distance(new Point2D.Double(267.7075561388218, 54.00000000000001)), 0, EPSILON);
+			assertEquals(s4.getLine().getPoints().get(1).distance(new Point2D.Double(298.3735877669656, 71.67109819284718)), 0, EPSILON);
+			assertEquals(s4.getLine().getPoints().get(2).distance(new Point2D.Double(190.66666666666666, 117.66666666666667)), 0, EPSILON);
+
+			// new NormalImageGenerator(1, 0, 0, 1024, 1024, model, true, false, 0,
+			// false).saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionOperatorsWithOperators() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/reactions/reactionWithOperators.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+			NodeOperator operator1 = reaction.getOperators().get(0);
+			NodeOperator operator2 = reaction.getOperators().get(1);
+			NodeOperator operator3 = reaction.getOperators().get(2);
+
+			// new NormalImageGenerator(1, 0, 0, 1024, 1024, model, true, false, 0,
+			// false).saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+			assertEquals(operator1.getLine().getPoints().get(0).distance(new Point2D.Double(287.0, 242.00000000000009)), 0, EPSILON);
+			assertEquals(operator1.getLine().getPoints().get(1).distance(new Point2D.Double(287.97349260719136, 204.40292958328325)), 0, EPSILON);
+			assertEquals(operator1.getLine().getPoints().get(2).distance(new Point2D.Double(372.9868291110932, 203.8558964441427)), 0, EPSILON);
+
+			assertEquals(operator2.getLine().getPoints().get(0).distance(new Point2D.Double(359.1840955643148, 203.94471254019686)), 0, EPSILON);
+			assertEquals(operator2.getLine().getPoints().get(1).distance(new Point2D.Double(372.9868291110932, 203.8558964441427)), 0, EPSILON);
+
+			assertEquals(operator3.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
+			assertEquals(operator3.getLine().getPoints().get(1).distance(new Point2D.Double(380.9866634960982, 203.80442011470782)), 0, EPSILON);
+
+			Product product1 = reaction.getProducts().get(0);
+			Product product2 = reaction.getProducts().get(1);
+
+			assertEquals(product1.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
+			assertEquals(product1.getLine().getPoints().get(1).distance(new Point2D.Double(466.0, 203.25738697556727)), 0, EPSILON);
+
+			assertEquals(product2.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
+			assertEquals(product2.getLine().getPoints().get(1).distance(new Point2D.Double(452.96894321929705, 107.00000000000001)), 0, EPSILON);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionProductsWithOperators() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/reactions/reactionWithOperators.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+
+			Product product1 = reaction.getProducts().get(0);
+			Product product2 = reaction.getProducts().get(1);
+
+			assertEquals(product1.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
+			assertEquals(product1.getLine().getPoints().get(1).distance(new Point2D.Double(466.0, 203.25738697556727)), 0, EPSILON);
+
+			assertEquals(product2.getLine().getPoints().get(0).distance(new Point2D.Double(394.78939704287654, 203.71560401865366)), 0, EPSILON);
+			assertEquals(product2.getLine().getPoints().get(1).distance(new Point2D.Double(452.96894321929705, 107.00000000000001)), 0, EPSILON);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionReactantsWithOperators() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/reactions/reactionWithOperators.xml");
+			Reaction reaction = model.getReactions().iterator().next();
+
+			Reactant reactant1 = reaction.getReactants().get(0);
+			Reactant reactant2 = reaction.getReactants().get(1);
+			Reactant reactant3 = reaction.getReactants().get(2);
+
+			assertEquals(reactant1.getLine().getPoints().get(0).distance(new Point2D.Double(112.53618421052632, 167.46381578947367)), 0, EPSILON);
+			assertEquals(reactant1.getLine().getPoints().get(1).distance(new Point2D.Double(287.0, 242.00000000000009)), 0, EPSILON);
+
+			assertEquals(reactant2.getLine().getPoints().get(0).distance(new Point2D.Double(121.0, 242.0)), 0, EPSILON);
+			assertEquals(reactant2.getLine().getPoints().get(1).distance(new Point2D.Double(287.0, 242.00000000000009)), 0, EPSILON);
+
+			assertEquals(reactant3.getLine().getPoints().get(0).distance(new Point2D.Double(116.65392247520951, 72.34607752479052)), 0, EPSILON);
+			assertEquals(reactant3.getLine().getPoints().get(1).distance(new Point2D.Double(359.1840955643148, 203.94471254019686)), 0, EPSILON);
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0, false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTransitionReactionToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transition.xml");
+
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+			assertEquals(reaction1.getReactants().size(), reaction2.getReactants().size());
+			Reactant reactant1 = reaction1.getReactants().get(0);
+			Reactant reactant2 = reaction2.getReactants().get(0);
+			assertEquals(reactant1.getLine().getBeginAtd().getArrowType(), reactant2.getLine().getBeginAtd().getArrowType());
+			assertEquals(reactant1.getLine().getEndAtd().getArrowType(), reactant2.getLine().getEndAtd().getArrowType());
+			assertEquals(reactant1.getLine().getLines().size(), reactant2.getLine().getLines().size());
+
+			Product product1 = reaction1.getProducts().get(0);
+			Product product2 = reaction2.getProducts().get(0);
+			assertEquals(product1.getLine().getBeginAtd().getArrowType(), product2.getLine().getBeginAtd().getArrowType());
+			assertEquals(product1.getLine().getEndAtd().getArrowType(), product2.getLine().getEndAtd().getArrowType());
+			assertEquals(product1.getLine().getLines().size(), product2.getLine().getLines().size());
+
+			assertEquals(reactant1.getLine().getEndPoint().getX(), reactant2.getLine().getEndPoint().getX(), EPSILON);
+			assertEquals(reactant1.getLine().getEndPoint().getY(), reactant2.getLine().getEndPoint().getY(), EPSILON);
+
+			assertEquals(reaction1.getReactionRect(), reaction2.getReactionRect());
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+
+			assertEquals(product1.getLine().getColor(), product2.getLine().getColor());
+			assertEquals(product1.getLine().getWidth(), product2.getLine().getWidth(), 1e-6);
+
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTransitionWidthAdditionalNodelReactionToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transitionWithAdditionalNodes.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+			assertEquals(reaction1.getReactants().size(), reaction2.getReactants().size());
+			Reactant reactant1 = reaction1.getReactants().get(1);
+			Reactant reactant2 = reaction2.getReactants().get(1);
+			assertEquals(reactant1.getLine().getBeginAtd().getArrowType(), reactant2.getLine().getBeginAtd().getArrowType());
+			assertEquals(reactant1.getLine().getEndAtd().getArrowType(), reactant2.getLine().getEndAtd().getArrowType());
+			assertEquals(reactant1.getLine().getLines().size(), reactant2.getLine().getLines().size());
+
+			Product product1 = reaction1.getProducts().get(1);
+			Product product2 = reaction2.getProducts().get(1);
+			assertEquals(product1.getLine().getBeginAtd().getArrowType(), product2.getLine().getBeginAtd().getArrowType());
+			assertEquals(product1.getLine().getEndAtd().getArrowType(), product2.getLine().getEndAtd().getArrowType());
+			assertEquals(product1.getLine().getLines().size(), product2.getLine().getLines().size());
+
+			assertTrue(reactant1.getLine().getEndPoint().distance(reactant2.getLine().getEndPoint()) < 1e-6);
+			assertEquals(reaction1.getReactionRect(), reaction2.getReactionRect());
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+
+			assertEquals(product1.getLine().getColor(), product2.getLine().getColor());
+			assertEquals(product1.getLine().getWidth(), product2.getLine().getWidth(), 1e-6);
+
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTranslationToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_translation.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+			assertEquals(reaction1.getReactants().size(), reaction2.getReactants().size());
+			Reactant reactant1 = reaction1.getReactants().get(1);
+			Reactant reactant2 = reaction2.getReactants().get(1);
+			assertEquals(reactant1.getLine().getBeginAtd().getArrowType(), reactant2.getLine().getBeginAtd().getArrowType());
+			assertEquals(reactant1.getLine().getEndAtd().getArrowType(), reactant2.getLine().getEndAtd().getArrowType());
+			assertEquals(reactant1.getLine().getLines().size(), reactant2.getLine().getLines().size());
+
+			Product product1 = reaction1.getProducts().get(1);
+			Product product2 = reaction2.getProducts().get(1);
+			assertEquals(product1.getLine().getBeginAtd().getArrowType(), product2.getLine().getBeginAtd().getArrowType());
+			assertEquals(product1.getLine().getEndAtd().getArrowType(), product2.getLine().getEndAtd().getArrowType());
+			assertEquals(product1.getLine().getLines().size(), product2.getLine().getLines().size());
+
+			assertTrue(reactant1.getLine().getEndPoint().distance(reactant2.getLine().getEndPoint()) < 1e-6);
+			assertEquals(reaction1.getReactionRect(), reaction2.getReactionRect());
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+
+			assertEquals(product1.getLine().getColor(), product2.getLine().getColor());
+			assertEquals(product1.getLine().getWidth(), product2.getLine().getWidth(), 1e-6);
+
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTransportToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transport.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+			assertEquals(reaction1.getMiriamData().size(), reaction2.getMiriamData().size());
+			assertEquals(reaction1.getNotes().trim(), reaction2.getNotes().trim());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTruncationToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_truncation.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTruncationWithModifierToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_truncationWithModifier.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUnknownTransitionToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_unknown_transition.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTransitionOmittedToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transition_omitted.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTranscriptionToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transcription.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTranscriptionWithAdditionsToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_transcription_with_additions.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionWithOperatorsToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_with_operators.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionWithModifiersToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_with_modifiers.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionPositiveInfluenceToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_positive_influence.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionHeterodimerWithAdditionsToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer_with_additions.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			assertEquals(reaction1.getNodes().size(), reaction2.getNodes().size());
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionHeterodimerToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			assertEquals(reaction1.getNodes().size(), reaction2.getNodes().size());
+
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testOperatorInReactionHeterodimer() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_heterodimer.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+			for (NodeOperator operator : reaction1.getOperators()) {
+				assertTrue(operator instanceof AssociationOperator);
+			}
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionDissociationWithAdditionToXml() throws Exception {
+		try {
+			Model model = getModelFilledWithSpecies();
+			String xmlString = readFile("testFiles/xmlNodeTestExamples/reaction_dissociation_with_addition.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			Reaction reaction1 = parser.getReaction(node, model);
+
+			String xmlString2 = parser.toXml(reaction1);
+			assertNotNull(xmlString2);
+			// logger.debug(xmlString2);
+			Node node2 = getNodeFromXmlString(xmlString2);
+			Reaction reaction2 = parser.getReaction(node2, model);
+
+			assertEquals(reaction1.getName(), reaction2.getName());
+			assertNotNull(reaction1.getName());
+			assertFalse(reaction1.getName().trim().equals(""));
+			List<Line2D> lines1 = reaction1.getLines();
+			List<Line2D> lines2 = reaction2.getLines();
+
+			for (int i = 0; i < lines1.size(); i++) {
+				assertEquals(lines1.get(i).getX1(), lines2.get(i).getX1(), 1e-6);
+				assertEquals(lines1.get(i).getX2(), lines2.get(i).getX2(), 1e-6);
+				assertEquals(lines1.get(i).getY1(), lines2.get(i).getY1(), 1e-6);
+				assertEquals(lines1.get(i).getY2(), lines2.get(i).getY2(), 1e-6);
+			}
+			assertEquals(reaction1.getClass(), reaction2.getClass());
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	private Model getModelFilledWithSpecies() {
+		Model model = new ModelFullIndexed(null);
+		GenericProtein s1 = new GenericProtein();
+		s1.setElementId("s1");
+		model.addElement(s1);
+
+		SpeciesAlias sa1 = new GenericProteinAlias("sa1", s1);
+		sa1.setSpecies(s1);
+		sa1.setX(100.0);
+		sa1.setY(200.0);
+		sa1.setWidth(300.0);
+		sa1.setHeight(400.0);
+		model.addAlias(sa1);
+
+		GenericProtein s2 = new GenericProtein();
+		s2.setElementId("s2");
+		model.addElement(s2);
+
+		SpeciesAlias sa2 = new GenericProteinAlias("sa2", s2);
+		sa2.setX(1050.0);
+		sa2.setY(2050.0);
+		sa2.setWidth(300.0);
+		sa2.setHeight(450.0);
+		sa2.setSpecies(s2);
+		model.addAlias(sa2);
+
+		GenericProtein s3 = new GenericProtein();
+		s3.setElementId("s3");
+		model.addElement(s3);
+
+		SpeciesAlias sa3 = new GenericProteinAlias("sa3", s2);
+		sa3.setSpecies(s3);
+		sa3.setX(600.0);
+		sa3.setY(250.0);
+		sa3.setWidth(300.0);
+		sa3.setHeight(400.0);
+		model.addAlias(sa3);
+
+		GenericProtein s4 = new GenericProtein();
+		s4.setElementId("s4");
+		model.addElement(s4);
+
+		SpeciesAlias sa4 = new GenericProteinAlias("sa4", s4);
+		sa4.setX(550.0);
+		sa4.setY(350.0);
+		sa4.setWidth(300.0);
+		sa4.setHeight(450.0);
+		sa4.setSpecies(s4);
+		model.addAlias(sa4);
+
+		GenericProtein s5 = new GenericProtein();
+		s5.setElementId("s5");
+		model.addElement(s5);
+
+		SpeciesAlias sa5 = new GenericProteinAlias("sa5", s5);
+		sa5.setX(10.0);
+		sa5.setY(250.0);
+		sa5.setWidth(300.0);
+		sa5.setHeight(450.0);
+		sa5.setSpecies(s5);
+		model.addAlias(sa5);
+
+		GenericProtein s6 = new GenericProtein();
+		s6.setElementId("s6");
+		model.addElement(s6);
+
+		SpeciesAlias sa6 = new GenericProteinAlias("sa6", s6);
+		sa6.setX(10.0);
+		sa6.setY(250.0);
+		sa6.setWidth(300.0);
+		sa6.setHeight(450.0);
+		sa6.setSpecies(s6);
+		model.addAlias(sa6);
+
+		GenericProtein s10 = new GenericProtein();
+		s10.setElementId("s10");
+		model.addElement(s10);
+
+		SpeciesAlias sa10 = new GenericProteinAlias("sa10", s10);
+		sa10.setX(210.0);
+		sa10.setY(220.0);
+		sa10.setWidth(320.0);
+		sa10.setHeight(250.0);
+		sa10.setSpecies(s10);
+		model.addAlias(sa10);
+
+		GenericProtein s11 = new GenericProtein();
+		s11.setElementId("s11");
+		model.addElement(s11);
+
+		SpeciesAlias sa11 = new GenericProteinAlias("sa11", s11);
+		sa11.setX(11.0);
+		sa11.setY(320.0);
+		sa11.setWidth(321.0);
+		sa11.setHeight(150.0);
+		sa11.setSpecies(s11);
+		model.addAlias(sa11);
+
+		GenericProtein s12 = new GenericProtein();
+		s12.setElementId("s12");
+		model.addElement(s12);
+
+		SpeciesAlias sa12 = new GenericProteinAlias("sa12", s12);
+		sa12.setX(12.0);
+		sa12.setY(20.0);
+		sa12.setWidth(321.0);
+		sa12.setHeight(150.0);
+		sa12.setSpecies(s12);
+		model.addAlias(sa12);
+
+		GenericProtein s13 = new GenericProtein();
+		s13.setElementId("s13");
+		model.addElement(s13);
+
+		SpeciesAlias sa13 = new GenericProteinAlias("sa13", s13);
+		sa13.setX(513.0);
+		sa13.setY(20.0);
+		sa13.setWidth(321.0);
+		sa13.setHeight(150.0);
+		sa13.setSpecies(s13);
+		model.addAlias(sa13);
+
+		GenericProtein s14 = new GenericProtein();
+		s14.setElementId("s14");
+		model.addElement(s14);
+
+		SpeciesAlias sa14 = new GenericProteinAlias("sa14", s14);
+		sa14.setX(14.0);
+		sa14.setY(820.0);
+		sa14.setWidth(321.0);
+		sa14.setHeight(150.0);
+		sa14.setSpecies(s14);
+		model.addAlias(sa14);
+
+		GenericProtein s15 = new GenericProtein();
+		s15.setElementId("s15");
+		model.addElement(s15);
+
+		SpeciesAlias sa15 = new GenericProteinAlias("sa15", s15);
+		sa15.setX(815.0);
+		sa15.setY(620.0);
+		sa15.setWidth(321.0);
+		sa15.setHeight(150.0);
+		sa15.setSpecies(s15);
+		model.addAlias(sa15);
+
+		return model;
+	}
+
+	@Test
+	public void testLogiGateAndReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/reactions/logicGateAnd.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof BooleanLogicGateReaction);
+			assertEquals(1, reaction.getOperators().size());
+			assertTrue(reaction.getOperators().get(0) instanceof AndOperator);
+			assertEquals(2, reaction.getReactants().size());
+			assertEquals(1, reaction.getProducts().size());
+
+			assertEquals(0.0, reaction.getReactants().get(0).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
+			assertEquals(0.0, reaction.getReactants().get(1).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
+			assertEquals(0.0, reaction.getProducts().get(0).getLine().getBeginPoint().distance(200.0, 127.0), EPSILON);
+
+			CellDesignerXmlParser cellDesignerXmlParser = new CellDesignerXmlParser();
+
+			model.setName(null);
+			String xmlString = cellDesignerXmlParser.toXml(model);
+
+			ByteArrayInputStream bais = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
+			Model model2 = cellDesignerXmlParser.createModel(new ConverterParams().inputStream(bais).sizeAutoAdjust(false));
+
+			ModelComparator mc = new ModelComparator();
+			assertEquals("After CellDesigner xml serialization models are different", 0, mc.compare(model, model2));
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0, false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testLogiGateOrReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/reactions/logicGateOr.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof BooleanLogicGateReaction);
+			assertEquals(1, reaction.getOperators().size());
+			assertTrue(reaction.getOperators().get(0) instanceof OrOperator);
+			assertEquals(2, reaction.getReactants().size());
+			assertEquals(1, reaction.getProducts().size());
+
+			assertEquals(0.0, reaction.getReactants().get(0).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
+			assertEquals(0.0, reaction.getReactants().get(1).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
+			assertEquals(0.0, reaction.getProducts().get(0).getLine().getBeginPoint().distance(200.0, 127.0), EPSILON);
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0, false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testLogiGateNotReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/reactions/logicGateNot.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof BooleanLogicGateReaction);
+			assertEquals(1, reaction.getOperators().size());
+			assertTrue(reaction.getOperators().get(0) instanceof NandOperator);
+			assertEquals(2, reaction.getReactants().size());
+			assertEquals(1, reaction.getProducts().size());
+
+			assertEquals(0.0, reaction.getReactants().get(0).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
+			assertEquals(0.0, reaction.getReactants().get(1).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
+			assertEquals(0.0, reaction.getProducts().get(0).getLine().getBeginPoint().distance(200.0, 127.0), EPSILON);
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0, false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testLogiGateUnknownReaction() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/reactions/logicGateUnknown.xml");
+			assertEquals(1, model.getReactions().size());
+			Reaction reaction = model.getReactions().iterator().next();
+			assertTrue(reaction instanceof BooleanLogicGateReaction);
+			assertEquals(1, reaction.getOperators().size());
+			assertTrue(reaction.getOperators().get(0) instanceof UnknownOperator);
+			assertEquals(2, reaction.getReactants().size());
+			assertEquals(1, reaction.getProducts().size());
+
+			assertEquals(0.0, reaction.getReactants().get(0).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
+			assertEquals(0.0, reaction.getReactants().get(1).getLine().getEndPoint().distance(200.0, 127.0), EPSILON);
+			assertEquals(0.0, reaction.getProducts().get(0).getLine().getBeginPoint().distance(200.0, 127.0), EPSILON);
+
+			// NormalImageGenerator generator = new NormalImageGenerator(1, 0, 0,
+			// 1024, 1024, model, true, false, 0, false);
+			// generator.saveToPNG("tmp.png");
+			// Desktop.getDesktop().open(new File("tmp.png"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicDrawing() throws Exception {
+		Model model;
+		try {
+			model = getModelForFile("testFiles/problematic/reaction_drawing_problem.xml");
+			Reaction reaction = model.getReactionByReactionId("re1");
+			assertEquals(0, reaction.getCenterPoint().distance(new Point2D.Double(258.5, 145.0)), EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProteinsInsideComplex() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/problematic/proteins_inside_complex.xml");
+			for (Element el : model.getElements()) {
+				assertFalse(el.getClass().equals(Protein.class));
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionToXmlTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionToXmlTest.java
index c43a831009..c044d8c2e2 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionToXmlTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionToXmlTest.java
@@ -1,245 +1,239 @@
-package lcsb.mapviewer.converter.model.celldesigner.reaction;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.EventStorageLoggerAppender;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.modifier.Catalysis;
-import lcsb.mapviewer.model.map.reaction.AndOperator;
-import lcsb.mapviewer.model.map.reaction.Modifier;
-import lcsb.mapviewer.model.map.reaction.NodeOperator;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.type.DissociationReaction;
-import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-
-public class ReactionToXmlTest {
-	Logger				logger			= Logger.getLogger(ReactionToXmlTest.class);
-
-	ReactionToXml	toXmlParser	= new ReactionToXml();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testInvalidModification() {
-		Model model = new ModelFullIndexed(null);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setAliasId("2");
-		Protein protein = new GenericProtein();
-		protein.setElementId("1");
-		alias.setSpecies(protein);
-
-		model.addElement(protein);
-		model.addAlias(alias);
-
-		Reaction reaction = new TransportReaction();
-
-		Reactant reactant = new Reactant(alias, protein);
-		reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(10, 0)));
-		Product product = new Product(alias, protein);
-		product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(20, 0)));
-
-		reaction.addReactant(reactant);
-		reaction.addProduct(product);
-
-		Modifier modifier = new Catalysis(alias, protein);
-		modifier.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(30, 0)));
-
-		Modifier modifier2 = new Catalysis(alias, protein);
-		List<Point2D> points = new ArrayList<>();
-		points.add(new Point2D.Double(0, 0));
-		points.add(new Point2D.Double(30, 30));
-		points.add(new Point2D.Double(20, 20));
-		points.add(new Point2D.Double(20, 10));
-		points.add(new Point2D.Double(40, 0));
-		modifier2.setLine(new PolylineData(points));
-
-		NodeOperator andOperator = new AndOperator();
-		andOperator.addInput(modifier);
-		andOperator.addInput(modifier2);
-		points = new ArrayList<>();
-		points.add(new Point2D.Double(1, 0));
-		points.add(new Point2D.Double(30, 30));
-		points.add(new Point2D.Double(20, 20));
-		points.add(new Point2D.Double(20, 10));
-		points.add(new Point2D.Double(30, 0));
-		andOperator.setLine(new PolylineData(points));
-
-		reaction.addModifier(modifier);
-		reaction.addModifier(modifier2);
-		reaction.addNode(andOperator);
-
-		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
-		Logger.getRootLogger().addAppender(appender);
-
-		try {
-			toXmlParser.toXml(reaction);
-			assertEquals(2, appender.getWarnings().size());
-		} finally {
-			Logger.getRootLogger().removeAppender(appender);
-		}
-
-	}
-
-	@Test
-	public void testModificationFromInsideComplex() {
-
-		Model model = new ModelFullIndexed(null);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setAliasId("2");
-		Protein protein = new GenericProtein();
-		protein.setElementId("1");
-		alias.setSpecies(protein);
-
-		model.addElement(protein);
-		model.addAlias(alias);
-
-		ComplexAlias complex = new ComplexAlias();
-		complex.addAlias(complex);
-		complex.setAliasId("4");
-
-		ComplexSpecies species = new ComplexSpecies();
-		species.setElementId("5");
-		complex.setElement(species);
-
-		alias.setParent(complex);
-		alias.setComplexAlias(complex);
-		protein.setComplex(species);
-
-		model.addElement(species);
-		model.addAlias(complex);
-
-		Reaction reaction = new TransportReaction();
-
-		Reactant reactant = new Reactant(alias, protein);
-		reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(10, 0)));
-		Product product = new Product(alias, protein);
-		product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(20, 0)));
-
-		reaction.addReactant(reactant);
-		reaction.addProduct(product);
-
-		Modifier modifier = new Catalysis(alias, protein);
-		modifier.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(30, 0)));
-
-		reaction.addModifier(modifier);
-
-		String xml = toXmlParser.toXml(reaction);
-
-		assertTrue(xml.contains("species=\"5\""));
-
-	}
-
-	@Test
-	public void testInvalidReaction() {
-
-		Model model = new ModelFullIndexed(null);
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setAliasId("2");
-		Protein protein = new GenericProtein();
-		protein.setElementId("1");
-		alias.setSpecies(protein);
-
-		model.addElement(protein);
-		model.addAlias(alias);
-
-		Reaction reaction = new Reaction();
-
-		Reactant reactant = new Reactant(alias, protein);
-		reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(10, 0)));
-		Product product = new Product(alias, protein);
-		product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(20, 0)));
-
-		reaction.addReactant(reactant);
-		reaction.addProduct(product);
-
-		try {
-			toXmlParser.toXml(reaction);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown reaction type"));
-		}
-
-	}
-
-	@Test
-	public void testGetEditPointsXmlStringForInvalidReaction() {
-		try {
-			toXmlParser.getEditPointsXmlStringForReaction(new Reaction());
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unhandled reaction type"));
-		}
-
-	}
-
-	@Test
-	public void testGetConnectSchemeXmlStringForReaction() {
-		try {
-			toXmlParser.getConnectSchemeXmlStringForReaction(new Reaction());
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown reaction type"));
-		}
-
-	}
-
-	@Test
-	public void testGetConnectSchemeXmlStringForReaction2() {
-		try {
-			// test internal implementation
-			toXmlParser = new ReactionToXml() {
-				@Override
-				String getEditPointsXmlStringForReaction(Reaction reaction) {
-					return "";
-				}
-			};
-			toXmlParser.getConnectSchemeXmlStringForReaction(new DissociationReaction());
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Invalid editPoints string"));
-		}
-
-	}
-
-	@Test
-	public void testGetConnectSchemeXmlStringForLines() {
-		// this test checks currenlty not used part of the code (for test coverage
-		// purpose)
-		String xml = toXmlParser.getConnectSchemeXmlStringForLines(new PolylineData[] { new PolylineData(new Point2D.Double(),new Point2D.Double()), new PolylineData() });
-		assertTrue(xml.contains("arm"));
-
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.reaction;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.EventStorageLoggerAppender;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.modifier.Catalysis;
+import lcsb.mapviewer.model.map.reaction.AndOperator;
+import lcsb.mapviewer.model.map.reaction.Modifier;
+import lcsb.mapviewer.model.map.reaction.NodeOperator;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.DissociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class ReactionToXmlTest {
+	Logger				logger			= Logger.getLogger(ReactionToXmlTest.class);
+
+	ReactionToXml	toXmlParser	= new ReactionToXml();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testInvalidModification() {
+		Model model = new ModelFullIndexed(null);
+		GenericProtein protein = new GenericProtein();
+		protein.setElementId("1");
+		SpeciesAlias alias = new GenericProteinAlias("2", protein);
+
+		model.addElement(protein);
+		model.addAlias(alias);
+
+		Reaction reaction = new TransportReaction();
+
+		Reactant reactant = new Reactant(alias, protein);
+		reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(10, 0)));
+		Product product = new Product(alias, protein);
+		product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(20, 0)));
+
+		reaction.addReactant(reactant);
+		reaction.addProduct(product);
+
+		Modifier modifier = new Catalysis(alias, protein);
+		modifier.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(30, 0)));
+
+		Modifier modifier2 = new Catalysis(alias, protein);
+		List<Point2D> points = new ArrayList<>();
+		points.add(new Point2D.Double(0, 0));
+		points.add(new Point2D.Double(30, 30));
+		points.add(new Point2D.Double(20, 20));
+		points.add(new Point2D.Double(20, 10));
+		points.add(new Point2D.Double(40, 0));
+		modifier2.setLine(new PolylineData(points));
+
+		NodeOperator andOperator = new AndOperator();
+		andOperator.addInput(modifier);
+		andOperator.addInput(modifier2);
+		points = new ArrayList<>();
+		points.add(new Point2D.Double(1, 0));
+		points.add(new Point2D.Double(30, 30));
+		points.add(new Point2D.Double(20, 20));
+		points.add(new Point2D.Double(20, 10));
+		points.add(new Point2D.Double(30, 0));
+		andOperator.setLine(new PolylineData(points));
+
+		reaction.addModifier(modifier);
+		reaction.addModifier(modifier2);
+		reaction.addNode(andOperator);
+
+		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
+		Logger.getRootLogger().addAppender(appender);
+
+		try {
+			toXmlParser.toXml(reaction);
+			assertEquals(2, appender.getWarnings().size());
+		} finally {
+			Logger.getRootLogger().removeAppender(appender);
+		}
+
+	}
+
+	@Test
+	public void testModificationFromInsideComplex() {
+
+		Model model = new ModelFullIndexed(null);
+		GenericProtein protein = new GenericProtein();
+		protein.setElementId("1");
+		SpeciesAlias alias = new GenericProteinAlias("2", protein);
+
+		model.addElement(protein);
+		model.addAlias(alias);
+
+		ComplexAlias complex = new ComplexAlias("4");
+		complex.addAlias(complex);
+
+		ComplexSpecies species = new ComplexSpecies();
+		species.setElementId("5");
+		complex.setElement(species);
+
+		alias.setParent(complex);
+		alias.setComplexAlias(complex);
+		protein.setComplex(species);
+
+		model.addElement(species);
+		model.addAlias(complex);
+
+		Reaction reaction = new TransportReaction();
+
+		Reactant reactant = new Reactant(alias, protein);
+		reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(10, 0)));
+		Product product = new Product(alias, protein);
+		product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(20, 0)));
+
+		reaction.addReactant(reactant);
+		reaction.addProduct(product);
+
+		Modifier modifier = new Catalysis(alias, protein);
+		modifier.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(30, 0)));
+
+		reaction.addModifier(modifier);
+
+		String xml = toXmlParser.toXml(reaction);
+
+		assertTrue(xml.contains("species=\"5\""));
+
+	}
+
+	@Test
+	public void testInvalidReaction() {
+
+		Model model = new ModelFullIndexed(null);
+		GenericProtein protein = new GenericProtein();
+		protein.setElementId("1");
+		SpeciesAlias alias = new GenericProteinAlias("2", protein);
+
+		model.addElement(protein);
+		model.addAlias(alias);
+
+		Reaction reaction = new Reaction();
+
+		Reactant reactant = new Reactant(alias, protein);
+		reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(10, 0)));
+		Product product = new Product(alias, protein);
+		product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double(20, 0)));
+
+		reaction.addReactant(reactant);
+		reaction.addProduct(product);
+
+		try {
+			toXmlParser.toXml(reaction);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unknown reaction type"));
+		}
+
+	}
+
+	@Test
+	public void testGetEditPointsXmlStringForInvalidReaction() {
+		try {
+			toXmlParser.getEditPointsXmlStringForReaction(new Reaction());
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unhandled reaction type"));
+		}
+
+	}
+
+	@Test
+	public void testGetConnectSchemeXmlStringForReaction() {
+		try {
+			toXmlParser.getConnectSchemeXmlStringForReaction(new Reaction());
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unknown reaction type"));
+		}
+
+	}
+
+	@Test
+	public void testGetConnectSchemeXmlStringForReaction2() {
+		try {
+			// test internal implementation
+			toXmlParser = new ReactionToXml() {
+				@Override
+				String getEditPointsXmlStringForReaction(Reaction reaction) {
+					return "";
+				}
+			};
+			toXmlParser.getConnectSchemeXmlStringForReaction(new DissociationReaction());
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Invalid editPoints string"));
+		}
+
+	}
+
+	@Test
+	public void testGetConnectSchemeXmlStringForLines() {
+		// this test checks currenlty not used part of the code (for test coverage
+		// purpose)
+		String xml = toXmlParser
+				.getConnectSchemeXmlStringForLines(new PolylineData[] { new PolylineData(new Point2D.Double(), new Point2D.Double()), new PolylineData() });
+		assertTrue(xml.contains("arm"));
+
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/ComplexParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/ComplexParserTest.java
index 5fc557dadc..6b3a335ffb 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/ComplexParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/ComplexParserTest.java
@@ -1,402 +1,395 @@
-package lcsb.mapviewer.converter.model.celldesigner.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.converter.model.celldesigner.alias.ComplexAliasXmlParser;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Protein;
-
-public class ComplexParserTest extends CellDesignerTestFunctions {
-	Logger logger									 = Logger.getLogger(ComplexParserTest.class);
-
-	String testSpeciesId					 = "s3";
-	String testAliasId						 = "sa3";
-	String testCompartmentAliasId	 = "ca3";
-	String testCompartmentId			 = "c3";
-	String testCompartmentAliasId2 = "ca4";
-	String testCompartmentId2			 = "c4";
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testComplexState() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/problematic/complex_with_state.xml");
-			ComplexSpecies complex = (ComplexSpecies) model.getSpeciesBySpeciesId("s1");
-			assertEquals("test state", complex.getStructuralState());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidInputNode() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias.xml"));
-			fail("Exceptione expected");
-
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("No species"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidInputNode2() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Element element = new Protein();
-			element.setElementId("s3");
-			model.addElement(element);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias2.xml"));
-			fail("Exceptione expected");
-
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("celldesigner:bla"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidInputNode3() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Element element = new Protein();
-			element.setElementId("s3");
-			model.addElement(element);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias3.xml"));
-			fail("Exceptione expected");
-
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("unusual"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidInputNode4() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Element element = new Protein();
-			element.setElementId("s3");
-			model.addElement(element);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias4.xml"));
-			fail("Exceptione expected");
-
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("unkown state"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidInputNode5() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Element element = new Protein();
-			element.setElementId("s3");
-			model.addElement(element);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias5.xml"));
-			fail("Exceptione expected");
-
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("CompartmentAlias does not exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlWithParent() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-
-			CompartmentAlias ca = new CompartmentAlias();
-			ca.setAliasId(testCompartmentAliasId);
-
-			Element element = new ComplexSpecies();
-			element.setElementId(testSpeciesId);
-
-			ComplexAlias alias = new ComplexAlias();
-			alias.setAliasId(testAliasId);
-			alias.setElement(element);
-
-			alias.setParent(ca);
-
-			model.addElement(element);
-			model.addAlias(alias);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			String xml = parser.toXml(alias);
-
-			assertTrue(xml.contains(testSpeciesId));
-			assertTrue(xml.contains(testAliasId));
-			assertTrue(xml.contains(testCompartmentAliasId));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlWithCompartment() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-
-			CompartmentAlias ca = new CompartmentAlias();
-			ca.setAliasId(testCompartmentAliasId);
-
-			Element element = new ComplexSpecies();
-			element.setElementId(testSpeciesId);
-
-			ComplexAlias alias = new ComplexAlias();
-			alias.setAliasId(testAliasId);
-			alias.setElement(element);
-
-			alias.setCompartmentAlias(ca);
-
-			model.addElement(element);
-			model.addAlias(alias);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			String xml = parser.toXml(alias);
-
-			assertTrue(xml.contains(testSpeciesId));
-			assertTrue(xml.contains(testAliasId));
-			assertTrue(xml.contains(testCompartmentAliasId));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlWithUnknownCompartment() throws Exception {
-		try {
-			Model model = Mockito.mock(ModelFullIndexed.class);
-			ModelData md = new ModelData();
-			md.setModel(model);
-
-			Compartment compartment2 = new Compartment();
-			compartment2.setElementId(testCompartmentId2);
-			CompartmentAlias ca2 = new CompartmentAlias();
-			ca2.setAliasId(testCompartmentAliasId2);
-			ca2.setX(6);
-			ca2.setY(6);
-			ca2.setWidth(190);
-			ca2.setHeight(190);
-			ca2.setElement(compartment2);
-
-			Compartment compartment = new Compartment();
-			compartment.setElementId(testCompartmentId);
-			CompartmentAlias ca = new CompartmentAlias();
-			ca.setAliasId(testCompartmentAliasId);
-			ca.setX(5);
-			ca.setY(5);
-			ca.setWidth(200);
-			ca.setHeight(200);
-			ca.setElement(compartment);
-
-			List<CompartmentAlias> list = new ArrayList<>();
-			list.add(ca);
-			list.add(ca2);
-
-			// ensure that we return list (firts bigger compartment, then smaller)
-			when(model.getCompartmentsAliases()).thenReturn(list);
-			when(model.getModelData()).thenReturn(md);
-
-			Element element = new ComplexSpecies();
-			element.setElementId(testSpeciesId);
-
-			ComplexAlias alias = new ComplexAlias();
-			alias.setX(10);
-			alias.setY(10);
-			alias.setWidth(100);
-			alias.setHeight(100);
-			alias.setAliasId(testAliasId);
-			alias.setElement(element);
-			alias.setModel(model);
-
-			model.addElement(element);
-			model.addAlias(alias);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			String xml = parser.toXml(alias);
-
-			assertTrue(xml.contains(testSpeciesId));
-			assertTrue(xml.contains(testAliasId));
-			assertTrue(xml.contains(testCompartmentAliasId2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlWithComplexParent() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-
-			Compartment compartment = new Compartment();
-			compartment.setElementId("default");
-			model.addElement(compartment);
-
-			ComplexAlias ca = new ComplexAlias();
-			ca.setAliasId(testCompartmentAliasId);
-
-			Element element = new ComplexSpecies();
-			element.setElementId(testSpeciesId);
-
-			ComplexAlias alias = new ComplexAlias();
-			alias.setAliasId(testAliasId);
-			alias.setElement(element);
-
-			alias.setParent(ca);
-
-			model.addElement(element);
-			model.addAlias(alias);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			String xml = parser.toXml(alias);
-
-			assertTrue(xml.contains(testSpeciesId));
-			assertTrue(xml.contains(testAliasId));
-			assertTrue(xml.contains(testCompartmentAliasId));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlWithActiveComplex() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-
-			Element element = new ComplexSpecies();
-			element.setElementId(testSpeciesId);
-
-			ComplexAlias alias = new ComplexAlias();
-			alias.setAliasId(testAliasId);
-			alias.setElement(element);
-
-			alias.setActivity(true);
-
-			model.addElement(element);
-			model.addAlias(alias);
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			String xml = parser.toXml(alias);
-
-			assertTrue(xml.contains(testSpeciesId));
-			assertTrue(xml.contains(testAliasId));
-			assertTrue(xml.contains("<celldesigner:activity>active</celldesigner:activity>"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddInvalidReference() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Element element = new Protein();
-			element.setElementId("s2");
-			model.addElement(element);
-
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			ComplexAlias child = parser.parseXmlAlias(readFile("testFiles/xmlNodeTestExamples/cd_complex_alias_with_parent.xml"));
-
-			parser.addReference(child);
-			fail("Exception expected");
-
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Parent complex alias does not exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseWithEmptyState() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Element element = new Protein();
-			element.setElementId("s2597");
-			model.addElement(element);
-
-			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
-
-			ComplexAlias child = parser.parseXmlAlias(readFile("testFiles/xmlNodeTestExamples/cd_complex_alias_with_empty_state.xml"));
-			
-			assertNotNull(child);
-			assertNull(child.getAliasStateLabel());
-			assertNull(child.getAliasStatePrefix());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.converter.model.celldesigner.alias.ComplexAliasXmlParser;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class ComplexParserTest extends CellDesignerTestFunctions {
+	Logger logger									 = Logger.getLogger(ComplexParserTest.class);
+
+	String testSpeciesId					 = "s3";
+	String testAliasId						 = "sa3";
+	String testCompartmentAliasId	 = "ca3";
+	String testCompartmentId			 = "c3";
+	String testCompartmentAliasId2 = "ca4";
+	String testCompartmentId2			 = "c4";
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testComplexState() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/problematic/complex_with_state.xml");
+			ComplexSpecies complex = (ComplexSpecies) model.getSpeciesBySpeciesId("s1");
+			assertEquals("test state", complex.getStructuralState());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidInputNode() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias.xml"));
+			fail("Exceptione expected");
+
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("No species"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidInputNode2() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Element element = new ComplexSpecies();
+			element.setElementId("s3");
+			model.addElement(element);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias2.xml"));
+			fail("Exceptione expected");
+
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("celldesigner:bla"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidInputNode3() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Element element = new ComplexSpecies();
+			element.setElementId("s3");
+			model.addElement(element);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias3.xml"));
+			fail("Exceptione expected");
+
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("unusual"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidInputNode4() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Element element = new ComplexSpecies();
+			element.setElementId("s3");
+			model.addElement(element);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias4.xml"));
+			fail("Exceptione expected");
+
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("unkown state"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidInputNode5() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Element element = new ComplexSpecies();
+			element.setElementId("s3");
+			model.addElement(element);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			parser.parseXmlAlias(readFile("testFiles/invalid/invalid_complex_alias5.xml"));
+			fail("Exceptione expected");
+
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("CompartmentAlias does not exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlWithParent() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+
+			CompartmentAlias ca = new CompartmentAlias();
+			ca.setAliasId(testCompartmentAliasId);
+
+			ComplexSpecies element = new ComplexSpecies();
+			element.setElementId(testSpeciesId);
+
+			ComplexAlias alias = new ComplexAlias(element);
+			alias.setAliasId(testAliasId);
+
+			alias.setParent(ca);
+
+			model.addElement(element);
+			model.addAlias(alias);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			String xml = parser.toXml(alias);
+
+			assertTrue(xml.contains(testSpeciesId));
+			assertTrue(xml.contains(testAliasId));
+			assertTrue(xml.contains(testCompartmentAliasId));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlWithCompartment() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+
+			CompartmentAlias ca = new CompartmentAlias();
+			ca.setAliasId(testCompartmentAliasId);
+
+			ComplexSpecies element = new ComplexSpecies();
+			element.setElementId(testSpeciesId);
+
+			ComplexAlias alias = new ComplexAlias(element);
+			alias.setAliasId(testAliasId);
+
+			alias.setCompartmentAlias(ca);
+
+			model.addElement(element);
+			model.addAlias(alias);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			String xml = parser.toXml(alias);
+
+			assertTrue(xml.contains(testSpeciesId));
+			assertTrue(xml.contains(testAliasId));
+			assertTrue(xml.contains(testCompartmentAliasId));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlWithUnknownCompartment() throws Exception {
+		try {
+			Model model = Mockito.mock(ModelFullIndexed.class);
+			ModelData md = new ModelData();
+			md.setModel(model);
+
+			Compartment compartment2 = new Compartment();
+			compartment2.setElementId(testCompartmentId2);
+			CompartmentAlias ca2 = new CompartmentAlias();
+			ca2.setAliasId(testCompartmentAliasId2);
+			ca2.setX(6);
+			ca2.setY(6);
+			ca2.setWidth(190);
+			ca2.setHeight(190);
+			ca2.setElement(compartment2);
+
+			Compartment compartment = new Compartment();
+			compartment.setElementId(testCompartmentId);
+			CompartmentAlias ca = new CompartmentAlias();
+			ca.setAliasId(testCompartmentAliasId);
+			ca.setX(5);
+			ca.setY(5);
+			ca.setWidth(200);
+			ca.setHeight(200);
+			ca.setElement(compartment);
+
+			List<CompartmentAlias> list = new ArrayList<>();
+			list.add(ca);
+			list.add(ca2);
+
+			// ensure that we return list (firts bigger compartment, then smaller)
+			when(model.getCompartmentsAliases()).thenReturn(list);
+			when(model.getModelData()).thenReturn(md);
+
+			ComplexSpecies element = new ComplexSpecies();
+			element.setElementId(testSpeciesId);
+
+			ComplexAlias alias = new ComplexAlias(element);
+			alias.setX(10);
+			alias.setY(10);
+			alias.setWidth(100);
+			alias.setHeight(100);
+			alias.setAliasId(testAliasId);
+			alias.setModel(model);
+
+			model.addElement(element);
+			model.addAlias(alias);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			String xml = parser.toXml(alias);
+
+			assertTrue(xml.contains(testSpeciesId));
+			assertTrue(xml.contains(testAliasId));
+			assertTrue(xml.contains(testCompartmentAliasId2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlWithComplexParent() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+
+			Compartment compartment = new Compartment();
+			compartment.setElementId("default");
+			model.addElement(compartment);
+
+			ComplexAlias ca = new ComplexAlias(testCompartmentAliasId);
+
+			ComplexSpecies element = new ComplexSpecies();
+			element.setElementId(testSpeciesId);
+
+			ComplexAlias alias = new ComplexAlias(element);
+			alias.setAliasId(testAliasId);
+
+			alias.setParent(ca);
+
+			model.addElement(element);
+			model.addAlias(alias);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			String xml = parser.toXml(alias);
+
+			assertTrue(xml.contains(testSpeciesId));
+			assertTrue(xml.contains(testAliasId));
+			assertTrue(xml.contains(testCompartmentAliasId));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlWithActiveComplex() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+
+			ComplexSpecies element = new ComplexSpecies();
+			element.setElementId(testSpeciesId);
+
+			ComplexAlias alias = new ComplexAlias(element);
+			alias.setAliasId(testAliasId);
+
+			alias.setActivity(true);
+
+			model.addElement(element);
+			model.addAlias(alias);
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			String xml = parser.toXml(alias);
+
+			assertTrue(xml.contains(testSpeciesId));
+			assertTrue(xml.contains(testAliasId));
+			assertTrue(xml.contains("<celldesigner:activity>active</celldesigner:activity>"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddInvalidReference() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Element element = new ComplexSpecies();
+			element.setElementId("s2");
+			model.addElement(element);
+
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			ComplexAlias child = parser.parseXmlAlias(readFile("testFiles/xmlNodeTestExamples/cd_complex_alias_with_parent.xml"));
+
+			parser.addReference(child);
+			fail("Exception expected");
+
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Parent complex alias does not exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseWithEmptyState() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Element element = new ComplexSpecies("s2597");
+			model.addElement(element);
+
+			ComplexAliasXmlParser parser = new ComplexAliasXmlParser(model);
+
+			ComplexAlias child = parser.parseXmlAlias(readFile("testFiles/xmlNodeTestExamples/cd_complex_alias_with_empty_state.xml"));
+
+			assertNotNull(child);
+			assertNull(child.getAliasStateLabel());
+			assertNull(child.getAliasStatePrefix());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionTest.java
index 021323e574..31de0bec57 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionTest.java
@@ -1,120 +1,121 @@
-package lcsb.mapviewer.converter.model.celldesigner.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class SpeciesCollectionTest {
-	Logger logger = Logger.getLogger(SpeciesCollectionTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testAdd() {
-		try {
-			SpeciesCollection<Gene> coll = new SpeciesCollection<Gene>();
-			Gene g = new Gene();
-			g.setElementId("general Id");
-			coll.add(g, "geneId");
-			assertNotNull(coll.getSpeciesListByLocalId("geneId"));
-			assertEquals(1, coll.getSpeciesListByLocalId("geneId").size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdate() {
-		try {
-			SpeciesCollection<Protein> coll = new SpeciesCollection<Protein>();
-			Protein p = new Protein();
-			p.setElementId("");
-			coll.add(p, "prot id");
-
-			Protein p2 = new Protein();
-			p2.setElementId("id2");
-			coll.updateSpeciesByLocalId(p2, "prot id");
-			assertEquals(1, coll.getSpeciesListByLocalId("prot id").size());
-			Protein p3 = coll.getSpeciesListByLocalId("prot id").get(0);
-
-			assertEquals(p, p3);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdateWithTypeChange() {
-		try {
-			SpeciesCollection<Protein> coll = new SpeciesCollection<Protein>();
-			Protein p = new Protein();
-			p.setElementId("");
-			coll.add(p, "prot id");
-
-			GenericProtein p2 = new GenericProtein();
-			p2.setElementId("id2");
-			coll.updateSpeciesByLocalId(p2, "prot id");
-			assertEquals(1, coll.getSpeciesListByLocalId("prot id").size());
-			Protein p3 = coll.getSpeciesListByLocalId("prot id").get(0);
-
-			// we don't have generic data anymore but new instance
-			assertFalse(p3.equals(p));
-			assertFalse(p3.equals(p2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateNewInstance() {
-		try {
-			SpeciesCollection<Species> coll = new SpeciesCollection<>();
-			class InvalidSpecies extends Species {
-				private static final long serialVersionUID = 1L;
-
-				public InvalidSpecies() {
-				}
-
-				@SuppressWarnings("unused")
-				public InvalidSpecies(final Species sp) {
-					throw new NotImplementedException();
-				}
-			}
-
-			InvalidSpecies p = new InvalidSpecies();
-			p.setElementId("");
-
-			coll.createNewInstance(p.getClass(), p);
-
-		} catch (InvalidStateException e) {
-			assertTrue(e.getMessage().contains("Problem with creating object"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.converter.model.celldesigner.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.TruncatedProtein;
+
+public class SpeciesCollectionTest {
+	Logger logger = Logger.getLogger(SpeciesCollectionTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testAdd() {
+		try {
+			SpeciesCollection<Gene> coll = new SpeciesCollection<Gene>();
+			Gene g = new Gene();
+			g.setElementId("general Id");
+			coll.add(g, "geneId");
+			assertNotNull(coll.getSpeciesListByLocalId("geneId"));
+			assertEquals(1, coll.getSpeciesListByLocalId("geneId").size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdate() {
+		try {
+			SpeciesCollection<Protein> coll = new SpeciesCollection<>();
+			Protein protein = new GenericProtein();
+			protein.setElementId("");
+			coll.add(protein, "prot id");
+
+			Protein p2 = new GenericProtein();
+			p2.setElementId("id2");
+			coll.updateSpeciesByLocalId(p2, "prot id");
+			assertEquals(1, coll.getSpeciesListByLocalId("prot id").size());
+			Protein p3 = coll.getSpeciesListByLocalId("prot id").get(0);
+
+			assertEquals(protein, p3);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdateWithTypeChange() {
+		try {
+			SpeciesCollection<Protein> coll = new SpeciesCollection<>();
+			Protein protein = new TruncatedProtein();
+			protein.setElementId("");
+			coll.add(protein, "prot id");
+
+			GenericProtein p2 = new GenericProtein();
+			p2.setElementId("id2");
+			coll.updateSpeciesByLocalId(p2, "prot id");
+			assertEquals(1, coll.getSpeciesListByLocalId("prot id").size());
+			Protein p3 = coll.getSpeciesListByLocalId("prot id").get(0);
+
+			// we don't have generic data anymore but new instance
+			assertFalse(p3.equals(protein));
+			assertFalse(p3.equals(p2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCreateNewInstance() {
+		try {
+			SpeciesCollection<Species> coll = new SpeciesCollection<>();
+			class InvalidSpecies extends Species {
+				private static final long serialVersionUID = 1L;
+
+				public InvalidSpecies() {
+				}
+
+				@SuppressWarnings("unused")
+				public InvalidSpecies(final Species sp) {
+					throw new NotImplementedException();
+				}
+			}
+
+			InvalidSpecies p = new InvalidSpecies();
+			p.setElementId("");
+
+			coll.createNewInstance(p.getClass(), p);
+
+		} catch (InvalidStateException e) {
+			assertTrue(e.getMessage().contains("Problem with creating object"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParserTest.java
index 2ece01b6a5..e18c9f4652 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParserTest.java
@@ -1,606 +1,601 @@
-package lcsb.mapviewer.converter.model.celldesigner.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-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;
-
-public class SpeciesCollectionXmlParserTest extends CellDesignerTestFunctions {
-	static Logger							 logger											 = Logger.getLogger(SpeciesCollectionXmlParserTest.class);
-	Model											 model											 = new ModelFullIndexed(null);
-	SpeciesCollectionXmlParser parser											 = null;
-
-	String										 testDirectory							 = "testFiles" + System.getProperty("file.separator") + "xmlNodeTestExamples"
-			+ System.getProperty("file.separator");
-
-	String										 testRnaListXmlFile					 = "cd_rna_collection.xml";
-	String										 testGeneListXmlFile				 = "cd_gene_collection.xml";
-	String										 testAntisenseRnaListXmlFile = "cd_antisense_rna_collection.xml";
-	String										 testIncludedListXmlFile		 = "cd_included_species_collection.xml";
-	String										 testProteinListXmlFile			 = "cd_protein_collection.xml";
-	String										 testSbmlListXmlFile				 = "cd_sbml_collection.xml";
-
-	@Before
-	public void setUp() throws Exception {
-		parser = new SpeciesCollectionXmlParser(model);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseXmlRnaCollection() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testRnaListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseXmlRnaCollection(node);
-			assertEquals(2, list.size());
-			assertTrue(list.get(0).getRight() instanceof Rna);
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlRnaCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/rna_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseXmlRnaCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfRNAs"));
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlGeneCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/gene_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseXmlGeneCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfGenes"));
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlAntisenseRnaCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/antisense_rna_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseXmlAntisenseRnaCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfAntisenseRNAs"));
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidXmlPRoteinCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/protein_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseXmlProteinCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfProteins"));
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlStringRnaCollection() {
-		try {
-			String xmlString = readFile(testDirectory + testRnaListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseXmlRnaCollection(node);
-			List<Rna> arList = new ArrayList<Rna>();
-			for (Pair<String, ? extends Species> pair : list) {
-				arList.add((Rna) pair.getRight());
-			}
-			String convertedString = parser.rnaCollectionToXmlString(arList);
-			assertNotNull(convertedString);
-			node = getNodeFromXmlString(convertedString);
-			assertEquals("celldesigner:listOfRNAs", node.getNodeName());
-			List<Pair<String, ? extends Species>> list2 = parser.parseXmlRnaCollection(node);
-			assertNotNull(list2);
-			assertEquals(list.size(), list2.size());
-			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
-		} catch (Exception exception) {
-			fail("Unexpected exception occurred");
-		}
-	}
-
-	@Test
-	public void testParseXmlGeneCollection() {
-		try {
-			String xmlString = readFile(testDirectory + testGeneListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseXmlGeneCollection(node);
-			assertEquals(2, list.size());
-			assertTrue(list.get(0).getRight() instanceof Gene);
-		} catch (Exception exception) {
-			fail("Unexpected exception occurred");
-		}
-	}
-
-	@Test
-	public void testToXmlStringGeneCollection() {
-		try {
-			String xmlString = readFile(testDirectory + testGeneListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseXmlGeneCollection(node);
-			List<Gene> arList = new ArrayList<Gene>();
-			for (Pair<String, ? extends Species> pair : list) {
-				arList.add((Gene) pair.getRight());
-			}
-			String convertedString = parser.geneCollectionToXmlString(arList);
-			assertNotNull(convertedString);
-			node = getNodeFromXmlString(convertedString);
-			assertEquals("celldesigner:listOfGenes", node.getNodeName());
-			List<Pair<String, ? extends Species>> list2 = parser.parseXmlGeneCollection(node);
-			assertNotNull(list2);
-			assertEquals(list.size(), list2.size());
-			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
-		} catch (Exception exception) {
-			fail("Unexpected exception occurred");
-		}
-	}
-
-	@Test
-	public void testParseXmlProteinCollection() {
-		try {
-			String xmlString = readFile(testDirectory + testProteinListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseXmlProteinCollection(node);
-			assertEquals(4, list.size());
-			assertTrue(list.get(0).getRight() instanceof Protein);
-		} catch (Exception exception) {
-			fail("Unexpected exception occurred");
-		}
-	}
-
-	@Test
-	public void testToXmlStringProteinCollection() {
-		try {
-			String xmlString = readFile(testDirectory + testProteinListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseXmlProteinCollection(node);
-			List<Protein> arList = new ArrayList<Protein>();
-			for (Pair<String, ? extends Species> pair : list) {
-				arList.add((Protein) pair.getRight());
-			}
-			String convertedString = parser.proteinCollectionToXmlString(arList);
-			assertNotNull(convertedString);
-			node = getNodeFromXmlString(convertedString);
-			assertEquals("celldesigner:listOfProteins", node.getNodeName());
-			List<Pair<String, ? extends Species>> list2 = parser.parseXmlProteinCollection(node);
-			assertNotNull(list2);
-			assertEquals(list.size(), list2.size());
-			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
-		} catch (Exception exception) {
-			fail("Unexpected exception occurred");
-		}
-	}
-
-	@Test
-	public void testParseXmlAntisenseRnaCollection() {
-		try {
-			String xmlString = readFile(testDirectory + testAntisenseRnaListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseXmlAntisenseRnaCollection(node);
-			assertEquals(2, list.size());
-			assertTrue(list.get(0).getRight() instanceof AntisenseRna);
-		} catch (Exception exception) {
-			fail("Unexpected exception occurred");
-		}
-	}
-
-	@Test
-	public void testToXmlStringAntisenseRnaCollection() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testAntisenseRnaListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseXmlAntisenseRnaCollection(node);
-			List<AntisenseRna> arList = new ArrayList<AntisenseRna>();
-			for (Pair<String, ? extends Species> pair : list) {
-				arList.add((AntisenseRna) pair.getRight());
-			}
-			String convertedString = parser.antisenseRnaCollectionToXmlString(arList);
-			assertNotNull(convertedString);
-			node = getNodeFromXmlString(convertedString);
-			assertEquals("celldesigner:listOfAntisenseRNAs", node.getNodeName());
-			List<Pair<String, ? extends Species>> list2 = parser.parseXmlAntisenseRnaCollection(node);
-			assertNotNull(list2);
-			assertEquals(list.size(), list2.size());
-			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseSbmlSpeciesCollection() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testSbmlListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseSbmlSpeciesCollection(node);
-			assertEquals(9, list.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalidSbmlSpeciesCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/sbml_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseSbmlSpeciesCollection(node);
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Unknown element of listOfSpecies"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToSbmlStringSpeciesCollection() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testSbmlListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseSbmlSpeciesCollection(node);
-			Model model = new ModelFullIndexed(null);
-			int x = 0;
-			List<Species> speciesList = new ArrayList<Species>();
-			for (Pair<String, ? extends Species> el : list) {
-				Species species = el.getRight();
-				species.setModel(model);
-
-				SpeciesAlias alias;
-				if (species instanceof ComplexSpecies) {
-					alias = new ComplexAlias((ComplexSpecies) species);
-				} else {
-					alias = new SpeciesAlias(species);
-				}
-				alias.setAliasId("alias" + (x++));
-				model.addAlias(alias);
-				speciesList.add(species);
-			}
-			model.addCompartment(new Compartment("default"));
-			String convertedString = parser.speciesCollectionToSbmlString(speciesList);
-			assertNotNull(convertedString);
-			node = getNodeFromXmlString(convertedString);
-			assertEquals("listOfSpecies", node.getNodeName());
-			List<Pair<String, ? extends Species>> list2 = parser.parseSbmlSpeciesCollection(node);
-			assertNotNull(list2);
-			assertEquals(list.size(), list2.size());
-			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testParseIncludedSpeciesCollection() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testIncludedListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseIncludedSpeciesCollection(node);
-			assertEquals(3, list.size());
-			int complexes = 0;
-			int proteins = 0;
-			for (Pair<String, ? extends Species> species : list) {
-				if (species.getRight() instanceof ComplexSpecies)
-					complexes++;
-				if (species.getRight() instanceof Protein)
-					proteins++;
-			}
-			assertEquals(1, complexes);
-			assertEquals(2, proteins);
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testParseInvalidIncludedSpeciesCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseIncludedSpeciesCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue(exception.getMessage().contains("Included species does not contain id"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testParseInvalidIncludedSpeciesCollection2() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection2.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseIncludedSpeciesCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue(exception.getMessage().contains("Unknown element of celldesigner:species"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testParseInvalidIncludedSpeciesCollection3() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection3.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseIncludedSpeciesCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue(exception.getMessage().contains("Included species does not contain annotation node"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testParseInvalidIncludedSpeciesCollection4() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection4.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseIncludedSpeciesCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue(exception.getMessage().contains("No celldesigner:speciesIdentity node in included tag"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testParseInvalidIncludedSpeciesCollection5() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection5.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.parseIncludedSpeciesCollection(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue(exception.getMessage().contains("Unknown element of celldesigner:listOfIncludedSpecies"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testAddInvalidIncludedSpeciesCollection() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.addConnectionBetweenIncludedSpecies(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue(exception.getMessage().contains("Included species does not contain id"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testAddInvalidIncludedSpeciesCollection2() throws Exception {
-		try {
-			ComplexSpecies complex = new ComplexSpecies("s9");
-			model.addElement(complex);
-			String xmlString = readFile("testFiles/invalid/included_species_collection2.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.addConnectionBetweenIncludedSpecies(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue("Invalid message: " + exception.getMessage(), exception.getMessage().contains("Cannot find species with id"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testAddInvalidIncludedSpeciesCollection3() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection3.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.addConnectionBetweenIncludedSpecies(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue(exception.getMessage().contains("Included species does not contain annotation node"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testAddInvalidIncludedSpeciesCollection4() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection4.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.addConnectionBetweenIncludedSpecies(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue("Invalid message: " + exception.getMessage(), exception.getMessage().contains("Cannot find complex with id"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testAddInvalidIncludedSpeciesCollection5() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/included_species_collection5.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.addConnectionBetweenIncludedSpecies(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue(exception.getMessage().contains("Unknown element of celldesigner:listOfIncludedSpecies"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testAddInvalidIncludedSpeciesCollection6() throws Exception {
-		try {
-			ComplexSpecies complex = new ComplexSpecies("s9");
-			model.addElement(complex);
-			complex = new ComplexSpecies("s10");
-			model.addElement(complex);
-			String xmlString = readFile("testFiles/invalid/included_species_collection6.xml");
-			Node node = getNodeFromXmlString(xmlString);
-			parser.addConnectionBetweenIncludedSpecies(node);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException exception) {
-			assertTrue("Invalid message: " + exception.getMessage(), exception.getMessage().contains("No celldesigner:complexSpecies node in included tag"));
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void testToIncludedStringSpeciesCollection() throws Exception {
-		try {
-			ComplexSpecies protein = new ComplexSpecies();
-			protein.setElementId("s9");
-			model.addElement(protein);
-
-			String xmlString = readFile(testDirectory + testIncludedListXmlFile);
-			Node node = getNodeFromXmlString(xmlString);
-			List<Pair<String, ? extends Species>> list = parser.parseIncludedSpeciesCollection(node);
-			for (Pair<String, ? extends Species> species : list) {
-				model.addElement(species.getRight());
-			}
-			parser.addConnectionBetweenIncludedSpecies(node);
-
-			Set<Species> collection = new HashSet<Species>();
-
-			for (Element element : model.getElements()) {
-				if (element instanceof Species) {
-					collection.add((Species) element);
-				}
-			}
-
-			String convertedString = parser.speciesCollectionToXmlIncludedString(collection);
-			assertNotNull(convertedString);
-			List<Pair<String, ? extends Species>> list2 = parser.parseIncludedSpeciesCollection(getNodeFromXmlString(convertedString));
-			assertNotNull(list2);
-			assertEquals(list.size(), list2.size());
-			Map<Class<?>, Integer> counter = new HashMap<Class<?>, Integer>();
-			for (Pair<String, ? extends Species> species : list) {
-				Integer count = counter.get(species.getRight().getClass());
-				if (count == null)
-					count = 0;
-				count++;
-				counter.put(species.getRight().getClass(), count);
-			}
-			Map<Class<?>, Integer> counter2 = new HashMap<Class<?>, Integer>();
-			for (Pair<String, ? extends Species> species : list2) {
-				Integer count = counter2.get(species.getRight().getClass());
-				if (count == null)
-					count = 0;
-				count++;
-				counter2.put(species.getRight().getClass(), count);
-			}
-
-			for (Class<?> clazz : counter2.keySet()) {
-				assertEquals(counter.get(clazz), counter2.get(clazz));
-			}
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-	@Test
-	public void artifitialTest() throws Exception {
-		try {
-			// tests some parts of the code that should never be called and therefore
-			// throw exceptions
-
-			// this is only for test coverage puropse
-
-			SpeciesCollectionXmlParser parser = new SpeciesCollectionXmlParser(new ModelFullIndexed(null));
-			Field field = SpeciesCollectionXmlParser.class.getDeclaredField("helpParser");
-			field.setAccessible(true);
-			try {
-				((AbstractElementXmlParser<?>) field.get(parser)).toXml(null);
-				fail("Exception expected");
-			} catch (NotImplementedException e) {
-
-			}
-			try {
-				((AbstractElementXmlParser<?>) field.get(parser)).parseXmlElement((Node) null);
-				fail("Exception expected");
-			} catch (NotImplementedException e) {
-
-			}
-		} catch (Exception exception) {
-			exception.printStackTrace();
-			throw exception;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+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;
+
+public class SpeciesCollectionXmlParserTest extends CellDesignerTestFunctions {
+	static Logger							 logger											 = Logger.getLogger(SpeciesCollectionXmlParserTest.class);
+	Model											 model											 = new ModelFullIndexed(null);
+	SpeciesCollectionXmlParser parser											 = null;
+
+	String										 testDirectory							 = "testFiles" + System.getProperty("file.separator") + "xmlNodeTestExamples"
+			+ System.getProperty("file.separator");
+
+	String										 testRnaListXmlFile					 = "cd_rna_collection.xml";
+	String										 testGeneListXmlFile				 = "cd_gene_collection.xml";
+	String										 testAntisenseRnaListXmlFile = "cd_antisense_rna_collection.xml";
+	String										 testIncludedListXmlFile		 = "cd_included_species_collection.xml";
+	String										 testProteinListXmlFile			 = "cd_protein_collection.xml";
+	String										 testSbmlListXmlFile				 = "cd_sbml_collection.xml";
+
+	@Before
+	public void setUp() throws Exception {
+		parser = new SpeciesCollectionXmlParser(model);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseXmlRnaCollection() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testRnaListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseXmlRnaCollection(node);
+			assertEquals(2, list.size());
+			assertTrue(list.get(0).getRight() instanceof Rna);
+		} catch (Exception e) {
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlRnaCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/rna_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseXmlRnaCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfRNAs"));
+		} catch (Exception e) {
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlGeneCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/gene_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseXmlGeneCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfGenes"));
+		} catch (Exception e) {
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlAntisenseRnaCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/antisense_rna_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseXmlAntisenseRnaCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfAntisenseRNAs"));
+		} catch (Exception e) {
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidXmlPRoteinCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/protein_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseXmlProteinCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of celldesigner:listOfProteins"));
+		} catch (Exception e) {
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlStringRnaCollection() {
+		try {
+			String xmlString = readFile(testDirectory + testRnaListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseXmlRnaCollection(node);
+			List<Rna> arList = new ArrayList<Rna>();
+			for (Pair<String, ? extends Species> pair : list) {
+				arList.add((Rna) pair.getRight());
+			}
+			String convertedString = parser.rnaCollectionToXmlString(arList);
+			assertNotNull(convertedString);
+			node = getNodeFromXmlString(convertedString);
+			assertEquals("celldesigner:listOfRNAs", node.getNodeName());
+			List<Pair<String, ? extends Species>> list2 = parser.parseXmlRnaCollection(node);
+			assertNotNull(list2);
+			assertEquals(list.size(), list2.size());
+			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
+		} catch (Exception exception) {
+			fail("Unexpected exception occurred");
+		}
+	}
+
+	@Test
+	public void testParseXmlGeneCollection() {
+		try {
+			String xmlString = readFile(testDirectory + testGeneListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseXmlGeneCollection(node);
+			assertEquals(2, list.size());
+			assertTrue(list.get(0).getRight() instanceof Gene);
+		} catch (Exception exception) {
+			fail("Unexpected exception occurred");
+		}
+	}
+
+	@Test
+	public void testToXmlStringGeneCollection() {
+		try {
+			String xmlString = readFile(testDirectory + testGeneListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseXmlGeneCollection(node);
+			List<Gene> arList = new ArrayList<Gene>();
+			for (Pair<String, ? extends Species> pair : list) {
+				arList.add((Gene) pair.getRight());
+			}
+			String convertedString = parser.geneCollectionToXmlString(arList);
+			assertNotNull(convertedString);
+			node = getNodeFromXmlString(convertedString);
+			assertEquals("celldesigner:listOfGenes", node.getNodeName());
+			List<Pair<String, ? extends Species>> list2 = parser.parseXmlGeneCollection(node);
+			assertNotNull(list2);
+			assertEquals(list.size(), list2.size());
+			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
+		} catch (Exception exception) {
+			fail("Unexpected exception occurred");
+		}
+	}
+
+	@Test
+	public void testParseXmlProteinCollection() {
+		try {
+			String xmlString = readFile(testDirectory + testProteinListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseXmlProteinCollection(node);
+			assertEquals(4, list.size());
+			assertTrue(list.get(0).getRight() instanceof Protein);
+		} catch (Exception exception) {
+			fail("Unexpected exception occurred");
+		}
+	}
+
+	@Test
+	public void testToXmlStringProteinCollection() {
+		try {
+			String xmlString = readFile(testDirectory + testProteinListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseXmlProteinCollection(node);
+			List<Protein> arList = new ArrayList<Protein>();
+			for (Pair<String, ? extends Species> pair : list) {
+				arList.add((Protein) pair.getRight());
+			}
+			String convertedString = parser.proteinCollectionToXmlString(arList);
+			assertNotNull(convertedString);
+			node = getNodeFromXmlString(convertedString);
+			assertEquals("celldesigner:listOfProteins", node.getNodeName());
+			List<Pair<String, ? extends Species>> list2 = parser.parseXmlProteinCollection(node);
+			assertNotNull(list2);
+			assertEquals(list.size(), list2.size());
+			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
+		} catch (Exception exception) {
+			fail("Unexpected exception occurred");
+		}
+	}
+
+	@Test
+	public void testParseXmlAntisenseRnaCollection() {
+		try {
+			String xmlString = readFile(testDirectory + testAntisenseRnaListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseXmlAntisenseRnaCollection(node);
+			assertEquals(2, list.size());
+			assertTrue(list.get(0).getRight() instanceof AntisenseRna);
+		} catch (Exception exception) {
+			fail("Unexpected exception occurred");
+		}
+	}
+
+	@Test
+	public void testToXmlStringAntisenseRnaCollection() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testAntisenseRnaListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseXmlAntisenseRnaCollection(node);
+			List<AntisenseRna> arList = new ArrayList<AntisenseRna>();
+			for (Pair<String, ? extends Species> pair : list) {
+				arList.add((AntisenseRna) pair.getRight());
+			}
+			String convertedString = parser.antisenseRnaCollectionToXmlString(arList);
+			assertNotNull(convertedString);
+			node = getNodeFromXmlString(convertedString);
+			assertEquals("celldesigner:listOfAntisenseRNAs", node.getNodeName());
+			List<Pair<String, ? extends Species>> list2 = parser.parseXmlAntisenseRnaCollection(node);
+			assertNotNull(list2);
+			assertEquals(list.size(), list2.size());
+			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseSbmlSpeciesCollection() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testSbmlListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseSbmlSpeciesCollection(node);
+			assertEquals(9, list.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalidSbmlSpeciesCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/sbml_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseSbmlSpeciesCollection(node);
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Unknown element of listOfSpecies"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToSbmlStringSpeciesCollection() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testSbmlListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseSbmlSpeciesCollection(node);
+			Model model = new ModelFullIndexed(null);
+			int x = 0;
+			List<Species> speciesList = new ArrayList<>();
+			for (Pair<String, ? extends Species> el : list) {
+				Species species = el.getRight();
+				species.setModel(model);
+
+				SpeciesAlias alias = SpeciesAlias.createAlias(species);
+				alias.setAliasId("alias" + (x++));
+				model.addAlias(alias);
+				speciesList.add(species);
+			}
+			model.addCompartment(new Compartment("default"));
+			String convertedString = parser.speciesCollectionToSbmlString(speciesList);
+			assertNotNull(convertedString);
+			node = getNodeFromXmlString(convertedString);
+			assertEquals("listOfSpecies", node.getNodeName());
+			List<Pair<String, ? extends Species>> list2 = parser.parseSbmlSpeciesCollection(node);
+			assertNotNull(list2);
+			assertEquals(list.size(), list2.size());
+			assertEquals(list.get(0).getClass().getName(), list2.get(0).getClass().getName());
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testParseIncludedSpeciesCollection() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testIncludedListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseIncludedSpeciesCollection(node);
+			assertEquals(3, list.size());
+			int complexes = 0;
+			int proteins = 0;
+			for (Pair<String, ? extends Species> species : list) {
+				if (species.getRight() instanceof ComplexSpecies)
+					complexes++;
+				if (species.getRight() instanceof Protein)
+					proteins++;
+			}
+			assertEquals(1, complexes);
+			assertEquals(2, proteins);
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testParseInvalidIncludedSpeciesCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseIncludedSpeciesCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue(exception.getMessage().contains("Included species does not contain id"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testParseInvalidIncludedSpeciesCollection2() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection2.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseIncludedSpeciesCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue(exception.getMessage().contains("Unknown element of celldesigner:species"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testParseInvalidIncludedSpeciesCollection3() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection3.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseIncludedSpeciesCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue(exception.getMessage().contains("Included species does not contain annotation node"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testParseInvalidIncludedSpeciesCollection4() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection4.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseIncludedSpeciesCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue(exception.getMessage().contains("No celldesigner:speciesIdentity node in included tag"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testParseInvalidIncludedSpeciesCollection5() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection5.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.parseIncludedSpeciesCollection(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue(exception.getMessage().contains("Unknown element of celldesigner:listOfIncludedSpecies"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testAddInvalidIncludedSpeciesCollection() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.addConnectionBetweenIncludedSpecies(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue(exception.getMessage().contains("Included species does not contain id"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testAddInvalidIncludedSpeciesCollection2() throws Exception {
+		try {
+			ComplexSpecies complex = new ComplexSpecies("s9");
+			model.addElement(complex);
+			String xmlString = readFile("testFiles/invalid/included_species_collection2.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.addConnectionBetweenIncludedSpecies(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue("Invalid message: " + exception.getMessage(), exception.getMessage().contains("Cannot find species with id"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testAddInvalidIncludedSpeciesCollection3() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection3.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.addConnectionBetweenIncludedSpecies(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue(exception.getMessage().contains("Included species does not contain annotation node"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testAddInvalidIncludedSpeciesCollection4() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection4.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.addConnectionBetweenIncludedSpecies(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue("Invalid message: " + exception.getMessage(), exception.getMessage().contains("Cannot find complex with id"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testAddInvalidIncludedSpeciesCollection5() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/included_species_collection5.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.addConnectionBetweenIncludedSpecies(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue(exception.getMessage().contains("Unknown element of celldesigner:listOfIncludedSpecies"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testAddInvalidIncludedSpeciesCollection6() throws Exception {
+		try {
+			ComplexSpecies complex = new ComplexSpecies("s9");
+			model.addElement(complex);
+			complex = new ComplexSpecies("s10");
+			model.addElement(complex);
+			String xmlString = readFile("testFiles/invalid/included_species_collection6.xml");
+			Node node = getNodeFromXmlString(xmlString);
+			parser.addConnectionBetweenIncludedSpecies(node);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException exception) {
+			assertTrue("Invalid message: " + exception.getMessage(), exception.getMessage().contains("No celldesigner:complexSpecies node in included tag"));
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void testToIncludedStringSpeciesCollection() throws Exception {
+		try {
+			ComplexSpecies protein = new ComplexSpecies();
+			protein.setElementId("s9");
+			model.addElement(protein);
+
+			String xmlString = readFile(testDirectory + testIncludedListXmlFile);
+			Node node = getNodeFromXmlString(xmlString);
+			List<Pair<String, ? extends Species>> list = parser.parseIncludedSpeciesCollection(node);
+			for (Pair<String, ? extends Species> species : list) {
+				model.addElement(species.getRight());
+			}
+			parser.addConnectionBetweenIncludedSpecies(node);
+
+			Set<Species> collection = new HashSet<Species>();
+
+			for (Element element : model.getElements()) {
+				if (element instanceof Species) {
+					collection.add((Species) element);
+				}
+			}
+
+			String convertedString = parser.speciesCollectionToXmlIncludedString(collection);
+			assertNotNull(convertedString);
+			List<Pair<String, ? extends Species>> list2 = parser.parseIncludedSpeciesCollection(getNodeFromXmlString(convertedString));
+			assertNotNull(list2);
+			assertEquals(list.size(), list2.size());
+			Map<Class<?>, Integer> counter = new HashMap<Class<?>, Integer>();
+			for (Pair<String, ? extends Species> species : list) {
+				Integer count = counter.get(species.getRight().getClass());
+				if (count == null)
+					count = 0;
+				count++;
+				counter.put(species.getRight().getClass(), count);
+			}
+			Map<Class<?>, Integer> counter2 = new HashMap<Class<?>, Integer>();
+			for (Pair<String, ? extends Species> species : list2) {
+				Integer count = counter2.get(species.getRight().getClass());
+				if (count == null)
+					count = 0;
+				count++;
+				counter2.put(species.getRight().getClass(), count);
+			}
+
+			for (Class<?> clazz : counter2.keySet()) {
+				assertEquals(counter.get(clazz), counter2.get(clazz));
+			}
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+	@Test
+	public void artifitialTest() throws Exception {
+		try {
+			// tests some parts of the code that should never be called and therefore
+			// throw exceptions
+
+			// this is only for test coverage puropse
+
+			SpeciesCollectionXmlParser parser = new SpeciesCollectionXmlParser(new ModelFullIndexed(null));
+			Field field = SpeciesCollectionXmlParser.class.getDeclaredField("helpParser");
+			field.setAccessible(true);
+			try {
+				((AbstractElementXmlParser<?>) field.get(parser)).toXml(null);
+				fail("Exception expected");
+			} catch (NotImplementedException e) {
+
+			}
+			try {
+				((AbstractElementXmlParser<?>) field.get(parser)).parseXmlElement((Node) null);
+				fail("Exception expected");
+			} catch (NotImplementedException e) {
+
+			}
+		} catch (Exception exception) {
+			exception.printStackTrace();
+			throw exception;
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesSbmlParserTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesSbmlParserTest.java
index 0b64cd4c69..9d11dd757f 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesSbmlParserTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesSbmlParserTest.java
@@ -1,1180 +1,1180 @@
-package lcsb.mapviewer.converter.model.celldesigner.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.comparator.StringComparator;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
-import lcsb.mapviewer.converter.model.celldesigner.structure.SpeciesState;
-import lcsb.mapviewer.model.map.InconsistentModelException;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Degraded;
-import lcsb.mapviewer.model.map.species.Drug;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.Ion;
-import lcsb.mapviewer.model.map.species.Phenotype;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.Unknown;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.model.map.species.fields.RnaRegion;
-
-public class SpeciesSbmlParserTest extends CellDesignerTestFunctions {
-	@SuppressWarnings("unused")
-	private Logger		logger								 = Logger.getLogger(SpeciesSbmlParserTest.class.getName());
-
-	SpeciesSbmlParser	parser								 = new SpeciesSbmlParser(new ModelMock());
-
-	String						testDirectory					 = "testFiles" + System.getProperty("file.separator") + "xmlNodeTestExamples" + System.getProperty("file.separator");
-	String						testAntisenseRnaFile	 = "sbml_antisense_rna.xml";
-	String						testGeneFile					 = "sbml_gene.xml";
-	String						testComplexFile				 = "sbml_complex.xml";
-	String						testDegradedFile			 = "sbml_degraded.xml";
-	String						testDrugFile					 = "sbml_drug.xml";
-	String						testIonFile						 = "sbml_ion.xml";
-	String						testPhenotypeFile			 = "sbml_phenotype.xml";
-	String						testProteinFile				 = "sbml_protein.xml";
-	String						testRnaFile						 = "sbml_rna.xml";
-	String						testSimpleMoleculeFile = "sbml_simple_molecule.xml";
-	String						testUnknownFile				 = "sbml_unknown.xml";
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseXmlSpeciesAntisenseRna() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testAntisenseRnaFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			AntisenseRna species = (AntisenseRna) result.getRight();
-			assertEquals("s2", species.getElementId());
-			assertEquals("s3", species.getName());
-			Compartment parentCompartment = (Compartment) species.getParent();
-			assertNotNull(parentCompartment);
-			assertEquals("default", parentCompartment.getElementId());
-			assertEquals(new Integer(2), species.getInitialAmount());
-			assertEquals(Boolean.TRUE, species.hasOnlySubstanceUnits());
-			assertEquals(new Integer(0), species.getCharge());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlAntisenseRna() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testAntisenseRnaFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			AntisenseRna species = (AntisenseRna) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			AntisenseRna species2 = (AntisenseRna) result2.getRight();
-
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-			assertEquals(species.getPositionToCompartment(), species2.getPositionToCompartment());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesComplex() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testComplexFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			ComplexSpecies species = (ComplexSpecies) result.getRight();
-			assertNotNull(species);
-			assertEquals("s6549", species.getElementId());
-			assertEquals("LC3-II", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c1", comp.getElementId());
-			assertEquals(new Integer(0), species.getInitialAmount());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlComplex() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testComplexFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			ComplexSpecies species = (ComplexSpecies) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			ComplexSpecies species2 = (ComplexSpecies) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesDegraded() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testDegradedFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Degraded species = (Degraded) result.getRight();
-			assertNotNull(species);
-			assertEquals("s1275", species.getElementId());
-			assertEquals("s1275", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c20", comp.getElementId());
-			assertEquals(new Integer(0), species.getInitialAmount());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlDegraded() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testDegradedFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Degraded species = (Degraded) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			Degraded species2 = (Degraded) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesDrug() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testDrugFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Drug species = (Drug) result.getRight();
-			assertEquals("s6104", species.getElementId());
-			assertEquals("geldanamycin", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c1", comp.getElementId());
-			assertEquals(new Integer(0), species.getCharge());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlDrug() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testDrugFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Drug species = (Drug) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			Drug species2 = (Drug) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesGene() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testGeneFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Gene species = (Gene) result.getRight();
-
-			assertEquals("s5916", species.getElementId());
-			assertEquals("Ptgr1", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c20", comp.getElementId());
-			assertEquals(new Integer(0), species.getCharge());
-			assertEquals(new Integer(0), species.getInitialAmount());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesGeneWithModelUpdate() throws Exception {
-		try {
-			Species gene = new Gene();
-			gene.setElementId("s5916");
-			InternalModelSpeciesData modelData = new InternalModelSpeciesData();
-			modelData.updateSpecies(gene, "");
-
-			SpeciesSbmlParser complexParser = new SpeciesSbmlParser(new ModelFullIndexed(null));
-			Gene oldGene = new Gene();
-			oldGene.setElementId("s5916");
-			oldGene.setName("Ptgr1");
-			modelData.updateSpecies(oldGene, "gn95");
-
-			String xmlString = readFile(testDirectory + testGeneFile);
-			Pair<String, ? extends Species> result = complexParser.parseXmlElement(xmlString);
-			Gene species = (Gene) result.getRight();
-			modelData.updateSpecies(species, result.getLeft());
-
-			assertEquals("s5916", species.getElementId());
-			assertEquals("Ptgr1", species.getName());
-			assertNotNull(species.getFullName());
-			assertTrue(species.getFullName().contains("prostaglandin reductase 1"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlGene() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testGeneFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Gene species = (Gene) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			Gene species2 = (Gene) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-			assertEquals(species.getNotes().trim(), species2.getNotes().trim());
-			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesIon() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testIonFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Ion species = (Ion) result.getRight();
-
-			assertEquals("s6029", species.getElementId());
-			assertEquals("Pi", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c1", comp.getElementId());
-			assertEquals(new Integer(0), species.getCharge());
-			assertEquals(new Integer(0), species.getInitialConcentration());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlIon() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testIonFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Ion species = (Ion) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(xmlString);
-			Ion species2 = (Ion) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
-			assertEquals(species.getNotes().trim(), species2.getNotes().trim());
-			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesPhenotype() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testPhenotypeFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Phenotype species = (Phenotype) result.getRight();
-
-			assertEquals("s5462", species.getElementId());
-			assertEquals("Neuronal damage and death", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c1", comp.getElementId());
-			assertEquals(new Integer(0), species.getInitialAmount());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlPhenotype() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testPhenotypeFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Phenotype species = (Phenotype) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			Phenotype species2 = (Phenotype) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
-			assertEquals(species.getNotes(), species2.getNotes());
-			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesProtein() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testProteinFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Protein species = (Protein) result.getRight();
-
-			assertEquals("s5456", species.getElementId());
-			assertEquals("PTPRC", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c27", comp.getElementId());
-			assertEquals(new Integer(0), species.getInitialAmount());
-			assertEquals(new Integer(0), species.getCharge());
-			assertTrue(species.getNotes().contains("protein tyrosine phosphatase, receptor type, C"));
-			assertNull(species.getStructuralState());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlProtein() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testProteinFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Protein species = (Protein) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			Protein species2 = (Protein) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
-			StringComparator stringComparator = new StringComparator();
-			assertEquals(0, stringComparator.compare(species.getNotes(), species2.getNotes(), true));
-			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesRna() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testRnaFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Rna species = (Rna) result.getRight();
-
-			assertEquals("s5914", species.getElementId());
-			assertEquals("Fmo3", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c20", comp.getElementId());
-			assertEquals(new Integer(0), species.getInitialAmount());
-			assertEquals(new Integer(0), species.getCharge());
-			assertTrue(species.getNotes().contains("Dimethylaniline monooxygenase [N-oxide-forming] 3"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlRna() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testRnaFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Rna species = (Rna) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			Rna species2 = (Rna) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
-			assertEquals(species.getNotes().trim(), species2.getNotes().trim());
-			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesSimpleMolecule() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testSimpleMoleculeFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			SimpleMolecule species = (SimpleMolecule) result.getRight();
-			assertEquals("s5463", species.getElementId());
-			assertEquals("Peroxides", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c1", comp.getElementId());
-			assertEquals(new Integer(0), species.getInitialAmount());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlSimpleMolecule() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testSimpleMoleculeFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			SimpleMolecule species = (SimpleMolecule) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			SimpleMolecule species2 = (SimpleMolecule) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
-			assertEquals(species.getNotes(), species2.getNotes());
-			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlSpeciesUnknown() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testUnknownFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Unknown species = (Unknown) result.getRight();
-			assertEquals("s1356", species.getElementId());
-			assertEquals("unidentified caspase acting on Occludin", species.getName());
-			Compartment comp = (Compartment) species.getParent();
-			assertEquals("c1", comp.getElementId());
-			assertEquals(new Integer(0), species.getInitialAmount());
-			assertEquals(new Integer(0), species.getCharge());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlUnknown() throws Exception {
-		try {
-			String xmlString = readFile(testDirectory + testUnknownFile);
-			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
-			Unknown species = (Unknown) result.getRight();
-
-			String transformedXml = parser.toXml(species);
-			assertNotNull(transformedXml);
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			InputSource is = new InputSource(new StringReader(transformedXml));
-			Document doc = builder.parse(is);
-			NodeList root = doc.getChildNodes();
-			assertEquals("species", root.item(0).getNodeName());
-
-			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
-			Unknown species2 = (Unknown) result2.getRight();
-
-			assertNotNull(species2);
-			assertEquals(species.getElementId(), species2.getElementId());
-			assertEquals(species.getName(), species2.getName());
-			assertEquals(species.getParent(), species2.getParent());
-			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
-			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
-			assertEquals(species.getCharge(), species2.getCharge());
-			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
-			assertEquals(species.getNotes(), species2.getNotes());
-			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseXmlProteinWithMissingState() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setAliasId("tmp");
-			Species gene = new Protein();
-			gene.setElementId("s2596");
-			alias.setSpecies(gene);
-
-			model.addAlias(alias);
-
-			SpeciesSbmlParser complexParser = new SpeciesSbmlParser(model);
-
-			String xmlString = readFile("testFiles/problematic/protein_missing_structural_state.xml");
-			Pair<String, ? extends Species> result = complexParser.parseXmlElement(xmlString);
-			Protein species = (Protein) result.getRight();
-			model.addElement(species);
-
-			assertEquals("test", species.getStructuralState());
-
-			Protein sp2 = (Protein) model.getSpeciesBySpeciesId(species.getElementId());
-			assertNotNull(sp2);
-			assertEquals("test", sp2.getStructuralState());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("No annotation node"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid2() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein2.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("bla"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid3() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein3.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("unk_bla"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid4() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein4.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("No celldesigner:extension"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid5() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein5.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("ann_unk"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid6() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein6.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("No celldesigner:speciesIdentity"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid7() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein7.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("unkPos"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid8() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein8.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Species node in Sbml model doesn't contain"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid9() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein9.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("unknown_protein_class"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid10() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein10.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Wrong class type for protein reference"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid11() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein11.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Wrong class type for gene reference"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid12() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein12.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Wrong class type for rna reference"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid13() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein13.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("Wrong class type for antisense rna reference"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseInvalid14() throws Exception {
-		try {
-			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein14.xml");
-			parser.parseXmlElement(xmlString);
-			fail("Exception expected");
-		} catch (InvalidXmlSchemaException e) {
-			assertTrue(e.getMessage().contains("uknNode"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlWithInvalidModel() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Species species = new Protein();
-			species.setModel(model);
-			parser.toXml(species);
-			fail("Excepiton expected");
-		} catch (InconsistentModelException e) {
-			assertTrue(e.getMessage().contains("Default compartment doesn't exist"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXmlWithDefaultCompartment() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Compartment compartment = new Compartment();
-			compartment.setElementId("default");
-			model.addElement(compartment);
-
-			Species species = new Protein();
-			species.setElementId("EL_ID");
-			species.setModel(model);
-			String xml = parser.toXml(species);
-			assertTrue(xml.contains("EL_ID"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidSpeciesIdentityToXml() throws Exception {
-		try {
-			Species species = new Species() {
-				private static final long serialVersionUID = 1L;
-			};
-			parser.speciesIdentityToXml(species);
-			fail("Excepiton expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Invalid species class"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSpeciesIdentityToXml() throws Exception {
-		try {
-			Species species = new Protein();
-			species.setHypothetical(true);
-			String xml = parser.speciesIdentityToXml(species);
-			assertTrue(xml.contains("<celldesigner:hypothetical>true</celldesigner:hypothetical>"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSpeciesStateToXml() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.setHomodimer(2);
-			state.setStructuralState("xxxState");
-			String xml = parser.speciesStateToXml(state);
-			assertTrue(xml.contains("xxxState"));
-			assertTrue(xml.contains("celldesigner:homodimer"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessInvalidStateDataInSpecies() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.addModificationResidue(new ModificationResidue());
-			Species species = new ComplexSpecies();
-
-			parser.processStateDataInSpecies(species, state);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Modification not supported in Complex"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessInvalidStateDataInSpecies2() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.setStructuralState("state");
-			Species species = new Gene();
-
-			parser.processStateDataInSpecies(species, state);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("StructuralState not supported in Gene"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessInvalidStateDataInSpecies3() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.setStructuralState("state");
-			Species species = new Rna();
-
-			parser.processStateDataInSpecies(species, state);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Structural state not supported in RNA"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessInvalidStateDataInSpecies4() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.addModificationResidue(new ModificationResidue());
-			Species species = new SimpleMolecule();
-
-			parser.processStateDataInSpecies(species, state);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Modification not supported in SimpleMolecule"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessInvalidStateDataInSpecies5() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.setStructuralState("state");
-			Species species = new SimpleMolecule();
-
-			parser.processStateDataInSpecies(species, state);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Structural state not supported in SimpleMolecule"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessInvalidStateDataInSpecies6() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.setStructuralState("state");
-			Species species = new AntisenseRna();
-
-			parser.processStateDataInSpecies(species, state);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Structural state not supported in AntisenseRna"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessInvalidStateDataInSpecies7() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.setStructuralState("state");
-			Species species = new Species();
-
-			parser.processStateDataInSpecies(species, state);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Structural state not supported"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessInvalidStateDataInSpecies8() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.addModificationResidue(new ModificationResidue());
-			Species species = new Species();
-
-			parser.processStateDataInSpecies(species, state);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-			assertTrue(e.getMessage().contains("Modification not supported in"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProcessAntisenseRnaStateDataInSpecies() throws Exception {
-		try {
-			SpeciesState state = new SpeciesState();
-			state.addModificationResidue(new ModificationResidue());
-			AntisenseRna species = new AntisenseRna();
-
-			parser.processStateDataInSpecies(species, state);
-			
-			assertEquals(1, species.getRegions().size());
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateRnaRegion() throws Exception {
-		try {
-			ModificationResidue mr = new ModificationResidue();
-			mr.setSize(1.0);
-			mr.setAngle(1.0);
-			
-			RnaRegion region = parser.createRnaRegion(mr);
-			assertNotNull(region.getPos());
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateAntisenseRnaRegion() throws Exception {
-		try {
-			ModificationResidue mr = new ModificationResidue();
-			mr.setSize(1.0);
-			mr.setAngle(1.0);
-			
-			AntisenseRnaRegion region = parser.createAntisenseRnaRegion(mr);
-			assertNotNull(region.getPos());
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.comparator.StringComparator;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerTestFunctions;
+import lcsb.mapviewer.converter.model.celldesigner.structure.SpeciesState;
+import lcsb.mapviewer.model.map.InconsistentModelException;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Degraded;
+import lcsb.mapviewer.model.map.species.Drug;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Ion;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.Unknown;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.model.map.species.fields.RnaRegion;
+
+public class SpeciesSbmlParserTest extends CellDesignerTestFunctions {
+	@SuppressWarnings("unused")
+	private Logger		logger								 = Logger.getLogger(SpeciesSbmlParserTest.class.getName());
+
+	SpeciesSbmlParser	parser								 = new SpeciesSbmlParser(new ModelMock());
+
+	String						testDirectory					 = "testFiles" + System.getProperty("file.separator") + "xmlNodeTestExamples" + System.getProperty("file.separator");
+	String						testAntisenseRnaFile	 = "sbml_antisense_rna.xml";
+	String						testGeneFile					 = "sbml_gene.xml";
+	String						testComplexFile				 = "sbml_complex.xml";
+	String						testDegradedFile			 = "sbml_degraded.xml";
+	String						testDrugFile					 = "sbml_drug.xml";
+	String						testIonFile						 = "sbml_ion.xml";
+	String						testPhenotypeFile			 = "sbml_phenotype.xml";
+	String						testProteinFile				 = "sbml_protein.xml";
+	String						testRnaFile						 = "sbml_rna.xml";
+	String						testSimpleMoleculeFile = "sbml_simple_molecule.xml";
+	String						testUnknownFile				 = "sbml_unknown.xml";
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseXmlSpeciesAntisenseRna() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testAntisenseRnaFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			AntisenseRna species = (AntisenseRna) result.getRight();
+			assertEquals("s2", species.getElementId());
+			assertEquals("s3", species.getName());
+			Compartment parentCompartment = (Compartment) species.getParent();
+			assertNotNull(parentCompartment);
+			assertEquals("default", parentCompartment.getElementId());
+			assertEquals(new Integer(2), species.getInitialAmount());
+			assertEquals(Boolean.TRUE, species.hasOnlySubstanceUnits());
+			assertEquals(new Integer(0), species.getCharge());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlAntisenseRna() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testAntisenseRnaFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			AntisenseRna species = (AntisenseRna) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			AntisenseRna species2 = (AntisenseRna) result2.getRight();
+
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+			assertEquals(species.getPositionToCompartment(), species2.getPositionToCompartment());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesComplex() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testComplexFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			ComplexSpecies species = (ComplexSpecies) result.getRight();
+			assertNotNull(species);
+			assertEquals("s6549", species.getElementId());
+			assertEquals("LC3-II", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c1", comp.getElementId());
+			assertEquals(new Integer(0), species.getInitialAmount());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlComplex() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testComplexFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			ComplexSpecies species = (ComplexSpecies) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			ComplexSpecies species2 = (ComplexSpecies) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesDegraded() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testDegradedFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Degraded species = (Degraded) result.getRight();
+			assertNotNull(species);
+			assertEquals("s1275", species.getElementId());
+			assertEquals("s1275", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c20", comp.getElementId());
+			assertEquals(new Integer(0), species.getInitialAmount());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlDegraded() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testDegradedFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Degraded species = (Degraded) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			Degraded species2 = (Degraded) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesDrug() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testDrugFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Drug species = (Drug) result.getRight();
+			assertEquals("s6104", species.getElementId());
+			assertEquals("geldanamycin", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c1", comp.getElementId());
+			assertEquals(new Integer(0), species.getCharge());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlDrug() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testDrugFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Drug species = (Drug) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			Drug species2 = (Drug) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesGene() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testGeneFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Gene species = (Gene) result.getRight();
+
+			assertEquals("s5916", species.getElementId());
+			assertEquals("Ptgr1", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c20", comp.getElementId());
+			assertEquals(new Integer(0), species.getCharge());
+			assertEquals(new Integer(0), species.getInitialAmount());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesGeneWithModelUpdate() throws Exception {
+		try {
+			Species gene = new Gene();
+			gene.setElementId("s5916");
+			InternalModelSpeciesData modelData = new InternalModelSpeciesData();
+			modelData.updateSpecies(gene, "");
+
+			SpeciesSbmlParser complexParser = new SpeciesSbmlParser(new ModelFullIndexed(null));
+			Gene oldGene = new Gene();
+			oldGene.setElementId("s5916");
+			oldGene.setName("Ptgr1");
+			modelData.updateSpecies(oldGene, "gn95");
+
+			String xmlString = readFile(testDirectory + testGeneFile);
+			Pair<String, ? extends Species> result = complexParser.parseXmlElement(xmlString);
+			Gene species = (Gene) result.getRight();
+			modelData.updateSpecies(species, result.getLeft());
+
+			assertEquals("s5916", species.getElementId());
+			assertEquals("Ptgr1", species.getName());
+			assertNotNull(species.getFullName());
+			assertTrue(species.getFullName().contains("prostaglandin reductase 1"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlGene() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testGeneFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Gene species = (Gene) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			Gene species2 = (Gene) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+			assertEquals(species.getNotes().trim(), species2.getNotes().trim());
+			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesIon() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testIonFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Ion species = (Ion) result.getRight();
+
+			assertEquals("s6029", species.getElementId());
+			assertEquals("Pi", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c1", comp.getElementId());
+			assertEquals(new Integer(0), species.getCharge());
+			assertEquals(new Integer(0), species.getInitialConcentration());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlIon() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testIonFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Ion species = (Ion) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(xmlString);
+			Ion species2 = (Ion) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
+			assertEquals(species.getNotes().trim(), species2.getNotes().trim());
+			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesPhenotype() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testPhenotypeFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Phenotype species = (Phenotype) result.getRight();
+
+			assertEquals("s5462", species.getElementId());
+			assertEquals("Neuronal damage and death", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c1", comp.getElementId());
+			assertEquals(new Integer(0), species.getInitialAmount());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlPhenotype() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testPhenotypeFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Phenotype species = (Phenotype) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			Phenotype species2 = (Phenotype) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
+			assertEquals(species.getNotes(), species2.getNotes());
+			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesProtein() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testProteinFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Protein species = (Protein) result.getRight();
+
+			assertEquals("s5456", species.getElementId());
+			assertEquals("PTPRC", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c27", comp.getElementId());
+			assertEquals(new Integer(0), species.getInitialAmount());
+			assertEquals(new Integer(0), species.getCharge());
+			assertTrue(species.getNotes().contains("protein tyrosine phosphatase, receptor type, C"));
+			assertNull(species.getStructuralState());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlProtein() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testProteinFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Protein species = (Protein) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			Protein species2 = (Protein) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
+			StringComparator stringComparator = new StringComparator();
+			assertEquals(0, stringComparator.compare(species.getNotes(), species2.getNotes(), true));
+			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesRna() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testRnaFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Rna species = (Rna) result.getRight();
+
+			assertEquals("s5914", species.getElementId());
+			assertEquals("Fmo3", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c20", comp.getElementId());
+			assertEquals(new Integer(0), species.getInitialAmount());
+			assertEquals(new Integer(0), species.getCharge());
+			assertTrue(species.getNotes().contains("Dimethylaniline monooxygenase [N-oxide-forming] 3"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlRna() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testRnaFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Rna species = (Rna) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			Rna species2 = (Rna) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
+			assertEquals(species.getNotes().trim(), species2.getNotes().trim());
+			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesSimpleMolecule() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testSimpleMoleculeFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			SimpleMolecule species = (SimpleMolecule) result.getRight();
+			assertEquals("s5463", species.getElementId());
+			assertEquals("Peroxides", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c1", comp.getElementId());
+			assertEquals(new Integer(0), species.getInitialAmount());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlSimpleMolecule() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testSimpleMoleculeFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			SimpleMolecule species = (SimpleMolecule) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			SimpleMolecule species2 = (SimpleMolecule) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
+			assertEquals(species.getNotes(), species2.getNotes());
+			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlSpeciesUnknown() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testUnknownFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Unknown species = (Unknown) result.getRight();
+			assertEquals("s1356", species.getElementId());
+			assertEquals("unidentified caspase acting on Occludin", species.getName());
+			Compartment comp = (Compartment) species.getParent();
+			assertEquals("c1", comp.getElementId());
+			assertEquals(new Integer(0), species.getInitialAmount());
+			assertEquals(new Integer(0), species.getCharge());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlUnknown() throws Exception {
+		try {
+			String xmlString = readFile(testDirectory + testUnknownFile);
+			Pair<String, ? extends Species> result = parser.parseXmlElement(xmlString);
+			Unknown species = (Unknown) result.getRight();
+
+			String transformedXml = parser.toXml(species);
+			assertNotNull(transformedXml);
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			InputSource is = new InputSource(new StringReader(transformedXml));
+			Document doc = builder.parse(is);
+			NodeList root = doc.getChildNodes();
+			assertEquals("species", root.item(0).getNodeName());
+
+			Pair<String, ? extends Species> result2 = parser.parseXmlElement(parser.toXml(species));
+			Unknown species2 = (Unknown) result2.getRight();
+
+			assertNotNull(species2);
+			assertEquals(species.getElementId(), species2.getElementId());
+			assertEquals(species.getName(), species2.getName());
+			assertEquals(species.getParent(), species2.getParent());
+			assertEquals(species.getInitialAmount(), species2.getInitialAmount());
+			assertEquals(species.hasOnlySubstanceUnits(), species2.hasOnlySubstanceUnits());
+			assertEquals(species.getCharge(), species2.getCharge());
+			assertEquals(species.getInitialConcentration(), species2.getInitialConcentration());
+			assertEquals(species.getNotes(), species2.getNotes());
+			assertEquals(species.getMiriamData().size(), species2.getMiriamData().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseXmlProteinWithMissingState() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			GenericProtein gene = new GenericProtein();
+			gene.setElementId("s2596");
+			SpeciesAlias alias = new GenericProteinAlias("tmp", gene);
+
+			model.addAlias(alias);
+
+			SpeciesSbmlParser complexParser = new SpeciesSbmlParser(model);
+
+			String xmlString = readFile("testFiles/problematic/protein_missing_structural_state.xml");
+			Pair<String, ? extends Species> result = complexParser.parseXmlElement(xmlString);
+			Protein species = (Protein) result.getRight();
+			model.addElement(species);
+
+			assertEquals("test", species.getStructuralState());
+
+			Protein sp2 = (Protein) model.getSpeciesBySpeciesId(species.getElementId());
+			assertNotNull(sp2);
+			assertEquals("test", sp2.getStructuralState());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("No annotation node"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid2() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein2.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("bla"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid3() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein3.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("unk_bla"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid4() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein4.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("No celldesigner:extension"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid5() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein5.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("ann_unk"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid6() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein6.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("No celldesigner:speciesIdentity"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid7() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein7.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("unkPos"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid8() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein8.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Species node in Sbml model doesn't contain"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid9() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein9.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("unknown_protein_class"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid10() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein10.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Wrong class type for protein reference"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid11() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein11.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Wrong class type for gene reference"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid12() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein12.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Wrong class type for rna reference"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid13() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein13.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("Wrong class type for antisense rna reference"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseInvalid14() throws Exception {
+		try {
+			String xmlString = readFile("testFiles/invalid/invalid_sbml_protein14.xml");
+			parser.parseXmlElement(xmlString);
+			fail("Exception expected");
+		} catch (InvalidXmlSchemaException e) {
+			assertTrue(e.getMessage().contains("uknNode"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlWithInvalidModel() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Species species = new GenericProtein();
+			species.setModel(model);
+			parser.toXml(species);
+			fail("Excepiton expected");
+		} catch (InconsistentModelException e) {
+			assertTrue(e.getMessage().contains("Default compartment doesn't exist"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXmlWithDefaultCompartment() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Compartment compartment = new Compartment();
+			compartment.setElementId("default");
+			model.addElement(compartment);
+
+			Species species = new GenericProtein();
+			species.setElementId("EL_ID");
+			species.setModel(model);
+			String xml = parser.toXml(species);
+			assertTrue(xml.contains("EL_ID"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidSpeciesIdentityToXml() throws Exception {
+		try {
+			Species species = new Species() {
+				private static final long serialVersionUID = 1L;
+			};
+			parser.speciesIdentityToXml(species);
+			fail("Excepiton expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Invalid species class"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSpeciesIdentityToXml() throws Exception {
+		try {
+			Species species = new GenericProtein();
+			species.setHypothetical(true);
+			String xml = parser.speciesIdentityToXml(species);
+			assertTrue(xml.contains("<celldesigner:hypothetical>true</celldesigner:hypothetical>"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSpeciesStateToXml() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.setHomodimer(2);
+			state.setStructuralState("xxxState");
+			String xml = parser.speciesStateToXml(state);
+			assertTrue(xml.contains("xxxState"));
+			assertTrue(xml.contains("celldesigner:homodimer"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessInvalidStateDataInSpecies() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.addModificationResidue(new ModificationResidue());
+			Species species = new ComplexSpecies();
+
+			parser.processStateDataInSpecies(species, state);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Modification not supported in Complex"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessInvalidStateDataInSpecies2() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.setStructuralState("state");
+			Species species = new Gene();
+
+			parser.processStateDataInSpecies(species, state);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("StructuralState not supported in Gene"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessInvalidStateDataInSpecies3() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.setStructuralState("state");
+			Species species = new Rna();
+
+			parser.processStateDataInSpecies(species, state);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Structural state not supported in RNA"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessInvalidStateDataInSpecies4() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.addModificationResidue(new ModificationResidue());
+			Species species = new SimpleMolecule();
+
+			parser.processStateDataInSpecies(species, state);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Modification not supported in SimpleMolecule"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessInvalidStateDataInSpecies5() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.setStructuralState("state");
+			Species species = new SimpleMolecule();
+
+			parser.processStateDataInSpecies(species, state);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Structural state not supported in SimpleMolecule"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessInvalidStateDataInSpecies6() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.setStructuralState("state");
+			Species species = new AntisenseRna();
+
+			parser.processStateDataInSpecies(species, state);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Structural state not supported in AntisenseRna"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessInvalidStateDataInSpecies7() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.setStructuralState("state");
+			Species species = new Species();
+
+			parser.processStateDataInSpecies(species, state);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Structural state not supported"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessInvalidStateDataInSpecies8() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.addModificationResidue(new ModificationResidue());
+			Species species = new Species();
+
+			parser.processStateDataInSpecies(species, state);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+			assertTrue(e.getMessage().contains("Modification not supported in"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProcessAntisenseRnaStateDataInSpecies() throws Exception {
+		try {
+			SpeciesState state = new SpeciesState();
+			state.addModificationResidue(new ModificationResidue());
+			AntisenseRna species = new AntisenseRna();
+
+			parser.processStateDataInSpecies(species, state);
+
+			assertEquals(1, species.getRegions().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCreateRnaRegion() throws Exception {
+		try {
+			ModificationResidue mr = new ModificationResidue();
+			mr.setSize(1.0);
+			mr.setAngle(1.0);
+
+			RnaRegion region = parser.createRnaRegion(mr);
+			assertNotNull(region.getPos());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCreateAntisenseRnaRegion() throws Exception {
+		try {
+			ModificationResidue mr = new ModificationResidue();
+			mr.setSize(1.0);
+			mr.setAngle(1.0);
+
+			AntisenseRnaRegion region = parser.createAntisenseRnaRegion(mr);
+			assertNotNull(region.getPos());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/types/ModifierTypeUtilsTest.java b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/types/ModifierTypeUtilsTest.java
index 30697dfa41..be27a12b47 100644
--- a/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/types/ModifierTypeUtilsTest.java
+++ b/converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/types/ModifierTypeUtilsTest.java
@@ -1,265 +1,268 @@
-package lcsb.mapviewer.converter.model.celldesigner.types;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.geom.Point2D;
-import java.lang.reflect.Field;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.reaction.AndOperator;
-import lcsb.mapviewer.model.map.reaction.Modifier;
-import lcsb.mapviewer.model.map.reaction.NodeOperator;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ModifierTypeUtilsTest {
-
-	ModifierTypeUtils	utils						= new ModifierTypeUtils();
-
-	Modifier					invalidModifier	= new Modifier() {
-																			private static final long serialVersionUID = 1L;
-																		};
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetInvalidModifierTypeForClazz() {
-		ModifierType type = utils.getModifierTypeForClazz(invalidModifier.getClass());
-		assertNull(type);
-	}
-
-	@Test
-	public void testGetInvalidStringTypeByModifier() {
-		String type = utils.getStringTypeByModifier(invalidModifier);
-		assertNull(type);
-	}
-
-	@Test
-	public void testGetTargetLineIndexByInvalidModifier() {
-		try {
-			utils.getTargetLineIndexByModifier(invalidModifier);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown modifier class"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testCreateInvalidModifierForStringType() {
-		try {
-			utils.createModifierForStringType("unk type", new SpeciesAlias(), new Species());
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("unk type"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetTargetLineIndexByInvalidModifier2() {
-		try {
-			NodeOperator operator = new AndOperator();
-			operator.addInput(new Reactant());
-			utils.getTargetLineIndexByModifier(operator);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Invalid NodeOperator"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetTargetLineIndexByInvalidModifier3() {
-		try {
-			NodeOperator operator = new AndOperator();
-			operator.addInput(invalidModifier);
-			utils.getTargetLineIndexByModifier(operator);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown modifier class"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAnchorPointOnReactionRectByInvalidType() {
-		try {
-			Reaction reaction = new Reaction();
-			Reactant reactant = new Reactant();
-			Product product = new Product();
-			reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
-			product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
-			reaction.addReactant(reactant);
-			reaction.addProduct(product);
-			Point2D point = utils.getAnchorPointOnReactionRect(reaction, "0,0");
-			assertNotNull(point);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAnchorPointOnReactionRectByInvalidType2() {
-		try {
-			Reaction reaction = new Reaction();
-			Reactant reactant = new Reactant();
-			Product product = new Product();
-			reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
-			product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
-			reaction.addReactant(reactant);
-			reaction.addProduct(product);
-			utils.getAnchorPointOnReactionRect(reaction, "0");
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Invalid targetLineIndex"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAnchorPointOnReactionRectByInvalidType3() {
-		try {
-			Reaction reaction = new Reaction();
-			Reactant reactant = new Reactant();
-			Product product = new Product();
-			reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
-			product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
-			reaction.addReactant(reactant);
-			reaction.addProduct(product);
-			utils.getAnchorPointOnReactionRect(reaction, "10,10");
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown targetLineIndex"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdateLineEndPointForInvalidModifier() {
-		try {
-			utils.updateLineEndPoint(invalidModifier);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown modifier class"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdateLineEndPointForInvalidModifier2() {
-		try {
-			NodeOperator operator = new AndOperator();
-			operator.addInput(new Product());
-			operator.addInput(invalidModifier);
-			utils.updateLineEndPoint(operator);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Unknown modifier class"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdateLineEndPointForInvalidModifier3() {
-		try {
-			NodeOperator operator = new AndOperator();
-			operator.addInput(new Product());
-			operator.addInput(new Product());
-			utils.updateLineEndPoint(operator);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-			assertTrue(e.getMessage().contains("Operator contains invalid input"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testCreateInvalidModifierForStringType2() throws Exception {
-		// artificial implementation of Modifier that is invalid
-		class InvalidModifier extends Modifier {
-			private static final long serialVersionUID = 1L;
-
-			@SuppressWarnings("unused")
-			public InvalidModifier() {
-				throw new NotImplementedException();
-			}
-			@SuppressWarnings("unused")
-			public InvalidModifier(SpeciesAlias alias, Element element) {
-				throw new NotImplementedException();
-			}
-		}
-
-		// mopdify one of the elements of OperatorType so it will have invalid
-		// implementation
-		ModifierType typeToModify = ModifierType.CATALYSIS;
-		Class<? extends Modifier> clazz = typeToModify.getClazz();
-
-		try {
-			Field field = typeToModify.getClass().getDeclaredField("clazz");
-			field.setAccessible(true);
-			field.set(typeToModify, InvalidModifier.class);
-
-			// and check if we catch properly information about problematic
-			// implementation
-			utils.createModifierForStringType(typeToModify.getStringName(), new SpeciesAlias(), new Species());
-			fail("Exceptione expected");
-		} catch (InvalidStateException e) {
-			assertTrue(e.getMessage().contains("Problem with instantiation of Modifier class"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			// restore correct values for the modified type (if not then other test
-			// might fail...)
-			Field field = typeToModify.getClass().getDeclaredField("clazz");
-			field.setAccessible(true);
-			field.set(typeToModify, clazz);
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.model.celldesigner.types;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.geom.Point2D;
+import java.lang.reflect.Field;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.reaction.AndOperator;
+import lcsb.mapviewer.model.map.reaction.Modifier;
+import lcsb.mapviewer.model.map.reaction.NodeOperator;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class ModifierTypeUtilsTest {
+
+	ModifierTypeUtils	utils						= new ModifierTypeUtils();
+
+	Modifier					invalidModifier	= new Modifier() {
+																			private static final long serialVersionUID = 1L;
+																		};
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetInvalidModifierTypeForClazz() {
+		ModifierType type = utils.getModifierTypeForClazz(invalidModifier.getClass());
+		assertNull(type);
+	}
+
+	@Test
+	public void testGetInvalidStringTypeByModifier() {
+		String type = utils.getStringTypeByModifier(invalidModifier);
+		assertNull(type);
+	}
+
+	@Test
+	public void testGetTargetLineIndexByInvalidModifier() {
+		try {
+			utils.getTargetLineIndexByModifier(invalidModifier);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unknown modifier class"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testCreateInvalidModifierForStringType() {
+		try {
+			utils.createModifierForStringType("unk type", new GenericProteinAlias(null, null), new Species());
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("unk type"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetTargetLineIndexByInvalidModifier2() {
+		try {
+			NodeOperator operator = new AndOperator();
+			operator.addInput(new Reactant());
+			utils.getTargetLineIndexByModifier(operator);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Invalid NodeOperator"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetTargetLineIndexByInvalidModifier3() {
+		try {
+			NodeOperator operator = new AndOperator();
+			operator.addInput(invalidModifier);
+			utils.getTargetLineIndexByModifier(operator);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unknown modifier class"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAnchorPointOnReactionRectByInvalidType() {
+		try {
+			Reaction reaction = new Reaction();
+			Reactant reactant = new Reactant();
+			Product product = new Product();
+			reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
+			product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
+			reaction.addReactant(reactant);
+			reaction.addProduct(product);
+			Point2D point = utils.getAnchorPointOnReactionRect(reaction, "0,0");
+			assertNotNull(point);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAnchorPointOnReactionRectByInvalidType2() {
+		try {
+			Reaction reaction = new Reaction();
+			Reactant reactant = new Reactant();
+			Product product = new Product();
+			reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
+			product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
+			reaction.addReactant(reactant);
+			reaction.addProduct(product);
+			utils.getAnchorPointOnReactionRect(reaction, "0");
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Invalid targetLineIndex"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAnchorPointOnReactionRectByInvalidType3() {
+		try {
+			Reaction reaction = new Reaction();
+			Reactant reactant = new Reactant();
+			Product product = new Product();
+			reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
+			product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
+			reaction.addReactant(reactant);
+			reaction.addProduct(product);
+			utils.getAnchorPointOnReactionRect(reaction, "10,10");
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unknown targetLineIndex"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdateLineEndPointForInvalidModifier() {
+		try {
+			utils.updateLineEndPoint(invalidModifier);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unknown modifier class"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdateLineEndPointForInvalidModifier2() {
+		try {
+			NodeOperator operator = new AndOperator();
+			operator.addInput(new Product());
+			operator.addInput(invalidModifier);
+			utils.updateLineEndPoint(operator);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Unknown modifier class"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdateLineEndPointForInvalidModifier3() {
+		try {
+			NodeOperator operator = new AndOperator();
+			operator.addInput(new Product());
+			operator.addInput(new Product());
+			utils.updateLineEndPoint(operator);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+			assertTrue(e.getMessage().contains("Operator contains invalid input"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCreateInvalidModifierForStringType2() throws Exception {
+		// artificial implementation of Modifier that is invalid
+		class InvalidModifier extends Modifier {
+			private static final long serialVersionUID = 1L;
+
+			@SuppressWarnings("unused")
+			public InvalidModifier() {
+				throw new NotImplementedException();
+			}
+
+			@SuppressWarnings("unused")
+			public InvalidModifier(SpeciesAlias alias, Element element) {
+				throw new NotImplementedException();
+			}
+		}
+
+		// mopdify one of the elements of OperatorType so it will have invalid
+		// implementation
+		ModifierType typeToModify = ModifierType.CATALYSIS;
+		Class<? extends Modifier> clazz = typeToModify.getClazz();
+
+		try {
+			Field field = typeToModify.getClass().getDeclaredField("clazz");
+			field.setAccessible(true);
+			field.set(typeToModify, InvalidModifier.class);
+
+			// and check if we catch properly information about problematic
+			// implementation
+			utils.createModifierForStringType(typeToModify.getStringName(), new GenericProteinAlias(null, null), new Species());
+			fail("Exceptione expected");
+		} catch (InvalidStateException e) {
+			assertTrue(e.getMessage().contains("Problem with instantiation of Modifier class"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			// restore correct values for the modified type (if not then other test
+			// might fail...)
+			Field field = typeToModify.getClass().getDeclaredField("clazz");
+			field.setAccessible(true);
+			field.set(typeToModify, clazz);
+		}
+	}
+
+}
diff --git a/converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlParser.java b/converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlParser.java
index f0dfb2ecc0..46cc03c814 100644
--- a/converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlParser.java
+++ b/converter-SBGNML/src/main/java/lcsb/mapviewer/converter/model/sbgnml/SbgnmlXmlParser.java
@@ -1,1557 +1,1552 @@
-package lcsb.mapviewer.converter.model.sbgnml;
-
-import java.awt.Color;
-import java.awt.geom.Line2D;
-import java.awt.geom.Point2D;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.log4j.Logger;
-import org.sbgn.ArcClazz;
-import org.sbgn.GlyphClazz;
-import org.sbgn.SbgnUtil;
-import org.sbgn.bindings.Arc;
-import org.sbgn.bindings.Arc.End;
-import org.sbgn.bindings.Arc.Next;
-import org.sbgn.bindings.Arc.Start;
-import org.sbgn.bindings.Bbox;
-import org.sbgn.bindings.Glyph;
-import org.sbgn.bindings.Map;
-import org.sbgn.bindings.Port;
-import org.sbgn.bindings.Sbgn;
-
-import lcsb.mapviewer.common.comparator.DoubleComparator;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.converter.ConverterParams;
-import lcsb.mapviewer.converter.InvalidInputDataExecption;
-import lcsb.mapviewer.converter.graphics.species.SpeciesConverter;
-import lcsb.mapviewer.converter.model.celldesigner.types.ModifierType;
-import lcsb.mapviewer.converter.model.celldesigner.types.ModifierTypeUtils;
-import lcsb.mapviewer.converter.model.sbgnml.structures.Process;
-import lcsb.mapviewer.model.graphics.ArrowType;
-import lcsb.mapviewer.model.graphics.ArrowTypeData;
-import lcsb.mapviewer.model.graphics.LineType;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.alias.SquareCompartmentAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.modifier.Catalysis;
-import lcsb.mapviewer.model.map.modifier.Inhibition;
-import lcsb.mapviewer.model.map.modifier.Modulation;
-import lcsb.mapviewer.model.map.modifier.PhysicalStimulation;
-import lcsb.mapviewer.model.map.modifier.Trigger;
-import lcsb.mapviewer.model.map.reaction.AndOperator;
-import lcsb.mapviewer.model.map.reaction.Modifier;
-import lcsb.mapviewer.model.map.reaction.NodeOperator;
-import lcsb.mapviewer.model.map.reaction.OrOperator;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.SplitOperator;
-import lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction;
-import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
-import lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction;
-import lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction;
-import lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction;
-import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
-import lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Degraded;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Phenotype;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.Unknown;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-
-/**
- * This class is a parser for SBGN-ML files.
- * 
- * @author Michał Kuźma
- *
- */
-public class SbgnmlXmlParser {
-
-	/**
-	 * Default class logger.
-	 */
-	private Logger							logger											= Logger.getLogger(SbgnmlXmlParser.class.getName());
-
-	/**
-	 * List of all processes to be parsed.
-	 */
-	private List<Process>				processes										= new ArrayList<Process>();
-
-	/**
-	 * List of all logic operator glyphs parsed so far.
-	 */
-	private List<Glyph>					logicOperators							= new ArrayList<Glyph>();
-
-	/**
-	 * List of all logic arcs parsed so far.
-	 */
-	private List<Arc>						logicArcs										= new ArrayList<Arc>();
-
-	/**
-	 * Default margin for container name.
-	 */
-	private static final double	CONTAINER_NAME_MARGIN				= 5.0;
-
-	/**
-	 * Part of height of the line used to cross degraded circle that goes behind
-	 * this circle.
-	 */
-	private static final int		CROSS_LINE_EXTENDED_LENGTH	= 7;
-
-	/**
-	 * Default color for parsed compartments.
-	 */
-	private static final Color	COMPARTMENT_COLOR						= new Color(0.5f, 0.5f, 1.0f);
-
-	/**
-	 * Method used to create a model from SBGN-ML file.
-	 * 
-	 * @param params
-	 *          parameters needed for parsing file and creating a model
-	 * @return valid model parsed from the file
-	 * @throws InvalidInputDataExecption
-	 *           thrown when input file is invalid
-	 */
-	public Model createModel(ConverterParams params) throws InvalidInputDataExecption {
-
-		Model model = new ModelFullIndexed(null);
-		model.setIdModel(params.getFilename());
-		model.setSbgnFormat(params.isSbgnFormat());
-
-		// Input file
-		File inputSbgnmlFile = inputStreamToFile(params.getInputStream());
-
-		Sbgn sbgnData;
-		// Check if input file has valid SBGN-ML data
-		try {
-			if (!SbgnUtil.isValid(inputSbgnmlFile)) {
-				throw new InvalidInputDataExecption("Given input is not a valid SBGN-ML file.");
-			}
-
-			// Read data from file
-			sbgnData = SbgnUtil.readFromFile(inputSbgnmlFile);
-		} catch (InvalidInputDataExecption ex) {
-			throw ex;
-		} catch (Exception ex) {
-			throw new InvalidInputDataExecption("Unable to read given file.", ex);
-		}
-
-		// Extract map with all the glyphs and arcs
-		Map map = sbgnData.getMap();
-
-		// Add default compartment
-		Compartment defaultCompartment = new Compartment("default");
-		model.addCompartment(defaultCompartment);
-
-		adjustSizeOfElements(map);
-
-		setModelSize(map, model);
-
-		// Iterate over every glyph
-		for (Glyph g : map.getGlyph()) {
-			parseGlyph(g, model);
-		}
-
-		// Iterate over every arc in the map
-		for (Arc a : map.getArc()) {
-			parseArc(a, model);
-		}
-
-		// Parse all processes created before
-		for (Process p : processes) {
-			try {
-				parseProcess(p, model);
-			} catch (Exception e) {
-				logger.warn("Unable to parse the process: " + p.getCentralPoint().getId());
-			}
-		}
-
-		return model;
-	}
-
-	/**
-	 * Writes input stream into a File.
-	 * @param inputStream
-	 *          Input stream to be written to File
-	 * @return
-	 * 			File handle
-	 */
-	private File inputStreamToFile(InputStream inputStream) {
-		File tempFile = null;
-		try {
-			tempFile = File.createTempFile("stream2file", ".tmp");
-			tempFile.deleteOnExit();
-			try (FileOutputStream out = new FileOutputStream(tempFile)) {
-				IOUtils.copy(inputStream, out);
-			}
-		} catch (Exception ex) {
-			logger.debug("Unable to create temporary file.");
-			return null;
-		}
-		return tempFile;
-	}
-
-	/**
-	 * Method used to adjust the size of elements that have their size
-	 * represented different in the SBGN-ML file. Adjusted elements: Source and
-	 * Sink / Degraded elements, Multimers.
-	 * 
-	 * @param map
-	 *          Map parsed from SBGN-ML file
-	 */
-	private void adjustSizeOfElements(Map map) {
-		for (Glyph g : map.getGlyph()) {
-			GlyphClazz glyphClazz = GlyphClazz.fromClazz(g.getClazz());
-			switch (glyphClazz) {
-				case SOURCE_AND_SINK:
-					g.getBbox().setH(g.getBbox().getH() + 2 * CROSS_LINE_EXTENDED_LENGTH);
-					g.getBbox().setW(g.getBbox().getW() + 2 * CROSS_LINE_EXTENDED_LENGTH);
-					g.getBbox().setX(g.getBbox().getX() - CROSS_LINE_EXTENDED_LENGTH);
-					g.getBbox().setY(g.getBbox().getY() - CROSS_LINE_EXTENDED_LENGTH);
-					break;
-				case COMPLEX_MULTIMER:
-				case MACROMOLECULE_MULTIMER:
-				case NUCLEIC_ACID_FEATURE_MULTIMER:
-				case SIMPLE_CHEMICAL_MULTIMER:
-					int cardinality;
-					try {
-						cardinality = getMultimerCardinality(g);
-					} catch (Exception ex) {
-						cardinality = 2;
-						logger.warn(ex.getMessage() + " Set the default value of 2.");
-					}
-					g.getBbox().setW(g.getBbox().getW() + (cardinality - 1) * SpeciesConverter.HOMODIMER_OFFSET);
-					g.getBbox().setH(g.getBbox().getH() + (cardinality - 1) * SpeciesConverter.HOMODIMER_OFFSET);
-					break;
-				default:
-					break;
-			}
-		}
-	}
-
-	/**
-	 * Method used to compute height and width of the model.
-	 * 
-	 * @param map
-	 *          Map parsed from SBGN-ML file
-	 * @param model
-	 *          Model to be updated
-	 */
-	private void setModelSize(Map map, Model model) {
-		double minX = Double.MAX_VALUE;
-		double minY = Double.MAX_VALUE;
-		double maxX = 0;
-		double maxY = 0;
-
-		// Iterate over every glyph
-		for (Glyph g : map.getGlyph()) {
-			if (GlyphClazz.fromClazz(g.getClazz()).equals(GlyphClazz.ANNOTATION)
-					|| GlyphClazz.fromClazz(g.getClazz()).equals(GlyphClazz.TAG)) {
-				continue;
-			}
-			Bbox bbox = g.getBbox();
-			if (bbox != null) {
-				if (bbox.getX() < minX) {
-					minX = bbox.getX();
-				}
-				if (bbox.getY() < minY) {
-					minY = bbox.getY();
-				}
-				if (bbox.getX() + bbox.getW() > maxX) {
-					maxX = bbox.getX() + bbox.getW();
-				}
-				if (bbox.getY() + bbox.getH() > maxY) {
-					maxY = bbox.getY() + bbox.getH();
-				}
-			}
-		}
-
-		// Iterate over every arc
-		for (Arc a : map.getArc()) {
-			// Since submaps are not yet supported, the arcs connecting them or
-			// tags cannot be used when computing width and height of the model.
-			boolean connectsTagOrSubmap = false;
-			if (a.getSource() instanceof Glyph) {
-				Glyph sourceGlyph = (Glyph) a.getSource();
-				if (GlyphClazz.fromClazz(sourceGlyph.getClazz()).equals(GlyphClazz.TAG)
-						|| GlyphClazz.fromClazz(sourceGlyph.getClazz()).equals(GlyphClazz.SUBMAP)) {
-					connectsTagOrSubmap = true;
-				}
-			}
-			if (a.getTarget() instanceof Glyph) {
-				Glyph targetGlyph = (Glyph) a.getTarget();
-				if (GlyphClazz.fromClazz(targetGlyph.getClazz()).equals(GlyphClazz.TAG)
-						|| GlyphClazz.fromClazz(targetGlyph.getClazz()).equals(GlyphClazz.SUBMAP)) {
-					connectsTagOrSubmap = true;
-				}
-			}
-			// If the arc is not connecting a submap or a tag, check it's points
-			if (!connectsTagOrSubmap) {
-				Start aStart = a.getStart();
-				if (aStart.getX() < minX) {
-					minX = aStart.getX();
-				}
-				if (aStart.getX() > maxX) {
-					maxX = aStart.getX();
-				}
-				if (aStart.getY() < minY) {
-					minY = aStart.getY();
-				}
-				if (aStart.getY() > maxY) {
-					maxY = aStart.getY();
-				}
-				End aEnd = a.getEnd();
-				if (aEnd.getX() < minX) {
-					minX = aEnd.getX();
-				}
-				if (aEnd.getX() > maxX) {
-					maxX = aEnd.getX();
-				}
-				if (aEnd.getY() < minY) {
-					minY = aEnd.getY();
-				}
-				if (aEnd.getY() > maxY) {
-					maxY = aEnd.getY();
-				}
-				for (Next aNext : a.getNext()) {
-					if (aNext.getX() < minX) {
-						minX = aNext.getX();
-					}
-					if (aNext.getX() > maxX) {
-						maxX = aNext.getX();
-					}
-					if (aNext.getY() < minY) {
-						minY = aNext.getY();
-					}
-					if (aNext.getY() > maxY) {
-						maxY = aNext.getY();
-					}
-				}
-			}
-		}
-
-		model.setWidth(maxX + minX);
-		model.setHeight(maxY + minY);
-	}
-
-	/**
-	 * Method used to parse a single glyph.
-	 * 
-	 * @param g
-	 *          glyph to be parsed
-	 * @param model
-	 *          model to be updated
-	 * @throws Exception
-	 */
-	private void parseGlyph(Glyph g, Model model) {
-		Species newSpecies = null;
-		switch (GlyphClazz.fromClazz(g.getClazz())) {
-			case AND:
-			case NOT:
-			case OR:
-				logicOperators.add(g);
-				break;
-			case COMPARTMENT:
-				parseCompartment(g, model);
-				break;
-			case COMPLEX:
-				parseComplex(g, null, true, model);
-				break;
-			case COMPLEX_MULTIMER:
-				parseComplex(g, null, false, model);
-				break;
-			case MACROMOLECULE:
-				newSpecies = new GenericProtein();
-				parseSpecies(g, newSpecies, true, model);
-				break;
-			case MACROMOLECULE_MULTIMER:
-				newSpecies = new GenericProtein();
-				parseSpecies(g, newSpecies, false, model);
-				break;
-			case NUCLEIC_ACID_FEATURE:
-			if (isRNA(g)) {
-				newSpecies = new Rna();
-			} else {
-				newSpecies = new Gene();
-			}
-				parseSpecies(g, newSpecies, true, model);
-				break;
-			case NUCLEIC_ACID_FEATURE_MULTIMER:
-			if (isRNA(g)) {
-				newSpecies = new Rna();
-			} else {
-				newSpecies = new Gene();
-			}
-				parseSpecies(g, newSpecies, false, model);
-				break;
-			case PERTURBING_AGENT:
-			newSpecies = new Phenotype();
-			parseSpecies(g, newSpecies, true, model);
-				break;
-			case PHENOTYPE:
-				newSpecies = new Phenotype();
-				parseSpecies(g, newSpecies, true, model);
-				break;
-			case ASSOCIATION:
-			case DISSOCIATION:
-			case OMITTED_PROCESS:
-			case PROCESS:
-			case UNCERTAIN_PROCESS:
-				processes.add(new Process(g));
-				break;
-			case SIMPLE_CHEMICAL:
-				newSpecies = new SimpleMolecule();
-				parseSpecies(g, newSpecies, true, model);
-				break;
-			case SIMPLE_CHEMICAL_MULTIMER:
-				newSpecies = new SimpleMolecule();
-				parseSpecies(g, newSpecies, false, model);
-				break;
-			case SOURCE_AND_SINK:
-				newSpecies = new Degraded();
-				parseSpecies(g, newSpecies, true, model);
-				break;
-		case TAG:
-		case SUBMAP:
-			logger.warn("Submaps are not supported. Glyph: " + g.getId() + " has not been parsed.");
-			case UNSPECIFIED_ENTITY:
-				newSpecies = new Unknown();
-				parseSpecies(g, newSpecies, true, model);
-				break;
-			default:
-				logger.warn("The glyph " + g.getId() + " of class " + g.getClazz() + " has not been parsed, since it is invalid for SBGN PD map.");
-				break;
-		}
-	}
-
-	/**
-	 * Method used to parse a single arc.
-	 * 
-	 * @param a
-	 *          arc to be parsed
-	 * @param model
-	 *          model to be updated
-	 */
-	private void parseArc(Arc a, Model model) {
-		switch (ArcClazz.fromClazz(a.getClazz())) {
-			case CONSUMPTION:
-				Port arcTargetPort = (Port) a.getTarget();
-				for (Process p : processes) {
-					if (p.getCentralPoint().getPort().contains(arcTargetPort)) {
-						p.addReagentArc(a);
-						break;
-					}
-				}
-				break;
-			case PRODUCTION:
-				Port arcSourcePort = (Port) a.getSource();
-				for (Process p : processes) {
-					if (p.getCentralPoint().getPort().contains(arcSourcePort)) {
-						p.addProductArc(a);
-						break;
-					}
-				}
-				break;
-			case EQUIVALENCE_ARC:
-			logger.warn("Submaps are not supported. Equivalence arc: " + a.getId() + " has not been parsed.");
-				break;
-			case LOGIC_ARC:
-				logicArcs.add(a);
-				break;
-			case CATALYSIS:
-			case INHIBITION:
-			case MODULATION:
-			case NECESSARY_STIMULATION:
-			case STIMULATION:
-				Glyph targetGlyph = (Glyph) a.getTarget();
-				if (GlyphClazz.fromClazz(targetGlyph.getClazz()).equals(GlyphClazz.PHENOTYPE)) {
-					if (!(a.getSource() instanceof Glyph)) {
-						logger.warn("Invalid phenotype arc: " + a.getId());
-						break;
-					}
-					try {
-						parsePhenotypeArc(a, model);
-					} catch (Exception ex) {
-						logger.warn(ex.getMessage());
-					}
-					break;
-				}
-				if (a.getSource() instanceof Glyph) {
-					Glyph sourceGlyph = (Glyph) a.getSource();
-					if (GlyphClazz.fromClazz(sourceGlyph.getClazz()).equals(GlyphClazz.PHENOTYPE)
-							&& (model.getAliasByAliasId(targetGlyph.getId()) instanceof SpeciesAlias)) {
-						try {
-							parsePhenotypeArc(a, model);
-						} catch (InvalidArgumentException ex) {
-							logger.warn("The arc " + a.getId() + " of class " + a.getClazz() + " is not a valid reduced notation arc.");
-						}
-						break;
-					}
-				}
-				for (Process p : processes) {
-					if (p.getCentralPoint().getId().equals(targetGlyph.getId())) {
-						p.addInfluenceArc(a);
-						break;
-					}
-				}
-				break;
-			default:
-				logger.warn("The arc " + a.getId() + " of class " + a.getClazz() + " has not been parsed, since it is invalid for SBGN PD map.");
-		}
-	}
-
-	/**
-	 * Method used to parse arc going to or from a phenotype.
-	 * 
-	 * @param a
-	 *          arc to be parsed
-	 * @param model
-	 *          model to be updated
-	 */
-	private void parsePhenotypeArc(Arc a, Model model) {
-		Reaction reaction;
-
-		switch (ArcClazz.fromClazz(a.getClazz())) {
-
-			case INHIBITION:
-				reaction = new NegativeInfluenceReaction();
-				break;
-			case MODULATION:
-				reaction = new ReducedModulationReaction();
-				break;
-			case NECESSARY_STIMULATION:
-				reaction = new ReducedTriggerReaction();
-				break;
-			case STIMULATION:
-				reaction = new ReducedPhysicalStimulationReaction();
-				break;
-			default:
-				throw new InvalidArgumentException();
-		}
-
-		reaction.setIdReaction(a.getId());
-		reaction.setModel(model);
-
-		Reactant reactant = new Reactant();
-		reactant.setReaction(reaction);
-		Glyph source = (Glyph) a.getSource();
-		reactant.setAlias(model.getAliasByAliasId(source.getId()));
-		reactant.setElement(reactant.getAlias().getElement());
-		List<Point2D> reactantPointList = new ArrayList<>();
-		reactantPointList.add(new Point2D.Double(a.getStart().getX(), a.getStart().getY()));
-		reactantPointList.add(new Point2D.Double(a.getStart().getX(), a.getStart().getY()));
-		PolylineData reactantLine = new PolylineData(reactantPointList);
-		ArrowTypeData atd = new ArrowTypeData();
-		atd.setArrowType(ArrowType.NONE);
-		atd.setArrowLineType(LineType.SOLID);
-		reactantLine.setEndAtd(atd);
-		reactant.setLine(reactantLine);
-		reaction.addReactant(reactant);
-
-		Product product = new Product();
-		product.setReaction(reaction);
-		Glyph target = (Glyph) a.getTarget();
-		product.setAlias(model.getAliasByAliasId(target.getId()));
-		product.setElement(product.getAlias().getElement());
-		List<Point2D> productPointList = getLinePoints(a);
-		PolylineData productLine = parseLine(a, productPointList);
-		product.setLine(productLine);
-		reaction.addProduct(product);
-
-		model.addReaction(reaction);
-	}
-
-	/**
-	 * Method used to parse a single species.
-	 * 
-	 * @param g
-	 *          SBGN-ML glyph representing the species
-	 * @param newSpecies
-	 *          species to be parsed
-	 * @param isHomodimer
-	 *          true if parsed species is not multimer
-	 * @param model
-	 *          model to be updated
-	 */
-	private void parseSpecies(Glyph g, Species newSpecies, boolean isHomodimer, Model model) {
-		newSpecies.setElementId(g.getId());
-		newSpecies.setModel(model);
-		// If Glyph has label with a name, set it as Species name. If not, set
-		// Id as name.
-		if (g.getLabel() != null) {
-			newSpecies.setName(g.getLabel().getText());
-		} else {
-			newSpecies.setName(g.getId());
-		}
-		// Add species to parent complex if there is one
-		if (newSpecies.getComplex() != null) {
-			newSpecies.getComplex().addElement(newSpecies);
-		}
-		// If the species is a multimer, set it's cardinality.
-		if (!isHomodimer) {
-			try {
-				newSpecies.setHomodimer(getMultimerCardinality(g));
-			} catch (Exception ex) {
-				newSpecies.setHomodimer(2);
-				logger.warn(ex.getMessage() + " Set the default value of 2.");
-			}
-		}
-
-		List<Glyph> children = g.getGlyph();
-		for (Glyph child : children) {
-			if (GlyphClazz.fromClazz(child.getClazz()).equals(GlyphClazz.STATE_VARIABLE)) {
-				if (child.getState() == null || child.getState().getVariable() != null) {
-					try {
-						parseStateVariable(child, g, newSpecies);
-					} catch (Exception ex) {
-						logger.warn(ex.getMessage());
-					}
-				} else {
-					String structuralState = child.getState().getValue();
-					if (newSpecies instanceof Protein) {
-						Protein protein = (Protein) newSpecies;
-						protein.setStructuralState(structuralState);
-					} else if (newSpecies instanceof ComplexSpecies) {
-						ComplexSpecies complex = (ComplexSpecies) newSpecies;
-						complex.setStructuralState(structuralState);
-					}
-				}
-			}
-		}
-
-		model.addElement(newSpecies);
-
-		parseAlias(g, newSpecies, model);
-	}
-
-	/**
-	 * Method used to create a new alias from SBGN-ML glyph.
-	 * 
-	 * @param g
-	 *          SBGN-ML glyph representing the alias
-	 * @param newSpecies
-	 *          species of the alias
-	 * @param model
-	 *          model to be updated
-	 */
-	private void parseAlias(Glyph g, Species newSpecies, Model model) {
-		SpeciesAlias newAlias;
-		if (newSpecies instanceof ComplexSpecies) {
-			newAlias = new ComplexAlias((ComplexSpecies) newSpecies);
-		} else {
-			newAlias = new SpeciesAlias(newSpecies);
-		}
-		newAlias.setHeight(new Double(g.getBbox().getH()));
-		newAlias.setWidth(new Double(g.getBbox().getW()));
-		newAlias.setX(new Double(g.getBbox().getX()));
-		newAlias.setY(new Double(g.getBbox().getY()));
-		newAlias.setAliasId(g.getId());
-
-		if (g.getCompartmentRef() != null) {
-			Glyph compartmentGlyph = (Glyph) g.getCompartmentRef();
-			CompartmentAlias compartmentAlias = model.getCompartmentAliasByCompartmentAliasId(compartmentGlyph.getId());
-			newAlias.setParent(compartmentAlias);
-			newAlias.setCompartmentAlias(compartmentAlias);
-		} else if (newSpecies.getComplex() == null) {
-			// If the alias is in any compartment, assign it to that compartment
-			for (CompartmentAlias compartmentAlias : model.getCompartmentsAliases()) {
-				boolean dx1 = compartmentAlias.getX() + compartmentAlias.getWidth() - newAlias.getX() >= 0;
-				boolean dx2 = compartmentAlias.getX() - (newAlias.getX() + newAlias.getWidth()) <= 0;
-				boolean dy1 = compartmentAlias.getY() + compartmentAlias.getHeight() - newAlias.getY() >= 0;
-				boolean dy2 = compartmentAlias.getY() - (newAlias.getY() + newAlias.getHeight()) <= 0;
-				if (dx1 && dx2 && dy1 && dy2) {
-					newAlias.setCompartmentAlias(compartmentAlias);
-					newAlias.setParent(compartmentAlias);
-				}
-			}
-		}
-
-		// Parse units of information
-		for (Glyph child : g.getGlyph()) {
-			if (GlyphClazz.fromClazz(child.getClazz()).equals(GlyphClazz.UNIT_OF_INFORMATION)) {
-				parseUnitOfInformation(child, newAlias);
-			}
-		}
-
-		model.addAlias(newAlias);
-	}
-
-	/**
-	 * Method used to retrieve multimer cardinality from a multimer glyph.
-	 * 
-	 * @param g
-	 *          multimer glyph
-	 * @return multimer cardinality
-	 * @throws Exception
-	 *           Exception is thrown if no proper unit of information with
-	 *           cardinality was found
-	 */
-	private int getMultimerCardinality(Glyph g) throws Exception {
-		int multimerCardinality = 0;
-		// Check all the children nodes looking for unit of information with
-		// cardinality
-		List<Glyph> children = g.getGlyph();
-		for (Glyph child : children) {
-			if (GlyphClazz.fromClazz(child.getClazz()) == GlyphClazz.UNIT_OF_INFORMATION) {
-				String[] splitLabel = child.getLabel().getText().split(":");
-				multimerCardinality = Integer.parseInt(splitLabel[1]);
-			}
-		}
-		// If no unit of information was found, or the cardinality is invalid,
-		// raise exception
-		if (multimerCardinality <= 0) {
-			throw new Exception(
-					"No proper unit of information with multimer cardinality was found." + " Glyph: " + g.getId());
-		}
-
-		return multimerCardinality;
-	}
-
-	/**
-	 * Method used to decide if Nucleic-acid feature should be translated to RNA.
-	 * @param g
-	 * 			Nucleic-acid feature glyph
-	 * @return
-	 * 			true if input is RNA
-	 */
-	private boolean isRNA(Glyph g) {
-		boolean rna = false;
-		// Check all the children nodes looking for unit of information
-		List<Glyph> children = g.getGlyph();
-		for (Glyph child : children) {
-			if (GlyphClazz.fromClazz(child.getClazz()) == GlyphClazz.UNIT_OF_INFORMATION) {
-				if (child.getLabel().getText().toLowerCase().contains("rna")) {
-					rna = true;
-				}
-			}
-		}
-
-		return rna;
-	}
-
-	/**
-	 * Method used to parse state variable.
-	 * 
-	 * @param unitOfInformationGlyph
-	 *          unit of information glyph from sbgn-ml file
-	 * @param speciesGlyph
-	 *          glyph that the unit of information considers
-	 * @param newSpecies
-	 *          species that the unit of information considers
-	 * @throws Exception
-	 *             Exception is thrown if state variable is parsed for species
-	 *             other than Protein
-	 */
-	private void parseStateVariable(Glyph unitOfInformationGlyph, Glyph speciesGlyph, Species newSpecies)
-			throws Exception {
-		if (!(newSpecies instanceof Protein)) {
-			throw new Exception("Only macromolecule elements can have state variables.");
-		}
-		Protein protein = (Protein) newSpecies;
-		ModificationResidue mr = new ModificationResidue();
-
-		mr.setSpecies(protein);
-		mr.setIdModificationResidue(unitOfInformationGlyph.getId());
-		if (unitOfInformationGlyph.getState() != null) {
-			// If State variable consists of value and variable
-			mr.setName(unitOfInformationGlyph.getState().getVariable());
-			for (ModificationState ms : ModificationState.values()) {
-				if (ms.getAbbreviation().equals(unitOfInformationGlyph.getState().getValue())) {
-					mr.setState(ms);
-				}
-			}
-		}
-
-		// Compute the angle from coordinates and dimensions
-		Double stateVarX = new Double(unitOfInformationGlyph.getBbox().getX()
-				+ unitOfInformationGlyph.getBbox().getW() / 2 - speciesGlyph.getBbox().getX());
-		Double stateVarY = new Double(unitOfInformationGlyph.getBbox().getY()
-				+ unitOfInformationGlyph.getBbox().getH() / 2 - speciesGlyph.getBbox().getY());
-
-		// Angle difference between endpoints of glyph's edge (divided by Pi)
-		final double edgeAngle = 0.5;
-
-		// Starting angle (top-right corner)
-		final double startingAngle = 0.25;
-
-		// Angle of the state variable
-		Double angle = startingAngle;
-
-		double leftSideDif = Math.abs(stateVarX);
-		double rightSideDif = Math.abs(speciesGlyph.getBbox().getW() - stateVarX);
-		double topSideDif = Math.abs(stateVarY);
-		double bottomSideDif = Math.abs(speciesGlyph.getBbox().getH() - stateVarY);
-		double minDif = Math.min(Math.min(leftSideDif, rightSideDif), Math.min(topSideDif, bottomSideDif));
-
-		if (minDif == leftSideDif) {
-			// State variable is located on glyph's left edge
-			angle += edgeAngle + (stateVarY / speciesGlyph.getBbox().getH()) * edgeAngle;
-		} else if (minDif == rightSideDif) {
-			// State variable is located on glyph's right edge
-			angle -= (stateVarY / speciesGlyph.getBbox().getH()) * edgeAngle;
-		} else if (minDif == topSideDif) {
-			// State variable is located on glyph's top edge
-			angle += edgeAngle - (stateVarX / speciesGlyph.getBbox().getW()) * edgeAngle;
-		} else if (minDif == bottomSideDif) {
-			// State variable is located on glyph's bottom edge
-			angle += 2 * edgeAngle + (stateVarX / speciesGlyph.getBbox().getW()) * edgeAngle;
-		}
-
-		mr.setAngle(angle * Math.PI);
-
-		protein.addModificationResidue(mr);
-	}
-
-	/**
-	 * Method used for parsing units of information.
-	 * 
-	 * @param unitOfInformationGlyph
-	 *          unit of information glyph from sbgn-ml file
-	 * @param alias
-	 *          alias that the unit of information concerns
-	 */
-	private void parseUnitOfInformation(Glyph unitOfInformationGlyph, SpeciesAlias alias) {
-		String unitOfInformationText = unitOfInformationGlyph.getLabel().getText();
-		if (unitOfInformationText.contains(":") && !unitOfInformationText.startsWith("N:")) {
-			String unitOfInformationPrefix = unitOfInformationText.substring(0, unitOfInformationText.indexOf(':'));
-			String unitOfInformationSuffix = unitOfInformationText.substring(unitOfInformationText.indexOf(':') + 1);
-			alias.setAliasStatePrefix(unitOfInformationPrefix);
-			alias.setAliasStateLabel(unitOfInformationSuffix);
-		} else if (!unitOfInformationText.startsWith("N:")) {
-			alias.setAliasStateLabel(unitOfInformationText);
-			alias.setAliasStatePrefix("free input");
-		}
-	}
-
-	/**
-	 * Method used for parsing complex species.
-	 * 
-	 * @param complexGlyph
-	 *          complex species glyph from sbgn-ml file
-	 * @param parentComplexSpecies
-	 *          parent complex species
-	 * @param isHomodimer
-	 *          set if the complex is a homodimer
-	 * @param model
-	 *          model to update with the parsed complex species
-	 */
-	private void parseComplex(Glyph complexGlyph, ComplexSpecies parentComplexSpecies, boolean isHomodimer,
-			Model model) {
-		Species complexSpecies = new ComplexSpecies();
-		if (parentComplexSpecies != null) {
-			complexSpecies.setComplex(parentComplexSpecies);
-		}
-		parseSpecies(complexGlyph, complexSpecies, isHomodimer, model);
-
-		ComplexAlias complexAlias = (ComplexAlias) model.getAliasByAliasId(complexGlyph.getId());
-		for (Glyph child : complexGlyph.getGlyph()) {
-			Species newSpecies;
-			switch (GlyphClazz.fromClazz(child.getClazz())) {
-				case UNSPECIFIED_ENTITY:
-					newSpecies = new Unknown();
-					newSpecies.setComplex((ComplexSpecies) complexSpecies);
-					parseSpecies(child, newSpecies, true, model);
-					break;
-				case SIMPLE_CHEMICAL:
-					newSpecies = new SimpleMolecule();
-					newSpecies.setComplex((ComplexSpecies) complexSpecies);
-					parseSpecies(child, newSpecies, true, model);
-					break;
-				case MACROMOLECULE:
-					newSpecies = new GenericProtein();
-					newSpecies.setComplex((ComplexSpecies) complexSpecies);
-					parseSpecies(child, newSpecies, true, model);
-					break;
-				case NUCLEIC_ACID_FEATURE:
-					newSpecies = new Gene();
-					newSpecies.setComplex((ComplexSpecies) complexSpecies);
-					parseSpecies(child, newSpecies, true, model);
-					break;
-				case SIMPLE_CHEMICAL_MULTIMER:
-					newSpecies = new SimpleMolecule();
-					newSpecies.setComplex((ComplexSpecies) complexSpecies);
-					parseSpecies(child, newSpecies, false, model);
-					break;
-				case MACROMOLECULE_MULTIMER:
-					newSpecies = new GenericProtein();
-					newSpecies.setComplex((ComplexSpecies) complexSpecies);
-					parseSpecies(child, newSpecies, false, model);
-					break;
-				case NUCLEIC_ACID_FEATURE_MULTIMER:
-					newSpecies = new Gene();
-					newSpecies.setComplex((ComplexSpecies) complexSpecies);
-					parseSpecies(child, newSpecies, false, model);
-					break;
-				case COMPLEX:
-					parseComplex(child, (ComplexSpecies) complexSpecies, true, model);
-					break;
-				case COMPLEX_MULTIMER:
-					parseComplex(child, (ComplexSpecies) complexSpecies, false, model);
-					break;
-				default:
-					break;
-			}
-			Alias newAlias = model.getAliasByAliasId(child.getId());
-			if (newAlias != null) {
-				newAlias.setParent(complexAlias);
-				complexAlias.addAlias((SpeciesAlias) newAlias);
-			}
-		}
-	}
-
-	/**
-	 * Method used to compute end point for modifier line.
-	 * 
-	 * @param a
-	 *          SBGN-ML modifier arc
-	 * @param reaction
-	 *          reaction to which the arc points
-	 * @return end point for modifier line
-	 */
-	private Point2D getModifierEndPoint(Arc a, Reaction reaction) {
-		ModifierTypeUtils utils = new ModifierTypeUtils();
-		Point2D result;
-
-		Line2D centerLine = reaction.getCenterLine();
-		double dx = centerLine.getX2() - centerLine.getX1();
-		double dy = centerLine.getY2() - centerLine.getY1();
-		double centerLineAngle = Math.atan2(dy, dx);
-
-		Point2D centerPoint = new Point2D.Double(centerLine.getX1() + dx / 2, centerLine.getY1() + dy / 2);
-
-		// Retrieve second last point from the arc
-		Point2D secondLast;
-		if (a.getNext().isEmpty()) {
-			secondLast = new Point2D.Double(a.getStart().getX(), a.getStart().getY());
-		} else {
-			Next temp = a.getNext().get(a.getNext().size() - 1);
-			secondLast = new Point2D.Double(temp.getX(), temp.getY());
-		}
-
-		double dx2 = secondLast.getX() - centerPoint.getX();
-		double dy2 = secondLast.getY() - centerPoint.getY();
-		double modifierAngle = Math.atan2(dy2, dx2);
-
-		double finalAngle = modifierAngle - centerLineAngle;
-		while (finalAngle < -Math.PI) {
-			finalAngle += 2 * Math.PI;
-		}
-		while (finalAngle > Math.PI) {
-			finalAngle -= 2 * Math.PI;
-		}
-		String lineConnectionType = null;
-
-		// CHECKSTYLE:OFF
-		if (finalAngle < -Math.PI / 3 * 2) {
-			lineConnectionType = "0,4";
-		} else if (finalAngle < -Math.PI / 3) {
-			lineConnectionType = "0,2";
-		} else if (finalAngle < 0) {
-			lineConnectionType = "0,5";
-		} else if (finalAngle < Math.PI / 3) {
-			lineConnectionType = "0,7";
-		} else if (finalAngle < Math.PI / 3 * 2) {
-			lineConnectionType = "0,3";
-		} else {
-			lineConnectionType = "0,6";
-		}
-		// CHECKSTYLE:ON
-
-		result = utils.getAnchorPointOnReactionRect(reaction, lineConnectionType);
-
-		return result;
-	}
-
-	/**
-	 * Method used to parse line points from SBGN-ML arc.
-	 * 
-	 * @param a
-	 *          SBGN-ML arc
-	 * @return list of line points
-	 */
-	private List<Point2D> getLinePoints(Arc a) {
-		List<Point2D> pointList = new ArrayList<>();
-		Point2D startPoint = new Point2D.Double(a.getStart().getX(), a.getStart().getY());
-		Point2D endPoint = new Point2D.Double(a.getEnd().getX(), a.getEnd().getY());
-		pointList.add(startPoint);
-		for (Next nextPoint : a.getNext()) {
-			pointList.add(new Point2D.Double(nextPoint.getX(), nextPoint.getY()));
-		}
-		pointList.add(endPoint);
-		return pointList;
-	}
-
-	/**
-	 * Method used for parsing lines from sbgn-ml arcs.
-	 * 
-	 * @param a
-	 *          SBGN-ML arc
-	 * @param pointList
-	 *          list of points for the line
-	 * @return line parsed from SBGN-ML arc
-	 */
-	private PolylineData parseLine(Arc a, List<Point2D> pointList) {
-		PolylineData line = new PolylineData(pointList);
-		ArrowTypeData atd = new ArrowTypeData();
-
-		switch (ArcClazz.fromClazz(a.getClazz())) {
-			case CATALYSIS:
-				atd = ModifierType.CATALYSIS.getAtd();
-				break;
-			case CONSUMPTION:
-				atd.setArrowType(ArrowType.NONE);
-				break;
-			case INHIBITION:
-				atd = ModifierType.INHIBITION.getAtd();
-				break;
-			case MODULATION:
-				atd = ModifierType.MODULATION_STRING.getAtd();
-				break;
-			case NECESSARY_STIMULATION:
-				atd = ModifierType.TRIGGER_STRING.getAtd();
-				break;
-			case PRODUCTION:
-				atd.setArrowType(ArrowType.FULL);
-				break;
-			case STIMULATION:
-				atd = ModifierType.PHYSICAL_STIMULATION.getAtd();
-				break;
-			case LOGIC_ARC:
-				atd.setArrowType(ArrowType.NONE);
-				break;
-			default:
-				throw new InvalidArgumentException("Wrong arc class.");
-		}
-		atd.setArrowLineType(LineType.SOLID);
-		line.setEndAtd(atd.copy());
-		return line;
-	}
-
-	/**
-	 * Returns {@link AndOperator} for the reaction's reagents port.
-	 * 
-	 * @param p
-	 *          process of the reaction
-	 * @return operator for the reaction port
-	 */
-	private AndOperator getReactionPortAndOperator(Process p) {
-		AndOperator andOperator = new AndOperator();
-		Glyph centralPoint = p.getCentralPoint();
-		Double centralPointX = new Double(centralPoint.getBbox().getX() + centralPoint.getBbox().getW() / 2);
-		Double centralPointY = new Double(centralPoint.getBbox().getY() + centralPoint.getBbox().getH() / 2);
-		Point2D centerOfReactionPoint = new Point2D.Double(centralPointX, centralPointY);
-		Point2D portPoint;
-		if (p.getReagentArcs().size() > 1) {
-			portPoint = new Point2D.Double(p.getReagentArcs().get(0).getEnd().getX(),
-					p.getReagentArcs().get(0).getEnd().getY());
-		} else {
-			portPoint = new Point2D.Double(p.getRevReagentArcs().get(0).getStart().getX(),
-					p.getRevReagentArcs().get(0).getStart().getY());
-		}
-		PolylineData line = new PolylineData(portPoint, centerOfReactionPoint);
-		ArrowTypeData atd = new ArrowTypeData();
-		atd.setArrowType(ArrowType.NONE);
-		atd.setArrowLineType(LineType.SOLID);
-		line.setEndAtd(atd);
-		andOperator.setLine(line);
-		return andOperator;
-	}
-
-	/**
-	 * Returns {@link SplitOperator} for the reaction's products port.
-	 * 
-	 * @param p
-	 *          process of the reaction
-	 * @return operator for the reaction port
-	 */
-	private SplitOperator getReactionPortSplitOperator(Process p) {
-		SplitOperator splitOperator = new SplitOperator();
-		Glyph centralPoint = p.getCentralPoint();
-		Double centralPointX = new Double(centralPoint.getBbox().getX() + centralPoint.getBbox().getW() / 2);
-		Double centralPointY = new Double(centralPoint.getBbox().getY() + centralPoint.getBbox().getH() / 2);
-		Point2D centerOfReactionPoint = new Point2D.Double(centralPointX, centralPointY);
-		Point2D portPoint;
-		if (!p.isReversible()) {
-			portPoint = new Point2D.Double(p.getProductArcs().get(0).getStart().getX(),
-					p.getProductArcs().get(0).getStart().getY());
-		} else {
-			portPoint = new Point2D.Double(p.getRevProductArcs().get(0).getStart().getX(),
-					p.getRevProductArcs().get(0).getStart().getY());
-		}
-		PolylineData line = new PolylineData(centerOfReactionPoint, portPoint);
-		ArrowTypeData atd = new ArrowTypeData();
-		atd.setArrowType(ArrowType.NONE);
-		atd.setArrowLineType(LineType.SOLID);
-		line.setEndAtd(atd);
-		splitOperator.setLine(line);
-		return splitOperator;
-	}
-
-	/**
-	 * Returns instance of {@link Modifier} based on given {@link ArcClazz}.
-	 * 
-	 * @param ac
-	 *          {@link ArcClazz} defining the result
-	 * @return {@link Modifier} of class adequate to given ac
-	 * @throws Exception
-	 *           thrown when no adequate Modifier has been found
-	 */
-	private Modifier getModifierFromArcClazz(ArcClazz ac) throws Exception {
-		switch (ac) {
-			case CATALYSIS:
-				return new Catalysis();
-			case INHIBITION:
-				return new Inhibition();
-			case MODULATION:
-				return new Modulation();
-			case NECESSARY_STIMULATION:
-				return new Trigger();
-			case STIMULATION:
-				return new PhysicalStimulation();
-			default:
-			logger.warn("Modifier arc of invalid class.");
-				throw new Exception("Wrong arc class.");
-		}
-	}
-
-	/**
-	 * Returns center point for given process.
-	 * 
-	 * @param p
-	 *          completely parsed process to compute center point from
-	 * @return center point for given process
-	 */
-	private Point2D getCenterPointFromProcess(Process p) {
-		Double centralPointX = new Double(
-				p.getCentralPoint().getBbox().getX() + p.getCentralPoint().getBbox().getW() / 2);
-		Double centralPointY = new Double(
-				p.getCentralPoint().getBbox().getY() + p.getCentralPoint().getBbox().getH() / 2);
-		Point2D centerOfReactionPoint = new Point2D.Double(centralPointX, centralPointY);
-		return centerOfReactionPoint;
-	}
-
-	/**
-	 * Returns proper Reaction object based on given glyph clazz.
-	 * @param glyphClazz
-	 *          clazz of the process glyph
-	 * @return
-	 * 			Reaction object based on given glyph clazz
-	 */
-	private Reaction getReactionFromProcessGlyphClazz(String glyphClazz) {
-		switch (GlyphClazz.fromClazz(glyphClazz)) {
-			case ASSOCIATION:
-			case DISSOCIATION:
-			case PROCESS:
-				return new StateTransitionReaction();
-			case OMITTED_PROCESS:
-				return new KnownTransitionOmittedReaction();
-			case UNCERTAIN_PROCESS:
-				return new UnknownTransitionReaction();
-			default:
-				throw new InvalidArgumentException();
-
-		}
-	}
-
-	/**
-	 * Method used for parsing processes into reactions.
-	 * 
-	 * @param p
-	 *          process to be parsed
-	 * @param model
-	 *          model to be updated with the parsed reaction
-	 * @throws Exception
-	 *           thrown when the process was invalid
-	 */
-	private void parseProcess(Process p, Model model) throws Exception {
-		if (p.getProductArcs().isEmpty()) {
-			throw new Exception(p.getCentralPoint().getId() + ": The process must have at least one outgoing arc.");
-		}
-		p.setProductsPort((Port) p.getProductArcs().get(0).getSource());
-		for (Arc productArc : p.getProductArcs()) {
-			if (!((Port) productArc.getSource()).equals(p.getProductsPort())) {
-				p.setReversible(true);
-				p.setReagentsPort((Port) productArc.getSource());
-			}
-		}
-		if (p.getReagentsPort() == null && !p.getReagentArcs().isEmpty()) {
-			p.setReagentsPort((Port) p.getReagentArcs().get(0).getTarget());
-		}
-
-		if ((p.getReagentArcs().isEmpty() && !p.isReversible())
-				|| (p.getRevReagentArcs().isEmpty() && p.isReversible())) {
-			throw new Exception(p.getCentralPoint().getId() + ": The process must have at least one incoming arc.");
-		}
-
-		Reaction reaction;
-		if (p.getCentralPoint() == null) {
-			throw new Exception("Process has no central point.");
-		}
-		reaction = getReactionFromProcessGlyphClazz(p.getCentralPoint().getClazz());
-		reaction.setIdReaction(p.getCentralPoint().getId());
-		reaction.setModel(model);
-
-		reaction.setReversible(p.isReversible());
-
-		// If there are multiple inputs, add "AND" operator
-		AndOperator andOperator = null;
-		if (p.getReagentArcs().size() > 1 || p.getRevReagentArcs().size() > 1) {
-			andOperator = getReactionPortAndOperator(p);
-			andOperator.setReaction(reaction);
-			reaction.addNode(andOperator);
-		}
-
-		// If there are multiple outputs, add Split operator
-		SplitOperator splitOperator = null;
-		if ((p.getProductArcs().size() > 1 && !p.isReversible())
-				|| (p.isReversible() && p.getRevProductArcs().size() > 1)) {
-			splitOperator = getReactionPortSplitOperator(p);
-			splitOperator.setReaction(reaction);
-			reaction.addNode(splitOperator);
-		}
-
-		for (Arc a : p.getReagentArcs()) {
-			Reactant reactant = new Reactant();
-			reactant.setReaction(reaction);
-			Glyph source = (Glyph) a.getSource();
-			reactant.setAlias(model.getAliasByAliasId(source.getId()));
-			reactant.setElement(reactant.getAlias().getElement());
-			List<Point2D> pointList = getLinePoints(a);
-			if (p.getReagentArcs().size() == 1) {
-				pointList.add(getCenterPointFromProcess(p));
-			} else {
-				pointList.add(pointList.get(pointList.size() - 1));
-			}
-			PolylineData line = parseLine(a, pointList);
-			reactant.setLine(line);
-			if (andOperator != null) {
-				andOperator.addInput(reactant);
-			}
-
-			reaction.addReactant(reactant);
-		}
-
-		for (Arc a : p.getProductArcs()) {
-			if (((Port) a.getSource()).equals(p.getProductsPort())) {
-				Product product = new Product();
-				product.setReaction(reaction);
-				Glyph target = (Glyph) a.getTarget();
-				product.setAlias(model.getAliasByAliasId(target.getId()));
-				product.setElement(product.getAlias().getElement());
-				List<Point2D> pointList = getLinePoints(a);
-				if (p.getRevProductArcs().size() >= 1) {
-					pointList.add(0, getCenterPointFromProcess(p));
-				} else {
-					pointList.add(0, pointList.get(0));
-				}
-				PolylineData line = parseLine(a, pointList);
-				product.setLine(line);
-				if (splitOperator != null) {
-					splitOperator.addOutput(product);
-				}
-
-				reaction.addProduct(product);
-			} else {
-				Reactant reactant = new Reactant();
-				reactant.setReaction(reaction);
-				Glyph source = (Glyph) a.getTarget();
-				reactant.setAlias(model.getAliasByAliasId(source.getId()));
-				reactant.setElement(reactant.getAlias().getElement());
-				List<Point2D> pointList = getLinePoints(a);
-				if (p.getRevReagentArcs().size() <= 1) {
-					pointList.add(0, getCenterPointFromProcess(p));
-				} else {
-					pointList.add(0, pointList.get(0));
-				}
-				PolylineData line = parseLine(a, pointList);
-				line = line.reverse();
-				reactant.setLine(line);
-				if (andOperator != null) {
-					andOperator.addInput(reactant);
-				}
-
-				reaction.addReactant(reactant);
-			}
-		}
-		for (Arc a : p.getModifierArcs()) {
-			Modifier modifier = null;
-			try {
-				modifier = getModifierFromArcClazz(ArcClazz.fromClazz(a.getClazz()));
-			} catch (Exception ex) {
-				logger.warn("Unable to add modifier");
-				continue;
-			}
-			if (a.getSource() instanceof Glyph) {
-				Glyph sourceGlyph = (Glyph) a.getSource();
-				SpeciesAlias modifierAlias = (SpeciesAlias) model.getAliasByAliasId(sourceGlyph.getId());
-				modifier.setAlias(modifierAlias);
-				modifier.setElement(modifier.getAlias().getElement());
-				List<Point2D> pointList = getLinePoints(a);
-				pointList.remove(pointList.size() - 1);
-				pointList.add(getModifierEndPoint(a, reaction));
-				PolylineData line = parseLine(a, pointList);
-				modifier.setLine(line);
-
-				reaction.addModifier(modifier);
-			} else if (a.getSource() instanceof Port) {
-				// Logic operator
-				try {
-					parseLogicOperator(a, reaction, ArcClazz.fromClazz(a.getClazz()), null, model);
-				} catch (Exception ex) {
-					logger.warn(ex.getMessage());
-				}
-			}
-
-		}
-
-		model.addReaction(reaction);
-	}
-
-	/**
-	 * Returns {@link ArrowTypeData} based on given {@link ArcClazz}.
-	 * 
-	 * @param ac
-	 *          input arc class
-	 * @return ArrowTypeData based on input arrow class
-	 * @throws Exception
-	 *           thrown when invalid arc class was given on input
-	 */
-	private ArrowTypeData getAtdFromArcClazz(ArcClazz ac) throws Exception {
-		ArrowTypeData atd = new ArrowTypeData();
-		switch (ac) {
-			case CATALYSIS:
-				atd = ModifierType.CATALYSIS.getAtd();
-				break;
-			case CONSUMPTION:
-				atd.setArrowType(ArrowType.NONE);
-				break;
-			case INHIBITION:
-				atd = ModifierType.INHIBITION.getAtd();
-				break;
-			case MODULATION:
-				atd = ModifierType.MODULATION_STRING.getAtd();
-				break;
-			case NECESSARY_STIMULATION:
-				atd = ModifierType.TRIGGER_STRING.getAtd();
-				break;
-			case PRODUCTION:
-				atd.setArrowType(ArrowType.FULL);
-				break;
-			case STIMULATION:
-				atd = ModifierType.PHYSICAL_STIMULATION.getAtd();
-				break;
-			case LOGIC_ARC:
-				atd.setArrowType(ArrowType.NONE);
-				break;
-			default:
-				throw new Exception("Wrong arc class.");
-		}
-		return atd.copy();
-	}
-
-	/**
-	 * Method used for parsing logic operators.
-	 * 
-	 * @param arc
-	 *          arc with a starting point in the logic operator
-	 * @param reaction
-	 *          reaction that the logic operator is a part of
-	 * @param modifierClass
-	 *          determines type of source species
-	 * @param targetOperator
-	 *          target logic operator
-	 * @param model
-	 *          model of the map
-	 * @throws Exception
-	 *           thrown when parsed logic operator is invalid
-	 */
-	private void parseLogicOperator(Arc arc, Reaction reaction, ArcClazz modifierClass, NodeOperator targetOperator,
-			Model model) throws Exception {
-		Port operatorPort = (Port) arc.getSource();
-		Glyph logicOperator = null;
-		for (Glyph lo : logicOperators) {
-			if (lo.getPort().contains(operatorPort)) {
-				logicOperator = lo;
-			}
-		}
-		if (logicOperator == null) {
-			throw new Exception("Missing logic operator for logic arc: " + arc.getId());
-		}
-
-		// LogicOperator is valid for CellDesigner only if it has exactly 2
-		// inputs of Species
-		final Glyph tempLogicOperator = logicOperator;
-		boolean isCellDesignerValidLogicOperator = logicArcs.stream()
-				.filter(a -> tempLogicOperator.getPort().contains(a.getTarget()) && !(a.getSource() instanceof Port))
-				.count() == 2;
-		if (!isCellDesignerValidLogicOperator) {
-			throw new Exception("Parsed operator is not valid for CellDesigner: " + logicOperator.getId());
-		}
-
-		NodeOperator operator;
-		switch (GlyphClazz.fromClazz(logicOperator.getClazz())) {
-			case AND:
-				operator = new AndOperator();
-				break;
-			case OR:
-				operator = new OrOperator();
-				break;
-			case NOT:
-			logger.warn("NOT gates are not implemented in the platform. Glyph: " + logicOperator.getId() + " has not been parsed.");
-				return;
-			default:
-				throw new Exception("Wrong logic operator class.");
-		}
-
-		// Parse line from arc and operator glyph
-		Point2D operatorCenterPoint = new Point2D.Double(
-				logicOperator.getBbox().getX() + logicOperator.getBbox().getW() / 2,
-				logicOperator.getBbox().getY() + logicOperator.getBbox().getH() / 2);
-
-		List<Point2D> linePoints = getLinePoints(arc);
-		new ArrayList<Point2D>();
-
-		if (targetOperator == null) {
-			linePoints.remove(linePoints.size() - 1);
-			linePoints.add(getModifierEndPoint(arc, reaction));
-		}
-
-		// Check if operator port is in the line from center point of the
-		// operator. If so, remove that redundant point.
-		double dx, dy;
-		dx = linePoints.get(0).getX() - operatorCenterPoint.getX();
-		dy = linePoints.get(0).getY() - operatorCenterPoint.getY();
-		double dx2, dy2;
-		if (arc.getNext().isEmpty()) {
-			dx2 = linePoints.get(linePoints.size() - 1).getX() - linePoints.get(0).getX();
-			dy2 = linePoints.get(linePoints.size() - 1).getY() - linePoints.get(0).getY();
-		} else {
-			dx2 = arc.getNext().get(0).getX() - linePoints.get(0).getX();
-			dy2 = arc.getNext().get(0).getY() - linePoints.get(0).getY();
-		}
-		DoubleComparator doubleComparator = new DoubleComparator();
-		if (doubleComparator.compare(dy / dx, dy2 / dx2) == 0) {
-			linePoints.remove(0);
-		}
-		linePoints.add(0, operatorCenterPoint);
-
-		PolylineData line = new PolylineData(linePoints);
-		ArrowTypeData atd = getAtdFromArcClazz(ArcClazz.fromClazz(arc.getClazz()));
-
-		atd.setArrowLineType(LineType.SOLID);
-		line.setEndAtd(atd);
-
-		operator.setLine(line);
-		operator.setReaction(reaction);
-
-		if (targetOperator != null) {
-			operator.addOutput(targetOperator);
-			targetOperator.addInput(operator);
-		}
-
-		for (Arc logicArc : logicArcs) {
-			if (logicOperator.getPort().contains(logicArc.getTarget())) {
-				if (logicArc.getSource() instanceof Port) {
-					// The arc has source in logic operator
-					logger.warn(
-							"Logic operators trees are not compatible with CellDesigner. Therefore they are not supported.");
-					continue;
-					// parseLogicOperator(logicArc, reaction, modifierClass,
-					// operator, model);
-				} else {
-					Modifier modifier;
-
-					switch (modifierClass) {
-						case CATALYSIS:
-							modifier = new Catalysis();
-							break;
-						case INHIBITION:
-							modifier = new Inhibition();
-							break;
-						case MODULATION:
-							modifier = new Modulation();
-							break;
-						case NECESSARY_STIMULATION:
-							modifier = new Trigger();
-							break;
-						case STIMULATION:
-							modifier = new PhysicalStimulation();
-							break;
-						default:
-							throw new Exception("Wrong arc class.");
-					}
-
-					Glyph sourceGlyph = (Glyph) logicArc.getSource();
-					SpeciesAlias modifierAlias = (SpeciesAlias) model.getAliasByAliasId(sourceGlyph.getId());
-					modifier.setAlias(modifierAlias);
-					List<Point2D> pointList = getLinePoints(logicArc);
-					pointList.add(operatorCenterPoint);
-					PolylineData newLine = parseLine(logicArc, pointList);
-					modifier.setLine(newLine);
-					modifier.setElement(modifier.getAlias().getElement());
-
-					operator.addInput(modifier);
-
-					reaction.addModifier(modifier);
-				}
-			}
-		}
-		reaction.addNode(operator);
-	}
-
-	/**
-	 * Method used for parsing compartments.
-	 * 
-	 * @param g
-	 *          compartment glyph from sbgn-ml file
-	 * @param model
-	 *          model to be updated with the parsed compartment
-	 */
-	private void parseCompartment(Glyph g, Model model) {
-		Compartment compartment = new Compartment();
-		compartment.setElementId(g.getId());
-		compartment.setModel(model);
-		if (g.getLabel() != null) {
-			compartment.setName(g.getLabel().getText());
-		}
-
-		CompartmentAlias compAlias = new SquareCompartmentAlias();
-		compAlias.setAliasId(g.getId());
-		compAlias.setCompartment(compartment);
-		compAlias.setModel(model);
-		compAlias.setHeight(new Double(g.getBbox().getH()));
-		compAlias.setWidth(new Double(g.getBbox().getW()));
-		compAlias.setX(new Double(g.getBbox().getX()));
-		compAlias.setY(new Double(g.getBbox().getY()));
-		compAlias.setThickness(1.0);
-		compAlias.setColor(COMPARTMENT_COLOR);
-
-		if (g.getLabel() != null && g.getLabel().getBbox() != null) {
-			compAlias.setNamePoint(g.getLabel().getBbox().getX(), g.getLabel().getBbox().getY());
-		} else {
-			compAlias.setNamePoint(compAlias.getX() + compAlias.getThickness() + CONTAINER_NAME_MARGIN,
-					compAlias.getY() + compAlias.getThickness() + CONTAINER_NAME_MARGIN);
-		}
-
-		model.addCompartment(compartment);
-		model.addAlias(compAlias);
-	}
-}
+package lcsb.mapviewer.converter.model.sbgnml;
+
+import java.awt.Color;
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.log4j.Logger;
+import org.sbgn.ArcClazz;
+import org.sbgn.GlyphClazz;
+import org.sbgn.SbgnUtil;
+import org.sbgn.bindings.Arc;
+import org.sbgn.bindings.Arc.End;
+import org.sbgn.bindings.Arc.Next;
+import org.sbgn.bindings.Arc.Start;
+import org.sbgn.bindings.Bbox;
+import org.sbgn.bindings.Glyph;
+import org.sbgn.bindings.Map;
+import org.sbgn.bindings.Port;
+import org.sbgn.bindings.Sbgn;
+
+import lcsb.mapviewer.common.comparator.DoubleComparator;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.converter.ConverterParams;
+import lcsb.mapviewer.converter.InvalidInputDataExecption;
+import lcsb.mapviewer.converter.graphics.species.SpeciesConverter;
+import lcsb.mapviewer.converter.model.celldesigner.types.ModifierType;
+import lcsb.mapviewer.converter.model.celldesigner.types.ModifierTypeUtils;
+import lcsb.mapviewer.converter.model.sbgnml.structures.Process;
+import lcsb.mapviewer.model.graphics.ArrowType;
+import lcsb.mapviewer.model.graphics.ArrowTypeData;
+import lcsb.mapviewer.model.graphics.LineType;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.alias.SquareCompartmentAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.modifier.Catalysis;
+import lcsb.mapviewer.model.map.modifier.Inhibition;
+import lcsb.mapviewer.model.map.modifier.Modulation;
+import lcsb.mapviewer.model.map.modifier.PhysicalStimulation;
+import lcsb.mapviewer.model.map.modifier.Trigger;
+import lcsb.mapviewer.model.map.reaction.AndOperator;
+import lcsb.mapviewer.model.map.reaction.Modifier;
+import lcsb.mapviewer.model.map.reaction.NodeOperator;
+import lcsb.mapviewer.model.map.reaction.OrOperator;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.SplitOperator;
+import lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction;
+import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction;
+import lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction;
+import lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction;
+import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Degraded;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.Unknown;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+
+/**
+ * This class is a parser for SBGN-ML files.
+ * 
+ * @author Michał Kuźma
+ *
+ */
+public class SbgnmlXmlParser {
+
+	/**
+	 * Default class logger.
+	 */
+	private Logger							logger											= Logger.getLogger(SbgnmlXmlParser.class.getName());
+
+	/**
+	 * List of all processes to be parsed.
+	 */
+	private List<Process>				processes										= new ArrayList<Process>();
+
+	/**
+	 * List of all logic operator glyphs parsed so far.
+	 */
+	private List<Glyph>					logicOperators							= new ArrayList<Glyph>();
+
+	/**
+	 * List of all logic arcs parsed so far.
+	 */
+	private List<Arc>						logicArcs										= new ArrayList<Arc>();
+
+	/**
+	 * Default margin for container name.
+	 */
+	private static final double	CONTAINER_NAME_MARGIN				= 5.0;
+
+	/**
+	 * Part of height of the line used to cross degraded circle that goes behind
+	 * this circle.
+	 */
+	private static final int		CROSS_LINE_EXTENDED_LENGTH	= 7;
+
+	/**
+	 * Default color for parsed compartments.
+	 */
+	private static final Color	COMPARTMENT_COLOR						= new Color(0.5f, 0.5f, 1.0f);
+
+	/**
+	 * Method used to create a model from SBGN-ML file.
+	 * 
+	 * @param params
+	 *          parameters needed for parsing file and creating a model
+	 * @return valid model parsed from the file
+	 * @throws InvalidInputDataExecption
+	 *           thrown when input file is invalid
+	 */
+	public Model createModel(ConverterParams params) throws InvalidInputDataExecption {
+
+		Model model = new ModelFullIndexed(null);
+		model.setIdModel(params.getFilename());
+		model.setSbgnFormat(params.isSbgnFormat());
+
+		// Input file
+		File inputSbgnmlFile = inputStreamToFile(params.getInputStream());
+
+		Sbgn sbgnData;
+		// Check if input file has valid SBGN-ML data
+		try {
+			if (!SbgnUtil.isValid(inputSbgnmlFile)) {
+				throw new InvalidInputDataExecption("Given input is not a valid SBGN-ML file.");
+			}
+
+			// Read data from file
+			sbgnData = SbgnUtil.readFromFile(inputSbgnmlFile);
+		} catch (InvalidInputDataExecption ex) {
+			throw ex;
+		} catch (Exception ex) {
+			throw new InvalidInputDataExecption("Unable to read given file.", ex);
+		}
+
+		// Extract map with all the glyphs and arcs
+		Map map = sbgnData.getMap();
+
+		// Add default compartment
+		Compartment defaultCompartment = new Compartment("default");
+		model.addCompartment(defaultCompartment);
+
+		adjustSizeOfElements(map);
+
+		setModelSize(map, model);
+
+		// Iterate over every glyph
+		for (Glyph g : map.getGlyph()) {
+			parseGlyph(g, model);
+		}
+
+		// Iterate over every arc in the map
+		for (Arc a : map.getArc()) {
+			parseArc(a, model);
+		}
+
+		// Parse all processes created before
+		for (Process p : processes) {
+			try {
+				parseProcess(p, model);
+			} catch (Exception e) {
+				logger.warn("Unable to parse the process: " + p.getCentralPoint().getId());
+			}
+		}
+
+		return model;
+	}
+
+	/**
+	 * Writes input stream into a File.
+	 * @param inputStream
+	 *          Input stream to be written to File
+	 * @return
+	 * 			File handle
+	 */
+	private File inputStreamToFile(InputStream inputStream) {
+		File tempFile = null;
+		try {
+			tempFile = File.createTempFile("stream2file", ".tmp");
+			tempFile.deleteOnExit();
+			try (FileOutputStream out = new FileOutputStream(tempFile)) {
+				IOUtils.copy(inputStream, out);
+			}
+		} catch (Exception ex) {
+			logger.debug("Unable to create temporary file.");
+			return null;
+		}
+		return tempFile;
+	}
+
+	/**
+	 * Method used to adjust the size of elements that have their size
+	 * represented different in the SBGN-ML file. Adjusted elements: Source and
+	 * Sink / Degraded elements, Multimers.
+	 * 
+	 * @param map
+	 *          Map parsed from SBGN-ML file
+	 */
+	private void adjustSizeOfElements(Map map) {
+		for (Glyph g : map.getGlyph()) {
+			GlyphClazz glyphClazz = GlyphClazz.fromClazz(g.getClazz());
+			switch (glyphClazz) {
+				case SOURCE_AND_SINK:
+					g.getBbox().setH(g.getBbox().getH() + 2 * CROSS_LINE_EXTENDED_LENGTH);
+					g.getBbox().setW(g.getBbox().getW() + 2 * CROSS_LINE_EXTENDED_LENGTH);
+					g.getBbox().setX(g.getBbox().getX() - CROSS_LINE_EXTENDED_LENGTH);
+					g.getBbox().setY(g.getBbox().getY() - CROSS_LINE_EXTENDED_LENGTH);
+					break;
+				case COMPLEX_MULTIMER:
+				case MACROMOLECULE_MULTIMER:
+				case NUCLEIC_ACID_FEATURE_MULTIMER:
+				case SIMPLE_CHEMICAL_MULTIMER:
+					int cardinality;
+					try {
+						cardinality = getMultimerCardinality(g);
+					} catch (Exception ex) {
+						cardinality = 2;
+						logger.warn(ex.getMessage() + " Set the default value of 2.");
+					}
+					g.getBbox().setW(g.getBbox().getW() + (cardinality - 1) * SpeciesConverter.HOMODIMER_OFFSET);
+					g.getBbox().setH(g.getBbox().getH() + (cardinality - 1) * SpeciesConverter.HOMODIMER_OFFSET);
+					break;
+				default:
+					break;
+			}
+		}
+	}
+
+	/**
+	 * Method used to compute height and width of the model.
+	 * 
+	 * @param map
+	 *          Map parsed from SBGN-ML file
+	 * @param model
+	 *          Model to be updated
+	 */
+	private void setModelSize(Map map, Model model) {
+		double minX = Double.MAX_VALUE;
+		double minY = Double.MAX_VALUE;
+		double maxX = 0;
+		double maxY = 0;
+
+		// Iterate over every glyph
+		for (Glyph g : map.getGlyph()) {
+			if (GlyphClazz.fromClazz(g.getClazz()).equals(GlyphClazz.ANNOTATION)
+					|| GlyphClazz.fromClazz(g.getClazz()).equals(GlyphClazz.TAG)) {
+				continue;
+			}
+			Bbox bbox = g.getBbox();
+			if (bbox != null) {
+				if (bbox.getX() < minX) {
+					minX = bbox.getX();
+				}
+				if (bbox.getY() < minY) {
+					minY = bbox.getY();
+				}
+				if (bbox.getX() + bbox.getW() > maxX) {
+					maxX = bbox.getX() + bbox.getW();
+				}
+				if (bbox.getY() + bbox.getH() > maxY) {
+					maxY = bbox.getY() + bbox.getH();
+				}
+			}
+		}
+
+		// Iterate over every arc
+		for (Arc a : map.getArc()) {
+			// Since submaps are not yet supported, the arcs connecting them or
+			// tags cannot be used when computing width and height of the model.
+			boolean connectsTagOrSubmap = false;
+			if (a.getSource() instanceof Glyph) {
+				Glyph sourceGlyph = (Glyph) a.getSource();
+				if (GlyphClazz.fromClazz(sourceGlyph.getClazz()).equals(GlyphClazz.TAG)
+						|| GlyphClazz.fromClazz(sourceGlyph.getClazz()).equals(GlyphClazz.SUBMAP)) {
+					connectsTagOrSubmap = true;
+				}
+			}
+			if (a.getTarget() instanceof Glyph) {
+				Glyph targetGlyph = (Glyph) a.getTarget();
+				if (GlyphClazz.fromClazz(targetGlyph.getClazz()).equals(GlyphClazz.TAG)
+						|| GlyphClazz.fromClazz(targetGlyph.getClazz()).equals(GlyphClazz.SUBMAP)) {
+					connectsTagOrSubmap = true;
+				}
+			}
+			// If the arc is not connecting a submap or a tag, check it's points
+			if (!connectsTagOrSubmap) {
+				Start aStart = a.getStart();
+				if (aStart.getX() < minX) {
+					minX = aStart.getX();
+				}
+				if (aStart.getX() > maxX) {
+					maxX = aStart.getX();
+				}
+				if (aStart.getY() < minY) {
+					minY = aStart.getY();
+				}
+				if (aStart.getY() > maxY) {
+					maxY = aStart.getY();
+				}
+				End aEnd = a.getEnd();
+				if (aEnd.getX() < minX) {
+					minX = aEnd.getX();
+				}
+				if (aEnd.getX() > maxX) {
+					maxX = aEnd.getX();
+				}
+				if (aEnd.getY() < minY) {
+					minY = aEnd.getY();
+				}
+				if (aEnd.getY() > maxY) {
+					maxY = aEnd.getY();
+				}
+				for (Next aNext : a.getNext()) {
+					if (aNext.getX() < minX) {
+						minX = aNext.getX();
+					}
+					if (aNext.getX() > maxX) {
+						maxX = aNext.getX();
+					}
+					if (aNext.getY() < minY) {
+						minY = aNext.getY();
+					}
+					if (aNext.getY() > maxY) {
+						maxY = aNext.getY();
+					}
+				}
+			}
+		}
+
+		model.setWidth(maxX + minX);
+		model.setHeight(maxY + minY);
+	}
+
+	/**
+	 * Method used to parse a single glyph.
+	 * 
+	 * @param g
+	 *          glyph to be parsed
+	 * @param model
+	 *          model to be updated
+	 * @throws Exception
+	 */
+	private void parseGlyph(Glyph g, Model model) {
+		Species newSpecies = null;
+		switch (GlyphClazz.fromClazz(g.getClazz())) {
+			case AND:
+			case NOT:
+			case OR:
+				logicOperators.add(g);
+				break;
+			case COMPARTMENT:
+				parseCompartment(g, model);
+				break;
+			case COMPLEX:
+				parseComplex(g, null, true, model);
+				break;
+			case COMPLEX_MULTIMER:
+				parseComplex(g, null, false, model);
+				break;
+			case MACROMOLECULE:
+				newSpecies = new GenericProtein();
+				parseSpecies(g, newSpecies, true, model);
+				break;
+			case MACROMOLECULE_MULTIMER:
+				newSpecies = new GenericProtein();
+				parseSpecies(g, newSpecies, false, model);
+				break;
+			case NUCLEIC_ACID_FEATURE:
+			if (isRNA(g)) {
+				newSpecies = new Rna();
+			} else {
+				newSpecies = new Gene();
+			}
+				parseSpecies(g, newSpecies, true, model);
+				break;
+			case NUCLEIC_ACID_FEATURE_MULTIMER:
+			if (isRNA(g)) {
+				newSpecies = new Rna();
+			} else {
+				newSpecies = new Gene();
+			}
+				parseSpecies(g, newSpecies, false, model);
+				break;
+			case PERTURBING_AGENT:
+			newSpecies = new Phenotype();
+			parseSpecies(g, newSpecies, true, model);
+				break;
+			case PHENOTYPE:
+				newSpecies = new Phenotype();
+				parseSpecies(g, newSpecies, true, model);
+				break;
+			case ASSOCIATION:
+			case DISSOCIATION:
+			case OMITTED_PROCESS:
+			case PROCESS:
+			case UNCERTAIN_PROCESS:
+				processes.add(new Process(g));
+				break;
+			case SIMPLE_CHEMICAL:
+				newSpecies = new SimpleMolecule();
+				parseSpecies(g, newSpecies, true, model);
+				break;
+			case SIMPLE_CHEMICAL_MULTIMER:
+				newSpecies = new SimpleMolecule();
+				parseSpecies(g, newSpecies, false, model);
+				break;
+			case SOURCE_AND_SINK:
+				newSpecies = new Degraded();
+				parseSpecies(g, newSpecies, true, model);
+				break;
+		case TAG:
+		case SUBMAP:
+			logger.warn("Submaps are not supported. Glyph: " + g.getId() + " has not been parsed.");
+			case UNSPECIFIED_ENTITY:
+				newSpecies = new Unknown();
+				parseSpecies(g, newSpecies, true, model);
+				break;
+			default:
+				logger.warn("The glyph " + g.getId() + " of class " + g.getClazz() + " has not been parsed, since it is invalid for SBGN PD map.");
+				break;
+		}
+	}
+
+	/**
+	 * Method used to parse a single arc.
+	 * 
+	 * @param a
+	 *          arc to be parsed
+	 * @param model
+	 *          model to be updated
+	 */
+	private void parseArc(Arc a, Model model) {
+		switch (ArcClazz.fromClazz(a.getClazz())) {
+			case CONSUMPTION:
+				Port arcTargetPort = (Port) a.getTarget();
+				for (Process p : processes) {
+					if (p.getCentralPoint().getPort().contains(arcTargetPort)) {
+						p.addReagentArc(a);
+						break;
+					}
+				}
+				break;
+			case PRODUCTION:
+				Port arcSourcePort = (Port) a.getSource();
+				for (Process p : processes) {
+					if (p.getCentralPoint().getPort().contains(arcSourcePort)) {
+						p.addProductArc(a);
+						break;
+					}
+				}
+				break;
+			case EQUIVALENCE_ARC:
+			logger.warn("Submaps are not supported. Equivalence arc: " + a.getId() + " has not been parsed.");
+				break;
+			case LOGIC_ARC:
+				logicArcs.add(a);
+				break;
+			case CATALYSIS:
+			case INHIBITION:
+			case MODULATION:
+			case NECESSARY_STIMULATION:
+			case STIMULATION:
+				Glyph targetGlyph = (Glyph) a.getTarget();
+				if (GlyphClazz.fromClazz(targetGlyph.getClazz()).equals(GlyphClazz.PHENOTYPE)) {
+					if (!(a.getSource() instanceof Glyph)) {
+						logger.warn("Invalid phenotype arc: " + a.getId());
+						break;
+					}
+					try {
+						parsePhenotypeArc(a, model);
+					} catch (Exception ex) {
+						logger.warn(ex.getMessage());
+					}
+					break;
+				}
+				if (a.getSource() instanceof Glyph) {
+					Glyph sourceGlyph = (Glyph) a.getSource();
+					if (GlyphClazz.fromClazz(sourceGlyph.getClazz()).equals(GlyphClazz.PHENOTYPE)
+							&& (model.getAliasByAliasId(targetGlyph.getId()) instanceof SpeciesAlias)) {
+						try {
+							parsePhenotypeArc(a, model);
+						} catch (InvalidArgumentException ex) {
+							logger.warn("The arc " + a.getId() + " of class " + a.getClazz() + " is not a valid reduced notation arc.");
+						}
+						break;
+					}
+				}
+				for (Process p : processes) {
+					if (p.getCentralPoint().getId().equals(targetGlyph.getId())) {
+						p.addInfluenceArc(a);
+						break;
+					}
+				}
+				break;
+			default:
+				logger.warn("The arc " + a.getId() + " of class " + a.getClazz() + " has not been parsed, since it is invalid for SBGN PD map.");
+		}
+	}
+
+	/**
+	 * Method used to parse arc going to or from a phenotype.
+	 * 
+	 * @param a
+	 *          arc to be parsed
+	 * @param model
+	 *          model to be updated
+	 */
+	private void parsePhenotypeArc(Arc a, Model model) {
+		Reaction reaction;
+
+		switch (ArcClazz.fromClazz(a.getClazz())) {
+
+			case INHIBITION:
+				reaction = new NegativeInfluenceReaction();
+				break;
+			case MODULATION:
+				reaction = new ReducedModulationReaction();
+				break;
+			case NECESSARY_STIMULATION:
+				reaction = new ReducedTriggerReaction();
+				break;
+			case STIMULATION:
+				reaction = new ReducedPhysicalStimulationReaction();
+				break;
+			default:
+				throw new InvalidArgumentException();
+		}
+
+		reaction.setIdReaction(a.getId());
+		reaction.setModel(model);
+
+		Reactant reactant = new Reactant();
+		reactant.setReaction(reaction);
+		Glyph source = (Glyph) a.getSource();
+		reactant.setAlias(model.getAliasByAliasId(source.getId()));
+		reactant.setElement(reactant.getAlias().getElement());
+		List<Point2D> reactantPointList = new ArrayList<>();
+		reactantPointList.add(new Point2D.Double(a.getStart().getX(), a.getStart().getY()));
+		reactantPointList.add(new Point2D.Double(a.getStart().getX(), a.getStart().getY()));
+		PolylineData reactantLine = new PolylineData(reactantPointList);
+		ArrowTypeData atd = new ArrowTypeData();
+		atd.setArrowType(ArrowType.NONE);
+		atd.setArrowLineType(LineType.SOLID);
+		reactantLine.setEndAtd(atd);
+		reactant.setLine(reactantLine);
+		reaction.addReactant(reactant);
+
+		Product product = new Product();
+		product.setReaction(reaction);
+		Glyph target = (Glyph) a.getTarget();
+		product.setAlias(model.getAliasByAliasId(target.getId()));
+		product.setElement(product.getAlias().getElement());
+		List<Point2D> productPointList = getLinePoints(a);
+		PolylineData productLine = parseLine(a, productPointList);
+		product.setLine(productLine);
+		reaction.addProduct(product);
+
+		model.addReaction(reaction);
+	}
+
+	/**
+	 * Method used to parse a single species.
+	 * 
+	 * @param g
+	 *          SBGN-ML glyph representing the species
+	 * @param newSpecies
+	 *          species to be parsed
+	 * @param isHomodimer
+	 *          true if parsed species is not multimer
+	 * @param model
+	 *          model to be updated
+	 */
+	private void parseSpecies(Glyph g, Species newSpecies, boolean isHomodimer, Model model) {
+		newSpecies.setElementId(g.getId());
+		newSpecies.setModel(model);
+		// If Glyph has label with a name, set it as Species name. If not, set
+		// Id as name.
+		if (g.getLabel() != null) {
+			newSpecies.setName(g.getLabel().getText());
+		} else {
+			newSpecies.setName(g.getId());
+		}
+		// Add species to parent complex if there is one
+		if (newSpecies.getComplex() != null) {
+			newSpecies.getComplex().addElement(newSpecies);
+		}
+		// If the species is a multimer, set it's cardinality.
+		if (!isHomodimer) {
+			try {
+				newSpecies.setHomodimer(getMultimerCardinality(g));
+			} catch (Exception ex) {
+				newSpecies.setHomodimer(2);
+				logger.warn(ex.getMessage() + " Set the default value of 2.");
+			}
+		}
+
+		List<Glyph> children = g.getGlyph();
+		for (Glyph child : children) {
+			if (GlyphClazz.fromClazz(child.getClazz()).equals(GlyphClazz.STATE_VARIABLE)) {
+				if (child.getState() == null || child.getState().getVariable() != null) {
+					try {
+						parseStateVariable(child, g, newSpecies);
+					} catch (Exception ex) {
+						logger.warn(ex.getMessage());
+					}
+				} else {
+					String structuralState = child.getState().getValue();
+					if (newSpecies instanceof Protein) {
+						Protein protein = (Protein) newSpecies;
+						protein.setStructuralState(structuralState);
+					} else if (newSpecies instanceof ComplexSpecies) {
+						ComplexSpecies complex = (ComplexSpecies) newSpecies;
+						complex.setStructuralState(structuralState);
+					}
+				}
+			}
+		}
+
+		model.addElement(newSpecies);
+
+		parseAlias(g, newSpecies, model);
+	}
+
+	/**
+	 * Method used to create a new alias from SBGN-ML glyph.
+	 * 
+	 * @param g
+	 *          SBGN-ML glyph representing the alias
+	 * @param newSpecies
+	 *          species of the alias
+	 * @param model
+	 *          model to be updated
+	 */
+	private void parseAlias(Glyph g, Species newSpecies, Model model) {
+		SpeciesAlias newAlias = SpeciesAlias.createAlias(newSpecies);
+		newAlias.setHeight(new Double(g.getBbox().getH()));
+		newAlias.setWidth(new Double(g.getBbox().getW()));
+		newAlias.setX(new Double(g.getBbox().getX()));
+		newAlias.setY(new Double(g.getBbox().getY()));
+		newAlias.setAliasId(g.getId());
+
+		if (g.getCompartmentRef() != null) {
+			Glyph compartmentGlyph = (Glyph) g.getCompartmentRef();
+			CompartmentAlias compartmentAlias = model.getCompartmentAliasByCompartmentAliasId(compartmentGlyph.getId());
+			newAlias.setParent(compartmentAlias);
+			newAlias.setCompartmentAlias(compartmentAlias);
+		} else if (newSpecies.getComplex() == null) {
+			// If the alias is in any compartment, assign it to that compartment
+			for (CompartmentAlias compartmentAlias : model.getCompartmentsAliases()) {
+				boolean dx1 = compartmentAlias.getX() + compartmentAlias.getWidth() - newAlias.getX() >= 0;
+				boolean dx2 = compartmentAlias.getX() - (newAlias.getX() + newAlias.getWidth()) <= 0;
+				boolean dy1 = compartmentAlias.getY() + compartmentAlias.getHeight() - newAlias.getY() >= 0;
+				boolean dy2 = compartmentAlias.getY() - (newAlias.getY() + newAlias.getHeight()) <= 0;
+				if (dx1 && dx2 && dy1 && dy2) {
+					newAlias.setCompartmentAlias(compartmentAlias);
+					newAlias.setParent(compartmentAlias);
+				}
+			}
+		}
+
+		// Parse units of information
+		for (Glyph child : g.getGlyph()) {
+			if (GlyphClazz.fromClazz(child.getClazz()).equals(GlyphClazz.UNIT_OF_INFORMATION)) {
+				parseUnitOfInformation(child, newAlias);
+			}
+		}
+
+		model.addAlias(newAlias);
+	}
+
+	/**
+	 * Method used to retrieve multimer cardinality from a multimer glyph.
+	 * 
+	 * @param g
+	 *          multimer glyph
+	 * @return multimer cardinality
+	 * @throws Exception
+	 *           Exception is thrown if no proper unit of information with
+	 *           cardinality was found
+	 */
+	private int getMultimerCardinality(Glyph g) throws Exception {
+		int multimerCardinality = 0;
+		// Check all the children nodes looking for unit of information with
+		// cardinality
+		List<Glyph> children = g.getGlyph();
+		for (Glyph child : children) {
+			if (GlyphClazz.fromClazz(child.getClazz()) == GlyphClazz.UNIT_OF_INFORMATION) {
+				String[] splitLabel = child.getLabel().getText().split(":");
+				multimerCardinality = Integer.parseInt(splitLabel[1]);
+			}
+		}
+		// If no unit of information was found, or the cardinality is invalid,
+		// raise exception
+		if (multimerCardinality <= 0) {
+			throw new Exception(
+					"No proper unit of information with multimer cardinality was found." + " Glyph: " + g.getId());
+		}
+
+		return multimerCardinality;
+	}
+
+	/**
+	 * Method used to decide if Nucleic-acid feature should be translated to RNA.
+	 * @param g
+	 * 			Nucleic-acid feature glyph
+	 * @return
+	 * 			true if input is RNA
+	 */
+	private boolean isRNA(Glyph g) {
+		boolean rna = false;
+		// Check all the children nodes looking for unit of information
+		List<Glyph> children = g.getGlyph();
+		for (Glyph child : children) {
+			if (GlyphClazz.fromClazz(child.getClazz()) == GlyphClazz.UNIT_OF_INFORMATION) {
+				if (child.getLabel().getText().toLowerCase().contains("rna")) {
+					rna = true;
+				}
+			}
+		}
+
+		return rna;
+	}
+
+	/**
+	 * Method used to parse state variable.
+	 * 
+	 * @param unitOfInformationGlyph
+	 *          unit of information glyph from sbgn-ml file
+	 * @param speciesGlyph
+	 *          glyph that the unit of information considers
+	 * @param newSpecies
+	 *          species that the unit of information considers
+	 * @throws Exception
+	 *             Exception is thrown if state variable is parsed for species
+	 *             other than Protein
+	 */
+	private void parseStateVariable(Glyph unitOfInformationGlyph, Glyph speciesGlyph, Species newSpecies)
+			throws Exception {
+		if (!(newSpecies instanceof Protein)) {
+			throw new Exception("Only macromolecule elements can have state variables.");
+		}
+		Protein protein = (Protein) newSpecies;
+		ModificationResidue mr = new ModificationResidue();
+
+		mr.setSpecies(protein);
+		mr.setIdModificationResidue(unitOfInformationGlyph.getId());
+		if (unitOfInformationGlyph.getState() != null) {
+			// If State variable consists of value and variable
+			mr.setName(unitOfInformationGlyph.getState().getVariable());
+			for (ModificationState ms : ModificationState.values()) {
+				if (ms.getAbbreviation().equals(unitOfInformationGlyph.getState().getValue())) {
+					mr.setState(ms);
+				}
+			}
+		}
+
+		// Compute the angle from coordinates and dimensions
+		Double stateVarX = new Double(unitOfInformationGlyph.getBbox().getX()
+				+ unitOfInformationGlyph.getBbox().getW() / 2 - speciesGlyph.getBbox().getX());
+		Double stateVarY = new Double(unitOfInformationGlyph.getBbox().getY()
+				+ unitOfInformationGlyph.getBbox().getH() / 2 - speciesGlyph.getBbox().getY());
+
+		// Angle difference between endpoints of glyph's edge (divided by Pi)
+		final double edgeAngle = 0.5;
+
+		// Starting angle (top-right corner)
+		final double startingAngle = 0.25;
+
+		// Angle of the state variable
+		Double angle = startingAngle;
+
+		double leftSideDif = Math.abs(stateVarX);
+		double rightSideDif = Math.abs(speciesGlyph.getBbox().getW() - stateVarX);
+		double topSideDif = Math.abs(stateVarY);
+		double bottomSideDif = Math.abs(speciesGlyph.getBbox().getH() - stateVarY);
+		double minDif = Math.min(Math.min(leftSideDif, rightSideDif), Math.min(topSideDif, bottomSideDif));
+
+		if (minDif == leftSideDif) {
+			// State variable is located on glyph's left edge
+			angle += edgeAngle + (stateVarY / speciesGlyph.getBbox().getH()) * edgeAngle;
+		} else if (minDif == rightSideDif) {
+			// State variable is located on glyph's right edge
+			angle -= (stateVarY / speciesGlyph.getBbox().getH()) * edgeAngle;
+		} else if (minDif == topSideDif) {
+			// State variable is located on glyph's top edge
+			angle += edgeAngle - (stateVarX / speciesGlyph.getBbox().getW()) * edgeAngle;
+		} else if (minDif == bottomSideDif) {
+			// State variable is located on glyph's bottom edge
+			angle += 2 * edgeAngle + (stateVarX / speciesGlyph.getBbox().getW()) * edgeAngle;
+		}
+
+		mr.setAngle(angle * Math.PI);
+
+		protein.addModificationResidue(mr);
+	}
+
+	/**
+	 * Method used for parsing units of information.
+	 * 
+	 * @param unitOfInformationGlyph
+	 *          unit of information glyph from sbgn-ml file
+	 * @param alias
+	 *          alias that the unit of information concerns
+	 */
+	private void parseUnitOfInformation(Glyph unitOfInformationGlyph, SpeciesAlias alias) {
+		String unitOfInformationText = unitOfInformationGlyph.getLabel().getText();
+		if (unitOfInformationText.contains(":") && !unitOfInformationText.startsWith("N:")) {
+			String unitOfInformationPrefix = unitOfInformationText.substring(0, unitOfInformationText.indexOf(':'));
+			String unitOfInformationSuffix = unitOfInformationText.substring(unitOfInformationText.indexOf(':') + 1);
+			alias.setAliasStatePrefix(unitOfInformationPrefix);
+			alias.setAliasStateLabel(unitOfInformationSuffix);
+		} else if (!unitOfInformationText.startsWith("N:")) {
+			alias.setAliasStateLabel(unitOfInformationText);
+			alias.setAliasStatePrefix("free input");
+		}
+	}
+
+	/**
+	 * Method used for parsing complex species.
+	 * 
+	 * @param complexGlyph
+	 *          complex species glyph from sbgn-ml file
+	 * @param parentComplexSpecies
+	 *          parent complex species
+	 * @param isHomodimer
+	 *          set if the complex is a homodimer
+	 * @param model
+	 *          model to update with the parsed complex species
+	 */
+	private void parseComplex(Glyph complexGlyph, ComplexSpecies parentComplexSpecies, boolean isHomodimer,
+			Model model) {
+		Species complexSpecies = new ComplexSpecies();
+		if (parentComplexSpecies != null) {
+			complexSpecies.setComplex(parentComplexSpecies);
+		}
+		parseSpecies(complexGlyph, complexSpecies, isHomodimer, model);
+
+		ComplexAlias complexAlias = (ComplexAlias) model.getAliasByAliasId(complexGlyph.getId());
+		for (Glyph child : complexGlyph.getGlyph()) {
+			Species newSpecies;
+			switch (GlyphClazz.fromClazz(child.getClazz())) {
+				case UNSPECIFIED_ENTITY:
+					newSpecies = new Unknown();
+					newSpecies.setComplex((ComplexSpecies) complexSpecies);
+					parseSpecies(child, newSpecies, true, model);
+					break;
+				case SIMPLE_CHEMICAL:
+					newSpecies = new SimpleMolecule();
+					newSpecies.setComplex((ComplexSpecies) complexSpecies);
+					parseSpecies(child, newSpecies, true, model);
+					break;
+				case MACROMOLECULE:
+					newSpecies = new GenericProtein();
+					newSpecies.setComplex((ComplexSpecies) complexSpecies);
+					parseSpecies(child, newSpecies, true, model);
+					break;
+				case NUCLEIC_ACID_FEATURE:
+					newSpecies = new Gene();
+					newSpecies.setComplex((ComplexSpecies) complexSpecies);
+					parseSpecies(child, newSpecies, true, model);
+					break;
+				case SIMPLE_CHEMICAL_MULTIMER:
+					newSpecies = new SimpleMolecule();
+					newSpecies.setComplex((ComplexSpecies) complexSpecies);
+					parseSpecies(child, newSpecies, false, model);
+					break;
+				case MACROMOLECULE_MULTIMER:
+					newSpecies = new GenericProtein();
+					newSpecies.setComplex((ComplexSpecies) complexSpecies);
+					parseSpecies(child, newSpecies, false, model);
+					break;
+				case NUCLEIC_ACID_FEATURE_MULTIMER:
+					newSpecies = new Gene();
+					newSpecies.setComplex((ComplexSpecies) complexSpecies);
+					parseSpecies(child, newSpecies, false, model);
+					break;
+				case COMPLEX:
+					parseComplex(child, (ComplexSpecies) complexSpecies, true, model);
+					break;
+				case COMPLEX_MULTIMER:
+					parseComplex(child, (ComplexSpecies) complexSpecies, false, model);
+					break;
+				default:
+					break;
+			}
+			Alias newAlias = model.getAliasByAliasId(child.getId());
+			if (newAlias != null) {
+				newAlias.setParent(complexAlias);
+				complexAlias.addAlias((SpeciesAlias) newAlias);
+			}
+		}
+	}
+
+	/**
+	 * Method used to compute end point for modifier line.
+	 * 
+	 * @param a
+	 *          SBGN-ML modifier arc
+	 * @param reaction
+	 *          reaction to which the arc points
+	 * @return end point for modifier line
+	 */
+	private Point2D getModifierEndPoint(Arc a, Reaction reaction) {
+		ModifierTypeUtils utils = new ModifierTypeUtils();
+		Point2D result;
+
+		Line2D centerLine = reaction.getCenterLine();
+		double dx = centerLine.getX2() - centerLine.getX1();
+		double dy = centerLine.getY2() - centerLine.getY1();
+		double centerLineAngle = Math.atan2(dy, dx);
+
+		Point2D centerPoint = new Point2D.Double(centerLine.getX1() + dx / 2, centerLine.getY1() + dy / 2);
+
+		// Retrieve second last point from the arc
+		Point2D secondLast;
+		if (a.getNext().isEmpty()) {
+			secondLast = new Point2D.Double(a.getStart().getX(), a.getStart().getY());
+		} else {
+			Next temp = a.getNext().get(a.getNext().size() - 1);
+			secondLast = new Point2D.Double(temp.getX(), temp.getY());
+		}
+
+		double dx2 = secondLast.getX() - centerPoint.getX();
+		double dy2 = secondLast.getY() - centerPoint.getY();
+		double modifierAngle = Math.atan2(dy2, dx2);
+
+		double finalAngle = modifierAngle - centerLineAngle;
+		while (finalAngle < -Math.PI) {
+			finalAngle += 2 * Math.PI;
+		}
+		while (finalAngle > Math.PI) {
+			finalAngle -= 2 * Math.PI;
+		}
+		String lineConnectionType = null;
+
+		// CHECKSTYLE:OFF
+		if (finalAngle < -Math.PI / 3 * 2) {
+			lineConnectionType = "0,4";
+		} else if (finalAngle < -Math.PI / 3) {
+			lineConnectionType = "0,2";
+		} else if (finalAngle < 0) {
+			lineConnectionType = "0,5";
+		} else if (finalAngle < Math.PI / 3) {
+			lineConnectionType = "0,7";
+		} else if (finalAngle < Math.PI / 3 * 2) {
+			lineConnectionType = "0,3";
+		} else {
+			lineConnectionType = "0,6";
+		}
+		// CHECKSTYLE:ON
+
+		result = utils.getAnchorPointOnReactionRect(reaction, lineConnectionType);
+
+		return result;
+	}
+
+	/**
+	 * Method used to parse line points from SBGN-ML arc.
+	 * 
+	 * @param a
+	 *          SBGN-ML arc
+	 * @return list of line points
+	 */
+	private List<Point2D> getLinePoints(Arc a) {
+		List<Point2D> pointList = new ArrayList<>();
+		Point2D startPoint = new Point2D.Double(a.getStart().getX(), a.getStart().getY());
+		Point2D endPoint = new Point2D.Double(a.getEnd().getX(), a.getEnd().getY());
+		pointList.add(startPoint);
+		for (Next nextPoint : a.getNext()) {
+			pointList.add(new Point2D.Double(nextPoint.getX(), nextPoint.getY()));
+		}
+		pointList.add(endPoint);
+		return pointList;
+	}
+
+	/**
+	 * Method used for parsing lines from sbgn-ml arcs.
+	 * 
+	 * @param a
+	 *          SBGN-ML arc
+	 * @param pointList
+	 *          list of points for the line
+	 * @return line parsed from SBGN-ML arc
+	 */
+	private PolylineData parseLine(Arc a, List<Point2D> pointList) {
+		PolylineData line = new PolylineData(pointList);
+		ArrowTypeData atd = new ArrowTypeData();
+
+		switch (ArcClazz.fromClazz(a.getClazz())) {
+			case CATALYSIS:
+				atd = ModifierType.CATALYSIS.getAtd();
+				break;
+			case CONSUMPTION:
+				atd.setArrowType(ArrowType.NONE);
+				break;
+			case INHIBITION:
+				atd = ModifierType.INHIBITION.getAtd();
+				break;
+			case MODULATION:
+				atd = ModifierType.MODULATION_STRING.getAtd();
+				break;
+			case NECESSARY_STIMULATION:
+				atd = ModifierType.TRIGGER_STRING.getAtd();
+				break;
+			case PRODUCTION:
+				atd.setArrowType(ArrowType.FULL);
+				break;
+			case STIMULATION:
+				atd = ModifierType.PHYSICAL_STIMULATION.getAtd();
+				break;
+			case LOGIC_ARC:
+				atd.setArrowType(ArrowType.NONE);
+				break;
+			default:
+				throw new InvalidArgumentException("Wrong arc class.");
+		}
+		atd.setArrowLineType(LineType.SOLID);
+		line.setEndAtd(atd.copy());
+		return line;
+	}
+
+	/**
+	 * Returns {@link AndOperator} for the reaction's reagents port.
+	 * 
+	 * @param p
+	 *          process of the reaction
+	 * @return operator for the reaction port
+	 */
+	private AndOperator getReactionPortAndOperator(Process p) {
+		AndOperator andOperator = new AndOperator();
+		Glyph centralPoint = p.getCentralPoint();
+		Double centralPointX = new Double(centralPoint.getBbox().getX() + centralPoint.getBbox().getW() / 2);
+		Double centralPointY = new Double(centralPoint.getBbox().getY() + centralPoint.getBbox().getH() / 2);
+		Point2D centerOfReactionPoint = new Point2D.Double(centralPointX, centralPointY);
+		Point2D portPoint;
+		if (p.getReagentArcs().size() > 1) {
+			portPoint = new Point2D.Double(p.getReagentArcs().get(0).getEnd().getX(),
+					p.getReagentArcs().get(0).getEnd().getY());
+		} else {
+			portPoint = new Point2D.Double(p.getRevReagentArcs().get(0).getStart().getX(),
+					p.getRevReagentArcs().get(0).getStart().getY());
+		}
+		PolylineData line = new PolylineData(portPoint, centerOfReactionPoint);
+		ArrowTypeData atd = new ArrowTypeData();
+		atd.setArrowType(ArrowType.NONE);
+		atd.setArrowLineType(LineType.SOLID);
+		line.setEndAtd(atd);
+		andOperator.setLine(line);
+		return andOperator;
+	}
+
+	/**
+	 * Returns {@link SplitOperator} for the reaction's products port.
+	 * 
+	 * @param p
+	 *          process of the reaction
+	 * @return operator for the reaction port
+	 */
+	private SplitOperator getReactionPortSplitOperator(Process p) {
+		SplitOperator splitOperator = new SplitOperator();
+		Glyph centralPoint = p.getCentralPoint();
+		Double centralPointX = new Double(centralPoint.getBbox().getX() + centralPoint.getBbox().getW() / 2);
+		Double centralPointY = new Double(centralPoint.getBbox().getY() + centralPoint.getBbox().getH() / 2);
+		Point2D centerOfReactionPoint = new Point2D.Double(centralPointX, centralPointY);
+		Point2D portPoint;
+		if (!p.isReversible()) {
+			portPoint = new Point2D.Double(p.getProductArcs().get(0).getStart().getX(),
+					p.getProductArcs().get(0).getStart().getY());
+		} else {
+			portPoint = new Point2D.Double(p.getRevProductArcs().get(0).getStart().getX(),
+					p.getRevProductArcs().get(0).getStart().getY());
+		}
+		PolylineData line = new PolylineData(centerOfReactionPoint, portPoint);
+		ArrowTypeData atd = new ArrowTypeData();
+		atd.setArrowType(ArrowType.NONE);
+		atd.setArrowLineType(LineType.SOLID);
+		line.setEndAtd(atd);
+		splitOperator.setLine(line);
+		return splitOperator;
+	}
+
+	/**
+	 * Returns instance of {@link Modifier} based on given {@link ArcClazz}.
+	 * 
+	 * @param ac
+	 *          {@link ArcClazz} defining the result
+	 * @return {@link Modifier} of class adequate to given ac
+	 * @throws Exception
+	 *           thrown when no adequate Modifier has been found
+	 */
+	private Modifier getModifierFromArcClazz(ArcClazz ac) throws Exception {
+		switch (ac) {
+			case CATALYSIS:
+				return new Catalysis();
+			case INHIBITION:
+				return new Inhibition();
+			case MODULATION:
+				return new Modulation();
+			case NECESSARY_STIMULATION:
+				return new Trigger();
+			case STIMULATION:
+				return new PhysicalStimulation();
+			default:
+			logger.warn("Modifier arc of invalid class.");
+				throw new Exception("Wrong arc class.");
+		}
+	}
+
+	/**
+	 * Returns center point for given process.
+	 * 
+	 * @param p
+	 *          completely parsed process to compute center point from
+	 * @return center point for given process
+	 */
+	private Point2D getCenterPointFromProcess(Process p) {
+		Double centralPointX = new Double(
+				p.getCentralPoint().getBbox().getX() + p.getCentralPoint().getBbox().getW() / 2);
+		Double centralPointY = new Double(
+				p.getCentralPoint().getBbox().getY() + p.getCentralPoint().getBbox().getH() / 2);
+		Point2D centerOfReactionPoint = new Point2D.Double(centralPointX, centralPointY);
+		return centerOfReactionPoint;
+	}
+
+	/**
+	 * Returns proper Reaction object based on given glyph clazz.
+	 * @param glyphClazz
+	 *          clazz of the process glyph
+	 * @return
+	 * 			Reaction object based on given glyph clazz
+	 */
+	private Reaction getReactionFromProcessGlyphClazz(String glyphClazz) {
+		switch (GlyphClazz.fromClazz(glyphClazz)) {
+			case ASSOCIATION:
+			case DISSOCIATION:
+			case PROCESS:
+				return new StateTransitionReaction();
+			case OMITTED_PROCESS:
+				return new KnownTransitionOmittedReaction();
+			case UNCERTAIN_PROCESS:
+				return new UnknownTransitionReaction();
+			default:
+				throw new InvalidArgumentException();
+
+		}
+	}
+
+	/**
+	 * Method used for parsing processes into reactions.
+	 * 
+	 * @param p
+	 *          process to be parsed
+	 * @param model
+	 *          model to be updated with the parsed reaction
+	 * @throws Exception
+	 *           thrown when the process was invalid
+	 */
+	private void parseProcess(Process p, Model model) throws Exception {
+		if (p.getProductArcs().isEmpty()) {
+			throw new Exception(p.getCentralPoint().getId() + ": The process must have at least one outgoing arc.");
+		}
+		p.setProductsPort((Port) p.getProductArcs().get(0).getSource());
+		for (Arc productArc : p.getProductArcs()) {
+			if (!((Port) productArc.getSource()).equals(p.getProductsPort())) {
+				p.setReversible(true);
+				p.setReagentsPort((Port) productArc.getSource());
+			}
+		}
+		if (p.getReagentsPort() == null && !p.getReagentArcs().isEmpty()) {
+			p.setReagentsPort((Port) p.getReagentArcs().get(0).getTarget());
+		}
+
+		if ((p.getReagentArcs().isEmpty() && !p.isReversible())
+				|| (p.getRevReagentArcs().isEmpty() && p.isReversible())) {
+			throw new Exception(p.getCentralPoint().getId() + ": The process must have at least one incoming arc.");
+		}
+
+		Reaction reaction;
+		if (p.getCentralPoint() == null) {
+			throw new Exception("Process has no central point.");
+		}
+		reaction = getReactionFromProcessGlyphClazz(p.getCentralPoint().getClazz());
+		reaction.setIdReaction(p.getCentralPoint().getId());
+		reaction.setModel(model);
+
+		reaction.setReversible(p.isReversible());
+
+		// If there are multiple inputs, add "AND" operator
+		AndOperator andOperator = null;
+		if (p.getReagentArcs().size() > 1 || p.getRevReagentArcs().size() > 1) {
+			andOperator = getReactionPortAndOperator(p);
+			andOperator.setReaction(reaction);
+			reaction.addNode(andOperator);
+		}
+
+		// If there are multiple outputs, add Split operator
+		SplitOperator splitOperator = null;
+		if ((p.getProductArcs().size() > 1 && !p.isReversible())
+				|| (p.isReversible() && p.getRevProductArcs().size() > 1)) {
+			splitOperator = getReactionPortSplitOperator(p);
+			splitOperator.setReaction(reaction);
+			reaction.addNode(splitOperator);
+		}
+
+		for (Arc a : p.getReagentArcs()) {
+			Reactant reactant = new Reactant();
+			reactant.setReaction(reaction);
+			Glyph source = (Glyph) a.getSource();
+			reactant.setAlias(model.getAliasByAliasId(source.getId()));
+			reactant.setElement(reactant.getAlias().getElement());
+			List<Point2D> pointList = getLinePoints(a);
+			if (p.getReagentArcs().size() == 1) {
+				pointList.add(getCenterPointFromProcess(p));
+			} else {
+				pointList.add(pointList.get(pointList.size() - 1));
+			}
+			PolylineData line = parseLine(a, pointList);
+			reactant.setLine(line);
+			if (andOperator != null) {
+				andOperator.addInput(reactant);
+			}
+
+			reaction.addReactant(reactant);
+		}
+
+		for (Arc a : p.getProductArcs()) {
+			if (((Port) a.getSource()).equals(p.getProductsPort())) {
+				Product product = new Product();
+				product.setReaction(reaction);
+				Glyph target = (Glyph) a.getTarget();
+				product.setAlias(model.getAliasByAliasId(target.getId()));
+				product.setElement(product.getAlias().getElement());
+				List<Point2D> pointList = getLinePoints(a);
+				if (p.getRevProductArcs().size() >= 1) {
+					pointList.add(0, getCenterPointFromProcess(p));
+				} else {
+					pointList.add(0, pointList.get(0));
+				}
+				PolylineData line = parseLine(a, pointList);
+				product.setLine(line);
+				if (splitOperator != null) {
+					splitOperator.addOutput(product);
+				}
+
+				reaction.addProduct(product);
+			} else {
+				Reactant reactant = new Reactant();
+				reactant.setReaction(reaction);
+				Glyph source = (Glyph) a.getTarget();
+				reactant.setAlias(model.getAliasByAliasId(source.getId()));
+				reactant.setElement(reactant.getAlias().getElement());
+				List<Point2D> pointList = getLinePoints(a);
+				if (p.getRevReagentArcs().size() <= 1) {
+					pointList.add(0, getCenterPointFromProcess(p));
+				} else {
+					pointList.add(0, pointList.get(0));
+				}
+				PolylineData line = parseLine(a, pointList);
+				line = line.reverse();
+				reactant.setLine(line);
+				if (andOperator != null) {
+					andOperator.addInput(reactant);
+				}
+
+				reaction.addReactant(reactant);
+			}
+		}
+		for (Arc a : p.getModifierArcs()) {
+			Modifier modifier = null;
+			try {
+				modifier = getModifierFromArcClazz(ArcClazz.fromClazz(a.getClazz()));
+			} catch (Exception ex) {
+				logger.warn("Unable to add modifier");
+				continue;
+			}
+			if (a.getSource() instanceof Glyph) {
+				Glyph sourceGlyph = (Glyph) a.getSource();
+				SpeciesAlias modifierAlias = (SpeciesAlias) model.getAliasByAliasId(sourceGlyph.getId());
+				modifier.setAlias(modifierAlias);
+				modifier.setElement(modifier.getAlias().getElement());
+				List<Point2D> pointList = getLinePoints(a);
+				pointList.remove(pointList.size() - 1);
+				pointList.add(getModifierEndPoint(a, reaction));
+				PolylineData line = parseLine(a, pointList);
+				modifier.setLine(line);
+
+				reaction.addModifier(modifier);
+			} else if (a.getSource() instanceof Port) {
+				// Logic operator
+				try {
+					parseLogicOperator(a, reaction, ArcClazz.fromClazz(a.getClazz()), null, model);
+				} catch (Exception ex) {
+					logger.warn(ex.getMessage());
+				}
+			}
+
+		}
+
+		model.addReaction(reaction);
+	}
+
+	/**
+	 * Returns {@link ArrowTypeData} based on given {@link ArcClazz}.
+	 * 
+	 * @param ac
+	 *          input arc class
+	 * @return ArrowTypeData based on input arrow class
+	 * @throws Exception
+	 *           thrown when invalid arc class was given on input
+	 */
+	private ArrowTypeData getAtdFromArcClazz(ArcClazz ac) throws Exception {
+		ArrowTypeData atd = new ArrowTypeData();
+		switch (ac) {
+			case CATALYSIS:
+				atd = ModifierType.CATALYSIS.getAtd();
+				break;
+			case CONSUMPTION:
+				atd.setArrowType(ArrowType.NONE);
+				break;
+			case INHIBITION:
+				atd = ModifierType.INHIBITION.getAtd();
+				break;
+			case MODULATION:
+				atd = ModifierType.MODULATION_STRING.getAtd();
+				break;
+			case NECESSARY_STIMULATION:
+				atd = ModifierType.TRIGGER_STRING.getAtd();
+				break;
+			case PRODUCTION:
+				atd.setArrowType(ArrowType.FULL);
+				break;
+			case STIMULATION:
+				atd = ModifierType.PHYSICAL_STIMULATION.getAtd();
+				break;
+			case LOGIC_ARC:
+				atd.setArrowType(ArrowType.NONE);
+				break;
+			default:
+				throw new Exception("Wrong arc class.");
+		}
+		return atd.copy();
+	}
+
+	/**
+	 * Method used for parsing logic operators.
+	 * 
+	 * @param arc
+	 *          arc with a starting point in the logic operator
+	 * @param reaction
+	 *          reaction that the logic operator is a part of
+	 * @param modifierClass
+	 *          determines type of source species
+	 * @param targetOperator
+	 *          target logic operator
+	 * @param model
+	 *          model of the map
+	 * @throws Exception
+	 *           thrown when parsed logic operator is invalid
+	 */
+	private void parseLogicOperator(Arc arc, Reaction reaction, ArcClazz modifierClass, NodeOperator targetOperator,
+			Model model) throws Exception {
+		Port operatorPort = (Port) arc.getSource();
+		Glyph logicOperator = null;
+		for (Glyph lo : logicOperators) {
+			if (lo.getPort().contains(operatorPort)) {
+				logicOperator = lo;
+			}
+		}
+		if (logicOperator == null) {
+			throw new Exception("Missing logic operator for logic arc: " + arc.getId());
+		}
+
+		// LogicOperator is valid for CellDesigner only if it has exactly 2
+		// inputs of Species
+		final Glyph tempLogicOperator = logicOperator;
+		boolean isCellDesignerValidLogicOperator = logicArcs.stream()
+				.filter(a -> tempLogicOperator.getPort().contains(a.getTarget()) && !(a.getSource() instanceof Port))
+				.count() == 2;
+		if (!isCellDesignerValidLogicOperator) {
+			throw new Exception("Parsed operator is not valid for CellDesigner: " + logicOperator.getId());
+		}
+
+		NodeOperator operator;
+		switch (GlyphClazz.fromClazz(logicOperator.getClazz())) {
+			case AND:
+				operator = new AndOperator();
+				break;
+			case OR:
+				operator = new OrOperator();
+				break;
+			case NOT:
+			logger.warn("NOT gates are not implemented in the platform. Glyph: " + logicOperator.getId() + " has not been parsed.");
+				return;
+			default:
+				throw new Exception("Wrong logic operator class.");
+		}
+
+		// Parse line from arc and operator glyph
+		Point2D operatorCenterPoint = new Point2D.Double(
+				logicOperator.getBbox().getX() + logicOperator.getBbox().getW() / 2,
+				logicOperator.getBbox().getY() + logicOperator.getBbox().getH() / 2);
+
+		List<Point2D> linePoints = getLinePoints(arc);
+		new ArrayList<Point2D>();
+
+		if (targetOperator == null) {
+			linePoints.remove(linePoints.size() - 1);
+			linePoints.add(getModifierEndPoint(arc, reaction));
+		}
+
+		// Check if operator port is in the line from center point of the
+		// operator. If so, remove that redundant point.
+		double dx, dy;
+		dx = linePoints.get(0).getX() - operatorCenterPoint.getX();
+		dy = linePoints.get(0).getY() - operatorCenterPoint.getY();
+		double dx2, dy2;
+		if (arc.getNext().isEmpty()) {
+			dx2 = linePoints.get(linePoints.size() - 1).getX() - linePoints.get(0).getX();
+			dy2 = linePoints.get(linePoints.size() - 1).getY() - linePoints.get(0).getY();
+		} else {
+			dx2 = arc.getNext().get(0).getX() - linePoints.get(0).getX();
+			dy2 = arc.getNext().get(0).getY() - linePoints.get(0).getY();
+		}
+		DoubleComparator doubleComparator = new DoubleComparator();
+		if (doubleComparator.compare(dy / dx, dy2 / dx2) == 0) {
+			linePoints.remove(0);
+		}
+		linePoints.add(0, operatorCenterPoint);
+
+		PolylineData line = new PolylineData(linePoints);
+		ArrowTypeData atd = getAtdFromArcClazz(ArcClazz.fromClazz(arc.getClazz()));
+
+		atd.setArrowLineType(LineType.SOLID);
+		line.setEndAtd(atd);
+
+		operator.setLine(line);
+		operator.setReaction(reaction);
+
+		if (targetOperator != null) {
+			operator.addOutput(targetOperator);
+			targetOperator.addInput(operator);
+		}
+
+		for (Arc logicArc : logicArcs) {
+			if (logicOperator.getPort().contains(logicArc.getTarget())) {
+				if (logicArc.getSource() instanceof Port) {
+					// The arc has source in logic operator
+					logger.warn(
+							"Logic operators trees are not compatible with CellDesigner. Therefore they are not supported.");
+					continue;
+					// parseLogicOperator(logicArc, reaction, modifierClass,
+					// operator, model);
+				} else {
+					Modifier modifier;
+
+					switch (modifierClass) {
+						case CATALYSIS:
+							modifier = new Catalysis();
+							break;
+						case INHIBITION:
+							modifier = new Inhibition();
+							break;
+						case MODULATION:
+							modifier = new Modulation();
+							break;
+						case NECESSARY_STIMULATION:
+							modifier = new Trigger();
+							break;
+						case STIMULATION:
+							modifier = new PhysicalStimulation();
+							break;
+						default:
+							throw new Exception("Wrong arc class.");
+					}
+
+					Glyph sourceGlyph = (Glyph) logicArc.getSource();
+					SpeciesAlias modifierAlias = (SpeciesAlias) model.getAliasByAliasId(sourceGlyph.getId());
+					modifier.setAlias(modifierAlias);
+					List<Point2D> pointList = getLinePoints(logicArc);
+					pointList.add(operatorCenterPoint);
+					PolylineData newLine = parseLine(logicArc, pointList);
+					modifier.setLine(newLine);
+					modifier.setElement(modifier.getAlias().getElement());
+
+					operator.addInput(modifier);
+
+					reaction.addModifier(modifier);
+				}
+			}
+		}
+		reaction.addNode(operator);
+	}
+
+	/**
+	 * Method used for parsing compartments.
+	 * 
+	 * @param g
+	 *          compartment glyph from sbgn-ml file
+	 * @param model
+	 *          model to be updated with the parsed compartment
+	 */
+	private void parseCompartment(Glyph g, Model model) {
+		Compartment compartment = new Compartment();
+		compartment.setElementId(g.getId());
+		compartment.setModel(model);
+		if (g.getLabel() != null) {
+			compartment.setName(g.getLabel().getText());
+		}
+
+		CompartmentAlias compAlias = new SquareCompartmentAlias();
+		compAlias.setAliasId(g.getId());
+		compAlias.setCompartment(compartment);
+		compAlias.setModel(model);
+		compAlias.setHeight(new Double(g.getBbox().getH()));
+		compAlias.setWidth(new Double(g.getBbox().getW()));
+		compAlias.setX(new Double(g.getBbox().getX()));
+		compAlias.setY(new Double(g.getBbox().getY()));
+		compAlias.setThickness(1.0);
+		compAlias.setColor(COMPARTMENT_COLOR);
+
+		if (g.getLabel() != null && g.getLabel().getBbox() != null) {
+			compAlias.setNamePoint(g.getLabel().getBbox().getX(), g.getLabel().getBbox().getY());
+		} else {
+			compAlias.setNamePoint(compAlias.getX() + compAlias.getThickness() + CONTAINER_NAME_MARGIN,
+					compAlias.getY() + compAlias.getThickness() + CONTAINER_NAME_MARGIN);
+		}
+
+		model.addCompartment(compartment);
+		model.addAlias(compAlias);
+	}
+}
diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AliasConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AliasConverter.java
index 86c468f74e..e0eaca5c12 100644
--- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AliasConverter.java
+++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/AliasConverter.java
@@ -1,240 +1,240 @@
-package lcsb.mapviewer.converter.graphics;
-
-import java.awt.Graphics2D;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.converter.graphics.compartment.ArtifitialCompartmentConverter;
-import lcsb.mapviewer.converter.graphics.compartment.BottomSquareCompartmentConverter;
-import lcsb.mapviewer.converter.graphics.compartment.LeftSquareCompartmentConverter;
-import lcsb.mapviewer.converter.graphics.compartment.OvalCompartmentConverter;
-import lcsb.mapviewer.converter.graphics.compartment.RightSquareCompartmentConverter;
-import lcsb.mapviewer.converter.graphics.compartment.SquareCompartmentConverter;
-import lcsb.mapviewer.converter.graphics.compartment.TopSquareCompartmentConverter;
-import lcsb.mapviewer.converter.graphics.species.AntisenseRnaConverter;
-import lcsb.mapviewer.converter.graphics.species.ComplexConverter;
-import lcsb.mapviewer.converter.graphics.species.DegradedConverter;
-import lcsb.mapviewer.converter.graphics.species.DrugConverter;
-import lcsb.mapviewer.converter.graphics.species.GeneConverter;
-import lcsb.mapviewer.converter.graphics.species.IonConverter;
-import lcsb.mapviewer.converter.graphics.species.PhenotypeConverter;
-import lcsb.mapviewer.converter.graphics.species.ProteinConverter;
-import lcsb.mapviewer.converter.graphics.species.RnaConverter;
-import lcsb.mapviewer.converter.graphics.species.SBGNNucleicAcidFeatureConverter;
-import lcsb.mapviewer.converter.graphics.species.SimpleMoleculeConverter;
-import lcsb.mapviewer.converter.graphics.species.UnknownConverter;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.BottomSquareCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.LeftSquareCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.OvalCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.RightSquareCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.SquareCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.TopSquareCompartmentAlias;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Degraded;
-import lcsb.mapviewer.model.map.species.Drug;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Ion;
-import lcsb.mapviewer.model.map.species.IonChannelProtein;
-import lcsb.mapviewer.model.map.species.Phenotype;
-import lcsb.mapviewer.model.map.species.ReceptorProtein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.TruncatedProtein;
-import lcsb.mapviewer.model.map.species.Unknown;
-
-import org.apache.log4j.Logger;
-
-/**
- * This class is designed to convert any type of alias into a graphic glyph that
- * will be visualized on the graphgics2d object. It contains static instances of
- * converter for every type and use one that is needed for currently processed
- * alias.
- * 
- * @author Piotr Gawron
- * 
- */
-public class AliasConverter implements IAliasConverter<Alias> {
-	/**
-	 * Default class logger.
-	 */
-	private static Logger																						 logger						 = Logger.getLogger(AliasConverter.class.getName());
-
-	// *****************************************************************
-	//
-	// STATIC PART
-	//
-	// *****************************************************************
-
-	/**
-	 * Static map of graphic alias converters used for conversion of aliases. Key
-	 * in this map is a class of element to which alias reference to. Value is
-	 * instance of a converter that can process the alias with the specific
-	 * element type reference.
-	 */
-	private static Map<Class<? extends Element>, IAliasConverter<?>> elementConverters = new HashMap<Class<? extends Element>, IAliasConverter<?>>();
-
-	/**
-	 * Static map of graphic alias converters used for conversion of aliases. Key
-	 * in this map is a class of alias. Value is the converter that can process
-	 * this type of alias.
-	 */
-	private static Map<Class<? extends Alias>, IAliasConverter<?>>	 aliasConverters	 = new HashMap<Class<? extends Alias>, IAliasConverter<?>>();
-
-	static {
-		// at the beginning lets add all implemented aliases
-
-		// for element reference
-		addElementConverter(GenericProtein.class, new ProteinConverter());
-		addElementConverter(IonChannelProtein.class, new ProteinConverter());
-		addElementConverter(ReceptorProtein.class, new ProteinConverter());
-		addElementConverter(TruncatedProtein.class, new ProteinConverter());
-		addElementConverter(Degraded.class, new DegradedConverter());
-		addElementConverter(ComplexSpecies.class, new ComplexConverter());
-		addElementConverter(SimpleMolecule.class, new SimpleMoleculeConverter());
-		addElementConverter(Drug.class, new DrugConverter());
-		addElementConverter(Ion.class, new IonConverter());
-		addElementConverter(Phenotype.class, new PhenotypeConverter());
-		addElementConverter(Rna.class, new RnaConverter());
-		addElementConverter(AntisenseRna.class, new AntisenseRnaConverter());
-		addElementConverter(Gene.class, new GeneConverter());
-		addElementConverter(Unknown.class, new UnknownConverter());
-
-		// for compartment aliases
-		addAliasConverter(SquareCompartmentAlias.class, new SquareCompartmentConverter());
-		addAliasConverter(OvalCompartmentAlias.class, new OvalCompartmentConverter());
-		addAliasConverter(ArtifitialCompartmentAlias.class, new ArtifitialCompartmentConverter());
-		addAliasConverter(BottomSquareCompartmentAlias.class, new BottomSquareCompartmentConverter());
-		addAliasConverter(TopSquareCompartmentAlias.class, new TopSquareCompartmentConverter());
-		addAliasConverter(LeftSquareCompartmentAlias.class, new LeftSquareCompartmentConverter());
-		addAliasConverter(RightSquareCompartmentAlias.class, new RightSquareCompartmentConverter());
-
-	}
-
-	/**
-	 * Method that set a converter for element referenced by alias to process.
-	 * 
-	 * @param clazz
-	 *          class type of element referenced by alias
-	 * @param converter
-	 *          converter that should be used for conversion of this alias
-	 */
-	protected static void addElementConverter(final Class<? extends Element> clazz, final IAliasConverter<?> converter) {
-		if (elementConverters.get(clazz) != null) {
-			logger.warn("Converter for " + clazz + " has been already added");
-		}
-		elementConverters.put(clazz, converter);
-	}
-
-	/**
-	 * Method that set a converter for specific alias type.
-	 * 
-	 * @param clazz
-	 *          class type of alias
-	 * @param converter
-	 *          converter that should be used for conversion of this alias
-	 */
-	protected static void addAliasConverter(final Class<? extends Alias> clazz, final IAliasConverter<?> converter) {
-		if (aliasConverters.get(clazz) != null) {
-			logger.warn("Converter for " + clazz + " has been already added");
-		}
-		aliasConverters.put(clazz, converter);
-	}
-
-	/**
-	 * Returns a converter for given alias. If converter doesn't exist then null
-	 * is returned.
-	 * 
-	 * @param alias
-	 *          alias for which we are loooking for a converter
-	 * @return converter that can be applied for the given alias; null if such
-	 *         converter doesn't exist
-	 */
-	private static IAliasConverter<? extends Alias> getConverterForAlias(final Alias alias) {
-		if (alias == null) {
-			throw new InvalidArgumentException("alias cannot be null");
-		}
-		IAliasConverter<?> result = null;
-		Element element = alias.getElement();
-		if (element != null) {
-			result = elementConverters.get(element.getClass());
-		}
-
-		if (result == null) {
-			result = aliasConverters.get(alias.getClass());
-		}
-		return result;
-	}
-
-	// *******************************************************
-	//
-	// NON-STATIC CLASS DEFINITION
-	//
-	// *******************************************************
-
-	/**
-	 * Converter used for conversion of the alias given in constructor.
-	 */
-	@SuppressWarnings("rawtypes")
-	private IAliasConverter aliasConverter = null;
-
-	/**
-	 * Support constructor. Used in case of SBGN format display
-	 * 
-	 * @param alias
-	 *          alias for which this converter will be used
-	 * @param sbgnFormat
-	 *          boolean value indicating if SBGN display format should be used
-	 */
-	public AliasConverter(final Alias alias, final boolean sbgnFormat) {
-
-		// If alias is a nucleic acid feature to be displayed in SBGN
-		if (sbgnFormat && alias.getElement() != null
-				&& (alias.getElement() instanceof AntisenseRna || alias.getElement() instanceof Rna || alias.getElement() instanceof Gene)) {
-			aliasConverter = new SBGNNucleicAcidFeatureConverter();
-		} else {
-			// If not, at the beginning try to find an appropriate converter
-			aliasConverter = getConverterForAlias(alias);
-		}
-
-		// if we don't know which converter to use then throw an exception
-		if (aliasConverter == null) {
-			throw new InvalidArgumentException("Unknown converter for class: " + alias.getClass() + ". Alias id: " + alias.getAliasId());
-		}
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param alias
-	 *          alias for which this converter will be used
-	 */
-	public AliasConverter(final Alias alias) {
-		this(alias, false);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public void drawAlias(final Alias alias, final Graphics2D graphics, final ConverterParams params) {
-		aliasConverter.drawAlias(alias, graphics, params);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public void drawText(final Alias compAlias, final Graphics2D graphics, final ConverterParams params) throws DrawingException {
-		aliasConverter.drawText(compAlias, graphics, params);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public void drawAlias(Alias alias, Graphics2D graphics, ConverterParams params, List<ColorSchema> visualizedLayoutsColorSchemas) {
-		aliasConverter.drawAlias(alias, graphics, params, visualizedLayoutsColorSchemas);
-	}
-}
+package lcsb.mapviewer.converter.graphics;
+
+import java.awt.Graphics2D;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.converter.graphics.compartment.ArtifitialCompartmentConverter;
+import lcsb.mapviewer.converter.graphics.compartment.BottomSquareCompartmentConverter;
+import lcsb.mapviewer.converter.graphics.compartment.LeftSquareCompartmentConverter;
+import lcsb.mapviewer.converter.graphics.compartment.OvalCompartmentConverter;
+import lcsb.mapviewer.converter.graphics.compartment.RightSquareCompartmentConverter;
+import lcsb.mapviewer.converter.graphics.compartment.SquareCompartmentConverter;
+import lcsb.mapviewer.converter.graphics.compartment.TopSquareCompartmentConverter;
+import lcsb.mapviewer.converter.graphics.species.AntisenseRnaConverter;
+import lcsb.mapviewer.converter.graphics.species.ComplexConverter;
+import lcsb.mapviewer.converter.graphics.species.DegradedConverter;
+import lcsb.mapviewer.converter.graphics.species.DrugConverter;
+import lcsb.mapviewer.converter.graphics.species.GeneConverter;
+import lcsb.mapviewer.converter.graphics.species.IonConverter;
+import lcsb.mapviewer.converter.graphics.species.PhenotypeConverter;
+import lcsb.mapviewer.converter.graphics.species.ProteinConverter;
+import lcsb.mapviewer.converter.graphics.species.RnaConverter;
+import lcsb.mapviewer.converter.graphics.species.SBGNNucleicAcidFeatureConverter;
+import lcsb.mapviewer.converter.graphics.species.SimpleMoleculeConverter;
+import lcsb.mapviewer.converter.graphics.species.UnknownConverter;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.BottomSquareCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.LeftSquareCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.OvalCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.RightSquareCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.SquareCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.TopSquareCompartmentAlias;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Degraded;
+import lcsb.mapviewer.model.map.species.Drug;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Ion;
+import lcsb.mapviewer.model.map.species.IonChannelProtein;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.ReceptorProtein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.TruncatedProtein;
+import lcsb.mapviewer.model.map.species.Unknown;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is designed to convert any type of alias into a graphic glyph that
+ * will be visualized on the graphgics2d object. It contains static instances of
+ * converter for every type and use one that is needed for currently processed
+ * alias.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class AliasConverter implements IAliasConverter<Alias> {
+	/**
+	 * Default class logger.
+	 */
+	private static Logger																						 logger						 = Logger.getLogger(AliasConverter.class.getName());
+
+	// *****************************************************************
+	//
+	// STATIC PART
+	//
+	// *****************************************************************
+
+	/**
+	 * Static map of graphic alias converters used for conversion of aliases. Key
+	 * in this map is a class of element to which alias reference to. Value is
+	 * instance of a converter that can process the alias with the specific
+	 * element type reference.
+	 */
+	private static Map<Class<? extends Element>, IAliasConverter<?>> elementConverters = new HashMap<Class<? extends Element>, IAliasConverter<?>>();
+
+	/**
+	 * Static map of graphic alias converters used for conversion of aliases. Key
+	 * in this map is a class of alias. Value is the converter that can process
+	 * this type of alias.
+	 */
+	private static Map<Class<? extends Alias>, IAliasConverter<?>>	 aliasConverters	 = new HashMap<Class<? extends Alias>, IAliasConverter<?>>();
+
+	static {
+		// at the beginning lets add all implemented aliases
+
+		// for element reference
+		addElementConverter(GenericProtein.class, new ProteinConverter());
+		addElementConverter(IonChannelProtein.class, new ProteinConverter());
+		addElementConverter(ReceptorProtein.class, new ProteinConverter());
+		addElementConverter(TruncatedProtein.class, new ProteinConverter());
+		addElementConverter(Degraded.class, new DegradedConverter());
+		addElementConverter(ComplexSpecies.class, new ComplexConverter());
+		addElementConverter(SimpleMolecule.class, new SimpleMoleculeConverter());
+		addElementConverter(Drug.class, new DrugConverter());
+		addElementConverter(Ion.class, new IonConverter());
+		addElementConverter(Phenotype.class, new PhenotypeConverter());
+		addElementConverter(Rna.class, new RnaConverter());
+		addElementConverter(AntisenseRna.class, new AntisenseRnaConverter());
+		addElementConverter(Gene.class, new GeneConverter());
+		addElementConverter(Unknown.class, new UnknownConverter());
+
+		// for compartment aliases
+		addAliasConverter(SquareCompartmentAlias.class, new SquareCompartmentConverter());
+		addAliasConverter(OvalCompartmentAlias.class, new OvalCompartmentConverter());
+		addAliasConverter(ArtifitialCompartmentAlias.class, new ArtifitialCompartmentConverter());
+		addAliasConverter(BottomSquareCompartmentAlias.class, new BottomSquareCompartmentConverter());
+		addAliasConverter(TopSquareCompartmentAlias.class, new TopSquareCompartmentConverter());
+		addAliasConverter(LeftSquareCompartmentAlias.class, new LeftSquareCompartmentConverter());
+		addAliasConverter(RightSquareCompartmentAlias.class, new RightSquareCompartmentConverter());
+
+	}
+
+	/**
+	 * Method that set a converter for element referenced by alias to process.
+	 * 
+	 * @param clazz
+	 *          class type of element referenced by alias
+	 * @param converter
+	 *          converter that should be used for conversion of this alias
+	 */
+	protected static void addElementConverter(final Class<? extends Element> clazz, final IAliasConverter<?> converter) {
+		if (elementConverters.get(clazz) != null) {
+			logger.warn("Converter for " + clazz + " has been already added");
+		}
+		elementConverters.put(clazz, converter);
+	}
+
+	/**
+	 * Method that set a converter for specific alias type.
+	 * 
+	 * @param clazz
+	 *          class type of alias
+	 * @param converter
+	 *          converter that should be used for conversion of this alias
+	 */
+	protected static void addAliasConverter(final Class<? extends Alias> clazz, final IAliasConverter<?> converter) {
+		if (aliasConverters.get(clazz) != null) {
+			logger.warn("Converter for " + clazz + " has been already added");
+		}
+		aliasConverters.put(clazz, converter);
+	}
+
+	/**
+	 * Returns a converter for given alias. If converter doesn't exist then null
+	 * is returned.
+	 * 
+	 * @param alias
+	 *          alias for which we are loooking for a converter
+	 * @return converter that can be applied for the given alias; null if such
+	 *         converter doesn't exist
+	 */
+	private static IAliasConverter<? extends Alias> getConverterForAlias(final Alias alias) {
+		if (alias == null) {
+			throw new InvalidArgumentException("alias cannot be null");
+		}
+		IAliasConverter<?> result = null;
+		Element element = alias.getElement();
+		if (element != null) {
+			result = elementConverters.get(element.getClass());
+		}
+
+		if (result == null) {
+			result = aliasConverters.get(alias.getClass());
+		}
+		return result;
+	}
+
+	// *******************************************************
+	//
+	// NON-STATIC CLASS DEFINITION
+	//
+	// *******************************************************
+
+	/**
+	 * Converter used for conversion of the alias given in constructor.
+	 */
+	@SuppressWarnings("rawtypes")
+	private IAliasConverter aliasConverter = null;
+
+	/**
+	 * Support constructor. Used in case of SBGN format display
+	 * 
+	 * @param alias
+	 *          alias for which this converter will be used
+	 * @param sbgnFormat
+	 *          boolean value indicating if SBGN display format should be used
+	 */
+	public AliasConverter(final Alias alias, final boolean sbgnFormat) {
+
+		// If alias is a nucleic acid feature to be displayed in SBGN
+		if (sbgnFormat && alias.getElement() != null
+				&& (alias.getElement() instanceof AntisenseRna || alias.getElement() instanceof Rna || alias.getElement() instanceof Gene)) {
+			aliasConverter = new SBGNNucleicAcidFeatureConverter();
+		} else {
+			// If not, at the beginning try to find an appropriate converter
+			aliasConverter = getConverterForAlias(alias);
+		}
+
+		// if we don't know which converter to use then throw an exception
+		if (aliasConverter == null) {
+			throw new InvalidArgumentException("Unknown converter for class: " + alias.getClass() + ". Alias id: " + alias.getAliasId());
+		}
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param alias
+	 *          alias for which this converter will be used
+	 */
+	public AliasConverter(final Alias alias) {
+		this(alias, false);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public void drawAlias(final Alias alias, final Graphics2D graphics, final ConverterParams params) {
+		aliasConverter.drawAlias(alias, graphics, params);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public void drawText(final Alias compAlias, final Graphics2D graphics, final ConverterParams params) throws DrawingException {
+		aliasConverter.drawText(compAlias, graphics, params);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public void drawAlias(Alias alias, Graphics2D graphics, ConverterParams params, List<ColorSchema> visualizedLayoutsColorSchemas) {
+		aliasConverter.drawAlias(alias, graphics, params, visualizedLayoutsColorSchemas);
+	}
+}
diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/IAliasConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/IAliasConverter.java
index 8f0d1ac4bf..bfb089af4f 100644
--- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/IAliasConverter.java
+++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/IAliasConverter.java
@@ -1,73 +1,73 @@
-package lcsb.mapviewer.converter.graphics;
-
-import java.awt.Graphics2D;
-import java.util.List;
-
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-
-/**
- * This interface defines what operations should be possible to convert
- * {@link Alias} into a graphics on Graphics2D object.
- * 
- * @author Piotr Gawron
- * 
- * @param <T>
- *          class of alias to convert
- */
-public interface IAliasConverter<T extends Alias> {
-	/**
-	 * Alpha value (0..255) used for visualizing layout data that are normally
-	 * visualized in javascript.
-	 */
-	int LAYOUT_ALPHA = 200;
-
-	/**
-	 * This function draw representation of the alias on the graphics object.
-	 * 
-	 * @param alias
-	 *          alias that should be drawn
-	 * @param graphics
-	 *          where we want to draw alias
-	 * @param params
-	 *          visuzalization params (like, should the object be filled with
-	 *          solid color, etc.), for more information see
-	 *          {@link ConverterParams}
-	 * 
-	 */
-	void drawAlias(T alias, Graphics2D graphics, ConverterParams params);
-
-	/**
-	 * This function draw representation of the alias on the graphics object.
-	 * 
-	 * @param alias
-	 *          alias that should be drawn
-	 * @param graphics
-	 *          where we want to draw alias
-	 * @param params
-	 *          visuzalization params (like, should the object be filled with
-	 *          solid color, etc.), for more information see
-	 *          {@link ConverterParams}
-	 * @param visualizedLayoutsColorSchemas
-	 *          list of {@link ColorSchema} that were used for visualizing this
-	 *          alias in different layouts that should be overlayed on the alias
-	 * 
-	 */
-	void drawAlias(T alias, Graphics2D graphics, ConverterParams params, List<ColorSchema> visualizedLayoutsColorSchemas);
-
-	/**
-	 * This function will find proper font size to display text within it. Then it
-	 * will print this text.
-	 * 
-	 * @param alias
-	 *          alias with description to be drawn
-	 * @param graphics
-	 *          where the description should be drawn
-	 * @param params
-	 *          parameters of visualization (centering, scale)
-	 * @throws DrawingException
-	 *           thrown when there is a problem with drawing alias
-	 */
-	void drawText(T alias, Graphics2D graphics, ConverterParams params) throws DrawingException;
-
-}
+package lcsb.mapviewer.converter.graphics;
+
+import java.awt.Graphics2D;
+import java.util.List;
+
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+
+/**
+ * This interface defines what operations should be possible to convert
+ * {@link Alias} into a graphics on Graphics2D object.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @param <T>
+ *          class of alias to convert
+ */
+public interface IAliasConverter<T extends Alias> {
+	/**
+	 * Alpha value (0..255) used for visualizing layout data that are normally
+	 * visualized in javascript.
+	 */
+	int LAYOUT_ALPHA = 200;
+
+	/**
+	 * This function draw representation of the alias on the graphics object.
+	 * 
+	 * @param alias
+	 *          alias that should be drawn
+	 * @param graphics
+	 *          where we want to draw alias
+	 * @param params
+	 *          visuzalization params (like, should the object be filled with
+	 *          solid color, etc.), for more information see
+	 *          {@link ConverterParams}
+	 * 
+	 */
+	void drawAlias(T alias, Graphics2D graphics, ConverterParams params);
+
+	/**
+	 * This function draw representation of the alias on the graphics object.
+	 * 
+	 * @param alias
+	 *          alias that should be drawn
+	 * @param graphics
+	 *          where we want to draw alias
+	 * @param params
+	 *          visuzalization params (like, should the object be filled with
+	 *          solid color, etc.), for more information see
+	 *          {@link ConverterParams}
+	 * @param visualizedLayoutsColorSchemas
+	 *          list of {@link ColorSchema} that were used for visualizing this
+	 *          alias in different layouts that should be overlayed on the alias
+	 * 
+	 */
+	void drawAlias(T alias, Graphics2D graphics, ConverterParams params, List<ColorSchema> visualizedLayoutsColorSchemas);
+
+	/**
+	 * This function will find proper font size to display text within it. Then it
+	 * will print this text.
+	 * 
+	 * @param alias
+	 *          alias with description to be drawn
+	 * @param graphics
+	 *          where the description should be drawn
+	 * @param params
+	 *          parameters of visualization (centering, scale)
+	 * @throws DrawingException
+	 *           thrown when there is a problem with drawing alias
+	 */
+	void drawText(T alias, Graphics2D graphics, ConverterParams params) throws DrawingException;
+
+}
diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/ComplexConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/ComplexConverter.java
index 2058bf7e56..12ad662947 100644
--- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/ComplexConverter.java
+++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/ComplexConverter.java
@@ -1,178 +1,178 @@
-package lcsb.mapviewer.converter.graphics.species;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.Stroke;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Path2D;
-import java.awt.geom.PathIterator;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.converter.graphics.ConverterParams;
-import lcsb.mapviewer.converter.graphics.geometry.FontFinder;
-import lcsb.mapviewer.converter.graphics.geometry.RectangleTooSmallException;
-import lcsb.mapviewer.model.graphics.LineType;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-
-/**
- * This class defines methods used for drawing ComplexAlias on the graphics2d
- * object.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ComplexConverter extends SpeciesConverter<ComplexAlias> {
-
-	/**
-	 * How big is the triangle trimmed part of the complex.
-	 */
-	private static final int		TRIMMED_CORNER_SIZE	 = 5;
-
-	/**
-	 * Describes the distance between border of complex and internal border in
-	 * brief view (without children).
-	 */
-	private static final double	INTERNAL_BORDER_DIST = 5.0;
-	/**
-	 * Default class logger.
-	 */
-	private static Logger				logger							 = Logger.getLogger(ComplexConverter.class.getName());
-
-	@Override
-	public void drawAlias(final ComplexAlias alias, final Graphics2D graphics, final ConverterParams params) {
-		if (alias.getState().equalsIgnoreCase("complexnoborder")) {
-			return;
-		}
-
-		int homodir;
-		if (params.isSbgnFormat()) {
-			// If the SBGN display mode is set, multimer is shown as two stacked
-			// glyphs
-			if (alias.getSpecies().getHomodimer() > 1) {
-				homodir = 2;
-			} else {
-				homodir = 1;
-			}
-		} else {
-			homodir = alias.getSpecies().getHomodimer();
-		}
-
-		alias.setWidth(alias.getWidth() - SpeciesConverter.HOMODIMER_OFFSET * (alias.getSpecies().getHomodimer() - 1));
-		alias.setHeight(alias.getHeight() - SpeciesConverter.HOMODIMER_OFFSET * (alias.getSpecies().getHomodimer() - 1));
-
-		alias.setX(alias.getX() + SpeciesConverter.HOMODIMER_OFFSET * (homodir));
-		alias.setY(alias.getY() + SpeciesConverter.HOMODIMER_OFFSET * (homodir));
-
-		for (int i = 0; i < homodir; i++) {
-			alias.setX(alias.getX() - SpeciesConverter.HOMODIMER_OFFSET);
-			alias.setY(alias.getY() - SpeciesConverter.HOMODIMER_OFFSET);
-
-			GeneralPath path = getAliasPath(alias);
-
-			Color c = graphics.getColor();
-			Stroke stroke = graphics.getStroke();
-			graphics.setColor(alias.getColor());
-			graphics.fill(path);
-			graphics.setColor(c);
-			graphics.setStroke(getBorderLine(alias));
-			graphics.draw(path);
-
-			if (alias.getState().equals("brief")) {
-				alias.increaseBorder(-INTERNAL_BORDER_DIST);
-				path = getAliasPath(alias);
-				alias.increaseBorder(INTERNAL_BORDER_DIST);
-				graphics.setStroke(LineType.DOTTED.getStroke());
-				graphics.draw(path);
-			}
-			if (alias.getActivity() && !params.isSbgnFormat()) {
-				alias.increaseBorder(INTERNAL_BORDER_DIST);
-				path = getAliasPath(alias);
-				alias.increaseBorder(-INTERNAL_BORDER_DIST);
-				graphics.setStroke(LineType.DOTTED.getStroke());
-				graphics.draw(path);
-			}
-			graphics.setStroke(stroke);
-		}
-
-		alias.setWidth(alias.getWidth() + SpeciesConverter.HOMODIMER_OFFSET * (alias.getSpecies().getHomodimer() - 1));
-		alias.setHeight(alias.getHeight() + SpeciesConverter.HOMODIMER_OFFSET * (alias.getSpecies().getHomodimer() - 1));
-
-		// SBGN view - multimers are displayed with a unit of information containing
-		// cardinality
-		if (params.isSbgnFormat()) {
-			String unitOfInformationText = null;
-			if (alias.getAliasStatePrefix() != null && alias.getAliasStateLabel() != null) {
-				unitOfInformationText = alias.getAliasStatePrefix() + ":" + alias.getAliasStateLabel();
-			}
-			if (homodir == 2 && (unitOfInformationText == null || !unitOfInformationText.contains("N:"))) {
-				if (unitOfInformationText != null) {
-					unitOfInformationText += "; ";
-				} else {
-					unitOfInformationText = "";
-				}
-				unitOfInformationText += "N:" + alias.getSpecies().getHomodimer();
-			}
-
-			drawUnitOfInformation(unitOfInformationText, alias, graphics);
-		}
-
-		String text = ((ComplexSpecies) alias.getSpecies()).getStructuralState();
-
-		drawStructuralState(text, alias, graphics);
-
-		drawText(alias, graphics, params);
-	}
-
-	@Override
-	public void drawText(final ComplexAlias alias, final Graphics2D graphics, final ConverterParams params) {
-		if (((ComplexAlias) alias).getAliases().size() > 0) {
-			if (alias.getTransparencyLevel() <= params.getLevel()) {
-				super.drawText(alias, graphics, params);
-				return;
-			}
-		}
-		String text = getText(alias);
-		try {
-			double fontSize = DEFAULT_SPECIES_FONT_SIZE;
-			if (alias.getFontSize() != null) {
-				fontSize = alias.getFontSize();
-			}
-			int size = (int) FontFinder.findMaxFontSize(params.getScale() * fontSize, Font.SANS_SERIF, graphics, alias.getBorder(), text);
-			FontFinder.drawText(size, Font.SANS_SERIF, graphics, alias.getBorder(), text);
-		} catch (RectangleTooSmallException e) {
-			logger.warn("Problem with finding font size", e);
-			super.drawText(alias, graphics, params);
-		}
-	}
-
-	/**
-	 * Returns the border of complex alias.
-	 * 
-	 * @param alias
-	 *          exact object for which we want to get a border
-	 * @return border of the alias
-	 */
-	private GeneralPath getAliasPath(final Alias alias) {
-		GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD);
-		path.moveTo(alias.getX() + TRIMMED_CORNER_SIZE, alias.getY());
-		path.lineTo(alias.getX() + alias.getWidth() - TRIMMED_CORNER_SIZE, alias.getY());
-		path.lineTo(alias.getX() + alias.getWidth(), alias.getY() + TRIMMED_CORNER_SIZE);
-		path.lineTo(alias.getX() + alias.getWidth(), alias.getY() + alias.getHeight() - TRIMMED_CORNER_SIZE);
-		path.lineTo(alias.getX() + alias.getWidth() - TRIMMED_CORNER_SIZE, alias.getY() + alias.getHeight());
-		path.lineTo(alias.getX() + TRIMMED_CORNER_SIZE, alias.getY() + alias.getHeight());
-		path.lineTo(alias.getX(), alias.getY() + alias.getHeight() - TRIMMED_CORNER_SIZE);
-		path.lineTo(alias.getX(), alias.getY() + TRIMMED_CORNER_SIZE);
-		path.closePath();
-		return path;
-	}
-
-	@Override
-	public PathIterator getBoundPathIterator(final ComplexAlias alias) {
-		return getAliasPath(alias).getPathIterator(new AffineTransform());
-	}
-}
+package lcsb.mapviewer.converter.graphics.species;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Stroke;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Path2D;
+import java.awt.geom.PathIterator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.converter.graphics.ConverterParams;
+import lcsb.mapviewer.converter.graphics.geometry.FontFinder;
+import lcsb.mapviewer.converter.graphics.geometry.RectangleTooSmallException;
+import lcsb.mapviewer.model.graphics.LineType;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+
+/**
+ * This class defines methods used for drawing ComplexAlias on the graphics2d
+ * object.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ComplexConverter extends SpeciesConverter<ComplexAlias> {
+
+	/**
+	 * How big is the triangle trimmed part of the complex.
+	 */
+	private static final int		TRIMMED_CORNER_SIZE	 = 5;
+
+	/**
+	 * Describes the distance between border of complex and internal border in
+	 * brief view (without children).
+	 */
+	private static final double	INTERNAL_BORDER_DIST = 5.0;
+	/**
+	 * Default class logger.
+	 */
+	private static Logger				logger							 = Logger.getLogger(ComplexConverter.class.getName());
+
+	@Override
+	public void drawAlias(final ComplexAlias alias, final Graphics2D graphics, final ConverterParams params) {
+		if (alias.getState().equalsIgnoreCase("complexnoborder")) {
+			return;
+		}
+
+		int homodir;
+		if (params.isSbgnFormat()) {
+			// If the SBGN display mode is set, multimer is shown as two stacked
+			// glyphs
+			if (alias.getSpecies().getHomodimer() > 1) {
+				homodir = 2;
+			} else {
+				homodir = 1;
+			}
+		} else {
+			homodir = alias.getSpecies().getHomodimer();
+		}
+
+		alias.setWidth(alias.getWidth() - SpeciesConverter.HOMODIMER_OFFSET * (alias.getSpecies().getHomodimer() - 1));
+		alias.setHeight(alias.getHeight() - SpeciesConverter.HOMODIMER_OFFSET * (alias.getSpecies().getHomodimer() - 1));
+
+		alias.setX(alias.getX() + SpeciesConverter.HOMODIMER_OFFSET * (homodir));
+		alias.setY(alias.getY() + SpeciesConverter.HOMODIMER_OFFSET * (homodir));
+
+		for (int i = 0; i < homodir; i++) {
+			alias.setX(alias.getX() - SpeciesConverter.HOMODIMER_OFFSET);
+			alias.setY(alias.getY() - SpeciesConverter.HOMODIMER_OFFSET);
+
+			GeneralPath path = getAliasPath(alias);
+
+			Color c = graphics.getColor();
+			Stroke stroke = graphics.getStroke();
+			graphics.setColor(alias.getColor());
+			graphics.fill(path);
+			graphics.setColor(c);
+			graphics.setStroke(getBorderLine(alias));
+			graphics.draw(path);
+
+			if (alias.getState().equals("brief")) {
+				alias.increaseBorder(-INTERNAL_BORDER_DIST);
+				path = getAliasPath(alias);
+				alias.increaseBorder(INTERNAL_BORDER_DIST);
+				graphics.setStroke(LineType.DOTTED.getStroke());
+				graphics.draw(path);
+			}
+			if (alias.getActivity() && !params.isSbgnFormat()) {
+				alias.increaseBorder(INTERNAL_BORDER_DIST);
+				path = getAliasPath(alias);
+				alias.increaseBorder(-INTERNAL_BORDER_DIST);
+				graphics.setStroke(LineType.DOTTED.getStroke());
+				graphics.draw(path);
+			}
+			graphics.setStroke(stroke);
+		}
+
+		alias.setWidth(alias.getWidth() + SpeciesConverter.HOMODIMER_OFFSET * (alias.getSpecies().getHomodimer() - 1));
+		alias.setHeight(alias.getHeight() + SpeciesConverter.HOMODIMER_OFFSET * (alias.getSpecies().getHomodimer() - 1));
+
+		// SBGN view - multimers are displayed with a unit of information containing
+		// cardinality
+		if (params.isSbgnFormat()) {
+			String unitOfInformationText = null;
+			if (alias.getAliasStatePrefix() != null && alias.getAliasStateLabel() != null) {
+				unitOfInformationText = alias.getAliasStatePrefix() + ":" + alias.getAliasStateLabel();
+			}
+			if (homodir == 2 && (unitOfInformationText == null || !unitOfInformationText.contains("N:"))) {
+				if (unitOfInformationText != null) {
+					unitOfInformationText += "; ";
+				} else {
+					unitOfInformationText = "";
+				}
+				unitOfInformationText += "N:" + alias.getSpecies().getHomodimer();
+			}
+
+			drawUnitOfInformation(unitOfInformationText, alias, graphics);
+		}
+
+		String text = ((ComplexSpecies) alias.getSpecies()).getStructuralState();
+
+		drawStructuralState(text, alias, graphics);
+
+		drawText(alias, graphics, params);
+	}
+
+	@Override
+	public void drawText(final ComplexAlias alias, final Graphics2D graphics, final ConverterParams params) {
+		if (((ComplexAlias) alias).getAliases().size() > 0) {
+			if (alias.getTransparencyLevel() <= params.getLevel()) {
+				super.drawText(alias, graphics, params);
+				return;
+			}
+		}
+		String text = getText(alias);
+		try {
+			double fontSize = DEFAULT_SPECIES_FONT_SIZE;
+			if (alias.getFontSize() != null) {
+				fontSize = alias.getFontSize();
+			}
+			int size = (int) FontFinder.findMaxFontSize(params.getScale() * fontSize, Font.SANS_SERIF, graphics, alias.getBorder(), text);
+			FontFinder.drawText(size, Font.SANS_SERIF, graphics, alias.getBorder(), text);
+		} catch (RectangleTooSmallException e) {
+			logger.warn("Problem with finding font size", e);
+			super.drawText(alias, graphics, params);
+		}
+	}
+
+	/**
+	 * Returns the border of complex alias.
+	 * 
+	 * @param alias
+	 *          exact object for which we want to get a border
+	 * @return border of the alias
+	 */
+	private GeneralPath getAliasPath(final Alias alias) {
+		GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD);
+		path.moveTo(alias.getX() + TRIMMED_CORNER_SIZE, alias.getY());
+		path.lineTo(alias.getX() + alias.getWidth() - TRIMMED_CORNER_SIZE, alias.getY());
+		path.lineTo(alias.getX() + alias.getWidth(), alias.getY() + TRIMMED_CORNER_SIZE);
+		path.lineTo(alias.getX() + alias.getWidth(), alias.getY() + alias.getHeight() - TRIMMED_CORNER_SIZE);
+		path.lineTo(alias.getX() + alias.getWidth() - TRIMMED_CORNER_SIZE, alias.getY() + alias.getHeight());
+		path.lineTo(alias.getX() + TRIMMED_CORNER_SIZE, alias.getY() + alias.getHeight());
+		path.lineTo(alias.getX(), alias.getY() + alias.getHeight() - TRIMMED_CORNER_SIZE);
+		path.lineTo(alias.getX(), alias.getY() + TRIMMED_CORNER_SIZE);
+		path.closePath();
+		return path;
+	}
+
+	@Override
+	public PathIterator getBoundPathIterator(final ComplexAlias alias) {
+		return getAliasPath(alias).getPathIterator(new AffineTransform());
+	}
+}
diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/ProteinConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/ProteinConverter.java
index f5c0b4b596..42c0012bdb 100644
--- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/ProteinConverter.java
+++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/ProteinConverter.java
@@ -1,438 +1,438 @@
-package lcsb.mapviewer.converter.graphics.species;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.Stroke;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Area;
-import java.awt.geom.Ellipse2D;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Path2D;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-import java.awt.geom.RoundRectangle2D;
-import java.util.ArrayList;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.converter.graphics.ConverterParams;
-import lcsb.mapviewer.model.graphics.LineType;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.IonChannelProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.ReceptorProtein;
-import lcsb.mapviewer.model.map.species.TruncatedProtein;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-
-import org.apache.log4j.Logger;
-
-/**
- * This class defines methods used for drawing SpeciesAlias of
- * {@link lcsb.mapviewer.db.model.map.species.Protein Protein} on the
- * {@link Graphics2D} object.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ProteinConverter extends SpeciesConverter<SpeciesAlias> {
-	/**
-	 * Width of the ion part in the open channel representation.
-	 */
-	private static final int	ION_CHANNEL_WIDTH					= 20;
-	/**
-	 * Width of the gap in the open channel representation.
-	 */
-	private static final int	OPEN_ION_CHANNEL_WIDTH		= 20;
-
-	/**
-	 * How big should be the arc in rectangle for protein representation.
-	 */
-	private static final int	RECTANGLE_CORNER_ARC_SIZE	= 10;
-	/**
-	 * Default class logger.
-	 */
-	private static Logger			logger										= Logger.getLogger(ProteinConverter.class.getName());
-
-	/**
-	 * Returns shape of generic protein.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return Shape object defining given alias
-	 */
-	private Shape getGenericShape(final Alias alias) {
-		return new RoundRectangle2D.Double(alias.getX(), alias.getY(), alias.getWidth(), alias.getHeight(), RECTANGLE_CORNER_ARC_SIZE, RECTANGLE_CORNER_ARC_SIZE);
-	}
-
-	@Override
-	public void drawAlias(final SpeciesAlias alias, final Graphics2D graphics, final ConverterParams params) {
-		Protein protein = (Protein) alias.getSpecies();
-
-		// Local variable setting the SBGN visualization
-		boolean sbgnFormat = params.isSbgnFormat();
-
-		// Unit of information text (multimer cardinality and/or ion channel's
-		// state)
-		String unitOfInformationText = "";
-		if (alias.getAliasStatePrefix() != null && alias.getAliasStateLabel() != null) {
-			if (alias.getAliasStatePrefix().equals("free input")) {
-				unitOfInformationText = alias.getAliasStateLabel();
-			} else {
-				unitOfInformationText = alias.getAliasStatePrefix() + ":" + alias.getAliasStateLabel();
-			}
-		}
-
-		int homodir;
-		if (sbgnFormat) {
-			// If the SBGN display mode is set, multimer is shown as two stacked
-			// glyphs
-			if (protein.getHomodimer() > 1) {
-				homodir = 2;
-			} else {
-				homodir = 1;
-			}
-		} else {
-			homodir = protein.getHomodimer();
-		}
-
-		alias.setWidth(alias.getWidth() - SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
-		alias.setHeight(alias.getHeight() - SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
-
-		alias.setX(alias.getX() + SpeciesConverter.HOMODIMER_OFFSET * (homodir));
-		alias.setY(alias.getY() + SpeciesConverter.HOMODIMER_OFFSET * (homodir));
-
-		for (int homodimerId = 0; homodimerId < homodir; homodimerId++) {
-			alias.setX(alias.getX() - SpeciesConverter.HOMODIMER_OFFSET);
-			alias.setY(alias.getY() - SpeciesConverter.HOMODIMER_OFFSET);
-
-			Shape shape = null;
-			if (protein instanceof GenericProtein || sbgnFormat) {
-				shape = getGenericShape(alias);
-				if (alias.getActivity() && !sbgnFormat) {
-					drawActivityGenericProtein(alias, graphics);
-				}
-			} else if (protein instanceof IonChannelProtein) {
-				Area a1;
-				if (!alias.getActivity()) {
-					a1 = new Area(new RoundRectangle2D.Double(
-							alias.getX(), alias.getY(), alias.getWidth() - ION_CHANNEL_WIDTH - 1, alias.getHeight(), RECTANGLE_CORNER_ARC_SIZE, RECTANGLE_CORNER_ARC_SIZE));
-				} else {
-					a1 = new Area(new RoundRectangle2D.Double(
-							alias.getX(), alias.getY(), alias.getWidth() - ION_CHANNEL_WIDTH - OPEN_ION_CHANNEL_WIDTH - 1, alias.getHeight(), RECTANGLE_CORNER_ARC_SIZE,
-							RECTANGLE_CORNER_ARC_SIZE));
-				}
-				Area a2 = new Area(new RoundRectangle2D.Double(
-						alias.getX() + alias.getWidth() - ION_CHANNEL_WIDTH, alias.getY(), ION_CHANNEL_WIDTH, alias.getHeight(), RECTANGLE_CORNER_ARC_SIZE,
-						RECTANGLE_CORNER_ARC_SIZE));
-				a1.add(a2);
-				shape = a1;
-			} else if (protein instanceof TruncatedProtein) {
-				shape = getTruncatedShape(alias);
-				if (alias.getActivity()) {
-					drawActivityTruncatedShape(alias, graphics);
-				}
-			} else if (protein instanceof ReceptorProtein) {
-				shape = getReceptorShape(alias);
-				if (alias.getActivity()) {
-					drawActivityReceptorProtein(alias, graphics);
-				}
-			} else {
-				logger.warn("Unknown shape for protein: " + alias.getSpecies().getElementId() + " " + protein.getClass());
-				shape = getDefaultAliasShape(alias);
-			}
-			Color c = graphics.getColor();
-			graphics.setColor(alias.getColor());
-			graphics.fill(shape);
-			graphics.setColor(c);
-			Stroke stroke = graphics.getStroke();
-			graphics.setStroke(getBorderLine(alias));
-			graphics.draw(shape);
-			graphics.setStroke(stroke);
-
-			// SBGN display mode - units of information and state variables are
-			// printed on the top element only
-			if (!sbgnFormat || (homodimerId == homodir - 1)) {
-				for (ModificationResidue mr : protein.getModificationResidues()) {
-					// SBGN display mode - print empty state variables
-					drawModification(alias, mr, graphics, sbgnFormat, false);
-				}
-				if (sbgnFormat) {
-					// SBGN display mode - ion channel's state is marked as a unit of
-					// information
-					if (protein instanceof IonChannelProtein) {
-						if (!unitOfInformationText.equals("")) {
-							unitOfInformationText = unitOfInformationText.concat("; ");
-						}
-						if (alias.getActivity()) {
-							unitOfInformationText = unitOfInformationText.concat("open");
-						} else {
-							unitOfInformationText = unitOfInformationText.concat("closed");
-						}
-					}
-
-					// SBGN display mode - multimers have their cardinality printed as a
-					// unit of information
-					if (homodir > 1 && (unitOfInformationText == null || !unitOfInformationText.contains("N:"))) {
-						if (!unitOfInformationText.equals("")) {
-							unitOfInformationText = unitOfInformationText.concat("; ");
-						}
-						unitOfInformationText = unitOfInformationText.concat("N:").concat(Integer.toString(protein.getHomodimer()));
-					}
-				}
-			}
-		}
-
-		if (unitOfInformationText.equals("")) {
-			unitOfInformationText = null;
-		}
-
-		String text = protein.getStructuralState();
-		drawStructuralState(text, alias, graphics);
-		drawUnitOfInformation(unitOfInformationText, alias, graphics);
-		drawText(alias, graphics, params);
-		alias.setWidth(alias.getWidth() + SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
-		alias.setHeight(alias.getHeight() + SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
-	}
-
-	/**
-	 * Draws activity border of {@link GenericProtein} alias.
-	 * 
-	 * @param alias
-	 *          {@link SpeciesAlias} that will be drawn
-	 * @param graphics
-	 *          where we are drawing
-	 */
-	private void drawActivityGenericProtein(final SpeciesAlias alias, final Graphics2D graphics) {
-		int border = ACTIVITY_BORDER_DISTANCE;
-		alias.increaseBorder(border);
-		Shape shape2 = getGenericShape(alias);
-		Stroke stroke = graphics.getStroke();
-		graphics.setStroke(LineType.DOTTED.getStroke());
-		graphics.draw(shape2);
-		graphics.setStroke(stroke);
-		alias.increaseBorder(-border);
-	}
-
-	/**
-	 * Draws activity border of {@link ReceptorProtein} alias.
-	 * 
-	 * @param alias
-	 *          {@link SpeciesAlias} that will be drawn
-	 * @param graphics
-	 *          where we are drawing
-	 */
-	public void drawActivityReceptorProtein(final SpeciesAlias alias, final Graphics2D graphics) {
-		int border = ACTIVITY_BORDER_DISTANCE;
-		alias.setX(alias.getX() - border);
-		alias.setY(alias.getY() - border);
-		alias.setWidth(alias.getWidth() + border * 2);
-		alias.setHeight(alias.getHeight() + border * 2);
-		Shape shape2 = getReceptorShape(alias);
-		Stroke stroke = graphics.getStroke();
-		graphics.setStroke(LineType.DOTTED.getStroke());
-		graphics.draw(shape2);
-		graphics.setStroke(stroke);
-		alias.setX(alias.getX() + border);
-		alias.setY(alias.getY() + border);
-		alias.setWidth(alias.getWidth() - border * 2);
-		alias.setHeight(alias.getHeight() - border * 2);
-	}
-
-	/**
-	 * Draws activity border of {@link TruncatedProtein} alias.
-	 * 
-	 * @param alias
-	 *          {@link SpeciesAlias} that will be drawn
-	 * @param graphics
-	 *          where we are drawing
-	 */
-	public void drawActivityTruncatedShape(final SpeciesAlias alias, final Graphics2D graphics) {
-		int border = ACTIVITY_BORDER_DISTANCE;
-		alias.setX(alias.getX() - border);
-		alias.setY(alias.getY() - border);
-		alias.setWidth(alias.getWidth() + border * 2);
-		alias.setHeight(alias.getHeight() + border * 2);
-		Shape shape2 = getTruncatedShape(alias);
-		Stroke stroke = graphics.getStroke();
-		graphics.setStroke(LineType.DOTTED.getStroke());
-		graphics.draw(shape2);
-		graphics.setStroke(stroke);
-		alias.setX(alias.getX() + border);
-		alias.setY(alias.getY() + border);
-		alias.setWidth(alias.getWidth() - border * 2);
-		alias.setHeight(alias.getHeight() - border * 2);
-	}
-
-	/**
-	 * This method draws modification of the alias. If drawEmptyModification is
-	 * set to false then modification is not drawn if empty. If drawDescription is
-	 * set then also description (position) of the modification is drawn on the
-	 * canvas.
-	 * 
-	 * @param alias
-	 *          object that is 'parent' of the residue
-	 * @param mr
-	 *          modification to be drawn
-	 * @param graphics
-	 *          - where the modification should be drawn
-	 * @param drawEmptyModification
-	 *          flag that indicates if we should draw empty modification
-	 * @param drawDescription
-	 *          flag that indicates if we should draw description of the
-	 *          modification
-	 */
-	private void drawModification(final SpeciesAlias alias, final ModificationResidue mr, final Graphics2D graphics, final boolean drawEmptyModification,
-			final boolean drawDescription) {
-		if ((!drawEmptyModification) && (mr.getState() == null)) {
-			return;
-		}
-		double diameter = DEFAULT_MODIFICATION_DIAMETER;
-		double angle = mr.getAngle();
-		if (angle < 0) {
-			angle += Math.PI * 2;
-		}
-		if (angle > Math.PI * 2) {
-			angle -= Math.PI * 2;
-		}
-
-		Point2D p = getResidueCoordinates(alias, mr.getAngle());
-		Ellipse2D ellipse = new Ellipse2D.Double(p.getX() - diameter / 2, p.getY() - diameter / 2, diameter, diameter);
-		Color c = graphics.getColor();
-		graphics.setColor(Color.WHITE);
-		graphics.fill(ellipse);
-		graphics.setColor(c);
-		graphics.draw(ellipse);
-
-		String text = mr.getName();
-		if (!text.equals("") && drawDescription) {
-
-			alias.increaseBorder(-diameter / 2);
-			Point2D p2 = getResidueCoordinates(alias, mr.getAngle());
-			alias.increaseBorder(diameter / 2);
-
-			double width = graphics.getFontMetrics().stringWidth(text);
-			double height = graphics.getFontMetrics().getHeight();
-			if (angle <= RIGHT_TOP_RESIDUE_MAX_ANGLE || angle > BOTTOM_RESIDUE_MAX_ANGLE) {
-				p2.setLocation(p2.getX() - width, p2.getY());
-			} else if (angle > RIGHT_TOP_RESIDUE_MAX_ANGLE && angle <= TOP_RESIDUE_MAX_ANGLE) {
-				p2.setLocation(p2.getX() - width / 2, p2.getY() + height - 2);
-			} else if (angle > TOP_RESIDUE_MAX_ANGLE && angle <= LEFT_RESIDUE_MAX_ANGLE) {
-				p2.setLocation(p2.getX(), p2.getY());
-			} else if (angle > LEFT_RESIDUE_MAX_ANGLE && angle <= BOTTOM_RESIDUE_MAX_ANGLE) {
-				p2.setLocation(p2.getX() - width / 2, p2.getY() - 2);
-			} else {
-				throw new InvalidStateException();
-			}
-
-			graphics.drawString(text, (int) p2.getX(), (int) p2.getY());
-		}
-		ModificationState state = mr.getState();
-		if (state != null) {
-			String str = state.getAbbreviation();
-			Font tmpFont = graphics.getFont();
-			graphics.setFont(getStructuralFont());
-			double x = p.getX() - graphics.getFontMetrics().stringWidth(str) / 2;
-			double y = p.getY() + graphics.getFontMetrics().getAscent() / 2;
-			graphics.drawString(str, (int) x, (int) y);
-			graphics.setFont(tmpFont);
-		}
-
-	}
-
-	/**
-	 * Returns shape of receptor protein.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return Shape object defining given alias
-	 */
-	protected Shape getReceptorShape(final Alias alias) {
-		Shape shape;
-		GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD);
-		ArrayList<Point2D> points = getReceptorPoints(alias);
-		path.moveTo(points.get(0).getX(), points.get(0).getY());
-		for (int i = 1; i < points.size(); i++) {
-			path.lineTo(points.get(i).getX(), points.get(i).getY());
-		}
-		path.closePath();
-		shape = path;
-		return shape;
-	}
-
-	/**
-	 * Returns shape of truncated protein.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return Shape object defining given alias
-	 */
-	protected Shape getTruncatedShape(final Alias alias) {
-		Shape shape;
-		GeneralPath path = new GeneralPath();
-		// CHECKSTYLE:OFF
-		path.moveTo(alias.getX() + 10, alias.getY());
-		path.lineTo(alias.getX() + alias.getWidth(), alias.getY());
-		path.lineTo(alias.getX() + alias.getWidth(), alias.getY() + alias.getHeight() * 3 / 5);
-		path.lineTo(alias.getX() + alias.getWidth() * 4 / 5, alias.getY() + alias.getHeight() * 2 / 5);
-		path.lineTo(alias.getX() + alias.getWidth() * 4 / 5, alias.getY() + alias.getHeight());
-		path.lineTo(alias.getX() + 10, alias.getY() + alias.getHeight());
-		path.curveTo(alias.getX() + 5, alias.getY() + alias.getHeight() - 2, alias.getX() + 2, alias.getY() + alias.getHeight() - 5, alias.getX(), alias.getY()
-				+ alias.getHeight() - 10);
-		path.lineTo(alias.getX(), alias.getY() + 10);
-		path.curveTo(alias.getX() + 2, alias.getY() + 5, alias.getX() + 5, alias.getY() + 2, alias.getX() + 10, alias.getY());
-		// CHECKSTYLE:ON
-
-		path.closePath();
-		shape = path;
-		return shape;
-	}
-
-	/**
-	 * Returns shape of receptor protein as a list of points.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return list of points defining border of the given alias
-	 */
-	private ArrayList<Point2D> getReceptorPoints(final Alias alias) {
-		double x = alias.getX();
-		double y = alias.getY();
-		double width = alias.getWidth();
-		double height = alias.getHeight();
-		ArrayList<Point2D> points = new ArrayList<Point2D>();
-
-		// CHECKSTYLE:OFF
-		points.add(new Point2D.Double(x, y + height * 2 / 5));
-		points.add(new Point2D.Double(x, y));
-		points.add(new Point2D.Double(x + width / 2, y + height / 5));
-		points.add(new Point2D.Double(x + width, y));
-		points.add(new Point2D.Double(x + width, y + height * 2 / 5));
-		points.add(new Point2D.Double(x + width, y + height * 4 / 5));
-		points.add(new Point2D.Double(x + width / 2, y + height));
-		points.add(new Point2D.Double(x, y + height * 4 / 5));
-		// CHECKSTYLE:ON
-
-		return points;
-	}
-
-	@Override
-	public PathIterator getBoundPathIterator(final SpeciesAlias alias) {
-		if (alias.getSpecies() instanceof GenericProtein) {
-			return getGenericShape(alias).getPathIterator(new AffineTransform());
-		} else if (alias.getSpecies() instanceof ReceptorProtein) {
-			return getReceptorShape(alias).getPathIterator(new AffineTransform());
-		} else if (alias.getSpecies() instanceof IonChannelProtein) {
-			return getGenericShape(alias).getPathIterator(new AffineTransform());
-		} else if (alias.getSpecies() instanceof TruncatedProtein) {
-			return getTruncatedShape(alias).getPathIterator(new AffineTransform());
-		} else {
-			throw new InvalidArgumentException("Not implemented protein converter for type: " + alias.getSpecies().getClass());
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.graphics.species;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.Stroke;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Area;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Path2D;
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+import java.awt.geom.RoundRectangle2D;
+import java.util.ArrayList;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.converter.graphics.ConverterParams;
+import lcsb.mapviewer.model.graphics.LineType;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.IonChannelProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.ReceptorProtein;
+import lcsb.mapviewer.model.map.species.TruncatedProtein;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class defines methods used for drawing SpeciesAlias of
+ * {@link lcsb.mapviewer.db.model.map.species.Protein Protein} on the
+ * {@link Graphics2D} object.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ProteinConverter extends SpeciesConverter<SpeciesAlias> {
+	/**
+	 * Width of the ion part in the open channel representation.
+	 */
+	private static final int	ION_CHANNEL_WIDTH					= 20;
+	/**
+	 * Width of the gap in the open channel representation.
+	 */
+	private static final int	OPEN_ION_CHANNEL_WIDTH		= 20;
+
+	/**
+	 * How big should be the arc in rectangle for protein representation.
+	 */
+	private static final int	RECTANGLE_CORNER_ARC_SIZE	= 10;
+	/**
+	 * Default class logger.
+	 */
+	private static Logger			logger										= Logger.getLogger(ProteinConverter.class.getName());
+
+	/**
+	 * Returns shape of generic protein.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return Shape object defining given alias
+	 */
+	private Shape getGenericShape(final Alias alias) {
+		return new RoundRectangle2D.Double(alias.getX(), alias.getY(), alias.getWidth(), alias.getHeight(), RECTANGLE_CORNER_ARC_SIZE, RECTANGLE_CORNER_ARC_SIZE);
+	}
+
+	@Override
+	public void drawAlias(final SpeciesAlias alias, final Graphics2D graphics, final ConverterParams params) {
+		Protein protein = (Protein) alias.getSpecies();
+
+		// Local variable setting the SBGN visualization
+		boolean sbgnFormat = params.isSbgnFormat();
+
+		// Unit of information text (multimer cardinality and/or ion channel's
+		// state)
+		String unitOfInformationText = "";
+		if (alias.getAliasStatePrefix() != null && alias.getAliasStateLabel() != null) {
+			if (alias.getAliasStatePrefix().equals("free input")) {
+				unitOfInformationText = alias.getAliasStateLabel();
+			} else {
+				unitOfInformationText = alias.getAliasStatePrefix() + ":" + alias.getAliasStateLabel();
+			}
+		}
+
+		int homodir;
+		if (sbgnFormat) {
+			// If the SBGN display mode is set, multimer is shown as two stacked
+			// glyphs
+			if (protein.getHomodimer() > 1) {
+				homodir = 2;
+			} else {
+				homodir = 1;
+			}
+		} else {
+			homodir = protein.getHomodimer();
+		}
+
+		alias.setWidth(alias.getWidth() - SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
+		alias.setHeight(alias.getHeight() - SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
+
+		alias.setX(alias.getX() + SpeciesConverter.HOMODIMER_OFFSET * (homodir));
+		alias.setY(alias.getY() + SpeciesConverter.HOMODIMER_OFFSET * (homodir));
+
+		for (int homodimerId = 0; homodimerId < homodir; homodimerId++) {
+			alias.setX(alias.getX() - SpeciesConverter.HOMODIMER_OFFSET);
+			alias.setY(alias.getY() - SpeciesConverter.HOMODIMER_OFFSET);
+
+			Shape shape = null;
+			if (protein instanceof GenericProtein || sbgnFormat) {
+				shape = getGenericShape(alias);
+				if (alias.getActivity() && !sbgnFormat) {
+					drawActivityGenericProtein(alias, graphics);
+				}
+			} else if (protein instanceof IonChannelProtein) {
+				Area a1;
+				if (!alias.getActivity()) {
+					a1 = new Area(new RoundRectangle2D.Double(
+							alias.getX(), alias.getY(), alias.getWidth() - ION_CHANNEL_WIDTH - 1, alias.getHeight(), RECTANGLE_CORNER_ARC_SIZE, RECTANGLE_CORNER_ARC_SIZE));
+				} else {
+					a1 = new Area(new RoundRectangle2D.Double(
+							alias.getX(), alias.getY(), alias.getWidth() - ION_CHANNEL_WIDTH - OPEN_ION_CHANNEL_WIDTH - 1, alias.getHeight(), RECTANGLE_CORNER_ARC_SIZE,
+							RECTANGLE_CORNER_ARC_SIZE));
+				}
+				Area a2 = new Area(new RoundRectangle2D.Double(
+						alias.getX() + alias.getWidth() - ION_CHANNEL_WIDTH, alias.getY(), ION_CHANNEL_WIDTH, alias.getHeight(), RECTANGLE_CORNER_ARC_SIZE,
+						RECTANGLE_CORNER_ARC_SIZE));
+				a1.add(a2);
+				shape = a1;
+			} else if (protein instanceof TruncatedProtein) {
+				shape = getTruncatedShape(alias);
+				if (alias.getActivity()) {
+					drawActivityTruncatedShape(alias, graphics);
+				}
+			} else if (protein instanceof ReceptorProtein) {
+				shape = getReceptorShape(alias);
+				if (alias.getActivity()) {
+					drawActivityReceptorProtein(alias, graphics);
+				}
+			} else {
+				logger.warn("Unknown shape for protein: " + alias.getSpecies().getElementId() + " " + protein.getClass());
+				shape = getDefaultAliasShape(alias);
+			}
+			Color c = graphics.getColor();
+			graphics.setColor(alias.getColor());
+			graphics.fill(shape);
+			graphics.setColor(c);
+			Stroke stroke = graphics.getStroke();
+			graphics.setStroke(getBorderLine(alias));
+			graphics.draw(shape);
+			graphics.setStroke(stroke);
+
+			// SBGN display mode - units of information and state variables are
+			// printed on the top element only
+			if (!sbgnFormat || (homodimerId == homodir - 1)) {
+				for (ModificationResidue mr : protein.getModificationResidues()) {
+					// SBGN display mode - print empty state variables
+					drawModification(alias, mr, graphics, sbgnFormat, false);
+				}
+				if (sbgnFormat) {
+					// SBGN display mode - ion channel's state is marked as a unit of
+					// information
+					if (protein instanceof IonChannelProtein) {
+						if (!unitOfInformationText.equals("")) {
+							unitOfInformationText = unitOfInformationText.concat("; ");
+						}
+						if (alias.getActivity()) {
+							unitOfInformationText = unitOfInformationText.concat("open");
+						} else {
+							unitOfInformationText = unitOfInformationText.concat("closed");
+						}
+					}
+
+					// SBGN display mode - multimers have their cardinality printed as a
+					// unit of information
+					if (homodir > 1 && (unitOfInformationText == null || !unitOfInformationText.contains("N:"))) {
+						if (!unitOfInformationText.equals("")) {
+							unitOfInformationText = unitOfInformationText.concat("; ");
+						}
+						unitOfInformationText = unitOfInformationText.concat("N:").concat(Integer.toString(protein.getHomodimer()));
+					}
+				}
+			}
+		}
+
+		if (unitOfInformationText.equals("")) {
+			unitOfInformationText = null;
+		}
+
+		String text = protein.getStructuralState();
+		drawStructuralState(text, alias, graphics);
+		drawUnitOfInformation(unitOfInformationText, alias, graphics);
+		drawText(alias, graphics, params);
+		alias.setWidth(alias.getWidth() + SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
+		alias.setHeight(alias.getHeight() + SpeciesConverter.HOMODIMER_OFFSET * (protein.getHomodimer() - 1));
+	}
+
+	/**
+	 * Draws activity border of {@link GenericProtein} alias.
+	 * 
+	 * @param alias
+	 *          {@link SpeciesAlias} that will be drawn
+	 * @param graphics
+	 *          where we are drawing
+	 */
+	private void drawActivityGenericProtein(final SpeciesAlias alias, final Graphics2D graphics) {
+		int border = ACTIVITY_BORDER_DISTANCE;
+		alias.increaseBorder(border);
+		Shape shape2 = getGenericShape(alias);
+		Stroke stroke = graphics.getStroke();
+		graphics.setStroke(LineType.DOTTED.getStroke());
+		graphics.draw(shape2);
+		graphics.setStroke(stroke);
+		alias.increaseBorder(-border);
+	}
+
+	/**
+	 * Draws activity border of {@link ReceptorProtein} alias.
+	 * 
+	 * @param alias
+	 *          {@link SpeciesAlias} that will be drawn
+	 * @param graphics
+	 *          where we are drawing
+	 */
+	public void drawActivityReceptorProtein(final SpeciesAlias alias, final Graphics2D graphics) {
+		int border = ACTIVITY_BORDER_DISTANCE;
+		alias.setX(alias.getX() - border);
+		alias.setY(alias.getY() - border);
+		alias.setWidth(alias.getWidth() + border * 2);
+		alias.setHeight(alias.getHeight() + border * 2);
+		Shape shape2 = getReceptorShape(alias);
+		Stroke stroke = graphics.getStroke();
+		graphics.setStroke(LineType.DOTTED.getStroke());
+		graphics.draw(shape2);
+		graphics.setStroke(stroke);
+		alias.setX(alias.getX() + border);
+		alias.setY(alias.getY() + border);
+		alias.setWidth(alias.getWidth() - border * 2);
+		alias.setHeight(alias.getHeight() - border * 2);
+	}
+
+	/**
+	 * Draws activity border of {@link TruncatedProtein} alias.
+	 * 
+	 * @param alias
+	 *          {@link SpeciesAlias} that will be drawn
+	 * @param graphics
+	 *          where we are drawing
+	 */
+	public void drawActivityTruncatedShape(final SpeciesAlias alias, final Graphics2D graphics) {
+		int border = ACTIVITY_BORDER_DISTANCE;
+		alias.setX(alias.getX() - border);
+		alias.setY(alias.getY() - border);
+		alias.setWidth(alias.getWidth() + border * 2);
+		alias.setHeight(alias.getHeight() + border * 2);
+		Shape shape2 = getTruncatedShape(alias);
+		Stroke stroke = graphics.getStroke();
+		graphics.setStroke(LineType.DOTTED.getStroke());
+		graphics.draw(shape2);
+		graphics.setStroke(stroke);
+		alias.setX(alias.getX() + border);
+		alias.setY(alias.getY() + border);
+		alias.setWidth(alias.getWidth() - border * 2);
+		alias.setHeight(alias.getHeight() - border * 2);
+	}
+
+	/**
+	 * This method draws modification of the alias. If drawEmptyModification is
+	 * set to false then modification is not drawn if empty. If drawDescription is
+	 * set then also description (position) of the modification is drawn on the
+	 * canvas.
+	 * 
+	 * @param alias
+	 *          object that is 'parent' of the residue
+	 * @param mr
+	 *          modification to be drawn
+	 * @param graphics
+	 *          - where the modification should be drawn
+	 * @param drawEmptyModification
+	 *          flag that indicates if we should draw empty modification
+	 * @param drawDescription
+	 *          flag that indicates if we should draw description of the
+	 *          modification
+	 */
+	private void drawModification(final SpeciesAlias alias, final ModificationResidue mr, final Graphics2D graphics, final boolean drawEmptyModification,
+			final boolean drawDescription) {
+		if ((!drawEmptyModification) && (mr.getState() == null)) {
+			return;
+		}
+		double diameter = DEFAULT_MODIFICATION_DIAMETER;
+		double angle = mr.getAngle();
+		if (angle < 0) {
+			angle += Math.PI * 2;
+		}
+		if (angle > Math.PI * 2) {
+			angle -= Math.PI * 2;
+		}
+
+		Point2D p = getResidueCoordinates(alias, mr.getAngle());
+		Ellipse2D ellipse = new Ellipse2D.Double(p.getX() - diameter / 2, p.getY() - diameter / 2, diameter, diameter);
+		Color c = graphics.getColor();
+		graphics.setColor(Color.WHITE);
+		graphics.fill(ellipse);
+		graphics.setColor(c);
+		graphics.draw(ellipse);
+
+		String text = mr.getName();
+		if (!text.equals("") && drawDescription) {
+
+			alias.increaseBorder(-diameter / 2);
+			Point2D p2 = getResidueCoordinates(alias, mr.getAngle());
+			alias.increaseBorder(diameter / 2);
+
+			double width = graphics.getFontMetrics().stringWidth(text);
+			double height = graphics.getFontMetrics().getHeight();
+			if (angle <= RIGHT_TOP_RESIDUE_MAX_ANGLE || angle > BOTTOM_RESIDUE_MAX_ANGLE) {
+				p2.setLocation(p2.getX() - width, p2.getY());
+			} else if (angle > RIGHT_TOP_RESIDUE_MAX_ANGLE && angle <= TOP_RESIDUE_MAX_ANGLE) {
+				p2.setLocation(p2.getX() - width / 2, p2.getY() + height - 2);
+			} else if (angle > TOP_RESIDUE_MAX_ANGLE && angle <= LEFT_RESIDUE_MAX_ANGLE) {
+				p2.setLocation(p2.getX(), p2.getY());
+			} else if (angle > LEFT_RESIDUE_MAX_ANGLE && angle <= BOTTOM_RESIDUE_MAX_ANGLE) {
+				p2.setLocation(p2.getX() - width / 2, p2.getY() - 2);
+			} else {
+				throw new InvalidStateException();
+			}
+
+			graphics.drawString(text, (int) p2.getX(), (int) p2.getY());
+		}
+		ModificationState state = mr.getState();
+		if (state != null) {
+			String str = state.getAbbreviation();
+			Font tmpFont = graphics.getFont();
+			graphics.setFont(getStructuralFont());
+			double x = p.getX() - graphics.getFontMetrics().stringWidth(str) / 2;
+			double y = p.getY() + graphics.getFontMetrics().getAscent() / 2;
+			graphics.drawString(str, (int) x, (int) y);
+			graphics.setFont(tmpFont);
+		}
+
+	}
+
+	/**
+	 * Returns shape of receptor protein.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return Shape object defining given alias
+	 */
+	protected Shape getReceptorShape(final Alias alias) {
+		Shape shape;
+		GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD);
+		ArrayList<Point2D> points = getReceptorPoints(alias);
+		path.moveTo(points.get(0).getX(), points.get(0).getY());
+		for (int i = 1; i < points.size(); i++) {
+			path.lineTo(points.get(i).getX(), points.get(i).getY());
+		}
+		path.closePath();
+		shape = path;
+		return shape;
+	}
+
+	/**
+	 * Returns shape of truncated protein.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return Shape object defining given alias
+	 */
+	protected Shape getTruncatedShape(final Alias alias) {
+		Shape shape;
+		GeneralPath path = new GeneralPath();
+		// CHECKSTYLE:OFF
+		path.moveTo(alias.getX() + 10, alias.getY());
+		path.lineTo(alias.getX() + alias.getWidth(), alias.getY());
+		path.lineTo(alias.getX() + alias.getWidth(), alias.getY() + alias.getHeight() * 3 / 5);
+		path.lineTo(alias.getX() + alias.getWidth() * 4 / 5, alias.getY() + alias.getHeight() * 2 / 5);
+		path.lineTo(alias.getX() + alias.getWidth() * 4 / 5, alias.getY() + alias.getHeight());
+		path.lineTo(alias.getX() + 10, alias.getY() + alias.getHeight());
+		path.curveTo(alias.getX() + 5, alias.getY() + alias.getHeight() - 2, alias.getX() + 2, alias.getY() + alias.getHeight() - 5, alias.getX(), alias.getY()
+				+ alias.getHeight() - 10);
+		path.lineTo(alias.getX(), alias.getY() + 10);
+		path.curveTo(alias.getX() + 2, alias.getY() + 5, alias.getX() + 5, alias.getY() + 2, alias.getX() + 10, alias.getY());
+		// CHECKSTYLE:ON
+
+		path.closePath();
+		shape = path;
+		return shape;
+	}
+
+	/**
+	 * Returns shape of receptor protein as a list of points.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return list of points defining border of the given alias
+	 */
+	private ArrayList<Point2D> getReceptorPoints(final Alias alias) {
+		double x = alias.getX();
+		double y = alias.getY();
+		double width = alias.getWidth();
+		double height = alias.getHeight();
+		ArrayList<Point2D> points = new ArrayList<Point2D>();
+
+		// CHECKSTYLE:OFF
+		points.add(new Point2D.Double(x, y + height * 2 / 5));
+		points.add(new Point2D.Double(x, y));
+		points.add(new Point2D.Double(x + width / 2, y + height / 5));
+		points.add(new Point2D.Double(x + width, y));
+		points.add(new Point2D.Double(x + width, y + height * 2 / 5));
+		points.add(new Point2D.Double(x + width, y + height * 4 / 5));
+		points.add(new Point2D.Double(x + width / 2, y + height));
+		points.add(new Point2D.Double(x, y + height * 4 / 5));
+		// CHECKSTYLE:ON
+
+		return points;
+	}
+
+	@Override
+	public PathIterator getBoundPathIterator(final SpeciesAlias alias) {
+		if (alias.getSpecies() instanceof GenericProtein) {
+			return getGenericShape(alias).getPathIterator(new AffineTransform());
+		} else if (alias.getSpecies() instanceof ReceptorProtein) {
+			return getReceptorShape(alias).getPathIterator(new AffineTransform());
+		} else if (alias.getSpecies() instanceof IonChannelProtein) {
+			return getGenericShape(alias).getPathIterator(new AffineTransform());
+		} else if (alias.getSpecies() instanceof TruncatedProtein) {
+			return getTruncatedShape(alias).getPathIterator(new AffineTransform());
+		} else {
+			throw new InvalidArgumentException("Not implemented protein converter for type: " + alias.getSpecies().getClass());
+		}
+	}
+
+}
diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/SpeciesConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/SpeciesConverter.java
index e396f061d7..f9f3a87d43 100644
--- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/SpeciesConverter.java
+++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/species/SpeciesConverter.java
@@ -1,595 +1,595 @@
-package lcsb.mapviewer.converter.graphics.species;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.Stroke;
-import java.awt.geom.Ellipse2D;
-import java.awt.geom.Line2D;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.common.geometry.EllipseTransformation;
-import lcsb.mapviewer.common.geometry.LineTransformation;
-import lcsb.mapviewer.converter.graphics.ConverterParams;
-import lcsb.mapviewer.converter.graphics.IAliasConverter;
-import lcsb.mapviewer.model.graphics.LineType;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-
-/**
- * This class defines basics used for drawing aliases of
- * {@link lcsb.mapviewer.db.model.map.species.Species Species} (node in the
- * graph representation) on the graphics2d object.
- * 
- * @param <T>
- *          alias class that can be drawn with this converter
- * @author Piotr Gawron
- * 
- */
-public abstract class SpeciesConverter<T extends Alias> implements IAliasConverter<T> {
-	/**
-	 * PI value.
-	 */
-	private static final double		PI																			 = Math.PI;
-
-	/**
-	 * Constant determining angle of the top right corner.
-	 */
-	protected static final double	RIGHT_TOP_RESIDUE_MAX_ANGLE							 = 0.25 * PI;
-
-	/**
-	 * Constant determining angle of the top left corner.
-	 */
-	protected static final double	TOP_RESIDUE_MAX_ANGLE										 = 0.75 * PI;
-
-	/**
-	 * Constant determining angle of the bottom left corner.
-	 */
-	protected static final double	LEFT_RESIDUE_MAX_ANGLE									 = 1.25 * PI;
-
-	/**
-	 * Constant determining angle of the bottom right corner.
-	 */
-	protected static final double	BOTTOM_RESIDUE_MAX_ANGLE								 = 1.75 * PI;
-
-	/**
-	 * Default font size for the modifier description.
-	 */
-	protected static final int		DEFAULT_SPECIES_MODIFIER_FONT_SIZE			 = 10;
-
-	/**
-	 * Default diameter of the modification residues.
-	 */
-	protected static final int		DEFAULT_MODIFICATION_DIAMETER						 = 15;
-
-	/**
-	 * How far from the original shape should the activity border be drawn.
-	 */
-	protected static final int		ACTIVITY_BORDER_DISTANCE								 = 5;
-
-	/**
-	 * Default species font size.
-	 */
-	protected static final int		DEFAULT_SPECIES_FONT_SIZE								 = 12;
-
-	/**
-	 * Height of the ellipse that contain structural state description.
-	 */
-	private static final int			STRUCTURAL_STATE_HEIGHT									 = 20;
-
-	/**
-	 * Height of the rectangle that contains unit of information.
-	 */
-	private static final int			UNIT_OF_INFORMATION_HEIGHT							 = 20;
-
-	/**
-	 * Size of the margin in the structural state description.
-	 */
-	private static final int			TEXT_MARGIN_FOR_STRUCTURAL_STATE_DESC		 = 40;
-
-	/**
-	 * Size of the margin in the unit of information description.
-	 */
-	private static final int			TEXT_MARGIN_FOR_UNIT_OF_INFORMATION_DESC = 20;
-
-	/**
-	 * Minimum width of the structural state ellipse.
-	 */
-	private static final int			MIN_STRUCTURAL_STATE_WIDTH							 = 60;
-
-	/**
-	 * Minimum width of the unit of information rectangle.
-	 */
-	private static final int			MIN_UNIT_OF_INFORMATION_WIDTH						 = 40;
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger					logger																	 = Logger.getLogger(SpeciesConverter.class.getName());
-
-	/**
-	 * Graphical helper object with line transformation functions.
-	 */
-	private LineTransformation		lineTransformation											 = new LineTransformation();
-
-	/**
-	 * Graphical helper object with ellipse transformation functions.
-	 */
-	private EllipseTransformation	ellipseTransformation										 = new EllipseTransformation();
-
-	/**
-	 * Default font used to draw structural state of the species.
-	 */
-	private Font									structuralFont													 = null;
-
-	/**
-	 * Default font used to draw unit of information of the species.
-	 */
-	private Font									unitOfInformationFont										 = null;
-
-	/**
-	 * What is the distance between homodimer aliases when homodimer>1.
-	 */
-	public static final int				HOMODIMER_OFFSET												 = 6;
-
-	/**
-	 * Default constructor.
-	 */
-	protected SpeciesConverter() {
-		structuralFont = new Font(Font.SANS_SERIF, 0, DEFAULT_SPECIES_MODIFIER_FONT_SIZE);
-	};
-
-	/**
-	 * Returns coordinates on the alias border for given angle.
-	 * 
-	 * @param alias
-	 *          object on border which the point is looked for
-	 * @param angle
-	 *          angle between X axis center point of alias and point that we are
-	 *          looking for
-	 * @return coordinates on the alias border that correspond to the angle
-	 */
-	protected Point2D getPointCoordinatesOnBorder(final T alias, final double angle) {
-		Point2D result = null;
-		if (alias.getWidth() == 0 && alias.getHeight() == 0) {
-			result = alias.getCenter();
-		} else {
-			double dist = Math.max(alias.getWidth(), alias.getHeight()) * 2;
-			Point2D startPoint = alias.getCenter();
-			double x = startPoint.getX() + Math.cos(angle) * dist;
-			double y = startPoint.getY() - Math.sin(angle) * dist;
-			Point2D endPoint = new Point2D.Double(x, y);
-			Line2D line = new Line2D.Double(startPoint, endPoint);
-			result = lineTransformation.getIntersectionWithPathIterator(line, getBoundPathIterator(alias));
-		}
-		return result;
-
-	}
-
-	/**
-	 * Returns coordinates on the alias border for given angle for residues.
-	 * 
-	 * @param alias
-	 *          object on border which the point is looked for
-	 * @param angle
-	 *          CellDEsigner specific angle defining coordinates (;/)
-	 * @return coordinates on the alias border that correspond to the angle
-	 */
-	protected Point2D getResidueCoordinates(final T alias, double angle) {
-		Point2D result = null;
-		if (alias.getWidth() == 0 && alias.getHeight() == 0) {
-			result = alias.getCenter();
-		} else {
-			double x = 0;
-			double y = 0;
-			while (angle > 2 * PI) {
-				angle -= 2 * PI;
-			}
-			while (angle < 0) {
-				angle += 2 * PI;
-			}
-			if (angle < RIGHT_TOP_RESIDUE_MAX_ANGLE) {
-				// CHECKSTYLE:OFF 0.5 is much readable than any other suggestion
-				double ratio = 0.5 + angle / (PI / 2);
-				// CHECKSTYLE:ON
-				x = alias.getX() + alias.getWidth();
-				y = alias.getY() + alias.getHeight() * (1 - ratio);
-			} else if (angle < TOP_RESIDUE_MAX_ANGLE) {
-				double ratio = (angle - RIGHT_TOP_RESIDUE_MAX_ANGLE) / (PI / 2);
-				y = alias.getY();
-				x = alias.getX() + alias.getWidth() * (1 - ratio);
-			} else if (angle < LEFT_RESIDUE_MAX_ANGLE) {
-				double ratio = (angle - TOP_RESIDUE_MAX_ANGLE) / (PI / 2);
-				y = alias.getY() + alias.getHeight() * (ratio);
-				x = alias.getX();
-			} else if (angle < BOTTOM_RESIDUE_MAX_ANGLE) {
-				double ratio = (angle - LEFT_RESIDUE_MAX_ANGLE) / (PI / 2);
-				y = alias.getY() + alias.getHeight();
-				x = alias.getX() + alias.getWidth() * ratio;
-			} else if (angle <= 2 * PI + Configuration.EPSILON) {
-				double ratio = (angle - BOTTOM_RESIDUE_MAX_ANGLE) / (PI / 2);
-				y = alias.getY() + alias.getHeight() * (1 - ratio);
-				x = alias.getX() + alias.getWidth();
-			} else {
-				throw new InvalidStateException();
-			}
-			Point2D center = alias.getCenter();
-			double correctedAngle = -Math.atan2((y - center.getY()), (x - center.getX()));
-			result = getPointCoordinatesOnBorder(alias, correctedAngle);
-		}
-		return result;
-
-	}
-
-	/**
-	 * Returns default shape of the alias.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return Shape object defining given alias
-	 */
-	protected Shape getDefaultAliasShape(final Alias alias) {
-		Shape shape;
-		shape = new Rectangle(alias.getX().intValue(), alias.getY().intValue(), alias.getWidth().intValue(), alias.getHeight().intValue());
-		return shape;
-	}
-
-	/**
-	 * Returns font that should be used for drawing description of the alias.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a font
-	 * @param params
-	 *          specific drawing parameters (like scale)
-	 * @return Font that should be used for drawing alias description
-	 */
-	protected Font getFont(final Alias alias, ConverterParams params) {
-		double fontSize = DEFAULT_SPECIES_FONT_SIZE;
-		if (alias.getFontSize() != null) {
-			fontSize = alias.getFontSize();
-		}
-		return new Font(Font.SANS_SERIF, 0, (int) (fontSize * params.getScale()));
-	}
-
-	/**
-	 * Returns text describing alias.
-	 * 
-	 * @param alias
-	 *          object under investigation
-	 * @return description of the alias
-	 */
-	protected String getText(final T alias) {
-		String name = "";
-		if (alias.getElement() != null) {
-			name = alias.getElement().getName();
-		}
-		if (name.equals("")) {
-			name = " ";
-		}
-
-		return name;
-	}
-
-	@Override
-	public void drawText(final T alias, final Graphics2D graphics, final ConverterParams params) {
-		String text = getText(alias);
-		Font oldFont = graphics.getFont();
-		Font font = getFont(alias, params);
-		graphics.setColor(Color.BLACK);
-		graphics.setFont(font);
-
-		Point2D point = alias.getCenter();
-		if (alias instanceof ComplexAlias) {
-			if (((ComplexAlias) alias).getAliases().size() > 0) {
-				if (alias.getTransparencyLevel() <= params.getLevel()) {
-					point.setLocation(point.getX(), alias.getY() + alias.getHeight() - graphics.getFontMetrics().getAscent());
-				}
-			}
-		}
-		drawText(point, text, graphics, true, true);
-		graphics.setFont(oldFont);
-	}
-
-	/**
-	 * Return width of the text.
-	 * 
-	 * @param text
-	 *          width of this text will be computed
-	 * @param graphics
-	 *          the width will be computed assuming using this graphics
-	 * @return width of the text
-	 */
-	protected double getTextWidth(final String text, final Graphics2D graphics) {
-		if (text == null) {
-			return 0;
-		}
-		if (text.equals("")) {
-			return 0;
-		}
-
-		double result = 0;
-		String[] lines = text.split("\n");
-		for (String string : lines) {
-			result = Math.max(result, graphics.getFontMetrics().stringWidth(string));
-		}
-
-		return result;
-	}
-
-	/**
-	 * Returns text height.
-	 * 
-	 * @param text
-	 *          height of this text will be computed
-	 * @param graphics
-	 *          the height will be computed assuming using this graphics
-	 * @return height of the text
-	 */
-	protected double getTextHeight(final String text, final Graphics2D graphics) {
-		if (text == null) {
-			return 0;
-		}
-		if (text.equals("")) {
-			return 0;
-		}
-
-		double result = 0;
-		int lines = text.split("\n").length;
-		result = graphics.getFontMetrics().getHeight() * lines;
-		return result;
-	}
-
-	/**
-	 * This method draws a string on graphics using current font. The coordinates
-	 * of the text is given as a point. Both parameters centered described if text
-	 * should be automatically centered horizontally and vertically.
-	 * 
-	 * @param point
-	 *          where the text should be drawn
-	 * @param text
-	 *          text to draw
-	 * @param graphics
-	 *          where we want to draw the object
-	 * @param horizontalCentered
-	 *          should the text be horizontally centered
-	 * @param verticalCentered
-	 *          should the text be vertically centered
-	 */
-	protected void drawText(final Point2D point, final String text, final Graphics2D graphics, final boolean horizontalCentered,
-			final boolean verticalCentered) {
-		double height = getTextHeight(text, graphics);
-		double x = point.getX();
-		double y = point.getY();
-		if (verticalCentered) {
-			y -= height / 2 - graphics.getFontMetrics().getAscent();
-		}
-		String[] lines = text.split("\n");
-
-		double lineHeight = graphics.getFontMetrics().getHeight();
-		for (String string : lines) {
-			double currX = x;
-			if (horizontalCentered) {
-				currX -= getTextWidth(string, graphics) / 2;
-			}
-			graphics.drawString(string, (int) currX, (int) y);
-			y += lineHeight;
-		}
-	}
-
-	/**
-	 * Returns line style used for drawing alias border.
-	 * 
-	 * @param alias
-	 *          alias to be drawn
-	 * @return style of the line used to draw alias
-	 */
-	protected Stroke getBorderLine(final SpeciesAlias alias) {
-		if (!alias.getSpecies().isHypothetical()) {
-			if (alias instanceof ComplexAlias) {
-				return LineType.SOLID_BOLD.getStroke();
-			} else {
-				return LineType.SOLID.getStroke();
-			}
-		} else {
-			if (alias instanceof ComplexAlias) {
-				return LineType.DASHED_BOLD.getStroke();
-			} else {
-				return LineType.DASHED.getStroke();
-			}
-		}
-	}
-
-	/**
-	 * Returns border of the alias as PathIterator.
-	 * 
-	 * @param alias
-	 *          alias for which we are looking for a border
-	 * @return PathIterator object defining given alias
-	 */
-	protected abstract PathIterator getBoundPathIterator(T alias);
-
-	/**
-	 * @return the lineTransformation
-	 */
-	protected LineTransformation getLineTransformation() {
-		return lineTransformation;
-	}
-
-	/**
-	 * @param lineTransformation
-	 *          the lineTransformation to set
-	 */
-	protected void setLineTransformation(LineTransformation lineTransformation) {
-		this.lineTransformation = lineTransformation;
-	}
-
-	/**
-	 * @return the ellipseTransformation
-	 */
-	protected EllipseTransformation getEllipseTransformation() {
-		return ellipseTransformation;
-	}
-
-	/**
-	 * @param ellipseTransformation
-	 *          the ellipseTransformation to set
-	 */
-	protected void setEllipseTransformation(EllipseTransformation ellipseTransformation) {
-		this.ellipseTransformation = ellipseTransformation;
-	}
-
-	/**
-	 * @return the structuralFont
-	 */
-	protected Font getStructuralFont() {
-		return structuralFont;
-	}
-
-	/**
-	 * @param structuralFont
-	 *          the structuralFont to set
-	 */
-	protected void setStructuralFont(Font structuralFont) {
-		this.structuralFont = structuralFont;
-	}
-
-	/**
-	 * @return the unitOfInformationFont
-	 */
-	protected Font getUnitOfInformationFont() {
-		return unitOfInformationFont;
-	}
-
-	/**
-	 * @param unitOfInformationFont
-	 *          the unitOfInformationFont to set
-	 */
-	protected void setUnitOfInformationFont(Font unitOfInformationFont) {
-		this.unitOfInformationFont = unitOfInformationFont;
-	}
-
-	/**
-	 * Draws structural state description of the alias (ellipse in the top part of
-	 * the alias).
-	 * 
-	 * @param text
-	 *          state description text
-	 * @param alias
-	 *          state description should be drawn on this alias
-	 * @param graphics
-	 *          where the drawing should be performed
-	 */
-	protected void drawStructuralState(String text, T alias, final Graphics2D graphics) {
-		if (text == null) {
-			return;
-		}
-
-		Point2D p = getPointCoordinatesOnBorder(alias, Math.PI / 2);
-
-		double width = MIN_STRUCTURAL_STATE_WIDTH;
-		if (!text.trim().equals("")) {
-			width = Math.max(MIN_STRUCTURAL_STATE_WIDTH, graphics.getFontMetrics().stringWidth(text) + TEXT_MARGIN_FOR_STRUCTURAL_STATE_DESC);
-		}
-		width = Math.min(width, alias.getWidth());
-		double height = STRUCTURAL_STATE_HEIGHT;
-
-		Ellipse2D ellipse = new Ellipse2D.Double(p.getX() - width / 2, p.getY() - height / 2, width, height);
-		Color c = graphics.getColor();
-		graphics.setColor(Color.WHITE);
-		graphics.fill(ellipse);
-		graphics.setColor(c);
-		graphics.draw(ellipse);
-		if (!text.trim().equals("")) {
-			Font font = graphics.getFont();
-			graphics.setFont(getStructuralFont());
-
-			width = graphics.getFontMetrics().stringWidth(text);
-			height = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
-
-			graphics.drawString(text, (int) (p.getX() - width / 2), (int) (p.getY() + height / 2));
-			graphics.setFont(font);
-		}
-
-	}
-
-	/**
-	 * Draws unit of information for the alias (rectangle in the top part of the
-	 * alias).
-	 * 
-	 * @param text
-	 *          unit of information text
-	 * @param alias
-	 *          unit of information should be drawn on this alias
-	 * @param graphics
-	 *          where the drawing should be performed
-	 */
-	protected void drawUnitOfInformation(String text, T alias, final Graphics2D graphics) {
-		if (text == null) {
-			return;
-		}
-
-		Point2D p = getPointCoordinatesOnBorder(alias, Math.PI / 2);
-
-		double width = MIN_UNIT_OF_INFORMATION_WIDTH;
-		if (!text.trim().equals("")) {
-			width = Math.max(MIN_UNIT_OF_INFORMATION_WIDTH, graphics.getFontMetrics().stringWidth(text) + TEXT_MARGIN_FOR_UNIT_OF_INFORMATION_DESC);
-		}
-		width = Math.min(width, alias.getWidth());
-		double height = UNIT_OF_INFORMATION_HEIGHT;
-
-		Rectangle2D rectangle = new Rectangle2D.Double(p.getX() - width / 2, p.getY() - height / 2, width, height);
-		Color c = graphics.getColor();
-		graphics.setColor(Color.WHITE);
-		graphics.fill(rectangle);
-		graphics.setColor(c);
-		graphics.draw(rectangle);
-		if (!text.trim().equals("")) {
-			Font font = graphics.getFont();
-			graphics.setFont(getUnitOfInformationFont());
-
-			width = graphics.getFontMetrics().stringWidth(text);
-			height = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
-
-			graphics.drawString(text, (int) (p.getX() - width / 2), (int) (p.getY() + height / 2));
-			graphics.setFont(font);
-		}
-	}
-
-	@Override
-	public void drawAlias(T alias, Graphics2D graphics, ConverterParams params, List<ColorSchema> visualizedLayoutsColorSchemas) {
-		drawAlias(alias, graphics, params);
-
-		Color oldColor = graphics.getColor();
-		int count = 0;
-		double width = alias.getWidth() / visualizedLayoutsColorSchemas.size();
-		for (ColorSchema schema : visualizedLayoutsColorSchemas) {
-			if (schema != null) {
-				double startX = (double) count / (double) visualizedLayoutsColorSchemas.size();
-				graphics.setColor(Color.BLACK);
-
-				int x = (int) (startX * alias.getWidth() + alias.getX());
-				graphics.drawRect(x, alias.getY().intValue(), (int) width, alias.getHeight().intValue());
-
-				Color color = schema.getNormalizedColor();
-				Color bgAlphaColor = new Color(color.getRed(), color.getGreen(), color.getBlue(), LAYOUT_ALPHA);
-				graphics.setColor(bgAlphaColor);
-				graphics.fillRect(x, alias.getY().intValue(), (int) width, alias.getHeight().intValue());
-			}
-			count++;
-		}
-		graphics.setColor(oldColor);
-	}
-
-}
+package lcsb.mapviewer.converter.graphics.species;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.Stroke;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Line2D;
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.common.geometry.EllipseTransformation;
+import lcsb.mapviewer.common.geometry.LineTransformation;
+import lcsb.mapviewer.converter.graphics.ConverterParams;
+import lcsb.mapviewer.converter.graphics.IAliasConverter;
+import lcsb.mapviewer.model.graphics.LineType;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+
+/**
+ * This class defines basics used for drawing aliases of
+ * {@link lcsb.mapviewer.db.model.map.species.Species Species} (node in the
+ * graph representation) on the graphics2d object.
+ * 
+ * @param <T>
+ *          alias class that can be drawn with this converter
+ * @author Piotr Gawron
+ * 
+ */
+public abstract class SpeciesConverter<T extends Alias> implements IAliasConverter<T> {
+	/**
+	 * PI value.
+	 */
+	private static final double		PI																			 = Math.PI;
+
+	/**
+	 * Constant determining angle of the top right corner.
+	 */
+	protected static final double	RIGHT_TOP_RESIDUE_MAX_ANGLE							 = 0.25 * PI;
+
+	/**
+	 * Constant determining angle of the top left corner.
+	 */
+	protected static final double	TOP_RESIDUE_MAX_ANGLE										 = 0.75 * PI;
+
+	/**
+	 * Constant determining angle of the bottom left corner.
+	 */
+	protected static final double	LEFT_RESIDUE_MAX_ANGLE									 = 1.25 * PI;
+
+	/**
+	 * Constant determining angle of the bottom right corner.
+	 */
+	protected static final double	BOTTOM_RESIDUE_MAX_ANGLE								 = 1.75 * PI;
+
+	/**
+	 * Default font size for the modifier description.
+	 */
+	protected static final int		DEFAULT_SPECIES_MODIFIER_FONT_SIZE			 = 10;
+
+	/**
+	 * Default diameter of the modification residues.
+	 */
+	protected static final int		DEFAULT_MODIFICATION_DIAMETER						 = 15;
+
+	/**
+	 * How far from the original shape should the activity border be drawn.
+	 */
+	protected static final int		ACTIVITY_BORDER_DISTANCE								 = 5;
+
+	/**
+	 * Default species font size.
+	 */
+	protected static final int		DEFAULT_SPECIES_FONT_SIZE								 = 12;
+
+	/**
+	 * Height of the ellipse that contain structural state description.
+	 */
+	private static final int			STRUCTURAL_STATE_HEIGHT									 = 20;
+
+	/**
+	 * Height of the rectangle that contains unit of information.
+	 */
+	private static final int			UNIT_OF_INFORMATION_HEIGHT							 = 20;
+
+	/**
+	 * Size of the margin in the structural state description.
+	 */
+	private static final int			TEXT_MARGIN_FOR_STRUCTURAL_STATE_DESC		 = 40;
+
+	/**
+	 * Size of the margin in the unit of information description.
+	 */
+	private static final int			TEXT_MARGIN_FOR_UNIT_OF_INFORMATION_DESC = 20;
+
+	/**
+	 * Minimum width of the structural state ellipse.
+	 */
+	private static final int			MIN_STRUCTURAL_STATE_WIDTH							 = 60;
+
+	/**
+	 * Minimum width of the unit of information rectangle.
+	 */
+	private static final int			MIN_UNIT_OF_INFORMATION_WIDTH						 = 40;
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger					logger																	 = Logger.getLogger(SpeciesConverter.class.getName());
+
+	/**
+	 * Graphical helper object with line transformation functions.
+	 */
+	private LineTransformation		lineTransformation											 = new LineTransformation();
+
+	/**
+	 * Graphical helper object with ellipse transformation functions.
+	 */
+	private EllipseTransformation	ellipseTransformation										 = new EllipseTransformation();
+
+	/**
+	 * Default font used to draw structural state of the species.
+	 */
+	private Font									structuralFont													 = null;
+
+	/**
+	 * Default font used to draw unit of information of the species.
+	 */
+	private Font									unitOfInformationFont										 = null;
+
+	/**
+	 * What is the distance between homodimer aliases when homodimer>1.
+	 */
+	public static final int				HOMODIMER_OFFSET												 = 6;
+
+	/**
+	 * Default constructor.
+	 */
+	protected SpeciesConverter() {
+		structuralFont = new Font(Font.SANS_SERIF, 0, DEFAULT_SPECIES_MODIFIER_FONT_SIZE);
+	};
+
+	/**
+	 * Returns coordinates on the alias border for given angle.
+	 * 
+	 * @param alias
+	 *          object on border which the point is looked for
+	 * @param angle
+	 *          angle between X axis center point of alias and point that we are
+	 *          looking for
+	 * @return coordinates on the alias border that correspond to the angle
+	 */
+	protected Point2D getPointCoordinatesOnBorder(final T alias, final double angle) {
+		Point2D result = null;
+		if (alias.getWidth() == 0 && alias.getHeight() == 0) {
+			result = alias.getCenter();
+		} else {
+			double dist = Math.max(alias.getWidth(), alias.getHeight()) * 2;
+			Point2D startPoint = alias.getCenter();
+			double x = startPoint.getX() + Math.cos(angle) * dist;
+			double y = startPoint.getY() - Math.sin(angle) * dist;
+			Point2D endPoint = new Point2D.Double(x, y);
+			Line2D line = new Line2D.Double(startPoint, endPoint);
+			result = lineTransformation.getIntersectionWithPathIterator(line, getBoundPathIterator(alias));
+		}
+		return result;
+
+	}
+
+	/**
+	 * Returns coordinates on the alias border for given angle for residues.
+	 * 
+	 * @param alias
+	 *          object on border which the point is looked for
+	 * @param angle
+	 *          CellDEsigner specific angle defining coordinates (;/)
+	 * @return coordinates on the alias border that correspond to the angle
+	 */
+	protected Point2D getResidueCoordinates(final T alias, double angle) {
+		Point2D result = null;
+		if (alias.getWidth() == 0 && alias.getHeight() == 0) {
+			result = alias.getCenter();
+		} else {
+			double x = 0;
+			double y = 0;
+			while (angle > 2 * PI) {
+				angle -= 2 * PI;
+			}
+			while (angle < 0) {
+				angle += 2 * PI;
+			}
+			if (angle < RIGHT_TOP_RESIDUE_MAX_ANGLE) {
+				// CHECKSTYLE:OFF 0.5 is much readable than any other suggestion
+				double ratio = 0.5 + angle / (PI / 2);
+				// CHECKSTYLE:ON
+				x = alias.getX() + alias.getWidth();
+				y = alias.getY() + alias.getHeight() * (1 - ratio);
+			} else if (angle < TOP_RESIDUE_MAX_ANGLE) {
+				double ratio = (angle - RIGHT_TOP_RESIDUE_MAX_ANGLE) / (PI / 2);
+				y = alias.getY();
+				x = alias.getX() + alias.getWidth() * (1 - ratio);
+			} else if (angle < LEFT_RESIDUE_MAX_ANGLE) {
+				double ratio = (angle - TOP_RESIDUE_MAX_ANGLE) / (PI / 2);
+				y = alias.getY() + alias.getHeight() * (ratio);
+				x = alias.getX();
+			} else if (angle < BOTTOM_RESIDUE_MAX_ANGLE) {
+				double ratio = (angle - LEFT_RESIDUE_MAX_ANGLE) / (PI / 2);
+				y = alias.getY() + alias.getHeight();
+				x = alias.getX() + alias.getWidth() * ratio;
+			} else if (angle <= 2 * PI + Configuration.EPSILON) {
+				double ratio = (angle - BOTTOM_RESIDUE_MAX_ANGLE) / (PI / 2);
+				y = alias.getY() + alias.getHeight() * (1 - ratio);
+				x = alias.getX() + alias.getWidth();
+			} else {
+				throw new InvalidStateException();
+			}
+			Point2D center = alias.getCenter();
+			double correctedAngle = -Math.atan2((y - center.getY()), (x - center.getX()));
+			result = getPointCoordinatesOnBorder(alias, correctedAngle);
+		}
+		return result;
+
+	}
+
+	/**
+	 * Returns default shape of the alias.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return Shape object defining given alias
+	 */
+	protected Shape getDefaultAliasShape(final Alias alias) {
+		Shape shape;
+		shape = new Rectangle(alias.getX().intValue(), alias.getY().intValue(), alias.getWidth().intValue(), alias.getHeight().intValue());
+		return shape;
+	}
+
+	/**
+	 * Returns font that should be used for drawing description of the alias.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a font
+	 * @param params
+	 *          specific drawing parameters (like scale)
+	 * @return Font that should be used for drawing alias description
+	 */
+	protected Font getFont(final Alias alias, ConverterParams params) {
+		double fontSize = DEFAULT_SPECIES_FONT_SIZE;
+		if (alias.getFontSize() != null) {
+			fontSize = alias.getFontSize();
+		}
+		return new Font(Font.SANS_SERIF, 0, (int) (fontSize * params.getScale()));
+	}
+
+	/**
+	 * Returns text describing alias.
+	 * 
+	 * @param alias
+	 *          object under investigation
+	 * @return description of the alias
+	 */
+	protected String getText(final T alias) {
+		String name = "";
+		if (alias.getElement() != null) {
+			name = alias.getElement().getName();
+		}
+		if (name.equals("")) {
+			name = " ";
+		}
+
+		return name;
+	}
+
+	@Override
+	public void drawText(final T alias, final Graphics2D graphics, final ConverterParams params) {
+		String text = getText(alias);
+		Font oldFont = graphics.getFont();
+		Font font = getFont(alias, params);
+		graphics.setColor(Color.BLACK);
+		graphics.setFont(font);
+
+		Point2D point = alias.getCenter();
+		if (alias instanceof ComplexAlias) {
+			if (((ComplexAlias) alias).getAliases().size() > 0) {
+				if (alias.getTransparencyLevel() <= params.getLevel()) {
+					point.setLocation(point.getX(), alias.getY() + alias.getHeight() - graphics.getFontMetrics().getAscent());
+				}
+			}
+		}
+		drawText(point, text, graphics, true, true);
+		graphics.setFont(oldFont);
+	}
+
+	/**
+	 * Return width of the text.
+	 * 
+	 * @param text
+	 *          width of this text will be computed
+	 * @param graphics
+	 *          the width will be computed assuming using this graphics
+	 * @return width of the text
+	 */
+	protected double getTextWidth(final String text, final Graphics2D graphics) {
+		if (text == null) {
+			return 0;
+		}
+		if (text.equals("")) {
+			return 0;
+		}
+
+		double result = 0;
+		String[] lines = text.split("\n");
+		for (String string : lines) {
+			result = Math.max(result, graphics.getFontMetrics().stringWidth(string));
+		}
+
+		return result;
+	}
+
+	/**
+	 * Returns text height.
+	 * 
+	 * @param text
+	 *          height of this text will be computed
+	 * @param graphics
+	 *          the height will be computed assuming using this graphics
+	 * @return height of the text
+	 */
+	protected double getTextHeight(final String text, final Graphics2D graphics) {
+		if (text == null) {
+			return 0;
+		}
+		if (text.equals("")) {
+			return 0;
+		}
+
+		double result = 0;
+		int lines = text.split("\n").length;
+		result = graphics.getFontMetrics().getHeight() * lines;
+		return result;
+	}
+
+	/**
+	 * This method draws a string on graphics using current font. The coordinates
+	 * of the text is given as a point. Both parameters centered described if text
+	 * should be automatically centered horizontally and vertically.
+	 * 
+	 * @param point
+	 *          where the text should be drawn
+	 * @param text
+	 *          text to draw
+	 * @param graphics
+	 *          where we want to draw the object
+	 * @param horizontalCentered
+	 *          should the text be horizontally centered
+	 * @param verticalCentered
+	 *          should the text be vertically centered
+	 */
+	protected void drawText(final Point2D point, final String text, final Graphics2D graphics, final boolean horizontalCentered,
+			final boolean verticalCentered) {
+		double height = getTextHeight(text, graphics);
+		double x = point.getX();
+		double y = point.getY();
+		if (verticalCentered) {
+			y -= height / 2 - graphics.getFontMetrics().getAscent();
+		}
+		String[] lines = text.split("\n");
+
+		double lineHeight = graphics.getFontMetrics().getHeight();
+		for (String string : lines) {
+			double currX = x;
+			if (horizontalCentered) {
+				currX -= getTextWidth(string, graphics) / 2;
+			}
+			graphics.drawString(string, (int) currX, (int) y);
+			y += lineHeight;
+		}
+	}
+
+	/**
+	 * Returns line style used for drawing alias border.
+	 * 
+	 * @param alias
+	 *          alias to be drawn
+	 * @return style of the line used to draw alias
+	 */
+	protected Stroke getBorderLine(final SpeciesAlias alias) {
+		if (!alias.getSpecies().isHypothetical()) {
+			if (alias instanceof ComplexAlias) {
+				return LineType.SOLID_BOLD.getStroke();
+			} else {
+				return LineType.SOLID.getStroke();
+			}
+		} else {
+			if (alias instanceof ComplexAlias) {
+				return LineType.DASHED_BOLD.getStroke();
+			} else {
+				return LineType.DASHED.getStroke();
+			}
+		}
+	}
+
+	/**
+	 * Returns border of the alias as PathIterator.
+	 * 
+	 * @param alias
+	 *          alias for which we are looking for a border
+	 * @return PathIterator object defining given alias
+	 */
+	protected abstract PathIterator getBoundPathIterator(T alias);
+
+	/**
+	 * @return the lineTransformation
+	 */
+	protected LineTransformation getLineTransformation() {
+		return lineTransformation;
+	}
+
+	/**
+	 * @param lineTransformation
+	 *          the lineTransformation to set
+	 */
+	protected void setLineTransformation(LineTransformation lineTransformation) {
+		this.lineTransformation = lineTransformation;
+	}
+
+	/**
+	 * @return the ellipseTransformation
+	 */
+	protected EllipseTransformation getEllipseTransformation() {
+		return ellipseTransformation;
+	}
+
+	/**
+	 * @param ellipseTransformation
+	 *          the ellipseTransformation to set
+	 */
+	protected void setEllipseTransformation(EllipseTransformation ellipseTransformation) {
+		this.ellipseTransformation = ellipseTransformation;
+	}
+
+	/**
+	 * @return the structuralFont
+	 */
+	protected Font getStructuralFont() {
+		return structuralFont;
+	}
+
+	/**
+	 * @param structuralFont
+	 *          the structuralFont to set
+	 */
+	protected void setStructuralFont(Font structuralFont) {
+		this.structuralFont = structuralFont;
+	}
+
+	/**
+	 * @return the unitOfInformationFont
+	 */
+	protected Font getUnitOfInformationFont() {
+		return unitOfInformationFont;
+	}
+
+	/**
+	 * @param unitOfInformationFont
+	 *          the unitOfInformationFont to set
+	 */
+	protected void setUnitOfInformationFont(Font unitOfInformationFont) {
+		this.unitOfInformationFont = unitOfInformationFont;
+	}
+
+	/**
+	 * Draws structural state description of the alias (ellipse in the top part of
+	 * the alias).
+	 * 
+	 * @param text
+	 *          state description text
+	 * @param alias
+	 *          state description should be drawn on this alias
+	 * @param graphics
+	 *          where the drawing should be performed
+	 */
+	protected void drawStructuralState(String text, T alias, final Graphics2D graphics) {
+		if (text == null) {
+			return;
+		}
+
+		Point2D p = getPointCoordinatesOnBorder(alias, Math.PI / 2);
+
+		double width = MIN_STRUCTURAL_STATE_WIDTH;
+		if (!text.trim().equals("")) {
+			width = Math.max(MIN_STRUCTURAL_STATE_WIDTH, graphics.getFontMetrics().stringWidth(text) + TEXT_MARGIN_FOR_STRUCTURAL_STATE_DESC);
+		}
+		width = Math.min(width, alias.getWidth());
+		double height = STRUCTURAL_STATE_HEIGHT;
+
+		Ellipse2D ellipse = new Ellipse2D.Double(p.getX() - width / 2, p.getY() - height / 2, width, height);
+		Color c = graphics.getColor();
+		graphics.setColor(Color.WHITE);
+		graphics.fill(ellipse);
+		graphics.setColor(c);
+		graphics.draw(ellipse);
+		if (!text.trim().equals("")) {
+			Font font = graphics.getFont();
+			graphics.setFont(getStructuralFont());
+
+			width = graphics.getFontMetrics().stringWidth(text);
+			height = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
+
+			graphics.drawString(text, (int) (p.getX() - width / 2), (int) (p.getY() + height / 2));
+			graphics.setFont(font);
+		}
+
+	}
+
+	/**
+	 * Draws unit of information for the alias (rectangle in the top part of the
+	 * alias).
+	 * 
+	 * @param text
+	 *          unit of information text
+	 * @param alias
+	 *          unit of information should be drawn on this alias
+	 * @param graphics
+	 *          where the drawing should be performed
+	 */
+	protected void drawUnitOfInformation(String text, T alias, final Graphics2D graphics) {
+		if (text == null) {
+			return;
+		}
+
+		Point2D p = getPointCoordinatesOnBorder(alias, Math.PI / 2);
+
+		double width = MIN_UNIT_OF_INFORMATION_WIDTH;
+		if (!text.trim().equals("")) {
+			width = Math.max(MIN_UNIT_OF_INFORMATION_WIDTH, graphics.getFontMetrics().stringWidth(text) + TEXT_MARGIN_FOR_UNIT_OF_INFORMATION_DESC);
+		}
+		width = Math.min(width, alias.getWidth());
+		double height = UNIT_OF_INFORMATION_HEIGHT;
+
+		Rectangle2D rectangle = new Rectangle2D.Double(p.getX() - width / 2, p.getY() - height / 2, width, height);
+		Color c = graphics.getColor();
+		graphics.setColor(Color.WHITE);
+		graphics.fill(rectangle);
+		graphics.setColor(c);
+		graphics.draw(rectangle);
+		if (!text.trim().equals("")) {
+			Font font = graphics.getFont();
+			graphics.setFont(getUnitOfInformationFont());
+
+			width = graphics.getFontMetrics().stringWidth(text);
+			height = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
+
+			graphics.drawString(text, (int) (p.getX() - width / 2), (int) (p.getY() + height / 2));
+			graphics.setFont(font);
+		}
+	}
+
+	@Override
+	public void drawAlias(T alias, Graphics2D graphics, ConverterParams params, List<ColorSchema> visualizedLayoutsColorSchemas) {
+		drawAlias(alias, graphics, params);
+
+		Color oldColor = graphics.getColor();
+		int count = 0;
+		double width = alias.getWidth() / visualizedLayoutsColorSchemas.size();
+		for (ColorSchema schema : visualizedLayoutsColorSchemas) {
+			if (schema != null) {
+				double startX = (double) count / (double) visualizedLayoutsColorSchemas.size();
+				graphics.setColor(Color.BLACK);
+
+				int x = (int) (startX * alias.getWidth() + alias.getX());
+				graphics.drawRect(x, alias.getY().intValue(), (int) width, alias.getHeight().intValue());
+
+				Color color = schema.getNormalizedColor();
+				Color bgAlphaColor = new Color(color.getRed(), color.getGreen(), color.getBlue(), LAYOUT_ALPHA);
+				graphics.setColor(bgAlphaColor);
+				graphics.fillRect(x, alias.getY().intValue(), (int) width, alias.getHeight().intValue());
+			}
+			count++;
+		}
+		graphics.setColor(oldColor);
+	}
+
+}
diff --git a/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/NormalImageGeneratorTest.java b/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/NormalImageGeneratorTest.java
index 976ba7ba5c..21dcccdbf1 100644
--- a/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/NormalImageGeneratorTest.java
+++ b/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/NormalImageGeneratorTest.java
@@ -1,241 +1,238 @@
-package lcsb.mapviewer.converter.graphics;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.commands.CreateHierarchyCommand;
-import lcsb.mapviewer.converter.graphics.AbstractImageGenerator.Params;
-import lcsb.mapviewer.converter.graphics.compartment.ArtifitialCompartmentConverter;
-import lcsb.mapviewer.converter.graphics.species.ComplexConverter;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.layout.graphics.LayerText;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class NormalImageGeneratorTest {
-	static Logger	logger	= Logger.getLogger(NormalImageGenerator.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	Double					scale;
-	Boolean					centered;
-	private Boolean	artifitialCalled;
-
-	public void setScale(Double sc) {
-		scale = sc;
-	}
-
-	public void setCentered(Boolean ce) {
-		centered = ce;
-	}
-
-	class TmpComplexConverter extends ComplexConverter {
-		@Override
-		public void drawText(ComplexAlias compAlias, Graphics2D graphics, ConverterParams params) {
-			setScale(params.getScale());
-			setCentered(params.isTextCentered());
-			super.drawText(compAlias, graphics, params);
-		}
-
-	}
-
-	@Test
-	public void testComplexConversion() throws Exception {
-		scale = null;
-		try {
-			AliasConverter.addElementConverter(ComplexSpecies.class, new TmpComplexConverter());
-
-			Model model = createComplexModel();
-			new CreateHierarchyCommand(model, 2, 2).execute();
-			new PngImageGenerator(new Params().scale(2).width(600).height(600).model(model).level(0).nested(true));
-
-			// test if font was scaled
-			assertTrue(scale > 1.0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createComplexModel() {
-		Model model = new ModelFullIndexed(null);
-		model.setWidth(600);
-		model.setHeight(600);
-
-		ComplexSpecies complex = new ComplexSpecies();
-		complex.setName("a");
-		complex.setElementId("c1");
-
-		ComplexAlias alias = new ComplexAlias();
-		alias.setAliasId("1");
-		alias.setSpecies(complex);
-		alias.setX(10);
-		alias.setY(10);
-		alias.setWidth(200);
-		alias.setHeight(50);
-		model.addElement(complex);
-		model.addAlias(alias);
-		
-		Species protein= new GenericProtein();
-		protein.setName("b");
-		protein.setElementId("s1");
-
-		SpeciesAlias a2= new SpeciesAlias();
-		a2.setAliasId("2");
-		a2.setSpecies(protein);
-		a2.setX(10);
-		a2.setY(100);
-		a2.setWidth(200);
-		a2.setHeight(50);
-		a2.setFontSize(30);
-		model.addElement(protein);
-		model.addAlias(a2);
-		return model;
-	}
-
-	class TmpArtifitialConverter extends ArtifitialCompartmentConverter {
-		@Override
-		public void drawText(ArtifitialCompartmentAlias compAlias, Graphics2D graphics, ConverterParams params) {
-			setScale(params.getScale());
-			setCentered(params.isTextCentered());
-			setArtifitialCalled(true);
-			super.drawText(compAlias, graphics, params);
-		}
-
-	}
-
-	@Test
-	public void testNestedCompartmentsConversion() throws Exception {
-		scale = null;
-		try {
-			AliasConverter.addAliasConverter(ArtifitialCompartmentAlias.class, new TmpArtifitialConverter());
-			Model model = createCompartmentModel();
-			new CreateHierarchyCommand(model, 2, 2).execute();
-			new PngImageGenerator(new Params().scale(2).width(600).height(600).model(model).level(0).nested(true));
-
-			assertTrue(centered);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createCompartmentModel() {
-		Model model = new ModelFullIndexed(null);
-		model.setWidth(526);
-		model.setHeight(346);
-
-		LayerText compAlias = new LayerText();
-		compAlias.setX(256.0);
-		compAlias.setY(79.0);
-		compAlias.setWidth(233.0);
-		compAlias.setHeight(188.0);
-		compAlias.setNotes("asd as");
-		compAlias.setColor(Color.BLACK);
-		Layer layer = new Layer();
-		layer.addLayerText(compAlias);
-		layer.setVisible(true);
-		model.addLayer(layer);
-
-		layer.addLayerLine(new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(100, 100)));
-
-		ComplexSpecies complex = new ComplexSpecies();
-		complex.setName("a");
-		complex.setElementId("c1");
-
-		ComplexAlias alias = new ComplexAlias();
-		alias.setAliasId("1");
-		alias.setSpecies(complex);
-		alias.setX(300);
-		alias.setY(90);
-		alias.setWidth(100);
-		alias.setHeight(50);
-		model.addElement(complex);
-		model.addAlias(alias);
-
-		return model;
-	}
-
-	@Test
-	public void testArtifitialInNonHierarchicalView() throws Exception {
-		scale = null;
-		try {
-			AliasConverter.addAliasConverter(ArtifitialCompartmentAlias.class, new TmpArtifitialConverter());
-
-			setArtifitialCalled(false);
-			Model model = createCompartmentModel();
-			new CreateHierarchyCommand(model, 2, 2).execute();
-			new PngImageGenerator(new Params().scale(2).width(600).height(600).model(model));
-
-			assertFalse(getArtifitialCalled());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	/**
-	 * @return the artifitialCalled
-	 * @see #artifitialCalled
-	 */
-	public Boolean getArtifitialCalled() {
-		return artifitialCalled;
-	}
-
-	/**
-	 * @param artifitialCalled
-	 *          the artifitialCalled to set
-	 * @see #artifitialCalled
-	 */
-	public void setArtifitialCalled(Boolean artifitialCalled) {
-		this.artifitialCalled = artifitialCalled;
-	}
-
-	@Test
-	public void testArtifitialInHierarchicalView() throws Exception {
-		try {
-			Model model = createCompartmentModel();
-			Layer layer = model.getLayers().iterator().next();
-
-			layer.addLayerText(new LayerText(new Rectangle2D.Double(10, 10, 500, 500), "X asd"));
-			layer.addLayerText(new LayerText(new Rectangle2D.Double(20, 20, 200, 200), "Y qwe ret"));
-			layer.addLayerText(new LayerText(new Rectangle2D.Double(100, 100, 199, 220), "Z dgf fsd aaewq ret"));
-
-			new CreateHierarchyCommand(model, 1, 8).execute();
-			model.getCompartmentsAliases().get(1).setTransparencyLevel(2);
-			model.getCompartmentsAliases().get(0).setTransparencyLevel(2);
-			model.getCompartmentsAliases().get(3).setTransparencyLevel(2);
-			new PngImageGenerator(new Params().level(2).scale(4).width(600).height(600).model(model).nested(true));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.converter.graphics;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.commands.CreateHierarchyCommand;
+import lcsb.mapviewer.converter.graphics.AbstractImageGenerator.Params;
+import lcsb.mapviewer.converter.graphics.compartment.ArtifitialCompartmentConverter;
+import lcsb.mapviewer.converter.graphics.species.ComplexConverter;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.layout.graphics.LayerText;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class NormalImageGeneratorTest {
+	static Logger logger = Logger.getLogger(NormalImageGenerator.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	Double					scale;
+	Boolean					centered;
+	private Boolean	artifitialCalled;
+
+	public void setScale(Double sc) {
+		scale = sc;
+	}
+
+	public void setCentered(Boolean ce) {
+		centered = ce;
+	}
+
+	class TmpComplexConverter extends ComplexConverter {
+		@Override
+		public void drawText(ComplexAlias compAlias, Graphics2D graphics, ConverterParams params) {
+			setScale(params.getScale());
+			setCentered(params.isTextCentered());
+			super.drawText(compAlias, graphics, params);
+		}
+
+	}
+
+	@Test
+	public void testComplexConversion() throws Exception {
+		scale = null;
+		try {
+			AliasConverter.addElementConverter(ComplexSpecies.class, new TmpComplexConverter());
+
+			Model model = createComplexModel();
+			new CreateHierarchyCommand(model, 2, 2).execute();
+			new PngImageGenerator(new Params().scale(2).width(600).height(600).model(model).level(0).nested(true));
+
+			// test if font was scaled
+			assertTrue(scale > 1.0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createComplexModel() {
+		Model model = new ModelFullIndexed(null);
+		model.setWidth(600);
+		model.setHeight(600);
+
+		ComplexSpecies complex = new ComplexSpecies();
+		complex.setName("a");
+		complex.setElementId("c1");
+
+		ComplexAlias alias = new ComplexAlias(complex);
+		alias.setAliasId("1");
+		alias.setX(10);
+		alias.setY(10);
+		alias.setWidth(200);
+		alias.setHeight(50);
+		model.addElement(complex);
+		model.addAlias(alias);
+
+		GenericProtein protein = new GenericProtein();
+		protein.setName("b");
+		protein.setElementId("s1");
+
+		SpeciesAlias a2 = new GenericProteinAlias(protein);
+		a2.setAliasId("2");
+		a2.setX(10);
+		a2.setY(100);
+		a2.setWidth(200);
+		a2.setHeight(50);
+		a2.setFontSize(30);
+		model.addElement(protein);
+		model.addAlias(a2);
+		return model;
+	}
+
+	class TmpArtifitialConverter extends ArtifitialCompartmentConverter {
+		@Override
+		public void drawText(ArtifitialCompartmentAlias compAlias, Graphics2D graphics, ConverterParams params) {
+			setScale(params.getScale());
+			setCentered(params.isTextCentered());
+			setArtifitialCalled(true);
+			super.drawText(compAlias, graphics, params);
+		}
+
+	}
+
+	@Test
+	public void testNestedCompartmentsConversion() throws Exception {
+		scale = null;
+		try {
+			AliasConverter.addAliasConverter(ArtifitialCompartmentAlias.class, new TmpArtifitialConverter());
+			Model model = createCompartmentModel();
+			new CreateHierarchyCommand(model, 2, 2).execute();
+			new PngImageGenerator(new Params().scale(2).width(600).height(600).model(model).level(0).nested(true));
+
+			assertTrue(centered);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createCompartmentModel() {
+		Model model = new ModelFullIndexed(null);
+		model.setWidth(526);
+		model.setHeight(346);
+
+		LayerText compAlias = new LayerText();
+		compAlias.setX(256.0);
+		compAlias.setY(79.0);
+		compAlias.setWidth(233.0);
+		compAlias.setHeight(188.0);
+		compAlias.setNotes("asd as");
+		compAlias.setColor(Color.BLACK);
+		Layer layer = new Layer();
+		layer.addLayerText(compAlias);
+		layer.setVisible(true);
+		model.addLayer(layer);
+
+		layer.addLayerLine(new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(100, 100)));
+
+		ComplexSpecies complex = new ComplexSpecies();
+		complex.setName("a");
+		complex.setElementId("c1");
+
+		ComplexAlias alias = new ComplexAlias(complex);
+		alias.setAliasId("1");
+		alias.setX(300);
+		alias.setY(90);
+		alias.setWidth(100);
+		alias.setHeight(50);
+		model.addElement(complex);
+		model.addAlias(alias);
+
+		return model;
+	}
+
+	@Test
+	public void testArtifitialInNonHierarchicalView() throws Exception {
+		scale = null;
+		try {
+			AliasConverter.addAliasConverter(ArtifitialCompartmentAlias.class, new TmpArtifitialConverter());
+
+			setArtifitialCalled(false);
+			Model model = createCompartmentModel();
+			new CreateHierarchyCommand(model, 2, 2).execute();
+			new PngImageGenerator(new Params().scale(2).width(600).height(600).model(model));
+
+			assertFalse(getArtifitialCalled());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	/**
+	 * @return the artifitialCalled
+	 * @see #artifitialCalled
+	 */
+	public Boolean getArtifitialCalled() {
+		return artifitialCalled;
+	}
+
+	/**
+	 * @param artifitialCalled
+	 *          the artifitialCalled to set
+	 * @see #artifitialCalled
+	 */
+	public void setArtifitialCalled(Boolean artifitialCalled) {
+		this.artifitialCalled = artifitialCalled;
+	}
+
+	@Test
+	public void testArtifitialInHierarchicalView() throws Exception {
+		try {
+			Model model = createCompartmentModel();
+			Layer layer = model.getLayers().iterator().next();
+
+			layer.addLayerText(new LayerText(new Rectangle2D.Double(10, 10, 500, 500), "X asd"));
+			layer.addLayerText(new LayerText(new Rectangle2D.Double(20, 20, 200, 200), "Y qwe ret"));
+			layer.addLayerText(new LayerText(new Rectangle2D.Double(100, 100, 199, 220), "Z dgf fsd aaewq ret"));
+
+			new CreateHierarchyCommand(model, 1, 8).execute();
+			model.getCompartmentsAliases().get(1).setTransparencyLevel(2);
+			model.getCompartmentsAliases().get(0).setTransparencyLevel(2);
+			model.getCompartmentsAliases().get(3).setTransparencyLevel(2);
+			new PngImageGenerator(new Params().level(2).scale(4).width(600).height(600).model(model).nested(true));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/PdfImageGeneratorTest.java b/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/PdfImageGeneratorTest.java
index 691c4d8f85..be1d774ddd 100644
--- a/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/PdfImageGeneratorTest.java
+++ b/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/PdfImageGeneratorTest.java
@@ -93,9 +93,8 @@ public class PdfImageGeneratorTest {
 		complex.setName("a");
 		complex.setElementId("c1");
 
-		ComplexAlias alias = new ComplexAlias();
+		ComplexAlias alias = new ComplexAlias(complex);
 		alias.setAliasId("1");
-		alias.setSpecies(complex);
 		alias.setX(300);
 		alias.setY(90);
 		alias.setWidth(100);
diff --git a/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/species/SpeciesConverterTest.java b/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/species/SpeciesConverterTest.java
index 2bb851bf33..0abe4abadf 100644
--- a/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/species/SpeciesConverterTest.java
+++ b/converter-graphics/src/test/java/lcsb/mapviewer/converter/graphics/species/SpeciesConverterTest.java
@@ -1,195 +1,194 @@
-package lcsb.mapviewer.converter.graphics.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.geom.Point2D;
-import java.awt.image.BufferedImage;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.converter.graphics.ConverterParams;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.GenericColorSchema;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-
-public class SpeciesConverterTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetResidueCoords() throws Exception {
-		try {
-			final class Conv extends ProteinConverter {
-				public Point2D getCoordinate(SpeciesAlias alias, double angle) {
-					return super.getResidueCoordinates(alias, angle);
-				}
-			}
-			Protein protein = new GenericProtein();
-			SpeciesAlias alias = new SpeciesAlias(protein);
-			alias.setX(135);
-			alias.setY(194.0);
-			alias.setWidth(130);
-			alias.setHeight(67);
-			Conv conv = new Conv();
-			assertEquals(135.0, conv.getCoordinate(alias, 3.141592653589793).getX(), 2);
-			assertEquals(265., conv.getCoordinate(alias, 0.0).getX(), 2);
-			assertEquals(135.0, conv.getCoordinate(alias, 2.41).getX(), 2);
-			assertEquals(194.0, conv.getCoordinate(alias, 1.98).getY(), 2);
-			assertEquals(194.0, conv.getCoordinate(alias, 1.59).getY(), 2);
-			assertEquals(265.0, conv.getCoordinate(alias, 6.28).getX(), 2);
-			assertEquals(261.0, conv.getCoordinate(alias, 4.13).getY(), 2);
-			assertEquals(261.0, conv.getCoordinate(alias, 4.86).getY(), 2);
-			assertEquals(265.0, conv.getCoordinate(alias, 5.69).getX(), 2);
-			assertEquals(194.0, conv.getCoordinate(alias, 0.99).getY(), 2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDrawAliasWithLayouts() throws Exception {
-		try {
-			BufferedImage bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
-			Graphics2D graphics = bi.createGraphics();
-			ProteinConverter rc = new ProteinConverter();
-
-			SpeciesAlias alias = createAlias();
-			rc.drawAlias(alias, graphics, new ConverterParams());
-
-			int val = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
-
-			SpeciesAlias alias2 = createAlias();
-
-			bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
-			graphics = bi.createGraphics();
-
-			ColorSchema schema = new GenericColorSchema();
-			schema.setColor(Color.RED);
-			List<ColorSchema> schemas = new ArrayList<>();
-			schemas.add(schema);
-
-			rc.drawAlias(alias2, graphics, new ConverterParams(), schemas);
-
-			int val2 = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
-
-			assertTrue(val != val2);
-
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDrawAfterDrawingReactionWithLayouts() throws Exception {
-		try {
-			BufferedImage bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
-			Graphics2D graphics = bi.createGraphics();
-			ProteinConverter rc = new ProteinConverter();
-
-			SpeciesAlias alias = createAlias();
-			rc.drawAlias(alias, graphics, new ConverterParams());
-
-			int val = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
-
-			SpeciesAlias alias2 = createAlias();
-
-			bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
-			graphics = bi.createGraphics();
-
-			ColorSchema schema = new GenericColorSchema();
-			schema.setColor(Color.RED);
-			List<ColorSchema> schemas = new ArrayList<>();
-			schemas.add(schema);
-
-			rc.drawAlias(alias2, graphics, new ConverterParams(), schemas);
-
-			int val2 = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
-
-			bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
-			graphics = bi.createGraphics();
-
-			rc.drawAlias(alias2, graphics, new ConverterParams(), new ArrayList<>());
-
-			int val3 = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
-
-			assertTrue(val != val2);
-			assertEquals(val, val3);
-
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDrawReactionWithFewLayouts() throws Exception {
-		try {
-			BufferedImage bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
-			Graphics2D graphics = bi.createGraphics();
-			ProteinConverter rc = new ProteinConverter();
-
-			SpeciesAlias alias = createAlias();
-			rc.drawAlias(alias, graphics, new ConverterParams());
-
-			int val = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
-
-			SpeciesAlias alias2 = createAlias();
-
-			bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
-			graphics = bi.createGraphics();
-
-			ColorSchema schema = new GenericColorSchema();
-			schema.setColor(Color.RED);
-			List<ColorSchema> schemas = new ArrayList<>();
-			schemas.add(schema);
-			schemas.add(null);
-			schema = new GenericColorSchema();
-			schema.setColor(Color.BLUE);
-			schemas.add(schema);
-
-			rc.drawAlias(alias2, graphics, new ConverterParams(), schemas);
-
-			int val2 = bi.getRGB((int) (alias.getX() + alias.getWidth() / 4), (int) alias.getCenterY());
-			int val3 = bi.getRGB((int) (alias.getCenterX()), (int) alias.getCenterY());
-			int val4 = bi.getRGB((int) (alias.getX() + 3 * alias.getWidth() / 4), (int) alias.getCenterY());
-
-			assertTrue(val != val2);
-			assertEquals(val, val3);
-			assertTrue(val != val4);
-
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-
-	private SpeciesAlias createAlias() {
-		SpeciesAlias alias = new SpeciesAlias();
-		alias.setX(10);
-		alias.setY(20);
-		alias.setWidth(100);
-		alias.setHeight(80);
-		alias.setColor(Color.WHITE);
-
-		Protein protein = new GenericProtein();
-		protein.setName("NAME_OF_THE_ELEMENT");
-		alias.setElement(protein);
-		return alias;
-	}
-
-}
+package lcsb.mapviewer.converter.graphics.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.converter.graphics.ConverterParams;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.GenericColorSchema;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class SpeciesConverterTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetResidueCoords() throws Exception {
+		try {
+			final class Conv extends ProteinConverter {
+				public Point2D getCoordinate(SpeciesAlias alias, double angle) {
+					return super.getResidueCoordinates(alias, angle);
+				}
+			}
+			GenericProtein protein = new GenericProtein();
+			SpeciesAlias alias = new GenericProteinAlias(protein);
+			alias.setX(135);
+			alias.setY(194.0);
+			alias.setWidth(130);
+			alias.setHeight(67);
+			Conv conv = new Conv();
+			assertEquals(135.0, conv.getCoordinate(alias, 3.141592653589793).getX(), 2);
+			assertEquals(265., conv.getCoordinate(alias, 0.0).getX(), 2);
+			assertEquals(135.0, conv.getCoordinate(alias, 2.41).getX(), 2);
+			assertEquals(194.0, conv.getCoordinate(alias, 1.98).getY(), 2);
+			assertEquals(194.0, conv.getCoordinate(alias, 1.59).getY(), 2);
+			assertEquals(265.0, conv.getCoordinate(alias, 6.28).getX(), 2);
+			assertEquals(261.0, conv.getCoordinate(alias, 4.13).getY(), 2);
+			assertEquals(261.0, conv.getCoordinate(alias, 4.86).getY(), 2);
+			assertEquals(265.0, conv.getCoordinate(alias, 5.69).getX(), 2);
+			assertEquals(194.0, conv.getCoordinate(alias, 0.99).getY(), 2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDrawAliasWithLayouts() throws Exception {
+		try {
+			BufferedImage bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
+			Graphics2D graphics = bi.createGraphics();
+			ProteinConverter rc = new ProteinConverter();
+
+			SpeciesAlias alias = createAlias();
+			rc.drawAlias(alias, graphics, new ConverterParams());
+
+			int val = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
+
+			SpeciesAlias alias2 = createAlias();
+
+			bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
+			graphics = bi.createGraphics();
+
+			ColorSchema schema = new GenericColorSchema();
+			schema.setColor(Color.RED);
+			List<ColorSchema> schemas = new ArrayList<>();
+			schemas.add(schema);
+
+			rc.drawAlias(alias2, graphics, new ConverterParams(), schemas);
+
+			int val2 = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
+
+			assertTrue(val != val2);
+
+		} catch (Exception e) {
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDrawAfterDrawingReactionWithLayouts() throws Exception {
+		try {
+			BufferedImage bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
+			Graphics2D graphics = bi.createGraphics();
+			ProteinConverter rc = new ProteinConverter();
+
+			SpeciesAlias alias = createAlias();
+			rc.drawAlias(alias, graphics, new ConverterParams());
+
+			int val = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
+
+			SpeciesAlias alias2 = createAlias();
+
+			bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
+			graphics = bi.createGraphics();
+
+			ColorSchema schema = new GenericColorSchema();
+			schema.setColor(Color.RED);
+			List<ColorSchema> schemas = new ArrayList<>();
+			schemas.add(schema);
+
+			rc.drawAlias(alias2, graphics, new ConverterParams(), schemas);
+
+			int val2 = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
+
+			bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
+			graphics = bi.createGraphics();
+
+			rc.drawAlias(alias2, graphics, new ConverterParams(), new ArrayList<>());
+
+			int val3 = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
+
+			assertTrue(val != val2);
+			assertEquals(val, val3);
+
+		} catch (Exception e) {
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDrawReactionWithFewLayouts() throws Exception {
+		try {
+			BufferedImage bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
+			Graphics2D graphics = bi.createGraphics();
+			ProteinConverter rc = new ProteinConverter();
+
+			SpeciesAlias alias = createAlias();
+			rc.drawAlias(alias, graphics, new ConverterParams());
+
+			int val = bi.getRGB((int) alias.getCenterX(), (int) alias.getCenterY());
+
+			SpeciesAlias alias2 = createAlias();
+
+			bi = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
+			graphics = bi.createGraphics();
+
+			ColorSchema schema = new GenericColorSchema();
+			schema.setColor(Color.RED);
+			List<ColorSchema> schemas = new ArrayList<>();
+			schemas.add(schema);
+			schemas.add(null);
+			schema = new GenericColorSchema();
+			schema.setColor(Color.BLUE);
+			schemas.add(schema);
+
+			rc.drawAlias(alias2, graphics, new ConverterParams(), schemas);
+
+			int val2 = bi.getRGB((int) (alias.getX() + alias.getWidth() / 4), (int) alias.getCenterY());
+			int val3 = bi.getRGB((int) (alias.getCenterX()), (int) alias.getCenterY());
+			int val4 = bi.getRGB((int) (alias.getX() + 3 * alias.getWidth() / 4), (int) alias.getCenterY());
+
+			assertTrue(val != val2);
+			assertEquals(val, val3);
+			assertTrue(val != val4);
+
+		} catch (Exception e) {
+			throw e;
+		}
+	}
+
+	private SpeciesAlias createAlias() {
+		GenericProtein protein = new GenericProtein();
+		protein.setName("NAME_OF_THE_ELEMENT");
+		SpeciesAlias alias = new GenericProteinAlias(protein);
+		alias.setX(10);
+		alias.setY(20);
+		alias.setWidth(100);
+		alias.setHeight(80);
+		alias.setColor(Color.WHITE);
+
+		return alias;
+	}
+
+}
diff --git a/converter/src/main/java/lcsb/mapviewer/converter/zip/ZipEntryFileFactory.java b/converter/src/main/java/lcsb/mapviewer/converter/zip/ZipEntryFileFactory.java
index b6abf7fc2f..084e575cd0 100644
--- a/converter/src/main/java/lcsb/mapviewer/converter/zip/ZipEntryFileFactory.java
+++ b/converter/src/main/java/lcsb/mapviewer/converter/zip/ZipEntryFileFactory.java
@@ -1,234 +1,234 @@
-package lcsb.mapviewer.converter.zip;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.apache.commons.io.FilenameUtils;
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.TextFileUtils;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.graph.DataMiningType;
-
-/**
- * Factory class used to create {@link ZipEntryFile} objects.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ZipEntryFileFactory {
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private final Logger				logger														 = Logger.getLogger(ZipEntryFileFactory.class);
-
-	/**
-	 * Directory in a zip file where information about submodels is stored. These
-	 * entries should be by default transformed into {@link ModelZipEntryFile}.
-	 */
-	private static final String	SUBMODEL_DIRECTORY								 = "submaps/";
-
-	/**
-	 * Directory in a zip file where information about
-	 * {@link lcsb.mapviewer.model.map.OverviewImage OverviewImage} is stored.
-	 * These entries should be by default transformed into
-	 * {@link ImageZipEntryFile}.
-	 */
-	private static final String	IMAGES_DIRECTORY									 = "images/";
-
-	/**
-	 * Directory in a zip file where information about
-	 * {@link lcsb.mapviewer.model.map.layout.Layout Layout} is stored. These
-	 * entries should be by default transformed into {@link LayoutZipEntryFile}.
-	 */
-	private static final String	LAYOUT_DIRECTORY									 = "layouts/";
-
-	/**
-	 * Directory in a zip file where information about
-	 * {@link lcsb.mapviewer.model.map.graph.DataMiningSet DataMiningSet} is
-	 * stored. These entries should be by default transformed into
-	 * {@link DataMiningZipEntryFile}.
-	 */
-	private static final String	DATA_MINING_DIRECTORY							 = "data_mining/";
-
-	/**
-	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
-	 * corresponding to the {@link LayoutZipEntryFile#name layout name}.
-	 */
-	private static final String	LAYOUT_HEADER_PARAM_NAME					 = "NAME";
-
-	/**
-	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
-	 * corresponding to the {@link LayoutZipEntryFile#description layout
-	 * description}.
-	 */
-	private static final String	LAYOUT_HEADER_PARAM_DESCRIPTION		 = "DESCRIPTION";
-
-	/**
-	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
-	 * corresponding to the {@link LayoutZipEntryFile#type type}.
-	 */
-	public static final String	LAYOUT_HEADER_PARAM_TYPE					 = "TYPE";
-
-	/**
-	 * Name of the parameter in {@link DataMiningZipEntryFile file describing data
-	 * mining set} corresponding to the {@link DataMiningZipEntryFile#description
-	 * short description of the set}.
-	 */
-	private static final String	DM_HEADER_PARAM_DESCRIPTION				 = "DESCRIPTION";
-
-	/**
-	 * Name of the parameter in {@link DataMiningZipEntryFile file describing data
-	 * mining set} corresponding to the {@link DataMiningZipEntryFile#name dataset
-	 * name}.
-	 */
-	private static final String	DM_HEADER_PARAM_NAME							 = "NAME";
-
-	/**
-	 * Name of the parameter in {@link DataMiningZipEntryFile file describing data
-	 * mining set} corresponding to the {@link DataMiningZipEntryFile#source link
-	 * to the source of data set}.
-	 */
-	private static final String	DM_HEADER_PARAM_SOURCE						 = "SOURCE";
-
-	/**
-	 * Name of the parameter in {@link DataMiningZipEntryFile file describing data
-	 * mining set} corresponding to the {@link DataMiningZipEntryFile#type type of
-	 * the set}.
-	 */
-	private static final String	DM_HEADER_PARAM_TYPE							 = "TYPE";
-
-	/**
-	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
-	 * corresponding to the {@link LayoutZipEntryFile#genomeType genome type}.
-	 */
-	public static final String	LAYOUT_HEADER_PARAM_GENOME_TYPE		 = "GENOME_TYPE";
-
-	/**
-	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
-	 * corresponding to the {@link LayoutZipEntryFile#genomeVersion genome
-	 * version}.
-	 */
-	public static final String	LAYOUT_HEADER_PARAM_GENOME_VERSION = "GENOME_VERSION";
-
-	/**
-	 * Generates instance of {@link ZipEntryFile} representing entry in the zip
-	 * file with pre-parsed structural data (like: type, name, description, etc).
-	 * 
-	 * @param entry
-	 *          {@link ZipEntry entry} in the {@link ZipFile}
-	 * @param zipFile
-	 *          original {@link ZipFile}
-	 * @return {@link ZipEntryFile} for the given {@link ZipEntry}
-	 * @throws IOException
-	 *           thrown when there is a problem with accessing zip file
-	 */
-	public ZipEntryFile createZipEntryFile(ZipEntry entry, ZipFile zipFile) throws IOException {
-		if (entry.isDirectory()) {
-			return null;
-		} else {
-			String directory = null;
-			String[] tmp = entry.getName().split("/");
-			String name = tmp[tmp.length - 1];
-			if (tmp.length > 1) {
-				directory = entry.getName().replace(name, "");
-			}
-
-			if (directory == null) {
-				ModelZipEntryFile zesf = new ModelZipEntryFile();
-				zesf.setFilename(entry.getName());
-				zesf.setName(FilenameUtils.getBaseName(entry.getName()));
-				zesf.setRoot(true);
-				if ("xml".equalsIgnoreCase(FilenameUtils.getExtension(entry.getName()))) {
-					zesf.setFileType(InputFileType.CELLDESIGNER);
-				} else {
-					throw new InvalidArgumentException("Don't know what to do with entry: " + entry.getName());
-				}
-				return zesf;
-			} else if (directory.equals(SUBMODEL_DIRECTORY)) {
-				ModelZipEntryFile zesf = new ModelZipEntryFile();
-				zesf.setFilename(entry.getName());
-				zesf.setName(FilenameUtils.getBaseName(entry.getName()));
-				if ("mapping".equalsIgnoreCase(zesf.getName())) {
-					zesf.setMapping("true");
-				} else {
-					zesf.setMapping("false");
-				}
-				if ("xml".equalsIgnoreCase(FilenameUtils.getExtension(entry.getName()))) {
-					zesf.setFileType(InputFileType.CELLDESIGNER);
-				} else {
-					throw new InvalidArgumentException("Don't know what to do with entry: " + entry.getName());
-				}
-				return zesf;
-			} else if (directory.equals(IMAGES_DIRECTORY)) {
-				ImageZipEntryFile result = new ImageZipEntryFile(entry.getName(), zipFile.getInputStream(entry));
-				return result;
-			} else if (directory.equals(LAYOUT_DIRECTORY)) {
-				LayoutZipEntryFile result = createLayoutZipEntryFile(entry.getName(), zipFile.getInputStream(entry));
-				return result;
-			} else if (directory.equals(DATA_MINING_DIRECTORY)) {
-				DataMiningZipEntryFile result = new DataMiningZipEntryFile(entry.getName());
-				result.setName(FilenameUtils.getBaseName(entry.getName()));
-				for (Map.Entry<String, String> mapEntry : TextFileUtils.getHeaderParametersFromFile(zipFile.getInputStream(entry)).entrySet()) {
-					result.setHeaderParameter(mapEntry.getKey(), mapEntry.getValue());
-				}
-
-				if (result.getHeaderParameter(DM_HEADER_PARAM_TYPE) != null) {
-					DataMiningType type = DataMiningType.valueOf(result.getHeaderParameter(DM_HEADER_PARAM_TYPE));
-					result.setType(type);
-				} else {
-					result.setType(DataMiningType.UNKNOWN);
-				}
-
-				if (result.getHeaderParameter(DM_HEADER_PARAM_DESCRIPTION) != null) {
-					result.setDescription(result.getHeaderParameter(DM_HEADER_PARAM_DESCRIPTION));
-				}
-
-				if (result.getHeaderParameter(DM_HEADER_PARAM_NAME) != null) {
-					result.setName(result.getHeaderParameter(DM_HEADER_PARAM_NAME));
-				}
-
-				if (result.getHeaderParameter(DM_HEADER_PARAM_SOURCE) != null) {
-					result.setSource(result.getHeaderParameter(DM_HEADER_PARAM_SOURCE));
-				}
-
-				return result;
-			} else {
-				throw new InvalidArgumentException("Don't know what to do with entry: " + entry.getName());
-			}
-		}
-	}
-
-	/**
-	 * Creates {@link LayoutZipEntryFile layout entry} from input stream and given
-	 * name of the layout.
-	 * 
-	 * @param name
-	 *          name of the layout
-	 * @param inputStream
-	 *          stream where data is stored
-	 * @return {@link LayoutZipEntryFile} processed from input data
-	 * @throws IOException
-	 *           thrown when there is problem with accessing input data
-	 */
-	public LayoutZipEntryFile createLayoutZipEntryFile(String name, InputStream inputStream) throws IOException {
-		LayoutZipEntryFile result = new LayoutZipEntryFile();
-		result.setFilename(name);
-		result.setName(FilenameUtils.getBaseName(name));
-		for (Map.Entry<String, String> mapEntry : TextFileUtils.getHeaderParametersFromFile(inputStream).entrySet()) {
-			result.setHeaderParameter(mapEntry.getKey(), mapEntry.getValue());
-		}
-		if (result.getHeaderParameter(LAYOUT_HEADER_PARAM_NAME) != null) {
-			result.setName(result.getHeaderParameter(LAYOUT_HEADER_PARAM_NAME));
-		}
-		if (result.getHeaderParameter(LAYOUT_HEADER_PARAM_DESCRIPTION) != null) {
-			result.setDescription(result.getHeaderParameter(LAYOUT_HEADER_PARAM_DESCRIPTION));
-		}
-		return result;
-	}
-
-}
+package lcsb.mapviewer.converter.zip;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.TextFileUtils;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.graph.DataMiningType;
+
+/**
+ * Factory class used to create {@link ZipEntryFile} objects.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ZipEntryFileFactory {
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private final Logger				logger														 = Logger.getLogger(ZipEntryFileFactory.class);
+
+	/**
+	 * Directory in a zip file where information about submodels is stored. These
+	 * entries should be by default transformed into {@link ModelZipEntryFile}.
+	 */
+	private static final String	SUBMODEL_DIRECTORY								 = "submaps/";
+
+	/**
+	 * Directory in a zip file where information about
+	 * {@link lcsb.mapviewer.model.map.OverviewImage OverviewImage} is stored.
+	 * These entries should be by default transformed into
+	 * {@link ImageZipEntryFile}.
+	 */
+	private static final String	IMAGES_DIRECTORY									 = "images/";
+
+	/**
+	 * Directory in a zip file where information about
+	 * {@link lcsb.mapviewer.model.map.layout.Layout Layout} is stored. These
+	 * entries should be by default transformed into {@link LayoutZipEntryFile}.
+	 */
+	private static final String	LAYOUT_DIRECTORY									 = "layouts/";
+
+	/**
+	 * Directory in a zip file where information about
+	 * {@link lcsb.mapviewer.model.map.graph.DataMiningSet DataMiningSet} is
+	 * stored. These entries should be by default transformed into
+	 * {@link DataMiningZipEntryFile}.
+	 */
+	private static final String	DATA_MINING_DIRECTORY							 = "data_mining/";
+
+	/**
+	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
+	 * corresponding to the {@link LayoutZipEntryFile#name layout name}.
+	 */
+	private static final String	LAYOUT_HEADER_PARAM_NAME					 = "NAME";
+
+	/**
+	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
+	 * corresponding to the {@link LayoutZipEntryFile#description layout
+	 * description}.
+	 */
+	private static final String	LAYOUT_HEADER_PARAM_DESCRIPTION		 = "DESCRIPTION";
+
+	/**
+	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
+	 * corresponding to the {@link LayoutZipEntryFile#type type}.
+	 */
+	public static final String	LAYOUT_HEADER_PARAM_TYPE					 = "TYPE";
+
+	/**
+	 * Name of the parameter in {@link DataMiningZipEntryFile file describing data
+	 * mining set} corresponding to the {@link DataMiningZipEntryFile#description
+	 * short description of the set}.
+	 */
+	private static final String	DM_HEADER_PARAM_DESCRIPTION				 = "DESCRIPTION";
+
+	/**
+	 * Name of the parameter in {@link DataMiningZipEntryFile file describing data
+	 * mining set} corresponding to the {@link DataMiningZipEntryFile#name dataset
+	 * name}.
+	 */
+	private static final String	DM_HEADER_PARAM_NAME							 = "NAME";
+
+	/**
+	 * Name of the parameter in {@link DataMiningZipEntryFile file describing data
+	 * mining set} corresponding to the {@link DataMiningZipEntryFile#source link
+	 * to the source of data set}.
+	 */
+	private static final String	DM_HEADER_PARAM_SOURCE						 = "SOURCE";
+
+	/**
+	 * Name of the parameter in {@link DataMiningZipEntryFile file describing data
+	 * mining set} corresponding to the {@link DataMiningZipEntryFile#type type of
+	 * the set}.
+	 */
+	private static final String	DM_HEADER_PARAM_TYPE							 = "TYPE";
+
+	/**
+	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
+	 * corresponding to the {@link LayoutZipEntryFile#genomeType genome type}.
+	 */
+	public static final String	LAYOUT_HEADER_PARAM_GENOME_TYPE		 = "GENOME_TYPE";
+
+	/**
+	 * Name of the parameter in {@link LayoutZipEntryFile file describing layout}
+	 * corresponding to the {@link LayoutZipEntryFile#genomeVersion genome
+	 * version}.
+	 */
+	public static final String	LAYOUT_HEADER_PARAM_GENOME_VERSION = "GENOME_VERSION";
+
+	/**
+	 * Generates instance of {@link ZipEntryFile} representing entry in the zip
+	 * file with pre-parsed structural data (like: type, name, description, etc).
+	 * 
+	 * @param entry
+	 *          {@link ZipEntry entry} in the {@link ZipFile}
+	 * @param zipFile
+	 *          original {@link ZipFile}
+	 * @return {@link ZipEntryFile} for the given {@link ZipEntry}
+	 * @throws IOException
+	 *           thrown when there is a problem with accessing zip file
+	 */
+	public ZipEntryFile createZipEntryFile(ZipEntry entry, ZipFile zipFile) throws IOException {
+		if (entry.isDirectory()) {
+			return null;
+		} else {
+			String directory = null;
+			String[] tmp = entry.getName().split("/");
+			String name = tmp[tmp.length - 1];
+			if (tmp.length > 1) {
+				directory = entry.getName().replace(name, "");
+			}
+
+			if (directory == null) {
+				ModelZipEntryFile zesf = new ModelZipEntryFile();
+				zesf.setFilename(entry.getName());
+				zesf.setName(FilenameUtils.getBaseName(entry.getName()));
+				zesf.setRoot(true);
+				if ("xml".equalsIgnoreCase(FilenameUtils.getExtension(entry.getName()))) {
+					zesf.setFileType(InputFileType.CELLDESIGNER);
+				} else {
+					throw new InvalidArgumentException("Don't know what to do with entry: " + entry.getName());
+				}
+				return zesf;
+			} else if (directory.equals(SUBMODEL_DIRECTORY)) {
+				ModelZipEntryFile zesf = new ModelZipEntryFile();
+				zesf.setFilename(entry.getName());
+				zesf.setName(FilenameUtils.getBaseName(entry.getName()));
+				if ("mapping".equalsIgnoreCase(zesf.getName())) {
+					zesf.setMapping("true");
+				} else {
+					zesf.setMapping("false");
+				}
+				if ("xml".equalsIgnoreCase(FilenameUtils.getExtension(entry.getName()))) {
+					zesf.setFileType(InputFileType.CELLDESIGNER);
+				} else {
+					throw new InvalidArgumentException("Don't know what to do with entry: " + entry.getName());
+				}
+				return zesf;
+			} else if (directory.equals(IMAGES_DIRECTORY)) {
+				ImageZipEntryFile result = new ImageZipEntryFile(entry.getName(), zipFile.getInputStream(entry));
+				return result;
+			} else if (directory.equals(LAYOUT_DIRECTORY)) {
+				LayoutZipEntryFile result = createLayoutZipEntryFile(entry.getName(), zipFile.getInputStream(entry));
+				return result;
+			} else if (directory.equals(DATA_MINING_DIRECTORY)) {
+				DataMiningZipEntryFile result = new DataMiningZipEntryFile(entry.getName());
+				result.setName(FilenameUtils.getBaseName(entry.getName()));
+				for (Map.Entry<String, String> mapEntry : TextFileUtils.getHeaderParametersFromFile(zipFile.getInputStream(entry)).entrySet()) {
+					result.setHeaderParameter(mapEntry.getKey(), mapEntry.getValue());
+				}
+
+				if (result.getHeaderParameter(DM_HEADER_PARAM_TYPE) != null) {
+					DataMiningType type = DataMiningType.valueOf(result.getHeaderParameter(DM_HEADER_PARAM_TYPE));
+					result.setType(type);
+				} else {
+					result.setType(DataMiningType.UNKNOWN);
+				}
+
+				if (result.getHeaderParameter(DM_HEADER_PARAM_DESCRIPTION) != null) {
+					result.setDescription(result.getHeaderParameter(DM_HEADER_PARAM_DESCRIPTION));
+				}
+
+				if (result.getHeaderParameter(DM_HEADER_PARAM_NAME) != null) {
+					result.setName(result.getHeaderParameter(DM_HEADER_PARAM_NAME));
+				}
+
+				if (result.getHeaderParameter(DM_HEADER_PARAM_SOURCE) != null) {
+					result.setSource(result.getHeaderParameter(DM_HEADER_PARAM_SOURCE));
+				}
+
+				return result;
+			} else {
+				throw new InvalidArgumentException("Don't know what to do with entry: " + entry.getName());
+			}
+		}
+	}
+
+	/**
+	 * Creates {@link LayoutZipEntryFile layout entry} from input stream and given
+	 * name of the layout.
+	 * 
+	 * @param name
+	 *          name of the layout
+	 * @param inputStream
+	 *          stream where data is stored
+	 * @return {@link LayoutZipEntryFile} processed from input data
+	 * @throws IOException
+	 *           thrown when there is problem with accessing input data
+	 */
+	public LayoutZipEntryFile createLayoutZipEntryFile(String name, InputStream inputStream) throws IOException {
+		LayoutZipEntryFile result = new LayoutZipEntryFile();
+		result.setFilename(name);
+		result.setName(FilenameUtils.getBaseName(name));
+		for (Map.Entry<String, String> mapEntry : TextFileUtils.getHeaderParametersFromFile(inputStream).entrySet()) {
+			result.setHeaderParameter(mapEntry.getKey(), mapEntry.getValue());
+		}
+		if (result.getHeaderParameter(LAYOUT_HEADER_PARAM_NAME) != null) {
+			result.setName(result.getHeaderParameter(LAYOUT_HEADER_PARAM_NAME));
+		}
+		if (result.getHeaderParameter(LAYOUT_HEADER_PARAM_DESCRIPTION) != null) {
+			result.setDescription(result.getHeaderParameter(LAYOUT_HEADER_PARAM_DESCRIPTION));
+		}
+		return result;
+	}
+
+}
diff --git a/converter/src/test/java/lcsb/mapviewer/converter/ComplexZipConverterTest.java b/converter/src/test/java/lcsb/mapviewer/converter/ComplexZipConverterTest.java
index 9d328c20fb..693eaed63f 100644
--- a/converter/src/test/java/lcsb/mapviewer/converter/ComplexZipConverterTest.java
+++ b/converter/src/test/java/lcsb/mapviewer/converter/ComplexZipConverterTest.java
@@ -14,6 +14,11 @@ import java.util.List;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
 import lcsb.mapviewer.common.MimeType;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.common.exception.InvalidClassException;
@@ -25,6 +30,8 @@ import lcsb.mapviewer.model.map.OverviewLink;
 import lcsb.mapviewer.model.map.OverviewModelLink;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
 import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.PhenotypeAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelFullIndexed;
@@ -39,11 +46,6 @@ import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Phenotype;
 import lcsb.mapviewer.model.map.species.Protein;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
 public class ComplexZipConverterTest {
 	private static Logger	logger	= Logger.getLogger(ComplexZipConverterTest.class);
 
@@ -61,30 +63,30 @@ public class ComplexZipConverterTest {
 		public Model createModel(ConverterParams params) {
 			Model result = new ModelFullIndexed(null);
 
-			Protein s1 = new GenericProtein();
+			GenericProtein s1 = new GenericProtein();
 			s1.setElementId("s1");
-			SpeciesAlias sa1 = new SpeciesAlias(s1);
+			SpeciesAlias sa1 = new GenericProteinAlias(s1);
 			sa1.setAliasId("sa1");
 			result.addAlias(sa1);
 			result.addElement(s1);
 
-			Protein s2 = new GenericProtein();
+			GenericProtein s2 = new GenericProtein();
 			s2.setElementId("s2");
-			SpeciesAlias sa2 = new SpeciesAlias(s2);
+			SpeciesAlias sa2 = new GenericProteinAlias(s2);
 			sa2.setAliasId("sa2");
 			result.addAlias(sa2);
 			result.addElement(s2);
 
-			Protein s3 = new GenericProtein();
+			GenericProtein s3 = new GenericProtein();
 			s3.setElementId("s3");
-			SpeciesAlias sa3 = new SpeciesAlias(s3);
+			SpeciesAlias sa3 = new GenericProteinAlias(s3);
 			sa3.setAliasId("sa3");
 			result.addAlias(sa3);
 			result.addElement(s3);
 
 			Phenotype s4 = new Phenotype();
 			s4.setElementId("s4");
-			SpeciesAlias sa4 = new SpeciesAlias(s4);
+			SpeciesAlias sa4 = new PhenotypeAlias(s4);
 			sa4.setAliasId("sa4");
 			result.addAlias(sa4);
 			result.addElement(s4);
@@ -96,10 +98,10 @@ public class ComplexZipConverterTest {
 			cs1.setName("main");
 			result.addAlias(ca1);
 			result.addElement(cs1);
-			Protein s5 = new GenericProtein();
+			GenericProtein s5 = new GenericProtein();
 			s5.setElementId("s5");
 			s5.setName("sa1");
-			SpeciesAlias sa5 = new SpeciesAlias(s5);
+			SpeciesAlias sa5 = new GenericProteinAlias(s5);
 			sa5.setAliasId("sa5");
 			result.addAlias(sa5);
 			result.addElement(s5);
@@ -108,7 +110,7 @@ public class ComplexZipConverterTest {
 			Phenotype s6 = new Phenotype();
 			s6.setElementId("s6");
 			s6.setName("sa4");
-			SpeciesAlias sa6 = new SpeciesAlias(s6);
+			SpeciesAlias sa6 = new PhenotypeAlias(s6);
 			sa6.setAliasId("sa6");
 			result.addAlias(sa6);
 			result.addElement(s6);
@@ -122,10 +124,10 @@ public class ComplexZipConverterTest {
 			cs2.setName("s1");
 			result.addAlias(ca2);
 			result.addElement(cs2);
-			Protein s7 = new GenericProtein();
+			GenericProtein s7 = new GenericProtein();
 			s7.setElementId("s7");
 			s7.setName("sa1");
-			SpeciesAlias sa7 = new SpeciesAlias(s7);
+			SpeciesAlias sa7 = new GenericProteinAlias(s7);
 			sa7.setAliasId("sa7");
 			result.addAlias(sa7);
 			result.addElement(s7);
diff --git a/model-command/src/test/java/lcsb/mapviewer/commands/ColorModelCommandTest.java b/model-command/src/test/java/lcsb/mapviewer/commands/ColorModelCommandTest.java
index dfdd85384d..1af65daeda 100644
--- a/model-command/src/test/java/lcsb/mapviewer/commands/ColorModelCommandTest.java
+++ b/model-command/src/test/java/lcsb/mapviewer/commands/ColorModelCommandTest.java
@@ -20,7 +20,7 @@ import lcsb.mapviewer.model.map.MiriamType;
 import lcsb.mapviewer.model.map.layout.ColorSchema;
 import lcsb.mapviewer.model.map.layout.GenericColorSchema;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelComparator;
 import lcsb.mapviewer.model.map.model.ModelFullIndexed;
@@ -28,7 +28,6 @@ import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
 import lcsb.mapviewer.model.map.model.SubmodelType;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
 
 public class ColorModelCommandTest extends CommandTestFunctions {
 	Logger logger = Logger.getLogger(ColorModelCommandTest.class);
@@ -279,7 +278,7 @@ public class ColorModelCommandTest extends CommandTestFunctions {
 			throw e;
 		}
 	}
-	
+
 	@Test
 	public void testColoredReactions2() throws Exception {
 		try {
@@ -307,35 +306,33 @@ public class ColorModelCommandTest extends CommandTestFunctions {
 			throw e;
 		}
 	}
-	
+
 	@Test
 	public void testAliasMatchWithReactionId() throws Exception {
 		try {
 			GenericColorSchema colorSchema = new GenericColorSchema();
 			colorSchema.setName(null);
 			colorSchema.setReactionIdentifier("1");
-			
-			Alias alias = new SpeciesAlias();
-			Protein protein = new GenericProtein();
+
+			GenericProtein protein = new GenericProtein();
 			protein.setName("test");
-			alias.setElement(protein);
-			
+			GenericProteinAlias alias = new GenericProteinAlias(protein);
+
 			List<ColorSchema> schemas = new ArrayList<>();
 			schemas.add(colorSchema);
 
 			ColorModelCommand factory = new ColorModelCommand(new ModelFullIndexed(null), schemas);
 
 			assertFalse(factory.match(alias, colorSchema));
-			
+
 			colorSchema.setReactionIdentifier(null);
 			assertTrue(factory.match(alias, colorSchema));
-			
 
 		} catch (Exception e) {
 			e.printStackTrace();
 			throw e;
 		}
-		
+
 	}
-	
+
 }
diff --git a/model-command/src/test/java/lcsb/mapviewer/commands/CommandTestFunctions.java b/model-command/src/test/java/lcsb/mapviewer/commands/CommandTestFunctions.java
index ebbeaf037e..14a3111ff7 100644
--- a/model-command/src/test/java/lcsb/mapviewer/commands/CommandTestFunctions.java
+++ b/model-command/src/test/java/lcsb/mapviewer/commands/CommandTestFunctions.java
@@ -5,24 +5,24 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.log4j.Logger;
+
 import lcsb.mapviewer.converter.ConverterParams;
 import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
 import lcsb.mapviewer.model.map.agregator.Compartment;
 import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelFullIndexed;
 import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Protein;
-
-import org.apache.log4j.Logger;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 
 public abstract class CommandTestFunctions {
-	public double										 EPSILON = 1e-6;
+	public double											EPSILON	= 1e-6;
 
 	Logger														logger	= Logger.getLogger(CommandTestFunctions.class);
 
-	private static Map<String, Model> models	= new HashMap<String, Model>();
+	private static Map<String, Model>	models	= new HashMap<String, Model>();
 
 	protected Model getModelForFile(String fileName, boolean fromCache) throws Exception {
 		if (!fromCache) {
@@ -51,7 +51,7 @@ public abstract class CommandTestFunctions {
 		ComplexSpecies complex = new ComplexSpecies();
 		complex.setElementId("complex_id");
 
-		Protein protein = new Protein();
+		GenericProtein protein = new GenericProtein();
 		protein.setNotes(null);
 		protein.setParent(compartment);
 		protein.setElementId("species_id");
@@ -66,14 +66,12 @@ public abstract class CommandTestFunctions {
 		model.addElement(protein);
 		model.addElement(complex);
 
-		ComplexAlias complexAlias = new ComplexAlias();
+		ComplexAlias complexAlias = new ComplexAlias(complex);
 		complexAlias.setAliasId("complex_alias_id");
-		complexAlias.setSpecies(complex);
 		model.addAlias(complexAlias);
 
-		SpeciesAlias alias = new SpeciesAlias();
+		GenericProteinAlias alias = new GenericProteinAlias(protein);
 		alias.setAliasId("alias_id");
-		alias.setSpecies(protein);
 		complexAlias.addAlias(alias);
 
 		model.addAlias(alias);
diff --git a/model-command/src/test/java/lcsb/mapviewer/commands/CopyCommandTest.java b/model-command/src/test/java/lcsb/mapviewer/commands/CopyCommandTest.java
index 032b83c900..43202aac15 100644
--- a/model-command/src/test/java/lcsb/mapviewer/commands/CopyCommandTest.java
+++ b/model-command/src/test/java/lcsb/mapviewer/commands/CopyCommandTest.java
@@ -7,6 +7,10 @@ import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.converter.ConverterParams;
 import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
@@ -15,6 +19,7 @@ import lcsb.mapviewer.model.map.OverviewModelLink;
 import lcsb.mapviewer.model.map.agregator.Compartment;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
 import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.layout.graphics.Layer;
 import lcsb.mapviewer.model.map.model.AliasSubmodelConnection;
@@ -25,12 +30,9 @@ import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
 import lcsb.mapviewer.model.map.model.SubmodelType;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Protein;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
 public class CopyCommandTest extends CommandTestFunctions {
 
 	@Before
@@ -63,7 +65,7 @@ public class CopyCommandTest extends CommandTestFunctions {
 			Compartment compartment = new Compartment();
 			model.addCompartment(compartment);
 
-			Protein protein = new Protein();
+			Protein protein = new GenericProtein();
 			protein.setNotes(null);
 			protein.setParent(compartment);
 			protein.setElementId("A");
@@ -91,7 +93,7 @@ public class CopyCommandTest extends CommandTestFunctions {
 			ComplexSpecies complex = new ComplexSpecies();
 			complex.setElementId("id");
 
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setNotes(null);
 			protein.setParent(compartment);
 			protein.setElementId("A");
@@ -100,14 +102,11 @@ public class CopyCommandTest extends CommandTestFunctions {
 			model.addElement(protein);
 			model.addElement(complex);
 
-			ComplexAlias complexAlias = new ComplexAlias();
+			ComplexAlias complexAlias = new ComplexAlias(complex);
 			complexAlias.setAliasId("id2");
-			complexAlias.setSpecies(complex);
 			model.addAlias(complexAlias);
 
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setAliasId("B");
-			alias.setSpecies(protein);
+			GenericProteinAlias alias = new GenericProteinAlias("B",protein);
 			complexAlias.addAlias(alias);
 
 			model.addAlias(alias);
@@ -299,12 +298,12 @@ public class CopyCommandTest extends CommandTestFunctions {
 	private Model getModel() {
 		Model model = new ModelFullIndexed(null);
 		model.setNotes("Some description");
-		Protein protein = new Protein();
+		GenericProtein protein = new GenericProtein();
 		protein.setName("ad");
 		protein.setElementId("A");
 		model.addElement(protein);
 
-		SpeciesAlias alias = new SpeciesAlias(protein);
+		GenericProteinAlias alias = new GenericProteinAlias(protein);
 		alias.setAliasId("a_id");
 		model.addAlias(alias);
 
diff --git a/model-command/src/test/java/lcsb/mapviewer/commands/properties/ChangeElementMiriamDataCommandTest.java b/model-command/src/test/java/lcsb/mapviewer/commands/properties/ChangeElementMiriamDataCommandTest.java
index 1d55a4c08f..d6743707c2 100644
--- a/model-command/src/test/java/lcsb/mapviewer/commands/properties/ChangeElementMiriamDataCommandTest.java
+++ b/model-command/src/test/java/lcsb/mapviewer/commands/properties/ChangeElementMiriamDataCommandTest.java
@@ -1,88 +1,88 @@
-package lcsb.mapviewer.commands.properties;
-
-import static org.junit.Assert.*;
-import lcsb.mapviewer.commands.CommandExecutionException;
-import lcsb.mapviewer.commands.CommandTestFunctions;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.model.Model;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ChangeElementMiriamDataCommandTest extends CommandTestFunctions {
-
-	Model model;
-
-	@Before
-	public void setUp() throws Exception {
-		model = createSimpleModel();
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testWithoutChange() throws Exception {
-		try {
-			Alias alias = model.getAliasByAliasId("alias_id");
-			MiriamData md = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
-			MiriamData md2 = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
-			alias.getElement().addMiriamData(md);
-			ChangeElementMiriamDataCommand command = new ChangeElementMiriamDataCommand(model, alias, md2, md);
-			command.execute();
-			assertTrue(alias.getElement().getMiriamData().contains(md2));
-			assertEquals(1, alias.getElement().getMiriamData().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidChange() throws Exception {
-		try {
-			Alias alias = model.getAliasByAliasId("alias_id");
-			MiriamData md = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
-			MiriamData md2 = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA2");
-			alias.getElement().addMiriamData(md);
-			alias.getElement().addMiriamData(md2);
-			ChangeElementMiriamDataCommand command = new ChangeElementMiriamDataCommand(model, alias, md2, md);
-			try {
-				command.execute();
-				fail("Exception expected");
-			} catch (CommandExecutionException e) {
-				assertTrue(alias.getElement().getMiriamData().contains(md));
-				assertTrue(alias.getElement().getMiriamData().contains(md2));
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-
-	@Test
-	public void testChange() throws Exception {
-		try {
-			Alias alias = model.getAliasByAliasId("alias_id");
-			MiriamData md = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
-			MiriamData md2 = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA2");
-			MiriamData md3 = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
-			alias.getElement().addMiriamData(md);
-			ChangeElementMiriamDataCommand command = new ChangeElementMiriamDataCommand(model, alias, md2, md);
-			command.execute();
-			assertTrue(alias.getElement().getMiriamData().contains(md2));
-			assertFalse(alias.getElement().getMiriamData().contains(md3));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-}
+package lcsb.mapviewer.commands.properties;
+
+import static org.junit.Assert.*;
+import lcsb.mapviewer.commands.CommandExecutionException;
+import lcsb.mapviewer.commands.CommandTestFunctions;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.model.Model;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ChangeElementMiriamDataCommandTest extends CommandTestFunctions {
+
+	Model model;
+
+	@Before
+	public void setUp() throws Exception {
+		model = createSimpleModel();
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testWithoutChange() throws Exception {
+		try {
+			Alias alias = model.getAliasByAliasId("alias_id");
+			MiriamData md = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
+			MiriamData md2 = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
+			alias.getElement().addMiriamData(md);
+			ChangeElementMiriamDataCommand command = new ChangeElementMiriamDataCommand(model, alias, md2, md);
+			command.execute();
+			assertTrue(alias.getElement().getMiriamData().contains(md2));
+			assertEquals(1, alias.getElement().getMiriamData().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidChange() throws Exception {
+		try {
+			Alias alias = model.getAliasByAliasId("alias_id");
+			MiriamData md = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
+			MiriamData md2 = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA2");
+			alias.getElement().addMiriamData(md);
+			alias.getElement().addMiriamData(md2);
+			ChangeElementMiriamDataCommand command = new ChangeElementMiriamDataCommand(model, alias, md2, md);
+			try {
+				command.execute();
+				fail("Exception expected");
+			} catch (CommandExecutionException e) {
+				assertTrue(alias.getElement().getMiriamData().contains(md));
+				assertTrue(alias.getElement().getMiriamData().contains(md2));
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+
+	@Test
+	public void testChange() throws Exception {
+		try {
+			Alias alias = model.getAliasByAliasId("alias_id");
+			MiriamData md = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
+			MiriamData md2 = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA2");
+			MiriamData md3 = new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA");
+			alias.getElement().addMiriamData(md);
+			ChangeElementMiriamDataCommand command = new ChangeElementMiriamDataCommand(model, alias, md2, md);
+			command.execute();
+			assertTrue(alias.getElement().getMiriamData().contains(md2));
+			assertFalse(alias.getElement().getMiriamData().contains(md3));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/cache/BigFileEntry.java b/model/src/main/java/lcsb/mapviewer/model/cache/BigFileEntry.java
index 460b07ec14..a56b7c135b 100644
--- a/model/src/main/java/lcsb/mapviewer/model/cache/BigFileEntry.java
+++ b/model/src/main/java/lcsb/mapviewer/model/cache/BigFileEntry.java
@@ -1,116 +1,116 @@
-package lcsb.mapviewer.model.cache;
-
-import java.io.Serializable;
-import java.util.Calendar;
-
-import javax.persistence.Column;
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.IProgressUpdater;
-
-/**
- * Database object representing big file cached in filesystem.
- * 
- * @author Piotr Gawron
- *
- */
-@Entity
-@DiscriminatorValue("BIG_FILE_ENTRY")
-public class BigFileEntry extends FileEntry implements Serializable {
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Url from which file was obtained.
-	 */
-	@Column(columnDefinition = "TEXT")
-	private String						url;
-
-	/**
-	 * When file was downloaded.
-	 */
-	private Calendar					downloadDate;
-
-	/**
-	 * What is the download progress (value between 0 and
-	 * {@link IProgressUpdater#MAX_PROGRESS 100}).
-	 */
-	private Double						downloadProgress;
-
-	/**
-	 * {@link Thread} identifier that is downloading the file.
-	 */
-	private Long							downloadThreadId;
-
-	/**
-	 * @return the url
-	 * @see #url
-	 */
-	public String getUrl() {
-		return url;
-	}
-
-	/**
-	 * @param url
-	 *          the url to set
-	 * @see #url
-	 */
-	public void setUrl(String url) {
-		this.url = url;
-	}
-
-	/**
-	 * @return the downloadDate
-	 * @see #downloadDate
-	 */
-	public Calendar getDownloadDate() {
-		return downloadDate;
-	}
-
-	/**
-	 * @param downloadDate
-	 *          the downloadDate to set
-	 * @see #downloadDate
-	 */
-	public void setDownloadDate(Calendar downloadDate) {
-		this.downloadDate = downloadDate;
-	}
-
-	/**
-	 * @return the downloadProgress
-	 * @see #downloadProgress
-	 */
-	public Double getDownloadProgress() {
-		return downloadProgress;
-	}
-
-	/**
-	 * @param downloadProgress
-	 *          the downloadProgress to set
-	 * @see #downloadProgress
-	 */
-	public void setDownloadProgress(Double downloadProgress) {
-		this.downloadProgress = downloadProgress;
-	}
-
-	/**
-	 * @return the downloadThreadId
-	 * @see #downloadThreadId
-	 */
-	public Long getDownloadThreadId() {
-		return downloadThreadId;
-	}
-
-	/**
-	 * @param downloadThreadId
-	 *          the downloadThreadId to set
-	 * @see #downloadThreadId
-	 */
-	public void setDownloadThreadId(Long downloadThreadId) {
-		this.downloadThreadId = downloadThreadId;
-	}
-
-}
+package lcsb.mapviewer.model.cache;
+
+import java.io.Serializable;
+import java.util.Calendar;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.IProgressUpdater;
+
+/**
+ * Database object representing big file cached in filesystem.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+@Entity
+@DiscriminatorValue("BIG_FILE_ENTRY")
+public class BigFileEntry extends FileEntry implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Url from which file was obtained.
+	 */
+	@Column(columnDefinition = "TEXT")
+	private String						url;
+
+	/**
+	 * When file was downloaded.
+	 */
+	private Calendar					downloadDate;
+
+	/**
+	 * What is the download progress (value between 0 and
+	 * {@link IProgressUpdater#MAX_PROGRESS 100}).
+	 */
+	private Double						downloadProgress;
+
+	/**
+	 * {@link Thread} identifier that is downloading the file.
+	 */
+	private Long							downloadThreadId;
+
+	/**
+	 * @return the url
+	 * @see #url
+	 */
+	public String getUrl() {
+		return url;
+	}
+
+	/**
+	 * @param url
+	 *          the url to set
+	 * @see #url
+	 */
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	/**
+	 * @return the downloadDate
+	 * @see #downloadDate
+	 */
+	public Calendar getDownloadDate() {
+		return downloadDate;
+	}
+
+	/**
+	 * @param downloadDate
+	 *          the downloadDate to set
+	 * @see #downloadDate
+	 */
+	public void setDownloadDate(Calendar downloadDate) {
+		this.downloadDate = downloadDate;
+	}
+
+	/**
+	 * @return the downloadProgress
+	 * @see #downloadProgress
+	 */
+	public Double getDownloadProgress() {
+		return downloadProgress;
+	}
+
+	/**
+	 * @param downloadProgress
+	 *          the downloadProgress to set
+	 * @see #downloadProgress
+	 */
+	public void setDownloadProgress(Double downloadProgress) {
+		this.downloadProgress = downloadProgress;
+	}
+
+	/**
+	 * @return the downloadThreadId
+	 * @see #downloadThreadId
+	 */
+	public Long getDownloadThreadId() {
+		return downloadThreadId;
+	}
+
+	/**
+	 * @param downloadThreadId
+	 *          the downloadThreadId to set
+	 * @see #downloadThreadId
+	 */
+	public void setDownloadThreadId(Long downloadThreadId) {
+		this.downloadThreadId = downloadThreadId;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/cache/CacheType.java b/model/src/main/java/lcsb/mapviewer/model/cache/CacheType.java
index c2adbeface..0807d3e244 100644
--- a/model/src/main/java/lcsb/mapviewer/model/cache/CacheType.java
+++ b/model/src/main/java/lcsb/mapviewer/model/cache/CacheType.java
@@ -1,102 +1,102 @@
-package lcsb.mapviewer.model.cache;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * Defines types of objects stored in the cache and interfaces used for
- * refreshing them.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@Table(name = "cache_type")
-public class CacheType implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Class of object that will refresh the data of given type.
-	 */
-	private String						className;
-
-	/**
-	 * Unique local database identifier.
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
-	@Column(name = "idDb", unique = true, nullable = false)
-	private int								id;
-
-	/**
-	 * How many days cached value is valid.
-	 */
-	private int								validity;
-
-	/**
-	 * @return the validity
-	 * @see #validity
-	 */
-	public int getValidity() {
-		return validity;
-	}
-
-	/**
-	 * @param validity
-	 *          the validity to set
-	 * @see #validity
-	 */
-	public void setValidity(int validity) {
-		this.validity = validity;
-	}
-
-	/**
-	 * @return the className
-	 * @see #className
-	 */
-	public String getClassName() {
-		return className;
-	}
-
-	/**
-	 * @param className
-	 *          the className to set
-	 * @see #className
-	 */
-	public void setClassName(String className) {
-		this.className = className;
-	}
-
-	/**
-	 * @return the id
-	 * @see #id
-	 */
-	public int getId() {
-		return id;
-	}
-
-	/**
-	 * @param id
-	 *          the id to set
-	 * @see #id
-	 */
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	@Override
-	public String toString() {
-		return className + " [id: " + id + "]";
-	}
-
-}
+package lcsb.mapviewer.model.cache;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * Defines types of objects stored in the cache and interfaces used for
+ * refreshing them.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@Table(name = "cache_type")
+public class CacheType implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Class of object that will refresh the data of given type.
+	 */
+	private String						className;
+
+	/**
+	 * Unique local database identifier.
+	 */
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "idDb", unique = true, nullable = false)
+	private int								id;
+
+	/**
+	 * How many days cached value is valid.
+	 */
+	private int								validity;
+
+	/**
+	 * @return the validity
+	 * @see #validity
+	 */
+	public int getValidity() {
+		return validity;
+	}
+
+	/**
+	 * @param validity
+	 *          the validity to set
+	 * @see #validity
+	 */
+	public void setValidity(int validity) {
+		this.validity = validity;
+	}
+
+	/**
+	 * @return the className
+	 * @see #className
+	 */
+	public String getClassName() {
+		return className;
+	}
+
+	/**
+	 * @param className
+	 *          the className to set
+	 * @see #className
+	 */
+	public void setClassName(String className) {
+		this.className = className;
+	}
+
+	/**
+	 * @return the id
+	 * @see #id
+	 */
+	public int getId() {
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *          the id to set
+	 * @see #id
+	 */
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	@Override
+	public String toString() {
+		return className + " [id: " + id + "]";
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/cache/FileEntry.java b/model/src/main/java/lcsb/mapviewer/model/cache/FileEntry.java
index 4d11eecc66..527fa61854 100644
--- a/model/src/main/java/lcsb/mapviewer/model/cache/FileEntry.java
+++ b/model/src/main/java/lcsb/mapviewer/model/cache/FileEntry.java
@@ -1,172 +1,172 @@
-package lcsb.mapviewer.model.cache;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.DiscriminatorColumn;
-import javax.persistence.DiscriminatorType;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
-
-/**
- * Database object representing file put in the system (it can be some cached
- * file, or uploaded file). There are two ways of storing file. First is by
- * storing the content in database direclty (int the {@link #fileContent}
- * field). Second way should be used for all big files - it soters content in
- * the local file system (relative path is stored in {@link #localPath} field).
- * 
- * @author Piotr Gawron
- *
- */
-@Entity
-@Table(name = "file_entry")
-@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
-@DiscriminatorColumn(name = "file_type_db", discriminatorType = DiscriminatorType.STRING)
-public abstract class FileEntry implements Serializable {
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Unique local database identifier.
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
-	@Column(name = "idDb", unique = true, nullable = false)
-	private int								id;
-
-	/**
-	 * Local (relative) path where file is stored.
-	 */
-	@Column(columnDefinition = "TEXT")
-	private String						localPath;
-
-	/**
-	 * Original name of the file.
-	 */
-	private String						originalFileName;
-
-	/**
-	 * Is the file removed from databse.
-	 */
-	private boolean						removed					 = false;
-
-	/**
-	 * Content of the file. If set to null it means it stored in filesystem.
-	 * 
-	 * @see #localPath
-	 */
-	private byte[]						fileContent;
-
-	/**
-	 * Constructor that copies data from the parameter.
-	 * 
-	 * @param inputData
-	 *          original object from which data will bbe copied
-	 */
-	public FileEntry(FileEntry inputData) {
-		setLocalPath(inputData.getLocalPath());
-		setOriginalFileName(inputData.getOriginalFileName());
-		setRemoved(inputData.isRemoved());
-		if (inputData.getFileContent() != null) {
-			setFileContent(inputData.getFileContent().clone());
-		}
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public FileEntry() {
-	}
-
-	/**
-	 * @return the localPath
-	 * @see #localPath
-	 */
-	public String getLocalPath() {
-		return localPath;
-	}
-
-	/**
-	 * @param localPath
-	 *          the localPath to set
-	 * @see #localPath
-	 */
-	public void setLocalPath(String localPath) {
-		this.localPath = localPath;
-	}
-
-	/**
-	 * @return the id
-	 * @see #id
-	 */
-	public int getId() {
-		return id;
-	}
-
-	/**
-	 * @param id
-	 *          the id to set
-	 * @see #id
-	 */
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	/**
-	 * @return the removed
-	 * @see #removed
-	 */
-	public boolean isRemoved() {
-		return removed;
-	}
-
-	/**
-	 * @param removed
-	 *          the removed to set
-	 * @see #removed
-	 */
-	public void setRemoved(boolean removed) {
-		this.removed = removed;
-	}
-
-	/**
-	 * @return the fileContent
-	 * @see #fileContent
-	 */
-	public byte[] getFileContent() {
-		return fileContent;
-	}
-
-	/**
-	 * @param fileContent
-	 *          the fileContent to set
-	 * @see #fileContent
-	 */
-	public void setFileContent(byte[] fileContent) {
-		this.fileContent = fileContent;
-	}
-
-	/**
-	 * @return the originalFileName
-	 * @see #originalFileName
-	 */
-	public String getOriginalFileName() {
-		return originalFileName;
-	}
-
-	/**
-	 * @param originalFileName
-	 *          the originalFileName to set
-	 * @see #originalFileName
-	 */
-	public void setOriginalFileName(String originalFileName) {
-		this.originalFileName = originalFileName;
-	}
-}
+package lcsb.mapviewer.model.cache;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.DiscriminatorType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.Table;
+
+/**
+ * Database object representing file put in the system (it can be some cached
+ * file, or uploaded file). There are two ways of storing file. First is by
+ * storing the content in database direclty (int the {@link #fileContent}
+ * field). Second way should be used for all big files - it soters content in
+ * the local file system (relative path is stored in {@link #localPath} field).
+ * 
+ * @author Piotr Gawron
+ *
+ */
+@Entity
+@Table(name = "file_entry")
+@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(name = "file_type_db", discriminatorType = DiscriminatorType.STRING)
+public abstract class FileEntry implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Unique local database identifier.
+	 */
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "idDb", unique = true, nullable = false)
+	private int								id;
+
+	/**
+	 * Local (relative) path where file is stored.
+	 */
+	@Column(columnDefinition = "TEXT")
+	private String						localPath;
+
+	/**
+	 * Original name of the file.
+	 */
+	private String						originalFileName;
+
+	/**
+	 * Is the file removed from databse.
+	 */
+	private boolean						removed					 = false;
+
+	/**
+	 * Content of the file. If set to null it means it stored in filesystem.
+	 * 
+	 * @see #localPath
+	 */
+	private byte[]						fileContent;
+
+	/**
+	 * Constructor that copies data from the parameter.
+	 * 
+	 * @param inputData
+	 *          original object from which data will bbe copied
+	 */
+	public FileEntry(FileEntry inputData) {
+		setLocalPath(inputData.getLocalPath());
+		setOriginalFileName(inputData.getOriginalFileName());
+		setRemoved(inputData.isRemoved());
+		if (inputData.getFileContent() != null) {
+			setFileContent(inputData.getFileContent().clone());
+		}
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public FileEntry() {
+	}
+
+	/**
+	 * @return the localPath
+	 * @see #localPath
+	 */
+	public String getLocalPath() {
+		return localPath;
+	}
+
+	/**
+	 * @param localPath
+	 *          the localPath to set
+	 * @see #localPath
+	 */
+	public void setLocalPath(String localPath) {
+		this.localPath = localPath;
+	}
+
+	/**
+	 * @return the id
+	 * @see #id
+	 */
+	public int getId() {
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *          the id to set
+	 * @see #id
+	 */
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	/**
+	 * @return the removed
+	 * @see #removed
+	 */
+	public boolean isRemoved() {
+		return removed;
+	}
+
+	/**
+	 * @param removed
+	 *          the removed to set
+	 * @see #removed
+	 */
+	public void setRemoved(boolean removed) {
+		this.removed = removed;
+	}
+
+	/**
+	 * @return the fileContent
+	 * @see #fileContent
+	 */
+	public byte[] getFileContent() {
+		return fileContent;
+	}
+
+	/**
+	 * @param fileContent
+	 *          the fileContent to set
+	 * @see #fileContent
+	 */
+	public void setFileContent(byte[] fileContent) {
+		this.fileContent = fileContent;
+	}
+
+	/**
+	 * @return the originalFileName
+	 * @see #originalFileName
+	 */
+	public String getOriginalFileName() {
+		return originalFileName;
+	}
+
+	/**
+	 * @param originalFileName
+	 *          the originalFileName to set
+	 * @see #originalFileName
+	 */
+	public void setOriginalFileName(String originalFileName) {
+		this.originalFileName = originalFileName;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/cache/UploadedFileEntry.java b/model/src/main/java/lcsb/mapviewer/model/cache/UploadedFileEntry.java
index 6bb5407522..0ef8844970 100644
--- a/model/src/main/java/lcsb/mapviewer/model/cache/UploadedFileEntry.java
+++ b/model/src/main/java/lcsb/mapviewer/model/cache/UploadedFileEntry.java
@@ -1,40 +1,40 @@
-package lcsb.mapviewer.model.cache;
-
-import java.io.Serializable;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-/**
- * Database object representing file uploaded into system.
- * 
- * @author Piotr Gawron
- *
- */
-@Entity
-@DiscriminatorValue("UPLOADED_FILE_ENTRY")
-public class UploadedFileEntry extends FileEntry implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Default constructor.
-	 */
-	public UploadedFileEntry() {
-
-	}
-
-	/**
-	 * Constructor that copies data from the parameter.
-	 * 
-	 * @param original
-	 *          original object from which data will bbe copied
-	 */
-	public UploadedFileEntry(UploadedFileEntry original) {
-		super(original);
-	}
-
-}
+package lcsb.mapviewer.model.cache;
+
+import java.io.Serializable;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+/**
+ * Database object representing file uploaded into system.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+@Entity
+@DiscriminatorValue("UPLOADED_FILE_ENTRY")
+public class UploadedFileEntry extends FileEntry implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor.
+	 */
+	public UploadedFileEntry() {
+
+	}
+
+	/**
+	 * Constructor that copies data from the parameter.
+	 * 
+	 * @param original
+	 *          original object from which data will bbe copied
+	 */
+	public UploadedFileEntry(UploadedFileEntry original) {
+		super(original);
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/graphics/ArrowTypeData.java b/model/src/main/java/lcsb/mapviewer/model/graphics/ArrowTypeData.java
index 91ecadac86..9fac35e1c3 100644
--- a/model/src/main/java/lcsb/mapviewer/model/graphics/ArrowTypeData.java
+++ b/model/src/main/java/lcsb/mapviewer/model/graphics/ArrowTypeData.java
@@ -1,184 +1,184 @@
-package lcsb.mapviewer.model.graphics;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * This class define data for arrow ends.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-public class ArrowTypeData implements Serializable {
-	/**
-	 * 
-	 */
-	private static final long		serialVersionUID		 = 1L;
-
-	/**
-	 * Default angle of the arrow.
-	 */
-	private static final double	DEFAULT_ARROW_ANGLE	 = 0.875 * Math.PI;
-
-	/**
-	 * Default length of the arrow.
-	 */
-	private static final int		DEFAULT_ARROW_LENGTH = 15;
-
-	/**
-	 * Unique identifier in the database.
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
-	@Column(name = "idDb", unique = true, nullable = false)
-	private int									id;
-
-	/**
-	 * Type of the arrow.
-	 */
-	private ArrowType						arrowType;
-	
-	/**
-	 * Defines type of the line used to draw arrow end.
-	 */
-	private LineType						arrowLineType;
-	
-	/**
-	 * Defines length of the arrow head.
-	 */
-	private double							len;
-	
-	/**
-	 * Defines angle of the arrow head (when necessary).
-	 */
-	private double							angle;
-
-	/**
-	 * Default constructor - uses default values.
-	 */
-	public ArrowTypeData() {
-		arrowType = ArrowType.NONE;
-		arrowLineType = LineType.SOLID;
-		len = DEFAULT_ARROW_LENGTH;
-		angle = DEFAULT_ARROW_ANGLE;
-	}
-
-	/**
-	 * Constructor that creates object with the data copied from param object.
-	 * 
-	 * @param param
-	 *          object used for initialization of the data
-	 */
-	public ArrowTypeData(ArrowTypeData param) {
-		arrowType = param.arrowType;
-		arrowLineType = param.arrowLineType;
-		len = param.len;
-		angle = param.angle;
-	}
-
-	/**
-	 * Creates a copy of the object.
-	 * 
-	 * @return object copy
-	 */
-	public ArrowTypeData copy() {
-		if (this.getClass() == ArrowTypeData.class) {
-			return new ArrowTypeData(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	/**
-	 * @return the id
-	 * @see #id
-	 */
-	public int getId() {
-		return id;
-	}
-
-	/**
-	 * @param id
-	 *          the id to set
-	 * @see #id
-	 */
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	/**
-	 * @return the arrowType
-	 * @see #arrowType
-	 */
-	public ArrowType getArrowType() {
-		return arrowType;
-	}
-
-	/**
-	 * @param arrowType
-	 *          the arrowType to set
-	 * @see #arrowType
-	 */
-	public void setArrowType(ArrowType arrowType) {
-		this.arrowType = arrowType;
-	}
-
-	/**
-	 * @return the arrowLineType
-	 * @see #arrowLineType
-	 */
-	public LineType getArrowLineType() {
-		return arrowLineType;
-	}
-
-	/**
-	 * @param arrowLineType
-	 *          the arrowLineType to set
-	 * @see #arrowLineType
-	 */
-	public void setArrowLineType(LineType arrowLineType) {
-		this.arrowLineType = arrowLineType;
-	}
-
-	/**
-	 * @return the len
-	 * @see #len
-	 */
-	public double getLen() {
-		return len;
-	}
-
-	/**
-	 * @param len
-	 *          the len to set
-	 * @see #len
-	 */
-	public void setLen(double len) {
-		this.len = len;
-	}
-
-	/**
-	 * @return the angle
-	 * @see #angle
-	 */
-	public double getAngle() {
-		return angle;
-	}
-
-	/**
-	 * @param angle
-	 *          the angle to set
-	 * @see #angle
-	 */
-	public void setAngle(double angle) {
-		this.angle = angle;
-	}
-}
+package lcsb.mapviewer.model.graphics;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * This class define data for arrow ends.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+public class ArrowTypeData implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long		serialVersionUID		 = 1L;
+
+	/**
+	 * Default angle of the arrow.
+	 */
+	private static final double	DEFAULT_ARROW_ANGLE	 = 0.875 * Math.PI;
+
+	/**
+	 * Default length of the arrow.
+	 */
+	private static final int		DEFAULT_ARROW_LENGTH = 15;
+
+	/**
+	 * Unique identifier in the database.
+	 */
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "idDb", unique = true, nullable = false)
+	private int									id;
+
+	/**
+	 * Type of the arrow.
+	 */
+	private ArrowType						arrowType;
+	
+	/**
+	 * Defines type of the line used to draw arrow end.
+	 */
+	private LineType						arrowLineType;
+	
+	/**
+	 * Defines length of the arrow head.
+	 */
+	private double							len;
+	
+	/**
+	 * Defines angle of the arrow head (when necessary).
+	 */
+	private double							angle;
+
+	/**
+	 * Default constructor - uses default values.
+	 */
+	public ArrowTypeData() {
+		arrowType = ArrowType.NONE;
+		arrowLineType = LineType.SOLID;
+		len = DEFAULT_ARROW_LENGTH;
+		angle = DEFAULT_ARROW_ANGLE;
+	}
+
+	/**
+	 * Constructor that creates object with the data copied from param object.
+	 * 
+	 * @param param
+	 *          object used for initialization of the data
+	 */
+	public ArrowTypeData(ArrowTypeData param) {
+		arrowType = param.arrowType;
+		arrowLineType = param.arrowLineType;
+		len = param.len;
+		angle = param.angle;
+	}
+
+	/**
+	 * Creates a copy of the object.
+	 * 
+	 * @return object copy
+	 */
+	public ArrowTypeData copy() {
+		if (this.getClass() == ArrowTypeData.class) {
+			return new ArrowTypeData(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	/**
+	 * @return the id
+	 * @see #id
+	 */
+	public int getId() {
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *          the id to set
+	 * @see #id
+	 */
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	/**
+	 * @return the arrowType
+	 * @see #arrowType
+	 */
+	public ArrowType getArrowType() {
+		return arrowType;
+	}
+
+	/**
+	 * @param arrowType
+	 *          the arrowType to set
+	 * @see #arrowType
+	 */
+	public void setArrowType(ArrowType arrowType) {
+		this.arrowType = arrowType;
+	}
+
+	/**
+	 * @return the arrowLineType
+	 * @see #arrowLineType
+	 */
+	public LineType getArrowLineType() {
+		return arrowLineType;
+	}
+
+	/**
+	 * @param arrowLineType
+	 *          the arrowLineType to set
+	 * @see #arrowLineType
+	 */
+	public void setArrowLineType(LineType arrowLineType) {
+		this.arrowLineType = arrowLineType;
+	}
+
+	/**
+	 * @return the len
+	 * @see #len
+	 */
+	public double getLen() {
+		return len;
+	}
+
+	/**
+	 * @param len
+	 *          the len to set
+	 * @see #len
+	 */
+	public void setLen(double len) {
+		this.len = len;
+	}
+
+	/**
+	 * @return the angle
+	 * @see #angle
+	 */
+	public double getAngle() {
+		return angle;
+	}
+
+	/**
+	 * @param angle
+	 *          the angle to set
+	 * @see #angle
+	 */
+	public void setAngle(double angle) {
+		this.angle = angle;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/graphics/PolylineData.java b/model/src/main/java/lcsb/mapviewer/model/graphics/PolylineData.java
index ec9a59bd66..2ddf398615 100644
--- a/model/src/main/java/lcsb/mapviewer/model/graphics/PolylineData.java
+++ b/model/src/main/java/lcsb/mapviewer/model/graphics/PolylineData.java
@@ -1,535 +1,535 @@
-package lcsb.mapviewer.model.graphics;
-
-import java.awt.Color;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Line2D;
-import java.awt.geom.Point2D;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-
-import org.apache.log4j.Logger;
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-import org.hibernate.annotations.IndexColumn;
-import org.hibernate.annotations.Type;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.common.geometry.PointTransformation;
-
-/**
- * This class represents general line structure. Line can contain several
- * segments. Begining and the end of the line could be finished with the arrow.
- * There are also color and line width associated with the object.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-public class PolylineData implements Serializable {
-	/**
-	 * 
-	 */
-	private static final long					 serialVersionUID	= 1L;
-
-	/**
-	 * Class used to perform some operation on points.
-	 */
-	private static PointTransformation pt								= new PointTransformation();
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger							 logger						= Logger.getLogger(PolylineData.class);
-
-	/**
-	 * Unique identifier in the database.
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
-	@Column(name = "idDb", unique = true, nullable = false)
-	private int												 id;
-
-	/**
-	 * List of points that build the line.
-	 */
-	@ElementCollection(fetch = FetchType.EAGER)
-	@CollectionTable(name = "point_table", joinColumns = @JoinColumn(name = "idDb"))
-	@IndexColumn(name = "idx")
-	@Column(name = "point_val")
-	@Type(type = "lcsb.mapviewer.persist.mapper.Point2DMapper")
-	@Cascade({ CascadeType.ALL })
-	private List<Point2D>							 points						= new ArrayList<Point2D>();
-
-	/**
-	 * Arrow at the beginning of the line.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToOne
-	private ArrowTypeData							 beginAtd					= new ArrowTypeData();
-
-	/**
-	 * Arrow at the end of the line.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToOne
-	private ArrowTypeData							 endAtd						= new ArrowTypeData();
-
-	/**
-	 * Width of the line.
-	 */
-	private double										 width						= 1;
-
-	/**
-	 * Color of the line.
-	 */
-	private Color											 color						= Color.BLACK;
-
-	/**
-	 * Type of the line (pattern used to draw it).
-	 */
-	private LineType									 type							= LineType.SOLID;
-
-	/**
-	 * Default constructor for simple to points line.
-	 * 
-	 * @param startPoint
-	 *          start point of the line
-	 * @param endPoint
-	 *          end point of the line
-	 */
-	public PolylineData(Point2D startPoint, Point2D endPoint) {
-		addPoint(startPoint);
-		addPoint(endPoint);
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public PolylineData() {
-	}
-
-	/**
-	 * Constructor that creates object initialized by the param line.
-	 * 
-	 * @param param
-	 *          parameter used for data initialization
-	 */
-	public PolylineData(PolylineData param) {
-		points = new ArrayList<Point2D>();
-		for (Point2D point : param.getPoints()) {
-			points.add(new Point2D.Double(point.getX(), point.getY()));
-		}
-		beginAtd = new ArrowTypeData(param.getBeginAtd());
-		endAtd = new ArrowTypeData(param.getEndAtd());
-		width = param.getWidth();
-		color = param.getColor();
-		type = param.getType();
-	}
-
-	/**
-	 * Creates line from the list of points.
-	 * 
-	 * @param pointsList
-	 *          list of points that represent the line
-	 */
-	public PolylineData(List<Point2D> pointsList) {
-		for (Point2D point2d : pointsList) {
-			addPoint(point2d);
-		}
-	}
-
-	/**
-	 * Adds a point to the line.
-	 * 
-	 * @param point
-	 *          point to add
-	 */
-	public void addPoint(Point2D point) {
-		if (!pt.isValidPoint(point)) {
-			throw new InvalidArgumentException("Invalid coordinates: " + point);
-		}
-		points.add(point);
-	}
-
-	/**
-	 * Adds a point to the line at specific point (the rest will be shifted
-	 * accordingly).
-	 * 
-	 * @param point
-	 *          point to add
-	 * @param position
-	 *          where the point should be inserted
-	 */
-	public void addPoint(int position, Point2D point) {
-		if (!pt.isValidPoint(point)) {
-			throw new InvalidArgumentException("Invalid coordinates: " + point);
-		}
-		points.add(position, point);
-	}
-
-	/**
-	 * Set new coordinetas of the point inside line.
-	 * 
-	 * @param position
-	 *          which point should be changed
-	 * @param point
-	 *          new point value
-	 */
-	public void setPoint(int position, Point2D point) {
-		if (!pt.isValidPoint(point)) {
-			throw new InvalidArgumentException("Invalid coordinates (NaN is not accepted): " + point);
-		}
-		points.set(position, point);
-	}
-
-	/**
-	 * Returns all segment lines as a list of {@link Line2D} objects.
-	 * 
-	 * @return list of segment lines
-	 */
-	public List<Line2D> getLines() {
-		List<Line2D> result = new ArrayList<Line2D>();
-		if (points.size() > 1) {
-			Point2D p1 = points.get(0);
-
-			for (int i = 1; i < points.size(); i++) {
-				Point2D p2 = points.get(i);
-				Line2D line = new Line2D.Double(p1, p2);
-				result.add(line);
-				p1 = p2;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Return a line that correspond to the part of line.
-	 * 
-	 * @param from
-	 *          index of the point where line should start
-	 * @param to
-	 *          index of the point where line should end
-	 * @return line that correspond to the part of line
-	 */
-	public PolylineData getSubline(int from, int to) {
-		PolylineData result = new PolylineData(this);
-		result.setPoints(new ArrayList<Point2D>());
-		for (int i = Math.max(from, 0); i < Math.min(to, points.size()); i++) {
-			result.addPoint(new Point2D.Double(points.get(i).getX(), points.get(i).getY()));
-		}
-		return result;
-	}
-
-	/**
-	 * Sets the new value of the last point in the line.
-	 * 
-	 * @param point
-	 *          new value of the last point in the line
-	 */
-	public void setEndPoint(Point2D point) {
-		if (!pt.isValidPoint(point)) {
-			throw new InvalidArgumentException("Invalid coordinates (NaN is not accepted): " + point);
-		}
-		points.set(points.size() - 1, point);
-
-	}
-
-	/**
-	 * Returns coordinates of the last point in the line.
-	 * 
-	 * @return coordinates of the last point in the line
-	 */
-	public Point2D getEndPoint() {
-		return points.get(points.size() - 1);
-	}
-
-	/**
-	 * Transforms line representation into {@link GeneralPath} class.
-	 * 
-	 * @return {@link GeneralPath} representation of line
-	 */
-	public GeneralPath toGeneralPath() {
-		GeneralPath path = new GeneralPath();
-		Point2D p = points.get(0);
-		path.moveTo(p.getX(), p.getY());
-		for (int i = 1; i < points.size(); i++) {
-			p = points.get(i);
-			path.lineTo(p.getX(), p.getY());
-		}
-		return path;
-	}
-
-	/**
-	 * Trims the end of the line.
-	 * 
-	 * @param distToTrim
-	 *          distance by which end of line should be trimmed
-	 */
-	public void trimEnd(double distToTrim) {
-		Point2D last = points.get(points.size() - 1);
-		Point2D last2 = points.get(points.size() - 2);
-		double oldDist = last.distance(last2);
-		if (oldDist <= distToTrim) {
-			last.setLocation(last2);
-		} else {
-			double newDistr = oldDist - distToTrim;
-			double ratio = newDistr / oldDist;
-			double dx = last.getX() - last2.getX();
-			double dy = last.getY() - last2.getY();
-			dx *= ratio;
-			dy *= ratio;
-			last.setLocation(last2.getX() + dx, last2.getY() + dy);
-		}
-	}
-
-	/**
-	 * Trims the begining of the line.
-	 * 
-	 * @param distToTrim
-	 *          distance by which beginning of line should be trimmed
-	 */
-	public void trimBegin(double distToTrim) {
-		Point2D last = points.get(0);
-		Point2D last2 = points.get(1);
-		double oldDist = last.distance(last2);
-		if (oldDist <= distToTrim) {
-			last.setLocation(last2);
-		} else {
-			double newDistr = oldDist - distToTrim;
-			double ratio = newDistr / oldDist;
-			double dx = last.getX() - last2.getX();
-			double dy = last.getY() - last2.getY();
-			dx *= ratio;
-			dy *= ratio;
-			last.setLocation(last2.getX() + dx, last2.getY() + dy);
-		}
-	}
-
-	/**
-	 * Returns the object with reversed order of line.
-	 * 
-	 * @return reversed line
-	 */
-	public PolylineData reverse() {
-		PolylineData result = new PolylineData(this);
-		List<Point2D> points = new ArrayList<Point2D>();
-		for (int i = getPoints().size() - 1; i >= 0; i--) {
-			points.add(getPoints().get(i));
-		}
-		result.setPoints(points);
-		result.setBeginAtd(getEndAtd());
-		result.setEndAtd(getBeginAtd());
-		return result;
-	}
-
-	/**
-	 * Returns length of the whole line.
-	 * 
-	 * @return length of the line
-	 */
-	public double length() {
-		if (points.size() < 2) {
-			return 0;
-		}
-		double dist = 0;
-		Point2D point = points.get(0);
-		for (int i = 1; i < points.size(); i++) {
-			dist += point.distance(points.get(i));
-			point = points.get(i);
-		}
-		return dist;
-	}
-
-	/**
-	 * Sets first point in the line.
-	 * 
-	 * @param point
-	 *          new first point in the line
-	 */
-	public void setStartPoint(Point2D point) {
-		if (!pt.isValidPoint(point)) {
-			throw new InvalidArgumentException("Invalid coordinates: " + point);
-		}
-		points.set(0, point);
-	}
-
-	/**
-	 * Returns first point in the line.
-	 * 
-	 * @return first point in the line
-	 */
-	public Point2D getBeginPoint() {
-		return points.get(0);
-	}
-
-	/**
-	 * @return the points
-	 * @see #points
-	 */
-	public List<Point2D> getPoints() {
-		return points;
-	}
-
-	/**
-	 * @param points
-	 *          the points to set
-	 * @see #points
-	 */
-	public void setPoints(List<Point2D> points) {
-		for (Point2D point : points) {
-			if (!pt.isValidPoint(point)) {
-				throw new InvalidArgumentException("Invalid coordinates: " + point);
-			}
-		}
-		this.points = points;
-	}
-
-	/**
-	 * @return the beginAtd
-	 * @see #beginAtd
-	 */
-	public ArrowTypeData getBeginAtd() {
-		return beginAtd;
-	}
-
-	/**
-	 * @param beginAtd
-	 *          the beginAtd to set
-	 * @see #beginAtd
-	 */
-	public void setBeginAtd(ArrowTypeData beginAtd) {
-		this.beginAtd = beginAtd;
-	}
-
-	/**
-	 * @return the endAtd
-	 * @see #endAtd
-	 */
-	public ArrowTypeData getEndAtd() {
-		return endAtd;
-	}
-
-	/**
-	 * @param endAtd
-	 *          the endAtd to set
-	 * @see #endAtd
-	 */
-	public void setEndAtd(ArrowTypeData endAtd) {
-		this.endAtd = endAtd;
-	}
-
-	/**
-	 * @return the width
-	 * @see #width
-	 */
-	public double getWidth() {
-		return width;
-	}
-
-	/**
-	 * @param width
-	 *          the width to set
-	 * @see #width
-	 */
-	public void setWidth(double width) {
-		this.width = width;
-	}
-
-	/**
-	 * @return the color
-	 * @see #color
-	 */
-	public Color getColor() {
-		return color;
-	}
-
-	/**
-	 * @param color
-	 *          the color to set
-	 * @see #color
-	 */
-	public void setColor(Color color) {
-		this.color = color;
-	}
-
-	/**
-	 * @return the type
-	 * @see #type
-	 */
-	public LineType getType() {
-		return type;
-	}
-
-	/**
-	 * @param type
-	 *          the type to set
-	 * @see #type
-	 */
-	public void setType(LineType type) {
-		this.type = type;
-	}
-
-	/**
-	 * @return the id
-	 * @see #id
-	 */
-	public int getId() {
-		return id;
-	}
-
-	/**
-	 * @param id
-	 *          the id to set
-	 * @see #id
-	 */
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	/**
-	 * @param string
-	 *          the width to set
-	 * @see #width
-	 */
-	public void setWidth(String string) {
-		setWidth(Double.parseDouble(string));
-	}
-
-	/**
-	 * Prepares a copy of the object.
-	 * 
-	 * @return copy of {@link PolylineData}
-	 */
-	public PolylineData copy() {
-		if (this.getClass().equals(PolylineData.class)) {
-			return new PolylineData(this);
-		} else {
-			throw new NotImplementedException("Copy method for " + this.getClass() + " class not implemented.");
-		}
-	}
-
-	@Override
-	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("[" + this.getClass().getSimpleName() + "]: ");
-		for (Point2D point : points) {
-			sb.append(point.getX() + ", " + point.getY() + " ");
-		}
-		return sb.toString();
-	}
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import java.awt.Color;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.CollectionTable;
+import javax.persistence.Column;
+import javax.persistence.ElementCollection;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+
+import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+import org.hibernate.annotations.IndexColumn;
+import org.hibernate.annotations.Type;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.common.geometry.PointTransformation;
+
+/**
+ * This class represents general line structure. Line can contain several
+ * segments. Begining and the end of the line could be finished with the arrow.
+ * There are also color and line width associated with the object.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+public class PolylineData implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long					 serialVersionUID	= 1L;
+
+	/**
+	 * Class used to perform some operation on points.
+	 */
+	private static PointTransformation pt								= new PointTransformation();
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger							 logger						= Logger.getLogger(PolylineData.class);
+
+	/**
+	 * Unique identifier in the database.
+	 */
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "idDb", unique = true, nullable = false)
+	private int												 id;
+
+	/**
+	 * List of points that build the line.
+	 */
+	@ElementCollection(fetch = FetchType.EAGER)
+	@CollectionTable(name = "point_table", joinColumns = @JoinColumn(name = "idDb"))
+	@IndexColumn(name = "idx")
+	@Column(name = "point_val")
+	@Type(type = "lcsb.mapviewer.persist.mapper.Point2DMapper")
+	@Cascade({ CascadeType.ALL })
+	private List<Point2D>							 points						= new ArrayList<Point2D>();
+
+	/**
+	 * Arrow at the beginning of the line.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToOne
+	private ArrowTypeData							 beginAtd					= new ArrowTypeData();
+
+	/**
+	 * Arrow at the end of the line.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToOne
+	private ArrowTypeData							 endAtd						= new ArrowTypeData();
+
+	/**
+	 * Width of the line.
+	 */
+	private double										 width						= 1;
+
+	/**
+	 * Color of the line.
+	 */
+	private Color											 color						= Color.BLACK;
+
+	/**
+	 * Type of the line (pattern used to draw it).
+	 */
+	private LineType									 type							= LineType.SOLID;
+
+	/**
+	 * Default constructor for simple to points line.
+	 * 
+	 * @param startPoint
+	 *          start point of the line
+	 * @param endPoint
+	 *          end point of the line
+	 */
+	public PolylineData(Point2D startPoint, Point2D endPoint) {
+		addPoint(startPoint);
+		addPoint(endPoint);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public PolylineData() {
+	}
+
+	/**
+	 * Constructor that creates object initialized by the param line.
+	 * 
+	 * @param param
+	 *          parameter used for data initialization
+	 */
+	public PolylineData(PolylineData param) {
+		points = new ArrayList<Point2D>();
+		for (Point2D point : param.getPoints()) {
+			points.add(new Point2D.Double(point.getX(), point.getY()));
+		}
+		beginAtd = new ArrowTypeData(param.getBeginAtd());
+		endAtd = new ArrowTypeData(param.getEndAtd());
+		width = param.getWidth();
+		color = param.getColor();
+		type = param.getType();
+	}
+
+	/**
+	 * Creates line from the list of points.
+	 * 
+	 * @param pointsList
+	 *          list of points that represent the line
+	 */
+	public PolylineData(List<Point2D> pointsList) {
+		for (Point2D point2d : pointsList) {
+			addPoint(point2d);
+		}
+	}
+
+	/**
+	 * Adds a point to the line.
+	 * 
+	 * @param point
+	 *          point to add
+	 */
+	public void addPoint(Point2D point) {
+		if (!pt.isValidPoint(point)) {
+			throw new InvalidArgumentException("Invalid coordinates: " + point);
+		}
+		points.add(point);
+	}
+
+	/**
+	 * Adds a point to the line at specific point (the rest will be shifted
+	 * accordingly).
+	 * 
+	 * @param point
+	 *          point to add
+	 * @param position
+	 *          where the point should be inserted
+	 */
+	public void addPoint(int position, Point2D point) {
+		if (!pt.isValidPoint(point)) {
+			throw new InvalidArgumentException("Invalid coordinates: " + point);
+		}
+		points.add(position, point);
+	}
+
+	/**
+	 * Set new coordinetas of the point inside line.
+	 * 
+	 * @param position
+	 *          which point should be changed
+	 * @param point
+	 *          new point value
+	 */
+	public void setPoint(int position, Point2D point) {
+		if (!pt.isValidPoint(point)) {
+			throw new InvalidArgumentException("Invalid coordinates (NaN is not accepted): " + point);
+		}
+		points.set(position, point);
+	}
+
+	/**
+	 * Returns all segment lines as a list of {@link Line2D} objects.
+	 * 
+	 * @return list of segment lines
+	 */
+	public List<Line2D> getLines() {
+		List<Line2D> result = new ArrayList<Line2D>();
+		if (points.size() > 1) {
+			Point2D p1 = points.get(0);
+
+			for (int i = 1; i < points.size(); i++) {
+				Point2D p2 = points.get(i);
+				Line2D line = new Line2D.Double(p1, p2);
+				result.add(line);
+				p1 = p2;
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Return a line that correspond to the part of line.
+	 * 
+	 * @param from
+	 *          index of the point where line should start
+	 * @param to
+	 *          index of the point where line should end
+	 * @return line that correspond to the part of line
+	 */
+	public PolylineData getSubline(int from, int to) {
+		PolylineData result = new PolylineData(this);
+		result.setPoints(new ArrayList<Point2D>());
+		for (int i = Math.max(from, 0); i < Math.min(to, points.size()); i++) {
+			result.addPoint(new Point2D.Double(points.get(i).getX(), points.get(i).getY()));
+		}
+		return result;
+	}
+
+	/**
+	 * Sets the new value of the last point in the line.
+	 * 
+	 * @param point
+	 *          new value of the last point in the line
+	 */
+	public void setEndPoint(Point2D point) {
+		if (!pt.isValidPoint(point)) {
+			throw new InvalidArgumentException("Invalid coordinates (NaN is not accepted): " + point);
+		}
+		points.set(points.size() - 1, point);
+
+	}
+
+	/**
+	 * Returns coordinates of the last point in the line.
+	 * 
+	 * @return coordinates of the last point in the line
+	 */
+	public Point2D getEndPoint() {
+		return points.get(points.size() - 1);
+	}
+
+	/**
+	 * Transforms line representation into {@link GeneralPath} class.
+	 * 
+	 * @return {@link GeneralPath} representation of line
+	 */
+	public GeneralPath toGeneralPath() {
+		GeneralPath path = new GeneralPath();
+		Point2D p = points.get(0);
+		path.moveTo(p.getX(), p.getY());
+		for (int i = 1; i < points.size(); i++) {
+			p = points.get(i);
+			path.lineTo(p.getX(), p.getY());
+		}
+		return path;
+	}
+
+	/**
+	 * Trims the end of the line.
+	 * 
+	 * @param distToTrim
+	 *          distance by which end of line should be trimmed
+	 */
+	public void trimEnd(double distToTrim) {
+		Point2D last = points.get(points.size() - 1);
+		Point2D last2 = points.get(points.size() - 2);
+		double oldDist = last.distance(last2);
+		if (oldDist <= distToTrim) {
+			last.setLocation(last2);
+		} else {
+			double newDistr = oldDist - distToTrim;
+			double ratio = newDistr / oldDist;
+			double dx = last.getX() - last2.getX();
+			double dy = last.getY() - last2.getY();
+			dx *= ratio;
+			dy *= ratio;
+			last.setLocation(last2.getX() + dx, last2.getY() + dy);
+		}
+	}
+
+	/**
+	 * Trims the begining of the line.
+	 * 
+	 * @param distToTrim
+	 *          distance by which beginning of line should be trimmed
+	 */
+	public void trimBegin(double distToTrim) {
+		Point2D last = points.get(0);
+		Point2D last2 = points.get(1);
+		double oldDist = last.distance(last2);
+		if (oldDist <= distToTrim) {
+			last.setLocation(last2);
+		} else {
+			double newDistr = oldDist - distToTrim;
+			double ratio = newDistr / oldDist;
+			double dx = last.getX() - last2.getX();
+			double dy = last.getY() - last2.getY();
+			dx *= ratio;
+			dy *= ratio;
+			last.setLocation(last2.getX() + dx, last2.getY() + dy);
+		}
+	}
+
+	/**
+	 * Returns the object with reversed order of line.
+	 * 
+	 * @return reversed line
+	 */
+	public PolylineData reverse() {
+		PolylineData result = new PolylineData(this);
+		List<Point2D> points = new ArrayList<Point2D>();
+		for (int i = getPoints().size() - 1; i >= 0; i--) {
+			points.add(getPoints().get(i));
+		}
+		result.setPoints(points);
+		result.setBeginAtd(getEndAtd());
+		result.setEndAtd(getBeginAtd());
+		return result;
+	}
+
+	/**
+	 * Returns length of the whole line.
+	 * 
+	 * @return length of the line
+	 */
+	public double length() {
+		if (points.size() < 2) {
+			return 0;
+		}
+		double dist = 0;
+		Point2D point = points.get(0);
+		for (int i = 1; i < points.size(); i++) {
+			dist += point.distance(points.get(i));
+			point = points.get(i);
+		}
+		return dist;
+	}
+
+	/**
+	 * Sets first point in the line.
+	 * 
+	 * @param point
+	 *          new first point in the line
+	 */
+	public void setStartPoint(Point2D point) {
+		if (!pt.isValidPoint(point)) {
+			throw new InvalidArgumentException("Invalid coordinates: " + point);
+		}
+		points.set(0, point);
+	}
+
+	/**
+	 * Returns first point in the line.
+	 * 
+	 * @return first point in the line
+	 */
+	public Point2D getBeginPoint() {
+		return points.get(0);
+	}
+
+	/**
+	 * @return the points
+	 * @see #points
+	 */
+	public List<Point2D> getPoints() {
+		return points;
+	}
+
+	/**
+	 * @param points
+	 *          the points to set
+	 * @see #points
+	 */
+	public void setPoints(List<Point2D> points) {
+		for (Point2D point : points) {
+			if (!pt.isValidPoint(point)) {
+				throw new InvalidArgumentException("Invalid coordinates: " + point);
+			}
+		}
+		this.points = points;
+	}
+
+	/**
+	 * @return the beginAtd
+	 * @see #beginAtd
+	 */
+	public ArrowTypeData getBeginAtd() {
+		return beginAtd;
+	}
+
+	/**
+	 * @param beginAtd
+	 *          the beginAtd to set
+	 * @see #beginAtd
+	 */
+	public void setBeginAtd(ArrowTypeData beginAtd) {
+		this.beginAtd = beginAtd;
+	}
+
+	/**
+	 * @return the endAtd
+	 * @see #endAtd
+	 */
+	public ArrowTypeData getEndAtd() {
+		return endAtd;
+	}
+
+	/**
+	 * @param endAtd
+	 *          the endAtd to set
+	 * @see #endAtd
+	 */
+	public void setEndAtd(ArrowTypeData endAtd) {
+		this.endAtd = endAtd;
+	}
+
+	/**
+	 * @return the width
+	 * @see #width
+	 */
+	public double getWidth() {
+		return width;
+	}
+
+	/**
+	 * @param width
+	 *          the width to set
+	 * @see #width
+	 */
+	public void setWidth(double width) {
+		this.width = width;
+	}
+
+	/**
+	 * @return the color
+	 * @see #color
+	 */
+	public Color getColor() {
+		return color;
+	}
+
+	/**
+	 * @param color
+	 *          the color to set
+	 * @see #color
+	 */
+	public void setColor(Color color) {
+		this.color = color;
+	}
+
+	/**
+	 * @return the type
+	 * @see #type
+	 */
+	public LineType getType() {
+		return type;
+	}
+
+	/**
+	 * @param type
+	 *          the type to set
+	 * @see #type
+	 */
+	public void setType(LineType type) {
+		this.type = type;
+	}
+
+	/**
+	 * @return the id
+	 * @see #id
+	 */
+	public int getId() {
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *          the id to set
+	 * @see #id
+	 */
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	/**
+	 * @param string
+	 *          the width to set
+	 * @see #width
+	 */
+	public void setWidth(String string) {
+		setWidth(Double.parseDouble(string));
+	}
+
+	/**
+	 * Prepares a copy of the object.
+	 * 
+	 * @return copy of {@link PolylineData}
+	 */
+	public PolylineData copy() {
+		if (this.getClass().equals(PolylineData.class)) {
+			return new PolylineData(this);
+		} else {
+			throw new NotImplementedException("Copy method for " + this.getClass() + " class not implemented.");
+		}
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("[" + this.getClass().getSimpleName() + "]: ");
+		for (Point2D point : points) {
+			sb.append(point.getX() + ", " + point.getY() + " ");
+		}
+		return sb.toString();
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/graphics/PolylineDataComparator.java b/model/src/main/java/lcsb/mapviewer/model/graphics/PolylineDataComparator.java
index 624f4508b1..2be249dcdc 100644
--- a/model/src/main/java/lcsb/mapviewer/model/graphics/PolylineDataComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/graphics/PolylineDataComparator.java
@@ -1,131 +1,131 @@
-package lcsb.mapviewer.model.graphics;
-
-import java.util.Comparator;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.DoubleComparator;
-import lcsb.mapviewer.common.comparator.IntegerComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * This class implements comparator interface for {@link PolylineData}. It
- * compares the content, but skip database identifier.
- * 
- * @author Piotr Gawron
- * 
- */
-public class PolylineDataComparator implements Comparator<PolylineData> {
-	/**
-	 * Default class logger.
-	 */
-	private Logger logger	= Logger.getLogger(PolylineDataComparator.class);
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public PolylineDataComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public PolylineDataComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(PolylineData arg0, PolylineData arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(PolylineData.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in
-	 * {@link PolylineData} class in inheritence tree.
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(PolylineData arg0, PolylineData arg1) {
-		IntegerComparator integerComparator = new IntegerComparator();
-		DoubleComparator doubleComparator = new DoubleComparator(epsilon);
-		ArrowTypeDataComparator atdComparator = new ArrowTypeDataComparator(epsilon);
-
-		if (integerComparator.compare(arg0.getPoints().size(), arg1.getPoints().size()) != 0) {
-			logger.debug("Lines have different size: " + arg0.getPoints().size() + ", " + arg1.getPoints().size());
-			return integerComparator.compare(arg0.getPoints().size(), arg1.getPoints().size());
-		}
-		// TODO this should be fixed
-		// for (int i = 0; i < arg0.getPoints().size(); i++) {
-		// if
-		// (doubleComparator.compare(arg0.getPoints().get(i).distanceSq(arg1.getPoints().get(i)),
-		// 0.0) != 0) {
-		// logger.debug("Lines have different points: " + arg0.getPoints().get(i) +
-		// ", " + arg1.getPoints().get(i));
-		// return
-		// doubleComparator.compare(arg0.getPoints().get(i).distanceSq(arg1.getPoints().get(i)),
-		// 0.0);
-		// }
-		// }
-
-		if (atdComparator.compare(arg0.getBeginAtd(), arg1.getBeginAtd()) != 0) {
-			logger.debug("Lines have different begin adt: " + arg0.getBeginAtd() + ", " + arg1.getBeginAtd());
-			return atdComparator.compare(arg0.getBeginAtd(), arg1.getBeginAtd());
-		}
-
-		if (atdComparator.compare(arg0.getEndAtd(), arg1.getEndAtd()) != 0) {
-			logger.debug("Lines have different end adt: " + arg0.getEndAtd() + ", " + arg1.getEndAtd());
-			return atdComparator.compare(arg0.getEndAtd(), arg1.getEndAtd());
-		}
-
-		if (doubleComparator.compare(arg0.getWidth(), arg1.getWidth()) != 0) {
-			logger.debug("Lines have different width: " + arg0.getWidth() + ", " + arg1.getWidth());
-			return doubleComparator.compare(arg0.getWidth(), arg1.getWidth());
-		}
-
-		if (integerComparator.compare(arg0.getColor().getRGB(), arg1.getColor().getRGB()) != 0) {
-			logger.debug("Lines have different color: " + arg0.getColor() + ", " + arg1.getColor());
-			return integerComparator.compare(arg0.getColor().getRGB(), arg1.getColor().getRGB());
-		}
-
-		if (arg0.getType().compareTo(arg1.getType()) != 0) {
-			logger.debug("Lines have different type: " + arg0.getType() + ", " + arg1.getType());
-			return arg0.getType().compareTo(arg1.getType());
-		}
-
-		return 0;
-	}
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.DoubleComparator;
+import lcsb.mapviewer.common.comparator.IntegerComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * This class implements comparator interface for {@link PolylineData}. It
+ * compares the content, but skip database identifier.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class PolylineDataComparator implements Comparator<PolylineData> {
+	/**
+	 * Default class logger.
+	 */
+	private Logger logger	= Logger.getLogger(PolylineDataComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public PolylineDataComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public PolylineDataComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(PolylineData arg0, PolylineData arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(PolylineData.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in
+	 * {@link PolylineData} class in inheritence tree.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(PolylineData arg0, PolylineData arg1) {
+		IntegerComparator integerComparator = new IntegerComparator();
+		DoubleComparator doubleComparator = new DoubleComparator(epsilon);
+		ArrowTypeDataComparator atdComparator = new ArrowTypeDataComparator(epsilon);
+
+		if (integerComparator.compare(arg0.getPoints().size(), arg1.getPoints().size()) != 0) {
+			logger.debug("Lines have different size: " + arg0.getPoints().size() + ", " + arg1.getPoints().size());
+			return integerComparator.compare(arg0.getPoints().size(), arg1.getPoints().size());
+		}
+		// TODO this should be fixed
+		// for (int i = 0; i < arg0.getPoints().size(); i++) {
+		// if
+		// (doubleComparator.compare(arg0.getPoints().get(i).distanceSq(arg1.getPoints().get(i)),
+		// 0.0) != 0) {
+		// logger.debug("Lines have different points: " + arg0.getPoints().get(i) +
+		// ", " + arg1.getPoints().get(i));
+		// return
+		// doubleComparator.compare(arg0.getPoints().get(i).distanceSq(arg1.getPoints().get(i)),
+		// 0.0);
+		// }
+		// }
+
+		if (atdComparator.compare(arg0.getBeginAtd(), arg1.getBeginAtd()) != 0) {
+			logger.debug("Lines have different begin adt: " + arg0.getBeginAtd() + ", " + arg1.getBeginAtd());
+			return atdComparator.compare(arg0.getBeginAtd(), arg1.getBeginAtd());
+		}
+
+		if (atdComparator.compare(arg0.getEndAtd(), arg1.getEndAtd()) != 0) {
+			logger.debug("Lines have different end adt: " + arg0.getEndAtd() + ", " + arg1.getEndAtd());
+			return atdComparator.compare(arg0.getEndAtd(), arg1.getEndAtd());
+		}
+
+		if (doubleComparator.compare(arg0.getWidth(), arg1.getWidth()) != 0) {
+			logger.debug("Lines have different width: " + arg0.getWidth() + ", " + arg1.getWidth());
+			return doubleComparator.compare(arg0.getWidth(), arg1.getWidth());
+		}
+
+		if (integerComparator.compare(arg0.getColor().getRGB(), arg1.getColor().getRGB()) != 0) {
+			logger.debug("Lines have different color: " + arg0.getColor() + ", " + arg1.getColor());
+			return integerComparator.compare(arg0.getColor().getRGB(), arg1.getColor().getRGB());
+		}
+
+		if (arg0.getType().compareTo(arg1.getType()) != 0) {
+			logger.debug("Lines have different type: " + arg0.getType() + ", " + arg1.getType());
+			return arg0.getType().compareTo(arg1.getType());
+		}
+
+		return 0;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/log/LogType.java b/model/src/main/java/lcsb/mapviewer/model/log/LogType.java
index 3521cc7678..3fbcfceb0a 100644
--- a/model/src/main/java/lcsb/mapviewer/model/log/LogType.java
+++ b/model/src/main/java/lcsb/mapviewer/model/log/LogType.java
@@ -1,60 +1,60 @@
-package lcsb.mapviewer.model.log;
-
-/**
- * Types of log events.
- * 
- * @author Piotr Gawron
- * 
- */
-public enum LogType {
-	/**
-	 * New data mining object was added to the map.
-	 */
-	ADD_MISSING_CONNECTION,
-
-	/**
-	 * Data mining object was removed from the map.
-	 */
-	REMOVE_MISSING_CONNECTION,
-
-	/**
-	 * User logged in.
-	 */
-	USER_LOGIN,
-
-	/**
-	 * User logged out.
-	 */
-	USER_LOGOUT,
-
-	/**
-	 * User was created.
-	 */
-	USER_CREATED,
-
-	/**
-	 * User was removed.
-	 */
-	USER_REMOVED,
-
-	/**
-	 * Map was created.
-	 */
-	MAP_CREATED,
-
-	/**
-	 * Map was removed.
-	 */
-	MAP_REMOVED,
-
-	/**
-	 * Custom layout was added.
-	 */
-	LAYOUT_CREATED,
-
-	/**
-	 * Custom layout was removed.
-	 */
-	LAYOUT_REMOVED
-
-}
+package lcsb.mapviewer.model.log;
+
+/**
+ * Types of log events.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public enum LogType {
+	/**
+	 * New data mining object was added to the map.
+	 */
+	ADD_MISSING_CONNECTION,
+
+	/**
+	 * Data mining object was removed from the map.
+	 */
+	REMOVE_MISSING_CONNECTION,
+
+	/**
+	 * User logged in.
+	 */
+	USER_LOGIN,
+
+	/**
+	 * User logged out.
+	 */
+	USER_LOGOUT,
+
+	/**
+	 * User was created.
+	 */
+	USER_CREATED,
+
+	/**
+	 * User was removed.
+	 */
+	USER_REMOVED,
+
+	/**
+	 * Map was created.
+	 */
+	MAP_CREATED,
+
+	/**
+	 * Map was removed.
+	 */
+	MAP_REMOVED,
+
+	/**
+	 * Custom layout was added.
+	 */
+	LAYOUT_CREATED,
+
+	/**
+	 * Custom layout was removed.
+	 */
+	LAYOUT_REMOVED
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/AnnotatedObject.java b/model/src/main/java/lcsb/mapviewer/model/map/AnnotatedObject.java
index 2a7529541b..b5379cde34 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/AnnotatedObject.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/AnnotatedObject.java
@@ -1,142 +1,142 @@
-package lcsb.mapviewer.model.map;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Interface that describes object that can be annotated.
- * 
- * @author Piotr Gawron
- * 
- */
-public interface AnnotatedObject extends Serializable {
-	/**
-	 * Returns list of {@link MiriamData annotations} for the object.
-	 * 
-	 * @return list of {@link MiriamData annotations} for the object
-	 */
-	Collection<MiriamData> getMiriamData();
-
-	/**
-	 * Adds miriam annotations to the element.
-	 * 
-	 * @param miriamData
-	 *          set of miriam annotations to be added
-	 */
-	void addMiriamData(Collection<MiriamData> miriamData);
-
-	/**
-	 * Adds miriam annotation to the element.
-	 * 
-	 * @param md
-	 *          miriam annotation to be added
-	 */
-	void addMiriamData(MiriamData md);
-
-	/**
-	 * Returns the name of the object.
-	 * 
-	 * @return the name of the object
-	 */
-	String getName();
-
-	/**
-	 * Returns notes about the object.
-	 * 
-	 * @return notes about the object
-	 */
-	String getNotes();
-
-	/**
-	 * Returns string identifier (unique within the map) of the element.
-	 * 
-	 * @return string identifier of the element
-	 */
-	String getElementId();
-
-	/**
-	 * Sets string identifier (unique within the map) to the element.
-	 * 
-	 * @param id
-	 *          string identifier
-	 */
-	void setElementId(String id);
-
-	/**
-	 * Sets notes about the object.
-	 * 
-	 * @param notes
-	 *          new notes
-	 */
-	void setNotes(String notes);
-
-	/**
-	 * Returns the symbol of the element.
-	 * 
-	 * @return the symbol of the element
-	 */
-	String getSymbol();
-
-	/**
-	 * Sets symbol of the element.
-	 * 
-	 * @param symbol
-	 *          new symbol
-	 */
-	void setSymbol(String symbol);
-
-	/**
-	 * Get list of synonyms.
-	 * 
-	 * @return list of synonyms
-	 */
-	List<String> getSynonyms();
-
-	/**
-	 * Sets list of synonyms to the element.
-	 * 
-	 * @param synonyms
-	 *          new list
-	 */
-	void setSynonyms(List<String> synonyms);
-
-	/**
-	 * Returns the abbreviation.
-	 * 
-	 * @return the abbreviation
-	 */
-	String getAbbreviation();
-
-	/**
-	 * Sets abbreviation.
-	 * 
-	 * @param abbreviation
-	 *          new abbreviation
-	 */
-	void setAbbreviation(String abbreviation);
-
-	/**
-	 * Sets formula.
-	 * 
-	 * @param formula
-	 *          new formula
-	 */
-	void setFormula(String formula);
-
-	/**
-	 * Returns the formula.
-	 * 
-	 * @return the formula
-	 */
-	String getFormula();
-
-	/**
-	 * Sets the name to the object.
-	 * 
-	 * @param name
-	 *          name of the object
-	 * 
-	 */
-	void setName(String name);
-}
+package lcsb.mapviewer.model.map;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Interface that describes object that can be annotated.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public interface AnnotatedObject extends Serializable {
+	/**
+	 * Returns list of {@link MiriamData annotations} for the object.
+	 * 
+	 * @return list of {@link MiriamData annotations} for the object
+	 */
+	Collection<MiriamData> getMiriamData();
+
+	/**
+	 * Adds miriam annotations to the element.
+	 * 
+	 * @param miriamData
+	 *          set of miriam annotations to be added
+	 */
+	void addMiriamData(Collection<MiriamData> miriamData);
+
+	/**
+	 * Adds miriam annotation to the element.
+	 * 
+	 * @param md
+	 *          miriam annotation to be added
+	 */
+	void addMiriamData(MiriamData md);
+
+	/**
+	 * Returns the name of the object.
+	 * 
+	 * @return the name of the object
+	 */
+	String getName();
+
+	/**
+	 * Returns notes about the object.
+	 * 
+	 * @return notes about the object
+	 */
+	String getNotes();
+
+	/**
+	 * Returns string identifier (unique within the map) of the element.
+	 * 
+	 * @return string identifier of the element
+	 */
+	String getElementId();
+
+	/**
+	 * Sets string identifier (unique within the map) to the element.
+	 * 
+	 * @param id
+	 *          string identifier
+	 */
+	void setElementId(String id);
+
+	/**
+	 * Sets notes about the object.
+	 * 
+	 * @param notes
+	 *          new notes
+	 */
+	void setNotes(String notes);
+
+	/**
+	 * Returns the symbol of the element.
+	 * 
+	 * @return the symbol of the element
+	 */
+	String getSymbol();
+
+	/**
+	 * Sets symbol of the element.
+	 * 
+	 * @param symbol
+	 *          new symbol
+	 */
+	void setSymbol(String symbol);
+
+	/**
+	 * Get list of synonyms.
+	 * 
+	 * @return list of synonyms
+	 */
+	List<String> getSynonyms();
+
+	/**
+	 * Sets list of synonyms to the element.
+	 * 
+	 * @param synonyms
+	 *          new list
+	 */
+	void setSynonyms(List<String> synonyms);
+
+	/**
+	 * Returns the abbreviation.
+	 * 
+	 * @return the abbreviation
+	 */
+	String getAbbreviation();
+
+	/**
+	 * Sets abbreviation.
+	 * 
+	 * @param abbreviation
+	 *          new abbreviation
+	 */
+	void setAbbreviation(String abbreviation);
+
+	/**
+	 * Sets formula.
+	 * 
+	 * @param formula
+	 *          new formula
+	 */
+	void setFormula(String formula);
+
+	/**
+	 * Returns the formula.
+	 * 
+	 * @return the formula
+	 */
+	String getFormula();
+
+	/**
+	 * Sets the name to the object.
+	 * 
+	 * @param name
+	 *          name of the object
+	 * 
+	 */
+	void setName(String name);
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/ElementComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/ElementComparator.java
index 08f4368bcf..9d484a8ab8 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/ElementComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/ElementComparator.java
@@ -1,184 +1,184 @@
-package lcsb.mapviewer.model.map;
-
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Set;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.StringComparator;
-import lcsb.mapviewer.common.comparator.StringListComparator;
-import lcsb.mapviewer.common.comparator.StringSetComparator;
-import lcsb.mapviewer.common.exception.InvalidClassException;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.agregator.CompartmentComparator;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.SpeciesComparator;
-
-import org.apache.log4j.Logger;
-
-/**
- * This class implements comparator interface for Element. It handles comparison
- * of subclasses of Element class.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ElementComparator implements Comparator<Element> {
-	/**
-	 * Default class logger.
-	 */
-	private static Logger	logger	= Logger.getLogger(ElementComparator.class);
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double				epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public ElementComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public ElementComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	/**
-	 * This method compares only the fields that are defined in Element class in
-	 * inheritence tree. It should be called by the super class comparators, like
-	 * Species and Compartment.
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	public int internalCompare(Element arg0, Element arg1) {
-		StringComparator stringComparator = new StringComparator();
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (stringComparator.compare(arg0.getName(), arg1.getName()) != 0) {
-			logger.debug("Name different: " + arg0.getName() + ", " + arg1.getName());
-			return stringComparator.compare(arg0.getName(), arg1.getName());
-		}
-
-		if (stringComparator.compare(arg0.getNotes(), arg1.getNotes(), true) != 0) {
-			logger.debug("notes different: \n\"" + arg0.getNotes() + "\"\n\"" + arg1.getNotes() + "\"");
-			return stringComparator.compare(arg0.getNotes(), arg1.getNotes());
-		}
-
-		if (stringComparator.compare(arg0.getSymbol(), arg1.getSymbol()) != 0) {
-			logger.debug("symbol different: \"" + arg0.getSymbol() + "\", \"" + arg1.getSymbol() + "\"");
-			return stringComparator.compare(arg0.getSymbol(), arg1.getSymbol());
-		}
-
-		if (stringComparator.compare(arg0.getFullName(), arg1.getFullName()) != 0) {
-			logger.debug("full name different: \"" + arg0.getFullName() + "\", \"" + arg1.getFullName() + "\"");
-			return stringComparator.compare(arg0.getFullName(), arg1.getFullName());
-		}
-		
-		if (stringComparator.compare(arg0.getAbbreviation(), arg1.getAbbreviation()) != 0) {
-			logger.debug("Abbreviation different: \"" + arg0.getAbbreviation() + "\", \"" + arg1.getAbbreviation() + "\"");
-			return stringComparator.compare(arg0.getAbbreviation(), arg1.getAbbreviation());
-		}
-		
-		if (stringComparator.compare(arg0.getFormula(), arg1.getFormula()) != 0) {
-			logger.debug("formula different: \"" + arg0.getFormula() + "\", \"" + arg1.getFormula() + "\"");
-			return stringComparator.compare(arg0.getFormula(), arg1.getFormula());
-		}
-
-		StringSetComparator stringSetComparator = new StringSetComparator();
-		StringListComparator stringListComparator = new StringListComparator();
-
-		if (stringListComparator.compare(arg0.getSynonyms(), arg1.getSynonyms()) != 0) {
-			logger.debug("List of synonyms different");
-			return stringListComparator.compare(arg0.getSynonyms(), arg1.getSynonyms());
-		}
-
-		if (stringListComparator.compare(arg0.getFormerSymbols(), arg1.getFormerSymbols()) != 0) {
-			logger.debug("List of former symbols different");
-			return stringListComparator.compare(arg0.getFormerSymbols(), arg1.getFormerSymbols());
-		}
-
-		Set<String> hashCode1 = new HashSet<String>();
-		Set<String> hashCode2 = new HashSet<String>();
-
-		if (arg0.getMiriamData().size() != arg1.getMiriamData().size()) {
-			logger.debug("different number of annotations: " + arg0.getMiriamData().size() + ", " + arg1.getMiriamData().size());
-			return ((Integer) arg0.getMiriamData().size()).compareTo(arg1.getMiriamData().size());
-		}
-
-		for (MiriamData md : arg0.getMiriamData()) {
-			String hash = md.getRelationType() + "  " + md.getDataType() + "  " + md.getResource();
-			hashCode1.add(hash);
-		}
-
-		for (MiriamData md : arg1.getMiriamData()) {
-			String hash = md.getRelationType() + "  " + md.getDataType() + "  " + md.getResource();
-			hashCode2.add(hash);
-		}
-
-		if (stringSetComparator.compare(hashCode1, hashCode2) != 0) {
-			logger.debug("different annotations: ");
-			logger.debug("A:");
-			for (String string : hashCode1) {
-				logger.debug("|" + string + "|");
-			}
-			logger.debug("B:");
-			for (String string : hashCode2) {
-				logger.debug("|" + string + "|");
-			}
-			logger.debug("--");
-			return stringSetComparator.compare(hashCode1, hashCode2);
-
-		}
-
-		return 0;
-	}
-
-	@Override
-	public int compare(Element arg0, Element arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0 instanceof Species) {
-				SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-				return speciesComparator.compare((Species) arg0, (Species) arg1);
-			} else if (arg0 instanceof Compartment) {
-				CompartmentComparator compartmentComparator = new CompartmentComparator(epsilon);
-				return compartmentComparator.compare((Compartment) arg0, (Compartment) arg1);
-			} else {
-				throw new InvalidClassException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Set;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.StringComparator;
+import lcsb.mapviewer.common.comparator.StringListComparator;
+import lcsb.mapviewer.common.comparator.StringSetComparator;
+import lcsb.mapviewer.common.exception.InvalidClassException;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.agregator.CompartmentComparator;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.SpeciesComparator;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class implements comparator interface for Element. It handles comparison
+ * of subclasses of Element class.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ElementComparator implements Comparator<Element> {
+	/**
+	 * Default class logger.
+	 */
+	private static Logger	logger	= Logger.getLogger(ElementComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public ElementComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public ElementComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	/**
+	 * This method compares only the fields that are defined in Element class in
+	 * inheritence tree. It should be called by the super class comparators, like
+	 * Species and Compartment.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	public int internalCompare(Element arg0, Element arg1) {
+		StringComparator stringComparator = new StringComparator();
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (stringComparator.compare(arg0.getName(), arg1.getName()) != 0) {
+			logger.debug("Name different: " + arg0.getName() + ", " + arg1.getName());
+			return stringComparator.compare(arg0.getName(), arg1.getName());
+		}
+
+		if (stringComparator.compare(arg0.getNotes(), arg1.getNotes(), true) != 0) {
+			logger.debug("notes different: \n\"" + arg0.getNotes() + "\"\n\"" + arg1.getNotes() + "\"");
+			return stringComparator.compare(arg0.getNotes(), arg1.getNotes());
+		}
+
+		if (stringComparator.compare(arg0.getSymbol(), arg1.getSymbol()) != 0) {
+			logger.debug("symbol different: \"" + arg0.getSymbol() + "\", \"" + arg1.getSymbol() + "\"");
+			return stringComparator.compare(arg0.getSymbol(), arg1.getSymbol());
+		}
+
+		if (stringComparator.compare(arg0.getFullName(), arg1.getFullName()) != 0) {
+			logger.debug("full name different: \"" + arg0.getFullName() + "\", \"" + arg1.getFullName() + "\"");
+			return stringComparator.compare(arg0.getFullName(), arg1.getFullName());
+		}
+		
+		if (stringComparator.compare(arg0.getAbbreviation(), arg1.getAbbreviation()) != 0) {
+			logger.debug("Abbreviation different: \"" + arg0.getAbbreviation() + "\", \"" + arg1.getAbbreviation() + "\"");
+			return stringComparator.compare(arg0.getAbbreviation(), arg1.getAbbreviation());
+		}
+		
+		if (stringComparator.compare(arg0.getFormula(), arg1.getFormula()) != 0) {
+			logger.debug("formula different: \"" + arg0.getFormula() + "\", \"" + arg1.getFormula() + "\"");
+			return stringComparator.compare(arg0.getFormula(), arg1.getFormula());
+		}
+
+		StringSetComparator stringSetComparator = new StringSetComparator();
+		StringListComparator stringListComparator = new StringListComparator();
+
+		if (stringListComparator.compare(arg0.getSynonyms(), arg1.getSynonyms()) != 0) {
+			logger.debug("List of synonyms different");
+			return stringListComparator.compare(arg0.getSynonyms(), arg1.getSynonyms());
+		}
+
+		if (stringListComparator.compare(arg0.getFormerSymbols(), arg1.getFormerSymbols()) != 0) {
+			logger.debug("List of former symbols different");
+			return stringListComparator.compare(arg0.getFormerSymbols(), arg1.getFormerSymbols());
+		}
+
+		Set<String> hashCode1 = new HashSet<String>();
+		Set<String> hashCode2 = new HashSet<String>();
+
+		if (arg0.getMiriamData().size() != arg1.getMiriamData().size()) {
+			logger.debug("different number of annotations: " + arg0.getMiriamData().size() + ", " + arg1.getMiriamData().size());
+			return ((Integer) arg0.getMiriamData().size()).compareTo(arg1.getMiriamData().size());
+		}
+
+		for (MiriamData md : arg0.getMiriamData()) {
+			String hash = md.getRelationType() + "  " + md.getDataType() + "  " + md.getResource();
+			hashCode1.add(hash);
+		}
+
+		for (MiriamData md : arg1.getMiriamData()) {
+			String hash = md.getRelationType() + "  " + md.getDataType() + "  " + md.getResource();
+			hashCode2.add(hash);
+		}
+
+		if (stringSetComparator.compare(hashCode1, hashCode2) != 0) {
+			logger.debug("different annotations: ");
+			logger.debug("A:");
+			for (String string : hashCode1) {
+				logger.debug("|" + string + "|");
+			}
+			logger.debug("B:");
+			for (String string : hashCode2) {
+				logger.debug("|" + string + "|");
+			}
+			logger.debug("--");
+			return stringSetComparator.compare(hashCode1, hashCode2);
+
+		}
+
+		return 0;
+	}
+
+	@Override
+	public int compare(Element arg0, Element arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0 instanceof Species) {
+				SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+				return speciesComparator.compare((Species) arg0, (Species) arg1);
+			} else if (arg0 instanceof Compartment) {
+				CompartmentComparator compartmentComparator = new CompartmentComparator(epsilon);
+				return compartmentComparator.compare((Compartment) arg0, (Compartment) arg1);
+			} else {
+				throw new InvalidClassException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/MiriamRelationType.java b/model/src/main/java/lcsb/mapviewer/model/map/MiriamRelationType.java
index 0ee468edb9..5f400b9cc9 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/MiriamRelationType.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/MiriamRelationType.java
@@ -1,112 +1,112 @@
-package lcsb.mapviewer.model.map;
-
-/**
- * Encodes list of biomodel qualifiers used for description in miriam
- * references. More information can be found <a
- * href="http://co.mbine.org/standards/qualifiers">here</a>.
- * 
- * @author Piotr Gawron
- * 
- */
-public enum MiriamRelationType {
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_MODEL_IS("bqmodel:is"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_MODEL_IS_DESCRIBED_BY("bqmodel:isDescribedBy"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_IS("bqbiol:is"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_HAS_PART("bqbiol:hasPart"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_IS_PART_OF("bqbiol:isPartOf"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_IS_VERSION_OF("bqbiol:isVersionOf"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_HAS_VERSION("bqbiol:hasVersion"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_IS_HOMOLOG_TO("bqbiol:isHomologTo"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_IS_DESCRIBED_BY("bqbiol:isDescribedBy"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_IS_ENCODED_BY("bqbiol:isEncodedBy"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_ENCODES("bqbiol:encodes"),
-	
-	/**
-	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	BQ_BIOL_OCCURES("bqbiol:occures");
-	
-	/**
-	 * String representing relation. List of all possibilites can be found <a
-	 * href="http://co.mbine.org/standards/qualifiers">here</a>.
-	 */
-	private String	stringRepresentation;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param stringRepresentation
-	 *          {@link #stringRepresentation}
-	 */
-	MiriamRelationType(String stringRepresentation) {
-		this.stringRepresentation = stringRepresentation;
-	}
-
-	/**
-	 * @return the stringRepresentation
-	 * @see #stringRepresentation
-	 */
-	public String getStringRepresentation() {
-		return stringRepresentation;
-	}
-
-	/**
-	 * Returns {@link MiriamRelationType} associated with #stringRepresentation.
-	 * 
-	 * @param string
-	 *          #stringRepresentation
-	 * @return {@link MiriamRelationType} for given #stringRepresentation
-	 */
-	public static MiriamRelationType getTypeByStringRepresentation(String string) {
-		for (MiriamRelationType mrt : MiriamRelationType.values()) {
-			if (mrt.getStringRepresentation().equalsIgnoreCase(string)) {
-				return mrt;
-			}
-		}
-		return null;
-	}
-}
+package lcsb.mapviewer.model.map;
+
+/**
+ * Encodes list of biomodel qualifiers used for description in miriam
+ * references. More information can be found <a
+ * href="http://co.mbine.org/standards/qualifiers">here</a>.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public enum MiriamRelationType {
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_MODEL_IS("bqmodel:is"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_MODEL_IS_DESCRIBED_BY("bqmodel:isDescribedBy"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_IS("bqbiol:is"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_HAS_PART("bqbiol:hasPart"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_IS_PART_OF("bqbiol:isPartOf"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_IS_VERSION_OF("bqbiol:isVersionOf"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_HAS_VERSION("bqbiol:hasVersion"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_IS_HOMOLOG_TO("bqbiol:isHomologTo"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_IS_DESCRIBED_BY("bqbiol:isDescribedBy"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_IS_ENCODED_BY("bqbiol:isEncodedBy"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_ENCODES("bqbiol:encodes"),
+	
+	/**
+	 * Take a look <a href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	BQ_BIOL_OCCURES("bqbiol:occures");
+	
+	/**
+	 * String representing relation. List of all possibilites can be found <a
+	 * href="http://co.mbine.org/standards/qualifiers">here</a>.
+	 */
+	private String	stringRepresentation;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param stringRepresentation
+	 *          {@link #stringRepresentation}
+	 */
+	MiriamRelationType(String stringRepresentation) {
+		this.stringRepresentation = stringRepresentation;
+	}
+
+	/**
+	 * @return the stringRepresentation
+	 * @see #stringRepresentation
+	 */
+	public String getStringRepresentation() {
+		return stringRepresentation;
+	}
+
+	/**
+	 * Returns {@link MiriamRelationType} associated with #stringRepresentation.
+	 * 
+	 * @param string
+	 *          #stringRepresentation
+	 * @return {@link MiriamRelationType} for given #stringRepresentation
+	 */
+	public static MiriamRelationType getTypeByStringRepresentation(String string) {
+		for (MiriamRelationType mrt : MiriamRelationType.values()) {
+			if (mrt.getStringRepresentation().equalsIgnoreCase(string)) {
+				return mrt;
+			}
+		}
+		return null;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/MiriamType.java b/model/src/main/java/lcsb/mapviewer/model/map/MiriamType.java
index 5c0add9319..4827677972 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/MiriamType.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/MiriamType.java
@@ -1,654 +1,654 @@
-package lcsb.mapviewer.model.map;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.Chemical;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Drug;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.Phenotype;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-
-/**
- * Type of known miriam annotation.
- * 
- * @author Piotr Gawron
- * 
- */
-public enum MiriamType {
-	/**
-	 * Chemical Abstracts Service database: http://commonchemistry.org.
-	 */
-	CAS("Chemical Abstracts Service", //
-			"http://commonchemistry.org", //
-			new String[] { "urn:miriam:cas" }, //
-			new Class<?>[] {}, "MIR:00000237"), //
-
-	/**
-	 * Consensus CDS: http://identifiers.org/ccds/.
-	 */
-	CCDS("Consensus CDS", //
-			"http://www.ncbi.nlm.nih.gov/CCDS/", //
-			new String[] { "urn:miriam:ccds" }, //
-			new Class<?>[] {}, "MIR:00000375"), //
-
-	/**
-	 * Chebi database:
-	 * <a href = "http://www.ebi.ac.uk/chebi/">http://www.ebi.ac.uk/chebi/</a>.
-	 */
-	CHEBI("Chebi", //
-			"http://www.ebi.ac.uk/chebi/", //
-			new String[] { "urn:miriam:obo.chebi", "urn:miriam:chebi" }, //
-			new Class<?>[] { Chemical.class, Drug.class, }, "MIR:00000002", //
-			new Class<?>[] { Chemical.class }), //
-
-	/**
-	 * ChemSpider database:
-	 * <a href = "http://www.chemspider.com/">http://www.chemspider.com/</a>.
-	 */
-	CHEMSPIDER("ChemSpider", //
-			"http://www.chemspider.com//", //
-			new String[] { "urn:miriam:chemspider" }, //
-			new Class<?>[] {}, "MIR:00000138"), //
-
-	/**
-	 * Chembl database: https://www.ebi.ac.uk/chembldb/.
-	 */
-	CHEMBL_COMPOUND("ChEMBL", //
-			"https://www.ebi.ac.uk/chembldb/", //
-			new String[] { "urn:miriam:chembl.compound" }, //
-			new Class<?>[] { Drug.class }, "MIR:00000084"), //
-
-	/**
-	 * Target in chembl database: https://www.ebi.ac.uk/chembldb/.
-	 */
-	CHEMBL_TARGET("ChEMBL target", //
-			"https://www.ebi.ac.uk/chembldb/", //
-			new String[] { "urn:miriam:chembl.target" }, //
-			new Class<?>[] { Protein.class, ComplexSpecies.class }, "MIR:00000085"), //
-
-	/**
-	 * Drugbank database: http://www.drugbank.ca/.
-	 */
-	DRUGBANK("DrugBank", //
-			"http://www.drugbank.ca/", //
-			new String[] { "urn:miriam:drugbank" }, //
-			new Class<?>[] { Drug.class }, "MIR:00000102"), //
-	/**
-	 * Drugbank tagrets: http://www.drugbank.ca/targets.
-	 */
-	DRUGBANK_TARGET_V4("DrugBank Target v4", //
-			"http://www.drugbank.ca/targets", //
-			new String[] { "urn:miriam:drugbankv4.target" }, //
-			new Class<?>[] {}, "MIR:00000528"), //
-
-	/**
-	 * Enzyme Nomenclature: http://www.enzyme-database.org/.
-	 */
-	EC("Enzyme Nomenclature", //
-			"http://www.enzyme-database.org/", //
-			new String[] { "urn:miriam:ec-code" }, //
-			new Class<?>[] { Protein.class, ComplexSpecies.class }, "MIR:00000004"), //
-
-	/**
-	 * Ensembl: www.ensembl.org.
-	 */
-	ENSEMBL("Ensembl", //
-			"www.ensembl.org", //
-			new String[] { "urn:miriam:ensembl" }, //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000003"), //
-
-	/**
-	 * Ensembl Plants: http://plants.ensembl.org/.
-	 */
-	ENSEMBL_PLANTS("Ensembl Plants", //
-			"http://plants.ensembl.org/", //
-			new String[] { "urn:miriam:ensembl.plant" }, //
-			new Class<?>[] {}, "MIR:00000205"), //
-
-	/**
-	 * Entrez Gene: http://www.ncbi.nlm.nih.gov/gene.
-	 */
-	ENTREZ("Entrez Gene", //
-			"http://www.ncbi.nlm.nih.gov/gene", //
-			new String[] { "urn:miriam:ncbigene", "urn:miriam:entrez.gene" }, //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000069"), //
-
-	/**
-	 * Gene Ontology: http://amigo.geneontology.org/amigo.
-	 */
-	GO("Gene Ontology", //
-			"http://amigo.geneontology.org/amigo", //
-			new String[] { "urn:miriam:obo.go", "urn:miriam:go" }, //
-			new Class<?>[] { Phenotype.class, Compartment.class, ComplexSpecies.class }, "MIR:00000022"), //
-
-	/**
-	 * HGNC: http://www.genenames.org.
-	 */
-	HGNC("HGNC", //
-			"http://www.genenames.org", //
-			new String[] { "urn:miriam:hgnc" }, //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000080", //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }), //
-
-	/**
-	 * HGNC symbol: http://www.genenames.org.
-	 */
-	HGNC_SYMBOL("HGNC Symbol", //
-			"http://www.genenames.org", //
-			new String[] { "urn:miriam:hgnc.symbol" }, //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000362", //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }), //
-
-	/**
-	 * HMDB: http://www.hmdb.ca/.
-	 */
-	HMDB("HMDB", //
-			"http://www.hmdb.ca/", //
-			"urn:miriam:hmdb", //
-			new Class<?>[] { Chemical.class, Drug.class, }, "MIR:00000051"), //
-
-	/**
-	 * InterPro: http://www.ebi.ac.uk/interpro/.
-	 */
-	INTERPRO("InterPro", //
-			"http://www.ebi.ac.uk/interpro/", //
-			new String[] { "urn:miriam:interpro" }, //
-			new Class<?>[] { Protein.class, ComplexSpecies.class }, "MIR:00000011"), //
-
-	/**
-	 * KEGG Compound: http://www.genome.jp/kegg/ligand.html.
-	 */
-	KEGG_COMPOUND("Kegg Compound", //
-			"http://www.genome.jp/kegg/ligand.html", //
-			"urn:miriam:kegg.compound", //
-			new Class<?>[] { Chemical.class }, "MIR:00000013"), //
-
-	/**
-	 * KEGG Genes: http://www.genome.jp/kegg/genes.html.
-	 */
-	KEGG_GENES("Kegg Genes", //
-			"http://www.genome.jp/kegg/genes.html", //
-			new String[] { "urn:miriam:kegg.genes", "urn:miriam:kegg.genes:hsa" }, //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000070"), //
-
-	/**
-	 * KEGG Orthology: http://www.genome.jp/kegg/ko.html.
-	 */
-	KEGG_ORTHOLOGY("KEGG Orthology", //
-			"http://www.genome.jp/kegg/ko.html", //
-			new String[] { "urn:miriam:kegg.orthology" }, //
-			new Class<?>[] {}, "MIR:00000116"), //
-
-	/**
-	 * KEGG Pathway: http://www.genome.jp/kegg/pathway.html.
-	 */
-	KEGG_PATHWAY("Kegg Pathway", //
-			"http://www.genome.jp/kegg/pathway.html", //
-			"urn:miriam:kegg.pathway", //
-			new Class<?>[] { Reaction.class }, "MIR:00000012"), //
-
-	/**
-	 * KEGG Reaction: http://www.genome.jp/kegg/reaction/.
-	 */
-	KEGG_REACTION("Kegg Reaction", //
-			"http://www.genome.jp/kegg/reaction/", //
-			"urn:miriam:kegg.reaction", //
-			new Class<?>[] { Reaction.class }, "MIR:00000014"), //
-
-	/**
-	 * MeSH 2012: http://www.nlm.nih.gov/mesh/.
-	 */
-	MESH_2012("MeSH 2012", //
-			"http://www.nlm.nih.gov/mesh/", //
-			new String[] { "urn:miriam:mesh.2012", "urn:miriam:mesh" }, //
-			new Class<?>[] { Phenotype.class, Compartment.class, ComplexSpecies.class }, "MIR:00000270"), //
-
-	/**
-	 * miRBase Sequence: http://www.mirbase.org/.
-	 */
-	MI_R_BASE_SEQUENCE("miRBase Sequence Database", //
-			"http://www.mirbase.org/", //
-			new String[] { "urn:miriam:mirbase" }, //
-			new Class<?>[] {}, "MIR:00000078"), //
-
-	/**
-	 * miRBase Mature Sequence: http://www.mirbase.org/.
-	 */
-	MI_R_BASE_MATURE_SEQUENCE("miRBase Mature Sequence Database", //
-			"http://www.mirbase.org/", //
-			new String[] { "urn:miriam:mirbase.mature" }, //
-			new Class<?>[] {}, "MIR:00000235"), //
-
-	/**
-	 * miRTaRBase Mature Sequence: http://mirtarbase.mbc.nctu.edu.tw/.
-	 */
-	MIR_TAR_BASE_MATURE_SEQUENCE("miRTarBase Mature Sequence Database", //
-			"http://mirtarbase.mbc.nctu.edu.tw/", //
-			new String[] { "urn:miriam:mirtarbase" }, //
-			new Class<?>[] {}, "MIR:00100739"), //
-
-	/**
-	 * Mouse Genome Database: http://www.informatics.jax.org/.
-	 */
-	MGD("Mouse Genome Database", //
-			"http://www.informatics.jax.org/", //
-			new String[] { "urn:miriam:mgd" }, //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000037"), //
-
-	/**
-	 * Online Mendelian Inheritance in Man: http://omim.org/.
-	 */
-	OMIM("Online Mendelian Inheritance in Man", //
-			"http://omim.org/", //
-			new String[] { "urn:miriam:omim" }, //
-			new Class<?>[] { Phenotype.class }, "MIR:00000016"), //
-
-	/**
-	 * PANTHER Family: http://www.pantherdb.org/.
-	 */
-	PANTHER("PANTHER Family", //
-			"http://www.pantherdb.org/", //
-			new String[] { "urn:miriam:panther.family", "urn:miriam:panther" }, //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000060"), //
-
-	/**
-	 * Protein Family Database: http://pfam.xfam.org/.
-	 */
-	PFAM("Protein Family Database", //
-			"http://pfam.xfam.org//", //
-			"urn:miriam:pfam", //
-			new Class<?>[] {}, "MIR:00000028"), //
-
-	/**
-	 * PharmGKB Pathways: http://www.pharmgkb.org/.
-	 */
-	PHARM("PharmGKB Pathways", //
-			"http://www.pharmgkb.org/", //
-			"urn:miriam:pharmgkb.pathways", //
-			new Class<?>[] {}, "MIR:00000089"), //
-
-	/**
-	 * PubChem-compound: http://pubchem.ncbi.nlm.nih.gov/.
-	 */
-	PUBCHEM("PubChem-compound", //
-			"http://pubchem.ncbi.nlm.nih.gov/", //
-			new String[] { "urn:miriam:pubchem.compound" }, //
-			new Class<?>[] { Chemical.class }, "MIR:00000034", //
-			new Class<?>[] { Chemical.class }), //
-
-	/**
-	 * PubChem-substance: http://pubchem.ncbi.nlm.nih.gov/.
-	 */
-	PUBCHEM_SUBSTANCE("PubChem-substance", //
-			"http://pubchem.ncbi.nlm.nih.gov/", //
-			new String[] { "urn:miriam:pubchem.substance" }, //
-			new Class<?>[] { Chemical.class }, "MIR:00000033", //
-			new Class<?>[] { Chemical.class }), //
-
-	/**
-	 * PubMed: http://www.ncbi.nlm.nih.gov/PubMed/.
-	 */
-	PUBMED("PubMed", //
-			"http://www.ncbi.nlm.nih.gov/PubMed/", //
-			new String[] { "urn:miriam:pubmed" }, //
-			new Class<?>[] { AnnotatedObject.class }, "MIR:00000015", //
-			new Class<?>[] { Reaction.class }), //
-
-	/**
-	 * Reactome: http://www.reactome.org/.
-	 */
-	REACTOME("Reactome", //
-			"http://www.reactome.org/", //
-			"urn:miriam:reactome", //
-			new Class<?>[] { Reaction.class }, "MIR:00000018"), //
-
-	/**
-	 * RefSeq: http://www.ncbi.nlm.nih.gov/projects/RefSeq/.
-	 */
-	REFSEQ("RefSeq", //
-			"http://www.ncbi.nlm.nih.gov/projects/RefSeq/", //
-			"urn:miriam:refseq", //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000039"),
-
-	/**
-	 * SGD: http://www.yeastgenome.org/.
-	 */
-	SGD("Saccharomyces Genome Database", //
-			"http://www.yeastgenome.org/", //
-			"urn:miriam:sgd", //
-			new Class<?>[] {}, "MIR:00000023"),
-
-	/**
-	 * The Arabidopsis Information Resource (TAIR) maintains a database of genetic
-	 * and molecular biology data for the model higher plant Arabidopsis thaliana.
-	 * The name of a Locus is unique and used by TAIR, TIGR, and MIPS:
-	 * http://arabidopsis.org/index.jsp.
-	 */
-	TAIR_LOCUS("TAIR Locus", //
-			"http://arabidopsis.org/index.jsp", //
-			"urn:miriam:tair.locus", //
-			new Class<?>[] {}, "MIR:00000050"),
-
-	/**
-	 * Taxonomy: http://www.ncbi.nlm.nih.gov/taxonomy/.
-	 */
-	TAXONOMY("Taxonomy", //
-			"http://www.ncbi.nlm.nih.gov/taxonomy/", //
-			"urn:miriam:taxonomy", //
-			new Class<?>[] {}, "MIR:00000006"),
-	/**
-	 * Toxicogenomic: Chemical: http://ctdbase.org/detail.go.
-	 * http://ctdbase.org/detail.go
-	 */
-	TOXICOGENOMIC_CHEMICAL("Toxicogenomic Chemical", //
-			"http://ctdbase.org/", //
-			"urn:miriam:ctd.chemical", //
-			new Class<?>[] {}, "MIR:00000098"), //
-
-	/**
-	 * UniGene: http://www.ncbi.nlm.nih.gov/unigene.
-	 */
-	UNIGENE("UniGene", //
-			"http://www.ncbi.nlm.nih.gov/unigene", //
-			"urn:miriam:unigene", //
-			new Class<?>[] {}, "MIR:00000346"),
-
-	/**
-	 * Uniprot: http://www.uniprot.org/.
-	 */
-	UNIPROT("Uniprot", //
-			"http://www.uniprot.org/", //
-			"urn:miriam:uniprot", //
-			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000005"),
-
-	/**
-	 * UniProt Isoform: http://www.uniprot.org/.
-	 */
-	UNIPROT_ISOFORM("UniProt Isoform", //
-			"http://www.uniprot.org/", //
-			"urn:miriam:uniprot.isoform", //
-			new Class<?>[] { Protein.class }, "MIR:00000388"),
-
-	/**
-	 * Unknown reference type...
-	 */
-	UNKNOWN("Unknown", //
-			null, //
-			new String[] {}, //
-			new Class<?>[] {}, null),
-
-	/**
-	 * Wikidata: https://www.wikidata.org/.
-	 */
-	WIKIDATA("Wikidata", //
-			"https://www.wikidata.org/", //
-			new String[] { "urn:miriam:wikidata" }, //
-			new Class<?>[] {}, "MIR:00000549"), //
-
-	/**
-	 * WikiPathways: http://www.wikipathways.org/.
-	 */
-	WIKIPATHWAYS("WikiPathways", //
-			"http://www.wikipathways.org/", //
-			new String[] { "urn:miriam:wikipathways" }, //
-			new Class<?>[] {}, "MIR:00000076"), //
-
-	/**
-	 * Wikipedia: http://en.wikipedia.org/wiki/Main_Page.
-	 */
-	WIKIPEDIA("Wikipedia (English)", //
-			"http://en.wikipedia.org/wiki/Main_Page", // /
-			new String[] { "urn:miriam:wikipedia.en" }, //
-			new Class<?>[] {}, "MIR:00000384"),
-
-	/**
-	 * WormBase: http://wormbase.bio2rdf.org/fct.
-	 */
-	WORM_BASE("WormBase", //
-			"http://wormbase.bio2rdf.org/fct", // /
-			new String[] { "urn:miriam:wormbase" }, //
-			new Class<?>[] {}, "MIR:00000027");
-
-	/**
-	 * User friendly name.
-	 */
-	private String				 commonName;
-	/**
-	 * url to homepage of given resource type.
-	 */
-	private String				 dbHomepage;
-
-	/**
-	 * Identifier of the database in miriam registry.
-	 */
-	private String				 registryIdentifier;
-
-	/**
-	 * Valid uris to this resource.
-	 */
-	private List<String>	 uris					 = new ArrayList<String>();
-
-	/**
-	 * Classes that can be annotated by this resource.
-	 */
-	private List<Class<?>> validClass		 = new ArrayList<Class<?>>();
-
-	/**
-	 * When class from this list is marked as "require at least one annotation"
-	 * then annotation of this type is valid.
-	 */
-	private List<Class<?>> requiredClass = new ArrayList<Class<?>>();
-
-	/**
-	 * Constructor that initialize enum object.
-	 * 
-	 * @param dbHomePage
-	 *          homepage of the resource {@link #dbHomepage}
-	 * @param commonName
-	 *          {@link #commonName}
-	 * @param uris
-	 *          {@link #uris}
-	 * @param classes
-	 *          {@link #validClass}
-	 * @param registryIdentifier
-	 *          {@link #registryIdentifier}
-	 */
-	MiriamType(String commonName, String dbHomePage, String[] uris, Class<?>[] classes, String registryIdentifier) {
-		this(commonName, dbHomePage, uris, classes, registryIdentifier, new Class<?>[] {});
-	}
-
-	/**
-	 * Constructor that initialize enum object.
-	 * 
-	 * @param dbHomePage
-	 *          homepage of the resource {@link #dbHomepage}
-	 * @param commonName
-	 *          {@link #commonName}
-	 * @param uris
-	 *          {@link #uris}
-	 * @param classes
-	 *          {@link #validClass}
-	 * @param registryIdentifier
-	 *          {@link #registryIdentifier}
-	 * @param requiredClasses
-	 *          {@link #requiredClasses}
-	 */
-	MiriamType(String commonName, String dbHomePage, String[] uris, Class<?>[] classes, String registryIdentifier, Class<?>[] requiredClasses) {
-		this.commonName = commonName;
-		this.dbHomepage = dbHomePage;
-		for (String string : uris) {
-			this.uris.add(string);
-		}
-		for (Class<?> clazz : classes) {
-			this.validClass.add(clazz);
-		}
-		for (Class<?> clazz : requiredClasses) {
-			this.requiredClass.add(clazz);
-		}
-		this.registryIdentifier = registryIdentifier;
-	}
-
-	/**
-	 * Constructor that initialize enum object.
-	 * 
-	 * @param dbHomePage
-	 *          homepage of the resource {@link #dbHomepage}
-	 * @param commonName
-	 *          {@link #commonName}
-	 * @param uri
-	 *          one of {@link #uris}
-	 * @param registryIdentifier
-	 *          {@link #registryIdentifier}
-	 * @param classes
-	 *          {@link #validClass}
-	 */
-	MiriamType(String commonName, String dbHomePage, String uri, Class<?>[] classes, String registryIdentifier) {
-		this(commonName, dbHomePage, new String[] { uri }, classes, registryIdentifier);
-	}
-
-	/**
-	 * 
-	 * @return {@link #commonName}
-	 */
-	public String getCommonName() {
-		return commonName;
-	}
-
-	/**
-	 * 
-	 * @return {@link #uris}
-	 */
-	public List<String> getUris() {
-		return uris;
-	}
-
-	/**
-	 * 
-	 * @return {@link #validClass}
-	 */
-	public List<Class<?>> getValidClass() {
-		return validClass;
-	}
-
-	/**
-	 * Returns {@link MiriamType} associated with parameter uri address.
-	 * 
-	 * @param uri
-	 *          uri to check
-	 * @return {@link MiriamType} for given uri
-	 */
-	public static MiriamType getTypeByUri(String uri) {
-		for (MiriamType mt : MiriamType.values()) {
-			for (String string : mt.getUris()) {
-				if (string.equalsIgnoreCase(uri)) {
-					return mt;
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * @return the dbHomepage
-	 * @see #dbHomepage
-	 */
-	public String getDbHomepage() {
-		return dbHomepage;
-	}
-
-	/**
-	 * @return the registryIdentifier
-	 * @see #registryIdentifier
-	 */
-	public String getRegistryIdentifier() {
-		return registryIdentifier;
-	}
-
-	/**
-	 * @return the requiredClass
-	 * @see #requiredClass
-	 */
-	public List<Class<?>> getRequiredClass() {
-		return requiredClass;
-	}
-
-	/**
-	 * Returns {@link MiriamType} associated with {@link #commonName}.
-	 * 
-	 * @param string
-	 *          {@link #commonName}
-	 * @return {@link MiriamType} for given name
-	 */
-	public static MiriamType getTypeByCommonName(String string) {
-		for (MiriamType mt : MiriamType.values()) {
-			if (string.equalsIgnoreCase(mt.getCommonName())) {
-				return mt;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Transforms identifier into {@link MiriamData}.
-	 * 
-	 * @param generalIdentifier
-	 *          identifier in the format NAME:IDENTIFIER. Where NAME is the name
-	 *          from {@link MiriamType#commonName} and IDENTIFIER is reasource
-	 *          identifier.
-	 * @return {@link MiriamData} representing generalIdentifier, when identifier
-	 *         is invalid InvalidArgumentException is thrown
-	 */
-	public static MiriamData getMiriamDataFromIdentifier(String generalIdentifier) {
-		int index = generalIdentifier.indexOf(":");
-		if (index < 0) {
-			throw new InvalidArgumentException("Identifier doesn't contain type");
-		}
-		String type = generalIdentifier.substring(0, index);
-		String id = generalIdentifier.substring(index + 1);
-		for (MiriamType mt : MiriamType.values()) {
-			if (mt.getCommonName().equalsIgnoreCase(type)) {
-				return new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, mt, id);
-			}
-		}
-		throw new InvalidArgumentException("Unknown miriam type: " + type + " (id: " + id + ")");
-	}
-
-	/**
-	 * Creates {@link MiriamData} from miriam uri.
-	 * 
-	 * @param miriamUri
-	 *          miriam uri defining {@link MiriamData}
-	 * @return {@link MiriamData} from miriam uri
-	 */
-	public static MiriamData getMiriamByUri(String miriamUri) {
-		// this hack is due to CellDesigner issue (CellDesigner incorectly handle
-		// with identifiers that have ":" inside resource ":" inside resource with
-		// "%3A" and also the last ":"
-		miriamUri = miriamUri.replace("%3A", ":");
-
-		String foundUri = "";
-		MiriamType foundType = null;
-
-		for (MiriamType type : MiriamType.values()) {
-			for (String uri : type.getUris()) {
-				if (miriamUri.startsWith(uri + ":")) {
-					if (uri.length() > foundUri.length()) {
-						foundType = type;
-						foundUri = uri;
-					}
-				}
-			}
-		}
-		if (foundType != null) {
-			return new MiriamData(foundType, miriamUri.substring(foundUri.length() + 1));
-		}
-		throw new InvalidArgumentException("Invalid miriam uri: " + miriamUri);
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.Chemical;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Drug;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Rna;
+
+/**
+ * Type of known miriam annotation.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public enum MiriamType {
+	/**
+	 * Chemical Abstracts Service database: http://commonchemistry.org.
+	 */
+	CAS("Chemical Abstracts Service", //
+			"http://commonchemistry.org", //
+			new String[] { "urn:miriam:cas" }, //
+			new Class<?>[] {}, "MIR:00000237"), //
+
+	/**
+	 * Consensus CDS: http://identifiers.org/ccds/.
+	 */
+	CCDS("Consensus CDS", //
+			"http://www.ncbi.nlm.nih.gov/CCDS/", //
+			new String[] { "urn:miriam:ccds" }, //
+			new Class<?>[] {}, "MIR:00000375"), //
+
+	/**
+	 * Chebi database:
+	 * <a href = "http://www.ebi.ac.uk/chebi/">http://www.ebi.ac.uk/chebi/</a>.
+	 */
+	CHEBI("Chebi", //
+			"http://www.ebi.ac.uk/chebi/", //
+			new String[] { "urn:miriam:obo.chebi", "urn:miriam:chebi" }, //
+			new Class<?>[] { Chemical.class, Drug.class, }, "MIR:00000002", //
+			new Class<?>[] { Chemical.class }), //
+
+	/**
+	 * ChemSpider database:
+	 * <a href = "http://www.chemspider.com/">http://www.chemspider.com/</a>.
+	 */
+	CHEMSPIDER("ChemSpider", //
+			"http://www.chemspider.com//", //
+			new String[] { "urn:miriam:chemspider" }, //
+			new Class<?>[] {}, "MIR:00000138"), //
+
+	/**
+	 * Chembl database: https://www.ebi.ac.uk/chembldb/.
+	 */
+	CHEMBL_COMPOUND("ChEMBL", //
+			"https://www.ebi.ac.uk/chembldb/", //
+			new String[] { "urn:miriam:chembl.compound" }, //
+			new Class<?>[] { Drug.class }, "MIR:00000084"), //
+
+	/**
+	 * Target in chembl database: https://www.ebi.ac.uk/chembldb/.
+	 */
+	CHEMBL_TARGET("ChEMBL target", //
+			"https://www.ebi.ac.uk/chembldb/", //
+			new String[] { "urn:miriam:chembl.target" }, //
+			new Class<?>[] { Protein.class, ComplexSpecies.class }, "MIR:00000085"), //
+
+	/**
+	 * Drugbank database: http://www.drugbank.ca/.
+	 */
+	DRUGBANK("DrugBank", //
+			"http://www.drugbank.ca/", //
+			new String[] { "urn:miriam:drugbank" }, //
+			new Class<?>[] { Drug.class }, "MIR:00000102"), //
+	/**
+	 * Drugbank tagrets: http://www.drugbank.ca/targets.
+	 */
+	DRUGBANK_TARGET_V4("DrugBank Target v4", //
+			"http://www.drugbank.ca/targets", //
+			new String[] { "urn:miriam:drugbankv4.target" }, //
+			new Class<?>[] {}, "MIR:00000528"), //
+
+	/**
+	 * Enzyme Nomenclature: http://www.enzyme-database.org/.
+	 */
+	EC("Enzyme Nomenclature", //
+			"http://www.enzyme-database.org/", //
+			new String[] { "urn:miriam:ec-code" }, //
+			new Class<?>[] { Protein.class, ComplexSpecies.class }, "MIR:00000004"), //
+
+	/**
+	 * Ensembl: www.ensembl.org.
+	 */
+	ENSEMBL("Ensembl", //
+			"www.ensembl.org", //
+			new String[] { "urn:miriam:ensembl" }, //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000003"), //
+
+	/**
+	 * Ensembl Plants: http://plants.ensembl.org/.
+	 */
+	ENSEMBL_PLANTS("Ensembl Plants", //
+			"http://plants.ensembl.org/", //
+			new String[] { "urn:miriam:ensembl.plant" }, //
+			new Class<?>[] {}, "MIR:00000205"), //
+
+	/**
+	 * Entrez Gene: http://www.ncbi.nlm.nih.gov/gene.
+	 */
+	ENTREZ("Entrez Gene", //
+			"http://www.ncbi.nlm.nih.gov/gene", //
+			new String[] { "urn:miriam:ncbigene", "urn:miriam:entrez.gene" }, //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000069"), //
+
+	/**
+	 * Gene Ontology: http://amigo.geneontology.org/amigo.
+	 */
+	GO("Gene Ontology", //
+			"http://amigo.geneontology.org/amigo", //
+			new String[] { "urn:miriam:obo.go", "urn:miriam:go" }, //
+			new Class<?>[] { Phenotype.class, Compartment.class, ComplexSpecies.class }, "MIR:00000022"), //
+
+	/**
+	 * HGNC: http://www.genenames.org.
+	 */
+	HGNC("HGNC", //
+			"http://www.genenames.org", //
+			new String[] { "urn:miriam:hgnc" }, //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000080", //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }), //
+
+	/**
+	 * HGNC symbol: http://www.genenames.org.
+	 */
+	HGNC_SYMBOL("HGNC Symbol", //
+			"http://www.genenames.org", //
+			new String[] { "urn:miriam:hgnc.symbol" }, //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000362", //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }), //
+
+	/**
+	 * HMDB: http://www.hmdb.ca/.
+	 */
+	HMDB("HMDB", //
+			"http://www.hmdb.ca/", //
+			"urn:miriam:hmdb", //
+			new Class<?>[] { Chemical.class, Drug.class, }, "MIR:00000051"), //
+
+	/**
+	 * InterPro: http://www.ebi.ac.uk/interpro/.
+	 */
+	INTERPRO("InterPro", //
+			"http://www.ebi.ac.uk/interpro/", //
+			new String[] { "urn:miriam:interpro" }, //
+			new Class<?>[] { Protein.class, ComplexSpecies.class }, "MIR:00000011"), //
+
+	/**
+	 * KEGG Compound: http://www.genome.jp/kegg/ligand.html.
+	 */
+	KEGG_COMPOUND("Kegg Compound", //
+			"http://www.genome.jp/kegg/ligand.html", //
+			"urn:miriam:kegg.compound", //
+			new Class<?>[] { Chemical.class }, "MIR:00000013"), //
+
+	/**
+	 * KEGG Genes: http://www.genome.jp/kegg/genes.html.
+	 */
+	KEGG_GENES("Kegg Genes", //
+			"http://www.genome.jp/kegg/genes.html", //
+			new String[] { "urn:miriam:kegg.genes", "urn:miriam:kegg.genes:hsa" }, //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000070"), //
+
+	/**
+	 * KEGG Orthology: http://www.genome.jp/kegg/ko.html.
+	 */
+	KEGG_ORTHOLOGY("KEGG Orthology", //
+			"http://www.genome.jp/kegg/ko.html", //
+			new String[] { "urn:miriam:kegg.orthology" }, //
+			new Class<?>[] {}, "MIR:00000116"), //
+
+	/**
+	 * KEGG Pathway: http://www.genome.jp/kegg/pathway.html.
+	 */
+	KEGG_PATHWAY("Kegg Pathway", //
+			"http://www.genome.jp/kegg/pathway.html", //
+			"urn:miriam:kegg.pathway", //
+			new Class<?>[] { Reaction.class }, "MIR:00000012"), //
+
+	/**
+	 * KEGG Reaction: http://www.genome.jp/kegg/reaction/.
+	 */
+	KEGG_REACTION("Kegg Reaction", //
+			"http://www.genome.jp/kegg/reaction/", //
+			"urn:miriam:kegg.reaction", //
+			new Class<?>[] { Reaction.class }, "MIR:00000014"), //
+
+	/**
+	 * MeSH 2012: http://www.nlm.nih.gov/mesh/.
+	 */
+	MESH_2012("MeSH 2012", //
+			"http://www.nlm.nih.gov/mesh/", //
+			new String[] { "urn:miriam:mesh.2012", "urn:miriam:mesh" }, //
+			new Class<?>[] { Phenotype.class, Compartment.class, ComplexSpecies.class }, "MIR:00000270"), //
+
+	/**
+	 * miRBase Sequence: http://www.mirbase.org/.
+	 */
+	MI_R_BASE_SEQUENCE("miRBase Sequence Database", //
+			"http://www.mirbase.org/", //
+			new String[] { "urn:miriam:mirbase" }, //
+			new Class<?>[] {}, "MIR:00000078"), //
+
+	/**
+	 * miRBase Mature Sequence: http://www.mirbase.org/.
+	 */
+	MI_R_BASE_MATURE_SEQUENCE("miRBase Mature Sequence Database", //
+			"http://www.mirbase.org/", //
+			new String[] { "urn:miriam:mirbase.mature" }, //
+			new Class<?>[] {}, "MIR:00000235"), //
+
+	/**
+	 * miRTaRBase Mature Sequence: http://mirtarbase.mbc.nctu.edu.tw/.
+	 */
+	MIR_TAR_BASE_MATURE_SEQUENCE("miRTarBase Mature Sequence Database", //
+			"http://mirtarbase.mbc.nctu.edu.tw/", //
+			new String[] { "urn:miriam:mirtarbase" }, //
+			new Class<?>[] {}, "MIR:00100739"), //
+
+	/**
+	 * Mouse Genome Database: http://www.informatics.jax.org/.
+	 */
+	MGD("Mouse Genome Database", //
+			"http://www.informatics.jax.org/", //
+			new String[] { "urn:miriam:mgd" }, //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000037"), //
+
+	/**
+	 * Online Mendelian Inheritance in Man: http://omim.org/.
+	 */
+	OMIM("Online Mendelian Inheritance in Man", //
+			"http://omim.org/", //
+			new String[] { "urn:miriam:omim" }, //
+			new Class<?>[] { Phenotype.class }, "MIR:00000016"), //
+
+	/**
+	 * PANTHER Family: http://www.pantherdb.org/.
+	 */
+	PANTHER("PANTHER Family", //
+			"http://www.pantherdb.org/", //
+			new String[] { "urn:miriam:panther.family", "urn:miriam:panther" }, //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000060"), //
+
+	/**
+	 * Protein Family Database: http://pfam.xfam.org/.
+	 */
+	PFAM("Protein Family Database", //
+			"http://pfam.xfam.org//", //
+			"urn:miriam:pfam", //
+			new Class<?>[] {}, "MIR:00000028"), //
+
+	/**
+	 * PharmGKB Pathways: http://www.pharmgkb.org/.
+	 */
+	PHARM("PharmGKB Pathways", //
+			"http://www.pharmgkb.org/", //
+			"urn:miriam:pharmgkb.pathways", //
+			new Class<?>[] {}, "MIR:00000089"), //
+
+	/**
+	 * PubChem-compound: http://pubchem.ncbi.nlm.nih.gov/.
+	 */
+	PUBCHEM("PubChem-compound", //
+			"http://pubchem.ncbi.nlm.nih.gov/", //
+			new String[] { "urn:miriam:pubchem.compound" }, //
+			new Class<?>[] { Chemical.class }, "MIR:00000034", //
+			new Class<?>[] { Chemical.class }), //
+
+	/**
+	 * PubChem-substance: http://pubchem.ncbi.nlm.nih.gov/.
+	 */
+	PUBCHEM_SUBSTANCE("PubChem-substance", //
+			"http://pubchem.ncbi.nlm.nih.gov/", //
+			new String[] { "urn:miriam:pubchem.substance" }, //
+			new Class<?>[] { Chemical.class }, "MIR:00000033", //
+			new Class<?>[] { Chemical.class }), //
+
+	/**
+	 * PubMed: http://www.ncbi.nlm.nih.gov/PubMed/.
+	 */
+	PUBMED("PubMed", //
+			"http://www.ncbi.nlm.nih.gov/PubMed/", //
+			new String[] { "urn:miriam:pubmed" }, //
+			new Class<?>[] { AnnotatedObject.class }, "MIR:00000015", //
+			new Class<?>[] { Reaction.class }), //
+
+	/**
+	 * Reactome: http://www.reactome.org/.
+	 */
+	REACTOME("Reactome", //
+			"http://www.reactome.org/", //
+			"urn:miriam:reactome", //
+			new Class<?>[] { Reaction.class }, "MIR:00000018"), //
+
+	/**
+	 * RefSeq: http://www.ncbi.nlm.nih.gov/projects/RefSeq/.
+	 */
+	REFSEQ("RefSeq", //
+			"http://www.ncbi.nlm.nih.gov/projects/RefSeq/", //
+			"urn:miriam:refseq", //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000039"),
+
+	/**
+	 * SGD: http://www.yeastgenome.org/.
+	 */
+	SGD("Saccharomyces Genome Database", //
+			"http://www.yeastgenome.org/", //
+			"urn:miriam:sgd", //
+			new Class<?>[] {}, "MIR:00000023"),
+
+	/**
+	 * The Arabidopsis Information Resource (TAIR) maintains a database of genetic
+	 * and molecular biology data for the model higher plant Arabidopsis thaliana.
+	 * The name of a Locus is unique and used by TAIR, TIGR, and MIPS:
+	 * http://arabidopsis.org/index.jsp.
+	 */
+	TAIR_LOCUS("TAIR Locus", //
+			"http://arabidopsis.org/index.jsp", //
+			"urn:miriam:tair.locus", //
+			new Class<?>[] {}, "MIR:00000050"),
+
+	/**
+	 * Taxonomy: http://www.ncbi.nlm.nih.gov/taxonomy/.
+	 */
+	TAXONOMY("Taxonomy", //
+			"http://www.ncbi.nlm.nih.gov/taxonomy/", //
+			"urn:miriam:taxonomy", //
+			new Class<?>[] {}, "MIR:00000006"),
+	/**
+	 * Toxicogenomic: Chemical: http://ctdbase.org/detail.go.
+	 * http://ctdbase.org/detail.go
+	 */
+	TOXICOGENOMIC_CHEMICAL("Toxicogenomic Chemical", //
+			"http://ctdbase.org/", //
+			"urn:miriam:ctd.chemical", //
+			new Class<?>[] {}, "MIR:00000098"), //
+
+	/**
+	 * UniGene: http://www.ncbi.nlm.nih.gov/unigene.
+	 */
+	UNIGENE("UniGene", //
+			"http://www.ncbi.nlm.nih.gov/unigene", //
+			"urn:miriam:unigene", //
+			new Class<?>[] {}, "MIR:00000346"),
+
+	/**
+	 * Uniprot: http://www.uniprot.org/.
+	 */
+	UNIPROT("Uniprot", //
+			"http://www.uniprot.org/", //
+			"urn:miriam:uniprot", //
+			new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000005"),
+
+	/**
+	 * UniProt Isoform: http://www.uniprot.org/.
+	 */
+	UNIPROT_ISOFORM("UniProt Isoform", //
+			"http://www.uniprot.org/", //
+			"urn:miriam:uniprot.isoform", //
+			new Class<?>[] { Protein.class }, "MIR:00000388"),
+
+	/**
+	 * Unknown reference type...
+	 */
+	UNKNOWN("Unknown", //
+			null, //
+			new String[] {}, //
+			new Class<?>[] {}, null),
+
+	/**
+	 * Wikidata: https://www.wikidata.org/.
+	 */
+	WIKIDATA("Wikidata", //
+			"https://www.wikidata.org/", //
+			new String[] { "urn:miriam:wikidata" }, //
+			new Class<?>[] {}, "MIR:00000549"), //
+
+	/**
+	 * WikiPathways: http://www.wikipathways.org/.
+	 */
+	WIKIPATHWAYS("WikiPathways", //
+			"http://www.wikipathways.org/", //
+			new String[] { "urn:miriam:wikipathways" }, //
+			new Class<?>[] {}, "MIR:00000076"), //
+
+	/**
+	 * Wikipedia: http://en.wikipedia.org/wiki/Main_Page.
+	 */
+	WIKIPEDIA("Wikipedia (English)", //
+			"http://en.wikipedia.org/wiki/Main_Page", // /
+			new String[] { "urn:miriam:wikipedia.en" }, //
+			new Class<?>[] {}, "MIR:00000384"),
+
+	/**
+	 * WormBase: http://wormbase.bio2rdf.org/fct.
+	 */
+	WORM_BASE("WormBase", //
+			"http://wormbase.bio2rdf.org/fct", // /
+			new String[] { "urn:miriam:wormbase" }, //
+			new Class<?>[] {}, "MIR:00000027");
+
+	/**
+	 * User friendly name.
+	 */
+	private String				 commonName;
+	/**
+	 * url to homepage of given resource type.
+	 */
+	private String				 dbHomepage;
+
+	/**
+	 * Identifier of the database in miriam registry.
+	 */
+	private String				 registryIdentifier;
+
+	/**
+	 * Valid uris to this resource.
+	 */
+	private List<String>	 uris					 = new ArrayList<String>();
+
+	/**
+	 * Classes that can be annotated by this resource.
+	 */
+	private List<Class<?>> validClass		 = new ArrayList<Class<?>>();
+
+	/**
+	 * When class from this list is marked as "require at least one annotation"
+	 * then annotation of this type is valid.
+	 */
+	private List<Class<?>> requiredClass = new ArrayList<Class<?>>();
+
+	/**
+	 * Constructor that initialize enum object.
+	 * 
+	 * @param dbHomePage
+	 *          homepage of the resource {@link #dbHomepage}
+	 * @param commonName
+	 *          {@link #commonName}
+	 * @param uris
+	 *          {@link #uris}
+	 * @param classes
+	 *          {@link #validClass}
+	 * @param registryIdentifier
+	 *          {@link #registryIdentifier}
+	 */
+	MiriamType(String commonName, String dbHomePage, String[] uris, Class<?>[] classes, String registryIdentifier) {
+		this(commonName, dbHomePage, uris, classes, registryIdentifier, new Class<?>[] {});
+	}
+
+	/**
+	 * Constructor that initialize enum object.
+	 * 
+	 * @param dbHomePage
+	 *          homepage of the resource {@link #dbHomepage}
+	 * @param commonName
+	 *          {@link #commonName}
+	 * @param uris
+	 *          {@link #uris}
+	 * @param classes
+	 *          {@link #validClass}
+	 * @param registryIdentifier
+	 *          {@link #registryIdentifier}
+	 * @param requiredClasses
+	 *          {@link #requiredClasses}
+	 */
+	MiriamType(String commonName, String dbHomePage, String[] uris, Class<?>[] classes, String registryIdentifier, Class<?>[] requiredClasses) {
+		this.commonName = commonName;
+		this.dbHomepage = dbHomePage;
+		for (String string : uris) {
+			this.uris.add(string);
+		}
+		for (Class<?> clazz : classes) {
+			this.validClass.add(clazz);
+		}
+		for (Class<?> clazz : requiredClasses) {
+			this.requiredClass.add(clazz);
+		}
+		this.registryIdentifier = registryIdentifier;
+	}
+
+	/**
+	 * Constructor that initialize enum object.
+	 * 
+	 * @param dbHomePage
+	 *          homepage of the resource {@link #dbHomepage}
+	 * @param commonName
+	 *          {@link #commonName}
+	 * @param uri
+	 *          one of {@link #uris}
+	 * @param registryIdentifier
+	 *          {@link #registryIdentifier}
+	 * @param classes
+	 *          {@link #validClass}
+	 */
+	MiriamType(String commonName, String dbHomePage, String uri, Class<?>[] classes, String registryIdentifier) {
+		this(commonName, dbHomePage, new String[] { uri }, classes, registryIdentifier);
+	}
+
+	/**
+	 * 
+	 * @return {@link #commonName}
+	 */
+	public String getCommonName() {
+		return commonName;
+	}
+
+	/**
+	 * 
+	 * @return {@link #uris}
+	 */
+	public List<String> getUris() {
+		return uris;
+	}
+
+	/**
+	 * 
+	 * @return {@link #validClass}
+	 */
+	public List<Class<?>> getValidClass() {
+		return validClass;
+	}
+
+	/**
+	 * Returns {@link MiriamType} associated with parameter uri address.
+	 * 
+	 * @param uri
+	 *          uri to check
+	 * @return {@link MiriamType} for given uri
+	 */
+	public static MiriamType getTypeByUri(String uri) {
+		for (MiriamType mt : MiriamType.values()) {
+			for (String string : mt.getUris()) {
+				if (string.equalsIgnoreCase(uri)) {
+					return mt;
+				}
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * @return the dbHomepage
+	 * @see #dbHomepage
+	 */
+	public String getDbHomepage() {
+		return dbHomepage;
+	}
+
+	/**
+	 * @return the registryIdentifier
+	 * @see #registryIdentifier
+	 */
+	public String getRegistryIdentifier() {
+		return registryIdentifier;
+	}
+
+	/**
+	 * @return the requiredClass
+	 * @see #requiredClass
+	 */
+	public List<Class<?>> getRequiredClass() {
+		return requiredClass;
+	}
+
+	/**
+	 * Returns {@link MiriamType} associated with {@link #commonName}.
+	 * 
+	 * @param string
+	 *          {@link #commonName}
+	 * @return {@link MiriamType} for given name
+	 */
+	public static MiriamType getTypeByCommonName(String string) {
+		for (MiriamType mt : MiriamType.values()) {
+			if (string.equalsIgnoreCase(mt.getCommonName())) {
+				return mt;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Transforms identifier into {@link MiriamData}.
+	 * 
+	 * @param generalIdentifier
+	 *          identifier in the format NAME:IDENTIFIER. Where NAME is the name
+	 *          from {@link MiriamType#commonName} and IDENTIFIER is reasource
+	 *          identifier.
+	 * @return {@link MiriamData} representing generalIdentifier, when identifier
+	 *         is invalid InvalidArgumentException is thrown
+	 */
+	public static MiriamData getMiriamDataFromIdentifier(String generalIdentifier) {
+		int index = generalIdentifier.indexOf(":");
+		if (index < 0) {
+			throw new InvalidArgumentException("Identifier doesn't contain type");
+		}
+		String type = generalIdentifier.substring(0, index);
+		String id = generalIdentifier.substring(index + 1);
+		for (MiriamType mt : MiriamType.values()) {
+			if (mt.getCommonName().equalsIgnoreCase(type)) {
+				return new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, mt, id);
+			}
+		}
+		throw new InvalidArgumentException("Unknown miriam type: " + type + " (id: " + id + ")");
+	}
+
+	/**
+	 * Creates {@link MiriamData} from miriam uri.
+	 * 
+	 * @param miriamUri
+	 *          miriam uri defining {@link MiriamData}
+	 * @return {@link MiriamData} from miriam uri
+	 */
+	public static MiriamData getMiriamByUri(String miriamUri) {
+		// this hack is due to CellDesigner issue (CellDesigner incorectly handle
+		// with identifiers that have ":" inside resource ":" inside resource with
+		// "%3A" and also the last ":"
+		miriamUri = miriamUri.replace("%3A", ":");
+
+		String foundUri = "";
+		MiriamType foundType = null;
+
+		for (MiriamType type : MiriamType.values()) {
+			for (String uri : type.getUris()) {
+				if (miriamUri.startsWith(uri + ":")) {
+					if (uri.length() > foundUri.length()) {
+						foundType = type;
+						foundUri = uri;
+					}
+				}
+			}
+		}
+		if (foundType != null) {
+			return new MiriamData(foundType, miriamUri.substring(foundUri.length() + 1));
+		}
+		throw new InvalidArgumentException("Invalid miriam uri: " + miriamUri);
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/OverviewImage.java b/model/src/main/java/lcsb/mapviewer/model/map/OverviewImage.java
index dde476ced8..f71cfa88ba 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/OverviewImage.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/OverviewImage.java
@@ -1,231 +1,231 @@
-package lcsb.mapviewer.model.map;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
-
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.model.ModelData;
-
-/**
- * This class describes single image that overview the model. Images can create
- * hierarchical structure via {@link OverviewLink} (link can point to another
- * image). The idea is to have set of images that nicely represent biology and
- * map it into map via {@link OverviewModelLink}.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@Table(name = "overview_image_table")
-public class OverviewImage implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long	 serialVersionUID	= 1L;
-
-	/**
-	 * Unique database identifier.
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
-	@Column(name = "idDb", unique = true, nullable = false)
-	private int								 id;
-
-	/**
-	 * The description belongs to this model. It doesn't mean that {@link #links}
-	 * will point to this model. Links can also point to submodel.
-	 */
-	@ManyToOne(fetch = FetchType.LAZY, optional = false)
-	private ModelData					 model;
-
-	/**
-	 * Name of the file in file system that reresent this overview image.
-	 */
-	private String						 filename;
-
-	/**
-	 * Width of the image.
-	 */
-	private Integer						 width;
-
-	/**
-	 * Height of the image.
-	 */
-	private Integer						 height;
-
-	/**
-	 * List of links that should redirect from this image. They can refer to
-	 * another {@link OverviewImage} or {@link ModelData Model}.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(fetch = FetchType.EAGER, mappedBy = "overviewImage", orphanRemoval = true)
-	@OrderBy("id")
-	private List<OverviewLink> links						= new ArrayList<OverviewLink>();
-
-	/**
-	 * Default constructor.
-	 */
-	public OverviewImage() {
-
-	}
-
-	/**
-	 * Default constructor with original {@link OverviewImage} as a source of
-	 * data.
-	 * 
-	 * @param overviewImage
-	 *          original {@link OverviewImage}
-	 */
-	public OverviewImage(OverviewImage overviewImage) {
-		this.setId(overviewImage.getId());
-		this.setModel(overviewImage.getModel());
-		this.setFilename(overviewImage.getFilename());
-		this.setWidth(overviewImage.getWidth());
-		this.setHeight(overviewImage.getHeight());
-		for (OverviewLink ol : overviewImage.getLinks()) {
-			this.addLink(ol.copy());
-		}
-	}
-
-	/**
-	 * @return the filename
-	 * @see #filename
-	 */
-	public String getFilename() {
-		return filename;
-	}
-
-	/**
-	 * @param filename
-	 *          the filename to set
-	 * @see #filename
-	 */
-	public void setFilename(String filename) {
-		this.filename = filename;
-	}
-
-	/**
-	 * @return the width
-	 * @see #width
-	 */
-	public Integer getWidth() {
-		return width;
-	}
-
-	/**
-	 * @param width
-	 *          the width to set
-	 * @see #width
-	 */
-	public void setWidth(Integer width) {
-		this.width = width;
-	}
-
-	/**
-	 * @return the height
-	 * @see #height
-	 */
-	public Integer getHeight() {
-		return height;
-	}
-
-	/**
-	 * @param height
-	 *          the height to set
-	 * @see #height
-	 */
-	public void setHeight(Integer height) {
-		this.height = height;
-	}
-
-	/**
-	 * @return the links
-	 * @see #links
-	 */
-	public List<OverviewLink> getLinks() {
-		return links;
-	}
-
-	/**
-	 * @param links
-	 *          the links to set
-	 * @see #links
-	 */
-	public void setLinks(List<OverviewLink> links) {
-		this.links = links;
-	}
-
-	/**
-	 * @return the model
-	 * @see #model
-	 */
-	public ModelData getModel() {
-		return model;
-	}
-
-	/**
-	 * @param model
-	 *          the model to set
-	 * @see #model
-	 */
-	public void setModel(ModelData model) {
-		this.model = model;
-	}
-
-	/**
-	 * @return the id
-	 * @see #id
-	 */
-	public int getId() {
-		return id;
-	}
-
-	/**
-	 * @param id
-	 *          the id to set
-	 * @see #id
-	 */
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	/**
-	 * Adds {@link OverviewLink link } to {@link #links}.
-	 * 
-	 * @param oml
-	 *          object to add
-	 */
-	public void addLink(OverviewLink oml) {
-		links.add(oml);
-		oml.setOverviewImage(this);
-	}
-
-	/**
-	 * Creates a copy of the object.
-	 * 
-	 * @return copy of the object
-	 */
-	public OverviewImage copy() {
-		if (this.getClass() == OverviewImage.class) {
-			return new OverviewImage(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-}
+package lcsb.mapviewer.model.map;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.model.ModelData;
+
+/**
+ * This class describes single image that overview the model. Images can create
+ * hierarchical structure via {@link OverviewLink} (link can point to another
+ * image). The idea is to have set of images that nicely represent biology and
+ * map it into map via {@link OverviewModelLink}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@Table(name = "overview_image_table")
+public class OverviewImage implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long	 serialVersionUID	= 1L;
+
+	/**
+	 * Unique database identifier.
+	 */
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "idDb", unique = true, nullable = false)
+	private int								 id;
+
+	/**
+	 * The description belongs to this model. It doesn't mean that {@link #links}
+	 * will point to this model. Links can also point to submodel.
+	 */
+	@ManyToOne(fetch = FetchType.LAZY, optional = false)
+	private ModelData					 model;
+
+	/**
+	 * Name of the file in file system that reresent this overview image.
+	 */
+	private String						 filename;
+
+	/**
+	 * Width of the image.
+	 */
+	private Integer						 width;
+
+	/**
+	 * Height of the image.
+	 */
+	private Integer						 height;
+
+	/**
+	 * List of links that should redirect from this image. They can refer to
+	 * another {@link OverviewImage} or {@link ModelData Model}.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(fetch = FetchType.EAGER, mappedBy = "overviewImage", orphanRemoval = true)
+	@OrderBy("id")
+	private List<OverviewLink> links						= new ArrayList<OverviewLink>();
+
+	/**
+	 * Default constructor.
+	 */
+	public OverviewImage() {
+
+	}
+
+	/**
+	 * Default constructor with original {@link OverviewImage} as a source of
+	 * data.
+	 * 
+	 * @param overviewImage
+	 *          original {@link OverviewImage}
+	 */
+	public OverviewImage(OverviewImage overviewImage) {
+		this.setId(overviewImage.getId());
+		this.setModel(overviewImage.getModel());
+		this.setFilename(overviewImage.getFilename());
+		this.setWidth(overviewImage.getWidth());
+		this.setHeight(overviewImage.getHeight());
+		for (OverviewLink ol : overviewImage.getLinks()) {
+			this.addLink(ol.copy());
+		}
+	}
+
+	/**
+	 * @return the filename
+	 * @see #filename
+	 */
+	public String getFilename() {
+		return filename;
+	}
+
+	/**
+	 * @param filename
+	 *          the filename to set
+	 * @see #filename
+	 */
+	public void setFilename(String filename) {
+		this.filename = filename;
+	}
+
+	/**
+	 * @return the width
+	 * @see #width
+	 */
+	public Integer getWidth() {
+		return width;
+	}
+
+	/**
+	 * @param width
+	 *          the width to set
+	 * @see #width
+	 */
+	public void setWidth(Integer width) {
+		this.width = width;
+	}
+
+	/**
+	 * @return the height
+	 * @see #height
+	 */
+	public Integer getHeight() {
+		return height;
+	}
+
+	/**
+	 * @param height
+	 *          the height to set
+	 * @see #height
+	 */
+	public void setHeight(Integer height) {
+		this.height = height;
+	}
+
+	/**
+	 * @return the links
+	 * @see #links
+	 */
+	public List<OverviewLink> getLinks() {
+		return links;
+	}
+
+	/**
+	 * @param links
+	 *          the links to set
+	 * @see #links
+	 */
+	public void setLinks(List<OverviewLink> links) {
+		this.links = links;
+	}
+
+	/**
+	 * @return the model
+	 * @see #model
+	 */
+	public ModelData getModel() {
+		return model;
+	}
+
+	/**
+	 * @param model
+	 *          the model to set
+	 * @see #model
+	 */
+	public void setModel(ModelData model) {
+		this.model = model;
+	}
+
+	/**
+	 * @return the id
+	 * @see #id
+	 */
+	public int getId() {
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *          the id to set
+	 * @see #id
+	 */
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	/**
+	 * Adds {@link OverviewLink link } to {@link #links}.
+	 * 
+	 * @param oml
+	 *          object to add
+	 */
+	public void addLink(OverviewLink oml) {
+		links.add(oml);
+		oml.setOverviewImage(this);
+	}
+
+	/**
+	 * Creates a copy of the object.
+	 * 
+	 * @return copy of the object
+	 */
+	public OverviewImage copy() {
+		if (this.getClass() == OverviewImage.class) {
+			return new OverviewImage(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/OverviewImageLink.java b/model/src/main/java/lcsb/mapviewer/model/map/OverviewImageLink.java
index c3a577f376..4610de7b60 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/OverviewImageLink.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/OverviewImageLink.java
@@ -1,77 +1,77 @@
-package lcsb.mapviewer.model.map;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.ManyToOne;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * Link used in {@link OverviewImage parent OverviewImage} to link it to
- * {@link OverviewImage child OverviewImage}.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("IMAGE_LINK")
-public class OverviewImageLink extends OverviewLink {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Child {@link OverviewImage} that can be reached via this link.
-	 */
-	@ManyToOne(fetch = FetchType.LAZY, optional = false)
-	private OverviewImage			linkedOverviewImage;
-
-	/**
-	 * Default constructor that copies object from the parameter.
-	 * 
-	 * @param original
-	 *          original object to be copied
-	 */
-	public OverviewImageLink(OverviewImageLink original) {
-		super(original);
-		this.linkedOverviewImage = original.linkedOverviewImage;
-
-	}
-
-	/**
-	 * DEfault constructor.
-	 */
-	public OverviewImageLink() {
-		super();
-	}
-
-	/**
-	 * @return the linkedOverviewImage
-	 * @see #linkedOverviewImage
-	 */
-	public OverviewImage getLinkedOverviewImage() {
-		return linkedOverviewImage;
-	}
-
-	/**
-	 * @param linkedOverviewImage
-	 *          the linkedOverviewImage to set
-	 * @see #linkedOverviewImage
-	 */
-	public void setLinkedOverviewImage(OverviewImage linkedOverviewImage) {
-		this.linkedOverviewImage = linkedOverviewImage;
-	}
-
-	@Override
-	public OverviewImageLink copy() {
-		if (this.getClass() == OverviewImageLink.class) {
-			return new OverviewImageLink(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.ManyToOne;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * Link used in {@link OverviewImage parent OverviewImage} to link it to
+ * {@link OverviewImage child OverviewImage}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("IMAGE_LINK")
+public class OverviewImageLink extends OverviewLink {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Child {@link OverviewImage} that can be reached via this link.
+	 */
+	@ManyToOne(fetch = FetchType.LAZY, optional = false)
+	private OverviewImage			linkedOverviewImage;
+
+	/**
+	 * Default constructor that copies object from the parameter.
+	 * 
+	 * @param original
+	 *          original object to be copied
+	 */
+	public OverviewImageLink(OverviewImageLink original) {
+		super(original);
+		this.linkedOverviewImage = original.linkedOverviewImage;
+
+	}
+
+	/**
+	 * DEfault constructor.
+	 */
+	public OverviewImageLink() {
+		super();
+	}
+
+	/**
+	 * @return the linkedOverviewImage
+	 * @see #linkedOverviewImage
+	 */
+	public OverviewImage getLinkedOverviewImage() {
+		return linkedOverviewImage;
+	}
+
+	/**
+	 * @param linkedOverviewImage
+	 *          the linkedOverviewImage to set
+	 * @see #linkedOverviewImage
+	 */
+	public void setLinkedOverviewImage(OverviewImage linkedOverviewImage) {
+		this.linkedOverviewImage = linkedOverviewImage;
+	}
+
+	@Override
+	public OverviewImageLink copy() {
+		if (this.getClass() == OverviewImageLink.class) {
+			return new OverviewImageLink(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/OverviewLinkComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/OverviewLinkComparator.java
index 14619188b4..a81a46c0e6 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/OverviewLinkComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/OverviewLinkComparator.java
@@ -1,109 +1,109 @@
-package lcsb.mapviewer.model.map;
-
-import java.util.Comparator;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.StringComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * This class implements comparator interface for {@link OverviewLink}.
- * 
- * @author Piotr Gawron
- * 
- */
-public class OverviewLinkComparator implements Comparator<OverviewLink> {
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger								logger = Logger.getLogger(OverviewLinkComparator.class);
-
-	/**
-	 * Comparator used to compare {@link OverviewModelLink} objects.
-	 */
-	private OverviewModelLinkComparator	overviewModelLinkComparator;
-
-	/**
-	 * Comparator used to compare {@link OverviewImageLink} objects.
-	 */
-	private OverviewImageLinkComparator	overviewImageLinkComparator;
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	@SuppressWarnings("unused")
-	private double											epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public OverviewLinkComparator(double epsilon) {
-		this.epsilon = epsilon;
-		overviewImageLinkComparator = new OverviewImageLinkComparator(epsilon);
-		overviewModelLinkComparator = new OverviewModelLinkComparator(epsilon);
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public OverviewLinkComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(OverviewLink arg0, OverviewLink arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0 instanceof OverviewImageLink) {
-				return overviewImageLinkComparator.compare((OverviewImageLink) arg0, (OverviewImageLink) arg1);
-			} else if (arg0 instanceof OverviewModelLink) {
-				return overviewModelLinkComparator.compare((OverviewModelLink) arg0, (OverviewModelLink) arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			logger.debug("class different: " + arg0.getClass() + ", " + arg1.getClass());
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in
-	 * {@link OverviewImage} class in inheritence tree.
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	public int internalCompare(OverviewLink arg0, OverviewLink arg1) {
-
-		StringComparator stringComparator = new StringComparator();
-
-		if (stringComparator.compare(arg0.getPolygon(), arg1.getPolygon()) != 0) {
-			logger.debug("polygon different: " + arg0.getPolygon() + ", " + arg1.getPolygon());
-			return stringComparator.compare(arg0.getPolygon(), arg1.getPolygon());
-		}
-
-		return 0;
-
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.StringComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * This class implements comparator interface for {@link OverviewLink}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class OverviewLinkComparator implements Comparator<OverviewLink> {
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger								logger = Logger.getLogger(OverviewLinkComparator.class);
+
+	/**
+	 * Comparator used to compare {@link OverviewModelLink} objects.
+	 */
+	private OverviewModelLinkComparator	overviewModelLinkComparator;
+
+	/**
+	 * Comparator used to compare {@link OverviewImageLink} objects.
+	 */
+	private OverviewImageLinkComparator	overviewImageLinkComparator;
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	@SuppressWarnings("unused")
+	private double											epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public OverviewLinkComparator(double epsilon) {
+		this.epsilon = epsilon;
+		overviewImageLinkComparator = new OverviewImageLinkComparator(epsilon);
+		overviewModelLinkComparator = new OverviewModelLinkComparator(epsilon);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public OverviewLinkComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(OverviewLink arg0, OverviewLink arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0 instanceof OverviewImageLink) {
+				return overviewImageLinkComparator.compare((OverviewImageLink) arg0, (OverviewImageLink) arg1);
+			} else if (arg0 instanceof OverviewModelLink) {
+				return overviewModelLinkComparator.compare((OverviewModelLink) arg0, (OverviewModelLink) arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			logger.debug("class different: " + arg0.getClass() + ", " + arg1.getClass());
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in
+	 * {@link OverviewImage} class in inheritence tree.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	public int internalCompare(OverviewLink arg0, OverviewLink arg1) {
+
+		StringComparator stringComparator = new StringComparator();
+
+		if (stringComparator.compare(arg0.getPolygon(), arg1.getPolygon()) != 0) {
+			logger.debug("polygon different: " + arg0.getPolygon() + ", " + arg1.getPolygon());
+			return stringComparator.compare(arg0.getPolygon(), arg1.getPolygon());
+		}
+
+		return 0;
+
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/OverviewModelLink.java b/model/src/main/java/lcsb/mapviewer/model/map/OverviewModelLink.java
index 985789755f..60589e09f1 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/OverviewModelLink.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/OverviewModelLink.java
@@ -1,185 +1,185 @@
-package lcsb.mapviewer.model.map;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.ManyToOne;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-
-/**
- * Link used in {@link OverviewImage parent OverviewImage} to link it to
- * {@link ModelData (sub)model}.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("MODEL_LINK")
-public class OverviewModelLink extends OverviewLink {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Model to which this links is going.
-	 */
-	@ManyToOne(fetch = FetchType.LAZY, optional = false)
-	private ModelData					linkedModel;
-
-	/**
-	 * Zoom level at which model should be opened.
-	 */
-	private Integer						zoomLevel;
-
-	/**
-	 * X coordinate on {@link #linkedModel} where this links point to.
-	 */
-	private Integer						xCoord;
-
-	/**
-	 * Y coordinate on {@link #linkedModel} where this links point to.
-	 */
-	private Integer						yCoord;
-
-	/**
-	 * Default constructor that creates copy of the parameter object.
-	 * 
-	 * @param original
-	 *          origianl object that will be copied to this one
-	 */
-	public OverviewModelLink(OverviewModelLink original) {
-		super(original);
-		this.linkedModel = original.linkedModel;
-		this.xCoord = original.xCoord;
-		this.yCoord = original.yCoord;
-		this.zoomLevel = original.zoomLevel;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public OverviewModelLink() {
-		super();
-	}
-
-	/**
-	 * @return the model
-	 * @see #linkedModel
-	 */
-	public Model getLinkedModel() {
-		if (linkedModel != null) {
-			return linkedModel.getModel();
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 * @param model
-	 *          the model to set
-	 * @see #linkedModel
-	 */
-	public void setLinkedModel(Model model) {
-		if (model != null) {
-			this.linkedModel = model.getModelData();
-		} else {
-			this.linkedModel = null;
-		}
-	}
-
-	@Override
-	public OverviewModelLink copy() {
-		if (this.getClass() == OverviewModelLink.class) {
-			return new OverviewModelLink(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	/**
-	 * @return the zoomLevel
-	 * @see #zoomLevel
-	 */
-	public Integer getZoomLevel() {
-		return zoomLevel;
-	}
-
-	/**
-	 * @param zoomLevel
-	 *          the zoomLevel to set
-	 * @see #zoomLevel
-	 */
-	public void setZoomLevel(Integer zoomLevel) {
-		this.zoomLevel = zoomLevel;
-	}
-
-	/**
-	 * @return the xCoord
-	 * @see #xCoord
-	 */
-	public Integer getxCoord() {
-		return xCoord;
-	}
-
-	/**
-	 * @param xCoord
-	 *          the xCoord to set
-	 * @see #xCoord
-	 */
-	public void setxCoord(Integer xCoord) {
-		this.xCoord = xCoord;
-	}
-
-	/**
-	 * @return the yCoord
-	 * @see #yCoord
-	 */
-	public Integer getyCoord() {
-		return yCoord;
-	}
-
-	/**
-	 * @param yCoord
-	 *          the yCoord to set
-	 * @see #yCoord
-	 */
-	public void setyCoord(Integer yCoord) {
-		this.yCoord = yCoord;
-	}
-
-	/**
-	 * Sets {@link #xCoord} value. Value will be trimmed to {@link Integer}.
-	 * 
-	 * @param value
-	 *          the xCoord to set
-	 * @see #xCoord
-	 */
-	public void setxCoord(Double value) {
-		if (value == null) {
-			this.xCoord = null;
-		} else {
-			this.xCoord = value.intValue();
-		}
-	}
-
-	/**
-	 * Sets {@link #yCoord} value. Value will be trimmed to {@link Integer}.
-	 * 
-	 * @param value
-	 *          the yCoord to set
-	 * @see #yCoord
-	 */
-	public void setyCoord(Double value) {
-		if (value == null) {
-			this.yCoord = null;
-		} else {
-			this.yCoord = value.intValue();
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.ManyToOne;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+
+/**
+ * Link used in {@link OverviewImage parent OverviewImage} to link it to
+ * {@link ModelData (sub)model}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("MODEL_LINK")
+public class OverviewModelLink extends OverviewLink {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Model to which this links is going.
+	 */
+	@ManyToOne(fetch = FetchType.LAZY, optional = false)
+	private ModelData					linkedModel;
+
+	/**
+	 * Zoom level at which model should be opened.
+	 */
+	private Integer						zoomLevel;
+
+	/**
+	 * X coordinate on {@link #linkedModel} where this links point to.
+	 */
+	private Integer						xCoord;
+
+	/**
+	 * Y coordinate on {@link #linkedModel} where this links point to.
+	 */
+	private Integer						yCoord;
+
+	/**
+	 * Default constructor that creates copy of the parameter object.
+	 * 
+	 * @param original
+	 *          origianl object that will be copied to this one
+	 */
+	public OverviewModelLink(OverviewModelLink original) {
+		super(original);
+		this.linkedModel = original.linkedModel;
+		this.xCoord = original.xCoord;
+		this.yCoord = original.yCoord;
+		this.zoomLevel = original.zoomLevel;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public OverviewModelLink() {
+		super();
+	}
+
+	/**
+	 * @return the model
+	 * @see #linkedModel
+	 */
+	public Model getLinkedModel() {
+		if (linkedModel != null) {
+			return linkedModel.getModel();
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * @param model
+	 *          the model to set
+	 * @see #linkedModel
+	 */
+	public void setLinkedModel(Model model) {
+		if (model != null) {
+			this.linkedModel = model.getModelData();
+		} else {
+			this.linkedModel = null;
+		}
+	}
+
+	@Override
+	public OverviewModelLink copy() {
+		if (this.getClass() == OverviewModelLink.class) {
+			return new OverviewModelLink(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	/**
+	 * @return the zoomLevel
+	 * @see #zoomLevel
+	 */
+	public Integer getZoomLevel() {
+		return zoomLevel;
+	}
+
+	/**
+	 * @param zoomLevel
+	 *          the zoomLevel to set
+	 * @see #zoomLevel
+	 */
+	public void setZoomLevel(Integer zoomLevel) {
+		this.zoomLevel = zoomLevel;
+	}
+
+	/**
+	 * @return the xCoord
+	 * @see #xCoord
+	 */
+	public Integer getxCoord() {
+		return xCoord;
+	}
+
+	/**
+	 * @param xCoord
+	 *          the xCoord to set
+	 * @see #xCoord
+	 */
+	public void setxCoord(Integer xCoord) {
+		this.xCoord = xCoord;
+	}
+
+	/**
+	 * @return the yCoord
+	 * @see #yCoord
+	 */
+	public Integer getyCoord() {
+		return yCoord;
+	}
+
+	/**
+	 * @param yCoord
+	 *          the yCoord to set
+	 * @see #yCoord
+	 */
+	public void setyCoord(Integer yCoord) {
+		this.yCoord = yCoord;
+	}
+
+	/**
+	 * Sets {@link #xCoord} value. Value will be trimmed to {@link Integer}.
+	 * 
+	 * @param value
+	 *          the xCoord to set
+	 * @see #xCoord
+	 */
+	public void setxCoord(Double value) {
+		if (value == null) {
+			this.xCoord = null;
+		} else {
+			this.xCoord = value.intValue();
+		}
+	}
+
+	/**
+	 * Sets {@link #yCoord} value. Value will be trimmed to {@link Integer}.
+	 * 
+	 * @param value
+	 *          the yCoord to set
+	 * @see #yCoord
+	 */
+	public void setyCoord(Double value) {
+		if (value == null) {
+			this.yCoord = null;
+		} else {
+			this.yCoord = value.intValue();
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/OverviewSearchLink.java b/model/src/main/java/lcsb/mapviewer/model/map/OverviewSearchLink.java
index 9d12d5a7d4..cfe336aeb8 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/OverviewSearchLink.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/OverviewSearchLink.java
@@ -1,74 +1,74 @@
-package lcsb.mapviewer.model.map;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * Link used in {@link OverviewImage parent OverviewImage} to link it to
- * {@link OverviewImage child OverviewImage}.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("SEARCH_LINK")
-public class OverviewSearchLink extends OverviewLink {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Results of this search query in the map will be a target for this link.
-	 */
-	private String						query;
-
-	/**
-	 * Default constructor that copies object from the parameter.
-	 * 
-	 * @param original
-	 *          original object to be copied
-	 */
-	public OverviewSearchLink(OverviewSearchLink original) {
-		super(original);
-		this.query = original.query;
-
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public OverviewSearchLink() {
-		super();
-	}
-
-	@Override
-	public OverviewSearchLink copy() {
-		if (this.getClass() == OverviewSearchLink.class) {
-			return new OverviewSearchLink(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	/**
-	 * @return the query
-	 * @see #query
-	 */
-	public String getQuery() {
-		return query;
-	}
-
-	/**
-	 * @param query
-	 *          the query to set
-	 * @see #query
-	 */
-	public void setQuery(String query) {
-		this.query = query;
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * Link used in {@link OverviewImage parent OverviewImage} to link it to
+ * {@link OverviewImage child OverviewImage}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("SEARCH_LINK")
+public class OverviewSearchLink extends OverviewLink {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Results of this search query in the map will be a target for this link.
+	 */
+	private String						query;
+
+	/**
+	 * Default constructor that copies object from the parameter.
+	 * 
+	 * @param original
+	 *          original object to be copied
+	 */
+	public OverviewSearchLink(OverviewSearchLink original) {
+		super(original);
+		this.query = original.query;
+
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public OverviewSearchLink() {
+		super();
+	}
+
+	@Override
+	public OverviewSearchLink copy() {
+		if (this.getClass() == OverviewSearchLink.class) {
+			return new OverviewSearchLink(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	/**
+	 * @return the query
+	 * @see #query
+	 */
+	public String getQuery() {
+		return query;
+	}
+
+	/**
+	 * @param query
+	 *          the query to set
+	 * @see #query
+	 */
+	public void setQuery(String query) {
+		this.query = query;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/AntisenseRnaAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/AntisenseRnaAlias.java
new file mode 100644
index 0000000000..57f0229d02
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/AntisenseRnaAlias.java
@@ -0,0 +1,38 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+
+@Entity
+@DiscriminatorValue("ANTISENSE_RNA_ALIAS")
+public class AntisenseRnaAlias extends SpeciesAlias {
+
+	AntisenseRnaAlias() {
+	}
+
+	public AntisenseRnaAlias(AntisenseRna antisenseRna) {
+		super(antisenseRna);
+	}
+
+	public AntisenseRnaAlias(String aliasId, AntisenseRna antisenseRna) {
+		super(antisenseRna);
+		super.setAliasId(aliasId);
+	}
+
+	public AntisenseRnaAlias(AntisenseRnaAlias original) {
+		super(original);
+	}
+
+	@Override
+	public AntisenseRnaAlias copy() {
+		if (this.getClass() == AntisenseRnaAlias.class) {
+			return new AntisenseRnaAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/AntisenseRnaAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/AntisenseRnaAliasComparator.java
new file mode 100644
index 0000000000..5cdf02b8f7
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/AntisenseRnaAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class AntisenseRnaAliasComparator implements Comparator<AntisenseRnaAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(AntisenseRnaAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public AntisenseRnaAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public AntisenseRnaAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(AntisenseRnaAlias arg0, AntisenseRnaAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(AntisenseRnaAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in AntisenseRnaAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(AntisenseRnaAlias arg0, AntisenseRnaAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ChemicalAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ChemicalAlias.java
new file mode 100644
index 0000000000..71b9226885
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ChemicalAlias.java
@@ -0,0 +1,23 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.model.map.species.Chemical;
+
+@Entity
+@DiscriminatorValue("CHEMICAL_ALIAS")
+public abstract class ChemicalAlias extends SpeciesAlias{
+
+	ChemicalAlias() {
+	}
+
+	public ChemicalAlias(Chemical chemical) {
+		super(chemical);
+	}
+
+	public ChemicalAlias(ChemicalAlias original) {
+		super(original);
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ChemicalAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ChemicalAliasComparator.java
new file mode 100644
index 0000000000..1f6a05bd8f
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ChemicalAliasComparator.java
@@ -0,0 +1,92 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class ChemicalAliasComparator implements Comparator<ChemicalAlias> {
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger					logger = Logger.getLogger(ChemicalAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double								epsilon;
+
+	IonAliasComparator						ionAliasComparator;
+	SimpleMoleculeAliasComparator	simpleMoleculeAliasComparator;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public ChemicalAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+		ionAliasComparator = new IonAliasComparator(epsilon);
+		simpleMoleculeAliasComparator = new SimpleMoleculeAliasComparator(epsilon);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public ChemicalAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(ChemicalAlias arg0, ChemicalAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(ChemicalAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else if (arg0.getClass().equals(IonAlias.class)) {
+				return ionAliasComparator.compare((IonAlias) arg0, (IonAlias) arg1);
+			} else if (arg0.getClass().equals(SimpleMoleculeAlias.class)) {
+				return simpleMoleculeAliasComparator.compare((SimpleMoleculeAlias) arg0, (SimpleMoleculeAlias) arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in ChemicalAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	int internalCompare(ChemicalAlias arg0, ChemicalAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ComplexAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ComplexAlias.java
index dc151377aa..28b8bd9271 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ComplexAlias.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ComplexAlias.java
@@ -1,162 +1,161 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.OneToMany;
-
-import org.apache.log4j.Logger;
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-
-/**
- * Class that represents alias of a complex in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Complex Species Alias")
-public class ComplexAlias extends SpeciesAlias {
-
-	/**
-	 * 
-	 */
-	private static final long	 serialVersionUID	= 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger			 logger						= Logger.getLogger(ComplexAlias.class);
-
-	/**
-	 * List of aliases that are in this complex alias (only aliases that lies
-	 * there directly).
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(fetch = FetchType.EAGER, mappedBy = "complexAlias")
-	private List<SpeciesAlias> aliases					= new ArrayList<SpeciesAlias>();
-
-	/**
-	 * Default constructor.
-	 */
-	public ComplexAlias() {
-		super();
-	}
-
-	/**
-	 * Constructor that creates object initialized by the object given in the
-	 * parameter.
-	 * 
-	 * @param original
-	 *          original alias used for initialization
-	 */
-	public ComplexAlias(ComplexAlias original) {
-		super(original);
-
-		for (SpeciesAlias alias : original.getAliases()) {
-			addAlias(alias.copy());
-		}
-	}
-
-	/**
-	 * Constructor that creates alias with reference to species.
-	 * 
-	 * @param species
-	 *          rederence to this complex will be used by alias
-	 */
-	public ComplexAlias(ComplexSpecies species) {
-		this();
-		this.setSpecies(species);
-	}
-
-	/**
-	 * Constructor that creates complex alias with given alias id.
-	 * 
-	 * @param aliasId
-	 *          identifier of the alias
-	 */
-	public ComplexAlias(String aliasId) {
-		super(aliasId);
-	}
-
-	/**
-	 * Adds alias to the complex.
-	 * 
-	 * @param alias
-	 *          object to add
-	 */
-	public void addAlias(SpeciesAlias alias) {
-		boolean contains = false;
-		for (SpeciesAlias alias2 : aliases) {
-			if (alias.getAliasId().equals(alias2.getAliasId())) {
-				contains = true;
-			}
-
-		}
-		if (!contains) {
-			aliases.add(alias);
-			alias.setComplexAlias(this);
-		}
-	}
-
-	/**
-	 * Returns list of aliases.
-	 * 
-	 * @return list of aliases insied complexAlias.
-	 */
-	public List<SpeciesAlias> getAliases() {
-		return aliases;
-	}
-
-	/**
-	 * Returns list of all aliases that lies inside complex alias (direct and
-	 * undirect).
-	 * 
-	 * @return list of all aliases insied complex alias.
-	 */
-	public List<SpeciesAlias> getAllChildrenAliases() {
-		List<SpeciesAlias> result = new ArrayList<SpeciesAlias>();
-		result.addAll(aliases);
-		for (SpeciesAlias speciesAlias : aliases) {
-			if (speciesAlias instanceof ComplexAlias) {
-				result.addAll(((ComplexAlias) speciesAlias).getAllChildrenAliases());
-			}
-		}
-		return result;
-	}
-
-	@Override
-	public ComplexAlias copy() {
-		if (this.getClass() == ComplexAlias.class) {
-			return new ComplexAlias(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-
-	}
-
-	/**
-	 * Removes alias from the complex alias.
-	 * 
-	 * @param alias
-	 *          object to remove
-	 */
-	public void removeAlias(SpeciesAlias alias) {
-		aliases.remove(alias);
-		if (alias.getComplexAlias() != null) {
-			if (alias.getComplexAlias() == this) {
-				alias.setComplexAlias(null);
-			} else {
-				logger.warn("Removing element from complex that probably doesn't belong there");
-			}
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.OneToMany;
+
+import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+
+/**
+ * Class that represents alias of a complex in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Complex Species Alias")
+public class ComplexAlias extends SpeciesAlias {
+
+	/**
+	 * 
+	 */
+	private static final long	 serialVersionUID	= 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger			 logger						= Logger.getLogger(ComplexAlias.class);
+
+	/**
+	 * List of aliases that are in this complex alias (only aliases that lies
+	 * there directly).
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(fetch = FetchType.EAGER, mappedBy = "complexAlias")
+	private List<SpeciesAlias> aliases					= new ArrayList<SpeciesAlias>();
+
+	/**
+	 * Default constructor.
+	 */
+	ComplexAlias() {
+		super();
+	}
+
+	/**
+	 * Constructor that creates object initialized by the object given in the
+	 * parameter.
+	 * 
+	 * @param original
+	 *          original alias used for initialization
+	 */
+	public ComplexAlias(ComplexAlias original) {
+		super(original);
+
+		for (SpeciesAlias alias : original.getAliases()) {
+			addAlias(alias.copy());
+		}
+	}
+
+	/**
+	 * Constructor that creates alias with reference to species.
+	 * 
+	 * @param species
+	 *          rederence to this complex will be used by alias
+	 */
+	public ComplexAlias(ComplexSpecies species) {
+		super(species);
+	}
+
+	/**
+	 * Constructor that creates complex alias with given alias id.
+	 * 
+	 * @param aliasId
+	 *          identifier of the alias
+	 */
+	public ComplexAlias(String aliasId) {
+		super(aliasId);
+	}
+
+	/**
+	 * Adds alias to the complex.
+	 * 
+	 * @param alias
+	 *          object to add
+	 */
+	public void addAlias(SpeciesAlias alias) {
+		boolean contains = false;
+		for (SpeciesAlias alias2 : aliases) {
+			if (alias.getAliasId().equals(alias2.getAliasId())) {
+				contains = true;
+			}
+
+		}
+		if (!contains) {
+			aliases.add(alias);
+			alias.setComplexAlias(this);
+		}
+	}
+
+	/**
+	 * Returns list of aliases.
+	 * 
+	 * @return list of aliases insied complexAlias.
+	 */
+	public List<SpeciesAlias> getAliases() {
+		return aliases;
+	}
+
+	/**
+	 * Returns list of all aliases that lies inside complex alias (direct and
+	 * undirect).
+	 * 
+	 * @return list of all aliases insied complex alias.
+	 */
+	public List<SpeciesAlias> getAllChildrenAliases() {
+		List<SpeciesAlias> result = new ArrayList<SpeciesAlias>();
+		result.addAll(aliases);
+		for (SpeciesAlias speciesAlias : aliases) {
+			if (speciesAlias instanceof ComplexAlias) {
+				result.addAll(((ComplexAlias) speciesAlias).getAllChildrenAliases());
+			}
+		}
+		return result;
+	}
+
+	@Override
+	public ComplexAlias copy() {
+		if (this.getClass() == ComplexAlias.class) {
+			return new ComplexAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+
+	}
+
+	/**
+	 * Removes alias from the complex alias.
+	 * 
+	 * @param alias
+	 *          object to remove
+	 */
+	public void removeAlias(SpeciesAlias alias) {
+		aliases.remove(alias);
+		if (alias.getComplexAlias() != null) {
+			if (alias.getComplexAlias() == this) {
+				alias.setComplexAlias(null);
+			} else {
+				logger.warn("Removing element from complex that probably doesn't belong there");
+			}
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DegradedAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DegradedAlias.java
new file mode 100644
index 0000000000..49e3314da2
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DegradedAlias.java
@@ -0,0 +1,37 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.Degraded;
+
+@Entity
+@DiscriminatorValue("DEGRADED_ALIAS")
+public class DegradedAlias extends SpeciesAlias {
+	DegradedAlias() {
+	}
+
+	public DegradedAlias(Degraded degraded) {
+		super(degraded);
+	}
+
+	public DegradedAlias(DegradedAlias original) {
+		super(original);
+	}
+
+	public DegradedAlias(String aliasId, Degraded degraded) {
+		super(degraded);
+		super.setAliasId(aliasId);
+	}
+
+	@Override
+	public DegradedAlias copy() {
+		if (this.getClass() == DegradedAlias.class) {
+			return new DegradedAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DegradedAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DegradedAliasComparator.java
new file mode 100644
index 0000000000..a13c4e4340
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DegradedAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class DegradedAliasComparator implements Comparator<DegradedAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(DegradedAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public DegradedAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public DegradedAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(DegradedAlias arg0, DegradedAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(DegradedAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in DegradedAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(DegradedAlias arg0, DegradedAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DrugAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DrugAlias.java
new file mode 100644
index 0000000000..7575362e06
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DrugAlias.java
@@ -0,0 +1,31 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.Drug;
+
+@Entity
+@DiscriminatorValue("DRUG_ALIAS")
+public class DrugAlias extends SpeciesAlias {
+	DrugAlias() {
+	}
+
+	public DrugAlias(Drug drug) {
+		super(drug);
+	}
+
+	public DrugAlias(DrugAlias original) {
+		super(original);
+	}
+
+	@Override
+	public DrugAlias copy() {
+		if (this.getClass() == DrugAlias.class) {
+			return new DrugAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DrugAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DrugAliasComparator.java
new file mode 100644
index 0000000000..bd512689ee
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/DrugAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class DrugAliasComparator implements Comparator<DrugAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(DrugAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public DrugAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public DrugAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(DrugAlias arg0, DrugAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(DrugAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in DrugAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(DrugAlias arg0, DrugAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GeneAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GeneAlias.java
new file mode 100644
index 0000000000..ea4b97472c
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GeneAlias.java
@@ -0,0 +1,37 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.Gene;
+
+@Entity
+@DiscriminatorValue("GENE_ALIAS")
+public class GeneAlias extends SpeciesAlias {
+	GeneAlias() {
+	}
+
+	public GeneAlias(Gene gene) {
+		super(gene);
+	}
+
+	public GeneAlias(GeneAlias original) {
+		super(original);
+	}
+
+	public GeneAlias(String aliasId, Gene gene) {
+		super(gene);
+		super.setAliasId(aliasId);
+	}
+
+	@Override
+	public GeneAlias copy() {
+		if (this.getClass() == GeneAlias.class) {
+			return new GeneAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GeneAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GeneAliasComparator.java
new file mode 100644
index 0000000000..111f52eee1
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GeneAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class GeneAliasComparator implements Comparator<GeneAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(GeneAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public GeneAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public GeneAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(GeneAlias arg0, GeneAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(GeneAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in GeneAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(GeneAlias arg0, GeneAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GenericProteinAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GenericProteinAlias.java
new file mode 100644
index 0000000000..87a7bf2487
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GenericProteinAlias.java
@@ -0,0 +1,36 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+@Entity
+@DiscriminatorValue("GENERIC_PROTEIN_ALIAS")
+public class GenericProteinAlias extends ProteinAlias {
+	GenericProteinAlias() {
+	}
+
+	public GenericProteinAlias(GenericProtein genericProtein) {
+		super(genericProtein);
+	}
+
+	public GenericProteinAlias(String aliasId, GenericProtein genericProtein) {
+		super(aliasId, genericProtein);
+	}
+
+	public GenericProteinAlias(GenericProteinAlias original) {
+		super(original);
+	}
+
+	@Override
+	public GenericProteinAlias copy() {
+		if (this.getClass() == GenericProteinAlias.class) {
+			return new GenericProteinAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GenericProteinAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GenericProteinAliasComparator.java
new file mode 100644
index 0000000000..0b7f83b6e6
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/GenericProteinAliasComparator.java
@@ -0,0 +1,84 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class GenericProteinAliasComparator implements Comparator<GenericProteinAlias> {
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	 logger	= Logger.getLogger(GenericProteinAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				 epsilon;
+
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public GenericProteinAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public GenericProteinAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(GenericProteinAlias arg0, GenericProteinAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(GenericProteinAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in
+	 * {@link GenericProteinAlias} class in inheritence tree. By the design it
+	 * calls also comparator of the upper ({@link ProteinAlias}) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(GenericProteinAlias arg0, GenericProteinAlias arg1) {
+		ProteinAliasComparator proteinAliasComparator = new ProteinAliasComparator(epsilon);
+		int result = proteinAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonAlias.java
new file mode 100644
index 0000000000..b9a75360b6
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonAlias.java
@@ -0,0 +1,32 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.Ion;
+
+@Entity
+@DiscriminatorValue("ION_ALIAS")
+public class IonAlias extends ChemicalAlias {
+	IonAlias() {
+	}
+
+	public IonAlias(Ion ion) {
+		super(ion);
+	}
+
+	public IonAlias(IonAlias original) {
+		super(original);
+	}
+
+	@Override
+	public IonAlias copy() {
+		if (this.getClass() == IonAlias.class) {
+			return new IonAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonAliasComparator.java
new file mode 100644
index 0000000000..0372ac214f
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class IonAliasComparator implements Comparator<IonAlias> {
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(IonAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public IonAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public IonAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(IonAlias arg0, IonAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(IonAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in {@link IonAlias}
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper {@link ChemicalAlias} class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(IonAlias arg0, IonAlias arg1) {
+		ChemicalAliasComparator speciesAliasComparator = new ChemicalAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonChannelProteinAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonChannelProteinAlias.java
new file mode 100644
index 0000000000..b97b958c6a
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonChannelProteinAlias.java
@@ -0,0 +1,32 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.IonChannelProtein;
+
+@Entity
+@DiscriminatorValue("ION_CHANNEL_PROTEIN_ALIAS")
+public class IonChannelProteinAlias extends ProteinAlias {
+	IonChannelProteinAlias() {
+	}
+
+	public IonChannelProteinAlias(IonChannelProtein ionChannelProtein) {
+		super(ionChannelProtein);
+	}
+
+	public IonChannelProteinAlias(IonChannelProteinAlias original) {
+		super(original);
+	}
+
+	@Override
+	public IonChannelProteinAlias copy() {
+		if (this.getClass() == IonChannelProteinAlias.class) {
+			return new IonChannelProteinAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonChannelProteinAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonChannelProteinAliasComparator.java
new file mode 100644
index 0000000000..2a8c9de3e2
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/IonChannelProteinAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class IonChannelProteinAliasComparator implements Comparator<IonChannelProteinAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(IonChannelProteinAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public IonChannelProteinAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public IonChannelProteinAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(IonChannelProteinAlias arg0, IonChannelProteinAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(IonChannelProteinAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in IonChannelProteinAliasAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(IonChannelProteinAlias arg0, IonChannelProteinAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/PhenotypeAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/PhenotypeAlias.java
new file mode 100644
index 0000000000..9dbdc3a8bf
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/PhenotypeAlias.java
@@ -0,0 +1,32 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.Phenotype;
+
+@Entity
+@DiscriminatorValue("PHENTOYPE_ALIAS")
+public class PhenotypeAlias extends SpeciesAlias {
+	PhenotypeAlias() {
+	}
+
+	public PhenotypeAlias(Phenotype phenotype) {
+		super(phenotype);
+	}
+
+	public PhenotypeAlias(PhenotypeAlias original) {
+		super(original);
+	}
+
+	@Override
+	public PhenotypeAlias copy() {
+		if (this.getClass() == PhenotypeAlias.class) {
+			return new PhenotypeAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/PhenotypeAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/PhenotypeAliasComparator.java
new file mode 100644
index 0000000000..f4891b9942
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/PhenotypeAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class PhenotypeAliasComparator implements Comparator<PhenotypeAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(PhenotypeAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public PhenotypeAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public PhenotypeAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(PhenotypeAlias arg0, PhenotypeAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(PhenotypeAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in PhenotypeAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(PhenotypeAlias arg0, PhenotypeAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ProteinAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ProteinAlias.java
new file mode 100644
index 0000000000..f0c2676b8c
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ProteinAlias.java
@@ -0,0 +1,29 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+
+@Entity
+@DiscriminatorValue("PROTEIN_ALIAS")
+public abstract class ProteinAlias extends SpeciesAlias {
+	ProteinAlias() {
+	}
+
+	public ProteinAlias(String aliasId, Protein protein) {
+		super(protein);
+		this.setAliasId(aliasId);
+	}
+
+	public ProteinAlias(Protein protein) {
+		super(protein);
+	}
+
+	public ProteinAlias(ProteinAlias original) {
+		super(original);
+	}
+
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ProteinAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ProteinAliasComparator.java
new file mode 100644
index 0000000000..eb95e0f2a2
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ProteinAliasComparator.java
@@ -0,0 +1,100 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class ProteinAliasComparator implements Comparator<ProteinAlias> {
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger						 logger	= Logger.getLogger(ProteinAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double									 epsilon;
+
+	GenericProteinAliasComparator		 genericProteinAliasComparator;
+	IonChannelProteinAliasComparator ionChannelProteinAliasComparator;
+	ReceptorProteinAliasComparator	 receptorProteinAliasComparator;
+	TruncatedProteinAliasComparator	 truncatedProteinAliasComparator;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public ProteinAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+		genericProteinAliasComparator = new GenericProteinAliasComparator(epsilon);
+		ionChannelProteinAliasComparator = new IonChannelProteinAliasComparator(epsilon);
+		receptorProteinAliasComparator = new ReceptorProteinAliasComparator(epsilon);
+		truncatedProteinAliasComparator = new TruncatedProteinAliasComparator(epsilon);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public ProteinAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(ProteinAlias arg0, ProteinAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(ProteinAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else if (arg0.getClass().equals(GenericProteinAlias.class)) {
+				return genericProteinAliasComparator.compare((GenericProteinAlias) arg0, (GenericProteinAlias) arg1);
+			} else if (arg0.getClass().equals(IonChannelProteinAlias.class)) {
+				return ionChannelProteinAliasComparator.compare((IonChannelProteinAlias) arg0, (IonChannelProteinAlias) arg1);
+			} else if (arg0.getClass().equals(ReceptorProteinAlias.class)) {
+				return receptorProteinAliasComparator.compare((ReceptorProteinAlias) arg0, (ReceptorProteinAlias) arg1);
+			} else if (arg0.getClass().equals(TruncatedProteinAlias.class)) {
+				return truncatedProteinAliasComparator.compare((TruncatedProteinAlias) arg0, (TruncatedProteinAlias) arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in ProteinAlias class
+	 * in inheritence tree. By the design it calls also comparator of the upper
+	 * (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	int internalCompare(ProteinAlias arg0, ProteinAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ReceptorProteinAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ReceptorProteinAlias.java
new file mode 100644
index 0000000000..fe541a3214
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ReceptorProteinAlias.java
@@ -0,0 +1,32 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.ReceptorProtein;
+
+@Entity
+@DiscriminatorValue("RECEPTOR_PROTEIN_ALIAS")
+public class ReceptorProteinAlias extends ProteinAlias {
+	ReceptorProteinAlias() {
+	}
+
+	public ReceptorProteinAlias(ReceptorProtein receptorProtein) {
+		super(receptorProtein);
+	}
+
+	public ReceptorProteinAlias(ReceptorProteinAlias original) {
+		super(original);
+	}
+
+	@Override
+	public ReceptorProteinAlias copy() {
+		if (this.getClass() == ReceptorProteinAlias.class) {
+			return new ReceptorProteinAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ReceptorProteinAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ReceptorProteinAliasComparator.java
new file mode 100644
index 0000000000..d4e9d1432a
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/ReceptorProteinAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class ReceptorProteinAliasComparator implements Comparator<ReceptorProteinAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(ReceptorProteinAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public ReceptorProteinAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public ReceptorProteinAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(ReceptorProteinAlias arg0, ReceptorProteinAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(ReceptorProteinAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in ReceptorProteinAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(ReceptorProteinAlias arg0, ReceptorProteinAlias arg1) {
+		ProteinAliasComparator proteinAliasComparator = new ProteinAliasComparator(epsilon);
+		int result = proteinAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/RnaAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/RnaAlias.java
new file mode 100644
index 0000000000..869f819b4a
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/RnaAlias.java
@@ -0,0 +1,32 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.Rna;
+
+@Entity
+@DiscriminatorValue("RNA_ALIAS")
+public class RnaAlias extends SpeciesAlias {
+	RnaAlias() {
+	}
+
+	public RnaAlias(Rna rna) {
+		super(rna);
+	}
+
+	public RnaAlias(RnaAlias original) {
+		super(original);
+	}
+
+	@Override
+	public RnaAlias copy() {
+		if (this.getClass() == RnaAlias.class) {
+			return new RnaAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/RnaAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/RnaAliasComparator.java
new file mode 100644
index 0000000000..180425ff2f
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/RnaAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class RnaAliasComparator implements Comparator<RnaAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(RnaAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public RnaAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public RnaAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(RnaAlias arg0, RnaAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(RnaAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in RnaAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(RnaAlias arg0, RnaAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SimpleMoleculeAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SimpleMoleculeAlias.java
new file mode 100644
index 0000000000..0460b34328
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SimpleMoleculeAlias.java
@@ -0,0 +1,37 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+
+@Entity
+@DiscriminatorValue("SIMPLE_MOLECULE_ALIAS")
+public class SimpleMoleculeAlias extends ChemicalAlias {
+	SimpleMoleculeAlias() {
+	}
+
+	public SimpleMoleculeAlias(SimpleMolecule simpleMolecule) {
+		super(simpleMolecule);
+	}
+
+	public SimpleMoleculeAlias(SimpleMoleculeAlias original) {
+		super(original);
+	}
+
+	public SimpleMoleculeAlias(String aliasId, SimpleMolecule species) {
+		super(species);
+		super.setAliasId(aliasId);
+	}
+
+	@Override
+	public SimpleMoleculeAlias copy() {
+		if (this.getClass() == SimpleMoleculeAlias.class) {
+			return new SimpleMoleculeAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SimpleMoleculeAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SimpleMoleculeAliasComparator.java
new file mode 100644
index 0000000000..39ddf57491
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SimpleMoleculeAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class SimpleMoleculeAliasComparator implements Comparator<SimpleMoleculeAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(SimpleMoleculeAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public SimpleMoleculeAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public SimpleMoleculeAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(SimpleMoleculeAlias arg0, SimpleMoleculeAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(SimpleMoleculeAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in SimpleMoleculeAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(SimpleMoleculeAlias arg0, SimpleMoleculeAlias arg1) {
+		ChemicalAliasComparator chemicalAliasComparator = new ChemicalAliasComparator(epsilon);
+		int result = chemicalAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAlias.java
index f89de48388..e5e292df6e 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAlias.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAlias.java
@@ -1,287 +1,327 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-
-import org.apache.log4j.Logger;
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.reaction.ReactionNode;
-import lcsb.mapviewer.model.map.species.Species;
-
-/**
- * {@link Alias} structure used for representing {@link Species}.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Species Alias")
-public class SpeciesAlias extends Alias {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger			logger					 = Logger.getLogger(SpeciesAlias.class);
-
-	/**
-	 * Is the alias active.
-	 */
-	private Boolean						activity;
-
-	/**
-	 * Width of the alias border.
-	 */
-	private Double						lineWidth;
-
-	/**
-	 * State of the alias visualization (should the inside be presented in details
-	 * or not). TODO this should be transformed into enum
-	 */
-	private String						state;
-
-	/**
-	 * State (free text describing alias in some way) of the alias is split into
-	 * {@link #aliasStatePrefix prefix} and {@link #aliasStateLabel label}. This
-	 * value represent the first part of the state.
-	 */
-	private String						aliasStatePrefix;
-
-	/**
-	 * State (free text describing alias in some way) of the alias is split into
-	 * {@link #aliasStatePrefix prefix} and {@link #aliasStateLabel label}. This
-	 * value represent the second part of the state.
-	 */
-	private String						aliasStateLabel;
-
-	/**
-	 * Complex alias to which this alias belongs to. Null if such complex alias
-	 * doesn't exist.
-	 */
-	@ManyToOne
-	@Cascade({ CascadeType.ALL })
-	@JoinColumn(name = "idComplexAliasDb")
-	private ComplexAlias			complexAlias;
-
-	/**
-	 * List of reaction nodes that point to this alias.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(fetch = FetchType.EAGER, mappedBy = "alias", orphanRemoval = true)
-	private Set<ReactionNode>	node						 = new HashSet<ReactionNode>();
-
-	/**
-	 * Cunstructor that set alias identifier.
-	 * 
-	 * @param aliasId
-	 *          {@link Alias#aliasId}
-	 */
-	public SpeciesAlias(String aliasId) {
-		this();
-		setAliasId(aliasId);
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public SpeciesAlias() {
-		super();
-		activity = false;
-		lineWidth = 1.0;
-		state = "usual";
-	}
-
-	/**
-	 * Constructor with species to which alias will refer.
-	 * 
-	 * @param species
-	 *          {@link #species}
-	 */
-	public SpeciesAlias(Species species) {
-		this();
-		this.setSpecies(species);
-	}
-
-	/**
-	 * Constructor that initializes data with the information given in the
-	 * parameter.
-	 * 
-	 * @param alias
-	 *          object from which data will be initialized
-	 */
-	public SpeciesAlias(SpeciesAlias alias) {
-		super(alias);
-		setSpecies(alias.getSpecies());
-		activity = alias.getActivity();
-		lineWidth = alias.getLineWidth();
-		state = alias.getState();
-
-		complexAlias = alias.getComplexAlias();
-		aliasStateLabel = alias.getAliasStateLabel();
-		aliasStatePrefix = alias.getAliasStatePrefix();
-
-		// don't copy reaction nodes
-	}
-
-	@Override
-	public SpeciesAlias copy() {
-		if (this.getClass() == SpeciesAlias.class) {
-			return new SpeciesAlias(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-
-	}
-
-	/**
-	 * @return the species
-	 * @see #species
-	 */
-	public Species getSpecies() {
-		return (Species) getElement();
-	}
-
-	/**
-	 * @param species
-	 *          the species to set
-	 * @see #species
-	 */
-	public void setSpecies(Species species) {
-		setElement(species);
-	}
-
-	/**
-	 * @return the activity
-	 * @see #activity
-	 */
-	public Boolean getActivity() {
-		return activity;
-	}
-
-	/**
-	 * @param activity
-	 *          the activity to set
-	 * @see #activity
-	 */
-	public void setActivity(Boolean activity) {
-		this.activity = activity;
-	}
-
-	/**
-	 * @return the lineWidth
-	 * @see #lineWidth
-	 */
-	public Double getLineWidth() {
-		return lineWidth;
-	}
-
-	/**
-	 * @param lineWidth
-	 *          the lineWidth to set
-	 * @see #lineWidth
-	 */
-	public void setLineWidth(Double lineWidth) {
-		this.lineWidth = lineWidth;
-	}
-
-	/**
-	 * @return the state
-	 * @see #state
-	 */
-	public String getState() {
-		return state;
-	}
-
-	/**
-	 * @param state
-	 *          the state to set
-	 * @see #state
-	 */
-	public void setState(String state) {
-		this.state = state;
-	}
-
-	/**
-	 * @return the complexAlias
-	 * @see #complexAlias
-	 */
-	public ComplexAlias getComplexAlias() {
-		return complexAlias;
-	}
-
-	/**
-	 * @param complexAlias
-	 *          the complexAlias to set
-	 * @see #complexAlias
-	 */
-	public void setComplexAlias(ComplexAlias complexAlias) {
-		this.complexAlias = complexAlias;
-	}
-
-	/**
-	 * @return the node
-	 * @see #node
-	 */
-	public Set<ReactionNode> getNode() {
-		return node;
-	}
-
-	/**
-	 * @param node
-	 *          the node to set
-	 * @see #node
-	 */
-	public void setNode(Set<ReactionNode> node) {
-		this.node = node;
-	}
-
-	/**
-	 * @return the aliasStatePrefix
-	 * @see #aliasStatePrefix
-	 */
-	public String getAliasStatePrefix() {
-		return aliasStatePrefix;
-	}
-
-	/**
-	 * @param aliasStatePrefix
-	 *          the aliasStatePrefix to set
-	 * @see #aliasStatePrefix
-	 */
-	public void setAliasStatePrefix(String aliasStatePrefix) {
-		this.aliasStatePrefix = aliasStatePrefix;
-	}
-
-	/**
-	 * @return the aliasStateLabel
-	 * @see #aliasStateLabel
-	 */
-	public String getAliasStateLabel() {
-		return aliasStateLabel;
-	}
-
-	/**
-	 * @param aliasStateLabel
-	 *          the aliasStateLabel to set
-	 * @see #aliasStateLabel
-	 */
-	public void setAliasStateLabel(String aliasStateLabel) {
-		this.aliasStateLabel = aliasStateLabel;
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+
+import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.reaction.ReactionNode;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Degraded;
+import lcsb.mapviewer.model.map.species.Drug;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Ion;
+import lcsb.mapviewer.model.map.species.IonChannelProtein;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.ReceptorProtein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.TruncatedProtein;
+import lcsb.mapviewer.model.map.species.Unknown;
+
+/**
+ * {@link Alias} structure used for representing {@link Species}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Species Alias")
+public abstract class SpeciesAlias extends Alias {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger			logger					 = Logger.getLogger(SpeciesAlias.class);
+
+	/**
+	 * Is the alias active.
+	 */
+	private Boolean						activity;
+
+	/**
+	 * Width of the alias border.
+	 */
+	private Double						lineWidth;
+
+	/**
+	 * State of the alias visualization (should the inside be presented in details
+	 * or not). TODO this should be transformed into enum
+	 */
+	private String						state;
+
+	/**
+	 * State (free text describing alias in some way) of the alias is split into
+	 * {@link #aliasStatePrefix prefix} and {@link #aliasStateLabel label}. This
+	 * value represent the first part of the state.
+	 */
+	private String						aliasStatePrefix;
+
+	/**
+	 * State (free text describing alias in some way) of the alias is split into
+	 * {@link #aliasStatePrefix prefix} and {@link #aliasStateLabel label}. This
+	 * value represent the second part of the state.
+	 */
+	private String						aliasStateLabel;
+
+	/**
+	 * Complex alias to which this alias belongs to. Null if such complex alias
+	 * doesn't exist.
+	 */
+	@ManyToOne
+	@Cascade({ CascadeType.ALL })
+	@JoinColumn(name = "idComplexAliasDb")
+	private ComplexAlias			complexAlias;
+
+	/**
+	 * List of reaction nodes that point to this alias.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(fetch = FetchType.EAGER, mappedBy = "alias", orphanRemoval = true)
+	private Set<ReactionNode>	node						 = new HashSet<ReactionNode>();
+
+	/**
+	 * Cunstructor that set alias identifier.
+	 * 
+	 * @param aliasId
+	 *          {@link Alias#aliasId}
+	 */
+	public SpeciesAlias(String aliasId) {
+		this();
+		setAliasId(aliasId);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public SpeciesAlias() {
+		super();
+		activity = false;
+		lineWidth = 1.0;
+		state = "usual";
+	}
+
+	/**
+	 * Constructor with species to which alias will refer.
+	 * 
+	 * @param species
+	 *          {@link #species}
+	 */
+	public SpeciesAlias(Species species) {
+		this();
+		this.setSpecies(species);
+	}
+
+	/**
+	 * Constructor that initializes data with the information given in the
+	 * parameter.
+	 * 
+	 * @param alias
+	 *          object from which data will be initialized
+	 */
+	public SpeciesAlias(SpeciesAlias alias) {
+		super(alias);
+		setSpecies(alias.getSpecies());
+		activity = alias.getActivity();
+		lineWidth = alias.getLineWidth();
+		state = alias.getState();
+
+		complexAlias = alias.getComplexAlias();
+		aliasStateLabel = alias.getAliasStateLabel();
+		aliasStatePrefix = alias.getAliasStatePrefix();
+
+		// don't copy reaction nodes
+	}
+
+	/**
+	 * @return the species
+	 * @see #species
+	 */
+	public Species getSpecies() {
+		return (Species) getElement();
+	}
+
+	/**
+	 * @param species
+	 *          the species to set
+	 * @see #species
+	 */
+	public void setSpecies(Species species) {
+		setElement(species);
+	}
+
+	/**
+	 * @return the activity
+	 * @see #activity
+	 */
+	public Boolean getActivity() {
+		return activity;
+	}
+
+	/**
+	 * @param activity
+	 *          the activity to set
+	 * @see #activity
+	 */
+	public void setActivity(Boolean activity) {
+		this.activity = activity;
+	}
+
+	/**
+	 * @return the lineWidth
+	 * @see #lineWidth
+	 */
+	public Double getLineWidth() {
+		return lineWidth;
+	}
+
+	/**
+	 * @param lineWidth
+	 *          the lineWidth to set
+	 * @see #lineWidth
+	 */
+	public void setLineWidth(Double lineWidth) {
+		this.lineWidth = lineWidth;
+	}
+
+	/**
+	 * @return the state
+	 * @see #state
+	 */
+	public String getState() {
+		return state;
+	}
+
+	/**
+	 * @param state
+	 *          the state to set
+	 * @see #state
+	 */
+	public void setState(String state) {
+		this.state = state;
+	}
+
+	/**
+	 * @return the complexAlias
+	 * @see #complexAlias
+	 */
+	public ComplexAlias getComplexAlias() {
+		return complexAlias;
+	}
+
+	/**
+	 * @param complexAlias
+	 *          the complexAlias to set
+	 * @see #complexAlias
+	 */
+	public void setComplexAlias(ComplexAlias complexAlias) {
+		this.complexAlias = complexAlias;
+	}
+
+	/**
+	 * @return the node
+	 * @see #node
+	 */
+	public Set<ReactionNode> getNode() {
+		return node;
+	}
+
+	/**
+	 * @param node
+	 *          the node to set
+	 * @see #node
+	 */
+	public void setNode(Set<ReactionNode> node) {
+		this.node = node;
+	}
+
+	/**
+	 * @return the aliasStatePrefix
+	 * @see #aliasStatePrefix
+	 */
+	public String getAliasStatePrefix() {
+		return aliasStatePrefix;
+	}
+
+	/**
+	 * @param aliasStatePrefix
+	 *          the aliasStatePrefix to set
+	 * @see #aliasStatePrefix
+	 */
+	public void setAliasStatePrefix(String aliasStatePrefix) {
+		this.aliasStatePrefix = aliasStatePrefix;
+	}
+
+	/**
+	 * @return the aliasStateLabel
+	 * @see #aliasStateLabel
+	 */
+	public String getAliasStateLabel() {
+		return aliasStateLabel;
+	}
+
+	/**
+	 * @param aliasStateLabel
+	 *          the aliasStateLabel to set
+	 * @see #aliasStateLabel
+	 */
+	public void setAliasStateLabel(String aliasStateLabel) {
+		this.aliasStateLabel = aliasStateLabel;
+	}
+
+	public abstract SpeciesAlias copy();
+
+	public static SpeciesAlias createAlias(Species species) {
+		if (species.getClass().equals(AntisenseRna.class)) {
+			return new AntisenseRnaAlias((AntisenseRna) species);
+		} else if (species.getClass().equals(ComplexSpecies.class)) {
+			return new ComplexAlias((ComplexSpecies) species);
+		} else if (species.getClass().equals(Degraded.class)) {
+			return new DegradedAlias((Degraded) species);
+		} else if (species.getClass().equals(Drug.class)) {
+			return new DrugAlias((Drug) species);
+		} else if (species.getClass().equals(Gene.class)) {
+			return new GeneAlias((Gene) species);
+		} else if (species.getClass().equals(GenericProtein.class)) {
+			return new GenericProteinAlias((GenericProtein) species);
+		} else if (species.getClass().equals(Ion.class)) {
+			return new IonAlias((Ion) species);
+		} else if (species.getClass().equals(IonChannelProtein.class)) {
+			return new IonChannelProteinAlias((IonChannelProtein) species);
+		} else if (species.getClass().equals(Phenotype.class)) {
+			return new PhenotypeAlias((Phenotype) species);
+		} else if (species.getClass().equals(ReceptorProtein.class)) {
+			return new ReceptorProteinAlias((ReceptorProtein) species);
+		} else if (species.getClass().equals(Rna.class)) {
+			return new RnaAlias((Rna) species);
+		} else if (species.getClass().equals(SimpleMolecule.class)) {
+			return new SimpleMoleculeAlias((SimpleMolecule) species);
+		} else if (species.getClass().equals(TruncatedProtein.class)) {
+			return new TruncatedProteinAlias((TruncatedProtein) species);
+		} else if (species.getClass().equals(Unknown.class)) {
+			return new UnknownAlias((Unknown) species);
+		} else {
+			throw new NotImplementedException("Don't know how to handle class: " + species.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasComparator.java
index 18e3728415..6c25ba437b 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasComparator.java
@@ -1,125 +1,163 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import java.util.Comparator;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.BooleanComparator;
-import lcsb.mapviewer.common.comparator.DoubleComparator;
-import lcsb.mapviewer.common.comparator.StringComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.SpeciesComparator;
-
-/**
- * This class implements comparator interface for SpeciesAlias. It also handles
- * comparison of subclasses of SpeciesAlias class.
- * 
- * @author Piotr Gawron
- * 
- */
-public class SpeciesAliasComparator implements Comparator<SpeciesAlias> {
-	/**
-	 * Default class logger.
-	 */
-	private Logger logger	= Logger.getLogger(SpeciesAliasComparator.class);
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public SpeciesAliasComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public SpeciesAliasComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(SpeciesAlias arg0, SpeciesAlias arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0 instanceof ComplexAlias) {
-				ComplexAliasComparator caComparator = new ComplexAliasComparator(epsilon);
-				return caComparator.compare((ComplexAlias) arg0, (ComplexAlias) arg1);
-			} else if (arg0.getClass().equals(SpeciesAlias.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in
-	 * {@link SpeciesAlias} class in inheritence tree. By the design it calls also
-	 * comparator of the upper ({@link Alias}) class.
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	int internalCompare(SpeciesAlias arg0, SpeciesAlias arg1) {
-		AliasComparator aliasComparator = new AliasComparator(epsilon);
-		int result = aliasComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-
-		DoubleComparator doubleComparator = new DoubleComparator(epsilon);
-		BooleanComparator booleanComparator = new BooleanComparator();
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-
-		if (speciesComparator.compare(arg0.getSpecies(), arg1.getSpecies()) != 0) {
-			logger.debug("Species different: " + arg0.getSpecies().getElementId() + ", " + arg1.getSpecies().getElementId());
-			return speciesComparator.compare(arg0.getSpecies(), arg1.getSpecies());
-		}
-
-		if (booleanComparator.compare(arg0.getActivity(), arg1.getActivity()) != 0) {
-			logger.debug("activity different: " + arg0.getActivity() + ", " + arg1.getActivity());
-			return booleanComparator.compare(arg0.getActivity(), arg1.getActivity());
-		}
-
-		if (doubleComparator.compare(arg0.getLineWidth(), arg1.getLineWidth()) != 0) {
-			logger.debug("line width different: " + arg0.getLineWidth() + ", " + arg1.getLineWidth());
-			return doubleComparator.compare(arg0.getLineWidth(), arg1.getLineWidth());
-		}
-		StringComparator stringComparator = new StringComparator();
-		if (stringComparator.compare(arg0.getAliasStateLabel(), arg1.getAliasStateLabel()) != 0) {
-			logger.debug("state label different: " + arg0.getAliasStateLabel() + ", " + arg1.getAliasStateLabel());
-			return stringComparator.compare(arg0.getAliasStateLabel(), arg1.getAliasStateLabel());
-		}
-
-		if (stringComparator.compare(arg0.getAliasStatePrefix(), arg1.getAliasStatePrefix()) != 0) {
-			logger.debug("state prefix different: " + arg0.getAliasStatePrefix() + ", " + arg1.getAliasStatePrefix());
-			return stringComparator.compare(arg0.getAliasStatePrefix(), arg1.getAliasStatePrefix());
-		}
-
-		return 0;
-	}
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.BooleanComparator;
+import lcsb.mapviewer.common.comparator.DoubleComparator;
+import lcsb.mapviewer.common.comparator.StringComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.SpeciesComparator;
+
+/**
+ * This class implements comparator interface for SpeciesAlias. It also handles
+ * comparison of subclasses of SpeciesAlias class.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class SpeciesAliasComparator implements Comparator<SpeciesAlias> {
+	/**
+	 * Default class logger.
+	 */
+	private Logger											logger = Logger.getLogger(SpeciesAliasComparator.class);
+
+	private AntisenseRnaAliasComparator	antisenseRnaAliasComparator;
+	private ChemicalAliasComparator			chemicalAliasComparator;
+	private ComplexAliasComparator			complexAliasComparator;
+	private DegradedAliasComparator			degradedAliasComparator;
+	private DrugAliasComparator					drugAliasComparator;
+	private GeneAliasComparator					geneAliasComparator;
+	private PhenotypeAliasComparator		phenotypeAliasComparator;
+	private ProteinAliasComparator			proteinAliasComparator;
+	private RnaAliasComparator					rnaAliasComparator;
+	private UnknownAliasComparator			unknownAliasComparator;
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double											epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public SpeciesAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+		antisenseRnaAliasComparator = new AntisenseRnaAliasComparator(epsilon);
+		chemicalAliasComparator = new ChemicalAliasComparator(epsilon);
+		complexAliasComparator = new ComplexAliasComparator(epsilon);
+		degradedAliasComparator = new DegradedAliasComparator(epsilon);
+		drugAliasComparator = new DrugAliasComparator(epsilon);
+		geneAliasComparator = new GeneAliasComparator(epsilon);
+		phenotypeAliasComparator = new PhenotypeAliasComparator(epsilon);
+		proteinAliasComparator = new ProteinAliasComparator(epsilon);
+		rnaAliasComparator = new RnaAliasComparator(epsilon);
+		unknownAliasComparator = new UnknownAliasComparator(epsilon);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public SpeciesAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(SpeciesAlias arg0, SpeciesAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(AntisenseRnaAlias.class)) {
+				return antisenseRnaAliasComparator.compare((AntisenseRnaAlias) arg0, (AntisenseRnaAlias) arg1);
+			} else if (arg0 instanceof ChemicalAlias) {
+				return chemicalAliasComparator.compare((ChemicalAlias) arg0, (ChemicalAlias) arg1);
+			} else if (arg0.getClass().equals(ComplexAlias.class)) {
+				return complexAliasComparator.compare((ComplexAlias) arg0, (ComplexAlias) arg1);
+			} else if (arg0.getClass().equals(DegradedAlias.class)) {
+				return degradedAliasComparator.compare((DegradedAlias) arg0, (DegradedAlias) arg1);
+			} else if (arg0.getClass().equals(DrugAlias.class)) {
+				return drugAliasComparator.compare((DrugAlias) arg0, (DrugAlias) arg1);
+			} else if (arg0.getClass().equals(GeneAlias.class)) {
+				return geneAliasComparator.compare((GeneAlias) arg0, (GeneAlias) arg1);
+			} else if (arg0.getClass().equals(PhenotypeAlias.class)) {
+				return phenotypeAliasComparator.compare((PhenotypeAlias) arg0, (PhenotypeAlias) arg1);
+			} else if (arg0 instanceof ProteinAlias) {
+				return proteinAliasComparator.compare((ProteinAlias) arg0, (ProteinAlias) arg1);
+			} else if (arg0.getClass().equals(RnaAlias.class)) {
+				return rnaAliasComparator.compare((RnaAlias) arg0, (RnaAlias) arg1);
+			} else if (arg0.getClass().equals(UnknownAlias.class)) {
+				return unknownAliasComparator.compare((UnknownAlias) arg0, (UnknownAlias) arg1);
+			} else if (arg0.getClass().equals(SpeciesAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in
+	 * {@link SpeciesAlias} class in inheritence tree. By the design it calls also
+	 * comparator of the upper ({@link Alias}) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	int internalCompare(SpeciesAlias arg0, SpeciesAlias arg1) {
+		AliasComparator aliasComparator = new AliasComparator(epsilon);
+		int result = aliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+
+		DoubleComparator doubleComparator = new DoubleComparator(epsilon);
+		BooleanComparator booleanComparator = new BooleanComparator();
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+
+		if (speciesComparator.compare(arg0.getSpecies(), arg1.getSpecies()) != 0) {
+			logger.debug("Species different: " + arg0.getSpecies().getElementId() + ", " + arg1.getSpecies().getElementId());
+			return speciesComparator.compare(arg0.getSpecies(), arg1.getSpecies());
+		}
+
+		if (booleanComparator.compare(arg0.getActivity(), arg1.getActivity()) != 0) {
+			logger.debug("activity different: " + arg0.getActivity() + ", " + arg1.getActivity());
+			return booleanComparator.compare(arg0.getActivity(), arg1.getActivity());
+		}
+
+		if (doubleComparator.compare(arg0.getLineWidth(), arg1.getLineWidth()) != 0) {
+			logger.debug("line width different: " + arg0.getLineWidth() + ", " + arg1.getLineWidth());
+			return doubleComparator.compare(arg0.getLineWidth(), arg1.getLineWidth());
+		}
+		StringComparator stringComparator = new StringComparator();
+		if (stringComparator.compare(arg0.getAliasStateLabel(), arg1.getAliasStateLabel()) != 0) {
+			logger.debug("state label different: " + arg0.getAliasStateLabel() + ", " + arg1.getAliasStateLabel());
+			return stringComparator.compare(arg0.getAliasStateLabel(), arg1.getAliasStateLabel());
+		}
+
+		if (stringComparator.compare(arg0.getAliasStatePrefix(), arg1.getAliasStatePrefix()) != 0) {
+			logger.debug("state prefix different: " + arg0.getAliasStatePrefix() + ", " + arg1.getAliasStatePrefix());
+			return stringComparator.compare(arg0.getAliasStatePrefix(), arg1.getAliasStatePrefix());
+		}
+
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/TruncatedProteinAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/TruncatedProteinAlias.java
new file mode 100644
index 0000000000..707885a4eb
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/TruncatedProteinAlias.java
@@ -0,0 +1,32 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.TruncatedProtein;
+
+@Entity
+@DiscriminatorValue("TRUNCATED_PROTEIN_ALIAS")
+public class TruncatedProteinAlias extends ProteinAlias {
+	TruncatedProteinAlias() {
+	}
+
+	public TruncatedProteinAlias(TruncatedProtein truncateProtein) {
+		super(truncateProtein);
+	}
+
+	public TruncatedProteinAlias(TruncatedProteinAlias original) {
+		super(original);
+	}
+
+	@Override
+	public TruncatedProteinAlias copy() {
+		if (this.getClass() == TruncatedProteinAlias.class) {
+			return new TruncatedProteinAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/TruncatedProteinAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/TruncatedProteinAliasComparator.java
new file mode 100644
index 0000000000..224da1286f
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/TruncatedProteinAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class TruncatedProteinAliasComparator implements Comparator<TruncatedProteinAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(TruncatedProteinAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public TruncatedProteinAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public TruncatedProteinAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(TruncatedProteinAlias arg0, TruncatedProteinAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(TruncatedProteinAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in TruncatedProteinAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(TruncatedProteinAlias arg0, TruncatedProteinAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/UnknownAlias.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/UnknownAlias.java
new file mode 100644
index 0000000000..860bcdc820
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/UnknownAlias.java
@@ -0,0 +1,32 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.Unknown;
+
+@Entity
+@DiscriminatorValue("UNKNOWN_ALIAS")
+public class UnknownAlias extends SpeciesAlias {
+	UnknownAlias() {
+	}
+
+	public UnknownAlias(Unknown degraded) {
+		super(degraded);
+	}
+
+	public UnknownAlias(UnknownAlias original) {
+		super(original);
+	}
+
+	@Override
+	public UnknownAlias copy() {
+		if (this.getClass() == UnknownAlias.class) {
+			return new UnknownAlias(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/UnknownAliasComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/UnknownAliasComparator.java
new file mode 100644
index 0000000000..0a9583364b
--- /dev/null
+++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/alias/UnknownAliasComparator.java
@@ -0,0 +1,83 @@
+package lcsb.mapviewer.model.map.layout.alias;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class UnknownAliasComparator implements Comparator<UnknownAlias> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(UnknownAliasComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double				epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public UnknownAliasComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public UnknownAliasComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(UnknownAlias arg0, UnknownAlias arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(UnknownAlias.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in UnknownAlias
+	 * class in inheritence tree. By the design it calls also comparator of the
+	 * upper (SpeciesAlias) class.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(UnknownAlias arg0, UnknownAlias arg1) {
+		SpeciesAliasComparator speciesAliasComparator = new SpeciesAliasComparator(epsilon);
+		int result = speciesAliasComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Modifier.java b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Modifier.java
index b2e5a7f6a5..fb9f9ab213 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Modifier.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Modifier.java
@@ -1,66 +1,66 @@
-package lcsb.mapviewer.model.map.reaction;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-
-/**
- * Represents modifier (ie. catalyst) in the {@link Reaction}. It is an
- * implementation of more general {@link ReactionNode} class which describes the
- * node.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("MODIFIER_NODE")
-public class Modifier extends ReactionNode {
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Default constructor.
-	 */
-	protected Modifier() {
-		super();
-	}
-
-	/**
-	 * Constructor that creates modifier for given {@link SpeciesAlias} and
-	 * {@link Element}. These elements reference to the objects in the
-	 * {@link lcsb.mapviewer.model.map.model.db.model.map.Model Model} that
-	 * represents this modifier.
-	 * 
-	 * @param alias
-	 *          alias that represent this modifier
-	 * @param element
-	 *          element that represent this modifier
-	 */
-	public Modifier(SpeciesAlias alias, Element element) {
-		super(alias, element);
-	}
-
-	/**
-	 * Constructor that initialize the modifier with data from parameter.
-	 * 
-	 * @param original
-	 *          original modifier used for data initalization
-	 */
-	protected Modifier(Modifier original) {
-		super(original);
-	}
-
-	@Override
-	public Modifier copy() {
-		if (this.getClass() == Modifier.class) {
-			return new Modifier(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-}
+package lcsb.mapviewer.model.map.reaction;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+
+/**
+ * Represents modifier (ie. catalyst) in the {@link Reaction}. It is an
+ * implementation of more general {@link ReactionNode} class which describes the
+ * node.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("MODIFIER_NODE")
+public class Modifier extends ReactionNode {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor.
+	 */
+	protected Modifier() {
+		super();
+	}
+
+	/**
+	 * Constructor that creates modifier for given {@link SpeciesAlias} and
+	 * {@link Element}. These elements reference to the objects in the
+	 * {@link lcsb.mapviewer.model.map.model.db.model.map.Model Model} that
+	 * represents this modifier.
+	 * 
+	 * @param alias
+	 *          alias that represent this modifier
+	 * @param element
+	 *          element that represent this modifier
+	 */
+	public Modifier(SpeciesAlias alias, Element element) {
+		super(alias, element);
+	}
+
+	/**
+	 * Constructor that initialize the modifier with data from parameter.
+	 * 
+	 * @param original
+	 *          original modifier used for data initalization
+	 */
+	protected Modifier(Modifier original) {
+		super(original);
+	}
+
+	@Override
+	public Modifier copy() {
+		if (this.getClass() == Modifier.class) {
+			return new Modifier(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Product.java b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Product.java
index 6fb167ea36..e8c292d80a 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Product.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Product.java
@@ -1,66 +1,66 @@
-package lcsb.mapviewer.model.map.reaction;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-
-/**
- * Represents product of the reaction (in the reaction).
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("PRODUCT_NODE")
-public class Product extends ReactionNode {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Default constructor.
-	 */
-	public Product() {
-		super();
-	}
-
-	/**
-	 * Constructor that creates product for given {@link SpeciesAlias} and
-	 * {@link Element}. These elements reference to the objects in the
-	 * {@link lcsb.mapviewer.model.map.model.db.model.map.Model Model} that
-	 * represents this product.
-	 * 
-	 * @param alias
-	 *          alias that represent this product
-	 * @param element
-	 *          element that represent this product
-	 */
-	public Product(SpeciesAlias alias, Element element) {
-		super(alias, element);
-	}
-
-	/**
-	 * Constructor that initialize the product with data from parameter.
-	 * 
-	 * @param original
-	 *          original product used for data initalization
-	 */
-	protected Product(Product original) {
-		super(original);
-	}
-
-	@Override
-	public Product copy() {
-		if (this.getClass() == Product.class) {
-			return new Product(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.reaction;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+
+/**
+ * Represents product of the reaction (in the reaction).
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("PRODUCT_NODE")
+public class Product extends ReactionNode {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor.
+	 */
+	public Product() {
+		super();
+	}
+
+	/**
+	 * Constructor that creates product for given {@link SpeciesAlias} and
+	 * {@link Element}. These elements reference to the objects in the
+	 * {@link lcsb.mapviewer.model.map.model.db.model.map.Model Model} that
+	 * represents this product.
+	 * 
+	 * @param alias
+	 *          alias that represent this product
+	 * @param element
+	 *          element that represent this product
+	 */
+	public Product(SpeciesAlias alias, Element element) {
+		super(alias, element);
+	}
+
+	/**
+	 * Constructor that initialize the product with data from parameter.
+	 * 
+	 * @param original
+	 *          original product used for data initalization
+	 */
+	protected Product(Product original) {
+		super(original);
+	}
+
+	@Override
+	public Product copy() {
+		if (this.getClass() == Product.class) {
+			return new Product(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reactant.java b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reactant.java
index 29f98a287f..2430b0f33d 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reactant.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reactant.java
@@ -1,65 +1,65 @@
-package lcsb.mapviewer.model.map.reaction;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-
-/**
- * Represents reactant of the reaction.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("REACTANT_NODE")
-public class Reactant extends ReactionNode {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Default constructor.
-	 */
-	public Reactant() {
-		super();
-	}
-
-	/**
-	 * Constructor that creates reactant for a given {@link SpeciesAlias} and
-	 * {@link Element}. These elements reference to the objects in the
-	 * {@link lcsb.mapviewer.model.map.model.db.model.map.Model Model} that
-	 * represents this reactant.
-	 * 
-	 * @param alias
-	 *          alias that represent this reactant
-	 * @param element
-	 *          element that represent this reactant
-	 */
-	public Reactant(SpeciesAlias alias, Element element) {
-		super(alias, element);
-	}
-
-	/**
-	 * Constructor that initialize the reactant with data from parameter.
-	 * 
-	 * @param original
-	 *          original reactant used for data initalization
-	 */
-	public Reactant(Reactant original) {
-		super(original);
-	}
-
-	@Override
-	public Reactant copy() {
-		if (this.getClass() == Reactant.class) {
-			return new Reactant(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-}
+package lcsb.mapviewer.model.map.reaction;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+
+/**
+ * Represents reactant of the reaction.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("REACTANT_NODE")
+public class Reactant extends ReactionNode {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Default constructor.
+	 */
+	public Reactant() {
+		super();
+	}
+
+	/**
+	 * Constructor that creates reactant for a given {@link SpeciesAlias} and
+	 * {@link Element}. These elements reference to the objects in the
+	 * {@link lcsb.mapviewer.model.map.model.db.model.map.Model Model} that
+	 * represents this reactant.
+	 * 
+	 * @param alias
+	 *          alias that represent this reactant
+	 * @param element
+	 *          element that represent this reactant
+	 */
+	public Reactant(SpeciesAlias alias, Element element) {
+		super(alias, element);
+	}
+
+	/**
+	 * Constructor that initialize the reactant with data from parameter.
+	 * 
+	 * @param original
+	 *          original reactant used for data initalization
+	 */
+	public Reactant(Reactant original) {
+		super(original);
+	}
+
+	@Override
+	public Reactant copy() {
+		if (this.getClass() == Reactant.class) {
+			return new Reactant(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reaction.java b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reaction.java
index 4107ca63a7..70319fc560 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reaction.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/reaction/Reaction.java
@@ -1,880 +1,880 @@
-package lcsb.mapviewer.model.map.reaction;
-
-import java.awt.geom.Line2D;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.DiscriminatorColumn;
-import javax.persistence.DiscriminatorType;
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
-import javax.xml.bind.annotation.XmlTransient;
-
-import org.apache.log4j.Logger;
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-import org.hibernate.annotations.IndexColumn;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.common.geometry.LineTransformation;
-import lcsb.mapviewer.model.map.AnnotatedObject;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.reaction.type.ReactionRect;
-import lcsb.mapviewer.model.map.reaction.type.TwoProductReactionInterface;
-import lcsb.mapviewer.model.map.reaction.type.TwoReactantReactionInterface;
-
-/**
- * This class describes reaction in the {@link Model}. Every reaction consists
- * of set of participants (nodes):
- * <ul>
- * <li>{@link Reactant reactants},</li>
- * <li>{@link Product products},</li>
- * <li>{@link Modifier modifiers}.</li>
- * </ul>
- * These nodes are connected using {@link NodeOperator operators} that define
- * relation among them.<br/>
- * <br/>
- * There are also other fields that describes reaction (like {@link #reversible}
- * , {@link #kineticLaw}, etc.).<br/>
- * <br/>
- * This class is general and shouldn't be used (except during initialization).
- * There are few extensions of this class (in sub-package:
- * {@link lcsb.mapviewer.model.map.reaction.type type}) that defines specific
- * reaction type.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@Table(name = "reaction_table")
-@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
-@DiscriminatorColumn(name = "reaction_type_db", discriminatorType = DiscriminatorType.STRING)
-@DiscriminatorValue("GENERIC_REACTION")
-public class Reaction implements AnnotatedObject {
-
-	/**
-	 * 
-	 */
-	private static final long								 serialVersionUID					 = 1L;
-
-	/**
-	 * Comparator of reactions that compare them using {@link #idReaction
-	 * identifier} as a key.
-	 */
-	public static final Comparator<Reaction> ID_COMPARATOR						 = new Comparator<Reaction>() {
-																																			 @Override
-																																			 public int compare(Reaction reaction1, Reaction reaction2) {
-																																				 return reaction1.getIdReaction().compareTo(reaction2.getIdReaction());
-																																			 }
-																																		 };
-
-	/**
-	 * Default class logger.
-	 */
-
-	private static Logger										 logger										 = Logger.getLogger(Reaction.class.getName());
-
-	/**
-	 * Unique database identifier.
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
-	@Column(name = "idDb", unique = true, nullable = false)
-	private int															 id;
-
-	/**
-	 * List of {@link AbstractNode nodes} in the reaction.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(mappedBy = "reaction")
-	@OrderBy("id")
-	private List<AbstractNode>							 nodes										 = new ArrayList<AbstractNode>();
-
-	/**
-	 * Description of the reaction.
-	 */
-	@Column(name = "notes", columnDefinition = "TEXT")
-	private String													 notes										 = "";
-
-	/**
-	 * Identifier of the reaction. Unique in the {@link Model}.
-	 */
-	private String													 idReaction								 = "";
-
-	/**
-	 * Name of the reaction.
-	 */
-	private String													 name											 = "";
-
-	/**
-	 * Is the reaction reversible.
-	 */
-	private boolean													 reversible								 = false;
-
-	/**
-	 * Is there a cinetic low describing this reaction.
-	 */
-	private boolean													 kineticLaw								 = false;
-
-	/**
-	 * Symbol of the reaction (RECON).
-	 */
-	private String													 symbol										 = null;
-
-	/**
-	 * Abbreviation of the reaction (RECON).
-	 */
-	private String													 abbreviation							 = null;
-
-	/**
-	 * Formula (RECON).
-	 */
-	private String													 formula									 = null;
-
-	/**
-	 * Mechanical confidence score (RECON).
-	 */
-	private Integer													 mechanicalConfidenceScore = null;
-
-	/**
-	 * Lower bound (RECON).
-	 */
-	private Double													 lowerBound								 = null;
-
-	/**
-	 * Upper bound (RECON).
-	 */
-	private Double													 upperBound								 = null;
-
-	/**
-	 * Subsystem (RECON).
-	 */
-	private String													 subsystem								 = null;
-
-	/**
-	 * Gene protein reaction (RECON).
-	 */
-	private String													 geneProteinReaction			 = null;
-
-	/**
-	 * Lists of all synonyms used for describing this element.
-	 */
-	@ElementCollection
-	@CollectionTable(name = "reaction_synonyms", joinColumns = @JoinColumn(name = "idDb"))
-	@Column(name = "synonym")
-	@IndexColumn(name = "idx")
-	@Cascade({ org.hibernate.annotations.CascadeType.ALL })
-	private List<String>										 synonyms									 = new ArrayList<String>();
-
-	/**
-	 * Set of annotations (references to external resources) that describe this
-	 * reaction.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@ManyToMany(fetch = FetchType.EAGER)
-	@JoinTable(name = "reaction_miriam", joinColumns = { @JoinColumn(name = "reaction_id", referencedColumnName = "idDb", nullable = false, updatable = false) },
-			inverseJoinColumns = { @JoinColumn(name = "miriam_id", referencedColumnName = "idDb", nullable = true, updatable = true) })
-	private Set<MiriamData>									 miriamDataSet						 = new HashSet<MiriamData>();
-
-	/**
-	 * ModelData where reaction is placed.
-	 */
-	@ManyToOne(fetch = FetchType.LAZY)
-	private ModelData												 model;
-
-	/**
-	 * Default constructor.
-	 */
-	public Reaction() {
-	}
-
-	/**
-	 * Creates reaction based on the information from the reaction passed as
-	 * parameter.
-	 * 
-	 * @param original
-	 *          original reaction
-	 */
-	public Reaction(Reaction original) {
-		// don't copy nodes - reactions refers to this objects (maybe it should be
-		// refactorized)
-		for (AbstractNode node : original.getNodes()) {
-			addNode(node);
-		}
-
-		notes = original.getNotes();
-		idReaction = original.getIdReaction();
-		name = original.getName();
-		reversible = original.reversible;
-		kineticLaw = original.kineticLaw;
-		miriamDataSet = new HashSet<MiriamData>();
-		for (MiriamData md : original.getMiriamData()) {
-			miriamDataSet.add(new MiriamData(md));
-		}
-
-		symbol = original.getSymbol();
-		abbreviation = original.getAbbreviation();
-		formula = original.getFormula();
-		mechanicalConfidenceScore = original.getMechanicalConfidenceScore();
-		lowerBound = original.getLowerBound();
-		upperBound = original.getUpperBound();
-		subsystem = original.getSubsystem();
-		geneProteinReaction = original.getGeneProteinReaction();
-		synonyms = new ArrayList<String>();
-		for (String synonym : original.getSynonyms()) {
-			synonyms.add(synonym);
-		}
-
-	}
-
-	/**
-	 * Adds node to the reaction.
-	 * 
-	 * @param node
-	 *          node to add
-	 */
-	public void addNode(AbstractNode node) {
-		node.setReaction(this);
-		nodes.add(node);
-	}
-
-	/**
-	 * Adds reactant.
-	 * 
-	 * @param reactant
-	 *          reactant to add
-	 */
-	public void addReactant(Reactant reactant) {
-		addNode(reactant);
-	}
-
-	/**
-	 * Adds product.
-	 * 
-	 * @param product
-	 *          product to add
-	 */
-	public void addProduct(Product product) {
-		addNode(product);
-	}
-
-	/**
-	 * Adds modifier.
-	 * 
-	 * @param modifier
-	 *          modifier to add
-	 */
-	public void addModifier(Modifier modifier) {
-		addNode(modifier);
-	}
-
-	/**
-	 * Returns list of reaction products.
-	 * 
-	 * @return list of products
-	 */
-	public List<Product> getProducts() {
-		List<Product> result = new ArrayList<Product>();
-		for (AbstractNode node : nodes) {
-			if (node instanceof Product) {
-				result.add((Product) node);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns list of reaction reactants.
-	 * 
-	 * @return list of reactants
-	 */
-	public List<Reactant> getReactants() {
-		List<Reactant> result = new ArrayList<Reactant>();
-		for (AbstractNode node : nodes) {
-			if (node instanceof Reactant) {
-				result.add((Reactant) node);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns list of reaction modifiers.
-	 * 
-	 * @return list of modifiers
-	 */
-	public List<Modifier> getModifiers() {
-		List<Modifier> result = new ArrayList<Modifier>();
-		for (AbstractNode node : nodes) {
-			if (node instanceof Modifier) {
-				result.add((Modifier) node);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * This method return the minimum distance from the reaction representation
-	 * (all lines which describe reaction) and point given as a parameter.
-	 * 
-	 * @param point
-	 *          from where we look for the shortest possible distance
-	 * 
-	 * @return the shortest possible distance from this reaction and point
-	 */
-	public double getDistanceFromPoint(Point2D point) {
-		LineTransformation lt = new LineTransformation();
-		double dist = Double.MAX_VALUE;
-		List<Line2D> lines = getLines();
-		for (Line2D line : lines) {
-			double d2 = lt.distBetweenPointAndLineSegment(line, point);
-			if (d2 < dist) {
-				dist = d2;
-			}
-		}
-		return dist;
-	}
-
-	/**
-	 * Return list of all lines in the reaction that describe it.
-	 * 
-	 * @return list of all lines that describes every connection in the rection
-	 */
-	public List<Line2D> getLines() {
-		List<Line2D> result = new ArrayList<Line2D>();
-		for (AbstractNode node : nodes) {
-			result.addAll(node.getLine().getLines());
-		}
-		return result;
-	}
-
-	/**
-	 * Returns point on the reaction that is as close as possible to the given
-	 * parameter point.
-	 * 
-	 * @param point
-	 *          parameter point to which results will be as close as possible
-	 * @return the closest point to the parameter point that is placed on the
-	 *         reaction
-	 */
-	public Point2D getClosestPointTo(Point2D point) {
-		LineTransformation lt = new LineTransformation();
-		double dist = Double.MAX_VALUE;
-		List<Line2D> lines = getLines();
-		Point2D result = null;
-		for (Line2D line : lines) {
-			double d2 = lt.distBetweenPointAndLineSegment(line, point);
-			if (d2 < dist) {
-				dist = d2;
-				result = lt.closestPointOnSegmentLineToPoint(line, point);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns short string describing type of the reaction.
-	 * 
-	 * @return short string describing type of the reaction
-	 */
-	public String getStringType() {
-		throw new NotImplementedException();
-	}
-
-	/**
-	 * Returns visibility level of the reaction in hierarchical view. More
-	 * information about hierarchical view can be found in
-	 * {@link lcsb.mapviewer.converter.graphics.AbstractImageGenerator
-	 * AbstractImageGenerator}.
-	 * 
-	 * @return visibility level of the reaction
-	 */
-	public int getVisibilityLevel() {
-		int level = 0;
-		for (ReactionNode node : getReactionNodes()) {
-			level = Math.max(level, node.getAlias().getVisibilityLevel());
-		}
-		return level;
-	}
-
-	/**
-	 * Returns list of nodes (producst+rectants+modifiers) in the reaction.
-	 * 
-	 * @return list of nodes (producst+rectants+modifiers) in the reaction
-	 */
-	public List<ReactionNode> getReactionNodes() {
-		List<ReactionNode> result = new ArrayList<ReactionNode>();
-		for (AbstractNode node : nodes) {
-			if (node instanceof ReactionNode) {
-				result.add((ReactionNode) node);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns central line of the reaction. Central line is the line that
-	 * separates inputs from outputs.
-	 * 
-	 * @return central line of the reaction
-	 */
-	public Line2D getCenterLine() {
-		Product product = getProducts().get(0);
-		Reactant reactant = getReactants().get(0);
-
-		Point2D startPoint = reactant.getLine().getPoints().get(reactant.getLine().getPoints().size() - 2);
-		Point2D endPoint = product.getLine().getPoints().get(1);
-
-		if (this instanceof TwoReactantReactionInterface) {
-
-			NodeOperator firstOperator = null;
-
-			for (NodeOperator operator : getOperators()) {
-				if (operator.isReactantOperator() && firstOperator == null) {
-					firstOperator = operator;
-				}
-			}
-			if (firstOperator != null) {
-				startPoint = firstOperator.getLine().getPoints().get(firstOperator.getLine().getPoints().size() - 2);
-			}
-		}
-
-		if (this instanceof TwoProductReactionInterface) {
-
-			NodeOperator firstOperator = null;
-
-			for (NodeOperator operator : getOperators()) {
-				if (operator.isProductOperator() && firstOperator == null) {
-					firstOperator = operator;
-				}
-			}
-			if (firstOperator != null) {
-				endPoint = firstOperator.getLine().getPoints().get(firstOperator.getLine().getPoints().size() - 2);
-			}
-		}
-
-		return new Line2D.Double(startPoint, endPoint);
-	}
-
-	/**
-	 * Removes modifier.
-	 * 
-	 * @param modifier
-	 *          modifier to remove
-	 */
-	public void removeModifier(Modifier modifier) {
-		nodes.remove(modifier);
-	}
-
-	/**
-	 * Returns {@link ReactionRect} object that defines a small object that should
-	 * be drawn on the central line of the reaction.
-	 * 
-	 * @return {@link ReactionRect} object that defines a small object that should
-	 *         be drawn on the central line of the reaction
-	 */
-	public ReactionRect getReactionRect() {
-		return null;
-	}
-
-	/**
-	 * Returns central point of the reaction - point on central line (see:
-	 * {@link #getCenterLine()}). This point determines one of the points where
-	 * modifiers are attached.
-	 * 
-	 * @return central point of the reaction
-	 */
-	public Point2D getCenterPoint() {
-		Line2D line2D = getCenterLine();
-		return new Point2D.Double((line2D.getX1() + line2D.getX2()) / 2, (line2D.getY1() + line2D.getY2()) / 2);
-	}
-
-	/**
-	 * Check if one of the nodes reference to the element.
-	 * 
-	 * @param element
-	 *          element to be checked
-	 * @return <code>true</code> if element is part of the reaction,
-	 *         <code>false</code> otherwise
-	 */
-	public boolean containsElement(Element element) {
-		for (ReactionNode node : getReactionNodes()) {
-			if (node.getElement().equals(element)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * Creates copy of the reaction.
-	 * 
-	 * @return copy of the reaction
-	 */
-	public Reaction copy() {
-		if (this.getClass() == Reaction.class) {
-			return new Reaction(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	/**
-	 * Returns list of all {@link NodeOperator operators}.
-	 * 
-	 * @return list of all {@link NodeOperator operators}
-	 */
-	public List<NodeOperator> getOperators() {
-		List<NodeOperator> result = new ArrayList<NodeOperator>();
-		for (AbstractNode node : getNodes()) {
-			if (node instanceof NodeOperator) {
-				result.add((NodeOperator) node);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * @return the id
-	 * @see #id
-	 */
-	public int getId() {
-		return id;
-	}
-
-	/**
-	 * @param id
-	 *          the id to set
-	 * @see #id
-	 */
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	/**
-	 * @return the nodes
-	 * @see #nodes
-	 */
-	public List<AbstractNode> getNodes() {
-		return nodes;
-	}
-
-	/**
-	 * @param nodes
-	 *          the nodes to set
-	 * @see #nodes
-	 */
-	public void setNodes(List<AbstractNode> nodes) {
-		this.nodes = nodes;
-	}
-
-	@Override
-	public String getNotes() {
-		return notes;
-	}
-
-	@Override
-	public void setNotes(String notes) {
-		this.notes = notes;
-	}
-
-	/**
-	 * @return the idReaction
-	 * @see #idReaction
-	 */
-	public String getIdReaction() {
-		return idReaction;
-	}
-
-	/**
-	 * @param idReaction
-	 *          the idReaction to set
-	 * @see #idReaction
-	 */
-	public void setIdReaction(String idReaction) {
-		this.idReaction = idReaction;
-	}
-
-	@Override
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * @param name
-	 *          the name to set
-	 * @see #name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * @return the reversible
-	 * @see #reversible
-	 */
-	public boolean isReversible() {
-		return reversible;
-	}
-
-	/**
-	 * @param reversible
-	 *          the reversible to set
-	 * @see #reversible
-	 */
-	public void setReversible(boolean reversible) {
-		this.reversible = reversible;
-	}
-
-	/**
-	 * @return the kineticLaw
-	 * @see #kineticLaw
-	 */
-	public boolean isKineticLaw() {
-		return kineticLaw;
-	}
-
-	/**
-	 * @param kineticLaw
-	 *          the kineticLaw to set
-	 * @see #kineticLaw
-	 */
-	public void setKineticLaw(boolean kineticLaw) {
-		this.kineticLaw = kineticLaw;
-	}
-
-	@Override
-	public Set<MiriamData> getMiriamData() {
-		return miriamDataSet;
-	}
-
-	@Override
-	public void addMiriamData(Collection<MiriamData> miriamData) {
-		for (MiriamData md : miriamData) {
-			addMiriamData(md);
-		}
-	}
-
-	/**
-	 * @return the model
-	 * @see #model
-	 */
-	public ModelData getModelData() {
-		return model;
-	}
-
-	/**
-	 * @param model
-	 *          the model to set
-	 * @see #model
-	 */
-	public void setModelData(ModelData model) {
-		this.model = model;
-	}
-
-	@Override
-	public void addMiriamData(MiriamData md) {
-		if (this.miriamDataSet.contains(md)) {
-			logger.warn("Miriam data (" + md.getDataType() + ": " + md.getResource() + ") for " + getIdReaction() + " already exists. Ignoring...");
-		} else {
-			this.miriamDataSet.add(md);
-		}
-	}
-
-	/**
-	 * Sets model where the reaction is located.
-	 * 
-	 * @param model2
-	 *          model where the reaction is located
-	 */
-	public void setModel(Model model2) {
-		this.model = model2.getModelData();
-	}
-
-	/**
-	 * Returns model where reaction is locacted.
-	 * 
-	 * @return model where reaction is locacted.
-	 */
-	@XmlTransient
-	public Model getModel() {
-		return model.getModel();
-	}
-
-	@Override
-	public String getSymbol() {
-		return symbol;
-	}
-
-	@Override
-	public void setSymbol(String symbol) {
-		this.symbol = symbol;
-	}
-
-	@Override
-	public String getAbbreviation() {
-		return abbreviation;
-	}
-
-	@Override
-	public void setAbbreviation(String abbreviation) {
-		this.abbreviation = abbreviation;
-	}
-
-	@Override
-	public String getFormula() {
-		return formula;
-	}
-
-	@Override
-	public void setFormula(String formula) {
-		this.formula = formula;
-	}
-
-	/**
-	 * @return the mechanicalConfidenceScore
-	 * @see #mechanicalConfidenceScore
-	 */
-	public Integer getMechanicalConfidenceScore() {
-		return mechanicalConfidenceScore;
-	}
-
-	/**
-	 * @param mechanicalConfidenceScore
-	 *          the mechanicalConfidenceScore to set
-	 * @see #mechanicalConfidenceScore
-	 */
-	public void setMechanicalConfidenceScore(Integer mechanicalConfidenceScore) {
-		this.mechanicalConfidenceScore = mechanicalConfidenceScore;
-	}
-
-	/**
-	 * @return the lowerBound
-	 * @see #lowerBound
-	 */
-	public Double getLowerBound() {
-		return lowerBound;
-	}
-
-	/**
-	 * @param lowerBound
-	 *          the lowerBound to set
-	 * @see #lowerBound
-	 */
-	public void setLowerBound(Double lowerBound) {
-		this.lowerBound = lowerBound;
-	}
-
-	/**
-	 * @return the upperBound
-	 * @see #upperBound
-	 */
-	public Double getUpperBound() {
-		return upperBound;
-	}
-
-	/**
-	 * @param upperBound
-	 *          the upperBound to set
-	 * @see #upperBound
-	 */
-	public void setUpperBound(Double upperBound) {
-		this.upperBound = upperBound;
-	}
-
-	/**
-	 * @return the subsystem
-	 * @see #subsystem
-	 */
-	public String getSubsystem() {
-		return subsystem;
-	}
-
-	/**
-	 * @param subsystem
-	 *          the subsystem to set
-	 * @see #subsystem
-	 */
-	public void setSubsystem(String subsystem) {
-		this.subsystem = subsystem;
-	}
-
-	/**
-	 * @return the geneProteinReaction
-	 * @see #geneProteinReaction
-	 */
-	public String getGeneProteinReaction() {
-		return geneProteinReaction;
-	}
-
-	/**
-	 * @param geneProteinReaction
-	 *          the geneProteinReaction to set
-	 * @see #geneProteinReaction
-	 */
-	public void setGeneProteinReaction(String geneProteinReaction) {
-		this.geneProteinReaction = geneProteinReaction;
-	}
-
-	/**
-	 * @return the synonyms
-	 * @see #synonyms
-	 */
-	public List<String> getSynonyms() {
-		return synonyms;
-	}
-
-	/**
-	 * @param synonyms
-	 *          the synonyms to set
-	 * @see #synonyms
-	 */
-	public void setSynonyms(List<String> synonyms) {
-		this.synonyms = synonyms;
-	}
-
-	@Override
-	public String getElementId() {
-		return this.idReaction;
-	}
-
-	@Override
-	public void setElementId(String id) {
-		setIdReaction(id);
-	}
-
-	/**
-	 * Adds synonym to the {@link #synonyms}.
-	 * 
-	 * @param synonym
-	 *          new synonym to add
-	 */
-	public void addSynonym(String synonym) {
-		this.synonyms.add(synonym);
-	}
-
-}
+package lcsb.mapviewer.model.map.reaction;
+
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.CollectionTable;
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.DiscriminatorType;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.ElementCollection;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+import org.hibernate.annotations.IndexColumn;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.common.geometry.LineTransformation;
+import lcsb.mapviewer.model.map.AnnotatedObject;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.reaction.type.ReactionRect;
+import lcsb.mapviewer.model.map.reaction.type.TwoProductReactionInterface;
+import lcsb.mapviewer.model.map.reaction.type.TwoReactantReactionInterface;
+
+/**
+ * This class describes reaction in the {@link Model}. Every reaction consists
+ * of set of participants (nodes):
+ * <ul>
+ * <li>{@link Reactant reactants},</li>
+ * <li>{@link Product products},</li>
+ * <li>{@link Modifier modifiers}.</li>
+ * </ul>
+ * These nodes are connected using {@link NodeOperator operators} that define
+ * relation among them.<br/>
+ * <br/>
+ * There are also other fields that describes reaction (like {@link #reversible}
+ * , {@link #kineticLaw}, etc.).<br/>
+ * <br/>
+ * This class is general and shouldn't be used (except during initialization).
+ * There are few extensions of this class (in sub-package:
+ * {@link lcsb.mapviewer.model.map.reaction.type type}) that defines specific
+ * reaction type.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@Table(name = "reaction_table")
+@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(name = "reaction_type_db", discriminatorType = DiscriminatorType.STRING)
+@DiscriminatorValue("GENERIC_REACTION")
+public class Reaction implements AnnotatedObject {
+
+	/**
+	 * 
+	 */
+	private static final long								 serialVersionUID					 = 1L;
+
+	/**
+	 * Comparator of reactions that compare them using {@link #idReaction
+	 * identifier} as a key.
+	 */
+	public static final Comparator<Reaction> ID_COMPARATOR						 = new Comparator<Reaction>() {
+																																			 @Override
+																																			 public int compare(Reaction reaction1, Reaction reaction2) {
+																																				 return reaction1.getIdReaction().compareTo(reaction2.getIdReaction());
+																																			 }
+																																		 };
+
+	/**
+	 * Default class logger.
+	 */
+
+	private static Logger										 logger										 = Logger.getLogger(Reaction.class.getName());
+
+	/**
+	 * Unique database identifier.
+	 */
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "idDb", unique = true, nullable = false)
+	private int															 id;
+
+	/**
+	 * List of {@link AbstractNode nodes} in the reaction.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(mappedBy = "reaction")
+	@OrderBy("id")
+	private List<AbstractNode>							 nodes										 = new ArrayList<AbstractNode>();
+
+	/**
+	 * Description of the reaction.
+	 */
+	@Column(name = "notes", columnDefinition = "TEXT")
+	private String													 notes										 = "";
+
+	/**
+	 * Identifier of the reaction. Unique in the {@link Model}.
+	 */
+	private String													 idReaction								 = "";
+
+	/**
+	 * Name of the reaction.
+	 */
+	private String													 name											 = "";
+
+	/**
+	 * Is the reaction reversible.
+	 */
+	private boolean													 reversible								 = false;
+
+	/**
+	 * Is there a cinetic low describing this reaction.
+	 */
+	private boolean													 kineticLaw								 = false;
+
+	/**
+	 * Symbol of the reaction (RECON).
+	 */
+	private String													 symbol										 = null;
+
+	/**
+	 * Abbreviation of the reaction (RECON).
+	 */
+	private String													 abbreviation							 = null;
+
+	/**
+	 * Formula (RECON).
+	 */
+	private String													 formula									 = null;
+
+	/**
+	 * Mechanical confidence score (RECON).
+	 */
+	private Integer													 mechanicalConfidenceScore = null;
+
+	/**
+	 * Lower bound (RECON).
+	 */
+	private Double													 lowerBound								 = null;
+
+	/**
+	 * Upper bound (RECON).
+	 */
+	private Double													 upperBound								 = null;
+
+	/**
+	 * Subsystem (RECON).
+	 */
+	private String													 subsystem								 = null;
+
+	/**
+	 * Gene protein reaction (RECON).
+	 */
+	private String													 geneProteinReaction			 = null;
+
+	/**
+	 * Lists of all synonyms used for describing this element.
+	 */
+	@ElementCollection
+	@CollectionTable(name = "reaction_synonyms", joinColumns = @JoinColumn(name = "idDb"))
+	@Column(name = "synonym")
+	@IndexColumn(name = "idx")
+	@Cascade({ org.hibernate.annotations.CascadeType.ALL })
+	private List<String>										 synonyms									 = new ArrayList<String>();
+
+	/**
+	 * Set of annotations (references to external resources) that describe this
+	 * reaction.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@ManyToMany(fetch = FetchType.EAGER)
+	@JoinTable(name = "reaction_miriam", joinColumns = { @JoinColumn(name = "reaction_id", referencedColumnName = "idDb", nullable = false, updatable = false) },
+			inverseJoinColumns = { @JoinColumn(name = "miriam_id", referencedColumnName = "idDb", nullable = true, updatable = true) })
+	private Set<MiriamData>									 miriamDataSet						 = new HashSet<MiriamData>();
+
+	/**
+	 * ModelData where reaction is placed.
+	 */
+	@ManyToOne(fetch = FetchType.LAZY)
+	private ModelData												 model;
+
+	/**
+	 * Default constructor.
+	 */
+	public Reaction() {
+	}
+
+	/**
+	 * Creates reaction based on the information from the reaction passed as
+	 * parameter.
+	 * 
+	 * @param original
+	 *          original reaction
+	 */
+	public Reaction(Reaction original) {
+		// don't copy nodes - reactions refers to this objects (maybe it should be
+		// refactorized)
+		for (AbstractNode node : original.getNodes()) {
+			addNode(node);
+		}
+
+		notes = original.getNotes();
+		idReaction = original.getIdReaction();
+		name = original.getName();
+		reversible = original.reversible;
+		kineticLaw = original.kineticLaw;
+		miriamDataSet = new HashSet<MiriamData>();
+		for (MiriamData md : original.getMiriamData()) {
+			miriamDataSet.add(new MiriamData(md));
+		}
+
+		symbol = original.getSymbol();
+		abbreviation = original.getAbbreviation();
+		formula = original.getFormula();
+		mechanicalConfidenceScore = original.getMechanicalConfidenceScore();
+		lowerBound = original.getLowerBound();
+		upperBound = original.getUpperBound();
+		subsystem = original.getSubsystem();
+		geneProteinReaction = original.getGeneProteinReaction();
+		synonyms = new ArrayList<String>();
+		for (String synonym : original.getSynonyms()) {
+			synonyms.add(synonym);
+		}
+
+	}
+
+	/**
+	 * Adds node to the reaction.
+	 * 
+	 * @param node
+	 *          node to add
+	 */
+	public void addNode(AbstractNode node) {
+		node.setReaction(this);
+		nodes.add(node);
+	}
+
+	/**
+	 * Adds reactant.
+	 * 
+	 * @param reactant
+	 *          reactant to add
+	 */
+	public void addReactant(Reactant reactant) {
+		addNode(reactant);
+	}
+
+	/**
+	 * Adds product.
+	 * 
+	 * @param product
+	 *          product to add
+	 */
+	public void addProduct(Product product) {
+		addNode(product);
+	}
+
+	/**
+	 * Adds modifier.
+	 * 
+	 * @param modifier
+	 *          modifier to add
+	 */
+	public void addModifier(Modifier modifier) {
+		addNode(modifier);
+	}
+
+	/**
+	 * Returns list of reaction products.
+	 * 
+	 * @return list of products
+	 */
+	public List<Product> getProducts() {
+		List<Product> result = new ArrayList<Product>();
+		for (AbstractNode node : nodes) {
+			if (node instanceof Product) {
+				result.add((Product) node);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns list of reaction reactants.
+	 * 
+	 * @return list of reactants
+	 */
+	public List<Reactant> getReactants() {
+		List<Reactant> result = new ArrayList<Reactant>();
+		for (AbstractNode node : nodes) {
+			if (node instanceof Reactant) {
+				result.add((Reactant) node);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns list of reaction modifiers.
+	 * 
+	 * @return list of modifiers
+	 */
+	public List<Modifier> getModifiers() {
+		List<Modifier> result = new ArrayList<Modifier>();
+		for (AbstractNode node : nodes) {
+			if (node instanceof Modifier) {
+				result.add((Modifier) node);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * This method return the minimum distance from the reaction representation
+	 * (all lines which describe reaction) and point given as a parameter.
+	 * 
+	 * @param point
+	 *          from where we look for the shortest possible distance
+	 * 
+	 * @return the shortest possible distance from this reaction and point
+	 */
+	public double getDistanceFromPoint(Point2D point) {
+		LineTransformation lt = new LineTransformation();
+		double dist = Double.MAX_VALUE;
+		List<Line2D> lines = getLines();
+		for (Line2D line : lines) {
+			double d2 = lt.distBetweenPointAndLineSegment(line, point);
+			if (d2 < dist) {
+				dist = d2;
+			}
+		}
+		return dist;
+	}
+
+	/**
+	 * Return list of all lines in the reaction that describe it.
+	 * 
+	 * @return list of all lines that describes every connection in the rection
+	 */
+	public List<Line2D> getLines() {
+		List<Line2D> result = new ArrayList<Line2D>();
+		for (AbstractNode node : nodes) {
+			result.addAll(node.getLine().getLines());
+		}
+		return result;
+	}
+
+	/**
+	 * Returns point on the reaction that is as close as possible to the given
+	 * parameter point.
+	 * 
+	 * @param point
+	 *          parameter point to which results will be as close as possible
+	 * @return the closest point to the parameter point that is placed on the
+	 *         reaction
+	 */
+	public Point2D getClosestPointTo(Point2D point) {
+		LineTransformation lt = new LineTransformation();
+		double dist = Double.MAX_VALUE;
+		List<Line2D> lines = getLines();
+		Point2D result = null;
+		for (Line2D line : lines) {
+			double d2 = lt.distBetweenPointAndLineSegment(line, point);
+			if (d2 < dist) {
+				dist = d2;
+				result = lt.closestPointOnSegmentLineToPoint(line, point);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns short string describing type of the reaction.
+	 * 
+	 * @return short string describing type of the reaction
+	 */
+	public String getStringType() {
+		throw new NotImplementedException();
+	}
+
+	/**
+	 * Returns visibility level of the reaction in hierarchical view. More
+	 * information about hierarchical view can be found in
+	 * {@link lcsb.mapviewer.converter.graphics.AbstractImageGenerator
+	 * AbstractImageGenerator}.
+	 * 
+	 * @return visibility level of the reaction
+	 */
+	public int getVisibilityLevel() {
+		int level = 0;
+		for (ReactionNode node : getReactionNodes()) {
+			level = Math.max(level, node.getAlias().getVisibilityLevel());
+		}
+		return level;
+	}
+
+	/**
+	 * Returns list of nodes (producst+rectants+modifiers) in the reaction.
+	 * 
+	 * @return list of nodes (producst+rectants+modifiers) in the reaction
+	 */
+	public List<ReactionNode> getReactionNodes() {
+		List<ReactionNode> result = new ArrayList<ReactionNode>();
+		for (AbstractNode node : nodes) {
+			if (node instanceof ReactionNode) {
+				result.add((ReactionNode) node);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns central line of the reaction. Central line is the line that
+	 * separates inputs from outputs.
+	 * 
+	 * @return central line of the reaction
+	 */
+	public Line2D getCenterLine() {
+		Product product = getProducts().get(0);
+		Reactant reactant = getReactants().get(0);
+
+		Point2D startPoint = reactant.getLine().getPoints().get(reactant.getLine().getPoints().size() - 2);
+		Point2D endPoint = product.getLine().getPoints().get(1);
+
+		if (this instanceof TwoReactantReactionInterface) {
+
+			NodeOperator firstOperator = null;
+
+			for (NodeOperator operator : getOperators()) {
+				if (operator.isReactantOperator() && firstOperator == null) {
+					firstOperator = operator;
+				}
+			}
+			if (firstOperator != null) {
+				startPoint = firstOperator.getLine().getPoints().get(firstOperator.getLine().getPoints().size() - 2);
+			}
+		}
+
+		if (this instanceof TwoProductReactionInterface) {
+
+			NodeOperator firstOperator = null;
+
+			for (NodeOperator operator : getOperators()) {
+				if (operator.isProductOperator() && firstOperator == null) {
+					firstOperator = operator;
+				}
+			}
+			if (firstOperator != null) {
+				endPoint = firstOperator.getLine().getPoints().get(firstOperator.getLine().getPoints().size() - 2);
+			}
+		}
+
+		return new Line2D.Double(startPoint, endPoint);
+	}
+
+	/**
+	 * Removes modifier.
+	 * 
+	 * @param modifier
+	 *          modifier to remove
+	 */
+	public void removeModifier(Modifier modifier) {
+		nodes.remove(modifier);
+	}
+
+	/**
+	 * Returns {@link ReactionRect} object that defines a small object that should
+	 * be drawn on the central line of the reaction.
+	 * 
+	 * @return {@link ReactionRect} object that defines a small object that should
+	 *         be drawn on the central line of the reaction
+	 */
+	public ReactionRect getReactionRect() {
+		return null;
+	}
+
+	/**
+	 * Returns central point of the reaction - point on central line (see:
+	 * {@link #getCenterLine()}). This point determines one of the points where
+	 * modifiers are attached.
+	 * 
+	 * @return central point of the reaction
+	 */
+	public Point2D getCenterPoint() {
+		Line2D line2D = getCenterLine();
+		return new Point2D.Double((line2D.getX1() + line2D.getX2()) / 2, (line2D.getY1() + line2D.getY2()) / 2);
+	}
+
+	/**
+	 * Check if one of the nodes reference to the element.
+	 * 
+	 * @param element
+	 *          element to be checked
+	 * @return <code>true</code> if element is part of the reaction,
+	 *         <code>false</code> otherwise
+	 */
+	public boolean containsElement(Element element) {
+		for (ReactionNode node : getReactionNodes()) {
+			if (node.getElement().equals(element)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Creates copy of the reaction.
+	 * 
+	 * @return copy of the reaction
+	 */
+	public Reaction copy() {
+		if (this.getClass() == Reaction.class) {
+			return new Reaction(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	/**
+	 * Returns list of all {@link NodeOperator operators}.
+	 * 
+	 * @return list of all {@link NodeOperator operators}
+	 */
+	public List<NodeOperator> getOperators() {
+		List<NodeOperator> result = new ArrayList<NodeOperator>();
+		for (AbstractNode node : getNodes()) {
+			if (node instanceof NodeOperator) {
+				result.add((NodeOperator) node);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @return the id
+	 * @see #id
+	 */
+	public int getId() {
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *          the id to set
+	 * @see #id
+	 */
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	/**
+	 * @return the nodes
+	 * @see #nodes
+	 */
+	public List<AbstractNode> getNodes() {
+		return nodes;
+	}
+
+	/**
+	 * @param nodes
+	 *          the nodes to set
+	 * @see #nodes
+	 */
+	public void setNodes(List<AbstractNode> nodes) {
+		this.nodes = nodes;
+	}
+
+	@Override
+	public String getNotes() {
+		return notes;
+	}
+
+	@Override
+	public void setNotes(String notes) {
+		this.notes = notes;
+	}
+
+	/**
+	 * @return the idReaction
+	 * @see #idReaction
+	 */
+	public String getIdReaction() {
+		return idReaction;
+	}
+
+	/**
+	 * @param idReaction
+	 *          the idReaction to set
+	 * @see #idReaction
+	 */
+	public void setIdReaction(String idReaction) {
+		this.idReaction = idReaction;
+	}
+
+	@Override
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * @param name
+	 *          the name to set
+	 * @see #name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * @return the reversible
+	 * @see #reversible
+	 */
+	public boolean isReversible() {
+		return reversible;
+	}
+
+	/**
+	 * @param reversible
+	 *          the reversible to set
+	 * @see #reversible
+	 */
+	public void setReversible(boolean reversible) {
+		this.reversible = reversible;
+	}
+
+	/**
+	 * @return the kineticLaw
+	 * @see #kineticLaw
+	 */
+	public boolean isKineticLaw() {
+		return kineticLaw;
+	}
+
+	/**
+	 * @param kineticLaw
+	 *          the kineticLaw to set
+	 * @see #kineticLaw
+	 */
+	public void setKineticLaw(boolean kineticLaw) {
+		this.kineticLaw = kineticLaw;
+	}
+
+	@Override
+	public Set<MiriamData> getMiriamData() {
+		return miriamDataSet;
+	}
+
+	@Override
+	public void addMiriamData(Collection<MiriamData> miriamData) {
+		for (MiriamData md : miriamData) {
+			addMiriamData(md);
+		}
+	}
+
+	/**
+	 * @return the model
+	 * @see #model
+	 */
+	public ModelData getModelData() {
+		return model;
+	}
+
+	/**
+	 * @param model
+	 *          the model to set
+	 * @see #model
+	 */
+	public void setModelData(ModelData model) {
+		this.model = model;
+	}
+
+	@Override
+	public void addMiriamData(MiriamData md) {
+		if (this.miriamDataSet.contains(md)) {
+			logger.warn("Miriam data (" + md.getDataType() + ": " + md.getResource() + ") for " + getIdReaction() + " already exists. Ignoring...");
+		} else {
+			this.miriamDataSet.add(md);
+		}
+	}
+
+	/**
+	 * Sets model where the reaction is located.
+	 * 
+	 * @param model2
+	 *          model where the reaction is located
+	 */
+	public void setModel(Model model2) {
+		this.model = model2.getModelData();
+	}
+
+	/**
+	 * Returns model where reaction is locacted.
+	 * 
+	 * @return model where reaction is locacted.
+	 */
+	@XmlTransient
+	public Model getModel() {
+		return model.getModel();
+	}
+
+	@Override
+	public String getSymbol() {
+		return symbol;
+	}
+
+	@Override
+	public void setSymbol(String symbol) {
+		this.symbol = symbol;
+	}
+
+	@Override
+	public String getAbbreviation() {
+		return abbreviation;
+	}
+
+	@Override
+	public void setAbbreviation(String abbreviation) {
+		this.abbreviation = abbreviation;
+	}
+
+	@Override
+	public String getFormula() {
+		return formula;
+	}
+
+	@Override
+	public void setFormula(String formula) {
+		this.formula = formula;
+	}
+
+	/**
+	 * @return the mechanicalConfidenceScore
+	 * @see #mechanicalConfidenceScore
+	 */
+	public Integer getMechanicalConfidenceScore() {
+		return mechanicalConfidenceScore;
+	}
+
+	/**
+	 * @param mechanicalConfidenceScore
+	 *          the mechanicalConfidenceScore to set
+	 * @see #mechanicalConfidenceScore
+	 */
+	public void setMechanicalConfidenceScore(Integer mechanicalConfidenceScore) {
+		this.mechanicalConfidenceScore = mechanicalConfidenceScore;
+	}
+
+	/**
+	 * @return the lowerBound
+	 * @see #lowerBound
+	 */
+	public Double getLowerBound() {
+		return lowerBound;
+	}
+
+	/**
+	 * @param lowerBound
+	 *          the lowerBound to set
+	 * @see #lowerBound
+	 */
+	public void setLowerBound(Double lowerBound) {
+		this.lowerBound = lowerBound;
+	}
+
+	/**
+	 * @return the upperBound
+	 * @see #upperBound
+	 */
+	public Double getUpperBound() {
+		return upperBound;
+	}
+
+	/**
+	 * @param upperBound
+	 *          the upperBound to set
+	 * @see #upperBound
+	 */
+	public void setUpperBound(Double upperBound) {
+		this.upperBound = upperBound;
+	}
+
+	/**
+	 * @return the subsystem
+	 * @see #subsystem
+	 */
+	public String getSubsystem() {
+		return subsystem;
+	}
+
+	/**
+	 * @param subsystem
+	 *          the subsystem to set
+	 * @see #subsystem
+	 */
+	public void setSubsystem(String subsystem) {
+		this.subsystem = subsystem;
+	}
+
+	/**
+	 * @return the geneProteinReaction
+	 * @see #geneProteinReaction
+	 */
+	public String getGeneProteinReaction() {
+		return geneProteinReaction;
+	}
+
+	/**
+	 * @param geneProteinReaction
+	 *          the geneProteinReaction to set
+	 * @see #geneProteinReaction
+	 */
+	public void setGeneProteinReaction(String geneProteinReaction) {
+		this.geneProteinReaction = geneProteinReaction;
+	}
+
+	/**
+	 * @return the synonyms
+	 * @see #synonyms
+	 */
+	public List<String> getSynonyms() {
+		return synonyms;
+	}
+
+	/**
+	 * @param synonyms
+	 *          the synonyms to set
+	 * @see #synonyms
+	 */
+	public void setSynonyms(List<String> synonyms) {
+		this.synonyms = synonyms;
+	}
+
+	@Override
+	public String getElementId() {
+		return this.idReaction;
+	}
+
+	@Override
+	public void setElementId(String id) {
+		setIdReaction(id);
+	}
+
+	/**
+	 * Adds synonym to the {@link #synonyms}.
+	 * 
+	 * @param synonym
+	 *          new synonym to add
+	 */
+	public void addSynonym(String synonym) {
+		this.synonyms.add(synonym);
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/AntisenseRna.java b/model/src/main/java/lcsb/mapviewer/model/map/species/AntisenseRna.java
index 5a610fc37b..6b48d1fce6 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/AntisenseRna.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/AntisenseRna.java
@@ -1,156 +1,156 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.OneToMany;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
-
-import org.apache.log4j.Logger;
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-import org.hibernate.annotations.LazyCollection;
-import org.hibernate.annotations.LazyCollectionOption;
-
-/**
- * Class representing antisense rna in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Antisense RNA")
-public class AntisenseRna extends Species {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger							logger	= Logger.getLogger(AntisenseRna.class);
-
-	/**
-	 * List of antisense rna regions (some rna sequences) in this object.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(mappedBy = "species")
-	@LazyCollection(LazyCollectionOption.FALSE)
-	private List<AntisenseRnaRegion>	regions	= new ArrayList<AntisenseRnaRegion>();
-
-	/**
-	 * Constructor that copies the data from species given in the argument.
-	 * 
-	 * @param species
-	 *          parent species from which we want to copy data
-	 */
-	public AntisenseRna(Species species) {
-		super(species);
-		if (species instanceof AntisenseRna) {
-			AntisenseRna asRna = (AntisenseRna) species;
-			for (AntisenseRnaRegion region : asRna.getRegions()) {
-				addRegion(new AntisenseRnaRegion(region));
-			}
-		}
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public AntisenseRna() {
-		super();
-	}
-
-	@Override
-	public AntisenseRna copy() {
-		if (this.getClass() == AntisenseRna.class) {
-			return new AntisenseRna(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Antisense RNA";
-	}
-
-	/**
-	 * Addd antisense rna region (part of rna sequence that has some meaning) to
-	 * the object. If the region with given id exists then the data of this region
-	 * is copied to the one that is already in the {@link AntisenseRna}.
-	 * 
-	 * 
-	 * @param region
-	 *          region to add
-	 */
-	public void addRegion(AntisenseRnaRegion region) {
-		for (AntisenseRnaRegion region2 : regions) {
-			if (region2.getIdAntisenseRnaRegion().equals(region.getIdAntisenseRnaRegion())) {
-				region2.update(region);
-				return;
-			}
-		}
-
-		regions.add(region);
-		region.setSpecies(this);
-	}
-
-	@Override
-	public void update(Species sp) {
-		super.update(sp);
-		if (sp instanceof AntisenseRna) {
-			AntisenseRna rna = (AntisenseRna) sp;
-			for (AntisenseRnaRegion mr : getRegions()) {
-				mr.setState(null);
-			}
-
-			for (AntisenseRnaRegion region : rna.getRegions()) {
-				updateRegion(region);
-			}
-		}
-	}
-
-	/**
-	 * Method update antisense rna region from the object in params (if the object
-	 * with the same id already exists). If there is no object with given id then
-	 * new object is added to antisense rna.
-	 * 
-	 * @param param
-	 *          - object with new data from where update should be performed
-	 */
-	private void updateRegion(AntisenseRnaRegion param) {
-		for (AntisenseRnaRegion region : regions) {
-			if (region.getIdAntisenseRnaRegion().equals(param.getIdAntisenseRnaRegion())) {
-				region.update(param);
-				return;
-			}
-		}
-		regions.add(param);
-	}
-
-	/**
-	 * @return the regions
-	 * @see #regions
-	 */
-	public List<AntisenseRnaRegion> getRegions() {
-		return regions;
-	}
-
-	/**
-	 * @param regions
-	 *          the regions to set
-	 * @see #regions
-	 */
-	public void setRegions(List<AntisenseRnaRegion> regions) {
-		this.regions = regions;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
+
+import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+import org.hibernate.annotations.LazyCollection;
+import org.hibernate.annotations.LazyCollectionOption;
+
+/**
+ * Class representing antisense rna in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Antisense RNA")
+public class AntisenseRna extends Species {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger							logger	= Logger.getLogger(AntisenseRna.class);
+
+	/**
+	 * List of antisense rna regions (some rna sequences) in this object.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(mappedBy = "species")
+	@LazyCollection(LazyCollectionOption.FALSE)
+	private List<AntisenseRnaRegion>	regions	= new ArrayList<AntisenseRnaRegion>();
+
+	/**
+	 * Constructor that copies the data from species given in the argument.
+	 * 
+	 * @param species
+	 *          parent species from which we want to copy data
+	 */
+	public AntisenseRna(Species species) {
+		super(species);
+		if (species instanceof AntisenseRna) {
+			AntisenseRna asRna = (AntisenseRna) species;
+			for (AntisenseRnaRegion region : asRna.getRegions()) {
+				addRegion(new AntisenseRnaRegion(region));
+			}
+		}
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public AntisenseRna() {
+		super();
+	}
+
+	@Override
+	public AntisenseRna copy() {
+		if (this.getClass() == AntisenseRna.class) {
+			return new AntisenseRna(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Antisense RNA";
+	}
+
+	/**
+	 * Addd antisense rna region (part of rna sequence that has some meaning) to
+	 * the object. If the region with given id exists then the data of this region
+	 * is copied to the one that is already in the {@link AntisenseRna}.
+	 * 
+	 * 
+	 * @param region
+	 *          region to add
+	 */
+	public void addRegion(AntisenseRnaRegion region) {
+		for (AntisenseRnaRegion region2 : regions) {
+			if (region2.getIdAntisenseRnaRegion().equals(region.getIdAntisenseRnaRegion())) {
+				region2.update(region);
+				return;
+			}
+		}
+
+		regions.add(region);
+		region.setSpecies(this);
+	}
+
+	@Override
+	public void update(Species sp) {
+		super.update(sp);
+		if (sp instanceof AntisenseRna) {
+			AntisenseRna rna = (AntisenseRna) sp;
+			for (AntisenseRnaRegion mr : getRegions()) {
+				mr.setState(null);
+			}
+
+			for (AntisenseRnaRegion region : rna.getRegions()) {
+				updateRegion(region);
+			}
+		}
+	}
+
+	/**
+	 * Method update antisense rna region from the object in params (if the object
+	 * with the same id already exists). If there is no object with given id then
+	 * new object is added to antisense rna.
+	 * 
+	 * @param param
+	 *          - object with new data from where update should be performed
+	 */
+	private void updateRegion(AntisenseRnaRegion param) {
+		for (AntisenseRnaRegion region : regions) {
+			if (region.getIdAntisenseRnaRegion().equals(param.getIdAntisenseRnaRegion())) {
+				region.update(param);
+				return;
+			}
+		}
+		regions.add(param);
+	}
+
+	/**
+	 * @return the regions
+	 * @see #regions
+	 */
+	public List<AntisenseRnaRegion> getRegions() {
+		return regions;
+	}
+
+	/**
+	 * @param regions
+	 *          the regions to set
+	 * @see #regions
+	 */
+	public void setRegions(List<AntisenseRnaRegion> regions) {
+		this.regions = regions;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/AntisenseRnaComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/AntisenseRnaComparator.java
index 291030d391..0f0b0e3188 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/AntisenseRnaComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/AntisenseRnaComparator.java
@@ -1,103 +1,103 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Set;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.StringSetComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
-
-/**
- * This class implements comparator interface for AntisenseRna.
- * 
- * @author Piotr Gawron
- * 
- */
-public class AntisenseRnaComparator implements Comparator<AntisenseRna> {
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public AntisenseRnaComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public AntisenseRnaComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(AntisenseRna arg0, AntisenseRna arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(AntisenseRna.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in AntisenseRna class
-	 * in inheritence tree. It also calls the comparator for super class
-	 * (Species).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(AntisenseRna arg0, AntisenseRna arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-		StringSetComparator stringSetComparator = new StringSetComparator();
-
-		Set<String> set1 = new HashSet<String>();
-		Set<String> set2 = new HashSet<String>();
-
-		for (AntisenseRnaRegion region : arg0.getRegions()) {
-			set1.add(region.toString());
-		}
-
-		for (AntisenseRnaRegion region : arg1.getRegions()) {
-			set2.add(region.toString());
-		}
-
-		if (stringSetComparator.compare(set1, set2) != 0) {
-			return stringSetComparator.compare(set1, set2);
-		}
-
-		return 0;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Set;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.StringSetComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
+
+/**
+ * This class implements comparator interface for AntisenseRna.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class AntisenseRnaComparator implements Comparator<AntisenseRna> {
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public AntisenseRnaComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public AntisenseRnaComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(AntisenseRna arg0, AntisenseRna arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(AntisenseRna.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in AntisenseRna class
+	 * in inheritence tree. It also calls the comparator for super class
+	 * (Species).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(AntisenseRna arg0, AntisenseRna arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		StringSetComparator stringSetComparator = new StringSetComparator();
+
+		Set<String> set1 = new HashSet<String>();
+		Set<String> set2 = new HashSet<String>();
+
+		for (AntisenseRnaRegion region : arg0.getRegions()) {
+			set1.add(region.toString());
+		}
+
+		for (AntisenseRnaRegion region : arg1.getRegions()) {
+			set2.add(region.toString());
+		}
+
+		if (stringSetComparator.compare(set1, set2) != 0) {
+			return stringSetComparator.compare(set1, set2);
+		}
+
+		return 0;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/ComplexSpecies.java b/model/src/main/java/lcsb/mapviewer/model/map/species/ComplexSpecies.java
index ad1294daa5..11bf29ea04 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/ComplexSpecies.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/ComplexSpecies.java
@@ -1,170 +1,170 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.persistence.Column;
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.OneToMany;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-
-/**
- * Class representing complex in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("COMPLEX_SPECIES")
-public class ComplexSpecies extends Species {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger			logger					 = Logger.getLogger(ComplexSpecies.class.getName());
-
-	/**
-	 * Elements that exists in this complex.
-	 */
-	@OneToMany(mappedBy = "complex")
-	private Set<Element>			elements				 = new HashSet<Element>();
-
-	/**
-	 * State of the complex species.
-	 */
-	@Column(name = "structuralState")
-	private String						structuralState	 = null;
-
-	/**
-	 * Default constructor.
-	 */
-	public ComplexSpecies() {
-		super();
-	}
-
-	/**
-	 * Constructor that initiale the complex with the data from the object passed
-	 * as an argument.
-	 * 
-	 * @param original
-	 *          object used for initializing data
-	 */
-	public ComplexSpecies(Species original) {
-		super(original);
-		if (original instanceof ComplexSpecies) {
-			structuralState = ((ComplexSpecies) original).getStructuralState();
-			for (Element element : ((ComplexSpecies) original).getElements()) {
-				addElement(element.copy());
-			}
-		}
-	}
-
-	/**
-	 * Constructor with species id.
-	 * 
-	 * @param complexId
-	 *          {@link Species#idSpecies}
-	 */
-	public ComplexSpecies(String complexId) {
-		super(complexId);
-	}
-
-	@Override
-	public ComplexSpecies copy() {
-		if (this.getClass() == ComplexSpecies.class) {
-			return new ComplexSpecies(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Complex species";
-	}
-
-	/**
-	 * Adds element to the complex.
-	 * 
-	 * @param element
-	 *          object to add
-	 */
-	public void addElement(Element element) {
-		if (element instanceof Species) {
-			for (Element el : elements) {
-				if (el instanceof Species) {
-					if (((Species) el).getElementId().equals(((Species) element).getElementId())) {
-						throw new InvalidArgumentException("Cannot add two species with the same id: " + ((Species) el).getElementId());
-					}
-				}
-			}
-		}
-		this.elements.add(element);
-	}
-
-	/**
-	 * Returns list of all elements in the complex. Also subelements are included.
-	 * 
-	 * @return list of all elements in the complex.
-	 */
-	public Set<Species> getAllSimpleChildren() {
-		Set<Species> result = new HashSet<Species>();
-		for (Element element : getElements()) {
-			if (element instanceof ComplexSpecies) {
-				result.addAll(((ComplexSpecies) element).getAllSimpleChildren());
-			} else if (element instanceof Species) {
-				result.add((Species) element);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * @return the structuralState
-	 * @see #structuralState
-	 */
-	public String getStructuralState() {
-		return structuralState;
-	}
-
-	/**
-	 * @param structuralState
-	 *          the structuralState to set
-	 * @see #structuralState
-	 */
-	public void setStructuralState(String structuralState) {
-		if (this.structuralState != null && !this.structuralState.equals("") && !this.structuralState.equals(structuralState)) {
-			logger.warn("replacing structural state, Old: " + this.structuralState + " into new: " + structuralState);
-		}
-		this.structuralState = structuralState;
-	}
-
-	/**
-	 * @return the elements
-	 * @see #elements
-	 */
-	public Set<Element> getElements() {
-		return elements;
-	}
-
-	/**
-	 * @param elements
-	 *          the elements to set
-	 * @see #elements
-	 */
-	public void setElements(Set<Element> elements) {
-		this.elements = elements;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+
+/**
+ * Class representing complex in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("COMPLEX_SPECIES")
+public class ComplexSpecies extends Species {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger			logger					 = Logger.getLogger(ComplexSpecies.class.getName());
+
+	/**
+	 * Elements that exists in this complex.
+	 */
+	@OneToMany(mappedBy = "complex")
+	private Set<Element>			elements				 = new HashSet<Element>();
+
+	/**
+	 * State of the complex species.
+	 */
+	@Column(name = "structuralState")
+	private String						structuralState	 = null;
+
+	/**
+	 * Default constructor.
+	 */
+	public ComplexSpecies() {
+		super();
+	}
+
+	/**
+	 * Constructor that initiale the complex with the data from the object passed
+	 * as an argument.
+	 * 
+	 * @param original
+	 *          object used for initializing data
+	 */
+	public ComplexSpecies(Species original) {
+		super(original);
+		if (original instanceof ComplexSpecies) {
+			structuralState = ((ComplexSpecies) original).getStructuralState();
+			for (Element element : ((ComplexSpecies) original).getElements()) {
+				addElement(element.copy());
+			}
+		}
+	}
+
+	/**
+	 * Constructor with species id.
+	 * 
+	 * @param complexId
+	 *          {@link Species#idSpecies}
+	 */
+	public ComplexSpecies(String complexId) {
+		super(complexId);
+	}
+
+	@Override
+	public ComplexSpecies copy() {
+		if (this.getClass() == ComplexSpecies.class) {
+			return new ComplexSpecies(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Complex species";
+	}
+
+	/**
+	 * Adds element to the complex.
+	 * 
+	 * @param element
+	 *          object to add
+	 */
+	public void addElement(Element element) {
+		if (element instanceof Species) {
+			for (Element el : elements) {
+				if (el instanceof Species) {
+					if (((Species) el).getElementId().equals(((Species) element).getElementId())) {
+						throw new InvalidArgumentException("Cannot add two species with the same id: " + ((Species) el).getElementId());
+					}
+				}
+			}
+		}
+		this.elements.add(element);
+	}
+
+	/**
+	 * Returns list of all elements in the complex. Also subelements are included.
+	 * 
+	 * @return list of all elements in the complex.
+	 */
+	public Set<Species> getAllSimpleChildren() {
+		Set<Species> result = new HashSet<Species>();
+		for (Element element : getElements()) {
+			if (element instanceof ComplexSpecies) {
+				result.addAll(((ComplexSpecies) element).getAllSimpleChildren());
+			} else if (element instanceof Species) {
+				result.add((Species) element);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @return the structuralState
+	 * @see #structuralState
+	 */
+	public String getStructuralState() {
+		return structuralState;
+	}
+
+	/**
+	 * @param structuralState
+	 *          the structuralState to set
+	 * @see #structuralState
+	 */
+	public void setStructuralState(String structuralState) {
+		if (this.structuralState != null && !this.structuralState.equals("") && !this.structuralState.equals(structuralState)) {
+			logger.warn("replacing structural state, Old: " + this.structuralState + " into new: " + structuralState);
+		}
+		this.structuralState = structuralState;
+	}
+
+	/**
+	 * @return the elements
+	 * @see #elements
+	 */
+	public Set<Element> getElements() {
+		return elements;
+	}
+
+	/**
+	 * @param elements
+	 *          the elements to set
+	 * @see #elements
+	 */
+	public void setElements(Set<Element> elements) {
+		this.elements = elements;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/ComplexSpeciesComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/ComplexSpeciesComparator.java
index 276f3c91cc..70c072161e 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/ComplexSpeciesComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/ComplexSpeciesComparator.java
@@ -1,191 +1,191 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.IntegerComparator;
-import lcsb.mapviewer.common.comparator.StringComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.ElementComparator;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-
-/**
- * This class implements comparator interface for ComplexSpecies.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ComplexSpeciesComparator implements Comparator<ComplexSpecies> {
-	/**
-	 * Default class logger.
-	 */
-	private Logger logger	= Logger.getLogger(ComplexSpeciesComparator.class);
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public ComplexSpeciesComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public ComplexSpeciesComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(ComplexSpecies arg0, ComplexSpecies arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(ComplexSpecies.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in ComplexSpecies
-	 * class in inheritence tree. It also calls the comparator for super class
-	 * (Species).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(ComplexSpecies arg0, ComplexSpecies arg1) {
-		ElementComparator elementComparator = new ElementComparator(epsilon);
-
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-
-		IntegerComparator integerComparator = new IntegerComparator();
-		StringComparator stringComparator = new StringComparator();
-
-		if (integerComparator.compare(arg0.getHomodimer(), arg1.getHomodimer()) != 0) {
-			logger.debug("Homodimer different: " + arg0.getHomodimer() + ", " + arg1.getHomodimer());
-			return integerComparator.compare(arg0.getHomodimer(), arg1.getHomodimer());
-		}
-
-		if (integerComparator.compare(arg0.getElements().size(), arg1.getElements().size()) != 0) {
-			logger.debug("Species size different: " + arg0.getElements().size() + ", " + arg1.getElements().size());
-			return integerComparator.compare(arg0.getElements().size(), arg1.getElements().size());
-		}
-
-		if (stringComparator.compare(arg0.getStructuralState(), arg1.getStructuralState()) != 0) {
-			logger.debug("Species structuralState different: " + arg0.getStructuralState() + ", " + arg1.getStructuralState());
-			return stringComparator.compare(arg0.getStructuralState(), arg1.getStructuralState());
-		}
-
-		for (Element element : arg0.getElements()) {
-			boolean found = false;
-
-			if (element instanceof Species) {
-				for (Element element1 : arg1.getElements()) {
-					if (element1 instanceof Species) {
-						if (((Species) element).getElementId().equals(((Species) element1).getElementId())) {
-							if (elementComparator.compare(element, element1) != 0) {
-								logger.debug("Species different: " + ((Species) element).getElementId());
-								return elementComparator.compare(element, element1);
-							} else {
-								found = true;
-							}
-						}
-					}
-				}
-
-			} else if (element instanceof Compartment) {
-				for (Element element1 : arg1.getElements()) {
-					if (element1 instanceof Compartment) {
-						if (((Compartment) element).getElementId().equals(((Compartment) element1).getElementId())) {
-							if (elementComparator.compare(element, element1) != 0) {
-								logger.debug("Compartment different: " + ((Compartment) element).getElementId());
-								return elementComparator.compare(element, element1);
-							} else {
-								found = true;
-							}
-						}
-					}
-				}
-			} else {
-				throw new NotImplementedException("Don't know how to compare: " + element.getClass());
-			}
-			if (!found) {
-				if (element instanceof Species) {
-					logger.debug("Cannot find element: " + element.getElementId() + " in:");
-					for (Element el : arg1.getElements()) {
-						logger.debug(el.getElementId());
-					}
-				}
-				return -1;
-			}
-		}
-
-		for (Element element : arg1.getElements()) {
-			boolean found = false;
-
-			if (element instanceof Species) {
-				for (Element element1 : arg0.getElements()) {
-					if (element1 instanceof Species) {
-						if (element.getElementId().equals(element1.getElementId())) {
-							if (elementComparator.compare(element, element1) == 0) {
-								found = true;
-							}
-						}
-					}
-				}
-
-			} else if (element instanceof Compartment) {
-				for (Element element1 : arg0.getElements()) {
-					if (element1 instanceof Compartment) {
-						if (element.getElementId().equals(element1.getElementId())) {
-							if (elementComparator.compare(element, element1) == 0) {
-								found = true;
-							}
-						}
-					}
-				}
-			} else {
-				throw new NotImplementedException("Don't know how to compare: " + element.getClass());
-			}
-			if (!found) {
-				logger.debug("Cannot find element: " + element.getElementId());
-				return 1;
-			}
-		}
-
-		return 0;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.IntegerComparator;
+import lcsb.mapviewer.common.comparator.StringComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.ElementComparator;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+
+/**
+ * This class implements comparator interface for ComplexSpecies.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ComplexSpeciesComparator implements Comparator<ComplexSpecies> {
+	/**
+	 * Default class logger.
+	 */
+	private Logger logger	= Logger.getLogger(ComplexSpeciesComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public ComplexSpeciesComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public ComplexSpeciesComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(ComplexSpecies arg0, ComplexSpecies arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(ComplexSpecies.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in ComplexSpecies
+	 * class in inheritence tree. It also calls the comparator for super class
+	 * (Species).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(ComplexSpecies arg0, ComplexSpecies arg1) {
+		ElementComparator elementComparator = new ElementComparator(epsilon);
+
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+
+		IntegerComparator integerComparator = new IntegerComparator();
+		StringComparator stringComparator = new StringComparator();
+
+		if (integerComparator.compare(arg0.getHomodimer(), arg1.getHomodimer()) != 0) {
+			logger.debug("Homodimer different: " + arg0.getHomodimer() + ", " + arg1.getHomodimer());
+			return integerComparator.compare(arg0.getHomodimer(), arg1.getHomodimer());
+		}
+
+		if (integerComparator.compare(arg0.getElements().size(), arg1.getElements().size()) != 0) {
+			logger.debug("Species size different: " + arg0.getElements().size() + ", " + arg1.getElements().size());
+			return integerComparator.compare(arg0.getElements().size(), arg1.getElements().size());
+		}
+
+		if (stringComparator.compare(arg0.getStructuralState(), arg1.getStructuralState()) != 0) {
+			logger.debug("Species structuralState different: " + arg0.getStructuralState() + ", " + arg1.getStructuralState());
+			return stringComparator.compare(arg0.getStructuralState(), arg1.getStructuralState());
+		}
+
+		for (Element element : arg0.getElements()) {
+			boolean found = false;
+
+			if (element instanceof Species) {
+				for (Element element1 : arg1.getElements()) {
+					if (element1 instanceof Species) {
+						if (((Species) element).getElementId().equals(((Species) element1).getElementId())) {
+							if (elementComparator.compare(element, element1) != 0) {
+								logger.debug("Species different: " + ((Species) element).getElementId());
+								return elementComparator.compare(element, element1);
+							} else {
+								found = true;
+							}
+						}
+					}
+				}
+
+			} else if (element instanceof Compartment) {
+				for (Element element1 : arg1.getElements()) {
+					if (element1 instanceof Compartment) {
+						if (((Compartment) element).getElementId().equals(((Compartment) element1).getElementId())) {
+							if (elementComparator.compare(element, element1) != 0) {
+								logger.debug("Compartment different: " + ((Compartment) element).getElementId());
+								return elementComparator.compare(element, element1);
+							} else {
+								found = true;
+							}
+						}
+					}
+				}
+			} else {
+				throw new NotImplementedException("Don't know how to compare: " + element.getClass());
+			}
+			if (!found) {
+				if (element instanceof Species) {
+					logger.debug("Cannot find element: " + element.getElementId() + " in:");
+					for (Element el : arg1.getElements()) {
+						logger.debug(el.getElementId());
+					}
+				}
+				return -1;
+			}
+		}
+
+		for (Element element : arg1.getElements()) {
+			boolean found = false;
+
+			if (element instanceof Species) {
+				for (Element element1 : arg0.getElements()) {
+					if (element1 instanceof Species) {
+						if (element.getElementId().equals(element1.getElementId())) {
+							if (elementComparator.compare(element, element1) == 0) {
+								found = true;
+							}
+						}
+					}
+				}
+
+			} else if (element instanceof Compartment) {
+				for (Element element1 : arg0.getElements()) {
+					if (element1 instanceof Compartment) {
+						if (element.getElementId().equals(element1.getElementId())) {
+							if (elementComparator.compare(element, element1) == 0) {
+								found = true;
+							}
+						}
+					}
+				}
+			} else {
+				throw new NotImplementedException("Don't know how to compare: " + element.getClass());
+			}
+			if (!found) {
+				logger.debug("Cannot find element: " + element.getElementId());
+				return 1;
+			}
+		}
+
+		return 0;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Degraded.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Degraded.java
index ad5ed16b9e..ab7814a667 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Degraded.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Degraded.java
@@ -1,53 +1,53 @@
-package lcsb.mapviewer.model.map.species;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * Class representing degraded objects in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Degraded")
-public class Degraded extends Species {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Constructor that copies the data from species given in the argument.
-	 * 
-	 * @param species
-	 *          parent species from which we want to copy data
-	 */
-	public Degraded(Species species) {
-		super(species);
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Degraded() {
-	}
-
-	@Override
-	public Degraded copy() {
-		if (this.getClass() == Degraded.class) {
-			return new Degraded(super.copy());
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Degraded";
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * Class representing degraded objects in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Degraded")
+public class Degraded extends Species {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Constructor that copies the data from species given in the argument.
+	 * 
+	 * @param species
+	 *          parent species from which we want to copy data
+	 */
+	public Degraded(Species species) {
+		super(species);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Degraded() {
+	}
+
+	@Override
+	public Degraded copy() {
+		if (this.getClass() == Degraded.class) {
+			return new Degraded(super.copy());
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Degraded";
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/DegradedComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/DegradedComparator.java
index a5a2ea5d19..341a95a1d6 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/DegradedComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/DegradedComparator.java
@@ -1,82 +1,82 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * This class implements comparator interface for Degraded.
- * 
- * @author Piotr Gawron
- * 
- * @see Degraded
- */
-public class DegradedComparator implements Comparator<Degraded> {
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public DegradedComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public DegradedComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(Degraded arg0, Degraded arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(Degraded.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in Degraded class in
-	 * inheritence tree. It also calls the comparator for super class (Species).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(Degraded arg0, Degraded arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-
-		return 0;
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * This class implements comparator interface for Degraded.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see Degraded
+ */
+public class DegradedComparator implements Comparator<Degraded> {
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public DegradedComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public DegradedComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(Degraded arg0, Degraded arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(Degraded.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in Degraded class in
+	 * inheritence tree. It also calls the comparator for super class (Species).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(Degraded arg0, Degraded arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Drug.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Drug.java
index 46003e825e..a715f05a22 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Drug.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Drug.java
@@ -1,53 +1,53 @@
-package lcsb.mapviewer.model.map.species;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * Class representing drug in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Drug")
-public class Drug extends Species {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * Constructor that copies the data from species given in the argument.
-	 * 
-	 * @param species
-	 *          parent species from which we want to copy data
-	 */
-	public Drug(Species species) {
-		super(species);
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Drug() {
-	}
-
-	@Override
-	public Drug copy() {
-		if (this.getClass() == Drug.class) {
-			return new Drug(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Drug";
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * Class representing drug in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Drug")
+public class Drug extends Species {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * Constructor that copies the data from species given in the argument.
+	 * 
+	 * @param species
+	 *          parent species from which we want to copy data
+	 */
+	public Drug(Species species) {
+		super(species);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Drug() {
+	}
+
+	@Override
+	public Drug copy() {
+		if (this.getClass() == Drug.class) {
+			return new Drug(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Drug";
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/DrugComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/DrugComparator.java
index 151c3a013b..722268f526 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/DrugComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/DrugComparator.java
@@ -1,81 +1,81 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * This class implements comparator interface for Drug.
- * 
- * @author Piotr Gawron
- * 
- * @see Drug
- */
-public class DrugComparator implements Comparator<Drug> {
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public DrugComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public DrugComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(Drug arg0, Drug arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(Drug.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in Drug class in
-	 * inheritence tree. It also calls the comparator for super class (Species).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(Drug arg0, Drug arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-		return 0;
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * This class implements comparator interface for Drug.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see Drug
+ */
+public class DrugComparator implements Comparator<Drug> {
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public DrugComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public DrugComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(Drug arg0, Drug arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(Drug.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in Drug class in
+	 * inheritence tree. It also calls the comparator for super class (Species).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(Drug arg0, Drug arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Gene.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Gene.java
index 46e12b647f..fa39d6f5ad 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Gene.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Gene.java
@@ -1,125 +1,125 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.OneToMany;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-import org.hibernate.annotations.LazyCollection;
-import org.hibernate.annotations.LazyCollectionOption;
-
-/**
- * Class representing gene in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Gene")
-public class Gene extends Species {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * List of modifications for the Gene.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(mappedBy = "species", orphanRemoval = true)
-	@LazyCollection(LazyCollectionOption.FALSE)
-	private List<ModificationResidue>	modificationResidues	= new ArrayList<ModificationResidue>();
-
-	/**
-	 * Constructor that initializes gene with the data passed in the argument.
-	 * 
-	 * @param species
-	 *          original species used for data initialization
-	 */
-	public Gene(Species species) {
-		super(species);
-		if (species instanceof Gene) {
-			Gene gene = (Gene) species;
-			for (ModificationResidue mr : gene.getModificationResidues()) {
-				addModificationResidue(new ModificationResidue(mr));
-			}
-		}
-	}
-
-	@Override
-	public void update(Species species) {
-		super.update(species);
-		if (species instanceof Gene) {
-			Gene gene = (Gene) species;
-
-			for (ModificationResidue mr : gene.getModificationResidues()) {
-				addModificationResidue(mr);
-			}
-		}
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Gene() {
-		super();
-	}
-
-	@Override
-	public Gene copy() {
-		if (this.getClass() == Gene.class) {
-			return new Gene(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Gene";
-	}
-
-	/**
-	 * Adds modification to the gene.
-	 * 
-	 * @param modificationResidue
-	 *          modifiaction to add
-	 */
-	public void addModificationResidue(ModificationResidue modificationResidue) {
-		for (ModificationResidue mr : modificationResidues) {
-			if (mr.getIdModificationResidue().equals(modificationResidue.getIdModificationResidue())) {
-				mr.update(modificationResidue);
-				return;
-			}
-		}
-		modificationResidues.add(modificationResidue);
-		modificationResidue.setSpecies(this);
-
-	}
-
-	/**
-	 * @return the modificationResidues
-	 * @see #modificationResidues
-	 */
-	public List<ModificationResidue> getModificationResidues() {
-		return modificationResidues;
-	}
-
-	/**
-	 * @param modificationResidues
-	 *          the modificationResidues to set
-	 * @see #modificationResidues
-	 */
-	public void setModificationResidues(List<ModificationResidue> modificationResidues) {
-		this.modificationResidues = modificationResidues;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+import org.hibernate.annotations.LazyCollection;
+import org.hibernate.annotations.LazyCollectionOption;
+
+/**
+ * Class representing gene in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Gene")
+public class Gene extends Species {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * List of modifications for the Gene.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(mappedBy = "species", orphanRemoval = true)
+	@LazyCollection(LazyCollectionOption.FALSE)
+	private List<ModificationResidue>	modificationResidues	= new ArrayList<ModificationResidue>();
+
+	/**
+	 * Constructor that initializes gene with the data passed in the argument.
+	 * 
+	 * @param species
+	 *          original species used for data initialization
+	 */
+	public Gene(Species species) {
+		super(species);
+		if (species instanceof Gene) {
+			Gene gene = (Gene) species;
+			for (ModificationResidue mr : gene.getModificationResidues()) {
+				addModificationResidue(new ModificationResidue(mr));
+			}
+		}
+	}
+
+	@Override
+	public void update(Species species) {
+		super.update(species);
+		if (species instanceof Gene) {
+			Gene gene = (Gene) species;
+
+			for (ModificationResidue mr : gene.getModificationResidues()) {
+				addModificationResidue(mr);
+			}
+		}
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Gene() {
+		super();
+	}
+
+	@Override
+	public Gene copy() {
+		if (this.getClass() == Gene.class) {
+			return new Gene(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Gene";
+	}
+
+	/**
+	 * Adds modification to the gene.
+	 * 
+	 * @param modificationResidue
+	 *          modifiaction to add
+	 */
+	public void addModificationResidue(ModificationResidue modificationResidue) {
+		for (ModificationResidue mr : modificationResidues) {
+			if (mr.getIdModificationResidue().equals(modificationResidue.getIdModificationResidue())) {
+				mr.update(modificationResidue);
+				return;
+			}
+		}
+		modificationResidues.add(modificationResidue);
+		modificationResidue.setSpecies(this);
+
+	}
+
+	/**
+	 * @return the modificationResidues
+	 * @see #modificationResidues
+	 */
+	public List<ModificationResidue> getModificationResidues() {
+		return modificationResidues;
+	}
+
+	/**
+	 * @param modificationResidues
+	 *          the modificationResidues to set
+	 * @see #modificationResidues
+	 */
+	public void setModificationResidues(List<ModificationResidue> modificationResidues) {
+		this.modificationResidues = modificationResidues;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/GeneComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/GeneComparator.java
index abace22624..2522cbdcd6 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/GeneComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/GeneComparator.java
@@ -1,105 +1,105 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Set;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.StringSetComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-
-/**
- * This class implements comparator interface for Gene.
- * 
- * @author Piotr Gawron
- * 
- * @see Gene
- */
-public class GeneComparator implements Comparator<Gene> {
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public GeneComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public GeneComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(Gene arg0, Gene arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(Gene.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in Gene class in
-	 * inheritence tree. It also calls the comparator for the super class (
-	 * {@link Species}): {@link SpeciesComparator}.
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(Gene arg0, Gene arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-
-		StringSetComparator stringSetComparator = new StringSetComparator();
-
-		Set<String> set1 = new HashSet<String>();
-		Set<String> set2 = new HashSet<String>();
-
-		for (ModificationResidue region : arg0.getModificationResidues()) {
-			set1.add(region.toString());
-		}
-
-		for (ModificationResidue region : arg1.getModificationResidues()) {
-			set2.add(region.toString());
-		}
-
-		if (stringSetComparator.compare(set1, set2) != 0) {
-			return stringSetComparator.compare(set1, set2);
-		}
-
-		return 0;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Set;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.StringSetComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+
+/**
+ * This class implements comparator interface for Gene.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see Gene
+ */
+public class GeneComparator implements Comparator<Gene> {
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public GeneComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public GeneComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(Gene arg0, Gene arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(Gene.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in Gene class in
+	 * inheritence tree. It also calls the comparator for the super class (
+	 * {@link Species}): {@link SpeciesComparator}.
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(Gene arg0, Gene arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+
+		StringSetComparator stringSetComparator = new StringSetComparator();
+
+		Set<String> set1 = new HashSet<String>();
+		Set<String> set2 = new HashSet<String>();
+
+		for (ModificationResidue region : arg0.getModificationResidues()) {
+			set1.add(region.toString());
+		}
+
+		for (ModificationResidue region : arg1.getModificationResidues()) {
+			set2.add(region.toString());
+		}
+
+		if (stringSetComparator.compare(set1, set2) != 0) {
+			return stringSetComparator.compare(set1, set2);
+		}
+
+		return 0;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/GenericProtein.java b/model/src/main/java/lcsb/mapviewer/model/map/species/GenericProtein.java
index f8e69836ca..52d5e72182 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/GenericProtein.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/GenericProtein.java
@@ -1,47 +1,47 @@
-package lcsb.mapviewer.model.map.species;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * Generic protein.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("GENERIC_PROTEIN")
-public class GenericProtein extends Protein {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * Default constructor.
-	 */
-	public GenericProtein() {
-		super();
-	}
-
-	/**
-	 * Constructor that creates a copy of species.
-	 * 
-	 * @param species original species 
-	 */
-	public GenericProtein(Species species) {
-		super(species);
-	}
-
-	@Override
-	public GenericProtein copy() {
-		if (this.getClass().equals(GenericProtein.class)) {
-			return new GenericProtein(this);
-		} else {
-			throw new NotImplementedException("Copy method for " + this.getClass() + " class not implemented");
-		}
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * Generic protein.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("GENERIC_PROTEIN")
+public class GenericProtein extends Protein {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * Default constructor.
+	 */
+	public GenericProtein() {
+		super();
+	}
+
+	/**
+	 * Constructor that creates a copy of species.
+	 * 
+	 * @param species original species 
+	 */
+	public GenericProtein(Species species) {
+		super(species);
+	}
+
+	@Override
+	public GenericProtein copy() {
+		if (this.getClass().equals(GenericProtein.class)) {
+			return new GenericProtein(this);
+		} else {
+			throw new NotImplementedException("Copy method for " + this.getClass() + " class not implemented");
+		}
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Ion.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Ion.java
index 19fd30f899..4f5e97d4aa 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Ion.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Ion.java
@@ -1,54 +1,54 @@
-package lcsb.mapviewer.model.map.species;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * Class representing ion in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Ion")
-public class Ion extends Chemical {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * Constructor that initializes ion with the data passed in the argument.
-	 * 
-	 * @param species
-	 *          original species used for data initialization
-	 */
-	public Ion(Species species) {
-		super(species);
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Ion() {
-		super();
-	}
-
-	@Override
-	public Ion copy() {
-		if (this.getClass() == Ion.class) {
-			return new Ion(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Ion";
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * Class representing ion in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Ion")
+public class Ion extends Chemical {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * Constructor that initializes ion with the data passed in the argument.
+	 * 
+	 * @param species
+	 *          original species used for data initialization
+	 */
+	public Ion(Species species) {
+		super(species);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Ion() {
+		super();
+	}
+
+	@Override
+	public Ion copy() {
+		if (this.getClass() == Ion.class) {
+			return new Ion(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Ion";
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/IonComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/IonComparator.java
index 32856e36da..8c35ad4a35 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/IonComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/IonComparator.java
@@ -1,83 +1,83 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * This class implements comparator interface for Ion.
- * 
- * @author Piotr Gawron
- * 
- * @see Ion
- */
-public class IonComparator implements Comparator<Ion> {
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public IonComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public IonComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(Ion arg0, Ion arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(Ion.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in {@link Ion} class
-	 * in inheritence tree. It also calls the {@link SpeciesComparator} for the
-	 * super class ( {@link Species}).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(Ion arg0, Ion arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-		return 0;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * This class implements comparator interface for Ion.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see Ion
+ */
+public class IonComparator implements Comparator<Ion> {
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public IonComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public IonComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(Ion arg0, Ion arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(Ion.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in {@link Ion} class
+	 * in inheritence tree. It also calls the {@link SpeciesComparator} for the
+	 * super class ( {@link Species}).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(Ion arg0, Ion arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+		return 0;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Phenotype.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Phenotype.java
index 3d8700942e..8cc6ff3b6e 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Phenotype.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Phenotype.java
@@ -1,106 +1,106 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.OneToMany;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.AssociatedElement;
-
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-import org.hibernate.annotations.LazyCollection;
-import org.hibernate.annotations.LazyCollectionOption;
-
-/**
- * Class representing phenotype in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Phenotype")
-public class Phenotype extends Species {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * List of associated with this phenotape elements.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(mappedBy = "phenotype", orphanRemoval = true)
-	@LazyCollection(LazyCollectionOption.FALSE)
-	private List<AssociatedElement>	associatedElements	= new ArrayList<AssociatedElement>();
-
-	/**
-	 * Constructor that initializes phenotype with the data passed in the
-	 * argument.
-	 * 
-	 * @param species
-	 *          original species used for data initialization
-	 */
-	public Phenotype(Species species) {
-		super(species);
-		if (species instanceof Phenotype) {
-			Phenotype phenotype = (Phenotype) species;
-			for (AssociatedElement ae : phenotype.getAssociatedElements()) {
-				addAssociatedElement(new AssociatedElement(ae));
-			}
-		}
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Phenotype() {
-	}
-
-	@Override
-	public Phenotype copy() {
-		if (this.getClass() == Phenotype.class) {
-			return new Phenotype(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Phenotype";
-	}
-
-	/**
-	 * Adds associated element to the phenotype.
-	 * 
-	 * @param ae
-	 *          associated element to add
-	 */
-	public void addAssociatedElement(AssociatedElement ae) {
-		associatedElements.add(ae);
-		ae.setPhenotype(this);
-	}
-
-	/**
-	 * @return the associatedElements
-	 * @see #associatedElements
-	 */
-	public List<AssociatedElement> getAssociatedElements() {
-		return associatedElements;
-	}
-
-	/**
-	 * @param associatedElements
-	 *          the associatedElements to set
-	 * @see #associatedElements
-	 */
-	public void setAssociatedElements(List<AssociatedElement> associatedElements) {
-		this.associatedElements = associatedElements;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.AssociatedElement;
+
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+import org.hibernate.annotations.LazyCollection;
+import org.hibernate.annotations.LazyCollectionOption;
+
+/**
+ * Class representing phenotype in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Phenotype")
+public class Phenotype extends Species {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * List of associated with this phenotape elements.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(mappedBy = "phenotype", orphanRemoval = true)
+	@LazyCollection(LazyCollectionOption.FALSE)
+	private List<AssociatedElement>	associatedElements	= new ArrayList<AssociatedElement>();
+
+	/**
+	 * Constructor that initializes phenotype with the data passed in the
+	 * argument.
+	 * 
+	 * @param species
+	 *          original species used for data initialization
+	 */
+	public Phenotype(Species species) {
+		super(species);
+		if (species instanceof Phenotype) {
+			Phenotype phenotype = (Phenotype) species;
+			for (AssociatedElement ae : phenotype.getAssociatedElements()) {
+				addAssociatedElement(new AssociatedElement(ae));
+			}
+		}
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Phenotype() {
+	}
+
+	@Override
+	public Phenotype copy() {
+		if (this.getClass() == Phenotype.class) {
+			return new Phenotype(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Phenotype";
+	}
+
+	/**
+	 * Adds associated element to the phenotype.
+	 * 
+	 * @param ae
+	 *          associated element to add
+	 */
+	public void addAssociatedElement(AssociatedElement ae) {
+		associatedElements.add(ae);
+		ae.setPhenotype(this);
+	}
+
+	/**
+	 * @return the associatedElements
+	 * @see #associatedElements
+	 */
+	public List<AssociatedElement> getAssociatedElements() {
+		return associatedElements;
+	}
+
+	/**
+	 * @param associatedElements
+	 *          the associatedElements to set
+	 * @see #associatedElements
+	 */
+	public void setAssociatedElements(List<AssociatedElement> associatedElements) {
+		this.associatedElements = associatedElements;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/PhenotypeComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/PhenotypeComparator.java
index e24c16a23d..39318fab73 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/PhenotypeComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/PhenotypeComparator.java
@@ -1,106 +1,106 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.IntegerComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.AssociatedElementComparator;
-
-/**
- * This class implements comparator interface for Phenotype.
- * 
- * @author Piotr Gawron
- * 
- * @see Phenotype
- */
-public class PhenotypeComparator implements Comparator<Phenotype> {
-	/**
-	 * Default class logger.
-	 */
-	private Logger logger	= Logger.getLogger(PhenotypeComparator.class);
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public PhenotypeComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public PhenotypeComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(Phenotype arg0, Phenotype arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(Phenotype.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in {@link Phenotype}
-	 * class in inheritence tree. It also calls the {@link SpeciesComparator} for
-	 * the super class ( {@link Species}).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(Phenotype arg0, Phenotype arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-
-		IntegerComparator integerComparator = new IntegerComparator();
-
-		if (integerComparator.compare(arg0.getAssociatedElements().size(), arg1.getAssociatedElements().size()) != 0) {
-			logger.debug("number of associated elements different: " + arg0.getAssociatedElements().size() + ", " + arg1.getAssociatedElements().size());
-			return integerComparator.compare(arg0.getAssociatedElements().size(), arg1.getAssociatedElements().size());
-		}
-
-		AssociatedElementComparator associatedElementComparator = new AssociatedElementComparator();
-		for (int i = 0; i < arg0.getAssociatedElements().size(); i++) {
-			if (associatedElementComparator.compare(arg0.getAssociatedElements().get(i), arg1.getAssociatedElements().get(i)) != 0) {
-				logger.debug("Associated elements different");
-				return associatedElementComparator.compare(arg0.getAssociatedElements().get(i), arg1.getAssociatedElements().get(i));
-			}
-		}
-		return 0;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.IntegerComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.AssociatedElementComparator;
+
+/**
+ * This class implements comparator interface for Phenotype.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see Phenotype
+ */
+public class PhenotypeComparator implements Comparator<Phenotype> {
+	/**
+	 * Default class logger.
+	 */
+	private Logger logger	= Logger.getLogger(PhenotypeComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public PhenotypeComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public PhenotypeComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(Phenotype arg0, Phenotype arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(Phenotype.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in {@link Phenotype}
+	 * class in inheritence tree. It also calls the {@link SpeciesComparator} for
+	 * the super class ( {@link Species}).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(Phenotype arg0, Phenotype arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+
+		IntegerComparator integerComparator = new IntegerComparator();
+
+		if (integerComparator.compare(arg0.getAssociatedElements().size(), arg1.getAssociatedElements().size()) != 0) {
+			logger.debug("number of associated elements different: " + arg0.getAssociatedElements().size() + ", " + arg1.getAssociatedElements().size());
+			return integerComparator.compare(arg0.getAssociatedElements().size(), arg1.getAssociatedElements().size());
+		}
+
+		AssociatedElementComparator associatedElementComparator = new AssociatedElementComparator();
+		for (int i = 0; i < arg0.getAssociatedElements().size(); i++) {
+			if (associatedElementComparator.compare(arg0.getAssociatedElements().get(i), arg1.getAssociatedElements().get(i)) != 0) {
+				logger.debug("Associated elements different");
+				return associatedElementComparator.compare(arg0.getAssociatedElements().get(i), arg1.getAssociatedElements().get(i));
+			}
+		}
+		return 0;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Protein.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Protein.java
index a2bcc01da5..f08802e866 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Protein.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Protein.java
@@ -1,160 +1,160 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.Column;
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.OneToMany;
-
-import org.apache.log4j.Logger;
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-import org.hibernate.annotations.LazyCollection;
-import org.hibernate.annotations.LazyCollectionOption;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-
-/**
- * Class representing protein in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Protein")
-public class Protein extends Species {
-	/**
-	 * 
-	 */
-	private static final long					serialVersionUID		 = 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger							logger							 = Logger.getLogger(Protein.class.getName());
-
-	/**
-	 * State of the protein.
-	 */
-	@Column(name = "structuralState")
-	private String										structuralState			 = null;
-
-	/**
-	 * List of modifications for the Protein.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(mappedBy = "species", orphanRemoval = true)
-	@LazyCollection(LazyCollectionOption.FALSE)
-	private List<ModificationResidue>	modificationResidues = new ArrayList<ModificationResidue>();
-
-	/**
-	 * Constructor that initializes protein with the data passed in the argument.
-	 * 
-	 * @param species
-	 *          original species used for data initialization
-	 */
-	public Protein(Species species) {
-		super(species);
-		if (species instanceof Protein) {
-			Protein protein = (Protein) species;
-			if (protein.getStructuralState() != null) {
-				setStructuralState(new String(protein.getStructuralState()));
-			}
-			for (ModificationResidue mr : protein.getModificationResidues()) {
-				addModificationResidue(new ModificationResidue(mr));
-			}
-		}
-	}
-
-	@Override
-	public void update(Species species) {
-		super.update(species);
-		if (species instanceof Protein) {
-			Protein protein = (Protein) species;
-			if (getStructuralState() == null || getStructuralState().equals("")) {
-				setStructuralState(protein.getStructuralState());
-			}
-			for (ModificationResidue mr : protein.getModificationResidues()) {
-				addModificationResidue(mr);
-			}
-		}
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Protein() {
-		super();
-	}
-
-	@Override
-	public Protein copy() {
-		if (this.getClass().equals(Protein.class)) {
-			return new Protein(this);
-		} else {
-			throw new NotImplementedException("Copy method for " + this.getClass() + " class not implemented");
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Protein";
-	}
-
-	/**
-	 * Adds modification to the protein.
-	 * 
-	 * @param modificationResidue
-	 *          modification to add
-	 */
-	public void addModificationResidue(ModificationResidue modificationResidue) {
-		for (ModificationResidue mr : modificationResidues) {
-			if (mr.getIdModificationResidue().equals(modificationResidue.getIdModificationResidue())) {
-				mr.update(modificationResidue);
-				return;
-			}
-		}
-		modificationResidues.add(modificationResidue);
-		modificationResidue.setSpecies(this);
-	}
-
-	/**
-	 * @return the structuralState
-	 * @see #structuralState
-	 */
-	public String getStructuralState() {
-		return structuralState;
-	}
-
-	/**
-	 * @param structuralState
-	 *          the structuralState to set
-	 * @see #structuralState
-	 */
-	public void setStructuralState(String structuralState) {
-		if (this.structuralState != null && !this.structuralState.equals("") && !this.structuralState.equals(structuralState)) {
-			logger.warn("replacing structural state, Old: " + this.structuralState + " into new: " + structuralState);
-		}
-		this.structuralState = structuralState;
-	}
-
-	/**
-	 * @return the modificationResidues
-	 * @see #modificationResidues
-	 */
-	public List<ModificationResidue> getModificationResidues() {
-		return modificationResidues;
-	}
-
-	/**
-	 * @param modificationResidues
-	 *          the modificationResidues to set
-	 * @see #modificationResidues
-	 */
-	public void setModificationResidues(List<ModificationResidue> modificationResidues) {
-		this.modificationResidues = modificationResidues;
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+
+import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+import org.hibernate.annotations.LazyCollection;
+import org.hibernate.annotations.LazyCollectionOption;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+
+/**
+ * Class representing protein in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Protein")
+public class Protein extends Species {
+	/**
+	 * 
+	 */
+	private static final long					serialVersionUID		 = 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger							logger							 = Logger.getLogger(Protein.class.getName());
+
+	/**
+	 * State of the protein.
+	 */
+	@Column(name = "structuralState")
+	private String										structuralState			 = null;
+
+	/**
+	 * List of modifications for the Protein.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(mappedBy = "species", orphanRemoval = true)
+	@LazyCollection(LazyCollectionOption.FALSE)
+	private List<ModificationResidue>	modificationResidues = new ArrayList<ModificationResidue>();
+
+	/**
+	 * Constructor that initializes protein with the data passed in the argument.
+	 * 
+	 * @param species
+	 *          original species used for data initialization
+	 */
+	public Protein(Species species) {
+		super(species);
+		if (species instanceof Protein) {
+			Protein protein = (Protein) species;
+			if (protein.getStructuralState() != null) {
+				setStructuralState(new String(protein.getStructuralState()));
+			}
+			for (ModificationResidue mr : protein.getModificationResidues()) {
+				addModificationResidue(new ModificationResidue(mr));
+			}
+		}
+	}
+
+	@Override
+	public void update(Species species) {
+		super.update(species);
+		if (species instanceof Protein) {
+			Protein protein = (Protein) species;
+			if (getStructuralState() == null || getStructuralState().equals("")) {
+				setStructuralState(protein.getStructuralState());
+			}
+			for (ModificationResidue mr : protein.getModificationResidues()) {
+				addModificationResidue(mr);
+			}
+		}
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Protein() {
+		super();
+	}
+
+	@Override
+	public Protein copy() {
+		if (this.getClass().equals(Protein.class)) {
+			return new Protein(this);
+		} else {
+			throw new NotImplementedException("Copy method for " + this.getClass() + " class not implemented");
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Protein";
+	}
+
+	/**
+	 * Adds modification to the protein.
+	 * 
+	 * @param modificationResidue
+	 *          modification to add
+	 */
+	public void addModificationResidue(ModificationResidue modificationResidue) {
+		for (ModificationResidue mr : modificationResidues) {
+			if (mr.getIdModificationResidue().equals(modificationResidue.getIdModificationResidue())) {
+				mr.update(modificationResidue);
+				return;
+			}
+		}
+		modificationResidues.add(modificationResidue);
+		modificationResidue.setSpecies(this);
+	}
+
+	/**
+	 * @return the structuralState
+	 * @see #structuralState
+	 */
+	public String getStructuralState() {
+		return structuralState;
+	}
+
+	/**
+	 * @param structuralState
+	 *          the structuralState to set
+	 * @see #structuralState
+	 */
+	public void setStructuralState(String structuralState) {
+		if (this.structuralState != null && !this.structuralState.equals("") && !this.structuralState.equals(structuralState)) {
+			logger.warn("replacing structural state, Old: " + this.structuralState + " into new: " + structuralState);
+		}
+		this.structuralState = structuralState;
+	}
+
+	/**
+	 * @return the modificationResidues
+	 * @see #modificationResidues
+	 */
+	public List<ModificationResidue> getModificationResidues() {
+		return modificationResidues;
+	}
+
+	/**
+	 * @param modificationResidues
+	 *          the modificationResidues to set
+	 * @see #modificationResidues
+	 */
+	public void setModificationResidues(List<ModificationResidue> modificationResidues) {
+		this.modificationResidues = modificationResidues;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Rna.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Rna.java
index 5d7ca9e863..5b1cfde970 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Rna.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Rna.java
@@ -1,153 +1,153 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.OneToMany;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.RnaRegion;
-
-import org.apache.log4j.Logger;
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
-import org.hibernate.annotations.LazyCollection;
-import org.hibernate.annotations.LazyCollectionOption;
-
-/**
- * Class representing rna in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("RNA")
-public class Rna extends Species {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger		logger	= Logger.getLogger(Rna.class.getName());
-
-	/**
-	 * List of rna regions (some rna sequences) in this object.
-	 */
-	@Cascade({ CascadeType.ALL })
-	@OneToMany(mappedBy = "species", orphanRemoval = true)
-	@LazyCollection(LazyCollectionOption.FALSE)
-	private List<RnaRegion>	regions	= new ArrayList<RnaRegion>();
-
-	/**
-	 * Constructor that initializes rna with the data passed in the argument.
-	 * 
-	 * @param species
-	 *          original species used for data initialization
-	 */
-	public Rna(Species species) {
-		super(species);
-		if (species instanceof Rna) {
-			Rna rna = (Rna) species;
-			for (RnaRegion region : rna.getRegions()) {
-				addRegion(new RnaRegion(region));
-			}
-		}
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Rna() {
-		super();
-	}
-
-	@Override
-	public Rna copy() {
-		if (this.getClass() == Rna.class) {
-			return new Rna(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public void update(Species species) {
-		super.update(species);
-		if (species instanceof Rna) {
-			Rna rna = (Rna) species;
-			for (RnaRegion mr : getRegions()) {
-				mr.setState(null);
-			}
-
-			for (RnaRegion region : rna.getRegions()) {
-				updateRegion(region);
-			}
-		}
-	}
-
-	/**
-	 * Updates region in the rna. If region doesn't exist then it is added.
-	 * 
-	 * @param param
-	 *          region that with the data to update
-	 */
-	private void updateRegion(RnaRegion param) {
-		for (RnaRegion region : regions) {
-			if (region.getIdRnaRegion().equals(param.getIdRnaRegion())) {
-				region.update(param);
-				return;
-			}
-		}
-		addRegion(new RnaRegion(param));
-	}
-
-	@Override
-	public String getStringType() {
-		return "RNA";
-	}
-
-	/**
-	 * Adds region. If the region with given id exists then the data of this
-	 * region is copied to the one that is already in the {@link Rna}.
-	 * 
-	 * @param rnaRegion
-	 *          region to add
-	 */
-	public void addRegion(RnaRegion rnaRegion) {
-		for (RnaRegion region2 : regions) {
-			if (region2.getIdRnaRegion().equals(rnaRegion.getIdRnaRegion())) {
-				region2.update(rnaRegion);
-				return;
-			}
-		}
-
-		regions.add(rnaRegion);
-		rnaRegion.setSpecies(this);
-
-	}
-
-	/**
-	 * @return the regions
-	 * @see #regions
-	 */
-	public List<RnaRegion> getRegions() {
-		return regions;
-	}
-
-	/**
-	 * @param regions
-	 *          the regions to set
-	 * @see #regions
-	 */
-	public void setRegions(List<RnaRegion> regions) {
-		this.regions = regions;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.RnaRegion;
+
+import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
+import org.hibernate.annotations.CascadeType;
+import org.hibernate.annotations.LazyCollection;
+import org.hibernate.annotations.LazyCollectionOption;
+
+/**
+ * Class representing rna in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("RNA")
+public class Rna extends Species {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger		logger	= Logger.getLogger(Rna.class.getName());
+
+	/**
+	 * List of rna regions (some rna sequences) in this object.
+	 */
+	@Cascade({ CascadeType.ALL })
+	@OneToMany(mappedBy = "species", orphanRemoval = true)
+	@LazyCollection(LazyCollectionOption.FALSE)
+	private List<RnaRegion>	regions	= new ArrayList<RnaRegion>();
+
+	/**
+	 * Constructor that initializes rna with the data passed in the argument.
+	 * 
+	 * @param species
+	 *          original species used for data initialization
+	 */
+	public Rna(Species species) {
+		super(species);
+		if (species instanceof Rna) {
+			Rna rna = (Rna) species;
+			for (RnaRegion region : rna.getRegions()) {
+				addRegion(new RnaRegion(region));
+			}
+		}
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Rna() {
+		super();
+	}
+
+	@Override
+	public Rna copy() {
+		if (this.getClass() == Rna.class) {
+			return new Rna(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public void update(Species species) {
+		super.update(species);
+		if (species instanceof Rna) {
+			Rna rna = (Rna) species;
+			for (RnaRegion mr : getRegions()) {
+				mr.setState(null);
+			}
+
+			for (RnaRegion region : rna.getRegions()) {
+				updateRegion(region);
+			}
+		}
+	}
+
+	/**
+	 * Updates region in the rna. If region doesn't exist then it is added.
+	 * 
+	 * @param param
+	 *          region that with the data to update
+	 */
+	private void updateRegion(RnaRegion param) {
+		for (RnaRegion region : regions) {
+			if (region.getIdRnaRegion().equals(param.getIdRnaRegion())) {
+				region.update(param);
+				return;
+			}
+		}
+		addRegion(new RnaRegion(param));
+	}
+
+	@Override
+	public String getStringType() {
+		return "RNA";
+	}
+
+	/**
+	 * Adds region. If the region with given id exists then the data of this
+	 * region is copied to the one that is already in the {@link Rna}.
+	 * 
+	 * @param rnaRegion
+	 *          region to add
+	 */
+	public void addRegion(RnaRegion rnaRegion) {
+		for (RnaRegion region2 : regions) {
+			if (region2.getIdRnaRegion().equals(rnaRegion.getIdRnaRegion())) {
+				region2.update(rnaRegion);
+				return;
+			}
+		}
+
+		regions.add(rnaRegion);
+		rnaRegion.setSpecies(this);
+
+	}
+
+	/**
+	 * @return the regions
+	 * @see #regions
+	 */
+	public List<RnaRegion> getRegions() {
+		return regions;
+	}
+
+	/**
+	 * @param regions
+	 *          the regions to set
+	 * @see #regions
+	 */
+	public void setRegions(List<RnaRegion> regions) {
+		this.regions = regions;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/RnaComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/RnaComparator.java
index 7643fa8a66..c1273dada2 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/RnaComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/RnaComparator.java
@@ -1,105 +1,105 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Set;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.StringSetComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.RnaRegion;
-
-/**
- * This class implements comparator interface for Rna.
- * 
- * @author Piotr Gawron
- * 
- * @see Rna
- */
-public class RnaComparator implements Comparator<Rna> {
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public RnaComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public RnaComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(Rna arg0, Rna arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(Rna.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in {@link Rna} class
-	 * in inheritence tree. It also calls the {@link SpeciesComparator} for the
-	 * super class ({@link Species}).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(Rna arg0, Rna arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-
-		StringSetComparator stringSetComparator = new StringSetComparator();
-
-		Set<String> set1 = new HashSet<String>();
-		Set<String> set2 = new HashSet<String>();
-
-		for (RnaRegion region : arg0.getRegions()) {
-			set1.add(region.toString());
-		}
-
-		for (RnaRegion region : arg1.getRegions()) {
-			set2.add(region.toString());
-		}
-
-		if (stringSetComparator.compare(set1, set2) != 0) {
-			return stringSetComparator.compare(set1, set2);
-		}
-
-		return 0;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Set;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.StringSetComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.RnaRegion;
+
+/**
+ * This class implements comparator interface for Rna.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see Rna
+ */
+public class RnaComparator implements Comparator<Rna> {
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public RnaComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public RnaComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(Rna arg0, Rna arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(Rna.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in {@link Rna} class
+	 * in inheritence tree. It also calls the {@link SpeciesComparator} for the
+	 * super class ({@link Species}).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(Rna arg0, Rna arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+
+		StringSetComparator stringSetComparator = new StringSetComparator();
+
+		Set<String> set1 = new HashSet<String>();
+		Set<String> set2 = new HashSet<String>();
+
+		for (RnaRegion region : arg0.getRegions()) {
+			set1.add(region.toString());
+		}
+
+		for (RnaRegion region : arg1.getRegions()) {
+			set2.add(region.toString());
+		}
+
+		if (stringSetComparator.compare(set1, set2) != 0) {
+			return stringSetComparator.compare(set1, set2);
+		}
+
+		return 0;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/SimpleMolecule.java b/model/src/main/java/lcsb/mapviewer/model/map/species/SimpleMolecule.java
index 68591ac7b1..76ad73dec6 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/SimpleMolecule.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/SimpleMolecule.java
@@ -1,61 +1,61 @@
-package lcsb.mapviewer.model.map.species;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * Class representing molecule in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("SimpleMolecule")
-public class SimpleMolecule extends Chemical {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger	logger		= Logger.getLogger(SimpleMolecule.class.getName());
-
-	/**
-	 * Constructor that initializes molecule with the data passed in the argument.
-	 * 
-	 * @param species
-	 *          original species used for data initialization
-	 */
-	public SimpleMolecule(Species species) {
-		super(species);
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public SimpleMolecule() {
-	}
-
-	@Override
-	public SimpleMolecule copy() {
-		if (this.getClass() == SimpleMolecule.class) {
-			return new SimpleMolecule(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Simple molecule";
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * Class representing molecule in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("SimpleMolecule")
+public class SimpleMolecule extends Chemical {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger		= Logger.getLogger(SimpleMolecule.class.getName());
+
+	/**
+	 * Constructor that initializes molecule with the data passed in the argument.
+	 * 
+	 * @param species
+	 *          original species used for data initialization
+	 */
+	public SimpleMolecule(Species species) {
+		super(species);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public SimpleMolecule() {
+	}
+
+	@Override
+	public SimpleMolecule copy() {
+		if (this.getClass() == SimpleMolecule.class) {
+			return new SimpleMolecule(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Simple molecule";
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/SimpleMoleculeComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/SimpleMoleculeComparator.java
index 5e9c7a5bf7..24d954c4a3 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/SimpleMoleculeComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/SimpleMoleculeComparator.java
@@ -1,112 +1,112 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.comparator.StringComparator;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * This class implements comparator interface for SimpleMolecule.
- * 
- * @author Piotr Gawron
- * 
- * @see SimpleMolecule
- */
-public class SimpleMoleculeComparator implements Comparator<SimpleMolecule> {
-	/**
-	 * Default class logger.
-	 */
-	private Logger logger	= Logger.getLogger(SimpleMoleculeComparator.class);
-
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public SimpleMoleculeComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public SimpleMoleculeComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(SimpleMolecule arg0, SimpleMolecule arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(SimpleMolecule.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in
-	 * {@link SimpleMolecule} class in inheritence tree. It also calls the
-	 * {@link SpeciesComparator} for the super class ( {@link Species}).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(SimpleMolecule arg0, SimpleMolecule arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-
-		if (((Integer) arg0.getHomodimer()).compareTo(arg1.getHomodimer()) != 0) {
-			logger.debug("Homodimer different: " + arg0.getHomodimer() + ", " + arg1.getHomodimer());
-			return ((Integer) arg0.getHomodimer()).compareTo(arg1.getHomodimer());
-		}
-
-		StringComparator stringComparator = new StringComparator();
-
-		if (stringComparator.compare(arg0.getSmiles(), arg1.getSmiles()) != 0) {
-			logger.debug("Smiles different: " + arg0.getSmiles() + ", " + arg1.getSmiles());
-			return stringComparator.compare(arg0.getSmiles(), arg1.getSmiles());
-		}
-
-		if (stringComparator.compare(arg0.getInChIKey(), arg1.getInChIKey()) != 0) {
-			logger.debug("InChIKey different: " + arg0.getInChIKey() + ", " + arg1.getInChIKey());
-			return stringComparator.compare(arg0.getInChIKey(), arg1.getInChIKey());
-		}
-
-		if (stringComparator.compare(arg0.getInChI(), arg1.getInChI()) != 0) {
-			logger.debug("InChI different: " + arg0.getInChI() + ", " + arg1.getInChI());
-			return stringComparator.compare(arg0.getInChI(), arg1.getInChI());
-		}
-		return 0;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.comparator.StringComparator;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * This class implements comparator interface for SimpleMolecule.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see SimpleMolecule
+ */
+public class SimpleMoleculeComparator implements Comparator<SimpleMolecule> {
+	/**
+	 * Default class logger.
+	 */
+	private Logger logger	= Logger.getLogger(SimpleMoleculeComparator.class);
+
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public SimpleMoleculeComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public SimpleMoleculeComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(SimpleMolecule arg0, SimpleMolecule arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(SimpleMolecule.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in
+	 * {@link SimpleMolecule} class in inheritence tree. It also calls the
+	 * {@link SpeciesComparator} for the super class ( {@link Species}).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(SimpleMolecule arg0, SimpleMolecule arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+
+		if (((Integer) arg0.getHomodimer()).compareTo(arg1.getHomodimer()) != 0) {
+			logger.debug("Homodimer different: " + arg0.getHomodimer() + ", " + arg1.getHomodimer());
+			return ((Integer) arg0.getHomodimer()).compareTo(arg1.getHomodimer());
+		}
+
+		StringComparator stringComparator = new StringComparator();
+
+		if (stringComparator.compare(arg0.getSmiles(), arg1.getSmiles()) != 0) {
+			logger.debug("Smiles different: " + arg0.getSmiles() + ", " + arg1.getSmiles());
+			return stringComparator.compare(arg0.getSmiles(), arg1.getSmiles());
+		}
+
+		if (stringComparator.compare(arg0.getInChIKey(), arg1.getInChIKey()) != 0) {
+			logger.debug("InChIKey different: " + arg0.getInChIKey() + ", " + arg1.getInChIKey());
+			return stringComparator.compare(arg0.getInChIKey(), arg1.getInChIKey());
+		}
+
+		if (stringComparator.compare(arg0.getInChI(), arg1.getInChI()) != 0) {
+			logger.debug("InChI different: " + arg0.getInChI() + ", " + arg1.getInChI());
+			return stringComparator.compare(arg0.getInChI(), arg1.getInChI());
+		}
+		return 0;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Species.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Species.java
index 5ad4b55452..de43e59df7 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Species.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Species.java
@@ -1,476 +1,476 @@
-package lcsb.mapviewer.model.map.species;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.species.fields.PositionToCompartment;
-
-/**
- * Generic species of the map.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("SPECIES")
-public class Species extends Element {
-	/**
-	 * 
-	 */
-	private static final long			serialVersionUID			= 1L;
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger					logger								= Logger.getLogger(Species.class.getName());
-
-	/**
-	 * Identifier of the species. It must be unique within the model.
-	 */
-	private String								idSpecies;
-
-	/**
-	 * Initial amount of species.
-	 */
-	private Integer								initialAmount					= null;
-
-	/**
-	 * Charge of the species.
-	 */
-	private Integer								charge								= null;
-
-	/**
-	 * Initial concentration of species.
-	 */
-	private Integer								initialConcentration	= null;
-
-	/**
-	 * Is only substance units allowed.
-	 */
-	private Boolean								onlySubstanceUnits		= null;
-
-	/**
-	 * How many dimers are in this species.
-	 */
-	private int										homodimer							= 1;
-
-	/**
-	 * Position on the compartment.
-	 */
-	@Enumerated(EnumType.STRING)
-	private PositionToCompartment	positionToCompartment	= null;
-
-	/**
-	 * Is species hypothetical.
-	 */
-	private Boolean								hypothetical					= null;
-
-	/**
-	 * Set hypothetical flag from text input.
-	 * 
-	 * @param text
-	 *          string with true/false value that determines hypothetical state.
-	 * @see #hypothetical
-	 */
-	public void setHypothetical(String text) {
-		hypothetical = text.equals("true");
-	}
-
-	/**
-	 * Constructor that copies the data from species given in the argument.
-	 * 
-	 * @param species
-	 *          parent species from which we want to copy data
-	 */
-	public Species(Species species) {
-		super(species);
-		this.hypothetical = species.hypothetical;
-		this.idSpecies = species.idSpecies;
-		this.positionToCompartment = species.positionToCompartment;
-		this.initialAmount = species.initialAmount;
-		this.charge = species.charge;
-		this.initialConcentration = species.initialConcentration;
-		this.onlySubstanceUnits = species.onlySubstanceUnits;
-		this.homodimer = species.homodimer;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Species() {
-		super();
-		idSpecies = "";
-	}
-
-	/**
-	 * Default constructor with species identifier as a parameter.
-	 * 
-	 * @param id
-	 *          species identifier
-	 */
-	public Species(String id) {
-		this();
-		this.idSpecies = id;
-	}
-
-	@Override
-	public Species copy() {
-		Species result = new Species(this);
-
-		result.idSpecies = idSpecies;
-		result.setNotes(getNotes());
-		result.setHypothetical(hypothetical);
-		// correct this
-
-		result.setParent(getParent());
-
-		result.charge = charge;
-		result.initialAmount = initialAmount;
-		result.initialConcentration = initialConcentration;
-		result.onlySubstanceUnits = onlySubstanceUnits;
-		result.positionToCompartment = positionToCompartment;
-		result.homodimer = homodimer;
-		return result;
-	}
-
-	/**
-	 * Updates species with the value from the species given in the parameter.
-	 * 
-	 * @param species
-	 *          object from which we are updating information
-	 */
-	public void update(Species species) {
-		if (getName() == null || getName().equals("")) {
-			setName(species.getName());
-		} else if (!getName().trim().equals(species.getName().trim())) {
-			String id = species.getElementId();
-			if (id == null || id.equals("")) {
-				id = getElementId();
-			}
-			logger.warn("Two different names in species with id =" + id + ": \"" + species.getName() + "\", \"" + getName() + "\"");
-			setName(species.getName());
-		}
-		if (idSpecies == null || idSpecies.equals("")) {
-			setElementId(species.getElementId());
-		}
-		for (MiriamData md : species.getMiriamData()) {
-			if (!getMiriamData().contains(md)) {
-				addMiriamData(new MiriamData(md));
-			}
-		}
-		if (this.getNotes() == null || this.getNotes().trim().equals("")) {
-			setNotes(species.getNotes());
-		} else if (species.getNotes() != null && !species.getNotes().trim().equals("") && !this.getNotes().equals(species.getNotes())) {
-			String string1 = this.getNotes();
-
-			String string2 = species.getNotes();
-
-			string1 = string1.trim();
-			string2 = string2.trim();
-			if (string2.toLowerCase().contains(string1.toLowerCase())) {
-				setNotes(species.getNotes());
-			} else if (!string1.toLowerCase().contains(string2.toLowerCase())) {
-				// insert new information
-				setNotes(string2 + getNotes());
-			}
-		}
-
-		if (getParent() == null) {
-			setParent(species.getParent());
-		}
-
-		if (species.getHypothetical() != null) {
-			setHypothetical(species.getHypothetical());
-		}
-
-		if (getSymbol() != null && !getSymbol().equals("")) {
-			if (species.getSymbol() != null && !species.getSymbol().equals("")) {
-				if (!species.getSymbol().equals(getSymbol())) {
-					logger.warn("Different symbol names: " + species.getSymbol() + ", " + getSymbol() + ". Ignoring...");
-				}
-			}
-		} else {
-			setSymbol(species.getSymbol());
-		}
-
-		if (getFullName() != null && !getFullName().equals("")) {
-			if (species.getFullName() != null && !species.getFullName().equals("")) {
-				if (!species.getFullName().equals(getFullName())) {
-					logger.warn("Different symbol names: " + species.getFullName() + ", " + getFullName() + ". Ignoring...");
-				}
-			}
-		} else {
-			setFullName(species.getFullName());
-		}
-
-		for (String string : species.getSynonyms()) {
-			if (!getSynonyms().contains(string)) {
-				getSynonyms().add(string);
-			}
-		}
-
-		for (String string : species.getFormerSymbols()) {
-			if (!getFormerSymbols().contains(string)) {
-				getFormerSymbols().add(string);
-			}
-		}
-		if (species.getHomodimer() != 1) {
-			setHomodimer(species.getHomodimer());
-		}
-	}
-
-	/**
-	 * Sets initial amount from text.
-	 * 
-	 * @param text
-	 *          initial amount in string format
-	 * @see #initialAmount
-	 */
-
-	public void setInitialAmount(String text) {
-		if (text != null && !text.trim().equals("")) {
-			try {
-				initialAmount = Integer.parseInt(text);
-			} catch (NumberFormatException e) {
-				throw new InvalidArgumentException("Invalid species amount: " + text, e);
-			}
-		} else {
-			initialAmount = null;
-		}
-
-	}
-
-	/**
-	 * Sets charge from text.
-	 * 
-	 * @param text
-	 *          charge in string format
-	 * @see #charge
-	 */
-	public void setCharge(String text) {
-		if (text != null && !text.trim().equals("")) {
-			try {
-				charge = Integer.parseInt(text);
-			} catch (NumberFormatException e) {
-				throw new InvalidArgumentException("Invalid species charge: " + text, e);
-			}
-		} else {
-			charge = null;
-		}
-
-	}
-
-	/**
-	 * Sets OnlySubstanceUnits amount from text.
-	 * 
-	 * @param text
-	 *          OnlySubstanceUnits in string format
-	 * @see #onlySubstanceUnits
-	 */
-	public void setOnlySubstanceUnits(String text) {
-		if (text != null && !text.trim().equals("")) {
-			if (text.equalsIgnoreCase("TRUE")) {
-				onlySubstanceUnits = true;
-			} else if (text.equalsIgnoreCase("FALSE")) {
-				onlySubstanceUnits = false;
-			} else {
-				throw new InvalidArgumentException("Invalid species value for only substance unit boolean: " + text);
-			}
-		} else {
-			onlySubstanceUnits = null;
-		}
-	}
-
-	/**
-	 * Sets initial concentration amount from text.
-	 * 
-	 * @param text
-	 *          initial concentration in string format
-	 * @see #initialConcentration
-	 */
-	public void setInitialConcentration(String text) {
-		if (text != null && !text.trim().equals("")) {
-			try {
-				initialConcentration = Integer.parseInt(text);
-			} catch (NumberFormatException e) {
-				throw new InvalidArgumentException("Invalid species initial concentration: " + text, e);
-			}
-		} else {
-			initialConcentration = null;
-		}
-	}
-
-	/**
-	 * Is species hypothetical or not.
-	 * 
-	 * @return <code>true</code> if species is hypothetical, <code>false</code>
-	 *         otherwise
-	 */
-	public boolean isHypothetical() {
-		if (hypothetical == null) {
-			return false;
-		}
-		return hypothetical;
-	}
-
-	@Override
-	public String getElementId() {
-		return this.idSpecies;
-	}
-
-	@Override
-	public void setElementId(String id) {
-		if (this.idSpecies.equals(id) || this.idSpecies.equals("")) {
-			this.idSpecies = id;
-		} else if (!id.equals("")) {
-			throw new InvalidArgumentException("Cannot change identifier of the species in the runtime. OLD: " + this.idSpecies + ", NEW: " + id);
-		} else {
-			this.idSpecies = id;
-		}
-	}
-
-	/**
-	 * Returns string that describe a type of species.
-	 * 
-	 * @return string that describe a species type
-	 */
-	public String getStringType() {
-		throw new NotImplementedException();
-	}
-
-	/**
-	 * @return the initialAmount
-	 * @see #initialAmount
-	 */
-	public Integer getInitialAmount() {
-		return initialAmount;
-	}
-
-	/**
-	 * @param initialAmount
-	 *          the initialAmount to set
-	 * @see #initialAmount
-	 */
-	public void setInitialAmount(Integer initialAmount) {
-		this.initialAmount = initialAmount;
-	}
-
-	/**
-	 * @return the charge
-	 * @see #charge
-	 */
-	public Integer getCharge() {
-		return charge;
-	}
-
-	/**
-	 * @param charge
-	 *          the charge to set
-	 * @see #charge
-	 */
-	public void setCharge(Integer charge) {
-		this.charge = charge;
-	}
-
-	/**
-	 * @return the onlySubstanceUnits
-	 * @see #onlySubstanceUnits
-	 */
-	public Boolean getOnlySubstanceUnits() {
-		return onlySubstanceUnits;
-	}
-
-	/**
-	 * @param onlySubstanceUnits
-	 *          the onlySubstanceUnits to set
-	 * @see #onlySubstanceUnits
-	 */
-	public void setOnlySubstanceUnits(Boolean onlySubstanceUnits) {
-		this.onlySubstanceUnits = onlySubstanceUnits;
-	}
-
-	/**
-	 * @return the initialConcentration
-	 * @see #initialConcentration
-	 */
-	public Integer getInitialConcentration() {
-		return initialConcentration;
-	}
-
-	/**
-	 * @param initialConcentration
-	 *          the initialConcentration to set
-	 * @see #initialConcentration
-	 */
-	public void setInitialConcentration(Integer initialConcentration) {
-		this.initialConcentration = initialConcentration;
-	}
-
-	/**
-	 * @return the hypothetical
-	 * @see #hypothetical
-	 */
-	public Boolean getHypothetical() {
-		return hypothetical;
-	}
-
-	/**
-	 * @param hypothetical
-	 *          the hypothetical to set
-	 * @see #hypothetical
-	 */
-	public void setHypothetical(Boolean hypothetical) {
-		this.hypothetical = hypothetical;
-	}
-
-	/**
-	 * @return the onlySubstanceUnits
-	 * @see #onlySubstanceUnits
-	 */
-	public Boolean hasOnlySubstanceUnits() {
-		return onlySubstanceUnits;
-	}
-
-	/**
-	 * @return the positionToCompartment
-	 * @see #positionToCompartment
-	 */
-	public PositionToCompartment getPositionToCompartment() {
-		return positionToCompartment;
-	}
-
-	/**
-	 * @param positionToCompartment
-	 *          the positionToCompartment to set
-	 * @see #positionToCompartment
-	 */
-	public void setPositionToCompartment(PositionToCompartment positionToCompartment) {
-		this.positionToCompartment = positionToCompartment;
-	}
-
-	/**
-	 * @return the homodimer
-	 * @see #homodimer
-	 */
-	public int getHomodimer() {
-		return homodimer;
-	}
-
-	/**
-	 * @param homodimer
-	 *          the homodimer to set
-	 * @see #homodimer
-	 */
-	public void setHomodimer(int homodimer) {
-		this.homodimer = homodimer;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.species.fields.PositionToCompartment;
+
+/**
+ * Generic species of the map.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("SPECIES")
+public class Species extends Element {
+	/**
+	 * 
+	 */
+	private static final long			serialVersionUID			= 1L;
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger					logger								= Logger.getLogger(Species.class.getName());
+
+	/**
+	 * Identifier of the species. It must be unique within the model.
+	 */
+	private String								idSpecies;
+
+	/**
+	 * Initial amount of species.
+	 */
+	private Integer								initialAmount					= null;
+
+	/**
+	 * Charge of the species.
+	 */
+	private Integer								charge								= null;
+
+	/**
+	 * Initial concentration of species.
+	 */
+	private Integer								initialConcentration	= null;
+
+	/**
+	 * Is only substance units allowed.
+	 */
+	private Boolean								onlySubstanceUnits		= null;
+
+	/**
+	 * How many dimers are in this species.
+	 */
+	private int										homodimer							= 1;
+
+	/**
+	 * Position on the compartment.
+	 */
+	@Enumerated(EnumType.STRING)
+	private PositionToCompartment	positionToCompartment	= null;
+
+	/**
+	 * Is species hypothetical.
+	 */
+	private Boolean								hypothetical					= null;
+
+	/**
+	 * Set hypothetical flag from text input.
+	 * 
+	 * @param text
+	 *          string with true/false value that determines hypothetical state.
+	 * @see #hypothetical
+	 */
+	public void setHypothetical(String text) {
+		hypothetical = text.equals("true");
+	}
+
+	/**
+	 * Constructor that copies the data from species given in the argument.
+	 * 
+	 * @param species
+	 *          parent species from which we want to copy data
+	 */
+	public Species(Species species) {
+		super(species);
+		this.hypothetical = species.hypothetical;
+		this.idSpecies = species.idSpecies;
+		this.positionToCompartment = species.positionToCompartment;
+		this.initialAmount = species.initialAmount;
+		this.charge = species.charge;
+		this.initialConcentration = species.initialConcentration;
+		this.onlySubstanceUnits = species.onlySubstanceUnits;
+		this.homodimer = species.homodimer;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Species() {
+		super();
+		idSpecies = "";
+	}
+
+	/**
+	 * Default constructor with species identifier as a parameter.
+	 * 
+	 * @param id
+	 *          species identifier
+	 */
+	public Species(String id) {
+		this();
+		this.idSpecies = id;
+	}
+
+	@Override
+	public Species copy() {
+		Species result = new Species(this);
+
+		result.idSpecies = idSpecies;
+		result.setNotes(getNotes());
+		result.setHypothetical(hypothetical);
+		// correct this
+
+		result.setParent(getParent());
+
+		result.charge = charge;
+		result.initialAmount = initialAmount;
+		result.initialConcentration = initialConcentration;
+		result.onlySubstanceUnits = onlySubstanceUnits;
+		result.positionToCompartment = positionToCompartment;
+		result.homodimer = homodimer;
+		return result;
+	}
+
+	/**
+	 * Updates species with the value from the species given in the parameter.
+	 * 
+	 * @param species
+	 *          object from which we are updating information
+	 */
+	public void update(Species species) {
+		if (getName() == null || getName().equals("")) {
+			setName(species.getName());
+		} else if (!getName().trim().equals(species.getName().trim())) {
+			String id = species.getElementId();
+			if (id == null || id.equals("")) {
+				id = getElementId();
+			}
+			logger.warn("Two different names in species with id =" + id + ": \"" + species.getName() + "\", \"" + getName() + "\"");
+			setName(species.getName());
+		}
+		if (idSpecies == null || idSpecies.equals("")) {
+			setElementId(species.getElementId());
+		}
+		for (MiriamData md : species.getMiriamData()) {
+			if (!getMiriamData().contains(md)) {
+				addMiriamData(new MiriamData(md));
+			}
+		}
+		if (this.getNotes() == null || this.getNotes().trim().equals("")) {
+			setNotes(species.getNotes());
+		} else if (species.getNotes() != null && !species.getNotes().trim().equals("") && !this.getNotes().equals(species.getNotes())) {
+			String string1 = this.getNotes();
+
+			String string2 = species.getNotes();
+
+			string1 = string1.trim();
+			string2 = string2.trim();
+			if (string2.toLowerCase().contains(string1.toLowerCase())) {
+				setNotes(species.getNotes());
+			} else if (!string1.toLowerCase().contains(string2.toLowerCase())) {
+				// insert new information
+				setNotes(string2 + getNotes());
+			}
+		}
+
+		if (getParent() == null) {
+			setParent(species.getParent());
+		}
+
+		if (species.getHypothetical() != null) {
+			setHypothetical(species.getHypothetical());
+		}
+
+		if (getSymbol() != null && !getSymbol().equals("")) {
+			if (species.getSymbol() != null && !species.getSymbol().equals("")) {
+				if (!species.getSymbol().equals(getSymbol())) {
+					logger.warn("Different symbol names: " + species.getSymbol() + ", " + getSymbol() + ". Ignoring...");
+				}
+			}
+		} else {
+			setSymbol(species.getSymbol());
+		}
+
+		if (getFullName() != null && !getFullName().equals("")) {
+			if (species.getFullName() != null && !species.getFullName().equals("")) {
+				if (!species.getFullName().equals(getFullName())) {
+					logger.warn("Different symbol names: " + species.getFullName() + ", " + getFullName() + ". Ignoring...");
+				}
+			}
+		} else {
+			setFullName(species.getFullName());
+		}
+
+		for (String string : species.getSynonyms()) {
+			if (!getSynonyms().contains(string)) {
+				getSynonyms().add(string);
+			}
+		}
+
+		for (String string : species.getFormerSymbols()) {
+			if (!getFormerSymbols().contains(string)) {
+				getFormerSymbols().add(string);
+			}
+		}
+		if (species.getHomodimer() != 1) {
+			setHomodimer(species.getHomodimer());
+		}
+	}
+
+	/**
+	 * Sets initial amount from text.
+	 * 
+	 * @param text
+	 *          initial amount in string format
+	 * @see #initialAmount
+	 */
+
+	public void setInitialAmount(String text) {
+		if (text != null && !text.trim().equals("")) {
+			try {
+				initialAmount = Integer.parseInt(text);
+			} catch (NumberFormatException e) {
+				throw new InvalidArgumentException("Invalid species amount: " + text, e);
+			}
+		} else {
+			initialAmount = null;
+		}
+
+	}
+
+	/**
+	 * Sets charge from text.
+	 * 
+	 * @param text
+	 *          charge in string format
+	 * @see #charge
+	 */
+	public void setCharge(String text) {
+		if (text != null && !text.trim().equals("")) {
+			try {
+				charge = Integer.parseInt(text);
+			} catch (NumberFormatException e) {
+				throw new InvalidArgumentException("Invalid species charge: " + text, e);
+			}
+		} else {
+			charge = null;
+		}
+
+	}
+
+	/**
+	 * Sets OnlySubstanceUnits amount from text.
+	 * 
+	 * @param text
+	 *          OnlySubstanceUnits in string format
+	 * @see #onlySubstanceUnits
+	 */
+	public void setOnlySubstanceUnits(String text) {
+		if (text != null && !text.trim().equals("")) {
+			if (text.equalsIgnoreCase("TRUE")) {
+				onlySubstanceUnits = true;
+			} else if (text.equalsIgnoreCase("FALSE")) {
+				onlySubstanceUnits = false;
+			} else {
+				throw new InvalidArgumentException("Invalid species value for only substance unit boolean: " + text);
+			}
+		} else {
+			onlySubstanceUnits = null;
+		}
+	}
+
+	/**
+	 * Sets initial concentration amount from text.
+	 * 
+	 * @param text
+	 *          initial concentration in string format
+	 * @see #initialConcentration
+	 */
+	public void setInitialConcentration(String text) {
+		if (text != null && !text.trim().equals("")) {
+			try {
+				initialConcentration = Integer.parseInt(text);
+			} catch (NumberFormatException e) {
+				throw new InvalidArgumentException("Invalid species initial concentration: " + text, e);
+			}
+		} else {
+			initialConcentration = null;
+		}
+	}
+
+	/**
+	 * Is species hypothetical or not.
+	 * 
+	 * @return <code>true</code> if species is hypothetical, <code>false</code>
+	 *         otherwise
+	 */
+	public boolean isHypothetical() {
+		if (hypothetical == null) {
+			return false;
+		}
+		return hypothetical;
+	}
+
+	@Override
+	public String getElementId() {
+		return this.idSpecies;
+	}
+
+	@Override
+	public void setElementId(String id) {
+		if (this.idSpecies.equals(id) || this.idSpecies.equals("")) {
+			this.idSpecies = id;
+		} else if (!id.equals("")) {
+			throw new InvalidArgumentException("Cannot change identifier of the species in the runtime. OLD: " + this.idSpecies + ", NEW: " + id);
+		} else {
+			this.idSpecies = id;
+		}
+	}
+
+	/**
+	 * Returns string that describe a type of species.
+	 * 
+	 * @return string that describe a species type
+	 */
+	public String getStringType() {
+		throw new NotImplementedException();
+	}
+
+	/**
+	 * @return the initialAmount
+	 * @see #initialAmount
+	 */
+	public Integer getInitialAmount() {
+		return initialAmount;
+	}
+
+	/**
+	 * @param initialAmount
+	 *          the initialAmount to set
+	 * @see #initialAmount
+	 */
+	public void setInitialAmount(Integer initialAmount) {
+		this.initialAmount = initialAmount;
+	}
+
+	/**
+	 * @return the charge
+	 * @see #charge
+	 */
+	public Integer getCharge() {
+		return charge;
+	}
+
+	/**
+	 * @param charge
+	 *          the charge to set
+	 * @see #charge
+	 */
+	public void setCharge(Integer charge) {
+		this.charge = charge;
+	}
+
+	/**
+	 * @return the onlySubstanceUnits
+	 * @see #onlySubstanceUnits
+	 */
+	public Boolean getOnlySubstanceUnits() {
+		return onlySubstanceUnits;
+	}
+
+	/**
+	 * @param onlySubstanceUnits
+	 *          the onlySubstanceUnits to set
+	 * @see #onlySubstanceUnits
+	 */
+	public void setOnlySubstanceUnits(Boolean onlySubstanceUnits) {
+		this.onlySubstanceUnits = onlySubstanceUnits;
+	}
+
+	/**
+	 * @return the initialConcentration
+	 * @see #initialConcentration
+	 */
+	public Integer getInitialConcentration() {
+		return initialConcentration;
+	}
+
+	/**
+	 * @param initialConcentration
+	 *          the initialConcentration to set
+	 * @see #initialConcentration
+	 */
+	public void setInitialConcentration(Integer initialConcentration) {
+		this.initialConcentration = initialConcentration;
+	}
+
+	/**
+	 * @return the hypothetical
+	 * @see #hypothetical
+	 */
+	public Boolean getHypothetical() {
+		return hypothetical;
+	}
+
+	/**
+	 * @param hypothetical
+	 *          the hypothetical to set
+	 * @see #hypothetical
+	 */
+	public void setHypothetical(Boolean hypothetical) {
+		this.hypothetical = hypothetical;
+	}
+
+	/**
+	 * @return the onlySubstanceUnits
+	 * @see #onlySubstanceUnits
+	 */
+	public Boolean hasOnlySubstanceUnits() {
+		return onlySubstanceUnits;
+	}
+
+	/**
+	 * @return the positionToCompartment
+	 * @see #positionToCompartment
+	 */
+	public PositionToCompartment getPositionToCompartment() {
+		return positionToCompartment;
+	}
+
+	/**
+	 * @param positionToCompartment
+	 *          the positionToCompartment to set
+	 * @see #positionToCompartment
+	 */
+	public void setPositionToCompartment(PositionToCompartment positionToCompartment) {
+		this.positionToCompartment = positionToCompartment;
+	}
+
+	/**
+	 * @return the homodimer
+	 * @see #homodimer
+	 */
+	public int getHomodimer() {
+		return homodimer;
+	}
+
+	/**
+	 * @param homodimer
+	 *          the homodimer to set
+	 * @see #homodimer
+	 */
+	public void setHomodimer(int homodimer) {
+		this.homodimer = homodimer;
+	}
+
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/Unknown.java b/model/src/main/java/lcsb/mapviewer/model/map/species/Unknown.java
index 6ae1290f39..d854e4d48e 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/Unknown.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/Unknown.java
@@ -1,51 +1,51 @@
-package lcsb.mapviewer.model.map.species;
-
-import javax.persistence.DiscriminatorValue;
-import javax.persistence.Entity;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * Class representing unknown element in the model.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@DiscriminatorValue("Unknown")
-public class Unknown extends Species {
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID	= 1L;
-
-	/**
-	 * Constructor that initializes unknown with the data passed in the argument.
-	 * 
-	 * @param species
-	 *          original species used for data initialization
-	 */
-	public Unknown(Species species) {
-		super(species);
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public Unknown() {
-	}
-
-	@Override
-	public Unknown copy() {
-		if (this.getClass() == Unknown.class) {
-			return new Unknown(this);
-		} else {
-			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
-		}
-	}
-
-	@Override
-	public String getStringType() {
-		return "Unknown";
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * Class representing unknown element in the model.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@DiscriminatorValue("Unknown")
+public class Unknown extends Species {
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID	= 1L;
+
+	/**
+	 * Constructor that initializes unknown with the data passed in the argument.
+	 * 
+	 * @param species
+	 *          original species used for data initialization
+	 */
+	public Unknown(Species species) {
+		super(species);
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public Unknown() {
+	}
+
+	@Override
+	public Unknown copy() {
+		if (this.getClass() == Unknown.class) {
+			return new Unknown(this);
+		} else {
+			throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
+		}
+	}
+
+	@Override
+	public String getStringType() {
+		return "Unknown";
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/map/species/UnknownComparator.java b/model/src/main/java/lcsb/mapviewer/model/map/species/UnknownComparator.java
index 78cb62929e..5ec9093971 100644
--- a/model/src/main/java/lcsb/mapviewer/model/map/species/UnknownComparator.java
+++ b/model/src/main/java/lcsb/mapviewer/model/map/species/UnknownComparator.java
@@ -1,82 +1,82 @@
-package lcsb.mapviewer.model.map.species;
-
-import java.util.Comparator;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-/**
- * This class implements comparator interface for Unknown.
- * 
- * @author Piotr Gawron
- * 
- * @see Unknown
- */
-public class UnknownComparator implements Comparator<Unknown> {
-	/**
-	 * Epsilon value used for comparison of doubles.
-	 */
-	private double	epsilon;
-
-	/**
-	 * Constructor that requires {@link #epsilon} parameter.
-	 * 
-	 * @param epsilon
-	 *          {@link #epsilon}
-	 */
-	public UnknownComparator(double epsilon) {
-		this.epsilon = epsilon;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public UnknownComparator() {
-		this(Configuration.EPSILON);
-	}
-
-	@Override
-	public int compare(Unknown arg0, Unknown arg1) {
-		if (arg0 == null) {
-			if (arg1 == null) {
-				return 0;
-			} else {
-				return 1;
-			}
-		} else if (arg1 == null) {
-			return -1;
-		}
-
-		if (arg0.getClass().equals(arg1.getClass())) {
-			if (arg0.getClass().equals(Unknown.class)) {
-				return internalCompare(arg0, arg1);
-			} else {
-				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
-			}
-		} else {
-			return -1;
-		}
-	}
-
-	/**
-	 * This method compares only the fields that are defined in {@link Unknown}
-	 * class in inheritence tree. It also calls the {@link SpeciesComparator} for
-	 * the super class ({@link Species}).
-	 * 
-	 * @param arg0
-	 *          first object to compare
-	 * @param arg1
-	 *          second object to compare
-	 * @return if all fields are qual then returns 0. If they are different then
-	 *         -1/1 is returned.
-	 */
-	private int internalCompare(Unknown arg0, Unknown arg1) {
-		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
-		int result = speciesComparator.internalCompare(arg0, arg1);
-		if (result != 0) {
-			return result;
-		}
-
-		return 0;
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import java.util.Comparator;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+/**
+ * This class implements comparator interface for Unknown.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @see Unknown
+ */
+public class UnknownComparator implements Comparator<Unknown> {
+	/**
+	 * Epsilon value used for comparison of doubles.
+	 */
+	private double	epsilon;
+
+	/**
+	 * Constructor that requires {@link #epsilon} parameter.
+	 * 
+	 * @param epsilon
+	 *          {@link #epsilon}
+	 */
+	public UnknownComparator(double epsilon) {
+		this.epsilon = epsilon;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public UnknownComparator() {
+		this(Configuration.EPSILON);
+	}
+
+	@Override
+	public int compare(Unknown arg0, Unknown arg1) {
+		if (arg0 == null) {
+			if (arg1 == null) {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else if (arg1 == null) {
+			return -1;
+		}
+
+		if (arg0.getClass().equals(arg1.getClass())) {
+			if (arg0.getClass().equals(Unknown.class)) {
+				return internalCompare(arg0, arg1);
+			} else {
+				throw new NotImplementedException("Don't know how to compare classes: " + arg0.getClass());
+			}
+		} else {
+			return -1;
+		}
+	}
+
+	/**
+	 * This method compares only the fields that are defined in {@link Unknown}
+	 * class in inheritence tree. It also calls the {@link SpeciesComparator} for
+	 * the super class ({@link Species}).
+	 * 
+	 * @param arg0
+	 *          first object to compare
+	 * @param arg1
+	 *          second object to compare
+	 * @return if all fields are qual then returns 0. If they are different then
+	 *         -1/1 is returned.
+	 */
+	private int internalCompare(Unknown arg0, Unknown arg1) {
+		SpeciesComparator speciesComparator = new SpeciesComparator(epsilon);
+		int result = speciesComparator.internalCompare(arg0, arg1);
+		if (result != 0) {
+			return result;
+		}
+
+		return 0;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/user/PrivilegeType.java b/model/src/main/java/lcsb/mapviewer/model/user/PrivilegeType.java
index 0a378e287d..04af0ffb93 100644
--- a/model/src/main/java/lcsb/mapviewer/model/user/PrivilegeType.java
+++ b/model/src/main/java/lcsb/mapviewer/model/user/PrivilegeType.java
@@ -1,160 +1,160 @@
-package lcsb.mapviewer.model.user;
-
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.layout.Layout;
-
-/**
- * Defines types of privileges in the system.
- * 
- * @author Piotr Gawron
- * 
- */
-public enum PrivilegeType {
-
-	/**
-	 * User can browse project.
-	 */
-	VIEW_PROJECT(ObjectPrivilege.class, Project.class, "View project"),
-
-	/**
-	 * User can add project.
-	 */
-	ADD_MAP(BasicPrivilege.class, null, "Add project"),
-
-	/**
-	 * User can edit data mining information in the project.
-	 */
-	EDIT_MISSING_CONNECTIONS_PROJECT(ObjectPrivilege.class, Project.class, "Edit suggested connections"),
-
-	/**
-	 * User can edit comments in the project.
-	 */
-	EDIT_COMMENTS_PROJECT(ObjectPrivilege.class, Project.class, "Manage comments"),
-
-	/**
-	 * User has access to advanced drug targeting info.
-	 */
-	DRUG_TARGETING_ADVANCED_VIEW_PROJECT(ObjectPrivilege.class, Project.class, "Drug targeting advanced view"),
-
-	/**
-	 * User can manage projects.
-	 */
-	PROJECT_MANAGEMENT(BasicPrivilege.class, null, "Map management"),
-
-	/**
-	 * User can manage users.
-	 */
-	USER_MANAGEMENT(BasicPrivilege.class, null, "User management"),
-
-	/**
-	 * User can have custom layouts (access level defines how many).
-	 */
-	CUSTOM_LAYOUTS(BasicPrivilege.class, null, "Custom layouts", true),
-
-	/**
-	 * User can view non-public layout.
-	 */
-	LAYOUT_VIEW(ObjectPrivilege.class, Layout.class, "View layout"),
-
-	/**
-	 * User can manage configuration.
-	 */
-	CONFIGURATION_MANAGE(BasicPrivilege.class, null, "Manage configuration"),
-
-	/**
-	 * User can manage layouts of all users in the project.
-	 */
-	LAYOUT_MANAGEMENT(ObjectPrivilege.class, Project.class, "Manage layouts"), //
-
-	/**
-	 * User can manage reference genomes.
-	 */
-	MANAGE_GENOMES(BasicPrivilege.class, null, "Manage genomes");
-
-	/**
-	 * Type of privilege (basic or privilege to the object).
-	 */
-	private Class<? extends BasicPrivilege>	privilegeClassType;
-
-	/**
-	 * Type of the object to which privilege refers.
-	 */
-	private Class<?>												privilegeObjectType;
-
-	/**
-	 * Name of the privilege.
-	 */
-	private String													commonName;
-
-	/**
-	 * Is the privilege numeric.
-	 */
-	private boolean													numeric	= false;
-
-	/**
-	 * Constructor that initialize enum with data.
-	 * 
-	 * @param privilegeClazz
-	 *          {@link #privilegeClassType}
-	 * @param objectClazz
-	 *          {@link #privilegeObjectType}
-	 * @param commonName
-	 *          {@link #commonName}
-	 */
-	PrivilegeType(Class<? extends BasicPrivilege> privilegeClazz, Class<?> objectClazz, String commonName) {
-		this.privilegeClassType = privilegeClazz;
-		this.privilegeObjectType = objectClazz;
-		this.commonName = commonName;
-	}
-
-	/**
-	 * Constructor that initialize enum with data.
-	 * 
-	 * @param privilegeClazz
-	 *          {@link #privilegeClassType}
-	 * @param objectClazz
-	 *          {@link #privilegeObjectType}
-	 * @param commonName
-	 *          {@link #commonName}
-	 * @param numeric
-	 *          {@link #numeric}
-	 */
-	PrivilegeType(Class<? extends BasicPrivilege> privilegeClazz, Class<?> objectClazz, String commonName, boolean numeric) {
-		this.privilegeClassType = privilegeClazz;
-		this.privilegeObjectType = objectClazz;
-		this.commonName = commonName;
-		this.numeric = true;
-	}
-
-	/**
-	 * 
-	 * @return {@link #privilegeClassType}
-	 */
-	public Class<? extends BasicPrivilege> getPrivilegeClassType() {
-		return privilegeClassType;
-	}
-
-	/**
-	 * 
-	 * @return {@link #privilegeObjectType}
-	 */
-	public Class<?> getPrivilegeObjectType() {
-		return privilegeObjectType;
-	}
-
-	/**
-	 * 
-	 * @return {@link #commonName}
-	 */
-	public String getCommonName() {
-		return commonName;
-	}
-
-	/**
-	 * 
-	 * @return {@link #numeric}
-	 */
-	public boolean isNumeric() {
-		return numeric;
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.layout.Layout;
+
+/**
+ * Defines types of privileges in the system.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public enum PrivilegeType {
+
+	/**
+	 * User can browse project.
+	 */
+	VIEW_PROJECT(ObjectPrivilege.class, Project.class, "View project"),
+
+	/**
+	 * User can add project.
+	 */
+	ADD_MAP(BasicPrivilege.class, null, "Add project"),
+
+	/**
+	 * User can edit data mining information in the project.
+	 */
+	EDIT_MISSING_CONNECTIONS_PROJECT(ObjectPrivilege.class, Project.class, "Edit suggested connections"),
+
+	/**
+	 * User can edit comments in the project.
+	 */
+	EDIT_COMMENTS_PROJECT(ObjectPrivilege.class, Project.class, "Manage comments"),
+
+	/**
+	 * User has access to advanced drug targeting info.
+	 */
+	DRUG_TARGETING_ADVANCED_VIEW_PROJECT(ObjectPrivilege.class, Project.class, "Drug targeting advanced view"),
+
+	/**
+	 * User can manage projects.
+	 */
+	PROJECT_MANAGEMENT(BasicPrivilege.class, null, "Map management"),
+
+	/**
+	 * User can manage users.
+	 */
+	USER_MANAGEMENT(BasicPrivilege.class, null, "User management"),
+
+	/**
+	 * User can have custom layouts (access level defines how many).
+	 */
+	CUSTOM_LAYOUTS(BasicPrivilege.class, null, "Custom layouts", true),
+
+	/**
+	 * User can view non-public layout.
+	 */
+	LAYOUT_VIEW(ObjectPrivilege.class, Layout.class, "View layout"),
+
+	/**
+	 * User can manage configuration.
+	 */
+	CONFIGURATION_MANAGE(BasicPrivilege.class, null, "Manage configuration"),
+
+	/**
+	 * User can manage layouts of all users in the project.
+	 */
+	LAYOUT_MANAGEMENT(ObjectPrivilege.class, Project.class, "Manage layouts"), //
+
+	/**
+	 * User can manage reference genomes.
+	 */
+	MANAGE_GENOMES(BasicPrivilege.class, null, "Manage genomes");
+
+	/**
+	 * Type of privilege (basic or privilege to the object).
+	 */
+	private Class<? extends BasicPrivilege>	privilegeClassType;
+
+	/**
+	 * Type of the object to which privilege refers.
+	 */
+	private Class<?>												privilegeObjectType;
+
+	/**
+	 * Name of the privilege.
+	 */
+	private String													commonName;
+
+	/**
+	 * Is the privilege numeric.
+	 */
+	private boolean													numeric	= false;
+
+	/**
+	 * Constructor that initialize enum with data.
+	 * 
+	 * @param privilegeClazz
+	 *          {@link #privilegeClassType}
+	 * @param objectClazz
+	 *          {@link #privilegeObjectType}
+	 * @param commonName
+	 *          {@link #commonName}
+	 */
+	PrivilegeType(Class<? extends BasicPrivilege> privilegeClazz, Class<?> objectClazz, String commonName) {
+		this.privilegeClassType = privilegeClazz;
+		this.privilegeObjectType = objectClazz;
+		this.commonName = commonName;
+	}
+
+	/**
+	 * Constructor that initialize enum with data.
+	 * 
+	 * @param privilegeClazz
+	 *          {@link #privilegeClassType}
+	 * @param objectClazz
+	 *          {@link #privilegeObjectType}
+	 * @param commonName
+	 *          {@link #commonName}
+	 * @param numeric
+	 *          {@link #numeric}
+	 */
+	PrivilegeType(Class<? extends BasicPrivilege> privilegeClazz, Class<?> objectClazz, String commonName, boolean numeric) {
+		this.privilegeClassType = privilegeClazz;
+		this.privilegeObjectType = objectClazz;
+		this.commonName = commonName;
+		this.numeric = true;
+	}
+
+	/**
+	 * 
+	 * @return {@link #privilegeClassType}
+	 */
+	public Class<? extends BasicPrivilege> getPrivilegeClassType() {
+		return privilegeClassType;
+	}
+
+	/**
+	 * 
+	 * @return {@link #privilegeObjectType}
+	 */
+	public Class<?> getPrivilegeObjectType() {
+		return privilegeObjectType;
+	}
+
+	/**
+	 * 
+	 * @return {@link #commonName}
+	 */
+	public String getCommonName() {
+		return commonName;
+	}
+
+	/**
+	 * 
+	 * @return {@link #numeric}
+	 */
+	public boolean isNumeric() {
+		return numeric;
+	}
+}
diff --git a/model/src/main/java/lcsb/mapviewer/model/user/UserClassRequiredAnnotations.java b/model/src/main/java/lcsb/mapviewer/model/user/UserClassRequiredAnnotations.java
index 46a708ec07..526e03041c 100644
--- a/model/src/main/java/lcsb/mapviewer/model/user/UserClassRequiredAnnotations.java
+++ b/model/src/main/java/lcsb/mapviewer/model/user/UserClassRequiredAnnotations.java
@@ -1,230 +1,230 @@
-package lcsb.mapviewer.model.user;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import org.apache.log4j.Logger;
-import org.hibernate.annotations.IndexColumn;
-
-import lcsb.mapviewer.model.map.MiriamType;
-
-/**
- * Defines set of required {@link MiriamType annotations} for a given object
- * type.
- * 
- * @author Piotr Gawron
- * 
- */
-@Entity
-@Table(name = "class_required_annotation_table")
-public class UserClassRequiredAnnotations implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long			 serialVersionUID		 = 1L;
-
-	/**
-	 * Defdault class logger.
-	 */
-	@Transient
-	private final transient Logger logger							 = Logger.getLogger(UserClassRequiredAnnotations.class);
-
-	/**
-	 * Unique identifier in the database.
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
-	@Column(name = "idDb", unique = true, nullable = false)
-	private Integer								 id;
-
-	/**
-	 * {@link UserAnnotationSchema} in which this set of required
-	 * {@link MiriamType annotations} is used.
-	 */
-	@ManyToOne
-	private UserAnnotationSchema	 annotationSchema;
-
-	/**
-	 * Name of the class for which this set is defined.
-	 */
-	private String								 className;
-
-	/**
-	 * Are the annotations required?
-	 */
-	private Boolean								 requireAtLestOneAnnotation;
-
-	/**
-	 * One of this annotations will be required if
-	 * {@link #requireAtLestOneAnnotation} is set.
-	 */
-	@ElementCollection
-	@JoinTable(name = "class_required_annotation_miriam_type_table", joinColumns = @JoinColumn(name = "class_required_annotation_iddb"))
-	@Column(name = "miriam_type_name", nullable = false)
-	@IndexColumn(name = "idx")
-	@Enumerated(EnumType.STRING)
-	private List<MiriamType>			 requiredMiriamTypes = new ArrayList<MiriamType>();
-
-	/**
-	 * Default constructor.
-	 */
-	public UserClassRequiredAnnotations() {
-
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param clazz
-	 *          {@link #className}
-	 * @param miriamTypes
-	 *          {@link #requiredMiriamTypes}
-	 */
-	public UserClassRequiredAnnotations(Class<?> clazz, Collection<MiriamType> miriamTypes) {
-		setClassName(clazz);
-		if (miriamTypes != null) {
-			setRequireAtLestOneAnnotation(true);
-			this.requiredMiriamTypes.addAll(miriamTypes);
-		} else {
-			setRequireAtLestOneAnnotation(false);
-		}
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param clazz
-	 *          {@link #className}
-	 * @param miriamTypes
-	 *          {@link #requiredMiriamTypes}
-	 */
-	public UserClassRequiredAnnotations(Class<?> clazz, MiriamType[] miriamTypes) {
-		setClassName(clazz);
-		for (MiriamType miriamType : miriamTypes) {
-			this.requiredMiriamTypes.add(miriamType);
-		}
-		setRequireAtLestOneAnnotation(miriamTypes.length > 0);
-	}
-
-	/**
-	 * @return the className
-	 * @see #className
-	 */
-	public String getClassName() {
-		return className;
-	}
-
-	/**
-	 * @param className
-	 *          the className to set
-	 * @see #className
-	 */
-	public void setClassName(String className) {
-		this.className = className;
-	}
-
-	/**
-	 * @return the id
-	 * @see #id
-	 */
-	public Integer getId() {
-		return id;
-	}
-
-	/**
-	 * @param id
-	 *          the id to set
-	 * @see #id
-	 */
-	public void setId(Integer id) {
-		this.id = id;
-	}
-
-	/**
-	 * Sets {@link #className}.
-	 * 
-	 * @param clazz
-	 *          new {@link #className} value
-	 */
-	public void setClassName(Class<?> clazz) {
-		setClassName(clazz.getCanonicalName());
-	}
-
-	/**
-	 * Adds a type into {@link #requiredMiriamTypes list of required annotations}.
-	 * 
-	 * @param miriamType
-	 *          object to add
-	 */
-	public void addRequiredMiriamType(MiriamType miriamType) {
-		requiredMiriamTypes.add(miriamType);
-	}
-
-	/**
-	 * @return the annotationSchema
-	 * @see #annotationSchema
-	 */
-	public UserAnnotationSchema getAnnotationSchema() {
-		return annotationSchema;
-	}
-
-	/**
-	 * @param annotationSchema
-	 *          the annotationSchema to set
-	 * @see #annotationSchema
-	 */
-	public void setAnnotationSchema(UserAnnotationSchema annotationSchema) {
-		this.annotationSchema = annotationSchema;
-	}
-
-	/**
-	 * @return the requiredMiriamTypes
-	 * @see #requiredMiriamTypes
-	 */
-	public List<MiriamType> getRequiredMiriamTypes() {
-		return requiredMiriamTypes;
-	}
-
-	/**
-	 * @param requiredMiriamTypes
-	 *          the requiredMiriamTypes to set
-	 * @see #requiredMiriamTypes
-	 */
-	public void setRequiredMiriamTypes(List<MiriamType> requiredMiriamTypes) {
-		this.requiredMiriamTypes = requiredMiriamTypes;
-	}
-
-	/**
-	 * @return the requireAtLestOneAnnotation
-	 * @see #requireAtLestOneAnnotation
-	 */
-	public Boolean getRequireAtLestOneAnnotation() {
-		return requireAtLestOneAnnotation;
-	}
-
-	/**
-	 * @param requireAtLestOneAnnotation
-	 *          the requireAtLestOneAnnotation to set
-	 * @see #requireAtLestOneAnnotation
-	 */
-	public void setRequireAtLestOneAnnotation(Boolean requireAtLestOneAnnotation) {
-		this.requireAtLestOneAnnotation = requireAtLestOneAnnotation;
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.ElementCollection;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+import org.apache.log4j.Logger;
+import org.hibernate.annotations.IndexColumn;
+
+import lcsb.mapviewer.model.map.MiriamType;
+
+/**
+ * Defines set of required {@link MiriamType annotations} for a given object
+ * type.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Entity
+@Table(name = "class_required_annotation_table")
+public class UserClassRequiredAnnotations implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long			 serialVersionUID		 = 1L;
+
+	/**
+	 * Defdault class logger.
+	 */
+	@Transient
+	private final transient Logger logger							 = Logger.getLogger(UserClassRequiredAnnotations.class);
+
+	/**
+	 * Unique identifier in the database.
+	 */
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "idDb", unique = true, nullable = false)
+	private Integer								 id;
+
+	/**
+	 * {@link UserAnnotationSchema} in which this set of required
+	 * {@link MiriamType annotations} is used.
+	 */
+	@ManyToOne
+	private UserAnnotationSchema	 annotationSchema;
+
+	/**
+	 * Name of the class for which this set is defined.
+	 */
+	private String								 className;
+
+	/**
+	 * Are the annotations required?
+	 */
+	private Boolean								 requireAtLestOneAnnotation;
+
+	/**
+	 * One of this annotations will be required if
+	 * {@link #requireAtLestOneAnnotation} is set.
+	 */
+	@ElementCollection
+	@JoinTable(name = "class_required_annotation_miriam_type_table", joinColumns = @JoinColumn(name = "class_required_annotation_iddb"))
+	@Column(name = "miriam_type_name", nullable = false)
+	@IndexColumn(name = "idx")
+	@Enumerated(EnumType.STRING)
+	private List<MiriamType>			 requiredMiriamTypes = new ArrayList<MiriamType>();
+
+	/**
+	 * Default constructor.
+	 */
+	public UserClassRequiredAnnotations() {
+
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param clazz
+	 *          {@link #className}
+	 * @param miriamTypes
+	 *          {@link #requiredMiriamTypes}
+	 */
+	public UserClassRequiredAnnotations(Class<?> clazz, Collection<MiriamType> miriamTypes) {
+		setClassName(clazz);
+		if (miriamTypes != null) {
+			setRequireAtLestOneAnnotation(true);
+			this.requiredMiriamTypes.addAll(miriamTypes);
+		} else {
+			setRequireAtLestOneAnnotation(false);
+		}
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param clazz
+	 *          {@link #className}
+	 * @param miriamTypes
+	 *          {@link #requiredMiriamTypes}
+	 */
+	public UserClassRequiredAnnotations(Class<?> clazz, MiriamType[] miriamTypes) {
+		setClassName(clazz);
+		for (MiriamType miriamType : miriamTypes) {
+			this.requiredMiriamTypes.add(miriamType);
+		}
+		setRequireAtLestOneAnnotation(miriamTypes.length > 0);
+	}
+
+	/**
+	 * @return the className
+	 * @see #className
+	 */
+	public String getClassName() {
+		return className;
+	}
+
+	/**
+	 * @param className
+	 *          the className to set
+	 * @see #className
+	 */
+	public void setClassName(String className) {
+		this.className = className;
+	}
+
+	/**
+	 * @return the id
+	 * @see #id
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * @param id
+	 *          the id to set
+	 * @see #id
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * Sets {@link #className}.
+	 * 
+	 * @param clazz
+	 *          new {@link #className} value
+	 */
+	public void setClassName(Class<?> clazz) {
+		setClassName(clazz.getCanonicalName());
+	}
+
+	/**
+	 * Adds a type into {@link #requiredMiriamTypes list of required annotations}.
+	 * 
+	 * @param miriamType
+	 *          object to add
+	 */
+	public void addRequiredMiriamType(MiriamType miriamType) {
+		requiredMiriamTypes.add(miriamType);
+	}
+
+	/**
+	 * @return the annotationSchema
+	 * @see #annotationSchema
+	 */
+	public UserAnnotationSchema getAnnotationSchema() {
+		return annotationSchema;
+	}
+
+	/**
+	 * @param annotationSchema
+	 *          the annotationSchema to set
+	 * @see #annotationSchema
+	 */
+	public void setAnnotationSchema(UserAnnotationSchema annotationSchema) {
+		this.annotationSchema = annotationSchema;
+	}
+
+	/**
+	 * @return the requiredMiriamTypes
+	 * @see #requiredMiriamTypes
+	 */
+	public List<MiriamType> getRequiredMiriamTypes() {
+		return requiredMiriamTypes;
+	}
+
+	/**
+	 * @param requiredMiriamTypes
+	 *          the requiredMiriamTypes to set
+	 * @see #requiredMiriamTypes
+	 */
+	public void setRequiredMiriamTypes(List<MiriamType> requiredMiriamTypes) {
+		this.requiredMiriamTypes = requiredMiriamTypes;
+	}
+
+	/**
+	 * @return the requireAtLestOneAnnotation
+	 * @see #requireAtLestOneAnnotation
+	 */
+	public Boolean getRequireAtLestOneAnnotation() {
+		return requireAtLestOneAnnotation;
+	}
+
+	/**
+	 * @param requireAtLestOneAnnotation
+	 *          the requireAtLestOneAnnotation to set
+	 * @see #requireAtLestOneAnnotation
+	 */
+	public void setRequireAtLestOneAnnotation(Boolean requireAtLestOneAnnotation) {
+		this.requireAtLestOneAnnotation = requireAtLestOneAnnotation;
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/cache/AllCacheTests.java b/model/src/test/java/lcsb/mapviewer/model/cache/AllCacheTests.java
index 063c947872..bb1c289b23 100644
--- a/model/src/test/java/lcsb/mapviewer/model/cache/AllCacheTests.java
+++ b/model/src/test/java/lcsb/mapviewer/model/cache/AllCacheTests.java
@@ -1,16 +1,16 @@
-package lcsb.mapviewer.model.cache;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ BigFileEntryTest.class, //
-		CacheQueryTest.class, //
-		CacheTypeTest.class,//
-		UploadedFileEntryTest.class,//
-		
-})
-public class AllCacheTests {
-
-}
+package lcsb.mapviewer.model.cache;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ BigFileEntryTest.class, //
+		CacheQueryTest.class, //
+		CacheTypeTest.class,//
+		UploadedFileEntryTest.class,//
+		
+})
+public class AllCacheTests {
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/cache/BigFileEntryTest.java b/model/src/test/java/lcsb/mapviewer/model/cache/BigFileEntryTest.java
index 08e0eb2353..bd0b87cc24 100644
--- a/model/src/test/java/lcsb/mapviewer/model/cache/BigFileEntryTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/cache/BigFileEntryTest.java
@@ -1,66 +1,66 @@
-package lcsb.mapviewer.model.cache;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Calendar;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class BigFileEntryTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Calendar downloadDate = Calendar.getInstance();
-			int id = 120;
-			double downloadProgress = 4.6;
-			long downloadThreadId = 6;
-			String localPath = "C:/";
-			boolean removed = true;
-			String url = "www.google.com";
-			String filename = "tmp";
-			byte[] content = new byte[] { 1, 2 };
-
-			BigFileEntry element = new BigFileEntry();
-			element.setDownloadDate(downloadDate);
-			element.setDownloadProgress(downloadProgress);
-			element.setDownloadThreadId(downloadThreadId);
-			element.setId(id);
-			element.setLocalPath(localPath);
-			element.setRemoved(removed);
-			element.setUrl(url);
-			element.setOriginalFileName(filename);
-			element.setFileContent(content);
-
-			assertEquals(downloadDate, element.getDownloadDate());
-			assertEquals((Double) downloadProgress, element.getDownloadProgress());
-			assertEquals((Long) downloadThreadId, element.getDownloadThreadId());
-			assertEquals(id, element.getId());
-			assertEquals(localPath, element.getLocalPath());
-			assertEquals(removed, element.isRemoved());
-			assertEquals(url, element.getUrl());
-			assertEquals(content, element.getFileContent());
-			assertEquals(filename, element.getOriginalFileName());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.cache;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Calendar;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class BigFileEntryTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Calendar downloadDate = Calendar.getInstance();
+			int id = 120;
+			double downloadProgress = 4.6;
+			long downloadThreadId = 6;
+			String localPath = "C:/";
+			boolean removed = true;
+			String url = "www.google.com";
+			String filename = "tmp";
+			byte[] content = new byte[] { 1, 2 };
+
+			BigFileEntry element = new BigFileEntry();
+			element.setDownloadDate(downloadDate);
+			element.setDownloadProgress(downloadProgress);
+			element.setDownloadThreadId(downloadThreadId);
+			element.setId(id);
+			element.setLocalPath(localPath);
+			element.setRemoved(removed);
+			element.setUrl(url);
+			element.setOriginalFileName(filename);
+			element.setFileContent(content);
+
+			assertEquals(downloadDate, element.getDownloadDate());
+			assertEquals((Double) downloadProgress, element.getDownloadProgress());
+			assertEquals((Long) downloadThreadId, element.getDownloadThreadId());
+			assertEquals(id, element.getId());
+			assertEquals(localPath, element.getLocalPath());
+			assertEquals(removed, element.isRemoved());
+			assertEquals(url, element.getUrl());
+			assertEquals(content, element.getFileContent());
+			assertEquals(filename, element.getOriginalFileName());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/cache/CacheQueryTest.java b/model/src/test/java/lcsb/mapviewer/model/cache/CacheQueryTest.java
index ce9a2d4a94..89a305b561 100644
--- a/model/src/test/java/lcsb/mapviewer/model/cache/CacheQueryTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/cache/CacheQueryTest.java
@@ -1,69 +1,69 @@
-package lcsb.mapviewer.model.cache;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Calendar;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CacheQueryTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new CacheQuery());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Calendar expires = Calendar.getInstance();
-			expires.add(Calendar.DATE, 1);
-			Calendar accessed = Calendar.getInstance();
-			accessed.add(Calendar.DATE, 10);
-			int id = 120;
-			String query = "query1";
-			int type = 34;
-			int type2 = 45;
-			String value = "val";
-			CacheType ctype = new CacheType();
-			ctype.setId(type2);
-
-			CacheQuery cq = new CacheQuery();
-			cq.setAccessed(accessed);
-			assertTrue(accessed.equals(cq.getAccessed()));
-			cq.setExpires(expires);
-			assertTrue(expires.equals(cq.getExpires()));
-			cq.setId(id);
-			assertEquals(id, cq.getId());
-			cq.setQuery(query);
-			assertEquals(query, cq.getQuery());
-			cq.setType(ctype);
-			assertEquals((Integer) type2, cq.getType());
-			cq.setType(type);
-			assertEquals((Integer) type, cq.getType());
-			cq.setValue(value);
-			assertEquals(value, cq.getValue());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.cache;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Calendar;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CacheQueryTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new CacheQuery());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Calendar expires = Calendar.getInstance();
+			expires.add(Calendar.DATE, 1);
+			Calendar accessed = Calendar.getInstance();
+			accessed.add(Calendar.DATE, 10);
+			int id = 120;
+			String query = "query1";
+			int type = 34;
+			int type2 = 45;
+			String value = "val";
+			CacheType ctype = new CacheType();
+			ctype.setId(type2);
+
+			CacheQuery cq = new CacheQuery();
+			cq.setAccessed(accessed);
+			assertTrue(accessed.equals(cq.getAccessed()));
+			cq.setExpires(expires);
+			assertTrue(expires.equals(cq.getExpires()));
+			cq.setId(id);
+			assertEquals(id, cq.getId());
+			cq.setQuery(query);
+			assertEquals(query, cq.getQuery());
+			cq.setType(ctype);
+			assertEquals((Integer) type2, cq.getType());
+			cq.setType(type);
+			assertEquals((Integer) type, cq.getType());
+			cq.setValue(value);
+			assertEquals(value, cq.getValue());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/cache/CacheTypeTest.java b/model/src/test/java/lcsb/mapviewer/model/cache/CacheTypeTest.java
index fe634b21ce..a9ccdc9666 100644
--- a/model/src/test/java/lcsb/mapviewer/model/cache/CacheTypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/cache/CacheTypeTest.java
@@ -1,50 +1,50 @@
-package lcsb.mapviewer.model.cache;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CacheTypeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new CacheType());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			int id = 4;
-			int validity = 12;
-			String className = "cname";
-			CacheType ct = new CacheType();
-			ct.setId(id);
-			ct.setClassName(className);
-			ct.setValidity(validity);
-			assertEquals(id, ct.getId());
-			assertEquals(className, ct.getClassName());
-			assertEquals(validity, ct.getValidity());
-			assertNotNull(ct.toString());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.cache;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CacheTypeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new CacheType());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			int id = 4;
+			int validity = 12;
+			String className = "cname";
+			CacheType ct = new CacheType();
+			ct.setId(id);
+			ct.setClassName(className);
+			ct.setValidity(validity);
+			assertEquals(id, ct.getId());
+			assertEquals(className, ct.getClassName());
+			assertEquals(validity, ct.getValidity());
+			assertNotNull(ct.toString());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/cache/UploadedFileEntryTest.java b/model/src/test/java/lcsb/mapviewer/model/cache/UploadedFileEntryTest.java
index ed6588fe62..54f7f5f75f 100644
--- a/model/src/test/java/lcsb/mapviewer/model/cache/UploadedFileEntryTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/cache/UploadedFileEntryTest.java
@@ -1,33 +1,33 @@
-package lcsb.mapviewer.model.cache;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-public class UploadedFileEntryTest {
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new UploadedFileEntry());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.cache;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+public class UploadedFileEntryTest {
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new UploadedFileEntry());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/graphics/AllGraphicsTests.java b/model/src/test/java/lcsb/mapviewer/model/graphics/AllGraphicsTests.java
index a17a49b09b..e1aa276dc7 100644
--- a/model/src/test/java/lcsb/mapviewer/model/graphics/AllGraphicsTests.java
+++ b/model/src/test/java/lcsb/mapviewer/model/graphics/AllGraphicsTests.java
@@ -1,18 +1,18 @@
-package lcsb.mapviewer.model.graphics;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ ArrowTypeDataComparatorTest.class, //
-		ArrowTypeDataTest.class, //
-		ArrowTypeTest.class, //
-		LineTypeTest.class, //
-		PolylineDataTest.class, //
-		PolylineDataComparatorTest.class,//
-
-})
-public class AllGraphicsTests {
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ ArrowTypeDataComparatorTest.class, //
+		ArrowTypeDataTest.class, //
+		ArrowTypeTest.class, //
+		LineTypeTest.class, //
+		PolylineDataTest.class, //
+		PolylineDataComparatorTest.class,//
+
+})
+public class AllGraphicsTests {
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeDataComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeDataComparatorTest.java
index 1a15ccf54c..dd7e91768e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeDataComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeDataComparatorTest.java
@@ -1,72 +1,72 @@
-package lcsb.mapviewer.model.graphics;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ArrowTypeDataComparatorTest {
-	ArrowTypeDataComparator comparator = new ArrowTypeDataComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCompareEquals() {
-		try {
-			assertEquals(0, comparator.compare(null, null));
-			assertEquals(0, comparator.compare(new ArrowTypeData(), new ArrowTypeData()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCompareDifferent() {
-		try {
-			assertTrue(comparator.compare(new ArrowTypeData(), null) != 0);
-			assertTrue(comparator.compare(null, new ArrowTypeData()) != 0);
-			assertTrue(comparator.compare(new ArrowTypeData() {
-				private static final long serialVersionUID = 1L;
-			}, new ArrowTypeData()) != 0);
-			
-			ArrowTypeData atd1 = new ArrowTypeData();
-			ArrowTypeData atd2 = new ArrowTypeData();
-
-			atd1.setArrowType(ArrowType.CROSSBAR);
-			assertTrue(comparator.compare(atd1, atd2)!=0);
-			
-			atd1 = new ArrowTypeData();
-			atd2 = new ArrowTypeData();
-
-			atd1.setArrowLineType(LineType.DOUBLE);
-			assertTrue(comparator.compare(atd1, atd2)!=0);
-			
-			atd1 = new ArrowTypeData();
-			atd2 = new ArrowTypeData();
-
-			atd1.setLen(2.0);
-			assertTrue(comparator.compare(atd1, atd2)!=0);
-			
-			
-			atd1 = new ArrowTypeData();
-			atd2 = new ArrowTypeData();
-
-			atd1.setAngle(3.4);
-			assertTrue(comparator.compare(atd1, atd2)!=0);
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ArrowTypeDataComparatorTest {
+	ArrowTypeDataComparator comparator = new ArrowTypeDataComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCompareEquals() {
+		try {
+			assertEquals(0, comparator.compare(null, null));
+			assertEquals(0, comparator.compare(new ArrowTypeData(), new ArrowTypeData()));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCompareDifferent() {
+		try {
+			assertTrue(comparator.compare(new ArrowTypeData(), null) != 0);
+			assertTrue(comparator.compare(null, new ArrowTypeData()) != 0);
+			assertTrue(comparator.compare(new ArrowTypeData() {
+				private static final long serialVersionUID = 1L;
+			}, new ArrowTypeData()) != 0);
+			
+			ArrowTypeData atd1 = new ArrowTypeData();
+			ArrowTypeData atd2 = new ArrowTypeData();
+
+			atd1.setArrowType(ArrowType.CROSSBAR);
+			assertTrue(comparator.compare(atd1, atd2)!=0);
+			
+			atd1 = new ArrowTypeData();
+			atd2 = new ArrowTypeData();
+
+			atd1.setArrowLineType(LineType.DOUBLE);
+			assertTrue(comparator.compare(atd1, atd2)!=0);
+			
+			atd1 = new ArrowTypeData();
+			atd2 = new ArrowTypeData();
+
+			atd1.setLen(2.0);
+			assertTrue(comparator.compare(atd1, atd2)!=0);
+			
+			
+			atd1 = new ArrowTypeData();
+			atd2 = new ArrowTypeData();
+
+			atd1.setAngle(3.4);
+			assertTrue(comparator.compare(atd1, atd2)!=0);
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeDataTest.java b/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeDataTest.java
index 7127d2f882..274720d480 100644
--- a/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeDataTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeDataTest.java
@@ -1,79 +1,79 @@
-package lcsb.mapviewer.model.graphics;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class ArrowTypeDataTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new ArrowTypeData());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			ArrowTypeData original = new ArrowTypeData();
-			ArrowTypeData degraded = original.copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			ArrowTypeData original = new ArrowTypeData();
-			int id = 29;
-
-			original.setId(id);
-			assertEquals(id, original.getId());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new ArrowTypeData() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class ArrowTypeDataTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new ArrowTypeData());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			ArrowTypeData original = new ArrowTypeData();
+			ArrowTypeData degraded = original.copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			ArrowTypeData original = new ArrowTypeData();
+			int id = 29;
+
+			original.setId(id);
+			assertEquals(id, original.getId());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new ArrowTypeData() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeTest.java b/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeTest.java
index d8701436b3..9fbee6020e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/graphics/ArrowTypeTest.java
@@ -1,29 +1,29 @@
-package lcsb.mapviewer.model.graphics;
-
-import static org.junit.Assert.*;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ArrowTypeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValidValues() {
-		for (ArrowType type : ArrowType.values()) {
-			assertNotNull(type);
-
-			// for coverage tests
-			ArrowType.valueOf(type.toString());
-		}
-	}
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ArrowTypeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValidValues() {
+		for (ArrowType type : ArrowType.values()) {
+			assertNotNull(type);
+
+			// for coverage tests
+			ArrowType.valueOf(type.toString());
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/graphics/LineTypeTest.java b/model/src/test/java/lcsb/mapviewer/model/graphics/LineTypeTest.java
index 8d16c8f510..8bb7702d1e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/graphics/LineTypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/graphics/LineTypeTest.java
@@ -1,30 +1,30 @@
-package lcsb.mapviewer.model.graphics;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class LineTypeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValidValues() {
-		for (LineType type : LineType.values()) {
-			assertNotNull(type);
-			assertNotNull(type.getStroke());
-
-			// for coverage tests
-			LineType.valueOf(type.toString());
-		}
-	}
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class LineTypeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValidValues() {
+		for (LineType type : LineType.values()) {
+			assertNotNull(type);
+			assertNotNull(type.getStroke());
+
+			// for coverage tests
+			LineType.valueOf(type.toString());
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/graphics/PolylineDataComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/graphics/PolylineDataComparatorTest.java
index 7488a91730..fef2e47552 100644
--- a/model/src/test/java/lcsb/mapviewer/model/graphics/PolylineDataComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/graphics/PolylineDataComparatorTest.java
@@ -1,111 +1,111 @@
-package lcsb.mapviewer.model.graphics;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.Color;
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class PolylineDataComparatorTest {
-
-	PolylineDataComparator comparator = new PolylineDataComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			PolylineData pd1 = new PolylineData();
-			PolylineData pd2 = new PolylineData();
-			assertEquals(0, comparator.compare(pd1, pd2));
-			assertEquals(0, comparator.compare(null, null));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends PolylineData {
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp pd1 = new Tmp();
-			Tmp pd2 = new Tmp();
-			comparator.compare(pd1, pd2);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			PolylineData pd1 = new PolylineData();
-			PolylineData pd2 = new PolylineData();
-
-			assertTrue(comparator.compare(pd2, null) != 0);
-			assertTrue(comparator.compare(null, pd1) != 0);
-
-			pd1 = new PolylineData();
-			pd2 = new PolylineData();
-			pd2.addPoint(new Point2D.Double(1, 2));
-			assertTrue(comparator.compare(pd1, pd2) != 0);
-			assertTrue(comparator.compare(pd2, pd1) != 0);
-
-			pd1 = new PolylineData();
-			pd2 = new PolylineData();
-			ArrowTypeData atd = new ArrowTypeData();
-			atd.setLen(34);
-			pd2.setBeginAtd(atd);
-			assertTrue(comparator.compare(pd1, pd2) != 0);
-			assertTrue(comparator.compare(pd2, pd1) != 0);
-
-			pd1 = new PolylineData();
-			pd2 = new PolylineData();
-			atd = new ArrowTypeData();
-			atd.setLen(34);
-			pd2.setEndAtd(atd);
-			assertTrue(comparator.compare(pd1, pd2) != 0);
-			assertTrue(comparator.compare(pd2, pd1) != 0);
-
-			pd1 = new PolylineData();
-			pd2 = new PolylineData();
-			pd2.setColor(Color.BLUE);
-			assertTrue(comparator.compare(pd1, pd2) != 0);
-			assertTrue(comparator.compare(pd2, pd1) != 0);
-
-			pd1 = new PolylineData();
-			pd2 = new PolylineData();
-			pd2.setType(LineType.DASHED);
-			assertTrue(comparator.compare(pd1, pd2) != 0);
-			assertTrue(comparator.compare(pd2, pd1) != 0);
-
-			assertTrue(comparator.compare(pd2, new PolylineData() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.Color;
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class PolylineDataComparatorTest {
+
+	PolylineDataComparator comparator = new PolylineDataComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			PolylineData pd1 = new PolylineData();
+			PolylineData pd2 = new PolylineData();
+			assertEquals(0, comparator.compare(pd1, pd2));
+			assertEquals(0, comparator.compare(null, null));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends PolylineData {
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp pd1 = new Tmp();
+			Tmp pd2 = new Tmp();
+			comparator.compare(pd1, pd2);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			PolylineData pd1 = new PolylineData();
+			PolylineData pd2 = new PolylineData();
+
+			assertTrue(comparator.compare(pd2, null) != 0);
+			assertTrue(comparator.compare(null, pd1) != 0);
+
+			pd1 = new PolylineData();
+			pd2 = new PolylineData();
+			pd2.addPoint(new Point2D.Double(1, 2));
+			assertTrue(comparator.compare(pd1, pd2) != 0);
+			assertTrue(comparator.compare(pd2, pd1) != 0);
+
+			pd1 = new PolylineData();
+			pd2 = new PolylineData();
+			ArrowTypeData atd = new ArrowTypeData();
+			atd.setLen(34);
+			pd2.setBeginAtd(atd);
+			assertTrue(comparator.compare(pd1, pd2) != 0);
+			assertTrue(comparator.compare(pd2, pd1) != 0);
+
+			pd1 = new PolylineData();
+			pd2 = new PolylineData();
+			atd = new ArrowTypeData();
+			atd.setLen(34);
+			pd2.setEndAtd(atd);
+			assertTrue(comparator.compare(pd1, pd2) != 0);
+			assertTrue(comparator.compare(pd2, pd1) != 0);
+
+			pd1 = new PolylineData();
+			pd2 = new PolylineData();
+			pd2.setColor(Color.BLUE);
+			assertTrue(comparator.compare(pd1, pd2) != 0);
+			assertTrue(comparator.compare(pd2, pd1) != 0);
+
+			pd1 = new PolylineData();
+			pd2 = new PolylineData();
+			pd2.setType(LineType.DASHED);
+			assertTrue(comparator.compare(pd1, pd2) != 0);
+			assertTrue(comparator.compare(pd2, pd1) != 0);
+
+			assertTrue(comparator.compare(pd2, new PolylineData() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/graphics/PolylineDataTest.java b/model/src/test/java/lcsb/mapviewer/model/graphics/PolylineDataTest.java
index 2acb342d6c..ffde78d536 100644
--- a/model/src/test/java/lcsb/mapviewer/model/graphics/PolylineDataTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/graphics/PolylineDataTest.java
@@ -1,421 +1,421 @@
-package lcsb.mapviewer.model.graphics;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.Color;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.PathIterator;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class PolylineDataTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testConstructor() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			assertNotNull(pd);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor2() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			PolylineData pd2 = new PolylineData(pd);
-			assertNotNull(pd2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor3() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(5, 1));
-			points.add(new Point2D.Double(5, 5));
-			PolylineData pd2 = new PolylineData(points);
-			assertNotNull(pd2);
-			assertEquals(points.size(), pd2.getPoints().size());
-			assertEquals(8, pd2.length(), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddPoint() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			pd.addPoint(0, new Point2D.Double(-10, -10));
-			assertEquals(3, pd.getPoints().size());
-			assertTrue(pd.getPoints().get(0).getX() < 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddInvalidPoint() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			pd.addPoint(0, new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetPoint() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			pd.setPoint(0, new Point2D.Double(-10, -10));
-			assertEquals(2, pd.getPoints().size());
-			assertTrue(pd.getPoints().get(0).getX() < 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetInvalidPoint() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			pd.setPoint(0, new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLines() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(5, 1));
-			points.add(new Point2D.Double(5, 5));
-			PolylineData pd2 = new PolylineData(points);
-			assertEquals(2, pd2.getLines().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvaliArgument() throws Exception {
-		try {
-			new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, Double.NaN));
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new PolylineData());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetSubline() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(5, 1));
-			points.add(new Point2D.Double(5, 5));
-			PolylineData pd = new PolylineData(points);
-			PolylineData pd2 = pd.getSubline(0, 2);
-			assertNotNull(pd2);
-			assertEquals(2, pd2.getPoints().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetEndPoint() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			pd.setEndPoint(new Point2D.Double(-10, -10));
-			assertEquals(2, pd.getPoints().size());
-			assertTrue(pd.getEndPoint().getX() < 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetInvalidEndPoint() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			pd.setEndPoint(new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetStartPoint() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			pd.setStartPoint(new Point2D.Double(-10, -10));
-			assertEquals(2, pd.getPoints().size());
-			assertTrue(pd.getBeginPoint().getX() < 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetInvalidStartPoint() throws Exception {
-		try {
-			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
-			pd.setStartPoint(new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToGeneralPath() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(5, 1));
-			points.add(new Point2D.Double(5, 5));
-			PolylineData pd = new PolylineData(points);
-			GeneralPath gp = pd.toGeneralPath();
-			PathIterator pi = gp.getPathIterator(new AffineTransform());
-			int count = 0;
-			while (!pi.isDone()) {
-				count++;
-				pi.next();
-			}
-			assertEquals(3, count);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTrimEnd() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(11, 1));
-			PolylineData pd = new PolylineData(points);
-			pd.trimEnd(3);
-
-			assertEquals(8, pd.getEndPoint().getX(), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTrimBegin() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(11, 1));
-			PolylineData pd = new PolylineData(points);
-			pd.trimBegin(3);
-
-			assertEquals(4, pd.getPoints().get(0).getX(), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTrimEnd2() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(11, 1));
-			PolylineData pd = new PolylineData(points);
-			pd.trimEnd(30);
-
-			assertEquals(1, pd.getEndPoint().getX(), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testTrimBegin2() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(11, 1));
-			PolylineData pd = new PolylineData(points);
-			pd.trimBegin(30);
-
-			assertEquals(11, pd.getPoints().get(0).getX(), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReverse() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(1, 1));
-			points.add(new Point2D.Double(11, 1));
-			PolylineData pd = new PolylineData(points);
-			PolylineData pd2 = pd.reverse();
-			assertTrue(pd.getBeginPoint().distance(pd2.getEndPoint()) <= Configuration.EPSILON);
-			assertTrue(pd2.getBeginPoint().distance(pd.getEndPoint()) <= Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testEmptyLength() throws Exception {
-		try {
-			PolylineData pd = new PolylineData();
-			pd.addPoint(new Point2D.Double(0, 0));
-			assertEquals(0, pd.length(), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetInvalidPoints() throws Exception {
-		try {
-			List<Point2D> points = new ArrayList<>();
-			points.add(new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
-			PolylineData pd = new PolylineData();
-			pd.setPoints(points);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() throws Exception {
-		try {
-			PolylineData pd = new PolylineData();
-			Color color = Color.BLACK;
-			LineType type = LineType.DASH_DOT;
-			String strWidth = "12";
-			double width = 12.0;
-			int id = 3;
-			pd.setColor(color);
-			pd.setId(id);
-			pd.setType(type);
-			pd.setWidth(strWidth);
-
-			assertEquals(id, pd.getId());
-			assertEquals(color, pd.getColor());
-			assertEquals(width, pd.getWidth(), Configuration.EPSILON);
-			assertEquals(type, pd.getType());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSimpleCopy() throws Exception {
-		try {
-			PolylineData pd = new PolylineData();
-			PolylineData pd2 = pd.copy();
-
-			assertNotNull(pd2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() throws Exception {
-		try {
-			PolylineData pd = new PolylineData() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			};
-			pd.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.graphics;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.Color;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class PolylineDataTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testConstructor() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			assertNotNull(pd);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			PolylineData pd2 = new PolylineData(pd);
+			assertNotNull(pd2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor3() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(5, 1));
+			points.add(new Point2D.Double(5, 5));
+			PolylineData pd2 = new PolylineData(points);
+			assertNotNull(pd2);
+			assertEquals(points.size(), pd2.getPoints().size());
+			assertEquals(8, pd2.length(), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddPoint() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			pd.addPoint(0, new Point2D.Double(-10, -10));
+			assertEquals(3, pd.getPoints().size());
+			assertTrue(pd.getPoints().get(0).getX() < 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddInvalidPoint() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			pd.addPoint(0, new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetPoint() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			pd.setPoint(0, new Point2D.Double(-10, -10));
+			assertEquals(2, pd.getPoints().size());
+			assertTrue(pd.getPoints().get(0).getX() < 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetInvalidPoint() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			pd.setPoint(0, new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLines() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(5, 1));
+			points.add(new Point2D.Double(5, 5));
+			PolylineData pd2 = new PolylineData(points);
+			assertEquals(2, pd2.getLines().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvaliArgument() throws Exception {
+		try {
+			new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, Double.NaN));
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new PolylineData());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetSubline() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(5, 1));
+			points.add(new Point2D.Double(5, 5));
+			PolylineData pd = new PolylineData(points);
+			PolylineData pd2 = pd.getSubline(0, 2);
+			assertNotNull(pd2);
+			assertEquals(2, pd2.getPoints().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetEndPoint() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			pd.setEndPoint(new Point2D.Double(-10, -10));
+			assertEquals(2, pd.getPoints().size());
+			assertTrue(pd.getEndPoint().getX() < 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetInvalidEndPoint() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			pd.setEndPoint(new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetStartPoint() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			pd.setStartPoint(new Point2D.Double(-10, -10));
+			assertEquals(2, pd.getPoints().size());
+			assertTrue(pd.getBeginPoint().getX() < 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetInvalidStartPoint() throws Exception {
+		try {
+			PolylineData pd = new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 10));
+			pd.setStartPoint(new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToGeneralPath() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(5, 1));
+			points.add(new Point2D.Double(5, 5));
+			PolylineData pd = new PolylineData(points);
+			GeneralPath gp = pd.toGeneralPath();
+			PathIterator pi = gp.getPathIterator(new AffineTransform());
+			int count = 0;
+			while (!pi.isDone()) {
+				count++;
+				pi.next();
+			}
+			assertEquals(3, count);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTrimEnd() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(11, 1));
+			PolylineData pd = new PolylineData(points);
+			pd.trimEnd(3);
+
+			assertEquals(8, pd.getEndPoint().getX(), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTrimBegin() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(11, 1));
+			PolylineData pd = new PolylineData(points);
+			pd.trimBegin(3);
+
+			assertEquals(4, pd.getPoints().get(0).getX(), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTrimEnd2() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(11, 1));
+			PolylineData pd = new PolylineData(points);
+			pd.trimEnd(30);
+
+			assertEquals(1, pd.getEndPoint().getX(), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testTrimBegin2() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(11, 1));
+			PolylineData pd = new PolylineData(points);
+			pd.trimBegin(30);
+
+			assertEquals(11, pd.getPoints().get(0).getX(), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReverse() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(1, 1));
+			points.add(new Point2D.Double(11, 1));
+			PolylineData pd = new PolylineData(points);
+			PolylineData pd2 = pd.reverse();
+			assertTrue(pd.getBeginPoint().distance(pd2.getEndPoint()) <= Configuration.EPSILON);
+			assertTrue(pd2.getBeginPoint().distance(pd.getEndPoint()) <= Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testEmptyLength() throws Exception {
+		try {
+			PolylineData pd = new PolylineData();
+			pd.addPoint(new Point2D.Double(0, 0));
+			assertEquals(0, pd.length(), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetInvalidPoints() throws Exception {
+		try {
+			List<Point2D> points = new ArrayList<>();
+			points.add(new Point2D.Double(Double.NEGATIVE_INFINITY, -10));
+			PolylineData pd = new PolylineData();
+			pd.setPoints(points);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() throws Exception {
+		try {
+			PolylineData pd = new PolylineData();
+			Color color = Color.BLACK;
+			LineType type = LineType.DASH_DOT;
+			String strWidth = "12";
+			double width = 12.0;
+			int id = 3;
+			pd.setColor(color);
+			pd.setId(id);
+			pd.setType(type);
+			pd.setWidth(strWidth);
+
+			assertEquals(id, pd.getId());
+			assertEquals(color, pd.getColor());
+			assertEquals(width, pd.getWidth(), Configuration.EPSILON);
+			assertEquals(type, pd.getType());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSimpleCopy() throws Exception {
+		try {
+			PolylineData pd = new PolylineData();
+			PolylineData pd2 = pd.copy();
+
+			assertNotNull(pd2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() throws Exception {
+		try {
+			PolylineData pd = new PolylineData() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			};
+			pd.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/log/LogTypeTest.java b/model/src/test/java/lcsb/mapviewer/model/log/LogTypeTest.java
index a1f6925281..743855cb5e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/log/LogTypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/log/LogTypeTest.java
@@ -1,29 +1,29 @@
-package lcsb.mapviewer.model.log;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class LogTypeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValidValues() {
-		for (LogType type : LogType.values()) {
-			assertNotNull(type);
-
-			// for coverage tests
-			LogType.valueOf(type.toString());
-		}
-	}
-
-}
+package lcsb.mapviewer.model.log;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class LogTypeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValidValues() {
+		for (LogType type : LogType.values()) {
+			assertNotNull(type);
+
+			// for coverage tests
+			LogType.valueOf(type.toString());
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/log/ObjectLogTest.java b/model/src/test/java/lcsb/mapviewer/model/log/ObjectLogTest.java
index ca0f9f8f3e..882666ad11 100644
--- a/model/src/test/java/lcsb/mapviewer/model/log/ObjectLogTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/log/ObjectLogTest.java
@@ -1,65 +1,65 @@
-package lcsb.mapviewer.model.log;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Calendar;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.user.User;
-
-public class ObjectLogTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new ObjectLog());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			ObjectLog log = new ObjectLog();
-			String description = "qwe";
-			int id = 20;
-			int objectId = 21;
-			Calendar time = Calendar.getInstance();
-			Class<?> tableName = Object.class;
-			LogType type = LogType.ADD_MISSING_CONNECTION;
-			User user = new User();
-			log.setDescription(description);
-			log.setId(id);
-			log.setObjectId(objectId);
-			log.setTime(time);
-			log.setTable(tableName);
-			log.setType(type);
-			log.setUser(user);
-			
-			assertEquals(description,log.getDescription());
-			assertEquals(id,log.getId());
-			assertEquals((Integer)objectId,log.getObjectId());
-			assertEquals(time,log.getTime());
-			assertEquals(tableName,log.getTable());
-			assertEquals(type,log.getType());
-			assertEquals(user,log.getUser());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.log;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Calendar;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.user.User;
+
+public class ObjectLogTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new ObjectLog());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			ObjectLog log = new ObjectLog();
+			String description = "qwe";
+			int id = 20;
+			int objectId = 21;
+			Calendar time = Calendar.getInstance();
+			Class<?> tableName = Object.class;
+			LogType type = LogType.ADD_MISSING_CONNECTION;
+			User user = new User();
+			log.setDescription(description);
+			log.setId(id);
+			log.setObjectId(objectId);
+			log.setTime(time);
+			log.setTable(tableName);
+			log.setType(type);
+			log.setUser(user);
+			
+			assertEquals(description,log.getDescription());
+			assertEquals(id,log.getId());
+			assertEquals((Integer)objectId,log.getObjectId());
+			assertEquals(time,log.getTime());
+			assertEquals(tableName,log.getTable());
+			assertEquals(type,log.getType());
+			assertEquals(user,log.getUser());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/AliasInFewParentsExceptionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/AliasInFewParentsExceptionTest.java
index 31bcce2dc0..c33431d2c0 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/AliasInFewParentsExceptionTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/AliasInFewParentsExceptionTest.java
@@ -1,28 +1,28 @@
-package lcsb.mapviewer.model.map;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class AliasInFewParentsExceptionTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new AliasInFewParentsException(""));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class AliasInFewParentsExceptionTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new AliasInFewParentsException(""));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/AllMapTests.java b/model/src/test/java/lcsb/mapviewer/model/map/AllMapTests.java
index ba9c75490c..f0d48eeb97 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/AllMapTests.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/AllMapTests.java
@@ -1,48 +1,48 @@
-package lcsb.mapviewer.model.map;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-import lcsb.mapviewer.model.map.agregator.AllAgregatorTests;
-import lcsb.mapviewer.model.map.graph.AllGraphTests;
-import lcsb.mapviewer.model.map.layout.AllLayoutTests;
-import lcsb.mapviewer.model.map.layout.graphics.AllGraphicsTests;
-import lcsb.mapviewer.model.map.model.AllModelTests;
-import lcsb.mapviewer.model.map.modifier.AllModifierTests;
-import lcsb.mapviewer.model.map.reaction.AllReactionTests;
-import lcsb.mapviewer.model.map.species.AllSpeciesTests;
-import lcsb.mapviewer.model.map.statistics.AllStatisticsTests;
-
-@RunWith(Suite.class)
-@SuiteClasses({ AliasInFewParentsExceptionTest.class, //
-		AllAgregatorTests.class, //
-		AllGraphTests.class, //
-		AllGraphicsTests.class, //
-		AllLayoutTests.class, //
-		AllModelTests.class, //
-		AllModifierTests.class, //
-		AllReactionTests.class, //
-		AllSpeciesTests.class, //
-		AllStatisticsTests.class, //
-		CommentTest.class, //
-		ElementComparatorTest.class, //
-		ElementTest.class, //
-		InconsistentModelExceptionTest.class, //
-		LayoutComparatorTest.class, //
-		MiriamDataTest.class, //
-		MiriamRelationTypeTest.class, //
-		MiriamTypeTest.class, //
-		MiriamTypeNameComparatorTest.class, //
-		OverviewImageComparatorTest.class, //
-		OverviewImageLinkComparatorTest.class, //
-		OverviewImageLinkTest.class, //
-		OverviewImageTest.class, //
-		OverviewLinkComparatorTest.class, //
-		OverviewLinkTest.class, //
-		OverviewModelLinkComparatorTest.class, //
-		OverviewModelLinkTest.class, //
-		OverviewSearchLinkTest.class })
-public class AllMapTests {
-
-}
+package lcsb.mapviewer.model.map;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import lcsb.mapviewer.model.map.agregator.AllAgregatorTests;
+import lcsb.mapviewer.model.map.graph.AllGraphTests;
+import lcsb.mapviewer.model.map.layout.AllLayoutTests;
+import lcsb.mapviewer.model.map.layout.graphics.AllGraphicsTests;
+import lcsb.mapviewer.model.map.model.AllModelTests;
+import lcsb.mapviewer.model.map.modifier.AllModifierTests;
+import lcsb.mapviewer.model.map.reaction.AllReactionTests;
+import lcsb.mapviewer.model.map.species.AllSpeciesTests;
+import lcsb.mapviewer.model.map.statistics.AllStatisticsTests;
+
+@RunWith(Suite.class)
+@SuiteClasses({ AliasInFewParentsExceptionTest.class, //
+		AllAgregatorTests.class, //
+		AllGraphTests.class, //
+		AllGraphicsTests.class, //
+		AllLayoutTests.class, //
+		AllModelTests.class, //
+		AllModifierTests.class, //
+		AllReactionTests.class, //
+		AllSpeciesTests.class, //
+		AllStatisticsTests.class, //
+		CommentTest.class, //
+		ElementComparatorTest.class, //
+		ElementTest.class, //
+		InconsistentModelExceptionTest.class, //
+		LayoutComparatorTest.class, //
+		MiriamDataTest.class, //
+		MiriamRelationTypeTest.class, //
+		MiriamTypeTest.class, //
+		MiriamTypeNameComparatorTest.class, //
+		OverviewImageComparatorTest.class, //
+		OverviewImageLinkComparatorTest.class, //
+		OverviewImageLinkTest.class, //
+		OverviewImageTest.class, //
+		OverviewLinkComparatorTest.class, //
+		OverviewLinkTest.class, //
+		OverviewModelLinkComparatorTest.class, //
+		OverviewModelLinkTest.class, //
+		OverviewSearchLinkTest.class })
+public class AllMapTests {
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/CommentTest.java b/model/src/test/java/lcsb/mapviewer/model/map/CommentTest.java
index 65bdb2a74a..d44b3e1ad9 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/CommentTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/CommentTest.java
@@ -1,90 +1,90 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-
-import java.awt.geom.Point2D;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.user.User;
-
-public class CommentTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Comment());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Comment comment = new Comment();
-			String content = "c";
-			Point2D.Double coordinates = new Point2D.Double(1, 2);
-			String email = "a";
-			boolean deleted = true;
-			int id = 85;
-			Model model = new ModelFullIndexed(null);
-			String name = "n";
-			boolean pinned = true;
-			String removeReason = "rr";
-			Model submodel = new ModelFullIndexed(null);
-			Integer tableId = 5;
-			Class<?> tableName = Object.class;
-			User user = new User();
-
-			comment.setContent(content);
-			assertEquals(content, comment.getContent());
-			comment.setCoordinates(coordinates);
-			assertEquals(coordinates, comment.getCoordinates());
-			comment.setDeleted(deleted);
-			assertEquals(deleted, comment.isDeleted());
-			comment.setEmail(email);
-			assertEquals(email, comment.getEmail());
-			comment.setId(id);
-			assertEquals(id, comment.getId());
-			comment.setModel(model);
-			assertEquals(model, comment.getModelData().getModel());
-			comment.setModelData(model.getModelData());
-			assertEquals(model.getModelData(), comment.getModelData());
-			comment.setName(name);
-			assertEquals(name, comment.getName());
-			comment.setPinned(pinned);
-			assertEquals(pinned, comment.isPinned());
-			comment.setRemoveReason(removeReason);
-			assertEquals(removeReason, comment.getRemoveReason());
-			comment.setSubmodel(submodel);
-			assertEquals(submodel, comment.getSubmodel());
-			comment.setSubmodelData(submodel.getModelData());
-			assertEquals(submodel.getModelData(), comment.getSubmodelData());
-			comment.setTableId(tableId);
-			assertEquals(tableId, comment.getTableId());
-			comment.setTableName(tableName);
-			assertEquals(tableName, comment.getTableName());
-			comment.setUser(user);
-			assertEquals(user, comment.getUser());
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+
+import java.awt.geom.Point2D;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.user.User;
+
+public class CommentTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Comment());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Comment comment = new Comment();
+			String content = "c";
+			Point2D.Double coordinates = new Point2D.Double(1, 2);
+			String email = "a";
+			boolean deleted = true;
+			int id = 85;
+			Model model = new ModelFullIndexed(null);
+			String name = "n";
+			boolean pinned = true;
+			String removeReason = "rr";
+			Model submodel = new ModelFullIndexed(null);
+			Integer tableId = 5;
+			Class<?> tableName = Object.class;
+			User user = new User();
+
+			comment.setContent(content);
+			assertEquals(content, comment.getContent());
+			comment.setCoordinates(coordinates);
+			assertEquals(coordinates, comment.getCoordinates());
+			comment.setDeleted(deleted);
+			assertEquals(deleted, comment.isDeleted());
+			comment.setEmail(email);
+			assertEquals(email, comment.getEmail());
+			comment.setId(id);
+			assertEquals(id, comment.getId());
+			comment.setModel(model);
+			assertEquals(model, comment.getModelData().getModel());
+			comment.setModelData(model.getModelData());
+			assertEquals(model.getModelData(), comment.getModelData());
+			comment.setName(name);
+			assertEquals(name, comment.getName());
+			comment.setPinned(pinned);
+			assertEquals(pinned, comment.isPinned());
+			comment.setRemoveReason(removeReason);
+			assertEquals(removeReason, comment.getRemoveReason());
+			comment.setSubmodel(submodel);
+			assertEquals(submodel, comment.getSubmodel());
+			comment.setSubmodelData(submodel.getModelData());
+			assertEquals(submodel.getModelData(), comment.getSubmodelData());
+			comment.setTableId(tableId);
+			assertEquals(tableId, comment.getTableId());
+			comment.setTableName(tableName);
+			assertEquals(tableName, comment.getTableName());
+			comment.setUser(user);
+			assertEquals(user, comment.getUser());
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/ElementComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/ElementComparatorTest.java
index 75927396cf..e49dc4804e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/ElementComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/ElementComparatorTest.java
@@ -1,253 +1,253 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidClassException;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.fields.PositionToCompartment;
-
-public class ElementComparatorTest {
-
-	ElementComparator comparator = new ElementComparator();
-
-	class Mock extends Element {
-
-		/**
-		 * 
-		 */
-		private static final long serialVersionUID = 1L;
-
-		@Override
-		public Element copy() {
-			return null;
-		}
-
-		@Override
-		public String getElementId() {
-			return null;
-		}
-
-		@Override
-		public String getStringType() {
-			return null;
-		}
-
-		@Override
-		public void setElementId(String id) {
-		}
-
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testException() {
-		try {
-			comparator.compare(new Mock(), new Mock());
-
-			fail("Exception should occur");
-		} catch (InvalidClassException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testException2() {
-		try {
-			assertEquals(0, comparator.compare(new Compartment(), new Compartment()));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Species species1 = createSimpleMolecule();
-			Species species2 = createSimpleMolecule();
-			assertEquals(0, comparator.compare(species1, species2));
-
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (InvalidClassException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testInternalCompare() {
-		try {
-			Species species1 = createSimpleMolecule();
-			assertTrue(comparator.internalCompare(species1, null) != 0);
-			assertTrue(comparator.internalCompare(null, species1) != 0);
-
-			assertEquals(0, comparator.internalCompare(null, null));
-
-		} catch (InvalidClassException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			SimpleMolecule species1 = createSimpleMolecule();
-			Species species2 = createSimpleMolecule();
-
-			species1.setCharge(99);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setHomodimer(233);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setFormula("a");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setElementId("");
-			species1.setElementId("ASD");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setNotes("ASD");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setPositionToCompartment(PositionToCompartment.INSIDE);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.getMiriamData().clear();
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.getMiriamData().iterator().next().setRelationType(MiriamRelationType.BQ_BIOL_HAS_PART);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.addMiriamData(new MiriamData());
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			assertTrue(comparator.compare(species1, null) != 0);
-			assertTrue(comparator.compare(null, species1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testDifferentNewFields() throws Exception {
-		try {
-			SimpleMolecule species1 = createSimpleMolecule();
-			Species species2 = createSimpleMolecule();
-
-			species1.setSymbol("some symbol");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-
-			species1.setFullName("some symbol");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-
-			species1.getSynonyms().add("asd");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-
-			species1.getFormerSymbols().add("asd");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	public SimpleMolecule createSimpleMolecule() {
-		SimpleMolecule result = new SimpleMolecule();
-		result.setHomodimer(12);
-		result.setElementId("id");
-		result.setName("id");
-		result.setInitialAmount("12");
-		result.setCharge("13");
-		result.setInitialConcentration("14");
-		result.setOnlySubstanceUnits("true");
-		result.setPositionToCompartment(PositionToCompartment.TRANSMEMBRANE);
-		result.setNotes("id");
-		MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, "c");
-		result.addMiriamData(md);
-		return result;
-	}
-
-	@Test
-	public void testDifferentNewReconFields() throws Exception {
-		try {
-			Element reaction1 = createSimpleMolecule();
-
-			Element reaction2 = createSimpleMolecule();
-			reaction2.setAbbreviation("ABRR");
-
-			assertTrue(comparator.compare(reaction1, reaction2) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidClassException;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.fields.PositionToCompartment;
+
+public class ElementComparatorTest {
+
+	ElementComparator comparator = new ElementComparator();
+
+	class Mock extends Element {
+
+		/**
+		 * 
+		 */
+		private static final long serialVersionUID = 1L;
+
+		@Override
+		public Element copy() {
+			return null;
+		}
+
+		@Override
+		public String getElementId() {
+			return null;
+		}
+
+		@Override
+		public String getStringType() {
+			return null;
+		}
+
+		@Override
+		public void setElementId(String id) {
+		}
+
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testException() {
+		try {
+			comparator.compare(new Mock(), new Mock());
+
+			fail("Exception should occur");
+		} catch (InvalidClassException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testException2() {
+		try {
+			assertEquals(0, comparator.compare(new Compartment(), new Compartment()));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Species species1 = createSimpleMolecule();
+			Species species2 = createSimpleMolecule();
+			assertEquals(0, comparator.compare(species1, species2));
+
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (InvalidClassException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testInternalCompare() {
+		try {
+			Species species1 = createSimpleMolecule();
+			assertTrue(comparator.internalCompare(species1, null) != 0);
+			assertTrue(comparator.internalCompare(null, species1) != 0);
+
+			assertEquals(0, comparator.internalCompare(null, null));
+
+		} catch (InvalidClassException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			SimpleMolecule species1 = createSimpleMolecule();
+			Species species2 = createSimpleMolecule();
+
+			species1.setCharge(99);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setHomodimer(233);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setFormula("a");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setElementId("");
+			species1.setElementId("ASD");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setNotes("ASD");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setPositionToCompartment(PositionToCompartment.INSIDE);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.getMiriamData().clear();
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.getMiriamData().iterator().next().setRelationType(MiriamRelationType.BQ_BIOL_HAS_PART);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.addMiriamData(new MiriamData());
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			assertTrue(comparator.compare(species1, null) != 0);
+			assertTrue(comparator.compare(null, species1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testDifferentNewFields() throws Exception {
+		try {
+			SimpleMolecule species1 = createSimpleMolecule();
+			Species species2 = createSimpleMolecule();
+
+			species1.setSymbol("some symbol");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+
+			species1.setFullName("some symbol");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+
+			species1.getSynonyms().add("asd");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+
+			species1.getFormerSymbols().add("asd");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	public SimpleMolecule createSimpleMolecule() {
+		SimpleMolecule result = new SimpleMolecule();
+		result.setHomodimer(12);
+		result.setElementId("id");
+		result.setName("id");
+		result.setInitialAmount("12");
+		result.setCharge("13");
+		result.setInitialConcentration("14");
+		result.setOnlySubstanceUnits("true");
+		result.setPositionToCompartment(PositionToCompartment.TRANSMEMBRANE);
+		result.setNotes("id");
+		MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, "c");
+		result.addMiriamData(md);
+		return result;
+	}
+
+	@Test
+	public void testDifferentNewReconFields() throws Exception {
+		try {
+			Element reaction1 = createSimpleMolecule();
+
+			Element reaction2 = createSimpleMolecule();
+			reaction2.setAbbreviation("ABRR");
+
+			assertTrue(comparator.compare(reaction1, reaction2) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/ElementTest.java b/model/src/test/java/lcsb/mapviewer/model/map/ElementTest.java
index 423d2879d9..5d81ea38ad 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/ElementTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/ElementTest.java
@@ -1,163 +1,163 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.ModelTestFunctions;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-
-public class ElementTest extends ModelTestFunctions {
-	Logger logger = Logger.getLogger(ElementTest.class);
-
-	class ElementMock extends Element {
-		private static final long serialVersionUID = 1L;
-
-		public ElementMock() {
-		}
-
-		public ElementMock(Element element) {
-			super(element);
-		}
-
-		@Override
-		public String getElementId() {
-			return null;
-		}
-
-		@Override
-		public void setElementId(String id) {
-		}
-
-		@Override
-		public Element copy() {
-			return null;
-		}
-
-		@Override
-		public String getStringType() {
-			return null;
-		}
-
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			Element element = new ElementMock();
-			element.addMiriamData(new MiriamData());
-			Element copy = new ElementMock(element);
-			assertNotNull(copy);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddMiriamCollection() {
-		try {
-			List<MiriamData> list = new ArrayList<>();
-			list.add(new MiriamData(MiriamType.CAS, "1"));
-			list.add(new MiriamData(MiriamType.CAS, "1"));
-			Element element = new ElementMock();
-			element.addMiriamData(list);
-			assertEquals(1, element.getMiriamData().size());
-			assertEquals(1, getWarnings().size());
-
-			element.addMiriamData(list);
-			assertEquals(3, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetNotes() {
-		try {
-			Element element = new ElementMock();
-			element.setNotes("</html>");
-			fail("Exception epxected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddSynonym() {
-		try {
-			Element element = new ElementMock();
-			List<String> synonyms = new ArrayList<>();
-			synonyms.add("syn");
-			element.addSynonyms(synonyms);
-			assertEquals("syn", element.getSynonyms().get(0));
-			StringBuilder sb = new StringBuilder();
-			for (int i = 0; i < 300; i++) {
-				sb.append("a");
-			}
-			String syn = sb.toString();
-			synonyms = new ArrayList<>();
-			synonyms.add(syn);
-			element.addSynonyms(synonyms);
-			assertFalse(syn.equals(element.getSynonyms().get(1)));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Element element = new ElementMock();
-			int id = 4;
-			List<String> synonyms = new ArrayList<>();
-			List<String> formerSymbols = new ArrayList<>();
-			ComplexSpecies complex = new ComplexSpecies();
-			Model model = new ModelFullIndexed(null);
-			String formula = "str";
-
-			element.setId(id);
-			element.setSynonyms(synonyms);
-			element.setFormerSymbols(formerSymbols);
-			element.setComplex(complex);
-			element.setModel(model);
-			element.setFormula(formula);
-
-			assertEquals(id, element.getId());
-			assertEquals(synonyms, element.getSynonyms());
-			assertEquals(formerSymbols, element.getFormerSymbols());
-			assertEquals(complex, element.getComplex());
-			assertEquals(model.getModelData(), element.getModelData());
-			assertEquals(formula, element.getFormula());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.ModelTestFunctions;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+
+public class ElementTest extends ModelTestFunctions {
+	Logger logger = Logger.getLogger(ElementTest.class);
+
+	class ElementMock extends Element {
+		private static final long serialVersionUID = 1L;
+
+		public ElementMock() {
+		}
+
+		public ElementMock(Element element) {
+			super(element);
+		}
+
+		@Override
+		public String getElementId() {
+			return null;
+		}
+
+		@Override
+		public void setElementId(String id) {
+		}
+
+		@Override
+		public Element copy() {
+			return null;
+		}
+
+		@Override
+		public String getStringType() {
+			return null;
+		}
+
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			Element element = new ElementMock();
+			element.addMiriamData(new MiriamData());
+			Element copy = new ElementMock(element);
+			assertNotNull(copy);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddMiriamCollection() {
+		try {
+			List<MiriamData> list = new ArrayList<>();
+			list.add(new MiriamData(MiriamType.CAS, "1"));
+			list.add(new MiriamData(MiriamType.CAS, "1"));
+			Element element = new ElementMock();
+			element.addMiriamData(list);
+			assertEquals(1, element.getMiriamData().size());
+			assertEquals(1, getWarnings().size());
+
+			element.addMiriamData(list);
+			assertEquals(3, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetNotes() {
+		try {
+			Element element = new ElementMock();
+			element.setNotes("</html>");
+			fail("Exception epxected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddSynonym() {
+		try {
+			Element element = new ElementMock();
+			List<String> synonyms = new ArrayList<>();
+			synonyms.add("syn");
+			element.addSynonyms(synonyms);
+			assertEquals("syn", element.getSynonyms().get(0));
+			StringBuilder sb = new StringBuilder();
+			for (int i = 0; i < 300; i++) {
+				sb.append("a");
+			}
+			String syn = sb.toString();
+			synonyms = new ArrayList<>();
+			synonyms.add(syn);
+			element.addSynonyms(synonyms);
+			assertFalse(syn.equals(element.getSynonyms().get(1)));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Element element = new ElementMock();
+			int id = 4;
+			List<String> synonyms = new ArrayList<>();
+			List<String> formerSymbols = new ArrayList<>();
+			ComplexSpecies complex = new ComplexSpecies();
+			Model model = new ModelFullIndexed(null);
+			String formula = "str";
+
+			element.setId(id);
+			element.setSynonyms(synonyms);
+			element.setFormerSymbols(formerSymbols);
+			element.setComplex(complex);
+			element.setModel(model);
+			element.setFormula(formula);
+
+			assertEquals(id, element.getId());
+			assertEquals(synonyms, element.getSynonyms());
+			assertEquals(formerSymbols, element.getFormerSymbols());
+			assertEquals(complex, element.getComplex());
+			assertEquals(model.getModelData(), element.getModelData());
+			assertEquals(formula, element.getFormula());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/InconsistentModelExceptionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/InconsistentModelExceptionTest.java
index 604387471b..22c1b1ec38 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/InconsistentModelExceptionTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/InconsistentModelExceptionTest.java
@@ -1,28 +1,28 @@
-package lcsb.mapviewer.model.map;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class InconsistentModelExceptionTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new InconsistentModelException(""));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class InconsistentModelExceptionTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new InconsistentModelException(""));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/LayoutComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/LayoutComparatorTest.java
index c50fe1a559..b42cb22632 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/LayoutComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/LayoutComparatorTest.java
@@ -1,139 +1,139 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.LayoutComparator;
-
-public class LayoutComparatorTest {
-	LayoutComparator comparator = new LayoutComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Layout layout1 = getLayout();
-			Layout layout2 = getLayout();
-
-			assertEquals(0, comparator.compare(new Layout(), new Layout()));
-			assertEquals(0, comparator.compare(layout1, layout2));
-			assertEquals(0, comparator.compare(layout1, layout1));
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	private Layout getLayout() {
-		Layout layout = new Layout();
-		layout.setDirectory("dirrr");
-		layout.setTitle("title");
-		return layout;
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Layout layout1 = getLayout();
-			Layout layout2 = getLayout();
-
-			assertTrue(comparator.compare(layout1, new Layout()) != 0);
-
-			assertTrue(comparator.compare(layout1, null) != 0);
-			assertTrue(comparator.compare(null, layout1) != 0);
-
-			layout1 = getLayout();
-			layout2 = getLayout();
-
-			layout1.setDirectory("ASDsaD");
-
-			assertTrue(comparator.compare(layout1, layout2) != 0);
-			assertTrue(comparator.compare(layout2, layout1) != 0);
-
-			layout1 = getLayout();
-			layout2 = getLayout();
-
-			layout1.setTitle("ASDsaD");
-
-			assertTrue(comparator.compare(layout1, layout2) != 0);
-			assertTrue(comparator.compare(layout2, layout1) != 0);
-
-			layout1 = getLayout();
-			layout2 = getLayout();
-
-			layout1.setHierarchicalView(true);
-
-			assertTrue(comparator.compare(layout1, layout2) != 0);
-			assertTrue(comparator.compare(layout2, layout1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testDifferent2() {
-		try {
-			class Tmp extends Layout {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}
-			;
-
-			Layout layout1 = new Tmp();
-			Layout layout2 = new Layout();
-
-			assertTrue(comparator.compare(layout1, layout2) != 0);
-			assertTrue(comparator.compare(layout2, layout1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends Layout {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}
-			;
-
-			Layout layout1 = new Tmp();
-			Layout layout2 = new Tmp();
-
-			comparator.compare(layout1, layout2);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.LayoutComparator;
+
+public class LayoutComparatorTest {
+	LayoutComparator comparator = new LayoutComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Layout layout1 = getLayout();
+			Layout layout2 = getLayout();
+
+			assertEquals(0, comparator.compare(new Layout(), new Layout()));
+			assertEquals(0, comparator.compare(layout1, layout2));
+			assertEquals(0, comparator.compare(layout1, layout1));
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	private Layout getLayout() {
+		Layout layout = new Layout();
+		layout.setDirectory("dirrr");
+		layout.setTitle("title");
+		return layout;
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Layout layout1 = getLayout();
+			Layout layout2 = getLayout();
+
+			assertTrue(comparator.compare(layout1, new Layout()) != 0);
+
+			assertTrue(comparator.compare(layout1, null) != 0);
+			assertTrue(comparator.compare(null, layout1) != 0);
+
+			layout1 = getLayout();
+			layout2 = getLayout();
+
+			layout1.setDirectory("ASDsaD");
+
+			assertTrue(comparator.compare(layout1, layout2) != 0);
+			assertTrue(comparator.compare(layout2, layout1) != 0);
+
+			layout1 = getLayout();
+			layout2 = getLayout();
+
+			layout1.setTitle("ASDsaD");
+
+			assertTrue(comparator.compare(layout1, layout2) != 0);
+			assertTrue(comparator.compare(layout2, layout1) != 0);
+
+			layout1 = getLayout();
+			layout2 = getLayout();
+
+			layout1.setHierarchicalView(true);
+
+			assertTrue(comparator.compare(layout1, layout2) != 0);
+			assertTrue(comparator.compare(layout2, layout1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testDifferent2() {
+		try {
+			class Tmp extends Layout {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}
+			;
+
+			Layout layout1 = new Tmp();
+			Layout layout2 = new Layout();
+
+			assertTrue(comparator.compare(layout1, layout2) != 0);
+			assertTrue(comparator.compare(layout2, layout1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends Layout {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}
+			;
+
+			Layout layout1 = new Tmp();
+			Layout layout2 = new Tmp();
+
+			comparator.compare(layout1, layout2);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/MiriamDataTest.java b/model/src/test/java/lcsb/mapviewer/model/map/MiriamDataTest.java
index e2281ec7c8..d1171d7a2e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/MiriamDataTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/MiriamDataTest.java
@@ -1,125 +1,125 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class MiriamDataTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new MiriamData());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidConstructor1() {
-		try {
-			new MiriamData(null, null);
-			fail("Exception expection");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidConstructor2() {
-		try {
-			new MiriamData(null, MiriamType.CAS, null);
-			fail("Exception expection");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetIdFromIdentifier() {
-		try {
-			assertEquals("id", MiriamData.getIdFromIdentifier("name:id"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			int id = 6;
-			Element element = new Species();
-			MiriamData md = new MiriamData();
-			md.setResource(null);
-			assertNull(md.getResource());
-			
-			md.setId(id);
-			assertEquals(id, md.getId());
-			md.setElement(element);
-			assertEquals(element, md.getElement());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToString() {
-		try {
-			assertNotNull(new MiriamData().toString());
-			assertNotNull(new MiriamData(MiriamType.CAS,"a").toString());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testEqual() {
-		try {
-			MiriamData md = new MiriamData();
-			assertFalse(md.equals(new Object()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCompareTo() {
-		try {
-			MiriamData md = new MiriamData();
-			assertTrue(md.compareTo(new MiriamData(MiriamType.CAS, "a")) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class MiriamDataTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new MiriamData());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidConstructor1() {
+		try {
+			new MiriamData(null, null);
+			fail("Exception expection");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidConstructor2() {
+		try {
+			new MiriamData(null, MiriamType.CAS, null);
+			fail("Exception expection");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetIdFromIdentifier() {
+		try {
+			assertEquals("id", MiriamData.getIdFromIdentifier("name:id"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			int id = 6;
+			Element element = new Species();
+			MiriamData md = new MiriamData();
+			md.setResource(null);
+			assertNull(md.getResource());
+			
+			md.setId(id);
+			assertEquals(id, md.getId());
+			md.setElement(element);
+			assertEquals(element, md.getElement());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToString() {
+		try {
+			assertNotNull(new MiriamData().toString());
+			assertNotNull(new MiriamData(MiriamType.CAS,"a").toString());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testEqual() {
+		try {
+			MiriamData md = new MiriamData();
+			assertFalse(md.equals(new Object()));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCompareTo() {
+		try {
+			MiriamData md = new MiriamData();
+			assertTrue(md.compareTo(new MiriamData(MiriamType.CAS, "a")) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/MiriamRelationTypeTest.java b/model/src/test/java/lcsb/mapviewer/model/map/MiriamRelationTypeTest.java
index 17e609addf..0e7d84d3dc 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/MiriamRelationTypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/MiriamRelationTypeTest.java
@@ -1,38 +1,38 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class MiriamRelationTypeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValidValues() {
-		for (MiriamRelationType type : MiriamRelationType.values()) {
-			assertNotNull(type);
-
-			// for coverage tests
-			MiriamRelationType.valueOf(type.toString());
-			assertNotNull(type.getStringRepresentation());
-
-		}
-	}
-
-	@Test
-	public void testGetTypeByString() {
-		assertNull(MiriamRelationType.getTypeByStringRepresentation("DSfsdfs"));
-		assertNotNull(MiriamRelationType.getTypeByStringRepresentation("bqbiol:occures"));
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class MiriamRelationTypeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValidValues() {
+		for (MiriamRelationType type : MiriamRelationType.values()) {
+			assertNotNull(type);
+
+			// for coverage tests
+			MiriamRelationType.valueOf(type.toString());
+			assertNotNull(type.getStringRepresentation());
+
+		}
+	}
+
+	@Test
+	public void testGetTypeByString() {
+		assertNull(MiriamRelationType.getTypeByStringRepresentation("DSfsdfs"));
+		assertNotNull(MiriamRelationType.getTypeByStringRepresentation("bqbiol:occures"));
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeNameComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeNameComparatorTest.java
index 8dba860590..b2d2bfb9f1 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeNameComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeNameComparatorTest.java
@@ -1,46 +1,46 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class MiriamTypeNameComparatorTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCompareNulls() {
-		try {
-			MiriamTypeNameComparator comparator = new MiriamTypeNameComparator();
-			assertEquals(0, comparator.compare(null, null));
-			assertTrue(comparator.compare(null, MiriamType.CAS) != 0);
-			assertTrue(comparator.compare(MiriamType.CAS, null) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCompare() {
-		try {
-			MiriamTypeNameComparator comparator = new MiriamTypeNameComparator();
-			assertTrue(comparator.compare(MiriamType.CHEBI, MiriamType.CAS) < 0);
-			assertTrue(comparator.compare(MiriamType.CAS, MiriamType.CHEBI) > 0);
-			assertTrue(comparator.compare(MiriamType.CAS, MiriamType.CAS) == 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class MiriamTypeNameComparatorTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCompareNulls() {
+		try {
+			MiriamTypeNameComparator comparator = new MiriamTypeNameComparator();
+			assertEquals(0, comparator.compare(null, null));
+			assertTrue(comparator.compare(null, MiriamType.CAS) != 0);
+			assertTrue(comparator.compare(MiriamType.CAS, null) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCompare() {
+		try {
+			MiriamTypeNameComparator comparator = new MiriamTypeNameComparator();
+			assertTrue(comparator.compare(MiriamType.CHEBI, MiriamType.CAS) < 0);
+			assertTrue(comparator.compare(MiriamType.CAS, MiriamType.CHEBI) > 0);
+			assertTrue(comparator.compare(MiriamType.CAS, MiriamType.CAS) == 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeTest.java b/model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeTest.java
index f9e12148a8..92fed4f8dd 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeTest.java
@@ -1,123 +1,123 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-
-public class MiriamTypeTest {
-	Logger logger = Logger.getLogger(MiriamDataTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testIdUniqness() {
-		try {
-			Map<String, MiriamType> ids = new HashMap<>();
-			for (MiriamType mt : MiriamType.values()) {
-				assertNull(mt.getCommonName() + " doesn't have a unique key", ids.get(mt.getRegistryIdentifier()));
-				ids.put(mt.getRegistryIdentifier(), mt);
-
-				// coverage tests
-				assertNotNull(MiriamType.valueOf(mt.name()));
-				assertNotNull(mt.getUris());
-				assertNotNull(mt.getValidClass());
-				assertNotNull(mt.getRequiredClass());
-				if (mt != MiriamType.UNKNOWN) {
-					assertNotNull("No homepage for: " + mt, mt.getDbHomepage());
-				}
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetMiriamDataFromIdentifier() {
-		MiriamData md = MiriamType.getMiriamDataFromIdentifier("HGNC Symbol:SNCA");
-		assertEquals(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"), md);
-	}
-
-	@Test
-	public void testGetMiriamDataFromInvalidIdentifier() {
-		try {
-			MiriamType.getMiriamDataFromIdentifier("xyz:SNCA");
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-
-		}
-	}
-	@Test
-	public void testGetMiriamDataFromInvalidIdentifier2() {
-		try {
-			MiriamType.getMiriamDataFromIdentifier("xyz");
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-
-		}
-	}
-
-	@Test
-	public void testTypeByUri() {
-		assertNotNull(MiriamType.getTypeByUri("urn:miriam:cas"));
-		assertNull(MiriamType.getTypeByUri("xyz"));
-	}
-
-	@Test
-	public void testTypeByCommonName() {
-		assertNotNull(MiriamType.getTypeByCommonName("Consensus CDS"));
-		assertNull(MiriamType.getTypeByCommonName("xyz"));
-	}
-
-	@Test
-	public void testGetMiriamByUri1() throws Exception {
-		try {
-			MiriamData md = MiriamType.getMiriamByUri("urn:miriam:panther.family:PTHR19384:SF5");
-			assertTrue(new MiriamData(MiriamType.PANTHER,"PTHR19384:SF5").equals(md));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetMiriamByUri2() throws Exception {
-		try {
-			MiriamData md = MiriamType.getMiriamByUri("urn:miriam:panther.family:PTHR19384%3ASF5");
-			assertTrue(new MiriamData(MiriamType.PANTHER,"PTHR19384:SF5").equals(md));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetMiriamByUri3() throws Exception {
-		try {
-			MiriamData md = MiriamType.getMiriamByUri("urn:miriam:panther.family%3APTHR19384%3ASF5");
-			assertTrue(new MiriamData(MiriamType.PANTHER,"PTHR19384:SF5").equals(md));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+
+public class MiriamTypeTest {
+	Logger logger = Logger.getLogger(MiriamDataTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testIdUniqness() {
+		try {
+			Map<String, MiriamType> ids = new HashMap<>();
+			for (MiriamType mt : MiriamType.values()) {
+				assertNull(mt.getCommonName() + " doesn't have a unique key", ids.get(mt.getRegistryIdentifier()));
+				ids.put(mt.getRegistryIdentifier(), mt);
+
+				// coverage tests
+				assertNotNull(MiriamType.valueOf(mt.name()));
+				assertNotNull(mt.getUris());
+				assertNotNull(mt.getValidClass());
+				assertNotNull(mt.getRequiredClass());
+				if (mt != MiriamType.UNKNOWN) {
+					assertNotNull("No homepage for: " + mt, mt.getDbHomepage());
+				}
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetMiriamDataFromIdentifier() {
+		MiriamData md = MiriamType.getMiriamDataFromIdentifier("HGNC Symbol:SNCA");
+		assertEquals(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"), md);
+	}
+
+	@Test
+	public void testGetMiriamDataFromInvalidIdentifier() {
+		try {
+			MiriamType.getMiriamDataFromIdentifier("xyz:SNCA");
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+
+		}
+	}
+	@Test
+	public void testGetMiriamDataFromInvalidIdentifier2() {
+		try {
+			MiriamType.getMiriamDataFromIdentifier("xyz");
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+
+		}
+	}
+
+	@Test
+	public void testTypeByUri() {
+		assertNotNull(MiriamType.getTypeByUri("urn:miriam:cas"));
+		assertNull(MiriamType.getTypeByUri("xyz"));
+	}
+
+	@Test
+	public void testTypeByCommonName() {
+		assertNotNull(MiriamType.getTypeByCommonName("Consensus CDS"));
+		assertNull(MiriamType.getTypeByCommonName("xyz"));
+	}
+
+	@Test
+	public void testGetMiriamByUri1() throws Exception {
+		try {
+			MiriamData md = MiriamType.getMiriamByUri("urn:miriam:panther.family:PTHR19384:SF5");
+			assertTrue(new MiriamData(MiriamType.PANTHER,"PTHR19384:SF5").equals(md));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetMiriamByUri2() throws Exception {
+		try {
+			MiriamData md = MiriamType.getMiriamByUri("urn:miriam:panther.family:PTHR19384%3ASF5");
+			assertTrue(new MiriamData(MiriamType.PANTHER,"PTHR19384:SF5").equals(md));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetMiriamByUri3() throws Exception {
+		try {
+			MiriamData md = MiriamType.getMiriamByUri("urn:miriam:panther.family%3APTHR19384%3ASF5");
+			assertTrue(new MiriamData(MiriamType.PANTHER,"PTHR19384:SF5").equals(md));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageComparatorTest.java
index 7bbbc7a1bc..e61c0b1c82 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageComparatorTest.java
@@ -1,92 +1,92 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class OverviewImageComparatorTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEqual() throws Exception {
-		try {
-			OverviewImageComparator oic = new OverviewImageComparator();
-
-			OverviewImage oi = new OverviewImage();
-			OverviewImage oi2 = new OverviewImage();
-
-			assertEquals(0, oic.compare(oi, oi2));
-			assertEquals(0, oic.compare(null, null));
-
-			oi.addLink(new OverviewImageLink());
-			oi2.addLink(new OverviewImageLink());
-			assertEquals(0, oic.compare(oi, oi2));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			OverviewImageComparator oic = new OverviewImageComparator();
-
-			OverviewImage oi = new OverviewImage();
-
-			OverviewImage oi2 = new OverviewImage();
-			oi2.setFilename("x");
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			oi2 = new OverviewImage();
-			oi2.setHeight(1);
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			oi2 = new OverviewImage();
-			oi2.setWidth(2);
-			;
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			oi2 = new OverviewImage();
-			oi2.addLink(new OverviewModelLink());
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			assertTrue(0 != oic.compare(oi, null));
-			assertTrue(0 != oic.compare(null, oi2));
-
-			assertTrue(0 != oic.compare(new OverviewImage() {
-				private static final long serialVersionUID = 1L;
-			}, oi2));
-			
-			oi = new OverviewImage();
-			oi2 = new OverviewImage();
-			OverviewImageLink link= new OverviewImageLink();
-			link.setPolygon("1,1");
-			oi.addLink(link);
-			link= new OverviewImageLink();
-			link.setPolygon("1,2");
-			oi2.addLink(link);
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class OverviewImageComparatorTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEqual() throws Exception {
+		try {
+			OverviewImageComparator oic = new OverviewImageComparator();
+
+			OverviewImage oi = new OverviewImage();
+			OverviewImage oi2 = new OverviewImage();
+
+			assertEquals(0, oic.compare(oi, oi2));
+			assertEquals(0, oic.compare(null, null));
+
+			oi.addLink(new OverviewImageLink());
+			oi2.addLink(new OverviewImageLink());
+			assertEquals(0, oic.compare(oi, oi2));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			OverviewImageComparator oic = new OverviewImageComparator();
+
+			OverviewImage oi = new OverviewImage();
+
+			OverviewImage oi2 = new OverviewImage();
+			oi2.setFilename("x");
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			oi2 = new OverviewImage();
+			oi2.setHeight(1);
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			oi2 = new OverviewImage();
+			oi2.setWidth(2);
+			;
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			oi2 = new OverviewImage();
+			oi2.addLink(new OverviewModelLink());
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			assertTrue(0 != oic.compare(oi, null));
+			assertTrue(0 != oic.compare(null, oi2));
+
+			assertTrue(0 != oic.compare(new OverviewImage() {
+				private static final long serialVersionUID = 1L;
+			}, oi2));
+			
+			oi = new OverviewImage();
+			oi2 = new OverviewImage();
+			OverviewImageLink link= new OverviewImageLink();
+			link.setPolygon("1,1");
+			oi.addLink(link);
+			link= new OverviewImageLink();
+			link.setPolygon("1,2");
+			oi2.addLink(link);
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageLinkComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageLinkComparatorTest.java
index 837333e1ea..06a28a73d7 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageLinkComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageLinkComparatorTest.java
@@ -1,78 +1,78 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.*;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class OverviewImageLinkComparatorTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEqual() throws Exception {
-		try {
-			OverviewImageLinkComparator oic = new OverviewImageLinkComparator();
-
-			OverviewImageLink oi = new OverviewImageLink();
-			OverviewImageLink oi2 = new OverviewImageLink();
-
-			assertEquals(0, oic.compare(oi, oi2));
-			assertEquals(0, oic.compare(null, null));
-
-			oi2.setLinkedOverviewImage(new OverviewImage());
-			oi.setLinkedOverviewImage(new OverviewImage());
-			assertEquals(0, oic.compare(oi, oi2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			OverviewImageLinkComparator oic = new OverviewImageLinkComparator();
-
-			OverviewImageLink oi = new OverviewImageLink();
-			
-			OverviewImageLink oi2 = new OverviewImageLink();
-			oi2.setLinkedOverviewImage(new OverviewImage());
-
-			assertTrue(0 != oic.compare(oi, oi2));
-			assertTrue(0 != oic.compare(oi2, oi));
-
-			oi2 = new OverviewImageLink();
-			oi2.setLinkedOverviewImage(new OverviewImage());
-
-			assertTrue(0 != oic.compare(oi, oi2));
-			assertTrue(0 != oic.compare(oi2, oi));
-
-			oi2 = new OverviewImageLink();
-			oi2.setPolygon("AS");
-
-			assertTrue(0 != oic.compare(oi, oi2));
-			assertTrue(0 != oic.compare(oi, null));
-			assertTrue(0 != oic.compare(null, oi2));
-			assertTrue(0 != oic.compare(new OverviewImageLink(){
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;}, oi2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class OverviewImageLinkComparatorTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEqual() throws Exception {
+		try {
+			OverviewImageLinkComparator oic = new OverviewImageLinkComparator();
+
+			OverviewImageLink oi = new OverviewImageLink();
+			OverviewImageLink oi2 = new OverviewImageLink();
+
+			assertEquals(0, oic.compare(oi, oi2));
+			assertEquals(0, oic.compare(null, null));
+
+			oi2.setLinkedOverviewImage(new OverviewImage());
+			oi.setLinkedOverviewImage(new OverviewImage());
+			assertEquals(0, oic.compare(oi, oi2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			OverviewImageLinkComparator oic = new OverviewImageLinkComparator();
+
+			OverviewImageLink oi = new OverviewImageLink();
+			
+			OverviewImageLink oi2 = new OverviewImageLink();
+			oi2.setLinkedOverviewImage(new OverviewImage());
+
+			assertTrue(0 != oic.compare(oi, oi2));
+			assertTrue(0 != oic.compare(oi2, oi));
+
+			oi2 = new OverviewImageLink();
+			oi2.setLinkedOverviewImage(new OverviewImage());
+
+			assertTrue(0 != oic.compare(oi, oi2));
+			assertTrue(0 != oic.compare(oi2, oi));
+
+			oi2 = new OverviewImageLink();
+			oi2.setPolygon("AS");
+
+			assertTrue(0 != oic.compare(oi, oi2));
+			assertTrue(0 != oic.compare(oi, null));
+			assertTrue(0 != oic.compare(null, oi2));
+			assertTrue(0 != oic.compare(new OverviewImageLink(){
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;}, oi2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageLinkTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageLinkTest.java
index 5fbc342400..f78fd125dd 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageLinkTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageLinkTest.java
@@ -1,63 +1,63 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class OverviewImageLinkTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new OverviewImageLink());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			OverviewImageLink original = new OverviewImageLink();
-			OverviewImageLink degraded = original.copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new OverviewImageLink() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class OverviewImageLinkTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new OverviewImageLink());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			OverviewImageLink original = new OverviewImageLink();
+			OverviewImageLink degraded = original.copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new OverviewImageLink() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageTest.java
index eccd4f9b06..3b712fd29e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewImageTest.java
@@ -1,82 +1,82 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class OverviewImageTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new OverviewImage());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			OverviewImage original = new OverviewImage();
-			original.addLink(new OverviewImageLink());
-			OverviewImage degraded = original.copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetters() {
-		try {
-			OverviewImage original = new OverviewImage();
-			List<OverviewLink> links = new ArrayList<>();
-			original.setLinks(links);
-
-			assertEquals(links, original.getLinks());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new OverviewImage() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class OverviewImageTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new OverviewImage());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			OverviewImage original = new OverviewImage();
+			original.addLink(new OverviewImageLink());
+			OverviewImage degraded = original.copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetters() {
+		try {
+			OverviewImage original = new OverviewImage();
+			List<OverviewLink> links = new ArrayList<>();
+			original.setLinks(links);
+
+			assertEquals(links, original.getLinks());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new OverviewImage() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewLinkComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewLinkComparatorTest.java
index c48fbfda52..8902796c1d 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewLinkComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewLinkComparatorTest.java
@@ -1,93 +1,93 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-public class OverviewLinkComparatorTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEqual() throws Exception {
-		try {
-			OverviewLinkComparator omlc = new OverviewLinkComparator();
-
-			OverviewModelLink oml = new OverviewModelLink();
-			OverviewModelLink oml2 = new OverviewModelLink();
-
-			assertEquals(0, omlc.compare(oml, oml2));
-			assertEquals(0, omlc.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid() throws Exception {
-		try {
-			class Tmp extends OverviewLink {
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public OverviewLink copy() {
-					return null;
-				}
-			}
-			;
-			OverviewLinkComparator omlc = new OverviewLinkComparator();
-
-			OverviewLink oml = new Tmp();
-			OverviewLink oml2 = new Tmp();
-
-			omlc.compare(oml, oml2);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			OverviewLinkComparator omlc = new OverviewLinkComparator();
-
-			OverviewModelLink oml = new OverviewModelLink();
-			OverviewImageLink iml = new OverviewImageLink();
-
-			assertTrue(0 != omlc.compare(oml, iml));
-			assertTrue(0 != omlc.compare(oml, null));
-			assertTrue(0 != omlc.compare(null, iml));
-
-			oml = new OverviewModelLink();
-			OverviewModelLink oml2 = new OverviewModelLink();
-			oml2.setLinkedModel(new ModelFullIndexed(new ModelData()));
-
-			assertTrue(0 != omlc.compare(oml, oml2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class OverviewLinkComparatorTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEqual() throws Exception {
+		try {
+			OverviewLinkComparator omlc = new OverviewLinkComparator();
+
+			OverviewModelLink oml = new OverviewModelLink();
+			OverviewModelLink oml2 = new OverviewModelLink();
+
+			assertEquals(0, omlc.compare(oml, oml2));
+			assertEquals(0, omlc.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid() throws Exception {
+		try {
+			class Tmp extends OverviewLink {
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public OverviewLink copy() {
+					return null;
+				}
+			}
+			;
+			OverviewLinkComparator omlc = new OverviewLinkComparator();
+
+			OverviewLink oml = new Tmp();
+			OverviewLink oml2 = new Tmp();
+
+			omlc.compare(oml, oml2);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			OverviewLinkComparator omlc = new OverviewLinkComparator();
+
+			OverviewModelLink oml = new OverviewModelLink();
+			OverviewImageLink iml = new OverviewImageLink();
+
+			assertTrue(0 != omlc.compare(oml, iml));
+			assertTrue(0 != omlc.compare(oml, null));
+			assertTrue(0 != omlc.compare(null, iml));
+
+			oml = new OverviewModelLink();
+			OverviewModelLink oml2 = new OverviewModelLink();
+			oml2.setLinkedModel(new ModelFullIndexed(new ModelData()));
+
+			assertTrue(0 != omlc.compare(oml, oml2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewLinkTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewLinkTest.java
index 7287d170cb..68f045d706 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewLinkTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewLinkTest.java
@@ -1,73 +1,73 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class OverviewLinkTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetPolygonCoord() {
-		try {
-			OverviewLink link = new OverviewLink() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public OverviewLink copy() {
-					// TODO Auto-generated method stub
-					return null;
-				}
-			};
-			String polygon = "1,1 2,2 4,0";
-			link.setPolygon(polygon);
-			assertEquals(3, link.getPolygonCoordinates().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			OverviewLink link = new OverviewLink() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public OverviewLink copy() {
-					// TODO Auto-generated method stub
-					return null;
-				}
-			};
-			OverviewImage image= new OverviewImage();
-			int id = 309;
-			link.setOverviewImage(image);
-			link.setId(id);
-			
-			assertEquals(image, link.getOverviewImage());
-			assertEquals(id, link.getId());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class OverviewLinkTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetPolygonCoord() {
+		try {
+			OverviewLink link = new OverviewLink() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public OverviewLink copy() {
+					// TODO Auto-generated method stub
+					return null;
+				}
+			};
+			String polygon = "1,1 2,2 4,0";
+			link.setPolygon(polygon);
+			assertEquals(3, link.getPolygonCoordinates().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			OverviewLink link = new OverviewLink() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public OverviewLink copy() {
+					// TODO Auto-generated method stub
+					return null;
+				}
+			};
+			OverviewImage image= new OverviewImage();
+			int id = 309;
+			link.setOverviewImage(image);
+			link.setId(id);
+			
+			assertEquals(image, link.getOverviewImage());
+			assertEquals(id, link.getId());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewModelLinkComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewModelLinkComparatorTest.java
index 9f8756eff6..578e6a92ce 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewModelLinkComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewModelLinkComparatorTest.java
@@ -1,89 +1,89 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.*;
-
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class OverviewModelLinkComparatorTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEqual() throws Exception {
-		try {
-			OverviewModelLinkComparator oic = new OverviewModelLinkComparator();
-
-			OverviewModelLink oi = new OverviewModelLink();
-			OverviewModelLink oi2 = new OverviewModelLink();
-
-			assertEquals(0, oic.compare(oi, oi2));
-			assertEquals(0, oic.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			OverviewModelLinkComparator oic = new OverviewModelLinkComparator();
-
-			OverviewModelLink oi = new OverviewModelLink();
-
-			OverviewModelLink oi2 = new OverviewModelLink();
-			oi2.setLinkedModel(new ModelFullIndexed(null));
-
-			assertTrue(0 != oic.compare(oi, oi2));
-			assertTrue(0 != oic.compare(oi2, oi));
-			assertTrue(0 != oic.compare(oi, null));
-			assertTrue(0 != oic.compare(null, oi2));
-
-			Model model = new ModelFullIndexed(null);
-			model.setId(1);
-			oi.setLinkedModel(model);
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			oi2 = new OverviewModelLink();
-			oi2.setPolygon("AS");
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			oi2 = new OverviewModelLink();
-			oi2.setxCoord(12);
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			oi2 = new OverviewModelLink();
-			oi2.setyCoord(13);
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			oi2 = new OverviewModelLink();
-			oi2.setZoomLevel(345);
-
-			assertTrue(0 != oic.compare(oi, oi2));
-
-			assertTrue(0 != oic.compare(oi, new OverviewModelLink() {
-				private static final long serialVersionUID = 1L;
-			}));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.*;
+
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class OverviewModelLinkComparatorTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEqual() throws Exception {
+		try {
+			OverviewModelLinkComparator oic = new OverviewModelLinkComparator();
+
+			OverviewModelLink oi = new OverviewModelLink();
+			OverviewModelLink oi2 = new OverviewModelLink();
+
+			assertEquals(0, oic.compare(oi, oi2));
+			assertEquals(0, oic.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			OverviewModelLinkComparator oic = new OverviewModelLinkComparator();
+
+			OverviewModelLink oi = new OverviewModelLink();
+
+			OverviewModelLink oi2 = new OverviewModelLink();
+			oi2.setLinkedModel(new ModelFullIndexed(null));
+
+			assertTrue(0 != oic.compare(oi, oi2));
+			assertTrue(0 != oic.compare(oi2, oi));
+			assertTrue(0 != oic.compare(oi, null));
+			assertTrue(0 != oic.compare(null, oi2));
+
+			Model model = new ModelFullIndexed(null);
+			model.setId(1);
+			oi.setLinkedModel(model);
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			oi2 = new OverviewModelLink();
+			oi2.setPolygon("AS");
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			oi2 = new OverviewModelLink();
+			oi2.setxCoord(12);
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			oi2 = new OverviewModelLink();
+			oi2.setyCoord(13);
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			oi2 = new OverviewModelLink();
+			oi2.setZoomLevel(345);
+
+			assertTrue(0 != oic.compare(oi, oi2));
+
+			assertTrue(0 != oic.compare(oi, new OverviewModelLink() {
+				private static final long serialVersionUID = 1L;
+			}));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewModelLinkTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewModelLinkTest.java
index f2044c6d78..f9ef8d37ad 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewModelLinkTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewModelLinkTest.java
@@ -1,98 +1,98 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class OverviewModelLinkTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new OverviewModelLink());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			OverviewModelLink link = new OverviewModelLink(new OverviewModelLink());
-			assertNotNull(link);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetters() {
-		try {
-			OverviewModelLink link = new OverviewModelLink();
-			link.setLinkedModel(null);
-			assertNull(link.getLinkedModel());
-
-			link.setxCoord(2.0);
-			link.setyCoord(3.0);
-
-			assertEquals((Integer) 2, link.getxCoord());
-			assertEquals((Integer) 3, link.getyCoord());
-
-			link.setxCoord((Double) null);
-			link.setyCoord((Double) null);
-			assertNull(link.getxCoord());
-			assertNull(link.getyCoord());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			OverviewModelLink degraded = new OverviewModelLink().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new OverviewModelLink() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class OverviewModelLinkTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new OverviewModelLink());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			OverviewModelLink link = new OverviewModelLink(new OverviewModelLink());
+			assertNotNull(link);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetters() {
+		try {
+			OverviewModelLink link = new OverviewModelLink();
+			link.setLinkedModel(null);
+			assertNull(link.getLinkedModel());
+
+			link.setxCoord(2.0);
+			link.setyCoord(3.0);
+
+			assertEquals((Integer) 2, link.getxCoord());
+			assertEquals((Integer) 3, link.getyCoord());
+
+			link.setxCoord((Double) null);
+			link.setyCoord((Double) null);
+			assertNull(link.getxCoord());
+			assertNull(link.getyCoord());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			OverviewModelLink degraded = new OverviewModelLink().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new OverviewModelLink() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/OverviewSearchLinkTest.java b/model/src/test/java/lcsb/mapviewer/model/map/OverviewSearchLinkTest.java
index 58f77f773d..2d9b9e0ad0 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/OverviewSearchLinkTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/OverviewSearchLinkTest.java
@@ -1,87 +1,87 @@
-package lcsb.mapviewer.model.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class OverviewSearchLinkTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new OverviewSearchLink());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			OverviewSearchLink osl = new OverviewSearchLink(new OverviewSearchLink());
-			assertNotNull(osl);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			OverviewSearchLink osl = new OverviewSearchLink(new OverviewSearchLink());
-			String query = "st";
-			osl.setQuery(query);
-			assertEquals(query, osl.getQuery());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			OverviewSearchLink degraded = new OverviewSearchLink().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new OverviewSearchLink() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class OverviewSearchLinkTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new OverviewSearchLink());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			OverviewSearchLink osl = new OverviewSearchLink(new OverviewSearchLink());
+			assertNotNull(osl);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			OverviewSearchLink osl = new OverviewSearchLink(new OverviewSearchLink());
+			String query = "st";
+			osl.setQuery(query);
+			assertEquals(query, osl.getQuery());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			OverviewSearchLink degraded = new OverviewSearchLink().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new OverviewSearchLink() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/agregator/CompartmentComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/agregator/CompartmentComparatorTest.java
index ff1d86ab8b..41f9c54ebb 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/agregator/CompartmentComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/agregator/CompartmentComparatorTest.java
@@ -1,121 +1,121 @@
-package lcsb.mapviewer.model.map.agregator;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidClassException;
-
-public class CompartmentComparatorTest {
-
-	CompartmentComparator comparator = new CompartmentComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Compartment comp1 = createCompartment();
-			Compartment comp2 = createCompartment();
-
-			assertEquals(0, comparator.compare(comp1, comp1));
-
-			assertEquals(0, comparator.compare(comp1, comp2));
-			assertEquals(0, comparator.compare(comp2, comp1));
-
-			comp1.setId(-1);
-			assertEquals(0, comparator.compare(comp1, comp2));
-			assertEquals(0, comparator.compare(comp2, comp1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Compartment compartment1 = createCompartment();
-			Compartment compartment2 = createCompartment();
-			compartment1.setElementId("id2");
-			assertTrue(comparator.compare(compartment1, compartment2) != 0);
-			assertTrue(comparator.compare(compartment2, compartment1) != 0);
-
-			compartment1 = createCompartment();
-			compartment2 = createCompartment();
-			compartment1.setName("id2asd");
-			assertTrue(comparator.compare(compartment1, compartment2) != 0);
-			assertTrue(comparator.compare(compartment2, compartment1) != 0);
-
-			compartment1 = createCompartment();
-			compartment2 = createCompartment();
-			assertTrue(comparator.compare(null, compartment2) != 0);
-			assertTrue(comparator.compare(compartment2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public Compartment createCompartment() {
-		Compartment result = new Compartment();
-		result.setElementId("id1");
-		result.setName("bla");
-		return result;
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			Compartment compartment1 = new Compartment();
-			Compartment compartment2 = new Compartment() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			};
-
-			assertTrue(comparator.compare(compartment1, compartment2) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testInvalid2() {
-		try {
-			Compartment compartment2 = new Compartment() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			};
-
-			comparator.compare(compartment2, compartment2);
-			fail("Exception expected");
-
-		} catch (InvalidClassException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.agregator;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidClassException;
+
+public class CompartmentComparatorTest {
+
+	CompartmentComparator comparator = new CompartmentComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Compartment comp1 = createCompartment();
+			Compartment comp2 = createCompartment();
+
+			assertEquals(0, comparator.compare(comp1, comp1));
+
+			assertEquals(0, comparator.compare(comp1, comp2));
+			assertEquals(0, comparator.compare(comp2, comp1));
+
+			comp1.setId(-1);
+			assertEquals(0, comparator.compare(comp1, comp2));
+			assertEquals(0, comparator.compare(comp2, comp1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Compartment compartment1 = createCompartment();
+			Compartment compartment2 = createCompartment();
+			compartment1.setElementId("id2");
+			assertTrue(comparator.compare(compartment1, compartment2) != 0);
+			assertTrue(comparator.compare(compartment2, compartment1) != 0);
+
+			compartment1 = createCompartment();
+			compartment2 = createCompartment();
+			compartment1.setName("id2asd");
+			assertTrue(comparator.compare(compartment1, compartment2) != 0);
+			assertTrue(comparator.compare(compartment2, compartment1) != 0);
+
+			compartment1 = createCompartment();
+			compartment2 = createCompartment();
+			assertTrue(comparator.compare(null, compartment2) != 0);
+			assertTrue(comparator.compare(compartment2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public Compartment createCompartment() {
+		Compartment result = new Compartment();
+		result.setElementId("id1");
+		result.setName("bla");
+		return result;
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			Compartment compartment1 = new Compartment();
+			Compartment compartment2 = new Compartment() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			};
+
+			assertTrue(comparator.compare(compartment1, compartment2) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testInvalid2() {
+		try {
+			Compartment compartment2 = new Compartment() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			};
+
+			comparator.compare(compartment2, compartment2);
+			fail("Exception expected");
+
+		} catch (InvalidClassException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/agregator/CompartmentTest.java b/model/src/test/java/lcsb/mapviewer/model/map/agregator/CompartmentTest.java
index 5a3e97c489..9c3f6451a6 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/agregator/CompartmentTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/agregator/CompartmentTest.java
@@ -1,147 +1,147 @@
-package lcsb.mapviewer.model.map.agregator;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-
-public class CompartmentTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Compartment());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor1() {
-		try {
-			Compartment original = new Compartment();
-			original.addElement(new GenericProtein());
-			Compartment compartment = new Compartment(original);
-			assertNotNull(compartment);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Compartment original = new Compartment();
-			original.setName("anme");
-			Compartment compartment = new Compartment(original);
-			Compartment compartment2 = new Compartment();
-
-			Compartment compartment3 = new Compartment();
-			compartment3.setElementId("q");
-
-			assertEquals(0, compartment.compareTo(original));
-			assertTrue(compartment.equals(original));
-
-			assertEquals(0, compartment.compareTo(compartment));
-			assertTrue(compartment.equals(compartment));
-			assertTrue(compartment.compareTo(compartment2) != 0);
-			assertFalse(compartment.equals(compartment2));
-
-			assertTrue(compartment.compareTo(compartment3) != 0);
-
-			assertFalse(compartment.equals(new Object()));
-
-			assertTrue(compartment.compareTo(null) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Compartment compartment = new Compartment().copy();
-			assertNotNull(compartment);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			String elementId = "id";
-
-			Compartment compartment = new Compartment();
-
-			compartment.setElementId(elementId);
-			assertEquals(elementId, compartment.getElementId());
-
-			assertNotNull(compartment.getStringType());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddElements() {
-		try {
-			Element protein = new GenericProtein();
-
-			Compartment compartment = new Compartment();
-
-			assertEquals(0, compartment.getElements().size());
-			compartment.addElement(protein);
-			assertEquals(1, compartment.getElements().size());
-			compartment.addElement(protein);
-			assertEquals(1, compartment.getElements().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Compartment() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.agregator;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class CompartmentTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Compartment());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor1() {
+		try {
+			Compartment original = new Compartment();
+			original.addElement(new GenericProtein());
+			Compartment compartment = new Compartment(original);
+			assertNotNull(compartment);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Compartment original = new Compartment();
+			original.setName("anme");
+			Compartment compartment = new Compartment(original);
+			Compartment compartment2 = new Compartment();
+
+			Compartment compartment3 = new Compartment();
+			compartment3.setElementId("q");
+
+			assertEquals(0, compartment.compareTo(original));
+			assertTrue(compartment.equals(original));
+
+			assertEquals(0, compartment.compareTo(compartment));
+			assertTrue(compartment.equals(compartment));
+			assertTrue(compartment.compareTo(compartment2) != 0);
+			assertFalse(compartment.equals(compartment2));
+
+			assertTrue(compartment.compareTo(compartment3) != 0);
+
+			assertFalse(compartment.equals(new Object()));
+
+			assertTrue(compartment.compareTo(null) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Compartment compartment = new Compartment().copy();
+			assertNotNull(compartment);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			String elementId = "id";
+
+			Compartment compartment = new Compartment();
+
+			compartment.setElementId(elementId);
+			assertEquals(elementId, compartment.getElementId());
+
+			assertNotNull(compartment.getStringType());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddElements() {
+		try {
+			Element protein = new GenericProtein();
+
+			Compartment compartment = new Compartment();
+
+			assertEquals(0, compartment.getElements().size());
+			compartment.addElement(protein);
+			assertEquals(1, compartment.getElements().size());
+			compartment.addElement(protein);
+			assertEquals(1, compartment.getElements().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Compartment() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasComparatorTest.java
index bdea46ff16..8a2928b8c6 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasComparatorTest.java
@@ -5,12 +5,13 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.awt.Color;
-import java.util.Collection;
-import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
 
 import lcsb.mapviewer.common.exception.InvalidClassException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.agregator.Compartment;
 import lcsb.mapviewer.model.map.layout.graphics.Layer;
 import lcsb.mapviewer.model.map.model.AliasSubmodelConnection;
@@ -18,138 +19,11 @@ import lcsb.mapviewer.model.map.model.Model;
 import lcsb.mapviewer.model.map.model.ModelFullIndexed;
 import lcsb.mapviewer.model.map.model.SubmodelType;
 import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.Protein;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 
 public class AliasComparatorTest {
 
-	public class Mock extends Alias {
-
-		/**
-		 * 
-		 */
-		private static final long	serialVersionUID	= 1L;
-
-		@Override
-		public Alias copy() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public Element getElement() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public Collection<MiriamData> getMiriamData() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public void addMiriamData(Collection<MiriamData> miriamData) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public void addMiriamData(MiriamData md) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public String getName() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public String getNotes() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public String getElementId() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public void setElementId(String id) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public void setNotes(String notes) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public String getSymbol() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public void setSymbol(String symbol) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public List<String> getSynonyms() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public void setSynonyms(List<String> synonyms) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public String getAbbreviation() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public void setAbbreviation(String abbreviation) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public void setFormula(String formula) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public String getFormula() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public void setName(String name) {
-			// TODO Auto-generated method stub
-			
-		}
-
-	}
-
-	AliasComparator	comparator	= new AliasComparator();
+	AliasComparator comparator = new AliasComparator();
 
 	@Before
 	public void setUp() throws Exception {
@@ -162,7 +36,7 @@ public class AliasComparatorTest {
 	@Test
 	public void testCompareException() throws Exception {
 		try {
-			comparator.compare(new Mock(), new Mock());
+			comparator.compare(Mockito.mock(Alias.class), Mockito.mock(Alias.class));
 
 			fail("Exception should occur");
 		} catch (InvalidClassException e) {
@@ -176,7 +50,8 @@ public class AliasComparatorTest {
 	@Test
 	public void testEquals() throws Exception {
 		try {
-			assertEquals(0, comparator.compare(new SpeciesAlias("id2"), new SpeciesAlias("id2")));
+			GenericProtein protein = new GenericProtein();
+			assertEquals(0, comparator.compare(new GenericProteinAlias("id2", protein), new GenericProteinAlias("id2", protein)));
 			assertEquals(0, comparator.compare(new ComplexAlias(), new ComplexAlias()));
 			assertEquals(0, comparator.compare(null, null));
 
@@ -189,39 +64,40 @@ public class AliasComparatorTest {
 	@Test
 	public void testDifferent() throws Exception {
 		try {
-			assertTrue(comparator.compare(new SpeciesAlias("id2"), new SpeciesAlias("id1")) != 0);
-
-			assertTrue(comparator.compare(null, new SpeciesAlias()) != 0);
-			assertTrue(comparator.compare(new SpeciesAlias(), null) != 0);
-			assertTrue(comparator.compare(new SpeciesAlias(), new ComplexAlias()) != 0);
-			
-			SpeciesAlias sa1 = new SpeciesAlias("id2");
-			SpeciesAlias sa2 = new SpeciesAlias("id2");
+			GenericProtein protein = new GenericProtein();
+			assertTrue(comparator.compare(new GenericProteinAlias("id2", protein), new GenericProteinAlias("id1", protein)) != 0);
+
+			assertTrue(comparator.compare(null, new GenericProteinAlias(protein)) != 0);
+			assertTrue(comparator.compare(new GenericProteinAlias(protein), null) != 0);
+			assertTrue(comparator.compare(new GenericProteinAlias(protein), new ComplexAlias()) != 0);
+
+			SpeciesAlias sa1 = new GenericProteinAlias("id2", protein);
+			SpeciesAlias sa2 = new GenericProteinAlias("id2", protein);
 			sa2.setY(2);
 			assertTrue(comparator.compare(sa1, sa2) != 0);
 
-			sa1 = new SpeciesAlias("id2");
-			sa2 = new SpeciesAlias("id2");
+			sa1 = new GenericProteinAlias("id2", protein);
+			sa2 = new GenericProteinAlias("id2", protein);
 			sa2.setY(2);
 			assertTrue(comparator.compare(sa1, sa2) != 0);
 
-			sa1 = new SpeciesAlias("id2");
-			sa2 = new SpeciesAlias("id2");
+			sa1 = new GenericProteinAlias("id2", protein);
+			sa2 = new GenericProteinAlias("id2", protein);
 			sa2.setHeight(2);
 			assertTrue(comparator.compare(sa1, sa2) != 0);
 
-			sa1 = new SpeciesAlias("id2");
-			sa2 = new SpeciesAlias("id2");
+			sa1 = new GenericProteinAlias("id2", protein);
+			sa2 = new GenericProteinAlias("id2", protein);
 			sa2.setFontSize(2);
 			assertTrue(comparator.compare(sa1, sa2) != 0);
 
-			sa1 = new SpeciesAlias("id2");
-			sa2 = new SpeciesAlias("id2");
+			sa1 = new GenericProteinAlias("id2", protein);
+			sa2 = new GenericProteinAlias("id2", protein);
 			sa2.setColor(Color.BLUE);
 			assertTrue(comparator.compare(sa1, sa2) != 0);
 
-			sa1 = new SpeciesAlias("id2");
-			sa2 = new SpeciesAlias("id2");
+			sa1 = new GenericProteinAlias("id2", protein);
+			sa2 = new GenericProteinAlias("id2", protein);
 			sa2.setVisibilityLevel(6);
 			assertTrue(comparator.compare(sa1, sa2) != 0);
 
@@ -236,7 +112,7 @@ public class AliasComparatorTest {
 		try {
 			Alias alias1 = createAlias();
 			Alias alias2 = createAlias();
-			assertEquals(0, comparator.compare(alias1,alias2));
+			assertEquals(0, comparator.compare(alias1, alias2));
 
 			alias1.setSubmodel(null);
 			assertTrue(comparator.compare(alias1, alias2) != 0);
@@ -244,7 +120,7 @@ public class AliasComparatorTest {
 
 			alias1 = createAlias();
 			alias2 = createAlias();
-			
+
 			alias1.getSubmodel().setName("Na");
 
 			assertTrue(comparator.compare(alias1, alias2) != 0);
@@ -257,21 +133,23 @@ public class AliasComparatorTest {
 	}
 
 	private Alias createAlias() {
-		Alias result = new SpeciesAlias("id2");
+		GenericProtein protein = new GenericProtein();
+		Alias result = new GenericProteinAlias("id2", protein);
 		AliasSubmodelConnection submodel = new AliasSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS);
 		result.setSubmodel(submodel);
 		return result;
 	}
 
 	private Model getModel() {
-		Model model = new ModelFullIndexed(null);;
+		Model model = new ModelFullIndexed(null);
+		;
 		model.setNotes("Some description");
-		Protein protein = new Protein();
+		GenericProtein protein = new GenericProtein();
 		protein.setName("ad");
 		protein.setElementId("A");
 		model.addElement(protein);
 
-		SpeciesAlias alias = new SpeciesAlias(protein);
+		ProteinAlias alias = new GenericProteinAlias(protein);
 		alias.setAliasId("a_id");
 		model.addAlias(alias);
 
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasGroupTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasGroupTest.java
index 058856218f..ff869568ce 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasGroupTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasGroupTest.java
@@ -1,62 +1,64 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class AliasGroupTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new AliasGroup());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			AliasGroup group = new AliasGroup();
-			String idGroup = "str";
-			List<Alias> aliases = new ArrayList<>();
-
-			group.setIdGroup(idGroup);
-			group.setAliases(aliases);
-
-			assertEquals(idGroup, group.getIdGroup());
-			assertEquals(aliases, group.getAliases());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddAlias() {
-		try {
-			AliasGroup group = new AliasGroup();
-			group.addAlias(new SpeciesAlias());
-			assertEquals(1, group.getAliases().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class AliasGroupTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new AliasGroup());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			AliasGroup group = new AliasGroup();
+			String idGroup = "str";
+			List<Alias> aliases = new ArrayList<>();
+
+			group.setIdGroup(idGroup);
+			group.setAliases(aliases);
+
+			assertEquals(idGroup, group.getIdGroup());
+			assertEquals(aliases, group.getAliases());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddAlias() {
+		try {
+			AliasGroup group = new AliasGroup();
+			group.addAlias(new GenericProteinAlias(new GenericProtein()));
+			assertEquals(1, group.getAliases().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasTest.java
index 8e3356a352..a0c83f8fa3 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/AliasTest.java
@@ -1,301 +1,301 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.layout.graphics.LayerText;
-import lcsb.mapviewer.model.map.model.AliasSubmodelConnection;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-public class AliasTest {
-
-	private static double EPSILON = Configuration.EPSILON;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testDistance1() {
-		SpeciesAlias alias;
-		alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(20);
-		alias.setX(100.0);
-		alias.setY(200.0);
-		double distance = alias.getDistanceFromPoint(alias.getCenter());
-		assertEquals(0, distance, EPSILON);
-	}
-
-	@Test
-	public void testDistance2() {
-		SpeciesAlias alias;
-		alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(20);
-		alias.setX(100.0);
-		alias.setY(200.0);
-		double distance = alias.getDistanceFromPoint(new Point2D.Double(100, 205));
-		assertEquals(0, distance, EPSILON);
-	}
-
-	@Test
-	public void testDistance6() {
-		SpeciesAlias alias;
-		alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(20);
-		alias.setX(100.0);
-		alias.setY(200.0);
-		double distance = alias.getDistanceFromPoint(new Point2D.Double(105, 95));
-		assertEquals(105, distance, EPSILON);
-	}
-
-	@Test
-	public void testDistance3() {
-		SpeciesAlias alias;
-		alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(20);
-		alias.setX(100.0);
-		alias.setY(200.0);
-		double distance = alias.getDistanceFromPoint(new Point2D.Double(50, 205));
-		assertEquals(50, distance, EPSILON);
-	}
-
-	@Test
-	public void testDistance4() {
-		SpeciesAlias alias;
-		alias = new SpeciesAlias();
-		alias.setWidth(10);
-		alias.setHeight(20);
-		alias.setX(100.0);
-		alias.setY(200.0);
-		double distance = alias.getDistanceFromPoint(new Point2D.Double(120, 230));
-		assertEquals(Math.sqrt(200), distance, EPSILON);
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.addSearchIndex(new SearchIndex());
-			alias.setSubmodel(new AliasSubmodelConnection());
-			Alias copy = new SpeciesAlias(alias);
-			assertNotNull(copy);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testIncreaseBorder() {
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			assertEquals(0.0, alias.getSize(), Configuration.EPSILON);
-			alias.increaseBorder(2);
-			assertEquals(16.0, alias.getSize(), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			Double nullDouble = null;
-			String xStr = "1.2";
-			Double x = 1.2;
-			String yStr = "1.3";
-			Double y = 1.3;
-			String fontSizeStr = "5.0";
-			Double fontSize = 5.0;
-			int fontSizeInt = 5;
-			String widthStr = "3.0";
-			Double width = 3.0;
-			String heightStr = "4.0";
-			Double height = 4.0;
-			ModelData modelData = new ModelData();
-			CompartmentAlias compartmentAlias = new CompartmentAlias();
-			int id = 72;
-			int transparencyLevel = 2;
-			Model model = new ModelFullIndexed(modelData);
-			List<SearchIndex> indexes = new ArrayList<>();
-			indexes.add(new SearchIndex());
-
-			alias.setX(xStr);
-			assertEquals(x, alias.getX(), Configuration.EPSILON);
-			alias.setX(nullDouble);
-			assertNull(alias.getX());
-			alias.setX(x);
-			assertEquals(x, alias.getX(), Configuration.EPSILON);
-
-			alias.setY(yStr);
-			assertEquals(y, alias.getY(), Configuration.EPSILON);
-			alias.setY(nullDouble);
-			assertNull(alias.getY());
-			alias.setY(y);
-			assertEquals(y, alias.getY(), Configuration.EPSILON);
-
-			alias.setFontSize(fontSizeStr);
-			assertEquals(fontSize, alias.getFontSize(), Configuration.EPSILON);
-			alias.setFontSize(nullDouble);
-			assertNull(alias.getFontSize());
-			alias.setFontSize(fontSize);
-			assertEquals(fontSize, alias.getFontSize(), Configuration.EPSILON);
-			alias.setFontSize(nullDouble);
-			assertNull(alias.getFontSize());
-			alias.setFontSize(fontSizeInt);
-			assertEquals(fontSize, alias.getFontSize(), Configuration.EPSILON);
-
-			alias.setWidth(widthStr);
-			assertEquals(width, alias.getWidth(), Configuration.EPSILON);
-			alias.setWidth(nullDouble);
-			assertNull(alias.getWidth());
-			alias.setWidth(width);
-			assertEquals(width, alias.getWidth(), Configuration.EPSILON);
-			try {
-				alias.setWidth("as");
-				fail("Exception expected");
-			} catch (InvalidArgumentException e) {
-			}
-
-			alias.setHeight(heightStr);
-			assertEquals(height, alias.getHeight(), Configuration.EPSILON);
-			alias.setHeight(nullDouble);
-			assertNull(alias.getHeight());
-			alias.setHeight(height);
-			assertEquals(height, alias.getHeight(), Configuration.EPSILON);
-			try {
-				alias.setHeight("as");
-				fail("Exception expected");
-			} catch (InvalidArgumentException e) {
-			}
-
-			alias.setCompartmentAlias(compartmentAlias);
-			assertEquals(compartmentAlias, alias.getCompartmentAlias());
-			alias.setId(id);
-			assertEquals(id, alias.getId());
-			alias.setTransparencyLevel(transparencyLevel);
-			assertEquals(transparencyLevel, alias.getTransparencyLevel());
-			alias.setModel(model);
-			assertEquals(model, alias.getModel());
-			alias.setModelData(modelData);
-			assertEquals(modelData, alias.getModelData());
-			alias.setSearchIndexes(indexes);
-			assertEquals(indexes, alias.getSearchIndexes());
-
-			assertNotNull(alias.getBorder());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testContainsAlias() {
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setWidth(100);
-			alias.setHeight(100);
-			SpeciesAlias alias2 = new SpeciesAlias();
-			alias2.setX(-2);
-			alias2.setY(-2);
-			alias2.setWidth(100);
-			alias2.setHeight(100);
-
-			assertTrue(alias.contains(alias2));
-			alias2.setX(2);
-			alias2.setY(2);
-			assertTrue(alias.contains(alias2));
-			alias2.setX(-2);
-			alias2.setY(2);
-			assertTrue(alias.contains(alias2));
-			alias2.setX(2);
-			alias2.setY(-2);
-			assertTrue(alias.contains(alias2));
-
-			alias2.setX(-2);
-			alias2.setY(-2);
-			alias2.setWidth(200);
-			alias2.setHeight(200);
-			assertFalse(alias.contains(alias2));
-
-			CompartmentAlias alias3 = new CompartmentAlias();
-			alias3.setX(2);
-			alias3.setY(2);
-			alias3.setWidth(10);
-			alias3.setHeight(100);
-			assertFalse(alias.contains(alias3));
-
-			alias3.setWidth(100);
-			alias3.setHeight(10);
-			assertFalse(alias.contains(alias3));
-
-			alias3.setWidth(10);
-			alias3.setHeight(10);
-			assertTrue(alias.contains(alias3));
-
-			alias3.setWidth(100);
-			alias3.setHeight(100);
-			alias3.setX(-2);
-			alias3.setY(2);
-			assertFalse(alias.contains(alias3));
-			alias3.setX(2);
-			alias3.setY(-2);
-			assertFalse(alias.contains(alias3));
-			alias3.setX(-2);
-			alias3.setY(-2);
-			assertFalse(alias.contains(alias3));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testContainsLayerText() {
-		try {
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setWidth(100);
-			alias.setHeight(100);
-			LayerText alias2 = new LayerText();
-			alias2.setX(2.0);
-			alias2.setY(2.0);
-			alias2.setWidth(100.0);
-			alias2.setHeight(100.0);
-
-			assertFalse(alias.contains(alias2));
-			alias2.setWidth(10.0);
-			alias2.setHeight(10.0);
-			assertTrue(alias.contains(alias2));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.layout.graphics.LayerText;
+import lcsb.mapviewer.model.map.model.AliasSubmodelConnection;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class AliasTest {
+
+	private static double EPSILON = Configuration.EPSILON;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testDistance1() {
+		SpeciesAlias alias;
+		alias = new GenericProteinAlias(null,null);
+		alias.setWidth(10);
+		alias.setHeight(20);
+		alias.setX(100.0);
+		alias.setY(200.0);
+		double distance = alias.getDistanceFromPoint(alias.getCenter());
+		assertEquals(0, distance, EPSILON);
+	}
+
+	@Test
+	public void testDistance2() {
+		SpeciesAlias alias;
+		alias = new GenericProteinAlias(null,null);
+		alias.setWidth(10);
+		alias.setHeight(20);
+		alias.setX(100.0);
+		alias.setY(200.0);
+		double distance = alias.getDistanceFromPoint(new Point2D.Double(100, 205));
+		assertEquals(0, distance, EPSILON);
+	}
+
+	@Test
+	public void testDistance6() {
+		SpeciesAlias alias;
+		alias = new GenericProteinAlias(null,null);
+		alias.setWidth(10);
+		alias.setHeight(20);
+		alias.setX(100.0);
+		alias.setY(200.0);
+		double distance = alias.getDistanceFromPoint(new Point2D.Double(105, 95));
+		assertEquals(105, distance, EPSILON);
+	}
+
+	@Test
+	public void testDistance3() {
+		SpeciesAlias alias;
+		alias = new GenericProteinAlias(null,null);
+		alias.setWidth(10);
+		alias.setHeight(20);
+		alias.setX(100.0);
+		alias.setY(200.0);
+		double distance = alias.getDistanceFromPoint(new Point2D.Double(50, 205));
+		assertEquals(50, distance, EPSILON);
+	}
+
+	@Test
+	public void testDistance4() {
+		SpeciesAlias alias;
+		alias = new GenericProteinAlias(null,null);
+		alias.setWidth(10);
+		alias.setHeight(20);
+		alias.setX(100.0);
+		alias.setY(200.0);
+		double distance = alias.getDistanceFromPoint(new Point2D.Double(120, 230));
+		assertEquals(Math.sqrt(200), distance, EPSILON);
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			GenericProteinAlias alias = new GenericProteinAlias(null,null);
+			alias.addSearchIndex(new SearchIndex());
+			alias.setSubmodel(new AliasSubmodelConnection());
+			Alias copy = new GenericProteinAlias(alias);
+			assertNotNull(copy);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testIncreaseBorder() {
+		try {
+			SpeciesAlias alias = new GenericProteinAlias(null,null);
+			assertEquals(0.0, alias.getSize(), Configuration.EPSILON);
+			alias.increaseBorder(2);
+			assertEquals(16.0, alias.getSize(), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			SpeciesAlias alias = new GenericProteinAlias(null,null);
+			Double nullDouble = null;
+			String xStr = "1.2";
+			Double x = 1.2;
+			String yStr = "1.3";
+			Double y = 1.3;
+			String fontSizeStr = "5.0";
+			Double fontSize = 5.0;
+			int fontSizeInt = 5;
+			String widthStr = "3.0";
+			Double width = 3.0;
+			String heightStr = "4.0";
+			Double height = 4.0;
+			ModelData modelData = new ModelData();
+			CompartmentAlias compartmentAlias = new CompartmentAlias();
+			int id = 72;
+			int transparencyLevel = 2;
+			Model model = new ModelFullIndexed(modelData);
+			List<SearchIndex> indexes = new ArrayList<>();
+			indexes.add(new SearchIndex());
+
+			alias.setX(xStr);
+			assertEquals(x, alias.getX(), Configuration.EPSILON);
+			alias.setX(nullDouble);
+			assertNull(alias.getX());
+			alias.setX(x);
+			assertEquals(x, alias.getX(), Configuration.EPSILON);
+
+			alias.setY(yStr);
+			assertEquals(y, alias.getY(), Configuration.EPSILON);
+			alias.setY(nullDouble);
+			assertNull(alias.getY());
+			alias.setY(y);
+			assertEquals(y, alias.getY(), Configuration.EPSILON);
+
+			alias.setFontSize(fontSizeStr);
+			assertEquals(fontSize, alias.getFontSize(), Configuration.EPSILON);
+			alias.setFontSize(nullDouble);
+			assertNull(alias.getFontSize());
+			alias.setFontSize(fontSize);
+			assertEquals(fontSize, alias.getFontSize(), Configuration.EPSILON);
+			alias.setFontSize(nullDouble);
+			assertNull(alias.getFontSize());
+			alias.setFontSize(fontSizeInt);
+			assertEquals(fontSize, alias.getFontSize(), Configuration.EPSILON);
+
+			alias.setWidth(widthStr);
+			assertEquals(width, alias.getWidth(), Configuration.EPSILON);
+			alias.setWidth(nullDouble);
+			assertNull(alias.getWidth());
+			alias.setWidth(width);
+			assertEquals(width, alias.getWidth(), Configuration.EPSILON);
+			try {
+				alias.setWidth("as");
+				fail("Exception expected");
+			} catch (InvalidArgumentException e) {
+			}
+
+			alias.setHeight(heightStr);
+			assertEquals(height, alias.getHeight(), Configuration.EPSILON);
+			alias.setHeight(nullDouble);
+			assertNull(alias.getHeight());
+			alias.setHeight(height);
+			assertEquals(height, alias.getHeight(), Configuration.EPSILON);
+			try {
+				alias.setHeight("as");
+				fail("Exception expected");
+			} catch (InvalidArgumentException e) {
+			}
+
+			alias.setCompartmentAlias(compartmentAlias);
+			assertEquals(compartmentAlias, alias.getCompartmentAlias());
+			alias.setId(id);
+			assertEquals(id, alias.getId());
+			alias.setTransparencyLevel(transparencyLevel);
+			assertEquals(transparencyLevel, alias.getTransparencyLevel());
+			alias.setModel(model);
+			assertEquals(model, alias.getModel());
+			alias.setModelData(modelData);
+			assertEquals(modelData, alias.getModelData());
+			alias.setSearchIndexes(indexes);
+			assertEquals(indexes, alias.getSearchIndexes());
+
+			assertNotNull(alias.getBorder());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testContainsAlias() {
+		try {
+			SpeciesAlias alias = new GenericProteinAlias(null,null);
+			alias.setWidth(100);
+			alias.setHeight(100);
+			SpeciesAlias alias2 = new GenericProteinAlias(null,null);
+			alias2.setX(-2);
+			alias2.setY(-2);
+			alias2.setWidth(100);
+			alias2.setHeight(100);
+
+			assertTrue(alias.contains(alias2));
+			alias2.setX(2);
+			alias2.setY(2);
+			assertTrue(alias.contains(alias2));
+			alias2.setX(-2);
+			alias2.setY(2);
+			assertTrue(alias.contains(alias2));
+			alias2.setX(2);
+			alias2.setY(-2);
+			assertTrue(alias.contains(alias2));
+
+			alias2.setX(-2);
+			alias2.setY(-2);
+			alias2.setWidth(200);
+			alias2.setHeight(200);
+			assertFalse(alias.contains(alias2));
+
+			CompartmentAlias alias3 = new CompartmentAlias();
+			alias3.setX(2);
+			alias3.setY(2);
+			alias3.setWidth(10);
+			alias3.setHeight(100);
+			assertFalse(alias.contains(alias3));
+
+			alias3.setWidth(100);
+			alias3.setHeight(10);
+			assertFalse(alias.contains(alias3));
+
+			alias3.setWidth(10);
+			alias3.setHeight(10);
+			assertTrue(alias.contains(alias3));
+
+			alias3.setWidth(100);
+			alias3.setHeight(100);
+			alias3.setX(-2);
+			alias3.setY(2);
+			assertFalse(alias.contains(alias3));
+			alias3.setX(2);
+			alias3.setY(-2);
+			assertFalse(alias.contains(alias3));
+			alias3.setX(-2);
+			alias3.setY(-2);
+			assertFalse(alias.contains(alias3));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testContainsLayerText() {
+		try {
+			SpeciesAlias alias = new GenericProteinAlias(null,null);
+			alias.setWidth(100);
+			alias.setHeight(100);
+			LayerText alias2 = new LayerText();
+			alias2.setX(2.0);
+			alias2.setY(2.0);
+			alias2.setWidth(100.0);
+			alias2.setHeight(100.0);
+
+			assertFalse(alias.contains(alias2));
+			alias2.setWidth(10.0);
+			alias2.setHeight(10.0);
+			assertTrue(alias.contains(alias2));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/CompartmentAliasComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/CompartmentAliasComparatorTest.java
index 4962277a98..15fd788ad3 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/CompartmentAliasComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/CompartmentAliasComparatorTest.java
@@ -1,221 +1,219 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.Color;
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.species.Protein;
-
-public class CompartmentAliasComparatorTest {
-
-	CompartmentAliasComparator comparator = new CompartmentAliasComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			CompartmentAlias alias1 = createCompartmentAlias();
-			CompartmentAlias alias2 = createCompartmentAlias();
-
-			assertEquals(0, comparator.compare(alias1, alias2));
-
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testDifferent2() {
-		try {
-			CompartmentAlias alias1 = createCompartmentAlias();
-
-			assertTrue(comparator.compare(alias1, new ArtifitialCompartmentAlias()) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			CompartmentAlias alias1 = createCompartmentAlias();
-			CompartmentAlias alias2 = createCompartmentAlias();
-			
-			SpeciesAlias alias = new SpeciesAlias("1");
-			alias1.getAliases().add(alias);
-			alias = new SpeciesAlias("1");
-			alias1.getAliases().add(alias);
-			
-			alias2.getAliases().add(new SpeciesAlias("b"));
-			alias2.getAliases().add(new SpeciesAlias("a"));
-
-			comparator.compare(alias1, alias2);
-			fail("Exception expected");
-
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testInvalid2() {
-		try {
-			CompartmentAlias alias1 = createCompartmentAlias();
-			CompartmentAlias alias2 = createCompartmentAlias();
-			
-			SpeciesAlias alias = new SpeciesAlias("1");
-			alias1.getAliases().add(alias);
-			alias = new SpeciesAlias("1");
-			alias1.getAliases().add(alias);
-			
-			alias2.getAliases().add(new SpeciesAlias("A"));
-			alias2.getAliases().add(new SpeciesAlias("B"));
-
-			comparator.compare(alias2, alias1);
-			fail("Exception expected");
-
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	private CompartmentAlias createCompartmentAlias() {
-		CompartmentAlias result = new CompartmentAlias();
-
-		result.setAliasId("asd");
-		result.setX(12.0);
-		result.setY(123.0);
-		result.setWidth(4);
-		result.setHeight(5);
-		result.setFontSize(9.0);
-		result.setColor(Color.BLUE);
-		result.setVisibilityLevel(14);
-		result.setThickness(998);
-		result.setOuterWidth(45);
-		result.setInnerWidth(65);
-		result.setNamePoint(new Point2D.Double(9, 2));
-
-		Protein protein = new Protein();
-		protein.setName("a");
-		SpeciesAlias alias = new SpeciesAlias(protein);
-		alias.setAliasId("S");
-		result.addAlias(alias);
-
-		return result;
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			CompartmentAlias alias1 = createCompartmentAlias();
-			CompartmentAlias alias2 = createCompartmentAlias();
-
-			assertTrue(comparator.compare(alias1, null) != 0);
-			assertTrue(comparator.compare(null, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			alias1.setAliasId("tmp");
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			alias1.setThickness(11111);
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			alias1.setNamePoint(new Point2D.Double(9, 999));
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			alias1.addAlias(new SpeciesAlias());
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			alias1.getAliases().iterator().next().setAliasId("bnu");
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			SpeciesAlias speciesAlias = (SpeciesAlias) alias1.getAliases().iterator().next();
-			speciesAlias.getSpecies().setName("new namne");
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			alias1.setOuterWidth(2);
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			alias1.setInnerWidth(2);
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createCompartmentAlias();
-			alias2 = createCompartmentAlias();
-
-			alias1.setCompartment(new Compartment("s"));
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.Color;
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class CompartmentAliasComparatorTest {
+
+	CompartmentAliasComparator comparator = new CompartmentAliasComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			CompartmentAlias alias1 = createCompartmentAlias();
+			CompartmentAlias alias2 = createCompartmentAlias();
+
+			assertEquals(0, comparator.compare(alias1, alias2));
+
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testDifferent2() {
+		try {
+			CompartmentAlias alias1 = createCompartmentAlias();
+
+			assertTrue(comparator.compare(alias1, new ArtifitialCompartmentAlias()) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			CompartmentAlias alias1 = createCompartmentAlias();
+			CompartmentAlias alias2 = createCompartmentAlias();
+
+			GenericProteinAlias alias = new GenericProteinAlias("1", null);
+			alias1.getAliases().add(alias);
+			alias = new GenericProteinAlias("1", null);
+			alias1.getAliases().add(alias);
+
+			alias2.getAliases().add(new GenericProteinAlias("b", null));
+			alias2.getAliases().add(new GenericProteinAlias("a", null));
+
+			comparator.compare(alias1, alias2);
+			fail("Exception expected");
+
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testInvalid2() {
+		try {
+			CompartmentAlias alias1 = createCompartmentAlias();
+			CompartmentAlias alias2 = createCompartmentAlias();
+
+			SpeciesAlias alias = new GenericProteinAlias("1", null);
+			alias1.getAliases().add(alias);
+			alias = new GenericProteinAlias("1", null);
+			alias1.getAliases().add(alias);
+
+			alias2.getAliases().add(new GenericProteinAlias("A", null));
+			alias2.getAliases().add(new GenericProteinAlias("B", null));
+
+			comparator.compare(alias2, alias1);
+			fail("Exception expected");
+
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	private CompartmentAlias createCompartmentAlias() {
+		CompartmentAlias result = new CompartmentAlias();
+
+		result.setAliasId("asd");
+		result.setX(12.0);
+		result.setY(123.0);
+		result.setWidth(4);
+		result.setHeight(5);
+		result.setFontSize(9.0);
+		result.setColor(Color.BLUE);
+		result.setVisibilityLevel(14);
+		result.setThickness(998);
+		result.setOuterWidth(45);
+		result.setInnerWidth(65);
+		result.setNamePoint(new Point2D.Double(9, 2));
+
+		GenericProtein protein = new GenericProtein();
+		protein.setName("a");
+		SpeciesAlias alias = new GenericProteinAlias("S", protein);
+		result.addAlias(alias);
+
+		return result;
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			CompartmentAlias alias1 = createCompartmentAlias();
+			CompartmentAlias alias2 = createCompartmentAlias();
+
+			assertTrue(comparator.compare(alias1, null) != 0);
+			assertTrue(comparator.compare(null, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			alias1.setAliasId("tmp");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			alias1.setThickness(11111);
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			alias1.setNamePoint(new Point2D.Double(9, 999));
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			alias1.addAlias(new GenericProteinAlias(null, null));
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			alias1.getAliases().iterator().next().setAliasId("bnu");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			SpeciesAlias speciesAlias = (SpeciesAlias) alias1.getAliases().iterator().next();
+			speciesAlias.getSpecies().setName("new namne");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			alias1.setOuterWidth(2);
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			alias1.setInnerWidth(2);
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createCompartmentAlias();
+			alias2 = createCompartmentAlias();
+
+			alias1.setCompartment(new Compartment("s"));
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/CompartmentAliasTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/CompartmentAliasTest.java
index 84dfd081c1..1e0ebc090e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/CompartmentAliasTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/CompartmentAliasTest.java
@@ -1,426 +1,424 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class CompartmentAliasTest {
-	Logger logger						 = Logger.getLogger(CompartmentAliasTest.class);
-
-	int		 identifierCounter = 1;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCross() throws Exception {
-		try {
-			Model model = createCrossModel();
-			Alias ldhbAlias1 = model.getAliasByAliasId("sa1115");
-			Alias ldhbAlias2 = model.getAliasByAliasId("sa1117");
-			Alias ldhbAlias3 = model.getAliasByAliasId("sa1119");
-			Alias ldhbAlias4 = model.getAliasByAliasId("sa1121");
-
-			CompartmentAlias cytosolAlias = (CompartmentAlias) model.getAliasByAliasId("ca1");
-
-			assertTrue(cytosolAlias.cross(ldhbAlias1));
-			assertTrue(cytosolAlias.cross(ldhbAlias2));
-			assertTrue(cytosolAlias.cross(ldhbAlias3));
-			assertTrue(cytosolAlias.cross(ldhbAlias4));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCrossException() throws Exception {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-			ComplexAlias alias2 = new ComplexAlias(new ComplexSpecies());
-			alias2.setParent(alias2);
-			alias.cross(alias2);
-
-			fail("Exception epxected");
-		} catch (InvalidStateException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCross2() throws Exception {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-			alias.setX(10.0);
-			alias.setY(10.0);
-			alias.setWidth(10.0);
-			alias.setHeight(10.0);
-			ComplexAlias alias2 = new ComplexAlias(new ComplexSpecies());
-			alias2.setWidth(10.0);
-			alias2.setHeight(10.0);
-			alias2.setX(5.0);
-			alias2.setY(5.0);
-			assertTrue(alias.cross(alias2));
-
-			alias2.setX(15.0);
-			alias2.setY(5.0);
-			assertTrue(alias.cross(alias2));
-
-			alias2.setX(5.0);
-			alias2.setY(15.0);
-			assertTrue(alias.cross(alias2));
-
-			alias2.setX(15.0);
-			alias2.setY(15.0);
-			assertTrue(alias.cross(alias2));
-
-			alias2.setWidth(100.0);
-			alias2.setHeight(100.0);
-			alias2.setX(-110.0);
-			alias2.setY(-10.0);
-			assertFalse(alias.cross(alias2));
-
-			alias2.setX(-10.0);
-			alias2.setY(-110.0);
-			assertFalse(alias.cross(alias2));
-
-			alias2.setX(40.0);
-			alias2.setY(-10.0);
-			assertFalse(alias.cross(alias2));
-
-			alias2.setX(-10.0);
-			alias2.setY(40.0);
-			assertFalse(alias.cross(alias2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetTitle() throws Exception {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-
-			assertNull(alias.getTitle());
-
-			Compartment comp = new Compartment();
-			comp.setName("AS");
-			alias.setCompartment(comp);
-
-			assertNotNull(alias.getTitle());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testContainsIdenticalSpecies() throws Exception {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-
-			Compartment comp = new Compartment();
-			comp.setName("AS");
-			alias.setCompartment(comp);
-
-			assertFalse(alias.containsIdenticalSpecies());
-			GenericProtein protein = new GenericProtein();
-			protein.setName("AS");
-			SpeciesAlias sAlias = new SpeciesAlias(protein);
-
-			alias.addAlias(sAlias);
-
-			assertTrue(alias.containsIdenticalSpecies());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createCrossModel() {
-		Model model = new ModelFullIndexed(null);
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		model.addAlias(createSpeciesAlias(3264.8333333333335, 7517.75, 86.0, 46.0, "sa1115"));
-		model.addAlias(createSpeciesAlias(3267.6666666666665, 7438.75, 80.0, 40.0, "sa1117"));
-		model.addAlias(createSpeciesAlias(3261.6666666666665, 7600.75, 92.0, 52.0, "sa1119"));
-		model.addAlias(createSpeciesAlias(3203.666666666667, 7687.75, 98.0, 58.0, "sa1121"));
-
-		SpeciesAlias alias = createSpeciesAlias(7817.714285714286, 11287.642857142859, 80.0, 40.0, "sa1422");
-		SpeciesAlias alias2 = createSpeciesAlias(8224.964285714286, 11241.392857142859, 80.0, 40.0, "sa1419");
-		ComplexAlias alias3 = createComplexAlias(7804.714285714286, 11182.642857142859, 112.0, 172.0, "csa152");
-		alias3.addAlias(alias);
-		alias3.addAlias(alias2);
-		alias.setParent(alias3);
-		alias2.setParent(alias3);
-
-		model.addAlias(alias);
-		model.addAlias(alias2);
-		model.addAlias(alias3);
-
-		model.addAlias(createCompartmentAlias(1380.0, 416.0, 15893.0, 10866.0, "ca1"));
-		return model;
-	}
-
-	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
-		Compartment compartment = new Compartment("c" + identifierCounter++);
-		CompartmentAlias alias = new CompartmentAlias(compartment);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
-		Species species = new SimpleMolecule();
-		species.setElementId("s" + identifierCounter++);
-		SpeciesAlias alias = new SpeciesAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
-		ComplexSpecies species = new ComplexSpecies();
-		species.setElementId("s" + identifierCounter++);
-		ComplexAlias alias = new ComplexAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	@Test
-	public void testCrossWithComplexElements() throws Exception {
-		try {
-			Model model = createCrossModel();
-			Alias ldhbAlias1 = model.getAliasByAliasId("sa1422");
-			Alias ldhbAlias2 = model.getAliasByAliasId("sa1419");
-
-			CompartmentAlias cytosolAlias = (CompartmentAlias) model.getAliasByAliasId("ca1");
-
-			assertTrue(cytosolAlias.cross(ldhbAlias1));
-			assertTrue(cytosolAlias.cross(ldhbAlias2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new CompartmentAlias());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-			alias.addAlias(new SpeciesAlias());
-			CompartmentAlias copy = new CompartmentAlias(alias);
-			assertNotNull(copy);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetters() {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-			String invalidVal = "a1.6";
-			String val = "1.6";
-			Double dVal = 1.6;
-
-			alias.setLineThickness(val);
-			alias.setLineOuterWidth(val);
-			alias.setLineInnerWidth(val);
-
-			assertEquals(dVal, alias.getThickness(), Configuration.EPSILON);
-			assertEquals(dVal, alias.getOuterWidth(), Configuration.EPSILON);
-			assertEquals(dVal, alias.getInnerWidth(), Configuration.EPSILON);
-
-			try {
-				alias.setLineThickness(invalidVal);
-				fail("Exception expected");
-			} catch (InvalidArgumentException e) {
-			}
-			try {
-				alias.setLineOuterWidth(invalidVal);
-				fail("Exception expected");
-			} catch (InvalidArgumentException e) {
-			}
-			try {
-				alias.setLineInnerWidth(invalidVal);
-				fail("Exception expected");
-			} catch (InvalidArgumentException e) {
-			}
-
-			alias.setNamePoint(2, 3);
-			assertEquals(0, alias.getNamePoint().distance(2, 3), Configuration.EPSILON);
-
-			Set<Alias> aliases = new HashSet<>();
-
-			alias.setAliases(aliases);
-			assertEquals(aliases, alias.getAliases());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddAlias() {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-
-			SpeciesAlias child = new SpeciesAlias("id");
-
-			alias.addAlias(child);
-			alias.addAlias(child);
-
-			assertEquals(1, alias.getAliases().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddInvalidAlias() {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-
-			SpeciesAlias child = new SpeciesAlias("id");
-			SpeciesAlias child2 = new SpeciesAlias("id");
-
-			alias.addAlias(child);
-			alias.addAlias(child2);
-
-			fail("Exception expected");
-
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAllAlias() {
-		try {
-			CompartmentAlias alias = new CompartmentAlias();
-
-			SpeciesAlias child = new SpeciesAlias("id");
-			CompartmentAlias child2 = new CompartmentAlias();
-			child2.addAlias(child);
-			alias.addAlias(child2);
-
-			assertEquals(2, alias.getAllSubAliases().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			CompartmentAlias degraded = new CompartmentAlias().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveAlias() {
-		try {
-			CompartmentAlias comp = new CompartmentAlias();
-			SpeciesAlias alias = new SpeciesAlias();
-			comp.addAlias(alias);
-			alias.setCompartmentAlias(new CompartmentAlias());
-
-			comp.removeAlias(alias);
-
-			assertEquals(0, comp.getAliases().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new CompartmentAlias() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+
+public class CompartmentAliasTest {
+	Logger logger						 = Logger.getLogger(CompartmentAliasTest.class);
+
+	int		 identifierCounter = 1;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCross() throws Exception {
+		try {
+			Model model = createCrossModel();
+			Alias ldhbAlias1 = model.getAliasByAliasId("sa1115");
+			Alias ldhbAlias2 = model.getAliasByAliasId("sa1117");
+			Alias ldhbAlias3 = model.getAliasByAliasId("sa1119");
+			Alias ldhbAlias4 = model.getAliasByAliasId("sa1121");
+
+			CompartmentAlias cytosolAlias = (CompartmentAlias) model.getAliasByAliasId("ca1");
+
+			assertTrue(cytosolAlias.cross(ldhbAlias1));
+			assertTrue(cytosolAlias.cross(ldhbAlias2));
+			assertTrue(cytosolAlias.cross(ldhbAlias3));
+			assertTrue(cytosolAlias.cross(ldhbAlias4));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCrossException() throws Exception {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+			ComplexAlias alias2 = new ComplexAlias(new ComplexSpecies());
+			alias2.setParent(alias2);
+			alias.cross(alias2);
+
+			fail("Exception epxected");
+		} catch (InvalidStateException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCross2() throws Exception {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+			alias.setX(10.0);
+			alias.setY(10.0);
+			alias.setWidth(10.0);
+			alias.setHeight(10.0);
+			ComplexAlias alias2 = new ComplexAlias(new ComplexSpecies());
+			alias2.setWidth(10.0);
+			alias2.setHeight(10.0);
+			alias2.setX(5.0);
+			alias2.setY(5.0);
+			assertTrue(alias.cross(alias2));
+
+			alias2.setX(15.0);
+			alias2.setY(5.0);
+			assertTrue(alias.cross(alias2));
+
+			alias2.setX(5.0);
+			alias2.setY(15.0);
+			assertTrue(alias.cross(alias2));
+
+			alias2.setX(15.0);
+			alias2.setY(15.0);
+			assertTrue(alias.cross(alias2));
+
+			alias2.setWidth(100.0);
+			alias2.setHeight(100.0);
+			alias2.setX(-110.0);
+			alias2.setY(-10.0);
+			assertFalse(alias.cross(alias2));
+
+			alias2.setX(-10.0);
+			alias2.setY(-110.0);
+			assertFalse(alias.cross(alias2));
+
+			alias2.setX(40.0);
+			alias2.setY(-10.0);
+			assertFalse(alias.cross(alias2));
+
+			alias2.setX(-10.0);
+			alias2.setY(40.0);
+			assertFalse(alias.cross(alias2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetTitle() throws Exception {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+
+			assertNull(alias.getTitle());
+
+			Compartment comp = new Compartment();
+			comp.setName("AS");
+			alias.setCompartment(comp);
+
+			assertNotNull(alias.getTitle());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testContainsIdenticalSpecies() throws Exception {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+
+			Compartment comp = new Compartment();
+			comp.setName("AS");
+			alias.setCompartment(comp);
+
+			assertFalse(alias.containsIdenticalSpecies());
+			GenericProtein protein = new GenericProtein();
+			protein.setName("AS");
+			SpeciesAlias sAlias = new GenericProteinAlias(null, protein);
+
+			alias.addAlias(sAlias);
+
+			assertTrue(alias.containsIdenticalSpecies());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createCrossModel() {
+		Model model = new ModelFullIndexed(null);
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		model.addAlias(createSpeciesAlias(3264.8333333333335, 7517.75, 86.0, 46.0, "sa1115"));
+		model.addAlias(createSpeciesAlias(3267.6666666666665, 7438.75, 80.0, 40.0, "sa1117"));
+		model.addAlias(createSpeciesAlias(3261.6666666666665, 7600.75, 92.0, 52.0, "sa1119"));
+		model.addAlias(createSpeciesAlias(3203.666666666667, 7687.75, 98.0, 58.0, "sa1121"));
+
+		SpeciesAlias alias = createSpeciesAlias(7817.714285714286, 11287.642857142859, 80.0, 40.0, "sa1422");
+		SpeciesAlias alias2 = createSpeciesAlias(8224.964285714286, 11241.392857142859, 80.0, 40.0, "sa1419");
+		ComplexAlias alias3 = createComplexAlias(7804.714285714286, 11182.642857142859, 112.0, 172.0, "csa152");
+		alias3.addAlias(alias);
+		alias3.addAlias(alias2);
+		alias.setParent(alias3);
+		alias2.setParent(alias3);
+
+		model.addAlias(alias);
+		model.addAlias(alias2);
+		model.addAlias(alias3);
+
+		model.addAlias(createCompartmentAlias(1380.0, 416.0, 15893.0, 10866.0, "ca1"));
+		return model;
+	}
+
+	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
+		Compartment compartment = new Compartment("c" + identifierCounter++);
+		CompartmentAlias alias = new CompartmentAlias(compartment);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
+		SimpleMolecule species = new SimpleMolecule();
+		species.setElementId("s" + identifierCounter++);
+		SimpleMoleculeAlias alias = new SimpleMoleculeAlias(aliasId, species);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
+		ComplexSpecies species = new ComplexSpecies();
+		species.setElementId("s" + identifierCounter++);
+		ComplexAlias alias = new ComplexAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	@Test
+	public void testCrossWithComplexElements() throws Exception {
+		try {
+			Model model = createCrossModel();
+			Alias ldhbAlias1 = model.getAliasByAliasId("sa1422");
+			Alias ldhbAlias2 = model.getAliasByAliasId("sa1419");
+
+			CompartmentAlias cytosolAlias = (CompartmentAlias) model.getAliasByAliasId("ca1");
+
+			assertTrue(cytosolAlias.cross(ldhbAlias1));
+			assertTrue(cytosolAlias.cross(ldhbAlias2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new CompartmentAlias());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+			alias.addAlias(new GenericProteinAlias(null, null));
+			CompartmentAlias copy = new CompartmentAlias(alias);
+			assertNotNull(copy);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetters() {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+			String invalidVal = "a1.6";
+			String val = "1.6";
+			Double dVal = 1.6;
+
+			alias.setLineThickness(val);
+			alias.setLineOuterWidth(val);
+			alias.setLineInnerWidth(val);
+
+			assertEquals(dVal, alias.getThickness(), Configuration.EPSILON);
+			assertEquals(dVal, alias.getOuterWidth(), Configuration.EPSILON);
+			assertEquals(dVal, alias.getInnerWidth(), Configuration.EPSILON);
+
+			try {
+				alias.setLineThickness(invalidVal);
+				fail("Exception expected");
+			} catch (InvalidArgumentException e) {
+			}
+			try {
+				alias.setLineOuterWidth(invalidVal);
+				fail("Exception expected");
+			} catch (InvalidArgumentException e) {
+			}
+			try {
+				alias.setLineInnerWidth(invalidVal);
+				fail("Exception expected");
+			} catch (InvalidArgumentException e) {
+			}
+
+			alias.setNamePoint(2, 3);
+			assertEquals(0, alias.getNamePoint().distance(2, 3), Configuration.EPSILON);
+
+			Set<Alias> aliases = new HashSet<>();
+
+			alias.setAliases(aliases);
+			assertEquals(aliases, alias.getAliases());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddAlias() {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+
+			SpeciesAlias child = new GenericProteinAlias("id", null);
+
+			alias.addAlias(child);
+			alias.addAlias(child);
+
+			assertEquals(1, alias.getAliases().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddInvalidAlias() {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+
+			SpeciesAlias child = new GenericProteinAlias("id", null);
+			SpeciesAlias child2 = new GenericProteinAlias("id", null);
+
+			alias.addAlias(child);
+			alias.addAlias(child2);
+
+			fail("Exception expected");
+
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAllAlias() {
+		try {
+			CompartmentAlias alias = new CompartmentAlias();
+
+			SpeciesAlias child = new GenericProteinAlias("id", null);
+			CompartmentAlias child2 = new CompartmentAlias();
+			child2.addAlias(child);
+			alias.addAlias(child2);
+
+			assertEquals(2, alias.getAllSubAliases().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			CompartmentAlias degraded = new CompartmentAlias().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveAlias() {
+		try {
+			CompartmentAlias comp = new CompartmentAlias();
+			SpeciesAlias alias = new GenericProteinAlias(null, null);
+			comp.addAlias(alias);
+			alias.setCompartmentAlias(new CompartmentAlias());
+
+			comp.removeAlias(alias);
+
+			assertEquals(0, comp.getAliases().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new CompartmentAlias() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/ComplexAliasComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/ComplexAliasComparatorTest.java
index a218c40817..01abc65be9 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/ComplexAliasComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/ComplexAliasComparatorTest.java
@@ -1,199 +1,200 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.Color;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ComplexAliasComparatorTest {
-
-	ComplexAliasComparator	comparator	= new ComplexAliasComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			ComplexAlias alias1 = createComplexAlias();
-			ComplexAlias alias2 = createComplexAlias();
-
-			assertEquals(0, comparator.compare(alias1, alias2));
-
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	private ComplexAlias createComplexAlias() {
-		ComplexAlias result = new ComplexAlias();
-
-		result.setAliasId("asd");
-		result.setX(12.0);
-		result.setY(123.0);
-		result.setWidth(4);
-		result.setHeight(5);
-		result.setFontSize(9.0);
-		result.setColor(Color.BLUE);
-		result.setVisibilityLevel(14);
-
-		Protein protein = new Protein();
-		protein.setName("a");
-		SpeciesAlias alias = new SpeciesAlias(protein);
-		alias.setAliasId("S");
-		result.addAlias(alias);
-
-		ComplexSpecies species= new ComplexSpecies();
-		species.setName("complex");
-		result.setSpecies(species);
-
-		return result;
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			ComplexAlias alias1 = createComplexAlias();
-			ComplexAlias alias2 = createComplexAlias();
-
-			assertTrue(comparator.compare(alias1, null) != 0);
-			assertTrue(comparator.compare(null, alias1) != 0);
-
-			alias1 = createComplexAlias();
-			alias2 = createComplexAlias();
-
-			alias1.setAliasId("tmp");
-			
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createComplexAlias();
-			alias2 = createComplexAlias();
-
-			alias1.addAlias(new SpeciesAlias());
-			
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createComplexAlias();
-			alias2 = createComplexAlias();
-
-			alias1.getAliases().iterator().next().setAliasId("bnu");
-			
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createComplexAlias();
-			alias2 = createComplexAlias();
-
-			SpeciesAlias speciesAlias = (SpeciesAlias) alias1.getAliases().iterator().next();
-			speciesAlias.getSpecies().setName("new namne");
-			
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createComplexAlias();
-			alias2 = createComplexAlias();
-
-			Species species = alias1.getSpecies();
-			species.setName("new namne");
-			
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			assertTrue(comparator.compare(alias2, new ComplexAlias(){
-				private static final long serialVersionUID = 1L;}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			ComplexAlias alias1 = createComplexAlias();
-			ComplexAlias alias2 = createComplexAlias();
-			
-			SpeciesAlias alias = new SpeciesAlias("1");
-			alias1.getAliases().add(alias);
-			alias = new SpeciesAlias("1");
-			alias1.getAliases().add(alias);
-			
-			alias2.getAliases().add(new SpeciesAlias("b"));
-			alias2.getAliases().add(new SpeciesAlias("a"));
-
-			comparator.compare(alias1, alias2);
-			fail("Exception expected");
-
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testInvalid3() {
-		try {
-			class Tmp extends ComplexAlias {
-				private static final long serialVersionUID = 1L;
-			};
-			Tmp alias1 = new Tmp();
-			Tmp alias2 = new Tmp();
-			
-			comparator.compare(alias1, alias2);
-			fail("Exception expected");
-
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testInvalid2() {
-		try {
-			ComplexAlias alias1 = createComplexAlias();
-			ComplexAlias alias2 = createComplexAlias();
-			
-			SpeciesAlias alias = new SpeciesAlias("1");
-			alias1.getAliases().add(alias);
-			alias = new SpeciesAlias("1");
-			alias1.getAliases().add(alias);
-			
-			alias2.getAliases().add(new SpeciesAlias("A"));
-			alias2.getAliases().add(new SpeciesAlias("B"));
-
-			comparator.compare(alias2, alias1);
-			fail("Exception expected");
-
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.Color;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class ComplexAliasComparatorTest {
+
+	ComplexAliasComparator comparator = new ComplexAliasComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			ComplexAlias alias1 = createComplexAlias();
+			ComplexAlias alias2 = createComplexAlias();
+
+			assertEquals(0, comparator.compare(alias1, alias2));
+
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	private ComplexAlias createComplexAlias() {
+		ComplexAlias result = new ComplexAlias();
+
+		result.setAliasId("asd");
+		result.setX(12.0);
+		result.setY(123.0);
+		result.setWidth(4);
+		result.setHeight(5);
+		result.setFontSize(9.0);
+		result.setColor(Color.BLUE);
+		result.setVisibilityLevel(14);
+
+		GenericProtein protein = new GenericProtein();
+		protein.setName("a");
+		SpeciesAlias alias = new GenericProteinAlias("S", protein);
+		result.addAlias(alias);
+
+		ComplexSpecies species = new ComplexSpecies();
+		species.setName("complex");
+		result.setSpecies(species);
+
+		return result;
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			ComplexAlias alias1 = createComplexAlias();
+			ComplexAlias alias2 = createComplexAlias();
+
+			assertTrue(comparator.compare(alias1, null) != 0);
+			assertTrue(comparator.compare(null, alias1) != 0);
+
+			alias1 = createComplexAlias();
+			alias2 = createComplexAlias();
+
+			alias1.setAliasId("tmp");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createComplexAlias();
+			alias2 = createComplexAlias();
+
+			alias1.addAlias(new GenericProteinAlias("id", null));
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createComplexAlias();
+			alias2 = createComplexAlias();
+
+			alias1.getAliases().iterator().next().setAliasId("bnu");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createComplexAlias();
+			alias2 = createComplexAlias();
+
+			SpeciesAlias speciesAlias = (SpeciesAlias) alias1.getAliases().iterator().next();
+			speciesAlias.getSpecies().setName("new namne");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createComplexAlias();
+			alias2 = createComplexAlias();
+
+			Species species = alias1.getSpecies();
+			species.setName("new namne");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			assertTrue(comparator.compare(alias2, new ComplexAlias() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			ComplexAlias alias1 = createComplexAlias();
+			ComplexAlias alias2 = createComplexAlias();
+
+			GenericProteinAlias alias = new GenericProteinAlias("1", null);
+			alias1.getAliases().add(alias);
+			alias = new GenericProteinAlias("1", null);
+			alias1.getAliases().add(alias);
+
+			alias2.getAliases().add(new GenericProteinAlias("b", null));
+			alias2.getAliases().add(new GenericProteinAlias("a", null));
+
+			comparator.compare(alias1, alias2);
+			fail("Exception expected");
+
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testInvalid3() {
+		try {
+			class Tmp extends ComplexAlias {
+				private static final long serialVersionUID = 1L;
+			}
+			;
+			Tmp alias1 = new Tmp();
+			Tmp alias2 = new Tmp();
+
+			comparator.compare(alias1, alias2);
+			fail("Exception expected");
+
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testInvalid2() {
+		try {
+			ComplexAlias alias1 = createComplexAlias();
+			ComplexAlias alias2 = createComplexAlias();
+
+			SpeciesAlias alias = new GenericProteinAlias("1", null);
+			alias1.getAliases().add(alias);
+			alias = new GenericProteinAlias("1", null);
+			alias1.getAliases().add(alias);
+
+			alias2.getAliases().add(new GenericProteinAlias("A", null));
+			alias2.getAliases().add(new GenericProteinAlias("B", null));
+
+			comparator.compare(alias2, alias1);
+			fail("Exception expected");
+
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/ComplexAliasTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/ComplexAliasTest.java
index 1702e63ded..22599b071f 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/ComplexAliasTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/ComplexAliasTest.java
@@ -1,152 +1,151 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-
-public class ComplexAliasTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new ComplexAlias());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			ComplexAlias complex = new ComplexAlias();
-			complex.addAlias(new SpeciesAlias());
-			ComplexAlias copy = new ComplexAlias(complex);
-			assertNotNull(copy);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor2() {
-		try {
-			ComplexAlias complex = new ComplexAlias(new ComplexSpecies());
-			assertNotNull(complex.getSpecies());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddAlias() {
-		try {
-			ComplexAlias complex = new ComplexAlias(new ComplexSpecies());
-			SpeciesAlias alias = new SpeciesAlias();
-			complex.addAlias(alias);
-			assertEquals(1, complex.getAllChildrenAliases().size());
-			complex.addAlias(alias);
-			assertEquals(1, complex.getAllChildrenAliases().size());
-			SpeciesAlias alias2 = new SpeciesAlias();
-			alias2.setAliasId("s");
-			complex.addAlias(alias2);
-			assertEquals(2, complex.getAllChildrenAliases().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAllChildren() {
-		try {
-			ComplexAlias complex = new ComplexAlias(new ComplexSpecies());
-
-			complex.addAlias(new SpeciesAlias("1"));
-			ComplexAlias complex2 = new ComplexAlias("c3");
-			complex2.addAlias(new SpeciesAlias("2"));
-			complex2.addAlias(new SpeciesAlias("4"));
-
-			complex.addAlias(complex2);
-
-			assertEquals(4, complex.getAllChildrenAliases().size());
-			assertEquals(2, complex.getAliases().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveAlias() {
-		try {
-			ComplexAlias complex = new ComplexAlias(new ComplexSpecies());
-
-			SpeciesAlias alias = new SpeciesAlias("1");
-			complex.addAlias(alias);
-			complex.addAlias(new SpeciesAlias("2"));
-			complex.addAlias(new SpeciesAlias("4"));
-
-			assertEquals(3, complex.getAliases().size());
-			complex.removeAlias(alias);
-			assertEquals(2, complex.getAliases().size());
-			complex.removeAlias(alias);
-			assertEquals(2, complex.getAliases().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			ComplexAlias original = new ComplexAlias();
-			ComplexAlias copy = original.copy();
-			assertNotNull(copy);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new ComplexAlias() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+
+public class ComplexAliasTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new ComplexAlias());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			ComplexAlias complex = new ComplexAlias();
+			complex.addAlias(new GenericProteinAlias(null, null));
+			ComplexAlias copy = new ComplexAlias(complex);
+			assertNotNull(copy);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			ComplexAlias complex = new ComplexAlias(new ComplexSpecies());
+			assertNotNull(complex.getSpecies());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddAlias() {
+		try {
+			ComplexAlias complex = new ComplexAlias(new ComplexSpecies());
+			SpeciesAlias alias = new GenericProteinAlias("id1", null);
+			complex.addAlias(alias);
+			assertEquals(1, complex.getAllChildrenAliases().size());
+			complex.addAlias(alias);
+			assertEquals(1, complex.getAllChildrenAliases().size());
+			SpeciesAlias alias2 = new GenericProteinAlias("s", null);
+			complex.addAlias(alias2);
+			assertEquals(2, complex.getAllChildrenAliases().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAllChildren() {
+		try {
+			ComplexAlias complex = new ComplexAlias(new ComplexSpecies());
+
+			complex.addAlias(new GenericProteinAlias("1", null));
+			ComplexAlias complex2 = new ComplexAlias("c3");
+			complex2.addAlias(new GenericProteinAlias("2", null));
+			complex2.addAlias(new GenericProteinAlias("4", null));
+
+			complex.addAlias(complex2);
+
+			assertEquals(4, complex.getAllChildrenAliases().size());
+			assertEquals(2, complex.getAliases().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveAlias() {
+		try {
+			ComplexAlias complex = new ComplexAlias(new ComplexSpecies());
+
+			SpeciesAlias alias = new GenericProteinAlias("1", null);
+			complex.addAlias(alias);
+			complex.addAlias(new GenericProteinAlias("2", null));
+			complex.addAlias(new GenericProteinAlias("4", null));
+
+			assertEquals(3, complex.getAliases().size());
+			complex.removeAlias(alias);
+			assertEquals(2, complex.getAliases().size());
+			complex.removeAlias(alias);
+			assertEquals(2, complex.getAliases().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			ComplexAlias original = new ComplexAlias();
+			ComplexAlias copy = original.copy();
+			assertNotNull(copy);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new ComplexAlias() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SearchIndexTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SearchIndexTest.java
index 646b608a9d..a774a7ab84 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SearchIndexTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SearchIndexTest.java
@@ -1,125 +1,125 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class SearchIndexTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new SearchIndex());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor1() {
-		try {
-			SearchIndex index = new SearchIndex("str", 2);
-			assertEquals("str", index.getValue());
-			assertEquals((Integer) 2, index.getWeight());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor2() {
-		try {
-			SearchIndex index = new SearchIndex("str");
-			assertEquals("str", index.getValue());
-			assertEquals((Integer) 1, index.getWeight());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor3() {
-		try {
-			SearchIndex index = new SearchIndex("str");
-			SearchIndex index2 = new SearchIndex(index);
-			assertNotNull(index2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			SearchIndex aRna = new SearchIndex().copy();
-			assertNotNull(aRna);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopyInvalid() {
-		try {
-			new SearchIndex() {
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			int id = 54;
-			int weight = 8;
-			String value = "val5";
-			Alias alias = new SpeciesAlias();
-
-			SearchIndex index = new SearchIndex();
-			index.setId(id);
-			assertEquals(id, index.getId());
-
-			index.setValue(value);
-			assertEquals(value, index.getValue());
-
-			index.setSource(alias);
-			assertEquals(alias, index.getSource());
-
-			index.setWeight(weight);
-			assertEquals((Integer) weight, index.getWeight());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class SearchIndexTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new SearchIndex());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor1() {
+		try {
+			SearchIndex index = new SearchIndex("str", 2);
+			assertEquals("str", index.getValue());
+			assertEquals((Integer) 2, index.getWeight());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			SearchIndex index = new SearchIndex("str");
+			assertEquals("str", index.getValue());
+			assertEquals((Integer) 1, index.getWeight());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor3() {
+		try {
+			SearchIndex index = new SearchIndex("str");
+			SearchIndex index2 = new SearchIndex(index);
+			assertNotNull(index2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			SearchIndex aRna = new SearchIndex().copy();
+			assertNotNull(aRna);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopyInvalid() {
+		try {
+			new SearchIndex() {
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			int id = 54;
+			int weight = 8;
+			String value = "val5";
+			Alias alias = new GeneAlias(null, null);
+
+			SearchIndex index = new SearchIndex();
+			index.setId(id);
+			assertEquals(id, index.getId());
+
+			index.setValue(value);
+			assertEquals(value, index.getValue());
+
+			index.setSource(alias);
+			assertEquals(alias, index.getSource());
+
+			index.setWeight(weight);
+			assertEquals((Integer) weight, index.getWeight());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasComparatorTest.java
index 015e9ef47d..7e0c2b58fd 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasComparatorTest.java
@@ -1,158 +1,160 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.Color;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class SpeciesAliasComparatorTest {
-
-	SpeciesAliasComparator comparator = new SpeciesAliasComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			SpeciesAlias alias1 = createSpeciesAlias();
-			SpeciesAlias alias2 = createSpeciesAlias();
-
-			assertEquals(0, comparator.compare(alias1, alias2));
-
-			assertEquals(0, comparator.compare(null, null));
-
-			assertEquals(0, comparator.compare(new ComplexAlias(), new ComplexAlias()));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testCompareInvalid() {
-		try {
-			class Tmp extends SpeciesAlias {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}
-			;
-
-			Tmp alias1 = new Tmp();
-			Tmp alias2 = new Tmp();
-			comparator.compare(alias1, alias2);
-			fail("Exception expected");
-
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	private SpeciesAlias createSpeciesAlias() {
-		SpeciesAlias result = new SpeciesAlias();
-
-		result.setAliasId("asd");
-		result.setX(12.0);
-		result.setY(123.0);
-		result.setWidth(4);
-		result.setHeight(5);
-		result.setFontSize(9.0);
-		result.setColor(Color.BLUE);
-		result.setVisibilityLevel(14);
-		result.setAliasStateLabel("123");
-		result.setAliasStatePrefix("1234");
-
-		Protein protein = new Protein();
-		protein.setName("a");
-		result.setSpecies(protein);
-
-		return result;
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			SpeciesAlias alias1 = createSpeciesAlias();
-			SpeciesAlias alias2 = createSpeciesAlias();
-
-			assertTrue(comparator.compare(alias1, null) != 0);
-			assertTrue(comparator.compare(null, alias1) != 0);
-
-			assertTrue(comparator.compare(new ComplexAlias(), alias1) != 0);
-
-			alias1 = createSpeciesAlias();
-			alias2 = createSpeciesAlias();
-
-			alias1.setAliasId("tmp");
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createSpeciesAlias();
-			alias2 = createSpeciesAlias();
-
-			alias1.setAliasStateLabel("tmp");
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createSpeciesAlias();
-			alias2 = createSpeciesAlias();
-
-			alias1.setAliasStatePrefix("tmp");
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createSpeciesAlias();
-			alias2 = createSpeciesAlias();
-
-			Species species = alias1.getSpecies();
-			species.setName("new namne");
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createSpeciesAlias();
-			alias2 = createSpeciesAlias();
-
-			alias1.setActivity(true);
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-			alias1 = createSpeciesAlias();
-			alias2 = createSpeciesAlias();
-
-			alias1.setLineWidth(453.75);
-
-			assertTrue(comparator.compare(alias1, alias2) != 0);
-			assertTrue(comparator.compare(alias2, alias1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.Color;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class SpeciesAliasComparatorTest {
+
+	SpeciesAliasComparator comparator = new SpeciesAliasComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			SpeciesAlias alias1 = createSpeciesAlias();
+			SpeciesAlias alias2 = createSpeciesAlias();
+
+			assertEquals(0, comparator.compare(alias1, alias2));
+
+			assertEquals(0, comparator.compare(null, null));
+
+			assertEquals(0, comparator.compare(new ComplexAlias(), new ComplexAlias()));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testCompareInvalid() {
+		try {
+			class Tmp extends GenericProteinAlias {
+
+				public Tmp() {
+					super(null, null);
+				}
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}
+			;
+
+			Tmp alias1 = new Tmp();
+			Tmp alias2 = new Tmp();
+			comparator.compare(alias1, alias2);
+			fail("Exception expected");
+
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	private SpeciesAlias createSpeciesAlias() {
+		GenericProtein protein = new GenericProtein();
+		protein.setName("a");
+		GenericProteinAlias result = new GenericProteinAlias(protein);
+
+		result.setAliasId("asd");
+		result.setX(12.0);
+		result.setY(123.0);
+		result.setWidth(4);
+		result.setHeight(5);
+		result.setFontSize(9.0);
+		result.setColor(Color.BLUE);
+		result.setVisibilityLevel(14);
+		result.setAliasStateLabel("123");
+		result.setAliasStatePrefix("1234");
+
+		return result;
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			SpeciesAlias alias1 = createSpeciesAlias();
+			SpeciesAlias alias2 = createSpeciesAlias();
+
+			assertTrue(comparator.compare(alias1, null) != 0);
+			assertTrue(comparator.compare(null, alias1) != 0);
+
+			assertTrue(comparator.compare(new ComplexAlias(), alias1) != 0);
+
+			alias1 = createSpeciesAlias();
+			alias2 = createSpeciesAlias();
+
+			alias1.setAliasId("tmp");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createSpeciesAlias();
+			alias2 = createSpeciesAlias();
+
+			alias1.setAliasStateLabel("tmp");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createSpeciesAlias();
+			alias2 = createSpeciesAlias();
+
+			alias1.setAliasStatePrefix("tmp");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createSpeciesAlias();
+			alias2 = createSpeciesAlias();
+
+			Species species = alias1.getSpecies();
+			species.setName("new namne");
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createSpeciesAlias();
+			alias2 = createSpeciesAlias();
+
+			alias1.setActivity(true);
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+			alias1 = createSpeciesAlias();
+			alias2 = createSpeciesAlias();
+
+			alias1.setLineWidth(453.75);
+
+			assertTrue(comparator.compare(alias1, alias2) != 0);
+			assertTrue(comparator.compare(alias2, alias1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasTest.java
index 8f11da5c1c..10ade68cb5 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/alias/SpeciesAliasTest.java
@@ -1,86 +1,52 @@
-package lcsb.mapviewer.model.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.reaction.ReactionNode;
-
-public class SpeciesAliasTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new SpeciesAlias());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testCopy() {
-		try {
-			SpeciesAlias degraded = new SpeciesAlias().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new SpeciesAlias() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetter() {
-		try {
-			SpeciesAlias alias = new SpeciesAlias().copy();
-			String state = "as";
-			Set<ReactionNode> node = new HashSet<>();
-			alias.setState(state);
-			alias.setNode(node);
-			
-			assertEquals(state, alias.getState());
-			assertEquals(node, alias.getNode());
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-
-}
+package lcsb.mapviewer.model.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.reaction.ReactionNode;
+
+public class SpeciesAliasTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetter() {
+		try {
+			SpeciesAlias alias = new SpeciesAlias() {
+				
+				@Override
+				public SpeciesAlias copy() {
+					return null;
+				}
+			};
+			String state = "as";
+			Set<ReactionNode> node = new HashSet<>();
+			alias.setState(state);
+			alias.setNode(node);
+
+			assertEquals(state, alias.getState());
+			assertEquals(node, alias.getNode());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/model/AliasSubmodelConnectionComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/model/AliasSubmodelConnectionComparatorTest.java
index 43c6cfbbab..aa4c4e97d7 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/model/AliasSubmodelConnectionComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/model/AliasSubmodelConnectionComparatorTest.java
@@ -1,132 +1,134 @@
-package lcsb.mapviewer.model.map.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.Color;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.Protein;
-
-public class AliasSubmodelConnectionComparatorTest {
-
-	AliasSubmodelConnectionComparator comparator = new AliasSubmodelConnectionComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() throws Exception {
-		try {
-			AliasSubmodelConnection connectionA = createConnection();
-			AliasSubmodelConnection connectionB = createConnection();
-
-			assertEquals(0, comparator.compare(new AliasSubmodelConnection(), new AliasSubmodelConnection()));
-			assertEquals(0, comparator.compare(connectionA, connectionB));
-			assertEquals(0, comparator.compare(connectionA, connectionA));
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			AliasSubmodelConnection connectionA = createConnection();
-			AliasSubmodelConnection connectionB = createConnection();
-
-			assertTrue(comparator.compare(null, connectionB) != 0);
-			assertTrue(comparator.compare(connectionA, null) != 0);
-
-			connectionA.setFromAlias(null);
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-
-			connectionA.getFromAlias().setWidth(1234567);
-
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-
-			connectionA.setToAlias(null);
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-
-			connectionA.getToAlias().setWidth(1234567);
-
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			assertTrue(comparator.compare(connectionB, new AliasSubmodelConnection() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model getModel() {
-		Model model = new ModelFullIndexed(null);
-
-		model.setNotes("Some description");
-		Protein protein = new Protein();
-		protein.setName("ad");
-		protein.setElementId("A");
-		model.addElement(protein);
-
-		SpeciesAlias alias = new SpeciesAlias(protein);
-		alias.setAliasId("a_id");
-		model.addAlias(alias);
-
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		Layer layer = new Layer();
-		layer.setName("layer name");
-		model.addLayer(layer);
-
-		model.addReaction(new Reaction());
-		return model;
-	}
-
-	private AliasSubmodelConnection createConnection() {
-		AliasSubmodelConnection result = new AliasSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS);
-		result.setName("name A");
-		result.setFromAlias(createAlias());
-		result.setToAlias(createAlias());
-		return result;
-	}
-
-	private Alias createAlias() {
-		Alias alias = new SpeciesAlias();
-		alias.setColor(Color.BLACK);
-		return alias;
-	}
-
-}
+package lcsb.mapviewer.model.map.model;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.Color;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+
+public class AliasSubmodelConnectionComparatorTest {
+
+	AliasSubmodelConnectionComparator comparator = new AliasSubmodelConnectionComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() throws Exception {
+		try {
+			AliasSubmodelConnection connectionA = createConnection();
+			AliasSubmodelConnection connectionB = createConnection();
+
+			assertEquals(0, comparator.compare(new AliasSubmodelConnection(), new AliasSubmodelConnection()));
+			assertEquals(0, comparator.compare(connectionA, connectionB));
+			assertEquals(0, comparator.compare(connectionA, connectionA));
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			AliasSubmodelConnection connectionA = createConnection();
+			AliasSubmodelConnection connectionB = createConnection();
+
+			assertTrue(comparator.compare(null, connectionB) != 0);
+			assertTrue(comparator.compare(connectionA, null) != 0);
+
+			connectionA.setFromAlias(null);
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+
+			connectionA.getFromAlias().setWidth(1234567);
+
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+
+			connectionA.setToAlias(null);
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+
+			connectionA.getToAlias().setWidth(1234567);
+
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			assertTrue(comparator.compare(connectionB, new AliasSubmodelConnection() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model getModel() {
+		Model model = new ModelFullIndexed(null);
+
+		model.setNotes("Some description");
+		GenericProtein protein = new GenericProtein();
+		protein.setName("ad");
+		protein.setElementId("A");
+		model.addElement(protein);
+
+		GenericProteinAlias alias = new GenericProteinAlias(protein);
+		alias.setAliasId("a_id");
+		model.addAlias(alias);
+
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		Layer layer = new Layer();
+		layer.setName("layer name");
+		model.addLayer(layer);
+
+		model.addReaction(new Reaction());
+		return model;
+	}
+
+	private AliasSubmodelConnection createConnection() {
+		AliasSubmodelConnection result = new AliasSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS);
+		result.setName("name A");
+		result.setFromAlias(createAlias());
+		result.setToAlias(createAlias());
+		return result;
+	}
+
+	private Alias createAlias() {
+		Alias alias = new GenericProteinAlias(new GenericProtein());
+		alias.setColor(Color.BLACK);
+		return alias;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelComparatorTest.java
index 3e8f3f7c17..a2492192d3 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelComparatorTest.java
@@ -1,566 +1,566 @@
-package lcsb.mapviewer.model.map.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-import lcsb.mapviewer.common.exception.InvalidClassException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.OverviewImage;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.graph.DataMiningSet;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ModelComparatorTest {
-	Logger					logger		 = Logger.getLogger(ModelComparatorTest.class);
-
-	ModelComparator	comparator = new ModelComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-
-			
-			assertEquals(0, comparator.compare(new ModelFullIndexed(null), new ModelFullIndexed(null)));
-			assertEquals(0, comparator.compare(model1, model2));
-			assertEquals(0, comparator.compare(model1, model1));
-			assertEquals(0, comparator.compare(null, null));
-			
-			model1.addOverviewImage(new OverviewImage());
-			model2.addOverviewImage(new OverviewImage());
-			assertEquals(0, comparator.compare(model1, model2));
-
-			model1.addDataMiningSet(new DataMiningSet());
-			model2.addDataMiningSet(new DataMiningSet());
-			assertEquals(0, comparator.compare(model1, model2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testDifferent2() {
-		try {
-			Model model1 = getModel();
-			Model model2 = Mockito.mock(Model.class);
-
-			assertTrue(comparator.compare(model1, model2)!=0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent3() {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-			
-			CompartmentAlias alias = new ArtifitialCompartmentAlias();
-			alias.setAliasId("1");
-			CompartmentAlias alias2 = new ArtifitialCompartmentAlias();
-			alias2.setAliasId("12");
-			model1.addAlias(alias);
-			model1.addAlias(alias2);
-
-			alias = new ArtifitialCompartmentAlias();
-			alias.setAliasId("1");
-			alias2 = new ArtifitialCompartmentAlias();
-			alias2.setAliasId("12");
-			model2.addAlias(alias);
-			model2.addAlias(alias2);
-			alias2.setAliasId("1");
-
-			assertTrue(comparator.compare(model1, model2)!=0);
-			assertTrue(comparator.compare(model2, model1)!=0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent4() {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-
-			Reaction reaction1 = new Reaction();
-			Reaction reaction2 = new Reaction();
-			Reaction reaction3 = new Reaction();
-			Reaction reaction4 = new Reaction();
-			reaction1.setIdReaction("a");
-			reaction2.setIdReaction("b");
-			reaction2.setIdReaction("a");
-			reaction2.setIdReaction("b");
-			
-			model1.addReaction(reaction1);
-			model1.addReaction(reaction2);
-			model2.addReaction(reaction3);
-			model2.addReaction(reaction4);
-			
-			reaction2.setIdReaction("a");
-
-			assertTrue(comparator.compare(model1, model2)!=0);
-			assertTrue(comparator.compare(model2, model1)!=0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-			
-			Species sp = new GenericProtein();
-			sp.setElementId("1");
-			model2.addElement(sp);
-			model1.getElements().add(new Element() {
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public void setElementId(String id) {
-				}
-				@Override
-				public String getElementId() {
-					return null;
-				}
-				@Override
-				public String getStringType() {
-					return null;
-				}
-				
-				@Override
-				public Element copy() {
-					return null;
-				}
-			});
-
-			comparator.compare(model1, model2);
-			fail("Exception expected");
-
-		} catch (InvalidClassException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid2() {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-			
-			Species sp = new GenericProtein();
-			sp.setElementId("1");
-			model2.addElement(sp);
-			model1.getElements().add(new Element() {
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public void setElementId(String id) {
-				}
-				@Override
-				public String getElementId() {
-					return null;
-				}
-				@Override
-				public String getStringType() {
-					return null;
-				}
-				
-				@Override
-				public Element copy() {
-					return null;
-				}
-			});
-
-			comparator.compare(model2, model1);
-			fail("Exception expected");
-
-		} catch (InvalidClassException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-
-			assertTrue(comparator.compare(model1, new ModelFullIndexed(null)) != 0);
-			assertTrue(comparator.compare(model1, null) != 0);
-			assertTrue(comparator.compare(null, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.setNotes("ASDsaD");
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			SpeciesAlias alias = new SpeciesAlias(new Protein());
-			alias.setAliasId("SAd");
-
-			model1.addAlias(alias);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.getAliases().iterator().next().setAliasId("sdfsd");
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.addCompartment(new Compartment());
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.getCompartmentByCompartmentId("default").setName("tmpxx");
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.addLayer(new Layer());
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.getLayers().iterator().next().setName("buu");
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			Protein protein = new Protein();
-			protein.setElementId("ASdas");
-			model1.addElement(protein);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.getElements().iterator().next().addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_HAS_PART, MiriamType.CHEBI, "c"));
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.addReaction(new TransportReaction());
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.getReactions().iterator().next().setName("dsf");
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.addOverviewImage(new OverviewImage());
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.setIdModel("asdsdasd");
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.setSbgnFormat(true);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.setMapVersion("asdsdasd");
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.setWidth(123);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.setHeight(636);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.setZoomLevels(1);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.setTileSize(129);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.addLayout(new Layout());
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.addDataMiningSet(new DataMiningSet());
-			DataMiningSet dms = new DataMiningSet();
-			dms.setName("x");
-			model2.addDataMiningSet(dms);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.addOverviewImage(new OverviewImage());
-			OverviewImage oi = new OverviewImage();
-			oi.setWidth(12);
-			model2.addOverviewImage(oi);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			model1 = getModel();
-			model2 = getModel();
-
-			model1.addReaction(new Reaction());
-			model2.addReaction(new Reaction());
-			Reaction reaction  = new Reaction();
-			reaction.setIdReaction("34");
-			model2.addReaction(reaction);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model getModel() {
-		Model model = new ModelFullIndexed(null);
-		;
-		model.setNotes("Some description");
-		Protein protein = new Protein();
-		protein.setName("ad");
-		protein.setElementId("A");
-		model.addElement(protein);
-
-		SpeciesAlias alias = new SpeciesAlias(protein);
-		alias.setAliasId("a_id");
-		model.addAlias(alias);
-
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		Layer layer = new Layer();
-		layer.setName("layer name");
-		model.addLayer(layer);
-		
-		model.addLayout(new Layout("1", "2", true));
-
-		model.addReaction(new Reaction());
-		return model;
-	}
-
-	@Test
-	public void testCompareSubmodels() throws Exception {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-
-			Model model3 = getModel();
-
-			ModelSubmodelConnection submodelA = new ModelSubmodelConnection(model3, SubmodelType.DOWNSTREAM_TARGETS);
-
-			model1.addSubmodelConnection(submodelA);
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			Model model4 = getModel();
-
-			ModelSubmodelConnection submodelB = new ModelSubmodelConnection(model4, SubmodelType.DOWNSTREAM_TARGETS);
-
-			model2.addSubmodelConnection(submodelB);
-
-			assertTrue(comparator.compare(model1, model2) == 0);
-
-			submodelB.setName("A");
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-			submodelB.setName(null);
-			assertTrue(comparator.compare(model1, model2) == 0);
-
-			model4.setNotes("ASdasdhsjkadhask");
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCompareSubmodels2() throws Exception {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-
-			model1.addSubmodelConnection(new ModelSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS));
-			model1.addSubmodelConnection(new ModelSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS));
-
-			model2.addSubmodelConnection(new ModelSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS));
-			model2.addSubmodelConnection(new ModelSubmodelConnection(getModel(), SubmodelType.PATHWAY));
-
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCompareName() throws Exception {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-			model1.setName("ASD");
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-			model2.setName("A");
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-			model1.setName("A");
-			assertEquals(0, comparator.compare(model1, model2));
-			assertEquals(0, comparator.compare(model2, model1));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCompareDataMiningSet() throws Exception {
-		try {
-			Model model1 = getModel();
-			Model model2 = getModel();
-			model1.addDataMiningSet(new DataMiningSet());
-			assertTrue(comparator.compare(model1, model2) != 0);
-			assertTrue(comparator.compare(model2, model1) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.model;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import lcsb.mapviewer.common.exception.InvalidClassException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.OverviewImage;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.graph.DataMiningSet;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class ModelComparatorTest {
+	Logger					logger		 = Logger.getLogger(ModelComparatorTest.class);
+
+	ModelComparator	comparator = new ModelComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+
+			
+			assertEquals(0, comparator.compare(new ModelFullIndexed(null), new ModelFullIndexed(null)));
+			assertEquals(0, comparator.compare(model1, model2));
+			assertEquals(0, comparator.compare(model1, model1));
+			assertEquals(0, comparator.compare(null, null));
+			
+			model1.addOverviewImage(new OverviewImage());
+			model2.addOverviewImage(new OverviewImage());
+			assertEquals(0, comparator.compare(model1, model2));
+
+			model1.addDataMiningSet(new DataMiningSet());
+			model2.addDataMiningSet(new DataMiningSet());
+			assertEquals(0, comparator.compare(model1, model2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testDifferent2() {
+		try {
+			Model model1 = getModel();
+			Model model2 = Mockito.mock(Model.class);
+
+			assertTrue(comparator.compare(model1, model2)!=0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent3() {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+			
+			CompartmentAlias alias = new ArtifitialCompartmentAlias();
+			alias.setAliasId("1");
+			CompartmentAlias alias2 = new ArtifitialCompartmentAlias();
+			alias2.setAliasId("12");
+			model1.addAlias(alias);
+			model1.addAlias(alias2);
+
+			alias = new ArtifitialCompartmentAlias();
+			alias.setAliasId("1");
+			alias2 = new ArtifitialCompartmentAlias();
+			alias2.setAliasId("12");
+			model2.addAlias(alias);
+			model2.addAlias(alias2);
+			alias2.setAliasId("1");
+
+			assertTrue(comparator.compare(model1, model2)!=0);
+			assertTrue(comparator.compare(model2, model1)!=0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent4() {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+
+			Reaction reaction1 = new Reaction();
+			Reaction reaction2 = new Reaction();
+			Reaction reaction3 = new Reaction();
+			Reaction reaction4 = new Reaction();
+			reaction1.setIdReaction("a");
+			reaction2.setIdReaction("b");
+			reaction2.setIdReaction("a");
+			reaction2.setIdReaction("b");
+			
+			model1.addReaction(reaction1);
+			model1.addReaction(reaction2);
+			model2.addReaction(reaction3);
+			model2.addReaction(reaction4);
+			
+			reaction2.setIdReaction("a");
+
+			assertTrue(comparator.compare(model1, model2)!=0);
+			assertTrue(comparator.compare(model2, model1)!=0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+			
+			Species sp = new GenericProtein();
+			sp.setElementId("1");
+			model2.addElement(sp);
+			model1.getElements().add(new Element() {
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public void setElementId(String id) {
+				}
+				@Override
+				public String getElementId() {
+					return null;
+				}
+				@Override
+				public String getStringType() {
+					return null;
+				}
+				
+				@Override
+				public Element copy() {
+					return null;
+				}
+			});
+
+			comparator.compare(model1, model2);
+			fail("Exception expected");
+
+		} catch (InvalidClassException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid2() {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+			
+			Species sp = new GenericProtein();
+			sp.setElementId("1");
+			model2.addElement(sp);
+			model1.getElements().add(new Element() {
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public void setElementId(String id) {
+				}
+				@Override
+				public String getElementId() {
+					return null;
+				}
+				@Override
+				public String getStringType() {
+					return null;
+				}
+				
+				@Override
+				public Element copy() {
+					return null;
+				}
+			});
+
+			comparator.compare(model2, model1);
+			fail("Exception expected");
+
+		} catch (InvalidClassException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+
+			assertTrue(comparator.compare(model1, new ModelFullIndexed(null)) != 0);
+			assertTrue(comparator.compare(model1, null) != 0);
+			assertTrue(comparator.compare(null, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.setNotes("ASDsaD");
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			SpeciesAlias alias = new GenericProteinAlias(new GenericProtein());
+			alias.setAliasId("SAd");
+
+			model1.addAlias(alias);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.getAliases().iterator().next().setAliasId("sdfsd");
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.addCompartment(new Compartment());
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.getCompartmentByCompartmentId("default").setName("tmpxx");
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.addLayer(new Layer());
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.getLayers().iterator().next().setName("buu");
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			Protein protein = new GenericProtein();
+			protein.setElementId("ASdas");
+			model1.addElement(protein);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.getElements().iterator().next().addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_HAS_PART, MiriamType.CHEBI, "c"));
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.addReaction(new TransportReaction());
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.getReactions().iterator().next().setName("dsf");
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.addOverviewImage(new OverviewImage());
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.setIdModel("asdsdasd");
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.setSbgnFormat(true);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.setMapVersion("asdsdasd");
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.setWidth(123);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.setHeight(636);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.setZoomLevels(1);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.setTileSize(129);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.addLayout(new Layout());
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.addDataMiningSet(new DataMiningSet());
+			DataMiningSet dms = new DataMiningSet();
+			dms.setName("x");
+			model2.addDataMiningSet(dms);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.addOverviewImage(new OverviewImage());
+			OverviewImage oi = new OverviewImage();
+			oi.setWidth(12);
+			model2.addOverviewImage(oi);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			model1 = getModel();
+			model2 = getModel();
+
+			model1.addReaction(new Reaction());
+			model2.addReaction(new Reaction());
+			Reaction reaction  = new Reaction();
+			reaction.setIdReaction("34");
+			model2.addReaction(reaction);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model getModel() {
+		Model model = new ModelFullIndexed(null);
+		model.setNotes("Some description");
+		GenericProtein protein = new GenericProtein();
+		protein.setName("ad");
+		protein.setElementId("A");
+		model.addElement(protein);
+
+		SpeciesAlias alias = new GenericProteinAlias(protein);
+		alias.setAliasId("a_id");
+		model.addAlias(alias);
+
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		Layer layer = new Layer();
+		layer.setName("layer name");
+		model.addLayer(layer);
+		
+		model.addLayout(new Layout("1", "2", true));
+
+		model.addReaction(new Reaction());
+		return model;
+	}
+
+	@Test
+	public void testCompareSubmodels() throws Exception {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+
+			Model model3 = getModel();
+
+			ModelSubmodelConnection submodelA = new ModelSubmodelConnection(model3, SubmodelType.DOWNSTREAM_TARGETS);
+
+			model1.addSubmodelConnection(submodelA);
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			Model model4 = getModel();
+
+			ModelSubmodelConnection submodelB = new ModelSubmodelConnection(model4, SubmodelType.DOWNSTREAM_TARGETS);
+
+			model2.addSubmodelConnection(submodelB);
+
+			assertTrue(comparator.compare(model1, model2) == 0);
+
+			submodelB.setName("A");
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+			submodelB.setName(null);
+			assertTrue(comparator.compare(model1, model2) == 0);
+
+			model4.setNotes("ASdasdhsjkadhask");
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCompareSubmodels2() throws Exception {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+
+			model1.addSubmodelConnection(new ModelSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS));
+			model1.addSubmodelConnection(new ModelSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS));
+
+			model2.addSubmodelConnection(new ModelSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS));
+			model2.addSubmodelConnection(new ModelSubmodelConnection(getModel(), SubmodelType.PATHWAY));
+
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCompareName() throws Exception {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+			model1.setName("ASD");
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+			model2.setName("A");
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+			model1.setName("A");
+			assertEquals(0, comparator.compare(model1, model2));
+			assertEquals(0, comparator.compare(model2, model1));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCompareDataMiningSet() throws Exception {
+		try {
+			Model model1 = getModel();
+			Model model2 = getModel();
+			model1.addDataMiningSet(new DataMiningSet());
+			assertTrue(comparator.compare(model1, model2) != 0);
+			assertTrue(comparator.compare(model2, model1) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelDataTest.java b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelDataTest.java
index 6c82ad08f0..83a168232d 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelDataTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelDataTest.java
@@ -1,454 +1,454 @@
-package lcsb.mapviewer.model.map.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.OverviewImage;
-import lcsb.mapviewer.model.map.graph.DataMiningSet;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.BlockDiagram;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ModelDataTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new ModelData());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddAliases() {
-		try {
-			ModelData md = new ModelData();
-			List<Alias> aliases = new ArrayList<>();
-			aliases.add(new SpeciesAlias());
-			md.addAliases(aliases);
-			assertEquals(1, md.getAliases().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddReactions() {
-		try {
-			ModelData md = new ModelData();
-			List<Reaction> aliases = new ArrayList<>();
-			aliases.add(new Reaction());
-			md.addReactions(aliases);
-			assertEquals(1, md.getReactions().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddLayers() {
-		try {
-			ModelData md = new ModelData();
-			List<Layer> aliases = new ArrayList<>();
-			aliases.add(new Layer());
-			md.addLayers(aliases);
-			assertEquals(1, md.getLayers().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddAliasGroup() {
-		try {
-			ModelData md = new ModelData();
-			md.addAliasGroup(null);
-			// not implemented for now
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddBlockDiagram() {
-		try {
-			ModelData md = new ModelData();
-			md.addBlockDiagream(new BlockDiagram() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			});
-			// not implemented for now
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddRemoveLayout() {
-		try {
-			ModelData md = new ModelData();
-			Layout l = new Layout();
-			l.setId(3);
-			md.addLayout(l);
-			assertEquals(1, md.getLayouts().size());
-			md.removeLayout(new Layout());
-			assertEquals(1, md.getLayouts().size());
-			md.removeLayout(l);
-			assertEquals(0, md.getLayouts().size());
-			md.addLayout(0, l);
-			assertEquals(1, md.getLayouts().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveAlias1() {
-		try {
-			ModelData md = new ModelData();
-			md.removeAlias(null);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveAlias2() {
-		try {
-			ModelData md = new ModelData();
-			md.removeAlias(new SpeciesAlias());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveAlias3() {
-		try {
-			ModelData md = new ModelData();
-			Alias alias = new SpeciesAlias();
-			md.addAlias(alias);
-			assertEquals(1, md.getAliases().size());
-			md.removeAlias(alias);
-			assertEquals(0, md.getAliases().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveElement2() {
-		try {
-			ModelData md = new ModelData();
-			md.removeElement(new Species());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveElement3() {
-		try {
-			ModelData md = new ModelData();
-			Element alias = new Species();
-			md.addElement(alias);
-			assertEquals(1, md.getElements().size());
-			md.removeElement(alias);
-			assertEquals(0, md.getElements().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveReaction2() {
-		try {
-			ModelData md = new ModelData();
-			md.removeReaction(new Reaction());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveReaction3() {
-		try {
-			ModelData md = new ModelData();
-			Reaction alias = new Reaction();
-			md.addReaction(alias);
-			assertEquals(1, md.getReactions().size());
-			md.removeReaction(alias);
-			assertEquals(0, md.getReactions().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddCreationWarning() {
-		try {
-			ModelData md = new ModelData();
-			md.addCreationWarning("text\ntext");
-
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddCreationWarning2() {
-		try {
-			ModelData md = new ModelData();
-			md.addCreationWarning("");
-			List<String> warnings = md.getCreationWarnings();
-			assertEquals(0, warnings.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddCreationWarning3() {
-		try {
-			ModelData md = new ModelData();
-			md.addCreationWarning("xqw");
-			List<String> warnings = md.getCreationWarnings();
-			assertEquals(1, warnings.size());
-			assertEquals("xqw", warnings.get(0));
-
-			md.addCreationWarning("WER");
-			warnings = md.getCreationWarnings();
-			assertEquals(2, warnings.size());
-			assertEquals("WER", warnings.get(1));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddCreationWarnings() {
-		try {
-			List<String> warnings = new ArrayList<>();
-			warnings.add("xqw");
-			warnings.add("aso");
-			warnings.add("");
-			ModelData md = new ModelData();
-			md.addCreationWarnings(warnings);
-
-			md.addCreationWarning("WER");
-			warnings = md.getCreationWarnings();
-			assertEquals(3, warnings.size());
-			assertEquals("aso", warnings.get(1));
-
-			md.addCreationWarnings(warnings);
-			warnings = md.getCreationWarnings();
-			assertEquals(6, warnings.size());
-			assertEquals("aso", warnings.get(1));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddCreationWarnings2() {
-		try {
-			List<String> warnings = new ArrayList<>();
-			warnings.add("xqw\nwer\nt");
-			ModelData md = new ModelData();
-			md.addCreationWarnings(warnings);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddCreationWarnings3() {
-		try {
-			List<String> warnings = new ArrayList<>();
-			ModelData md = new ModelData();
-			md.addCreationWarnings(warnings);
-			assertEquals(0, md.getCreationWarnings().size());
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddSubmodel() {
-		try {
-			ModelData md = new ModelData();
-			md.addSubmodel(new ModelSubmodelConnection());
-			assertEquals(1, md.getSubmodels().size());
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			ModelData md = new ModelData();
-			Set<Alias> aliases = new HashSet<>();
-			Set<Element> elements = new HashSet<>();
-			List<Layout> layouts = new ArrayList<>();
-			Set<Layer> layers = new HashSet<>();
-			Set<Reaction> reactions = new HashSet<>();
-			Set<SubmodelConnection> parents= new HashSet<>();
-			List<OverviewImage> overviewImages= new ArrayList<>();
-			overviewImages.add(new OverviewImage());
-			List<DataMiningSet> dataMiningSets= new ArrayList<>();
-			Integer id = 95;
-			int width = 2;
-			Double widthDouble = 2.0;
-			int height = 29;
-			int zoomLevels = 3;
-			int tileSize = 512;
-			String modelId = "modId";
-			String email = "a@b.cc";
-			String mapVersion = "1.2.6";
-			String notes = "nOT";
-			String name = "n_ma";
-			boolean sbgnFormat = true;
-			Double heightDouble = 29.0;
-			Project project = new Project();
-			Calendar creationDate = Calendar.getInstance();
-
-			Model model = new ModelFullIndexed(null);
-
-			md.setId(id);
-			assertEquals(id, md.getId());
-
-			md.setAliases(aliases);
-			assertEquals(aliases, md.getAliases());
-
-			md.setElements(elements);
-			assertEquals(elements, md.getElements());
-
-			md.setProject(project);
-			assertEquals(project, md.getProject());
-
-			md.setCreationDate(creationDate);
-			assertEquals(creationDate, md.getCreationDate());
-
-			md.setLayouts(layouts);
-			assertEquals(layouts, md.getLayouts());
-
-			md.setWidth(width);
-			assertEquals(widthDouble, md.getWidth(), Configuration.EPSILON);
-
-			md.setHeight(height);
-			assertEquals(heightDouble, md.getHeight(), Configuration.EPSILON);
-
-			md.setZoomLevels(zoomLevels);
-			assertEquals(zoomLevels, md.getZoomLevels());
-
-			md.setTileSize(tileSize);
-			assertEquals(tileSize, md.getTileSize());
-
-			md.setIdModel(modelId);
-			assertEquals(modelId, md.getIdModel());
-
-			md.setNotifyEmail(email);
-			assertEquals(email, md.getNotifyEmail());
-
-			md.setNotes(notes);
-			assertEquals(notes, md.getNotes());
-
-			md.setMapVersion(mapVersion);
-			assertEquals(mapVersion, md.getMapVersion());
-
-			md.setSbgnFormat(sbgnFormat);
-			assertEquals(sbgnFormat, md.isSbgnFormat());
-
-			md.setName(name);
-			assertEquals(name, md.getName());
-
-			md.setModel(null);
-			assertNull(md.getModel());
-			md.setModel(model);
-			assertEquals(model, md.getModel());
-
-			md.setLayers(layers);
-			assertEquals(layers, md.getLayers());
-
-			md.setReactions(reactions);
-			assertEquals(reactions, md.getReactions());
-
-			md.setParentModels(parents);
-			assertEquals(parents, md.getParentModels());
-
-			md.setOverviewImages(overviewImages);
-			assertEquals(overviewImages, md.getOverviewImages());
-
-			md.setDataMiningSets(dataMiningSets);
-			assertEquals(dataMiningSets, md.getDataMiningSets());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.map.model;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.OverviewImage;
+import lcsb.mapviewer.model.map.graph.DataMiningSet;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.BlockDiagram;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class ModelDataTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new ModelData());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddAliases() {
+		try {
+			ModelData md = new ModelData();
+			List<Alias> aliases = new ArrayList<>();
+			aliases.add(new GenericProteinAlias(null, null));
+			md.addAliases(aliases);
+			assertEquals(1, md.getAliases().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddReactions() {
+		try {
+			ModelData md = new ModelData();
+			List<Reaction> aliases = new ArrayList<>();
+			aliases.add(new Reaction());
+			md.addReactions(aliases);
+			assertEquals(1, md.getReactions().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddLayers() {
+		try {
+			ModelData md = new ModelData();
+			List<Layer> aliases = new ArrayList<>();
+			aliases.add(new Layer());
+			md.addLayers(aliases);
+			assertEquals(1, md.getLayers().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddAliasGroup() {
+		try {
+			ModelData md = new ModelData();
+			md.addAliasGroup(null);
+			// not implemented for now
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddBlockDiagram() {
+		try {
+			ModelData md = new ModelData();
+			md.addBlockDiagream(new BlockDiagram() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			});
+			// not implemented for now
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddRemoveLayout() {
+		try {
+			ModelData md = new ModelData();
+			Layout l = new Layout();
+			l.setId(3);
+			md.addLayout(l);
+			assertEquals(1, md.getLayouts().size());
+			md.removeLayout(new Layout());
+			assertEquals(1, md.getLayouts().size());
+			md.removeLayout(l);
+			assertEquals(0, md.getLayouts().size());
+			md.addLayout(0, l);
+			assertEquals(1, md.getLayouts().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveAlias1() {
+		try {
+			ModelData md = new ModelData();
+			md.removeAlias(null);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveAlias2() {
+		try {
+			ModelData md = new ModelData();
+			md.removeAlias(new GenericProteinAlias(null, null));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveAlias3() {
+		try {
+			ModelData md = new ModelData();
+			Alias alias = new GenericProteinAlias(null, null);
+			md.addAlias(alias);
+			assertEquals(1, md.getAliases().size());
+			md.removeAlias(alias);
+			assertEquals(0, md.getAliases().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveElement2() {
+		try {
+			ModelData md = new ModelData();
+			md.removeElement(new Species());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveElement3() {
+		try {
+			ModelData md = new ModelData();
+			Element alias = new Species();
+			md.addElement(alias);
+			assertEquals(1, md.getElements().size());
+			md.removeElement(alias);
+			assertEquals(0, md.getElements().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveReaction2() {
+		try {
+			ModelData md = new ModelData();
+			md.removeReaction(new Reaction());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveReaction3() {
+		try {
+			ModelData md = new ModelData();
+			Reaction alias = new Reaction();
+			md.addReaction(alias);
+			assertEquals(1, md.getReactions().size());
+			md.removeReaction(alias);
+			assertEquals(0, md.getReactions().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddCreationWarning() {
+		try {
+			ModelData md = new ModelData();
+			md.addCreationWarning("text\ntext");
+
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddCreationWarning2() {
+		try {
+			ModelData md = new ModelData();
+			md.addCreationWarning("");
+			List<String> warnings = md.getCreationWarnings();
+			assertEquals(0, warnings.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddCreationWarning3() {
+		try {
+			ModelData md = new ModelData();
+			md.addCreationWarning("xqw");
+			List<String> warnings = md.getCreationWarnings();
+			assertEquals(1, warnings.size());
+			assertEquals("xqw", warnings.get(0));
+
+			md.addCreationWarning("WER");
+			warnings = md.getCreationWarnings();
+			assertEquals(2, warnings.size());
+			assertEquals("WER", warnings.get(1));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddCreationWarnings() {
+		try {
+			List<String> warnings = new ArrayList<>();
+			warnings.add("xqw");
+			warnings.add("aso");
+			warnings.add("");
+			ModelData md = new ModelData();
+			md.addCreationWarnings(warnings);
+
+			md.addCreationWarning("WER");
+			warnings = md.getCreationWarnings();
+			assertEquals(3, warnings.size());
+			assertEquals("aso", warnings.get(1));
+
+			md.addCreationWarnings(warnings);
+			warnings = md.getCreationWarnings();
+			assertEquals(6, warnings.size());
+			assertEquals("aso", warnings.get(1));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddCreationWarnings2() {
+		try {
+			List<String> warnings = new ArrayList<>();
+			warnings.add("xqw\nwer\nt");
+			ModelData md = new ModelData();
+			md.addCreationWarnings(warnings);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddCreationWarnings3() {
+		try {
+			List<String> warnings = new ArrayList<>();
+			ModelData md = new ModelData();
+			md.addCreationWarnings(warnings);
+			assertEquals(0, md.getCreationWarnings().size());
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddSubmodel() {
+		try {
+			ModelData md = new ModelData();
+			md.addSubmodel(new ModelSubmodelConnection());
+			assertEquals(1, md.getSubmodels().size());
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			ModelData md = new ModelData();
+			Set<Alias> aliases = new HashSet<>();
+			Set<Element> elements = new HashSet<>();
+			List<Layout> layouts = new ArrayList<>();
+			Set<Layer> layers = new HashSet<>();
+			Set<Reaction> reactions = new HashSet<>();
+			Set<SubmodelConnection> parents = new HashSet<>();
+			List<OverviewImage> overviewImages = new ArrayList<>();
+			overviewImages.add(new OverviewImage());
+			List<DataMiningSet> dataMiningSets = new ArrayList<>();
+			Integer id = 95;
+			int width = 2;
+			Double widthDouble = 2.0;
+			int height = 29;
+			int zoomLevels = 3;
+			int tileSize = 512;
+			String modelId = "modId";
+			String email = "a@b.cc";
+			String mapVersion = "1.2.6";
+			String notes = "nOT";
+			String name = "n_ma";
+			boolean sbgnFormat = true;
+			Double heightDouble = 29.0;
+			Project project = new Project();
+			Calendar creationDate = Calendar.getInstance();
+
+			Model model = new ModelFullIndexed(null);
+
+			md.setId(id);
+			assertEquals(id, md.getId());
+
+			md.setAliases(aliases);
+			assertEquals(aliases, md.getAliases());
+
+			md.setElements(elements);
+			assertEquals(elements, md.getElements());
+
+			md.setProject(project);
+			assertEquals(project, md.getProject());
+
+			md.setCreationDate(creationDate);
+			assertEquals(creationDate, md.getCreationDate());
+
+			md.setLayouts(layouts);
+			assertEquals(layouts, md.getLayouts());
+
+			md.setWidth(width);
+			assertEquals(widthDouble, md.getWidth(), Configuration.EPSILON);
+
+			md.setHeight(height);
+			assertEquals(heightDouble, md.getHeight(), Configuration.EPSILON);
+
+			md.setZoomLevels(zoomLevels);
+			assertEquals(zoomLevels, md.getZoomLevels());
+
+			md.setTileSize(tileSize);
+			assertEquals(tileSize, md.getTileSize());
+
+			md.setIdModel(modelId);
+			assertEquals(modelId, md.getIdModel());
+
+			md.setNotifyEmail(email);
+			assertEquals(email, md.getNotifyEmail());
+
+			md.setNotes(notes);
+			assertEquals(notes, md.getNotes());
+
+			md.setMapVersion(mapVersion);
+			assertEquals(mapVersion, md.getMapVersion());
+
+			md.setSbgnFormat(sbgnFormat);
+			assertEquals(sbgnFormat, md.isSbgnFormat());
+
+			md.setName(name);
+			assertEquals(name, md.getName());
+
+			md.setModel(null);
+			assertNull(md.getModel());
+			md.setModel(model);
+			assertEquals(model, md.getModel());
+
+			md.setLayers(layers);
+			assertEquals(layers, md.getLayers());
+
+			md.setReactions(reactions);
+			assertEquals(reactions, md.getReactions());
+
+			md.setParentModels(parents);
+			assertEquals(parents, md.getParentModels());
+
+			md.setOverviewImages(overviewImages);
+			assertEquals(overviewImages, md.getOverviewImages());
+
+			md.setDataMiningSets(dataMiningSets);
+			assertEquals(dataMiningSets, md.getDataMiningSets());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelFullIndexedTest.java b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelFullIndexedTest.java
index 0f5f9f0033..90a240bf3e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelFullIndexedTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelFullIndexedTest.java
@@ -36,6 +36,7 @@ import lcsb.mapviewer.model.map.layout.alias.Alias;
 import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
 import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
 import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.layout.graphics.Layer;
 import lcsb.mapviewer.model.map.reaction.Product;
@@ -63,15 +64,15 @@ public class ModelFullIndexedTest {
 	public void testConstructor() {
 		try {
 			ModelFullIndexed model = new ModelFullIndexed(null);
-			Protein protein = new GenericProtein();
+			GenericProtein protein = new GenericProtein();
 			protein.setElementId("1");
-			Protein protein2 = new GenericProtein();
+			GenericProtein protein2 = new GenericProtein();
 			protein2.setElementId("a");
-			SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+			SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 			proteinAlias.setAliasId("1a");
-			SpeciesAlias proteinAlias2 = new SpeciesAlias(protein2);
+			SpeciesAlias proteinAlias2 = new GenericProteinAlias(protein2);
 			proteinAlias2.setAliasId("f");
-			SpeciesAlias proteinAlias3 = new SpeciesAlias(protein2);
+			SpeciesAlias proteinAlias3 = new GenericProteinAlias(protein2);
 			proteinAlias3.setAliasId("fa");
 
 			Compartment compartment = new Compartment();
@@ -274,7 +275,7 @@ public class ModelFullIndexedTest {
 		try {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
-			SpeciesAlias alias = new SpeciesAlias();
+			SpeciesAlias alias = new GenericProteinAlias(null, null);
 
 			model.addAlias(alias);
 
@@ -292,8 +293,7 @@ public class ModelFullIndexedTest {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
 			Protein protein = new GenericProtein();
-			SpeciesAlias alias = new ComplexAlias();
-			alias.setAliasId("1");
+			SpeciesAlias alias = new ComplexAlias("1");
 			alias.setSpecies(protein);
 
 			model.addAlias(alias);
@@ -312,7 +312,7 @@ public class ModelFullIndexedTest {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
 			ComplexSpecies protein = new ComplexSpecies();
-			SpeciesAlias alias = new SpeciesAlias();
+			SpeciesAlias alias = new GenericProteinAlias("1", null);
 			alias.setAliasId("1");
 			alias.setSpecies(protein);
 
@@ -331,7 +331,7 @@ public class ModelFullIndexedTest {
 		try {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
-			SpeciesAlias alias = new SpeciesAlias();
+			SpeciesAlias alias = new GenericProteinAlias(null, null);
 			alias.setAliasId("1");
 
 			model.addAlias(alias);
@@ -350,9 +350,8 @@ public class ModelFullIndexedTest {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
 			ComplexSpecies protein = new ComplexSpecies();
-			ComplexAlias alias = new ComplexAlias();
+			ComplexAlias alias = new ComplexAlias(protein);
 			alias.setAliasId("1");
-			alias.setSpecies(protein);
 
 			model.addAlias(alias);
 			try {
@@ -373,13 +372,12 @@ public class ModelFullIndexedTest {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
 			ComplexSpecies complex = new ComplexSpecies();
-			ComplexAlias alias = new ComplexAlias();
+			ComplexAlias alias = new ComplexAlias(complex);
 			alias.setAliasId("1");
-			alias.setSpecies(complex);
 
-			Species protein = new GenericProtein();
+			GenericProtein protein = new GenericProtein();
 			protein.setElementId("asd");
-			Alias proteinAlias = new SpeciesAlias();
+			Alias proteinAlias = new GenericProteinAlias(protein);
 			proteinAlias.setAliasId("zz");
 			proteinAlias.setElement(protein);
 			proteinAlias.setParent(alias);
@@ -418,14 +416,13 @@ public class ModelFullIndexedTest {
 			};
 
 			ComplexSpecies complex = new ComplexSpecies();
-			ComplexAlias alias = new ComplexAlias();
+			ComplexAlias alias = new ComplexAlias(complex);
 			alias.setAliasId("1");
-			alias.setSpecies(complex);
 			alias.setParent(parentAlias);
 
-			Species protein = new GenericProtein();
+			GenericProtein protein = new GenericProtein();
 			protein.setElementId("asd");
-			Alias proteinAlias = new SpeciesAlias();
+			Alias proteinAlias = new GenericProteinAlias(protein);
 			proteinAlias.setAliasId("zz");
 			proteinAlias.setElement(protein);
 			proteinAlias.setParent(alias);
@@ -447,9 +444,9 @@ public class ModelFullIndexedTest {
 		try {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
-			Species species = new Species();
+			GenericProtein species = new GenericProtein();
 			species.setElementId("xx");
-			SpeciesAlias alias = new SpeciesAlias();
+			SpeciesAlias alias = new GenericProteinAlias(species);
 			alias.setAliasId("1");
 			alias.setSpecies(species);
 
@@ -487,13 +484,12 @@ public class ModelFullIndexedTest {
 			model.addCompartment(defaultC);
 
 			ComplexSpecies complex = new ComplexSpecies();
-			ComplexAlias alias = new ComplexAlias();
+			ComplexAlias alias = new ComplexAlias(complex);
 			alias.setAliasId("1");
-			alias.setSpecies(complex);
 
-			Species protein = new GenericProtein();
+			GenericProtein protein = new GenericProtein();
 			protein.setElementId("asd");
-			Alias proteinAlias = new SpeciesAlias();
+			Alias proteinAlias = new GenericProteinAlias(protein);
 			proteinAlias.setAliasId("zz");
 			proteinAlias.setElement(protein);
 			proteinAlias.setParent(alias);
@@ -523,14 +519,13 @@ public class ModelFullIndexedTest {
 			model.addAlias(compAlias);
 
 			ComplexSpecies complex = new ComplexSpecies();
-			ComplexAlias alias = new ComplexAlias();
+			ComplexAlias alias = new ComplexAlias(complex);
 			alias.setAliasId("1");
-			alias.setSpecies(complex);
 			alias.setParent(compAlias);
 
-			Species protein = new GenericProtein();
+			GenericProtein protein = new GenericProtein();
 			protein.setElementId("asd");
-			Alias proteinAlias = new SpeciesAlias();
+			Alias proteinAlias = new GenericProteinAlias(protein);
 			proteinAlias.setAliasId("zz");
 			proteinAlias.setElement(protein);
 			proteinAlias.setParent(alias);
@@ -553,9 +548,9 @@ public class ModelFullIndexedTest {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
 			assertNull(model.getAliasByAliasId("id"));
-			Species protein = new GenericProtein();
+			GenericProtein protein = new GenericProtein();
 			protein.setElementId("asd");
-			SpeciesAlias alias = new SpeciesAlias();
+			SpeciesAlias alias = new GenericProteinAlias(protein);
 			alias.setAliasId("id");
 			alias.setSpecies(protein);
 
@@ -574,8 +569,7 @@ public class ModelFullIndexedTest {
 		try {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
-			SpeciesAlias alias = new ComplexAlias();
-			alias.setAliasId("1");
+			SpeciesAlias alias = new ComplexAlias("1");
 
 			model.addAlias(alias);
 			fail("Exception expected");
@@ -669,7 +663,7 @@ public class ModelFullIndexedTest {
 		try {
 			int aliasId = 12;
 			ModelFullIndexed model = new ModelFullIndexed(null);
-			Alias alias = new SpeciesAlias(new Species());
+			Alias alias = new GenericProteinAlias(new GenericProtein());
 			alias.setAliasId("1");
 			alias.setId(aliasId);
 			assertNull(model.getAliasByDbId(aliasId));
@@ -760,7 +754,7 @@ public class ModelFullIndexedTest {
 			cAlias.setWidth(10);
 			cAlias.setHeight(10);
 
-			SpeciesAlias sAlias = new SpeciesAlias("a1");
+			SpeciesAlias sAlias = new GenericProteinAlias("a1",null);
 			Species species = new GenericProtein();
 			species.setElementId("s1");
 			sAlias.setSpecies(species);
@@ -833,7 +827,7 @@ public class ModelFullIndexedTest {
 
 			assertEquals(1, model.getAliases().size());
 
-			alias.setComplexAlias(new ComplexAlias());
+			alias.setComplexAlias(new ComplexAlias("xxx"));
 
 			model.removeAlias(alias);
 			assertEquals(0, model.getAliases().size());
@@ -876,7 +870,7 @@ public class ModelFullIndexedTest {
 		try {
 			ModelFullIndexed model = new ModelFullIndexed(null);
 
-			Alias alias = new SpeciesAlias();
+			Alias alias = new GenericProteinAlias(null,null);
 			alias.setParent(new Alias() {
 
 				/**
@@ -1207,9 +1201,9 @@ public class ModelFullIndexedTest {
 	public void testGetAliasesForElement() {
 		try {
 			ModelFullIndexed model = new ModelFullIndexed(null);
-			Species species = new GenericProtein();
+			GenericProtein species = new GenericProtein();
 			species.setElementId("1");
-			Alias alias = new SpeciesAlias(species);
+			Alias alias = new GenericProteinAlias(species);
 			alias.setAliasId("2");
 			model.addAlias(alias);
 			model.addElement(species);
@@ -1457,9 +1451,10 @@ public class ModelFullIndexedTest {
 			Reaction reaction = new Reaction();
 			reaction.setIdReaction(reactionId);
 			model.addReaction(reaction);
-			Species species =new Species("s"); 
+			GenericProtein species = new GenericProtein();
+			species.setElementId("s");
 			model.addElement(species);
-			SpeciesAlias alias = new SpeciesAlias(species);
+			SpeciesAlias alias = new GenericProteinAlias(species);
 			alias.setAliasId("2");
 			model.addAlias(alias);
 
@@ -1483,7 +1478,7 @@ public class ModelFullIndexedTest {
 			LoggingEvent event = appender.getWarnings().get(0);
 			appender.getWarnings().add(new LoggingEvent("St", event.getLogger(), null, new Object(), null));
 			logger.removeAppender(appender);
-			
+
 			model.addLoggingInfo(appender);
 			assertEquals(2, model.getCreationWarnings().size());
 
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelSubmodelConnectionComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelSubmodelConnectionComparatorTest.java
index 9e0bd279fa..ac9608f521 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelSubmodelConnectionComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelSubmodelConnectionComparatorTest.java
@@ -1,115 +1,116 @@
-package lcsb.mapviewer.model.map.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.Protein;
-
-public class ModelSubmodelConnectionComparatorTest {
-
-	ModelSubmodelConnectionComparator comparator = new ModelSubmodelConnectionComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() throws Exception {
-		try {
-			ModelSubmodelConnection connectionA = createConnection();
-			ModelSubmodelConnection connectionB = createConnection();
-
-			assertEquals(0, comparator.compare(new ModelSubmodelConnection(), new ModelSubmodelConnection()));
-			assertEquals(0, comparator.compare(connectionA, connectionB));
-			assertEquals(0, comparator.compare(connectionA, connectionA));
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			ModelSubmodelConnection connectionA = createConnection();
-			ModelSubmodelConnection connectionB = createConnection();
-
-			assertTrue(comparator.compare(null, connectionB) != 0);
-			assertTrue(comparator.compare(connectionA, null) != 0);
-
-			connectionA.getParentModel().setNotes("QQWECS");
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-
-			connectionA.setParentModel((ModelData) null);
-
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-
-			connectionA.setType(SubmodelType.UNKNOWN);
-
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			assertTrue(comparator.compare(connectionB, new ModelSubmodelConnection() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model getModel() {
-		Model model = new ModelFullIndexed(null);
-
-		model.setNotes("Some description");
-		Protein protein = new Protein();
-		protein.setName("ad");
-		protein.setElementId("A");
-		model.addElement(protein);
-
-		SpeciesAlias alias = new SpeciesAlias(protein);
-		alias.setAliasId("a_id");
-		model.addAlias(alias);
-
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		Layer layer = new Layer();
-		layer.setName("layer name");
-		model.addLayer(layer);
-
-		model.addReaction(new Reaction());
-		return model;
-	}
-
-	private ModelSubmodelConnection createConnection() {
-		ModelSubmodelConnection result = new ModelSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS);
-		result.setName("name A");
-		result.setParentModel(getModel());
-		return result;
-	}
-
-}
+package lcsb.mapviewer.model.map.model;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class ModelSubmodelConnectionComparatorTest {
+
+	ModelSubmodelConnectionComparator comparator = new ModelSubmodelConnectionComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() throws Exception {
+		try {
+			ModelSubmodelConnection connectionA = createConnection();
+			ModelSubmodelConnection connectionB = createConnection();
+
+			assertEquals(0, comparator.compare(new ModelSubmodelConnection(), new ModelSubmodelConnection()));
+			assertEquals(0, comparator.compare(connectionA, connectionB));
+			assertEquals(0, comparator.compare(connectionA, connectionA));
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			ModelSubmodelConnection connectionA = createConnection();
+			ModelSubmodelConnection connectionB = createConnection();
+
+			assertTrue(comparator.compare(null, connectionB) != 0);
+			assertTrue(comparator.compare(connectionA, null) != 0);
+
+			connectionA.getParentModel().setNotes("QQWECS");
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+
+			connectionA.setParentModel((ModelData) null);
+
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+
+			connectionA.setType(SubmodelType.UNKNOWN);
+
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			assertTrue(comparator.compare(connectionB, new ModelSubmodelConnection() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model getModel() {
+		Model model = new ModelFullIndexed(null);
+
+		model.setNotes("Some description");
+		GenericProtein protein = new GenericProtein();
+		protein.setName("ad");
+		protein.setElementId("A");
+		model.addElement(protein);
+
+		SpeciesAlias alias = new GenericProteinAlias(protein);
+		alias.setAliasId("a_id");
+		model.addAlias(alias);
+
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		Layer layer = new Layer();
+		layer.setName("layer name");
+		model.addLayer(layer);
+
+		model.addReaction(new Reaction());
+		return model;
+	}
+
+	private ModelSubmodelConnection createConnection() {
+		ModelSubmodelConnection result = new ModelSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS);
+		result.setName("name A");
+		result.setParentModel(getModel());
+		return result;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelTest.java b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelTest.java
index 3c52371d25..cd1df6ab5c 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/model/ModelTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/model/ModelTest.java
@@ -9,6 +9,11 @@ import static org.junit.Assert.fail;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.model.map.AnnotatedObject;
 import lcsb.mapviewer.model.map.MiriamData;
@@ -18,22 +23,19 @@ import lcsb.mapviewer.model.map.agregator.Compartment;
 import lcsb.mapviewer.model.map.layout.alias.Alias;
 import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
 import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
 import lcsb.mapviewer.model.map.layout.graphics.Layer;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.Protein;
 import lcsb.mapviewer.model.map.species.Species;
 
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
 public class ModelTest {
 	Logger										logger	= Logger.getLogger(ModelTest.class);
 
-	private Protein						species;
+	private GenericProtein						species;
 	private SpeciesAlias			alias;
 
 	private ComplexSpecies		cSpecies;
@@ -46,15 +48,14 @@ public class ModelTest {
 	public void setUp() throws Exception {
 		model = new ModelFullIndexed(null);
 
-		species = new Protein();
+		species = new GenericProtein();
 		species.setElementId("s1");
-		alias = new SpeciesAlias(species);
+		alias = new GenericProteinAlias(species);
 		alias.setAliasId("sa1");
 
 		cSpecies = new ComplexSpecies(new ComplexSpecies());
 		cSpecies.setElementId("s2");
-		cAlias = new ComplexAlias();
-		cAlias.setSpecies(cSpecies);
+		cAlias = new ComplexAlias(cSpecies);
 		cAlias.setAliasId("sa2");
 
 		compartment = new Compartment();
@@ -167,7 +168,7 @@ public class ModelTest {
 	@Test
 	public void testAddSpecies2() throws Exception {
 		try {
-			Species species2 = new Protein();
+			Species species2 = new GenericProtein();
 			try {
 				model.addElement(species2);
 				fail("Exception expected");
@@ -283,39 +284,39 @@ public class ModelTest {
 	private Model createModel() {
 		Model model = new ModelFullIndexed(null);
 
-		Protein protein = new Protein();
+		GenericProtein protein = new GenericProtein();
 		protein.setElementId("s1");
 		protein.setName("s1");
 		
 		model.addElement(protein);
-		SpeciesAlias proteinAlias = new SpeciesAlias(protein);
+		SpeciesAlias proteinAlias = new GenericProteinAlias(protein);
 		proteinAlias.setAliasId("sa1");
 		model.addAlias(proteinAlias);
 
-		Protein protein2 = new Protein();
+		GenericProtein protein2 = new GenericProtein();
 		protein2.setElementId("s2");
 		protein2.setName("s1");
 
 		model.addElement(protein2);
-		SpeciesAlias proteinAlias2 = new SpeciesAlias(protein2);
+		SpeciesAlias proteinAlias2 = new GenericProteinAlias(protein2);
 		proteinAlias2.setAliasId("sa2");
 		model.addAlias(proteinAlias2);
 
-		Protein protein3 = new Protein();
+		GenericProtein protein3 = new GenericProtein();
 		protein3.setElementId("s3");
 		protein3.setName("s1");
 		model.addElement(protein3);
 		
-		SpeciesAlias proteinAlias3 = new SpeciesAlias(protein3);
+		SpeciesAlias proteinAlias3 = new GenericProteinAlias(protein3);
 		proteinAlias3.setAliasId("sa3");
 		model.addAlias(proteinAlias3);
 
-		Protein protein4 = new Protein();
+		GenericProtein protein4 = new GenericProtein();
 		protein4.setElementId("s5");
 		protein4.setName("s5");
 		protein4.addMiriamData(new MiriamData(MiriamRelationType.BQ_MODEL_IS, MiriamType.CHEMBL_TARGET, "CHEMBL12345"));
 		
-		SpeciesAlias proteinAlias4 = new SpeciesAlias(protein4);
+		SpeciesAlias proteinAlias4 = new GenericProteinAlias(protein4);
 		proteinAlias4.setAliasId("sa4");
 		model.addAlias(proteinAlias4);
 
@@ -339,23 +340,23 @@ public class ModelTest {
 		try {
 			Model model = new ModelFullIndexed(null);
 			
-			Protein protein = new Protein();
+			GenericProtein protein = new GenericProtein();
 			protein.setElementId("1");
 			model.addElement(protein);
 
-			SpeciesAlias alias = new SpeciesAlias(protein);
+			SpeciesAlias alias = new GenericProteinAlias(protein);
 			alias.setAliasId("2");
 			alias.setWidth(100);
 			alias.setHeight(100);
 			model.addAlias(alias);
 
-			alias = new SpeciesAlias(protein);
+			alias = new GenericProteinAlias(protein);
 			alias.setAliasId("3");
 			alias.setWidth(10);
 			alias.setHeight(10);
 			model.addAlias(alias);
 
-			alias = new SpeciesAlias(protein);
+			alias = new GenericProteinAlias(protein);
 			alias.setAliasId("4");
 			alias.setWidth(200);
 			alias.setHeight(100);
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/model/SubmodelConnectionComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/model/SubmodelConnectionComparatorTest.java
index 7cdb1f53a0..a1ae6a21ce 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/model/SubmodelConnectionComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/model/SubmodelConnectionComparatorTest.java
@@ -1,193 +1,194 @@
-package lcsb.mapviewer.model.map.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.Protein;
-
-public class SubmodelConnectionComparatorTest {
-
-	SubmodelConnectionComparator comparator = new SubmodelConnectionComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() throws Exception {
-		try {
-			SubmodelConnection connectionA = createConnection();
-			SubmodelConnection connectionB = createConnection();
-
-			assertEquals(0, comparator.compare(new AliasSubmodelConnection(), new AliasSubmodelConnection()));
-			assertEquals(0, comparator.compare(new ModelSubmodelConnection(), new ModelSubmodelConnection()));
-			assertEquals(0, comparator.compare(connectionA, connectionB));
-			assertEquals(0, comparator.compare(connectionA, connectionA));
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid() throws Exception {
-		try {
-			class Tmp extends SubmodelConnection {
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public SubmodelConnection copy() {
-					return null;
-				}
-			}
-			;
-			Tmp connectionA = new Tmp();
-			Tmp connectionB = new Tmp();
-
-			comparator.compare(connectionA, connectionB);
-			comparator.compare(connectionA, connectionA);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInternal() throws Exception {
-		try {
-			SubmodelConnection connectionA = createConnection();
-			SubmodelConnection connectionB = createConnection();
-
-			assertTrue(comparator.internalCompare(null, connectionB) != 0);
-			assertTrue(comparator.internalCompare(connectionA, null) != 0);
-			assertEquals(0, comparator.internalCompare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			SubmodelConnection connectionA = createConnection();
-			SubmodelConnection connectionB = createConnection();
-
-			assertTrue(comparator.compare(null, connectionB) != 0);
-			assertTrue(comparator.compare(connectionA, null) != 0);
-
-			connectionA.setName("AA");
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-
-			connectionA.setType(null);
-
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-
-			connectionA.setType(SubmodelType.PATHWAY);
-
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-
-			connectionA.getSubmodel().setNotes("ASD acd");
-
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			connectionA = createConnection();
-			connectionB = createConnection();
-			connectionB.setSubmodel(new ModelFullIndexed(null));
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-			assertTrue(comparator.compare(connectionB, new SubmodelConnection() {
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public SubmodelConnection copy() {
-					return null;
-				}
-			}) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent2() throws Exception {
-		try {
-			AliasSubmodelConnection connectionA = new AliasSubmodelConnection();
-			AliasSubmodelConnection connectionB = new AliasSubmodelConnection();
-
-			connectionB.setSubmodel(new ModelFullIndexed(null));
-			assertTrue(comparator.compare(connectionA, connectionB) != 0);
-			assertTrue(comparator.compare(connectionB, connectionA) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model getModel() {
-		Model model = new ModelFullIndexed(null);
-
-		model.setNotes("Some description");
-		Protein protein = new Protein();
-		protein.setName("ad");
-		protein.setElementId("A");
-		model.addElement(protein);
-
-		SpeciesAlias alias = new SpeciesAlias(protein);
-		alias.setAliasId("a_id");
-		model.addAlias(alias);
-
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		Layer layer = new Layer();
-		layer.setName("layer name");
-		model.addLayer(layer);
-
-		model.addReaction(new Reaction());
-		return model;
-	}
-
-	private AliasSubmodelConnection createConnection() {
-		AliasSubmodelConnection result = new AliasSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS);
-		result.setName("name A");
-		return result;
-	}
-
-}
+package lcsb.mapviewer.model.map.model;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class SubmodelConnectionComparatorTest {
+
+	SubmodelConnectionComparator comparator = new SubmodelConnectionComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() throws Exception {
+		try {
+			SubmodelConnection connectionA = createConnection();
+			SubmodelConnection connectionB = createConnection();
+
+			assertEquals(0, comparator.compare(new AliasSubmodelConnection(), new AliasSubmodelConnection()));
+			assertEquals(0, comparator.compare(new ModelSubmodelConnection(), new ModelSubmodelConnection()));
+			assertEquals(0, comparator.compare(connectionA, connectionB));
+			assertEquals(0, comparator.compare(connectionA, connectionA));
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid() throws Exception {
+		try {
+			class Tmp extends SubmodelConnection {
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public SubmodelConnection copy() {
+					return null;
+				}
+			}
+			;
+			Tmp connectionA = new Tmp();
+			Tmp connectionB = new Tmp();
+
+			comparator.compare(connectionA, connectionB);
+			comparator.compare(connectionA, connectionA);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInternal() throws Exception {
+		try {
+			SubmodelConnection connectionA = createConnection();
+			SubmodelConnection connectionB = createConnection();
+
+			assertTrue(comparator.internalCompare(null, connectionB) != 0);
+			assertTrue(comparator.internalCompare(connectionA, null) != 0);
+			assertEquals(0, comparator.internalCompare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			SubmodelConnection connectionA = createConnection();
+			SubmodelConnection connectionB = createConnection();
+
+			assertTrue(comparator.compare(null, connectionB) != 0);
+			assertTrue(comparator.compare(connectionA, null) != 0);
+
+			connectionA.setName("AA");
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+
+			connectionA.setType(null);
+
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+
+			connectionA.setType(SubmodelType.PATHWAY);
+
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+
+			connectionA.getSubmodel().setNotes("ASD acd");
+
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			connectionA = createConnection();
+			connectionB = createConnection();
+			connectionB.setSubmodel(new ModelFullIndexed(null));
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+			assertTrue(comparator.compare(connectionB, new SubmodelConnection() {
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public SubmodelConnection copy() {
+					return null;
+				}
+			}) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent2() throws Exception {
+		try {
+			AliasSubmodelConnection connectionA = new AliasSubmodelConnection();
+			AliasSubmodelConnection connectionB = new AliasSubmodelConnection();
+
+			connectionB.setSubmodel(new ModelFullIndexed(null));
+			assertTrue(comparator.compare(connectionA, connectionB) != 0);
+			assertTrue(comparator.compare(connectionB, connectionA) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model getModel() {
+		Model model = new ModelFullIndexed(null);
+
+		model.setNotes("Some description");
+		GenericProtein protein = new GenericProtein();
+		protein.setName("ad");
+		protein.setElementId("A");
+		model.addElement(protein);
+
+		SpeciesAlias alias = new GenericProteinAlias(protein);
+		alias.setAliasId("a_id");
+		model.addAlias(alias);
+
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		Layer layer = new Layer();
+		layer.setName("layer name");
+		model.addLayer(layer);
+
+		model.addReaction(new Reaction());
+		return model;
+	}
+
+	private AliasSubmodelConnection createConnection() {
+		AliasSubmodelConnection result = new AliasSubmodelConnection(getModel(), SubmodelType.DOWNSTREAM_TARGETS);
+		result.setName("name A");
+		return result;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/modifier/CatalysisTest.java b/model/src/test/java/lcsb/mapviewer/model/map/modifier/CatalysisTest.java
index 0188bb0b49..f8b8d81f7e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/modifier/CatalysisTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/modifier/CatalysisTest.java
@@ -1,90 +1,91 @@
-package lcsb.mapviewer.model.map.modifier;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class CatalysisTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Catalysis());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			Catalysis modifier = new Catalysis(new SpeciesAlias(), new Species());
-			assertNotNull(modifier);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor2() {
-		try {
-			Catalysis modifier = new Catalysis(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			Catalysis modifier2 = new Catalysis(modifier);
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Catalysis modifier = new Catalysis(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			Catalysis modifier2 = modifier.copy();
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopyInvalid() {
-		try {
-			new Catalysis() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.map.modifier;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.AntisenseRnaAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class CatalysisTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Catalysis());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			Catalysis modifier = new Catalysis(new AntisenseRnaAlias(null, null), new Species());
+			assertNotNull(modifier);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			Catalysis modifier = new Catalysis(new AntisenseRnaAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			Catalysis modifier2 = new Catalysis(modifier);
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Catalysis modifier = new Catalysis(new AntisenseRnaAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			Catalysis modifier2 = modifier.copy();
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopyInvalid() {
+		try {
+			new Catalysis() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/modifier/InhibitionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/modifier/InhibitionTest.java
index 177b5b7af9..9cfcf12425 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/modifier/InhibitionTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/modifier/InhibitionTest.java
@@ -1,91 +1,91 @@
-package lcsb.mapviewer.model.map.modifier;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class InhibitionTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Inhibition());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			Inhibition modifier = new Inhibition(new SpeciesAlias(), new Species());
-			assertNotNull(modifier);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor2() {
-		try {
-			Inhibition modifier = new Inhibition(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			Inhibition modifier2 = new Inhibition(modifier);
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Inhibition modifier = new Inhibition(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			Inhibition modifier2 = modifier.copy();
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopyInvalid() {
-		try {
-			new Inhibition() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.modifier;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class InhibitionTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Inhibition());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			Inhibition modifier = new Inhibition(new GenericProteinAlias(null, null), new Species());
+			assertNotNull(modifier);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			Inhibition modifier = new Inhibition(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			Inhibition modifier2 = new Inhibition(modifier);
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Inhibition modifier = new Inhibition(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			Inhibition modifier2 = modifier.copy();
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopyInvalid() {
+		try {
+			new Inhibition() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/modifier/ModulationTest.java b/model/src/test/java/lcsb/mapviewer/model/map/modifier/ModulationTest.java
index b4b542bf14..e53392d8f7 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/modifier/ModulationTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/modifier/ModulationTest.java
@@ -1,89 +1,91 @@
-package lcsb.mapviewer.model.map.modifier;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ModulationTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Modulation());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			Modulation modifier = new Modulation(new SpeciesAlias(), new Species());
-			assertNotNull(modifier);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testConstructor2() {
-		try {
-			Modulation modifier = new Modulation(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			Modulation modifier2 = new Modulation(modifier);
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testCopyInvalid() {
-		try {
-			new Modulation() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testCopy() {
-		try {
-			Modulation modifier = new Modulation(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			Modulation modifier2 = modifier.copy();
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-}
+package lcsb.mapviewer.model.map.modifier;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class ModulationTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Modulation());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			Modulation modifier = new Modulation(new GenericProteinAlias(null, null), new Species());
+			assertNotNull(modifier);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			Modulation modifier = new Modulation(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			Modulation modifier2 = new Modulation(modifier);
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopyInvalid() {
+		try {
+			new Modulation() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Modulation modifier = new Modulation(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			Modulation modifier2 = modifier.copy();
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/modifier/PhysicalStimulationTest.java b/model/src/test/java/lcsb/mapviewer/model/map/modifier/PhysicalStimulationTest.java
index 4b89ff6cb0..985374e65d 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/modifier/PhysicalStimulationTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/modifier/PhysicalStimulationTest.java
@@ -1,90 +1,91 @@
-package lcsb.mapviewer.model.map.modifier;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class PhysicalStimulationTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new PhysicalStimulation());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			PhysicalStimulation modifier = new PhysicalStimulation(new SpeciesAlias(), new Species());
-			assertNotNull(modifier);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testConstructor2() {
-		try {
-			PhysicalStimulation modifier = new PhysicalStimulation(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			PhysicalStimulation modifier2 = new PhysicalStimulation(modifier);
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testCopyInvalid() {
-		try {
-			new PhysicalStimulation() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			PhysicalStimulation modifier = new PhysicalStimulation(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			PhysicalStimulation modifier2 = modifier.copy();
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-
-}
+package lcsb.mapviewer.model.map.modifier;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class PhysicalStimulationTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new PhysicalStimulation());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			PhysicalStimulation modifier = new PhysicalStimulation(new GenericProteinAlias(null, null), new Species());
+			assertNotNull(modifier);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			PhysicalStimulation modifier = new PhysicalStimulation(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			PhysicalStimulation modifier2 = new PhysicalStimulation(modifier);
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopyInvalid() {
+		try {
+			new PhysicalStimulation() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			PhysicalStimulation modifier = new PhysicalStimulation(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			PhysicalStimulation modifier2 = modifier.copy();
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/modifier/TriggerTest.java b/model/src/test/java/lcsb/mapviewer/model/map/modifier/TriggerTest.java
index ef8efa4ceb..51d6c5d5c6 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/modifier/TriggerTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/modifier/TriggerTest.java
@@ -1,90 +1,91 @@
-package lcsb.mapviewer.model.map.modifier;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class TriggerTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Trigger());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			Trigger modifier = new Trigger(new SpeciesAlias(), new Species());
-			assertNotNull(modifier);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor2() {
-		try {
-			Trigger modifier = new Trigger(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			Trigger modifier2 = new Trigger(modifier);
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Trigger modifier = new Trigger(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			Trigger modifier2 = modifier.copy();
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testCopyInvalid() {
-		try {
-			new Trigger() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.modifier;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class TriggerTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Trigger());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			Trigger modifier = new Trigger(new GenericProteinAlias(null, null), new Species());
+			assertNotNull(modifier);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			Trigger modifier = new Trigger(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			Trigger modifier2 = new Trigger(modifier);
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Trigger modifier = new Trigger(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			Trigger modifier2 = modifier.copy();
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopyInvalid() {
+		try {
+			new Trigger() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/modifier/UnknownCatalysisTest.java b/model/src/test/java/lcsb/mapviewer/model/map/modifier/UnknownCatalysisTest.java
index 3e508af915..9ba748b18b 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/modifier/UnknownCatalysisTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/modifier/UnknownCatalysisTest.java
@@ -1,90 +1,91 @@
-package lcsb.mapviewer.model.map.modifier;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class UnknownCatalysisTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new UnknownCatalysis());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			UnknownCatalysis modifier = new UnknownCatalysis(new SpeciesAlias(), new Species());
-			assertNotNull(modifier);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor2() {
-		try {
-			UnknownCatalysis modifier = new UnknownCatalysis(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			UnknownCatalysis modifier2 = new UnknownCatalysis(modifier);
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			UnknownCatalysis modifier = new UnknownCatalysis(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			UnknownCatalysis modifier2 = modifier.copy();
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testCopyInvalid() {
-		try {
-			new UnknownCatalysis() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.modifier;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class UnknownCatalysisTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new UnknownCatalysis());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			UnknownCatalysis modifier = new UnknownCatalysis(new GenericProteinAlias(null, null), new Species());
+			assertNotNull(modifier);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			UnknownCatalysis modifier = new UnknownCatalysis(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			UnknownCatalysis modifier2 = new UnknownCatalysis(modifier);
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			UnknownCatalysis modifier = new UnknownCatalysis(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			UnknownCatalysis modifier2 = modifier.copy();
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopyInvalid() {
+		try {
+			new UnknownCatalysis() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/modifier/UnknownInhibitionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/modifier/UnknownInhibitionTest.java
index b16d33b5af..6b0fee21ed 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/modifier/UnknownInhibitionTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/modifier/UnknownInhibitionTest.java
@@ -1,89 +1,91 @@
-package lcsb.mapviewer.model.map.modifier;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class UnknownInhibitionTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new UnknownInhibition());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			UnknownInhibition modifier = new UnknownInhibition(new SpeciesAlias(), new Species());
-			assertNotNull(modifier);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testConstructor2() {
-		try {
-			UnknownInhibition modifier = new UnknownInhibition(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			UnknownInhibition modifier2 = new UnknownInhibition(modifier);
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			UnknownInhibition modifier = new UnknownInhibition(new SpeciesAlias(), new Species());
-			modifier.setLine(new PolylineData());
-			UnknownInhibition modifier2 = modifier.copy();
-			assertNotNull(modifier2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testCopyInvalid() {
-		try {
-			new UnknownInhibition() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.modifier;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class UnknownInhibitionTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new UnknownInhibition());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			UnknownInhibition modifier = new UnknownInhibition(new GenericProteinAlias(null, null), new Species());
+			assertNotNull(modifier);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor2() {
+		try {
+			UnknownInhibition modifier = new UnknownInhibition(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			UnknownInhibition modifier2 = new UnknownInhibition(modifier);
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			UnknownInhibition modifier = new UnknownInhibition(new GenericProteinAlias(null, null), new Species());
+			modifier.setLine(new PolylineData());
+			UnknownInhibition modifier2 = modifier.copy();
+			assertNotNull(modifier2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopyInvalid() {
+		try {
+			new UnknownInhibition() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/NodeOperatorComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/NodeOperatorComparatorTest.java
index 7016aaaf98..dd063c8fed 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/NodeOperatorComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/NodeOperatorComparatorTest.java
@@ -1,164 +1,164 @@
-package lcsb.mapviewer.model.map.reaction;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.geom.Point2D;
-
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class NodeOperatorComparatorTest {
-
-	NodeOperatorComparator	comparator	= new NodeOperatorComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			assertEquals(0, comparator.compare(new AndOperator(), new AndOperator()));
-
-			NodeOperator operator1 = createNodeOperator();
-			NodeOperator operator2 = createNodeOperator();
-
-			assertEquals(0, comparator.compare(operator1, operator2));
-
-			assertEquals(0, comparator.compare(operator1, operator1));
-
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			NodeOperator operator1 = createNodeOperator();
-			NodeOperator operator2 = createNodeOperator();
-
-			operator1.getLine().addPoint(new Point2D.Double(1, 1));
-			assertTrue(comparator.compare(operator1, operator2)!=0);
-			assertTrue(comparator.compare(operator2, operator1)!=0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			operator1.addInput(new Reactant());
-			assertTrue(comparator.compare(operator1, operator2)!=0);
-			assertTrue(comparator.compare(operator2, operator1)!=0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			operator1.addOutput(new Product());
-			assertTrue(comparator.compare(operator1, operator2)!=0);
-			assertTrue(comparator.compare(operator2, operator1)!=0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			Reactant reactant = (Reactant) operator1.getInputs().get(0);
-			reactant.setAlias(new SpeciesAlias());
-			assertTrue(comparator.compare(operator1, operator2)!=0);
-			assertTrue(comparator.compare(operator2, operator1)!=0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			Product product= (Product) operator1.getOutputs().get(0);
-			product.setElement(new Protein());
-			assertTrue(comparator.compare(operator1, operator2)!=0);
-			assertTrue(comparator.compare(operator2, operator1)!=0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			reactant = (Reactant) operator1.getInputs().get(0);
-			((Species)(reactant.getElement())).setName("bla");
-			assertTrue(comparator.compare(operator1, operator2)!=0);
-			assertTrue(comparator.compare(operator2, operator1)!=0);
-
-			assertTrue(comparator.compare(null, operator1)!=0);
-			assertTrue(comparator.compare(operator2, null)!=0);
-
-			assertTrue(comparator.compare(operator2, new OrOperator())!=0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	private NodeOperator createNodeOperator() {
-		AndOperator result = new AndOperator();
-		
-		Protein element0 = new Protein();
-		element0.setName("protein a");
-		
-		SpeciesAlias alias0 = new SpeciesAlias(element0);
-		alias0.setX(12.0);
-		alias0.setY(1.0);
-		alias0.setWidth(2.0);
-		alias0.setHeight(3.0);
-		
-		Product product = new Product(alias0, element0);
-		
-		result.addOutput(product);
-		
-		Protein element1 = new Protein();
-		element1.setName("protein b");
-		
-		SpeciesAlias alias1 = new SpeciesAlias(element1);
-		alias1.setX(120.0);
-		alias1.setY(10.0);
-		alias1.setWidth(20.0);
-		alias1.setHeight(30.0);
-		
-		Reactant reactant = new Reactant(alias1, element1);
-		
-		result.addInput(reactant);
-		
-		Gene element2 = new Gene();
-		element2.setName("gene b");
-		
-		SpeciesAlias alias2 = new SpeciesAlias(element2);
-		alias2.setX(320.0);
-		alias2.setY(30.0);
-		alias2.setWidth(30.0);
-		alias2.setHeight(40.0);
-		
-		Modifier modifier= new Modifier(alias2, element2);
-		
-		result.addInput(modifier);
-
-		PolylineData pd = new PolylineData();
-		pd.addPoint(new Point2D.Double(1,2));
-		pd.addPoint(new Point2D.Double(1,22));
-		pd.addPoint(new Point2D.Double(10,22));
-		result.setLine(pd);
-		
-		
-		return result;
-	}
-
-}
-
-
+package lcsb.mapviewer.model.map.reaction;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.GeneAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class NodeOperatorComparatorTest {
+
+	NodeOperatorComparator comparator = new NodeOperatorComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			assertEquals(0, comparator.compare(new AndOperator(), new AndOperator()));
+
+			NodeOperator operator1 = createNodeOperator();
+			NodeOperator operator2 = createNodeOperator();
+
+			assertEquals(0, comparator.compare(operator1, operator2));
+
+			assertEquals(0, comparator.compare(operator1, operator1));
+
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			NodeOperator operator1 = createNodeOperator();
+			NodeOperator operator2 = createNodeOperator();
+
+			operator1.getLine().addPoint(new Point2D.Double(1, 1));
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			operator1.addInput(new Reactant());
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			operator1.addOutput(new Product());
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			Reactant reactant = (Reactant) operator1.getInputs().get(0);
+			reactant.setAlias(new GenericProteinAlias(null, null));
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			Product product = (Product) operator1.getOutputs().get(0);
+			product.setElement(new GenericProtein());
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			reactant = (Reactant) operator1.getInputs().get(0);
+			((Species) (reactant.getElement())).setName("bla");
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			assertTrue(comparator.compare(null, operator1) != 0);
+			assertTrue(comparator.compare(operator2, null) != 0);
+
+			assertTrue(comparator.compare(operator2, new OrOperator()) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	private NodeOperator createNodeOperator() {
+		AndOperator result = new AndOperator();
+
+		GenericProtein element0 = new GenericProtein();
+		element0.setName("protein a");
+
+		SpeciesAlias alias0 = new GenericProteinAlias(element0);
+		alias0.setX(12.0);
+		alias0.setY(1.0);
+		alias0.setWidth(2.0);
+		alias0.setHeight(3.0);
+
+		Product product = new Product(alias0, element0);
+
+		result.addOutput(product);
+
+		GenericProtein element1 = new GenericProtein();
+		element1.setName("protein b");
+
+		SpeciesAlias alias1 = new GenericProteinAlias(element1);
+		alias1.setX(120.0);
+		alias1.setY(10.0);
+		alias1.setWidth(20.0);
+		alias1.setHeight(30.0);
+
+		Reactant reactant = new Reactant(alias1, element1);
+
+		result.addInput(reactant);
+
+		Gene element2 = new Gene();
+		element2.setName("gene b");
+
+		SpeciesAlias alias2 = new GeneAlias(element2);
+		alias2.setX(320.0);
+		alias2.setY(30.0);
+		alias2.setWidth(30.0);
+		alias2.setHeight(40.0);
+
+		Modifier modifier = new Modifier(alias2, element2);
+
+		result.addInput(modifier);
+
+		PolylineData pd = new PolylineData();
+		pd.addPoint(new Point2D.Double(1, 2));
+		pd.addPoint(new Point2D.Double(1, 22));
+		pd.addPoint(new Point2D.Double(10, 22));
+		result.setLine(pd);
+
+		return result;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionComparatorTest.java
index 7e8fc6042c..f766e3dee7 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionComparatorTest.java
@@ -14,11 +14,14 @@ import lcsb.mapviewer.model.graphics.PolylineData;
 import lcsb.mapviewer.model.map.MiriamData;
 import lcsb.mapviewer.model.map.MiriamRelationType;
 import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
 import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.alias.UnknownAlias;
 import lcsb.mapviewer.model.map.modifier.Catalysis;
 import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
 import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
-import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.GenericProtein;
 import lcsb.mapviewer.model.map.species.SimpleMolecule;
 import lcsb.mapviewer.model.map.species.Unknown;
 
@@ -46,7 +49,7 @@ public class ReactionComparatorTest {
 
 		} catch (Exception e) {
 			e.printStackTrace();
-			fail("Unknown exception");
+			throw e;
 		}
 	}
 
@@ -243,30 +246,30 @@ public class ReactionComparatorTest {
 
 		} catch (Exception e) {
 			e.printStackTrace();
-			fail("Unknown exception");
+			throw e;
 		}
 	}
 
 	private Reaction createReaction() {
 		Reaction reaction = new Reaction();
-		Protein protein = new Protein();
+		GenericProtein protein = new GenericProtein();
 		protein.setName("ASD");
-		SpeciesAlias alias = new SpeciesAlias(protein);
+		SpeciesAlias alias = new GenericProteinAlias(protein);
 		Reactant reactant = new Reactant(alias, protein);
 
-		Protein protein2 = new Protein();
+		GenericProtein protein2 = new GenericProtein();
 		protein2.setName("ASD2");
-		SpeciesAlias alias2 = new SpeciesAlias(protein2);
+		SpeciesAlias alias2 = new GenericProteinAlias(protein2);
 		Reactant reactant2 = new Reactant(alias2, protein2);
 
 		SimpleMolecule molecule = new SimpleMolecule();
 		molecule.setName("mol");
-		SpeciesAlias moelculeAlias = new SpeciesAlias(molecule);
+		SpeciesAlias moelculeAlias = new SimpleMoleculeAlias(molecule);
 		Product product = new Product(moelculeAlias, molecule);
 
 		Unknown unknown = new Unknown();
 		unknown.setName("unk");
-		SpeciesAlias unknownAlias = new SpeciesAlias(unknown);
+		SpeciesAlias unknownAlias = new UnknownAlias(unknown);
 		Modifier modifier = new Catalysis(unknownAlias, unknown);
 
 		AndOperator operator = new AndOperator();
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionNodeComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionNodeComparatorTest.java
index 110309f744..a1cfd80e5e 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionNodeComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionNodeComparatorTest.java
@@ -1,123 +1,128 @@
-package lcsb.mapviewer.model.map.reaction;
-
-import static org.junit.Assert.*;
-
-import java.awt.geom.Point2D;
-
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ReactionNodeComparatorTest {
-
-	ReactionNodeComparator	comparator	= new ReactionNodeComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			assertEquals(0, comparator.compare(new Modifier(), new Modifier()));
-
-			ReactionNode operator1 = createNodeOperator();
-			ReactionNode operator2 = createNodeOperator();
-
-			assertEquals(0, comparator.compare(operator1, operator2));
-
-			assertEquals(0, comparator.compare(operator1, operator1));
-
-			assertEquals(0, comparator.compare(null, null));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			ReactionNode operator1 = createNodeOperator();
-			ReactionNode operator2 = createNodeOperator();
-
-			operator1.getLine().addPoint(new Point2D.Double(1, 1));
-			assertTrue(comparator.compare(operator1, operator2) != 0);
-			assertTrue(comparator.compare(operator2, operator1) != 0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			operator1 = new Product();
-			assertTrue(comparator.compare(operator1, operator2) != 0);
-			assertTrue(comparator.compare(operator2, operator1) != 0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			operator1 = new Reactant();
-			assertTrue(comparator.compare(operator1, operator2) != 0);
-			assertTrue(comparator.compare(operator2, operator1) != 0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			operator1.setAlias(new SpeciesAlias());
-			assertTrue(comparator.compare(operator1, operator2) != 0);
-			assertTrue(comparator.compare(operator2, operator1) != 0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			operator1.setElement(new Protein());
-			assertTrue(comparator.compare(operator1, operator2) != 0);
-			assertTrue(comparator.compare(operator2, operator1) != 0);
-
-			operator1 = createNodeOperator();
-			operator2 = createNodeOperator();
-
-			((Species) (operator1.getElement())).setName("bla");
-			assertTrue(comparator.compare(operator1, operator2) != 0);
-			assertTrue(comparator.compare(operator2, operator1) != 0);
-
-			assertTrue(comparator.compare(null, operator1) != 0);
-			assertTrue(comparator.compare(operator2, null) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	private ReactionNode createNodeOperator() {
-		Gene element2 = new Gene();
-		element2.setName("gene b");
-
-		SpeciesAlias alias2 = new SpeciesAlias(element2);
-		alias2.setX(320.0);
-		alias2.setY(30.0);
-		alias2.setWidth(30.0);
-		alias2.setHeight(40.0);
-
-		Modifier modifier = new Modifier(alias2, element2);
-		
-		PolylineData pd = new PolylineData();
-		pd.addPoint(new Point2D.Double(1,2));
-		pd.addPoint(new Point2D.Double(1,21));
-		pd.addPoint(new Point2D.Double(11,2));
-		modifier.setLine(pd);
-
-		return modifier;
-	}
-
-}
+package lcsb.mapviewer.model.map.reaction;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.layout.alias.GeneAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+
+public class ReactionNodeComparatorTest {
+
+	ReactionNodeComparator comparator = new ReactionNodeComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			assertEquals(0, comparator.compare(new Modifier(), new Modifier()));
+
+			ReactionNode operator1 = createNodeOperator();
+			ReactionNode operator2 = createNodeOperator();
+
+			assertEquals(0, comparator.compare(operator1, operator2));
+
+			assertEquals(0, comparator.compare(operator1, operator1));
+
+			assertEquals(0, comparator.compare(null, null));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			ReactionNode operator1 = createNodeOperator();
+			ReactionNode operator2 = createNodeOperator();
+
+			operator1.getLine().addPoint(new Point2D.Double(1, 1));
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			operator1 = new Product();
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			operator1 = new Reactant();
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			operator1.setAlias(new GenericProteinAlias(null, null));
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			operator1.setElement(new GenericProtein());
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			operator1 = createNodeOperator();
+			operator2 = createNodeOperator();
+
+			((Species) (operator1.getElement())).setName("bla");
+			assertTrue(comparator.compare(operator1, operator2) != 0);
+			assertTrue(comparator.compare(operator2, operator1) != 0);
+
+			assertTrue(comparator.compare(null, operator1) != 0);
+			assertTrue(comparator.compare(operator2, null) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	private ReactionNode createNodeOperator() {
+		Gene element2 = new Gene();
+		element2.setName("gene b");
+
+		SpeciesAlias alias2 = new GeneAlias(element2);
+		alias2.setX(320.0);
+		alias2.setY(30.0);
+		alias2.setWidth(30.0);
+		alias2.setHeight(40.0);
+
+		Modifier modifier = new Modifier(alias2, element2);
+
+		PolylineData pd = new PolylineData();
+		pd.addPoint(new Point2D.Double(1, 2));
+		pd.addPoint(new Point2D.Double(1, 21));
+		pd.addPoint(new Point2D.Double(11, 2));
+		modifier.setLine(pd);
+
+		return modifier;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionTest.java b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionTest.java
index 22ff192545..0c917040c7 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/reaction/ReactionTest.java
@@ -1,429 +1,428 @@
-package lcsb.mapviewer.model.map.reaction;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.awt.geom.Line2D;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.ModelTestFunctions;
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.modifier.Catalysis;
-import lcsb.mapviewer.model.map.reaction.type.DissociationReaction;
-import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-
-public class ReactionTest extends ModelTestFunctions {
-
-	Logger							 logger	= Logger.getLogger(ReactantTest.class);
-
-	private Species			 species;
-	private SpeciesAlias alias;
-
-	@Before
-	public void setUp() throws Exception {
-		species = new Protein();
-		species.setElementId("id1");
-
-		alias = new SpeciesAlias();
-		alias.setSpecies(species);
-		alias.setAliasId("sa1");
-
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testContainsElement() {
-		try {
-			Reaction reaction = new Reaction();
-			assertFalse(reaction.containsElement(species));
-			Modifier modifier = new Catalysis(alias, species);
-			reaction.addModifier(modifier);
-			assertTrue(reaction.containsElement(species));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testComparator() {
-		try {
-			Reaction reaction1 = new Reaction();
-			reaction1.setIdReaction("2");
-			Reaction reaction2 = new Reaction();
-			reaction2.setIdReaction("1");
-			Reaction reaction3 = new Reaction();
-			reaction3.setIdReaction("3");
-			List<Reaction> reactions = new ArrayList<>();
-			reactions.add(reaction1);
-			reactions.add(reaction2);
-			reactions.add(reaction3);
-			Collections.sort(reactions, Reaction.ID_COMPARATOR);
-			assertEquals(reaction2, reactions.get(0));
-			assertEquals(reaction1, reactions.get(1));
-			assertEquals(reaction3, reactions.get(2));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			Reaction reaction1 = new Reaction();
-			reaction1.addMiriamData(new MiriamData());
-			reaction1.addSynonym("s");
-			Reaction reaction2 = new Reaction(reaction1);
-
-			assertEquals(1, reaction2.getMiriamData().size());
-			assertEquals(1, reaction2.getSynonyms().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetDistanceFromPoint() {
-		try {
-			Reaction reaction1 = new Reaction();
-			Reactant reactant = new Reactant();
-			PolylineData line = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(2.0, 0.0));
-			reactant.setLine(line);
-			reaction1.addReactant(reactant);
-
-			assertEquals(0.0, reaction1.getDistanceFromPoint(new Point2D.Double(0.0, 0.0)), Configuration.EPSILON);
-			assertEquals(0.0, reaction1.getDistanceFromPoint(new Point2D.Double(1.0, 0.0)), Configuration.EPSILON);
-			assertEquals(1.0, reaction1.getDistanceFromPoint(new Point2D.Double(1.0, 1.0)), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetClosestPointTo() {
-		try {
-			Reaction reaction1 = new Reaction();
-			Reactant reactant = new Reactant();
-			PolylineData line = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(2.0, 0.0));
-			reactant.setLine(line);
-			reaction1.addReactant(reactant);
-
-			assertEquals(0.0, reaction1.getClosestPointTo(new Point2D.Double(0.0, 0.0)).distance(new Point2D.Double(0.0, 0.0)), Configuration.EPSILON);
-			assertEquals(0.0, reaction1.getClosestPointTo(new Point2D.Double(1.0, 0.0)).distance(new Point2D.Double(1.0, 0.0)), Configuration.EPSILON);
-			assertEquals(0.0, reaction1.getClosestPointTo(new Point2D.Double(1.0, 1.0)).distance(new Point2D.Double(1.0, 0.0)), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddMiriam() {
-		try {
-			Reaction reaction1 = new Reaction();
-
-			MiriamData md = new MiriamData(MiriamType.CAS, "1");
-			reaction1.addMiriamData(md);
-
-			assertEquals(1, reaction1.getMiriamData().size());
-
-			reaction1.addMiriamData(md);
-			assertEquals(1, reaction1.getMiriamData().size());
-			assertEquals(1, getWarnings().size());
-
-			List<MiriamData> list = new ArrayList<>();
-			list.add(md);
-
-			reaction1.addMiriamData(list);
-			assertEquals(2, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Reaction reaction1 = new Reaction();
-
-			try {
-				assertNull(reaction1.getStringType());
-				fail("Exception expected");
-			} catch (NotImplementedException e) {
-			}
-			assertNull(reaction1.getReactionRect());
-
-			int id = 61;
-			List<AbstractNode> nodes = new ArrayList<>();
-			String notes = "dfp";
-
-			boolean kineticLaw = true;
-			ModelData data = new ModelData();
-			Model model = new ModelFullIndexed(data);
-			String symbol = "sybm";
-			String formula = "form";
-			Integer mechanicalConfidenceScore = 9908;
-			Double lowerBound = 9.2;
-			Double upperBound = 9.2;
-			String subsystem = "ssyst";
-			String geneProteinReaction = "GPR";
-			List<String> synonyms = new ArrayList<>();
-			String elementId = "id_e";
-
-			reaction1.setId(id);
-			reaction1.setNodes(nodes);
-			reaction1.setNotes(notes);
-			reaction1.setKineticLaw(kineticLaw);
-			assertEquals(kineticLaw, reaction1.isKineticLaw());
-			reaction1.setModel(model);
-			assertEquals(model, reaction1.getModel());
-			reaction1.setModelData(data);
-			assertEquals(data, reaction1.getModelData());
-			reaction1.setSymbol(symbol);
-			assertEquals(symbol, reaction1.getSymbol());
-			reaction1.setFormula(formula);
-			assertEquals(formula, reaction1.getFormula());
-			reaction1.setMechanicalConfidenceScore(mechanicalConfidenceScore);
-			assertEquals(mechanicalConfidenceScore, reaction1.getMechanicalConfidenceScore());
-			reaction1.setLowerBound(lowerBound);
-			assertEquals(lowerBound, reaction1.getLowerBound());
-			reaction1.setUpperBound(upperBound);
-			assertEquals(upperBound, reaction1.getUpperBound());
-			reaction1.setSubsystem(subsystem);
-			assertEquals(subsystem, reaction1.getSubsystem());
-			reaction1.setGeneProteinReaction(geneProteinReaction);
-			assertEquals(geneProteinReaction, reaction1.getGeneProteinReaction());
-			reaction1.setSynonyms(synonyms);
-			assertEquals(synonyms, reaction1.getSynonyms());
-			reaction1.setElementId(elementId);
-			assertEquals(elementId, reaction1.getElementId());
-
-			assertEquals(id, reaction1.getId());
-			assertEquals(nodes, reaction1.getNodes());
-			assertEquals(notes, reaction1.getNotes());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testVisibilityLevel() {
-		try {
-			Reaction reaction1 = new Reaction();
-			assertEquals(0, reaction1.getVisibilityLevel());
-
-			Reactant reactant = new Reactant();
-			Alias alias = new SpeciesAlias();
-			alias.setVisibilityLevel(2);
-			reactant.setAlias(alias);
-			reaction1.addReactant(reactant);
-
-			assertEquals(2, reaction1.getVisibilityLevel());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetCenterLine() {
-		try {
-			Reaction reaction1 = new Reaction();
-
-			Reactant reactant = new Reactant();
-			PolylineData line1 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
-			reactant.setLine(line1);
-			reaction1.addReactant(reactant);
-
-			Product product = new Product();
-			PolylineData line2 = new PolylineData(new Point2D.Double(0.0, 2.0), new Point2D.Double(4.0, 0.0));
-			product.setLine(line2);
-			reaction1.addProduct(product);
-
-			Line2D line = reaction1.getCenterLine();
-			assertEquals(4.0, line.getP1().distance(line.getP2()), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetCenterPoint() {
-		try {
-			Reaction reaction1 = new Reaction();
-
-			Reactant reactant = new Reactant();
-			PolylineData line1 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
-			reactant.setLine(line1);
-			reaction1.addReactant(reactant);
-
-			Product product = new Product();
-			PolylineData line2 = new PolylineData(new Point2D.Double(0.0, 2.0), new Point2D.Double(4.0, 0.0));
-			product.setLine(line2);
-			reaction1.addProduct(product);
-
-			assertEquals(0.0, reaction1.getCenterPoint().distance(new Point2D.Double(2.0, 0.0)), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetCenterLine2() {
-		try {
-			Reaction reaction1 = new HeterodimerAssociationReaction();
-
-			Reactant reactant = new Reactant();
-			PolylineData line1 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
-			reactant.setLine(line1);
-			reaction1.addReactant(reactant);
-
-			Reactant reactant2 = new Reactant();
-			PolylineData line3 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
-			reactant2.setLine(line3);
-			reaction1.addReactant(reactant2);
-			AndOperator operator = new AndOperator();
-			operator.addInput(reactant);
-			operator.addInput(reactant2);
-			PolylineData line4 = new PolylineData(new Point2D.Double(10.0, 0.0), new Point2D.Double(11.0, 11.0));
-			operator.setLine(line4);
-			reaction1.addNode(operator);
-
-			Product product = new Product();
-			PolylineData line2 = new PolylineData(new Point2D.Double(0.0, 2.0), new Point2D.Double(4.0, 0.0));
-			product.setLine(line2);
-			reaction1.addProduct(product);
-
-			Line2D line = reaction1.getCenterLine();
-			assertEquals(6.0, line.getP1().distance(line.getP2()), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetCenterLine3() {
-		try {
-			Reaction reaction1 = new DissociationReaction();
-
-			Reactant reactant = new Reactant();
-			PolylineData line1 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
-			reactant.setLine(line1);
-			reaction1.addReactant(reactant);
-
-			Product product = new Product();
-			PolylineData line2 = new PolylineData(new Point2D.Double(0.0, 2.0), new Point2D.Double(4.0, 0.0));
-			product.setLine(line2);
-			reaction1.addProduct(product);
-
-			Product product2 = new Product();
-			PolylineData line3 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
-			product2.setLine(line3);
-			reaction1.addProduct(product2);
-			SplitOperator operator = new SplitOperator();
-			operator.addOutput(product);
-			operator.addOutput(product2);
-			PolylineData line4 = new PolylineData(new Point2D.Double(10.0, 0.0), new Point2D.Double(11.0, 0.0));
-			operator.setLine(line4);
-			reaction1.addNode(operator);
-
-			Line2D line = reaction1.getCenterLine();
-			assertEquals(10.0, line.getP1().distance(line.getP2()), Configuration.EPSILON);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Reaction());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveModifier() {
-		try {
-			Reaction reaction = new Reaction();
-			Modifier modifier = new Modifier();
-			reaction.addModifier(modifier);
-			assertEquals(1, reaction.getModifiers().size());
-			reaction.removeModifier(modifier);
-			assertEquals(0, reaction.getModifiers().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Reaction original = new Reaction();
-			Reaction reactant = original.copy();
-			assertNotNull(reactant);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Reaction() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.reaction;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.ModelTestFunctions;
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.modifier.Catalysis;
+import lcsb.mapviewer.model.map.reaction.type.DissociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+
+public class ReactionTest extends ModelTestFunctions {
+
+	Logger								 logger	= Logger.getLogger(ReactantTest.class);
+
+	private GenericProtein species;
+	private SpeciesAlias	 alias;
+
+	@Before
+	public void setUp() throws Exception {
+		species = new GenericProtein();
+		species.setElementId("id1");
+
+		alias = new GenericProteinAlias(species);
+		alias.setAliasId("sa1");
+
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testContainsElement() {
+		try {
+			Reaction reaction = new Reaction();
+			assertFalse(reaction.containsElement(species));
+			Modifier modifier = new Catalysis(alias, species);
+			reaction.addModifier(modifier);
+			assertTrue(reaction.containsElement(species));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testComparator() {
+		try {
+			Reaction reaction1 = new Reaction();
+			reaction1.setIdReaction("2");
+			Reaction reaction2 = new Reaction();
+			reaction2.setIdReaction("1");
+			Reaction reaction3 = new Reaction();
+			reaction3.setIdReaction("3");
+			List<Reaction> reactions = new ArrayList<>();
+			reactions.add(reaction1);
+			reactions.add(reaction2);
+			reactions.add(reaction3);
+			Collections.sort(reactions, Reaction.ID_COMPARATOR);
+			assertEquals(reaction2, reactions.get(0));
+			assertEquals(reaction1, reactions.get(1));
+			assertEquals(reaction3, reactions.get(2));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			Reaction reaction1 = new Reaction();
+			reaction1.addMiriamData(new MiriamData());
+			reaction1.addSynonym("s");
+			Reaction reaction2 = new Reaction(reaction1);
+
+			assertEquals(1, reaction2.getMiriamData().size());
+			assertEquals(1, reaction2.getSynonyms().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetDistanceFromPoint() {
+		try {
+			Reaction reaction1 = new Reaction();
+			Reactant reactant = new Reactant();
+			PolylineData line = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(2.0, 0.0));
+			reactant.setLine(line);
+			reaction1.addReactant(reactant);
+
+			assertEquals(0.0, reaction1.getDistanceFromPoint(new Point2D.Double(0.0, 0.0)), Configuration.EPSILON);
+			assertEquals(0.0, reaction1.getDistanceFromPoint(new Point2D.Double(1.0, 0.0)), Configuration.EPSILON);
+			assertEquals(1.0, reaction1.getDistanceFromPoint(new Point2D.Double(1.0, 1.0)), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetClosestPointTo() {
+		try {
+			Reaction reaction1 = new Reaction();
+			Reactant reactant = new Reactant();
+			PolylineData line = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(2.0, 0.0));
+			reactant.setLine(line);
+			reaction1.addReactant(reactant);
+
+			assertEquals(0.0, reaction1.getClosestPointTo(new Point2D.Double(0.0, 0.0)).distance(new Point2D.Double(0.0, 0.0)), Configuration.EPSILON);
+			assertEquals(0.0, reaction1.getClosestPointTo(new Point2D.Double(1.0, 0.0)).distance(new Point2D.Double(1.0, 0.0)), Configuration.EPSILON);
+			assertEquals(0.0, reaction1.getClosestPointTo(new Point2D.Double(1.0, 1.0)).distance(new Point2D.Double(1.0, 0.0)), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddMiriam() {
+		try {
+			Reaction reaction1 = new Reaction();
+
+			MiriamData md = new MiriamData(MiriamType.CAS, "1");
+			reaction1.addMiriamData(md);
+
+			assertEquals(1, reaction1.getMiriamData().size());
+
+			reaction1.addMiriamData(md);
+			assertEquals(1, reaction1.getMiriamData().size());
+			assertEquals(1, getWarnings().size());
+
+			List<MiriamData> list = new ArrayList<>();
+			list.add(md);
+
+			reaction1.addMiriamData(list);
+			assertEquals(2, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Reaction reaction1 = new Reaction();
+
+			try {
+				assertNull(reaction1.getStringType());
+				fail("Exception expected");
+			} catch (NotImplementedException e) {
+			}
+			assertNull(reaction1.getReactionRect());
+
+			int id = 61;
+			List<AbstractNode> nodes = new ArrayList<>();
+			String notes = "dfp";
+
+			boolean kineticLaw = true;
+			ModelData data = new ModelData();
+			Model model = new ModelFullIndexed(data);
+			String symbol = "sybm";
+			String formula = "form";
+			Integer mechanicalConfidenceScore = 9908;
+			Double lowerBound = 9.2;
+			Double upperBound = 9.2;
+			String subsystem = "ssyst";
+			String geneProteinReaction = "GPR";
+			List<String> synonyms = new ArrayList<>();
+			String elementId = "id_e";
+
+			reaction1.setId(id);
+			reaction1.setNodes(nodes);
+			reaction1.setNotes(notes);
+			reaction1.setKineticLaw(kineticLaw);
+			assertEquals(kineticLaw, reaction1.isKineticLaw());
+			reaction1.setModel(model);
+			assertEquals(model, reaction1.getModel());
+			reaction1.setModelData(data);
+			assertEquals(data, reaction1.getModelData());
+			reaction1.setSymbol(symbol);
+			assertEquals(symbol, reaction1.getSymbol());
+			reaction1.setFormula(formula);
+			assertEquals(formula, reaction1.getFormula());
+			reaction1.setMechanicalConfidenceScore(mechanicalConfidenceScore);
+			assertEquals(mechanicalConfidenceScore, reaction1.getMechanicalConfidenceScore());
+			reaction1.setLowerBound(lowerBound);
+			assertEquals(lowerBound, reaction1.getLowerBound());
+			reaction1.setUpperBound(upperBound);
+			assertEquals(upperBound, reaction1.getUpperBound());
+			reaction1.setSubsystem(subsystem);
+			assertEquals(subsystem, reaction1.getSubsystem());
+			reaction1.setGeneProteinReaction(geneProteinReaction);
+			assertEquals(geneProteinReaction, reaction1.getGeneProteinReaction());
+			reaction1.setSynonyms(synonyms);
+			assertEquals(synonyms, reaction1.getSynonyms());
+			reaction1.setElementId(elementId);
+			assertEquals(elementId, reaction1.getElementId());
+
+			assertEquals(id, reaction1.getId());
+			assertEquals(nodes, reaction1.getNodes());
+			assertEquals(notes, reaction1.getNotes());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testVisibilityLevel() {
+		try {
+			Reaction reaction1 = new Reaction();
+			assertEquals(0, reaction1.getVisibilityLevel());
+
+			Reactant reactant = new Reactant();
+			Alias alias = new GenericProteinAlias(null, null);
+			alias.setVisibilityLevel(2);
+			reactant.setAlias(alias);
+			reaction1.addReactant(reactant);
+
+			assertEquals(2, reaction1.getVisibilityLevel());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetCenterLine() {
+		try {
+			Reaction reaction1 = new Reaction();
+
+			Reactant reactant = new Reactant();
+			PolylineData line1 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
+			reactant.setLine(line1);
+			reaction1.addReactant(reactant);
+
+			Product product = new Product();
+			PolylineData line2 = new PolylineData(new Point2D.Double(0.0, 2.0), new Point2D.Double(4.0, 0.0));
+			product.setLine(line2);
+			reaction1.addProduct(product);
+
+			Line2D line = reaction1.getCenterLine();
+			assertEquals(4.0, line.getP1().distance(line.getP2()), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetCenterPoint() {
+		try {
+			Reaction reaction1 = new Reaction();
+
+			Reactant reactant = new Reactant();
+			PolylineData line1 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
+			reactant.setLine(line1);
+			reaction1.addReactant(reactant);
+
+			Product product = new Product();
+			PolylineData line2 = new PolylineData(new Point2D.Double(0.0, 2.0), new Point2D.Double(4.0, 0.0));
+			product.setLine(line2);
+			reaction1.addProduct(product);
+
+			assertEquals(0.0, reaction1.getCenterPoint().distance(new Point2D.Double(2.0, 0.0)), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetCenterLine2() {
+		try {
+			Reaction reaction1 = new HeterodimerAssociationReaction();
+
+			Reactant reactant = new Reactant();
+			PolylineData line1 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
+			reactant.setLine(line1);
+			reaction1.addReactant(reactant);
+
+			Reactant reactant2 = new Reactant();
+			PolylineData line3 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
+			reactant2.setLine(line3);
+			reaction1.addReactant(reactant2);
+			AndOperator operator = new AndOperator();
+			operator.addInput(reactant);
+			operator.addInput(reactant2);
+			PolylineData line4 = new PolylineData(new Point2D.Double(10.0, 0.0), new Point2D.Double(11.0, 11.0));
+			operator.setLine(line4);
+			reaction1.addNode(operator);
+
+			Product product = new Product();
+			PolylineData line2 = new PolylineData(new Point2D.Double(0.0, 2.0), new Point2D.Double(4.0, 0.0));
+			product.setLine(line2);
+			reaction1.addProduct(product);
+
+			Line2D line = reaction1.getCenterLine();
+			assertEquals(6.0, line.getP1().distance(line.getP2()), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetCenterLine3() {
+		try {
+			Reaction reaction1 = new DissociationReaction();
+
+			Reactant reactant = new Reactant();
+			PolylineData line1 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
+			reactant.setLine(line1);
+			reaction1.addReactant(reactant);
+
+			Product product = new Product();
+			PolylineData line2 = new PolylineData(new Point2D.Double(0.0, 2.0), new Point2D.Double(4.0, 0.0));
+			product.setLine(line2);
+			reaction1.addProduct(product);
+
+			Product product2 = new Product();
+			PolylineData line3 = new PolylineData(new Point2D.Double(0.0, 0.0), new Point2D.Double(0.0, 1.0));
+			product2.setLine(line3);
+			reaction1.addProduct(product2);
+			SplitOperator operator = new SplitOperator();
+			operator.addOutput(product);
+			operator.addOutput(product2);
+			PolylineData line4 = new PolylineData(new Point2D.Double(10.0, 0.0), new Point2D.Double(11.0, 0.0));
+			operator.setLine(line4);
+			reaction1.addNode(operator);
+
+			Line2D line = reaction1.getCenterLine();
+			assertEquals(10.0, line.getP1().distance(line.getP2()), Configuration.EPSILON);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Reaction());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveModifier() {
+		try {
+			Reaction reaction = new Reaction();
+			Modifier modifier = new Modifier();
+			reaction.addModifier(modifier);
+			assertEquals(1, reaction.getModifiers().size());
+			reaction.removeModifier(modifier);
+			assertEquals(0, reaction.getModifiers().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Reaction original = new Reaction();
+			Reaction reactant = original.copy();
+			assertNotNull(reactant);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Reaction() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/AntisenseRnaComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/AntisenseRnaComparatorTest.java
index edbe4e3260..d09715f271 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/AntisenseRnaComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/AntisenseRnaComparatorTest.java
@@ -1,114 +1,114 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion.AntisenseRnaRegionType;
-
-public class AntisenseRnaComparatorTest {
-
-	AntisenseRnaComparator comparator = new AntisenseRnaComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			AntisenseRna aRna1 = createAntisenseRna();
-			AntisenseRna aRna2 = createAntisenseRna();
-
-			assertEquals(0, comparator.compare(aRna1, aRna1));
-
-			assertEquals(0, comparator.compare(aRna1, aRna2));
-			assertEquals(0, comparator.compare(aRna2, aRna1));
-
-			aRna1.setId(-1);
-			assertEquals(0, comparator.compare(aRna1, aRna2));
-			assertEquals(0, comparator.compare(aRna2, aRna1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			AntisenseRna aRna1 = createAntisenseRna();
-			AntisenseRna aRna2 = createAntisenseRna();
-			aRna1.getRegions().get(0).setName("bla");
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-			aRna1 = createAntisenseRna();
-			aRna2 = createAntisenseRna();
-			aRna1.getRegions().clear();
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-			aRna1 = createAntisenseRna();
-			aRna2 = createAntisenseRna();
-			assertTrue(comparator.compare(null, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			AntisenseRna unknown = createAntisenseRna();
-			unknown.setName("n");
-			assertTrue(comparator.compare(unknown, aRna2) != 0);
-
-			assertTrue(comparator.compare(unknown, new AntisenseRna() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public AntisenseRna createAntisenseRna() {
-		AntisenseRna result = new AntisenseRna();
-
-		AntisenseRnaRegion region1 = new AntisenseRnaRegion();
-		result.addRegion(region1);
-		region1.setIdAntisenseRnaRegion("a");
-		region1.setName("name");
-		region1.setPos("1");
-		region1.setSize("2");
-		region1.setType(AntisenseRnaRegionType.CODING_REGION);
-		return result;
-	}
-
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends AntisenseRna {
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp object = new Tmp();
-
-			comparator.compare(object, object);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion.AntisenseRnaRegionType;
+
+public class AntisenseRnaComparatorTest {
+
+	AntisenseRnaComparator comparator = new AntisenseRnaComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			AntisenseRna aRna1 = createAntisenseRna();
+			AntisenseRna aRna2 = createAntisenseRna();
+
+			assertEquals(0, comparator.compare(aRna1, aRna1));
+
+			assertEquals(0, comparator.compare(aRna1, aRna2));
+			assertEquals(0, comparator.compare(aRna2, aRna1));
+
+			aRna1.setId(-1);
+			assertEquals(0, comparator.compare(aRna1, aRna2));
+			assertEquals(0, comparator.compare(aRna2, aRna1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			AntisenseRna aRna1 = createAntisenseRna();
+			AntisenseRna aRna2 = createAntisenseRna();
+			aRna1.getRegions().get(0).setName("bla");
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+			aRna1 = createAntisenseRna();
+			aRna2 = createAntisenseRna();
+			aRna1.getRegions().clear();
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+			aRna1 = createAntisenseRna();
+			aRna2 = createAntisenseRna();
+			assertTrue(comparator.compare(null, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			AntisenseRna unknown = createAntisenseRna();
+			unknown.setName("n");
+			assertTrue(comparator.compare(unknown, aRna2) != 0);
+
+			assertTrue(comparator.compare(unknown, new AntisenseRna() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public AntisenseRna createAntisenseRna() {
+		AntisenseRna result = new AntisenseRna();
+
+		AntisenseRnaRegion region1 = new AntisenseRnaRegion();
+		result.addRegion(region1);
+		region1.setIdAntisenseRnaRegion("a");
+		region1.setName("name");
+		region1.setPos("1");
+		region1.setSize("2");
+		region1.setType(AntisenseRnaRegionType.CODING_REGION);
+		return result;
+	}
+
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends AntisenseRna {
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp object = new Tmp();
+
+			comparator.compare(object, object);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/AntisenseRnaTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/AntisenseRnaTest.java
index c28775dd8d..a57f4364fc 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/AntisenseRnaTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/AntisenseRnaTest.java
@@ -1,163 +1,163 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-
-public class AntisenseRnaTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new AntisenseRna());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor1() {
-		try {
-			AntisenseRna original = new AntisenseRna();
-			original.addRegion(new AntisenseRnaRegion());
-			AntisenseRna aRna = new AntisenseRna(original);
-			assertNotNull(aRna);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddRnaRegion() {
-		try {
-			AntisenseRna original = new AntisenseRna();
-			AntisenseRnaRegion region = new AntisenseRnaRegion();
-			region.setIdAntisenseRnaRegion("id1");
-			original.addRegion(region);
-
-			AntisenseRnaRegion region2 = new AntisenseRnaRegion();
-			region2.setIdAntisenseRnaRegion("id1");
-			region2.setName("nam");
-			original.addRegion(region2);
-
-			assertEquals(1, original.getRegions().size());
-
-			assertEquals("nam", original.getRegions().get(0).getName());
-
-			AntisenseRnaRegion region3 = new AntisenseRnaRegion();
-			region3.setIdAntisenseRnaRegion("id2");
-			region3.setName("nam");
-			original.addRegion(region3);
-
-			assertEquals(2, original.getRegions().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdate() {
-		try {
-			AntisenseRna original = new AntisenseRna();
-			AntisenseRnaRegion region2 = new AntisenseRnaRegion();
-			region2.setIdAntisenseRnaRegion("id1");
-			region2.setName("nam");
-			original.addRegion(region2);
-			AntisenseRnaRegion region3 = new AntisenseRnaRegion();
-			region3.setIdAntisenseRnaRegion("id2");
-			region3.setName("nam");
-			original.addRegion(region3);
-
-			AntisenseRna copy = new AntisenseRna(original);
-			copy.addRegion(new AntisenseRnaRegion());
-			copy.getRegions().get(0).setState(ModificationState.ACETYLATED);
-
-			original.update(copy);
-
-			boolean acetylatedFound = false;
-			for (AntisenseRnaRegion region : copy.getRegions()) {
-				if (ModificationState.ACETYLATED.equals(region.getState())) {
-					acetylatedFound = true;
-				}
-			}
-			assertTrue(acetylatedFound);
-			assertEquals(3, copy.getRegions().size());
-
-			original.update(new GenericProtein());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			AntisenseRna aRna = new AntisenseRna(new Species());
-			assertNotNull(aRna.getStringType());
-
-			List<AntisenseRnaRegion> regions = new ArrayList<>();
-
-			aRna.setRegions(regions);
-
-			assertEquals(regions, aRna.getRegions());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			AntisenseRna aRna = new AntisenseRna().copy();
-			assertNotNull(aRna);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new AntisenseRna() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+
+public class AntisenseRnaTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new AntisenseRna());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor1() {
+		try {
+			AntisenseRna original = new AntisenseRna();
+			original.addRegion(new AntisenseRnaRegion());
+			AntisenseRna aRna = new AntisenseRna(original);
+			assertNotNull(aRna);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddRnaRegion() {
+		try {
+			AntisenseRna original = new AntisenseRna();
+			AntisenseRnaRegion region = new AntisenseRnaRegion();
+			region.setIdAntisenseRnaRegion("id1");
+			original.addRegion(region);
+
+			AntisenseRnaRegion region2 = new AntisenseRnaRegion();
+			region2.setIdAntisenseRnaRegion("id1");
+			region2.setName("nam");
+			original.addRegion(region2);
+
+			assertEquals(1, original.getRegions().size());
+
+			assertEquals("nam", original.getRegions().get(0).getName());
+
+			AntisenseRnaRegion region3 = new AntisenseRnaRegion();
+			region3.setIdAntisenseRnaRegion("id2");
+			region3.setName("nam");
+			original.addRegion(region3);
+
+			assertEquals(2, original.getRegions().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdate() {
+		try {
+			AntisenseRna original = new AntisenseRna();
+			AntisenseRnaRegion region2 = new AntisenseRnaRegion();
+			region2.setIdAntisenseRnaRegion("id1");
+			region2.setName("nam");
+			original.addRegion(region2);
+			AntisenseRnaRegion region3 = new AntisenseRnaRegion();
+			region3.setIdAntisenseRnaRegion("id2");
+			region3.setName("nam");
+			original.addRegion(region3);
+
+			AntisenseRna copy = new AntisenseRna(original);
+			copy.addRegion(new AntisenseRnaRegion());
+			copy.getRegions().get(0).setState(ModificationState.ACETYLATED);
+
+			original.update(copy);
+
+			boolean acetylatedFound = false;
+			for (AntisenseRnaRegion region : copy.getRegions()) {
+				if (ModificationState.ACETYLATED.equals(region.getState())) {
+					acetylatedFound = true;
+				}
+			}
+			assertTrue(acetylatedFound);
+			assertEquals(3, copy.getRegions().size());
+
+			original.update(new GenericProtein());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			AntisenseRna aRna = new AntisenseRna(new Species());
+			assertNotNull(aRna.getStringType());
+
+			List<AntisenseRnaRegion> regions = new ArrayList<>();
+
+			aRna.setRegions(regions);
+
+			assertEquals(regions, aRna.getRegions());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			AntisenseRna aRna = new AntisenseRna().copy();
+			assertNotNull(aRna);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new AntisenseRna() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/ComplexSpeciesComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/ComplexSpeciesComparatorTest.java
index bc18f99077..a35bd7534f 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/ComplexSpeciesComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/ComplexSpeciesComparatorTest.java
@@ -1,300 +1,300 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-
-public class ComplexSpeciesComparatorTest {
-	Logger									 logger			= Logger.getLogger(ComplexSpeciesComparatorTest.class);
-
-	ComplexSpeciesComparator comparator	= new ComplexSpeciesComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			ComplexSpecies complex1 = createComplexSpecies();
-			ComplexSpecies complex2 = createComplexSpecies();
-
-			assertEquals(0, comparator.compare(complex1, complex1));
-
-			assertEquals(0, comparator.compare(complex1, complex2));
-			assertEquals(0, comparator.compare(complex2, complex1));
-
-			complex1.setId(-1);
-			assertEquals(0, comparator.compare(complex1, complex2));
-			assertEquals(0, comparator.compare(complex2, complex1));
-
-			complex2.addElement(new Compartment("test"));
-			complex1.addElement(new Compartment("test"));
-			assertEquals(0, comparator.compare(complex1, complex2));
-			assertEquals(0, comparator.compare(complex2, complex1));
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testInvalidComp() throws Exception {
-		try {
-			class Tmp extends ComplexSpecies {
-				private static final long serialVersionUID = 1L;
-			}
-
-			comparator.compare(new Tmp(), new Tmp());
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testInvalidComp2() throws Exception {
-		try {
-			ComplexSpecies complex1 = createComplexSpecies();
-			ComplexSpecies complex2 = createComplexSpecies();
-
-			complex2.addElement(new Compartment("test"));
-			complex1.addElement(new Element() {
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public String getElementId() {
-					return null;
-				}
-
-				@Override
-				public void setElementId(String id) {
-				}
-
-				@Override
-				public Element copy() {
-					return null;
-				}
-
-				@Override
-				public String getStringType() {
-					return null;
-				}
-			});
-			comparator.compare(complex1, complex2);
-			comparator.compare(complex2, complex1);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testInvalidComp3() throws Exception {
-		try {
-			ComplexSpecies complex1 = createComplexSpecies();
-			ComplexSpecies complex2 = createComplexSpecies();
-			Compartment c = new Compartment("test");
-			c.setName("a");
-			complex2.addElement(c);
-			c.setName("");
-			complex2.addElement(new Compartment("test"));
-			complex1.addElement(new Compartment("test"));
-			complex1.addElement(new Element() {
-				private static final long serialVersionUID = 1L;
-
-				@Override
-				public String getElementId() {
-					return null;
-				}
-
-				@Override
-				public void setElementId(String id) {
-				}
-
-				@Override
-				public Element copy() {
-					return null;
-				}
-
-				@Override
-				public String getStringType() {
-					return null;
-				}
-			});
-			comparator.compare(complex2, complex1);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testDifferent() throws Exception {
-		try {
-			ComplexSpecies complex1 = createComplexSpecies();
-			ComplexSpecies complex2 = createComplexSpecies();
-			complex1.setHomodimer(123);
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-			complex1 = createComplexSpecies();
-			complex2 = createComplexSpecies();
-			complex1.getElements().iterator().next().setNotes("bla");
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-			complex1 = createComplexSpecies();
-			complex2 = createComplexSpecies();
-			complex1.getElements().clear();
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-			complex1 = createComplexSpecies();
-			complex2 = createComplexSpecies();
-			assertTrue(comparator.compare(null, complex2) != 0);
-			assertTrue(comparator.compare(complex2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			complex1 = createComplexSpecies();
-			complex2 = createComplexSpecies();
-			ComplexSpecies child = (ComplexSpecies) complex1.getElements().iterator().next();
-			child.getElements().iterator().next().setNotes("grand child notes");
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-			complex1 = createComplexSpecies();
-			complex2 = createComplexSpecies();
-			Protein prot = new Protein();
-			prot.setElementId("test");
-			complex1.addElement(prot);
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-			complex1 = createComplexSpecies();
-			complex2 = createComplexSpecies();
-			complex1.setStructuralState("str");
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-			assertTrue(comparator.compare(new ComplexSpecies(), new ComplexSpecies() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent3() throws Exception {
-		try {
-			ComplexSpecies complex1 = createComplexSpecies();
-			ComplexSpecies complex2 = createComplexSpecies();
-			Protein prot = new Protein();
-			prot.setElementId("test");
-			complex1.addElement(prot);
-			prot = new Protein();
-			prot.setElementId("test2");
-			complex2.addElement(prot);
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent4() throws Exception {
-		try {
-			ComplexSpecies complex1 = createComplexSpecies();
-			ComplexSpecies complex2 = createComplexSpecies();
-			Compartment c = new Compartment("test");
-			c.setName("a");
-			complex2.addElement(c);
-			complex2.addElement(new Compartment("test"));
-			c.setName("");
-
-			complex1.addElement(new Compartment("test"));
-			Compartment d = new Compartment("test2");
-			d.setName("a");
-			complex1.addElement(d);
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent2() throws Exception {
-		try {
-			ComplexSpecies complex1 = createComplexSpecies();
-			ComplexSpecies complex2 = createComplexSpecies();
-			Compartment comp = new Compartment();
-			comp.setElementId("test");
-			comp.setFullName("X");
-			complex1.addElement(comp);
-			complex2.addElement(new Compartment("test"));
-			assertTrue(comparator.compare(complex1, complex2) != 0);
-			assertTrue(comparator.compare(complex2, complex1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	public ComplexSpecies createComplexSpecies() {
-		ComplexSpecies result = new ComplexSpecies();
-
-		result.setHypothetical(true);
-		result.setHomodimer(3);
-
-		ComplexSpecies child = new ComplexSpecies();
-		result.addElement(child);
-		child.setCharge(12);
-		child.setName("buu");
-		child.setNotes("hey, hi, hello");
-
-		ComplexSpecies grandChild = new ComplexSpecies();
-		child.addElement(grandChild);
-		child.setCharge(123);
-		child.setName("buus");
-		child.setNotes("hey, hi, hello !!");
-
-		return result;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+
+public class ComplexSpeciesComparatorTest {
+	Logger									 logger			= Logger.getLogger(ComplexSpeciesComparatorTest.class);
+
+	ComplexSpeciesComparator comparator	= new ComplexSpeciesComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			ComplexSpecies complex1 = createComplexSpecies();
+			ComplexSpecies complex2 = createComplexSpecies();
+
+			assertEquals(0, comparator.compare(complex1, complex1));
+
+			assertEquals(0, comparator.compare(complex1, complex2));
+			assertEquals(0, comparator.compare(complex2, complex1));
+
+			complex1.setId(-1);
+			assertEquals(0, comparator.compare(complex1, complex2));
+			assertEquals(0, comparator.compare(complex2, complex1));
+
+			complex2.addElement(new Compartment("test"));
+			complex1.addElement(new Compartment("test"));
+			assertEquals(0, comparator.compare(complex1, complex2));
+			assertEquals(0, comparator.compare(complex2, complex1));
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testInvalidComp() throws Exception {
+		try {
+			class Tmp extends ComplexSpecies {
+				private static final long serialVersionUID = 1L;
+			}
+
+			comparator.compare(new Tmp(), new Tmp());
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testInvalidComp2() throws Exception {
+		try {
+			ComplexSpecies complex1 = createComplexSpecies();
+			ComplexSpecies complex2 = createComplexSpecies();
+
+			complex2.addElement(new Compartment("test"));
+			complex1.addElement(new Element() {
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public String getElementId() {
+					return null;
+				}
+
+				@Override
+				public void setElementId(String id) {
+				}
+
+				@Override
+				public Element copy() {
+					return null;
+				}
+
+				@Override
+				public String getStringType() {
+					return null;
+				}
+			});
+			comparator.compare(complex1, complex2);
+			comparator.compare(complex2, complex1);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testInvalidComp3() throws Exception {
+		try {
+			ComplexSpecies complex1 = createComplexSpecies();
+			ComplexSpecies complex2 = createComplexSpecies();
+			Compartment c = new Compartment("test");
+			c.setName("a");
+			complex2.addElement(c);
+			c.setName("");
+			complex2.addElement(new Compartment("test"));
+			complex1.addElement(new Compartment("test"));
+			complex1.addElement(new Element() {
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public String getElementId() {
+					return null;
+				}
+
+				@Override
+				public void setElementId(String id) {
+				}
+
+				@Override
+				public Element copy() {
+					return null;
+				}
+
+				@Override
+				public String getStringType() {
+					return null;
+				}
+			});
+			comparator.compare(complex2, complex1);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testDifferent() throws Exception {
+		try {
+			ComplexSpecies complex1 = createComplexSpecies();
+			ComplexSpecies complex2 = createComplexSpecies();
+			complex1.setHomodimer(123);
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+			complex1 = createComplexSpecies();
+			complex2 = createComplexSpecies();
+			complex1.getElements().iterator().next().setNotes("bla");
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+			complex1 = createComplexSpecies();
+			complex2 = createComplexSpecies();
+			complex1.getElements().clear();
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+			complex1 = createComplexSpecies();
+			complex2 = createComplexSpecies();
+			assertTrue(comparator.compare(null, complex2) != 0);
+			assertTrue(comparator.compare(complex2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			complex1 = createComplexSpecies();
+			complex2 = createComplexSpecies();
+			ComplexSpecies child = (ComplexSpecies) complex1.getElements().iterator().next();
+			child.getElements().iterator().next().setNotes("grand child notes");
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+			complex1 = createComplexSpecies();
+			complex2 = createComplexSpecies();
+			Protein prot = new GenericProtein();
+			prot.setElementId("test");
+			complex1.addElement(prot);
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+			complex1 = createComplexSpecies();
+			complex2 = createComplexSpecies();
+			complex1.setStructuralState("str");
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+			assertTrue(comparator.compare(new ComplexSpecies(), new ComplexSpecies() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent3() throws Exception {
+		try {
+			ComplexSpecies complex1 = createComplexSpecies();
+			ComplexSpecies complex2 = createComplexSpecies();
+			Protein prot = new GenericProtein();
+			prot.setElementId("test");
+			complex1.addElement(prot);
+			prot = new GenericProtein();
+			prot.setElementId("test2");
+			complex2.addElement(prot);
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent4() throws Exception {
+		try {
+			ComplexSpecies complex1 = createComplexSpecies();
+			ComplexSpecies complex2 = createComplexSpecies();
+			Compartment c = new Compartment("test");
+			c.setName("a");
+			complex2.addElement(c);
+			complex2.addElement(new Compartment("test"));
+			c.setName("");
+
+			complex1.addElement(new Compartment("test"));
+			Compartment d = new Compartment("test2");
+			d.setName("a");
+			complex1.addElement(d);
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent2() throws Exception {
+		try {
+			ComplexSpecies complex1 = createComplexSpecies();
+			ComplexSpecies complex2 = createComplexSpecies();
+			Compartment comp = new Compartment();
+			comp.setElementId("test");
+			comp.setFullName("X");
+			complex1.addElement(comp);
+			complex2.addElement(new Compartment("test"));
+			assertTrue(comparator.compare(complex1, complex2) != 0);
+			assertTrue(comparator.compare(complex2, complex1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	public ComplexSpecies createComplexSpecies() {
+		ComplexSpecies result = new ComplexSpecies();
+
+		result.setHypothetical(true);
+		result.setHomodimer(3);
+
+		ComplexSpecies child = new ComplexSpecies();
+		result.addElement(child);
+		child.setCharge(12);
+		child.setName("buu");
+		child.setNotes("hey, hi, hello");
+
+		ComplexSpecies grandChild = new ComplexSpecies();
+		child.addElement(grandChild);
+		child.setCharge(123);
+		child.setName("buus");
+		child.setNotes("hey, hi, hello !!");
+
+		return result;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/ComplexSpeciesTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/ComplexSpeciesTest.java
index 9b33e4c406..943f935e1b 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/ComplexSpeciesTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/ComplexSpeciesTest.java
@@ -1,139 +1,139 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.Element;
-
-public class ComplexSpeciesTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new ComplexSpecies());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor1() {
-		try {
-			ComplexSpecies degraded = new ComplexSpecies(new Species());
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			ComplexSpecies species = new ComplexSpecies();
-			species.addElement(new Species());
-			ComplexSpecies complex = new ComplexSpecies(species);
-			assertNotNull(complex.getStringType());
-
-			Set<Element> elements = new HashSet<>();
-			complex.setElements(elements);
-			assertEquals(elements, complex.getElements());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddElement() {
-		try {
-			ComplexSpecies species = new ComplexSpecies();
-			species.addElement(new Species());
-			species.addElement(new Species());
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetStructuralState() {
-		try {
-			ComplexSpecies species = new ComplexSpecies();
-			species.setStructuralState("a");
-			species.setStructuralState("b");
-			assertEquals("b", species.getStructuralState());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAllSimpleChildren() {
-		try {
-			ComplexSpecies species = new ComplexSpecies();
-			species.addElement(new Species());
-			ComplexSpecies complex = new ComplexSpecies("a");
-			complex.addElement(new Species("s"));
-			complex.addElement(new Species("d"));
-			species.addElement(complex);
-			assertEquals(3, species.getAllSimpleChildren().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			ComplexSpecies degraded = new ComplexSpecies().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new ComplexSpecies() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.Element;
+
+public class ComplexSpeciesTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new ComplexSpecies());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor1() {
+		try {
+			ComplexSpecies degraded = new ComplexSpecies(new Species());
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			ComplexSpecies species = new ComplexSpecies();
+			species.addElement(new Species());
+			ComplexSpecies complex = new ComplexSpecies(species);
+			assertNotNull(complex.getStringType());
+
+			Set<Element> elements = new HashSet<>();
+			complex.setElements(elements);
+			assertEquals(elements, complex.getElements());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddElement() {
+		try {
+			ComplexSpecies species = new ComplexSpecies();
+			species.addElement(new Species());
+			species.addElement(new Species());
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetStructuralState() {
+		try {
+			ComplexSpecies species = new ComplexSpecies();
+			species.setStructuralState("a");
+			species.setStructuralState("b");
+			assertEquals("b", species.getStructuralState());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAllSimpleChildren() {
+		try {
+			ComplexSpecies species = new ComplexSpecies();
+			species.addElement(new Species());
+			ComplexSpecies complex = new ComplexSpecies("a");
+			complex.addElement(new Species("s"));
+			complex.addElement(new Species("d"));
+			species.addElement(complex);
+			assertEquals(3, species.getAllSimpleChildren().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			ComplexSpecies degraded = new ComplexSpecies().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new ComplexSpecies() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/DegradedComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/DegradedComparatorTest.java
index fcdddc6015..793abb6410 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/DegradedComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/DegradedComparatorTest.java
@@ -1,100 +1,100 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class DegradedComparatorTest {
-
-	DegradedComparator comparator = new DegradedComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Degraded degraded1 = createDegraded();
-			Degraded degraded2 = createDegraded();
-
-			assertEquals(0, comparator.compare(degraded1, degraded1));
-
-			assertEquals(0, comparator.compare(degraded1, degraded2));
-			assertEquals(0, comparator.compare(degraded2, degraded1));
-
-			degraded1.setId(-1);
-			assertEquals(0, comparator.compare(degraded1, degraded2));
-			assertEquals(0, comparator.compare(degraded2, degraded1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Degraded degraded1 = createDegraded();
-			Degraded degraded2 = createDegraded();
-			degraded1 = createDegraded();
-			degraded2 = createDegraded();
-			degraded1.setCharge(54);
-			assertTrue(comparator.compare(degraded1, degraded2) != 0);
-			assertTrue(comparator.compare(degraded2, degraded1) != 0);
-
-			degraded1 = createDegraded();
-			degraded2 = createDegraded();
-			assertTrue(comparator.compare(null, degraded2) != 0);
-			assertTrue(comparator.compare(degraded2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			Degraded degraded = createDegraded();
-			degraded.setName("n");
-			assertTrue(comparator.compare(degraded, degraded1) != 0);
-
-			assertTrue(comparator.compare(degraded, new Degraded() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public Degraded createDegraded() {
-		Degraded result = new Degraded();
-		result.setCharge(12);
-		return result;
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends Degraded{
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp object = new Tmp();
-
-			comparator.compare(object, object);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class DegradedComparatorTest {
+
+	DegradedComparator comparator = new DegradedComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Degraded degraded1 = createDegraded();
+			Degraded degraded2 = createDegraded();
+
+			assertEquals(0, comparator.compare(degraded1, degraded1));
+
+			assertEquals(0, comparator.compare(degraded1, degraded2));
+			assertEquals(0, comparator.compare(degraded2, degraded1));
+
+			degraded1.setId(-1);
+			assertEquals(0, comparator.compare(degraded1, degraded2));
+			assertEquals(0, comparator.compare(degraded2, degraded1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Degraded degraded1 = createDegraded();
+			Degraded degraded2 = createDegraded();
+			degraded1 = createDegraded();
+			degraded2 = createDegraded();
+			degraded1.setCharge(54);
+			assertTrue(comparator.compare(degraded1, degraded2) != 0);
+			assertTrue(comparator.compare(degraded2, degraded1) != 0);
+
+			degraded1 = createDegraded();
+			degraded2 = createDegraded();
+			assertTrue(comparator.compare(null, degraded2) != 0);
+			assertTrue(comparator.compare(degraded2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			Degraded degraded = createDegraded();
+			degraded.setName("n");
+			assertTrue(comparator.compare(degraded, degraded1) != 0);
+
+			assertTrue(comparator.compare(degraded, new Degraded() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public Degraded createDegraded() {
+		Degraded result = new Degraded();
+		result.setCharge(12);
+		return result;
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends Degraded{
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp object = new Tmp();
+
+			comparator.compare(object, object);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/DegradedTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/DegradedTest.java
index 0fda8c3323..495b9157da 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/DegradedTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/DegradedTest.java
@@ -1,84 +1,84 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class DegradedTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Degraded());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor1() {
-		try {
-			Degraded degraded = new Degraded(new Species());
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Degraded degraded = new Degraded(new Species());
-			assertNotNull(degraded.getStringType());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Degraded degraded = new Degraded().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Degraded() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class DegradedTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Degraded());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor1() {
+		try {
+			Degraded degraded = new Degraded(new Species());
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Degraded degraded = new Degraded(new Species());
+			assertNotNull(degraded.getStringType());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Degraded degraded = new Degraded().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Degraded() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/DrugComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/DrugComparatorTest.java
index 234ac4b8bc..2ca3baa4e2 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/DrugComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/DrugComparatorTest.java
@@ -1,92 +1,92 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class DrugComparatorTest {
-
-	DrugComparator	comparator	= new DrugComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Drug drug1 = createDrug();
-			Drug drug2 = createDrug();
-
-			assertEquals(0, comparator.compare(drug1, drug1));
-
-			assertEquals(0, comparator.compare(drug1, drug2));
-			assertEquals(0, comparator.compare(drug2, drug1));
-
-			drug1.setId(-1);
-			assertEquals(0, comparator.compare(drug1, drug2));
-			assertEquals(0, comparator.compare(drug2, drug1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Drug drug2 = createDrug();
-			assertTrue(comparator.compare(null, drug2) != 0);
-			assertTrue(comparator.compare(drug2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			Drug drug = createDrug();
-			drug.setName("n");
-			assertTrue(comparator.compare(drug, drug2) != 0);
-
-			assertTrue(comparator.compare(drug, new Drug() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public Drug createDrug() {
-		Drug result = new Drug();
-		return result;
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends Drug{
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp object = new Tmp();
-
-			comparator.compare(object, object);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class DrugComparatorTest {
+
+	DrugComparator	comparator	= new DrugComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Drug drug1 = createDrug();
+			Drug drug2 = createDrug();
+
+			assertEquals(0, comparator.compare(drug1, drug1));
+
+			assertEquals(0, comparator.compare(drug1, drug2));
+			assertEquals(0, comparator.compare(drug2, drug1));
+
+			drug1.setId(-1);
+			assertEquals(0, comparator.compare(drug1, drug2));
+			assertEquals(0, comparator.compare(drug2, drug1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Drug drug2 = createDrug();
+			assertTrue(comparator.compare(null, drug2) != 0);
+			assertTrue(comparator.compare(drug2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			Drug drug = createDrug();
+			drug.setName("n");
+			assertTrue(comparator.compare(drug, drug2) != 0);
+
+			assertTrue(comparator.compare(drug, new Drug() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public Drug createDrug() {
+		Drug result = new Drug();
+		return result;
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends Drug{
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp object = new Tmp();
+
+			comparator.compare(object, object);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/DrugTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/DrugTest.java
index 54f426b6eb..57d7c4efc4 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/DrugTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/DrugTest.java
@@ -1,86 +1,86 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class DrugTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Drug());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-
-	@Test
-	public void testConstructor1() {
-		try {
-			Drug degraded = new Drug(new Species());
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Drug degraded = new Drug(new Species());
-			assertNotNull(degraded.getStringType());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Drug degraded = new Drug().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Drug() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class DrugTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Drug());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+
+	@Test
+	public void testConstructor1() {
+		try {
+			Drug degraded = new Drug(new Species());
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Drug degraded = new Drug(new Species());
+			assertNotNull(degraded.getStringType());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Drug degraded = new Drug().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Drug() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/GeneComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/GeneComparatorTest.java
index 942d97134f..69a1698416 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/GeneComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/GeneComparatorTest.java
@@ -1,117 +1,117 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class GeneComparatorTest {
-
-	GeneComparator	comparator	= new GeneComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Gene gene1 = createGene();
-			Gene gene2 = createGene();
-
-			assertEquals(0, comparator.compare(gene1, gene1));
-
-			assertEquals(0, comparator.compare(gene1, gene2));
-			assertEquals(0, comparator.compare(gene2, gene1));
-
-			gene1.setId(-1);
-			assertEquals(0, comparator.compare(gene1, gene2));
-			assertEquals(0, comparator.compare(gene2, gene1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Gene gene1 = createGene();
-			Gene gene2 = createGene();
-			gene1.getModificationResidues().get(0).setName("bla");
-			assertTrue(comparator.compare(gene1, gene2) != 0);
-			assertTrue(comparator.compare(gene2, gene1) != 0);
-
-			gene1 = createGene();
-			gene2 = createGene();
-			gene1.getModificationResidues().clear();
-			assertTrue(comparator.compare(gene1, gene2) != 0);
-			assertTrue(comparator.compare(gene2, gene1) != 0);
-
-			gene1 = createGene();
-			gene2 = createGene();
-			assertTrue(comparator.compare(null, gene2) != 0);
-			assertTrue(comparator.compare(gene2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			Gene gene = createGene();
-			gene.setName("n");
-			assertTrue(comparator.compare(gene, gene2) != 0);
-
-			assertTrue(comparator.compare(gene, new Gene() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public Gene createGene() {
-		Gene result = new Gene();
-		result.setHypothetical(true);
-
-		ModificationResidue residue = new ModificationResidue();
-		result.addModificationResidue(residue);
-
-		residue.setIdModificationResidue("a");
-		residue.setName("name");
-		residue.setAngle("1");
-		residue.setSize("2");
-		residue.setSide("23");
-		residue.setState(ModificationState.ACETYLATED);
-		return result;
-	}
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends Gene{
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp object = new Tmp();
-
-			comparator.compare(object, object);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class GeneComparatorTest {
+
+	GeneComparator	comparator	= new GeneComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Gene gene1 = createGene();
+			Gene gene2 = createGene();
+
+			assertEquals(0, comparator.compare(gene1, gene1));
+
+			assertEquals(0, comparator.compare(gene1, gene2));
+			assertEquals(0, comparator.compare(gene2, gene1));
+
+			gene1.setId(-1);
+			assertEquals(0, comparator.compare(gene1, gene2));
+			assertEquals(0, comparator.compare(gene2, gene1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Gene gene1 = createGene();
+			Gene gene2 = createGene();
+			gene1.getModificationResidues().get(0).setName("bla");
+			assertTrue(comparator.compare(gene1, gene2) != 0);
+			assertTrue(comparator.compare(gene2, gene1) != 0);
+
+			gene1 = createGene();
+			gene2 = createGene();
+			gene1.getModificationResidues().clear();
+			assertTrue(comparator.compare(gene1, gene2) != 0);
+			assertTrue(comparator.compare(gene2, gene1) != 0);
+
+			gene1 = createGene();
+			gene2 = createGene();
+			assertTrue(comparator.compare(null, gene2) != 0);
+			assertTrue(comparator.compare(gene2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			Gene gene = createGene();
+			gene.setName("n");
+			assertTrue(comparator.compare(gene, gene2) != 0);
+
+			assertTrue(comparator.compare(gene, new Gene() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public Gene createGene() {
+		Gene result = new Gene();
+		result.setHypothetical(true);
+
+		ModificationResidue residue = new ModificationResidue();
+		result.addModificationResidue(residue);
+
+		residue.setIdModificationResidue("a");
+		residue.setName("name");
+		residue.setAngle("1");
+		residue.setSize("2");
+		residue.setSide("23");
+		residue.setState(ModificationState.ACETYLATED);
+		return result;
+	}
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends Gene{
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp object = new Tmp();
+
+			comparator.compare(object, object);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/GeneTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/GeneTest.java
index 833af525e6..d1964f7db7 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/GeneTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/GeneTest.java
@@ -1,132 +1,132 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-
-public class GeneTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Gene());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor1() {
-		try {
-			Gene original = new Gene();
-			original.addModificationResidue(new ModificationResidue());
-			Gene gene = new Gene(original);
-			assertNotNull(gene);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			List<ModificationResidue> modificationResidues = new ArrayList<>();
-			Gene gene = new Gene(new Species());
-			assertNotNull(gene.getStringType());
-			gene.setModificationResidues(modificationResidues);
-			assertEquals(modificationResidues, gene.getModificationResidues());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Gene degraded = new Gene().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Gene() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdate() {
-		try {
-			Gene gene = new Gene();
-			Gene gene2 = new Gene();
-			List<ModificationResidue> residues = new ArrayList<>();
-			residues.add(new ModificationResidue());
-
-			gene2.setModificationResidues(residues);
-
-			gene.update(gene2);
-			assertEquals(1, gene.getModificationResidues().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddModificationResidue() {
-		try {
-			Gene gene = new Gene();
-			ModificationResidue mr = new ModificationResidue();
-			mr.setIdModificationResidue("id1");
-
-			ModificationResidue mr2 = new ModificationResidue();
-			mr2.setIdModificationResidue("id1");
-
-			gene.addModificationResidue(mr);
-			assertEquals(1, gene.getModificationResidues().size());
-			gene.addModificationResidue(mr2);
-			assertEquals(1, gene.getModificationResidues().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+
+public class GeneTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Gene());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor1() {
+		try {
+			Gene original = new Gene();
+			original.addModificationResidue(new ModificationResidue());
+			Gene gene = new Gene(original);
+			assertNotNull(gene);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			List<ModificationResidue> modificationResidues = new ArrayList<>();
+			Gene gene = new Gene(new Species());
+			assertNotNull(gene.getStringType());
+			gene.setModificationResidues(modificationResidues);
+			assertEquals(modificationResidues, gene.getModificationResidues());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Gene degraded = new Gene().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Gene() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdate() {
+		try {
+			Gene gene = new Gene();
+			Gene gene2 = new Gene();
+			List<ModificationResidue> residues = new ArrayList<>();
+			residues.add(new ModificationResidue());
+
+			gene2.setModificationResidues(residues);
+
+			gene.update(gene2);
+			assertEquals(1, gene.getModificationResidues().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddModificationResidue() {
+		try {
+			Gene gene = new Gene();
+			ModificationResidue mr = new ModificationResidue();
+			mr.setIdModificationResidue("id1");
+
+			ModificationResidue mr2 = new ModificationResidue();
+			mr2.setIdModificationResidue("id1");
+
+			gene.addModificationResidue(mr);
+			assertEquals(1, gene.getModificationResidues().size());
+			gene.addModificationResidue(mr2);
+			assertEquals(1, gene.getModificationResidues().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/GenericProteinTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/GenericProteinTest.java
index 1a23cf3702..a71219dde6 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/GenericProteinTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/GenericProteinTest.java
@@ -1,72 +1,72 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class GenericProteinTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new GenericProtein());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			GenericProtein species = new GenericProtein(new Species());
-			assertNotNull(species);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy1() {
-		try {
-			GenericProtein species = new GenericProtein(new Species()).copy();
-			assertNotNull(species);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy2() {
-		try {
-			new GenericProtein() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class GenericProteinTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new GenericProtein());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			GenericProtein species = new GenericProtein(new Species());
+			assertNotNull(species);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy1() {
+		try {
+			GenericProtein species = new GenericProtein(new Species()).copy();
+			assertNotNull(species);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy2() {
+		try {
+			new GenericProtein() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/IonChannelProteinTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/IonChannelProteinTest.java
index 420e585b93..211c9dd81c 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/IonChannelProteinTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/IonChannelProteinTest.java
@@ -1,73 +1,73 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class IonChannelProteinTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new IonChannelProtein());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			IonChannelProtein species = new IonChannelProtein(new Species());
-			assertNotNull(species);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy1() {
-		try {
-			IonChannelProtein species = new IonChannelProtein(new Species()).copy();
-			assertNotNull(species);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy2() {
-		try {
-			new IonChannelProtein() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class IonChannelProteinTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new IonChannelProtein());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			IonChannelProtein species = new IonChannelProtein(new Species());
+			assertNotNull(species);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy1() {
+		try {
+			IonChannelProtein species = new IonChannelProtein(new Species()).copy();
+			assertNotNull(species);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy2() {
+		try {
+			new IonChannelProtein() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/IonComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/IonComparatorTest.java
index 82941959fb..c81434ca60 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/IonComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/IonComparatorTest.java
@@ -1,91 +1,91 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class IonComparatorTest {
-
-	IonComparator	comparator	= new IonComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Ion ion1 = createIon();
-			Ion ion2 = createIon();
-
-			assertEquals(0, comparator.compare(ion1, ion1));
-
-			assertEquals(0, comparator.compare(ion1, ion2));
-			assertEquals(0, comparator.compare(ion2, ion1));
-
-			ion1.setId(-1);
-			assertEquals(0, comparator.compare(ion1, ion2));
-			assertEquals(0, comparator.compare(ion2, ion1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Ione exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Ion ion2 = createIon();
-			assertTrue(comparator.compare(null, ion2) != 0);
-			assertTrue(comparator.compare(ion2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			Ion ion = createIon();
-			ion.setName("n");
-			assertTrue(comparator.compare(ion, ion2) != 0);
-
-			assertTrue(comparator.compare(ion, new Ion() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	public Ion createIon() {
-		Ion result = new Ion();
-		return result;
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends Ion {
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp object = new Tmp();
-
-			comparator.compare(object, object);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class IonComparatorTest {
+
+	IonComparator	comparator	= new IonComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Ion ion1 = createIon();
+			Ion ion2 = createIon();
+
+			assertEquals(0, comparator.compare(ion1, ion1));
+
+			assertEquals(0, comparator.compare(ion1, ion2));
+			assertEquals(0, comparator.compare(ion2, ion1));
+
+			ion1.setId(-1);
+			assertEquals(0, comparator.compare(ion1, ion2));
+			assertEquals(0, comparator.compare(ion2, ion1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Ione exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Ion ion2 = createIon();
+			assertTrue(comparator.compare(null, ion2) != 0);
+			assertTrue(comparator.compare(ion2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			Ion ion = createIon();
+			ion.setName("n");
+			assertTrue(comparator.compare(ion, ion2) != 0);
+
+			assertTrue(comparator.compare(ion, new Ion() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	public Ion createIon() {
+		Ion result = new Ion();
+		return result;
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends Ion {
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp object = new Tmp();
+
+			comparator.compare(object, object);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/IonTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/IonTest.java
index b58cfe97d7..03de3ea919 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/IonTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/IonTest.java
@@ -1,86 +1,86 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class IonTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Ion());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-
-	@Test
-	public void testConstructor1() {
-		try {
-			Ion degraded = new Ion(new Species());
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Ion degraded = new Ion(new Species());
-			assertNotNull(degraded.getStringType());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Ion degraded = new Ion().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Ion() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class IonTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Ion());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+
+	@Test
+	public void testConstructor1() {
+		try {
+			Ion degraded = new Ion(new Species());
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Ion degraded = new Ion(new Species());
+			assertNotNull(degraded.getStringType());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Ion degraded = new Ion().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Ion() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/PhenotypeComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/PhenotypeComparatorTest.java
index 6726d76ac7..4f9f9861c1 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/PhenotypeComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/PhenotypeComparatorTest.java
@@ -1,133 +1,133 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.species.fields.AssociatedElement;
-
-public class PhenotypeComparatorTest {
-
-	PhenotypeComparator comparator = new PhenotypeComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Phenotype phenotype1 = createPhenotype();
-			Phenotype phenotype2 = createPhenotype();
-
-			assertEquals(0, comparator.compare(phenotype1, phenotype1));
-
-			assertEquals(0, comparator.compare(phenotype1, phenotype2));
-			assertEquals(0, comparator.compare(phenotype2, phenotype1));
-
-			phenotype1.setId(-1);
-			assertEquals(0, comparator.compare(phenotype1, phenotype2));
-			assertEquals(0, comparator.compare(phenotype2, phenotype1));
-
-			phenotype1.addAssociatedElement(new AssociatedElement());
-			phenotype2.addAssociatedElement(new AssociatedElement());
-			assertEquals(0, comparator.compare(phenotype1, phenotype2));
-			assertEquals(0, comparator.compare(phenotype2, phenotype1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends Phenotype {
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp phenotype1 = new Tmp();
-			Tmp phenotype2 = new Tmp();
-
-			comparator.compare(phenotype1, phenotype2);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Phenotype phenotype2 = createPhenotype();
-			assertTrue(comparator.compare(null, phenotype2) != 0);
-			assertTrue(comparator.compare(phenotype2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			assertTrue(comparator.compare(phenotype2, new Phenotype() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-			Phenotype phenotype = createPhenotype();
-			phenotype2 = createPhenotype();
-			phenotype.setName("n");
-			assertTrue(comparator.compare(phenotype, phenotype2) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public Phenotype createPhenotype() {
-		Phenotype result = new Phenotype();
-
-		return result;
-	}
-
-	@Test
-	public void testDifferentNewFields() throws Exception {
-		try {
-			Phenotype species1 = createPhenotype();
-			Phenotype species2 = createPhenotype();
-
-			AssociatedElement ae = new AssociatedElement();
-
-			species1.addAssociatedElement(ae);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createPhenotype();
-			species2 = createPhenotype();
-
-			AssociatedElement ae1 = new AssociatedElement();
-			AssociatedElement ae2 = new AssociatedElement();
-
-			ae2.setSource(MiriamType.CHEMBL_COMPOUND);
-
-			species1.addAssociatedElement(ae1);
-			species2.addAssociatedElement(ae2);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.species.fields.AssociatedElement;
+
+public class PhenotypeComparatorTest {
+
+	PhenotypeComparator comparator = new PhenotypeComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Phenotype phenotype1 = createPhenotype();
+			Phenotype phenotype2 = createPhenotype();
+
+			assertEquals(0, comparator.compare(phenotype1, phenotype1));
+
+			assertEquals(0, comparator.compare(phenotype1, phenotype2));
+			assertEquals(0, comparator.compare(phenotype2, phenotype1));
+
+			phenotype1.setId(-1);
+			assertEquals(0, comparator.compare(phenotype1, phenotype2));
+			assertEquals(0, comparator.compare(phenotype2, phenotype1));
+
+			phenotype1.addAssociatedElement(new AssociatedElement());
+			phenotype2.addAssociatedElement(new AssociatedElement());
+			assertEquals(0, comparator.compare(phenotype1, phenotype2));
+			assertEquals(0, comparator.compare(phenotype2, phenotype1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends Phenotype {
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp phenotype1 = new Tmp();
+			Tmp phenotype2 = new Tmp();
+
+			comparator.compare(phenotype1, phenotype2);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Phenotype phenotype2 = createPhenotype();
+			assertTrue(comparator.compare(null, phenotype2) != 0);
+			assertTrue(comparator.compare(phenotype2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			assertTrue(comparator.compare(phenotype2, new Phenotype() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+			Phenotype phenotype = createPhenotype();
+			phenotype2 = createPhenotype();
+			phenotype.setName("n");
+			assertTrue(comparator.compare(phenotype, phenotype2) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public Phenotype createPhenotype() {
+		Phenotype result = new Phenotype();
+
+		return result;
+	}
+
+	@Test
+	public void testDifferentNewFields() throws Exception {
+		try {
+			Phenotype species1 = createPhenotype();
+			Phenotype species2 = createPhenotype();
+
+			AssociatedElement ae = new AssociatedElement();
+
+			species1.addAssociatedElement(ae);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createPhenotype();
+			species2 = createPhenotype();
+
+			AssociatedElement ae1 = new AssociatedElement();
+			AssociatedElement ae2 = new AssociatedElement();
+
+			ae2.setSource(MiriamType.CHEMBL_COMPOUND);
+
+			species1.addAssociatedElement(ae1);
+			species2.addAssociatedElement(ae2);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/PhenotypeTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/PhenotypeTest.java
index f1e8726db8..2e8e9f5313 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/PhenotypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/PhenotypeTest.java
@@ -1,99 +1,99 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.species.fields.AssociatedElement;
-
-public class PhenotypeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Phenotype());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor1() {
-		try {
-			Phenotype original = new Phenotype();
-			AssociatedElement ae = new AssociatedElement();
-			ae.setData(new MiriamData(MiriamType.CCDS, "a"));
-			original.addAssociatedElement(ae);
-			Phenotype copy = new Phenotype(original);
-			assertNotNull(copy);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Phenotype phenotype = new Phenotype(new Species());
-			assertNotNull(phenotype.getStringType());
-			List<AssociatedElement> associatedElements = new ArrayList<>();
-			phenotype.setAssociatedElements(associatedElements);
-
-			assertEquals(associatedElements, phenotype.getAssociatedElements());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Phenotype degraded = new Phenotype().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Phenotype() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.species.fields.AssociatedElement;
+
+public class PhenotypeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Phenotype());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor1() {
+		try {
+			Phenotype original = new Phenotype();
+			AssociatedElement ae = new AssociatedElement();
+			ae.setData(new MiriamData(MiriamType.CCDS, "a"));
+			original.addAssociatedElement(ae);
+			Phenotype copy = new Phenotype(original);
+			assertNotNull(copy);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Phenotype phenotype = new Phenotype(new Species());
+			assertNotNull(phenotype.getStringType());
+			List<AssociatedElement> associatedElements = new ArrayList<>();
+			phenotype.setAssociatedElements(associatedElements);
+
+			assertEquals(associatedElements, phenotype.getAssociatedElements());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Phenotype degraded = new Phenotype().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Phenotype() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/ProteinComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/ProteinComparatorTest.java
index 0397ef6100..bd667da787 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/ProteinComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/ProteinComparatorTest.java
@@ -1,111 +1,111 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ProteinComparatorTest {
-
-	ProteinComparator	comparator	= new ProteinComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Protein aRna1 = createProtein();
-			Protein aRna2 = createProtein();
-
-			assertEquals(0, comparator.compare(aRna1, aRna1));
-
-			assertEquals(0, comparator.compare(aRna1, aRna2));
-			assertEquals(0, comparator.compare(aRna2, aRna1));
-
-			aRna1.setId(-1);
-			assertEquals(0, comparator.compare(aRna1, aRna2));
-			assertEquals(0, comparator.compare(aRna2, aRna1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Protein aRna1 = createProtein();
-			Protein aRna2 = createProtein();
-			aRna1.getModificationResidues().get(0).setName("bla");
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-			aRna1 = createProtein();
-			aRna2 = createProtein();
-			aRna1.getModificationResidues().clear();
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-			aRna1 = createProtein();
-			aRna2 = createProtein();
-			assertTrue(comparator.compare(null, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			assertTrue(comparator.compare(aRna2, new GenericProtein()) != 0);
-
-			aRna1 = createProtein();
-			aRna2 = createProtein();
-			aRna1.setName("a");
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-			aRna1 = createProtein();
-			aRna2 = createProtein();
-			aRna1.setStructuralState("a");
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-			aRna1 = createProtein();
-			aRna2 = createProtein();
-			aRna1.setHomodimer(1);
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public Protein createProtein() {
-		Protein result = new Protein();
-		result.setHomodimer(12);
-		result.setStructuralState("id1");
-		result.setHypothetical(true);
-
-		ModificationResidue residue = new ModificationResidue();
-		result.addModificationResidue(residue);
-
-		residue.setIdModificationResidue("a");
-		residue.setName("name");
-		residue.setAngle("1");
-		residue.setSize("2");
-		residue.setSide("23");
-		residue.setState(ModificationState.DONT_CARE);
-		return result;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ProteinComparatorTest {
+
+	ProteinComparator	comparator	= new ProteinComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Protein aRna1 = createProtein();
+			Protein aRna2 = createProtein();
+
+			assertEquals(0, comparator.compare(aRna1, aRna1));
+
+			assertEquals(0, comparator.compare(aRna1, aRna2));
+			assertEquals(0, comparator.compare(aRna2, aRna1));
+
+			aRna1.setId(-1);
+			assertEquals(0, comparator.compare(aRna1, aRna2));
+			assertEquals(0, comparator.compare(aRna2, aRna1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Protein aRna1 = createProtein();
+			Protein aRna2 = createProtein();
+			aRna1.getModificationResidues().get(0).setName("bla");
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+			aRna1 = createProtein();
+			aRna2 = createProtein();
+			aRna1.getModificationResidues().clear();
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+			aRna1 = createProtein();
+			aRna2 = createProtein();
+			assertTrue(comparator.compare(null, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			assertTrue(comparator.compare(aRna2, new GenericProtein()) != 0);
+
+			aRna1 = createProtein();
+			aRna2 = createProtein();
+			aRna1.setName("a");
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+			aRna1 = createProtein();
+			aRna2 = createProtein();
+			aRna1.setStructuralState("a");
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+			aRna1 = createProtein();
+			aRna2 = createProtein();
+			aRna1.setHomodimer(1);
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public Protein createProtein() {
+		Protein result = new GenericProtein();
+		result.setHomodimer(12);
+		result.setStructuralState("id1");
+		result.setHypothetical(true);
+
+		ModificationResidue residue = new ModificationResidue();
+		result.addModificationResidue(residue);
+
+		residue.setIdModificationResidue("a");
+		residue.setName("name");
+		residue.setAngle("1");
+		residue.setSize("2");
+		residue.setSide("23");
+		residue.setState(ModificationState.DONT_CARE);
+		return result;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/ProteinTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/ProteinTest.java
index 2217c41357..deb6067334 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/ProteinTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/ProteinTest.java
@@ -1,151 +1,151 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-
-public class ProteinTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Protein());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-
-	@Test
-	public void testConstructor1() {
-		try {
-			Protein protein = new Protein();
-			protein.setStructuralState("srt");
-			List<ModificationResidue> residues = new ArrayList<>();
-			residues.add(new ModificationResidue());
-			
-			protein.setModificationResidues(residues);
-			Protein protein2 = new Protein(protein);
-			assertNotNull(protein2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdate() {
-		try {
-			Protein protein = new Protein();
-			protein.setStructuralState("");
-			Protein protein2 = new Protein();
-			protein2.setStructuralState("srt");
-			List<ModificationResidue> residues = new ArrayList<>();
-			residues.add(new ModificationResidue());
-			
-			protein2.setModificationResidues(residues);
-			
-			protein.update(protein2);
-			assertEquals(protein2.getStructuralState(),protein.getStructuralState());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddModificationResidue() {
-		try {
-			Protein protein = new Protein();
-			ModificationResidue mr = new ModificationResidue();
-			mr.setIdModificationResidue("id1");
-			
-			ModificationResidue mr2 = new ModificationResidue();
-			mr2.setIdModificationResidue("id1");
-			
-			protein.addModificationResidue(mr);
-			assertEquals(1, protein.getModificationResidues().size());
-			protein.addModificationResidue(mr2);
-			assertEquals(1, protein.getModificationResidues().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSetStructuralState() {
-		try {
-			Protein protein = new Protein();
-			protein.setStructuralState("str");
-			protein.setStructuralState("str1");
-			
-			assertEquals("str1", protein.getStructuralState());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Protein degraded = new Protein(new Species());
-			assertNotNull(degraded.getStringType());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Protein degraded = new Protein().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Protein() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+
+public class ProteinTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new GenericProtein());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+
+	@Test
+	public void testConstructor1() {
+		try {
+			Protein protein = new GenericProtein();
+			protein.setStructuralState("srt");
+			List<ModificationResidue> residues = new ArrayList<>();
+			residues.add(new ModificationResidue());
+			
+			protein.setModificationResidues(residues);
+			Protein protein2 = new GenericProtein(protein);
+			assertNotNull(protein2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdate() {
+		try {
+			Protein protein = new GenericProtein();
+			protein.setStructuralState("");
+			Protein protein2 = new GenericProtein();
+			protein2.setStructuralState("srt");
+			List<ModificationResidue> residues = new ArrayList<>();
+			residues.add(new ModificationResidue());
+			
+			protein2.setModificationResidues(residues);
+			
+			protein.update(protein2);
+			assertEquals(protein2.getStructuralState(),protein.getStructuralState());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddModificationResidue() {
+		try {
+			Protein protein = new GenericProtein();
+			ModificationResidue mr = new ModificationResidue();
+			mr.setIdModificationResidue("id1");
+			
+			ModificationResidue mr2 = new ModificationResidue();
+			mr2.setIdModificationResidue("id1");
+			
+			protein.addModificationResidue(mr);
+			assertEquals(1, protein.getModificationResidues().size());
+			protein.addModificationResidue(mr2);
+			assertEquals(1, protein.getModificationResidues().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSetStructuralState() {
+		try {
+			Protein protein = new GenericProtein();
+			protein.setStructuralState("str");
+			protein.setStructuralState("str1");
+			
+			assertEquals("str1", protein.getStructuralState());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Protein protein = new GenericProtein(new Species());
+			assertNotNull(protein.getStringType());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Protein protein = new GenericProtein().copy();
+			assertNotNull(protein);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Protein() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/ReceptorProteinTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/ReceptorProteinTest.java
index 96d009d6d8..ffc8af66eb 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/ReceptorProteinTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/ReceptorProteinTest.java
@@ -1,73 +1,73 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class ReceptorProteinTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new ReceptorProtein());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testConstructor() {
-		try {
-			ReceptorProtein species = new ReceptorProtein(new Species());
-			assertNotNull(species);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy1() {
-		try {
-			ReceptorProtein species = new ReceptorProtein(new Species()).copy();
-			assertNotNull(species);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy2() {
-		try {
-			new ReceptorProtein() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class ReceptorProteinTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new ReceptorProtein());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+	@Test
+	public void testConstructor() {
+		try {
+			ReceptorProtein species = new ReceptorProtein(new Species());
+			assertNotNull(species);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy1() {
+		try {
+			ReceptorProtein species = new ReceptorProtein(new Species()).copy();
+			assertNotNull(species);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy2() {
+		try {
+			new ReceptorProtein() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/RnaComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/RnaComparatorTest.java
index fed0053edc..beea204bb9 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/RnaComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/RnaComparatorTest.java
@@ -1,116 +1,116 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-import lcsb.mapviewer.model.map.species.fields.RnaRegion;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class RnaComparatorTest {
-
-	RnaComparator	comparator	= new RnaComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Rna aRna1 = createRna();
-			Rna aRna2 = createRna();
-
-			assertEquals(0, comparator.compare(aRna1, aRna1));
-
-			assertEquals(0, comparator.compare(aRna1, aRna2));
-			assertEquals(0, comparator.compare(aRna2, aRna1));
-
-			aRna1.setId(-1);
-			assertEquals(0, comparator.compare(aRna1, aRna2));
-			assertEquals(0, comparator.compare(aRna2, aRna1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Rna aRna1 = createRna();
-			Rna aRna2 = createRna();
-			aRna1.getRegions().get(0).setState(ModificationState.ACETYLATED);
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-			aRna1 = createRna();
-			aRna2 = createRna();
-			aRna1.getRegions().clear();
-			assertTrue(comparator.compare(aRna1, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, aRna1) != 0);
-
-			aRna1 = createRna();
-			aRna2 = createRna();
-			assertTrue(comparator.compare(null, aRna2) != 0);
-			assertTrue(comparator.compare(aRna2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			Rna rna = createRna();
-			rna.setName("n");
-			assertTrue(comparator.compare(rna, aRna2) != 0);
-
-			assertTrue(comparator.compare(rna, new Rna() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public Rna createRna() {
-		Rna result = new Rna();
-		result.setHypothetical(true);
-
-		RnaRegion region1 = new RnaRegion();
-		result.addRegion(region1);
-		region1.setIdRnaRegion("a");
-		region1.setState(ModificationState.DONT_CARE);
-		region1.setPos("1");
-		region1.setSize("2");
-		region1.setType("type");
-		return result;
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends Rna {
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp object = new Tmp();
-
-			comparator.compare(object, object);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+import lcsb.mapviewer.model.map.species.fields.RnaRegion;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class RnaComparatorTest {
+
+	RnaComparator	comparator	= new RnaComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Rna aRna1 = createRna();
+			Rna aRna2 = createRna();
+
+			assertEquals(0, comparator.compare(aRna1, aRna1));
+
+			assertEquals(0, comparator.compare(aRna1, aRna2));
+			assertEquals(0, comparator.compare(aRna2, aRna1));
+
+			aRna1.setId(-1);
+			assertEquals(0, comparator.compare(aRna1, aRna2));
+			assertEquals(0, comparator.compare(aRna2, aRna1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Rna aRna1 = createRna();
+			Rna aRna2 = createRna();
+			aRna1.getRegions().get(0).setState(ModificationState.ACETYLATED);
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+			aRna1 = createRna();
+			aRna2 = createRna();
+			aRna1.getRegions().clear();
+			assertTrue(comparator.compare(aRna1, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, aRna1) != 0);
+
+			aRna1 = createRna();
+			aRna2 = createRna();
+			assertTrue(comparator.compare(null, aRna2) != 0);
+			assertTrue(comparator.compare(aRna2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			Rna rna = createRna();
+			rna.setName("n");
+			assertTrue(comparator.compare(rna, aRna2) != 0);
+
+			assertTrue(comparator.compare(rna, new Rna() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public Rna createRna() {
+		Rna result = new Rna();
+		result.setHypothetical(true);
+
+		RnaRegion region1 = new RnaRegion();
+		result.addRegion(region1);
+		region1.setIdRnaRegion("a");
+		region1.setState(ModificationState.DONT_CARE);
+		region1.setPos("1");
+		region1.setSize("2");
+		region1.setType("type");
+		return result;
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends Rna {
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp object = new Tmp();
+
+			comparator.compare(object, object);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/SimpleMoleculeComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/SimpleMoleculeComparatorTest.java
index f07c497c2e..729d959778 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/SimpleMoleculeComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/SimpleMoleculeComparatorTest.java
@@ -1,131 +1,131 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class SimpleMoleculeComparatorTest {
-
-	SimpleMoleculeComparator comparator = new SimpleMoleculeComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			SimpleMolecule simpleMolecule1 = createSimpleMolecule();
-			SimpleMolecule simpleMolecule2 = createSimpleMolecule();
-
-			assertEquals(0, comparator.compare(simpleMolecule1, simpleMolecule1));
-
-			assertEquals(0, comparator.compare(simpleMolecule1, simpleMolecule2));
-			assertEquals(0, comparator.compare(simpleMolecule2, simpleMolecule1));
-
-			simpleMolecule1.setId(-1);
-			assertEquals(0, comparator.compare(simpleMolecule1, simpleMolecule2));
-			assertEquals(0, comparator.compare(simpleMolecule2, simpleMolecule1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			SimpleMolecule simpleMolecule1 = createSimpleMolecule();
-			SimpleMolecule simpleMolecule2 = createSimpleMolecule();
-			simpleMolecule1.setHomodimer(3);
-			assertTrue(comparator.compare(simpleMolecule1, simpleMolecule2) != 0);
-			assertTrue(comparator.compare(simpleMolecule2, simpleMolecule1) != 0);
-
-			simpleMolecule1 = createSimpleMolecule();
-			simpleMolecule2 = createSimpleMolecule();
-			simpleMolecule1.setName("as");
-			assertTrue(comparator.compare(simpleMolecule1, simpleMolecule2) != 0);
-			assertTrue(comparator.compare(simpleMolecule2, simpleMolecule1) != 0);
-
-			simpleMolecule1 = createSimpleMolecule();
-			simpleMolecule2 = createSimpleMolecule();
-			simpleMolecule1.setInChIKey("as");
-			assertTrue(comparator.compare(simpleMolecule1, simpleMolecule2) != 0);
-			assertTrue(comparator.compare(simpleMolecule2, simpleMolecule1) != 0);
-
-			simpleMolecule1 = createSimpleMolecule();
-			simpleMolecule2 = createSimpleMolecule();
-			assertTrue(comparator.compare(null, simpleMolecule2) != 0);
-			assertTrue(comparator.compare(simpleMolecule2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			assertTrue(comparator.compare(simpleMolecule1, new SimpleMolecule() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends SimpleMolecule {
-				private static final long serialVersionUID = 1L;
-			}
-			;
-			Tmp simpleMolecule1 = new Tmp();
-			Tmp simpleMolecule2 = new Tmp();
-			comparator.compare(simpleMolecule1, simpleMolecule2);
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferentNewFields() throws Exception {
-		try {
-			SimpleMolecule species1 = createSimpleMolecule();
-			SimpleMolecule species2 = createSimpleMolecule();
-
-			species1.setSmiles("some symbol");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-
-			species1.setInChI("some inchi");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	public SimpleMolecule createSimpleMolecule() {
-		SimpleMolecule result = new SimpleMolecule();
-		result.setHomodimer(12);
-
-		return result;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class SimpleMoleculeComparatorTest {
+
+	SimpleMoleculeComparator comparator = new SimpleMoleculeComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			SimpleMolecule simpleMolecule1 = createSimpleMolecule();
+			SimpleMolecule simpleMolecule2 = createSimpleMolecule();
+
+			assertEquals(0, comparator.compare(simpleMolecule1, simpleMolecule1));
+
+			assertEquals(0, comparator.compare(simpleMolecule1, simpleMolecule2));
+			assertEquals(0, comparator.compare(simpleMolecule2, simpleMolecule1));
+
+			simpleMolecule1.setId(-1);
+			assertEquals(0, comparator.compare(simpleMolecule1, simpleMolecule2));
+			assertEquals(0, comparator.compare(simpleMolecule2, simpleMolecule1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			SimpleMolecule simpleMolecule1 = createSimpleMolecule();
+			SimpleMolecule simpleMolecule2 = createSimpleMolecule();
+			simpleMolecule1.setHomodimer(3);
+			assertTrue(comparator.compare(simpleMolecule1, simpleMolecule2) != 0);
+			assertTrue(comparator.compare(simpleMolecule2, simpleMolecule1) != 0);
+
+			simpleMolecule1 = createSimpleMolecule();
+			simpleMolecule2 = createSimpleMolecule();
+			simpleMolecule1.setName("as");
+			assertTrue(comparator.compare(simpleMolecule1, simpleMolecule2) != 0);
+			assertTrue(comparator.compare(simpleMolecule2, simpleMolecule1) != 0);
+
+			simpleMolecule1 = createSimpleMolecule();
+			simpleMolecule2 = createSimpleMolecule();
+			simpleMolecule1.setInChIKey("as");
+			assertTrue(comparator.compare(simpleMolecule1, simpleMolecule2) != 0);
+			assertTrue(comparator.compare(simpleMolecule2, simpleMolecule1) != 0);
+
+			simpleMolecule1 = createSimpleMolecule();
+			simpleMolecule2 = createSimpleMolecule();
+			assertTrue(comparator.compare(null, simpleMolecule2) != 0);
+			assertTrue(comparator.compare(simpleMolecule2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			assertTrue(comparator.compare(simpleMolecule1, new SimpleMolecule() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends SimpleMolecule {
+				private static final long serialVersionUID = 1L;
+			}
+			;
+			Tmp simpleMolecule1 = new Tmp();
+			Tmp simpleMolecule2 = new Tmp();
+			comparator.compare(simpleMolecule1, simpleMolecule2);
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferentNewFields() throws Exception {
+		try {
+			SimpleMolecule species1 = createSimpleMolecule();
+			SimpleMolecule species2 = createSimpleMolecule();
+
+			species1.setSmiles("some symbol");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+
+			species1.setInChI("some inchi");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	public SimpleMolecule createSimpleMolecule() {
+		SimpleMolecule result = new SimpleMolecule();
+		result.setHomodimer(12);
+
+		return result;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/SimpleMoleculeTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/SimpleMoleculeTest.java
index 033f1b8eb7..ade7b468f0 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/SimpleMoleculeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/SimpleMoleculeTest.java
@@ -1,86 +1,86 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class SimpleMoleculeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new SimpleMolecule());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-
-	@Test
-	public void testConstructor1() {
-		try {
-			SimpleMolecule degraded = new SimpleMolecule(new Species());
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			SimpleMolecule degraded = new SimpleMolecule(new Species());
-			assertNotNull(degraded.getStringType());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			SimpleMolecule degraded = new SimpleMolecule().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new SimpleMolecule() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class SimpleMoleculeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new SimpleMolecule());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+
+	@Test
+	public void testConstructor1() {
+		try {
+			SimpleMolecule degraded = new SimpleMolecule(new Species());
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			SimpleMolecule degraded = new SimpleMolecule(new Species());
+			assertNotNull(degraded.getStringType());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			SimpleMolecule degraded = new SimpleMolecule().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new SimpleMolecule() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/SpeciesComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/SpeciesComparatorTest.java
index 55c223af71..1d5adead12 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/SpeciesComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/SpeciesComparatorTest.java
@@ -1,178 +1,178 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidClassException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.species.fields.PositionToCompartment;
-
-public class SpeciesComparatorTest {
-
-	SpeciesComparator comparator = new SpeciesComparator();
-
-	class Mock extends Species {
-
-		/**
-		 * 
-		 */
-		private static final long serialVersionUID = 1L;
-
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testException() {
-		try {
-			comparator.compare(new Mock(), new Mock());
-
-			fail("Exception should occur");
-		} catch (InvalidClassException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Species species1 = createSimpleMolecule();
-			Species species2 = createSimpleMolecule();
-			assertEquals(0, comparator.compare(species1, species2));
-
-			assertEquals(0, comparator.compare(null, null));
-
-			assertEquals(0, comparator.compare(new AntisenseRna(), new AntisenseRna()));
-			assertEquals(0, comparator.compare(new Degraded(), new Degraded()));
-			assertEquals(0, comparator.compare(new Drug(), new Drug()));
-			assertEquals(0, comparator.compare(new Ion(), new Ion()));
-			assertEquals(0, comparator.compare(new Phenotype(), new Phenotype()));
-			assertEquals(0, comparator.compare(new Rna(), new Rna()));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			SimpleMolecule species1 = createSimpleMolecule();
-			Species species2 = createSimpleMolecule();
-
-			species1.setCharge(99);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-			assertTrue(comparator.compare(null, species1) != 0);
-			assertTrue(comparator.compare(species1, null) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setHomodimer(1233);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setElementId("");
-			species1.setElementId("ASD");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setNotes("ASD");
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setPositionToCompartment(PositionToCompartment.TRANSMEMBRANE);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.getMiriamData().clear();
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setInitialAmount(4);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setInitialConcentration(4);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setOnlySubstanceUnits(false);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.setHypothetical(true);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.getMiriamData().iterator().next().setRelationType(MiriamRelationType.BQ_BIOL_IS);
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			species1 = createSimpleMolecule();
-			species2 = createSimpleMolecule();
-			species1.addMiriamData(new MiriamData());
-			assertTrue(comparator.compare(species1, species2) != 0);
-			assertTrue(comparator.compare(species2, species1) != 0);
-
-			assertTrue(comparator.compare(new Rna(), new Drug()) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unkowne exception");
-		}
-	}
-
-	public SimpleMolecule createSimpleMolecule() {
-		SimpleMolecule result = new SimpleMolecule();
-		result.setHomodimer(12);
-		result.setElementId("id");
-		result.setName("id");
-		result.setInitialAmount("12");
-		result.setCharge("13");
-		result.setInitialConcentration("14");
-		result.setOnlySubstanceUnits("true");
-		result.setPositionToCompartment(PositionToCompartment.INSIDE);
-		result.setNotes("id");
-		MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.UNKNOWN, "c");
-		result.addMiriamData(md);
-		return result;
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidClassException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.species.fields.PositionToCompartment;
+
+public class SpeciesComparatorTest {
+
+	SpeciesComparator comparator = new SpeciesComparator();
+
+	class Mock extends Species {
+
+		/**
+		 * 
+		 */
+		private static final long serialVersionUID = 1L;
+
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testException() {
+		try {
+			comparator.compare(new Mock(), new Mock());
+
+			fail("Exception should occur");
+		} catch (InvalidClassException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Species species1 = createSimpleMolecule();
+			Species species2 = createSimpleMolecule();
+			assertEquals(0, comparator.compare(species1, species2));
+
+			assertEquals(0, comparator.compare(null, null));
+
+			assertEquals(0, comparator.compare(new AntisenseRna(), new AntisenseRna()));
+			assertEquals(0, comparator.compare(new Degraded(), new Degraded()));
+			assertEquals(0, comparator.compare(new Drug(), new Drug()));
+			assertEquals(0, comparator.compare(new Ion(), new Ion()));
+			assertEquals(0, comparator.compare(new Phenotype(), new Phenotype()));
+			assertEquals(0, comparator.compare(new Rna(), new Rna()));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			SimpleMolecule species1 = createSimpleMolecule();
+			Species species2 = createSimpleMolecule();
+
+			species1.setCharge(99);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+			assertTrue(comparator.compare(null, species1) != 0);
+			assertTrue(comparator.compare(species1, null) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setHomodimer(1233);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setElementId("");
+			species1.setElementId("ASD");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setNotes("ASD");
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setPositionToCompartment(PositionToCompartment.TRANSMEMBRANE);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.getMiriamData().clear();
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setInitialAmount(4);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setInitialConcentration(4);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setOnlySubstanceUnits(false);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.setHypothetical(true);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.getMiriamData().iterator().next().setRelationType(MiriamRelationType.BQ_BIOL_IS);
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			species1 = createSimpleMolecule();
+			species2 = createSimpleMolecule();
+			species1.addMiriamData(new MiriamData());
+			assertTrue(comparator.compare(species1, species2) != 0);
+			assertTrue(comparator.compare(species2, species1) != 0);
+
+			assertTrue(comparator.compare(new Rna(), new Drug()) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unkowne exception");
+		}
+	}
+
+	public SimpleMolecule createSimpleMolecule() {
+		SimpleMolecule result = new SimpleMolecule();
+		result.setHomodimer(12);
+		result.setElementId("id");
+		result.setName("id");
+		result.setInitialAmount("12");
+		result.setCharge("13");
+		result.setInitialConcentration("14");
+		result.setOnlySubstanceUnits("true");
+		result.setPositionToCompartment(PositionToCompartment.INSIDE);
+		result.setNotes("id");
+		MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.UNKNOWN, "c");
+		result.addMiriamData(md);
+		return result;
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/TruncatedProteinTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/TruncatedProteinTest.java
index 39fafb9a5c..c0c0743d30 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/TruncatedProteinTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/TruncatedProteinTest.java
@@ -1,73 +1,73 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class TruncatedProteinTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new TruncatedProtein());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testConstructor() {
-		try {
-			TruncatedProtein species = new TruncatedProtein(new Species());
-			assertNotNull(species);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy1() {
-		try {
-			TruncatedProtein species = new TruncatedProtein(new Species()).copy();
-			assertNotNull(species);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy2() {
-		try {
-			new TruncatedProtein() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class TruncatedProteinTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new TruncatedProtein());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+	@Test
+	public void testConstructor() {
+		try {
+			TruncatedProtein species = new TruncatedProtein(new Species());
+			assertNotNull(species);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy1() {
+		try {
+			TruncatedProtein species = new TruncatedProtein(new Species()).copy();
+			assertNotNull(species);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy2() {
+		try {
+			new TruncatedProtein() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/UnknownComparatorTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/UnknownComparatorTest.java
index 2f856e1c1e..87ae8c8b1a 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/UnknownComparatorTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/UnknownComparatorTest.java
@@ -1,92 +1,92 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class UnknownComparatorTest {
-
-	UnknownComparator	comparator	= new UnknownComparator();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEquals() {
-		try {
-			Unknown aRna1 = createUnknown();
-			Unknown aRna2 = createUnknown();
-
-			assertEquals(0, comparator.compare(aRna1, aRna1));
-
-			assertEquals(0, comparator.compare(aRna1, aRna2));
-			assertEquals(0, comparator.compare(aRna2, aRna1));
-
-			aRna1.setId(-1);
-			assertEquals(0, comparator.compare(aRna1, aRna2));
-			assertEquals(0, comparator.compare(aRna2, aRna1));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	@Test
-	public void testDifferent() {
-		try {
-			Unknown unknown2 = createUnknown();
-			assertTrue(comparator.compare(null, unknown2) != 0);
-			assertTrue(comparator.compare(unknown2, null) != 0);
-			assertTrue(comparator.compare(null, null) == 0);
-
-			Unknown unknown = createUnknown();
-			unknown.setName("n");
-			assertTrue(comparator.compare(unknown, unknown2) != 0);
-
-			assertTrue(comparator.compare(unknown, new Unknown() {
-				private static final long serialVersionUID = 1L;
-			}) != 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-	public Unknown createUnknown() {
-		Unknown result = new Unknown();
-		return result;
-	}
-
-	@Test
-	public void testInvalid() {
-		try {
-			class Tmp extends Unknown{
-				private static final long serialVersionUID = 1L;
-			}
-			Tmp object = new Tmp();
-
-			comparator.compare(object, object);
-
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknowne exception occurred");
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class UnknownComparatorTest {
+
+	UnknownComparator	comparator	= new UnknownComparator();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEquals() {
+		try {
+			Unknown aRna1 = createUnknown();
+			Unknown aRna2 = createUnknown();
+
+			assertEquals(0, comparator.compare(aRna1, aRna1));
+
+			assertEquals(0, comparator.compare(aRna1, aRna2));
+			assertEquals(0, comparator.compare(aRna2, aRna1));
+
+			aRna1.setId(-1);
+			assertEquals(0, comparator.compare(aRna1, aRna2));
+			assertEquals(0, comparator.compare(aRna2, aRna1));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	@Test
+	public void testDifferent() {
+		try {
+			Unknown unknown2 = createUnknown();
+			assertTrue(comparator.compare(null, unknown2) != 0);
+			assertTrue(comparator.compare(unknown2, null) != 0);
+			assertTrue(comparator.compare(null, null) == 0);
+
+			Unknown unknown = createUnknown();
+			unknown.setName("n");
+			assertTrue(comparator.compare(unknown, unknown2) != 0);
+
+			assertTrue(comparator.compare(unknown, new Unknown() {
+				private static final long serialVersionUID = 1L;
+			}) != 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+	public Unknown createUnknown() {
+		Unknown result = new Unknown();
+		return result;
+	}
+
+	@Test
+	public void testInvalid() {
+		try {
+			class Tmp extends Unknown{
+				private static final long serialVersionUID = 1L;
+			}
+			Tmp object = new Tmp();
+
+			comparator.compare(object, object);
+
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknowne exception occurred");
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/map/species/UnknownTest.java b/model/src/test/java/lcsb/mapviewer/model/map/species/UnknownTest.java
index 3a7f97a48e..5caa89237a 100644
--- a/model/src/test/java/lcsb/mapviewer/model/map/species/UnknownTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/map/species/UnknownTest.java
@@ -1,84 +1,84 @@
-package lcsb.mapviewer.model.map.species;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-public class UnknownTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new Unknown());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor1() {
-		try {
-			Unknown degraded = new Unknown(new Species());
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			Unknown degraded = new Unknown(new Species());
-			assertNotNull(degraded.getStringType());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCopy() {
-		try {
-			Unknown degraded = new Unknown().copy();
-			assertNotNull(degraded);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidCopy() {
-		try {
-			new Unknown() {
-
-				/**
-				 * 
-				 */
-				private static final long serialVersionUID = 1L;
-			}.copy();
-			fail("Exception expected");
-		} catch (NotImplementedException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.map.species;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+public class UnknownTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new Unknown());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor1() {
+		try {
+			Unknown degraded = new Unknown(new Species());
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			Unknown degraded = new Unknown(new Species());
+			assertNotNull(degraded.getStringType());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCopy() {
+		try {
+			Unknown degraded = new Unknown().copy();
+			assertNotNull(degraded);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidCopy() {
+		try {
+			new Unknown() {
+
+				/**
+				 * 
+				 */
+				private static final long serialVersionUID = 1L;
+			}.copy();
+			fail("Exception expected");
+		} catch (NotImplementedException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/AllUserTests.java b/model/src/test/java/lcsb/mapviewer/model/user/AllUserTests.java
index 24020e6f6d..d568f1ce91 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/AllUserTests.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/AllUserTests.java
@@ -1,23 +1,23 @@
-package lcsb.mapviewer.model.user;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ BasicPrivilegeTest.class, //
-		ConfigurationElementTypeTest.class, //
-		ConfigurationTest.class, //
-		ExternalProjectTest.class, //
-		ExternalUserTest.class, //
-		ObjectPrivilegeTest.class, //
-		PrivilegeTypeTest.class, //
-		UserAnnotationSchemaTest.class, //
-		UserClassAnnotatorsTest.class, //
-		UserClassRequiredAnnotationsTest.class, //
-		UserClassValidAnnotationsTest.class, //
-		UserTest.class,//
-})
-public class AllUserTests {
-
-}
+package lcsb.mapviewer.model.user;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ BasicPrivilegeTest.class, //
+		ConfigurationElementTypeTest.class, //
+		ConfigurationTest.class, //
+		ExternalProjectTest.class, //
+		ExternalUserTest.class, //
+		ObjectPrivilegeTest.class, //
+		PrivilegeTypeTest.class, //
+		UserAnnotationSchemaTest.class, //
+		UserClassAnnotatorsTest.class, //
+		UserClassRequiredAnnotationsTest.class, //
+		UserClassValidAnnotationsTest.class, //
+		UserTest.class,//
+})
+public class AllUserTests {
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/BasicPrivilegeTest.java b/model/src/test/java/lcsb/mapviewer/model/user/BasicPrivilegeTest.java
index 8a226413bb..c34bee4c76 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/BasicPrivilegeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/BasicPrivilegeTest.java
@@ -1,65 +1,65 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class BasicPrivilegeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new BasicPrivilege());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			BasicPrivilege privilege = new BasicPrivilege();
-			int id = 25;
-			int level = 26;
-			PrivilegeType type = PrivilegeType.ADD_MAP;
-			User user = new User();
-
-			privilege.setId(id);
-			privilege.setLevel(level);
-			privilege.setType(type);
-			privilege.setUser(user);
-
-			assertEquals(id, privilege.getId());
-			assertEquals(level, privilege.getLevel());
-			assertEquals(type, privilege.getType());
-			assertEquals(user, privilege.getUser());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testEqualsPrivilege() {
-		try {
-			BasicPrivilege privilege = new BasicPrivilege();
-			assertFalse(privilege.equalsPrivilege(null));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class BasicPrivilegeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new BasicPrivilege());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			BasicPrivilege privilege = new BasicPrivilege();
+			int id = 25;
+			int level = 26;
+			PrivilegeType type = PrivilegeType.ADD_MAP;
+			User user = new User();
+
+			privilege.setId(id);
+			privilege.setLevel(level);
+			privilege.setType(type);
+			privilege.setUser(user);
+
+			assertEquals(id, privilege.getId());
+			assertEquals(level, privilege.getLevel());
+			assertEquals(type, privilege.getType());
+			assertEquals(user, privilege.getUser());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testEqualsPrivilege() {
+		try {
+			BasicPrivilege privilege = new BasicPrivilege();
+			assertFalse(privilege.equalsPrivilege(null));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/ConfigurationElementTypeTest.java b/model/src/test/java/lcsb/mapviewer/model/user/ConfigurationElementTypeTest.java
index 3aae168b3c..1f34d76b0d 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/ConfigurationElementTypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/ConfigurationElementTypeTest.java
@@ -1,30 +1,30 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ConfigurationElementTypeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValidValues() {
-		for (ConfigurationElementType type : ConfigurationElementType.values()) {
-			assertNotNull(type);
-
-			// for coverage tests
-			ConfigurationElementType.valueOf(type.toString());
-			assertNotNull(type.getCommonName());
-			assertNotNull(type.getDefaultValue());
-		}
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ConfigurationElementTypeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValidValues() {
+		for (ConfigurationElementType type : ConfigurationElementType.values()) {
+			assertNotNull(type);
+
+			// for coverage tests
+			ConfigurationElementType.valueOf(type.toString());
+			assertNotNull(type.getCommonName());
+			assertNotNull(type.getDefaultValue());
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/ExternalProjectTest.java b/model/src/test/java/lcsb/mapviewer/model/user/ExternalProjectTest.java
index a68a03a77c..a04556b3e8 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/ExternalProjectTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/ExternalProjectTest.java
@@ -1,42 +1,42 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ExternalProjectTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new ExternalProject());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testGetters() {
-		try {
-			String name = "str";
-			ExternalProject ep = new ExternalProject();
-			ep.setName(name);
-			assertEquals(name, ep.getName());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ExternalProjectTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new ExternalProject());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+	@Test
+	public void testGetters() {
+		try {
+			String name = "str";
+			ExternalProject ep = new ExternalProject();
+			ep.setName(name);
+			assertEquals(name, ep.getName());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/ObjectPrivilegeTest.java b/model/src/test/java/lcsb/mapviewer/model/user/ObjectPrivilegeTest.java
index 099910488c..7433bb583f 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/ObjectPrivilegeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/ObjectPrivilegeTest.java
@@ -1,96 +1,96 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.Project;
-
-public class ObjectPrivilegeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new ObjectPrivilege());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructror() {
-		try {
-			Integer id = 12;
-			Project project = new Project();
-			project.setId(id);
-			ObjectPrivilege privilege = new ObjectPrivilege(project, 1, PrivilegeType.VIEW_PROJECT, new User());
-			assertEquals(id, privilege.getIdObject());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			String idStr = "12";
-			Integer id = 12;
-			ObjectPrivilege privilege = new ObjectPrivilege();
-			privilege.setIdObject(idStr);
-			assertEquals(id, privilege.getIdObject());
-			privilege.setIdObject((Integer) null);
-			assertNull(privilege.getIdObject());
-			privilege.setIdObject(id);
-			assertEquals(id, privilege.getIdObject());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testEqualsPrivilege() {
-		try {
-			ObjectPrivilege privilege = new ObjectPrivilege();
-			privilege.setType(PrivilegeType.ADD_MAP);
-			assertFalse(privilege.equalsPrivilege(null));
-			assertFalse(privilege.equalsPrivilege(new BasicPrivilege()));
-
-			privilege.setIdObject(2);
-			ObjectPrivilege privilege2 = new ObjectPrivilege();
-			privilege2.setIdObject(3);
-			privilege2.setType(PrivilegeType.ADD_MAP);
-			assertFalse(privilege.equalsPrivilege(privilege2));
-
-			privilege2.setIdObject(3);
-			privilege2.setType(PrivilegeType.CONFIGURATION_MANAGE);
-			assertFalse(privilege.equalsPrivilege(privilege2));
-
-			privilege2.setIdObject(2);
-			privilege2.setType(PrivilegeType.ADD_MAP);
-			assertTrue(privilege.equalsPrivilege(privilege2));
-
-			privilege.setIdObject((Integer) null);
-			assertFalse(privilege.equalsPrivilege(privilege2));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.Project;
+
+public class ObjectPrivilegeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new ObjectPrivilege());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructror() {
+		try {
+			Integer id = 12;
+			Project project = new Project();
+			project.setId(id);
+			ObjectPrivilege privilege = new ObjectPrivilege(project, 1, PrivilegeType.VIEW_PROJECT, new User());
+			assertEquals(id, privilege.getIdObject());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			String idStr = "12";
+			Integer id = 12;
+			ObjectPrivilege privilege = new ObjectPrivilege();
+			privilege.setIdObject(idStr);
+			assertEquals(id, privilege.getIdObject());
+			privilege.setIdObject((Integer) null);
+			assertNull(privilege.getIdObject());
+			privilege.setIdObject(id);
+			assertEquals(id, privilege.getIdObject());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testEqualsPrivilege() {
+		try {
+			ObjectPrivilege privilege = new ObjectPrivilege();
+			privilege.setType(PrivilegeType.ADD_MAP);
+			assertFalse(privilege.equalsPrivilege(null));
+			assertFalse(privilege.equalsPrivilege(new BasicPrivilege()));
+
+			privilege.setIdObject(2);
+			ObjectPrivilege privilege2 = new ObjectPrivilege();
+			privilege2.setIdObject(3);
+			privilege2.setType(PrivilegeType.ADD_MAP);
+			assertFalse(privilege.equalsPrivilege(privilege2));
+
+			privilege2.setIdObject(3);
+			privilege2.setType(PrivilegeType.CONFIGURATION_MANAGE);
+			assertFalse(privilege.equalsPrivilege(privilege2));
+
+			privilege2.setIdObject(2);
+			privilege2.setType(PrivilegeType.ADD_MAP);
+			assertTrue(privilege.equalsPrivilege(privilege2));
+
+			privilege.setIdObject((Integer) null);
+			assertFalse(privilege.equalsPrivilege(privilege2));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/PrivilegeTypeTest.java b/model/src/test/java/lcsb/mapviewer/model/user/PrivilegeTypeTest.java
index d9b3476b9c..b872138a09 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/PrivilegeTypeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/PrivilegeTypeTest.java
@@ -1,34 +1,34 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class PrivilegeTypeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValidValues() {
-		for (PrivilegeType type : PrivilegeType.values()) {
-			assertNotNull(type);
-
-			// for coverage tests
-			PrivilegeType.valueOf(type.toString());
-			assertNotNull(type.getCommonName());
-			assertNotNull(type.getPrivilegeClassType());
-			type.getPrivilegeObjectType();
-			type.isNumeric();
-
-		}
-	}
-
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class PrivilegeTypeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValidValues() {
+		for (PrivilegeType type : PrivilegeType.values()) {
+			assertNotNull(type);
+
+			// for coverage tests
+			PrivilegeType.valueOf(type.toString());
+			assertNotNull(type.getCommonName());
+			assertNotNull(type.getPrivilegeClassType());
+			type.getPrivilegeObjectType();
+			type.isNumeric();
+
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/UserAnnotationSchemaTest.java b/model/src/test/java/lcsb/mapviewer/model/user/UserAnnotationSchemaTest.java
index 65270b47e9..8d7adb2e91 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/UserAnnotationSchemaTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/UserAnnotationSchemaTest.java
@@ -1,198 +1,198 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.MiriamType;
-
-public class UserAnnotationSchemaTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testAddClassAnnotator() throws Exception {
-		try {
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			UserClassAnnotators ca = new UserClassAnnotators(String.class, new ArrayList<String>());
-			UserClassAnnotators ca2 = new UserClassAnnotators(String.class, new ArrayList<String>());
-			annotationSchema.addClassAnnotator(ca);
-			annotationSchema.addClassAnnotator(ca2);
-			assertEquals(1, annotationSchema.getClassAnnotators().size());
-			assertEquals(ca2.getAnnotators(), annotationSchema.getAnnotatorsForClass(String.class));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testInvalidAddClassAnnotator() throws Exception {
-		try {
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			UserClassAnnotators ca = new UserClassAnnotators(String.class, new ArrayList<String>());
-			ca.setClassName((String)null);
-			annotationSchema.addClassAnnotator(ca);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddClassRequiredAnnotations() throws Exception {
-		try {
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			UserClassRequiredAnnotations cra = new UserClassRequiredAnnotations(String.class, new ArrayList<MiriamType>());
-			UserClassRequiredAnnotations cra2 = new UserClassRequiredAnnotations(String.class, new ArrayList<MiriamType>());
-			annotationSchema.addClassRequiredAnnotations(cra);
-			annotationSchema.addClassRequiredAnnotations(cra2);
-			assertEquals(1, annotationSchema.getClassRequiredAnnotators().size());
-			assertEquals(cra2, annotationSchema.getClassRequiredAnnotators().get(0));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testAddInvalidClassRequiredAnnotations() throws Exception {
-		try {
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			UserClassRequiredAnnotations cra = new UserClassRequiredAnnotations(String.class, new ArrayList<MiriamType>());
-			cra.setClassName((String)null);
-			
-			annotationSchema.addClassRequiredAnnotations(cra);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddClassValidAnnotations() throws Exception {
-		try {
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			UserClassValidAnnotations cva = new UserClassValidAnnotations(String.class, new ArrayList<MiriamType>());
-			UserClassValidAnnotations cva2 = new UserClassValidAnnotations(String.class, new ArrayList<MiriamType>());
-			annotationSchema.addClassValidAnnotations(cva);
-			annotationSchema.addClassValidAnnotations(cva2);
-			assertEquals(1, annotationSchema.getClassValidAnnotators().size());
-			assertEquals(cva2, annotationSchema.getClassValidAnnotators().get(0));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetValidAnnotations() throws Exception {
-		try {
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			List<MiriamType> list = new ArrayList<>();
-			list.add(MiriamType.CAS);
-			UserClassValidAnnotations cva = new UserClassValidAnnotations(String.class, list);
-			annotationSchema.addClassValidAnnotations(cva);
-			assertEquals(1, annotationSchema.getValidAnnotations(String.class).size());
-			assertEquals(0, annotationSchema.getValidAnnotations(Integer.class).size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetRequiredAnnotations() throws Exception {
-		try {
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			List<MiriamType> list = new ArrayList<>();
-			list.add(MiriamType.CAS);
-			UserClassRequiredAnnotations cva = new UserClassRequiredAnnotations(String.class, list);
-			annotationSchema.addClassRequiredAnnotations(cva);
-			assertEquals(1, annotationSchema.getRequiredAnnotations(String.class).size());
-			assertEquals(0, annotationSchema.getRequiredAnnotations(Integer.class).size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddInvalidClassValidAnnotations() throws Exception {
-		try {
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			UserClassValidAnnotations cva = new UserClassValidAnnotations(String.class, new ArrayList<MiriamType>());
-			cva.setClassName((String)null);
-			
-			annotationSchema.addClassValidAnnotations(cva);
-			fail("Exception expected");
-		} catch (InvalidArgumentException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new UserAnnotationSchema());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			UserAnnotationSchema uas = new UserAnnotationSchema();
-			Boolean validateMiriamTypes = true;
-			List<UserClassAnnotators> classAnnotators = new ArrayList<>();
-			List<UserClassValidAnnotations> classValidAnnotators = new ArrayList<>();
-			List<UserClassRequiredAnnotations> classRequiredAnnotators = new ArrayList<>();
-			User user = new User();
-
-			Boolean sbgnFormat = true;
-			Boolean networkLayoutAsDefault = true;
-
-			uas.setValidateMiriamTypes(validateMiriamTypes);
-			uas.setClassAnnotators(classAnnotators);
-			uas.setClassValidAnnotators(classValidAnnotators);
-			uas.setClassRequiredAnnotators(classRequiredAnnotators);
-			uas.setSbgnFormat(sbgnFormat);
-			uas.setNetworkLayoutAsDefault(networkLayoutAsDefault);
-			uas.setUser(user);
-
-			assertEquals(validateMiriamTypes, uas.getValidateMiriamTypes());
-			assertEquals(classAnnotators, uas.getClassAnnotators());
-			assertEquals(classValidAnnotators, uas.getClassValidAnnotators());
-			assertEquals(classRequiredAnnotators, uas.getClassRequiredAnnotators());
-			assertEquals(sbgnFormat, uas.getSbgnFormat());
-			assertEquals(networkLayoutAsDefault, uas.getNetworkLayoutAsDefault());
-			assertEquals(user, uas.getUser());
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.MiriamType;
+
+public class UserAnnotationSchemaTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testAddClassAnnotator() throws Exception {
+		try {
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			UserClassAnnotators ca = new UserClassAnnotators(String.class, new ArrayList<String>());
+			UserClassAnnotators ca2 = new UserClassAnnotators(String.class, new ArrayList<String>());
+			annotationSchema.addClassAnnotator(ca);
+			annotationSchema.addClassAnnotator(ca2);
+			assertEquals(1, annotationSchema.getClassAnnotators().size());
+			assertEquals(ca2.getAnnotators(), annotationSchema.getAnnotatorsForClass(String.class));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testInvalidAddClassAnnotator() throws Exception {
+		try {
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			UserClassAnnotators ca = new UserClassAnnotators(String.class, new ArrayList<String>());
+			ca.setClassName((String)null);
+			annotationSchema.addClassAnnotator(ca);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddClassRequiredAnnotations() throws Exception {
+		try {
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			UserClassRequiredAnnotations cra = new UserClassRequiredAnnotations(String.class, new ArrayList<MiriamType>());
+			UserClassRequiredAnnotations cra2 = new UserClassRequiredAnnotations(String.class, new ArrayList<MiriamType>());
+			annotationSchema.addClassRequiredAnnotations(cra);
+			annotationSchema.addClassRequiredAnnotations(cra2);
+			assertEquals(1, annotationSchema.getClassRequiredAnnotators().size());
+			assertEquals(cra2, annotationSchema.getClassRequiredAnnotators().get(0));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	@Test
+	public void testAddInvalidClassRequiredAnnotations() throws Exception {
+		try {
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			UserClassRequiredAnnotations cra = new UserClassRequiredAnnotations(String.class, new ArrayList<MiriamType>());
+			cra.setClassName((String)null);
+			
+			annotationSchema.addClassRequiredAnnotations(cra);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddClassValidAnnotations() throws Exception {
+		try {
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			UserClassValidAnnotations cva = new UserClassValidAnnotations(String.class, new ArrayList<MiriamType>());
+			UserClassValidAnnotations cva2 = new UserClassValidAnnotations(String.class, new ArrayList<MiriamType>());
+			annotationSchema.addClassValidAnnotations(cva);
+			annotationSchema.addClassValidAnnotations(cva2);
+			assertEquals(1, annotationSchema.getClassValidAnnotators().size());
+			assertEquals(cva2, annotationSchema.getClassValidAnnotators().get(0));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetValidAnnotations() throws Exception {
+		try {
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			List<MiriamType> list = new ArrayList<>();
+			list.add(MiriamType.CAS);
+			UserClassValidAnnotations cva = new UserClassValidAnnotations(String.class, list);
+			annotationSchema.addClassValidAnnotations(cva);
+			assertEquals(1, annotationSchema.getValidAnnotations(String.class).size());
+			assertEquals(0, annotationSchema.getValidAnnotations(Integer.class).size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetRequiredAnnotations() throws Exception {
+		try {
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			List<MiriamType> list = new ArrayList<>();
+			list.add(MiriamType.CAS);
+			UserClassRequiredAnnotations cva = new UserClassRequiredAnnotations(String.class, list);
+			annotationSchema.addClassRequiredAnnotations(cva);
+			assertEquals(1, annotationSchema.getRequiredAnnotations(String.class).size());
+			assertEquals(0, annotationSchema.getRequiredAnnotations(Integer.class).size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddInvalidClassValidAnnotations() throws Exception {
+		try {
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			UserClassValidAnnotations cva = new UserClassValidAnnotations(String.class, new ArrayList<MiriamType>());
+			cva.setClassName((String)null);
+			
+			annotationSchema.addClassValidAnnotations(cva);
+			fail("Exception expected");
+		} catch (InvalidArgumentException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new UserAnnotationSchema());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			UserAnnotationSchema uas = new UserAnnotationSchema();
+			Boolean validateMiriamTypes = true;
+			List<UserClassAnnotators> classAnnotators = new ArrayList<>();
+			List<UserClassValidAnnotations> classValidAnnotators = new ArrayList<>();
+			List<UserClassRequiredAnnotations> classRequiredAnnotators = new ArrayList<>();
+			User user = new User();
+
+			Boolean sbgnFormat = true;
+			Boolean networkLayoutAsDefault = true;
+
+			uas.setValidateMiriamTypes(validateMiriamTypes);
+			uas.setClassAnnotators(classAnnotators);
+			uas.setClassValidAnnotators(classValidAnnotators);
+			uas.setClassRequiredAnnotators(classRequiredAnnotators);
+			uas.setSbgnFormat(sbgnFormat);
+			uas.setNetworkLayoutAsDefault(networkLayoutAsDefault);
+			uas.setUser(user);
+
+			assertEquals(validateMiriamTypes, uas.getValidateMiriamTypes());
+			assertEquals(classAnnotators, uas.getClassAnnotators());
+			assertEquals(classValidAnnotators, uas.getClassValidAnnotators());
+			assertEquals(classRequiredAnnotators, uas.getClassRequiredAnnotators());
+			assertEquals(sbgnFormat, uas.getSbgnFormat());
+			assertEquals(networkLayoutAsDefault, uas.getNetworkLayoutAsDefault());
+			assertEquals(user, uas.getUser());
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/UserClassAnnotatorsTest.java b/model/src/test/java/lcsb/mapviewer/model/user/UserClassAnnotatorsTest.java
index 27a06d7cce..c704efc4bc 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/UserClassAnnotatorsTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/UserClassAnnotatorsTest.java
@@ -1,71 +1,71 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class UserClassAnnotatorsTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new UserClassAnnotators());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testConstructor() {
-		try {
-			List<String> list = new ArrayList<>();
-			list.add("test");
-			UserClassAnnotators uca = new UserClassAnnotators(String.class,list);
-			
-			assertEquals(1,uca.getAnnotators().size());
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testGetters() {
-		try {
-			UserClassAnnotators uca = new UserClassAnnotators();
-			Integer id = 26;
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			List<String> annotators = new ArrayList<>();
-			Class<?> clazz = String.class;
-			
-			uca.setId(id);
-			uca.setAnnotationSchema(annotationSchema);
-			uca.setAnnotators(annotators);
-			uca.addAnnotator(clazz);
-			
-			assertEquals(id, uca.getId());
-			assertEquals(annotationSchema, uca.getAnnotationSchema());
-			assertEquals(annotators, uca.getAnnotators());
-			assertEquals(clazz.getCanonicalName(), uca.getAnnotators().get(0));
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class UserClassAnnotatorsTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new UserClassAnnotators());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+	@Test
+	public void testConstructor() {
+		try {
+			List<String> list = new ArrayList<>();
+			list.add("test");
+			UserClassAnnotators uca = new UserClassAnnotators(String.class,list);
+			
+			assertEquals(1,uca.getAnnotators().size());
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	@Test
+	public void testGetters() {
+		try {
+			UserClassAnnotators uca = new UserClassAnnotators();
+			Integer id = 26;
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			List<String> annotators = new ArrayList<>();
+			Class<?> clazz = String.class;
+			
+			uca.setId(id);
+			uca.setAnnotationSchema(annotationSchema);
+			uca.setAnnotators(annotators);
+			uca.addAnnotator(clazz);
+			
+			assertEquals(id, uca.getId());
+			assertEquals(annotationSchema, uca.getAnnotationSchema());
+			assertEquals(annotators, uca.getAnnotators());
+			assertEquals(clazz.getCanonicalName(), uca.getAnnotators().get(0));
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/UserClassRequiredAnnotationsTest.java b/model/src/test/java/lcsb/mapviewer/model/user/UserClassRequiredAnnotationsTest.java
index 7bee0f079f..7b3b8c5ca3 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/UserClassRequiredAnnotationsTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/UserClassRequiredAnnotationsTest.java
@@ -1,97 +1,97 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.MiriamType;
-
-public class UserClassRequiredAnnotationsTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new UserClassRequiredAnnotations());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testGetters() {
-		try {
-			UserClassRequiredAnnotations obj = new UserClassRequiredAnnotations();
-			Integer id= 24;
-			List<MiriamType> requiredMiriamTypes = new ArrayList<>();
-			Boolean requireAtLestOneAnnotation = true;
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-			
-			obj.setId(id);
-			obj.setRequiredMiriamTypes(requiredMiriamTypes);
-			obj.setRequireAtLestOneAnnotation(requireAtLestOneAnnotation);
-			obj.setAnnotationSchema(annotationSchema);
-			
-			assertEquals(id, obj.getId());
-			assertEquals(requiredMiriamTypes, obj.getRequiredMiriamTypes());
-			assertEquals(requireAtLestOneAnnotation, obj.getRequireAtLestOneAnnotation());
-			
-			assertEquals(annotationSchema, obj.getAnnotationSchema());
-			
-			obj.addRequiredMiriamType(MiriamType.CCDS);
-			assertEquals(1,obj.getRequiredMiriamTypes().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testConstructor() {
-		try {
-			UserClassRequiredAnnotations obj = new UserClassRequiredAnnotations(String.class,(Collection<MiriamType>)null);
-			assertFalse(obj.getRequireAtLestOneAnnotation());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	
-	@Test
-	public void testConstructor2() {
-		try {
-			UserClassRequiredAnnotations obj = new UserClassRequiredAnnotations(String.class,new MiriamType[]{MiriamType.CAS});
-			assertTrue(obj.getRequireAtLestOneAnnotation());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-	@Test
-	public void testConstructor3() {
-		try {
-			UserClassRequiredAnnotations obj = new UserClassRequiredAnnotations(String.class,new MiriamType[]{});
-			assertFalse(obj.getRequireAtLestOneAnnotation());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.MiriamType;
+
+public class UserClassRequiredAnnotationsTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new UserClassRequiredAnnotations());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+	@Test
+	public void testGetters() {
+		try {
+			UserClassRequiredAnnotations obj = new UserClassRequiredAnnotations();
+			Integer id= 24;
+			List<MiriamType> requiredMiriamTypes = new ArrayList<>();
+			Boolean requireAtLestOneAnnotation = true;
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+			
+			obj.setId(id);
+			obj.setRequiredMiriamTypes(requiredMiriamTypes);
+			obj.setRequireAtLestOneAnnotation(requireAtLestOneAnnotation);
+			obj.setAnnotationSchema(annotationSchema);
+			
+			assertEquals(id, obj.getId());
+			assertEquals(requiredMiriamTypes, obj.getRequiredMiriamTypes());
+			assertEquals(requireAtLestOneAnnotation, obj.getRequireAtLestOneAnnotation());
+			
+			assertEquals(annotationSchema, obj.getAnnotationSchema());
+			
+			obj.addRequiredMiriamType(MiriamType.CCDS);
+			assertEquals(1,obj.getRequiredMiriamTypes().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+	@Test
+	public void testConstructor() {
+		try {
+			UserClassRequiredAnnotations obj = new UserClassRequiredAnnotations(String.class,(Collection<MiriamType>)null);
+			assertFalse(obj.getRequireAtLestOneAnnotation());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	
+	@Test
+	public void testConstructor2() {
+		try {
+			UserClassRequiredAnnotations obj = new UserClassRequiredAnnotations(String.class,new MiriamType[]{MiriamType.CAS});
+			assertTrue(obj.getRequireAtLestOneAnnotation());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	@Test
+	public void testConstructor3() {
+		try {
+			UserClassRequiredAnnotations obj = new UserClassRequiredAnnotations(String.class,new MiriamType[]{});
+			assertFalse(obj.getRequireAtLestOneAnnotation());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/UserClassValidAnnotationsTest.java b/model/src/test/java/lcsb/mapviewer/model/user/UserClassValidAnnotationsTest.java
index a53c5c0f51..29e55642e6 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/UserClassValidAnnotationsTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/UserClassValidAnnotationsTest.java
@@ -1,80 +1,80 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.MiriamType;
-
-public class UserClassValidAnnotationsTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new UserClassValidAnnotations());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testConstructor() {
-		try {
-			UserClassValidAnnotations usva = new UserClassValidAnnotations(Object.class, new MiriamType[] { MiriamType.CAS });
-			assertNotNull(usva);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			UserClassValidAnnotations usva = new UserClassValidAnnotations();
-			List<MiriamType> validMiriamTypes = new ArrayList<>();
-			UserAnnotationSchema schema = new UserAnnotationSchema();
-			Integer id = 69;
-			usva.setValidMiriamTypes(validMiriamTypes);
-			assertEquals(validMiriamTypes, usva.getValidMiriamTypes());
-			usva.setId(id);
-			assertEquals(id, usva.getId());
-			usva.setAnnotationSchema(schema);
-			assertEquals(schema, usva.getAnnotationSchema());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddValidMiriamType() {
-		try {
-			UserClassValidAnnotations usva = new UserClassValidAnnotations();
-			usva.addValidMiriamType(MiriamType.CAS);
-			assertTrue(usva.getValidMiriamTypes().contains(MiriamType.CAS));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.MiriamType;
+
+public class UserClassValidAnnotationsTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new UserClassValidAnnotations());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testConstructor() {
+		try {
+			UserClassValidAnnotations usva = new UserClassValidAnnotations(Object.class, new MiriamType[] { MiriamType.CAS });
+			assertNotNull(usva);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			UserClassValidAnnotations usva = new UserClassValidAnnotations();
+			List<MiriamType> validMiriamTypes = new ArrayList<>();
+			UserAnnotationSchema schema = new UserAnnotationSchema();
+			Integer id = 69;
+			usva.setValidMiriamTypes(validMiriamTypes);
+			assertEquals(validMiriamTypes, usva.getValidMiriamTypes());
+			usva.setId(id);
+			assertEquals(id, usva.getId());
+			usva.setAnnotationSchema(schema);
+			assertEquals(schema, usva.getAnnotationSchema());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddValidMiriamType() {
+		try {
+			UserClassValidAnnotations usva = new UserClassValidAnnotations();
+			usva.addValidMiriamType(MiriamType.CAS);
+			assertTrue(usva.getValidMiriamTypes().contains(MiriamType.CAS));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/model/user/UserTest.java b/model/src/test/java/lcsb/mapviewer/model/user/UserTest.java
index 67745a3572..2de8a4b7d3 100644
--- a/model/src/test/java/lcsb/mapviewer/model/user/UserTest.java
+++ b/model/src/test/java/lcsb/mapviewer/model/user/UserTest.java
@@ -1,102 +1,102 @@
-package lcsb.mapviewer.model.user;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.lang3.SerializationUtils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class UserTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSerialization() {
-		try {
-			SerializationUtils.serialize(new User());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToString() {
-		try {
-			assertNotNull(new User().toString());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddPrivilege() {
-		try {
-			User user = new User();
-			user.addPrivilege(new BasicPrivilege());
-			assertEquals(1, user.getPrivileges().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetters() {
-		try {
-			User user = new User();
-			int id = 737;
-			String login = "log 54";
-			String cryptedPassword = "pa";
-			String name = "ccr";
-			String email= "a.a@pl.pl";
-			String surname = "cccv";
-			Set<BasicPrivilege> privileges = new HashSet<>();
-			boolean removed = true;
-			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
-
-			user.setId(id);
-			assertEquals((Integer)id, user.getId());
-			
-			user.setLogin(login);
-			assertEquals(login, user.getLogin());
-			
-			user.setCryptedPassword(cryptedPassword);
-			assertEquals(cryptedPassword, user.getCryptedPassword());
-			
-			user.setName(name);
-			assertEquals(name, user.getName());
-			
-			user.setSurname(surname);
-			assertEquals(surname, user.getSurname());
-			
-			user.setPrivileges(privileges);
-			assertEquals(privileges, user.getPrivileges());
-			
-			user.setRemoved(removed);
-			assertEquals(removed, user.isRemoved());
-			
-			user.setEmail(email);
-			assertEquals(email, user.getEmail());
-			
-			user.setAnnotationSchema(annotationSchema);
-			assertEquals(annotationSchema, user.getAnnotationSchema());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.model.user;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class UserTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSerialization() {
+		try {
+			SerializationUtils.serialize(new User());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToString() {
+		try {
+			assertNotNull(new User().toString());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddPrivilege() {
+		try {
+			User user = new User();
+			user.addPrivilege(new BasicPrivilege());
+			assertEquals(1, user.getPrivileges().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetters() {
+		try {
+			User user = new User();
+			int id = 737;
+			String login = "log 54";
+			String cryptedPassword = "pa";
+			String name = "ccr";
+			String email= "a.a@pl.pl";
+			String surname = "cccv";
+			Set<BasicPrivilege> privileges = new HashSet<>();
+			boolean removed = true;
+			UserAnnotationSchema annotationSchema = new UserAnnotationSchema();
+
+			user.setId(id);
+			assertEquals((Integer)id, user.getId());
+			
+			user.setLogin(login);
+			assertEquals(login, user.getLogin());
+			
+			user.setCryptedPassword(cryptedPassword);
+			assertEquals(cryptedPassword, user.getCryptedPassword());
+			
+			user.setName(name);
+			assertEquals(name, user.getName());
+			
+			user.setSurname(surname);
+			assertEquals(surname, user.getSurname());
+			
+			user.setPrivileges(privileges);
+			assertEquals(privileges, user.getPrivileges());
+			
+			user.setRemoved(removed);
+			assertEquals(removed, user.isRemoved());
+			
+			user.setEmail(email);
+			assertEquals(email, user.getEmail());
+			
+			user.setAnnotationSchema(annotationSchema);
+			assertEquals(annotationSchema, user.getAnnotationSchema());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/model/src/test/java/lcsb/mapviewer/modelutils/map/AllMapUtilTests.java b/model/src/test/java/lcsb/mapviewer/modelutils/map/AllMapUtilTests.java
index 6e4837f4a5..39b4cc031b 100644
--- a/model/src/test/java/lcsb/mapviewer/modelutils/map/AllMapUtilTests.java
+++ b/model/src/test/java/lcsb/mapviewer/modelutils/map/AllMapUtilTests.java
@@ -1,14 +1,14 @@
-package lcsb.mapviewer.modelutils.map;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ ClassTreeNodeTest.class, //
-		ElementUtilsTest.class, //
-		RequireAnnotationMapTest.class, //
-})
-public class AllMapUtilTests {
-
-}
+package lcsb.mapviewer.modelutils.map;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ ClassTreeNodeTest.class, //
+		ElementUtilsTest.class, //
+		RequireAnnotationMapTest.class, //
+})
+public class AllMapUtilTests {
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/modelutils/map/ClassTreeNodeTest.java b/model/src/test/java/lcsb/mapviewer/modelutils/map/ClassTreeNodeTest.java
index db90ccf768..5ef9e5a72a 100644
--- a/model/src/test/java/lcsb/mapviewer/modelutils/map/ClassTreeNodeTest.java
+++ b/model/src/test/java/lcsb/mapviewer/modelutils/map/ClassTreeNodeTest.java
@@ -1,43 +1,43 @@
-package lcsb.mapviewer.modelutils.map;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ClassTreeNodeTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSetters() {
-		try {
-			ClassTreeNode node = new ClassTreeNode(Object.class);
-			Class<?> clazz = String.class;
-			List<ClassTreeNode> children = new ArrayList<>();
-			String commonName= "test";
-			node.setClazz(clazz);
-			node.setChildren(children);
-			node.setCommonName(commonName);
-			
-			assertEquals(clazz, node.getClazz());
-			assertEquals(children, node.getChildren());
-			assertEquals(commonName, node.getCommonName());
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.modelutils.map;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ClassTreeNodeTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSetters() {
+		try {
+			ClassTreeNode node = new ClassTreeNode(Object.class);
+			Class<?> clazz = String.class;
+			List<ClassTreeNode> children = new ArrayList<>();
+			String commonName= "test";
+			node.setClazz(clazz);
+			node.setChildren(children);
+			node.setCommonName(commonName);
+			
+			assertEquals(clazz, node.getClazz());
+			assertEquals(children, node.getChildren());
+			assertEquals(commonName, node.getCommonName());
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/model/src/test/java/lcsb/mapviewer/modelutils/map/RequireAnnotationMapTest.java b/model/src/test/java/lcsb/mapviewer/modelutils/map/RequireAnnotationMapTest.java
index 9c30c4cea4..e90a4446bb 100644
--- a/model/src/test/java/lcsb/mapviewer/modelutils/map/RequireAnnotationMapTest.java
+++ b/model/src/test/java/lcsb/mapviewer/modelutils/map/RequireAnnotationMapTest.java
@@ -1,29 +1,29 @@
-package lcsb.mapviewer.modelutils.map;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class RequireAnnotationMapTest {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testValidValues() {
-		for (RequireAnnotationMap type : RequireAnnotationMap.values()) {
-			assertNotNull(type);
-
-			// for coverage tests
-			RequireAnnotationMap.valueOf(type.toString());
-		}
-	}
-
-}
+package lcsb.mapviewer.modelutils.map;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class RequireAnnotationMapTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testValidValues() {
+		for (RequireAnnotationMap type : RequireAnnotationMap.values()) {
+			assertNotNull(type);
+
+			// for coverage tests
+			RequireAnnotationMap.valueOf(type.toString());
+		}
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/BiopaxParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/BiopaxParser.java
index c9e669f18d..18be5df81c 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/BiopaxParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/BiopaxParser.java
@@ -1,264 +1,264 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.XmlParser;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.wikipathway.model.biopax.BiopaxData;
-import lcsb.mapviewer.wikipathway.model.biopax.BiopaxOpenControlledVocabulary;
-import lcsb.mapviewer.wikipathway.model.biopax.BiopaxPublication;
-
-/**
- * Parser of Biopax data from the gpml file.
- * 
- * @author Piotr Gawron
- * 
- */
-public class BiopaxParser extends XmlParser {
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger						logger		 = Logger.getLogger(BiopaxParser.class);
-
-	/**
-	 * Hash used for next {@link BiopaxPublication} processed by parser.
-	 */
-	private Integer									hash			 = 1;
-
-	/**
-	 * Mapping between {@link MiriamData} and hash value.
-	 */
-	private Map<MiriamData, String>	miriamHash = new HashMap<>();
-
-	/**
-	 * Creates data structure from biopax xml node.
-	 * 
-	 * @param biopax
-	 *          xml node
-	 * @return {@link BiopaxData} structure containing biopax data
-	 */
-	public BiopaxData parse(Node biopax) {
-		BiopaxData result = new BiopaxData();
-		NodeList nodes = biopax.getChildNodes();
-		for (int i = 0; i < nodes.getLength(); i++) {
-			Node node = nodes.item(i);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if ("bp:PublicationXref".equalsIgnoreCase(node.getNodeName())) {
-					BiopaxPublication publication = parsePublication(node);
-					if (publication.getId() == null || publication.getId().isEmpty()) {
-						logger.warn("No pubmed identifier defined for publication: title: " + publication.getTitle());
-					}
-					result.addPublication(publication);
-				} else if ("bp:openControlledVocabulary".equalsIgnoreCase(node.getNodeName())) {
-					result.addOpenControlledVocabulary(parseOpenControlledVocabulary(node));
-				} else {
-					logger.warn("Unknown biopax node: " + node.getNodeName());
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Method which parse biopax vocabulary xml node.
-	 * 
-	 * @param biopaxNode
-	 *          xml node
-	 * @return {@link BiopaxOpenControlledVocabulary}
-	 */
-	private BiopaxOpenControlledVocabulary parseOpenControlledVocabulary(Node biopaxNode) {
-		BiopaxOpenControlledVocabulary result = new BiopaxOpenControlledVocabulary();
-		NodeList nodes = biopaxNode.getChildNodes();
-
-		for (int i = 0; i < nodes.getLength(); i++) {
-			Node node = nodes.item(i);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if ("bp:ID".equalsIgnoreCase(node.getNodeName())) {
-					result.setId(node.getTextContent());
-				} else if ("bp:TERM".equalsIgnoreCase(node.getNodeName())) {
-					result.setTerm(node.getTextContent());
-				} else if ("bp:Ontology".equalsIgnoreCase(node.getNodeName())) {
-					result.setOntology(node.getTextContent());
-				} else {
-					logger.warn("Unknown biopax node: " + node.getNodeName());
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Method which parse biopax publication xml node.
-	 * 
-	 * @param publication
-	 *          xml node
-	 * @return {@link BiopaxPublication}
-	 */
-	protected BiopaxPublication parsePublication(Node publication) {
-		BiopaxPublication result = new BiopaxPublication();
-		NodeList nodes = publication.getChildNodes();
-
-		result.setReferenceId(getNodeAttr("rdf:id", publication));
-		for (int i = 0; i < nodes.getLength(); i++) {
-			Node node = nodes.item(i);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if ("bp:ID".equalsIgnoreCase(node.getNodeName())) {
-					result.setId(node.getTextContent());
-				} else if ("bp:DB".equalsIgnoreCase(node.getNodeName())) {
-					result.setDb(node.getTextContent());
-				} else if ("bp:TITLE".equalsIgnoreCase(node.getNodeName())) {
-					result.setTitle(node.getTextContent());
-				} else if ("bp:SOURCE".equalsIgnoreCase(node.getNodeName())) {
-					result.setSource(node.getTextContent());
-				} else if ("bp:YEAR".equalsIgnoreCase(node.getNodeName())) {
-					result.setYear(node.getTextContent());
-				} else if ("bp:AUTHORS".equalsIgnoreCase(node.getNodeName())) {
-					result.setAuthors(node.getTextContent());
-				} else {
-					logger.warn("Unknown biopax node: " + node.getNodeName());
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns xml string representing biopax reference to set of
-	 * {@link MiriamData} form parameters.
-	 * 
-	 * @param miriamData
-	 *          set of {@link MiriamData} for which we want to obtain biopax
-	 *          references
-	 * @return xml string representing biopax reference to set of
-	 *         {@link MiriamData} form parameters. Only references to
-	 *         {@link MiriamType#PUBMED} are included.
-	 */
-	public String toReferenceXml(Set<MiriamData> miriamData) {
-		StringBuilder sb = new StringBuilder("");
-		for (MiriamData md : miriamData) {
-			if (md.getDataType().equals(MiriamType.PUBMED)) {
-				sb.append("<BiopaxRef>" + getHash(md) + "</BiopaxRef>\n");
-			}
-		}
-		return sb.toString();
-	}
-
-	/**
-	 * Returns unique hash for the {@link MiriamData} that can be used as a key in
-	 * Biopax xml.
-	 * 
-	 * @param md
-	 *          {@link MiriamData} for which we want to have unique hash value
-	 * @return unique hash for the {@link MiriamData} that can be used as a key in
-	 *         Biopax xml
-	 */
-	private String getHash(MiriamData md) {
-		if (miriamHash.get(md) == null) {
-			miriamHash.put(md, "ann" + hash);
-			hash++;
-		}
-		return miriamHash.get(md);
-	}
-
-	/**
-	 * Converts collection of {@link MiriamData} into an xml {@link String}
-	 * representing this collection as a biopax data.
-	 * 
-	 * @param miriamData
-	 *          collection of {@link MiriamData}
-	 * @return xml {@link String} representing this collection as a biopax data
-	 */
-	public String toXml(Collection<MiriamData> miriamData) {
-		StringBuilder sb = new StringBuilder("");
-		sb.append("<Biopax>\n");
-		for (MiriamData md : miriamData) {
-			if (md.getDataType().equals(MiriamType.PUBMED)) {
-				sb.append(toXml(md));
-			}
-		}
-		sb.append("</Biopax>\n");
-
-		return sb.toString();
-	}
-
-	/**
-	 * Converts {@link MiriamData} into xml string in biopax format.
-	 * 
-	 * @param md
-	 *          {@link MiriamData} to transform
-	 * @return xml string in biopax format representing {@link MiriamData}
-	 */
-	public String toXml(MiriamData md) {
-		StringBuilder sb = new StringBuilder();
-		sb.append(
-				"<bp:PublicationXref xmlns:bp=\"http://www.biopax.org/release/biopax-level3.owl#\" "
-						+ "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" rdf:id=\"" + getHash(md) + "\">\n");
-		sb.append("  <bp:ID rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">" + md.getResource() + "</bp:ID>\n");
-		sb.append("  <bp:DB rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">PubMed</bp:DB>\n");
-		sb.append("</bp:PublicationXref>\n");
-		return sb.toString();
-	}
-
-	/**
-	 * Creates {@link MiriamData annotation} from {@link BiopaxPublication}.
-	 * 
-	 * @param publication
-	 *          input biopax structure
-	 * @return {@link MiriamData annotation}
-	 */
-	protected MiriamData createMiriamData(BiopaxPublication publication) {
-		if ("PubMed".equals(publication.getDb())) {
-			if (publication.getId() == null || publication.getId().equals("")) {
-				return null;
-			} else {
-				return new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, publication.getId());
-			}
-		} else {
-			throw new InvalidArgumentException("Unknown biopax database: " + publication.getDb());
-		}
-	}
-
-	/**
-	 * Returns list of {@link MiriamData} that are refernced in {@link BiopaxData}
-	 * with identifier given in biopaxReference.
-	 * 
-	 * @param biopaxData
-	 *          {@link BiopaxData} where annotations are stored
-	 * @param biopaxReference
-	 *          list of refrences (to data in {@link BiopaxData}) that we want to
-	 *          convert into {@link MiriamData}
-	 * @return list of {@link MiriamData} that are refernced in {@link BiopaxData}
-	 *         with identifier given in biopaxReference.
-	 */
-	public Collection<MiriamData> getMiriamData(BiopaxData biopaxData, List<String> biopaxReference) {
-		List<MiriamData> result = new ArrayList<>();
-		for (String string : biopaxReference) {
-			BiopaxPublication bp = biopaxData.getPublicationByReference(string);
-			if (bp != null) {
-				MiriamData md = createMiriamData(bp);
-				if (md != null) {
-					result.add(md);
-				} else {
-					logger.warn("[" + string + "]\tBiopax publication is invalid.");
-				}
-			} else {
-				logger.warn("[" + string + "]\tBiopax publication doesn't exist.");
-			}
-		}
-		return result;
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.XmlParser;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.wikipathway.model.biopax.BiopaxData;
+import lcsb.mapviewer.wikipathway.model.biopax.BiopaxOpenControlledVocabulary;
+import lcsb.mapviewer.wikipathway.model.biopax.BiopaxPublication;
+
+/**
+ * Parser of Biopax data from the gpml file.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class BiopaxParser extends XmlParser {
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger						logger		 = Logger.getLogger(BiopaxParser.class);
+
+	/**
+	 * Hash used for next {@link BiopaxPublication} processed by parser.
+	 */
+	private Integer									hash			 = 1;
+
+	/**
+	 * Mapping between {@link MiriamData} and hash value.
+	 */
+	private Map<MiriamData, String>	miriamHash = new HashMap<>();
+
+	/**
+	 * Creates data structure from biopax xml node.
+	 * 
+	 * @param biopax
+	 *          xml node
+	 * @return {@link BiopaxData} structure containing biopax data
+	 */
+	public BiopaxData parse(Node biopax) {
+		BiopaxData result = new BiopaxData();
+		NodeList nodes = biopax.getChildNodes();
+		for (int i = 0; i < nodes.getLength(); i++) {
+			Node node = nodes.item(i);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if ("bp:PublicationXref".equalsIgnoreCase(node.getNodeName())) {
+					BiopaxPublication publication = parsePublication(node);
+					if (publication.getId() == null || publication.getId().isEmpty()) {
+						logger.warn("No pubmed identifier defined for publication: title: " + publication.getTitle());
+					}
+					result.addPublication(publication);
+				} else if ("bp:openControlledVocabulary".equalsIgnoreCase(node.getNodeName())) {
+					result.addOpenControlledVocabulary(parseOpenControlledVocabulary(node));
+				} else {
+					logger.warn("Unknown biopax node: " + node.getNodeName());
+				}
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Method which parse biopax vocabulary xml node.
+	 * 
+	 * @param biopaxNode
+	 *          xml node
+	 * @return {@link BiopaxOpenControlledVocabulary}
+	 */
+	private BiopaxOpenControlledVocabulary parseOpenControlledVocabulary(Node biopaxNode) {
+		BiopaxOpenControlledVocabulary result = new BiopaxOpenControlledVocabulary();
+		NodeList nodes = biopaxNode.getChildNodes();
+
+		for (int i = 0; i < nodes.getLength(); i++) {
+			Node node = nodes.item(i);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if ("bp:ID".equalsIgnoreCase(node.getNodeName())) {
+					result.setId(node.getTextContent());
+				} else if ("bp:TERM".equalsIgnoreCase(node.getNodeName())) {
+					result.setTerm(node.getTextContent());
+				} else if ("bp:Ontology".equalsIgnoreCase(node.getNodeName())) {
+					result.setOntology(node.getTextContent());
+				} else {
+					logger.warn("Unknown biopax node: " + node.getNodeName());
+				}
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Method which parse biopax publication xml node.
+	 * 
+	 * @param publication
+	 *          xml node
+	 * @return {@link BiopaxPublication}
+	 */
+	protected BiopaxPublication parsePublication(Node publication) {
+		BiopaxPublication result = new BiopaxPublication();
+		NodeList nodes = publication.getChildNodes();
+
+		result.setReferenceId(getNodeAttr("rdf:id", publication));
+		for (int i = 0; i < nodes.getLength(); i++) {
+			Node node = nodes.item(i);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if ("bp:ID".equalsIgnoreCase(node.getNodeName())) {
+					result.setId(node.getTextContent());
+				} else if ("bp:DB".equalsIgnoreCase(node.getNodeName())) {
+					result.setDb(node.getTextContent());
+				} else if ("bp:TITLE".equalsIgnoreCase(node.getNodeName())) {
+					result.setTitle(node.getTextContent());
+				} else if ("bp:SOURCE".equalsIgnoreCase(node.getNodeName())) {
+					result.setSource(node.getTextContent());
+				} else if ("bp:YEAR".equalsIgnoreCase(node.getNodeName())) {
+					result.setYear(node.getTextContent());
+				} else if ("bp:AUTHORS".equalsIgnoreCase(node.getNodeName())) {
+					result.setAuthors(node.getTextContent());
+				} else {
+					logger.warn("Unknown biopax node: " + node.getNodeName());
+				}
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns xml string representing biopax reference to set of
+	 * {@link MiriamData} form parameters.
+	 * 
+	 * @param miriamData
+	 *          set of {@link MiriamData} for which we want to obtain biopax
+	 *          references
+	 * @return xml string representing biopax reference to set of
+	 *         {@link MiriamData} form parameters. Only references to
+	 *         {@link MiriamType#PUBMED} are included.
+	 */
+	public String toReferenceXml(Set<MiriamData> miriamData) {
+		StringBuilder sb = new StringBuilder("");
+		for (MiriamData md : miriamData) {
+			if (md.getDataType().equals(MiriamType.PUBMED)) {
+				sb.append("<BiopaxRef>" + getHash(md) + "</BiopaxRef>\n");
+			}
+		}
+		return sb.toString();
+	}
+
+	/**
+	 * Returns unique hash for the {@link MiriamData} that can be used as a key in
+	 * Biopax xml.
+	 * 
+	 * @param md
+	 *          {@link MiriamData} for which we want to have unique hash value
+	 * @return unique hash for the {@link MiriamData} that can be used as a key in
+	 *         Biopax xml
+	 */
+	private String getHash(MiriamData md) {
+		if (miriamHash.get(md) == null) {
+			miriamHash.put(md, "ann" + hash);
+			hash++;
+		}
+		return miriamHash.get(md);
+	}
+
+	/**
+	 * Converts collection of {@link MiriamData} into an xml {@link String}
+	 * representing this collection as a biopax data.
+	 * 
+	 * @param miriamData
+	 *          collection of {@link MiriamData}
+	 * @return xml {@link String} representing this collection as a biopax data
+	 */
+	public String toXml(Collection<MiriamData> miriamData) {
+		StringBuilder sb = new StringBuilder("");
+		sb.append("<Biopax>\n");
+		for (MiriamData md : miriamData) {
+			if (md.getDataType().equals(MiriamType.PUBMED)) {
+				sb.append(toXml(md));
+			}
+		}
+		sb.append("</Biopax>\n");
+
+		return sb.toString();
+	}
+
+	/**
+	 * Converts {@link MiriamData} into xml string in biopax format.
+	 * 
+	 * @param md
+	 *          {@link MiriamData} to transform
+	 * @return xml string in biopax format representing {@link MiriamData}
+	 */
+	public String toXml(MiriamData md) {
+		StringBuilder sb = new StringBuilder();
+		sb.append(
+				"<bp:PublicationXref xmlns:bp=\"http://www.biopax.org/release/biopax-level3.owl#\" "
+						+ "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" rdf:id=\"" + getHash(md) + "\">\n");
+		sb.append("  <bp:ID rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">" + md.getResource() + "</bp:ID>\n");
+		sb.append("  <bp:DB rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">PubMed</bp:DB>\n");
+		sb.append("</bp:PublicationXref>\n");
+		return sb.toString();
+	}
+
+	/**
+	 * Creates {@link MiriamData annotation} from {@link BiopaxPublication}.
+	 * 
+	 * @param publication
+	 *          input biopax structure
+	 * @return {@link MiriamData annotation}
+	 */
+	protected MiriamData createMiriamData(BiopaxPublication publication) {
+		if ("PubMed".equals(publication.getDb())) {
+			if (publication.getId() == null || publication.getId().equals("")) {
+				return null;
+			} else {
+				return new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, publication.getId());
+			}
+		} else {
+			throw new InvalidArgumentException("Unknown biopax database: " + publication.getDb());
+		}
+	}
+
+	/**
+	 * Returns list of {@link MiriamData} that are refernced in {@link BiopaxData}
+	 * with identifier given in biopaxReference.
+	 * 
+	 * @param biopaxData
+	 *          {@link BiopaxData} where annotations are stored
+	 * @param biopaxReference
+	 *          list of refrences (to data in {@link BiopaxData}) that we want to
+	 *          convert into {@link MiriamData}
+	 * @return list of {@link MiriamData} that are refernced in {@link BiopaxData}
+	 *         with identifier given in biopaxReference.
+	 */
+	public Collection<MiriamData> getMiriamData(BiopaxData biopaxData, List<String> biopaxReference) {
+		List<MiriamData> result = new ArrayList<>();
+		for (String string : biopaxReference) {
+			BiopaxPublication bp = biopaxData.getPublicationByReference(string);
+			if (bp != null) {
+				MiriamData md = createMiriamData(bp);
+				if (md != null) {
+					result.add(md);
+				} else {
+					logger.warn("[" + string + "]\tBiopax publication is invalid.");
+				}
+			} else {
+				logger.warn("[" + string + "]\tBiopax publication doesn't exist.");
+			}
+		}
+		return result;
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/DataNodeParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/DataNodeParser.java
index 16a6b3b717..b9a02d90b9 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/DataNodeParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/DataNodeParser.java
@@ -1,200 +1,200 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.awt.geom.Rectangle2D;
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.wikipathway.model.DataNode;
-import lcsb.mapviewer.wikipathway.model.GpmlLineType;
-import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
-
-/**
- * Parser class that creates {@link DataNode} objects from Xml {@link Element
- * node}.
- * 
- * @author Piotr Gawron
- *
- */
-public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
-
-	/**
-	 * Default claass logger.
-	 */
-	private final Logger					logger					= Logger.getLogger(DataNodeParser.class);
-
-	/**
-	 * PArser used to process references.
-	 */
-	private final ReferenceParser	referenceParser	= new ReferenceParser();
-
-	@Override
-	public DataNode parse(Element eElement) throws UnknownTypeException {
-		if (!eElement.getNodeName().equals("DataNode")) {
-			throw new InvalidArgumentException(ShapeParser.class.getSimpleName() + " can parse only DataNode xml nodes");
-		}
-		DataNode node = new DataNode(eElement.getAttribute("GraphId"));
-
-		for (Pair<String, String> entry : getAttributes(eElement)) {
-			switch (entry.getLeft()) {
-				case ("GraphId"):
-					break;
-				case ("TextLabel"):
-					node.setTextLabel(entry.getRight());
-					break;
-				case ("GroupRef"):
-					node.setGroupRef(entry.getRight());
-					break;
-				case ("Type"):
-					node.setType(entry.getRight());
-					break;
-				default:
-					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
-					break;
-			}
-		}
-
-		NodeList tmpList = eElement.getChildNodes();
-		for (int j = 0; j < tmpList.getLength(); j++) {
-			Node tmpNode = tmpList.item(j);
-			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element eTmp = (Element) tmpNode;
-				switch (eTmp.getNodeName()) {
-					case ("Comment"):
-						node.addComment(eTmp.getTextContent());
-						break;
-					case ("BiopaxRef"):
-						node.addBiopaxReference(eTmp.getTextContent());
-						break;
-					case ("Xref"):
-						MiriamData data = referenceParser.parse(eTmp);
-						if (data != null) {
-							node.addReference(data);
-						}
-						break;
-					case ("Graphics"):
-						parseGraphics(eTmp, node);
-						break;
-					case ("Attribute"):
-						parseAttribute(eTmp, node);
-						break;
-					default:
-						logger.warn("Unknown sub-node of " + eElement.getNodeName() + " node: " + eTmp.getNodeName());
-						break;
-				}
-			}
-		}
-
-		return node;
-	}
-
-	/**
-	 * Parse graphics xml node in the shape node.
-	 * 
-	 * @param eTmp
-	 *          xml node with graphics
-	 * @param shape
-	 *          shape where data should be added
-	 * @throws UnknownTypeException
-	 *           thrown when node contains unknown types
-	 */
-	private void parseGraphics(Element eTmp, DataNode shape) throws UnknownTypeException {
-		Double centerX = null;
-		Double centerY = null;
-		Double width = null;
-		Double height = null;
-		for (Pair<String, String> entry : getAttributes(eTmp)) {
-			if (!parseCommonGraphicAttributes(shape, entry)) {
-				switch (entry.getLeft()) {
-					case ("CenterX"):
-						centerX = Double.valueOf(entry.getRight());
-						break;
-					case ("CenterY"):
-						centerY = Double.valueOf(entry.getRight());
-						break;
-					case ("Width"):
-						width = Double.valueOf(entry.getRight());
-						break;
-					case ("Height"):
-						height = Double.valueOf(entry.getRight());
-						break;
-					case ("ShapeType"):
-						shape.setType(entry.getRight());
-						break;
-					case ("Color"):
-						shape.setColor(hexStringToColor(entry.getRight()));
-						break;
-					case ("FillColor"):
-						shape.setFillColor(hexStringToColor(entry.getRight()));
-						break;
-					case ("ZOrder"):
-						shape.setzOrder(Integer.valueOf(entry.getRight()));
-						break;
-					case ("LineStyle"):
-						shape.setLineType(GpmlLineType.getByGpmlName(entry.getRight()).getCorrespondingGlobalLineType());
-						break;
-					case ("FontSize"):
-						shape.setFontSize(Double.valueOf(entry.getRight()));
-						break;
-					case ("FontWeight"):
-						shape.setFontWeight(entry.getRight());
-						break;
-					case ("Valign"):
-						shape.setvAlign(entry.getRight());
-						break;
-					default:
-						logger.warn("Unknown attribute of " + eTmp.getNodeName() + " node: " + entry.getLeft());
-						break;
-				}
-			}
-		}
-		shape.setRectangle(new Rectangle2D.Double(centerX - width / 2, centerY - height / 2, width, height));
-	}
-
-	/**
-	 * Method that parses {@link DataNode} xml attribute.
-	 * 
-	 * @param eTmp
-	 *          xml node with attribute
-	 * @param shape
-	 *          shape where data should be added
-	 */
-	private void parseAttribute(Element eTmp, DataNode shape) {
-		String key = eTmp.getAttribute("Key");
-		String value = eTmp.getAttribute("Value");
-		switch (key) {
-			case ("org.pathvisio.model.BackpageHead"):
-				// it's deprecated in PathVisio so we can skip it
-				break;
-			case ("org.pathvisio.model.GenMAPP-Xref"):
-				// skip it when it's empty
-				if (!value.isEmpty()) {
-					logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key: " + key + "; value: " + value);
-					break;
-				}
-				break;
-			default:
-				logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key: " + key + "; value: " + value);
-				break;
-		}
-	}
-
-	@Override
-	public String toXml(DataNode node) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-	@Override
-	public String toXml(Collection<DataNode> list) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.awt.geom.Rectangle2D;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.wikipathway.model.DataNode;
+import lcsb.mapviewer.wikipathway.model.GpmlLineType;
+import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
+
+/**
+ * Parser class that creates {@link DataNode} objects from Xml {@link Element
+ * node}.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class DataNodeParser extends GraphicalPathwayElementParser<DataNode> {
+
+	/**
+	 * Default claass logger.
+	 */
+	private final Logger					logger					= Logger.getLogger(DataNodeParser.class);
+
+	/**
+	 * PArser used to process references.
+	 */
+	private final ReferenceParser	referenceParser	= new ReferenceParser();
+
+	@Override
+	public DataNode parse(Element eElement) throws UnknownTypeException {
+		if (!eElement.getNodeName().equals("DataNode")) {
+			throw new InvalidArgumentException(ShapeParser.class.getSimpleName() + " can parse only DataNode xml nodes");
+		}
+		DataNode node = new DataNode(eElement.getAttribute("GraphId"));
+
+		for (Pair<String, String> entry : getAttributes(eElement)) {
+			switch (entry.getLeft()) {
+				case ("GraphId"):
+					break;
+				case ("TextLabel"):
+					node.setTextLabel(entry.getRight());
+					break;
+				case ("GroupRef"):
+					node.setGroupRef(entry.getRight());
+					break;
+				case ("Type"):
+					node.setType(entry.getRight());
+					break;
+				default:
+					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
+					break;
+			}
+		}
+
+		NodeList tmpList = eElement.getChildNodes();
+		for (int j = 0; j < tmpList.getLength(); j++) {
+			Node tmpNode = tmpList.item(j);
+			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
+				Element eTmp = (Element) tmpNode;
+				switch (eTmp.getNodeName()) {
+					case ("Comment"):
+						node.addComment(eTmp.getTextContent());
+						break;
+					case ("BiopaxRef"):
+						node.addBiopaxReference(eTmp.getTextContent());
+						break;
+					case ("Xref"):
+						MiriamData data = referenceParser.parse(eTmp);
+						if (data != null) {
+							node.addReference(data);
+						}
+						break;
+					case ("Graphics"):
+						parseGraphics(eTmp, node);
+						break;
+					case ("Attribute"):
+						parseAttribute(eTmp, node);
+						break;
+					default:
+						logger.warn("Unknown sub-node of " + eElement.getNodeName() + " node: " + eTmp.getNodeName());
+						break;
+				}
+			}
+		}
+
+		return node;
+	}
+
+	/**
+	 * Parse graphics xml node in the shape node.
+	 * 
+	 * @param eTmp
+	 *          xml node with graphics
+	 * @param shape
+	 *          shape where data should be added
+	 * @throws UnknownTypeException
+	 *           thrown when node contains unknown types
+	 */
+	private void parseGraphics(Element eTmp, DataNode shape) throws UnknownTypeException {
+		Double centerX = null;
+		Double centerY = null;
+		Double width = null;
+		Double height = null;
+		for (Pair<String, String> entry : getAttributes(eTmp)) {
+			if (!parseCommonGraphicAttributes(shape, entry)) {
+				switch (entry.getLeft()) {
+					case ("CenterX"):
+						centerX = Double.valueOf(entry.getRight());
+						break;
+					case ("CenterY"):
+						centerY = Double.valueOf(entry.getRight());
+						break;
+					case ("Width"):
+						width = Double.valueOf(entry.getRight());
+						break;
+					case ("Height"):
+						height = Double.valueOf(entry.getRight());
+						break;
+					case ("ShapeType"):
+						shape.setType(entry.getRight());
+						break;
+					case ("Color"):
+						shape.setColor(hexStringToColor(entry.getRight()));
+						break;
+					case ("FillColor"):
+						shape.setFillColor(hexStringToColor(entry.getRight()));
+						break;
+					case ("ZOrder"):
+						shape.setzOrder(Integer.valueOf(entry.getRight()));
+						break;
+					case ("LineStyle"):
+						shape.setLineType(GpmlLineType.getByGpmlName(entry.getRight()).getCorrespondingGlobalLineType());
+						break;
+					case ("FontSize"):
+						shape.setFontSize(Double.valueOf(entry.getRight()));
+						break;
+					case ("FontWeight"):
+						shape.setFontWeight(entry.getRight());
+						break;
+					case ("Valign"):
+						shape.setvAlign(entry.getRight());
+						break;
+					default:
+						logger.warn("Unknown attribute of " + eTmp.getNodeName() + " node: " + entry.getLeft());
+						break;
+				}
+			}
+		}
+		shape.setRectangle(new Rectangle2D.Double(centerX - width / 2, centerY - height / 2, width, height));
+	}
+
+	/**
+	 * Method that parses {@link DataNode} xml attribute.
+	 * 
+	 * @param eTmp
+	 *          xml node with attribute
+	 * @param shape
+	 *          shape where data should be added
+	 */
+	private void parseAttribute(Element eTmp, DataNode shape) {
+		String key = eTmp.getAttribute("Key");
+		String value = eTmp.getAttribute("Value");
+		switch (key) {
+			case ("org.pathvisio.model.BackpageHead"):
+				// it's deprecated in PathVisio so we can skip it
+				break;
+			case ("org.pathvisio.model.GenMAPP-Xref"):
+				// skip it when it's empty
+				if (!value.isEmpty()) {
+					logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key: " + key + "; value: " + value);
+					break;
+				}
+				break;
+			default:
+				logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key: " + key + "; value: " + value);
+				break;
+		}
+	}
+
+	@Override
+	public String toXml(DataNode node) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+	@Override
+	public String toXml(Collection<DataNode> list) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/EdgeLineParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/EdgeLineParser.java
index 92feeb4c0b..b573f26c44 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/EdgeLineParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/EdgeLineParser.java
@@ -1,92 +1,92 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.wikipathway.model.Edge;
-
-/**
- * Parser class that creates {@link Edge} objects from Xml {@link Element node}.
- * However the xml node is not typica edge node , but line node.
- * 
- * @author Piotr Gawron
- *
- */
-public class EdgeLineParser extends ElementGpmlParser<Edge> {
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger		 logger			= Logger.getLogger(EdgeLineParser.class);
-
-	/**
-	 * Parser used to parse typical {@link Edge} xml nodes.
-	 */
-	private final EdgeParser edgeParser	= new EdgeParser();
-
-	/**
-	 * Creates {@link Edge} from xml line node.
-	 * 
-	 * @return {@link Edge} from xml node
-	 * @throws ConverterException
-	 */
-	@Override
-	public Edge parse(Element eElement) throws ConverterException {
-		if (!eElement.getNodeName().equals("GraphicalLine")) {
-			throw new InvalidArgumentException(ShapeParser.class.getSimpleName() + " can parse only GraphicalLine xml nodes. But " + eElement.getNodeName());
-		}
-		Edge line = edgeParser.createEmpty();
-		NodeList nodes = eElement.getChildNodes();
-		for (Pair<String, String> entry : getAttributes(eElement)) {
-			switch (entry.getLeft()) {
-				case ("GraphId"):
-					line.setGraphId(entry.getRight());
-					break;
-				case ("GroupRef"):
-					line.setGroupRef(entry.getRight());
-					break;
-				default:
-					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
-			}
-		}
-
-		for (int i = 0; i < nodes.getLength(); i++) {
-			Node node = nodes.item(i);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				Element eTmp = (Element) node;
-				switch (node.getNodeName()) {
-					case ("Graphics"):
-						edgeParser.parseGraphics(line, (Element) node);
-						break;
-					case ("BiopaxRef"):
-						line.addBiopaxReference(eTmp.getTextContent());
-						break;
-					case ("Comment"):
-						line.addComment(eTmp.getTextContent());
-						break;
-					default:
-						logger.warn("Unknown node in line: " + node.getNodeName());
-				}
-			}
-		}
-		return line;
-	}
-
-	@Override
-	public String toXml(Edge node) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-	@Override
-	public String toXml(Collection<Edge> list) throws ConverterException {
-		throw new NotImplementedException();
-	}
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.wikipathway.model.Edge;
+
+/**
+ * Parser class that creates {@link Edge} objects from Xml {@link Element node}.
+ * However the xml node is not typica edge node , but line node.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class EdgeLineParser extends ElementGpmlParser<Edge> {
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger		 logger			= Logger.getLogger(EdgeLineParser.class);
+
+	/**
+	 * Parser used to parse typical {@link Edge} xml nodes.
+	 */
+	private final EdgeParser edgeParser	= new EdgeParser();
+
+	/**
+	 * Creates {@link Edge} from xml line node.
+	 * 
+	 * @return {@link Edge} from xml node
+	 * @throws ConverterException
+	 */
+	@Override
+	public Edge parse(Element eElement) throws ConverterException {
+		if (!eElement.getNodeName().equals("GraphicalLine")) {
+			throw new InvalidArgumentException(ShapeParser.class.getSimpleName() + " can parse only GraphicalLine xml nodes. But " + eElement.getNodeName());
+		}
+		Edge line = edgeParser.createEmpty();
+		NodeList nodes = eElement.getChildNodes();
+		for (Pair<String, String> entry : getAttributes(eElement)) {
+			switch (entry.getLeft()) {
+				case ("GraphId"):
+					line.setGraphId(entry.getRight());
+					break;
+				case ("GroupRef"):
+					line.setGroupRef(entry.getRight());
+					break;
+				default:
+					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
+			}
+		}
+
+		for (int i = 0; i < nodes.getLength(); i++) {
+			Node node = nodes.item(i);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				Element eTmp = (Element) node;
+				switch (node.getNodeName()) {
+					case ("Graphics"):
+						edgeParser.parseGraphics(line, (Element) node);
+						break;
+					case ("BiopaxRef"):
+						line.addBiopaxReference(eTmp.getTextContent());
+						break;
+					case ("Comment"):
+						line.addComment(eTmp.getTextContent());
+						break;
+					default:
+						logger.warn("Unknown node in line: " + node.getNodeName());
+				}
+			}
+		}
+		return line;
+	}
+
+	@Override
+	public String toXml(Edge node) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+	@Override
+	public String toXml(Collection<Edge> list) throws ConverterException {
+		throw new NotImplementedException();
+	}
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/EdgeParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/EdgeParser.java
index 5c367ccade..3cd2c16ebe 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/EdgeParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/EdgeParser.java
@@ -1,579 +1,579 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.awt.geom.Line2D;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.wikipathway.model.Direction;
-import lcsb.mapviewer.wikipathway.model.Edge;
-import lcsb.mapviewer.wikipathway.model.GpmlLineConnectorType;
-import lcsb.mapviewer.wikipathway.model.GpmlLineType;
-import lcsb.mapviewer.wikipathway.model.PointData;
-import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
-
-/**
- * Parser class that creates {@link Edge} objects from Xml {@link Element node}.
- * 
- * @author Piotr Gawron
- *
- */
-public class EdgeParser extends ElementGpmlParser<Edge> {
-
-	/**
-	 * Parser used for extracting {@link lcsb.mapviewer.model.map.MiriamData
-	 * references} from GPML model.
-	 */
-	private ReferenceParser			referenceParser	 = new ReferenceParser();
-
-	/**
-	 * Parser used for extracting {@link PointData points} from GPML xml nodes.
-	 */
-	private PointDataParser			pointParser			 = new PointDataParser();
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger				logger					 = Logger.getLogger(EdgeParser.class);
-
-	/**
-	 * First id value used for generating identifiers during conversion.
-	 */
-	private static final int		INITIAL_ID_VALUE = 10000;
-
-	/**
-	 * This is default lenght of lines when lines are drawn in
-	 * {@link GpmlLineConnectorType#ELBOW} mode, but without specifing
-	 * coordinates.
-	 */
-	private static final double	DEFAULT_DISTNACE = 20;
-
-	/**
-	 * Counter used for generating identifiers if identifiers aren't provided by
-	 * the gpml model.
-	 */
-	private static int					idCounter				 = INITIAL_ID_VALUE;
-
-	/**
-	 * This function get new id for interactions that don't have id.
-	 * 
-	 * @return String - new id
-	 */
-	private String getNewId() {
-		idCounter++;
-		return "id" + idCounter;
-	}
-
-	/**
-	 * Creates {@link Edge} from xml node.
-	 * 
-	 * @return {@link Edge} from xml node
-	 * @throws ConverterException
-	 *           thrown when there is a problem with parsing edge
-	 */
-	@Override
-	public Edge parse(Element eElement) throws ConverterException {
-
-		String graphId = eElement.getAttribute("GraphId");
-		if (graphId == null || graphId.equals("")) {
-			graphId = getNewId();
-		}
-		Edge edge = new Edge(graphId);
-
-		for (Pair<String, String> entry : getAttributes(eElement)) {
-			switch (entry.getLeft()) {
-				case ("GraphId"):
-					break;
-				case ("GroupRef"):
-					edge.setGroupRef(entry.getRight());
-					break;
-				default:
-					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
-					break;
-			}
-		}
-
-		NodeList nodes = eElement.getChildNodes();
-		boolean graphicsParsed = false;
-		for (int i = 0; i < nodes.getLength(); i++) {
-			Node node = nodes.item(i);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				Element element = (Element) node;
-				switch (node.getNodeName()) {
-					// references (annotations)
-					case ("Xref"):
-						MiriamData md = referenceParser.parse(element);
-						if (md != null) {
-							edge.addReference(md);
-						}
-						break;
-					case ("Comment"):
-						edge.addComment(node.getTextContent());
-						break;
-					// references (annotations)
-					case ("BiopaxRef"):
-						edge.getBiopaxReferences().add(node.getTextContent());
-						break;
-					case ("Graphics"):
-						graphicsParsed = true;
-						parseGraphics(edge, element);
-						break;
-					case ("Attribute"):
-						parseAttribute(element, edge);
-						break;
-					default:
-						logger.warn(edge.getWarningPrefix() + "Unknown edge node: " + node.getNodeName() + ".");
-						break;
-				}
-			}
-		}
-		if (!graphicsParsed) {
-			throw new ConverterException(edge.getWarningPrefix() + "No Graphics information found for edge.");
-		}
-		return edge;
-	}
-
-	/**
-	 * Parses graphics xml node that is part of edge xml node.
-	 * 
-	 * @param edge
-	 *          edge which is parsed
-	 * @param graphicsNode
-	 *          xml node
-	 * @throws ConverterException
-	 *           thrown when data for the edge is invalid
-	 */
-	protected void parseGraphics(Edge edge, Element graphicsNode) throws ConverterException {
-		List<Element> points = new ArrayList<Element>();
-		List<Element> anchors = new ArrayList<Element>();
-
-		GpmlLineConnectorType connectorType = GpmlLineConnectorType.STRAIGHT;
-
-		for (Pair<String, String> entry : getAttributes(graphicsNode)) {
-			switch (entry.getLeft()) {
-				case ("ConnectorType"):
-					connectorType = GpmlLineConnectorType.getByGpmlName(entry.getRight());
-					break;
-				case ("LineThickness"):
-					// line thicknes
-					edge.getLine().setWidth(entry.getRight());
-					break;
-				case ("LineStyle"):
-					// line type
-					GpmlLineType lineType = GpmlLineType.getByGpmlName(entry.getRight());
-					edge.getLine().setType(lineType.getCorrespondingGlobalLineType());
-					break;
-				case ("ZOrder"):
-					edge.setzOrder(Integer.valueOf(entry.getRight()));
-					break;
-				case ("Color"):
-					// graphics color
-					edge.setColor(hexStringToColor(entry.getRight()));
-					break;
-				default:
-					logger.warn("Unknown attribute of " + graphicsNode.getNodeName() + " node: " + entry.getLeft());
-					break;
-			}
-		}
-
-		NodeList nodes;
-		nodes = graphicsNode.getChildNodes();
-		for (int i = 0; i < nodes.getLength(); i++) {
-			Node node = nodes.item(i);
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				if ("Point".equalsIgnoreCase(node.getNodeName())) {
-					points.add((Element) node);
-				} else if ("Anchor".equalsIgnoreCase(node.getNodeName())) {
-					anchors.add((Element) node);
-				} else {
-					logger.warn(edge.getWarningPrefix() + "Unknown graphics edge node: " + node.getNodeName() + ".");
-				}
-			}
-		}
-
-		// lines
-
-		List<PointData> pointDataList = new ArrayList<>();
-
-		for (int j = 0; j < points.size(); j++) {
-			Node point = points.get(j);
-			PointData pointData = pointParser.parse((Element) point);
-
-			pointDataList.add(pointData);
-			if (j == 0 && pointData.hasGraphRef()) {
-				edge.setStart(pointData.getGraphRef());
-			}
-			if (j == points.size() - 1 && pointData.hasGraphRef()) {
-				edge.setEnd(pointData.getGraphRef());
-			}
-
-			edge.setType(pointData.getType());
-		}
-
-		edge.getLine().setPoints(getPoints(edge.getWarningPrefix(), pointDataList, connectorType));
-		if (edge.getLine().getPoints().size() < 2) {
-			throw new ConverterException(edge.getWarningPrefix() + "Contains too less points. At least two points are required in a line.");
-		}
-		double lineLength = 0;
-		for (Line2D line : edge.getLine().getLines()) {
-			lineLength += line.getP1().distance(line.getP2());
-		}
-		if (lineLength <= Configuration.EPSILON) {
-			throw new ConverterException(edge.getWarningPrefix() + "Line cannot have 0 length.");
-		}
-
-		// anchors
-		for (Element anchor : anchors) {
-			String anchorId = anchor.getAttribute("GraphId");
-			String position = anchor.getAttribute("Position");
-			if (anchorId != null && !anchorId.isEmpty()) {
-				edge.addAnchor(anchorId);
-				// if our edge is not connected from at first point but we have anchor
-				// there, then set this anchor there (so we could merge it later on)
-				if (edge.getStart() == null && "0.0".equals(position)) {
-					edge.setStart(anchorId);
-				}
-				// if our edge is not connected from at last point but we have anchor
-				// there, then set this anchor there (so we could merge it later on)
-				if (edge.getEnd() == null && "1.0".equals(position)) {
-					edge.setEnd(anchorId);
-				}
-			}
-		}
-	}
-
-	/**
-	 * This method transforms list of {@link PointData points} from gpml xml into
-	 * list of standard {@link Point2D points}.
-	 * 
-	 * @param warningPrefix
-	 *          prefix that should be used for warnings
-	 * @param pointDataList
-	 *          list of points from gpml format
-	 * @param connectorType
-	 *          {@link GpmlLineConnectorType type} defining how points are
-	 *          connected in gpml format
-	 * @return list of standard {@link Point2D points} obtained from input data
-	 * @throws UnknownGpmlLineConnectorTypeException
-	 *           thrown when {@link GpmlLineConnectorType type} is unknown
-	 * @throws InvalidElbowConnectorException
-	 *           thrown when input data define invalid line
-	 * @throws UnknownTypeException
-	 *           throw when connector type is invalid
-	 */
-	private List<Point2D> getPoints(String warningPrefix, List<PointData> pointDataList, GpmlLineConnectorType connectorType)
-			throws InvalidElbowConnectorException, UnknownTypeException {
-		List<Point2D> result = new ArrayList<>();
-		switch (connectorType) {
-			// line is a list of perpendicular segments
-			case ELBOW:
-				Direction from = pointDataList.get(0).getDirection();
-				Direction to = pointDataList.get(pointDataList.size() - 1).getDirection();
-
-				if (from == null) {
-					from = Direction.WEST;
-				}
-				if (to == null) {
-					to = Direction.EAST;
-				}
-
-				// how many segments do we have
-				int lines = computeNumberOfPerpendicularSegments(warningPrefix, pointDataList.get(0), pointDataList.get(pointDataList.size() - 1));
-				// now we know how many segments should be i the line
-
-				// if segments are defined in the input the it's easy
-				if (lines == pointDataList.size()) {
-					List<Point2D> points = new ArrayList<>();
-					for (PointData pd : pointDataList) {
-						points.add(pd.toPoint());
-					}
-					result = preparePerpendicularLines(from, points);
-
-					// if we know how many segments should be in the line, but we have
-					// only first and last point
-					// then we need to add missing points (some default behaviour).
-				} else if (pointDataList.size() == 2) {
-					List<Point2D> points = new ArrayList<>();
-					points.add(pointDataList.get(0).toPoint());
-					points.add(pointDataList.get(1).toPoint());
-					// add middle point
-					points.add(1, computeDefaultPoint(from, points.get(0)));
-					// CHECKSTYLE:OFF
-					// if something is still missing then add defult beginning line
-					if (lines > 3) {
-						points.add(2, computeDefaultPoint(to, points.get(2)));
-					}
-					// if something is still missing then add defult end line
-					if (lines > 4) {
-						double x = (points.get(1).getX() + points.get(2).getX()) / 2;
-						double y = (points.get(1).getY() + points.get(2).getY()) / 2;
-						points.add(2, new Point2D.Double(x, y));
-					}
-					// if something is still missing then there is something terrible
-					// wrong
-					if (lines > 5) {
-						throw new InvalidElbowConnectorException(warningPrefix + " Line with connector type " + connectorType + " contains too many segments: " + lines);
-					}
-					// CHECKSTYLE:ON
-
-					// and now transform the points into perpendicular segments
-					result = preparePerpendicularLines(from, points);
-
-					// if number of expectred segments is lower than number of defined
-					// segments then we probably missed something, let's assume that in
-					// gpml file the data is correct and parse it
-				} else if (pointDataList.size() > lines) {
-					List<Point2D> points = new ArrayList<>();
-					for (PointData pd : pointDataList) {
-						points.add(pd.toPoint());
-					}
-					result = preparePerpendicularLines(from, points);
-
-					// if number of expectred segments is different than number of defined
-					// segments then something is wrong
-				} else {
-					throw new InvalidElbowConnectorException(
-							warningPrefix + "Don't know how to prepare lines. " + connectorType + " contains invalid number of points: " + pointDataList.size()
-									+ ". Expected: " + lines);
-				}
-
-				break;
-
-			// if line is straight then pass input points into the output
-			case STRAIGHT:
-				for (PointData pointData : pointDataList) {
-					result.add(pointData.toPoint());
-				}
-				break;
-			// if line is segmented then pass input points into the output
-			case SEGMENTED:
-				for (PointData pointData : pointDataList) {
-					result.add(pointData.toPoint());
-				}
-				break;
-			// if line is curved then inform user that we don't support it and create
-			// a default one
-			case CURVED:
-				logger.warn(warningPrefix + "Curved connections are not supported.");
-				for (PointData pointData : pointDataList) {
-					result.add(pointData.toPoint());
-				}
-				break;
-			default:
-				throw new UnknownTypeException(warningPrefix + "Connector type is not supported: " + connectorType);
-		}
-		return result;
-	}
-
-	/**
-	 * Method that computes number of perpendicular lines that should connect
-	 * start point with the end point.
-	 * 
-	 * @param warningPrefix
-	 *          string used as a prefix for warnings/errors
-	 * @param start
-	 *          starting point
-	 * @param end
-	 *          end point
-	 * @return number of perpendicular lines that should connect start point with
-	 *         the end point
-	 * @throws InvalidElbowConnectorException
-	 *           thrown when output cannot be computed because input data is
-	 *           invalid
-	 */
-	private int computeNumberOfPerpendicularSegments(String warningPrefix, PointData start, PointData end) throws InvalidElbowConnectorException {
-		Point2D fromPoint = start.toPoint();
-		Point2D toPoint = end.toPoint();
-
-		Direction from = start.getDirection();
-		if (from == null) {
-			from = Direction.WEST;
-		}
-		Direction to = end.getDirection();
-		if (to == null) {
-			to = Direction.EAST;
-		}
-
-		// result (2 is the minimu)
-		int lines = 2;
-
-		// if line starts and ends i nthe same axis then number of segments
-		// should be at least3
-		if (from.getAxis().equals(to.getAxis())) {
-			lines++;
-		}
-
-		// if they are not starting and ending in the same direction (for
-		// instance they both start from NORTH)
-		// then check if some addition lines are needed
-		if (!from.equals(to)) {
-			int addition = 0;
-			// check if begining requires additional lines because the end is
-			// overlapping the beginning
-			switch (from) {
-				case EAST:
-					if (fromPoint.getX() >= toPoint.getX()) {
-						addition = 2;
-					}
-					break;
-				case WEST:
-					if (fromPoint.getX() <= toPoint.getX()) {
-						addition = 2;
-					}
-					break;
-				case NORTH:
-					if (fromPoint.getY() <= toPoint.getY()) {
-						addition = 2;
-					}
-					break;
-				case SOUTH:
-					if (fromPoint.getY() >= toPoint.getY()) {
-						addition = 2;
-					}
-					break;
-				default:
-					throw new InvalidElbowConnectorException(warningPrefix + "Unknown direction: " + from);
-			}
-			// check if emdrequires additional lines because the beginning is
-			// overlapping end part
-			switch (to) {
-				case EAST:
-					if (fromPoint.getX() <= toPoint.getX()) {
-						addition = 2;
-					}
-					break;
-				case WEST:
-					if (fromPoint.getX() >= toPoint.getX()) {
-						addition = 2;
-					}
-					break;
-				case NORTH:
-					if (fromPoint.getY() >= toPoint.getY()) {
-						addition = 2;
-					}
-					break;
-				case SOUTH:
-					if (fromPoint.getY() <= toPoint.getY()) {
-						addition = 2;
-					}
-					break;
-				default:
-					throw new InvalidElbowConnectorException(warningPrefix + "Unknown direction: " + from);
-			}
-			lines += addition;
-		}
-		return lines;
-	}
-
-	/**
-	 * Creates point that defines default perpendicular line from input point.
-	 * 
-	 * @param from
-	 *          direction from which point is connected
-	 * @param original
-	 *          point from where we want to have a line
-	 * @return point that defines default perpendicular line from input point
-	 */
-	private Point2D computeDefaultPoint(Direction from, Point2D original) {
-		switch (from) {
-			case NORTH:
-				return new Point2D.Double(original.getX(), original.getY() - DEFAULT_DISTNACE);
-			case SOUTH:
-				return new Point2D.Double(original.getX(), original.getY() + DEFAULT_DISTNACE);
-			case EAST:
-				return new Point2D.Double(original.getX() + DEFAULT_DISTNACE, original.getY());
-			case WEST:
-				return new Point2D.Double(original.getX() - DEFAULT_DISTNACE, original.getY());
-			default:
-				throw new InvalidStateException("Unknown direction: " + from);
-		}
-	}
-
-	/**
-	 * Creates perpendicular lines going through all input points.
-	 * 
-	 * @param from
-	 *          in which direction should go the first line
-	 * @param points
-	 *          set of points through which perpendicular line should go
-	 * @return perpendicular lines going through all input points
-	 */
-	private List<Point2D> preparePerpendicularLines(Direction from, List<Point2D> points) {
-		List<Point2D> result = new ArrayList<>();
-		result.add(points.get(0));
-		Point2D lastPoint = points.get(0);
-		for (int i = 1; i < points.size(); i++) {
-			Point2D point = points.get(i);
-			switch (from.getAxis()) {
-				case NORTH_SOUTH:
-					result.add(new Point2D.Double(lastPoint.getX(), point.getY()));
-					break;
-				case EAST_WEST:
-					result.add(new Point2D.Double(point.getX(), lastPoint.getY()));
-					break;
-				default:
-					throw new InvalidStateException("Unknown direction axis: " + from.getAxis());
-			}
-			lastPoint = result.get(i);
-			from = from.nextClockwiseDirection();
-		}
-		result.add(points.get(points.size() - 1));
-		return result;
-	}
-
-	/**
-	 * Creates new {@link Edge} object with unique identifier.
-	 * 
-	 * @return new {@link Edge} object with unique identifier
-	 */
-	public Edge createEmpty() {
-		return new Edge(getNewId());
-	}
-
-	/**
-	 * Method that parses {@link Edge} xml attribute.
-	 * 
-	 * @param eTmp
-	 *          xml node with attribute
-	 * @param edge
-	 *          edge where data should be added
-	 */
-	private void parseAttribute(Element eTmp, Edge edge) {
-		String key = eTmp.getAttribute("Key");
-		String value = eTmp.getAttribute("Value");
-		switch (key) {
-			case ("org.pathvisio.core.ds"):
-				// skip for now (no idea what des it mean)
-				break;
-			case ("org.pathvisio.core.id"):
-				// skip for now (no idea what des it mean)
-				break;
-			default:
-				logger.warn(edge.getWarningPrefix() + "Unknown attribute of node. Key: " + key + "; value: " + value);
-				break;
-		}
-	}
-
-	@Override
-	public String toXml(Edge node) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-	@Override
-	public String toXml(Collection<Edge> list) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.wikipathway.model.Direction;
+import lcsb.mapviewer.wikipathway.model.Edge;
+import lcsb.mapviewer.wikipathway.model.GpmlLineConnectorType;
+import lcsb.mapviewer.wikipathway.model.GpmlLineType;
+import lcsb.mapviewer.wikipathway.model.PointData;
+import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
+
+/**
+ * Parser class that creates {@link Edge} objects from Xml {@link Element node}.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class EdgeParser extends ElementGpmlParser<Edge> {
+
+	/**
+	 * Parser used for extracting {@link lcsb.mapviewer.model.map.MiriamData
+	 * references} from GPML model.
+	 */
+	private ReferenceParser			referenceParser	 = new ReferenceParser();
+
+	/**
+	 * Parser used for extracting {@link PointData points} from GPML xml nodes.
+	 */
+	private PointDataParser			pointParser			 = new PointDataParser();
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger				logger					 = Logger.getLogger(EdgeParser.class);
+
+	/**
+	 * First id value used for generating identifiers during conversion.
+	 */
+	private static final int		INITIAL_ID_VALUE = 10000;
+
+	/**
+	 * This is default lenght of lines when lines are drawn in
+	 * {@link GpmlLineConnectorType#ELBOW} mode, but without specifing
+	 * coordinates.
+	 */
+	private static final double	DEFAULT_DISTNACE = 20;
+
+	/**
+	 * Counter used for generating identifiers if identifiers aren't provided by
+	 * the gpml model.
+	 */
+	private static int					idCounter				 = INITIAL_ID_VALUE;
+
+	/**
+	 * This function get new id for interactions that don't have id.
+	 * 
+	 * @return String - new id
+	 */
+	private String getNewId() {
+		idCounter++;
+		return "id" + idCounter;
+	}
+
+	/**
+	 * Creates {@link Edge} from xml node.
+	 * 
+	 * @return {@link Edge} from xml node
+	 * @throws ConverterException
+	 *           thrown when there is a problem with parsing edge
+	 */
+	@Override
+	public Edge parse(Element eElement) throws ConverterException {
+
+		String graphId = eElement.getAttribute("GraphId");
+		if (graphId == null || graphId.equals("")) {
+			graphId = getNewId();
+		}
+		Edge edge = new Edge(graphId);
+
+		for (Pair<String, String> entry : getAttributes(eElement)) {
+			switch (entry.getLeft()) {
+				case ("GraphId"):
+					break;
+				case ("GroupRef"):
+					edge.setGroupRef(entry.getRight());
+					break;
+				default:
+					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
+					break;
+			}
+		}
+
+		NodeList nodes = eElement.getChildNodes();
+		boolean graphicsParsed = false;
+		for (int i = 0; i < nodes.getLength(); i++) {
+			Node node = nodes.item(i);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				Element element = (Element) node;
+				switch (node.getNodeName()) {
+					// references (annotations)
+					case ("Xref"):
+						MiriamData md = referenceParser.parse(element);
+						if (md != null) {
+							edge.addReference(md);
+						}
+						break;
+					case ("Comment"):
+						edge.addComment(node.getTextContent());
+						break;
+					// references (annotations)
+					case ("BiopaxRef"):
+						edge.getBiopaxReferences().add(node.getTextContent());
+						break;
+					case ("Graphics"):
+						graphicsParsed = true;
+						parseGraphics(edge, element);
+						break;
+					case ("Attribute"):
+						parseAttribute(element, edge);
+						break;
+					default:
+						logger.warn(edge.getWarningPrefix() + "Unknown edge node: " + node.getNodeName() + ".");
+						break;
+				}
+			}
+		}
+		if (!graphicsParsed) {
+			throw new ConverterException(edge.getWarningPrefix() + "No Graphics information found for edge.");
+		}
+		return edge;
+	}
+
+	/**
+	 * Parses graphics xml node that is part of edge xml node.
+	 * 
+	 * @param edge
+	 *          edge which is parsed
+	 * @param graphicsNode
+	 *          xml node
+	 * @throws ConverterException
+	 *           thrown when data for the edge is invalid
+	 */
+	protected void parseGraphics(Edge edge, Element graphicsNode) throws ConverterException {
+		List<Element> points = new ArrayList<Element>();
+		List<Element> anchors = new ArrayList<Element>();
+
+		GpmlLineConnectorType connectorType = GpmlLineConnectorType.STRAIGHT;
+
+		for (Pair<String, String> entry : getAttributes(graphicsNode)) {
+			switch (entry.getLeft()) {
+				case ("ConnectorType"):
+					connectorType = GpmlLineConnectorType.getByGpmlName(entry.getRight());
+					break;
+				case ("LineThickness"):
+					// line thicknes
+					edge.getLine().setWidth(entry.getRight());
+					break;
+				case ("LineStyle"):
+					// line type
+					GpmlLineType lineType = GpmlLineType.getByGpmlName(entry.getRight());
+					edge.getLine().setType(lineType.getCorrespondingGlobalLineType());
+					break;
+				case ("ZOrder"):
+					edge.setzOrder(Integer.valueOf(entry.getRight()));
+					break;
+				case ("Color"):
+					// graphics color
+					edge.setColor(hexStringToColor(entry.getRight()));
+					break;
+				default:
+					logger.warn("Unknown attribute of " + graphicsNode.getNodeName() + " node: " + entry.getLeft());
+					break;
+			}
+		}
+
+		NodeList nodes;
+		nodes = graphicsNode.getChildNodes();
+		for (int i = 0; i < nodes.getLength(); i++) {
+			Node node = nodes.item(i);
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				if ("Point".equalsIgnoreCase(node.getNodeName())) {
+					points.add((Element) node);
+				} else if ("Anchor".equalsIgnoreCase(node.getNodeName())) {
+					anchors.add((Element) node);
+				} else {
+					logger.warn(edge.getWarningPrefix() + "Unknown graphics edge node: " + node.getNodeName() + ".");
+				}
+			}
+		}
+
+		// lines
+
+		List<PointData> pointDataList = new ArrayList<>();
+
+		for (int j = 0; j < points.size(); j++) {
+			Node point = points.get(j);
+			PointData pointData = pointParser.parse((Element) point);
+
+			pointDataList.add(pointData);
+			if (j == 0 && pointData.hasGraphRef()) {
+				edge.setStart(pointData.getGraphRef());
+			}
+			if (j == points.size() - 1 && pointData.hasGraphRef()) {
+				edge.setEnd(pointData.getGraphRef());
+			}
+
+			edge.setType(pointData.getType());
+		}
+
+		edge.getLine().setPoints(getPoints(edge.getWarningPrefix(), pointDataList, connectorType));
+		if (edge.getLine().getPoints().size() < 2) {
+			throw new ConverterException(edge.getWarningPrefix() + "Contains too less points. At least two points are required in a line.");
+		}
+		double lineLength = 0;
+		for (Line2D line : edge.getLine().getLines()) {
+			lineLength += line.getP1().distance(line.getP2());
+		}
+		if (lineLength <= Configuration.EPSILON) {
+			throw new ConverterException(edge.getWarningPrefix() + "Line cannot have 0 length.");
+		}
+
+		// anchors
+		for (Element anchor : anchors) {
+			String anchorId = anchor.getAttribute("GraphId");
+			String position = anchor.getAttribute("Position");
+			if (anchorId != null && !anchorId.isEmpty()) {
+				edge.addAnchor(anchorId);
+				// if our edge is not connected from at first point but we have anchor
+				// there, then set this anchor there (so we could merge it later on)
+				if (edge.getStart() == null && "0.0".equals(position)) {
+					edge.setStart(anchorId);
+				}
+				// if our edge is not connected from at last point but we have anchor
+				// there, then set this anchor there (so we could merge it later on)
+				if (edge.getEnd() == null && "1.0".equals(position)) {
+					edge.setEnd(anchorId);
+				}
+			}
+		}
+	}
+
+	/**
+	 * This method transforms list of {@link PointData points} from gpml xml into
+	 * list of standard {@link Point2D points}.
+	 * 
+	 * @param warningPrefix
+	 *          prefix that should be used for warnings
+	 * @param pointDataList
+	 *          list of points from gpml format
+	 * @param connectorType
+	 *          {@link GpmlLineConnectorType type} defining how points are
+	 *          connected in gpml format
+	 * @return list of standard {@link Point2D points} obtained from input data
+	 * @throws UnknownGpmlLineConnectorTypeException
+	 *           thrown when {@link GpmlLineConnectorType type} is unknown
+	 * @throws InvalidElbowConnectorException
+	 *           thrown when input data define invalid line
+	 * @throws UnknownTypeException
+	 *           throw when connector type is invalid
+	 */
+	private List<Point2D> getPoints(String warningPrefix, List<PointData> pointDataList, GpmlLineConnectorType connectorType)
+			throws InvalidElbowConnectorException, UnknownTypeException {
+		List<Point2D> result = new ArrayList<>();
+		switch (connectorType) {
+			// line is a list of perpendicular segments
+			case ELBOW:
+				Direction from = pointDataList.get(0).getDirection();
+				Direction to = pointDataList.get(pointDataList.size() - 1).getDirection();
+
+				if (from == null) {
+					from = Direction.WEST;
+				}
+				if (to == null) {
+					to = Direction.EAST;
+				}
+
+				// how many segments do we have
+				int lines = computeNumberOfPerpendicularSegments(warningPrefix, pointDataList.get(0), pointDataList.get(pointDataList.size() - 1));
+				// now we know how many segments should be i the line
+
+				// if segments are defined in the input the it's easy
+				if (lines == pointDataList.size()) {
+					List<Point2D> points = new ArrayList<>();
+					for (PointData pd : pointDataList) {
+						points.add(pd.toPoint());
+					}
+					result = preparePerpendicularLines(from, points);
+
+					// if we know how many segments should be in the line, but we have
+					// only first and last point
+					// then we need to add missing points (some default behaviour).
+				} else if (pointDataList.size() == 2) {
+					List<Point2D> points = new ArrayList<>();
+					points.add(pointDataList.get(0).toPoint());
+					points.add(pointDataList.get(1).toPoint());
+					// add middle point
+					points.add(1, computeDefaultPoint(from, points.get(0)));
+					// CHECKSTYLE:OFF
+					// if something is still missing then add defult beginning line
+					if (lines > 3) {
+						points.add(2, computeDefaultPoint(to, points.get(2)));
+					}
+					// if something is still missing then add defult end line
+					if (lines > 4) {
+						double x = (points.get(1).getX() + points.get(2).getX()) / 2;
+						double y = (points.get(1).getY() + points.get(2).getY()) / 2;
+						points.add(2, new Point2D.Double(x, y));
+					}
+					// if something is still missing then there is something terrible
+					// wrong
+					if (lines > 5) {
+						throw new InvalidElbowConnectorException(warningPrefix + " Line with connector type " + connectorType + " contains too many segments: " + lines);
+					}
+					// CHECKSTYLE:ON
+
+					// and now transform the points into perpendicular segments
+					result = preparePerpendicularLines(from, points);
+
+					// if number of expectred segments is lower than number of defined
+					// segments then we probably missed something, let's assume that in
+					// gpml file the data is correct and parse it
+				} else if (pointDataList.size() > lines) {
+					List<Point2D> points = new ArrayList<>();
+					for (PointData pd : pointDataList) {
+						points.add(pd.toPoint());
+					}
+					result = preparePerpendicularLines(from, points);
+
+					// if number of expectred segments is different than number of defined
+					// segments then something is wrong
+				} else {
+					throw new InvalidElbowConnectorException(
+							warningPrefix + "Don't know how to prepare lines. " + connectorType + " contains invalid number of points: " + pointDataList.size()
+									+ ". Expected: " + lines);
+				}
+
+				break;
+
+			// if line is straight then pass input points into the output
+			case STRAIGHT:
+				for (PointData pointData : pointDataList) {
+					result.add(pointData.toPoint());
+				}
+				break;
+			// if line is segmented then pass input points into the output
+			case SEGMENTED:
+				for (PointData pointData : pointDataList) {
+					result.add(pointData.toPoint());
+				}
+				break;
+			// if line is curved then inform user that we don't support it and create
+			// a default one
+			case CURVED:
+				logger.warn(warningPrefix + "Curved connections are not supported.");
+				for (PointData pointData : pointDataList) {
+					result.add(pointData.toPoint());
+				}
+				break;
+			default:
+				throw new UnknownTypeException(warningPrefix + "Connector type is not supported: " + connectorType);
+		}
+		return result;
+	}
+
+	/**
+	 * Method that computes number of perpendicular lines that should connect
+	 * start point with the end point.
+	 * 
+	 * @param warningPrefix
+	 *          string used as a prefix for warnings/errors
+	 * @param start
+	 *          starting point
+	 * @param end
+	 *          end point
+	 * @return number of perpendicular lines that should connect start point with
+	 *         the end point
+	 * @throws InvalidElbowConnectorException
+	 *           thrown when output cannot be computed because input data is
+	 *           invalid
+	 */
+	private int computeNumberOfPerpendicularSegments(String warningPrefix, PointData start, PointData end) throws InvalidElbowConnectorException {
+		Point2D fromPoint = start.toPoint();
+		Point2D toPoint = end.toPoint();
+
+		Direction from = start.getDirection();
+		if (from == null) {
+			from = Direction.WEST;
+		}
+		Direction to = end.getDirection();
+		if (to == null) {
+			to = Direction.EAST;
+		}
+
+		// result (2 is the minimu)
+		int lines = 2;
+
+		// if line starts and ends i nthe same axis then number of segments
+		// should be at least3
+		if (from.getAxis().equals(to.getAxis())) {
+			lines++;
+		}
+
+		// if they are not starting and ending in the same direction (for
+		// instance they both start from NORTH)
+		// then check if some addition lines are needed
+		if (!from.equals(to)) {
+			int addition = 0;
+			// check if begining requires additional lines because the end is
+			// overlapping the beginning
+			switch (from) {
+				case EAST:
+					if (fromPoint.getX() >= toPoint.getX()) {
+						addition = 2;
+					}
+					break;
+				case WEST:
+					if (fromPoint.getX() <= toPoint.getX()) {
+						addition = 2;
+					}
+					break;
+				case NORTH:
+					if (fromPoint.getY() <= toPoint.getY()) {
+						addition = 2;
+					}
+					break;
+				case SOUTH:
+					if (fromPoint.getY() >= toPoint.getY()) {
+						addition = 2;
+					}
+					break;
+				default:
+					throw new InvalidElbowConnectorException(warningPrefix + "Unknown direction: " + from);
+			}
+			// check if emdrequires additional lines because the beginning is
+			// overlapping end part
+			switch (to) {
+				case EAST:
+					if (fromPoint.getX() <= toPoint.getX()) {
+						addition = 2;
+					}
+					break;
+				case WEST:
+					if (fromPoint.getX() >= toPoint.getX()) {
+						addition = 2;
+					}
+					break;
+				case NORTH:
+					if (fromPoint.getY() >= toPoint.getY()) {
+						addition = 2;
+					}
+					break;
+				case SOUTH:
+					if (fromPoint.getY() <= toPoint.getY()) {
+						addition = 2;
+					}
+					break;
+				default:
+					throw new InvalidElbowConnectorException(warningPrefix + "Unknown direction: " + from);
+			}
+			lines += addition;
+		}
+		return lines;
+	}
+
+	/**
+	 * Creates point that defines default perpendicular line from input point.
+	 * 
+	 * @param from
+	 *          direction from which point is connected
+	 * @param original
+	 *          point from where we want to have a line
+	 * @return point that defines default perpendicular line from input point
+	 */
+	private Point2D computeDefaultPoint(Direction from, Point2D original) {
+		switch (from) {
+			case NORTH:
+				return new Point2D.Double(original.getX(), original.getY() - DEFAULT_DISTNACE);
+			case SOUTH:
+				return new Point2D.Double(original.getX(), original.getY() + DEFAULT_DISTNACE);
+			case EAST:
+				return new Point2D.Double(original.getX() + DEFAULT_DISTNACE, original.getY());
+			case WEST:
+				return new Point2D.Double(original.getX() - DEFAULT_DISTNACE, original.getY());
+			default:
+				throw new InvalidStateException("Unknown direction: " + from);
+		}
+	}
+
+	/**
+	 * Creates perpendicular lines going through all input points.
+	 * 
+	 * @param from
+	 *          in which direction should go the first line
+	 * @param points
+	 *          set of points through which perpendicular line should go
+	 * @return perpendicular lines going through all input points
+	 */
+	private List<Point2D> preparePerpendicularLines(Direction from, List<Point2D> points) {
+		List<Point2D> result = new ArrayList<>();
+		result.add(points.get(0));
+		Point2D lastPoint = points.get(0);
+		for (int i = 1; i < points.size(); i++) {
+			Point2D point = points.get(i);
+			switch (from.getAxis()) {
+				case NORTH_SOUTH:
+					result.add(new Point2D.Double(lastPoint.getX(), point.getY()));
+					break;
+				case EAST_WEST:
+					result.add(new Point2D.Double(point.getX(), lastPoint.getY()));
+					break;
+				default:
+					throw new InvalidStateException("Unknown direction axis: " + from.getAxis());
+			}
+			lastPoint = result.get(i);
+			from = from.nextClockwiseDirection();
+		}
+		result.add(points.get(points.size() - 1));
+		return result;
+	}
+
+	/**
+	 * Creates new {@link Edge} object with unique identifier.
+	 * 
+	 * @return new {@link Edge} object with unique identifier
+	 */
+	public Edge createEmpty() {
+		return new Edge(getNewId());
+	}
+
+	/**
+	 * Method that parses {@link Edge} xml attribute.
+	 * 
+	 * @param eTmp
+	 *          xml node with attribute
+	 * @param edge
+	 *          edge where data should be added
+	 */
+	private void parseAttribute(Element eTmp, Edge edge) {
+		String key = eTmp.getAttribute("Key");
+		String value = eTmp.getAttribute("Value");
+		switch (key) {
+			case ("org.pathvisio.core.ds"):
+				// skip for now (no idea what des it mean)
+				break;
+			case ("org.pathvisio.core.id"):
+				// skip for now (no idea what des it mean)
+				break;
+			default:
+				logger.warn(edge.getWarningPrefix() + "Unknown attribute of node. Key: " + key + "; value: " + value);
+				break;
+		}
+	}
+
+	@Override
+	public String toXml(Edge node) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+	@Override
+	public String toXml(Collection<Edge> list) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ElementGpmlParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ElementGpmlParser.java
index cad379fcbd..1162229c9e 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ElementGpmlParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ElementGpmlParser.java
@@ -1,139 +1,139 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.awt.Color;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.converter.ConverterException;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Generic parser for GPML xml structures.
- * 
- * @author Piotr Gawron
- *
- * @param <T>
- *          class for which this parser aplies
- */
-public abstract class ElementGpmlParser<T> {
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private final Logger			 logger						= Logger.getLogger(ElementGpmlParser.class);
-
-	/**
-	 * Color that should be used when we have transparent color.
-	 */
-	private static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
-
-	/**
-	 * Creates object from xml node given in parameter.
-	 * 
-	 * @param node
-	 *          xml node from which object will be created
-	 * @return object created from xml node
-	 * @throws ConverterException
-	 *           thrown when there is severe problem with parsing xml node
-	 */
-	public abstract T parse(Element node) throws ConverterException;
-
-	/**
-	 * Converts object into xml string (in gpml format).
-	 * 
-	 * @param object
-	 *          object to transform
-	 * @return xml string representing object
-	 * @throws ConverterException
-	 *           thrown when there is a problem with converting into xml
-	 */
-	public abstract String toXml(T object) throws ConverterException;
-
-	/**
-	 * Converts list of objects into xml string (in gpml format) representing this
-	 * list.
-	 * 
-	 * @param list
-	 *          list objects to transform
-	 * @return xml string representing objects
-	 * @throws ConverterException
-	 *           thrown when there is a problem with converting into xml
-	 */
-	public abstract String toXml(Collection<T> list) throws ConverterException;
-
-	/**
-	 * Creates list of object from list of xml nodes.
-	 * 
-	 * @param nodes
-	 *          list of xml nodes to parse
-	 * @return list of object from list of xml nodes
-	 * @throws ConverterException
-	 *           thrown when there is severe problem with parsing xml node
-	 */
-	public List<T> parseCollection(Collection<Node> nodes) throws ConverterException {
-		List<T> result = new ArrayList<>();
-		for (Node node : nodes) {
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				T element = parse((Element) node);
-				// add only not null elements (null might appear when node is partially
-				// invalid and warnings are set)
-				if (element != null) {
-					result.add(element);
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Transforms string representing color into {@link Color}.
-	 * 
-	 * @param hex
-	 *          string representing color
-	 * @return {@link Color} representation of input string
-	 */
-	protected Color hexStringToColor(String hex) {
-		if (hex == null || hex.isEmpty()) {
-			return null;
-		}
-		if ("Transparent".equalsIgnoreCase(hex)) {
-			return TRANSPARENT_COLOR;
-		}
-		// CHECKSTYLE:OFF
-		if (hex.length() != 6) {
-			throw new InvalidArgumentException("Unknown color format: " + hex);
-		}
-		return new Color(Integer.valueOf(hex, 16));
-		// CHECKSTYLE:ON
-	}
-
-	/**
-	 * Returns list of {@link Node} attributes.
-	 * 
-	 * @param node
-	 *          xml node
-	 * @return set of pairs containing xml node attributes
-	 */
-	protected Set<Pair<String, String>> getAttributes(Node node) {
-		Set<Pair<String, String>> result = new HashSet<>();
-		NamedNodeMap map = node.getAttributes();
-		for (int k = 0; k < map.getLength(); k++) {
-			Node attribute = map.item(k);
-			String name = attribute.getNodeName();
-			String value = attribute.getNodeValue();
-			result.add(new Pair<String, String>(name, value));
-		}
-		return result;
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.converter.ConverterException;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * Generic parser for GPML xml structures.
+ * 
+ * @author Piotr Gawron
+ *
+ * @param <T>
+ *          class for which this parser aplies
+ */
+public abstract class ElementGpmlParser<T> {
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private final Logger			 logger						= Logger.getLogger(ElementGpmlParser.class);
+
+	/**
+	 * Color that should be used when we have transparent color.
+	 */
+	private static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
+
+	/**
+	 * Creates object from xml node given in parameter.
+	 * 
+	 * @param node
+	 *          xml node from which object will be created
+	 * @return object created from xml node
+	 * @throws ConverterException
+	 *           thrown when there is severe problem with parsing xml node
+	 */
+	public abstract T parse(Element node) throws ConverterException;
+
+	/**
+	 * Converts object into xml string (in gpml format).
+	 * 
+	 * @param object
+	 *          object to transform
+	 * @return xml string representing object
+	 * @throws ConverterException
+	 *           thrown when there is a problem with converting into xml
+	 */
+	public abstract String toXml(T object) throws ConverterException;
+
+	/**
+	 * Converts list of objects into xml string (in gpml format) representing this
+	 * list.
+	 * 
+	 * @param list
+	 *          list objects to transform
+	 * @return xml string representing objects
+	 * @throws ConverterException
+	 *           thrown when there is a problem with converting into xml
+	 */
+	public abstract String toXml(Collection<T> list) throws ConverterException;
+
+	/**
+	 * Creates list of object from list of xml nodes.
+	 * 
+	 * @param nodes
+	 *          list of xml nodes to parse
+	 * @return list of object from list of xml nodes
+	 * @throws ConverterException
+	 *           thrown when there is severe problem with parsing xml node
+	 */
+	public List<T> parseCollection(Collection<Node> nodes) throws ConverterException {
+		List<T> result = new ArrayList<>();
+		for (Node node : nodes) {
+			if (node.getNodeType() == Node.ELEMENT_NODE) {
+				T element = parse((Element) node);
+				// add only not null elements (null might appear when node is partially
+				// invalid and warnings are set)
+				if (element != null) {
+					result.add(element);
+				}
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Transforms string representing color into {@link Color}.
+	 * 
+	 * @param hex
+	 *          string representing color
+	 * @return {@link Color} representation of input string
+	 */
+	protected Color hexStringToColor(String hex) {
+		if (hex == null || hex.isEmpty()) {
+			return null;
+		}
+		if ("Transparent".equalsIgnoreCase(hex)) {
+			return TRANSPARENT_COLOR;
+		}
+		// CHECKSTYLE:OFF
+		if (hex.length() != 6) {
+			throw new InvalidArgumentException("Unknown color format: " + hex);
+		}
+		return new Color(Integer.valueOf(hex, 16));
+		// CHECKSTYLE:ON
+	}
+
+	/**
+	 * Returns list of {@link Node} attributes.
+	 * 
+	 * @param node
+	 *          xml node
+	 * @return set of pairs containing xml node attributes
+	 */
+	protected Set<Pair<String, String>> getAttributes(Node node) {
+		Set<Pair<String, String>> result = new HashSet<>();
+		NamedNodeMap map = node.getAttributes();
+		for (int k = 0; k < map.getLength(); k++) {
+			Node attribute = map.item(k);
+			String name = attribute.getNodeName();
+			String value = attribute.getNodeValue();
+			result.add(new Pair<String, String>(name, value));
+		}
+		return result;
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GPMLToModel.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GPMLToModel.java
index 5f05c492cc..5522e76654 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GPMLToModel.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GPMLToModel.java
@@ -1,62 +1,62 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.EventStorageLoggerAppender;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.wikipathway.model.Graph;
-
-/**
- * Class contains methods for GPMLToGraph conversion.
- * 
- * @author Jan Badura
- * 
- */
-public class GPMLToModel {
-
-	/**
-	 * This function creates model from gpml input stream.
-	 * 
-	 * @param stream
-	 *          input stream that contains gpml data
-	 * @return {@link Model} created from gpml file
-	 * @throws IOException
-	 *           thrown when there is a problem with input file
-	 * @throws ConverterException
-	 *           thrown when model couldn't be created
-	 */
-	public Model getModel(InputStream stream) throws IOException, ConverterException {
-		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
-		try {
-			Logger.getRootLogger().addAppender(appender);
-			Graph graph = new GpmlParser().createGraph(stream);
-			Logger.getRootLogger().removeAppender(appender);
-			Model model = new ModelContructor().getModel(graph);
-			model.addLoggingInfo(appender);
-			return model;
-		} finally {
-			Logger.getRootLogger().removeAppender(appender);
-		}
-	}
-
-	/**
-	 * This function creates model from gpml file.
-	 * 
-	 * @param fileName
-	 *          name of the gpml file
-	 * @return {@link Model} created from gpml file
-	 * @throws IOException
-	 *           thrown when there is a problem with input file
-	 * @throws ConverterException
-	 *           thrown when the was a problem with creating a model
-	 */
-	public Model getModel(String fileName) throws IOException, ConverterException {
-		FileInputStream fis = new FileInputStream(fileName);
-		return getModel(fis);
-	}
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.EventStorageLoggerAppender;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.wikipathway.model.Graph;
+
+/**
+ * Class contains methods for GPMLToGraph conversion.
+ * 
+ * @author Jan Badura
+ * 
+ */
+public class GPMLToModel {
+
+	/**
+	 * This function creates model from gpml input stream.
+	 * 
+	 * @param stream
+	 *          input stream that contains gpml data
+	 * @return {@link Model} created from gpml file
+	 * @throws IOException
+	 *           thrown when there is a problem with input file
+	 * @throws ConverterException
+	 *           thrown when model couldn't be created
+	 */
+	public Model getModel(InputStream stream) throws IOException, ConverterException {
+		EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
+		try {
+			Logger.getRootLogger().addAppender(appender);
+			Graph graph = new GpmlParser().createGraph(stream);
+			Logger.getRootLogger().removeAppender(appender);
+			Model model = new ModelContructor().getModel(graph);
+			model.addLoggingInfo(appender);
+			return model;
+		} finally {
+			Logger.getRootLogger().removeAppender(appender);
+		}
+	}
+
+	/**
+	 * This function creates model from gpml file.
+	 * 
+	 * @param fileName
+	 *          name of the gpml file
+	 * @return {@link Model} created from gpml file
+	 * @throws IOException
+	 *           thrown when there is a problem with input file
+	 * @throws ConverterException
+	 *           thrown when the was a problem with creating a model
+	 */
+	public Model getModel(String fileName) throws IOException, ConverterException {
+		FileInputStream fis = new FileInputStream(fileName);
+		return getModel(fis);
+	}
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GpmlParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GpmlParser.java
index ba5686885f..14163014d1 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GpmlParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GpmlParser.java
@@ -1,657 +1,657 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.reaction.Modifier;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.wikipathway.model.Edge;
-import lcsb.mapviewer.wikipathway.model.Graph;
-import lcsb.mapviewer.wikipathway.model.Group;
-import lcsb.mapviewer.wikipathway.model.Interaction;
-import lcsb.mapviewer.wikipathway.model.InteractionMapping;
-import lcsb.mapviewer.wikipathway.model.Label;
-import lcsb.mapviewer.wikipathway.model.MergeMapping;
-import lcsb.mapviewer.wikipathway.model.PointData;
-import lcsb.mapviewer.wikipathway.model.Shape;
-import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
-
-/**
- * This class allows to parse
- * <a href="http://developers.pathvisio.org/wiki/EverythingGpml">gpml</a>.
- * 
- * @author Jan Badura
- * 
- */
-public class GpmlParser {
-
-	/**
-	 * Default class logger.
-	 */
-	private Logger					logger				 = Logger.getLogger(GpmlParser.class);
-
-	/**
-	 * Parser used for creating {@link Shape shapes}.
-	 */
-	private ShapeParser			shapeParser		 = new ShapeParser();
-
-	/**
-	 * Parser used for creating {@link lcsb.mapviewer.wikipathway.model.DataNode
-	 * data nodes}.
-	 */
-	private DataNodeParser	dataNodeParser = new DataNodeParser();
-
-	/**
-	 * Parser used for creating {@link Label labels}.
-	 */
-	private LabelParser			labelParser		 = new LabelParser();
-
-	/**
-	 * Parser used for creating {@link Edge edges}.
-	 */
-	private EdgeParser			edgeParser		 = new EdgeParser();
-
-	/**
-	 * Parser used for creating {@link lcsb.mapviewer.wikipathway.model.State
-	 * states}.
-	 */
-	private StateParser			stateParser		 = new StateParser();
-
-	/**
-	 * Parser used for creating {@link Edge edges} from line xml nodes.
-	 */
-	private EdgeLineParser	edgeLineParser = new EdgeLineParser();
-
-	/**
-	 * Parser used for creating {@link PointData points} from line xml nodes.
-	 */
-	private PointDataParser	pointParser		 = new PointDataParser();
-
-	/**
-	 * This function returns parent interaction for edge that has anchor at one
-	 * end.
-	 * 
-	 * @param graph
-	 *          model where data is stored
-	 * @param edge
-	 *          edge for which interaction is looked for
-	 * @return {@link Interaction} that is parent reaction for given edge.
-	 * @throws CyclicEdgeException
-	 *           thrown when parent interaction cannot be found because reactions
-	 *           are cyclic
-	 */
-	private Interaction getParentInteraction(Graph graph, Edge edge) throws CyclicEdgeException {
-		// remeber what we already processed (to detect cycles)
-		Set<Edge> processedEdges = new HashSet<>();
-		processedEdges.add(edge);
-		while (graph.getNodeByGraphId(edge.getEnd()) == null || graph.getNodeByGraphId(edge.getStart()) == null) {
-			String anchor = null;
-			if (graph.getEdgeByAnchor(edge.getEnd()) != null) {
-				anchor = edge.getEnd();
-			} else if (graph.getEdgeByAnchor(edge.getStart()) != null) {
-				anchor = edge.getStart();
-			} else {
-				return null;
-			}
-
-			edge = graph.getEdgeByAnchor(anchor);
-			// when we have cycle then return null
-			if (processedEdges.contains(edge)) {
-				throw new CyclicEdgeException(edge.getWarningPrefix() + " edge is a part of invalid, cyclic edge");
-			}
-			processedEdges.add(edge);
-		}
-		return graph.getInteractionByGraphId(edge.getGraphId());
-	}
-
-	/**
-	 * This function sets width and height in given graph.
-	 * 
-	 * @param node
-	 *          xml node where data is stored
-	 * @param graph
-	 *          object where data is sotred
-	 */
-	protected void setSize(Node node, Graph graph) {
-		Element eElement = (Element) node;
-		String boardWidth = eElement.getAttribute("BoardWidth");
-		String boardHeight = eElement.getAttribute("BoardHeight");
-		graph.setBoardWidth(Math.ceil(Double.parseDouble(boardWidth)));
-		graph.setBoardHeight(Math.ceil(Double.parseDouble(boardHeight)));
-	}
-
-	/**
-	 * This function adds groups to graph and nest them.
-	 * 
-	 * @param groups
-	 *          xml nodes
-	 * @param graph
-	 *          object where data is sotred
-	 * @throws UnknownAttributeValueException
-	 *           thrown when there is a problem with xml attributes
-	 */
-	protected void addGroups(List<Node> groups, Graph graph) throws UnknownAttributeValueException {
-		// Adding Groups to graph
-		for (Node nNode : groups) {
-			if (nNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element eElement = (Element) nNode;
-				String graphId = eElement.getAttribute("GraphId");
-				String groupId = eElement.getAttribute("GroupId");
-				if (graphId.equals("") || graphId == null) {
-					graphId = groupId;
-				}
-				String style = eElement.getAttribute("Style");
-				if ("".equals(style)) {
-					style = null;
-				}
-				if (style != null && //
-						!"Complex".equalsIgnoreCase(style) && //
-						!"Group".equalsIgnoreCase(style)) {
-					throw new UnknownAttributeValueException(
-							"Unknown value of \"style\" attribute for group node: " + style + ". Only null, Complex, Group are supported.");
-				}
-				Group group = new Group(graphId, groupId);
-				group.setStyle(style);
-				graph.addGroup(group);
-			}
-		}
-		// Handling nested groups
-		Group gr1, gr2;
-		for (Node nNode : groups) {
-			if (nNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element eElement = (Element) nNode;
-				String groupRef = eElement.getAttribute("GroupRef");
-				String groupId = eElement.getAttribute("GroupId");
-				if (groupRef != null && !groupRef.equals("")) {
-					gr1 = graph.getGroupByGroupId(groupRef);
-					gr2 = graph.getGroupByGroupId(groupId);
-					gr1.addNode(gr2);
-				}
-			}
-		}
-	}
-
-	/**
-	 * This function adds edges to graph. It ignores edges that have no connection
-	 * at one end and edges that connects to shapes or labels.
-	 * 
-	 * @param nodes
-	 *          xml nodes
-	 * @param graph
-	 *          object where data is sotred
-	 */
-	private void prepareEdges(List<Node> nodes, Graph graph) {
-		for (Node nNode : nodes) {
-			if (nNode.getNodeType() == Node.ELEMENT_NODE) {
-				Edge edge;
-				try {
-					edge = edgeParser.parse((Element) nNode);
-
-					if (graph.getLabelByGraphId(edge.getStart()) != null) {
-						Label label = graph.getLabelByGraphId(edge.getStart());
-						label.setTreatAsNode(true);
-					}
-					if (graph.getLabelByGraphId(edge.getEnd()) != null) {
-						Label label = graph.getLabelByGraphId(edge.getEnd());
-						label.setTreatAsNode(true);
-					}
-
-					if (graph.getShapeByGraphId(edge.getStart()) != null) {
-						Shape shape = graph.getShapeByGraphId(edge.getStart());
-						shape.setTreatAsNode(true);
-					}
-					if (graph.getShapeByGraphId(edge.getEnd()) != null) {
-						Shape shape = graph.getShapeByGraphId(edge.getEnd());
-						shape.setTreatAsNode(true);
-					}
-					if (edge.getStart() == null || edge.getEnd() == null) {
-						logger.warn(edge.getWarningPrefix() + "Interaction is not connected");
-
-					} else {
-						graph.addEdge(edge);
-					}
-				} catch (ConverterException e) {
-					logger.warn(e, e);
-				}
-			}
-		}
-	}
-
-	/**
-	 * This function transforms Edges into Interactions. First: Edges with
-	 * NodeToNode connection are transformed into Interactions. Second: Edges with
-	 * AnchorToNode connection are added to right interaction. Edges with
-	 * AnchorToAnchor connection are ignored.
-	 * 
-	 * @param graph
-	 *          object where data is sotred
-	 * @throws InvalidXmlSchemaException
-	 *           thrown when the data in input file is invalid
-	 */
-	protected void addInteractions(Graph graph) throws InvalidXmlSchemaException {
-		for (Edge edge : graph.getEdges()) {
-			if (graph.getNodeByGraphId(edge.getEnd()) != null && graph.getNodeByGraphId(edge.getStart()) != null) {
-				if (graph.getNodeByGraphId(edge.getEnd()) instanceof Label) {
-					Label label = (Label) graph.getNodeByGraphId(edge.getEnd());
-					label.setTreatAsNode(true);
-				}
-				if (graph.getNodeByGraphId(edge.getStart()) instanceof Label) {
-					Label label = (Label) graph.getNodeByGraphId(edge.getStart());
-					label.setTreatAsNode(true);
-				}
-				if (graph.getShapeByGraphId(edge.getEnd()) instanceof Shape) {
-					Shape shape = (Shape) graph.getShapeByGraphId(edge.getEnd());
-					shape.setTreatAsNode(true);
-				}
-				if (graph.getShapeByGraphId(edge.getStart()) instanceof Shape) {
-					Shape shape = (Shape) graph.getShapeByGraphId(edge.getStart());
-					shape.setTreatAsNode(true);
-				}
-
-				Interaction interaction = new Interaction(edge);
-				graph.addInteraction(interaction);
-				InteractionMapping mapping = InteractionMapping.getInteractionMapping(edge.getType(), edge.getLine().getType());
-				if (mapping != null) {
-					if (mapping.isInteractionWarning()) {
-						logger.warn(edge.getWarningPrefix() + "Invalid interaction type.");
-					}
-				} else {
-					throw new InvalidXmlSchemaException(
-							edge.getWarningPrefix() + "Unknown interaction type: " + edge.getType() + " and line type: " + edge.getLine().getType());
-				}
-			}
-		}
-		for (Edge edge : graph.getEdges()) {
-			try {
-				if (graph.getEdgeByAnchor(edge.getEnd()) != null && graph.getEdgeByAnchor(edge.getStart()) != null) {
-					logger.warn(edge.getWarningPrefix() + "Interaction can not connect two anchors.");
-				} else if (graph.getEdgeByAnchor(edge.getEnd()) != null && graph.getNodeByGraphId(edge.getStart()) != null) {
-					Interaction tmp = getParentInteraction(graph, edge);
-					if (tmp != null) {
-						InteractionMapping mapping = InteractionMapping.getInteractionMapping(edge.getType(), edge.getLine().getType());
-						if (mapping != null) {
-							if (mapping.isInputWarning()) {
-								logger.warn(edge.getWarningPrefix() + "Invalid interaction type as an input to reaction.");
-							}
-							if (Modifier.class.isAssignableFrom(mapping.getModelInputReactionNodeType())) {
-								tmp.addModifier(edge);
-							} else if (Reactant.class.isAssignableFrom(mapping.getModelInputReactionNodeType())) {
-								tmp.addReactant(edge);
-							} else if (Product.class.isAssignableFrom(mapping.getModelInputReactionNodeType())) {
-								tmp.addProduct(edge);
-							} else {
-								throw new InvalidStateException("Unknown internal model type: " + mapping.getModelInputReactionNodeType());
-							}
-						} else {
-							throw new InvalidXmlSchemaException("Unknown interaction type: " + edge.getType());
-						}
-					} else {
-						logger.warn(edge.getWarningPrefix() + "Interaction is disconnected.");
-					}
-				} else if (graph.getEdgeByAnchor(edge.getStart()) != null && graph.getNodeByGraphId(edge.getEnd()) != null) {
-					Interaction tmp = getParentInteraction(graph, edge);
-					if (tmp != null) {
-						InteractionMapping mapping = InteractionMapping.getInteractionMapping(edge.getType(), edge.getLine().getType());
-						if (mapping != null) {
-							if (mapping.isOutputWarning()) {
-								logger.warn(edge.getWarningPrefix() + "Invalid interaction type \"" + edge.getType() + "\" as an input to reaction.");
-							}
-							if (Modifier.class.isAssignableFrom(mapping.getModelOutputReactionNodeType())) {
-								tmp.addModifier(edge);
-							} else if (Reactant.class.isAssignableFrom(mapping.getModelOutputReactionNodeType())) {
-								tmp.addReactant(edge);
-							} else if (Product.class.isAssignableFrom(mapping.getModelOutputReactionNodeType())) {
-								tmp.addProduct(edge);
-							} else {
-								throw new InvalidStateException("Unknown internal model type: " + mapping.getModelOutputReactionNodeType());
-							}
-						} else {
-							throw new InvalidXmlSchemaException("Unknown interaction type: " + edge.getType());
-						}
-					} else {
-						logger.warn(edge.getWarningPrefix() + "Interaction is disconnected.");
-					}
-				} else if (graph.getNodeByGraphId(edge.getEnd()) == null || graph.getNodeByGraphId(edge.getStart()) == null) {
-					logger.warn(edge.getWarningPrefix() + "Interaction edge is invalid (one end is not connected).");
-				}
-			} catch (CyclicEdgeException e) {
-				logger.warn(e, e);
-			}
-		}
-	}
-
-	/**
-	 * Creates gpml {@link Graph} model from gpml input stream.
-	 * 
-	 * @param stream
-	 *          input stream with gpml model
-	 * @return {@link Graph} model
-	 * @throws IOException
-	 *           thrown when there is a problem with input file
-	 * @throws ConverterException
-	 *           thrown when there is a problem with parsing input file
-	 */
-	public Graph createGraph(InputStream stream) throws IOException, ConverterException {
-		try {
-			DocumentBuilder builder;
-			builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-			Document document = builder.parse(stream);
-
-			// Get the document's root XML node
-			NodeList root = document.getElementsByTagName("Pathway");
-
-			NodeList nodes = root.item(0).getChildNodes();
-
-			Node dimensionNode = null;
-			List<Node> dataNodes = new ArrayList<Node>();
-			List<Node> interactions = new ArrayList<Node>();
-			List<Node> labels = new ArrayList<Node>();
-			List<Node> groups = new ArrayList<Node>();
-			List<Node> shapes = new ArrayList<Node>();
-			List<Node> lines = new ArrayList<Node>();
-			List<Node> states = new ArrayList<Node>();
-			List<Element> attributes = new ArrayList<Element>();
-			Node biopax = null;
-
-			Graph graph = new Graph();
-			for (int x = 0; x < nodes.getLength(); x++) {
-				Node node = nodes.item(x);
-				if (node.getNodeType() == Node.ELEMENT_NODE) {
-					if (node.getNodeName().equalsIgnoreCase("Graphics")) {
-						dimensionNode = node;
-					} else if (node.getNodeName().equalsIgnoreCase("DataNode")) {
-						dataNodes.add(node);
-					} else if (node.getNodeName().equalsIgnoreCase("Interaction")) {
-						interactions.add(node);
-					} else if (node.getNodeName().equalsIgnoreCase("Label")) {
-						labels.add(node);
-					} else if (node.getNodeName().equalsIgnoreCase("Group")) {
-						groups.add(node);
-					} else if (node.getNodeName().equalsIgnoreCase("Attribute")) {
-						attributes.add((Element) node);
-					} else if (node.getNodeName().equalsIgnoreCase("Shape")) {
-						shapes.add(node);
-					} else if (node.getNodeName().equalsIgnoreCase("GraphicalLine")) {
-						lines.add(node);
-					} else if (node.getNodeName().equalsIgnoreCase("Comment")) {
-						graph.addComment(node.getTextContent());
-					} else if (node.getNodeName().equalsIgnoreCase("BiopaxRef")) {
-						graph.addBiopaxReferences(node.getTextContent());
-					} else if (node.getNodeName().equalsIgnoreCase("State")) {
-						states.add(node);
-					} else if (node.getNodeName().equalsIgnoreCase("Biopax")) {
-						if (biopax != null) {
-							throw new ConverterException("Biopax node should appear only once");
-						}
-						biopax = node;
-					} else if (node.getNodeName().equalsIgnoreCase("InfoBox")) {
-						// infobox can be skipped
-						continue;
-					} else if (node.getNodeName().equalsIgnoreCase("Legend")) {
-						// legend can be skipped
-						continue;
-					} else {
-						logger.warn("Unknown element of gpml file: " + node.getNodeName());
-					}
-				}
-			}
-			graph.addLines(parseLines(lines));
-			graph.addEdges(parseEdgesFromLines(lines));
-
-			if (dimensionNode != null) {
-				setSize(dimensionNode, graph);
-			}
-			addGroups(groups, graph);
-
-			graph.addDataNodes(dataNodeParser.parseCollection(dataNodes));
-			graph.addLabels(labelParser.parseCollection(labels));
-			graph.addShapes(shapeParser.parseCollection(shapes));
-			graph.addStates(stateParser.parseCollection(states));
-
-			prepareEdges(interactions, graph);
-
-			mergeEdges(graph);
-
-			addInteractions(graph);
-			if (biopax != null) {
-				graph.setBiopaxData(new BiopaxParser().parse(biopax));
-			}
-			Map<String, String> attributesMap = new HashMap<String, String>();
-			for (Element attribute : attributes) {
-				String key = attribute.getAttribute("Key");
-				String value = attribute.getAttribute("Value");
-				if (attributesMap.get(key) != null) {
-					logger.warn("Model xml contains duplicate attributes: " + key);
-				} else {
-					attributesMap.put(key, value);
-				}
-			}
-			graph.setAttributes(attributesMap);
-			return graph;
-		} catch (ParserConfigurationException e) {
-			throw new ConverterException("Problem with input data", e);
-		} catch (SAXException e) {
-			throw new ConverterException("Problem with input data", e);
-		} catch (InvalidXmlSchemaException e) {
-			throw new ConverterException("Problem with input data", e);
-		}
-	}
-
-	/**
-	 * This method merge edges that should be merged into single line.
-	 * 
-	 * @param graph
-	 *          model where edges are stored
-	 */
-	private void mergeEdges(Graph graph) {
-		List<Edge> toExtend = new ArrayList<>();
-		List<Edge> toRemove = new ArrayList<>();
-		List<Edge> toAdd = new ArrayList<>();
-		Map<String, List<Edge>> extendable = new HashMap<>();
-		for (Edge edge : graph.getEdges()) {
-			if (graph.getEdgeByAnchor(edge.getStart()) == edge) {
-				toExtend.add(edge);
-			} else if (graph.getEdgeByAnchor(edge.getEnd()) == edge) {
-				toExtend.add(edge);
-			} else if (graph.getEdgeByAnchor(edge.getEnd()) != null) {
-				List<Edge> list = extendable.get(edge.getEnd());
-				if (list == null) {
-					list = new ArrayList<>();
-					extendable.put(edge.getEnd(), list);
-				}
-				list.add(edge);
-			} else if (graph.getEdgeByAnchor(edge.getStart()) != null) {
-				List<Edge> list = extendable.get(edge.getStart());
-				if (list == null) {
-					list = new ArrayList<>();
-					extendable.put(edge.getStart(), list);
-				}
-				list.add(edge);
-			}
-
-		}
-
-		for (Edge edge : toExtend) {
-			String anchor = null;
-			if (graph.getEdgeByAnchor(edge.getStart()) == edge) {
-				anchor = edge.getStart();
-			} else if (graph.getEdgeByAnchor(edge.getEnd()) == edge) {
-				anchor = edge.getEnd();
-			}
-			List<Edge> howExtend = extendable.get(anchor);
-			if (howExtend == null) {
-				logger.warn(edge.getWarningPrefix() + " Should be connected with another element, but nothing found.");
-				if (edge.getStart().equals(anchor)) {
-					edge.setStart(null);
-				} else if (edge.getEnd().equals(anchor)) {
-					edge.setEnd(null);
-				}
-			} else if (howExtend.size() > 0) {
-				try {
-					Edge newEdge = mergeEdges(edge, howExtend.get(0));
-					toRemove.add(edge);
-					toRemove.add(howExtend.get(0));
-					toAdd.add(newEdge);
-				} catch (UnknownMergingMethodException exception) {
-					toRemove.add(edge);
-					toRemove.add(howExtend.get(0));
-
-					logger.warn(exception, exception);
-				}
-			}
-		}
-		for (Edge e : toRemove) {
-			graph.removeEdge(e);
-		}
-		for (Edge e : toAdd) {
-			graph.addEdge(e);
-		}
-	}
-
-	/**
-	 * Method that merge two {@link Edge edges}.
-	 * 
-	 * @param edge1
-	 *          first edge to merge
-	 * @param edge2
-	 *          second edge to merge
-	 * @return new edge that merges two parameters
-	 * @throws UnknownMergingMethodException
-	 *           thrown when edges cannot be merged
-	 */
-	private Edge mergeEdges(Edge edge1, Edge edge2) throws UnknownMergingMethodException {
-		MergeMapping mapping = null;
-		if (edge1.getStart() != null && edge1.getStart().equals(edge2.getStart())) {
-			mapping = MergeMapping.getMergeMappingByInteractions(edge1.getType(), true, edge2.getType(), false);
-		} else if (edge1.getStart() != null && edge1.getStart().equals(edge2.getEnd())) {
-			mapping = MergeMapping.getMergeMappingByInteractions(edge1.getType(), true, edge2.getType(), true);
-		} else if (edge1.getEnd() != null && edge1.getEnd().equals(edge2.getStart())) {
-			mapping = MergeMapping.getMergeMappingByInteractions(edge1.getType(), false, edge2.getType(), false);
-		} else if (edge1.getEnd() != null && edge1.getEnd().equals(edge2.getEnd())) {
-			mapping = MergeMapping.getMergeMappingByInteractions(edge1.getType(), false, edge2.getType(), true);
-		}
-		if (mapping == null) {
-			String message = edge1.getWarningPrefix() + edge2.getWarningPrefix() + "Don't know how to merge interactions";
-			throw new UnknownMergingMethodException(message);
-		}
-		Edge first;
-		if (mapping.isReversed1()) {
-			first = edge1.reverse();
-		} else {
-			first = new Edge(edge1);
-		}
-		Edge second;
-		if (mapping.isReversed2()) {
-			second = edge2.reverse();
-		} else {
-			second = new Edge(edge2);
-		}
-		first.extend(second);
-
-		if (!first.getLine().getType().equals(second.getLine().getType())) {
-			logger.warn(
-					first.getWarningPrefix() + second.getWarningPrefix() + " merging edges with different line types: " + first.getLine().getType() + ", "
-							+ second.getLine().getType());
-		}
-		first.setType(mapping.getResultType());
-		if (mapping.isResultReversed()) {
-			return first.reverse();
-		} else {
-			return first;
-		}
-	}
-
-	/**
-	 * Creates edges from lines when it's possible.
-	 * 
-	 * @param lines
-	 *          xml nodes with lines
-	 * @return list of edges that could be created from xml nodes
-	 */
-	private Collection<Edge> parseEdgesFromLines(List<Node> lines) {
-		List<Edge> result = new ArrayList<Edge>();
-		for (Node lNode : lines) {
-			try {
-				Edge line = edgeLineParser.parse((Element) lNode);
-				if (line.getStart() != null && line.getEnd() != null) {
-					result.add(line);
-				}
-			} catch (ConverterException e) {
-				logger.warn(e, e);
-
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Creates lines from the list of gpml xml nodes.
-	 * 
-	 * @param lines
-	 *          list of xml nodes
-	 * @return list of {@link PolylineData lines}
-	 * @throws UnknownTypeException
-	 *           thrown when the type of line defined in xml node is unknown
-	 */
-	private Collection<PolylineData> parseLines(List<Node> lines) throws UnknownTypeException {
-		List<PolylineData> result = new ArrayList<PolylineData>();
-		for (Node lNode : lines) {
-			int refs = 0;
-			PolylineData line = new PolylineData();
-			NodeList nodes = lNode.getChildNodes();
-			for (int i = 0; i < nodes.getLength(); i++) {
-				Node node = nodes.item(i);
-				if (node.getNodeType() == Node.ELEMENT_NODE) {
-					if (node.getNodeName().equalsIgnoreCase("Graphics")) {
-						NodeList nodes2 = node.getChildNodes();
-						for (int j = 0; j < nodes2.getLength(); j++) {
-							Node node2 = nodes2.item(j);
-							if (node2.getNodeType() == Node.ELEMENT_NODE) {
-								Element element = (Element) node2;
-								if (node2.getNodeName().equalsIgnoreCase("Point")) {
-									PointData point = pointParser.parse(element);
-									if (point.hasGraphRef()) {
-										refs++;
-									}
-									line.addPoint(point.toPoint());
-								} else {
-									logger.warn("Unknown node in line: " + node2.getNodeName());
-								}
-							}
-						}
-
-					} else {
-						logger.warn("Unknown node in line: " + node.getNodeName());
-					}
-				}
-			}
-			if (refs < 2) {
-				result.add(line);
-			}
-		}
-		return result;
-	}
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.reaction.Modifier;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.wikipathway.model.Edge;
+import lcsb.mapviewer.wikipathway.model.Graph;
+import lcsb.mapviewer.wikipathway.model.Group;
+import lcsb.mapviewer.wikipathway.model.Interaction;
+import lcsb.mapviewer.wikipathway.model.InteractionMapping;
+import lcsb.mapviewer.wikipathway.model.Label;
+import lcsb.mapviewer.wikipathway.model.MergeMapping;
+import lcsb.mapviewer.wikipathway.model.PointData;
+import lcsb.mapviewer.wikipathway.model.Shape;
+import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
+
+/**
+ * This class allows to parse
+ * <a href="http://developers.pathvisio.org/wiki/EverythingGpml">gpml</a>.
+ * 
+ * @author Jan Badura
+ * 
+ */
+public class GpmlParser {
+
+	/**
+	 * Default class logger.
+	 */
+	private Logger					logger				 = Logger.getLogger(GpmlParser.class);
+
+	/**
+	 * Parser used for creating {@link Shape shapes}.
+	 */
+	private ShapeParser			shapeParser		 = new ShapeParser();
+
+	/**
+	 * Parser used for creating {@link lcsb.mapviewer.wikipathway.model.DataNode
+	 * data nodes}.
+	 */
+	private DataNodeParser	dataNodeParser = new DataNodeParser();
+
+	/**
+	 * Parser used for creating {@link Label labels}.
+	 */
+	private LabelParser			labelParser		 = new LabelParser();
+
+	/**
+	 * Parser used for creating {@link Edge edges}.
+	 */
+	private EdgeParser			edgeParser		 = new EdgeParser();
+
+	/**
+	 * Parser used for creating {@link lcsb.mapviewer.wikipathway.model.State
+	 * states}.
+	 */
+	private StateParser			stateParser		 = new StateParser();
+
+	/**
+	 * Parser used for creating {@link Edge edges} from line xml nodes.
+	 */
+	private EdgeLineParser	edgeLineParser = new EdgeLineParser();
+
+	/**
+	 * Parser used for creating {@link PointData points} from line xml nodes.
+	 */
+	private PointDataParser	pointParser		 = new PointDataParser();
+
+	/**
+	 * This function returns parent interaction for edge that has anchor at one
+	 * end.
+	 * 
+	 * @param graph
+	 *          model where data is stored
+	 * @param edge
+	 *          edge for which interaction is looked for
+	 * @return {@link Interaction} that is parent reaction for given edge.
+	 * @throws CyclicEdgeException
+	 *           thrown when parent interaction cannot be found because reactions
+	 *           are cyclic
+	 */
+	private Interaction getParentInteraction(Graph graph, Edge edge) throws CyclicEdgeException {
+		// remeber what we already processed (to detect cycles)
+		Set<Edge> processedEdges = new HashSet<>();
+		processedEdges.add(edge);
+		while (graph.getNodeByGraphId(edge.getEnd()) == null || graph.getNodeByGraphId(edge.getStart()) == null) {
+			String anchor = null;
+			if (graph.getEdgeByAnchor(edge.getEnd()) != null) {
+				anchor = edge.getEnd();
+			} else if (graph.getEdgeByAnchor(edge.getStart()) != null) {
+				anchor = edge.getStart();
+			} else {
+				return null;
+			}
+
+			edge = graph.getEdgeByAnchor(anchor);
+			// when we have cycle then return null
+			if (processedEdges.contains(edge)) {
+				throw new CyclicEdgeException(edge.getWarningPrefix() + " edge is a part of invalid, cyclic edge");
+			}
+			processedEdges.add(edge);
+		}
+		return graph.getInteractionByGraphId(edge.getGraphId());
+	}
+
+	/**
+	 * This function sets width and height in given graph.
+	 * 
+	 * @param node
+	 *          xml node where data is stored
+	 * @param graph
+	 *          object where data is sotred
+	 */
+	protected void setSize(Node node, Graph graph) {
+		Element eElement = (Element) node;
+		String boardWidth = eElement.getAttribute("BoardWidth");
+		String boardHeight = eElement.getAttribute("BoardHeight");
+		graph.setBoardWidth(Math.ceil(Double.parseDouble(boardWidth)));
+		graph.setBoardHeight(Math.ceil(Double.parseDouble(boardHeight)));
+	}
+
+	/**
+	 * This function adds groups to graph and nest them.
+	 * 
+	 * @param groups
+	 *          xml nodes
+	 * @param graph
+	 *          object where data is sotred
+	 * @throws UnknownAttributeValueException
+	 *           thrown when there is a problem with xml attributes
+	 */
+	protected void addGroups(List<Node> groups, Graph graph) throws UnknownAttributeValueException {
+		// Adding Groups to graph
+		for (Node nNode : groups) {
+			if (nNode.getNodeType() == Node.ELEMENT_NODE) {
+				Element eElement = (Element) nNode;
+				String graphId = eElement.getAttribute("GraphId");
+				String groupId = eElement.getAttribute("GroupId");
+				if (graphId.equals("") || graphId == null) {
+					graphId = groupId;
+				}
+				String style = eElement.getAttribute("Style");
+				if ("".equals(style)) {
+					style = null;
+				}
+				if (style != null && //
+						!"Complex".equalsIgnoreCase(style) && //
+						!"Group".equalsIgnoreCase(style)) {
+					throw new UnknownAttributeValueException(
+							"Unknown value of \"style\" attribute for group node: " + style + ". Only null, Complex, Group are supported.");
+				}
+				Group group = new Group(graphId, groupId);
+				group.setStyle(style);
+				graph.addGroup(group);
+			}
+		}
+		// Handling nested groups
+		Group gr1, gr2;
+		for (Node nNode : groups) {
+			if (nNode.getNodeType() == Node.ELEMENT_NODE) {
+				Element eElement = (Element) nNode;
+				String groupRef = eElement.getAttribute("GroupRef");
+				String groupId = eElement.getAttribute("GroupId");
+				if (groupRef != null && !groupRef.equals("")) {
+					gr1 = graph.getGroupByGroupId(groupRef);
+					gr2 = graph.getGroupByGroupId(groupId);
+					gr1.addNode(gr2);
+				}
+			}
+		}
+	}
+
+	/**
+	 * This function adds edges to graph. It ignores edges that have no connection
+	 * at one end and edges that connects to shapes or labels.
+	 * 
+	 * @param nodes
+	 *          xml nodes
+	 * @param graph
+	 *          object where data is sotred
+	 */
+	private void prepareEdges(List<Node> nodes, Graph graph) {
+		for (Node nNode : nodes) {
+			if (nNode.getNodeType() == Node.ELEMENT_NODE) {
+				Edge edge;
+				try {
+					edge = edgeParser.parse((Element) nNode);
+
+					if (graph.getLabelByGraphId(edge.getStart()) != null) {
+						Label label = graph.getLabelByGraphId(edge.getStart());
+						label.setTreatAsNode(true);
+					}
+					if (graph.getLabelByGraphId(edge.getEnd()) != null) {
+						Label label = graph.getLabelByGraphId(edge.getEnd());
+						label.setTreatAsNode(true);
+					}
+
+					if (graph.getShapeByGraphId(edge.getStart()) != null) {
+						Shape shape = graph.getShapeByGraphId(edge.getStart());
+						shape.setTreatAsNode(true);
+					}
+					if (graph.getShapeByGraphId(edge.getEnd()) != null) {
+						Shape shape = graph.getShapeByGraphId(edge.getEnd());
+						shape.setTreatAsNode(true);
+					}
+					if (edge.getStart() == null || edge.getEnd() == null) {
+						logger.warn(edge.getWarningPrefix() + "Interaction is not connected");
+
+					} else {
+						graph.addEdge(edge);
+					}
+				} catch (ConverterException e) {
+					logger.warn(e, e);
+				}
+			}
+		}
+	}
+
+	/**
+	 * This function transforms Edges into Interactions. First: Edges with
+	 * NodeToNode connection are transformed into Interactions. Second: Edges with
+	 * AnchorToNode connection are added to right interaction. Edges with
+	 * AnchorToAnchor connection are ignored.
+	 * 
+	 * @param graph
+	 *          object where data is sotred
+	 * @throws InvalidXmlSchemaException
+	 *           thrown when the data in input file is invalid
+	 */
+	protected void addInteractions(Graph graph) throws InvalidXmlSchemaException {
+		for (Edge edge : graph.getEdges()) {
+			if (graph.getNodeByGraphId(edge.getEnd()) != null && graph.getNodeByGraphId(edge.getStart()) != null) {
+				if (graph.getNodeByGraphId(edge.getEnd()) instanceof Label) {
+					Label label = (Label) graph.getNodeByGraphId(edge.getEnd());
+					label.setTreatAsNode(true);
+				}
+				if (graph.getNodeByGraphId(edge.getStart()) instanceof Label) {
+					Label label = (Label) graph.getNodeByGraphId(edge.getStart());
+					label.setTreatAsNode(true);
+				}
+				if (graph.getShapeByGraphId(edge.getEnd()) instanceof Shape) {
+					Shape shape = (Shape) graph.getShapeByGraphId(edge.getEnd());
+					shape.setTreatAsNode(true);
+				}
+				if (graph.getShapeByGraphId(edge.getStart()) instanceof Shape) {
+					Shape shape = (Shape) graph.getShapeByGraphId(edge.getStart());
+					shape.setTreatAsNode(true);
+				}
+
+				Interaction interaction = new Interaction(edge);
+				graph.addInteraction(interaction);
+				InteractionMapping mapping = InteractionMapping.getInteractionMapping(edge.getType(), edge.getLine().getType());
+				if (mapping != null) {
+					if (mapping.isInteractionWarning()) {
+						logger.warn(edge.getWarningPrefix() + "Invalid interaction type.");
+					}
+				} else {
+					throw new InvalidXmlSchemaException(
+							edge.getWarningPrefix() + "Unknown interaction type: " + edge.getType() + " and line type: " + edge.getLine().getType());
+				}
+			}
+		}
+		for (Edge edge : graph.getEdges()) {
+			try {
+				if (graph.getEdgeByAnchor(edge.getEnd()) != null && graph.getEdgeByAnchor(edge.getStart()) != null) {
+					logger.warn(edge.getWarningPrefix() + "Interaction can not connect two anchors.");
+				} else if (graph.getEdgeByAnchor(edge.getEnd()) != null && graph.getNodeByGraphId(edge.getStart()) != null) {
+					Interaction tmp = getParentInteraction(graph, edge);
+					if (tmp != null) {
+						InteractionMapping mapping = InteractionMapping.getInteractionMapping(edge.getType(), edge.getLine().getType());
+						if (mapping != null) {
+							if (mapping.isInputWarning()) {
+								logger.warn(edge.getWarningPrefix() + "Invalid interaction type as an input to reaction.");
+							}
+							if (Modifier.class.isAssignableFrom(mapping.getModelInputReactionNodeType())) {
+								tmp.addModifier(edge);
+							} else if (Reactant.class.isAssignableFrom(mapping.getModelInputReactionNodeType())) {
+								tmp.addReactant(edge);
+							} else if (Product.class.isAssignableFrom(mapping.getModelInputReactionNodeType())) {
+								tmp.addProduct(edge);
+							} else {
+								throw new InvalidStateException("Unknown internal model type: " + mapping.getModelInputReactionNodeType());
+							}
+						} else {
+							throw new InvalidXmlSchemaException("Unknown interaction type: " + edge.getType());
+						}
+					} else {
+						logger.warn(edge.getWarningPrefix() + "Interaction is disconnected.");
+					}
+				} else if (graph.getEdgeByAnchor(edge.getStart()) != null && graph.getNodeByGraphId(edge.getEnd()) != null) {
+					Interaction tmp = getParentInteraction(graph, edge);
+					if (tmp != null) {
+						InteractionMapping mapping = InteractionMapping.getInteractionMapping(edge.getType(), edge.getLine().getType());
+						if (mapping != null) {
+							if (mapping.isOutputWarning()) {
+								logger.warn(edge.getWarningPrefix() + "Invalid interaction type \"" + edge.getType() + "\" as an input to reaction.");
+							}
+							if (Modifier.class.isAssignableFrom(mapping.getModelOutputReactionNodeType())) {
+								tmp.addModifier(edge);
+							} else if (Reactant.class.isAssignableFrom(mapping.getModelOutputReactionNodeType())) {
+								tmp.addReactant(edge);
+							} else if (Product.class.isAssignableFrom(mapping.getModelOutputReactionNodeType())) {
+								tmp.addProduct(edge);
+							} else {
+								throw new InvalidStateException("Unknown internal model type: " + mapping.getModelOutputReactionNodeType());
+							}
+						} else {
+							throw new InvalidXmlSchemaException("Unknown interaction type: " + edge.getType());
+						}
+					} else {
+						logger.warn(edge.getWarningPrefix() + "Interaction is disconnected.");
+					}
+				} else if (graph.getNodeByGraphId(edge.getEnd()) == null || graph.getNodeByGraphId(edge.getStart()) == null) {
+					logger.warn(edge.getWarningPrefix() + "Interaction edge is invalid (one end is not connected).");
+				}
+			} catch (CyclicEdgeException e) {
+				logger.warn(e, e);
+			}
+		}
+	}
+
+	/**
+	 * Creates gpml {@link Graph} model from gpml input stream.
+	 * 
+	 * @param stream
+	 *          input stream with gpml model
+	 * @return {@link Graph} model
+	 * @throws IOException
+	 *           thrown when there is a problem with input file
+	 * @throws ConverterException
+	 *           thrown when there is a problem with parsing input file
+	 */
+	public Graph createGraph(InputStream stream) throws IOException, ConverterException {
+		try {
+			DocumentBuilder builder;
+			builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+			Document document = builder.parse(stream);
+
+			// Get the document's root XML node
+			NodeList root = document.getElementsByTagName("Pathway");
+
+			NodeList nodes = root.item(0).getChildNodes();
+
+			Node dimensionNode = null;
+			List<Node> dataNodes = new ArrayList<Node>();
+			List<Node> interactions = new ArrayList<Node>();
+			List<Node> labels = new ArrayList<Node>();
+			List<Node> groups = new ArrayList<Node>();
+			List<Node> shapes = new ArrayList<Node>();
+			List<Node> lines = new ArrayList<Node>();
+			List<Node> states = new ArrayList<Node>();
+			List<Element> attributes = new ArrayList<Element>();
+			Node biopax = null;
+
+			Graph graph = new Graph();
+			for (int x = 0; x < nodes.getLength(); x++) {
+				Node node = nodes.item(x);
+				if (node.getNodeType() == Node.ELEMENT_NODE) {
+					if (node.getNodeName().equalsIgnoreCase("Graphics")) {
+						dimensionNode = node;
+					} else if (node.getNodeName().equalsIgnoreCase("DataNode")) {
+						dataNodes.add(node);
+					} else if (node.getNodeName().equalsIgnoreCase("Interaction")) {
+						interactions.add(node);
+					} else if (node.getNodeName().equalsIgnoreCase("Label")) {
+						labels.add(node);
+					} else if (node.getNodeName().equalsIgnoreCase("Group")) {
+						groups.add(node);
+					} else if (node.getNodeName().equalsIgnoreCase("Attribute")) {
+						attributes.add((Element) node);
+					} else if (node.getNodeName().equalsIgnoreCase("Shape")) {
+						shapes.add(node);
+					} else if (node.getNodeName().equalsIgnoreCase("GraphicalLine")) {
+						lines.add(node);
+					} else if (node.getNodeName().equalsIgnoreCase("Comment")) {
+						graph.addComment(node.getTextContent());
+					} else if (node.getNodeName().equalsIgnoreCase("BiopaxRef")) {
+						graph.addBiopaxReferences(node.getTextContent());
+					} else if (node.getNodeName().equalsIgnoreCase("State")) {
+						states.add(node);
+					} else if (node.getNodeName().equalsIgnoreCase("Biopax")) {
+						if (biopax != null) {
+							throw new ConverterException("Biopax node should appear only once");
+						}
+						biopax = node;
+					} else if (node.getNodeName().equalsIgnoreCase("InfoBox")) {
+						// infobox can be skipped
+						continue;
+					} else if (node.getNodeName().equalsIgnoreCase("Legend")) {
+						// legend can be skipped
+						continue;
+					} else {
+						logger.warn("Unknown element of gpml file: " + node.getNodeName());
+					}
+				}
+			}
+			graph.addLines(parseLines(lines));
+			graph.addEdges(parseEdgesFromLines(lines));
+
+			if (dimensionNode != null) {
+				setSize(dimensionNode, graph);
+			}
+			addGroups(groups, graph);
+
+			graph.addDataNodes(dataNodeParser.parseCollection(dataNodes));
+			graph.addLabels(labelParser.parseCollection(labels));
+			graph.addShapes(shapeParser.parseCollection(shapes));
+			graph.addStates(stateParser.parseCollection(states));
+
+			prepareEdges(interactions, graph);
+
+			mergeEdges(graph);
+
+			addInteractions(graph);
+			if (biopax != null) {
+				graph.setBiopaxData(new BiopaxParser().parse(biopax));
+			}
+			Map<String, String> attributesMap = new HashMap<String, String>();
+			for (Element attribute : attributes) {
+				String key = attribute.getAttribute("Key");
+				String value = attribute.getAttribute("Value");
+				if (attributesMap.get(key) != null) {
+					logger.warn("Model xml contains duplicate attributes: " + key);
+				} else {
+					attributesMap.put(key, value);
+				}
+			}
+			graph.setAttributes(attributesMap);
+			return graph;
+		} catch (ParserConfigurationException e) {
+			throw new ConverterException("Problem with input data", e);
+		} catch (SAXException e) {
+			throw new ConverterException("Problem with input data", e);
+		} catch (InvalidXmlSchemaException e) {
+			throw new ConverterException("Problem with input data", e);
+		}
+	}
+
+	/**
+	 * This method merge edges that should be merged into single line.
+	 * 
+	 * @param graph
+	 *          model where edges are stored
+	 */
+	private void mergeEdges(Graph graph) {
+		List<Edge> toExtend = new ArrayList<>();
+		List<Edge> toRemove = new ArrayList<>();
+		List<Edge> toAdd = new ArrayList<>();
+		Map<String, List<Edge>> extendable = new HashMap<>();
+		for (Edge edge : graph.getEdges()) {
+			if (graph.getEdgeByAnchor(edge.getStart()) == edge) {
+				toExtend.add(edge);
+			} else if (graph.getEdgeByAnchor(edge.getEnd()) == edge) {
+				toExtend.add(edge);
+			} else if (graph.getEdgeByAnchor(edge.getEnd()) != null) {
+				List<Edge> list = extendable.get(edge.getEnd());
+				if (list == null) {
+					list = new ArrayList<>();
+					extendable.put(edge.getEnd(), list);
+				}
+				list.add(edge);
+			} else if (graph.getEdgeByAnchor(edge.getStart()) != null) {
+				List<Edge> list = extendable.get(edge.getStart());
+				if (list == null) {
+					list = new ArrayList<>();
+					extendable.put(edge.getStart(), list);
+				}
+				list.add(edge);
+			}
+
+		}
+
+		for (Edge edge : toExtend) {
+			String anchor = null;
+			if (graph.getEdgeByAnchor(edge.getStart()) == edge) {
+				anchor = edge.getStart();
+			} else if (graph.getEdgeByAnchor(edge.getEnd()) == edge) {
+				anchor = edge.getEnd();
+			}
+			List<Edge> howExtend = extendable.get(anchor);
+			if (howExtend == null) {
+				logger.warn(edge.getWarningPrefix() + " Should be connected with another element, but nothing found.");
+				if (edge.getStart().equals(anchor)) {
+					edge.setStart(null);
+				} else if (edge.getEnd().equals(anchor)) {
+					edge.setEnd(null);
+				}
+			} else if (howExtend.size() > 0) {
+				try {
+					Edge newEdge = mergeEdges(edge, howExtend.get(0));
+					toRemove.add(edge);
+					toRemove.add(howExtend.get(0));
+					toAdd.add(newEdge);
+				} catch (UnknownMergingMethodException exception) {
+					toRemove.add(edge);
+					toRemove.add(howExtend.get(0));
+
+					logger.warn(exception, exception);
+				}
+			}
+		}
+		for (Edge e : toRemove) {
+			graph.removeEdge(e);
+		}
+		for (Edge e : toAdd) {
+			graph.addEdge(e);
+		}
+	}
+
+	/**
+	 * Method that merge two {@link Edge edges}.
+	 * 
+	 * @param edge1
+	 *          first edge to merge
+	 * @param edge2
+	 *          second edge to merge
+	 * @return new edge that merges two parameters
+	 * @throws UnknownMergingMethodException
+	 *           thrown when edges cannot be merged
+	 */
+	private Edge mergeEdges(Edge edge1, Edge edge2) throws UnknownMergingMethodException {
+		MergeMapping mapping = null;
+		if (edge1.getStart() != null && edge1.getStart().equals(edge2.getStart())) {
+			mapping = MergeMapping.getMergeMappingByInteractions(edge1.getType(), true, edge2.getType(), false);
+		} else if (edge1.getStart() != null && edge1.getStart().equals(edge2.getEnd())) {
+			mapping = MergeMapping.getMergeMappingByInteractions(edge1.getType(), true, edge2.getType(), true);
+		} else if (edge1.getEnd() != null && edge1.getEnd().equals(edge2.getStart())) {
+			mapping = MergeMapping.getMergeMappingByInteractions(edge1.getType(), false, edge2.getType(), false);
+		} else if (edge1.getEnd() != null && edge1.getEnd().equals(edge2.getEnd())) {
+			mapping = MergeMapping.getMergeMappingByInteractions(edge1.getType(), false, edge2.getType(), true);
+		}
+		if (mapping == null) {
+			String message = edge1.getWarningPrefix() + edge2.getWarningPrefix() + "Don't know how to merge interactions";
+			throw new UnknownMergingMethodException(message);
+		}
+		Edge first;
+		if (mapping.isReversed1()) {
+			first = edge1.reverse();
+		} else {
+			first = new Edge(edge1);
+		}
+		Edge second;
+		if (mapping.isReversed2()) {
+			second = edge2.reverse();
+		} else {
+			second = new Edge(edge2);
+		}
+		first.extend(second);
+
+		if (!first.getLine().getType().equals(second.getLine().getType())) {
+			logger.warn(
+					first.getWarningPrefix() + second.getWarningPrefix() + " merging edges with different line types: " + first.getLine().getType() + ", "
+							+ second.getLine().getType());
+		}
+		first.setType(mapping.getResultType());
+		if (mapping.isResultReversed()) {
+			return first.reverse();
+		} else {
+			return first;
+		}
+	}
+
+	/**
+	 * Creates edges from lines when it's possible.
+	 * 
+	 * @param lines
+	 *          xml nodes with lines
+	 * @return list of edges that could be created from xml nodes
+	 */
+	private Collection<Edge> parseEdgesFromLines(List<Node> lines) {
+		List<Edge> result = new ArrayList<Edge>();
+		for (Node lNode : lines) {
+			try {
+				Edge line = edgeLineParser.parse((Element) lNode);
+				if (line.getStart() != null && line.getEnd() != null) {
+					result.add(line);
+				}
+			} catch (ConverterException e) {
+				logger.warn(e, e);
+
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Creates lines from the list of gpml xml nodes.
+	 * 
+	 * @param lines
+	 *          list of xml nodes
+	 * @return list of {@link PolylineData lines}
+	 * @throws UnknownTypeException
+	 *           thrown when the type of line defined in xml node is unknown
+	 */
+	private Collection<PolylineData> parseLines(List<Node> lines) throws UnknownTypeException {
+		List<PolylineData> result = new ArrayList<PolylineData>();
+		for (Node lNode : lines) {
+			int refs = 0;
+			PolylineData line = new PolylineData();
+			NodeList nodes = lNode.getChildNodes();
+			for (int i = 0; i < nodes.getLength(); i++) {
+				Node node = nodes.item(i);
+				if (node.getNodeType() == Node.ELEMENT_NODE) {
+					if (node.getNodeName().equalsIgnoreCase("Graphics")) {
+						NodeList nodes2 = node.getChildNodes();
+						for (int j = 0; j < nodes2.getLength(); j++) {
+							Node node2 = nodes2.item(j);
+							if (node2.getNodeType() == Node.ELEMENT_NODE) {
+								Element element = (Element) node2;
+								if (node2.getNodeName().equalsIgnoreCase("Point")) {
+									PointData point = pointParser.parse(element);
+									if (point.hasGraphRef()) {
+										refs++;
+									}
+									line.addPoint(point.toPoint());
+								} else {
+									logger.warn("Unknown node in line: " + node2.getNodeName());
+								}
+							}
+						}
+
+					} else {
+						logger.warn("Unknown node in line: " + node.getNodeName());
+					}
+				}
+			}
+			if (refs < 2) {
+				result.add(line);
+			}
+		}
+		return result;
+	}
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GraphicalPathwayElementParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GraphicalPathwayElementParser.java
index c868fdc211..787e11ba43 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GraphicalPathwayElementParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/GraphicalPathwayElementParser.java
@@ -1,77 +1,77 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.awt.font.TextAttribute;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.geometry.TextAlignment;
-import lcsb.mapviewer.wikipathway.model.GpmlLineType;
-import lcsb.mapviewer.wikipathway.model.GraphicalPathwayElement;
-import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
-
-/**
- * Parser used for extracting common data (from gpml file) for all elements
- * extending {@link GraphicalPathwayElement} class.
- * 
- * @author Piotr Gawron
- *
- * @param <T>
- */
-public abstract class GraphicalPathwayElementParser<T extends GraphicalPathwayElement> extends ElementGpmlParser<T> {
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger logger = Logger.getLogger(GraphicalPathwayElementParser.class);
-
-	/**
-	 * Parse font attributes that might appear.
-	 * 
-	 * @param element
-	 *          element where data should be put
-	 * @param attribute
-	 *          attribute to parse
-	 * @return true if element was parsed properly
-	 * @throws UnknownTypeException
-	 *           thrown when some elements contains unknown values
-	 */
-	protected boolean parseCommonGraphicAttributes(GraphicalPathwayElement element, Pair<String, String> attribute) throws UnknownTypeException {
-		switch (attribute.getLeft()) {
-			case ("LineThickness"):
-				try {
-					Double value = Double.valueOf(attribute.getRight());
-					element.setLineThickness(value);
-				} catch (NumberFormatException e) {
-					logger.warn("Invalid LineThickness: " + attribute.getRight());
-				}
-				break;
-			case ("LineStyle"):
-				element.setLineType(GpmlLineType.getByGpmlName(attribute.getRight()).getCorrespondingGlobalLineType());
-				break;
-			case ("FontStyle"):
-				element.addFontAttribute(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
-				break;
-			case ("FontName"):
-				element.setFontName(attribute.getRight());
-				break;
-			case ("Align"):
-				switch (attribute.getRight()) {
-					case ("Right"):
-						element.setTextAlignment(TextAlignment.RIGHT);
-						break;
-					case ("Left"):
-						element.setTextAlignment(TextAlignment.LEFT);
-						break;
-					default:
-						logger.warn("Unknown value of attribute: " + attribute.getLeft() + " - " + attribute.getRight());
-						break;
-				}
-				break;
-			default:
-				return false;
-		}
-		return true;
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.awt.font.TextAttribute;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.geometry.TextAlignment;
+import lcsb.mapviewer.wikipathway.model.GpmlLineType;
+import lcsb.mapviewer.wikipathway.model.GraphicalPathwayElement;
+import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
+
+/**
+ * Parser used for extracting common data (from gpml file) for all elements
+ * extending {@link GraphicalPathwayElement} class.
+ * 
+ * @author Piotr Gawron
+ *
+ * @param <T>
+ */
+public abstract class GraphicalPathwayElementParser<T extends GraphicalPathwayElement> extends ElementGpmlParser<T> {
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger logger = Logger.getLogger(GraphicalPathwayElementParser.class);
+
+	/**
+	 * Parse font attributes that might appear.
+	 * 
+	 * @param element
+	 *          element where data should be put
+	 * @param attribute
+	 *          attribute to parse
+	 * @return true if element was parsed properly
+	 * @throws UnknownTypeException
+	 *           thrown when some elements contains unknown values
+	 */
+	protected boolean parseCommonGraphicAttributes(GraphicalPathwayElement element, Pair<String, String> attribute) throws UnknownTypeException {
+		switch (attribute.getLeft()) {
+			case ("LineThickness"):
+				try {
+					Double value = Double.valueOf(attribute.getRight());
+					element.setLineThickness(value);
+				} catch (NumberFormatException e) {
+					logger.warn("Invalid LineThickness: " + attribute.getRight());
+				}
+				break;
+			case ("LineStyle"):
+				element.setLineType(GpmlLineType.getByGpmlName(attribute.getRight()).getCorrespondingGlobalLineType());
+				break;
+			case ("FontStyle"):
+				element.addFontAttribute(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
+				break;
+			case ("FontName"):
+				element.setFontName(attribute.getRight());
+				break;
+			case ("Align"):
+				switch (attribute.getRight()) {
+					case ("Right"):
+						element.setTextAlignment(TextAlignment.RIGHT);
+						break;
+					case ("Left"):
+						element.setTextAlignment(TextAlignment.LEFT);
+						break;
+					default:
+						logger.warn("Unknown value of attribute: " + attribute.getLeft() + " - " + attribute.getRight());
+						break;
+				}
+				break;
+			default:
+				return false;
+		}
+		return true;
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/LabelParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/LabelParser.java
index c7f3043a93..18cd33d369 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/LabelParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/LabelParser.java
@@ -1,178 +1,178 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.awt.geom.Rectangle2D;
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.wikipathway.model.Label;
-import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
-
-/**
- * Parser class that creates {@link Label} objects from Xml {@link Element node}
- * .
- * 
- * @author Piotr Gawron
- *
- */
-public class LabelParser extends GraphicalPathwayElementParser<Label> {
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger logger = Logger.getLogger(LabelParser.class);
-
-	@Override
-	public Label parse(Element eElement) throws UnknownTypeException {
-		if (!eElement.getNodeName().equals("Label")) {
-			throw new InvalidArgumentException(ShapeParser.class.getSimpleName() + " can parse only Label xml nodes");
-		}
-		Label label = new Label(eElement.getAttribute("GraphId"));
-
-		for (Pair<String, String> entry : getAttributes(eElement)) {
-			switch (entry.getLeft()) {
-				case ("GraphId"):
-					break;
-				case ("TextLabel"):
-					label.setTextLabel(entry.getRight());
-					break;
-				case ("GroupRef"):
-					label.setGroupRef(entry.getRight());
-					break;
-				default:
-					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
-					break;
-			}
-		}
-
-		NodeList tmpList = eElement.getChildNodes();
-		for (int j = 0; j < tmpList.getLength(); j++) {
-			Node tmpNode = tmpList.item(j);
-			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element eTmp = (Element) tmpNode;
-				switch (eTmp.getNodeName()) {
-					case ("Comment"):
-						label.addComment(eTmp.getTextContent());
-						break;
-					case ("BiopaxRef"):
-						label.addBiopaxReference(eTmp.getTextContent());
-						break;
-					case ("Graphics"):
-						parseGraphics(eTmp, label);
-						break;
-					case ("Attribute"):
-						parseAttribute(eTmp, label);
-						break;
-					default:
-						logger.warn("Unknown sub-node of " + eElement.getNodeName() + " node: " + eTmp.getNodeName());
-						break;
-				}
-			}
-		}
-
-		return label;
-	}
-
-	/**
-	 * Parse graphics xml node in the shape node.
-	 * 
-	 * @param eTmp
-	 *          xml node with graphics
-	 * @param shape
-	 *          shape where data should be added
-	 * @throws UnknownTypeException
-	 *           thrown when some elements contain unknown typevalues
-	 */
-	protected void parseGraphics(Element eTmp, Label shape) throws UnknownTypeException {
-		Double centerX = null;
-		Double centerY = null;
-		Double width = null;
-		Double height = null;
-		for (Pair<String, String> entry : getAttributes(eTmp)) {
-			if (!parseCommonGraphicAttributes(shape, entry)) {
-				switch (entry.getLeft()) {
-					case ("CenterX"):
-						centerX = Double.valueOf(entry.getRight());
-						break;
-					case ("CenterY"):
-						centerY = Double.valueOf(entry.getRight());
-						break;
-					case ("Width"):
-						width = Double.valueOf(entry.getRight());
-						break;
-					case ("Height"):
-						height = Double.valueOf(entry.getRight());
-						break;
-					case ("Color"):
-						shape.setColor(hexStringToColor(entry.getRight()));
-						break;
-					case ("FillColor"):
-						shape.setFillColor(hexStringToColor(entry.getRight()));
-						break;
-					case ("ZOrder"):
-						shape.setzOrder(Integer.valueOf(entry.getRight()));
-						break;
-					case ("FontSize"):
-						shape.setFontSize(Double.valueOf(entry.getRight()));
-						break;
-					case ("FontWeight"):
-						shape.setFontWeight(entry.getRight());
-						break;
-					case ("Valign"):
-						shape.setvAlign(entry.getRight());
-						break;
-					case ("ShapeType"):
-						shape.setShape(entry.getRight());
-						break;
-					default:
-						logger.warn("Unknown attribute of " + eTmp.getNodeName() + " node: " + entry.getLeft() + "; value: " + entry.getRight());
-						break;
-				}
-			}
-		}
-		shape.setRectangle(new Rectangle2D.Double(centerX - width / 2, centerY - height / 2, width, height));
-	}
-
-	/**
-	 * Method that parses {@link Label} xml attribute.
-	 * 
-	 * @param eTmp
-	 *          xml node with attribute
-	 * @param shape
-	 *          shape where data should be added
-	 */
-	private void parseAttribute(Element eTmp, Label shape) {
-		String key = eTmp.getAttribute("Key");
-		String value = eTmp.getAttribute("Value");
-		switch (key) {
-			case ("org.pathvisio.model.GenMAPP-Xref"):
-				// skip it when it's empty
-				if (!value.isEmpty()) {
-					logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key: " + key + "; value: " + value);
-					break;
-				}
-				break;
-			default:
-				logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key:" + key + "; value: " + value);
-				break;
-		}
-	}
-
-	@Override
-	public String toXml(Label node) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-	@Override
-	public String toXml(Collection<Label> list) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.awt.geom.Rectangle2D;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.wikipathway.model.Label;
+import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
+
+/**
+ * Parser class that creates {@link Label} objects from Xml {@link Element node}
+ * .
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class LabelParser extends GraphicalPathwayElementParser<Label> {
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger logger = Logger.getLogger(LabelParser.class);
+
+	@Override
+	public Label parse(Element eElement) throws UnknownTypeException {
+		if (!eElement.getNodeName().equals("Label")) {
+			throw new InvalidArgumentException(ShapeParser.class.getSimpleName() + " can parse only Label xml nodes");
+		}
+		Label label = new Label(eElement.getAttribute("GraphId"));
+
+		for (Pair<String, String> entry : getAttributes(eElement)) {
+			switch (entry.getLeft()) {
+				case ("GraphId"):
+					break;
+				case ("TextLabel"):
+					label.setTextLabel(entry.getRight());
+					break;
+				case ("GroupRef"):
+					label.setGroupRef(entry.getRight());
+					break;
+				default:
+					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
+					break;
+			}
+		}
+
+		NodeList tmpList = eElement.getChildNodes();
+		for (int j = 0; j < tmpList.getLength(); j++) {
+			Node tmpNode = tmpList.item(j);
+			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
+				Element eTmp = (Element) tmpNode;
+				switch (eTmp.getNodeName()) {
+					case ("Comment"):
+						label.addComment(eTmp.getTextContent());
+						break;
+					case ("BiopaxRef"):
+						label.addBiopaxReference(eTmp.getTextContent());
+						break;
+					case ("Graphics"):
+						parseGraphics(eTmp, label);
+						break;
+					case ("Attribute"):
+						parseAttribute(eTmp, label);
+						break;
+					default:
+						logger.warn("Unknown sub-node of " + eElement.getNodeName() + " node: " + eTmp.getNodeName());
+						break;
+				}
+			}
+		}
+
+		return label;
+	}
+
+	/**
+	 * Parse graphics xml node in the shape node.
+	 * 
+	 * @param eTmp
+	 *          xml node with graphics
+	 * @param shape
+	 *          shape where data should be added
+	 * @throws UnknownTypeException
+	 *           thrown when some elements contain unknown typevalues
+	 */
+	protected void parseGraphics(Element eTmp, Label shape) throws UnknownTypeException {
+		Double centerX = null;
+		Double centerY = null;
+		Double width = null;
+		Double height = null;
+		for (Pair<String, String> entry : getAttributes(eTmp)) {
+			if (!parseCommonGraphicAttributes(shape, entry)) {
+				switch (entry.getLeft()) {
+					case ("CenterX"):
+						centerX = Double.valueOf(entry.getRight());
+						break;
+					case ("CenterY"):
+						centerY = Double.valueOf(entry.getRight());
+						break;
+					case ("Width"):
+						width = Double.valueOf(entry.getRight());
+						break;
+					case ("Height"):
+						height = Double.valueOf(entry.getRight());
+						break;
+					case ("Color"):
+						shape.setColor(hexStringToColor(entry.getRight()));
+						break;
+					case ("FillColor"):
+						shape.setFillColor(hexStringToColor(entry.getRight()));
+						break;
+					case ("ZOrder"):
+						shape.setzOrder(Integer.valueOf(entry.getRight()));
+						break;
+					case ("FontSize"):
+						shape.setFontSize(Double.valueOf(entry.getRight()));
+						break;
+					case ("FontWeight"):
+						shape.setFontWeight(entry.getRight());
+						break;
+					case ("Valign"):
+						shape.setvAlign(entry.getRight());
+						break;
+					case ("ShapeType"):
+						shape.setShape(entry.getRight());
+						break;
+					default:
+						logger.warn("Unknown attribute of " + eTmp.getNodeName() + " node: " + entry.getLeft() + "; value: " + entry.getRight());
+						break;
+				}
+			}
+		}
+		shape.setRectangle(new Rectangle2D.Double(centerX - width / 2, centerY - height / 2, width, height));
+	}
+
+	/**
+	 * Method that parses {@link Label} xml attribute.
+	 * 
+	 * @param eTmp
+	 *          xml node with attribute
+	 * @param shape
+	 *          shape where data should be added
+	 */
+	private void parseAttribute(Element eTmp, Label shape) {
+		String key = eTmp.getAttribute("Key");
+		String value = eTmp.getAttribute("Value");
+		switch (key) {
+			case ("org.pathvisio.model.GenMAPP-Xref"):
+				// skip it when it's empty
+				if (!value.isEmpty()) {
+					logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key: " + key + "; value: " + value);
+					break;
+				}
+				break;
+			default:
+				logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key:" + key + "; value: " + value);
+				break;
+		}
+	}
+
+	@Override
+	public String toXml(Label node) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+	@Override
+	public String toXml(Collection<Label> list) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ModelContructor.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ModelContructor.java
index b0fbdcacd5..9e3fb20c07 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ModelContructor.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ModelContructor.java
@@ -20,6 +20,7 @@ import lcsb.mapviewer.common.EventStorageLoggerAppender;
 import lcsb.mapviewer.common.Pair;
 import lcsb.mapviewer.common.exception.InvalidArgumentException;
 import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
 import lcsb.mapviewer.converter.ConverterException;
 import lcsb.mapviewer.converter.model.celldesigner.reaction.ReactionLineData;
 import lcsb.mapviewer.converter.model.celldesigner.types.ModifierType;
@@ -320,7 +321,7 @@ public class ModelContructor {
 			model.addElement(comSpe);
 			data.id2spe.put(group.getGraphId(), comSpe);
 
-			ComplexAlias alias = new ComplexAlias();
+			ComplexAlias alias = new ComplexAlias(comSpe);
 			alias.setAliasId("al_" + group.getGraphId());
 			Rectangle2D rec = group.getRectangle();
 			if (rec == null) {
@@ -332,7 +333,6 @@ public class ModelContructor {
 			alias.setHeight(rec.getHeight());
 			alias.setColor(DEFAULT_COMPLEX_ALIAS_COLOR);
 
-			alias.setSpecies(comSpe);
 			data.id2alias.put(group.getGraphId(), alias);
 			model.addAlias(alias);
 			comSpe.setParent(data.compartment);
@@ -544,12 +544,10 @@ public class ModelContructor {
 			} else {
 				alias = new SquareCompartmentAlias();
 			}
+		} else if (species instanceof Species) {
+			alias = SpeciesAlias.createAlias((Species) species);
 		} else {
-			if (species instanceof ComplexSpecies) {
-				alias = new ComplexAlias();
-			} else {
-				alias = new SpeciesAlias();
-			}
+			throw new NotImplementedException();
 		}
 		alias.setAliasId("al_" + gpmlElement.getGraphId());
 		Rectangle2D rec = gpmlElement.getRectangle();
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/PointDataParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/PointDataParser.java
index 3538d76c4b..044c52f28b 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/PointDataParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/PointDataParser.java
@@ -1,68 +1,68 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.wikipathway.model.GpmlInteractionType;
-import lcsb.mapviewer.wikipathway.model.PointData;
-import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
-
-/**
- * Parser class that creates {@link PointData} objects from Xml {@link Element
- * node}.
- * 
- * @author Piotr Gawron
- *
- */
-public class PointDataParser extends ElementGpmlParser<PointData> {
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger logger = Logger.getLogger(PointDataParser.class);
-
-	@Override
-	public PointData parse(Element element) throws UnknownTypeException {
-		PointData result = new PointData();
-		for (Pair<String, String> entry : getAttributes(element)) {
-			switch (entry.getLeft()) {
-				case ("X"):
-					result.setX(Double.valueOf(entry.getRight()));
-					break;
-				case ("Y"):
-					result.setY(Double.valueOf(entry.getRight()));
-					break;
-				case ("GraphRef"):
-					result.setGraphRef(entry.getRight());
-					break;
-				case ("ArrowHead"):
-					result.setType(GpmlInteractionType.getTypeByGpmlString(entry.getRight()));
-					break;
-				case ("RelX"):
-					result.setRelX(entry.getRight());
-					break;
-				case ("RelY"):
-					result.setRelY(entry.getRight());
-					break;
-				default:
-					logger.warn("Unknown point attribute: " + entry.getLeft());
-			}
-		}
-		return result;
-	}
-
-	@Override
-	public String toXml(PointData node) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-	@Override
-	public String toXml(Collection<PointData> list) throws ConverterException {
-		throw new NotImplementedException();
-	}
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.wikipathway.model.GpmlInteractionType;
+import lcsb.mapviewer.wikipathway.model.PointData;
+import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
+
+/**
+ * Parser class that creates {@link PointData} objects from Xml {@link Element
+ * node}.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class PointDataParser extends ElementGpmlParser<PointData> {
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger logger = Logger.getLogger(PointDataParser.class);
+
+	@Override
+	public PointData parse(Element element) throws UnknownTypeException {
+		PointData result = new PointData();
+		for (Pair<String, String> entry : getAttributes(element)) {
+			switch (entry.getLeft()) {
+				case ("X"):
+					result.setX(Double.valueOf(entry.getRight()));
+					break;
+				case ("Y"):
+					result.setY(Double.valueOf(entry.getRight()));
+					break;
+				case ("GraphRef"):
+					result.setGraphRef(entry.getRight());
+					break;
+				case ("ArrowHead"):
+					result.setType(GpmlInteractionType.getTypeByGpmlString(entry.getRight()));
+					break;
+				case ("RelX"):
+					result.setRelX(entry.getRight());
+					break;
+				case ("RelY"):
+					result.setRelY(entry.getRight());
+					break;
+				default:
+					logger.warn("Unknown point attribute: " + entry.getLeft());
+			}
+		}
+		return result;
+	}
+
+	@Override
+	public String toXml(PointData node) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+	@Override
+	public String toXml(Collection<PointData> list) throws ConverterException {
+		throw new NotImplementedException();
+	}
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ReferenceParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ReferenceParser.java
index 74ec378fdd..e195bd18c5 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ReferenceParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ReferenceParser.java
@@ -1,162 +1,162 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.EventStorageLoggerAppender;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.wikipathway.model.ReferenceMapping;
-
-/**
- * Parser used to extract {@link MiriamData refernces} in miriam format from
- * GPML data.
- * 
- * @author Piotr Gawron
- *
- */
-public class ReferenceParser extends ElementGpmlParser<MiriamData> {
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger logger = Logger.getLogger(ReferenceParser.class);
-
-	/**
-	 * This function creates MiriamData from database name and id.
-	 * 
-	 * @param id
-	 *          - resource identifier
-	 * @param db
-	 *          -database type
-	 * @return {@link MiriamData} object referenceing to the resource
-	 */
-	protected MiriamData createMiriamData(String id, String db) {
-		if (db == null || db.equals("")) {
-			throw new InvalidArgumentException("Invalid db type: " + db);
-		} else if (id == null || id.trim().equals("")) {
-			throw new InvalidArgumentException("Invalid db resource value: " + id);
-		}
-		ReferenceMapping mapping = ReferenceMapping.getMappingByGpmlString(db);
-		MiriamType type = null;
-		if (mapping != null) {
-			type = mapping.getType();
-		} else {
-			for (MiriamType t : MiriamType.values()) {
-				if (t.getCommonName().equalsIgnoreCase(db)) {
-					type = t;
-				} else {
-					for (String uri : t.getUris()) {
-						if (uri.endsWith(db)) {
-							type = t;
-						}
-					}
-				}
-			}
-		}
-		if (type != null) {
-			return new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, type, id);
-		} else {
-			throw new NotImplementedException("This database type is not implemented yet: " + db + "; resource: " + id);
-		}
-	}
-
-	@Override
-	public MiriamData parse(Element node) {
-		String id = null;
-		String db = null;
-		for (Pair<String, String> entry : getAttributes(node)) {
-			switch (entry.getLeft()) {
-				case ("ID"):
-					id = entry.getRight();
-					break;
-				case ("Database"):
-					db = entry.getRight();
-					break;
-				default:
-					logger.warn("Unknown attribute of " + node.getNodeName() + " node: " + entry.getLeft());
-					break;
-			}
-		}
-
-		NodeList tmpList = node.getChildNodes();
-		for (int j = 0; j < tmpList.getLength(); j++) {
-			Node tmpNode = tmpList.item(j);
-			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element eTmp = (Element) tmpNode;
-				switch (eTmp.getNodeName()) {
-					default:
-						logger.warn("Unknown sub-node of " + node.getNodeName() + " node: " + eTmp.getNodeName());
-						break;
-				}
-			}
-		}
-
-		if (id != null && !id.isEmpty()) {
-			if (db == null || db.isEmpty()) {
-				logger.warn("Reference is invalid. Database identifier exists (" + id + "), but no database type is set.");
-			} else {
-				MiriamData md = createMiriamData(id, db);
-				return md;
-			}
-		}
-		return null;
-	}
-
-	@Override
-	public String toXml(MiriamData md) throws ConverterException {
-		if (md == null) {
-			return "<Xref ID=\"\" Database=\"\"/>\n";
-		} else if (MiriamType.PUBMED.equals(md.getDataType())) {
-			throw new InvalidArgumentException("Pubmed cannot be exported to XRef node.");
-		} else {
-			ReferenceMapping mapping = ReferenceMapping.getMappingByMiriamType(md.getDataType());
-			if (mapping == null) {
-				throw new InvalidArgumentException("Don't know how to export " + md.getDataType() + " annotation.");
-			} else if (mapping.getGpmlString() == null) {
-				logger.warn(md.getDataType().getCommonName() + " annotation is not supported by GPML");
-				return "";
-			} else {
-				return "<Xref ID=\"" + md.getResource() + "\" Database=\"" + mapping.getGpmlString() + "\"/>\n";
-			}
-		}
-	}
-
-	@Override
-	public String toXml(Collection<MiriamData> miriamData) throws ConverterException {
-		StringBuilder result = new StringBuilder("");
-		int counter = 0;
-		for (MiriamData md : miriamData) {
-			if (!md.getDataType().equals(MiriamType.PUBMED)) {
-				counter++;
-				if (counter == 1) {
-					EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
-					try {
-						Logger.getRootLogger().addAppender(appender);
-						result.append(toXml(md));
-						if (appender.getWarnings().size() > 0) {
-							counter--;
-						}
-					} finally {
-						Logger.getRootLogger().removeAppender(appender);
-					}
-				} else {
-					logger.warn("Annotation ommited - gpml support only one annotation per element: " + md.getDataType() + ": " + md.getResource());
-				}
-			}
-		}
-		if (counter == 0) {
-			return toXml((MiriamData) null);
-		}
-		return result.toString();
-	}
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.EventStorageLoggerAppender;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.wikipathway.model.ReferenceMapping;
+
+/**
+ * Parser used to extract {@link MiriamData refernces} in miriam format from
+ * GPML data.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class ReferenceParser extends ElementGpmlParser<MiriamData> {
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger logger = Logger.getLogger(ReferenceParser.class);
+
+	/**
+	 * This function creates MiriamData from database name and id.
+	 * 
+	 * @param id
+	 *          - resource identifier
+	 * @param db
+	 *          -database type
+	 * @return {@link MiriamData} object referenceing to the resource
+	 */
+	protected MiriamData createMiriamData(String id, String db) {
+		if (db == null || db.equals("")) {
+			throw new InvalidArgumentException("Invalid db type: " + db);
+		} else if (id == null || id.trim().equals("")) {
+			throw new InvalidArgumentException("Invalid db resource value: " + id);
+		}
+		ReferenceMapping mapping = ReferenceMapping.getMappingByGpmlString(db);
+		MiriamType type = null;
+		if (mapping != null) {
+			type = mapping.getType();
+		} else {
+			for (MiriamType t : MiriamType.values()) {
+				if (t.getCommonName().equalsIgnoreCase(db)) {
+					type = t;
+				} else {
+					for (String uri : t.getUris()) {
+						if (uri.endsWith(db)) {
+							type = t;
+						}
+					}
+				}
+			}
+		}
+		if (type != null) {
+			return new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, type, id);
+		} else {
+			throw new NotImplementedException("This database type is not implemented yet: " + db + "; resource: " + id);
+		}
+	}
+
+	@Override
+	public MiriamData parse(Element node) {
+		String id = null;
+		String db = null;
+		for (Pair<String, String> entry : getAttributes(node)) {
+			switch (entry.getLeft()) {
+				case ("ID"):
+					id = entry.getRight();
+					break;
+				case ("Database"):
+					db = entry.getRight();
+					break;
+				default:
+					logger.warn("Unknown attribute of " + node.getNodeName() + " node: " + entry.getLeft());
+					break;
+			}
+		}
+
+		NodeList tmpList = node.getChildNodes();
+		for (int j = 0; j < tmpList.getLength(); j++) {
+			Node tmpNode = tmpList.item(j);
+			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
+				Element eTmp = (Element) tmpNode;
+				switch (eTmp.getNodeName()) {
+					default:
+						logger.warn("Unknown sub-node of " + node.getNodeName() + " node: " + eTmp.getNodeName());
+						break;
+				}
+			}
+		}
+
+		if (id != null && !id.isEmpty()) {
+			if (db == null || db.isEmpty()) {
+				logger.warn("Reference is invalid. Database identifier exists (" + id + "), but no database type is set.");
+			} else {
+				MiriamData md = createMiriamData(id, db);
+				return md;
+			}
+		}
+		return null;
+	}
+
+	@Override
+	public String toXml(MiriamData md) throws ConverterException {
+		if (md == null) {
+			return "<Xref ID=\"\" Database=\"\"/>\n";
+		} else if (MiriamType.PUBMED.equals(md.getDataType())) {
+			throw new InvalidArgumentException("Pubmed cannot be exported to XRef node.");
+		} else {
+			ReferenceMapping mapping = ReferenceMapping.getMappingByMiriamType(md.getDataType());
+			if (mapping == null) {
+				throw new InvalidArgumentException("Don't know how to export " + md.getDataType() + " annotation.");
+			} else if (mapping.getGpmlString() == null) {
+				logger.warn(md.getDataType().getCommonName() + " annotation is not supported by GPML");
+				return "";
+			} else {
+				return "<Xref ID=\"" + md.getResource() + "\" Database=\"" + mapping.getGpmlString() + "\"/>\n";
+			}
+		}
+	}
+
+	@Override
+	public String toXml(Collection<MiriamData> miriamData) throws ConverterException {
+		StringBuilder result = new StringBuilder("");
+		int counter = 0;
+		for (MiriamData md : miriamData) {
+			if (!md.getDataType().equals(MiriamType.PUBMED)) {
+				counter++;
+				if (counter == 1) {
+					EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
+					try {
+						Logger.getRootLogger().addAppender(appender);
+						result.append(toXml(md));
+						if (appender.getWarnings().size() > 0) {
+							counter--;
+						}
+					} finally {
+						Logger.getRootLogger().removeAppender(appender);
+					}
+				} else {
+					logger.warn("Annotation ommited - gpml support only one annotation per element: " + md.getDataType() + ": " + md.getResource());
+				}
+			}
+		}
+		if (counter == 0) {
+			return toXml((MiriamData) null);
+		}
+		return result.toString();
+	}
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ShapeParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ShapeParser.java
index 20602560e8..7e72c869f7 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ShapeParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ShapeParser.java
@@ -1,196 +1,196 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.awt.font.TextAttribute;
-import java.awt.geom.Rectangle2D;
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.model.graphics.LineType;
-import lcsb.mapviewer.wikipathway.model.Shape;
-import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
-
-/**
- * Parser class that creates {@link Shape} objects from Xml {@link Element node}
- * .
- * 
- * @author Piotr Gawron
- *
- */
-public class ShapeParser extends GraphicalPathwayElementParser<Shape> {
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger logger = Logger.getLogger(ShapeParser.class);
-
-	@Override
-	public Shape parse(Element eElement) throws ConverterException {
-		if (!eElement.getNodeName().equals("Shape")) {
-			throw new InvalidArgumentException(ShapeParser.class.getSimpleName() + " can parse only Shape xml nodes");
-		}
-		Shape shape = new Shape(eElement.getAttribute("GraphId"));
-		for (Pair<String, String> entry : getAttributes(eElement)) {
-			switch (entry.getLeft()) {
-				case ("GraphId"):
-					break;
-				case ("TextLabel"):
-					shape.setTextLabel(entry.getRight());
-					break;
-				case ("GroupRef"):
-					shape.setGroupRef(entry.getRight());
-					break;
-				default:
-					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
-					break;
-			}
-		}
-
-		NodeList tmpList = eElement.getChildNodes();
-		for (int j = 0; j < tmpList.getLength(); j++) {
-			Node tmpNode = tmpList.item(j);
-			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element eTmp = (Element) tmpNode;
-				switch (eTmp.getNodeName()) {
-					case ("Graphics"):
-						parseGraphics(eTmp, shape);
-						break;
-					case ("Attribute"):
-						parseAttribute(eTmp, shape);
-						break;
-					case ("Comment"):
-						shape.addComment(eTmp.getTextContent());
-						break;
-					case ("BiopaxRef"):
-						shape.addBiopaxReference(eTmp.getTextContent());
-						break;
-					default:
-						logger.warn("Unknown sub-node of " + eElement.getNodeName() + " node: " + eTmp.getNodeName());
-						break;
-				}
-			}
-		}
-		return shape;
-	}
-
-	/**
-	 * Method that parses {@link Shape} xml attribute.
-	 * 
-	 * @param eTmp
-	 *          xml node with attribute
-	 * @param shape
-	 *          shape where data should be added
-	 */
-	private void parseAttribute(Element eTmp, Shape shape) {
-		String key = eTmp.getAttribute("Key");
-		String value = eTmp.getAttribute("Value");
-		switch (key) {
-			case ("org.pathvisio.CellularComponentProperty"):
-				shape.setCompartment(true);
-				break;
-			case ("org.pathvisio.DoubleLineProperty"):
-				switch (value) {
-					case ("Double"):
-						shape.setLineType(LineType.DOUBLE);
-						break;
-					default:
-						logger.warn(shape.getWarningPrefix() + "Unknown line type: " + value);
-						break;
-				}
-				break;
-			default:
-				logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key:" + key + "; value: " + value);
-				break;
-		}
-	}
-
-	/**
-	 * Parse graphics xml node in the shape node.
-	 * 
-	 * @param eTmp
-	 *          xml node with graphics
-	 * @param shape
-	 *          shape where data should be added
-	 * @throws UnknownTypeException
-	 *           thrown when some types in the xml node are unknown
-	 */
-	private void parseGraphics(Element eTmp, Shape shape) throws UnknownTypeException {
-		Double centerX = null;
-		Double centerY = null;
-		Double width = null;
-		Double height = null;
-		for (Pair<String, String> entry : getAttributes(eTmp)) {
-			if (!parseCommonGraphicAttributes(shape, entry)) {
-				switch (entry.getLeft()) {
-					case ("CenterX"):
-						centerX = Double.valueOf(entry.getRight());
-						break;
-					case ("CenterY"):
-						centerY = Double.valueOf(entry.getRight());
-						break;
-					case ("Width"):
-						width = Double.valueOf(entry.getRight());
-						break;
-					case ("Height"):
-						height = Double.valueOf(entry.getRight());
-						break;
-					case ("ShapeType"):
-						shape.setShape(entry.getRight());
-						break;
-					case ("Color"):
-						shape.setColor(hexStringToColor(entry.getRight()));
-						break;
-					case ("FillColor"):
-						shape.setFillColor(hexStringToColor(entry.getRight()));
-						break;
-					case ("ZOrder"):
-						shape.setzOrder(Integer.valueOf(entry.getRight()));
-						break;
-					case ("FontSize"):
-						shape.setFontSize(Double.valueOf(entry.getRight()));
-						break;
-					case ("LineThickness"):
-						shape.setLineThickness(Double.valueOf(entry.getRight()));
-						break;
-					case ("Valign"):
-						shape.setvAlign(entry.getRight());
-						break;
-					case ("FontWeight"):
-						switch (entry.getRight()) {
-							case ("Bold"):
-								shape.addFontAttribute(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
-								break;
-							default:
-								logger.warn("Unknown value of attribute: " + entry.getLeft() + " - " + entry.getRight());
-								break;
-						}
-						break;
-					case ("Rotation"):
-						shape.setRotation(Double.valueOf(entry.getRight()));
-						break;
-					default:
-						logger.warn("Unknown attribute of " + eTmp.getNodeName() + " node: " + entry.getLeft());
-						break;
-				}
-			}
-		}
-		shape.setRectangle(new Rectangle2D.Double(centerX - width / 2, centerY - height / 2, width, height));
-	}
-
-	@Override
-	public String toXml(Shape node) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-	@Override
-	public String toXml(Collection<Shape> list) throws ConverterException {
-		throw new NotImplementedException();
-	}
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.awt.font.TextAttribute;
+import java.awt.geom.Rectangle2D;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.model.graphics.LineType;
+import lcsb.mapviewer.wikipathway.model.Shape;
+import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
+
+/**
+ * Parser class that creates {@link Shape} objects from Xml {@link Element node}
+ * .
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class ShapeParser extends GraphicalPathwayElementParser<Shape> {
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger logger = Logger.getLogger(ShapeParser.class);
+
+	@Override
+	public Shape parse(Element eElement) throws ConverterException {
+		if (!eElement.getNodeName().equals("Shape")) {
+			throw new InvalidArgumentException(ShapeParser.class.getSimpleName() + " can parse only Shape xml nodes");
+		}
+		Shape shape = new Shape(eElement.getAttribute("GraphId"));
+		for (Pair<String, String> entry : getAttributes(eElement)) {
+			switch (entry.getLeft()) {
+				case ("GraphId"):
+					break;
+				case ("TextLabel"):
+					shape.setTextLabel(entry.getRight());
+					break;
+				case ("GroupRef"):
+					shape.setGroupRef(entry.getRight());
+					break;
+				default:
+					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
+					break;
+			}
+		}
+
+		NodeList tmpList = eElement.getChildNodes();
+		for (int j = 0; j < tmpList.getLength(); j++) {
+			Node tmpNode = tmpList.item(j);
+			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
+				Element eTmp = (Element) tmpNode;
+				switch (eTmp.getNodeName()) {
+					case ("Graphics"):
+						parseGraphics(eTmp, shape);
+						break;
+					case ("Attribute"):
+						parseAttribute(eTmp, shape);
+						break;
+					case ("Comment"):
+						shape.addComment(eTmp.getTextContent());
+						break;
+					case ("BiopaxRef"):
+						shape.addBiopaxReference(eTmp.getTextContent());
+						break;
+					default:
+						logger.warn("Unknown sub-node of " + eElement.getNodeName() + " node: " + eTmp.getNodeName());
+						break;
+				}
+			}
+		}
+		return shape;
+	}
+
+	/**
+	 * Method that parses {@link Shape} xml attribute.
+	 * 
+	 * @param eTmp
+	 *          xml node with attribute
+	 * @param shape
+	 *          shape where data should be added
+	 */
+	private void parseAttribute(Element eTmp, Shape shape) {
+		String key = eTmp.getAttribute("Key");
+		String value = eTmp.getAttribute("Value");
+		switch (key) {
+			case ("org.pathvisio.CellularComponentProperty"):
+				shape.setCompartment(true);
+				break;
+			case ("org.pathvisio.DoubleLineProperty"):
+				switch (value) {
+					case ("Double"):
+						shape.setLineType(LineType.DOUBLE);
+						break;
+					default:
+						logger.warn(shape.getWarningPrefix() + "Unknown line type: " + value);
+						break;
+				}
+				break;
+			default:
+				logger.warn(shape.getWarningPrefix() + "Unknown attribute of node. Key:" + key + "; value: " + value);
+				break;
+		}
+	}
+
+	/**
+	 * Parse graphics xml node in the shape node.
+	 * 
+	 * @param eTmp
+	 *          xml node with graphics
+	 * @param shape
+	 *          shape where data should be added
+	 * @throws UnknownTypeException
+	 *           thrown when some types in the xml node are unknown
+	 */
+	private void parseGraphics(Element eTmp, Shape shape) throws UnknownTypeException {
+		Double centerX = null;
+		Double centerY = null;
+		Double width = null;
+		Double height = null;
+		for (Pair<String, String> entry : getAttributes(eTmp)) {
+			if (!parseCommonGraphicAttributes(shape, entry)) {
+				switch (entry.getLeft()) {
+					case ("CenterX"):
+						centerX = Double.valueOf(entry.getRight());
+						break;
+					case ("CenterY"):
+						centerY = Double.valueOf(entry.getRight());
+						break;
+					case ("Width"):
+						width = Double.valueOf(entry.getRight());
+						break;
+					case ("Height"):
+						height = Double.valueOf(entry.getRight());
+						break;
+					case ("ShapeType"):
+						shape.setShape(entry.getRight());
+						break;
+					case ("Color"):
+						shape.setColor(hexStringToColor(entry.getRight()));
+						break;
+					case ("FillColor"):
+						shape.setFillColor(hexStringToColor(entry.getRight()));
+						break;
+					case ("ZOrder"):
+						shape.setzOrder(Integer.valueOf(entry.getRight()));
+						break;
+					case ("FontSize"):
+						shape.setFontSize(Double.valueOf(entry.getRight()));
+						break;
+					case ("LineThickness"):
+						shape.setLineThickness(Double.valueOf(entry.getRight()));
+						break;
+					case ("Valign"):
+						shape.setvAlign(entry.getRight());
+						break;
+					case ("FontWeight"):
+						switch (entry.getRight()) {
+							case ("Bold"):
+								shape.addFontAttribute(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
+								break;
+							default:
+								logger.warn("Unknown value of attribute: " + entry.getLeft() + " - " + entry.getRight());
+								break;
+						}
+						break;
+					case ("Rotation"):
+						shape.setRotation(Double.valueOf(entry.getRight()));
+						break;
+					default:
+						logger.warn("Unknown attribute of " + eTmp.getNodeName() + " node: " + entry.getLeft());
+						break;
+				}
+			}
+		}
+		shape.setRectangle(new Rectangle2D.Double(centerX - width / 2, centerY - height / 2, width, height));
+	}
+
+	@Override
+	public String toXml(Shape node) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+	@Override
+	public String toXml(Collection<Shape> list) throws ConverterException {
+		throw new NotImplementedException();
+	}
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/StateParser.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/StateParser.java
index 9117268a8a..33fe1a1ecb 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/StateParser.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/StateParser.java
@@ -1,171 +1,171 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.wikipathway.model.GpmlModificationType;
-import lcsb.mapviewer.wikipathway.model.GpmlStateType;
-import lcsb.mapviewer.wikipathway.model.State;
-import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
-
-/**
- * Parser class that creates {@link State} objects from Xml {@link Element node}
- * .
- * 
- * @author Piotr Gawron
- *
- */
-public class StateParser extends ElementGpmlParser<State> {
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger		logger					= Logger.getLogger(StateParser.class);
-
-	/**
-	 * Parser used for extracting {@link lcsb.mapviewer.model.map.MiriamData
-	 * references} from GPML model.
-	 */
-	private ReferenceParser	referenceParser	= new ReferenceParser();
-
-	@Override
-	public State parse(Element eElement) throws ConverterException {
-		if (!eElement.getNodeName().equals("State")) {
-			throw new InvalidArgumentException(StateParser.class.getSimpleName() + " can parse only State xml nodes");
-		}
-		State state = new State(eElement.getAttribute("GraphId"));
-		for (Pair<String, String> entry : getAttributes(eElement)) {
-			switch (entry.getLeft()) {
-				case ("GraphId"):
-					break;
-				case ("TextLabel"):
-					try {
-						GpmlModificationType type = GpmlModificationType.getByGpmlName(entry.getRight());
-						state.setType(type.getCorrespondingModificationState());
-					} catch (UnknownTypeException e) {
-						try {
-							GpmlStateType type = GpmlStateType.getByGpmlName(entry.getRight());
-							state.setStructuralState(type.getStringRepresenation());
-						} catch (UnknownTypeException e2) {
-							throw new ConverterException("Unknown state type: " + entry.getRight());
-						}
-					}
-					break;
-				case ("GraphRef"):
-					state.setGraphRef(entry.getRight());
-					break;
-				default:
-					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
-					break;
-			}
-		}
-
-		NodeList tmpList = eElement.getChildNodes();
-		for (int j = 0; j < tmpList.getLength(); j++) {
-			Node tmpNode = tmpList.item(j);
-			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
-				Element eTmp = (Element) tmpNode;
-				switch (eTmp.getNodeName()) {
-					case ("Comment"):
-						state.addComment(eTmp.getTextContent());
-						break;
-					case ("Graphics"):
-						parseGraphics(eTmp, state);
-						break;
-					case ("Attribute"):
-						parseAttribute(eTmp, state);
-						break;
-					case ("BiopaxRef"):
-						state.addBiopaxReference(eTmp.getTextContent());
-						break;
-					case ("Xref"):
-						MiriamData md = referenceParser.parse(eTmp);
-						if (md != null) {
-							state.addReference(md);
-						}
-						break;
-					default:
-						logger.warn("Unknown sub-node of " + eElement.getNodeName() + " node: " + eTmp.getNodeName());
-						break;
-				}
-			}
-		}
-		return state;
-	}
-
-	/**
-	 * Parse graphics xml node in the state node.
-	 * 
-	 * @param eTmp
-	 *          xml node with graphics
-	 * @param state
-	 *          state where data should be added
-	 * @throws UnknownTypeException
-	 *           thrown when some types in the xml node are unknown
-	 */
-	private void parseGraphics(Element eTmp, State state) throws UnknownTypeException {
-		for (Pair<String, String> entry : getAttributes(eTmp)) {
-			switch (entry.getLeft()) {
-				case ("RelX"):
-					state.setRelX(Double.valueOf(entry.getRight()));
-					break;
-				case ("RelY"):
-					state.setRelY(Double.valueOf(entry.getRight()));
-					break;
-				case ("Width"):
-					state.setWidth(Double.valueOf(entry.getRight()));
-					break;
-				case ("Height"):
-					state.setHeight(Double.valueOf(entry.getRight()));
-					break;
-				case ("ShapeType"):
-					state.setShape(entry.getRight());
-					break;
-				case ("FillColor"):
-					state.setFillColor(hexStringToColor(entry.getRight()));
-					break;
-				default:
-					logger.warn("Unknown attribute of " + eTmp.getNodeName() + " node: " + entry.getLeft());
-					break;
-			}
-		}
-	}
-
-	/**
-	 * Method that parses {@link State} xml attribute.
-	 * 
-	 * @param eTmp
-	 *          xml node with attribute
-	 * @param state
-	 *          state where data should be added
-	 */
-	private void parseAttribute(Element eTmp, State state) {
-		String key = eTmp.getAttribute("Key");
-		String value = eTmp.getAttribute("Value");
-		switch (key) {
-			default:
-				logger.warn(state.getWarningPrefix() + "Unknown attribute of node. Key:" + key + "; value: " + value);
-				break;
-		}
-	}
-
-	@Override
-	public String toXml(State node) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-	@Override
-	public String toXml(Collection<State> list) throws ConverterException {
-		throw new NotImplementedException();
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.wikipathway.model.GpmlModificationType;
+import lcsb.mapviewer.wikipathway.model.GpmlStateType;
+import lcsb.mapviewer.wikipathway.model.State;
+import lcsb.mapviewer.wikipathway.model.UnknownTypeException;
+
+/**
+ * Parser class that creates {@link State} objects from Xml {@link Element node}
+ * .
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class StateParser extends ElementGpmlParser<State> {
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger		logger					= Logger.getLogger(StateParser.class);
+
+	/**
+	 * Parser used for extracting {@link lcsb.mapviewer.model.map.MiriamData
+	 * references} from GPML model.
+	 */
+	private ReferenceParser	referenceParser	= new ReferenceParser();
+
+	@Override
+	public State parse(Element eElement) throws ConverterException {
+		if (!eElement.getNodeName().equals("State")) {
+			throw new InvalidArgumentException(StateParser.class.getSimpleName() + " can parse only State xml nodes");
+		}
+		State state = new State(eElement.getAttribute("GraphId"));
+		for (Pair<String, String> entry : getAttributes(eElement)) {
+			switch (entry.getLeft()) {
+				case ("GraphId"):
+					break;
+				case ("TextLabel"):
+					try {
+						GpmlModificationType type = GpmlModificationType.getByGpmlName(entry.getRight());
+						state.setType(type.getCorrespondingModificationState());
+					} catch (UnknownTypeException e) {
+						try {
+							GpmlStateType type = GpmlStateType.getByGpmlName(entry.getRight());
+							state.setStructuralState(type.getStringRepresenation());
+						} catch (UnknownTypeException e2) {
+							throw new ConverterException("Unknown state type: " + entry.getRight());
+						}
+					}
+					break;
+				case ("GraphRef"):
+					state.setGraphRef(entry.getRight());
+					break;
+				default:
+					logger.warn("Unknown attribute of " + eElement.getNodeName() + " node: " + entry.getLeft());
+					break;
+			}
+		}
+
+		NodeList tmpList = eElement.getChildNodes();
+		for (int j = 0; j < tmpList.getLength(); j++) {
+			Node tmpNode = tmpList.item(j);
+			if (tmpNode.getNodeType() == Node.ELEMENT_NODE) {
+				Element eTmp = (Element) tmpNode;
+				switch (eTmp.getNodeName()) {
+					case ("Comment"):
+						state.addComment(eTmp.getTextContent());
+						break;
+					case ("Graphics"):
+						parseGraphics(eTmp, state);
+						break;
+					case ("Attribute"):
+						parseAttribute(eTmp, state);
+						break;
+					case ("BiopaxRef"):
+						state.addBiopaxReference(eTmp.getTextContent());
+						break;
+					case ("Xref"):
+						MiriamData md = referenceParser.parse(eTmp);
+						if (md != null) {
+							state.addReference(md);
+						}
+						break;
+					default:
+						logger.warn("Unknown sub-node of " + eElement.getNodeName() + " node: " + eTmp.getNodeName());
+						break;
+				}
+			}
+		}
+		return state;
+	}
+
+	/**
+	 * Parse graphics xml node in the state node.
+	 * 
+	 * @param eTmp
+	 *          xml node with graphics
+	 * @param state
+	 *          state where data should be added
+	 * @throws UnknownTypeException
+	 *           thrown when some types in the xml node are unknown
+	 */
+	private void parseGraphics(Element eTmp, State state) throws UnknownTypeException {
+		for (Pair<String, String> entry : getAttributes(eTmp)) {
+			switch (entry.getLeft()) {
+				case ("RelX"):
+					state.setRelX(Double.valueOf(entry.getRight()));
+					break;
+				case ("RelY"):
+					state.setRelY(Double.valueOf(entry.getRight()));
+					break;
+				case ("Width"):
+					state.setWidth(Double.valueOf(entry.getRight()));
+					break;
+				case ("Height"):
+					state.setHeight(Double.valueOf(entry.getRight()));
+					break;
+				case ("ShapeType"):
+					state.setShape(entry.getRight());
+					break;
+				case ("FillColor"):
+					state.setFillColor(hexStringToColor(entry.getRight()));
+					break;
+				default:
+					logger.warn("Unknown attribute of " + eTmp.getNodeName() + " node: " + entry.getLeft());
+					break;
+			}
+		}
+	}
+
+	/**
+	 * Method that parses {@link State} xml attribute.
+	 * 
+	 * @param eTmp
+	 *          xml node with attribute
+	 * @param state
+	 *          state where data should be added
+	 */
+	private void parseAttribute(Element eTmp, State state) {
+		String key = eTmp.getAttribute("Key");
+		String value = eTmp.getAttribute("Value");
+		switch (key) {
+			default:
+				logger.warn(state.getWarningPrefix() + "Unknown attribute of node. Key:" + key + "; value: " + value);
+				break;
+		}
+	}
+
+	@Override
+	public String toXml(State node) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+	@Override
+	public String toXml(Collection<State> list) throws ConverterException {
+		throw new NotImplementedException();
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/Edge.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/Edge.java
index 82f6247a32..4818da24d1 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/Edge.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/Edge.java
@@ -1,469 +1,469 @@
-package lcsb.mapviewer.wikipathway.model;
-
-import java.awt.Color;
-import java.awt.geom.Point2D;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.MiriamData;
-
-/**
- * Support class for Interaction between elements. It stores data parsed from
- * GPML.
- * 
- * @author Jan Badura
- * @author Piotr Gawron
- * 
- */
-public class Edge implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long			 serialVersionUID	= 1L;
-
-	/**
-	 * Epsilon valu used for comparison of doubles.
-	 */
-	private static final Double		 EPSILON					= 1e-6;
-
-	/**
-	 * Default class logger.
-	 */
-	private final transient Logger logger						= Logger.getLogger(Edge.class);
-
-	/**
-	 * Identifier in gpml model.
-	 */
-	private String								 graphId;
-
-	/**
-	 * In which group this edge is located.
-	 */
-	private String								 groupRef;
-
-	/**
-	 * Where this {@link Edge} starts (in which {@link Edge}/{@link Interaction}).
-	 */
-	private String								 start;
-
-	/**
-	 * Where this {@link Edge} ends (in which {@link Edge}/{@link Interaction}).
-	 */
-	private String								 end;
-
-	/**
-	 * Z-order of the line (how much to front it should be located).
-	 */
-	private Integer								 zOrder;
-
-	/**
-	 * Line representing this edge.
-	 */
-	private PolylineData					 line							= new PolylineData();
-
-	/**
-	 * Gpml interaction type (arrow).
-	 */
-	private GpmlInteractionType		 type							= GpmlInteractionType.LINE;
-
-	/**
-	 * References for given edge.
-	 */
-	private List<MiriamData>			 references				= new ArrayList<>();
-
-	/**
-	 * List of anchors placed on the edge.
-	 */
-	private Set<String>						 anchors					= new HashSet<>();
-
-	/**
-	 * Comments.
-	 */
-	private List<String>					 comments					= new ArrayList<>();
-
-	/**
-	 * List of identifiers used by biopax nodes that are inside gpml. These biopax
-	 * nodes contain annotations.
-	 */
-	private List<String>					 biopaxReferences	= new ArrayList<String>();
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param graphId
-	 *          {@link #graphId}
-	 */
-	public Edge(String graphId) {
-		this.graphId = graphId;
-	}
-
-	/**
-	 * Creates new instance that contains the same data as the parameter object.
-	 * 
-	 * @param original
-	 *          original object from which data is being copied
-	 */
-	public Edge(Edge original) {
-		this.graphId = original.getGraphId();
-		this.groupRef = original.getGroupRef();
-		this.start = original.getStart();
-		this.end = original.getEnd();
-		this.line = new PolylineData(original.getLine());
-		this.type = original.getType();
-		for (MiriamData md : original.getReferences()) {
-			addReference(new MiriamData(md));
-		}
-		this.anchors.addAll(original.getAnchors());
-		this.comments.addAll(original.getComments());
-		this.biopaxReferences.addAll(original.getBiopaxReferences());
-		this.zOrder = original.getzOrder();
-	}
-
-	/**
-	 * Empty constructor that should be used only by serialization tools and
-	 * subclasses.
-	 */
-	protected Edge() {
-	}
-
-	/**
-	 * Adds reference to the object.
-	 * 
-	 * @param reference
-	 *          reference to add
-	 */
-	public void addReference(MiriamData reference) {
-		references.add(reference);
-	}
-
-	/**
-	 * Adds anchor to {@link #anchors}.
-	 * 
-	 * @param anchor
-	 *          object to add
-	 */
-	public void addAnchor(String anchor) {
-		this.anchors.add(anchor);
-	}
-
-	/**
-	 * @return the graphId
-	 * @see #graphId
-	 */
-	public String getGraphId() {
-		return graphId;
-	}
-
-	/**
-	 * @param graphId
-	 *          the graphId to set
-	 * @see #graphId
-	 */
-	public void setGraphId(String graphId) {
-		this.graphId = graphId;
-	}
-
-	/**
-	 * @return the start
-	 * @see #start
-	 */
-	public String getStart() {
-		return start;
-	}
-
-	/**
-	 * @param start
-	 *          the start to set
-	 * @see #start
-	 */
-	public void setStart(String start) {
-		this.start = start;
-	}
-
-	/**
-	 * @return the end
-	 * @see #end
-	 */
-	public String getEnd() {
-		return end;
-	}
-
-	/**
-	 * @param end
-	 *          the end to set
-	 * @see #end
-	 */
-	public void setEnd(String end) {
-		this.end = end;
-	}
-
-	/**
-	 * @return the line
-	 * @see #line
-	 */
-	public PolylineData getLine() {
-		return line;
-	}
-
-	/**
-	 * @param line
-	 *          the line to set
-	 * @see #line
-	 */
-	public void setLine(PolylineData line) {
-		this.line = line;
-	}
-
-	/**
-	 * @return the anchors
-	 * @see #anchors
-	 */
-	public Set<String> getAnchors() {
-		return anchors;
-	}
-
-	/**
-	 * @param anchors
-	 *          the anchors to set
-	 * @see #anchors
-	 */
-	public void setAnchors(Set<String> anchors) {
-		this.anchors = anchors;
-	}
-
-	/**
-	 * @return the comments
-	 * @see #comments
-	 */
-	public List<String> getComments() {
-		return comments;
-	}
-
-	/**
-	 * @param comment
-	 *          the comment to add
-	 * @see #comment
-	 */
-	public void addComment(String comment) {
-		this.comments.add(comment);
-	}
-
-	/**
-	 * @return the biopaxReferences
-	 * @see #biopaxReferences
-	 */
-	public List<String> getBiopaxReferences() {
-		return biopaxReferences;
-	}
-
-	/**
-	 * @param biopaxReferences
-	 *          the biopaxReferences to set
-	 * @see #biopaxReferences
-	 */
-	public void setBiopaxReferences(List<String> biopaxReferences) {
-		this.biopaxReferences = biopaxReferences;
-	}
-
-	/**
-	 * Returns a prefix that should be used in warnings.
-	 * 
-	 * @return string that identifies element in logs
-	 */
-	public String getWarningPrefix() {
-		return "[" + getType() + ", id: " + getGraphId() + "]\t";
-	}
-
-	/**
-	 * @return the type
-	 * @see #type
-	 */
-	public GpmlInteractionType getType() {
-		return type;
-	}
-
-	/**
-	 * @param type
-	 *          the type to set
-	 * @see #type
-	 */
-	public void setType(GpmlInteractionType type) {
-		if (type != null) {
-			this.type = type;
-		}
-	}
-
-	/**
-	 * Reverse direction of edge (order of elements).
-	 * 
-	 * @return copy of the object that is reversed
-	 */
-	public Edge reverse() {
-		Edge result = new Edge(this);
-		result.setLine(result.getLine().reverse());
-		String tmp = result.getStart();
-		result.setStart(result.getEnd());
-		result.setEnd(tmp);
-
-		return result;
-	}
-
-	/**
-	 * @return the references
-	 * @see #references
-	 */
-	public List<MiriamData> getReferences() {
-		return references;
-	}
-
-	/**
-	 * @param references
-	 *          the references to set
-	 * @see #references
-	 */
-	public void setReferences(List<MiriamData> references) {
-		this.references = references;
-	}
-
-	/**
-	 * Adds set of references.
-	 * 
-	 * @param references
-	 *          references to add
-	 */
-	public void addReferences(List<MiriamData> references) {
-		for (MiriamData miriamData : references) {
-			addReference(miriamData);
-		}
-	}
-
-	/**
-	 * This method extend edge (the line) by adding data from the edge in
-	 * parameter.
-	 * 
-	 * @param edge2
-	 *          edge that should be used for extension
-	 */
-	public void extend(Edge edge2) {
-		// check if extension make sense (they should point to the same identifier)
-		if (!getEnd().equals(edge2.getStart())) {
-			throw new InvalidArgumentException(
-					getWarningPrefix() + edge2.getWarningPrefix() + " Cannot merge - anchor points doesn't match: " + getEnd() + "," + edge2.getStart());
-		}
-
-		if (line.getEndPoint().distance(edge2.getLine().getBeginPoint()) > EPSILON) {
-			throw new InvalidArgumentException(
-					getWarningPrefix() + edge2.getWarningPrefix() + " Cannot merge - edges are far from each other: " + line.getEndPoint() + ","
-							+ edge2.getLine().getBeginPoint());
-		}
-
-		// graphId should be the same
-
-		// start should be taken from the original
-
-		// end should be taken from the extension
-		setEnd(edge2.getEnd());
-
-		// add points
-		for (int i = 1; i < edge2.getLine().getPoints().size(); i++) {
-			Point2D p = (Point2D) edge2.getLine().getPoints().get(i).clone();
-			line.addPoint(p);
-		}
-
-		// skip type
-
-		for (MiriamData md : edge2.getReferences()) {
-			addReference(new MiriamData(md));
-		}
-		anchors.addAll(edge2.getAnchors());
-		List<String> toAdd = new ArrayList<>();
-		for (String comment : edge2.getComments()) {
-			if (!comments.contains(comment)) {
-				toAdd.add(comment);
-			}
-		}
-		comments.addAll(toAdd);
-
-		// color should be skipped
-		if (!getColor().equals(edge2.getColor())) {
-			logger.warn(getWarningPrefix() + edge2.getWarningPrefix() + " Problem with merging. Edges have different colors.");
-		}
-
-		// add biopax references
-		biopaxReferences.addAll(edge2.getBiopaxReferences());
-
-	}
-
-	/**
-	 * @return the color
-	 * @see #color
-	 */
-	public Color getColor() {
-		return line.getColor();
-	}
-
-	/**
-	 * @param color
-	 *          the color to set
-	 * @see #color
-	 */
-	public void setColor(Color color) {
-		if (color != null) {
-			line.setColor(color);
-		}
-	}
-
-	/**
-	 * @return the zOrder
-	 * @see #zOrder
-	 */
-	public Integer getzOrder() {
-		return zOrder;
-	}
-
-	/**
-	 * @param zOrder
-	 *          the zOrder to set
-	 * @see #zOrder
-	 */
-	public void setzOrder(Integer zOrder) {
-		this.zOrder = zOrder;
-	}
-
-	/**
-	 * Adds element to {@link #biopaxReferences}.
-	 * 
-	 * @param reference
-	 *          reference to add
-	 */
-	public void addBiopaxReference(String reference) {
-		biopaxReferences.add(reference);
-
-	}
-
-	/**
-	 * @return the groupRef
-	 * @see #groupRef
-	 */
-	public String getGroupRef() {
-		return groupRef;
-	}
-
-	/**
-	 * @param groupRef
-	 *          the groupRef to set
-	 * @see #groupRef
-	 */
-	public void setGroupRef(String groupRef) {
-		this.groupRef = groupRef;
-	}
-
-}
+package lcsb.mapviewer.wikipathway.model;
+
+import java.awt.Color;
+import java.awt.geom.Point2D;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.MiriamData;
+
+/**
+ * Support class for Interaction between elements. It stores data parsed from
+ * GPML.
+ * 
+ * @author Jan Badura
+ * @author Piotr Gawron
+ * 
+ */
+public class Edge implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long			 serialVersionUID	= 1L;
+
+	/**
+	 * Epsilon valu used for comparison of doubles.
+	 */
+	private static final Double		 EPSILON					= 1e-6;
+
+	/**
+	 * Default class logger.
+	 */
+	private final transient Logger logger						= Logger.getLogger(Edge.class);
+
+	/**
+	 * Identifier in gpml model.
+	 */
+	private String								 graphId;
+
+	/**
+	 * In which group this edge is located.
+	 */
+	private String								 groupRef;
+
+	/**
+	 * Where this {@link Edge} starts (in which {@link Edge}/{@link Interaction}).
+	 */
+	private String								 start;
+
+	/**
+	 * Where this {@link Edge} ends (in which {@link Edge}/{@link Interaction}).
+	 */
+	private String								 end;
+
+	/**
+	 * Z-order of the line (how much to front it should be located).
+	 */
+	private Integer								 zOrder;
+
+	/**
+	 * Line representing this edge.
+	 */
+	private PolylineData					 line							= new PolylineData();
+
+	/**
+	 * Gpml interaction type (arrow).
+	 */
+	private GpmlInteractionType		 type							= GpmlInteractionType.LINE;
+
+	/**
+	 * References for given edge.
+	 */
+	private List<MiriamData>			 references				= new ArrayList<>();
+
+	/**
+	 * List of anchors placed on the edge.
+	 */
+	private Set<String>						 anchors					= new HashSet<>();
+
+	/**
+	 * Comments.
+	 */
+	private List<String>					 comments					= new ArrayList<>();
+
+	/**
+	 * List of identifiers used by biopax nodes that are inside gpml. These biopax
+	 * nodes contain annotations.
+	 */
+	private List<String>					 biopaxReferences	= new ArrayList<String>();
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param graphId
+	 *          {@link #graphId}
+	 */
+	public Edge(String graphId) {
+		this.graphId = graphId;
+	}
+
+	/**
+	 * Creates new instance that contains the same data as the parameter object.
+	 * 
+	 * @param original
+	 *          original object from which data is being copied
+	 */
+	public Edge(Edge original) {
+		this.graphId = original.getGraphId();
+		this.groupRef = original.getGroupRef();
+		this.start = original.getStart();
+		this.end = original.getEnd();
+		this.line = new PolylineData(original.getLine());
+		this.type = original.getType();
+		for (MiriamData md : original.getReferences()) {
+			addReference(new MiriamData(md));
+		}
+		this.anchors.addAll(original.getAnchors());
+		this.comments.addAll(original.getComments());
+		this.biopaxReferences.addAll(original.getBiopaxReferences());
+		this.zOrder = original.getzOrder();
+	}
+
+	/**
+	 * Empty constructor that should be used only by serialization tools and
+	 * subclasses.
+	 */
+	protected Edge() {
+	}
+
+	/**
+	 * Adds reference to the object.
+	 * 
+	 * @param reference
+	 *          reference to add
+	 */
+	public void addReference(MiriamData reference) {
+		references.add(reference);
+	}
+
+	/**
+	 * Adds anchor to {@link #anchors}.
+	 * 
+	 * @param anchor
+	 *          object to add
+	 */
+	public void addAnchor(String anchor) {
+		this.anchors.add(anchor);
+	}
+
+	/**
+	 * @return the graphId
+	 * @see #graphId
+	 */
+	public String getGraphId() {
+		return graphId;
+	}
+
+	/**
+	 * @param graphId
+	 *          the graphId to set
+	 * @see #graphId
+	 */
+	public void setGraphId(String graphId) {
+		this.graphId = graphId;
+	}
+
+	/**
+	 * @return the start
+	 * @see #start
+	 */
+	public String getStart() {
+		return start;
+	}
+
+	/**
+	 * @param start
+	 *          the start to set
+	 * @see #start
+	 */
+	public void setStart(String start) {
+		this.start = start;
+	}
+
+	/**
+	 * @return the end
+	 * @see #end
+	 */
+	public String getEnd() {
+		return end;
+	}
+
+	/**
+	 * @param end
+	 *          the end to set
+	 * @see #end
+	 */
+	public void setEnd(String end) {
+		this.end = end;
+	}
+
+	/**
+	 * @return the line
+	 * @see #line
+	 */
+	public PolylineData getLine() {
+		return line;
+	}
+
+	/**
+	 * @param line
+	 *          the line to set
+	 * @see #line
+	 */
+	public void setLine(PolylineData line) {
+		this.line = line;
+	}
+
+	/**
+	 * @return the anchors
+	 * @see #anchors
+	 */
+	public Set<String> getAnchors() {
+		return anchors;
+	}
+
+	/**
+	 * @param anchors
+	 *          the anchors to set
+	 * @see #anchors
+	 */
+	public void setAnchors(Set<String> anchors) {
+		this.anchors = anchors;
+	}
+
+	/**
+	 * @return the comments
+	 * @see #comments
+	 */
+	public List<String> getComments() {
+		return comments;
+	}
+
+	/**
+	 * @param comment
+	 *          the comment to add
+	 * @see #comment
+	 */
+	public void addComment(String comment) {
+		this.comments.add(comment);
+	}
+
+	/**
+	 * @return the biopaxReferences
+	 * @see #biopaxReferences
+	 */
+	public List<String> getBiopaxReferences() {
+		return biopaxReferences;
+	}
+
+	/**
+	 * @param biopaxReferences
+	 *          the biopaxReferences to set
+	 * @see #biopaxReferences
+	 */
+	public void setBiopaxReferences(List<String> biopaxReferences) {
+		this.biopaxReferences = biopaxReferences;
+	}
+
+	/**
+	 * Returns a prefix that should be used in warnings.
+	 * 
+	 * @return string that identifies element in logs
+	 */
+	public String getWarningPrefix() {
+		return "[" + getType() + ", id: " + getGraphId() + "]\t";
+	}
+
+	/**
+	 * @return the type
+	 * @see #type
+	 */
+	public GpmlInteractionType getType() {
+		return type;
+	}
+
+	/**
+	 * @param type
+	 *          the type to set
+	 * @see #type
+	 */
+	public void setType(GpmlInteractionType type) {
+		if (type != null) {
+			this.type = type;
+		}
+	}
+
+	/**
+	 * Reverse direction of edge (order of elements).
+	 * 
+	 * @return copy of the object that is reversed
+	 */
+	public Edge reverse() {
+		Edge result = new Edge(this);
+		result.setLine(result.getLine().reverse());
+		String tmp = result.getStart();
+		result.setStart(result.getEnd());
+		result.setEnd(tmp);
+
+		return result;
+	}
+
+	/**
+	 * @return the references
+	 * @see #references
+	 */
+	public List<MiriamData> getReferences() {
+		return references;
+	}
+
+	/**
+	 * @param references
+	 *          the references to set
+	 * @see #references
+	 */
+	public void setReferences(List<MiriamData> references) {
+		this.references = references;
+	}
+
+	/**
+	 * Adds set of references.
+	 * 
+	 * @param references
+	 *          references to add
+	 */
+	public void addReferences(List<MiriamData> references) {
+		for (MiriamData miriamData : references) {
+			addReference(miriamData);
+		}
+	}
+
+	/**
+	 * This method extend edge (the line) by adding data from the edge in
+	 * parameter.
+	 * 
+	 * @param edge2
+	 *          edge that should be used for extension
+	 */
+	public void extend(Edge edge2) {
+		// check if extension make sense (they should point to the same identifier)
+		if (!getEnd().equals(edge2.getStart())) {
+			throw new InvalidArgumentException(
+					getWarningPrefix() + edge2.getWarningPrefix() + " Cannot merge - anchor points doesn't match: " + getEnd() + "," + edge2.getStart());
+		}
+
+		if (line.getEndPoint().distance(edge2.getLine().getBeginPoint()) > EPSILON) {
+			throw new InvalidArgumentException(
+					getWarningPrefix() + edge2.getWarningPrefix() + " Cannot merge - edges are far from each other: " + line.getEndPoint() + ","
+							+ edge2.getLine().getBeginPoint());
+		}
+
+		// graphId should be the same
+
+		// start should be taken from the original
+
+		// end should be taken from the extension
+		setEnd(edge2.getEnd());
+
+		// add points
+		for (int i = 1; i < edge2.getLine().getPoints().size(); i++) {
+			Point2D p = (Point2D) edge2.getLine().getPoints().get(i).clone();
+			line.addPoint(p);
+		}
+
+		// skip type
+
+		for (MiriamData md : edge2.getReferences()) {
+			addReference(new MiriamData(md));
+		}
+		anchors.addAll(edge2.getAnchors());
+		List<String> toAdd = new ArrayList<>();
+		for (String comment : edge2.getComments()) {
+			if (!comments.contains(comment)) {
+				toAdd.add(comment);
+			}
+		}
+		comments.addAll(toAdd);
+
+		// color should be skipped
+		if (!getColor().equals(edge2.getColor())) {
+			logger.warn(getWarningPrefix() + edge2.getWarningPrefix() + " Problem with merging. Edges have different colors.");
+		}
+
+		// add biopax references
+		biopaxReferences.addAll(edge2.getBiopaxReferences());
+
+	}
+
+	/**
+	 * @return the color
+	 * @see #color
+	 */
+	public Color getColor() {
+		return line.getColor();
+	}
+
+	/**
+	 * @param color
+	 *          the color to set
+	 * @see #color
+	 */
+	public void setColor(Color color) {
+		if (color != null) {
+			line.setColor(color);
+		}
+	}
+
+	/**
+	 * @return the zOrder
+	 * @see #zOrder
+	 */
+	public Integer getzOrder() {
+		return zOrder;
+	}
+
+	/**
+	 * @param zOrder
+	 *          the zOrder to set
+	 * @see #zOrder
+	 */
+	public void setzOrder(Integer zOrder) {
+		this.zOrder = zOrder;
+	}
+
+	/**
+	 * Adds element to {@link #biopaxReferences}.
+	 * 
+	 * @param reference
+	 *          reference to add
+	 */
+	public void addBiopaxReference(String reference) {
+		biopaxReferences.add(reference);
+
+	}
+
+	/**
+	 * @return the groupRef
+	 * @see #groupRef
+	 */
+	public String getGroupRef() {
+		return groupRef;
+	}
+
+	/**
+	 * @param groupRef
+	 *          the groupRef to set
+	 * @see #groupRef
+	 */
+	public void setGroupRef(String groupRef) {
+		this.groupRef = groupRef;
+	}
+
+}
diff --git a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/InteractionMapping.java b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/InteractionMapping.java
index 23123297e1..4ea4f01c63 100644
--- a/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/InteractionMapping.java
+++ b/pathvisio/src/main/java/lcsb/mapviewer/wikipathway/model/InteractionMapping.java
@@ -1,514 +1,514 @@
-package lcsb.mapviewer.wikipathway.model;
-
-import lcsb.mapviewer.model.graphics.LineType;
-import lcsb.mapviewer.model.map.modifier.Catalysis;
-import lcsb.mapviewer.model.map.modifier.Inhibition;
-import lcsb.mapviewer.model.map.modifier.Modulation;
-import lcsb.mapviewer.model.map.modifier.PhysicalStimulation;
-import lcsb.mapviewer.model.map.modifier.UnknownCatalysis;
-import lcsb.mapviewer.model.map.modifier.UnknownInhibition;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.ReactionNode;
-import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
-import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
-import lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction;
-import lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction;
-import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
-import lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction;
-import lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction;
-import lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction;
-
-/**
- * This class contains mapping between gpml interactions and CellDesigner model
- * representation. Type is identified by two values:
- * {@link #gpmlInteractionType} and {@link #gpmlLineStyle}. For every type there
- * are three possible mappings:
- * <ul>
- * <li>reaction - defines to what {@link Reaction} gpml type should be
- * transformed</li>
- * <li>input - when interaction is just an input part of main reaction this
- * defines to what {@link ReactionNode} should it be transformed</li>
- * <li>output - when interaction is just an output part of main reaction this
- * defines to what {@link ReactionNode} should it be transformed</li>
- * </ul>
- * 
- * @author Piotr Gawron
- * 
- */
-public enum InteractionMapping {
-
-	/**
-	 * Default line.
-	 */
-	LINE(GpmlInteractionType.LINE, GpmlLineType.SOLID, //
-			UnknownTransitionReaction.class, true, //
-			Reactant.class, false, //
-			Reactant.class, false, //
-			true), //
-
-	/**
-	 * Default arrow.
-	 */
-	ARROW(GpmlInteractionType.ARROW, GpmlLineType.SOLID, //
-			StateTransitionReaction.class, false, //
-			Modulation.class, true, //
-			Product.class, false),
-
-	/**
-	 * Dashed line.
-	 */
-	LINE_DASHED(GpmlInteractionType.LINE, GpmlLineType.DASHED, //
-			UnknownTransitionReaction.class, true, //
-			Reactant.class, true, //
-			Reactant.class, true, //
-			true), //
-
-	/**
-	 * Dashed arrow.
-	 */
-	ARROW_DASHED(GpmlInteractionType.ARROW, GpmlLineType.DASHED, //
-			UnknownPositiveInfluenceReaction.class, false, //
-			Modulation.class, true, //
-			Product.class, true),
-
-	/**
-	 * Line ended with T-bar.
-	 */
-	TBAR(GpmlInteractionType.TBAR, GpmlLineType.SOLID, //
-			NegativeInfluenceReaction.class, true, //
-			Inhibition.class, false, //
-			Product.class, true), //
-
-	/**
-	 * Line ended with T-bar dashed.
-	 */
-	TBAR_DASHED(GpmlInteractionType.TBAR, GpmlLineType.DASHED, //
-			UnknownNegativeInfluenceReaction.class, true, //
-			UnknownInhibition.class, false, //
-			Product.class, true), //
-
-	/**
-	 * Necessary stimulation.
-	 */
-	NECESSARY_STIMULATION(GpmlInteractionType.NECESSARY_STIMULATION, GpmlLineType.SOLID, //
-			ReducedPhysicalStimulationReaction.class, false, //
-			PhysicalStimulation.class, false, //
-			Product.class, true), //
-
-	/**
-	 * Necessary stimulation dashed.
-	 */
-	NECESSARY_STIMULATION_DASHED(GpmlInteractionType.NECESSARY_STIMULATION, GpmlLineType.DASHED, //
-			UnknownPositiveInfluenceReaction.class, true, //
-			Modulation.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Binding.
-	 */
-	BINDING(GpmlInteractionType.BINDING, GpmlLineType.SOLID, //
-			HeterodimerAssociationReaction.class, false, //
-			Modulation.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Binding dashed.
-	 */
-	BINDING_DASHED(GpmlInteractionType.BINDING, GpmlLineType.DASHED, //
-			UnknownPositiveInfluenceReaction.class, false, //
-			Modulation.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Conversion.
-	 */
-	CONVERSION(GpmlInteractionType.CONVERSION, GpmlLineType.SOLID, //
-			StateTransitionReaction.class, false, //
-			Modulation.class, true, //
-			Product.class, false), //
-
-	/**
-	 * Dashed conversion.
-	 */
-	CONVERSION_DASHED(GpmlInteractionType.CONVERSION, GpmlLineType.DASHED, //
-			UnknownPositiveInfluenceReaction.class, false, //
-			Modulation.class, true, //
-			Product.class, true),
-
-	/**
-	 * Stimulation.
-	 */
-	STIMULATION(GpmlInteractionType.STIMULATION, GpmlLineType.SOLID, //
-			ReducedPhysicalStimulationReaction.class, true, //
-			PhysicalStimulation.class, false, //
-			Product.class, true), //
-
-	/**
-	 * Stimulation dashed.
-	 */
-	STIMULATION_DASHED(GpmlInteractionType.STIMULATION, GpmlLineType.DASHED, //
-			UnknownPositiveInfluenceReaction.class, true, //
-			Modulation.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Modification.
-	 */
-	MODIFICATION(GpmlInteractionType.MODIFICATION, GpmlLineType.SOLID, //
-			PositiveInfluenceReaction.class, true, //
-			Modulation.class, false, //
-			Product.class, true), //
-
-	/**
-	 * Modification dashed.
-	 */
-	MODIFICATION_DASHED(GpmlInteractionType.MODIFICATION, GpmlLineType.DASHED, //
-			UnknownPositiveInfluenceReaction.class, false, //
-			Modulation.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Catalysis.
-	 */
-	CATALYSIS(GpmlInteractionType.CATALYSIS, GpmlLineType.SOLID, //
-			PositiveInfluenceReaction.class, true, //
-			Catalysis.class, false, //
-			Product.class, true), //
-
-	/**
-	 * Catalysis dashed.
-	 */
-	CATALYSIS_DASHED(GpmlInteractionType.CATALYSIS, GpmlLineType.DASHED, //
-			UnknownPositiveInfluenceReaction.class, true, //
-			UnknownCatalysis.class, false, //
-			Product.class, true), //
-
-	/**
-	 * Inhibition.
-	 */
-	INHIBITION(GpmlInteractionType.INHIBITION, GpmlLineType.SOLID, //
-			NegativeInfluenceReaction.class, false, //
-			Inhibition.class, false, //
-			Product.class, true), //
-
-	/**
-	 * Inhibition dashed.
-	 */
-	INHIBITION_DASHED(GpmlInteractionType.INHIBITION, GpmlLineType.DASHED, //
-			UnknownNegativeInfluenceReaction.class, true, //
-			UnknownInhibition.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Cleavage.
-	 */
-	CLEAVAGE(GpmlInteractionType.CLEAVAGE, GpmlLineType.SOLID, //
-			StateTransitionReaction.class, false, //
-			Modulation.class, true, //
-			Product.class, false), //
-
-	/**
-	 * Cleavage dashed.
-	 */
-	CLEAVAGE_DASHED(GpmlInteractionType.CLEAVAGE, GpmlLineType.DASHED, //
-			UnknownTransitionReaction.class, true, //
-			Modulation.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Covalent bond.
-	 */
-	COVALENT_BOND(GpmlInteractionType.COVALENT_BOND, GpmlLineType.SOLID, //
-			UnknownTransitionReaction.class, true, //
-			Reactant.class, true, //
-			Product.class, true, //
-			true), //
-
-	/**
-	 * Covalent bond dashed.
-	 */
-	COVALENT_BOND_DASHED(GpmlInteractionType.COVALENT_BOND, GpmlLineType.DASHED, //
-			UnknownTransitionReaction.class, true, //
-			Reactant.class, true, //
-			Product.class, true, //
-			true), //
-
-	/**
-	 * Branching left.
-	 */
-	BRANCHING_LEFT(GpmlInteractionType.BRANCHING_LEFT, GpmlLineType.SOLID, //
-			UnknownTransitionReaction.class, true, //
-			Reactant.class, false, //
-			Reactant.class, false, //
-			true), //
-
-	/**
-	 * Branching left dashed.
-	 */
-	BRANCHING_LEFT_DASHED(GpmlInteractionType.BRANCHING_LEFT, GpmlLineType.DASHED, //
-			UnknownTransitionReaction.class, true, //
-			Reactant.class, true, //
-			Reactant.class, true, //
-			true), //
-
-	/**
-	 * Branching right.
-	 */
-	BRANCHING_RIGHT(GpmlInteractionType.BRANCHING_RIGHT, GpmlLineType.SOLID, //
-			UnknownTransitionReaction.class, true, //
-			Reactant.class, false, //
-			Reactant.class, false, //
-			true), //
-
-	/**
-	 * Branching right dashed.
-	 */
-	BRANCHING_RIGHT_DASHED(GpmlInteractionType.BRANCHING_RIGHT, GpmlLineType.DASHED, //
-			UnknownTransitionReaction.class, true, //
-			Reactant.class, true, //
-			Reactant.class, true, //
-			true), //
-
-	/**
-	 * Transription-translation.
-	 */
-	TRANSCRIPTION_TRANSLATION(GpmlInteractionType.TRANSCRIPTION_TRANSLATION, GpmlLineType.SOLID, //
-			PositiveInfluenceReaction.class, true, //
-			Modulation.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Transription-translation dashed.
-	 */
-	TRANSCRIPTION_TRANSLATION_DASHED(GpmlInteractionType.TRANSCRIPTION_TRANSLATION, GpmlLineType.DASHED, //
-			PositiveInfluenceReaction.class, true, //
-			Modulation.class, true, //
-			Product.class, true), //
-
-	/**
-	 * Gap...
-	 */
-	GAP(GpmlInteractionType.GAP, GpmlLineType.SOLID, //
-			UnknownTransitionReaction.class, true, //
-			Modulation.class, true, //
-			Product.class, true, //
-			true),
-
-	/**
-	 * Gap dashed...
-	 */
-	GAP_DASHED(GpmlInteractionType.GAP, GpmlLineType.DASHED, //
-			UnknownTransitionReaction.class, true, //
-			Modulation.class, true, //
-			Product.class, true, //
-			true);
-
-	/**
-	 * Interaction type defined in gpml.
-	 */
-	private GpmlInteractionType						gpmlInteractionType;
-
-	/**
-	 * Line type defined in gpml.
-	 */
-	private GpmlLineType									gpmlLineStyle;
-
-	/**
-	 * Cell designer reaction to which gpml interaction should be transformed.
-	 */
-	private Class<? extends Reaction>			modelReactionType;
-
-	/**
-	 * Cell designer reaction node to which interaction should be transformed when
-	 * it's an input to the reaction.
-	 */
-	private Class<? extends ReactionNode>	modelInputReactionNodeType;
-
-	/**
-	 * Cell designer reaction node to which interaction should be transformed when
-	 * it's an output to the reaction.
-	 */
-	private Class<? extends ReactionNode>	modelOutputReactionNodeType;
-
-	/**
-	 * Should CellDesigner reaction be reversible.
-	 */
-	private boolean												reversible				 = false;
-
-	/**
-	 * When converting to reaction. Should the code warn.
-	 */
-	private boolean												interactionWarning = false;
-
-	/**
-	 * When converting to input of the reaction should the code warn.
-	 */
-	private boolean												inputWarning			 = false;
-
-	/**
-	 * When converting to output of the reaction should the code warn.
-	 */
-	private boolean												outputWarning			 = false;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param gpmlInteractionType
-	 *          {@link #gpmlInteractionType}
-	 * @param gpmlLineStyle
-	 *          {@link #gpmlLineStyle}
-	 * @param modelReactionType
-	 *          {@link #modelReactionType}
-	 * @param interactionWarning
-	 *          {@link #interactionWarning}
-	 * @param modelInputReactionNodeType
-	 *          {@link #modelInputReactionNodeType}
-	 * @param inputWarning
-	 *          {@link #inputWarning}
-	 * @param modelOutputReactionNodeType
-	 *          {@link #modelOutputReactionNodeType}
-	 * @param outputWarning
-	 *          {@link #outputWarning}
-	 * @param reversible
-	 *          {@link #reversible}
-	 */
-	InteractionMapping(GpmlInteractionType gpmlInteractionType, GpmlLineType gpmlLineStyle, Class<? extends Reaction> modelReactionType,
-			boolean interactionWarning, Class<? extends ReactionNode> modelInputReactionNodeType, boolean inputWarning,
-			Class<? extends ReactionNode> modelOutputReactionNodeType, boolean outputWarning, boolean reversible) {
-		this.gpmlInteractionType = gpmlInteractionType;
-		this.modelReactionType = modelReactionType;
-		this.interactionWarning = interactionWarning;
-		this.modelInputReactionNodeType = modelInputReactionNodeType;
-		this.inputWarning = inputWarning;
-		this.modelOutputReactionNodeType = modelOutputReactionNodeType;
-		this.outputWarning = outputWarning;
-		this.reversible = reversible;
-		this.gpmlLineStyle = gpmlLineStyle;
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param gpmlInteractionType
-	 *          {@link #gpmlInteractionType}
-	 * @param gpmlLineStyle
-	 *          {@link #gpmlLineStyle}
-	 * @param modelReactionType
-	 *          {@link #modelReactionType}
-	 * @param interactionWarning
-	 *          {@link #interactionWarning}
-	 * @param modelInputReactionNodeType
-	 *          {@link #modelInputReactionNodeType}
-	 * @param inputWarning
-	 *          {@link #inputWarning}
-	 * @param modelOutputReactionNodeType
-	 *          {@link #modelOutputReactionNodeType}
-	 * @param outputWarning
-	 *          {@link #outputWarning}
-	 */
-	InteractionMapping(GpmlInteractionType gpmlInteractionType, GpmlLineType gpmlLineStyle, Class<? extends Reaction> modelReactionType,
-			boolean interactionWarning, Class<? extends ReactionNode> modelInputReactionNodeType, boolean inputWarning,
-			Class<? extends ReactionNode> modelOutputReactionNodeType, boolean outputWarning) {
-		this(
-				gpmlInteractionType, gpmlLineStyle, modelReactionType, interactionWarning, modelInputReactionNodeType, inputWarning, modelOutputReactionNodeType,
-				outputWarning, false);
-	}
-
-	/**
-	 * @return the gpmlInteractionType
-	 * @see #gpmlInteractionType
-	 */
-	public GpmlInteractionType getGpmlInteractionType() {
-		return gpmlInteractionType;
-	}
-
-	/**
-	 * @return the modelReactionType
-	 * @see #modelReactionType
-	 */
-	public Class<? extends Reaction> getModelReactionType() {
-		return modelReactionType;
-	}
-
-	/**
-	 * @return the modelInputReactionNodeType
-	 * @see #modelInputReactionNodeType
-	 */
-	public Class<? extends ReactionNode> getModelInputReactionNodeType() {
-		return modelInputReactionNodeType;
-	}
-
-	/**
-	 * @return the modelOutputReactionNodeType
-	 * @see #modelOutputReactionNodeType
-	 */
-	public Class<? extends ReactionNode> getModelOutputReactionNodeType() {
-		return modelOutputReactionNodeType;
-	}
-
-	/**
-	 * @return the reversible
-	 * @see #reversible
-	 */
-	public boolean isReversible() {
-		return reversible;
-	}
-
-	/**
-	 * @return the interactionWarning
-	 * @see #interactionWarning
-	 */
-	public boolean isInteractionWarning() {
-		return interactionWarning;
-	}
-
-	/**
-	 * @return the inputWarning
-	 * @see #inputWarning
-	 */
-	public boolean isInputWarning() {
-		return inputWarning;
-	}
-
-	/**
-	 * @return the outputWarning
-	 * @see #outputWarning
-	 */
-	public boolean isOutputWarning() {
-		return outputWarning;
-	}
-
-	/**
-	 * Method that is looking for the {@link InteractionMapping} that matches to
-	 * given gpml "arrow type" and "line type".
-	 * 
-	 * @param gpmlType
-	 *          gpml arrow type
-	 * @param lineType
-	 *          gpml line type
-	 * @return {@link InteractionMapping} that matches to given gpml "arrow type"
-	 *         and "line type"
-	 */
-	public static InteractionMapping getInteractionMapping(GpmlInteractionType gpmlType, LineType lineType) {
-		for (InteractionMapping mapping : InteractionMapping.values()) {
-			boolean arrowMatch = mapping.getGpmlInteractionType().equals(gpmlType);
-			boolean lineTypeMatch = lineType.equals(mapping.getGpmlLineStyle().getCorrespondingGlobalLineType());
-
-			if (arrowMatch && lineTypeMatch) {
-				return mapping;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * @return the gpmlLineStyle
-	 * @see #gpmlLineStyle
-	 */
-	public GpmlLineType getGpmlLineStyle() {
-		return gpmlLineStyle;
-	}
-
-}
+package lcsb.mapviewer.wikipathway.model;
+
+import lcsb.mapviewer.model.graphics.LineType;
+import lcsb.mapviewer.model.map.modifier.Catalysis;
+import lcsb.mapviewer.model.map.modifier.Inhibition;
+import lcsb.mapviewer.model.map.modifier.Modulation;
+import lcsb.mapviewer.model.map.modifier.PhysicalStimulation;
+import lcsb.mapviewer.model.map.modifier.UnknownCatalysis;
+import lcsb.mapviewer.model.map.modifier.UnknownInhibition;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.ReactionNode;
+import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction;
+import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction;
+
+/**
+ * This class contains mapping between gpml interactions and CellDesigner model
+ * representation. Type is identified by two values:
+ * {@link #gpmlInteractionType} and {@link #gpmlLineStyle}. For every type there
+ * are three possible mappings:
+ * <ul>
+ * <li>reaction - defines to what {@link Reaction} gpml type should be
+ * transformed</li>
+ * <li>input - when interaction is just an input part of main reaction this
+ * defines to what {@link ReactionNode} should it be transformed</li>
+ * <li>output - when interaction is just an output part of main reaction this
+ * defines to what {@link ReactionNode} should it be transformed</li>
+ * </ul>
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public enum InteractionMapping {
+
+	/**
+	 * Default line.
+	 */
+	LINE(GpmlInteractionType.LINE, GpmlLineType.SOLID, //
+			UnknownTransitionReaction.class, true, //
+			Reactant.class, false, //
+			Reactant.class, false, //
+			true), //
+
+	/**
+	 * Default arrow.
+	 */
+	ARROW(GpmlInteractionType.ARROW, GpmlLineType.SOLID, //
+			StateTransitionReaction.class, false, //
+			Modulation.class, true, //
+			Product.class, false),
+
+	/**
+	 * Dashed line.
+	 */
+	LINE_DASHED(GpmlInteractionType.LINE, GpmlLineType.DASHED, //
+			UnknownTransitionReaction.class, true, //
+			Reactant.class, true, //
+			Reactant.class, true, //
+			true), //
+
+	/**
+	 * Dashed arrow.
+	 */
+	ARROW_DASHED(GpmlInteractionType.ARROW, GpmlLineType.DASHED, //
+			UnknownPositiveInfluenceReaction.class, false, //
+			Modulation.class, true, //
+			Product.class, true),
+
+	/**
+	 * Line ended with T-bar.
+	 */
+	TBAR(GpmlInteractionType.TBAR, GpmlLineType.SOLID, //
+			NegativeInfluenceReaction.class, true, //
+			Inhibition.class, false, //
+			Product.class, true), //
+
+	/**
+	 * Line ended with T-bar dashed.
+	 */
+	TBAR_DASHED(GpmlInteractionType.TBAR, GpmlLineType.DASHED, //
+			UnknownNegativeInfluenceReaction.class, true, //
+			UnknownInhibition.class, false, //
+			Product.class, true), //
+
+	/**
+	 * Necessary stimulation.
+	 */
+	NECESSARY_STIMULATION(GpmlInteractionType.NECESSARY_STIMULATION, GpmlLineType.SOLID, //
+			ReducedPhysicalStimulationReaction.class, false, //
+			PhysicalStimulation.class, false, //
+			Product.class, true), //
+
+	/**
+	 * Necessary stimulation dashed.
+	 */
+	NECESSARY_STIMULATION_DASHED(GpmlInteractionType.NECESSARY_STIMULATION, GpmlLineType.DASHED, //
+			UnknownPositiveInfluenceReaction.class, true, //
+			Modulation.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Binding.
+	 */
+	BINDING(GpmlInteractionType.BINDING, GpmlLineType.SOLID, //
+			HeterodimerAssociationReaction.class, false, //
+			Modulation.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Binding dashed.
+	 */
+	BINDING_DASHED(GpmlInteractionType.BINDING, GpmlLineType.DASHED, //
+			UnknownPositiveInfluenceReaction.class, false, //
+			Modulation.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Conversion.
+	 */
+	CONVERSION(GpmlInteractionType.CONVERSION, GpmlLineType.SOLID, //
+			StateTransitionReaction.class, false, //
+			Modulation.class, true, //
+			Product.class, false), //
+
+	/**
+	 * Dashed conversion.
+	 */
+	CONVERSION_DASHED(GpmlInteractionType.CONVERSION, GpmlLineType.DASHED, //
+			UnknownPositiveInfluenceReaction.class, false, //
+			Modulation.class, true, //
+			Product.class, true),
+
+	/**
+	 * Stimulation.
+	 */
+	STIMULATION(GpmlInteractionType.STIMULATION, GpmlLineType.SOLID, //
+			ReducedPhysicalStimulationReaction.class, true, //
+			PhysicalStimulation.class, false, //
+			Product.class, true), //
+
+	/**
+	 * Stimulation dashed.
+	 */
+	STIMULATION_DASHED(GpmlInteractionType.STIMULATION, GpmlLineType.DASHED, //
+			UnknownPositiveInfluenceReaction.class, true, //
+			Modulation.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Modification.
+	 */
+	MODIFICATION(GpmlInteractionType.MODIFICATION, GpmlLineType.SOLID, //
+			PositiveInfluenceReaction.class, true, //
+			Modulation.class, false, //
+			Product.class, true), //
+
+	/**
+	 * Modification dashed.
+	 */
+	MODIFICATION_DASHED(GpmlInteractionType.MODIFICATION, GpmlLineType.DASHED, //
+			UnknownPositiveInfluenceReaction.class, false, //
+			Modulation.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Catalysis.
+	 */
+	CATALYSIS(GpmlInteractionType.CATALYSIS, GpmlLineType.SOLID, //
+			PositiveInfluenceReaction.class, true, //
+			Catalysis.class, false, //
+			Product.class, true), //
+
+	/**
+	 * Catalysis dashed.
+	 */
+	CATALYSIS_DASHED(GpmlInteractionType.CATALYSIS, GpmlLineType.DASHED, //
+			UnknownPositiveInfluenceReaction.class, true, //
+			UnknownCatalysis.class, false, //
+			Product.class, true), //
+
+	/**
+	 * Inhibition.
+	 */
+	INHIBITION(GpmlInteractionType.INHIBITION, GpmlLineType.SOLID, //
+			NegativeInfluenceReaction.class, false, //
+			Inhibition.class, false, //
+			Product.class, true), //
+
+	/**
+	 * Inhibition dashed.
+	 */
+	INHIBITION_DASHED(GpmlInteractionType.INHIBITION, GpmlLineType.DASHED, //
+			UnknownNegativeInfluenceReaction.class, true, //
+			UnknownInhibition.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Cleavage.
+	 */
+	CLEAVAGE(GpmlInteractionType.CLEAVAGE, GpmlLineType.SOLID, //
+			StateTransitionReaction.class, false, //
+			Modulation.class, true, //
+			Product.class, false), //
+
+	/**
+	 * Cleavage dashed.
+	 */
+	CLEAVAGE_DASHED(GpmlInteractionType.CLEAVAGE, GpmlLineType.DASHED, //
+			UnknownTransitionReaction.class, true, //
+			Modulation.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Covalent bond.
+	 */
+	COVALENT_BOND(GpmlInteractionType.COVALENT_BOND, GpmlLineType.SOLID, //
+			UnknownTransitionReaction.class, true, //
+			Reactant.class, true, //
+			Product.class, true, //
+			true), //
+
+	/**
+	 * Covalent bond dashed.
+	 */
+	COVALENT_BOND_DASHED(GpmlInteractionType.COVALENT_BOND, GpmlLineType.DASHED, //
+			UnknownTransitionReaction.class, true, //
+			Reactant.class, true, //
+			Product.class, true, //
+			true), //
+
+	/**
+	 * Branching left.
+	 */
+	BRANCHING_LEFT(GpmlInteractionType.BRANCHING_LEFT, GpmlLineType.SOLID, //
+			UnknownTransitionReaction.class, true, //
+			Reactant.class, false, //
+			Reactant.class, false, //
+			true), //
+
+	/**
+	 * Branching left dashed.
+	 */
+	BRANCHING_LEFT_DASHED(GpmlInteractionType.BRANCHING_LEFT, GpmlLineType.DASHED, //
+			UnknownTransitionReaction.class, true, //
+			Reactant.class, true, //
+			Reactant.class, true, //
+			true), //
+
+	/**
+	 * Branching right.
+	 */
+	BRANCHING_RIGHT(GpmlInteractionType.BRANCHING_RIGHT, GpmlLineType.SOLID, //
+			UnknownTransitionReaction.class, true, //
+			Reactant.class, false, //
+			Reactant.class, false, //
+			true), //
+
+	/**
+	 * Branching right dashed.
+	 */
+	BRANCHING_RIGHT_DASHED(GpmlInteractionType.BRANCHING_RIGHT, GpmlLineType.DASHED, //
+			UnknownTransitionReaction.class, true, //
+			Reactant.class, true, //
+			Reactant.class, true, //
+			true), //
+
+	/**
+	 * Transription-translation.
+	 */
+	TRANSCRIPTION_TRANSLATION(GpmlInteractionType.TRANSCRIPTION_TRANSLATION, GpmlLineType.SOLID, //
+			PositiveInfluenceReaction.class, true, //
+			Modulation.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Transription-translation dashed.
+	 */
+	TRANSCRIPTION_TRANSLATION_DASHED(GpmlInteractionType.TRANSCRIPTION_TRANSLATION, GpmlLineType.DASHED, //
+			PositiveInfluenceReaction.class, true, //
+			Modulation.class, true, //
+			Product.class, true), //
+
+	/**
+	 * Gap...
+	 */
+	GAP(GpmlInteractionType.GAP, GpmlLineType.SOLID, //
+			UnknownTransitionReaction.class, true, //
+			Modulation.class, true, //
+			Product.class, true, //
+			true),
+
+	/**
+	 * Gap dashed...
+	 */
+	GAP_DASHED(GpmlInteractionType.GAP, GpmlLineType.DASHED, //
+			UnknownTransitionReaction.class, true, //
+			Modulation.class, true, //
+			Product.class, true, //
+			true);
+
+	/**
+	 * Interaction type defined in gpml.
+	 */
+	private GpmlInteractionType						gpmlInteractionType;
+
+	/**
+	 * Line type defined in gpml.
+	 */
+	private GpmlLineType									gpmlLineStyle;
+
+	/**
+	 * Cell designer reaction to which gpml interaction should be transformed.
+	 */
+	private Class<? extends Reaction>			modelReactionType;
+
+	/**
+	 * Cell designer reaction node to which interaction should be transformed when
+	 * it's an input to the reaction.
+	 */
+	private Class<? extends ReactionNode>	modelInputReactionNodeType;
+
+	/**
+	 * Cell designer reaction node to which interaction should be transformed when
+	 * it's an output to the reaction.
+	 */
+	private Class<? extends ReactionNode>	modelOutputReactionNodeType;
+
+	/**
+	 * Should CellDesigner reaction be reversible.
+	 */
+	private boolean												reversible				 = false;
+
+	/**
+	 * When converting to reaction. Should the code warn.
+	 */
+	private boolean												interactionWarning = false;
+
+	/**
+	 * When converting to input of the reaction should the code warn.
+	 */
+	private boolean												inputWarning			 = false;
+
+	/**
+	 * When converting to output of the reaction should the code warn.
+	 */
+	private boolean												outputWarning			 = false;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param gpmlInteractionType
+	 *          {@link #gpmlInteractionType}
+	 * @param gpmlLineStyle
+	 *          {@link #gpmlLineStyle}
+	 * @param modelReactionType
+	 *          {@link #modelReactionType}
+	 * @param interactionWarning
+	 *          {@link #interactionWarning}
+	 * @param modelInputReactionNodeType
+	 *          {@link #modelInputReactionNodeType}
+	 * @param inputWarning
+	 *          {@link #inputWarning}
+	 * @param modelOutputReactionNodeType
+	 *          {@link #modelOutputReactionNodeType}
+	 * @param outputWarning
+	 *          {@link #outputWarning}
+	 * @param reversible
+	 *          {@link #reversible}
+	 */
+	InteractionMapping(GpmlInteractionType gpmlInteractionType, GpmlLineType gpmlLineStyle, Class<? extends Reaction> modelReactionType,
+			boolean interactionWarning, Class<? extends ReactionNode> modelInputReactionNodeType, boolean inputWarning,
+			Class<? extends ReactionNode> modelOutputReactionNodeType, boolean outputWarning, boolean reversible) {
+		this.gpmlInteractionType = gpmlInteractionType;
+		this.modelReactionType = modelReactionType;
+		this.interactionWarning = interactionWarning;
+		this.modelInputReactionNodeType = modelInputReactionNodeType;
+		this.inputWarning = inputWarning;
+		this.modelOutputReactionNodeType = modelOutputReactionNodeType;
+		this.outputWarning = outputWarning;
+		this.reversible = reversible;
+		this.gpmlLineStyle = gpmlLineStyle;
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param gpmlInteractionType
+	 *          {@link #gpmlInteractionType}
+	 * @param gpmlLineStyle
+	 *          {@link #gpmlLineStyle}
+	 * @param modelReactionType
+	 *          {@link #modelReactionType}
+	 * @param interactionWarning
+	 *          {@link #interactionWarning}
+	 * @param modelInputReactionNodeType
+	 *          {@link #modelInputReactionNodeType}
+	 * @param inputWarning
+	 *          {@link #inputWarning}
+	 * @param modelOutputReactionNodeType
+	 *          {@link #modelOutputReactionNodeType}
+	 * @param outputWarning
+	 *          {@link #outputWarning}
+	 */
+	InteractionMapping(GpmlInteractionType gpmlInteractionType, GpmlLineType gpmlLineStyle, Class<? extends Reaction> modelReactionType,
+			boolean interactionWarning, Class<? extends ReactionNode> modelInputReactionNodeType, boolean inputWarning,
+			Class<? extends ReactionNode> modelOutputReactionNodeType, boolean outputWarning) {
+		this(
+				gpmlInteractionType, gpmlLineStyle, modelReactionType, interactionWarning, modelInputReactionNodeType, inputWarning, modelOutputReactionNodeType,
+				outputWarning, false);
+	}
+
+	/**
+	 * @return the gpmlInteractionType
+	 * @see #gpmlInteractionType
+	 */
+	public GpmlInteractionType getGpmlInteractionType() {
+		return gpmlInteractionType;
+	}
+
+	/**
+	 * @return the modelReactionType
+	 * @see #modelReactionType
+	 */
+	public Class<? extends Reaction> getModelReactionType() {
+		return modelReactionType;
+	}
+
+	/**
+	 * @return the modelInputReactionNodeType
+	 * @see #modelInputReactionNodeType
+	 */
+	public Class<? extends ReactionNode> getModelInputReactionNodeType() {
+		return modelInputReactionNodeType;
+	}
+
+	/**
+	 * @return the modelOutputReactionNodeType
+	 * @see #modelOutputReactionNodeType
+	 */
+	public Class<? extends ReactionNode> getModelOutputReactionNodeType() {
+		return modelOutputReactionNodeType;
+	}
+
+	/**
+	 * @return the reversible
+	 * @see #reversible
+	 */
+	public boolean isReversible() {
+		return reversible;
+	}
+
+	/**
+	 * @return the interactionWarning
+	 * @see #interactionWarning
+	 */
+	public boolean isInteractionWarning() {
+		return interactionWarning;
+	}
+
+	/**
+	 * @return the inputWarning
+	 * @see #inputWarning
+	 */
+	public boolean isInputWarning() {
+		return inputWarning;
+	}
+
+	/**
+	 * @return the outputWarning
+	 * @see #outputWarning
+	 */
+	public boolean isOutputWarning() {
+		return outputWarning;
+	}
+
+	/**
+	 * Method that is looking for the {@link InteractionMapping} that matches to
+	 * given gpml "arrow type" and "line type".
+	 * 
+	 * @param gpmlType
+	 *          gpml arrow type
+	 * @param lineType
+	 *          gpml line type
+	 * @return {@link InteractionMapping} that matches to given gpml "arrow type"
+	 *         and "line type"
+	 */
+	public static InteractionMapping getInteractionMapping(GpmlInteractionType gpmlType, LineType lineType) {
+		for (InteractionMapping mapping : InteractionMapping.values()) {
+			boolean arrowMatch = mapping.getGpmlInteractionType().equals(gpmlType);
+			boolean lineTypeMatch = lineType.equals(mapping.getGpmlLineStyle().getCorrespondingGlobalLineType());
+
+			if (arrowMatch && lineTypeMatch) {
+				return mapping;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * @return the gpmlLineStyle
+	 * @see #gpmlLineStyle
+	 */
+	public GpmlLineType getGpmlLineStyle() {
+		return gpmlLineStyle;
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/BiopaxParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/BiopaxParserTest.java
index 401f90c6b3..1185363569 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/BiopaxParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/BiopaxParserTest.java
@@ -1,62 +1,62 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Document;
-
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-import lcsb.mapviewer.wikipathway.model.biopax.BiopaxData;
-import lcsb.mapviewer.wikipathway.model.biopax.BiopaxPublication;
-
-public class BiopaxParserTest extends WikipathwaysTestFunctions {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParse() throws Exception {
-		try {
-			BiopaxParser parser = new BiopaxParser();
-			Document document = getXmlDocumentFromFile("testFiles/biopax/small.xml");
-			BiopaxData data = parser.parse(document.getFirstChild());
-			assertNotNull(data);
-			assertEquals(2, data.getPublications().size());
-			BiopaxPublication publication = data.getPublicationByReference("cf2");
-			assertEquals("23456", publication.getId());
-			assertEquals("PubMed", publication.getDb());
-			assertEquals("[Radical resection of foci in tuberculosis of the shoulder joint].", publication.getTitle());
-			assertEquals("Magy Traumatol Orthop Helyreallito Seb", publication.getSource());
-			assertEquals("1977", publication.getYear());
-			assertEquals("Udvarhelyi I", publication.getAuthors());
-			assertEquals("cf2", publication.getReferenceId());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testIncorrectPumeds() throws Exception {
-		try {
-			BiopaxParser parser = new BiopaxParser();
-			Document document = getXmlDocumentFromFile("testFiles/biopax/invalid_pubmed_reference.xml");
-			BiopaxData data = parser.parse(document.getFirstChild());
-			assertNotNull(data);
-			assertTrue(getWarnings().size() > 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Document;
+
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+import lcsb.mapviewer.wikipathway.model.biopax.BiopaxData;
+import lcsb.mapviewer.wikipathway.model.biopax.BiopaxPublication;
+
+public class BiopaxParserTest extends WikipathwaysTestFunctions {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParse() throws Exception {
+		try {
+			BiopaxParser parser = new BiopaxParser();
+			Document document = getXmlDocumentFromFile("testFiles/biopax/small.xml");
+			BiopaxData data = parser.parse(document.getFirstChild());
+			assertNotNull(data);
+			assertEquals(2, data.getPublications().size());
+			BiopaxPublication publication = data.getPublicationByReference("cf2");
+			assertEquals("23456", publication.getId());
+			assertEquals("PubMed", publication.getDb());
+			assertEquals("[Radical resection of foci in tuberculosis of the shoulder joint].", publication.getTitle());
+			assertEquals("Magy Traumatol Orthop Helyreallito Seb", publication.getSource());
+			assertEquals("1977", publication.getYear());
+			assertEquals("Udvarhelyi I", publication.getAuthors());
+			assertEquals("cf2", publication.getReferenceId());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testIncorrectPumeds() throws Exception {
+		try {
+			BiopaxParser parser = new BiopaxParser();
+			Document document = getXmlDocumentFromFile("testFiles/biopax/invalid_pubmed_reference.xml");
+			BiopaxData data = parser.parse(document.getFirstChild());
+			assertNotNull(data);
+			assertTrue(getWarnings().size() > 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/BugTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/BugTest.java
index ccc8c5f9b2..f4057ac931 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/BugTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/BugTest.java
@@ -1,69 +1,69 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-
-import org.apache.log4j.Logger;
-import org.junit.Test;
-
-import lcsb.mapviewer.converter.ConverterParams;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelComparator;
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-
-public class BugTest extends WikipathwaysTestFunctions {
-	Logger logger = Logger.getLogger(BugTest.class);
-
-	@Test
-	public void testBug319() throws Exception {
-		try {
-			String fileName = "testFiles/bugs/error_319.gpml";
-			FileInputStream fis = new FileInputStream(fileName);
-			new GpmlParser().createGraph(fis);
-			assertEquals(1, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private ModelComparator mc = new ModelComparator(1.0);
-
-	@Test
-	public void testBug328() throws Exception {
-		try {
-			String filename = "testFiles/bugs/error_328.gpml";
-			Model model1 = new GPMLToModel().getModel(filename);
-
-			assertEquals(7, model1.getCreationWarnings().size());
-
-			int complexes = 0;
-			for (Alias alias : model1.getAliases()) {
-				if (alias instanceof ComplexAlias) {
-					complexes++;
-				}
-			}
-			assertEquals("Invalid number of complexes", 1, complexes);
-
-			CellDesignerXmlParser parser = new CellDesignerXmlParser();
-			String xml = parser.toXml(model1);
-			InputStream is = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8));
-
-			Model model2 = parser.createModel(new ConverterParams().inputStream(is).sizeAutoAdjust(false));
-
-			assertEquals("File " + filename + " different after transformation", 0, mc.compare(model1, model2));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.log4j.Logger;
+import org.junit.Test;
+
+import lcsb.mapviewer.converter.ConverterParams;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelComparator;
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+
+public class BugTest extends WikipathwaysTestFunctions {
+	Logger logger = Logger.getLogger(BugTest.class);
+
+	@Test
+	public void testBug319() throws Exception {
+		try {
+			String fileName = "testFiles/bugs/error_319.gpml";
+			FileInputStream fis = new FileInputStream(fileName);
+			new GpmlParser().createGraph(fis);
+			assertEquals(1, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private ModelComparator mc = new ModelComparator(1.0);
+
+	@Test
+	public void testBug328() throws Exception {
+		try {
+			String filename = "testFiles/bugs/error_328.gpml";
+			Model model1 = new GPMLToModel().getModel(filename);
+
+			assertEquals(7, model1.getCreationWarnings().size());
+
+			int complexes = 0;
+			for (Alias alias : model1.getAliases()) {
+				if (alias instanceof ComplexAlias) {
+					complexes++;
+				}
+			}
+			assertEquals("Invalid number of complexes", 1, complexes);
+
+			CellDesignerXmlParser parser = new CellDesignerXmlParser();
+			String xml = parser.toXml(model1);
+			InputStream is = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8));
+
+			Model model2 = parser.createModel(new ConverterParams().inputStream(is).sizeAutoAdjust(false));
+
+			assertEquals("File " + filename + " different after transformation", 0, mc.compare(model1, model2));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/DataNodeParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/DataNodeParserTest.java
index ff4a3f911d..6dc793949e 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/DataNodeParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/DataNodeParserTest.java
@@ -1,59 +1,59 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Element;
-
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-import lcsb.mapviewer.wikipathway.model.DataNode;
-
-public class DataNodeParserTest extends WikipathwaysTestFunctions {
-	Logger				 logger	= Logger.getLogger(DataNodeParserTest.class);
-	DataNodeParser parser	= new DataNodeParser();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseGene() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/gene.xml");
-			DataNode dataNode = parser.parse(node);
-
-			assertNotNull(dataNode);
-			assertEquals("GeneProduct", dataNode.getTextLabel());
-			assertEquals("ab30b", dataNode.getGraphId());
-			assertEquals(1, dataNode.getBiopaxReference().size());
-			assertEquals("aea", dataNode.getBiopaxReference().get(0));
-			assertEquals(1, dataNode.getReferences().size());
-			assertEquals(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"), dataNode.getReferences().get(0));
-
-			assertEquals((Integer) 32768, dataNode.getzOrder());
-			assertEquals((Double) 10.0, dataNode.getFontSize());
-			assertEquals("Middle", dataNode.getvAlign());
-			assertEquals("GeneProduct", dataNode.getType());
-			assertTrue(dataNode.getComments().contains("comment 1"));
-			assertTrue(dataNode.getComments().contains("Type your comment here"));
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Element;
+
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+import lcsb.mapviewer.wikipathway.model.DataNode;
+
+public class DataNodeParserTest extends WikipathwaysTestFunctions {
+	Logger				 logger	= Logger.getLogger(DataNodeParserTest.class);
+	DataNodeParser parser	= new DataNodeParser();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseGene() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/gene.xml");
+			DataNode dataNode = parser.parse(node);
+
+			assertNotNull(dataNode);
+			assertEquals("GeneProduct", dataNode.getTextLabel());
+			assertEquals("ab30b", dataNode.getGraphId());
+			assertEquals(1, dataNode.getBiopaxReference().size());
+			assertEquals("aea", dataNode.getBiopaxReference().get(0));
+			assertEquals(1, dataNode.getReferences().size());
+			assertEquals(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"), dataNode.getReferences().get(0));
+
+			assertEquals((Integer) 32768, dataNode.getzOrder());
+			assertEquals((Double) 10.0, dataNode.getFontSize());
+			assertEquals("Middle", dataNode.getvAlign());
+			assertEquals("GeneProduct", dataNode.getType());
+			assertTrue(dataNode.getComments().contains("comment 1"));
+			assertTrue(dataNode.getComments().contains("Type your comment here"));
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/EdgeLineParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/EdgeLineParserTest.java
index 51be34fbc8..2b3c0126fc 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/EdgeLineParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/EdgeLineParserTest.java
@@ -1,55 +1,55 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Point2D;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Element;
-
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-import lcsb.mapviewer.wikipathway.model.Edge;
-
-public class EdgeLineParserTest extends WikipathwaysTestFunctions {
-
-	EdgeLineParser parser = new EdgeLineParser();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseLine() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/line.xml");
-			Edge edge = parser.parse(node);
-			assertNotNull(edge);
-
-			assertEquals(1, edge.getBiopaxReferences().size());
-			assertEquals("c64", edge.getBiopaxReferences().get(0));
-
-			assertEquals((Integer) 12288, edge.getzOrder());
-			assertEquals(1.0, edge.getLine().getWidth(), EPSILON);
-			assertTrue(edge.getComments().contains("line comment"));
-			assertTrue(edge.getComments().contains("Type your comment here"));
-
-			assertTrue(new Point2D.Double(730, 265).distance(edge.getLine().getBeginPoint()) < EPSILON);
-			assertTrue(new Point2D.Double(931.0, 442.0).distance(edge.getLine().getEndPoint()) < EPSILON);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Point2D;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Element;
+
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+import lcsb.mapviewer.wikipathway.model.Edge;
+
+public class EdgeLineParserTest extends WikipathwaysTestFunctions {
+
+	EdgeLineParser parser = new EdgeLineParser();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseLine() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/line.xml");
+			Edge edge = parser.parse(node);
+			assertNotNull(edge);
+
+			assertEquals(1, edge.getBiopaxReferences().size());
+			assertEquals("c64", edge.getBiopaxReferences().get(0));
+
+			assertEquals((Integer) 12288, edge.getzOrder());
+			assertEquals(1.0, edge.getLine().getWidth(), EPSILON);
+			assertTrue(edge.getComments().contains("line comment"));
+			assertTrue(edge.getComments().contains("Type your comment here"));
+
+			assertTrue(new Point2D.Double(730, 265).distance(edge.getLine().getBeginPoint()) < EPSILON);
+			assertTrue(new Point2D.Double(931.0, 442.0).distance(edge.getLine().getEndPoint()) < EPSILON);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ElementGpmlParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ElementGpmlParserTest.java
index 8e084cf53e..9a021ad85d 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ElementGpmlParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ElementGpmlParserTest.java
@@ -1,54 +1,54 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.awt.Color;
-import java.util.Collection;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Element;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.ConverterException;
-
-public class ElementGpmlParserTest {
-
-	ElementGpmlParser<Object> parser = new ElementGpmlParser<Object>() {
-		@Override
-		public String toXml(Collection<Object> list) throws ConverterException {
-			throw new NotImplementedException();
-		}
-
-		@Override
-		public String toXml(Object object) throws ConverterException {
-			throw new NotImplementedException();
-		}
-
-		@Override
-		public Object parse(Element node) throws ConverterException {
-			throw new NotImplementedException();
-		}
-	};
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseTransparentColor() {
-		try {
-			Color color = parser.hexStringToColor("Transparent");
-			assertNotNull(color);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.awt.Color;
+import java.util.Collection;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Element;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.ConverterException;
+
+public class ElementGpmlParserTest {
+
+	ElementGpmlParser<Object> parser = new ElementGpmlParser<Object>() {
+		@Override
+		public String toXml(Collection<Object> list) throws ConverterException {
+			throw new NotImplementedException();
+		}
+
+		@Override
+		public String toXml(Object object) throws ConverterException {
+			throw new NotImplementedException();
+		}
+
+		@Override
+		public Object parse(Element node) throws ConverterException {
+			throw new NotImplementedException();
+		}
+	};
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseTransparentColor() {
+		try {
+			Color color = parser.hexStringToColor("Transparent");
+			assertNotNull(color);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/GpmlParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/GpmlParserTest.java
index 254110e418..c9353e4940 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/GpmlParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/GpmlParserTest.java
@@ -1,150 +1,150 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.FileInputStream;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-import lcsb.mapviewer.wikipathway.model.Graph;
-import lcsb.mapviewer.wikipathway.model.Interaction;
-
-public class GpmlParserTest extends WikipathwaysTestFunctions {
-	Logger logger = Logger.getLogger(GpmlParserTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testEdgeAttributes() throws Exception {
-		try {
-
-			String fileName = "testFiles/small/missing_aliases_in_compartment.gpml";
-			FileInputStream fis = new FileInputStream(fileName);
-			Graph graph = new GpmlParser().createGraph(fis);
-			assertNotNull(graph);
-			assertEquals(3, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCycliReactions() throws Exception {
-		try {
-
-			String fileName = "testFiles/small/cyclic_reactions.gpml";
-			FileInputStream fis = new FileInputStream(fileName);
-			Graph graph = new GpmlParser().createGraph(fis);
-			assertNotNull(graph);
-			assertEquals(3, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testBiopaxVocabulary() throws Exception {
-		try {
-
-			String fileName = "testFiles/small/opencontrolledvocabulary.gpml";
-			FileInputStream fis = new FileInputStream(fileName);
-			Graph graph = new GpmlParser().createGraph(fis);
-
-			assertEquals(1, graph.getBiopaxData().getOpenControlledVocabularies().size());
-			assertEquals(0, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testModelAttribute() throws Exception {
-		try {
-
-			String fileName = "testFiles/small/model_attribute.gpml";
-			FileInputStream fis = new FileInputStream(fileName);
-			Graph graph = new GpmlParser().createGraph(fis);
-
-			assertEquals("428359", graph.getAttributes().get("reactome_id"));
-			assertEquals(0, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testModelAnnotations() throws Exception {
-		try {
-
-			String fileName = "testFiles/small/model_annotations.gpml";
-			FileInputStream fis = new FileInputStream(fileName);
-			Graph graph = new GpmlParser().createGraph(fis);
-
-			assertEquals(6, graph.getBiopaxReferences().size());
-			assertEquals(0, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testModelLines() throws Exception {
-		try {
-
-			String fileName = "testFiles/small/model_with_line.gpml";
-			FileInputStream fis = new FileInputStream(fileName);
-			Graph graph = new GpmlParser().createGraph(fis);
-
-			assertEquals(1, graph.getLines().size());
-			PolylineData pd = graph.getLines().get(0);
-			assertEquals(3, pd.getPoints().size());
-			assertEquals(0, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSimpleReaction() throws Exception {
-		try {
-
-			String fileName = "testFiles/small/simple_reaction.gpml";
-			FileInputStream fis = new FileInputStream(fileName);
-			Graph graph = new GpmlParser().createGraph(fis);
-
-			Interaction interaction = graph.getInteractions().iterator().next();
-			PolylineData pd = interaction.getLine();
-			assertTrue(pd.getPoints().get(0).distance(476.0, 351.0) < EPSILON);
-			assertTrue(pd.getPoints().get(1).distance(476.0, 286.0) < EPSILON);
-			assertTrue(pd.getPoints().get(2).distance(846.0, 287.0) < EPSILON);
-			assertTrue(pd.getPoints().get(3).distance(846.0, 354.0) < EPSILON);
-
-			assertEquals(0, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.FileInputStream;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+import lcsb.mapviewer.wikipathway.model.Graph;
+import lcsb.mapviewer.wikipathway.model.Interaction;
+
+public class GpmlParserTest extends WikipathwaysTestFunctions {
+	Logger logger = Logger.getLogger(GpmlParserTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testEdgeAttributes() throws Exception {
+		try {
+
+			String fileName = "testFiles/small/missing_aliases_in_compartment.gpml";
+			FileInputStream fis = new FileInputStream(fileName);
+			Graph graph = new GpmlParser().createGraph(fis);
+			assertNotNull(graph);
+			assertEquals(3, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCycliReactions() throws Exception {
+		try {
+
+			String fileName = "testFiles/small/cyclic_reactions.gpml";
+			FileInputStream fis = new FileInputStream(fileName);
+			Graph graph = new GpmlParser().createGraph(fis);
+			assertNotNull(graph);
+			assertEquals(3, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testBiopaxVocabulary() throws Exception {
+		try {
+
+			String fileName = "testFiles/small/opencontrolledvocabulary.gpml";
+			FileInputStream fis = new FileInputStream(fileName);
+			Graph graph = new GpmlParser().createGraph(fis);
+
+			assertEquals(1, graph.getBiopaxData().getOpenControlledVocabularies().size());
+			assertEquals(0, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testModelAttribute() throws Exception {
+		try {
+
+			String fileName = "testFiles/small/model_attribute.gpml";
+			FileInputStream fis = new FileInputStream(fileName);
+			Graph graph = new GpmlParser().createGraph(fis);
+
+			assertEquals("428359", graph.getAttributes().get("reactome_id"));
+			assertEquals(0, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testModelAnnotations() throws Exception {
+		try {
+
+			String fileName = "testFiles/small/model_annotations.gpml";
+			FileInputStream fis = new FileInputStream(fileName);
+			Graph graph = new GpmlParser().createGraph(fis);
+
+			assertEquals(6, graph.getBiopaxReferences().size());
+			assertEquals(0, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testModelLines() throws Exception {
+		try {
+
+			String fileName = "testFiles/small/model_with_line.gpml";
+			FileInputStream fis = new FileInputStream(fileName);
+			Graph graph = new GpmlParser().createGraph(fis);
+
+			assertEquals(1, graph.getLines().size());
+			PolylineData pd = graph.getLines().get(0);
+			assertEquals(3, pd.getPoints().size());
+			assertEquals(0, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSimpleReaction() throws Exception {
+		try {
+
+			String fileName = "testFiles/small/simple_reaction.gpml";
+			FileInputStream fis = new FileInputStream(fileName);
+			Graph graph = new GpmlParser().createGraph(fis);
+
+			Interaction interaction = graph.getInteractions().iterator().next();
+			PolylineData pd = interaction.getLine();
+			assertTrue(pd.getPoints().get(0).distance(476.0, 351.0) < EPSILON);
+			assertTrue(pd.getPoints().get(1).distance(476.0, 286.0) < EPSILON);
+			assertTrue(pd.getPoints().get(2).distance(846.0, 287.0) < EPSILON);
+			assertTrue(pd.getPoints().get(3).distance(846.0, 354.0) < EPSILON);
+
+			assertEquals(0, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/LabelParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/LabelParserTest.java
index 711fa381ff..29858d4377 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/LabelParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/LabelParserTest.java
@@ -1,72 +1,72 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.Color;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Element;
-
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-import lcsb.mapviewer.wikipathway.model.Label;
-
-public class LabelParserTest extends WikipathwaysTestFunctions {
-	LabelParser parser = new LabelParser();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseLabel() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/label.xml");
-			Label label = parser.parse(node);
-			assertNotNull(label);
-
-			assertEquals("Label 2", label.getTextLabel());
-			assertEquals("edf06", label.getGraphId());
-			assertEquals(2, label.getBiopaxReference().size());
-			assertEquals("b38", label.getBiopaxReference().get(1));
-
-			assertEquals((Integer) 28672, label.getzOrder());
-			assertEquals((Double) 10.0, label.getFontSize());
-			assertEquals("Middle", label.getvAlign());
-			assertTrue(label.getComments().contains("comment 2"));
-			assertEquals(Color.WHITE, label.getFillColor());
-			assertEquals(Color.BLACK, label.getColor());
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseGraphics() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/label_graphics.xml");
-
-			Label label = new Label("test");
-			parser.parseGraphics(node, label);
-			assertNotNull(label);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.Color;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Element;
+
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+import lcsb.mapviewer.wikipathway.model.Label;
+
+public class LabelParserTest extends WikipathwaysTestFunctions {
+	LabelParser parser = new LabelParser();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseLabel() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/label.xml");
+			Label label = parser.parse(node);
+			assertNotNull(label);
+
+			assertEquals("Label 2", label.getTextLabel());
+			assertEquals("edf06", label.getGraphId());
+			assertEquals(2, label.getBiopaxReference().size());
+			assertEquals("b38", label.getBiopaxReference().get(1));
+
+			assertEquals((Integer) 28672, label.getzOrder());
+			assertEquals((Double) 10.0, label.getFontSize());
+			assertEquals("Middle", label.getvAlign());
+			assertTrue(label.getComments().contains("comment 2"));
+			assertEquals(Color.WHITE, label.getFillColor());
+			assertEquals(Color.BLACK, label.getColor());
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseGraphics() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/label_graphics.xml");
+
+			Label label = new Label("test");
+			parser.parseGraphics(node, label);
+			assertNotNull(label);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ModelToGPMLTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ModelToGPMLTest.java
index 5cf3ff1f4e..02af42b121 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ModelToGPMLTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ModelToGPMLTest.java
@@ -1,100 +1,100 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.converter.ConverterParams;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-
-public class ModelToGPMLTest extends WikipathwaysTestFunctions {
-	Logger logger = Logger.getLogger(ModelToGPMLTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void test() throws Exception {
-		try {
-			ModelToGPML parser = new ModelToGPML();
-			CellDesignerXmlParser cellDesignerXmlParser = new CellDesignerXmlParser();
-			Model model = cellDesignerXmlParser.createModel(new ConverterParams().filename("testFiles/other_full/GSTP1 subnetwork_220214.xml"));
-			String xml = parser.getGPML(model);
-			assertNotNull(xml);
-			assertEquals(0, model.getCreationWarnings().size());
-			assertEquals(10, getWarnings().size());
-
-			Model model2 = new GPMLToModel().getModel(new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
-			assertNotNull(model2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAnnotations() throws Exception {
-		try {
-			ModelToGPML parser = new ModelToGPML();
-
-			Model model = new ModelFullIndexed(null);
-			model.setWidth(1000);
-			model.setHeight(1000);
-
-			Protein protein = new GenericProtein();
-			protein.setElementId("s1");
-			protein.setName("s2");
-			protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
-			protein.addMiriamData(new MiriamData(MiriamType.PUBMED, "123"));
-			protein.addMiriamData(new MiriamData(MiriamType.PUBMED, "1234"));
-			model.addElement(protein);
-			SpeciesAlias alias = new SpeciesAlias(protein);
-			alias.setAliasId("sa");
-			alias.setWidth(10);
-			alias.setHeight(10);
-			alias.setX(1);
-			alias.setY(1);
-
-			model.addAlias(alias);
-
-			String xml = parser.getGPML(model);
-			assertNotNull(xml);
-			assertEquals(0, getWarnings().size());
-
-			Model model2 = new GPMLToModel().getModel(new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
-
-			Protein p = model2.getElementByElementId("sa");
-
-			assertEquals(protein.getMiriamData().size(), p.getMiriamData().size());
-			for (MiriamData md : p.getMiriamData()) {
-				assertTrue(protein.getMiriamData().contains(md));
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.converter.ConverterParams;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+
+public class ModelToGPMLTest extends WikipathwaysTestFunctions {
+	Logger logger = Logger.getLogger(ModelToGPMLTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void test() throws Exception {
+		try {
+			ModelToGPML parser = new ModelToGPML();
+			CellDesignerXmlParser cellDesignerXmlParser = new CellDesignerXmlParser();
+			Model model = cellDesignerXmlParser.createModel(new ConverterParams().filename("testFiles/other_full/GSTP1 subnetwork_220214.xml"));
+			String xml = parser.getGPML(model);
+			assertNotNull(xml);
+			assertEquals(0, model.getCreationWarnings().size());
+			assertEquals(10, getWarnings().size());
+
+			Model model2 = new GPMLToModel().getModel(new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
+			assertNotNull(model2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAnnotations() throws Exception {
+		try {
+			ModelToGPML parser = new ModelToGPML();
+
+			Model model = new ModelFullIndexed(null);
+			model.setWidth(1000);
+			model.setHeight(1000);
+
+			GenericProtein protein = new GenericProtein();
+			protein.setElementId("s1");
+			protein.setName("s2");
+			protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
+			protein.addMiriamData(new MiriamData(MiriamType.PUBMED, "123"));
+			protein.addMiriamData(new MiriamData(MiriamType.PUBMED, "1234"));
+			model.addElement(protein);
+			GenericProteinAlias alias = new GenericProteinAlias(protein);
+			alias.setAliasId("sa");
+			alias.setWidth(10);
+			alias.setHeight(10);
+			alias.setX(1);
+			alias.setY(1);
+
+			model.addAlias(alias);
+
+			String xml = parser.getGPML(model);
+			assertNotNull(xml);
+			assertEquals(0, getWarnings().size());
+
+			Model model2 = new GPMLToModel().getModel(new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
+
+			Protein p = model2.getElementByElementId("sa");
+
+			assertEquals(protein.getMiriamData().size(), p.getMiriamData().size());
+			for (MiriamData md : p.getMiriamData()) {
+				assertTrue(protein.getMiriamData().contains(md));
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ReferenceParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ReferenceParserTest.java
index a373252702..90b6a8c53b 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ReferenceParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ReferenceParserTest.java
@@ -1,158 +1,158 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-
-public class ReferenceParserTest extends WikipathwaysTestFunctions {
-	Logger					logger = Logger.getLogger(ReferenceParserTest.class);
-
-	ReferenceParser	mc		 = new ReferenceParser();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCreateHmdbMiriam() {
-		MiriamData md = mc.createMiriamData("HMDB03791", "HMDB");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testCreateWormBaseMiriam() {
-		MiriamData md = mc.createMiriamData("WormBase", "WormBase");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testSgdMiriam() {
-		MiriamData md = mc.createMiriamData("S000028457", "SGD");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testWikidataMiriam() {
-		MiriamData md = mc.createMiriamData("Q15623825", "Wikidata");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testCreateEnsemblPlantMiriam() {
-		MiriamData md = mc.createMiriamData("AT3G18550", "Ensembl Plants");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testCreateCasMiriam() {
-		MiriamData md = mc.createMiriamData("657-24-9", "CAS");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testCreateGenBankMiriam() {
-		MiriamData md = mc.createMiriamData("123", "GenBank");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testCreatePubchemMiriam() {
-		MiriamData md = mc.createMiriamData("39484", "pubchem.compound");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testCreateWikipediaMiriam() {
-		MiriamData md = mc.createMiriamData("Reactive_oxygen_species", "Wikipedia");
-		assertNotNull(md);
-	}
-
-	@Test
-	public void testCreateKeggOrthologyMiriam() throws Exception {
-		try {
-			MiriamData md = mc.createMiriamData("K00114", "Kegg ortholog");
-			assertNotNull(md);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testChemSpiderMiriam() throws Exception {
-		try {
-			MiriamData md = mc.createMiriamData("110354", "Chemspider");
-			assertNotNull(md);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testPfamMiriam() throws Exception {
-		try {
-			MiriamData md = mc.createMiriamData("PF00071", "Pfam");
-			assertNotNull(md);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testMiRBaseMiriam() throws Exception {
-		try {
-			MiriamData md = mc.createMiriamData("MI0000750", "miRBase");
-			assertNotNull(md);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParse() throws Exception {
-		try {
-			Node node = super.getXmlDocumentFromFile("testFiles/elements/xref.xml");
-			MiriamData md = mc.parse((Element) node.getFirstChild());
-			assertNotNull(md);
-			assertEquals(md, new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
-			assertEquals(0, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testToXml() throws Exception {
-		try {
-			MiriamData md = new MiriamData(MiriamType.CHEBI, "CHEBI:123");
-			String xml = mc.toXml(md);
-
-			Node node = super.getNodeFromXmlString(xml);
-			MiriamData md2 = mc.parse((Element) node);
-			assertNotNull(md);
-			assertEquals(md, md2);
-			assertEquals(0, getWarnings().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+
+public class ReferenceParserTest extends WikipathwaysTestFunctions {
+	Logger					logger = Logger.getLogger(ReferenceParserTest.class);
+
+	ReferenceParser	mc		 = new ReferenceParser();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCreateHmdbMiriam() {
+		MiriamData md = mc.createMiriamData("HMDB03791", "HMDB");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testCreateWormBaseMiriam() {
+		MiriamData md = mc.createMiriamData("WormBase", "WormBase");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testSgdMiriam() {
+		MiriamData md = mc.createMiriamData("S000028457", "SGD");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testWikidataMiriam() {
+		MiriamData md = mc.createMiriamData("Q15623825", "Wikidata");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testCreateEnsemblPlantMiriam() {
+		MiriamData md = mc.createMiriamData("AT3G18550", "Ensembl Plants");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testCreateCasMiriam() {
+		MiriamData md = mc.createMiriamData("657-24-9", "CAS");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testCreateGenBankMiriam() {
+		MiriamData md = mc.createMiriamData("123", "GenBank");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testCreatePubchemMiriam() {
+		MiriamData md = mc.createMiriamData("39484", "pubchem.compound");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testCreateWikipediaMiriam() {
+		MiriamData md = mc.createMiriamData("Reactive_oxygen_species", "Wikipedia");
+		assertNotNull(md);
+	}
+
+	@Test
+	public void testCreateKeggOrthologyMiriam() throws Exception {
+		try {
+			MiriamData md = mc.createMiriamData("K00114", "Kegg ortholog");
+			assertNotNull(md);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testChemSpiderMiriam() throws Exception {
+		try {
+			MiriamData md = mc.createMiriamData("110354", "Chemspider");
+			assertNotNull(md);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testPfamMiriam() throws Exception {
+		try {
+			MiriamData md = mc.createMiriamData("PF00071", "Pfam");
+			assertNotNull(md);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testMiRBaseMiriam() throws Exception {
+		try {
+			MiriamData md = mc.createMiriamData("MI0000750", "miRBase");
+			assertNotNull(md);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParse() throws Exception {
+		try {
+			Node node = super.getXmlDocumentFromFile("testFiles/elements/xref.xml");
+			MiriamData md = mc.parse((Element) node.getFirstChild());
+			assertNotNull(md);
+			assertEquals(md, new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
+			assertEquals(0, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testToXml() throws Exception {
+		try {
+			MiriamData md = new MiriamData(MiriamType.CHEBI, "CHEBI:123");
+			String xml = mc.toXml(md);
+
+			Node node = super.getNodeFromXmlString(xml);
+			MiriamData md2 = mc.parse((Element) node);
+			assertNotNull(md);
+			assertEquals(md, md2);
+			assertEquals(0, getWarnings().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ShapeParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ShapeParserTest.java
index 20b89ad10a..9240b59dac 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ShapeParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ShapeParserTest.java
@@ -1,215 +1,215 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.Color;
-
-import org.junit.After;
-import org.junit.Test;
-import org.w3c.dom.Element;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.model.graphics.LineType;
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-import lcsb.mapviewer.wikipathway.model.Shape;
-
-public class ShapeParserTest extends WikipathwaysTestFunctions {
-	ShapeParser parser = new ShapeParser();
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseArc() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/arc.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals("arc l", shape.getTextLabel());
-			assertEquals("d3af4", shape.getGraphId());
-			assertEquals((Integer) 16384, shape.getzOrder());
-			assertEquals((Double) 10.0, shape.getFontSize());
-			assertEquals("Middle", shape.getvAlign());
-			assertEquals("Arc", shape.getShape());
-			assertEquals((Double) 0.0, shape.getRotation());
-			assertTrue(shape.getComments().contains("arc c"));
-			assertTrue(shape.getComments().contains("Type your comment here"));
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseBrace() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/brace.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals("dfdfs fds ", shape.getTextLabel());
-			assertEquals("eb55e", shape.getGraphId());
-			assertEquals(1, shape.getBiopaxReference().size());
-			assertEquals("d04", shape.getBiopaxReference().get(0));
-
-			assertEquals((Integer) 16384, shape.getzOrder());
-			assertEquals((Double) 10.0, shape.getFontSize());
-			assertEquals("Middle", shape.getvAlign());
-			assertEquals("Brace", shape.getShape());
-			assertEquals((Double) 0.44830711094422787, shape.getRotation(), Configuration.EPSILON);
-			assertTrue(shape.getComments().contains("1"));
-			assertTrue(shape.getComments().contains("Type your comment here"));
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseCompartment() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/compartment.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals("compartment title", shape.getTextLabel());
-			assertEquals("c5869", shape.getGraphId());
-			assertEquals(1, shape.getBiopaxReference().size());
-			assertEquals("b80", shape.getBiopaxReference().get(0));
-
-			assertEquals((Integer) 16384, shape.getzOrder());
-			assertEquals((Double) 10.0, shape.getFontSize());
-			assertEquals((Double) 3.0, shape.getLineThickness());
-			assertEquals(LineType.DOUBLE, shape.getLineType());
-			assertEquals("Middle", shape.getvAlign());
-			assertEquals("RoundedRectangle", shape.getShape());
-			assertEquals((Double) 0.0, shape.getRotation(), Configuration.EPSILON);
-			assertTrue(shape.getComments().contains("compartment comment here"));
-			assertTrue(shape.getComments().contains("Type your comment here"));
-			assertTrue(shape.isCompartment());
-			assertEquals(Color.LIGHT_GRAY, shape.getColor());
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseDegraded() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/degraded.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseHex() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/hex.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseOval() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/oval.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParsePent() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/pent.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseRect() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/rect.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseRoundedREct() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/rounded_rect.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseTriangle() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/triangle.xml");
-			Shape shape = parser.parse(node);
-			assertNotNull(shape);
-
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.Color;
+
+import org.junit.After;
+import org.junit.Test;
+import org.w3c.dom.Element;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.model.graphics.LineType;
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+import lcsb.mapviewer.wikipathway.model.Shape;
+
+public class ShapeParserTest extends WikipathwaysTestFunctions {
+	ShapeParser parser = new ShapeParser();
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseArc() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/arc.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals("arc l", shape.getTextLabel());
+			assertEquals("d3af4", shape.getGraphId());
+			assertEquals((Integer) 16384, shape.getzOrder());
+			assertEquals((Double) 10.0, shape.getFontSize());
+			assertEquals("Middle", shape.getvAlign());
+			assertEquals("Arc", shape.getShape());
+			assertEquals((Double) 0.0, shape.getRotation());
+			assertTrue(shape.getComments().contains("arc c"));
+			assertTrue(shape.getComments().contains("Type your comment here"));
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseBrace() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/brace.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals("dfdfs fds ", shape.getTextLabel());
+			assertEquals("eb55e", shape.getGraphId());
+			assertEquals(1, shape.getBiopaxReference().size());
+			assertEquals("d04", shape.getBiopaxReference().get(0));
+
+			assertEquals((Integer) 16384, shape.getzOrder());
+			assertEquals((Double) 10.0, shape.getFontSize());
+			assertEquals("Middle", shape.getvAlign());
+			assertEquals("Brace", shape.getShape());
+			assertEquals((Double) 0.44830711094422787, shape.getRotation(), Configuration.EPSILON);
+			assertTrue(shape.getComments().contains("1"));
+			assertTrue(shape.getComments().contains("Type your comment here"));
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseCompartment() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/compartment.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals("compartment title", shape.getTextLabel());
+			assertEquals("c5869", shape.getGraphId());
+			assertEquals(1, shape.getBiopaxReference().size());
+			assertEquals("b80", shape.getBiopaxReference().get(0));
+
+			assertEquals((Integer) 16384, shape.getzOrder());
+			assertEquals((Double) 10.0, shape.getFontSize());
+			assertEquals((Double) 3.0, shape.getLineThickness());
+			assertEquals(LineType.DOUBLE, shape.getLineType());
+			assertEquals("Middle", shape.getvAlign());
+			assertEquals("RoundedRectangle", shape.getShape());
+			assertEquals((Double) 0.0, shape.getRotation(), Configuration.EPSILON);
+			assertTrue(shape.getComments().contains("compartment comment here"));
+			assertTrue(shape.getComments().contains("Type your comment here"));
+			assertTrue(shape.isCompartment());
+			assertEquals(Color.LIGHT_GRAY, shape.getColor());
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseDegraded() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/degraded.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseHex() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/hex.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseOval() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/oval.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParsePent() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/pent.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseRect() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/rect.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseRoundedREct() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/rounded_rect.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseTriangle() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/triangle.xml");
+			Shape shape = parser.parse(node);
+			assertNotNull(shape);
+
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/StateParserTest.java b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/StateParserTest.java
index 868fab5d19..5332f30cbf 100644
--- a/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/StateParserTest.java
+++ b/pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/StateParserTest.java
@@ -1,44 +1,44 @@
-package lcsb.mapviewer.wikipathway.XML;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.Test;
-import org.w3c.dom.Element;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
-import lcsb.mapviewer.wikipathway.model.State;
-
-public class StateParserTest extends WikipathwaysTestFunctions {
-	StateParser parser = new StateParser();
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseState() throws Exception {
-		try {
-			Element node = fileToNode("testFiles/elements/state.xml");
-			State state = parser.parse(node);
-			assertNotNull(state);
-
-			assertEquals(ModificationState.PHOSPHORYLATED, state.getType());
-			assertEquals("e7637", state.getGraphId());
-			assertEquals(1.0, state.getRelX(), Configuration.EPSILON);
-			assertEquals(-0.9978969505783312, state.getRelY(), Configuration.EPSILON);
-			assertEquals(15.0, state.getWidth(), Configuration.EPSILON);
-			assertEquals(15.0, state.getHeight(), Configuration.EPSILON);
-			assertEquals("Oval", state.getShape());
-			assertEquals(0, getWarnings().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.wikipathway.XML;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.Test;
+import org.w3c.dom.Element;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+import lcsb.mapviewer.wikipathway.WikipathwaysTestFunctions;
+import lcsb.mapviewer.wikipathway.model.State;
+
+public class StateParserTest extends WikipathwaysTestFunctions {
+	StateParser parser = new StateParser();
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseState() throws Exception {
+		try {
+			Element node = fileToNode("testFiles/elements/state.xml");
+			State state = parser.parse(node);
+			assertNotNull(state);
+
+			assertEquals(ModificationState.PHOSPHORYLATED, state.getType());
+			assertEquals("e7637", state.getGraphId());
+			assertEquals(1.0, state.getRelX(), Configuration.EPSILON);
+			assertEquals(-0.9978969505783312, state.getRelY(), Configuration.EPSILON);
+			assertEquals(15.0, state.getWidth(), Configuration.EPSILON);
+			assertEquals(15.0, state.getHeight(), Configuration.EPSILON);
+			assertEquals("Oval", state.getShape());
+			assertEquals(0, getWarnings().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/persist/src/db/10.0.2/fix_db_20160926.sql b/persist/src/db/10.0.2/fix_db_20160926.sql
new file mode 100644
index 0000000000..3eacb08493
--- /dev/null
+++ b/persist/src/db/10.0.2/fix_db_20160926.sql
@@ -0,0 +1,35 @@
+-- change alias types for new aliases implementation 
+update alias_table set alias_type_db = 'ANTISENSE_RNA_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Antisense RNA');
+
+--chemical_alias (should never happen)
+update alias_table set alias_type_db = 'CHEMICAL_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Chemical');
+
+update alias_table set alias_type_db = 'ION_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Ion');
+
+update alias_table set alias_type_db = 'SIMPLE_MOLECULE_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='SimpleMolecule');
+
+-- complex_alias (nothing should change)
+update alias_table set alias_type_db = 'Complex Species Alias' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='COMPLEX_SPECIES');
+
+update alias_table set alias_type_db = 'DEGRADED_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Degraded');
+
+update alias_table set alias_type_db = 'DRUG_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Drug');
+
+update alias_table set alias_type_db = 'GENE_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Gene');
+
+update alias_table set alias_type_db = 'PHENTOYPE_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Phenotype');
+
+-- protein_alias (this should never happen)
+update alias_table set alias_type_db = 'PROTEIN_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Protein');
+
+update alias_table set alias_type_db = 'GENERIC_PROTEIN_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='GENERIC_PROTEIN');
+
+update alias_table set alias_type_db = 'ION_CHANNEL_PROTEIN_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='ION_CHANNEL_PROTEIN');
+
+update alias_table set alias_type_db = 'RECEPTOR_PROTEIN_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='RECEPTOR_PROTEIN');
+
+update alias_table set alias_type_db = 'TRUNCATED_PROTEIN_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='TRUNCATED_PROTEIN');
+
+update alias_table set alias_type_db = 'RNA_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='RNA');
+
+update alias_table set alias_type_db = 'UNKNOWN_ALIAS' where iddb in (select alias_table.iddb from alias_table , species_table t where alias_table.idelementdb=t.iddb and t.species_type_db ='Unknown');
diff --git a/persist/src/main/java/lcsb/mapviewer/persist/dao/BaseDao.java b/persist/src/main/java/lcsb/mapviewer/persist/dao/BaseDao.java
index 06d322518c..02afc0199a 100644
--- a/persist/src/main/java/lcsb/mapviewer/persist/dao/BaseDao.java
+++ b/persist/src/main/java/lcsb/mapviewer/persist/dao/BaseDao.java
@@ -1,293 +1,293 @@
-package lcsb.mapviewer.persist.dao;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.hibernate.Session;
-import org.hibernate.criterion.Projections;
-import org.hibernate.criterion.Restrictions;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.persist.DbUtils;
-
-/**
- * Abstract interface for data access object in the system. Containts the basic
- * generic functionality.
- * 
- * @author Piotr Gawron
- * 
- * @param <T>
- *          type for which data access object is created
- */
-public abstract class BaseDao<T> {
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger			 logger					 = Logger.getLogger(BaseDao.class);
-
-	/**
-	 * Sometimes objects have a flag that indicate that the object was removed
-	 * from the system (but is still there because of foreign keys etc). This
-	 * column determines the name of the column. If its set to null then such
-	 * column doesn't exist.
-	 */
-	private String						 removableColumn = null;
-
-	/**
-	 * Class of the object that DAO works on.
-	 */
-	private Class<? extends T> clazz;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param theClass
-	 *          class of the object that DAO will work on
-	 */
-	public BaseDao(Class<? extends T> theClass) {
-		this.clazz = theClass;
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param theClass
-	 *          class of the object that DAO will work on
-	 * @param removableColumn
-	 *          determines the column in the object table that indicates if object
-	 *          should be considered as removed or not (see also:
-	 *          {@link #removableColumn}.
-	 * 
-	 */
-	public BaseDao(Class<? extends T> theClass, String removableColumn) {
-		this(theClass);
-		this.removableColumn = removableColumn;
-	}
-
-	/**
-	 * Utils that help to manage the sessions in custom multithreaded
-	 * implementation.
-	 */
-	@Autowired
-	private DbUtils dbUtils;
-
-	/**
-	 * Adds object to the database.
-	 * 
-	 * @param object
-	 *          object to add to database
-	 */
-	public void add(T object) {
-		getSession().save(object);
-		if (dbUtils.isAutoFlush()) {
-			getSession().flush();
-		}
-	}
-
-	/**
-	 * Flush connection with database.
-	 */
-	public void flush() {
-		getSession().flush();
-	}
-
-	/**
-	 * Commit current transaction.
-	 */
-	public void commit() {
-		if (!dbUtils.isCustomSessionForCurrentThread()) {
-			logger.warn("Manual commit with spring managed session!", new Exception());
-		}
-
-		getSession().getTransaction().commit();
-		getSession().beginTransaction();
-	}
-
-	/**
-	 * Returns current session.
-	 * 
-	 * @return session for current thread
-	 */
-	protected Session getSession() {
-		return dbUtils.getSessionForCurrentThread();
-	}
-
-	/**
-	 * Update object in the database.
-	 * 
-	 * @param object
-	 *          object to be updated
-	 */
-	public void update(T object) {
-		getSession().update(object);
-		if (dbUtils.isAutoFlush()) {
-			getSession().flush();
-		}
-	}
-
-	/**
-	 * Removes object from the database.
-	 * 
-	 * @param object
-	 *          object to be removed from database
-	 */
-	public void delete(T object) {
-		getSession().delete(object);
-		if (dbUtils.isAutoFlush()) {
-			getSession().flush();
-		}
-	}
-
-	/**
-	 * "Disconnects" object with the element in database. From this point on we
-	 * cannot update/delete it in the database.
-	 * 
-	 * @param object
-	 *          object that should be evicted
-	 */
-	public void evict(T object) {
-		getSession().evict(object);
-		if (dbUtils.isAutoFlush()) {
-			getSession().flush();
-		}
-	}
-
-	/**
-	 * Returns number of elements in the table for this object.
-	 * 
-	 * @return number of all elements in database
-	 */
-	public long getCount() {
-		if (removableColumn == null) {
-			return (Long) getSession().createCriteria(this.clazz).setProjection(Projections.rowCount()).uniqueResult();
-		} else {
-			return (Long) getSession().createCriteria(this.clazz).add(Restrictions.eq(removableColumn, false)).setProjection(Projections.rowCount()).uniqueResult();
-		}
-	}
-
-	/**
-	 * Returns an element that has a key parameter equal to value. If there is
-	 * more than one element than one of them will be returned. If there is no
-	 * such element then <code>null</code> is returned.
-	 * 
-	 * @param key
-	 *          which parameter will filter the data
-	 * @param value
-	 *          what must be the value of parameter key
-	 * @return element that fulfill T.key=value criteria
-	 */
-	@SuppressWarnings("unchecked")
-	protected T getByParameter(String key, Object value) {
-		List<?> list = getSession()
-				.createQuery(" from " + this.clazz.getSimpleName() + " where " + key + " = :param_val " + removableAndStatemant()).setParameter("param_val", value)
-				.list();
-		if (list.size() == 0) {
-			return null;
-		} else {
-			return (T) list.get(0);
-		}
-	}
-
-	/**
-	 * Returns the list of elements that havae a key parameter equal to value.
-	 * 
-	 * @param key
-	 *          which parameter will filter the data
-	 * @param value
-	 *          what must be the value of parameter key
-	 * @return list of elements that fulfill T.key=value criteria
-	 */
-	@SuppressWarnings("unchecked")
-	protected List<T> getElementsByParameter(String key, Object value) {
-		List<?> list = getSession()
-				.createQuery(" from " + this.clazz.getSimpleName() + " where " + key + " = :param_val " + removableAndStatemant()).setParameter("param_val", value)
-				.list();
-		return (List<T>) list;
-	}
-
-	/**
-	 * Returns element with the id given as parameter.
-	 * 
-	 * @param id
-	 *          database identifier
-	 * @return object width identifier given as parameter
-	 */
-	@SuppressWarnings("unchecked")
-	public T getById(int id) {
-		List<?> list = getSession().createQuery(" from " + this.clazz.getSimpleName() + " where id=? " + removableAndStatemant()).setParameter(0, id).list();
-		if (list.size() == 0) {
-			return null;
-		} else {
-			return (T) list.get(0);
-		}
-	}
-
-	/**
-	 * Returns list of all object in db.
-	 * 
-	 * @return list of all object in db
-	 */
-	@SuppressWarnings("unchecked")
-	public List<T> getAll() {
-		List<?> list = getSession().createQuery(" from " + this.clazz.getSimpleName() + " " + removableStatemant()).list();
-		return (List<T>) list;
-	}
-
-	/**
-	 * Removes all elements from the database.
-	 */
-	public void clearTable() {
-		String stringQuery = "DELETE FROM " + this.clazz.getSimpleName();
-		getSession().createQuery(stringQuery).executeUpdate();
-		if (dbUtils.isAutoFlush()) {
-			getSession().flush();
-		}
-	}
-
-	/**
-	 * Refresh object with the new data taken from database.
-	 * 
-	 * @param object
-	 *          object to be refreshed
-	 */
-	public void refresh(Object object) {
-		getSession().refresh(object);
-	}
-
-	/**
-	 * @return the clazz
-	 */
-	protected Class<? extends T> getClazz() {
-		return clazz;
-	}
-
-	/**
-	 * Returns part of HQL statement responsible for {@link #removableColumn}.
-	 * 
-	 * @return part of HQL statement responsible for {@link #removableColumn}.
-	 */
-	protected String removableAndStatemant() {
-		if (removableColumn == null) {
-			return "";
-		} else {
-			return " AND " + removableColumn + " = false ";
-		}
-	}
-
-	/**
-	 * Returns part of HQL statement responsible for {@link #removableColumn}
-	 * (without sql AND).
-	 * 
-	 * @return part of HQL statement responsible for {@link #removableColumn}
-	 *         (without sql AND).
-	 */
-	protected String removableStatemant() {
-		if (removableColumn == null) {
-			return "";
-		} else {
-			return " WHERE " + removableColumn + " = false ";
-		}
-	}
-
-}
+package lcsb.mapviewer.persist.dao;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.hibernate.Session;
+import org.hibernate.criterion.Projections;
+import org.hibernate.criterion.Restrictions;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.persist.DbUtils;
+
+/**
+ * Abstract interface for data access object in the system. Containts the basic
+ * generic functionality.
+ * 
+ * @author Piotr Gawron
+ * 
+ * @param <T>
+ *          type for which data access object is created
+ */
+public abstract class BaseDao<T> {
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger			 logger					 = Logger.getLogger(BaseDao.class);
+
+	/**
+	 * Sometimes objects have a flag that indicate that the object was removed
+	 * from the system (but is still there because of foreign keys etc). This
+	 * column determines the name of the column. If its set to null then such
+	 * column doesn't exist.
+	 */
+	private String						 removableColumn = null;
+
+	/**
+	 * Class of the object that DAO works on.
+	 */
+	private Class<? extends T> clazz;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param theClass
+	 *          class of the object that DAO will work on
+	 */
+	public BaseDao(Class<? extends T> theClass) {
+		this.clazz = theClass;
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param theClass
+	 *          class of the object that DAO will work on
+	 * @param removableColumn
+	 *          determines the column in the object table that indicates if object
+	 *          should be considered as removed or not (see also:
+	 *          {@link #removableColumn}.
+	 * 
+	 */
+	public BaseDao(Class<? extends T> theClass, String removableColumn) {
+		this(theClass);
+		this.removableColumn = removableColumn;
+	}
+
+	/**
+	 * Utils that help to manage the sessions in custom multithreaded
+	 * implementation.
+	 */
+	@Autowired
+	private DbUtils dbUtils;
+
+	/**
+	 * Adds object to the database.
+	 * 
+	 * @param object
+	 *          object to add to database
+	 */
+	public void add(T object) {
+		getSession().save(object);
+		if (dbUtils.isAutoFlush()) {
+			getSession().flush();
+		}
+	}
+
+	/**
+	 * Flush connection with database.
+	 */
+	public void flush() {
+		getSession().flush();
+	}
+
+	/**
+	 * Commit current transaction.
+	 */
+	public void commit() {
+		if (!dbUtils.isCustomSessionForCurrentThread()) {
+			logger.warn("Manual commit with spring managed session!", new Exception());
+		}
+
+		getSession().getTransaction().commit();
+		getSession().beginTransaction();
+	}
+
+	/**
+	 * Returns current session.
+	 * 
+	 * @return session for current thread
+	 */
+	protected Session getSession() {
+		return dbUtils.getSessionForCurrentThread();
+	}
+
+	/**
+	 * Update object in the database.
+	 * 
+	 * @param object
+	 *          object to be updated
+	 */
+	public void update(T object) {
+		getSession().update(object);
+		if (dbUtils.isAutoFlush()) {
+			getSession().flush();
+		}
+	}
+
+	/**
+	 * Removes object from the database.
+	 * 
+	 * @param object
+	 *          object to be removed from database
+	 */
+	public void delete(T object) {
+		getSession().delete(object);
+		if (dbUtils.isAutoFlush()) {
+			getSession().flush();
+		}
+	}
+
+	/**
+	 * "Disconnects" object with the element in database. From this point on we
+	 * cannot update/delete it in the database.
+	 * 
+	 * @param object
+	 *          object that should be evicted
+	 */
+	public void evict(T object) {
+		getSession().evict(object);
+		if (dbUtils.isAutoFlush()) {
+			getSession().flush();
+		}
+	}
+
+	/**
+	 * Returns number of elements in the table for this object.
+	 * 
+	 * @return number of all elements in database
+	 */
+	public long getCount() {
+		if (removableColumn == null) {
+			return (Long) getSession().createCriteria(this.clazz).setProjection(Projections.rowCount()).uniqueResult();
+		} else {
+			return (Long) getSession().createCriteria(this.clazz).add(Restrictions.eq(removableColumn, false)).setProjection(Projections.rowCount()).uniqueResult();
+		}
+	}
+
+	/**
+	 * Returns an element that has a key parameter equal to value. If there is
+	 * more than one element than one of them will be returned. If there is no
+	 * such element then <code>null</code> is returned.
+	 * 
+	 * @param key
+	 *          which parameter will filter the data
+	 * @param value
+	 *          what must be the value of parameter key
+	 * @return element that fulfill T.key=value criteria
+	 */
+	@SuppressWarnings("unchecked")
+	protected T getByParameter(String key, Object value) {
+		List<?> list = getSession()
+				.createQuery(" from " + this.clazz.getSimpleName() + " where " + key + " = :param_val " + removableAndStatemant()).setParameter("param_val", value)
+				.list();
+		if (list.size() == 0) {
+			return null;
+		} else {
+			return (T) list.get(0);
+		}
+	}
+
+	/**
+	 * Returns the list of elements that havae a key parameter equal to value.
+	 * 
+	 * @param key
+	 *          which parameter will filter the data
+	 * @param value
+	 *          what must be the value of parameter key
+	 * @return list of elements that fulfill T.key=value criteria
+	 */
+	@SuppressWarnings("unchecked")
+	protected List<T> getElementsByParameter(String key, Object value) {
+		List<?> list = getSession()
+				.createQuery(" from " + this.clazz.getSimpleName() + " where " + key + " = :param_val " + removableAndStatemant()).setParameter("param_val", value)
+				.list();
+		return (List<T>) list;
+	}
+
+	/**
+	 * Returns element with the id given as parameter.
+	 * 
+	 * @param id
+	 *          database identifier
+	 * @return object width identifier given as parameter
+	 */
+	@SuppressWarnings("unchecked")
+	public T getById(int id) {
+		List<?> list = getSession().createQuery(" from " + this.clazz.getSimpleName() + " where id=? " + removableAndStatemant()).setParameter(0, id).list();
+		if (list.size() == 0) {
+			return null;
+		} else {
+			return (T) list.get(0);
+		}
+	}
+
+	/**
+	 * Returns list of all object in db.
+	 * 
+	 * @return list of all object in db
+	 */
+	@SuppressWarnings("unchecked")
+	public List<T> getAll() {
+		List<?> list = getSession().createQuery(" from " + this.clazz.getSimpleName() + " " + removableStatemant()).list();
+		return (List<T>) list;
+	}
+
+	/**
+	 * Removes all elements from the database.
+	 */
+	public void clearTable() {
+		String stringQuery = "DELETE FROM " + this.clazz.getSimpleName();
+		getSession().createQuery(stringQuery).executeUpdate();
+		if (dbUtils.isAutoFlush()) {
+			getSession().flush();
+		}
+	}
+
+	/**
+	 * Refresh object with the new data taken from database.
+	 * 
+	 * @param object
+	 *          object to be refreshed
+	 */
+	public void refresh(Object object) {
+		getSession().refresh(object);
+	}
+
+	/**
+	 * @return the clazz
+	 */
+	protected Class<? extends T> getClazz() {
+		return clazz;
+	}
+
+	/**
+	 * Returns part of HQL statement responsible for {@link #removableColumn}.
+	 * 
+	 * @return part of HQL statement responsible for {@link #removableColumn}.
+	 */
+	protected String removableAndStatemant() {
+		if (removableColumn == null) {
+			return "";
+		} else {
+			return " AND " + removableColumn + " = false ";
+		}
+	}
+
+	/**
+	 * Returns part of HQL statement responsible for {@link #removableColumn}
+	 * (without sql AND).
+	 * 
+	 * @return part of HQL statement responsible for {@link #removableColumn}
+	 *         (without sql AND).
+	 */
+	protected String removableStatemant() {
+		if (removableColumn == null) {
+			return "";
+		} else {
+			return " WHERE " + removableColumn + " = false ";
+		}
+	}
+
+}
diff --git a/persist/src/main/java/lcsb/mapviewer/persist/dao/ConfigurationDao.java b/persist/src/main/java/lcsb/mapviewer/persist/dao/ConfigurationDao.java
index 385dc899fc..31c73bd7f0 100644
--- a/persist/src/main/java/lcsb/mapviewer/persist/dao/ConfigurationDao.java
+++ b/persist/src/main/java/lcsb/mapviewer/persist/dao/ConfigurationDao.java
@@ -1,52 +1,52 @@
-package lcsb.mapviewer.persist.dao;
-
-import lcsb.mapviewer.model.user.Configuration;
-import lcsb.mapviewer.model.user.ConfigurationElementType;
-
-/**
- * Data access object class for Configuration objects.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ConfigurationDao extends BaseDao<Configuration> {
-
-	/**
-	 * Default constructor.
-	 */
-	public ConfigurationDao() {
-		super(Configuration.class);
-	}
-
-	/**
-	 * Returns object with configuration value for the type given in the
-	 * parameter.
-	 * 
-	 * @param type
-	 *          type of the parameter that we are interested in
-	 * @return object with configuration value for the type given in the parameter
-	 */
-	public Configuration getByType(ConfigurationElementType type) {
-		return getByParameter("type", type);
-	}
-
-	/**
-	 * Returns value by the type.
-	 * 
-	 * @param type
-	 *          type of configuration parameter
-	 * @return value of the specific configuration parameter
-	 */
-	public String getValueByType(ConfigurationElementType type) {
-		Configuration val = getByParameter("type", type);
-		if (val == null) {
-			if (type == null) {
-				return null;
-			} else {
-				return type.getDefaultValue();
-			}
-		} else {
-			return val.getValue();
-		}
-	}
-}
+package lcsb.mapviewer.persist.dao;
+
+import lcsb.mapviewer.model.user.Configuration;
+import lcsb.mapviewer.model.user.ConfigurationElementType;
+
+/**
+ * Data access object class for Configuration objects.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ConfigurationDao extends BaseDao<Configuration> {
+
+	/**
+	 * Default constructor.
+	 */
+	public ConfigurationDao() {
+		super(Configuration.class);
+	}
+
+	/**
+	 * Returns object with configuration value for the type given in the
+	 * parameter.
+	 * 
+	 * @param type
+	 *          type of the parameter that we are interested in
+	 * @return object with configuration value for the type given in the parameter
+	 */
+	public Configuration getByType(ConfigurationElementType type) {
+		return getByParameter("type", type);
+	}
+
+	/**
+	 * Returns value by the type.
+	 * 
+	 * @param type
+	 *          type of configuration parameter
+	 * @return value of the specific configuration parameter
+	 */
+	public String getValueByType(ConfigurationElementType type) {
+		Configuration val = getByParameter("type", type);
+		if (val == null) {
+			if (type == null) {
+				return null;
+			} else {
+				return type.getDefaultValue();
+			}
+		} else {
+			return val.getValue();
+		}
+	}
+}
diff --git a/persist/src/main/java/lcsb/mapviewer/persist/dao/ProjectDao.java b/persist/src/main/java/lcsb/mapviewer/persist/dao/ProjectDao.java
index aec0235512..3710dd2f8a 100644
--- a/persist/src/main/java/lcsb/mapviewer/persist/dao/ProjectDao.java
+++ b/persist/src/main/java/lcsb/mapviewer/persist/dao/ProjectDao.java
@@ -1,67 +1,67 @@
-package lcsb.mapviewer.persist.dao;
-
-import java.util.List;
-
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.model.ModelData;
-
-/**
- * Data access object class for Project objects.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ProjectDao extends BaseDao<Project> {
-	/**
-	 * Default constructor.
-	 */
-	public ProjectDao() {
-		super(Project.class);
-	}
-
-	/**
-	 * Returns project with the given {@link Project#projectId project identifier}
-	 * .
-	 * 
-	 * @param projectId
-	 *          {@link Project#projectId project identifier}
-	 * @return project for the given name
-	 */
-	public Project getProjectByProjectId(String projectId) {
-		Project project = getByParameter("projectId", projectId);
-
-		return project;
-	}
-
-	/**
-	 * Returns project that contains model with a given id.
-	 * 
-	 * @param id
-	 *          id of the model
-	 * @return project that contains model with a given id
-	 */
-	public Project getProjectForModelId(Integer id) {
-		List<?> list = getSession()
-				.createQuery("select project from " + ModelData.class.getSimpleName() + " model_t where model_t.id = :id").setParameter("id", id).list();
-		if (list.size() == 0) {
-			return null;
-		}
-		return (Project) list.get(0);
-	}
-
-	/**
-	 * Returns information if the project with given name exists.
-	 * 
-	 * @param projectName
-	 *          name of the project
-	 * @return <code>true</code> if project with given name exists,
-	 *         <code>false</code> otherwise
-	 */
-	public boolean isProjectExistsByName(String projectName) {
-		@SuppressWarnings("unchecked")
-		List<Long> list = getSession()
-				.createQuery("select count(*) from " + getClazz().getSimpleName() + " where projectId = :projectId").setParameter("projectId", projectName).list();
-		return list.get(0) > 0;
-	}
-
-}
+package lcsb.mapviewer.persist.dao;
+
+import java.util.List;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.model.ModelData;
+
+/**
+ * Data access object class for Project objects.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ProjectDao extends BaseDao<Project> {
+	/**
+	 * Default constructor.
+	 */
+	public ProjectDao() {
+		super(Project.class);
+	}
+
+	/**
+	 * Returns project with the given {@link Project#projectId project identifier}
+	 * .
+	 * 
+	 * @param projectId
+	 *          {@link Project#projectId project identifier}
+	 * @return project for the given name
+	 */
+	public Project getProjectByProjectId(String projectId) {
+		Project project = getByParameter("projectId", projectId);
+
+		return project;
+	}
+
+	/**
+	 * Returns project that contains model with a given id.
+	 * 
+	 * @param id
+	 *          id of the model
+	 * @return project that contains model with a given id
+	 */
+	public Project getProjectForModelId(Integer id) {
+		List<?> list = getSession()
+				.createQuery("select project from " + ModelData.class.getSimpleName() + " model_t where model_t.id = :id").setParameter("id", id).list();
+		if (list.size() == 0) {
+			return null;
+		}
+		return (Project) list.get(0);
+	}
+
+	/**
+	 * Returns information if the project with given name exists.
+	 * 
+	 * @param projectName
+	 *          name of the project
+	 * @return <code>true</code> if project with given name exists,
+	 *         <code>false</code> otherwise
+	 */
+	public boolean isProjectExistsByName(String projectName) {
+		@SuppressWarnings("unchecked")
+		List<Long> list = getSession()
+				.createQuery("select count(*) from " + getClazz().getSimpleName() + " where projectId = :projectId").setParameter("projectId", projectName).list();
+		return list.get(0) > 0;
+	}
+
+}
diff --git a/persist/src/main/java/lcsb/mapviewer/persist/mapper/Point2DMapper.java b/persist/src/main/java/lcsb/mapviewer/persist/mapper/Point2DMapper.java
index afab6a1aab..a3865f48a2 100644
--- a/persist/src/main/java/lcsb/mapviewer/persist/mapper/Point2DMapper.java
+++ b/persist/src/main/java/lcsb/mapviewer/persist/mapper/Point2DMapper.java
@@ -1,126 +1,126 @@
-package lcsb.mapviewer.persist.mapper;
-
-import java.awt.geom.Point2D;
-import java.io.Serializable;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.hibernate.engine.spi.SessionImplementor;
-import org.hibernate.type.StringType;
-import org.hibernate.type.Type;
-import org.hibernate.usertype.CompositeUserType;
-
-/**
- * This class allows to put {@link Point2D} objects into hibernate based models.
- * 
- * @author Piotr Gawron
- * 
- */
-public class Point2DMapper implements CompositeUserType {
-
-	@Override
-	public String[] getPropertyNames() {
-		return new String[] { "val" };
-	}
-
-	@Override
-	public Type[] getPropertyTypes() {
-		return new Type[] { StringType.INSTANCE };
-	}
-
-	@Override
-	public Object getPropertyValue(Object component, int property) {
-		Object returnValue = null;
-		final Point2D point = (Point2D) component;
-		if (0 == property) {
-			returnValue = point.getX() + "," + point.getY();
-		}
-		return returnValue;
-	}
-
-	@Override
-	public void setPropertyValue(Object component, int property, Object value) {
-		final Point2D point = (Point2D) component;
-		if (0 == property) {
-			final String[] values = ((String) value).split(",");
-			point.setLocation(Double.parseDouble(values[0]), Double.parseDouble(values[1]));
-		}
-	}
-
-	@Override
-	public Class<?> returnedClass() {
-		return Point2D.class;
-	}
-
-	@Override
-	public boolean equals(Object o1, Object o2) {
-		boolean isEqual = false;
-		if (o1 == o2) {
-			isEqual = false;
-		}
-		if (null == o1 || null == o2) {
-			isEqual = false;
-		} else {
-			isEqual = o1.equals(o2);
-		}
-		return isEqual;
-	}
-
-	@Override
-	public int hashCode(Object x) {
-		return x.hashCode();
-	}
-
-	@Override
-	public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws SQLException {
-		Point2D point = null;
-		final String val = rs.getString(names[0]);
-		if (!rs.wasNull()) {
-			final String[] values = val.split(",");
-			point = new Point2D.Double(Double.parseDouble(values[0]), Double.parseDouble(values[1]));
-		}
-		return point;
-	}
-
-	@Override
-	public void nullSafeSet(PreparedStatement st, Object value, int property, SessionImplementor session) throws SQLException {
-		if (value == null) {
-			st.setNull(property, StringType.INSTANCE.sqlType());
-		} else {
-			final Point2D point = (Point2D) value;
-			st.setString(property, point.getX() + "," + point.getY());
-		}
-	}
-
-	@Override
-	public Object deepCopy(Object value) {
-		if (value == null) {
-			return null;
-		}
-		final Point2D recievedParam = (Point2D) value;
-		final Point2D point = new Point2D.Double(recievedParam.getX(), recievedParam.getY());
-		return point;
-	}
-
-	@Override
-	public boolean isMutable() {
-		return true;
-	}
-
-	@Override
-	public Serializable disassemble(Object value, SessionImplementor session) {
-		return (Serializable) value;
-	}
-
-	@Override
-	public Object assemble(Serializable cached, SessionImplementor session, Object owner) {
-		return cached;
-	}
-
-	@Override
-	public Object replace(Object original, Object target, SessionImplementor session, Object owner) {
-		return this.deepCopy(original);
-	}
-
-}
+package lcsb.mapviewer.persist.mapper;
+
+import java.awt.geom.Point2D;
+import java.io.Serializable;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.type.StringType;
+import org.hibernate.type.Type;
+import org.hibernate.usertype.CompositeUserType;
+
+/**
+ * This class allows to put {@link Point2D} objects into hibernate based models.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class Point2DMapper implements CompositeUserType {
+
+	@Override
+	public String[] getPropertyNames() {
+		return new String[] { "val" };
+	}
+
+	@Override
+	public Type[] getPropertyTypes() {
+		return new Type[] { StringType.INSTANCE };
+	}
+
+	@Override
+	public Object getPropertyValue(Object component, int property) {
+		Object returnValue = null;
+		final Point2D point = (Point2D) component;
+		if (0 == property) {
+			returnValue = point.getX() + "," + point.getY();
+		}
+		return returnValue;
+	}
+
+	@Override
+	public void setPropertyValue(Object component, int property, Object value) {
+		final Point2D point = (Point2D) component;
+		if (0 == property) {
+			final String[] values = ((String) value).split(",");
+			point.setLocation(Double.parseDouble(values[0]), Double.parseDouble(values[1]));
+		}
+	}
+
+	@Override
+	public Class<?> returnedClass() {
+		return Point2D.class;
+	}
+
+	@Override
+	public boolean equals(Object o1, Object o2) {
+		boolean isEqual = false;
+		if (o1 == o2) {
+			isEqual = false;
+		}
+		if (null == o1 || null == o2) {
+			isEqual = false;
+		} else {
+			isEqual = o1.equals(o2);
+		}
+		return isEqual;
+	}
+
+	@Override
+	public int hashCode(Object x) {
+		return x.hashCode();
+	}
+
+	@Override
+	public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws SQLException {
+		Point2D point = null;
+		final String val = rs.getString(names[0]);
+		if (!rs.wasNull()) {
+			final String[] values = val.split(",");
+			point = new Point2D.Double(Double.parseDouble(values[0]), Double.parseDouble(values[1]));
+		}
+		return point;
+	}
+
+	@Override
+	public void nullSafeSet(PreparedStatement st, Object value, int property, SessionImplementor session) throws SQLException {
+		if (value == null) {
+			st.setNull(property, StringType.INSTANCE.sqlType());
+		} else {
+			final Point2D point = (Point2D) value;
+			st.setString(property, point.getX() + "," + point.getY());
+		}
+	}
+
+	@Override
+	public Object deepCopy(Object value) {
+		if (value == null) {
+			return null;
+		}
+		final Point2D recievedParam = (Point2D) value;
+		final Point2D point = new Point2D.Double(recievedParam.getX(), recievedParam.getY());
+		return point;
+	}
+
+	@Override
+	public boolean isMutable() {
+		return true;
+	}
+
+	@Override
+	public Serializable disassemble(Object value, SessionImplementor session) {
+		return (Serializable) value;
+	}
+
+	@Override
+	public Object assemble(Serializable cached, SessionImplementor session, Object owner) {
+		return cached;
+	}
+
+	@Override
+	public Object replace(Object original, Object target, SessionImplementor session, Object owner) {
+		return this.deepCopy(original);
+	}
+
+}
diff --git a/persist/src/main/resources/applicationContext-persist.xml b/persist/src/main/resources/applicationContext-persist.xml
index 868a5f4689..7d323d0e9e 100644
--- a/persist/src/main/resources/applicationContext-persist.xml
+++ b/persist/src/main/resources/applicationContext-persist.xml
@@ -165,17 +165,32 @@
 				<value>lcsb.mapviewer.model.map.layout.ReferenceGenomeGeneMapping</value>
 				
 				<value>lcsb.mapviewer.model.map.layout.alias.Alias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.AntisenseRnaAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.BottomSquareCompartmentAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.ChemicalAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.CompartmentAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.ComplexAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.DegradedAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.DrugAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.GeneAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.IonAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.IonChannelProteinAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.LeftSquareCompartmentAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.OvalCompartmentAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.PhenotypeAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.ReceptorProteinAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.RightSquareCompartmentAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.RnaAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.SpeciesAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.SearchIndex</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.SquareCompartmentAlias</value>
 				<value>lcsb.mapviewer.model.map.layout.alias.TopSquareCompartmentAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.TruncatedProteinAlias</value>
+				<value>lcsb.mapviewer.model.map.layout.alias.UnknownAlias</value>
+				
 				<value>lcsb.mapviewer.model.map.layout.graphics.Layer</value>
 				<value>lcsb.mapviewer.model.map.layout.graphics.LayerText</value>
 				<value>lcsb.mapviewer.model.map.layout.graphics.LayerRect</value>
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/AllDaoTests.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/AllDaoTests.java
index 9c41308c0f..f289c4e122 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/AllDaoTests.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/AllDaoTests.java
@@ -1,25 +1,25 @@
-package lcsb.mapviewer.persist.dao;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-import lcsb.mapviewer.persist.dao.cache.AllCacheDbTests;
-import lcsb.mapviewer.persist.dao.graphics.AllGraphicsDaoTests;
-import lcsb.mapviewer.persist.dao.log.AllLogTests;
-import lcsb.mapviewer.persist.dao.map.AllMapDaoTests;
-import lcsb.mapviewer.persist.dao.user.AllUserTests;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({ AllCacheDbTests.class, //
-		AllGraphicsDaoTests.class, //
-		AllLogTests.class, //
-		AllMapDaoTests.class, //
-		AllUserTests.class, //
-		BaseDaoTest.class, //
-		ConfigurationDaoTest.class, //
-		ProjectDaoTest.class, //
-
-})
-public class AllDaoTests {
-
-}
+package lcsb.mapviewer.persist.dao;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+import lcsb.mapviewer.persist.dao.cache.AllCacheDbTests;
+import lcsb.mapviewer.persist.dao.graphics.AllGraphicsDaoTests;
+import lcsb.mapviewer.persist.dao.log.AllLogTests;
+import lcsb.mapviewer.persist.dao.map.AllMapDaoTests;
+import lcsb.mapviewer.persist.dao.user.AllUserTests;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ AllCacheDbTests.class, //
+		AllGraphicsDaoTests.class, //
+		AllLogTests.class, //
+		AllMapDaoTests.class, //
+		AllUserTests.class, //
+		BaseDaoTest.class, //
+		ConfigurationDaoTest.class, //
+		ProjectDaoTest.class, //
+
+})
+public class AllDaoTests {
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/BaseDaoTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/BaseDaoTest.java
index 7b77f30315..306550e4c0 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/BaseDaoTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/BaseDaoTest.java
@@ -1,45 +1,45 @@
-package lcsb.mapviewer.persist.dao;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.hibernate.Transaction;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.test.annotation.Rollback;
-
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-@Rollback(false)
-public class BaseDaoTest extends PersistTestFunctions{
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCommit() {
-		try {
-
-			dbUtils.createSessionForCurrentThread();
-			Transaction tr = userDao.getSession().getTransaction();
-			userDao.commit();
-			assertTrue(tr.equals(tr));
-			Transaction tr2 = userDao.getSession().getTransaction();
-			
-			assertFalse(tr.equals(tr2));
-
-			dbUtils.closeSessionForCurrentThread();
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.persist.dao;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.hibernate.Transaction;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.test.annotation.Rollback;
+
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+@Rollback(false)
+public class BaseDaoTest extends PersistTestFunctions{
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCommit() {
+		try {
+
+			dbUtils.createSessionForCurrentThread();
+			Transaction tr = userDao.getSession().getTransaction();
+			userDao.commit();
+			assertTrue(tr.equals(tr));
+			Transaction tr2 = userDao.getSession().getTransaction();
+			
+			assertFalse(tr.equals(tr2));
+
+			dbUtils.closeSessionForCurrentThread();
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/ConfigurationDaoTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/ConfigurationDaoTest.java
index cb1040e348..8b3f8bc332 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/ConfigurationDaoTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/ConfigurationDaoTest.java
@@ -1,50 +1,50 @@
-package lcsb.mapviewer.persist.dao;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.model.user.Configuration;
-import lcsb.mapviewer.model.user.ConfigurationElementType;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-public class ConfigurationDaoTest extends PersistTestFunctions {
-	@Autowired
-	protected ConfigurationDao configurationDao;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetNull() {
-		assertNull(configurationDao.getByType(null));
-	}
-
-	@Test
-	public void testGetValueByType() {
-		// check data for null input (failsafe test)
-		assertNull(configurationDao.getValueByType(null));
-
-		// check data for somethig that is in database
-		String val = configurationDao.getValueByType(ConfigurationElementType.LOGO_TEXT);
-		assertNotNull(val);
-
-		// remove data from database
-		Configuration obj = configurationDao.getByType(ConfigurationElementType.LOGO_TEXT);
-		configurationDao.delete(obj);
-
-		// and now check data for somethig that is not in database
-		assertNotNull(configurationDao.getValueByType(ConfigurationElementType.LOGO_TEXT));
-
-	}
-
-}
+package lcsb.mapviewer.persist.dao;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.model.user.Configuration;
+import lcsb.mapviewer.model.user.ConfigurationElementType;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+public class ConfigurationDaoTest extends PersistTestFunctions {
+	@Autowired
+	protected ConfigurationDao configurationDao;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetNull() {
+		assertNull(configurationDao.getByType(null));
+	}
+
+	@Test
+	public void testGetValueByType() {
+		// check data for null input (failsafe test)
+		assertNull(configurationDao.getValueByType(null));
+
+		// check data for somethig that is in database
+		String val = configurationDao.getValueByType(ConfigurationElementType.LOGO_TEXT);
+		assertNotNull(val);
+
+		// remove data from database
+		Configuration obj = configurationDao.getByType(ConfigurationElementType.LOGO_TEXT);
+		configurationDao.delete(obj);
+
+		// and now check data for somethig that is not in database
+		assertNotNull(configurationDao.getValueByType(ConfigurationElementType.LOGO_TEXT));
+
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/ProjectDaoTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/ProjectDaoTest.java
index 9887bd8797..7efcef6b72 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/ProjectDaoTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/ProjectDaoTest.java
@@ -1,278 +1,279 @@
-package lcsb.mapviewer.persist.dao;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.OverviewImage;
-import lcsb.mapviewer.model.map.OverviewModelLink;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelComparator;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ProjectDaoTest extends PersistTestFunctions {
-	Logger logger						= Logger.getLogger(ProjectDaoTest.class);
-	int		identifierCounter = 0;
-	String projectId				 = "Some_id";
-
-	@Before
-	public void setUp() throws Exception {
-		Project project = projectDao.getProjectByProjectId(projectId);
-		if (project != null) {
-			projectDao.delete(project);
-		}
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetProjectByName() throws Exception {
-		try {
-			Project project = new Project();
-			project.setProjectId(projectId);
-			projectDao.add(project);
-			projectDao.evict(project);
-
-			Project project2 = projectDao.getProjectByProjectId(projectId);
-			assertNotNull(project2);
-			assertFalse(project2.equals(project));
-			assertEquals(project.getId(), project2.getId());
-
-			projectDao.delete(project2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetProjectForModelId() throws Exception {
-		try {
-			String projectId = "Some name";
-			Project project = new Project();
-			project.setProjectId(projectId);
-			projectDao.add(project);
-			Model model = new ModelFullIndexed(null);
-			project.addModel(model);
-			modelDao.add(model);
-			modelDao.evict(model);
-			projectDao.evict(project);
-
-			Project project2 = projectDao.getProjectForModelId(model.getId());
-			assertNotNull(project2);
-			assertFalse(project2.equals(project));
-			assertEquals(project.getId(), project2.getId());
-
-			modelDao.delete(modelDao.getById(model.getId()));
-			projectDao.delete(project2);
-
-			assertNull(projectDao.getProjectForModelId(model.getId()));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProjectExists() throws Exception {
-		try {
-			String projectId = "Some_id";
-			Project project = new Project();
-			project.setProjectId(projectId);
-
-			assertFalse(projectDao.isProjectExistsByName(projectId));
-
-			projectDao.add(project);
-			projectDao.evict(project);
-
-			assertTrue(projectDao.isProjectExistsByName(projectId));
-
-			Project project2 = projectDao.getProjectByProjectId(projectId);
-
-			projectDao.delete(project2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCheckEqualityAfterReload() throws Exception {
-		try {
-
-			String projectId = "Some_id";
-			Project project = new Project();
-			project.setProjectId(projectId);
-			projectDao.add(project);
-			projectDao.flush();
-
-			Model model = createModel();
-			project.addModel(model);
-
-			projectDao.update(project);
-			projectDao.evict(project);
-
-			ModelComparator comparator = new ModelComparator();
-
-			Model model2 = new ModelFullIndexed(modelDao.getLastModelForProjectIdentifier(projectId, false));
-
-			assertEquals(0, comparator.compare(model, model2));
-
-			projectDao.delete(projectDao.getById(project.getId()));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCheckEqualityAfterReload2() throws Exception {
-		try {
-			String project_id = "Some_id";
-			Project project = new Project();
-			project.setProjectId(project_id);
-			Model model = createModel();
-			project.addModel(model);
-
-			projectDao.add(project);
-			projectDao.evict(project);
-
-			Project project2 = projectDao.getProjectByProjectId(project_id);
-
-			ModelComparator comparator = new ModelComparator();
-
-			Model fullModel1 = new ModelFullIndexed(project.getModels().iterator().next());
-			Model fullModel2 = new ModelFullIndexed(project2.getModels().iterator().next());
-			assertEquals(0, comparator.compare(fullModel1, fullModel2));
-
-			projectDao.delete(project2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createModel() {
-		Model model = new ModelFullIndexed(null);
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		model.addAlias(createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2"));
-		model.addAlias(createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117"));
-		model.addAlias(createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119"));
-		model.addAlias(createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121"));
-
-		SpeciesAlias alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
-		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
-		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
-		alias3.addAlias(alias);
-		alias3.addAlias(alias2);
-		alias.setParent(alias3);
-		alias2.setParent(alias3);
-
-		model.addAlias(alias);
-		model.addAlias(alias2);
-		model.addAlias(alias3);
-
-		model.addAlias(createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1"));
-		model.setWidth(2000);
-		model.setHeight(2000);
-		return model;
-	}
-
-	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
-		Compartment compartment = new Compartment("c" + identifierCounter++);
-		CompartmentAlias alias = new CompartmentAlias(compartment);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
-		Species species = new SimpleMolecule();
-		species.setElementId("s" + identifierCounter++);
-		SpeciesAlias alias = new SpeciesAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
-		ComplexSpecies species = new ComplexSpecies();
-		species.setElementId("s" + identifierCounter++);
-		ComplexAlias alias = new ComplexAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	@Test
-	public void testAddGetProjectWithOverviewImage() throws Exception {
-		try {
-			String projectId = "Some_id";
-			Project project = new Project();
-			project.setProjectId(projectId);
-			Model model = new ModelFullIndexed(null);
-			OverviewImage oi = new OverviewImage();
-			oi.setFilename("test");
-			OverviewModelLink oml = new OverviewModelLink();
-			oml.setPolygon("10,10 20,20 20,100");
-			oml.setxCoord(1);
-			oml.setyCoord(2);
-			oml.setZoomLevel(3);
-			oi.addLink(oml);
-			model.addOverviewImage(oi);
-			project.addModel(model);
-
-			projectDao.add(project);
-			projectDao.evict(project);
-
-			Project project2 = projectDao.getProjectByProjectId(projectId);
-			assertNotNull(project2);
-
-			Model model2 = new ModelFullIndexed(project2.getModels().iterator().next());
-			OverviewImage oi2 = model2.getOverviewImages().get(0);
-			OverviewModelLink oml2 = (OverviewModelLink) oi2.getLinks().get(0);
-
-			assertEquals(oi.getFilename(), oi2.getFilename());
-			assertEquals(oml.getPolygon(), oml2.getPolygon());
-			assertEquals(oml.getxCoord(), oml2.getxCoord());
-			assertEquals(oml.getyCoord(), oml2.getyCoord());
-			assertEquals(oml.getZoomLevel(), oml2.getZoomLevel());
-			assertNotNull(oml2.getPolygonCoordinates());
-
-			projectDao.delete(project2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.persist.dao;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.OverviewImage;
+import lcsb.mapviewer.model.map.OverviewModelLink;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelComparator;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+public class ProjectDaoTest extends PersistTestFunctions {
+	Logger logger						= Logger.getLogger(ProjectDaoTest.class);
+	int		identifierCounter = 0;
+	String projectId				 = "Some_id";
+
+	@Before
+	public void setUp() throws Exception {
+		Project project = projectDao.getProjectByProjectId(projectId);
+		if (project != null) {
+			projectDao.delete(project);
+		}
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetProjectByName() throws Exception {
+		try {
+			Project project = new Project();
+			project.setProjectId(projectId);
+			projectDao.add(project);
+			projectDao.evict(project);
+
+			Project project2 = projectDao.getProjectByProjectId(projectId);
+			assertNotNull(project2);
+			assertFalse(project2.equals(project));
+			assertEquals(project.getId(), project2.getId());
+
+			projectDao.delete(project2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetProjectForModelId() throws Exception {
+		try {
+			String projectId = "Some name";
+			Project project = new Project();
+			project.setProjectId(projectId);
+			projectDao.add(project);
+			Model model = new ModelFullIndexed(null);
+			project.addModel(model);
+			modelDao.add(model);
+			modelDao.evict(model);
+			projectDao.evict(project);
+
+			Project project2 = projectDao.getProjectForModelId(model.getId());
+			assertNotNull(project2);
+			assertFalse(project2.equals(project));
+			assertEquals(project.getId(), project2.getId());
+
+			modelDao.delete(modelDao.getById(model.getId()));
+			projectDao.delete(project2);
+
+			assertNull(projectDao.getProjectForModelId(model.getId()));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProjectExists() throws Exception {
+		try {
+			String projectId = "Some_id";
+			Project project = new Project();
+			project.setProjectId(projectId);
+
+			assertFalse(projectDao.isProjectExistsByName(projectId));
+
+			projectDao.add(project);
+			projectDao.evict(project);
+
+			assertTrue(projectDao.isProjectExistsByName(projectId));
+
+			Project project2 = projectDao.getProjectByProjectId(projectId);
+
+			projectDao.delete(project2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCheckEqualityAfterReload() throws Exception {
+		try {
+
+			String projectId = "Some_id";
+			Project project = new Project();
+			project.setProjectId(projectId);
+			projectDao.add(project);
+			projectDao.flush();
+
+			Model model = createModel();
+			project.addModel(model);
+
+			projectDao.update(project);
+			projectDao.evict(project);
+
+			ModelComparator comparator = new ModelComparator();
+
+			Model model2 = new ModelFullIndexed(modelDao.getLastModelForProjectIdentifier(projectId, false));
+
+			assertEquals(0, comparator.compare(model, model2));
+
+			projectDao.delete(projectDao.getById(project.getId()));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCheckEqualityAfterReload2() throws Exception {
+		try {
+			String project_id = "Some_id";
+			Project project = new Project();
+			project.setProjectId(project_id);
+			Model model = createModel();
+			project.addModel(model);
+
+			projectDao.add(project);
+			projectDao.evict(project);
+
+			Project project2 = projectDao.getProjectByProjectId(project_id);
+
+			ModelComparator comparator = new ModelComparator();
+
+			Model fullModel1 = new ModelFullIndexed(project.getModels().iterator().next());
+			Model fullModel2 = new ModelFullIndexed(project2.getModels().iterator().next());
+			assertEquals(0, comparator.compare(fullModel1, fullModel2));
+
+			projectDao.delete(project2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createModel() {
+		Model model = new ModelFullIndexed(null);
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		model.addAlias(createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2"));
+		model.addAlias(createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117"));
+		model.addAlias(createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119"));
+		model.addAlias(createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121"));
+
+		SpeciesAlias alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
+		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
+		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
+		alias3.addAlias(alias);
+		alias3.addAlias(alias2);
+		alias.setParent(alias3);
+		alias2.setParent(alias3);
+
+		model.addAlias(alias);
+		model.addAlias(alias2);
+		model.addAlias(alias3);
+
+		model.addAlias(createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1"));
+		model.setWidth(2000);
+		model.setHeight(2000);
+		return model;
+	}
+
+	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
+		Compartment compartment = new Compartment("c" + identifierCounter++);
+		CompartmentAlias alias = new CompartmentAlias(compartment);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
+		SimpleMolecule species = new SimpleMolecule();
+		species.setElementId("s" + identifierCounter++);
+		SpeciesAlias alias = new SimpleMoleculeAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
+		ComplexSpecies species = new ComplexSpecies();
+		species.setElementId("s" + identifierCounter++);
+		ComplexAlias alias = new ComplexAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	@Test
+	public void testAddGetProjectWithOverviewImage() throws Exception {
+		try {
+			String projectId = "Some_id";
+			Project project = new Project();
+			project.setProjectId(projectId);
+			Model model = new ModelFullIndexed(null);
+			OverviewImage oi = new OverviewImage();
+			oi.setFilename("test");
+			OverviewModelLink oml = new OverviewModelLink();
+			oml.setPolygon("10,10 20,20 20,100");
+			oml.setxCoord(1);
+			oml.setyCoord(2);
+			oml.setZoomLevel(3);
+			oi.addLink(oml);
+			model.addOverviewImage(oi);
+			project.addModel(model);
+
+			projectDao.add(project);
+			projectDao.evict(project);
+
+			Project project2 = projectDao.getProjectByProjectId(projectId);
+			assertNotNull(project2);
+
+			Model model2 = new ModelFullIndexed(project2.getModels().iterator().next());
+			OverviewImage oi2 = model2.getOverviewImages().get(0);
+			OverviewModelLink oml2 = (OverviewModelLink) oi2.getLinks().get(0);
+
+			assertEquals(oi.getFilename(), oi2.getFilename());
+			assertEquals(oml.getPolygon(), oml2.getPolygon());
+			assertEquals(oml.getxCoord(), oml2.getxCoord());
+			assertEquals(oml.getyCoord(), oml2.getyCoord());
+			assertEquals(oml.getZoomLevel(), oml2.getZoomLevel());
+			assertNotNull(oml2.getPolygonCoordinates());
+
+			projectDao.delete(project2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/CommentDaoTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/CommentDaoTest.java
index 240b11579f..47cc297fed 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/CommentDaoTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/CommentDaoTest.java
@@ -1,211 +1,212 @@
-package lcsb.mapviewer.persist.dao.map;
-
-import static org.junit.Assert.assertEquals;
-
-import java.awt.Color;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.Comment;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-public class CommentDaoTest extends PersistTestFunctions {
-	int							identifierCounter	= 1;
-
-	private Project	project;
-	String					projectId					= "Some_id";
-
-	@Before
-	public void setUp() throws Exception {
-		project = projectDao.getProjectByProjectId(projectId);
-		if (project != null) {
-			projectDao.delete(project);
-		}
-		project = new Project();
-		project.setProjectId(projectId);
-		projectDao.add(project);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		projectDao.delete(project);
-	}
-
-	@Test
-	public void testGetComments() {
-		try {
-			Model model = createModel();
-			project.addModel(model);
-			modelDao.add(model);
-			projectDao.update(project);
-
-			Comment comment = new Comment();
-			comment.setDeleted(true);
-			comment.setModel(model);
-			commentDao.add(comment);
-
-			Comment comment2 = new Comment();
-			comment2.setPinned(true);
-			comment2.setModel(model);
-			commentDao.add(comment2);
-
-			assertEquals(0, commentDao.getCommentByModel(model, true, true).size());
-			assertEquals(1, commentDao.getCommentByModel(model, false, true).size());
-			assertEquals(1, commentDao.getCommentByModel(model, null, true).size());
-			assertEquals(1, commentDao.getCommentByModel(model, true, false).size());
-			assertEquals(0, commentDao.getCommentByModel(model, false, false).size());
-			assertEquals(1, commentDao.getCommentByModel(model, null, false).size());
-			assertEquals(1, commentDao.getCommentByModel(model, true, null).size());
-			assertEquals(1, commentDao.getCommentByModel(model, false, null).size());
-			assertEquals(2, commentDao.getCommentByModel(model, null, null).size());
-
-			assertEquals(0, commentDao.getCommentByModel(model.getModelData(), true, true).size());
-			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), false, true).size());
-			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), null, true).size());
-			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), true, false).size());
-			assertEquals(0, commentDao.getCommentByModel(model.getModelData(), false, false).size());
-			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), null, false).size());
-			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), true, null).size());
-			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), false, null).size());
-			assertEquals(2, commentDao.getCommentByModel(model.getModelData(), null, null).size());
-
-			commentDao.delete(comment);
-			commentDao.delete(comment2);
-			modelDao.delete(model);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	private Model createModel() {
-		Model model = new ModelFullIndexed(null);
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		SpeciesAlias alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-
-		alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
-		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
-		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
-		alias3.addAlias(alias);
-		alias3.addAlias(alias2);
-		alias.setParent(alias3);
-		alias2.setParent(alias3);
-
-		model.addAlias(alias);
-		model.addAlias(alias2);
-		model.addAlias(alias3);
-
-		model.addElement(alias.getSpecies());
-		model.addElement(alias2.getSpecies());
-		model.addElement(alias3.getSpecies());
-
-		CompartmentAlias cAlias = createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1");
-		model.addAlias(cAlias);
-		model.addCompartment(cAlias.getCompartment());
-		model.setWidth(2000);
-		model.setHeight(2000);
-
-		Layer layer = new Layer();
-		model.addLayer(layer);
-
-		LayerRect lr = new LayerRect();
-		lr.setColor(Color.YELLOW);
-		layer.addLayerRect(lr);
-
-		Reaction reaction = new TransportReaction();
-		reaction.addProduct(new Product(alias, alias.getElement()));
-		reaction.addReactant(new Reactant(alias2, alias2.getElement()));
-		reaction.setIdReaction("re" + identifierCounter++);
-		model.addReaction(reaction);
-
-		alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "pr1");
-		Protein protein = new Protein();
-		protein.setElementId("p1");
-		alias.setSpecies(protein);
-		model.addAlias(alias);
-		model.addElement(protein);
-
-		ModificationResidue mr = new ModificationResidue();
-		mr.setName("mr");
-		protein.addModificationResidue(mr);
-
-		protein.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "c"));
-		return model;
-	}
-
-	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
-		Compartment compartment = new Compartment("c" + identifierCounter++);
-		CompartmentAlias alias = new CompartmentAlias(compartment);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
-		Species species = new Protein();
-		species.setElementId("s" + identifierCounter++);
-		species.setName("SNCA");
-		species.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
-		species.addMiriamData(new MiriamData(MiriamType.HGNC, "11138"));
-		SpeciesAlias alias = new SpeciesAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
-		ComplexSpecies species = new ComplexSpecies();
-		species.setElementId("s" + identifierCounter++);
-		ComplexAlias alias = new ComplexAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-}
+package lcsb.mapviewer.persist.dao.map;
+
+import static org.junit.Assert.assertEquals;
+
+import java.awt.Color;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.Comment;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+public class CommentDaoTest extends PersistTestFunctions {
+	int							identifierCounter	= 1;
+
+	private Project	project;
+	String					projectId					= "Some_id";
+
+	@Before
+	public void setUp() throws Exception {
+		project = projectDao.getProjectByProjectId(projectId);
+		if (project != null) {
+			projectDao.delete(project);
+		}
+		project = new Project();
+		project.setProjectId(projectId);
+		projectDao.add(project);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		projectDao.delete(project);
+	}
+
+	@Test
+	public void testGetComments() {
+		try {
+			Model model = createModel();
+			project.addModel(model);
+			modelDao.add(model);
+			projectDao.update(project);
+
+			Comment comment = new Comment();
+			comment.setDeleted(true);
+			comment.setModel(model);
+			commentDao.add(comment);
+
+			Comment comment2 = new Comment();
+			comment2.setPinned(true);
+			comment2.setModel(model);
+			commentDao.add(comment2);
+
+			assertEquals(0, commentDao.getCommentByModel(model, true, true).size());
+			assertEquals(1, commentDao.getCommentByModel(model, false, true).size());
+			assertEquals(1, commentDao.getCommentByModel(model, null, true).size());
+			assertEquals(1, commentDao.getCommentByModel(model, true, false).size());
+			assertEquals(0, commentDao.getCommentByModel(model, false, false).size());
+			assertEquals(1, commentDao.getCommentByModel(model, null, false).size());
+			assertEquals(1, commentDao.getCommentByModel(model, true, null).size());
+			assertEquals(1, commentDao.getCommentByModel(model, false, null).size());
+			assertEquals(2, commentDao.getCommentByModel(model, null, null).size());
+
+			assertEquals(0, commentDao.getCommentByModel(model.getModelData(), true, true).size());
+			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), false, true).size());
+			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), null, true).size());
+			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), true, false).size());
+			assertEquals(0, commentDao.getCommentByModel(model.getModelData(), false, false).size());
+			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), null, false).size());
+			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), true, null).size());
+			assertEquals(1, commentDao.getCommentByModel(model.getModelData(), false, null).size());
+			assertEquals(2, commentDao.getCommentByModel(model.getModelData(), null, null).size());
+
+			commentDao.delete(comment);
+			commentDao.delete(comment2);
+			modelDao.delete(model);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	private Model createModel() {
+		Model model = new ModelFullIndexed(null);
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		SpeciesAlias alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+
+		alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
+		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
+		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
+		alias3.addAlias(alias);
+		alias3.addAlias(alias2);
+		alias.setParent(alias3);
+		alias2.setParent(alias3);
+
+		model.addAlias(alias);
+		model.addAlias(alias2);
+		model.addAlias(alias3);
+
+		model.addElement(alias.getSpecies());
+		model.addElement(alias2.getSpecies());
+		model.addElement(alias3.getSpecies());
+
+		CompartmentAlias cAlias = createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1");
+		model.addAlias(cAlias);
+		model.addCompartment(cAlias.getCompartment());
+		model.setWidth(2000);
+		model.setHeight(2000);
+
+		Layer layer = new Layer();
+		model.addLayer(layer);
+
+		LayerRect lr = new LayerRect();
+		lr.setColor(Color.YELLOW);
+		layer.addLayerRect(lr);
+
+		Reaction reaction = new TransportReaction();
+		reaction.addProduct(new Product(alias, alias.getElement()));
+		reaction.addReactant(new Reactant(alias2, alias2.getElement()));
+		reaction.setIdReaction("re" + identifierCounter++);
+		model.addReaction(reaction);
+
+		alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "pr1");
+		Protein protein = new GenericProtein();
+		protein.setElementId("p1");
+		alias.setSpecies(protein);
+		model.addAlias(alias);
+		model.addElement(protein);
+
+		ModificationResidue mr = new ModificationResidue();
+		mr.setName("mr");
+		protein.addModificationResidue(mr);
+
+		protein.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "c"));
+		return model;
+	}
+
+	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
+		Compartment compartment = new Compartment("c" + identifierCounter++);
+		CompartmentAlias alias = new CompartmentAlias(compartment);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
+		GenericProtein species = new GenericProtein();
+		species.setElementId("s" + identifierCounter++);
+		species.setName("SNCA");
+		species.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
+		species.addMiriamData(new MiriamData(MiriamType.HGNC, "11138"));
+		GenericProteinAlias alias = new GenericProteinAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
+		ComplexSpecies species = new ComplexSpecies();
+		species.setElementId("s" + identifierCounter++);
+		ComplexAlias alias = new ComplexAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/LayoutDaoTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/LayoutDaoTest.java
index fdc1b4d5cf..006f43fa64 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/LayoutDaoTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/LayoutDaoTest.java
@@ -1,255 +1,256 @@
-package lcsb.mapviewer.persist.dao.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.awt.Color;
-import java.nio.charset.StandardCharsets;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.cache.UploadedFileEntry;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-public class LayoutDaoTest extends PersistTestFunctions {
-
-	@Autowired
-	private LayoutDao		layoutDao;
-
-	final static Logger	logger						= Logger.getLogger(LayoutDaoTest.class);
-
-	int									identifierCounter	= 0;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	/**
-	 * After adding layouts to model.
-	 * 
-	 * @throws Exception
-	 */
-	@Test
-	public void testLayoutsWithData() throws Exception {
-		try {
-			Model model = createModel();
-
-			Project project = new Project();
-			project.addModel(model);
-			projectDao.add(project);
-
-			modelDao.evict(model);
-			projectDao.evict(project);
-
-			Layout layout = new Layout();
-			layout.setDirectory("tmp");
-			layout.setTitle("temporary name");
-
-			byte[] data = "test".getBytes();
-			UploadedFileEntry fileEntry = new UploadedFileEntry();
-			fileEntry.setFileContent(data);
-
-			layout.setInputData(fileEntry);
-			model.addLayout(layout);
-			layoutDao.add(layout);
-
-			layoutDao.evict(layout);
-
-			layout = layoutDao.getById(layout.getId());
-
-			assertEquals("test", new String(layout.getInputData().getFileContent(), StandardCharsets.UTF_8));
-
-			project = projectDao.getById(project.getId());
-			projectDao.delete(project);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	/**
-	 * After adding layouts to model.
-	 * 
-	 * @throws Exception
-	 */
-	@Test
-	public void testLayoutsWithoutData() throws Exception {
-		try {
-			Model model = createModel();
-			String tempName = "temporary name";
-
-			createUser();
-
-			Project project = new Project();
-			project.addModel(model);
-			projectDao.add(project);
-
-			modelDao.evict(model);
-			projectDao.evict(project);
-
-			assertEquals(0, layoutDao.getCountByUser(user));
-			assertEquals(0, layoutDao.getLayoutsByModel(model).size());
-			assertNull(layoutDao.getLayoutByName(model, tempName));
-
-			Layout layout = new Layout();
-			layout.setDirectory("tmp");
-			layout.setTitle(tempName);
-			layout.setCreator(user);
-			model.addLayout(layout);
-			layoutDao.add(layout);
-
-			layoutDao.evict(layout);
-
-			layout = layoutDao.getById(layout.getId());
-
-			assertEquals(1, layoutDao.getLayoutsByModel(model).size());
-			assertNotNull(layoutDao.getLayoutByName(model, tempName));
-			assertEquals(1, layoutDao.getCountByUser(user));
-
-			assertNull(layout.getInputData());
-
-			project = projectDao.getById(project.getId());
-			projectDao.delete(project);
-
-			userDao.delete(user);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createModel() {
-		Model model = new ModelFullIndexed(null);
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		SpeciesAlias alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-
-		alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
-		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
-		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
-		alias3.addAlias(alias);
-		alias3.addAlias(alias2);
-		alias.setParent(alias3);
-		alias2.setParent(alias3);
-
-		model.addAlias(alias);
-		model.addAlias(alias2);
-		model.addAlias(alias3);
-
-		model.addElement(alias.getSpecies());
-		model.addElement(alias2.getSpecies());
-		model.addElement(alias3.getSpecies());
-
-		CompartmentAlias cAlias = createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1");
-		model.addAlias(cAlias);
-		model.addCompartment(cAlias.getCompartment());
-		model.setWidth(2000);
-		model.setHeight(2000);
-
-		Layer layer = new Layer();
-		model.addLayer(layer);
-
-		LayerRect lr = new LayerRect();
-		lr.setColor(Color.YELLOW);
-		layer.addLayerRect(lr);
-
-		Reaction reaction = new TransportReaction();
-		reaction.addProduct(new Product(alias, alias.getElement()));
-		reaction.addReactant(new Reactant(alias2, alias2.getElement()));
-		reaction.setIdReaction("re" + identifierCounter++);
-		model.addReaction(reaction);
-
-		alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "pr1");
-		Protein protein = new Protein();
-		protein.setElementId("p1");
-		alias.setSpecies(protein);
-		model.addAlias(alias);
-		model.addElement(protein);
-
-		ModificationResidue mr = new ModificationResidue();
-		mr.setName("mr");
-		protein.addModificationResidue(mr);
-
-		protein.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "c"));
-		return model;
-	}
-
-	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
-		Compartment compartment = new Compartment("c" + identifierCounter++);
-		CompartmentAlias alias = new CompartmentAlias(compartment);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
-		Species species = new SimpleMolecule();
-		species.setElementId("s" + identifierCounter++);
-		SpeciesAlias alias = new SpeciesAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
-		ComplexSpecies species = new ComplexSpecies();
-		species.setElementId("s" + identifierCounter++);
-		ComplexAlias alias = new ComplexAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-}
+package lcsb.mapviewer.persist.dao.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.awt.Color;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.cache.UploadedFileEntry;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+public class LayoutDaoTest extends PersistTestFunctions {
+
+	@Autowired
+	private LayoutDao		layoutDao;
+
+	final static Logger	logger						= Logger.getLogger(LayoutDaoTest.class);
+
+	int									identifierCounter	= 0;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	/**
+	 * After adding layouts to model.
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void testLayoutsWithData() throws Exception {
+		try {
+			Model model = createModel();
+
+			Project project = new Project();
+			project.addModel(model);
+			projectDao.add(project);
+
+			modelDao.evict(model);
+			projectDao.evict(project);
+
+			Layout layout = new Layout();
+			layout.setDirectory("tmp");
+			layout.setTitle("temporary name");
+
+			byte[] data = "test".getBytes();
+			UploadedFileEntry fileEntry = new UploadedFileEntry();
+			fileEntry.setFileContent(data);
+
+			layout.setInputData(fileEntry);
+			model.addLayout(layout);
+			layoutDao.add(layout);
+
+			layoutDao.evict(layout);
+
+			layout = layoutDao.getById(layout.getId());
+
+			assertEquals("test", new String(layout.getInputData().getFileContent(), StandardCharsets.UTF_8));
+
+			project = projectDao.getById(project.getId());
+			projectDao.delete(project);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	/**
+	 * After adding layouts to model.
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void testLayoutsWithoutData() throws Exception {
+		try {
+			Model model = createModel();
+			String tempName = "temporary name";
+
+			createUser();
+
+			Project project = new Project();
+			project.addModel(model);
+			projectDao.add(project);
+
+			modelDao.evict(model);
+			projectDao.evict(project);
+
+			assertEquals(0, layoutDao.getCountByUser(user));
+			assertEquals(0, layoutDao.getLayoutsByModel(model).size());
+			assertNull(layoutDao.getLayoutByName(model, tempName));
+
+			Layout layout = new Layout();
+			layout.setDirectory("tmp");
+			layout.setTitle(tempName);
+			layout.setCreator(user);
+			model.addLayout(layout);
+			layoutDao.add(layout);
+
+			layoutDao.evict(layout);
+
+			layout = layoutDao.getById(layout.getId());
+
+			assertEquals(1, layoutDao.getLayoutsByModel(model).size());
+			assertNotNull(layoutDao.getLayoutByName(model, tempName));
+			assertEquals(1, layoutDao.getCountByUser(user));
+
+			assertNull(layout.getInputData());
+
+			project = projectDao.getById(project.getId());
+			projectDao.delete(project);
+
+			userDao.delete(user);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createModel() {
+		Model model = new ModelFullIndexed(null);
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		SpeciesAlias alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+
+		alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
+		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
+		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
+		alias3.addAlias(alias);
+		alias3.addAlias(alias2);
+		alias.setParent(alias3);
+		alias2.setParent(alias3);
+
+		model.addAlias(alias);
+		model.addAlias(alias2);
+		model.addAlias(alias3);
+
+		model.addElement(alias.getSpecies());
+		model.addElement(alias2.getSpecies());
+		model.addElement(alias3.getSpecies());
+
+		CompartmentAlias cAlias = createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1");
+		model.addAlias(cAlias);
+		model.addCompartment(cAlias.getCompartment());
+		model.setWidth(2000);
+		model.setHeight(2000);
+
+		Layer layer = new Layer();
+		model.addLayer(layer);
+
+		LayerRect lr = new LayerRect();
+		lr.setColor(Color.YELLOW);
+		layer.addLayerRect(lr);
+
+		Reaction reaction = new TransportReaction();
+		reaction.addProduct(new Product(alias, alias.getElement()));
+		reaction.addReactant(new Reactant(alias2, alias2.getElement()));
+		reaction.setIdReaction("re" + identifierCounter++);
+		model.addReaction(reaction);
+
+		alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "pr1");
+		Protein protein = new GenericProtein();
+		protein.setElementId("p1");
+		alias.setSpecies(protein);
+		model.addAlias(alias);
+		model.addElement(protein);
+
+		ModificationResidue mr = new ModificationResidue();
+		mr.setName("mr");
+		protein.addModificationResidue(mr);
+
+		protein.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "c"));
+		return model;
+	}
+
+	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
+		Compartment compartment = new Compartment("c" + identifierCounter++);
+		CompartmentAlias alias = new CompartmentAlias(compartment);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
+		SimpleMolecule simpleMolecule = new SimpleMolecule();
+		simpleMolecule.setElementId("s" + identifierCounter++);
+		SimpleMoleculeAlias alias = new SimpleMoleculeAlias(simpleMolecule);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
+		ComplexSpecies species = new ComplexSpecies();
+		species.setElementId("s" + identifierCounter++);
+		ComplexAlias alias = new ComplexAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/ModelDaoTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/ModelDaoTest.java
index 65860270f9..cafd188e48 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/ModelDaoTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/ModelDaoTest.java
@@ -1,482 +1,484 @@
-package lcsb.mapviewer.persist.dao.map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.Color;
-
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.graph.DataMiningSet;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.layout.graphics.Layer;
-import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ModelDaoTest extends PersistTestFunctions {
-	Logger					logger						= Logger.getLogger(ModelDaoTest.class);
-	private Project	project;
-	String					projectId				= "Some_id";
-	int							identifierCounter	= 0;
-
-	@Before
-	public void setUp() throws Exception {
-		project = projectDao.getProjectByProjectId(projectId);
-		if (project!=null) {
-			projectDao.delete(project);
-		}
-		project = new Project();
-		project.setProjectId(projectId);
-		projectDao.add(project);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		projectDao.delete(project);
-	}
-
-	@Test
-	public void testLoadFromDb() throws Exception {
-		try {
-			Model model = createModel();
-			project.addModel(model);
-			modelDao.add(model);
-			projectDao.update(project);
-			projectDao.evict(project);
-
-			modelDao.evict(model);
-			ModelData model2 = modelDao.getById(model.getId());
-			assertNotNull(model2);
-			assertFalse(model2 == model);
-
-			assertEquals(model.getAliases().size(), model2.getAliases().size());
-			assertEquals(model.getLayers().size(), model2.getLayers().size());
-			assertEquals(model.getReactions().size(), model2.getReactions().size());
-			assertEquals(model.getElements().size(), model2.getElements().size());
-
-			modelDao.delete(model2);
-			model2 = modelDao.getById(model.getId());
-			assertNull(model2);
-			project = projectDao.getById(project.getId());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testIndexesReload() throws Exception {
-		try {
-			Model model = createModel();
-			project.addModel(model);
-			modelDao.add(model);
-			modelDao.evict(model);
-			ModelData model2 = modelDao.getById(model.getId());
-			Model fullModel = new ModelFullIndexed(model2);
-			assertNotNull(model2);
-
-			assertEquals(model.getAliases().size(), model2.getAliases().size());
-			assertEquals(model.getLayers().size(), model2.getLayers().size());
-			assertEquals(model.getReactions().size(), model2.getReactions().size());
-			assertEquals(model.getElements().size(), model2.getElements().size());
-
-			// check if we really performed a test
-			boolean test = false;
-
-			for (Alias alias : model.getAliases()) {
-				assertNotNull(fullModel.getAliasByAliasId(alias.getAliasId()));
-				test = true;
-			}
-			assertTrue(test);
-
-			test = false;
-			for (Element element : model.getElements()) {
-				if (element instanceof Species) {
-					assertNotNull(fullModel.getAliasesBySpeciesId(((Species) element).getElementId()));
-					assertNotNull(fullModel.getSpeciesBySpeciesId(((Species) element).getElementId()));
-					test = true;
-				}
-			}
-			assertTrue(test);
-
-			test = false;
-			for (Element element : model.getElements()) {
-				if (element instanceof Compartment) {
-					assertNotNull(fullModel.getCompartmentByCompartmentId(((Compartment) element).getElementId()));
-					assertNotNull(fullModel.getCompartmentsAliasByCompartmentId(((Compartment) element).getElementId()));
-					test = true;
-				}
-			}
-			assertTrue(test);
-
-			test = false;
-			for (Alias alias : model.getAliases()) {
-				if (alias instanceof CompartmentAlias) {
-					assertNotNull(fullModel.getCompartmentAliasByCompartmentAliasId(alias.getAliasId()));
-					test = true;
-				}
-			}
-			assertTrue(test);
-
-			model2.setHeight(32);
-			modelDao.update(model2.getModel());
-
-			modelDao.delete(model2);
-			model2 = modelDao.getById(model.getId());
-			assertNull(model2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReactionInModelAfterReload() throws Exception {
-		try {
-			Model model = createModel();
-			Reaction reaction = model.getReactions().iterator().next();
-			project.addModel(model);
-			modelDao.add(model);
-			projectDao.update(project);
-			projectDao.evict(project);
-			modelDao.evict(model);
-			ModelData model2 = modelDao.getById(model.getId());
-
-			Reaction reaction2 = null;
-			for (Reaction r : model2.getReactions()) {
-				if (r.getIdReaction().equals(reaction.getIdReaction())) {
-					reaction2 = r;
-				}
-			}
-			assertNotNull(reaction2);
-			assertFalse(reaction.equals(reaction2));
-
-			assertEquals(reaction.getNodes().size(), reaction2.getNodes().size());
-
-			modelDao.delete(model2);
-			model2 = modelDao.getById(model.getId());
-			assertNull(model2);
-			project = projectDao.getById(project.getId());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLastModelForProjectName() throws Exception {
-		try {
-			ModelData model3 = modelDao.getLastModelForProjectIdentifier(projectId, false);
-			assertNull(model3);
-
-			Model model = createModel();
-			project.addModel(model);
-			modelDao.add(model);
-
-			ModelData newModel = modelDao.getLastModelForProjectIdentifier(projectId, false);
-			assertNotNull(newModel);
-			assertEquals(model.getId(), newModel.getId());
-
-			Model model2 = createModel();
-			project.addModel(model2);
-			modelDao.add(model2);
-
-			newModel = modelDao.getLastModelForProjectIdentifier(projectId, false);
-			assertNotNull(newModel);
-			assertEquals(model2.getId(), newModel.getId());
-
-			modelDao.delete(model2);
-			modelDao.delete(model);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	/**
-	 * After adding model to db, modification residues disappear from the model...
-	 * 
-	 * @throws Exception
-	 */
-	@Test
-	public void testModificationsInProteins() throws Exception {
-		try {
-			Model model = createModel();
-			Project project = new Project();
-			project.addModel(model);
-			projectDao.add(project);
-
-			modelDao.evict(model);
-			projectDao.evict(project);
-			Model model2 = new ModelFullIndexed(modelDao.getById(model.getId()));
-
-			Protein originalSpecies = (Protein) model.getSpeciesBySpeciesId("p1");
-			Protein fromDbSpecies = (Protein) model2.getSpeciesBySpeciesId("p1");
-
-			assertFalse(originalSpecies.equals(fromDbSpecies));
-			assertEquals(originalSpecies.getModificationResidues().size(), fromDbSpecies.getModificationResidues().size());
-
-			project = projectDao.getById(project.getId());
-			projectDao.delete(project);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	/**
-	 * After adding model to db with creation warnings...
-	 * 
-	 * @throws Exception
-	 */
-	@Test
-	public void testCreationWarnings() throws Exception {
-		try {
-			Model model = createModel();
-			model.addCreationWarning("warning A");
-			model.addCreationWarning("warning B");
-			assertEquals(2, model.getCreationWarnings().size());
-
-			Project project = new Project();
-			project.addModel(model);
-			projectDao.add(project);
-
-			modelDao.evict(model);
-			projectDao.evict(project);
-			ModelData model2 = modelDao.getById(model.getId());
-
-			assertEquals(2, model2.getCreationWarnings().size());
-
-			project = projectDao.getById(project.getId());
-			projectDao.delete(project);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	/**
-	 * After adding model to db, miriam annotations disappear...
-	 * 
-	 * @throws Exception
-	 */
-	@Test
-	public void testMiriamInSpecies() throws Exception {
-		try {
-			Model model = createModel();
-			Project project = new Project();
-			project.addModel(model);
-			projectDao.add(project);
-
-			modelDao.evict(model);
-			projectDao.evict(project);
-			Model model2 = new ModelFullIndexed(modelDao.getById(model.getId()));
-
-			Protein originalSpecies = (Protein) model.getSpeciesBySpeciesId("p1");
-			Protein fromDbSpecies = (Protein) model2.getSpeciesBySpeciesId("p1");
-
-			assertFalse(originalSpecies.equals(fromDbSpecies));
-			assertEquals(originalSpecies.getMiriamData().size(), fromDbSpecies.getMiriamData().size());
-
-			project = projectDao.getById(project.getId());
-			projectDao.delete(project);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	/**
-	 * After adding layouts to model.
-	 * 
-	 * @throws Exception
-	 */
-	@Test
-	public void testLayoutsInModel() throws Exception {
-		try {
-			Model model = createModel();
-
-			Layout layout = new Layout();
-			layout.setDirectory("tmp");
-			layout.setTitle("temporary name");
-			model.addLayout(layout);
-			Project project = new Project();
-			project.addModel(model);
-			projectDao.add(project);
-
-			modelDao.evict(model);
-			projectDao.evict(project);
-			ModelData model2 = modelDao.getById(model.getId());
-
-			assertEquals(1, model2.getLayouts().size());
-			assertEquals("tmp", model2.getLayouts().get(0).getDirectory());
-			assertEquals("temporary name", model2.getLayouts().get(0).getTitle());
-
-			project = projectDao.getById(project.getId());
-			projectDao.delete(project);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createModel() {
-		Model model = new ModelFullIndexed(null);
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		SpeciesAlias alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-		alias = createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121");
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-
-		alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
-		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
-		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
-		alias3.addAlias(alias);
-		alias3.addAlias(alias2);
-		alias.setParent(alias3);
-		alias2.setParent(alias3);
-
-		model.addAlias(alias);
-		model.addAlias(alias2);
-		model.addAlias(alias3);
-
-		model.addElement(alias.getSpecies());
-		model.addElement(alias2.getSpecies());
-		model.addElement(alias3.getSpecies());
-
-		CompartmentAlias cAlias = createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1");
-		model.addAlias(cAlias);
-		model.addCompartment(cAlias.getCompartment());
-		model.setWidth(2000);
-		model.setHeight(2000);
-
-		Layer layer = new Layer();
-		model.addLayer(layer);
-
-		LayerRect lr = new LayerRect();
-		lr.setColor(Color.YELLOW);
-		layer.addLayerRect(lr);
-
-		Reaction reaction = new TransportReaction();
-		reaction.addProduct(new Product(alias, alias.getElement()));
-		reaction.addReactant(new Reactant(alias2, alias2.getElement()));
-		reaction.setIdReaction("re" + identifierCounter++);
-		model.addReaction(reaction);
-
-		alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "pr1");
-		Protein protein = new Protein();
-		protein.setElementId("p1");
-		alias.setSpecies(protein);
-		model.addAlias(alias);
-		model.addElement(protein);
-
-		ModificationResidue mr = new ModificationResidue();
-		mr.setName("mr");
-		protein.addModificationResidue(mr);
-
-		protein.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "c"));
-		return model;
-	}
-
-	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
-		Compartment compartment = new Compartment("c" + identifierCounter++);
-		CompartmentAlias alias = new CompartmentAlias(compartment);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
-		Species species = new Protein();
-		species.setElementId("s" + identifierCounter++);
-		species.setName("SNCA");
-		species.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
-		species.addMiriamData(new MiriamData(MiriamType.HGNC, "11138"));
-		SpeciesAlias alias = new SpeciesAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
-		ComplexSpecies species = new ComplexSpecies();
-		species.setElementId("s" + identifierCounter++);
-		ComplexAlias alias = new ComplexAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	@Test
-	public void testModelWithDataMining() throws Exception {
-		try {
-			Model model = createModel();
-			model.addDataMiningSet(new DataMiningSet());
-			project.addModel(model);
-			modelDao.add(model);
-			projectDao.update(project);
-			projectDao.evict(project);
-
-			modelDao.evict(model);
-			ModelData model2 = modelDao.getById(model.getId());
-			assertEquals(1, model2.getDataMiningSets().size());
-
-			project = projectDao.getById(project.getId());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.persist.dao.map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.Color;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.graph.DataMiningSet;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.layout.graphics.Layer;
+import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+public class ModelDaoTest extends PersistTestFunctions {
+	Logger					logger						= Logger.getLogger(ModelDaoTest.class);
+	private Project	project;
+	String					projectId				= "Some_id";
+	int							identifierCounter	= 0;
+
+	@Before
+	public void setUp() throws Exception {
+		project = projectDao.getProjectByProjectId(projectId);
+		if (project!=null) {
+			projectDao.delete(project);
+		}
+		project = new Project();
+		project.setProjectId(projectId);
+		projectDao.add(project);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		projectDao.delete(project);
+	}
+
+	@Test
+	public void testLoadFromDb() throws Exception {
+		try {
+			Model model = createModel();
+			project.addModel(model);
+			modelDao.add(model);
+			projectDao.update(project);
+			projectDao.evict(project);
+
+			modelDao.evict(model);
+			ModelData model2 = modelDao.getById(model.getId());
+			assertNotNull(model2);
+			assertFalse(model2 == model);
+
+			assertEquals(model.getAliases().size(), model2.getAliases().size());
+			assertEquals(model.getLayers().size(), model2.getLayers().size());
+			assertEquals(model.getReactions().size(), model2.getReactions().size());
+			assertEquals(model.getElements().size(), model2.getElements().size());
+
+			modelDao.delete(model2);
+			model2 = modelDao.getById(model.getId());
+			assertNull(model2);
+			project = projectDao.getById(project.getId());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testIndexesReload() throws Exception {
+		try {
+			Model model = createModel();
+			project.addModel(model);
+			modelDao.add(model);
+			modelDao.evict(model);
+			ModelData model2 = modelDao.getById(model.getId());
+			Model fullModel = new ModelFullIndexed(model2);
+			assertNotNull(model2);
+
+			assertEquals(model.getAliases().size(), model2.getAliases().size());
+			assertEquals(model.getLayers().size(), model2.getLayers().size());
+			assertEquals(model.getReactions().size(), model2.getReactions().size());
+			assertEquals(model.getElements().size(), model2.getElements().size());
+
+			// check if we really performed a test
+			boolean test = false;
+
+			for (Alias alias : model.getAliases()) {
+				assertNotNull(fullModel.getAliasByAliasId(alias.getAliasId()));
+				test = true;
+			}
+			assertTrue(test);
+
+			test = false;
+			for (Element element : model.getElements()) {
+				if (element instanceof Species) {
+					assertNotNull(fullModel.getAliasesBySpeciesId(((Species) element).getElementId()));
+					assertNotNull(fullModel.getSpeciesBySpeciesId(((Species) element).getElementId()));
+					test = true;
+				}
+			}
+			assertTrue(test);
+
+			test = false;
+			for (Element element : model.getElements()) {
+				if (element instanceof Compartment) {
+					assertNotNull(fullModel.getCompartmentByCompartmentId(((Compartment) element).getElementId()));
+					assertNotNull(fullModel.getCompartmentsAliasByCompartmentId(((Compartment) element).getElementId()));
+					test = true;
+				}
+			}
+			assertTrue(test);
+
+			test = false;
+			for (Alias alias : model.getAliases()) {
+				if (alias instanceof CompartmentAlias) {
+					assertNotNull(fullModel.getCompartmentAliasByCompartmentAliasId(alias.getAliasId()));
+					test = true;
+				}
+			}
+			assertTrue(test);
+
+			model2.setHeight(32);
+			modelDao.update(model2.getModel());
+
+			modelDao.delete(model2);
+			model2 = modelDao.getById(model.getId());
+			assertNull(model2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReactionInModelAfterReload() throws Exception {
+		try {
+			Model model = createModel();
+			Reaction reaction = model.getReactions().iterator().next();
+			project.addModel(model);
+			modelDao.add(model);
+			projectDao.update(project);
+			projectDao.evict(project);
+			modelDao.evict(model);
+			ModelData model2 = modelDao.getById(model.getId());
+
+			Reaction reaction2 = null;
+			for (Reaction r : model2.getReactions()) {
+				if (r.getIdReaction().equals(reaction.getIdReaction())) {
+					reaction2 = r;
+				}
+			}
+			assertNotNull(reaction2);
+			assertFalse(reaction.equals(reaction2));
+
+			assertEquals(reaction.getNodes().size(), reaction2.getNodes().size());
+
+			modelDao.delete(model2);
+			model2 = modelDao.getById(model.getId());
+			assertNull(model2);
+			project = projectDao.getById(project.getId());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLastModelForProjectName() throws Exception {
+		try {
+			ModelData model3 = modelDao.getLastModelForProjectIdentifier(projectId, false);
+			assertNull(model3);
+
+			Model model = createModel();
+			project.addModel(model);
+			modelDao.add(model);
+
+			ModelData newModel = modelDao.getLastModelForProjectIdentifier(projectId, false);
+			assertNotNull(newModel);
+			assertEquals(model.getId(), newModel.getId());
+
+			Model model2 = createModel();
+			project.addModel(model2);
+			modelDao.add(model2);
+
+			newModel = modelDao.getLastModelForProjectIdentifier(projectId, false);
+			assertNotNull(newModel);
+			assertEquals(model2.getId(), newModel.getId());
+
+			modelDao.delete(model2);
+			modelDao.delete(model);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	/**
+	 * After adding model to db, modification residues disappear from the model...
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void testModificationsInProteins() throws Exception {
+		try {
+			Model model = createModel();
+			Project project = new Project();
+			project.addModel(model);
+			projectDao.add(project);
+
+			modelDao.evict(model);
+			projectDao.evict(project);
+			Model model2 = new ModelFullIndexed(modelDao.getById(model.getId()));
+
+			Protein originalSpecies = (Protein) model.getSpeciesBySpeciesId("p1");
+			Protein fromDbSpecies = (Protein) model2.getSpeciesBySpeciesId("p1");
+
+			assertFalse(originalSpecies.equals(fromDbSpecies));
+			assertEquals(originalSpecies.getModificationResidues().size(), fromDbSpecies.getModificationResidues().size());
+
+			project = projectDao.getById(project.getId());
+			projectDao.delete(project);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	/**
+	 * After adding model to db with creation warnings...
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void testCreationWarnings() throws Exception {
+		try {
+			Model model = createModel();
+			model.addCreationWarning("warning A");
+			model.addCreationWarning("warning B");
+			assertEquals(2, model.getCreationWarnings().size());
+
+			Project project = new Project();
+			project.addModel(model);
+			projectDao.add(project);
+
+			modelDao.evict(model);
+			projectDao.evict(project);
+			ModelData model2 = modelDao.getById(model.getId());
+
+			assertEquals(2, model2.getCreationWarnings().size());
+
+			project = projectDao.getById(project.getId());
+			projectDao.delete(project);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	/**
+	 * After adding model to db, miriam annotations disappear...
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void testMiriamInSpecies() throws Exception {
+		try {
+			Model model = createModel();
+			Project project = new Project();
+			project.addModel(model);
+			projectDao.add(project);
+
+			modelDao.evict(model);
+			projectDao.evict(project);
+			Model model2 = new ModelFullIndexed(modelDao.getById(model.getId()));
+
+			Protein originalSpecies = (Protein) model.getSpeciesBySpeciesId("p1");
+			Protein fromDbSpecies = (Protein) model2.getSpeciesBySpeciesId("p1");
+
+			assertFalse(originalSpecies.equals(fromDbSpecies));
+			assertEquals(originalSpecies.getMiriamData().size(), fromDbSpecies.getMiriamData().size());
+
+			project = projectDao.getById(project.getId());
+			projectDao.delete(project);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	/**
+	 * After adding layouts to model.
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void testLayoutsInModel() throws Exception {
+		try {
+			Model model = createModel();
+
+			Layout layout = new Layout();
+			layout.setDirectory("tmp");
+			layout.setTitle("temporary name");
+			model.addLayout(layout);
+			Project project = new Project();
+			project.addModel(model);
+			projectDao.add(project);
+
+			modelDao.evict(model);
+			projectDao.evict(project);
+			ModelData model2 = modelDao.getById(model.getId());
+
+			assertEquals(1, model2.getLayouts().size());
+			assertEquals("tmp", model2.getLayouts().get(0).getDirectory());
+			assertEquals("temporary name", model2.getLayouts().get(0).getTitle());
+
+			project = projectDao.getById(project.getId());
+			projectDao.delete(project);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createModel() {
+		Model model = new ModelFullIndexed(null);
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		SpeciesAlias alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+		alias = createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121");
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+
+		alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
+		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
+		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
+		alias3.addAlias(alias);
+		alias3.addAlias(alias2);
+		alias.setParent(alias3);
+		alias2.setParent(alias3);
+
+		model.addAlias(alias);
+		model.addAlias(alias2);
+		model.addAlias(alias3);
+
+		model.addElement(alias.getSpecies());
+		model.addElement(alias2.getSpecies());
+		model.addElement(alias3.getSpecies());
+
+		CompartmentAlias cAlias = createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1");
+		model.addAlias(cAlias);
+		model.addCompartment(cAlias.getCompartment());
+		model.setWidth(2000);
+		model.setHeight(2000);
+
+		Layer layer = new Layer();
+		model.addLayer(layer);
+
+		LayerRect lr = new LayerRect();
+		lr.setColor(Color.YELLOW);
+		layer.addLayerRect(lr);
+
+		Reaction reaction = new TransportReaction();
+		reaction.addProduct(new Product(alias, alias.getElement()));
+		reaction.addReactant(new Reactant(alias2, alias2.getElement()));
+		reaction.setIdReaction("re" + identifierCounter++);
+		model.addReaction(reaction);
+
+		alias = createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "pr1");
+		Protein protein = new GenericProtein();
+		protein.setElementId("p1");
+		alias.setSpecies(protein);
+		model.addAlias(alias);
+		model.addElement(protein);
+
+		ModificationResidue mr = new ModificationResidue();
+		mr.setName("mr");
+		protein.addModificationResidue(mr);
+
+		protein.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CHEBI, "c"));
+		return model;
+	}
+
+	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
+		Compartment compartment = new Compartment("c" + identifierCounter++);
+		CompartmentAlias alias = new CompartmentAlias(compartment);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
+		GenericProtein protein = new GenericProtein();
+		protein.setElementId("s" + identifierCounter++);
+		protein.setName("SNCA");
+		protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
+		protein.addMiriamData(new MiriamData(MiriamType.HGNC, "11138"));
+		SpeciesAlias alias = new GenericProteinAlias(protein);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
+		ComplexSpecies species = new ComplexSpecies();
+		species.setElementId("s" + identifierCounter++);
+		ComplexAlias alias = new ComplexAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	@Test
+	public void testModelWithDataMining() throws Exception {
+		try {
+			Model model = createModel();
+			model.addDataMiningSet(new DataMiningSet());
+			project.addModel(model);
+			modelDao.add(model);
+			projectDao.update(project);
+			projectDao.evict(project);
+
+			modelDao.evict(model);
+			ModelData model2 = modelDao.getById(model.getId());
+			assertEquals(1, model2.getDataMiningSets().size());
+
+			project = projectDao.getById(project.getId());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/layout/alias/AliasDaoTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/layout/alias/AliasDaoTest.java
index 740572b2ef..6886253bbc 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/layout/alias/AliasDaoTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/layout/alias/AliasDaoTest.java
@@ -1,160 +1,161 @@
-package lcsb.mapviewer.persist.dao.map.layout.alias;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SearchIndex;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.AliasSubmodelConnection;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.model.SubmodelType;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-public class AliasDaoTest extends PersistTestFunctions {
-	Logger					logger						= Logger.getLogger(AliasDaoTest.class);
-
-	private Project	project;
-	String					projectId				= "Some_id";
-
-	int							identifierCounter	= 0;
-
-	@Before
-	public void setUp() throws Exception {
-		project = projectDao.getProjectByProjectId(projectId);
-		if (project!=null) {
-			projectDao.delete(project);
-		}
-		project = new Project();
-		project.setProjectId(projectId);
-		projectDao.add(project);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		projectDao.delete(project);
-	}
-
-	@Test
-	public void anotherSaveDaoTest() throws Exception {
-		try {
-			Model model = createModel();
-			project.addModel(model);
-
-			SpeciesAlias alias = (SpeciesAlias) model.getAliasByAliasId("sa2");
-
-			alias.getSearchIndexes().add(new SearchIndex("blabla"));
-
-			modelDao.add(model);
-
-			Model model2 = new ModelFullIndexed(modelDao.getById(model.getId()));
-
-			SpeciesAlias alias2 = (SpeciesAlias) aliasDao.getById(model2.getAliasByAliasId("sa2").getId());
-
-			assertEquals(1, alias2.getSearchIndexes().size());
-
-			modelDao.delete(model);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createModel() {
-		Model model = new ModelFullIndexed(null);
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		model.addAlias(createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2"));
-		model.addAlias(createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117"));
-		model.addAlias(createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119"));
-		model.addAlias(createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121"));
-
-		SpeciesAlias alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
-		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
-		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
-		alias3.addAlias(alias);
-		alias3.addAlias(alias2);
-		alias.setParent(alias3);
-		alias2.setParent(alias3);
-
-		model.addAlias(alias);
-		model.addAlias(alias2);
-		model.addAlias(alias3);
-
-		model.addAlias(createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1"));
-		model.setWidth(2000);
-		model.setHeight(2000);
-		return model;
-	}
-
-	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
-		Compartment compartment = new Compartment("c" + identifierCounter++);
-		CompartmentAlias alias = new CompartmentAlias(compartment);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
-		Species species = new SimpleMolecule();
-		species.setElementId("s" + identifierCounter++);
-		SpeciesAlias alias = new SpeciesAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
-		ComplexSpecies species = new ComplexSpecies();
-		species.setElementId("s" + identifierCounter++);
-		ComplexAlias alias = new ComplexAlias(species);
-		alias.setAliasId(aliasId);
-		alias.setX(x);
-		alias.setY(y);
-		alias.setWidth(width);
-		alias.setHeight(height);
-		return alias;
-	}
-
-	@Test
-	public void saveAliasWithSubmodelTest() throws Exception {
-		try {
-			long count = modelDao.getCount();
-			Model model = createModel();
-			Model model1 = createModel();
-			Alias alias = model.getAliasByAliasId("sa2");
-			AliasSubmodelConnection submodel = new AliasSubmodelConnection(model1, SubmodelType.UNKNOWN);
-			alias.setSubmodel(submodel);
-			project.addModel(model);
-
-			projectDao.add(project);
-			projectDao.flush();
-
-			long count2 = modelDao.getCount();
-			assertEquals(count + 2, count2);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.persist.dao.map.layout.alias;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SearchIndex;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.AliasSubmodelConnection;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.model.SubmodelType;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+public class AliasDaoTest extends PersistTestFunctions {
+	Logger					logger						= Logger.getLogger(AliasDaoTest.class);
+
+	private Project	project;
+	String					projectId				= "Some_id";
+
+	int							identifierCounter	= 0;
+
+	@Before
+	public void setUp() throws Exception {
+		project = projectDao.getProjectByProjectId(projectId);
+		if (project!=null) {
+			projectDao.delete(project);
+		}
+		project = new Project();
+		project.setProjectId(projectId);
+		projectDao.add(project);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		projectDao.delete(project);
+	}
+
+	@Test
+	public void anotherSaveDaoTest() throws Exception {
+		try {
+			Model model = createModel();
+			project.addModel(model);
+
+			SpeciesAlias alias = (SpeciesAlias) model.getAliasByAliasId("sa2");
+
+			alias.getSearchIndexes().add(new SearchIndex("blabla"));
+
+			modelDao.add(model);
+
+			Model model2 = new ModelFullIndexed(modelDao.getById(model.getId()));
+
+			SpeciesAlias alias2 = (SpeciesAlias) aliasDao.getById(model2.getAliasByAliasId("sa2").getId());
+
+			assertEquals(1, alias2.getSearchIndexes().size());
+
+			modelDao.delete(model);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createModel() {
+		Model model = new ModelFullIndexed(null);
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		model.addAlias(createSpeciesAlias(264.8333333333335, 517.75, 86.0, 46.0, "sa2"));
+		model.addAlias(createSpeciesAlias(267.6666666666665, 438.75, 80.0, 40.0, "sa1117"));
+		model.addAlias(createSpeciesAlias(261.6666666666665, 600.75, 92.0, 52.0, "sa1119"));
+		model.addAlias(createSpeciesAlias(203.666666666667, 687.75, 98.0, 58.0, "sa1121"));
+
+		SpeciesAlias alias = createSpeciesAlias(817.714285714286, 287.642857142859, 80.0, 40.0, "sa1422");
+		SpeciesAlias alias2 = createSpeciesAlias(224.964285714286, 241.392857142859, 80.0, 40.0, "sa1419");
+		ComplexAlias alias3 = createComplexAlias(804.714285714286, 182.642857142859, 112.0, 172.0, "csa152");
+		alias3.addAlias(alias);
+		alias3.addAlias(alias2);
+		alias.setParent(alias3);
+		alias2.setParent(alias3);
+
+		model.addAlias(alias);
+		model.addAlias(alias2);
+		model.addAlias(alias3);
+
+		model.addAlias(createCompartmentAlias(380.0, 416.0, 1893.0, 1866.0, "ca1"));
+		model.setWidth(2000);
+		model.setHeight(2000);
+		return model;
+	}
+
+	private CompartmentAlias createCompartmentAlias(double x, double y, double width, double height, String aliasId) {
+		Compartment compartment = new Compartment("c" + identifierCounter++);
+		CompartmentAlias alias = new CompartmentAlias(compartment);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private SpeciesAlias createSpeciesAlias(double x, double y, double width, double height, String aliasId) {
+		SimpleMolecule species = new SimpleMolecule();
+		species.setElementId("s" + identifierCounter++);
+		SimpleMoleculeAlias alias = new SimpleMoleculeAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	private ComplexAlias createComplexAlias(double x, double y, double width, double height, String aliasId) {
+		ComplexSpecies species = new ComplexSpecies();
+		species.setElementId("s" + identifierCounter++);
+		ComplexAlias alias = new ComplexAlias(species);
+		alias.setAliasId(aliasId);
+		alias.setX(x);
+		alias.setY(y);
+		alias.setWidth(width);
+		alias.setHeight(height);
+		return alias;
+	}
+
+	@Test
+	public void saveAliasWithSubmodelTest() throws Exception {
+		try {
+			long count = modelDao.getCount();
+			Model model = createModel();
+			Model model1 = createModel();
+			Alias alias = model.getAliasByAliasId("sa2");
+			AliasSubmodelConnection submodel = new AliasSubmodelConnection(model1, SubmodelType.UNKNOWN);
+			alias.setSubmodel(submodel);
+			project.addModel(model);
+
+			projectDao.add(project);
+			projectDao.flush();
+
+			long count2 = modelDao.getCount();
+			assertEquals(count + 2, count2);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/AntisenseRnaTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/AntisenseRnaTest.java
index 999df12318..a1ae7d9b5b 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/AntisenseRnaTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/AntisenseRnaTest.java
@@ -1,95 +1,97 @@
-package lcsb.mapviewer.persist.dao.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.test.annotation.Rollback;
-
-@Rollback(true)
-public class AntisenseRnaTest extends PersistTestFunctions {
-	Logger logger						= Logger.getLogger(AntisenseRnaTest.class);
-
-	int		identifierCounter = 0;
-	String projectId				 = "Some_id";
-
-	@Before
-	public void setUp() throws Exception {
-		Project project = projectDao.getProjectByProjectId(projectId);
-		if (project != null) {
-			projectDao.delete(project);
-		}
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testAntisenseRnaRegionInDb() throws Exception {
-		try {
-			Project project = new Project();
-			project.setProjectId(projectId);
-
-			Model model = createModel();
-
-			project.addModel(model);
-			projectDao.add(project);
-			projectDao.evict(project);
-
-			Project project2 = projectDao.getProjectByProjectId(projectId);
-			assertNotNull(project2);
-			assertFalse(project2.equals(project));
-			assertEquals(project.getId(), project2.getId());
-
-			Model model2 = new ModelFullIndexed(project2.getModels().iterator().next());
-
-			Species sp = model.getSpecies().iterator().next();
-			AntisenseRna ar = (AntisenseRna) sp;
-
-			Species sp2 = model2.getSpecies().iterator().next();
-			AntisenseRna ar2 = (AntisenseRna) sp2;
-
-			projectDao.delete(project2);
-
-			assertEquals(ar.getRegions().size(), ar2.getRegions().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createModel() {
-		Model model = new ModelFullIndexed(null);
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		AntisenseRna species = new AntisenseRna();
-		species.setElementId("s" + identifierCounter++);
-		species.addRegion(new AntisenseRnaRegion());
-		SpeciesAlias alias = new SpeciesAlias(species);
-		alias.setAliasId("As");
-		alias.setX(1);
-		alias.setY(2);
-		alias.setWidth(10);
-		alias.setHeight(20);
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-
-		return model;
-	}
-
-}
+package lcsb.mapviewer.persist.dao.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.test.annotation.Rollback;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.AntisenseRnaAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+@Rollback(true)
+public class AntisenseRnaTest extends PersistTestFunctions {
+	Logger logger						= Logger.getLogger(AntisenseRnaTest.class);
+
+	int		identifierCounter = 0;
+	String projectId				 = "Some_id";
+
+	@Before
+	public void setUp() throws Exception {
+		Project project = projectDao.getProjectByProjectId(projectId);
+		if (project != null) {
+			projectDao.delete(project);
+		}
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testAntisenseRnaRegionInDb() throws Exception {
+		try {
+			Project project = new Project();
+			project.setProjectId(projectId);
+
+			Model model = createModel();
+
+			project.addModel(model);
+			projectDao.add(project);
+			projectDao.evict(project);
+
+			Project project2 = projectDao.getProjectByProjectId(projectId);
+			assertNotNull(project2);
+			assertFalse(project2.equals(project));
+			assertEquals(project.getId(), project2.getId());
+
+			Model model2 = new ModelFullIndexed(project2.getModels().iterator().next());
+
+			Species sp = model.getSpecies().iterator().next();
+			AntisenseRna ar = (AntisenseRna) sp;
+
+			Species sp2 = model2.getSpecies().iterator().next();
+			AntisenseRna ar2 = (AntisenseRna) sp2;
+
+			projectDao.delete(project2);
+
+			assertEquals(ar.getRegions().size(), ar2.getRegions().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createModel() {
+		Model model = new ModelFullIndexed(null);
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		AntisenseRna species = new AntisenseRna();
+		species.setElementId("s" + identifierCounter++);
+		species.addRegion(new AntisenseRnaRegion());
+		SpeciesAlias alias = new AntisenseRnaAlias(species);
+		alias.setAliasId("As");
+		alias.setX(1);
+		alias.setY(2);
+		alias.setWidth(10);
+		alias.setHeight(20);
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+
+		return model;
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/RnaTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/RnaTest.java
index 814c6fdaaf..9178b36c55 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/RnaTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/RnaTest.java
@@ -1,94 +1,96 @@
-package lcsb.mapviewer.persist.dao.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.fields.RnaRegion;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class RnaTest extends PersistTestFunctions {
-	Logger	logger						= Logger.getLogger(RnaTest.class);
-
-	int			identifierCounter	= 0;
-	
-	String projectId = "Some_id";
-
-	@Before
-	public void setUp() throws Exception {
-		Project project = projectDao.getProjectByProjectId(projectId);
-		if (project != null) {
-			projectDao.delete(project);
-		}
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testRnaRegionInDb() throws Exception {
-		try {
-			Project project = new Project();
-			project.setProjectId(projectId);
-
-			Model model = createModel();
-
-			project.addModel(model);
-			projectDao.add(project);
-			projectDao.evict(project);
-
-			Project project2 = projectDao.getProjectByProjectId(projectId);
-			assertNotNull(project2);
-			assertFalse(project2.equals(project));
-			assertEquals(project.getId(), project2.getId());
-
-			Model model2 = new ModelFullIndexed(project2.getModels().iterator().next());
-
-			Species sp = model.getSpecies().iterator().next();
-			Rna ar = (Rna) sp;
-
-			Species sp2 = model2.getSpecies().iterator().next();
-			Rna ar2 = (Rna) sp2;
-
-			projectDao.delete(project2);
-
-			assertEquals(ar.getRegions().size(), ar2.getRegions().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	private Model createModel() {
-		Model model = new ModelFullIndexed(null);
-		Compartment compartment = new Compartment("default");
-		model.addCompartment(compartment);
-
-		Rna species = new Rna();
-		species.setElementId("s" + identifierCounter++);
-		species.addRegion(new RnaRegion());
-		SpeciesAlias alias = new SpeciesAlias(species);
-		alias.setAliasId("As");
-		alias.setX(1);
-		alias.setY(2);
-		alias.setWidth(10);
-		alias.setHeight(20);
-		model.addAlias(alias);
-		model.addElement(alias.getSpecies());
-
-		return model;
-	}
-
-}
+package lcsb.mapviewer.persist.dao.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.RnaAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.fields.RnaRegion;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+public class RnaTest extends PersistTestFunctions {
+	Logger logger						 = Logger.getLogger(RnaTest.class);
+
+	int		 identifierCounter = 0;
+
+	String projectId				 = "Some_id";
+
+	@Before
+	public void setUp() throws Exception {
+		Project project = projectDao.getProjectByProjectId(projectId);
+		if (project != null) {
+			projectDao.delete(project);
+		}
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testRnaRegionInDb() throws Exception {
+		try {
+			Project project = new Project();
+			project.setProjectId(projectId);
+
+			Model model = createModel();
+
+			project.addModel(model);
+			projectDao.add(project);
+			projectDao.evict(project);
+
+			Project project2 = projectDao.getProjectByProjectId(projectId);
+			assertNotNull(project2);
+			assertFalse(project2.equals(project));
+			assertEquals(project.getId(), project2.getId());
+
+			Model model2 = new ModelFullIndexed(project2.getModels().iterator().next());
+
+			Species sp = model.getSpecies().iterator().next();
+			Rna ar = (Rna) sp;
+
+			Species sp2 = model2.getSpecies().iterator().next();
+			Rna ar2 = (Rna) sp2;
+
+			projectDao.delete(project2);
+
+			assertEquals(ar.getRegions().size(), ar2.getRegions().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	private Model createModel() {
+		Model model = new ModelFullIndexed(null);
+		Compartment compartment = new Compartment("default");
+		model.addCompartment(compartment);
+
+		Rna species = new Rna();
+		species.setElementId("s" + identifierCounter++);
+		species.addRegion(new RnaRegion());
+		SpeciesAlias alias = new RnaAlias(species);
+		alias.setAliasId("As");
+		alias.setX(1);
+		alias.setY(2);
+		alias.setWidth(10);
+		alias.setHeight(20);
+		model.addAlias(alias);
+		model.addElement(alias.getSpecies());
+
+		return model;
+	}
+
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/SpeciesDaoTest.java b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/SpeciesDaoTest.java
index 53cbef104a..cf3a64f006 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/SpeciesDaoTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/dao/map/species/SpeciesDaoTest.java
@@ -1,334 +1,336 @@
-package lcsb.mapviewer.persist.dao.map.species;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-import lcsb.mapviewer.model.map.species.Chemical;
-import lcsb.mapviewer.model.map.species.Ion;
-import lcsb.mapviewer.model.map.species.Phenotype;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion.AntisenseRnaRegionType;
-import lcsb.mapviewer.model.map.species.fields.AssociatedElement;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.model.map.species.fields.ModificationState;
-import lcsb.mapviewer.model.map.species.fields.RnaRegion;
-import lcsb.mapviewer.persist.PersistTestFunctions;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class SpeciesDaoTest extends PersistTestFunctions {
-	static Logger		logger										= Logger.getLogger(SpeciesDaoTest.class);
-
-	private Integer	testChargeVal							= 1;
-	private String	testIdSpecies							= "a";
-	private Integer	testInitialAmount					= 2;
-	private Integer	testInitialConcentration	= 3;
-	private String	testName									= "d";
-	private String	testNotes									= "e";
-	private Boolean	testOnlySubstanceunits		= true;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testAdd() throws Exception {
-		try {
-
-			Species sp = new Species();
-			sp.setCharge(testChargeVal);
-			sp.setElementId(testIdSpecies);
-			sp.setInitialAmount(testInitialAmount);
-			sp.setInitialConcentration(testInitialConcentration);
-			sp.setName(testName);
-			sp.setNotes(testNotes);
-			sp.setOnlySubstanceUnits(testOnlySubstanceunits);
-
-			Compartment parent = new Compartment();
-			parent.setElementId("comp id");
-			sp.setParent(parent);
-
-			MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.UNKNOWN, "c");
-			sp.addMiriamData(md);
-
-			speciesDao.add(sp);
-
-			Species sp2 = speciesDao.getById(sp.getId());
-			assertNotNull(sp2);
-			assertEquals(sp.getCharge(), sp2.getCharge());
-			assertEquals(sp.getElementId(), sp2.getElementId());
-			assertEquals(sp.getInitialAmount(), sp2.getInitialAmount());
-			assertEquals(sp.getInitialConcentration(), sp2.getInitialConcentration());
-			assertEquals(sp.getName(), sp2.getName());
-			assertEquals(sp.getNotes(), sp2.getNotes());
-			assertEquals(sp.hasOnlySubstanceUnits(), sp2.hasOnlySubstanceUnits());
-
-			Compartment parent2 = (Compartment) sp2.getParent();
-			assertNotNull(parent2);
-			assertEquals("comp id", parent2.getElementId());
-
-			assertNotNull(sp2.getMiriamData());
-
-			MiriamData md2 = sp2.getMiriamData().iterator().next();
-			assertNotNull(md2);
-			assertEquals(md.getDataType(), md2.getDataType());
-			assertEquals(md.getRelationType(), md2.getRelationType());
-			assertEquals(md.getResource(), md2.getResource());
-
-			speciesDao.delete(sp);
-			sp2 = speciesDao.getById(sp.getId());
-			assertNull(sp2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProtein() throws Exception {
-		try {
-
-			Protein sp = new Protein();
-			sp.setElementId(testIdSpecies);
-			ModificationResidue mr = new ModificationResidue();
-			mr.setAngle(2.0);
-			mr.setName("name");
-			mr.setSide("side");
-			mr.setSize(3.0);
-			mr.setState(ModificationState.GLYCOSYLATED);
-			sp.addModificationResidue(mr);
-
-			speciesDao.add(sp);
-
-			Protein sp2 = (Protein) speciesDao.getById(sp.getId());
-			assertNotNull(sp2);
-			assertEquals(sp.getElementId(), sp2.getElementId());
-
-			assertNotNull(sp2.getModificationResidues());
-			assertEquals(1, sp2.getModificationResidues().size());
-
-			assertEquals(sp2.getModificationResidues().get(0).getAngle(), mr.getAngle());
-			assertEquals(sp2.getModificationResidues().get(0).getIdModificationResidue(), mr.getIdModificationResidue());
-			assertEquals(sp2.getModificationResidues().get(0).getName(), mr.getName());
-			assertEquals(sp2.getModificationResidues().get(0).getSide(), mr.getSide());
-			assertEquals(sp2.getModificationResidues().get(0).getSize(), mr.getSize());
-			assertEquals(sp2.getModificationResidues().get(0).getState(), mr.getState());
-
-			speciesDao.delete(sp2);
-			sp2 = (Protein) speciesDao.getById(sp.getId());
-			assertNull(sp2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRna() throws Exception {
-		try {
-
-			Rna sp = new Rna();
-			sp.setElementId(testIdSpecies);
-			RnaRegion mr = new RnaRegion();
-			mr.setName("name");
-			mr.setSize(3.0);
-			mr.setState(ModificationState.DONT_CARE);
-			sp.addRegion(mr);
-
-			speciesDao.add(sp);
-			speciesDao.evict(sp);
-
-			Rna sp2 = (Rna) speciesDao.getById(sp.getId());
-			assertNotNull(sp2);
-			assertEquals(sp.getElementId(), sp2.getElementId());
-
-			assertNotNull(sp2.getRegions());
-			assertEquals(1, sp2.getRegions().size());
-
-			assertEquals(sp2.getRegions().get(0).getId(), mr.getId());
-			assertEquals(sp2.getRegions().get(0).getName(), mr.getName());
-			assertEquals(sp2.getRegions().get(0).getSize(), mr.getSize(), EPSILON);
-			assertEquals(sp2.getRegions().get(0).getState(), mr.getState());
-
-			speciesDao.delete(sp2);
-			sp2 = (Rna) speciesDao.getById(sp.getId());
-			assertNull(sp2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAntisenseRna() throws Exception {
-		try {
-
-			AntisenseRna sp = new AntisenseRna();
-			sp.setElementId(testIdSpecies);
-			AntisenseRnaRegion mr = new AntisenseRnaRegion();
-			mr.setName("name");
-			mr.setSize(3.0);
-			mr.setType(AntisenseRnaRegionType.MODIFICATION_SITE);
-			mr.setState(ModificationState.UNKNOWN);
-			sp.addRegion(mr);
-
-			speciesDao.add(sp);
-			speciesDao.evict(sp);
-
-			AntisenseRna sp2 = (AntisenseRna) speciesDao.getById(sp.getId());
-			assertNotNull(sp2);
-			assertEquals(sp.getElementId(), sp2.getElementId());
-
-			assertNotNull(sp2.getRegions());
-			assertEquals(1, sp2.getRegions().size());
-
-			assertEquals(sp2.getRegions().get(0).getIdAntisenseRnaRegion(), mr.getIdAntisenseRnaRegion());
-			assertEquals(sp2.getRegions().get(0).getName(), mr.getName());
-			assertEquals(sp2.getRegions().get(0).getSize(), mr.getSize(), EPSILON);
-			assertEquals(sp2.getRegions().get(0).getState(), mr.getState());
-			assertEquals(sp2.getRegions().get(0).getType(), mr.getType());
-
-			speciesDao.delete(sp2);
-			sp2 = (AntisenseRna) speciesDao.getById(sp.getId());
-			assertNull(sp2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSynonymsInSpecies() throws Exception {
-		try {
-			Protein sp = new Protein();
-			sp.setElementId(testIdSpecies);
-			sp.getSynonyms().add("Synonym");
-			sp.getSynonyms().add("Synonym A");
-			sp.getSynonyms().add("A");
-
-			sp.getFormerSymbols().add("Sym");
-			sp.getFormerSymbols().add("Sym A");
-			sp.getFormerSymbols().add("DD");
-
-			speciesDao.add(sp);
-			speciesDao.flush();
-
-			speciesDao.evict(sp);
-			Protein sp2 = (Protein) speciesDao.getById(sp.getId());
-
-			assertNotNull(sp2.getSynonyms());
-			assertEquals(sp.getSynonyms().size(), sp2.getSynonyms().size());
-
-			for (int i = 0; i < sp.getSynonyms().size(); i++) {
-				assertEquals(sp.getSynonyms().get(i), sp2.getSynonyms().get(i));
-			}
-
-			assertNotNull(sp2.getFormerSymbols());
-			assertEquals(sp.getFormerSymbols().size(), sp2.getFormerSymbols().size());
-
-			for (int i = 0; i < sp.getFormerSymbols().size(); i++) {
-				assertEquals(sp.getFormerSymbols().get(i), sp2.getFormerSymbols().get(i));
-			}
-
-			speciesDao.delete(sp2);
-			sp2 = (Protein) speciesDao.getById(sp.getId());
-			assertNull(sp2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testChemicals() throws Exception {
-		try {
-			Chemical ion = new Ion();
-			ion.setElementId(testIdSpecies);
-			ion.setInChI("come inchi");
-			ion.setInChIKey("keyyy");
-			ion.setSmiles("smile");
-
-			speciesDao.add(ion);
-			speciesDao.flush();
-
-			speciesDao.evict(ion);
-			Ion sp2 = (Ion) speciesDao.getById(ion.getId());
-
-			assertNotNull(sp2.getSynonyms());
-			assertEquals(ion.getSynonyms().size(), sp2.getSynonyms().size());
-
-			assertEquals(ion.getSmiles(), sp2.getSmiles());
-			assertEquals(ion.getInChIKey(), sp2.getInChIKey());
-			assertEquals(ion.getInChI(), sp2.getInChI());
-
-			speciesDao.delete(sp2);
-			sp2 = (Ion) speciesDao.getById(ion.getId());
-			assertNull(sp2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testPhenotype() throws Exception {
-		try {
-			Phenotype phenotype = new Phenotype();
-			AssociatedElement ae = new AssociatedElement();
-			ae.setData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.UNKNOWN, "12345"));
-			ae.setSource(MiriamType.UNKNOWN);
-			phenotype.addAssociatedElement(ae);
-
-			ae = new AssociatedElement();
-			ae.setData(new MiriamData(MiriamRelationType.BQ_BIOL_IS, MiriamType.CHEMBL_COMPOUND, "123456"));
-			ae.setSource(MiriamType.CHEMBL_COMPOUND);
-			phenotype.addAssociatedElement(ae);
-
-			speciesDao.add(phenotype);
-			speciesDao.flush();
-
-			speciesDao.evict(phenotype);
-			Phenotype sp2 = (Phenotype) speciesDao.getById(phenotype.getId());
-
-			assertNotNull(sp2.getSynonyms());
-			assertEquals(phenotype.getSynonyms().size(), phenotype.getSynonyms().size());
-
-			assertNotNull(sp2.getAssociatedElements());
-			assertEquals(sp2.getAssociatedElements().size(), phenotype.getAssociatedElements().size());
-			for (int i = 0; i < phenotype.getAssociatedElements().size(); i++) {
-				assertEquals(phenotype.getAssociatedElements().get(i).getSource(), sp2.getAssociatedElements().get(i).getSource());
-				assertTrue(phenotype.getAssociatedElements().get(i).getData().equals(sp2.getAssociatedElements().get(i).getData()));
-			}
-
-			speciesDao.delete(sp2);
-			sp2 = (Phenotype) speciesDao.getById(phenotype.getId());
-			assertNull(sp2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-}
+package lcsb.mapviewer.persist.dao.map.species;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.Chemical;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Ion;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion.AntisenseRnaRegionType;
+import lcsb.mapviewer.model.map.species.fields.AssociatedElement;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.model.map.species.fields.ModificationState;
+import lcsb.mapviewer.model.map.species.fields.RnaRegion;
+import lcsb.mapviewer.persist.PersistTestFunctions;
+
+public class SpeciesDaoTest extends PersistTestFunctions {
+	static Logger		logger										= Logger.getLogger(SpeciesDaoTest.class);
+
+	private Integer	testChargeVal							= 1;
+	private String	testIdSpecies							= "a";
+	private Integer	testInitialAmount					= 2;
+	private Integer	testInitialConcentration	= 3;
+	private String	testName									= "d";
+	private String	testNotes									= "e";
+	private Boolean	testOnlySubstanceunits		= true;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testAdd() throws Exception {
+		try {
+
+			Species sp = new Species();
+			sp.setCharge(testChargeVal);
+			sp.setElementId(testIdSpecies);
+			sp.setInitialAmount(testInitialAmount);
+			sp.setInitialConcentration(testInitialConcentration);
+			sp.setName(testName);
+			sp.setNotes(testNotes);
+			sp.setOnlySubstanceUnits(testOnlySubstanceunits);
+
+			Compartment parent = new Compartment();
+			parent.setElementId("comp id");
+			sp.setParent(parent);
+
+			MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.UNKNOWN, "c");
+			sp.addMiriamData(md);
+
+			speciesDao.add(sp);
+
+			Species sp2 = speciesDao.getById(sp.getId());
+			assertNotNull(sp2);
+			assertEquals(sp.getCharge(), sp2.getCharge());
+			assertEquals(sp.getElementId(), sp2.getElementId());
+			assertEquals(sp.getInitialAmount(), sp2.getInitialAmount());
+			assertEquals(sp.getInitialConcentration(), sp2.getInitialConcentration());
+			assertEquals(sp.getName(), sp2.getName());
+			assertEquals(sp.getNotes(), sp2.getNotes());
+			assertEquals(sp.hasOnlySubstanceUnits(), sp2.hasOnlySubstanceUnits());
+
+			Compartment parent2 = (Compartment) sp2.getParent();
+			assertNotNull(parent2);
+			assertEquals("comp id", parent2.getElementId());
+
+			assertNotNull(sp2.getMiriamData());
+
+			MiriamData md2 = sp2.getMiriamData().iterator().next();
+			assertNotNull(md2);
+			assertEquals(md.getDataType(), md2.getDataType());
+			assertEquals(md.getRelationType(), md2.getRelationType());
+			assertEquals(md.getResource(), md2.getResource());
+
+			speciesDao.delete(sp);
+			sp2 = speciesDao.getById(sp.getId());
+			assertNull(sp2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProtein() throws Exception {
+		try {
+
+			Protein protein = new GenericProtein();
+			protein.setElementId(testIdSpecies);
+			ModificationResidue mr = new ModificationResidue();
+			mr.setAngle(2.0);
+			mr.setName("name");
+			mr.setSide("side");
+			mr.setSize(3.0);
+			mr.setState(ModificationState.GLYCOSYLATED);
+			protein.addModificationResidue(mr);
+
+			speciesDao.add(protein);
+
+			Protein sp2 = (Protein) speciesDao.getById(protein.getId());
+			assertNotNull(sp2);
+			assertEquals(protein.getElementId(), sp2.getElementId());
+
+			assertNotNull(sp2.getModificationResidues());
+			assertEquals(1, sp2.getModificationResidues().size());
+
+			assertEquals(sp2.getModificationResidues().get(0).getAngle(), mr.getAngle());
+			assertEquals(sp2.getModificationResidues().get(0).getIdModificationResidue(), mr.getIdModificationResidue());
+			assertEquals(sp2.getModificationResidues().get(0).getName(), mr.getName());
+			assertEquals(sp2.getModificationResidues().get(0).getSide(), mr.getSide());
+			assertEquals(sp2.getModificationResidues().get(0).getSize(), mr.getSize());
+			assertEquals(sp2.getModificationResidues().get(0).getState(), mr.getState());
+
+			speciesDao.delete(sp2);
+			sp2 = (Protein) speciesDao.getById(protein.getId());
+			assertNull(sp2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRna() throws Exception {
+		try {
+
+			Rna sp = new Rna();
+			sp.setElementId(testIdSpecies);
+			RnaRegion mr = new RnaRegion();
+			mr.setName("name");
+			mr.setSize(3.0);
+			mr.setState(ModificationState.DONT_CARE);
+			sp.addRegion(mr);
+
+			speciesDao.add(sp);
+			speciesDao.evict(sp);
+
+			Rna sp2 = (Rna) speciesDao.getById(sp.getId());
+			assertNotNull(sp2);
+			assertEquals(sp.getElementId(), sp2.getElementId());
+
+			assertNotNull(sp2.getRegions());
+			assertEquals(1, sp2.getRegions().size());
+
+			assertEquals(sp2.getRegions().get(0).getId(), mr.getId());
+			assertEquals(sp2.getRegions().get(0).getName(), mr.getName());
+			assertEquals(sp2.getRegions().get(0).getSize(), mr.getSize(), EPSILON);
+			assertEquals(sp2.getRegions().get(0).getState(), mr.getState());
+
+			speciesDao.delete(sp2);
+			sp2 = (Rna) speciesDao.getById(sp.getId());
+			assertNull(sp2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAntisenseRna() throws Exception {
+		try {
+
+			AntisenseRna sp = new AntisenseRna();
+			sp.setElementId(testIdSpecies);
+			AntisenseRnaRegion mr = new AntisenseRnaRegion();
+			mr.setName("name");
+			mr.setSize(3.0);
+			mr.setType(AntisenseRnaRegionType.MODIFICATION_SITE);
+			mr.setState(ModificationState.UNKNOWN);
+			sp.addRegion(mr);
+
+			speciesDao.add(sp);
+			speciesDao.evict(sp);
+
+			AntisenseRna sp2 = (AntisenseRna) speciesDao.getById(sp.getId());
+			assertNotNull(sp2);
+			assertEquals(sp.getElementId(), sp2.getElementId());
+
+			assertNotNull(sp2.getRegions());
+			assertEquals(1, sp2.getRegions().size());
+
+			assertEquals(sp2.getRegions().get(0).getIdAntisenseRnaRegion(), mr.getIdAntisenseRnaRegion());
+			assertEquals(sp2.getRegions().get(0).getName(), mr.getName());
+			assertEquals(sp2.getRegions().get(0).getSize(), mr.getSize(), EPSILON);
+			assertEquals(sp2.getRegions().get(0).getState(), mr.getState());
+			assertEquals(sp2.getRegions().get(0).getType(), mr.getType());
+
+			speciesDao.delete(sp2);
+			sp2 = (AntisenseRna) speciesDao.getById(sp.getId());
+			assertNull(sp2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSynonymsInSpecies() throws Exception {
+		try {
+			Protein protein = new GenericProtein();
+			protein.setElementId(testIdSpecies);
+			protein.getSynonyms().add("Synonym");
+			protein.getSynonyms().add("Synonym A");
+			protein.getSynonyms().add("A");
+
+			protein.getFormerSymbols().add("Sym");
+			protein.getFormerSymbols().add("Sym A");
+			protein.getFormerSymbols().add("DD");
+
+			speciesDao.add(protein);
+			speciesDao.flush();
+
+			speciesDao.evict(protein);
+			Protein sp2 = (Protein) speciesDao.getById(protein.getId());
+
+			assertNotNull(sp2.getSynonyms());
+			assertEquals(protein.getSynonyms().size(), sp2.getSynonyms().size());
+
+			for (int i = 0; i < protein.getSynonyms().size(); i++) {
+				assertEquals(protein.getSynonyms().get(i), sp2.getSynonyms().get(i));
+			}
+
+			assertNotNull(sp2.getFormerSymbols());
+			assertEquals(protein.getFormerSymbols().size(), sp2.getFormerSymbols().size());
+
+			for (int i = 0; i < protein.getFormerSymbols().size(); i++) {
+				assertEquals(protein.getFormerSymbols().get(i), sp2.getFormerSymbols().get(i));
+			}
+
+			speciesDao.delete(sp2);
+			sp2 = (Protein) speciesDao.getById(protein.getId());
+			assertNull(sp2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testChemicals() throws Exception {
+		try {
+			Chemical ion = new Ion();
+			ion.setElementId(testIdSpecies);
+			ion.setInChI("come inchi");
+			ion.setInChIKey("keyyy");
+			ion.setSmiles("smile");
+
+			speciesDao.add(ion);
+			speciesDao.flush();
+
+			speciesDao.evict(ion);
+			Ion sp2 = (Ion) speciesDao.getById(ion.getId());
+
+			assertNotNull(sp2.getSynonyms());
+			assertEquals(ion.getSynonyms().size(), sp2.getSynonyms().size());
+
+			assertEquals(ion.getSmiles(), sp2.getSmiles());
+			assertEquals(ion.getInChIKey(), sp2.getInChIKey());
+			assertEquals(ion.getInChI(), sp2.getInChI());
+
+			speciesDao.delete(sp2);
+			sp2 = (Ion) speciesDao.getById(ion.getId());
+			assertNull(sp2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testPhenotype() throws Exception {
+		try {
+			Phenotype phenotype = new Phenotype();
+			AssociatedElement ae = new AssociatedElement();
+			ae.setData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.UNKNOWN, "12345"));
+			ae.setSource(MiriamType.UNKNOWN);
+			phenotype.addAssociatedElement(ae);
+
+			ae = new AssociatedElement();
+			ae.setData(new MiriamData(MiriamRelationType.BQ_BIOL_IS, MiriamType.CHEMBL_COMPOUND, "123456"));
+			ae.setSource(MiriamType.CHEMBL_COMPOUND);
+			phenotype.addAssociatedElement(ae);
+
+			speciesDao.add(phenotype);
+			speciesDao.flush();
+
+			speciesDao.evict(phenotype);
+			Phenotype sp2 = (Phenotype) speciesDao.getById(phenotype.getId());
+
+			assertNotNull(sp2.getSynonyms());
+			assertEquals(phenotype.getSynonyms().size(), phenotype.getSynonyms().size());
+
+			assertNotNull(sp2.getAssociatedElements());
+			assertEquals(sp2.getAssociatedElements().size(), phenotype.getAssociatedElements().size());
+			for (int i = 0; i < phenotype.getAssociatedElements().size(); i++) {
+				assertEquals(phenotype.getAssociatedElements().get(i).getSource(), sp2.getAssociatedElements().get(i).getSource());
+				assertTrue(phenotype.getAssociatedElements().get(i).getData().equals(sp2.getAssociatedElements().get(i).getData()));
+			}
+
+			speciesDao.delete(sp2);
+			sp2 = (Phenotype) speciesDao.getById(phenotype.getId());
+			assertNull(sp2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+}
diff --git a/persist/src/test/java/lcsb/mapviewer/persist/mapper/Point2DMapperTest.java b/persist/src/test/java/lcsb/mapviewer/persist/mapper/Point2DMapperTest.java
index e7283b7171..9508f2a87b 100644
--- a/persist/src/test/java/lcsb/mapviewer/persist/mapper/Point2DMapperTest.java
+++ b/persist/src/test/java/lcsb/mapviewer/persist/mapper/Point2DMapperTest.java
@@ -1,60 +1,60 @@
-package lcsb.mapviewer.persist.mapper;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Point2D;
-import java.io.Serializable;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class Point2DMapperTest {
-
-	Point2DMapper mapper = new Point2DMapper();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSetPropertyValue() {
-		Point2D component = new Point2D.Double(0, 3);
-		Point2D component2 = new Point2D.Double(0, 0);
-		Object val = mapper.getPropertyValue(component, 0);
-		mapper.setPropertyValue(component2, 0, val);
-		assertTrue(component.equals(component2));
-	}
-
-	@Test
-	public void testReturnedClass() {
-		assertNotNull(mapper.returnedClass());
-	}
-
-	@Test
-	public void testHashCode() {
-		Point2D component = new Point2D.Double(0, 3);
-		Point2D component2 = new Point2D.Double(0, 0);
-		assertTrue(mapper.hashCode(component) != mapper.hashCode(component2));
-	}
-
-	@Test
-	public void testDisassemble() {
-		Point2D object = new Point2D.Double(0, 3);
-		Serializable obj = mapper.disassemble(object, null);
-		Point2D object2 = (Point2D) mapper.assemble(obj, null, null);
-
-		assertTrue(object.equals(object2));
-	}
-
-	@Test
-	public void testReplace() {
-		assertNotNull(mapper.replace(new Point2D.Double(0, 3), new Point2D.Double(0, 9), null, null));
-	}
-
-}
+package lcsb.mapviewer.persist.mapper;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Point2D;
+import java.io.Serializable;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class Point2DMapperTest {
+
+	Point2DMapper mapper = new Point2DMapper();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSetPropertyValue() {
+		Point2D component = new Point2D.Double(0, 3);
+		Point2D component2 = new Point2D.Double(0, 0);
+		Object val = mapper.getPropertyValue(component, 0);
+		mapper.setPropertyValue(component2, 0, val);
+		assertTrue(component.equals(component2));
+	}
+
+	@Test
+	public void testReturnedClass() {
+		assertNotNull(mapper.returnedClass());
+	}
+
+	@Test
+	public void testHashCode() {
+		Point2D component = new Point2D.Double(0, 3);
+		Point2D component2 = new Point2D.Double(0, 0);
+		assertTrue(mapper.hashCode(component) != mapper.hashCode(component2));
+	}
+
+	@Test
+	public void testDisassemble() {
+		Point2D object = new Point2D.Double(0, 3);
+		Serializable obj = mapper.disassemble(object, null);
+		Point2D object2 = (Point2D) mapper.assemble(obj, null, null);
+
+		assertTrue(object.equals(object2));
+	}
+
+	@Test
+	public void testReplace() {
+		assertNotNull(mapper.replace(new Point2D.Double(0, 3), new Point2D.Double(0, 9), null, null));
+	}
+
+}
diff --git a/reactome/src/main/java/lcsb/mapviewer/reactome/utils/ElementUtil.java b/reactome/src/main/java/lcsb/mapviewer/reactome/utils/ElementUtil.java
index 128b96ba9a..582e571778 100644
--- a/reactome/src/main/java/lcsb/mapviewer/reactome/utils/ElementUtil.java
+++ b/reactome/src/main/java/lcsb/mapviewer/reactome/utils/ElementUtil.java
@@ -1,101 +1,101 @@
-package lcsb.mapviewer.reactome.utils;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
-import lcsb.mapviewer.annotation.services.annotators.ChebiAnnotator;
-import lcsb.mapviewer.annotation.services.annotators.ChebiSearchException;
-import lcsb.mapviewer.annotation.services.annotators.HgncAnnotator;
-import lcsb.mapviewer.common.exception.InvalidStateException;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-
-/**
- * Util class used to get information about elements.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ElementUtil {
-
-	/**
-	 * Hgnc annotator used to resolve some identifier conversion.
-	 */
-	@Autowired
-	private HgncAnnotator	 hgncAnnotator;
-
-	/**
-	 * Service accessing chebi database.
-	 */
-	@Autowired
-	private ChebiAnnotator chebiBackend;
-
-	/**
-	 * Returns set of annotations by given type for given element (using local or
-	 * remote information).
-	 * 
-	 * @param element
-	 *          element for which annotation is looked for
-	 * @param mt
-	 *          {@link MiriamType} type of the annotation
-	 * @param queryServer
-	 *          if annotation is not found locally, should the method query
-	 *          external server
-	 * @return set of annotations
-	 * @throws AnnotatorException
-	 *           thrown when there is a problem with accessing external resource
-	 */
-	public Set<MiriamData> getMiriamByType(Element element, MiriamType mt, boolean queryServer) throws AnnotatorException {
-		Set<MiriamData> result = new HashSet<MiriamData>();
-		for (MiriamData md : element.getMiriamData()) {
-			if (mt.equals(md.getDataType())) {
-				result.add(md);
-			}
-		}
-		if (result.size() == 0 && queryServer) {
-			if (mt.equals(MiriamType.UNIPROT)) {
-				result.addAll(getUniprot(element));
-			} else if (MiriamType.CHEBI.equals(mt)) {
-				try {
-					MiriamData md = chebiBackend.getChebiForChebiName(element.getName());
-					if (md != null) {
-						result.add(md);
-					}
-				} catch (ChebiSearchException e) {
-					throw new AnnotatorException("Problem with getting information about chebi", e);
-				}
-			} else {
-				throw new InvalidStateException(
-						"Don't know how to query server for " + mt.getCommonName() + " in element: [" + element.getElementId() + ", " + element.getClass() + "] "
-								+ element.getName());
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns set of {@link MiriamType#UNIPROT} annotations for the element.
-	 * 
-	 * @param element
-	 *          object for which annotations are looked for
-	 * @return set of {@link MiriamType#UNIPROT} annotations for the element
-	 * @throws AnnotatorException
-	 *           thrown when there is a problem with accessing external server
-	 */
-	private Collection<? extends MiriamData> getUniprot(Element element) throws AnnotatorException {
-		Set<MiriamData> result = new HashSet<MiriamData>();
-		for (MiriamData md : element.getMiriamData()) {
-			if (MiriamType.HGNC_SYMBOL.equals(md.getDataType()) || MiriamType.HGNC.equals(md.getDataType())) {
-				List<MiriamData> uniprot = hgncAnnotator.hgncToUniprot(md);
-				result.addAll(uniprot);
-			}
-		}
-		return result;
-	}
-}
+package lcsb.mapviewer.reactome.utils;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
+import lcsb.mapviewer.annotation.services.annotators.ChebiAnnotator;
+import lcsb.mapviewer.annotation.services.annotators.ChebiSearchException;
+import lcsb.mapviewer.annotation.services.annotators.HgncAnnotator;
+import lcsb.mapviewer.common.exception.InvalidStateException;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+
+/**
+ * Util class used to get information about elements.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ElementUtil {
+
+	/**
+	 * Hgnc annotator used to resolve some identifier conversion.
+	 */
+	@Autowired
+	private HgncAnnotator	 hgncAnnotator;
+
+	/**
+	 * Service accessing chebi database.
+	 */
+	@Autowired
+	private ChebiAnnotator chebiBackend;
+
+	/**
+	 * Returns set of annotations by given type for given element (using local or
+	 * remote information).
+	 * 
+	 * @param element
+	 *          element for which annotation is looked for
+	 * @param mt
+	 *          {@link MiriamType} type of the annotation
+	 * @param queryServer
+	 *          if annotation is not found locally, should the method query
+	 *          external server
+	 * @return set of annotations
+	 * @throws AnnotatorException
+	 *           thrown when there is a problem with accessing external resource
+	 */
+	public Set<MiriamData> getMiriamByType(Element element, MiriamType mt, boolean queryServer) throws AnnotatorException {
+		Set<MiriamData> result = new HashSet<MiriamData>();
+		for (MiriamData md : element.getMiriamData()) {
+			if (mt.equals(md.getDataType())) {
+				result.add(md);
+			}
+		}
+		if (result.size() == 0 && queryServer) {
+			if (mt.equals(MiriamType.UNIPROT)) {
+				result.addAll(getUniprot(element));
+			} else if (MiriamType.CHEBI.equals(mt)) {
+				try {
+					MiriamData md = chebiBackend.getChebiForChebiName(element.getName());
+					if (md != null) {
+						result.add(md);
+					}
+				} catch (ChebiSearchException e) {
+					throw new AnnotatorException("Problem with getting information about chebi", e);
+				}
+			} else {
+				throw new InvalidStateException(
+						"Don't know how to query server for " + mt.getCommonName() + " in element: [" + element.getElementId() + ", " + element.getClass() + "] "
+								+ element.getName());
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns set of {@link MiriamType#UNIPROT} annotations for the element.
+	 * 
+	 * @param element
+	 *          object for which annotations are looked for
+	 * @return set of {@link MiriamType#UNIPROT} annotations for the element
+	 * @throws AnnotatorException
+	 *           thrown when there is a problem with accessing external server
+	 */
+	private Collection<? extends MiriamData> getUniprot(Element element) throws AnnotatorException {
+		Set<MiriamData> result = new HashSet<MiriamData>();
+		for (MiriamData md : element.getMiriamData()) {
+			if (MiriamType.HGNC_SYMBOL.equals(md.getDataType()) || MiriamType.HGNC.equals(md.getDataType())) {
+				List<MiriamData> uniprot = hgncAnnotator.hgncToUniprot(md);
+				result.addAll(uniprot);
+			}
+		}
+		return result;
+	}
+}
diff --git a/reactome/src/main/java/lcsb/mapviewer/reactome/utils/ReactomeConnector.java b/reactome/src/main/java/lcsb/mapviewer/reactome/utils/ReactomeConnector.java
index ccd505bda3..6f01e9d5a6 100644
--- a/reactome/src/main/java/lcsb/mapviewer/reactome/utils/ReactomeConnector.java
+++ b/reactome/src/main/java/lcsb/mapviewer/reactome/utils/ReactomeConnector.java
@@ -1,776 +1,776 @@
-package lcsb.mapviewer.reactome.utils;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.log4j.Logger;
-import org.springframework.transaction.annotation.Transactional;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import lcsb.mapviewer.annotation.cache.CachableInterface;
-import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
-import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
-import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
-import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
-import lcsb.mapviewer.common.HttpConnectionMethodType;
-import lcsb.mapviewer.common.MimeType;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.reactome.model.ReactomeCandidateSet;
-import lcsb.mapviewer.reactome.model.ReactomeCatalystActivity;
-import lcsb.mapviewer.reactome.model.ReactomeComplex;
-import lcsb.mapviewer.reactome.model.ReactomeDatabaseObject;
-import lcsb.mapviewer.reactome.model.ReactomeEntitySet;
-import lcsb.mapviewer.reactome.model.ReactomeEntityWithAccessionedSequence;
-import lcsb.mapviewer.reactome.model.ReactomePhysicalEntity;
-import lcsb.mapviewer.reactome.model.ReactomeReactionlikeEvent;
-import lcsb.mapviewer.reactome.model.ReactomeReferenceMolecule;
-import lcsb.mapviewer.reactome.model.ReactomeReferenceSequence;
-import lcsb.mapviewer.reactome.model.ReactomeSimpleEntity;
-import lcsb.mapviewer.reactome.model.ReactomeStableIdentifier;
-import lcsb.mapviewer.reactome.model.ReactomeStatus;
-import lcsb.mapviewer.reactome.xml.ReactomeNodeParser;
-import lcsb.mapviewer.reactome.xml.ReactomeParserFactory;
-
-/**
- * Data access object for reactome data.
- * 
- * @author Piotr Gawron
- * 
- */
-@Transactional(value = "txManager")
-public class ReactomeConnector extends CachableInterface implements DataSourceUpdater {
-
-	/**
-	 * Identifier of the object in reactome database used for testing connection.
-	 */
-	private static final int		CHECK_SERVICE_STATUS_EXAMPLE = 109581;
-
-	/**
-	 * Default timeout of http connection (in miliseconds).
-	 */
-	private static final int		CONNECTION_TIMEOUT					 = 10000;
-
-	/**
-	 * Prefix used in cache entries for objects queried by the identifier.
-	 */
-	private static final String	IDENTIFIER_QUERY_PREFIX			 = "ID: ";
-
-	@Override
-	public Object refreshCacheQuery(Object query) throws SourceNotAvailable {
-		ReactomeConnector connector = new ReactomeConnector();
-
-		String name;
-		Object result = null;
-		if (query instanceof String) {
-			name = (String) query;
-			if (name.startsWith(IDENTIFIER_QUERY_PREFIX)) {
-				String strId = name.substring(IDENTIFIER_QUERY_PREFIX.length());
-				Integer id = Integer.valueOf(strId);
-				try {
-					return connector.getFullNodeForDbId(id);
-				} catch (InvalidXmlSchemaException e) {
-					throw new SourceNotAvailable(e);
-				}
-			} else if (name.contains("\n")) {
-				String[] tmp = name.split("\n");
-				if (tmp.length != 2) {
-					throw new InvalidArgumentException("Don't know what to do with string \"" + query + "\"");
-				} else {
-					String params = tmp[0];
-					String url = tmp[1];
-					try {
-						result = connector.getNodesFromServer(params, url);
-					} catch (Exception e) {
-						throw new SourceNotAvailable(e);
-					}
-				}
-			} else {
-				throw new InvalidArgumentException("Don't know what to do with string \"" + query + "\"");
-			}
-		} else {
-			throw new InvalidArgumentException("Don't know what to do with class: " + query.getClass());
-		}
-		return result;
-	}
-
-	/**
-	 * Default constructor.
-	 */
-	public ReactomeConnector() {
-		super(ReactomeConnector.class);
-	}
-
-	/**
-	 * Determines if only one object instance should be created for single
-	 * reactome database identifier.
-	 */
-	private boolean															 oneInstancePerId	= true;
-
-	/**
-	 * Map of all reactome objects retrieved by this connector.
-	 */
-	private Map<Integer, ReactomeDatabaseObject> objectMap				= new HashMap<Integer, ReactomeDatabaseObject>();
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger												 logger						= Logger.getLogger(ReactomeConnector.class);
-	/**
-	 * Url used for accessing Reactome RestFULL API.
-	 */
-	private static final String									 REACTOME_URL			= "http://reactomews.oicr.on.ca:8080/ReactomeRESTfulAPI/RESTfulWS/";
-
-	@Override
-	public List<ReactomePhysicalEntity> getEntitiesForName(String name) throws IOException {
-		return getEntitiesForName(name, true);
-	}
-
-	@Override
-	public List<ReactomePhysicalEntity> getEntitiesForName(String name, boolean full) throws IOException {
-		List<ReactomePhysicalEntity> result = new ArrayList<ReactomePhysicalEntity>();
-
-		String query = "name=" + name;
-		List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomePhysicalEntity.class);
-
-		for (ReactomeDatabaseObject object : objects) {
-			if (full) {
-				ReactomePhysicalEntity fullEntity = (ReactomePhysicalEntity) getFullObjectForDbId(object.getDbId());
-				result.add(fullEntity);
-			} else {
-				result.add((ReactomePhysicalEntity) object);
-			}
-		}
-		return result;
-	}
-
-	@Override
-	public List<ReactomePhysicalEntity> getEntitiesForChebiId(Set<MiriamData> ids, boolean deepSearch) throws IOException {
-		Set<ReactomePhysicalEntity> set = new HashSet<ReactomePhysicalEntity>();
-		List<ReactomePhysicalEntity> result = new ArrayList<ReactomePhysicalEntity>();
-		if (ids == null) {
-			return result;
-		}
-		for (MiriamData md : ids) {
-			if (md == null) {
-				return result;
-			}
-			String id = md.getResource().replace("CHEBI:", "");
-
-			String query = "identifier=" + id;
-			List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeReferenceMolecule.class);
-
-			for (ReactomeDatabaseObject object : objects) {
-				ReactomeReferenceMolecule reference = (ReactomeReferenceMolecule) getFullObjectForDbId(object.getDbId());
-				List<ReactomeSimpleEntity> list = getSimpleEntitiesByReferenceMolecule(reference);
-				set.addAll(list);
-			}
-			if (deepSearch) {
-				int lastSize = 0;
-				do {
-					lastSize = set.size();
-					Set<ReactomePhysicalEntity> complexes = getComplexesContainingOneOfElements(set);
-					set.addAll(complexes);
-					Set<ReactomePhysicalEntity> sets = getSetsContainingOneOfElements(set);
-					set.addAll(sets);
-				} while (lastSize != set.size());
-			}
-			result.addAll(set);
-		}
-		return result;
-	}
-
-	@Override
-	public List<ReactomePhysicalEntity> getEntitiesForUniprotId(Collection<MiriamData> uniprot) throws IOException {
-		Set<ReactomePhysicalEntity> set = new HashSet<ReactomePhysicalEntity>();
-
-		for (MiriamData md : uniprot) {
-			if (!MiriamType.UNIPROT.equals(md.getDataType())) {
-				throw new InvalidArgumentException("Only uniprot miriam are acceptable");
-			}
-			String id = md.getResource();
-			int lastSize = set.size();
-			do {
-				lastSize = set.size();
-
-				String query = "identifier=" + id;
-				List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeReferenceSequence.class);
-
-				for (ReactomeDatabaseObject object : objects) {
-					ReactomeReferenceSequence reference = (ReactomeReferenceSequence) getFullObjectForDbId(object.getDbId());
-					List<ReactomePhysicalEntity> list = getPhysicalEnitiesForReferenceSequence(reference);
-					set.addAll(list);
-				}
-				query = "secondaryIdentifier=" + id;
-				objects = getSimpleObjectListByQuery(query, ReactomeReferenceSequence.class);
-
-				for (ReactomeDatabaseObject object : objects) {
-					ReactomeReferenceSequence reference = (ReactomeReferenceSequence) getFullObjectForDbId(object.getDbId());
-					List<ReactomePhysicalEntity> list = getPhysicalEnitiesForReferenceSequence(reference);
-					set.addAll(list);
-				}
-
-				Set<ReactomePhysicalEntity> complexes = getComplexesContainingOneOfElements(set);
-				set.addAll(complexes);
-				Set<ReactomePhysicalEntity> sets = getSetsContainingOneOfElements(set);
-				set.addAll(sets);
-			} while (lastSize != set.size());
-		}
-		List<ReactomePhysicalEntity> result = new ArrayList<ReactomePhysicalEntity>();
-		result.addAll(set);
-		return result;
-	}
-
-	/**
-	 * Returns list of ReactomeComplex that contain one of the elements given in
-	 * the parameter.
-	 * 
-	 * @param objects
-	 *          list of objects for which we want to retrieve complexes
-	 * @return list of ReactomeComplex that contain one of the elements given in
-	 *         the parameter
-	 * @throws IOException
-	 *           thrown when there is a problem with connection to reactome
-	 *           database
-	 */
-	private Set<ReactomePhysicalEntity> getComplexesContainingOneOfElements(Collection<ReactomePhysicalEntity> objects) throws IOException {
-		Set<ReactomePhysicalEntity> result = new HashSet<ReactomePhysicalEntity>();
-		for (ReactomeDatabaseObject obj : objects) {
-			String query = "hasComponent=" + obj.getDbId();
-			List<ReactomeDatabaseObject> complexes = getSimpleObjectListByQuery(query, ReactomeComplex.class);
-			for (ReactomeDatabaseObject complex : complexes) {
-				result.add((ReactomePhysicalEntity) getFullObjectForDbId(complex.getDbId()));
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns list of ReactomeEntitySet that contain one of the elements given in
-	 * the parameter.
-	 * 
-	 * @param objects
-	 *          list of objects for which we want to retrieve sets
-	 * @return list of ReactomeEntitySet that contain one of the elements given in
-	 *         the parameter
-	 * @throws IOException
-	 *           thrown when there is a problem with connection to reactome
-	 *           database
-	 */
-	private Set<ReactomePhysicalEntity> getSetsContainingOneOfElements(Collection<ReactomePhysicalEntity> objects) throws IOException {
-
-		Set<ReactomePhysicalEntity> result = new HashSet<ReactomePhysicalEntity>();
-		for (ReactomeDatabaseObject obj : objects) {
-			String query = "hasMember=" + obj.getDbId();
-			List<ReactomeDatabaseObject> complexes = getSimpleObjectListByQuery(query, ReactomeEntitySet.class);
-			for (ReactomeDatabaseObject complex : complexes) {
-				result.add((ReactomeEntitySet) getFullObjectForDbId(complex.getDbId()));
-			}
-			query = "hasCandidate=" + obj.getDbId();
-			complexes = getSimpleObjectListByQuery(query, ReactomeCandidateSet.class);
-			for (ReactomeDatabaseObject complex : complexes) {
-				result.add((ReactomeCandidateSet) getFullObjectForDbId(complex.getDbId()));
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns list of ReactomeEntityWithAccessionedSequence that refers to
-	 * parameter reference.
-	 * 
-	 * @param reference
-	 *          object to which result should refer to
-	 * @return list of ReactomeEntityWithAccessionedSequence that contain one of
-	 *         the elements given in the parameter
-	 * @throws IOException
-	 *           thrown when there is a problem with connection to reactome
-	 *           database
-	 */
-	private List<ReactomePhysicalEntity> getPhysicalEnitiesForReferenceSequence(ReactomeReferenceSequence reference) throws IOException {
-		List<ReactomePhysicalEntity> result = new ArrayList<ReactomePhysicalEntity>();
-
-		String query = "referenceEntity=" + reference.getDbId();
-		List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeEntityWithAccessionedSequence.class);
-
-		for (ReactomeDatabaseObject object : objects) {
-			result.add((ReactomePhysicalEntity) getFullObjectForDbId(object.getDbId()));
-		}
-		return result;
-	}
-
-	/**
-	 * Returns list of ReactomeSimpleEntity that refers to parameter reference.
-	 * 
-	 * @param reference
-	 *          object to which result should refer to
-	 * @return list of ReactomeSimpleEntity that contain one of the elements given
-	 *         in the parameter
-	 * @throws IOException
-	 *           thrown when there is a problem with connection to reactome
-	 *           database
-	 */
-	private List<ReactomeSimpleEntity> getSimpleEntitiesByReferenceMolecule(ReactomeReferenceMolecule reference) throws IOException {
-		List<ReactomeSimpleEntity> result = new ArrayList<ReactomeSimpleEntity>();
-
-		String query = "referenceEntity=" + reference.getDbId();
-		List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeSimpleEntity.class);
-
-		for (ReactomeDatabaseObject object : objects) {
-			result.add((ReactomeSimpleEntity) getFullObjectForDbId(object.getDbId()));
-		}
-		return result;
-	}
-
-	/**
-	 * Ges list of reactions that interact with object given in the parameter.
-	 * 
-	 * @param id
-	 *          identifier of the object that should be included in the result
-	 *          reactions
-	 * @return list of reactions that interact with object given in the parameter
-	 * @throws IOException
-	 *           thrown when there is a problem with connection to reactome
-	 *           database
-	 */
-	public List<ReactomeReactionlikeEvent> getReactionsForEntityId(Integer id) throws IOException {
-		List<ReactomeReactionlikeEvent> result = new ArrayList<ReactomeReactionlikeEvent>();
-
-		String query = "input=" + id;
-		List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeReactionlikeEvent.class);
-
-		for (ReactomeDatabaseObject object : objects) {
-			ReactomeDatabaseObject entity = getFullObjectForDbId(object.getDbId());
-			if (entity instanceof ReactomeReactionlikeEvent) {
-				result.add((ReactomeReactionlikeEvent) entity);
-			}
-		}
-
-		query = "output=" + id;
-		objects = getSimpleObjectListByQuery(query, ReactomeReactionlikeEvent.class);
-
-		for (ReactomeDatabaseObject object : objects) {
-			ReactomeDatabaseObject entity = getFullObjectForDbId(object.getDbId());
-			if (entity instanceof ReactomeReactionlikeEvent) {
-				result.add((ReactomeReactionlikeEvent) entity);
-			}
-		}
-
-		// and now find reaction with apropriate catalyst
-		query = "physicalEntity=" + id;
-		List<ReactomeDatabaseObject> catalysts = getSimpleObjectListByQuery(query, ReactomeCatalystActivity.class);
-		for (ReactomeDatabaseObject catalyst : catalysts) {
-			query = "catalystActivity=" + catalyst.getDbId();
-			objects = getSimpleObjectListByQuery(query, ReactomeReactionlikeEvent.class);
-			for (ReactomeDatabaseObject object : objects) {
-				ReactomeDatabaseObject entity = getFullObjectForDbId(object.getDbId());
-				if (entity instanceof ReactomeReactionlikeEvent) {
-					result.add((ReactomeReactionlikeEvent) entity);
-				}
-			}
-		}
-
-		return result;
-	}
-
-	@Override
-	public Class<?> getTypeForDbId(Integer id) throws ClassNotFoundException, InvalidXmlSchemaException {
-		Node node = getFullNodeForDbId(id);
-		Class<?> result = getTypeForNode(node);
-		return result;
-	}
-
-	/**
-	 * Returns class type of the data represented in the xml node.
-	 * 
-	 * @param node
-	 *          xml node
-	 * @return class type of the data represented in the xml node
-	 * @throws ClassNotFoundException
-	 *           thrown when there is a problem with finding apropriate class
-	 */
-	protected Class<?> getTypeForNode(Node node) throws ClassNotFoundException {
-		Class<?> result = null;
-		for (int i = 0; i < node.getChildNodes().getLength(); i++) {
-			Node child = node.getChildNodes().item(i);
-			if (child.getNodeName().equals("schemaClass")) {
-				// our classes aren't exactly the same as reactome names, change what is
-				// different
-				String shortName = child.getTextContent().replaceAll("GO_", "Go");
-				String className = ReactomeDatabaseObject.class.getPackage().getName() + ".Reactome" + shortName;
-				result = Class.forName(className);
-			}
-		}
-		return result;
-	}
-
-	@Override
-	public ReactomeDatabaseObject getFullObjectForDbId(Integer id) {
-		try {
-			ReactomeDatabaseObject result = null;
-			if (oneInstancePerId) {
-				result = objectMap.get(id);
-				if (result != null) {
-					return result;
-				}
-			}
-			Class<?> classType;
-			Node node = getFullNodeForDbId(id);
-			classType = getTypeForNode(node);
-			ReactomeNodeParser<?> parser = ReactomeParserFactory.getParserForClass(classType);
-			result = parser.parseObject(node);
-			if (oneInstancePerId) {
-				objectMap.put(id, result);
-			}
-			return result;
-		} catch (ClassNotFoundException e) {
-			throw new InvalidArgumentException("Unknown class type: " + e.getMessage());
-		} catch (InvalidXmlSchemaException e) {
-			logger.error(e, e);
-			return null;
-		}
-	}
-
-	@Override
-	@SuppressWarnings("unchecked")
-	public void updateOnlyIdFields(ReactomeDatabaseObject object) {
-		DataSourceUpdater dsu = this;
-		for (Method method : object.getClass().getMethods()) {
-
-			if (Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 0
-					&& (method.getName().startsWith("get") || method.getName().startsWith("is"))) {
-
-				if (ReactomeDatabaseObject.class.isAssignableFrom(method.getReturnType())) {
-					try {
-						ReactomeDatabaseObject value = (ReactomeDatabaseObject) method.invoke(object);
-						if (value != null) {
-							if (value.getStatus().equals(ReactomeStatus.ONLY_ID)) {
-								ReactomeDatabaseObject newValue = dsu.getFullObjectForDbId(value.getDbId());
-								String setterName = method.getName();
-								if (setterName.startsWith("get")) {
-									setterName = setterName.replaceFirst("get", "set");
-								} else {
-									setterName = setterName.replaceFirst("is", "set");
-								}
-								try {
-									Method setterMethod = object.getClass().getMethod(setterName, method.getReturnType());
-									setterMethod.invoke(object, newValue);
-								} catch (NoSuchMethodException e) {
-									e.printStackTrace();
-								} catch (IllegalArgumentException e) {
-									logger.error(
-											"Cannot assign " + newValue.getClass() + " (id: " + value.getDbId() + ") to field: " + setterName.replace("set", "") + " ("
-													+ method.getReturnType() + ")");
-								} catch (SecurityException e) {
-
-									e.printStackTrace();
-									// ignore it - however this would be strange
-								}
-							}
-						}
-					} catch (IllegalAccessException e) {
-						e.printStackTrace();
-					} catch (IllegalArgumentException e) {
-						e.printStackTrace();
-					} catch (InvocationTargetException e) {
-						e.printStackTrace();
-						// ignore it
-					}
-
-				} else if (List.class.isAssignableFrom(method.getReturnType())) {
-					try {
-						@SuppressWarnings("rawtypes")
-						List list = (List) method.invoke(object);
-						for (int i = 0; i < list.size(); i++) {
-							Object obj = list.get(i);
-							if (obj instanceof ReactomeDatabaseObject) {
-								if (((ReactomeDatabaseObject) obj).getStatus().equals(ReactomeStatus.ONLY_ID)) {
-									ReactomeDatabaseObject newValue = dsu.getFullObjectForDbId(((ReactomeDatabaseObject) obj).getDbId());
-									list.set(i, newValue);
-								}
-							}
-						}
-					} catch (IllegalAccessException e) {
-						e.printStackTrace();
-					} catch (IllegalArgumentException e) {
-						e.printStackTrace();
-					} catch (InvocationTargetException e) {
-						e.printStackTrace();
-						// ignore it
-					}
-				}
-			}
-		}
-	}
-
-	@Override
-	public ReactomeDatabaseObject getFullObjectForStableIdentifier(String stableIdentifier) throws IOException {
-		if (stableIdentifier == null) {
-			return null;
-		}
-		String[] tmp = stableIdentifier.split("\\.");
-		String identifier = tmp[0];
-		String version = "0";
-		if (tmp.length > 1) {
-			version = tmp[1];
-		}
-		return getFullObjectForStableIdentifier(identifier, version);
-	}
-
-	@Override
-	public ReactomeDatabaseObject getFullObjectForStableIdentifier(String identifier, String version) throws IOException {
-		String stableIdentifierQuery = "identifier=" + identifier;
-
-		List<ReactomeDatabaseObject> stableIdentifiers = getSimpleObjectListByQuery(stableIdentifierQuery, ReactomeStableIdentifier.class);
-
-		ReactomeStableIdentifier newestIdentifier = null;
-		ReactomeStableIdentifier matchedIdentifier = null;
-
-		for (ReactomeDatabaseObject object : stableIdentifiers) {
-			ReactomeStableIdentifier entity = (ReactomeStableIdentifier) getFullObjectForDbId(object.getDbId());
-			if (newestIdentifier == null) {
-				newestIdentifier = entity;
-			} else {
-				try {
-					Integer id1 = Integer.parseInt(newestIdentifier.getIdentifierVersion());
-					Integer id2 = Integer.parseInt(entity.getIdentifierVersion());
-					if (id2 > id1) {
-						newestIdentifier = entity;
-					}
-				} catch (Exception e) {
-					logger.error(e.getMessage(), e);
-				}
-			}
-			if (entity.getDisplayName().equals(identifier + "." + version) || entity.getIdentifierVersion().equalsIgnoreCase(version)) {
-				matchedIdentifier = entity;
-			}
-		}
-		if (matchedIdentifier == null) {
-			if (newestIdentifier != null) {
-				logger.warn(
-						"Invalid REACTOME stable identifier: \"" + identifier + "." + version + "\". Using another similar: " + newestIdentifier.getIdentifier() + "."
-								+ newestIdentifier.getIdentifierVersion());
-			}
-			matchedIdentifier = newestIdentifier;
-		}
-		if (matchedIdentifier != null) {
-			String query = "stableIdentifier=" + matchedIdentifier.getDbId();
-			List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeDatabaseObject.class);
-
-			for (ReactomeDatabaseObject object : objects) {
-				return getFullObjectForDbId(object.getDbId());
-			}
-
-		}
-		return null;
-	}
-
-	// ------------------------------------------------
-	//
-	// Methods that directly connect to reactome database (via restfull API)
-	//
-	// ------------------------------------------------
-
-	/**
-	 * This method get content of the page of the url (and post content).
-	 * 
-	 * @param url
-	 *          url address to connect
-	 * @param postParam
-	 *          params of the post method
-	 * @param type
-	 *          MIME type of the result
-	 * @param method
-	 *          request method (POST/GET)
-	 * @return return the string with the content of the webpage
-	 * @throws IOException
-	 *           thrown when there are some problem with network connection
-	 */
-	protected String getResponse(String url, String postParam, MimeType type, HttpConnectionMethodType method) throws IOException {
-		URL obj = new URL(url);
-		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
-
-		// add reuqest header
-		con.setRequestMethod(method.name());
-		con.setRequestProperty("Accept", type.getTextRepresentation());
-		con.setRequestProperty("Content-Type", type.getTextRepresentation());
-		con.setConnectTimeout(CONNECTION_TIMEOUT);
-		con.setReadTimeout(CONNECTION_TIMEOUT);
-
-		String urlParameters = postParam;
-
-		logger.debug("Sending '" + method + "' request to URL : " + url);
-		if (method.name().equals("POST")) {
-			logger.debug("Parameters : " + urlParameters);
-		}
-
-		// Send post request
-		con.setDoOutput(true);
-		if (method.name().equalsIgnoreCase("POST")) {
-			DataOutputStream wr = new DataOutputStream(con.getOutputStream());
-			wr.writeBytes(urlParameters);
-			wr.flush();
-			wr.close();
-		}
-
-		int responseCode = con.getResponseCode();
-		logger.debug("Response Code : " + responseCode);
-
-		String result = IOUtils.toString(con.getInputStream());
-		logger.debug(result);
-		return result;
-	}
-
-	@Override
-	public List<ReactomeDatabaseObject> getSimpleObjectListByQuery(String query, Class<? extends ReactomeDatabaseObject> clazz) throws IOException {
-		if (query.contains("\n")) {
-			throw new InvalidArgumentException("Query cannot contain new line character");
-		}
-		ReactomeNodeParser<?> parser = ReactomeParserFactory.getParserForClass(clazz);
-		List<ReactomeDatabaseObject> result = new ArrayList<ReactomeDatabaseObject>();
-
-		String url = REACTOME_URL + "listByQuery/" + clazz.getSimpleName().replaceFirst("Reactome", "").replaceAll("Go", "GO_");
-
-		String key = query + "\n" + url;
-
-		Node node = getCacheNode(key);
-		NodeList nodes = null;
-		if (node != null) {
-			nodes = node.getChildNodes();
-		} else {
-			try {
-				nodes = getNodesFromServer(query, url);
-			} catch (InvalidXmlSchemaException e) {
-				throw new IOException(e);
-			}
-			setCacheNode(key, nodes.item(0));
-			nodes = nodes.item(0).getChildNodes();
-		}
-		for (int i = 0; i < nodes.getLength(); i++) {
-			if (nodes.item(i).getNodeType() != Node.ELEMENT_NODE) {
-				continue;
-			}
-			ReactomeDatabaseObject object = parser.parseSimplifiedObject(nodes.item(i));
-			result.add(object);
-		}
-		return result;
-	}
-
-	/**
-	 * Returns list of nodes from the server identified by the query and POST
-	 * params.
-	 * 
-	 * @param query
-	 *          string query to the database sent by POST method
-	 * @param url
-	 *          direct url to the API
-	 * @return list of nodes from the server identified by the query and POST
-	 *         params.
-	 * @throws IOException
-	 *           thrown when there are some problem with network connection
-	 * @throws InvalidXmlSchemaException
-	 *           thrown when there is a problem with xml
-	 */
-	private NodeList getNodesFromServer(String query, String url) throws IOException, InvalidXmlSchemaException {
-		String response = getResponse(url, query, MimeType.XML, HttpConnectionMethodType.POST);
-		logger.debug(response);
-		Node node = getXmlDocumentFromString(response);
-		NodeList nodes = node.getChildNodes();
-		if (nodes.getLength() < 1) {
-			throw new InvalidArgumentException("Problem with xml document");
-		}
-		return nodes;
-	}
-
-	/**
-	 * This method returns xml NODE for object identified by id (identifier in
-	 * reactome database). However if object is in local cache then local copy is
-	 * returned. If object doesn't exist in local cache then after retrieving it
-	 * from reactome is put to the cache.
-	 * 
-	 * @param id
-	 *          identifier in reactome database
-	 * @return xml node for the id given reactome id
-	 * @throws InvalidXmlSchemaException
-	 *           thrown when there is a problem with xml
-	 */
-	@Override
-	public Node getFullNodeForDbId(Integer id) throws InvalidXmlSchemaException {
-		Node result = getCacheNode(IDENTIFIER_QUERY_PREFIX + id);
-		if (result != null) {
-			return result;
-		}
-
-		String response;
-		String url = REACTOME_URL + "queryById/DatabaseObject/" + id;
-		try {
-			response = getResponse(url, "", MimeType.XML, HttpConnectionMethodType.GET);
-			Document doc = getXmlDocumentFromString(response);
-			NodeList nodes = doc.getChildNodes();
-			result = nodes.item(0);
-			setCacheNode(IDENTIFIER_QUERY_PREFIX + id, result);
-			return result;
-		} catch (IOException e) {
-			logger.error(e.getMessage(), e);
-			return null;
-		}
-	}
-
-	@Override
-	public Map<Integer, ReactomeDatabaseObject> getFullObjectsForDbIds(List<Integer> ids) throws ClassNotFoundException, IOException {
-		Map<Integer, ReactomeDatabaseObject> result = new HashMap<Integer, ReactomeDatabaseObject>();
-		for (Integer integer : ids) {
-			result.put(integer, getFullObjectForDbId(integer));
-		}
-
-		return result;
-
-	}
-
-	@Override
-	public List<ReactomePhysicalEntity> getEntitiesForSetOfIds(Set<MiriamData> identifiers) throws IOException {
-		return getEntitiesForUniprotId(identifiers);
-	}
-
-	@Override
-	public ExternalServiceStatus getServiceStatus() {
-		ExternalServiceStatus status = new ExternalServiceStatus(
-				"Reactome RESTful API", "http://reactomews.oicr.on.ca:8080/ReactomeRESTfulAPI/ReactomeRESTFulAPI.html");
-
-		GeneralCacheInterface cacheCopy = getCache();
-		this.setCache(null);
-
-		try {
-			ReactomeDatabaseObject obj = getFullObjectForDbId(CHECK_SERVICE_STATUS_EXAMPLE);
-			status.setStatus(ExternalServiceStatusType.OK);
-			if (obj == null) {
-				status.setStatus(ExternalServiceStatusType.DOWN);
-			} else if (obj.getClass().equals(ReactomeDatabaseObject.class)) {
-				status.setStatus(ExternalServiceStatusType.CHANGED);
-			}
-		} catch (Exception e) {
-			logger.error(status.getName() + " is down", e);
-			status.setStatus(ExternalServiceStatusType.DOWN);
-		}
-		this.setCache(cacheCopy);
-		return status;
-	}
-
-}
+package lcsb.mapviewer.reactome.utils;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.log4j.Logger;
+import org.springframework.transaction.annotation.Transactional;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import lcsb.mapviewer.annotation.cache.CachableInterface;
+import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
+import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
+import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
+import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
+import lcsb.mapviewer.common.HttpConnectionMethodType;
+import lcsb.mapviewer.common.MimeType;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.reactome.model.ReactomeCandidateSet;
+import lcsb.mapviewer.reactome.model.ReactomeCatalystActivity;
+import lcsb.mapviewer.reactome.model.ReactomeComplex;
+import lcsb.mapviewer.reactome.model.ReactomeDatabaseObject;
+import lcsb.mapviewer.reactome.model.ReactomeEntitySet;
+import lcsb.mapviewer.reactome.model.ReactomeEntityWithAccessionedSequence;
+import lcsb.mapviewer.reactome.model.ReactomePhysicalEntity;
+import lcsb.mapviewer.reactome.model.ReactomeReactionlikeEvent;
+import lcsb.mapviewer.reactome.model.ReactomeReferenceMolecule;
+import lcsb.mapviewer.reactome.model.ReactomeReferenceSequence;
+import lcsb.mapviewer.reactome.model.ReactomeSimpleEntity;
+import lcsb.mapviewer.reactome.model.ReactomeStableIdentifier;
+import lcsb.mapviewer.reactome.model.ReactomeStatus;
+import lcsb.mapviewer.reactome.xml.ReactomeNodeParser;
+import lcsb.mapviewer.reactome.xml.ReactomeParserFactory;
+
+/**
+ * Data access object for reactome data.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Transactional(value = "txManager")
+public class ReactomeConnector extends CachableInterface implements DataSourceUpdater {
+
+	/**
+	 * Identifier of the object in reactome database used for testing connection.
+	 */
+	private static final int		CHECK_SERVICE_STATUS_EXAMPLE = 109581;
+
+	/**
+	 * Default timeout of http connection (in miliseconds).
+	 */
+	private static final int		CONNECTION_TIMEOUT					 = 10000;
+
+	/**
+	 * Prefix used in cache entries for objects queried by the identifier.
+	 */
+	private static final String	IDENTIFIER_QUERY_PREFIX			 = "ID: ";
+
+	@Override
+	public Object refreshCacheQuery(Object query) throws SourceNotAvailable {
+		ReactomeConnector connector = new ReactomeConnector();
+
+		String name;
+		Object result = null;
+		if (query instanceof String) {
+			name = (String) query;
+			if (name.startsWith(IDENTIFIER_QUERY_PREFIX)) {
+				String strId = name.substring(IDENTIFIER_QUERY_PREFIX.length());
+				Integer id = Integer.valueOf(strId);
+				try {
+					return connector.getFullNodeForDbId(id);
+				} catch (InvalidXmlSchemaException e) {
+					throw new SourceNotAvailable(e);
+				}
+			} else if (name.contains("\n")) {
+				String[] tmp = name.split("\n");
+				if (tmp.length != 2) {
+					throw new InvalidArgumentException("Don't know what to do with string \"" + query + "\"");
+				} else {
+					String params = tmp[0];
+					String url = tmp[1];
+					try {
+						result = connector.getNodesFromServer(params, url);
+					} catch (Exception e) {
+						throw new SourceNotAvailable(e);
+					}
+				}
+			} else {
+				throw new InvalidArgumentException("Don't know what to do with string \"" + query + "\"");
+			}
+		} else {
+			throw new InvalidArgumentException("Don't know what to do with class: " + query.getClass());
+		}
+		return result;
+	}
+
+	/**
+	 * Default constructor.
+	 */
+	public ReactomeConnector() {
+		super(ReactomeConnector.class);
+	}
+
+	/**
+	 * Determines if only one object instance should be created for single
+	 * reactome database identifier.
+	 */
+	private boolean															 oneInstancePerId	= true;
+
+	/**
+	 * Map of all reactome objects retrieved by this connector.
+	 */
+	private Map<Integer, ReactomeDatabaseObject> objectMap				= new HashMap<Integer, ReactomeDatabaseObject>();
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger												 logger						= Logger.getLogger(ReactomeConnector.class);
+	/**
+	 * Url used for accessing Reactome RestFULL API.
+	 */
+	private static final String									 REACTOME_URL			= "http://reactomews.oicr.on.ca:8080/ReactomeRESTfulAPI/RESTfulWS/";
+
+	@Override
+	public List<ReactomePhysicalEntity> getEntitiesForName(String name) throws IOException {
+		return getEntitiesForName(name, true);
+	}
+
+	@Override
+	public List<ReactomePhysicalEntity> getEntitiesForName(String name, boolean full) throws IOException {
+		List<ReactomePhysicalEntity> result = new ArrayList<ReactomePhysicalEntity>();
+
+		String query = "name=" + name;
+		List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomePhysicalEntity.class);
+
+		for (ReactomeDatabaseObject object : objects) {
+			if (full) {
+				ReactomePhysicalEntity fullEntity = (ReactomePhysicalEntity) getFullObjectForDbId(object.getDbId());
+				result.add(fullEntity);
+			} else {
+				result.add((ReactomePhysicalEntity) object);
+			}
+		}
+		return result;
+	}
+
+	@Override
+	public List<ReactomePhysicalEntity> getEntitiesForChebiId(Set<MiriamData> ids, boolean deepSearch) throws IOException {
+		Set<ReactomePhysicalEntity> set = new HashSet<ReactomePhysicalEntity>();
+		List<ReactomePhysicalEntity> result = new ArrayList<ReactomePhysicalEntity>();
+		if (ids == null) {
+			return result;
+		}
+		for (MiriamData md : ids) {
+			if (md == null) {
+				return result;
+			}
+			String id = md.getResource().replace("CHEBI:", "");
+
+			String query = "identifier=" + id;
+			List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeReferenceMolecule.class);
+
+			for (ReactomeDatabaseObject object : objects) {
+				ReactomeReferenceMolecule reference = (ReactomeReferenceMolecule) getFullObjectForDbId(object.getDbId());
+				List<ReactomeSimpleEntity> list = getSimpleEntitiesByReferenceMolecule(reference);
+				set.addAll(list);
+			}
+			if (deepSearch) {
+				int lastSize = 0;
+				do {
+					lastSize = set.size();
+					Set<ReactomePhysicalEntity> complexes = getComplexesContainingOneOfElements(set);
+					set.addAll(complexes);
+					Set<ReactomePhysicalEntity> sets = getSetsContainingOneOfElements(set);
+					set.addAll(sets);
+				} while (lastSize != set.size());
+			}
+			result.addAll(set);
+		}
+		return result;
+	}
+
+	@Override
+	public List<ReactomePhysicalEntity> getEntitiesForUniprotId(Collection<MiriamData> uniprot) throws IOException {
+		Set<ReactomePhysicalEntity> set = new HashSet<ReactomePhysicalEntity>();
+
+		for (MiriamData md : uniprot) {
+			if (!MiriamType.UNIPROT.equals(md.getDataType())) {
+				throw new InvalidArgumentException("Only uniprot miriam are acceptable");
+			}
+			String id = md.getResource();
+			int lastSize = set.size();
+			do {
+				lastSize = set.size();
+
+				String query = "identifier=" + id;
+				List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeReferenceSequence.class);
+
+				for (ReactomeDatabaseObject object : objects) {
+					ReactomeReferenceSequence reference = (ReactomeReferenceSequence) getFullObjectForDbId(object.getDbId());
+					List<ReactomePhysicalEntity> list = getPhysicalEnitiesForReferenceSequence(reference);
+					set.addAll(list);
+				}
+				query = "secondaryIdentifier=" + id;
+				objects = getSimpleObjectListByQuery(query, ReactomeReferenceSequence.class);
+
+				for (ReactomeDatabaseObject object : objects) {
+					ReactomeReferenceSequence reference = (ReactomeReferenceSequence) getFullObjectForDbId(object.getDbId());
+					List<ReactomePhysicalEntity> list = getPhysicalEnitiesForReferenceSequence(reference);
+					set.addAll(list);
+				}
+
+				Set<ReactomePhysicalEntity> complexes = getComplexesContainingOneOfElements(set);
+				set.addAll(complexes);
+				Set<ReactomePhysicalEntity> sets = getSetsContainingOneOfElements(set);
+				set.addAll(sets);
+			} while (lastSize != set.size());
+		}
+		List<ReactomePhysicalEntity> result = new ArrayList<ReactomePhysicalEntity>();
+		result.addAll(set);
+		return result;
+	}
+
+	/**
+	 * Returns list of ReactomeComplex that contain one of the elements given in
+	 * the parameter.
+	 * 
+	 * @param objects
+	 *          list of objects for which we want to retrieve complexes
+	 * @return list of ReactomeComplex that contain one of the elements given in
+	 *         the parameter
+	 * @throws IOException
+	 *           thrown when there is a problem with connection to reactome
+	 *           database
+	 */
+	private Set<ReactomePhysicalEntity> getComplexesContainingOneOfElements(Collection<ReactomePhysicalEntity> objects) throws IOException {
+		Set<ReactomePhysicalEntity> result = new HashSet<ReactomePhysicalEntity>();
+		for (ReactomeDatabaseObject obj : objects) {
+			String query = "hasComponent=" + obj.getDbId();
+			List<ReactomeDatabaseObject> complexes = getSimpleObjectListByQuery(query, ReactomeComplex.class);
+			for (ReactomeDatabaseObject complex : complexes) {
+				result.add((ReactomePhysicalEntity) getFullObjectForDbId(complex.getDbId()));
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns list of ReactomeEntitySet that contain one of the elements given in
+	 * the parameter.
+	 * 
+	 * @param objects
+	 *          list of objects for which we want to retrieve sets
+	 * @return list of ReactomeEntitySet that contain one of the elements given in
+	 *         the parameter
+	 * @throws IOException
+	 *           thrown when there is a problem with connection to reactome
+	 *           database
+	 */
+	private Set<ReactomePhysicalEntity> getSetsContainingOneOfElements(Collection<ReactomePhysicalEntity> objects) throws IOException {
+
+		Set<ReactomePhysicalEntity> result = new HashSet<ReactomePhysicalEntity>();
+		for (ReactomeDatabaseObject obj : objects) {
+			String query = "hasMember=" + obj.getDbId();
+			List<ReactomeDatabaseObject> complexes = getSimpleObjectListByQuery(query, ReactomeEntitySet.class);
+			for (ReactomeDatabaseObject complex : complexes) {
+				result.add((ReactomeEntitySet) getFullObjectForDbId(complex.getDbId()));
+			}
+			query = "hasCandidate=" + obj.getDbId();
+			complexes = getSimpleObjectListByQuery(query, ReactomeCandidateSet.class);
+			for (ReactomeDatabaseObject complex : complexes) {
+				result.add((ReactomeCandidateSet) getFullObjectForDbId(complex.getDbId()));
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns list of ReactomeEntityWithAccessionedSequence that refers to
+	 * parameter reference.
+	 * 
+	 * @param reference
+	 *          object to which result should refer to
+	 * @return list of ReactomeEntityWithAccessionedSequence that contain one of
+	 *         the elements given in the parameter
+	 * @throws IOException
+	 *           thrown when there is a problem with connection to reactome
+	 *           database
+	 */
+	private List<ReactomePhysicalEntity> getPhysicalEnitiesForReferenceSequence(ReactomeReferenceSequence reference) throws IOException {
+		List<ReactomePhysicalEntity> result = new ArrayList<ReactomePhysicalEntity>();
+
+		String query = "referenceEntity=" + reference.getDbId();
+		List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeEntityWithAccessionedSequence.class);
+
+		for (ReactomeDatabaseObject object : objects) {
+			result.add((ReactomePhysicalEntity) getFullObjectForDbId(object.getDbId()));
+		}
+		return result;
+	}
+
+	/**
+	 * Returns list of ReactomeSimpleEntity that refers to parameter reference.
+	 * 
+	 * @param reference
+	 *          object to which result should refer to
+	 * @return list of ReactomeSimpleEntity that contain one of the elements given
+	 *         in the parameter
+	 * @throws IOException
+	 *           thrown when there is a problem with connection to reactome
+	 *           database
+	 */
+	private List<ReactomeSimpleEntity> getSimpleEntitiesByReferenceMolecule(ReactomeReferenceMolecule reference) throws IOException {
+		List<ReactomeSimpleEntity> result = new ArrayList<ReactomeSimpleEntity>();
+
+		String query = "referenceEntity=" + reference.getDbId();
+		List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeSimpleEntity.class);
+
+		for (ReactomeDatabaseObject object : objects) {
+			result.add((ReactomeSimpleEntity) getFullObjectForDbId(object.getDbId()));
+		}
+		return result;
+	}
+
+	/**
+	 * Ges list of reactions that interact with object given in the parameter.
+	 * 
+	 * @param id
+	 *          identifier of the object that should be included in the result
+	 *          reactions
+	 * @return list of reactions that interact with object given in the parameter
+	 * @throws IOException
+	 *           thrown when there is a problem with connection to reactome
+	 *           database
+	 */
+	public List<ReactomeReactionlikeEvent> getReactionsForEntityId(Integer id) throws IOException {
+		List<ReactomeReactionlikeEvent> result = new ArrayList<ReactomeReactionlikeEvent>();
+
+		String query = "input=" + id;
+		List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeReactionlikeEvent.class);
+
+		for (ReactomeDatabaseObject object : objects) {
+			ReactomeDatabaseObject entity = getFullObjectForDbId(object.getDbId());
+			if (entity instanceof ReactomeReactionlikeEvent) {
+				result.add((ReactomeReactionlikeEvent) entity);
+			}
+		}
+
+		query = "output=" + id;
+		objects = getSimpleObjectListByQuery(query, ReactomeReactionlikeEvent.class);
+
+		for (ReactomeDatabaseObject object : objects) {
+			ReactomeDatabaseObject entity = getFullObjectForDbId(object.getDbId());
+			if (entity instanceof ReactomeReactionlikeEvent) {
+				result.add((ReactomeReactionlikeEvent) entity);
+			}
+		}
+
+		// and now find reaction with apropriate catalyst
+		query = "physicalEntity=" + id;
+		List<ReactomeDatabaseObject> catalysts = getSimpleObjectListByQuery(query, ReactomeCatalystActivity.class);
+		for (ReactomeDatabaseObject catalyst : catalysts) {
+			query = "catalystActivity=" + catalyst.getDbId();
+			objects = getSimpleObjectListByQuery(query, ReactomeReactionlikeEvent.class);
+			for (ReactomeDatabaseObject object : objects) {
+				ReactomeDatabaseObject entity = getFullObjectForDbId(object.getDbId());
+				if (entity instanceof ReactomeReactionlikeEvent) {
+					result.add((ReactomeReactionlikeEvent) entity);
+				}
+			}
+		}
+
+		return result;
+	}
+
+	@Override
+	public Class<?> getTypeForDbId(Integer id) throws ClassNotFoundException, InvalidXmlSchemaException {
+		Node node = getFullNodeForDbId(id);
+		Class<?> result = getTypeForNode(node);
+		return result;
+	}
+
+	/**
+	 * Returns class type of the data represented in the xml node.
+	 * 
+	 * @param node
+	 *          xml node
+	 * @return class type of the data represented in the xml node
+	 * @throws ClassNotFoundException
+	 *           thrown when there is a problem with finding apropriate class
+	 */
+	protected Class<?> getTypeForNode(Node node) throws ClassNotFoundException {
+		Class<?> result = null;
+		for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+			Node child = node.getChildNodes().item(i);
+			if (child.getNodeName().equals("schemaClass")) {
+				// our classes aren't exactly the same as reactome names, change what is
+				// different
+				String shortName = child.getTextContent().replaceAll("GO_", "Go");
+				String className = ReactomeDatabaseObject.class.getPackage().getName() + ".Reactome" + shortName;
+				result = Class.forName(className);
+			}
+		}
+		return result;
+	}
+
+	@Override
+	public ReactomeDatabaseObject getFullObjectForDbId(Integer id) {
+		try {
+			ReactomeDatabaseObject result = null;
+			if (oneInstancePerId) {
+				result = objectMap.get(id);
+				if (result != null) {
+					return result;
+				}
+			}
+			Class<?> classType;
+			Node node = getFullNodeForDbId(id);
+			classType = getTypeForNode(node);
+			ReactomeNodeParser<?> parser = ReactomeParserFactory.getParserForClass(classType);
+			result = parser.parseObject(node);
+			if (oneInstancePerId) {
+				objectMap.put(id, result);
+			}
+			return result;
+		} catch (ClassNotFoundException e) {
+			throw new InvalidArgumentException("Unknown class type: " + e.getMessage());
+		} catch (InvalidXmlSchemaException e) {
+			logger.error(e, e);
+			return null;
+		}
+	}
+
+	@Override
+	@SuppressWarnings("unchecked")
+	public void updateOnlyIdFields(ReactomeDatabaseObject object) {
+		DataSourceUpdater dsu = this;
+		for (Method method : object.getClass().getMethods()) {
+
+			if (Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 0
+					&& (method.getName().startsWith("get") || method.getName().startsWith("is"))) {
+
+				if (ReactomeDatabaseObject.class.isAssignableFrom(method.getReturnType())) {
+					try {
+						ReactomeDatabaseObject value = (ReactomeDatabaseObject) method.invoke(object);
+						if (value != null) {
+							if (value.getStatus().equals(ReactomeStatus.ONLY_ID)) {
+								ReactomeDatabaseObject newValue = dsu.getFullObjectForDbId(value.getDbId());
+								String setterName = method.getName();
+								if (setterName.startsWith("get")) {
+									setterName = setterName.replaceFirst("get", "set");
+								} else {
+									setterName = setterName.replaceFirst("is", "set");
+								}
+								try {
+									Method setterMethod = object.getClass().getMethod(setterName, method.getReturnType());
+									setterMethod.invoke(object, newValue);
+								} catch (NoSuchMethodException e) {
+									e.printStackTrace();
+								} catch (IllegalArgumentException e) {
+									logger.error(
+											"Cannot assign " + newValue.getClass() + " (id: " + value.getDbId() + ") to field: " + setterName.replace("set", "") + " ("
+													+ method.getReturnType() + ")");
+								} catch (SecurityException e) {
+
+									e.printStackTrace();
+									// ignore it - however this would be strange
+								}
+							}
+						}
+					} catch (IllegalAccessException e) {
+						e.printStackTrace();
+					} catch (IllegalArgumentException e) {
+						e.printStackTrace();
+					} catch (InvocationTargetException e) {
+						e.printStackTrace();
+						// ignore it
+					}
+
+				} else if (List.class.isAssignableFrom(method.getReturnType())) {
+					try {
+						@SuppressWarnings("rawtypes")
+						List list = (List) method.invoke(object);
+						for (int i = 0; i < list.size(); i++) {
+							Object obj = list.get(i);
+							if (obj instanceof ReactomeDatabaseObject) {
+								if (((ReactomeDatabaseObject) obj).getStatus().equals(ReactomeStatus.ONLY_ID)) {
+									ReactomeDatabaseObject newValue = dsu.getFullObjectForDbId(((ReactomeDatabaseObject) obj).getDbId());
+									list.set(i, newValue);
+								}
+							}
+						}
+					} catch (IllegalAccessException e) {
+						e.printStackTrace();
+					} catch (IllegalArgumentException e) {
+						e.printStackTrace();
+					} catch (InvocationTargetException e) {
+						e.printStackTrace();
+						// ignore it
+					}
+				}
+			}
+		}
+	}
+
+	@Override
+	public ReactomeDatabaseObject getFullObjectForStableIdentifier(String stableIdentifier) throws IOException {
+		if (stableIdentifier == null) {
+			return null;
+		}
+		String[] tmp = stableIdentifier.split("\\.");
+		String identifier = tmp[0];
+		String version = "0";
+		if (tmp.length > 1) {
+			version = tmp[1];
+		}
+		return getFullObjectForStableIdentifier(identifier, version);
+	}
+
+	@Override
+	public ReactomeDatabaseObject getFullObjectForStableIdentifier(String identifier, String version) throws IOException {
+		String stableIdentifierQuery = "identifier=" + identifier;
+
+		List<ReactomeDatabaseObject> stableIdentifiers = getSimpleObjectListByQuery(stableIdentifierQuery, ReactomeStableIdentifier.class);
+
+		ReactomeStableIdentifier newestIdentifier = null;
+		ReactomeStableIdentifier matchedIdentifier = null;
+
+		for (ReactomeDatabaseObject object : stableIdentifiers) {
+			ReactomeStableIdentifier entity = (ReactomeStableIdentifier) getFullObjectForDbId(object.getDbId());
+			if (newestIdentifier == null) {
+				newestIdentifier = entity;
+			} else {
+				try {
+					Integer id1 = Integer.parseInt(newestIdentifier.getIdentifierVersion());
+					Integer id2 = Integer.parseInt(entity.getIdentifierVersion());
+					if (id2 > id1) {
+						newestIdentifier = entity;
+					}
+				} catch (Exception e) {
+					logger.error(e.getMessage(), e);
+				}
+			}
+			if (entity.getDisplayName().equals(identifier + "." + version) || entity.getIdentifierVersion().equalsIgnoreCase(version)) {
+				matchedIdentifier = entity;
+			}
+		}
+		if (matchedIdentifier == null) {
+			if (newestIdentifier != null) {
+				logger.warn(
+						"Invalid REACTOME stable identifier: \"" + identifier + "." + version + "\". Using another similar: " + newestIdentifier.getIdentifier() + "."
+								+ newestIdentifier.getIdentifierVersion());
+			}
+			matchedIdentifier = newestIdentifier;
+		}
+		if (matchedIdentifier != null) {
+			String query = "stableIdentifier=" + matchedIdentifier.getDbId();
+			List<ReactomeDatabaseObject> objects = getSimpleObjectListByQuery(query, ReactomeDatabaseObject.class);
+
+			for (ReactomeDatabaseObject object : objects) {
+				return getFullObjectForDbId(object.getDbId());
+			}
+
+		}
+		return null;
+	}
+
+	// ------------------------------------------------
+	//
+	// Methods that directly connect to reactome database (via restfull API)
+	//
+	// ------------------------------------------------
+
+	/**
+	 * This method get content of the page of the url (and post content).
+	 * 
+	 * @param url
+	 *          url address to connect
+	 * @param postParam
+	 *          params of the post method
+	 * @param type
+	 *          MIME type of the result
+	 * @param method
+	 *          request method (POST/GET)
+	 * @return return the string with the content of the webpage
+	 * @throws IOException
+	 *           thrown when there are some problem with network connection
+	 */
+	protected String getResponse(String url, String postParam, MimeType type, HttpConnectionMethodType method) throws IOException {
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+		// add reuqest header
+		con.setRequestMethod(method.name());
+		con.setRequestProperty("Accept", type.getTextRepresentation());
+		con.setRequestProperty("Content-Type", type.getTextRepresentation());
+		con.setConnectTimeout(CONNECTION_TIMEOUT);
+		con.setReadTimeout(CONNECTION_TIMEOUT);
+
+		String urlParameters = postParam;
+
+		logger.debug("Sending '" + method + "' request to URL : " + url);
+		if (method.name().equals("POST")) {
+			logger.debug("Parameters : " + urlParameters);
+		}
+
+		// Send post request
+		con.setDoOutput(true);
+		if (method.name().equalsIgnoreCase("POST")) {
+			DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+			wr.writeBytes(urlParameters);
+			wr.flush();
+			wr.close();
+		}
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Response Code : " + responseCode);
+
+		String result = IOUtils.toString(con.getInputStream());
+		logger.debug(result);
+		return result;
+	}
+
+	@Override
+	public List<ReactomeDatabaseObject> getSimpleObjectListByQuery(String query, Class<? extends ReactomeDatabaseObject> clazz) throws IOException {
+		if (query.contains("\n")) {
+			throw new InvalidArgumentException("Query cannot contain new line character");
+		}
+		ReactomeNodeParser<?> parser = ReactomeParserFactory.getParserForClass(clazz);
+		List<ReactomeDatabaseObject> result = new ArrayList<ReactomeDatabaseObject>();
+
+		String url = REACTOME_URL + "listByQuery/" + clazz.getSimpleName().replaceFirst("Reactome", "").replaceAll("Go", "GO_");
+
+		String key = query + "\n" + url;
+
+		Node node = getCacheNode(key);
+		NodeList nodes = null;
+		if (node != null) {
+			nodes = node.getChildNodes();
+		} else {
+			try {
+				nodes = getNodesFromServer(query, url);
+			} catch (InvalidXmlSchemaException e) {
+				throw new IOException(e);
+			}
+			setCacheNode(key, nodes.item(0));
+			nodes = nodes.item(0).getChildNodes();
+		}
+		for (int i = 0; i < nodes.getLength(); i++) {
+			if (nodes.item(i).getNodeType() != Node.ELEMENT_NODE) {
+				continue;
+			}
+			ReactomeDatabaseObject object = parser.parseSimplifiedObject(nodes.item(i));
+			result.add(object);
+		}
+		return result;
+	}
+
+	/**
+	 * Returns list of nodes from the server identified by the query and POST
+	 * params.
+	 * 
+	 * @param query
+	 *          string query to the database sent by POST method
+	 * @param url
+	 *          direct url to the API
+	 * @return list of nodes from the server identified by the query and POST
+	 *         params.
+	 * @throws IOException
+	 *           thrown when there are some problem with network connection
+	 * @throws InvalidXmlSchemaException
+	 *           thrown when there is a problem with xml
+	 */
+	private NodeList getNodesFromServer(String query, String url) throws IOException, InvalidXmlSchemaException {
+		String response = getResponse(url, query, MimeType.XML, HttpConnectionMethodType.POST);
+		logger.debug(response);
+		Node node = getXmlDocumentFromString(response);
+		NodeList nodes = node.getChildNodes();
+		if (nodes.getLength() < 1) {
+			throw new InvalidArgumentException("Problem with xml document");
+		}
+		return nodes;
+	}
+
+	/**
+	 * This method returns xml NODE for object identified by id (identifier in
+	 * reactome database). However if object is in local cache then local copy is
+	 * returned. If object doesn't exist in local cache then after retrieving it
+	 * from reactome is put to the cache.
+	 * 
+	 * @param id
+	 *          identifier in reactome database
+	 * @return xml node for the id given reactome id
+	 * @throws InvalidXmlSchemaException
+	 *           thrown when there is a problem with xml
+	 */
+	@Override
+	public Node getFullNodeForDbId(Integer id) throws InvalidXmlSchemaException {
+		Node result = getCacheNode(IDENTIFIER_QUERY_PREFIX + id);
+		if (result != null) {
+			return result;
+		}
+
+		String response;
+		String url = REACTOME_URL + "queryById/DatabaseObject/" + id;
+		try {
+			response = getResponse(url, "", MimeType.XML, HttpConnectionMethodType.GET);
+			Document doc = getXmlDocumentFromString(response);
+			NodeList nodes = doc.getChildNodes();
+			result = nodes.item(0);
+			setCacheNode(IDENTIFIER_QUERY_PREFIX + id, result);
+			return result;
+		} catch (IOException e) {
+			logger.error(e.getMessage(), e);
+			return null;
+		}
+	}
+
+	@Override
+	public Map<Integer, ReactomeDatabaseObject> getFullObjectsForDbIds(List<Integer> ids) throws ClassNotFoundException, IOException {
+		Map<Integer, ReactomeDatabaseObject> result = new HashMap<Integer, ReactomeDatabaseObject>();
+		for (Integer integer : ids) {
+			result.put(integer, getFullObjectForDbId(integer));
+		}
+
+		return result;
+
+	}
+
+	@Override
+	public List<ReactomePhysicalEntity> getEntitiesForSetOfIds(Set<MiriamData> identifiers) throws IOException {
+		return getEntitiesForUniprotId(identifiers);
+	}
+
+	@Override
+	public ExternalServiceStatus getServiceStatus() {
+		ExternalServiceStatus status = new ExternalServiceStatus(
+				"Reactome RESTful API", "http://reactomews.oicr.on.ca:8080/ReactomeRESTfulAPI/ReactomeRESTFulAPI.html");
+
+		GeneralCacheInterface cacheCopy = getCache();
+		this.setCache(null);
+
+		try {
+			ReactomeDatabaseObject obj = getFullObjectForDbId(CHECK_SERVICE_STATUS_EXAMPLE);
+			status.setStatus(ExternalServiceStatusType.OK);
+			if (obj == null) {
+				status.setStatus(ExternalServiceStatusType.DOWN);
+			} else if (obj.getClass().equals(ReactomeDatabaseObject.class)) {
+				status.setStatus(ExternalServiceStatusType.CHANGED);
+			}
+		} catch (Exception e) {
+			logger.error(status.getName() + " is down", e);
+			status.setStatus(ExternalServiceStatusType.DOWN);
+		}
+		this.setCache(cacheCopy);
+		return status;
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/impl/DataMiningService.java b/service/src/main/java/lcsb/mapviewer/services/impl/DataMiningService.java
index f791ea7cf9..6fdfc8fdaf 100644
--- a/service/src/main/java/lcsb/mapviewer/services/impl/DataMiningService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/impl/DataMiningService.java
@@ -1,530 +1,530 @@
-package lcsb.mapviewer.services.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.lang3.math.NumberUtils;
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
-import lcsb.mapviewer.annotation.services.annotators.BiocompendiumAnnotator;
-import lcsb.mapviewer.annotation.services.annotators.HgncAnnotator;
-import lcsb.mapviewer.common.IProgressUpdater;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.XmlParser;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.log.LogType;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.graph.DataMining;
-import lcsb.mapviewer.model.map.graph.DataMiningSet;
-import lcsb.mapviewer.model.map.graph.DataMiningType;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.ReactionNode;
-import lcsb.mapviewer.persist.DbUtils;
-import lcsb.mapviewer.persist.dao.map.graph.DataMiningDao;
-import lcsb.mapviewer.persist.dao.map.graph.DataMiningSetDao;
-import lcsb.mapviewer.services.interfaces.IDataMiningService;
-import lcsb.mapviewer.services.interfaces.ILogService;
-import lcsb.mapviewer.services.interfaces.ILogService.LogParams;
-import lcsb.mapviewer.services.utils.InvalidDataMiningInputFile;
-import lcsb.mapviewer.services.view.DataMiningSetView;
-
-/**
- * Implementation of the service that manages data mining data.
- * 
- * @author Piotr Gawron
- * 
- */
-@Transactional(value = "txManager")
-public class DataMiningService extends XmlParser implements IDataMiningService {
-
-	/**
-	 * Name of the source column (element that misses connection) in the input
-	 * file containing information about data mining.
-	 */
-	private static final String		 SOURCE_COLUMN_NAME	= "Source";
-
-	/**
-	 * Name of the target column (connection that is missing) in the input file.
-	 */
-	private static final String		 TARGET_COLUMN_NAME	= "Target";
-
-	/**
-	 * Name of the description column in the input file.
-	 */
-	private static final String		 DESC_COLUMN_NAME		= "Description";
-
-	/**
-	 * Name of the column where references are kept in the input file.
-	 */
-	private static final String		 REF_COLUMN_NAME		= "References";
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger					 logger							= Logger.getLogger(DataMiningService.class);
-
-	/**
-	 * Data access object for data mining information.
-	 */
-	@Autowired
-	private DataMiningDao					 missingConnectionDao;
-
-	/**
-	 * Utils that help to manage the sessions in custom multithreaded
-	 * implementation.
-	 */
-	@Autowired
-	private DbUtils								 dbUtils;
-
-	/**
-	 * Data access object for {@link DataMiningSet} objects.
-	 */
-	@Autowired
-	private DataMiningSetDao			 dataMinigSetDao;
-
-	/**
-	 * Class used to work on {@link MiriamType#HGNC} annotations.
-	 */
-	@Autowired
-	private HgncAnnotator					 hgncAnnotator;
-
-	/**
-	 * Service that allows to log system messages.
-	 */
-	@Autowired
-	private ILogService						 logService;
-
-	/**
-	 * Service used for annotation of proteins (and finding annotation of
-	 * proteins).
-	 */
-	@Autowired
-	private BiocompendiumAnnotator annotationRestService;
-
-	@Override
-	public Collection<DataMining> getMissingConnections(SpeciesAlias alias) {
-		return getMissingConnections(alias.getSpecies());
-	}
-
-	@Override
-	public Collection<DataMining> getMissingConnections(Element species) {
-		return missingConnectionDao.getMissingConnectionForElement(species);
-	}
-
-	@Override
-	public void addMissingConnection(DataMining connection) {
-		missingConnectionDao.add(connection);
-		Element element = connection.getElement();
-		String id = element.getName() + " (" + element.getStringType() + ")";
-		String toString = "";
-		for (MiriamData md : connection.getSuggestedConnections()) {
-			toString += md.getResource() + ",";
-		}
-		LogParams params = new LogParams().type(LogType.ADD_MISSING_CONNECTION).description("Added connection: " + id + " " + toString).object(connection);
-		logService.log(params);
-	}
-
-	@Override
-	public void deleteMissingConnection(DataMining connection, String reason) {
-		missingConnectionDao.delete(connection);
-		Element element = connection.getElement();
-		String id = element.getName() + " (" + element.getStringType() + ")";
-		String toString = "";
-		for (MiriamData md : connection.getSuggestedConnections()) {
-			toString += md.getResource() + ",";
-		}
-		LogParams params = new LogParams().type(LogType.REMOVE_MISSING_CONNECTION).description("Connection removed: " + id + " " + toString).object(connection);
-		logService.log(params);
-	}
-
-	@Override
-	public void deleteMissingConnection(String connectionId, String reason) {
-		Integer id = Integer.parseInt(connectionId);
-		DataMining mc = missingConnectionDao.getById(id);
-		this.deleteMissingConnection(mc, reason);
-	}
-
-	@Override
-	public Collection<Element> getSpeciesWithMissingConnectionsByGeneName(Model model, String geneName) {
-		Set<Element> result = new HashSet<Element>();
-		if (geneName == null) {
-			return result;
-		}
-		for (Element element : model.getElements()) {
-			Collection<DataMining> set = missingConnectionDao.getMissingConnectionForElement(element);
-			for (DataMining dataMining : set) {
-				for (MiriamData md : dataMining.getSuggestedConnections()) {
-					if (md.getResource().equalsIgnoreCase(geneName)) {
-						result.add(element);
-					}
-				}
-			}
-		}
-		return result;
-	}
-
-	@Override
-	public void removeConnectionsForModel(Model model) {
-		removeConnectionsForModel(model.getModelData());
-
-	}
-
-	/**
-	 * @return the logService
-	 */
-	public ILogService getLogService() {
-		return logService;
-	}
-
-	/**
-	 * @param logService
-	 *          the logService to set
-	 */
-	public void setLogService(ILogService logService) {
-		this.logService = logService;
-	}
-
-	/**
-	 * @return the missingConnectionDao
-	 */
-	public DataMiningDao getMissingConnectionDao() {
-		return missingConnectionDao;
-	}
-
-	/**
-	 * @param missingConnectionDao
-	 *          the missingConnectionDao to set
-	 */
-	public void setMissingConnectionDao(DataMiningDao missingConnectionDao) {
-		this.missingConnectionDao = missingConnectionDao;
-	}
-
-	/**
-	 * Map that contains cached information if identifiers are hgnc valid names or
-	 * not.
-	 */
-	private Map<String, Boolean> isHgnc = new HashMap<String, Boolean>();
-
-	/**
-	 * Returns true if the parameter is valid hgnc identifier.
-	 * 
-	 * @param string
-	 *          name of supposed hgnc name
-	 * @return true if paraeter is valid hgnc identifier
-	 */
-	protected boolean isHgncName(String string) {
-		if (string == null) {
-			return false;
-		}
-		Boolean status = isHgnc.get(string);
-		if (status == null) {
-			try {
-				status = annotationRestService.validAnnotation(new MiriamData(MiriamType.HGNC_SYMBOL, string));
-			} catch (IOException e) {
-				logger.error(e);
-				status = false;
-			}
-			isHgnc.put(string, status);
-		}
-		return status;
-	}
-
-	@Override
-	public void removeConnectionsForModel(ModelData model) {
-		Collection<Element> nodes = model.getElements();
-
-		dbUtils.setAutoFlush(false);
-		for (Element node : nodes) {
-			Collection<DataMining> mcs = missingConnectionDao.getMissingConnectionForElement(node);
-			for (DataMining missingConnection : mcs) {
-				missingConnectionDao.delete(missingConnection);
-			}
-		}
-		dbUtils.setAutoFlush(true);
-		missingConnectionDao.flush();
-
-		dbUtils.setAutoFlush(false);
-		dbUtils.setAutoFlush(true);
-		missingConnectionDao.flush();
-	}
-
-	@Override
-	public Set<DataMining> parseData(String filename, DataMiningType type, Collection<Element> nodes, Set<Reaction> reactions, IProgressUpdater updater)
-			throws IOException, InvalidDataMiningInputFile {
-		InputStream is = new FileInputStream(filename);
-		String name = new File(filename).getName();
-		String warningPrefix = "[Data mining, " + name + "] ";
-
-		return parseData(nodes, reactions, is, warningPrefix);
-	}
-
-	/**
-	 * This method creates set of {@link DataMining} elements from input stream.
-	 * 
-	 * @param is
-	 *          {@link InputStream}
-	 * @param nodes
-	 *          nodes for which data mining connections shoul be generated
-	 * @param reactions
-	 *          list of already existing reactions in the model
-	 * @param warningPrefix
-	 *          prefix used in warnings
-	 * @return data mining connections for given data
-	 * @throws InvalidDataMiningInputFile
-	 *           thrown when the input file is invalid
-	 */
-	protected Set<DataMining> parseData(Collection<Element> nodes, Set<Reaction> reactions, InputStream is, String warningPrefix)
-			throws InvalidDataMiningInputFile {
-		Set<DataMining> result = new HashSet<DataMining>();
-		String content = null;
-		try {
-			content = inputStreamToString(is).replaceAll("[\r\n]+", "\n");
-		} catch (IOException e) {
-			throw new InvalidDataMiningInputFile(warningPrefix + " " + e.getMessage(), e);
-		}
-		String[] lines = content.split("\n");
-		int headerLine = -1;
-		for (int i = 0; i < lines.length; i++) {
-			if (!lines[i].startsWith("#") && !lines[i].isEmpty()) {
-				headerLine = i;
-				break;
-			}
-		}
-		if (headerLine < 0) {
-			throw new InvalidDataMiningInputFile(warningPrefix + " No header line found");
-		}
-		String[] columns = lines[headerLine].split("\t");
-		Integer sourceColumnId = null;
-		Integer targetColumnId = null;
-		Integer descColumnId = null;
-		Integer refColumnId = null;
-		for (int i = 0; i < columns.length; i++) {
-			String col = columns[i].trim();
-			if (SOURCE_COLUMN_NAME.equalsIgnoreCase(col)) {
-				sourceColumnId = i;
-			} else if (TARGET_COLUMN_NAME.equalsIgnoreCase(col)) {
-				targetColumnId = i;
-			} else if (DESC_COLUMN_NAME.equalsIgnoreCase(col)) {
-				descColumnId = i;
-			} else if (REF_COLUMN_NAME.equalsIgnoreCase(col)) {
-				refColumnId = i;
-			} else {
-				logger.debug(headerLine + ": \"" + lines[headerLine] + "\"");
-				throw new InvalidDataMiningInputFile(warningPrefix + " Unknown column name: \"" + col + "\". Only " //
-						+ "\"" + SOURCE_COLUMN_NAME + "\", " //
-						+ "\"" + TARGET_COLUMN_NAME + "\", " //
-						+ "\"" + DESC_COLUMN_NAME + "\", " //
-						+ "\"" + REF_COLUMN_NAME + "\" " //
-						+ " are available.");
-			}
-		}
-		if (sourceColumnId == null) {
-			throw new InvalidDataMiningInputFile(warningPrefix + " Column \"" + SOURCE_COLUMN_NAME + "\" wasn't found in the input file.");
-		}
-
-		if (targetColumnId == null) {
-			throw new InvalidDataMiningInputFile(warningPrefix + " Column \"" + TARGET_COLUMN_NAME + "\" wasn't found in the input file.");
-		}
-		Map<MiriamData, List<Element>> map = new HashMap<MiriamData, List<Element>>();
-		for (Element element : nodes) {
-			for (MiriamData md : element.getMiriamData()) {
-				List<Element> elList = map.get(md);
-				if (elList == null) {
-					elList = new ArrayList<Element>();
-					map.put(md, elList);
-				}
-				elList.add(element);
-			}
-		}
-		Set<Pair<MiriamData, MiriamData>> reactionsHash = createReactionHashMap(reactions);
-
-		for (int i = headerLine + 1; i < lines.length; i++) {
-			String[] tmp = lines[i].split("\t", -1);
-			if (tmp.length != columns.length) {
-				String warning = warningPrefix + "Row " + i + " contains invalid number of columns. Skipping... (row content: " + lines[i] + ") ";
-				logger.warn(warning);
-				continue;
-			}
-			String id1 = tmp[sourceColumnId];
-			String id2 = tmp[targetColumnId];
-			MiriamData md1 = parseIdentifier(id1, warningPrefix);
-			MiriamData md2 = parseIdentifier(id2, warningPrefix);
-			String description = null;
-			if (descColumnId != null) {
-				description = tmp[descColumnId].trim();
-			} else {
-				MiriamData hgncSymbol = null;
-				try {
-					if (md2.getDataType().equals(MiriamType.HGNC_SYMBOL)) {
-						hgncSymbol = md2;
-					} else if (md2.getDataType().equals(MiriamType.HGNC)) {
-						hgncSymbol = hgncAnnotator.hgncIdToHgncName(md2);
-					}
-				} catch (AnnotatorException e) {
-					logger.warn(warningPrefix + " Problem with transfomring identifier to " + MiriamType.HGNC_SYMBOL.getCommonName() + ". Identifier: " + md2, e);
-				}
-				if (hgncSymbol != null) {
-					description = hgncSymbol.getResource();
-				}
-			}
-			List<MiriamData> ref = new ArrayList<MiriamData>();
-			if (refColumnId != null) {
-				ref.addAll(createReferences(warningPrefix, tmp[refColumnId]));
-			}
-			if (md1 != null && md2 != null) {
-				boolean exists = false;
-				if (md1.compareTo(md2) < 0) {
-					exists = reactionsHash.contains(new Pair<MiriamData, MiriamData>(md1, md2));
-				} else {
-					exists = reactionsHash.contains(new Pair<MiriamData, MiriamData>(md2, md1));
-				}
-				if (!exists) {
-					List<Element> listEl = map.get(md1);
-					if (listEl != null) {
-						for (Element el : listEl) {
-							DataMining dm = new DataMining();
-							dm.setElement(el);
-							dm.setDescription(description);
-							dm.addReferences(copyList(ref));
-							dm.addSuggestedConnection(new MiriamData(md2));
-							dm.setType(DataMiningType.UNKNOWN);
-							result.add(dm);
-						}
-					} else {
-						logger.warn(warningPrefix + " Element with identifier \"" + md1.getDataType().getCommonName() + ": " + md1.getResource() + "\" doesn't exist");
-					}
-				}
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Creates list of references from string with comma separated identifiers.
-	 * 
-	 * @param warningPrefix
-	 *          prefix used for warnings
-	 * @param refString
-	 *          strign with comma separated pubmed identifiers
-	 * @return list of references from string with comma separated identifiers
-	 */
-	public List<MiriamData> createReferences(String warningPrefix, String refString) {
-		List<MiriamData> ref = new ArrayList<>();
-		for (String string : refString.split(",")) {
-			if (!string.isEmpty()) {
-				String id = string.replaceAll("urn:miriam:pubmed:", "").trim();
-				if (NumberUtils.isDigits(id)) {
-					ref.add(new MiriamData(MiriamType.PUBMED, id.trim()));
-				} else {
-					logger.warn(warningPrefix + "Invalid pubmed identifier: \"" + string);
-				}
-			}
-		}
-		return ref;
-	}
-
-	/**
-	 * Creates list with copies of the {@link MiriamData} objects.
-	 * 
-	 * @param ref
-	 *          list to copy
-	 * @return list with copies of the {@link MiriamData} objects
-	 */
-	private List<MiriamData> copyList(List<MiriamData> ref) {
-		List<MiriamData> result = new ArrayList<>();
-		for (MiriamData miriamData : ref) {
-			result.add(new MiriamData(miriamData));
-		}
-		return result;
-	}
-
-	/**
-	 * Parses string identifiers and returns {@link MiriamData} object with
-	 * information from the identifier.
-	 * 
-	 * @param identifier
-	 *          identfier to be parsed
-	 * @param warningPrefix
-	 *          prefix that should be added when reporting warning
-	 * @return {@link MiriamData} object obtained from identifier
-	 */
-	protected MiriamData parseIdentifier(String identifier, String warningPrefix) {
-		MiriamData md1 = null;
-		try {
-			md1 = MiriamType.getMiriamDataFromIdentifier(identifier.trim());
-		} catch (InvalidArgumentException e) {
-			try {
-				md1 = MiriamType.getMiriamByUri(identifier.trim());
-			} catch (InvalidArgumentException e1) {
-				logger.warn(warningPrefix + "Invalid identifier: " + identifier.trim());
-			}
-		}
-		return md1;
-	}
-
-	/**
-	 * Creates a set of pairs ( {@link MiriamData}, {@link MiriamData} )
-	 * containing information about all connection in the reactions.
-	 * 
-	 * @param reactions
-	 *          input reactions.
-	 * @return set of pairs ( {@link MiriamData}, {@link MiriamData} ) containing
-	 *         information about all connection in the input reactions
-	 */
-	protected Set<Pair<MiriamData, MiriamData>> createReactionHashMap(Set<Reaction> reactions) {
-		Set<Pair<MiriamData, MiriamData>> reactionsHash = new HashSet<Pair<MiriamData, MiriamData>>();
-		for (Reaction reaction : reactions) {
-			List<ReactionNode> rNodes = reaction.getReactionNodes();
-			for (int i = 0; i < rNodes.size(); i++) {
-				for (int j = i + 1; j < rNodes.size(); j++) {
-					for (MiriamData md1 : rNodes.get(i).getElement().getMiriamData()) {
-						for (MiriamData md2 : rNodes.get(j).getElement().getMiriamData()) {
-							if (md1.compareTo(md2) < 0) {
-								reactionsHash.add(new Pair<MiriamData, MiriamData>(md1, md2));
-							} else {
-								reactionsHash.add(new Pair<MiriamData, MiriamData>(md2, md1));
-							}
-						}
-					}
-				}
-			}
-		}
-		return reactionsHash;
-	}
-
-	@Override
-	public Set<DataMining> parseData(DataMiningSet dataMiningSet, Collection<Element> nodes, Set<Reaction> reactions, IProgressUpdater secondPartUpdater)
-			throws InvalidDataMiningInputFile {
-		String name = dataMiningSet.getName();
-		String warningPrefix = "[Data mining, " + name + "] ";
-		return parseData(nodes, reactions, new ByteArrayInputStream(dataMiningSet.getInputData()), warningPrefix);
-	}
-
-	@Override
-	public byte[] getInputDataForLayout(DataMiningSetView dms) {
-		DataMiningSet dataMinigSet = dataMinigSetDao.getById(dms.getIdObject());
-		if (dataMinigSet == null) {
-			return null;
-		} else {
-			return dataMinigSet.getInputData();
-		}
-	}
-}
+package lcsb.mapviewer.services.impl;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
+import lcsb.mapviewer.annotation.services.annotators.BiocompendiumAnnotator;
+import lcsb.mapviewer.annotation.services.annotators.HgncAnnotator;
+import lcsb.mapviewer.common.IProgressUpdater;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.XmlParser;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.log.LogType;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.graph.DataMining;
+import lcsb.mapviewer.model.map.graph.DataMiningSet;
+import lcsb.mapviewer.model.map.graph.DataMiningType;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.ReactionNode;
+import lcsb.mapviewer.persist.DbUtils;
+import lcsb.mapviewer.persist.dao.map.graph.DataMiningDao;
+import lcsb.mapviewer.persist.dao.map.graph.DataMiningSetDao;
+import lcsb.mapviewer.services.interfaces.IDataMiningService;
+import lcsb.mapviewer.services.interfaces.ILogService;
+import lcsb.mapviewer.services.interfaces.ILogService.LogParams;
+import lcsb.mapviewer.services.utils.InvalidDataMiningInputFile;
+import lcsb.mapviewer.services.view.DataMiningSetView;
+
+/**
+ * Implementation of the service that manages data mining data.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+@Transactional(value = "txManager")
+public class DataMiningService extends XmlParser implements IDataMiningService {
+
+	/**
+	 * Name of the source column (element that misses connection) in the input
+	 * file containing information about data mining.
+	 */
+	private static final String		 SOURCE_COLUMN_NAME	= "Source";
+
+	/**
+	 * Name of the target column (connection that is missing) in the input file.
+	 */
+	private static final String		 TARGET_COLUMN_NAME	= "Target";
+
+	/**
+	 * Name of the description column in the input file.
+	 */
+	private static final String		 DESC_COLUMN_NAME		= "Description";
+
+	/**
+	 * Name of the column where references are kept in the input file.
+	 */
+	private static final String		 REF_COLUMN_NAME		= "References";
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger					 logger							= Logger.getLogger(DataMiningService.class);
+
+	/**
+	 * Data access object for data mining information.
+	 */
+	@Autowired
+	private DataMiningDao					 missingConnectionDao;
+
+	/**
+	 * Utils that help to manage the sessions in custom multithreaded
+	 * implementation.
+	 */
+	@Autowired
+	private DbUtils								 dbUtils;
+
+	/**
+	 * Data access object for {@link DataMiningSet} objects.
+	 */
+	@Autowired
+	private DataMiningSetDao			 dataMinigSetDao;
+
+	/**
+	 * Class used to work on {@link MiriamType#HGNC} annotations.
+	 */
+	@Autowired
+	private HgncAnnotator					 hgncAnnotator;
+
+	/**
+	 * Service that allows to log system messages.
+	 */
+	@Autowired
+	private ILogService						 logService;
+
+	/**
+	 * Service used for annotation of proteins (and finding annotation of
+	 * proteins).
+	 */
+	@Autowired
+	private BiocompendiumAnnotator annotationRestService;
+
+	@Override
+	public Collection<DataMining> getMissingConnections(SpeciesAlias alias) {
+		return getMissingConnections(alias.getSpecies());
+	}
+
+	@Override
+	public Collection<DataMining> getMissingConnections(Element species) {
+		return missingConnectionDao.getMissingConnectionForElement(species);
+	}
+
+	@Override
+	public void addMissingConnection(DataMining connection) {
+		missingConnectionDao.add(connection);
+		Element element = connection.getElement();
+		String id = element.getName() + " (" + element.getStringType() + ")";
+		String toString = "";
+		for (MiriamData md : connection.getSuggestedConnections()) {
+			toString += md.getResource() + ",";
+		}
+		LogParams params = new LogParams().type(LogType.ADD_MISSING_CONNECTION).description("Added connection: " + id + " " + toString).object(connection);
+		logService.log(params);
+	}
+
+	@Override
+	public void deleteMissingConnection(DataMining connection, String reason) {
+		missingConnectionDao.delete(connection);
+		Element element = connection.getElement();
+		String id = element.getName() + " (" + element.getStringType() + ")";
+		String toString = "";
+		for (MiriamData md : connection.getSuggestedConnections()) {
+			toString += md.getResource() + ",";
+		}
+		LogParams params = new LogParams().type(LogType.REMOVE_MISSING_CONNECTION).description("Connection removed: " + id + " " + toString).object(connection);
+		logService.log(params);
+	}
+
+	@Override
+	public void deleteMissingConnection(String connectionId, String reason) {
+		Integer id = Integer.parseInt(connectionId);
+		DataMining mc = missingConnectionDao.getById(id);
+		this.deleteMissingConnection(mc, reason);
+	}
+
+	@Override
+	public Collection<Element> getSpeciesWithMissingConnectionsByGeneName(Model model, String geneName) {
+		Set<Element> result = new HashSet<Element>();
+		if (geneName == null) {
+			return result;
+		}
+		for (Element element : model.getElements()) {
+			Collection<DataMining> set = missingConnectionDao.getMissingConnectionForElement(element);
+			for (DataMining dataMining : set) {
+				for (MiriamData md : dataMining.getSuggestedConnections()) {
+					if (md.getResource().equalsIgnoreCase(geneName)) {
+						result.add(element);
+					}
+				}
+			}
+		}
+		return result;
+	}
+
+	@Override
+	public void removeConnectionsForModel(Model model) {
+		removeConnectionsForModel(model.getModelData());
+
+	}
+
+	/**
+	 * @return the logService
+	 */
+	public ILogService getLogService() {
+		return logService;
+	}
+
+	/**
+	 * @param logService
+	 *          the logService to set
+	 */
+	public void setLogService(ILogService logService) {
+		this.logService = logService;
+	}
+
+	/**
+	 * @return the missingConnectionDao
+	 */
+	public DataMiningDao getMissingConnectionDao() {
+		return missingConnectionDao;
+	}
+
+	/**
+	 * @param missingConnectionDao
+	 *          the missingConnectionDao to set
+	 */
+	public void setMissingConnectionDao(DataMiningDao missingConnectionDao) {
+		this.missingConnectionDao = missingConnectionDao;
+	}
+
+	/**
+	 * Map that contains cached information if identifiers are hgnc valid names or
+	 * not.
+	 */
+	private Map<String, Boolean> isHgnc = new HashMap<String, Boolean>();
+
+	/**
+	 * Returns true if the parameter is valid hgnc identifier.
+	 * 
+	 * @param string
+	 *          name of supposed hgnc name
+	 * @return true if paraeter is valid hgnc identifier
+	 */
+	protected boolean isHgncName(String string) {
+		if (string == null) {
+			return false;
+		}
+		Boolean status = isHgnc.get(string);
+		if (status == null) {
+			try {
+				status = annotationRestService.validAnnotation(new MiriamData(MiriamType.HGNC_SYMBOL, string));
+			} catch (IOException e) {
+				logger.error(e);
+				status = false;
+			}
+			isHgnc.put(string, status);
+		}
+		return status;
+	}
+
+	@Override
+	public void removeConnectionsForModel(ModelData model) {
+		Collection<Element> nodes = model.getElements();
+
+		dbUtils.setAutoFlush(false);
+		for (Element node : nodes) {
+			Collection<DataMining> mcs = missingConnectionDao.getMissingConnectionForElement(node);
+			for (DataMining missingConnection : mcs) {
+				missingConnectionDao.delete(missingConnection);
+			}
+		}
+		dbUtils.setAutoFlush(true);
+		missingConnectionDao.flush();
+
+		dbUtils.setAutoFlush(false);
+		dbUtils.setAutoFlush(true);
+		missingConnectionDao.flush();
+	}
+
+	@Override
+	public Set<DataMining> parseData(String filename, DataMiningType type, Collection<Element> nodes, Set<Reaction> reactions, IProgressUpdater updater)
+			throws IOException, InvalidDataMiningInputFile {
+		InputStream is = new FileInputStream(filename);
+		String name = new File(filename).getName();
+		String warningPrefix = "[Data mining, " + name + "] ";
+
+		return parseData(nodes, reactions, is, warningPrefix);
+	}
+
+	/**
+	 * This method creates set of {@link DataMining} elements from input stream.
+	 * 
+	 * @param is
+	 *          {@link InputStream}
+	 * @param nodes
+	 *          nodes for which data mining connections shoul be generated
+	 * @param reactions
+	 *          list of already existing reactions in the model
+	 * @param warningPrefix
+	 *          prefix used in warnings
+	 * @return data mining connections for given data
+	 * @throws InvalidDataMiningInputFile
+	 *           thrown when the input file is invalid
+	 */
+	protected Set<DataMining> parseData(Collection<Element> nodes, Set<Reaction> reactions, InputStream is, String warningPrefix)
+			throws InvalidDataMiningInputFile {
+		Set<DataMining> result = new HashSet<DataMining>();
+		String content = null;
+		try {
+			content = inputStreamToString(is).replaceAll("[\r\n]+", "\n");
+		} catch (IOException e) {
+			throw new InvalidDataMiningInputFile(warningPrefix + " " + e.getMessage(), e);
+		}
+		String[] lines = content.split("\n");
+		int headerLine = -1;
+		for (int i = 0; i < lines.length; i++) {
+			if (!lines[i].startsWith("#") && !lines[i].isEmpty()) {
+				headerLine = i;
+				break;
+			}
+		}
+		if (headerLine < 0) {
+			throw new InvalidDataMiningInputFile(warningPrefix + " No header line found");
+		}
+		String[] columns = lines[headerLine].split("\t");
+		Integer sourceColumnId = null;
+		Integer targetColumnId = null;
+		Integer descColumnId = null;
+		Integer refColumnId = null;
+		for (int i = 0; i < columns.length; i++) {
+			String col = columns[i].trim();
+			if (SOURCE_COLUMN_NAME.equalsIgnoreCase(col)) {
+				sourceColumnId = i;
+			} else if (TARGET_COLUMN_NAME.equalsIgnoreCase(col)) {
+				targetColumnId = i;
+			} else if (DESC_COLUMN_NAME.equalsIgnoreCase(col)) {
+				descColumnId = i;
+			} else if (REF_COLUMN_NAME.equalsIgnoreCase(col)) {
+				refColumnId = i;
+			} else {
+				logger.debug(headerLine + ": \"" + lines[headerLine] + "\"");
+				throw new InvalidDataMiningInputFile(warningPrefix + " Unknown column name: \"" + col + "\". Only " //
+						+ "\"" + SOURCE_COLUMN_NAME + "\", " //
+						+ "\"" + TARGET_COLUMN_NAME + "\", " //
+						+ "\"" + DESC_COLUMN_NAME + "\", " //
+						+ "\"" + REF_COLUMN_NAME + "\" " //
+						+ " are available.");
+			}
+		}
+		if (sourceColumnId == null) {
+			throw new InvalidDataMiningInputFile(warningPrefix + " Column \"" + SOURCE_COLUMN_NAME + "\" wasn't found in the input file.");
+		}
+
+		if (targetColumnId == null) {
+			throw new InvalidDataMiningInputFile(warningPrefix + " Column \"" + TARGET_COLUMN_NAME + "\" wasn't found in the input file.");
+		}
+		Map<MiriamData, List<Element>> map = new HashMap<MiriamData, List<Element>>();
+		for (Element element : nodes) {
+			for (MiriamData md : element.getMiriamData()) {
+				List<Element> elList = map.get(md);
+				if (elList == null) {
+					elList = new ArrayList<Element>();
+					map.put(md, elList);
+				}
+				elList.add(element);
+			}
+		}
+		Set<Pair<MiriamData, MiriamData>> reactionsHash = createReactionHashMap(reactions);
+
+		for (int i = headerLine + 1; i < lines.length; i++) {
+			String[] tmp = lines[i].split("\t", -1);
+			if (tmp.length != columns.length) {
+				String warning = warningPrefix + "Row " + i + " contains invalid number of columns. Skipping... (row content: " + lines[i] + ") ";
+				logger.warn(warning);
+				continue;
+			}
+			String id1 = tmp[sourceColumnId];
+			String id2 = tmp[targetColumnId];
+			MiriamData md1 = parseIdentifier(id1, warningPrefix);
+			MiriamData md2 = parseIdentifier(id2, warningPrefix);
+			String description = null;
+			if (descColumnId != null) {
+				description = tmp[descColumnId].trim();
+			} else {
+				MiriamData hgncSymbol = null;
+				try {
+					if (md2.getDataType().equals(MiriamType.HGNC_SYMBOL)) {
+						hgncSymbol = md2;
+					} else if (md2.getDataType().equals(MiriamType.HGNC)) {
+						hgncSymbol = hgncAnnotator.hgncIdToHgncName(md2);
+					}
+				} catch (AnnotatorException e) {
+					logger.warn(warningPrefix + " Problem with transfomring identifier to " + MiriamType.HGNC_SYMBOL.getCommonName() + ". Identifier: " + md2, e);
+				}
+				if (hgncSymbol != null) {
+					description = hgncSymbol.getResource();
+				}
+			}
+			List<MiriamData> ref = new ArrayList<MiriamData>();
+			if (refColumnId != null) {
+				ref.addAll(createReferences(warningPrefix, tmp[refColumnId]));
+			}
+			if (md1 != null && md2 != null) {
+				boolean exists = false;
+				if (md1.compareTo(md2) < 0) {
+					exists = reactionsHash.contains(new Pair<MiriamData, MiriamData>(md1, md2));
+				} else {
+					exists = reactionsHash.contains(new Pair<MiriamData, MiriamData>(md2, md1));
+				}
+				if (!exists) {
+					List<Element> listEl = map.get(md1);
+					if (listEl != null) {
+						for (Element el : listEl) {
+							DataMining dm = new DataMining();
+							dm.setElement(el);
+							dm.setDescription(description);
+							dm.addReferences(copyList(ref));
+							dm.addSuggestedConnection(new MiriamData(md2));
+							dm.setType(DataMiningType.UNKNOWN);
+							result.add(dm);
+						}
+					} else {
+						logger.warn(warningPrefix + " Element with identifier \"" + md1.getDataType().getCommonName() + ": " + md1.getResource() + "\" doesn't exist");
+					}
+				}
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Creates list of references from string with comma separated identifiers.
+	 * 
+	 * @param warningPrefix
+	 *          prefix used for warnings
+	 * @param refString
+	 *          strign with comma separated pubmed identifiers
+	 * @return list of references from string with comma separated identifiers
+	 */
+	public List<MiriamData> createReferences(String warningPrefix, String refString) {
+		List<MiriamData> ref = new ArrayList<>();
+		for (String string : refString.split(",")) {
+			if (!string.isEmpty()) {
+				String id = string.replaceAll("urn:miriam:pubmed:", "").trim();
+				if (NumberUtils.isDigits(id)) {
+					ref.add(new MiriamData(MiriamType.PUBMED, id.trim()));
+				} else {
+					logger.warn(warningPrefix + "Invalid pubmed identifier: \"" + string);
+				}
+			}
+		}
+		return ref;
+	}
+
+	/**
+	 * Creates list with copies of the {@link MiriamData} objects.
+	 * 
+	 * @param ref
+	 *          list to copy
+	 * @return list with copies of the {@link MiriamData} objects
+	 */
+	private List<MiriamData> copyList(List<MiriamData> ref) {
+		List<MiriamData> result = new ArrayList<>();
+		for (MiriamData miriamData : ref) {
+			result.add(new MiriamData(miriamData));
+		}
+		return result;
+	}
+
+	/**
+	 * Parses string identifiers and returns {@link MiriamData} object with
+	 * information from the identifier.
+	 * 
+	 * @param identifier
+	 *          identfier to be parsed
+	 * @param warningPrefix
+	 *          prefix that should be added when reporting warning
+	 * @return {@link MiriamData} object obtained from identifier
+	 */
+	protected MiriamData parseIdentifier(String identifier, String warningPrefix) {
+		MiriamData md1 = null;
+		try {
+			md1 = MiriamType.getMiriamDataFromIdentifier(identifier.trim());
+		} catch (InvalidArgumentException e) {
+			try {
+				md1 = MiriamType.getMiriamByUri(identifier.trim());
+			} catch (InvalidArgumentException e1) {
+				logger.warn(warningPrefix + "Invalid identifier: " + identifier.trim());
+			}
+		}
+		return md1;
+	}
+
+	/**
+	 * Creates a set of pairs ( {@link MiriamData}, {@link MiriamData} )
+	 * containing information about all connection in the reactions.
+	 * 
+	 * @param reactions
+	 *          input reactions.
+	 * @return set of pairs ( {@link MiriamData}, {@link MiriamData} ) containing
+	 *         information about all connection in the input reactions
+	 */
+	protected Set<Pair<MiriamData, MiriamData>> createReactionHashMap(Set<Reaction> reactions) {
+		Set<Pair<MiriamData, MiriamData>> reactionsHash = new HashSet<Pair<MiriamData, MiriamData>>();
+		for (Reaction reaction : reactions) {
+			List<ReactionNode> rNodes = reaction.getReactionNodes();
+			for (int i = 0; i < rNodes.size(); i++) {
+				for (int j = i + 1; j < rNodes.size(); j++) {
+					for (MiriamData md1 : rNodes.get(i).getElement().getMiriamData()) {
+						for (MiriamData md2 : rNodes.get(j).getElement().getMiriamData()) {
+							if (md1.compareTo(md2) < 0) {
+								reactionsHash.add(new Pair<MiriamData, MiriamData>(md1, md2));
+							} else {
+								reactionsHash.add(new Pair<MiriamData, MiriamData>(md2, md1));
+							}
+						}
+					}
+				}
+			}
+		}
+		return reactionsHash;
+	}
+
+	@Override
+	public Set<DataMining> parseData(DataMiningSet dataMiningSet, Collection<Element> nodes, Set<Reaction> reactions, IProgressUpdater secondPartUpdater)
+			throws InvalidDataMiningInputFile {
+		String name = dataMiningSet.getName();
+		String warningPrefix = "[Data mining, " + name + "] ";
+		return parseData(nodes, reactions, new ByteArrayInputStream(dataMiningSet.getInputData()), warningPrefix);
+	}
+
+	@Override
+	public byte[] getInputDataForLayout(DataMiningSetView dms) {
+		DataMiningSet dataMinigSet = dataMinigSetDao.getById(dms.getIdObject());
+		if (dataMinigSet == null) {
+			return null;
+		} else {
+			return dataMinigSet.getInputData();
+		}
+	}
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/impl/ExporterService.java b/service/src/main/java/lcsb/mapviewer/services/impl/ExporterService.java
index bac6a34b47..f8fda6c140 100644
--- a/service/src/main/java/lcsb/mapviewer/services/impl/ExporterService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/impl/ExporterService.java
@@ -1,1111 +1,1111 @@
-package lcsb.mapviewer.services.impl;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.converter.model.celldesigner.reaction.ReactionLineData;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.reaction.Modifier;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.ReactionNode;
-import lcsb.mapviewer.model.map.species.AntisenseRna;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Degraded;
-import lcsb.mapviewer.model.map.species.Drug;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.Ion;
-import lcsb.mapviewer.model.map.species.Phenotype;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.Unknown;
-import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
-import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
-import lcsb.mapviewer.model.map.species.fields.RnaRegion;
-import lcsb.mapviewer.services.interfaces.IExporterService;
-import lcsb.mapviewer.services.utils.data.ExportColumn;
-import lcsb.mapviewer.services.utils.data.ExportFileType;
-import lcsb.mapviewer.services.view.PubmedAnnotatedElementsView;
-import lcsb.mapviewer.services.view.PubmedAnnotatedElementsViewFactory;
-
-/**
- * Implementation of {@link IExporterService} interface that allows to export
- * {@link Model}.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ExporterService implements IExporterService {
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger																					 logger											= Logger.getLogger(ExporterService.class);
-
-	/**
-	 * List of publications by {@link Model#getId() model id}. This is used for
-	 * caching, as obtaining this list on runtime is quite expensive.
-	 */
-	private static Map<Integer, List<PubmedAnnotatedElementsView>> pubmedPublicationsForModel	= new HashMap<>();
-
-	/**
-	 * Factory used to create {@link PubmedAnnotatedElementsView publication
-	 * summary} elements.
-	 */
-	@Autowired
-	private PubmedAnnotatedElementsViewFactory										 pubmedAnnotatedElementsViewFactory;
-
-	@Override
-	public void exportSpecies(ExporterParameters parameters) throws IOException {
-		String content = getExportSpeciesString(parameters);
-		writeToFile(content, parameters.getFileName());
-	}
-
-	@Override
-	public String getExportSpeciesString(ExporterParameters parameters) {
-		Set<String> uniqeLines = new HashSet<String>();
-		StringBuilder builder = new StringBuilder();
-		for (ExportColumn column : parameters.getColumns()) {
-			builder.append(column.getTitle() + "\t");
-		}
-		builder.append("\n");
-		for (Model model : parameters.getModels()) {
-			for (Alias alias : model.getAliases()) {
-				if (alias instanceof SpeciesAlias) {
-					SpeciesAlias speciesAlias = (SpeciesAlias) alias;
-					boolean toBeProcessed = false;
-					// check type
-					for (Class<?> type : parameters.getTypes()) {
-						if (type.isAssignableFrom(speciesAlias.getSpecies().getClass())) {
-							toBeProcessed = true;
-							break;
-						}
-					}
-					if (!toBeProcessed && parameters.getTypes().size() > 0) {
-						continue;
-					}
-
-					// check where it lays
-					toBeProcessed = (parameters.getIncludedAliases().size() == 0);
-					for (CompartmentAlias ca : parameters.getIncludedAliases()) {
-						if (ca.cross(alias)) {
-							toBeProcessed = true;
-						}
-					}
-					for (CompartmentAlias ca : parameters.getExcludedAliases()) {
-						if (ca.cross(alias)) {
-							toBeProcessed = false;
-						}
-					}
-					if (toBeProcessed) {
-						List<String> elements = getExportStringForOneSpecies(speciesAlias, parameters);
-						for (String string : elements) {
-							uniqeLines.add(string);
-						}
-					}
-				}
-			}
-		}
-		List<String> sortedElements = new ArrayList<String>();
-		sortedElements.addAll(uniqeLines);
-		Collections.sort(sortedElements);
-		for (String string : sortedElements) {
-			builder.append(string);
-			builder.append("\n");
-		}
-		return builder.toString();
-	}
-
-	/**
-	 * Returns strings with species alias exported using given parameters. Many
-	 * lines can be exported because one species alias can belong to many
-	 * pathways.
-	 * 
-	 * @param parameters
-	 *          {@link ExporterParameters export parameters}
-	 * @param speciesAlias
-	 *          export string are generated for this alias
-	 * @return list of strings representing exported data
-	 */
-	protected List<String> getExportStringForOneSpecies(SpeciesAlias speciesAlias, ExporterParameters parameters) {
-		if (parameters.getFileType() != ExportFileType.TAB_SEPARATED) {
-			throw new InvalidArgumentException("Unhandled file type: " + parameters.getFileType());
-		}
-		Species species = speciesAlias.getSpecies();
-
-		// for (ExportColumn column : parameters.getColumns()) {
-		// if (column == ExportColumn.FULL) {
-		// List<String> list = new ArrayList<String>();
-		// list.add(getExportSingleSpecies(speciesAlias, parameters));
-		// return list;
-		// }
-		// }
-
-		List<CompartmentAlias> aliases = getComponentList(speciesAlias);
-		List<String> result = new ArrayList<String>();
-
-		CompartmentAlias smallestAlias = getCompartment(speciesAlias);
-
-		List<ExportColumn> processedColumns = new ArrayList<ExportColumn>();
-		for (ExportColumn column : parameters.getColumns()) {
-			if (column.getClazz().isAssignableFrom(Species.class)) {
-				processedColumns.add(column);
-			}
-		}
-
-		for (CompartmentAlias alias : aliases) {
-			String separator = "";
-			StringBuilder line = new StringBuilder();
-			for (ExportColumn column : processedColumns) {
-				line.append(separator);
-				separator = "\t";
-				if (column == ExportColumn.COMPARTMENT_NAME) {
-					if (smallestAlias == null) {
-						line.append("null");
-					} else {
-						line.append(smallestAlias.getTitle());
-					}
-				} else if (column == ExportColumn.POSITION_TO_COMPARTMENT) {
-					line.append(species.getPositionToCompartment());
-				} else if (column == ExportColumn.COMPONENT_NAME) {
-					line.append(alias.getTitle());
-				} else if (column == ExportColumn.NAME) {
-					if (speciesAlias instanceof ComplexAlias) {
-						if (!parameters.isComplexElementsName()) {
-							line.append(species.getName());
-						} else {
-							line.append(getComplexNameWithElements((ComplexSpecies) species, parameters));
-						}
-					} else {
-						line.append(species.getName());
-					}
-				} else if (column == ExportColumn.ID) {
-					line.append(getId(speciesAlias));
-				} else if (column == ExportColumn.TYPE) {
-					line.append(species.getClass().getSimpleName());
-				} else if (column == ExportColumn.SUBMODEL) {
-					line.append(species.getModelData().getName());
-				} else if (column == ExportColumn.COMPLEX) {
-					String complex = null;
-					if (species.getComplex() != null) {
-						complex = species.getComplex().getName();
-
-						complex += " [id=" + getId(speciesAlias.getComplexAlias()) + "]";
-					}
-					line.append(complex);
-				} else {
-					throw new InvalidArgumentException("Unhandled column type: " + column);
-				}
-			}
-			for (MiriamType mt : parameters.getMiriamTypes()) {
-				line.append(separator);
-				String types = "";
-				for (MiriamData md : species.getMiriamData()) {
-					if (md.getDataType().equals(mt)) {
-						if (!types.isEmpty()) {
-							types += ",";
-						}
-						types += md.getResource();
-					}
-				}
-				if (types.equals("")) {
-					line.append(mt.toString() + ": N/A");
-				} else {
-					line.append(mt.toString() + ": " + types);
-				}
-			}
-			result.add(line.toString().replaceAll("[\n\r]+", " "));
-		}
-		return result;
-	}
-
-	/**
-	 * Returns {@link CompartmentAlias} to which element belongs to.
-	 * 
-	 * @param element
-	 *          alias of the element
-	 * @return {@link CompartmentAlias} to which element belongs to
-	 */
-	private CompartmentAlias getCompartment(SpeciesAlias element) {
-		CompartmentAlias smallestAlias = null;
-		List<CompartmentAlias> compartmentAliases = new ArrayList<CompartmentAlias>();
-
-		for (CompartmentAlias alias : element.getModel().getCompartmentsAliases()) {
-			if (alias.cross(element)) {
-				if (!(alias instanceof ArtifitialCompartmentAlias)) {
-					compartmentAliases.add(alias);
-				}
-			}
-		}
-
-		if (compartmentAliases.size() > 0) {
-			smallestAlias = compartmentAliases.get(0);
-		}
-		for (CompartmentAlias compartmentAlias : compartmentAliases) {
-			if (compartmentAlias.getSize() < smallestAlias.getSize()) {
-				smallestAlias = compartmentAlias;
-			}
-		}
-		return smallestAlias;
-	}
-
-	/**
-	 * Returns a list of pathways to which element belongs to.
-	 * 
-	 * @param element
-	 *          alias of the element
-	 * @return list of {@link CompartmentAlias} representing pathways
-	 */
-	private List<CompartmentAlias> getComponentList(SpeciesAlias element) {
-		Model model = element.getModel();
-
-		List<CompartmentAlias> aliases = new ArrayList<CompartmentAlias>();
-		for (CompartmentAlias alias : model.getCompartmentsAliases()) {
-			if (alias instanceof ArtifitialCompartmentAlias) {
-				if (alias.cross(element)) {
-					aliases.add(alias);
-				}
-			}
-		}
-
-		// in case the element is outside any component then we have to crate
-		// artifical null component
-		if (aliases.size() == 0) {
-			ArtifitialCompartmentAlias nullAlias = new ArtifitialCompartmentAlias();
-			nullAlias.setTitle("null");
-			aliases.add(nullAlias);
-		}
-
-		return aliases;
-	}
-
-	/**
-	 * Returns name of a complex with the names of all species included in this
-	 * complex.
-	 * 
-	 * @param species
-	 *          complex for which name is computed
-	 * @param parameters
-	 *          parameter limits the species that will be included in generated
-	 *          name
-	 * @return name of a complex with the names of all species included in this
-	 *         complex
-	 */
-	private String getComplexNameWithElements(ComplexSpecies species, ExporterParameters parameters) {
-		StringBuilder result = new StringBuilder();
-		String separator = "";
-		ComplexSpecies complex = (ComplexSpecies) species;
-		for (Species species2 : complex.getAllSimpleChildren()) {
-			boolean add = false;
-			if (parameters.getTypes().size() == 0) {
-				add = true;
-			}
-			for (Class<?> class1 : parameters.getTypes()) {
-				if (class1.isAssignableFrom(species2.getClass())) {
-					add = true;
-				}
-			}
-			if (add) {
-				result.append(separator);
-				result.append(species2.getName());
-				separator = ":";
-			}
-
-		}
-		if (result.length() == 0) {
-			return species.getName();
-		} else {
-			return result.toString();
-		}
-	}
-
-	/**
-	 * Writes content into a file.
-	 * 
-	 * @param content
-	 *          content that should be written into the file.
-	 * @param fileName
-	 *          file name
-	 * @throws IOException
-	 *           thrown when there is a problem with accessing file
-	 */
-	protected void writeToFile(String content, String fileName) throws IOException {
-		logger.debug("Save file: " + fileName);
-		File file = new File(fileName);
-
-		// if file doesnt exists, then create it
-		if (!file.exists()) {
-			// first create directory structure
-			file.getParentFile().mkdirs();
-			file.createNewFile();
-		}
-
-		FileWriter fw = new FileWriter(file.getAbsoluteFile());
-		BufferedWriter bw = new BufferedWriter(fw);
-		bw.write(content);
-		bw.close();
-	}
-
-	@Override
-	public String getExportInteractionString(ExporterParameters parameters) {
-		Set<String> uniqueLines = new HashSet<String>();
-		if (parameters.getFileType() != ExportFileType.SIF && parameters.getFileType() != ExportFileType.TAB_SEPARATED) {
-			throw new InvalidArgumentException("Unsupported file format: " + parameters.getFileType());
-		}
-
-		for (Model model : parameters.getModels()) {
-			for (Reaction reaction : model.getReactions()) {
-				int counter = 0;
-				for (ReactionNode node : reaction.getReactionNodes()) {
-					Element element = node.getElement();
-					for (Class<?> type : parameters.getTypes()) {
-						if (type.isAssignableFrom(element.getClass())) {
-							counter++;
-							break;
-						}
-					}
-				}
-				if (counter > 1) {
-					uniqueLines.addAll(getExportSingleInteractionString(reaction, parameters));
-				}
-			}
-		}
-		if (parameters.isMoleculeEdges()) {
-			for (Model model : parameters.getModels()) {
-				for (Alias element : model.getAliases()) {
-					if (element instanceof SpeciesAlias) {
-						Species species = ((SpeciesAlias) element).getSpecies();
-						if (species instanceof SimpleMolecule) {
-							boolean ok = false;
-							for (CompartmentAlias alias : parameters.getIncludedAliases()) {
-								if (alias.cross(element)) {
-									ok = true;
-								}
-							}
-							for (CompartmentAlias alias : parameters.getExcludedAliases()) {
-								if (alias.cross(element)) {
-									ok = false;
-								}
-							}
-							if (ok) {
-								String string = getExportSingleInteractionStringFromSpecies((SimpleMolecule) species, parameters);
-								if (parameters.getFileType() == ExportFileType.SIF) {
-									if (!uniqueLines.contains(string.replace("molecule_type", "reaction_type"))) {
-										uniqueLines.add(string);
-									}
-								} else {
-									uniqueLines.add(string);
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-		List<String> sortedLines = new ArrayList<String>();
-		sortedLines.addAll(uniqueLines);
-		Collections.sort(sortedLines);
-		StringBuilder result = new StringBuilder();
-		for (String string : sortedLines) {
-			if (!string.equals("")) {
-				result.append(string);
-				result.append("\n");
-			}
-		}
-
-		return result.toString();
-	}
-
-	/**
-	 * Creates interaction from molecule (molecule is used as extension of
-	 * reaction between different types of elements).
-	 * 
-	 * @param species
-	 *          molecule which is treaded as a reaction element
-	 * @param parameters
-	 *          {@link ExporterParameters export parameters}
-	 * @return string representing exported reaction
-	 */
-	protected String getExportSingleInteractionStringFromSpecies(SimpleMolecule species, ExporterParameters parameters) {
-		if (parameters.getFileType() != ExportFileType.SIF) {
-			throw new InvalidArgumentException("Unsupported file format: " + parameters.getFileType());
-		}
-		StringBuilder result = new StringBuilder();
-		Set<String> elements = new HashSet<String>();
-		for (Model model : parameters.getModels()) {
-			for (Reaction reaction : model.getReactions()) {
-				boolean goodReaction = false;
-				for (ReactionNode node : reaction.getReactionNodes()) {
-					if (node.getElement() instanceof SimpleMolecule) {
-						Species species2 = (Species) node.getElement();
-						if (species.getName().equalsIgnoreCase(species2.getName())) {
-							goodReaction = true;
-						}
-					}
-				}
-				if (!goodReaction) {
-					continue;
-				}
-				for (ReactionNode node : reaction.getReactionNodes()) {
-					boolean ok = false;
-					if (parameters.getIncludedAliases().size() == 0) {
-						ok = true;
-					}
-					for (CompartmentAlias alias2 : parameters.getIncludedAliases()) {
-						if (alias2.cross(node.getAlias())) {
-							ok = true;
-							break;
-						}
-					}
-					for (CompartmentAlias alias2 : parameters.getExcludedAliases()) {
-						if (alias2.cross(node.getAlias())) {
-							ok = false;
-							break;
-						}
-					}
-					if (ok) {
-						Element element = node.getElement();
-						for (Class<?> type : parameters.getTypes()) {
-							if (type.isAssignableFrom(element.getClass())) {
-								if (element instanceof ComplexSpecies) {
-									if (!parameters.isComplexElementsName()) {
-										elements.add(((Species) element).getName());
-									} else {
-										String name = getComplexNameWithElements((ComplexSpecies) element, parameters);
-										elements.add(name);
-									}
-								} else {
-									elements.add(((Species) element).getName());
-								}
-								break;
-							}
-						}
-					}
-				}
-			}
-		}
-		if (elements.size() <= 1) {
-			return "";
-		}
-		List<String> list = new ArrayList<String>();
-		list.addAll(elements);
-		result.append(list.get(0));
-		result.append("\tmolecule_type");
-		for (int i = 1; i < list.size(); i++) {
-			result.append("\t");
-			result.append(list.get(i));
-		}
-		return result.toString();
-
-	}
-
-	/**
-	 * Returns strings with reactions exported using given parameters. Many lines
-	 * can be exported because one species alias can belong to many pathways.
-	 * 
-	 * @param parameters
-	 *          {@link ExporterParameters export parameters}
-	 * @param reaction
-	 *          export string are generated for this reaction
-	 * @return list of strings representing exported data
-	 */
-	protected List<String> getExportSingleInteractionString(Reaction reaction, ExporterParameters parameters) {
-		List<String> result = new ArrayList<String>();
-		if (parameters.getFileType() == ExportFileType.SIF) {
-			StringBuilder builder = new StringBuilder();
-			Set<Element> elements = new HashSet<Element>();
-			for (ReactionNode node : reaction.getReactionNodes()) {
-				boolean ok = false;
-				if (parameters.getIncludedAliases().size() == 0) {
-					ok = true;
-				}
-				for (CompartmentAlias alias2 : parameters.getIncludedAliases()) {
-					if (alias2.cross(node.getAlias())) {
-						ok = true;
-						break;
-					}
-				}
-				for (CompartmentAlias alias2 : parameters.getExcludedAliases()) {
-					if (alias2.cross(node.getAlias())) {
-						ok = false;
-						break;
-					}
-				}
-				if (ok) {
-					Element element = node.getElement();
-					if (parameters.getTypes().size() == 0) {
-						elements.add(element);
-					} else {
-						for (Class<?> type : parameters.getTypes()) {
-							if (type.isAssignableFrom(element.getClass())) {
-								elements.add(element);
-								break;
-							}
-						}
-					}
-				}
-			}
-			Set<String> elementsNames = new HashSet<String>();
-			for (Element element : elements) {
-				if (element instanceof ComplexSpecies) {
-					if (!parameters.isComplexElementsName()) {
-						elementsNames.add(((Species) element).getName());
-					} else {
-						String name = getComplexNameWithElements((ComplexSpecies) element, parameters);
-						elementsNames.add(name);
-					}
-
-				} else {
-					elementsNames.add(((Species) element).getName());
-				}
-			}
-
-			if (elementsNames.size() <= 1) {
-				return result;
-			}
-			List<String> list = new ArrayList<String>();
-			list.addAll(elementsNames);
-			builder.append(list.get(0));
-			builder.append("\treaction_type");
-			for (int i = 1; i < list.size(); i++) {
-				builder.append("\t");
-				builder.append(list.get(i));
-			}
-			result.add(builder.toString());
-		} else if (parameters.getFileType() == ExportFileType.TAB_SEPARATED) {
-			if (parameters.getColumns() == null || parameters.getColumns().size() == 0) {
-				result.add(getOldFormatString(reaction, parameters));
-			} else {
-				result.addAll(getNewFormatString(reaction, parameters));
-			}
-		} else {
-			throw new InvalidArgumentException("Unsupported file format: " + parameters.getFileType());
-		}
-		return result;
-	}
-
-	/**
-	 * Creates tab separated string for reaction in old format...
-	 * 
-	 * @param reaction
-	 *          reaction to transform
-	 * @param parameters
-	 *          {@link ExporterParameters export parameters}
-	 * @return export string representation of the reaction
-	 */
-	private String getOldFormatString(Reaction reaction, ExporterParameters parameters) {
-		StringBuilder result = new StringBuilder();
-		result.append(reaction.getIdReaction());
-		result.append("\t");
-		result.append(ReactionLineData.getByReactionType(reaction.getClass()));
-		result.append("\t");
-		result.append("reversible=" + reaction.isReversible());
-		result.append("\t");
-		result.append("kineticLaw=" + reaction.isKineticLaw());
-		result.append("\t");
-		if (reaction.getMiriamData().size() > 0) {
-			result.append("REACTION_MIRIAM_DATA");
-			result.append("\t");
-			for (MiriamData md : reaction.getMiriamData()) {
-				result.append("data_type=" + md.getDataType().getUris().get(0));
-				result.append("\t");
-				result.append("relation_type=" + md.getRelationType().getStringRepresentation());
-				result.append("\t");
-				result.append("resource=" + md.getResource());
-				result.append("\t");
-			}
-		}
-		for (Reactant reactant : reaction.getReactants()) {
-			result.append("REACTANT");
-			result.append("\t");
-			result.append(getExportSingleSpecies((SpeciesAlias) reactant.getAlias(), parameters));
-			result.append("\t");
-		}
-		for (Product product : reaction.getProducts()) {
-			result.append("PRODUCT");
-			result.append("\t");
-			result.append(getExportSingleSpecies((SpeciesAlias) product.getAlias(), parameters));
-			result.append("\t");
-		}
-		for (Modifier modifier : reaction.getModifiers()) {
-			result.append("MODIFIER");
-			result.append("\t");
-			result.append("type=" + modifier.getClass().getSimpleName());
-			result.append("\t");
-			result.append(getExportSingleSpecies((SpeciesAlias) modifier.getAlias(), parameters));
-			result.append("\t");
-		}
-		return result.toString();
-	}
-
-	/**
-	 * Creates tab separated string for reaction in new format...
-	 * 
-	 * @param reaction
-	 *          reaction to transform
-	 * @param parameters
-	 *          {@link ExporterParameters export parameters}
-	 * @return export string representation of the reaction
-	 */
-	private List<String> getNewFormatString(Reaction reaction, ExporterParameters parameters) {
-		List<String> result = new ArrayList<String>();
-		StringBuilder builder = new StringBuilder();
-		boolean splitReaction = false;
-		for (ExportColumn column : parameters.getColumns()) {
-			if (column.getClazz().isAssignableFrom(Reaction.class)) {
-				if (column.equals(ExportColumn.REACTION_ID)) {
-					builder.append(reaction.getIdReaction());
-				} else if (column.equals(ExportColumn.REACTION_REVERSIBLE)) {
-					builder.append(reaction.isReversible());
-				} else if (column.equals(ExportColumn.REACTION_TYPE)) {
-					builder.append(ReactionLineData.getByReactionType(reaction.getClass()));
-				} else if (column.equals(ExportColumn.REACTION_TWO_ELEMENT)) {
-					splitReaction = true;
-					continue;
-				} else {
-					throw new InvalidArgumentException("Unknown column type: " + column);
-				}
-			}
-			builder.append("\t");
-		}
-		for (MiriamType mt : parameters.getMiriamTypes()) {
-			String types = "";
-			for (MiriamData md : reaction.getMiriamData()) {
-				if (md.getDataType().equals(mt)) {
-					if (!types.isEmpty()) {
-						types += ",";
-					}
-					types += md.getResource();
-				}
-			}
-			if (types.equals("")) {
-				builder.append(mt.toString() + ": N/A");
-			} else {
-				builder.append(mt.toString() + ": " + types);
-			}
-			builder.append("\t");
-		}
-
-		int counter = 0;
-
-		if (splitReaction) {
-			String base = builder.toString();
-			Set<Alias> inputs = new HashSet<Alias>();
-			Set<Alias> outputs = new HashSet<Alias>();
-			for (Reactant reactant : reaction.getReactants()) {
-				if (!isAssignable(parameters, reactant.getElement())) {
-					continue;
-				}
-				if (reactant.getAlias() instanceof ComplexAlias) {
-					inputs.addAll(((ComplexAlias) (reactant.getAlias())).getAllChildrenAliases());
-				} else {
-					inputs.add(reactant.getAlias());
-				}
-			}
-			for (Product product : reaction.getProducts()) {
-				if (!isAssignable(parameters, product.getElement())) {
-					continue;
-				}
-				if (product.getElement() instanceof ComplexSpecies) {
-					outputs.addAll(((ComplexAlias) (product.getAlias())).getAllChildrenAliases());
-				} else {
-					outputs.add(product.getAlias());
-				}
-			}
-			for (Modifier modifier : reaction.getModifiers()) {
-				if (!isAssignable(parameters, modifier.getElement())) {
-					continue;
-				}
-				if (modifier.getElement() instanceof ComplexSpecies) {
-					inputs.addAll(((ComplexAlias) (modifier.getAlias())).getAllChildrenAliases());
-				} else {
-					inputs.add(modifier.getAlias());
-				}
-			}
-			for (Alias input : inputs) {
-				if (!isAssignable(parameters, input.getElement())) {
-					continue;
-				}
-				for (Alias output : outputs) {
-					if (!isAssignable(parameters, output.getElement())) {
-						continue;
-					}
-					String line = base + "\t" + getId(input) + "\t" + getId(output);
-					result.add(line);
-				}
-			}
-		} else {
-
-			for (Reactant reactant : reaction.getReactants()) {
-				if (!isAssignable(parameters, reactant.getElement())) {
-					continue;
-				}
-				counter++;
-
-				builder.append("REACTANT");
-				builder.append("\t");
-				builder.append(getId(reactant.getAlias()));
-				builder.append("\t");
-			}
-			for (Product product : reaction.getProducts()) {
-				if (!isAssignable(parameters, product.getElement())) {
-					continue;
-				}
-				counter++;
-
-				builder.append("PRODUCT");
-				builder.append("\t");
-				builder.append(getId(product.getAlias()));
-				builder.append("\t");
-			}
-			for (Modifier modifier : reaction.getModifiers()) {
-				if (!isAssignable(parameters, modifier.getElement())) {
-					continue;
-				}
-				counter++;
-
-				builder.append("MODIFIER");
-				builder.append("\t");
-				builder.append(getId(modifier.getAlias()));
-				builder.append("\t");
-			}
-			if (counter > 1) {
-				result.add(builder.toString());
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Checks if element is acceptable by {@link ExporterParameters export
-	 * parameters}.
-	 * 
-	 * @param parameters
-	 *          {@link ExporterParameters export parameters}
-	 * @param element
-	 *          element to check
-	 * @return true if element can exist in export string, <code>false</code>
-	 *         otherwise
-	 */
-	private boolean isAssignable(ExporterParameters parameters, Element element) {
-		boolean ok = false;
-		for (Class<?> clazz : parameters.getTypes()) {
-			if (clazz.isAssignableFrom(element.getClass())) {
-				ok = true;
-			}
-		}
-		return ok;
-	}
-
-	/**
-	 * Creates tab separated string for species for full mode.
-	 * 
-	 * @param alias
-	 *          alias of the element to transform
-	 * @param parameters
-	 *          {@link ExporterParameters export parameters}
-	 * @return export string representation of the element
-	 */
-	private String getExportSingleSpecies(SpeciesAlias alias, ExporterParameters parameters) {
-		Element element = alias.getElement();
-		if (parameters.getFileType() != ExportFileType.TAB_SEPARATED) {
-			throw new InvalidArgumentException("Unsupported file format: " + parameters.getFileType());
-		}
-		StringBuilder sb = new StringBuilder();
-		Species species = (Species) element;
-		sb.append(element.getClass().getSimpleName() + "\t");
-		sb.append("id=" + getId(alias) + "\t");
-		sb.append("name=" + species.getName() + "\t");
-		sb.append("fullName=" + species.getFullName() + "\t");
-		sb.append("charge=" + species.getCharge() + "\t");
-		sb.append("initialAmount=" + species.getInitialAmount() + "\t");
-		sb.append("initialConcentration=" + species.getInitialConcentration() + "\t");
-		String compartment = null;
-		if (species.getParent() instanceof Compartment) {
-			compartment = ((Compartment) species.getParent()).getName();
-		}
-		sb.append("compartment=" + compartment);
-		sb.append("\t");
-		String complexId = null;
-		if (species.getComplex() != null) {
-			complexId = getId(alias.getComplexAlias());
-		}
-		sb.append("complex=" + complexId);
-		sb.append("\t");
-		sb.append("hasOnlySubstanceUnits=" + species.hasOnlySubstanceUnits());
-		sb.append("\t");
-		sb.append("positionToCompartment=" + species.getPositionToCompartment());
-		sb.append("\t");
-
-		if (species instanceof Protein) {
-			Protein protein = (Protein) species;
-			sb.append("dimer=" + protein.getHomodimer());
-			sb.append("\t");
-			sb.append("structuralState=" + protein.getStructuralState());
-			sb.append("\t");
-			sb.append("hypothetical=" + protein.isHypothetical());
-			sb.append("\t");
-			for (ModificationResidue mr : protein.getModificationResidues()) {
-				sb.append("MODIFICATION RESIDUE");
-				sb.append("\t");
-				sb.append("angle=" + mr.getAngle());
-				sb.append("\t");
-				sb.append("name=" + mr.getName());
-				if (mr.getState() != null) {
-					sb.append("\t");
-					sb.append("shortName=" + mr.getState().getAbbreviation());
-				}
-				sb.append("\t");
-				sb.append("side=" + mr.getSide());
-				sb.append("\t");
-				sb.append("size=" + mr.getSize());
-				sb.append("\t");
-				if (mr.getState() != null) {
-					sb.append("state=" + mr.getState().getFullName() + "\t");
-				}
-			}
-		} else if (species instanceof Gene) {
-			Gene gene = (Gene) species;
-			for (ModificationResidue mr : gene.getModificationResidues()) {
-				sb.append("MODIFICATION RESIDUE");
-				sb.append("\t");
-				sb.append("angle=" + mr.getAngle());
-				sb.append("\t");
-				sb.append("name=" + mr.getName());
-				sb.append("\t");
-				if (mr.getState() != null) {
-					sb.append("shortName=" + mr.getState().getAbbreviation() + "\t");
-				}
-				sb.append("side=" + mr.getSide());
-				sb.append("\t");
-				sb.append("size=" + mr.getSize());
-				sb.append("\t");
-				if (mr.getState() != null) {
-					sb.append("state=" + mr.getState().getFullName() + "\t");
-				}
-			}
-		} else if (species instanceof ComplexSpecies) {
-			ComplexSpecies complex = (ComplexSpecies) species;
-			sb.append("dimer=" + complex.getHomodimer());
-			sb.append("\t");
-			sb.append("hypothetical=" + complex.isHypothetical());
-			sb.append("\t");
-		} else if (species instanceof SimpleMolecule) {
-			SimpleMolecule molecule = (SimpleMolecule) species;
-			sb.append("dimer=" + molecule.getHomodimer());
-			sb.append("\t");
-		} else if (species instanceof Ion) {
-			sb.append("");
-		} else if (species instanceof Phenotype) {
-			sb.append("");
-		} else if (species instanceof Drug) {
-			sb.append("");
-
-		} else if (species instanceof Rna) {
-			Rna rna = (Rna) species;
-			for (RnaRegion region : rna.getRegions()) {
-				sb.append("RNA_REGION");
-				sb.append("\t");
-				sb.append("type=" + region.getType());
-				sb.append("\t");
-				if (region.getState() != null) {
-					sb.append("state=" + region.getState().getFullName() + "\t");
-				}
-				sb.append("\t");
-				sb.append("size=" + region.getSize());
-				sb.append("\t");
-				sb.append("pos=" + region.getPos());
-				sb.append("\t");
-			}
-		} else if (species instanceof AntisenseRna) {
-			AntisenseRna antisenseRna = (AntisenseRna) species;
-			for (AntisenseRnaRegion region : antisenseRna.getRegions()) {
-				sb.append("RNA_REGION" + "\t");
-				if (region.getType() != null) {
-					sb.append("type=" + region.getType().getName() + "\t");
-				}
-				sb.append("name=" + region.getName() + "\t");
-				sb.append("size=" + region.getSize() + "\t");
-				sb.append("pos=" + region.getPos() + "\t");
-			}
-		} else if (species instanceof Unknown) {
-			sb.append("");
-		} else if (species instanceof Degraded) {
-			sb.append("");
-		} else {
-			throw new InvalidArgumentException("Invalid class type: " + species.getClass());
-		}
-		if (species.getMiriamData().size() > 0) {
-			sb.append("MIRIAM_DATA");
-			sb.append("\t");
-			for (MiriamData md : species.getMiriamData()) {
-				sb.append("data_type=" + md.getDataType().getUris().get(0));
-				sb.append("\t");
-				sb.append("relation_type=" + md.getRelationType().getStringRepresentation());
-				sb.append("\t");
-				sb.append("resource=" + md.getResource());
-				sb.append("\t");
-			}
-		}
-		return sb.toString();
-	}
-
-	@Override
-	public void exportReactions(ExporterParameters parameters) throws IOException {
-		String content = getExportInteractionString(parameters);
-		writeToFile(content, parameters.getFileName());
-	}
-
-	@Override
-	public void exportCompartments(ExporterParameters parameters) throws IOException {
-		String content = getExportCompartmentsString(parameters);
-		writeToFile(content, parameters.getFileName());
-	}
-
-	@Override
-	public String getExportCompartmentsString(ExporterParameters parameters) {
-		Set<String> uniqeLines = new HashSet<String>();
-		StringBuilder builder = new StringBuilder();
-		for (Model model : parameters.getModels()) {
-			for (CompartmentAlias alias : model.getCompartmentsAliases()) {
-
-				// check where it lays
-				boolean toBeProcessed = (parameters.getIncludedAliases().size() == 0);
-				if (alias.getCompartment() == null) {
-					toBeProcessed = false;
-				}
-				for (CompartmentAlias ca : parameters.getIncludedAliases()) {
-					if (ca.cross(alias)) {
-						toBeProcessed = true;
-					}
-				}
-				for (CompartmentAlias ca : parameters.getExcludedAliases()) {
-					if (ca.cross(alias)) {
-						toBeProcessed = false;
-					}
-				}
-				if (toBeProcessed) {
-					List<String> elements = getExportStringForOneCompartment(alias, parameters);
-					for (String string : elements) {
-						uniqeLines.add(string);
-					}
-				}
-			}
-		}
-		List<String> sortedElements = new ArrayList<String>();
-		sortedElements.addAll(uniqeLines);
-		Collections.sort(sortedElements);
-		for (String string : sortedElements) {
-			builder.append(string);
-			builder.append("\n");
-		}
-		return builder.toString();
-	}
-
-	/**
-	 * Exports compartments into set of text lines defining a compartment.
-	 * 
-	 * @param compartmentAlias
-	 *          alias of the compartment to export
-	 * @param parameters
-	 *          parameters used in export
-	 * @return string srepresenting compartment in export format
-	 */
-	private List<String> getExportStringForOneCompartment(CompartmentAlias compartmentAlias, ExporterParameters parameters) {
-		Compartment compartment = compartmentAlias.getCompartment();
-		List<String> result = new ArrayList<String>();
-		if (parameters.getFileType() != ExportFileType.TAB_SEPARATED) {
-			throw new InvalidArgumentException("Unhandled file type: " + parameters.getFileType());
-		}
-		StringBuilder sb = new StringBuilder();
-		sb.append(getId(compartmentAlias) + "\t");
-		sb.append("name=" + compartment.getName() + "\t");
-		sb.append("fullname=" + compartment.getFullName() + "\t");
-		if (compartment.getMiriamData().size() > 0) {
-			sb.append("MIRIAM_DATA");
-			sb.append("\t");
-			for (MiriamData md : compartment.getMiriamData()) {
-				sb.append("data_type=" + md.getDataType().getUris().get(0));
-				sb.append("\t");
-				sb.append("relation_type=" + md.getRelationType().getStringRepresentation());
-				sb.append("\t");
-				sb.append("resource=" + md.getResource());
-				sb.append("\t");
-			}
-		}
-		result.add(sb.toString());
-		return result;
-	}
-
-	/**
-	 * Returns identifier that should be used for a given alias.
-	 * 
-	 * @param alias
-	 *          alis for which identifier will be returned
-	 * @return identifier that should be used for a given alias
-	 */
-	private String getId(Alias alias) {
-		return alias.getAliasId() + "_" + alias.getElement().getElementId();
-	}
-
-	@Override
-	public List<PubmedAnnotatedElementsView> getPublicationModelSummary(Model model) {
-		List<PubmedAnnotatedElementsView> result = pubmedPublicationsForModel.get(model.getId());
-		if (result != null) {
-			return result;
-		} else {
-			result = new ArrayList<>();
-			pubmedPublicationsForModel.put(model.getId(), result);
-		}
-		List<Model> models = new ArrayList<>();
-		models.add(model);
-		models.addAll(model.getSubmodels());
-		Set<MiriamData> miriamDatas = new HashSet<>();
-		for (Model m : models) {
-			for (Element element : m.getElements()) {
-				for (MiriamData md : element.getMiriamData()) {
-					if (MiriamType.PUBMED.equals(md.getDataType())) {
-						miriamDatas.add(md);
-					}
-				}
-			}
-			for (Reaction reaction : m.getReactions()) {
-				for (MiriamData md : reaction.getMiriamData()) {
-					if (MiriamType.PUBMED.equals(md.getDataType())) {
-						miriamDatas.add(md);
-					}
-				}
-			}
-		}
-		for (MiriamData miriamData : miriamDatas) {
-			result.add(pubmedAnnotatedElementsViewFactory.create(miriamData, model));
-		}
-		return result;
-	}
-
-}
+package lcsb.mapviewer.services.impl;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.converter.model.celldesigner.reaction.ReactionLineData;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.ArtifitialCompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.reaction.Modifier;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.ReactionNode;
+import lcsb.mapviewer.model.map.species.AntisenseRna;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Degraded;
+import lcsb.mapviewer.model.map.species.Drug;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.Ion;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.model.map.species.Unknown;
+import lcsb.mapviewer.model.map.species.fields.AntisenseRnaRegion;
+import lcsb.mapviewer.model.map.species.fields.ModificationResidue;
+import lcsb.mapviewer.model.map.species.fields.RnaRegion;
+import lcsb.mapviewer.services.interfaces.IExporterService;
+import lcsb.mapviewer.services.utils.data.ExportColumn;
+import lcsb.mapviewer.services.utils.data.ExportFileType;
+import lcsb.mapviewer.services.view.PubmedAnnotatedElementsView;
+import lcsb.mapviewer.services.view.PubmedAnnotatedElementsViewFactory;
+
+/**
+ * Implementation of {@link IExporterService} interface that allows to export
+ * {@link Model}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ExporterService implements IExporterService {
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger																					 logger											= Logger.getLogger(ExporterService.class);
+
+	/**
+	 * List of publications by {@link Model#getId() model id}. This is used for
+	 * caching, as obtaining this list on runtime is quite expensive.
+	 */
+	private static Map<Integer, List<PubmedAnnotatedElementsView>> pubmedPublicationsForModel	= new HashMap<>();
+
+	/**
+	 * Factory used to create {@link PubmedAnnotatedElementsView publication
+	 * summary} elements.
+	 */
+	@Autowired
+	private PubmedAnnotatedElementsViewFactory										 pubmedAnnotatedElementsViewFactory;
+
+	@Override
+	public void exportSpecies(ExporterParameters parameters) throws IOException {
+		String content = getExportSpeciesString(parameters);
+		writeToFile(content, parameters.getFileName());
+	}
+
+	@Override
+	public String getExportSpeciesString(ExporterParameters parameters) {
+		Set<String> uniqeLines = new HashSet<String>();
+		StringBuilder builder = new StringBuilder();
+		for (ExportColumn column : parameters.getColumns()) {
+			builder.append(column.getTitle() + "\t");
+		}
+		builder.append("\n");
+		for (Model model : parameters.getModels()) {
+			for (Alias alias : model.getAliases()) {
+				if (alias instanceof SpeciesAlias) {
+					SpeciesAlias speciesAlias = (SpeciesAlias) alias;
+					boolean toBeProcessed = false;
+					// check type
+					for (Class<?> type : parameters.getTypes()) {
+						if (type.isAssignableFrom(speciesAlias.getSpecies().getClass())) {
+							toBeProcessed = true;
+							break;
+						}
+					}
+					if (!toBeProcessed && parameters.getTypes().size() > 0) {
+						continue;
+					}
+
+					// check where it lays
+					toBeProcessed = (parameters.getIncludedAliases().size() == 0);
+					for (CompartmentAlias ca : parameters.getIncludedAliases()) {
+						if (ca.cross(alias)) {
+							toBeProcessed = true;
+						}
+					}
+					for (CompartmentAlias ca : parameters.getExcludedAliases()) {
+						if (ca.cross(alias)) {
+							toBeProcessed = false;
+						}
+					}
+					if (toBeProcessed) {
+						List<String> elements = getExportStringForOneSpecies(speciesAlias, parameters);
+						for (String string : elements) {
+							uniqeLines.add(string);
+						}
+					}
+				}
+			}
+		}
+		List<String> sortedElements = new ArrayList<String>();
+		sortedElements.addAll(uniqeLines);
+		Collections.sort(sortedElements);
+		for (String string : sortedElements) {
+			builder.append(string);
+			builder.append("\n");
+		}
+		return builder.toString();
+	}
+
+	/**
+	 * Returns strings with species alias exported using given parameters. Many
+	 * lines can be exported because one species alias can belong to many
+	 * pathways.
+	 * 
+	 * @param parameters
+	 *          {@link ExporterParameters export parameters}
+	 * @param speciesAlias
+	 *          export string are generated for this alias
+	 * @return list of strings representing exported data
+	 */
+	protected List<String> getExportStringForOneSpecies(SpeciesAlias speciesAlias, ExporterParameters parameters) {
+		if (parameters.getFileType() != ExportFileType.TAB_SEPARATED) {
+			throw new InvalidArgumentException("Unhandled file type: " + parameters.getFileType());
+		}
+		Species species = speciesAlias.getSpecies();
+
+		// for (ExportColumn column : parameters.getColumns()) {
+		// if (column == ExportColumn.FULL) {
+		// List<String> list = new ArrayList<String>();
+		// list.add(getExportSingleSpecies(speciesAlias, parameters));
+		// return list;
+		// }
+		// }
+
+		List<CompartmentAlias> aliases = getComponentList(speciesAlias);
+		List<String> result = new ArrayList<String>();
+
+		CompartmentAlias smallestAlias = getCompartment(speciesAlias);
+
+		List<ExportColumn> processedColumns = new ArrayList<ExportColumn>();
+		for (ExportColumn column : parameters.getColumns()) {
+			if (column.getClazz().isAssignableFrom(Species.class)) {
+				processedColumns.add(column);
+			}
+		}
+
+		for (CompartmentAlias alias : aliases) {
+			String separator = "";
+			StringBuilder line = new StringBuilder();
+			for (ExportColumn column : processedColumns) {
+				line.append(separator);
+				separator = "\t";
+				if (column == ExportColumn.COMPARTMENT_NAME) {
+					if (smallestAlias == null) {
+						line.append("null");
+					} else {
+						line.append(smallestAlias.getTitle());
+					}
+				} else if (column == ExportColumn.POSITION_TO_COMPARTMENT) {
+					line.append(species.getPositionToCompartment());
+				} else if (column == ExportColumn.COMPONENT_NAME) {
+					line.append(alias.getTitle());
+				} else if (column == ExportColumn.NAME) {
+					if (speciesAlias instanceof ComplexAlias) {
+						if (!parameters.isComplexElementsName()) {
+							line.append(species.getName());
+						} else {
+							line.append(getComplexNameWithElements((ComplexSpecies) species, parameters));
+						}
+					} else {
+						line.append(species.getName());
+					}
+				} else if (column == ExportColumn.ID) {
+					line.append(getId(speciesAlias));
+				} else if (column == ExportColumn.TYPE) {
+					line.append(species.getClass().getSimpleName());
+				} else if (column == ExportColumn.SUBMODEL) {
+					line.append(species.getModelData().getName());
+				} else if (column == ExportColumn.COMPLEX) {
+					String complex = null;
+					if (species.getComplex() != null) {
+						complex = species.getComplex().getName();
+
+						complex += " [id=" + getId(speciesAlias.getComplexAlias()) + "]";
+					}
+					line.append(complex);
+				} else {
+					throw new InvalidArgumentException("Unhandled column type: " + column);
+				}
+			}
+			for (MiriamType mt : parameters.getMiriamTypes()) {
+				line.append(separator);
+				String types = "";
+				for (MiriamData md : species.getMiriamData()) {
+					if (md.getDataType().equals(mt)) {
+						if (!types.isEmpty()) {
+							types += ",";
+						}
+						types += md.getResource();
+					}
+				}
+				if (types.equals("")) {
+					line.append(mt.toString() + ": N/A");
+				} else {
+					line.append(mt.toString() + ": " + types);
+				}
+			}
+			result.add(line.toString().replaceAll("[\n\r]+", " "));
+		}
+		return result;
+	}
+
+	/**
+	 * Returns {@link CompartmentAlias} to which element belongs to.
+	 * 
+	 * @param element
+	 *          alias of the element
+	 * @return {@link CompartmentAlias} to which element belongs to
+	 */
+	private CompartmentAlias getCompartment(SpeciesAlias element) {
+		CompartmentAlias smallestAlias = null;
+		List<CompartmentAlias> compartmentAliases = new ArrayList<CompartmentAlias>();
+
+		for (CompartmentAlias alias : element.getModel().getCompartmentsAliases()) {
+			if (alias.cross(element)) {
+				if (!(alias instanceof ArtifitialCompartmentAlias)) {
+					compartmentAliases.add(alias);
+				}
+			}
+		}
+
+		if (compartmentAliases.size() > 0) {
+			smallestAlias = compartmentAliases.get(0);
+		}
+		for (CompartmentAlias compartmentAlias : compartmentAliases) {
+			if (compartmentAlias.getSize() < smallestAlias.getSize()) {
+				smallestAlias = compartmentAlias;
+			}
+		}
+		return smallestAlias;
+	}
+
+	/**
+	 * Returns a list of pathways to which element belongs to.
+	 * 
+	 * @param element
+	 *          alias of the element
+	 * @return list of {@link CompartmentAlias} representing pathways
+	 */
+	private List<CompartmentAlias> getComponentList(SpeciesAlias element) {
+		Model model = element.getModel();
+
+		List<CompartmentAlias> aliases = new ArrayList<CompartmentAlias>();
+		for (CompartmentAlias alias : model.getCompartmentsAliases()) {
+			if (alias instanceof ArtifitialCompartmentAlias) {
+				if (alias.cross(element)) {
+					aliases.add(alias);
+				}
+			}
+		}
+
+		// in case the element is outside any component then we have to crate
+		// artifical null component
+		if (aliases.size() == 0) {
+			ArtifitialCompartmentAlias nullAlias = new ArtifitialCompartmentAlias();
+			nullAlias.setTitle("null");
+			aliases.add(nullAlias);
+		}
+
+		return aliases;
+	}
+
+	/**
+	 * Returns name of a complex with the names of all species included in this
+	 * complex.
+	 * 
+	 * @param species
+	 *          complex for which name is computed
+	 * @param parameters
+	 *          parameter limits the species that will be included in generated
+	 *          name
+	 * @return name of a complex with the names of all species included in this
+	 *         complex
+	 */
+	private String getComplexNameWithElements(ComplexSpecies species, ExporterParameters parameters) {
+		StringBuilder result = new StringBuilder();
+		String separator = "";
+		ComplexSpecies complex = (ComplexSpecies) species;
+		for (Species species2 : complex.getAllSimpleChildren()) {
+			boolean add = false;
+			if (parameters.getTypes().size() == 0) {
+				add = true;
+			}
+			for (Class<?> class1 : parameters.getTypes()) {
+				if (class1.isAssignableFrom(species2.getClass())) {
+					add = true;
+				}
+			}
+			if (add) {
+				result.append(separator);
+				result.append(species2.getName());
+				separator = ":";
+			}
+
+		}
+		if (result.length() == 0) {
+			return species.getName();
+		} else {
+			return result.toString();
+		}
+	}
+
+	/**
+	 * Writes content into a file.
+	 * 
+	 * @param content
+	 *          content that should be written into the file.
+	 * @param fileName
+	 *          file name
+	 * @throws IOException
+	 *           thrown when there is a problem with accessing file
+	 */
+	protected void writeToFile(String content, String fileName) throws IOException {
+		logger.debug("Save file: " + fileName);
+		File file = new File(fileName);
+
+		// if file doesnt exists, then create it
+		if (!file.exists()) {
+			// first create directory structure
+			file.getParentFile().mkdirs();
+			file.createNewFile();
+		}
+
+		FileWriter fw = new FileWriter(file.getAbsoluteFile());
+		BufferedWriter bw = new BufferedWriter(fw);
+		bw.write(content);
+		bw.close();
+	}
+
+	@Override
+	public String getExportInteractionString(ExporterParameters parameters) {
+		Set<String> uniqueLines = new HashSet<String>();
+		if (parameters.getFileType() != ExportFileType.SIF && parameters.getFileType() != ExportFileType.TAB_SEPARATED) {
+			throw new InvalidArgumentException("Unsupported file format: " + parameters.getFileType());
+		}
+
+		for (Model model : parameters.getModels()) {
+			for (Reaction reaction : model.getReactions()) {
+				int counter = 0;
+				for (ReactionNode node : reaction.getReactionNodes()) {
+					Element element = node.getElement();
+					for (Class<?> type : parameters.getTypes()) {
+						if (type.isAssignableFrom(element.getClass())) {
+							counter++;
+							break;
+						}
+					}
+				}
+				if (counter > 1) {
+					uniqueLines.addAll(getExportSingleInteractionString(reaction, parameters));
+				}
+			}
+		}
+		if (parameters.isMoleculeEdges()) {
+			for (Model model : parameters.getModels()) {
+				for (Alias element : model.getAliases()) {
+					if (element instanceof SpeciesAlias) {
+						Species species = ((SpeciesAlias) element).getSpecies();
+						if (species instanceof SimpleMolecule) {
+							boolean ok = false;
+							for (CompartmentAlias alias : parameters.getIncludedAliases()) {
+								if (alias.cross(element)) {
+									ok = true;
+								}
+							}
+							for (CompartmentAlias alias : parameters.getExcludedAliases()) {
+								if (alias.cross(element)) {
+									ok = false;
+								}
+							}
+							if (ok) {
+								String string = getExportSingleInteractionStringFromSpecies((SimpleMolecule) species, parameters);
+								if (parameters.getFileType() == ExportFileType.SIF) {
+									if (!uniqueLines.contains(string.replace("molecule_type", "reaction_type"))) {
+										uniqueLines.add(string);
+									}
+								} else {
+									uniqueLines.add(string);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		List<String> sortedLines = new ArrayList<String>();
+		sortedLines.addAll(uniqueLines);
+		Collections.sort(sortedLines);
+		StringBuilder result = new StringBuilder();
+		for (String string : sortedLines) {
+			if (!string.equals("")) {
+				result.append(string);
+				result.append("\n");
+			}
+		}
+
+		return result.toString();
+	}
+
+	/**
+	 * Creates interaction from molecule (molecule is used as extension of
+	 * reaction between different types of elements).
+	 * 
+	 * @param species
+	 *          molecule which is treaded as a reaction element
+	 * @param parameters
+	 *          {@link ExporterParameters export parameters}
+	 * @return string representing exported reaction
+	 */
+	protected String getExportSingleInteractionStringFromSpecies(SimpleMolecule species, ExporterParameters parameters) {
+		if (parameters.getFileType() != ExportFileType.SIF) {
+			throw new InvalidArgumentException("Unsupported file format: " + parameters.getFileType());
+		}
+		StringBuilder result = new StringBuilder();
+		Set<String> elements = new HashSet<String>();
+		for (Model model : parameters.getModels()) {
+			for (Reaction reaction : model.getReactions()) {
+				boolean goodReaction = false;
+				for (ReactionNode node : reaction.getReactionNodes()) {
+					if (node.getElement() instanceof SimpleMolecule) {
+						Species species2 = (Species) node.getElement();
+						if (species.getName().equalsIgnoreCase(species2.getName())) {
+							goodReaction = true;
+						}
+					}
+				}
+				if (!goodReaction) {
+					continue;
+				}
+				for (ReactionNode node : reaction.getReactionNodes()) {
+					boolean ok = false;
+					if (parameters.getIncludedAliases().size() == 0) {
+						ok = true;
+					}
+					for (CompartmentAlias alias2 : parameters.getIncludedAliases()) {
+						if (alias2.cross(node.getAlias())) {
+							ok = true;
+							break;
+						}
+					}
+					for (CompartmentAlias alias2 : parameters.getExcludedAliases()) {
+						if (alias2.cross(node.getAlias())) {
+							ok = false;
+							break;
+						}
+					}
+					if (ok) {
+						Element element = node.getElement();
+						for (Class<?> type : parameters.getTypes()) {
+							if (type.isAssignableFrom(element.getClass())) {
+								if (element instanceof ComplexSpecies) {
+									if (!parameters.isComplexElementsName()) {
+										elements.add(((Species) element).getName());
+									} else {
+										String name = getComplexNameWithElements((ComplexSpecies) element, parameters);
+										elements.add(name);
+									}
+								} else {
+									elements.add(((Species) element).getName());
+								}
+								break;
+							}
+						}
+					}
+				}
+			}
+		}
+		if (elements.size() <= 1) {
+			return "";
+		}
+		List<String> list = new ArrayList<String>();
+		list.addAll(elements);
+		result.append(list.get(0));
+		result.append("\tmolecule_type");
+		for (int i = 1; i < list.size(); i++) {
+			result.append("\t");
+			result.append(list.get(i));
+		}
+		return result.toString();
+
+	}
+
+	/**
+	 * Returns strings with reactions exported using given parameters. Many lines
+	 * can be exported because one species alias can belong to many pathways.
+	 * 
+	 * @param parameters
+	 *          {@link ExporterParameters export parameters}
+	 * @param reaction
+	 *          export string are generated for this reaction
+	 * @return list of strings representing exported data
+	 */
+	protected List<String> getExportSingleInteractionString(Reaction reaction, ExporterParameters parameters) {
+		List<String> result = new ArrayList<String>();
+		if (parameters.getFileType() == ExportFileType.SIF) {
+			StringBuilder builder = new StringBuilder();
+			Set<Element> elements = new HashSet<Element>();
+			for (ReactionNode node : reaction.getReactionNodes()) {
+				boolean ok = false;
+				if (parameters.getIncludedAliases().size() == 0) {
+					ok = true;
+				}
+				for (CompartmentAlias alias2 : parameters.getIncludedAliases()) {
+					if (alias2.cross(node.getAlias())) {
+						ok = true;
+						break;
+					}
+				}
+				for (CompartmentAlias alias2 : parameters.getExcludedAliases()) {
+					if (alias2.cross(node.getAlias())) {
+						ok = false;
+						break;
+					}
+				}
+				if (ok) {
+					Element element = node.getElement();
+					if (parameters.getTypes().size() == 0) {
+						elements.add(element);
+					} else {
+						for (Class<?> type : parameters.getTypes()) {
+							if (type.isAssignableFrom(element.getClass())) {
+								elements.add(element);
+								break;
+							}
+						}
+					}
+				}
+			}
+			Set<String> elementsNames = new HashSet<String>();
+			for (Element element : elements) {
+				if (element instanceof ComplexSpecies) {
+					if (!parameters.isComplexElementsName()) {
+						elementsNames.add(((Species) element).getName());
+					} else {
+						String name = getComplexNameWithElements((ComplexSpecies) element, parameters);
+						elementsNames.add(name);
+					}
+
+				} else {
+					elementsNames.add(((Species) element).getName());
+				}
+			}
+
+			if (elementsNames.size() <= 1) {
+				return result;
+			}
+			List<String> list = new ArrayList<String>();
+			list.addAll(elementsNames);
+			builder.append(list.get(0));
+			builder.append("\treaction_type");
+			for (int i = 1; i < list.size(); i++) {
+				builder.append("\t");
+				builder.append(list.get(i));
+			}
+			result.add(builder.toString());
+		} else if (parameters.getFileType() == ExportFileType.TAB_SEPARATED) {
+			if (parameters.getColumns() == null || parameters.getColumns().size() == 0) {
+				result.add(getOldFormatString(reaction, parameters));
+			} else {
+				result.addAll(getNewFormatString(reaction, parameters));
+			}
+		} else {
+			throw new InvalidArgumentException("Unsupported file format: " + parameters.getFileType());
+		}
+		return result;
+	}
+
+	/**
+	 * Creates tab separated string for reaction in old format...
+	 * 
+	 * @param reaction
+	 *          reaction to transform
+	 * @param parameters
+	 *          {@link ExporterParameters export parameters}
+	 * @return export string representation of the reaction
+	 */
+	private String getOldFormatString(Reaction reaction, ExporterParameters parameters) {
+		StringBuilder result = new StringBuilder();
+		result.append(reaction.getIdReaction());
+		result.append("\t");
+		result.append(ReactionLineData.getByReactionType(reaction.getClass()));
+		result.append("\t");
+		result.append("reversible=" + reaction.isReversible());
+		result.append("\t");
+		result.append("kineticLaw=" + reaction.isKineticLaw());
+		result.append("\t");
+		if (reaction.getMiriamData().size() > 0) {
+			result.append("REACTION_MIRIAM_DATA");
+			result.append("\t");
+			for (MiriamData md : reaction.getMiriamData()) {
+				result.append("data_type=" + md.getDataType().getUris().get(0));
+				result.append("\t");
+				result.append("relation_type=" + md.getRelationType().getStringRepresentation());
+				result.append("\t");
+				result.append("resource=" + md.getResource());
+				result.append("\t");
+			}
+		}
+		for (Reactant reactant : reaction.getReactants()) {
+			result.append("REACTANT");
+			result.append("\t");
+			result.append(getExportSingleSpecies((SpeciesAlias) reactant.getAlias(), parameters));
+			result.append("\t");
+		}
+		for (Product product : reaction.getProducts()) {
+			result.append("PRODUCT");
+			result.append("\t");
+			result.append(getExportSingleSpecies((SpeciesAlias) product.getAlias(), parameters));
+			result.append("\t");
+		}
+		for (Modifier modifier : reaction.getModifiers()) {
+			result.append("MODIFIER");
+			result.append("\t");
+			result.append("type=" + modifier.getClass().getSimpleName());
+			result.append("\t");
+			result.append(getExportSingleSpecies((SpeciesAlias) modifier.getAlias(), parameters));
+			result.append("\t");
+		}
+		return result.toString();
+	}
+
+	/**
+	 * Creates tab separated string for reaction in new format...
+	 * 
+	 * @param reaction
+	 *          reaction to transform
+	 * @param parameters
+	 *          {@link ExporterParameters export parameters}
+	 * @return export string representation of the reaction
+	 */
+	private List<String> getNewFormatString(Reaction reaction, ExporterParameters parameters) {
+		List<String> result = new ArrayList<String>();
+		StringBuilder builder = new StringBuilder();
+		boolean splitReaction = false;
+		for (ExportColumn column : parameters.getColumns()) {
+			if (column.getClazz().isAssignableFrom(Reaction.class)) {
+				if (column.equals(ExportColumn.REACTION_ID)) {
+					builder.append(reaction.getIdReaction());
+				} else if (column.equals(ExportColumn.REACTION_REVERSIBLE)) {
+					builder.append(reaction.isReversible());
+				} else if (column.equals(ExportColumn.REACTION_TYPE)) {
+					builder.append(ReactionLineData.getByReactionType(reaction.getClass()));
+				} else if (column.equals(ExportColumn.REACTION_TWO_ELEMENT)) {
+					splitReaction = true;
+					continue;
+				} else {
+					throw new InvalidArgumentException("Unknown column type: " + column);
+				}
+			}
+			builder.append("\t");
+		}
+		for (MiriamType mt : parameters.getMiriamTypes()) {
+			String types = "";
+			for (MiriamData md : reaction.getMiriamData()) {
+				if (md.getDataType().equals(mt)) {
+					if (!types.isEmpty()) {
+						types += ",";
+					}
+					types += md.getResource();
+				}
+			}
+			if (types.equals("")) {
+				builder.append(mt.toString() + ": N/A");
+			} else {
+				builder.append(mt.toString() + ": " + types);
+			}
+			builder.append("\t");
+		}
+
+		int counter = 0;
+
+		if (splitReaction) {
+			String base = builder.toString();
+			Set<Alias> inputs = new HashSet<Alias>();
+			Set<Alias> outputs = new HashSet<Alias>();
+			for (Reactant reactant : reaction.getReactants()) {
+				if (!isAssignable(parameters, reactant.getElement())) {
+					continue;
+				}
+				if (reactant.getAlias() instanceof ComplexAlias) {
+					inputs.addAll(((ComplexAlias) (reactant.getAlias())).getAllChildrenAliases());
+				} else {
+					inputs.add(reactant.getAlias());
+				}
+			}
+			for (Product product : reaction.getProducts()) {
+				if (!isAssignable(parameters, product.getElement())) {
+					continue;
+				}
+				if (product.getElement() instanceof ComplexSpecies) {
+					outputs.addAll(((ComplexAlias) (product.getAlias())).getAllChildrenAliases());
+				} else {
+					outputs.add(product.getAlias());
+				}
+			}
+			for (Modifier modifier : reaction.getModifiers()) {
+				if (!isAssignable(parameters, modifier.getElement())) {
+					continue;
+				}
+				if (modifier.getElement() instanceof ComplexSpecies) {
+					inputs.addAll(((ComplexAlias) (modifier.getAlias())).getAllChildrenAliases());
+				} else {
+					inputs.add(modifier.getAlias());
+				}
+			}
+			for (Alias input : inputs) {
+				if (!isAssignable(parameters, input.getElement())) {
+					continue;
+				}
+				for (Alias output : outputs) {
+					if (!isAssignable(parameters, output.getElement())) {
+						continue;
+					}
+					String line = base + "\t" + getId(input) + "\t" + getId(output);
+					result.add(line);
+				}
+			}
+		} else {
+
+			for (Reactant reactant : reaction.getReactants()) {
+				if (!isAssignable(parameters, reactant.getElement())) {
+					continue;
+				}
+				counter++;
+
+				builder.append("REACTANT");
+				builder.append("\t");
+				builder.append(getId(reactant.getAlias()));
+				builder.append("\t");
+			}
+			for (Product product : reaction.getProducts()) {
+				if (!isAssignable(parameters, product.getElement())) {
+					continue;
+				}
+				counter++;
+
+				builder.append("PRODUCT");
+				builder.append("\t");
+				builder.append(getId(product.getAlias()));
+				builder.append("\t");
+			}
+			for (Modifier modifier : reaction.getModifiers()) {
+				if (!isAssignable(parameters, modifier.getElement())) {
+					continue;
+				}
+				counter++;
+
+				builder.append("MODIFIER");
+				builder.append("\t");
+				builder.append(getId(modifier.getAlias()));
+				builder.append("\t");
+			}
+			if (counter > 1) {
+				result.add(builder.toString());
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Checks if element is acceptable by {@link ExporterParameters export
+	 * parameters}.
+	 * 
+	 * @param parameters
+	 *          {@link ExporterParameters export parameters}
+	 * @param element
+	 *          element to check
+	 * @return true if element can exist in export string, <code>false</code>
+	 *         otherwise
+	 */
+	private boolean isAssignable(ExporterParameters parameters, Element element) {
+		boolean ok = false;
+		for (Class<?> clazz : parameters.getTypes()) {
+			if (clazz.isAssignableFrom(element.getClass())) {
+				ok = true;
+			}
+		}
+		return ok;
+	}
+
+	/**
+	 * Creates tab separated string for species for full mode.
+	 * 
+	 * @param alias
+	 *          alias of the element to transform
+	 * @param parameters
+	 *          {@link ExporterParameters export parameters}
+	 * @return export string representation of the element
+	 */
+	private String getExportSingleSpecies(SpeciesAlias alias, ExporterParameters parameters) {
+		Element element = alias.getElement();
+		if (parameters.getFileType() != ExportFileType.TAB_SEPARATED) {
+			throw new InvalidArgumentException("Unsupported file format: " + parameters.getFileType());
+		}
+		StringBuilder sb = new StringBuilder();
+		Species species = (Species) element;
+		sb.append(element.getClass().getSimpleName() + "\t");
+		sb.append("id=" + getId(alias) + "\t");
+		sb.append("name=" + species.getName() + "\t");
+		sb.append("fullName=" + species.getFullName() + "\t");
+		sb.append("charge=" + species.getCharge() + "\t");
+		sb.append("initialAmount=" + species.getInitialAmount() + "\t");
+		sb.append("initialConcentration=" + species.getInitialConcentration() + "\t");
+		String compartment = null;
+		if (species.getParent() instanceof Compartment) {
+			compartment = ((Compartment) species.getParent()).getName();
+		}
+		sb.append("compartment=" + compartment);
+		sb.append("\t");
+		String complexId = null;
+		if (species.getComplex() != null) {
+			complexId = getId(alias.getComplexAlias());
+		}
+		sb.append("complex=" + complexId);
+		sb.append("\t");
+		sb.append("hasOnlySubstanceUnits=" + species.hasOnlySubstanceUnits());
+		sb.append("\t");
+		sb.append("positionToCompartment=" + species.getPositionToCompartment());
+		sb.append("\t");
+
+		if (species instanceof Protein) {
+			Protein protein = (Protein) species;
+			sb.append("dimer=" + protein.getHomodimer());
+			sb.append("\t");
+			sb.append("structuralState=" + protein.getStructuralState());
+			sb.append("\t");
+			sb.append("hypothetical=" + protein.isHypothetical());
+			sb.append("\t");
+			for (ModificationResidue mr : protein.getModificationResidues()) {
+				sb.append("MODIFICATION RESIDUE");
+				sb.append("\t");
+				sb.append("angle=" + mr.getAngle());
+				sb.append("\t");
+				sb.append("name=" + mr.getName());
+				if (mr.getState() != null) {
+					sb.append("\t");
+					sb.append("shortName=" + mr.getState().getAbbreviation());
+				}
+				sb.append("\t");
+				sb.append("side=" + mr.getSide());
+				sb.append("\t");
+				sb.append("size=" + mr.getSize());
+				sb.append("\t");
+				if (mr.getState() != null) {
+					sb.append("state=" + mr.getState().getFullName() + "\t");
+				}
+			}
+		} else if (species instanceof Gene) {
+			Gene gene = (Gene) species;
+			for (ModificationResidue mr : gene.getModificationResidues()) {
+				sb.append("MODIFICATION RESIDUE");
+				sb.append("\t");
+				sb.append("angle=" + mr.getAngle());
+				sb.append("\t");
+				sb.append("name=" + mr.getName());
+				sb.append("\t");
+				if (mr.getState() != null) {
+					sb.append("shortName=" + mr.getState().getAbbreviation() + "\t");
+				}
+				sb.append("side=" + mr.getSide());
+				sb.append("\t");
+				sb.append("size=" + mr.getSize());
+				sb.append("\t");
+				if (mr.getState() != null) {
+					sb.append("state=" + mr.getState().getFullName() + "\t");
+				}
+			}
+		} else if (species instanceof ComplexSpecies) {
+			ComplexSpecies complex = (ComplexSpecies) species;
+			sb.append("dimer=" + complex.getHomodimer());
+			sb.append("\t");
+			sb.append("hypothetical=" + complex.isHypothetical());
+			sb.append("\t");
+		} else if (species instanceof SimpleMolecule) {
+			SimpleMolecule molecule = (SimpleMolecule) species;
+			sb.append("dimer=" + molecule.getHomodimer());
+			sb.append("\t");
+		} else if (species instanceof Ion) {
+			sb.append("");
+		} else if (species instanceof Phenotype) {
+			sb.append("");
+		} else if (species instanceof Drug) {
+			sb.append("");
+
+		} else if (species instanceof Rna) {
+			Rna rna = (Rna) species;
+			for (RnaRegion region : rna.getRegions()) {
+				sb.append("RNA_REGION");
+				sb.append("\t");
+				sb.append("type=" + region.getType());
+				sb.append("\t");
+				if (region.getState() != null) {
+					sb.append("state=" + region.getState().getFullName() + "\t");
+				}
+				sb.append("\t");
+				sb.append("size=" + region.getSize());
+				sb.append("\t");
+				sb.append("pos=" + region.getPos());
+				sb.append("\t");
+			}
+		} else if (species instanceof AntisenseRna) {
+			AntisenseRna antisenseRna = (AntisenseRna) species;
+			for (AntisenseRnaRegion region : antisenseRna.getRegions()) {
+				sb.append("RNA_REGION" + "\t");
+				if (region.getType() != null) {
+					sb.append("type=" + region.getType().getName() + "\t");
+				}
+				sb.append("name=" + region.getName() + "\t");
+				sb.append("size=" + region.getSize() + "\t");
+				sb.append("pos=" + region.getPos() + "\t");
+			}
+		} else if (species instanceof Unknown) {
+			sb.append("");
+		} else if (species instanceof Degraded) {
+			sb.append("");
+		} else {
+			throw new InvalidArgumentException("Invalid class type: " + species.getClass());
+		}
+		if (species.getMiriamData().size() > 0) {
+			sb.append("MIRIAM_DATA");
+			sb.append("\t");
+			for (MiriamData md : species.getMiriamData()) {
+				sb.append("data_type=" + md.getDataType().getUris().get(0));
+				sb.append("\t");
+				sb.append("relation_type=" + md.getRelationType().getStringRepresentation());
+				sb.append("\t");
+				sb.append("resource=" + md.getResource());
+				sb.append("\t");
+			}
+		}
+		return sb.toString();
+	}
+
+	@Override
+	public void exportReactions(ExporterParameters parameters) throws IOException {
+		String content = getExportInteractionString(parameters);
+		writeToFile(content, parameters.getFileName());
+	}
+
+	@Override
+	public void exportCompartments(ExporterParameters parameters) throws IOException {
+		String content = getExportCompartmentsString(parameters);
+		writeToFile(content, parameters.getFileName());
+	}
+
+	@Override
+	public String getExportCompartmentsString(ExporterParameters parameters) {
+		Set<String> uniqeLines = new HashSet<String>();
+		StringBuilder builder = new StringBuilder();
+		for (Model model : parameters.getModels()) {
+			for (CompartmentAlias alias : model.getCompartmentsAliases()) {
+
+				// check where it lays
+				boolean toBeProcessed = (parameters.getIncludedAliases().size() == 0);
+				if (alias.getCompartment() == null) {
+					toBeProcessed = false;
+				}
+				for (CompartmentAlias ca : parameters.getIncludedAliases()) {
+					if (ca.cross(alias)) {
+						toBeProcessed = true;
+					}
+				}
+				for (CompartmentAlias ca : parameters.getExcludedAliases()) {
+					if (ca.cross(alias)) {
+						toBeProcessed = false;
+					}
+				}
+				if (toBeProcessed) {
+					List<String> elements = getExportStringForOneCompartment(alias, parameters);
+					for (String string : elements) {
+						uniqeLines.add(string);
+					}
+				}
+			}
+		}
+		List<String> sortedElements = new ArrayList<String>();
+		sortedElements.addAll(uniqeLines);
+		Collections.sort(sortedElements);
+		for (String string : sortedElements) {
+			builder.append(string);
+			builder.append("\n");
+		}
+		return builder.toString();
+	}
+
+	/**
+	 * Exports compartments into set of text lines defining a compartment.
+	 * 
+	 * @param compartmentAlias
+	 *          alias of the compartment to export
+	 * @param parameters
+	 *          parameters used in export
+	 * @return string srepresenting compartment in export format
+	 */
+	private List<String> getExportStringForOneCompartment(CompartmentAlias compartmentAlias, ExporterParameters parameters) {
+		Compartment compartment = compartmentAlias.getCompartment();
+		List<String> result = new ArrayList<String>();
+		if (parameters.getFileType() != ExportFileType.TAB_SEPARATED) {
+			throw new InvalidArgumentException("Unhandled file type: " + parameters.getFileType());
+		}
+		StringBuilder sb = new StringBuilder();
+		sb.append(getId(compartmentAlias) + "\t");
+		sb.append("name=" + compartment.getName() + "\t");
+		sb.append("fullname=" + compartment.getFullName() + "\t");
+		if (compartment.getMiriamData().size() > 0) {
+			sb.append("MIRIAM_DATA");
+			sb.append("\t");
+			for (MiriamData md : compartment.getMiriamData()) {
+				sb.append("data_type=" + md.getDataType().getUris().get(0));
+				sb.append("\t");
+				sb.append("relation_type=" + md.getRelationType().getStringRepresentation());
+				sb.append("\t");
+				sb.append("resource=" + md.getResource());
+				sb.append("\t");
+			}
+		}
+		result.add(sb.toString());
+		return result;
+	}
+
+	/**
+	 * Returns identifier that should be used for a given alias.
+	 * 
+	 * @param alias
+	 *          alis for which identifier will be returned
+	 * @return identifier that should be used for a given alias
+	 */
+	private String getId(Alias alias) {
+		return alias.getAliasId() + "_" + alias.getElement().getElementId();
+	}
+
+	@Override
+	public List<PubmedAnnotatedElementsView> getPublicationModelSummary(Model model) {
+		List<PubmedAnnotatedElementsView> result = pubmedPublicationsForModel.get(model.getId());
+		if (result != null) {
+			return result;
+		} else {
+			result = new ArrayList<>();
+			pubmedPublicationsForModel.put(model.getId(), result);
+		}
+		List<Model> models = new ArrayList<>();
+		models.add(model);
+		models.addAll(model.getSubmodels());
+		Set<MiriamData> miriamDatas = new HashSet<>();
+		for (Model m : models) {
+			for (Element element : m.getElements()) {
+				for (MiriamData md : element.getMiriamData()) {
+					if (MiriamType.PUBMED.equals(md.getDataType())) {
+						miriamDatas.add(md);
+					}
+				}
+			}
+			for (Reaction reaction : m.getReactions()) {
+				for (MiriamData md : reaction.getMiriamData()) {
+					if (MiriamType.PUBMED.equals(md.getDataType())) {
+						miriamDatas.add(md);
+					}
+				}
+			}
+		}
+		for (MiriamData miriamData : miriamDatas) {
+			result.add(pubmedAnnotatedElementsViewFactory.create(miriamData, model));
+		}
+		return result;
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/interfaces/IDataMiningService.java b/service/src/main/java/lcsb/mapviewer/services/interfaces/IDataMiningService.java
index 0958e88ee6..ba81f380e5 100644
--- a/service/src/main/java/lcsb/mapviewer/services/interfaces/IDataMiningService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/interfaces/IDataMiningService.java
@@ -1,152 +1,152 @@
-package lcsb.mapviewer.services.interfaces;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Set;
-
-import lcsb.mapviewer.common.IProgressUpdater;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.graph.DataMining;
-import lcsb.mapviewer.model.map.graph.DataMiningSet;
-import lcsb.mapviewer.model.map.graph.DataMiningType;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelData;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.services.utils.InvalidDataMiningInputFile;
-import lcsb.mapviewer.services.view.DataMiningSetView;
-
-/**
- * This service manages data mining data.
- * 
- * @author Piotr Gawron
- * 
- */
-public interface IDataMiningService {
-
-	/**
-	 * Return additional suggested connections for the given alias.
-	 * 
-	 * @param alias
-	 *          alias to be investigated
-	 * @return set of suggested connections
-	 */
-	Collection<DataMining> getMissingConnections(SpeciesAlias alias);
-
-	/**
-	 * Return additional suggested connections for the given species.
-	 * 
-	 * @param element
-	 *          element to be investigated
-	 * @return set of suggested connections
-	 */
-	Collection<DataMining> getMissingConnections(Element element);
-
-	/**
-	 * Adds new suggested connection.
-	 * 
-	 * @param connection
-	 *          connection to add
-	 */
-	void addMissingConnection(DataMining connection);
-
-	/**
-	 * Removes suggested connection.
-	 * 
-	 * @param connection
-	 *          connection to be removed
-	 * @param reason
-	 *          text reason of the removal
-	 */
-	void deleteMissingConnection(DataMining connection, String reason);
-
-	/**
-	 * Removes suggested connection.
-	 * 
-	 * @param connectionId
-	 *          identifier of the connection to be removed
-	 * @param reason
-	 *          text reason of the removal
-	 */
-	void deleteMissingConnection(String connectionId, String reason);
-
-	/**
-	 * Returns a set of elements that has suggested connection to a geneName.
-	 * 
-	 * @param geneName
-	 *          name of the element to which suggested connection are looked for
-	 * @param model
-	 *          model from which suggested connections should taken
-	 * @return set of elements that has suggested connection to a geneName.
-	 */
-	Collection<Element> getSpeciesWithMissingConnectionsByGeneName(Model model, String geneName);
-
-	/**
-	 * Removes all suggested connections for model.
-	 * 
-	 * @param model
-	 *          model from which all suggested connections should be removed
-	 */
-	void removeConnectionsForModel(Model model);
-
-	/**
-	 * Removes all suggested connections for model.
-	 * 
-	 * @param model
-	 *          model from which all suggested connections should be removed
-	 */
-	void removeConnectionsForModel(ModelData model);
-
-	/**
-	 * This method creates set of {@link DataMining} elements from input file.
-	 * 
-	 * @param filename
-	 *          file where data mining data is stored
-	 * @param nodes
-	 *          nodes for which data mining connections shoul be generated
-	 * @param reactions
-	 *          list of already existing reactions in the model
-	 * @param type
-	 *          {@link DataMiningType} defining type of the input entries
-	 * @param updater
-	 *          callback function that update information about progress of the
-	 *          function execution
-	 * @return data mining connections for given data
-	 * @throws IOException
-	 *           thrown when there is a problem with input file
-	 * @throws InvalidDataMiningInputFile
-	 *           thrown when the input file is invalid
-	 */
-	Set<DataMining> parseData(String filename, DataMiningType type, Collection<Element> nodes, Set<Reaction> reactions, IProgressUpdater updater)
-			throws IOException, InvalidDataMiningInputFile;
-
-	/**
-	 * This method creates set of {@link DataMining} elements from input file.
-	 * 
-	 * @param dataMiningSet
-	 *          data mining set where information about parsed file is stored
-	 * @param nodes
-	 *          nodes for which data mining connections shoul be generated
-	 * @param reactions
-	 *          list of already existing reactions in the model
-	 * @param updater
-	 *          callback function that update information about progress of the
-	 *          function execution
-	 * @return data mining connections for given data
-	 * @throws InvalidDataMiningInputFile
-	 *           thrown when the input file is invalid
-	 */
-	Set<DataMining> parseData(DataMiningSet dataMiningSet, Collection<Element> nodes, Set<Reaction> reactions, IProgressUpdater updater)
-			throws InvalidDataMiningInputFile;
-
-	/**
-	 * Returns byte array containing data from original input file that was used
-	 * in this {@link DataMiningSet}.
-	 * 
-	 * @param dms
-	 *          {@link DataMiningSetView} for which we want to retrieve original
-	 *          file data
-	 * @return original data file for given {@link DataMiningSet}
-	 */
-	byte[] getInputDataForLayout(DataMiningSetView dms);
-}
+package lcsb.mapviewer.services.interfaces;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Set;
+
+import lcsb.mapviewer.common.IProgressUpdater;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.graph.DataMining;
+import lcsb.mapviewer.model.map.graph.DataMiningSet;
+import lcsb.mapviewer.model.map.graph.DataMiningType;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelData;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.services.utils.InvalidDataMiningInputFile;
+import lcsb.mapviewer.services.view.DataMiningSetView;
+
+/**
+ * This service manages data mining data.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public interface IDataMiningService {
+
+	/**
+	 * Return additional suggested connections for the given alias.
+	 * 
+	 * @param alias
+	 *          alias to be investigated
+	 * @return set of suggested connections
+	 */
+	Collection<DataMining> getMissingConnections(SpeciesAlias alias);
+
+	/**
+	 * Return additional suggested connections for the given species.
+	 * 
+	 * @param element
+	 *          element to be investigated
+	 * @return set of suggested connections
+	 */
+	Collection<DataMining> getMissingConnections(Element element);
+
+	/**
+	 * Adds new suggested connection.
+	 * 
+	 * @param connection
+	 *          connection to add
+	 */
+	void addMissingConnection(DataMining connection);
+
+	/**
+	 * Removes suggested connection.
+	 * 
+	 * @param connection
+	 *          connection to be removed
+	 * @param reason
+	 *          text reason of the removal
+	 */
+	void deleteMissingConnection(DataMining connection, String reason);
+
+	/**
+	 * Removes suggested connection.
+	 * 
+	 * @param connectionId
+	 *          identifier of the connection to be removed
+	 * @param reason
+	 *          text reason of the removal
+	 */
+	void deleteMissingConnection(String connectionId, String reason);
+
+	/**
+	 * Returns a set of elements that has suggested connection to a geneName.
+	 * 
+	 * @param geneName
+	 *          name of the element to which suggested connection are looked for
+	 * @param model
+	 *          model from which suggested connections should taken
+	 * @return set of elements that has suggested connection to a geneName.
+	 */
+	Collection<Element> getSpeciesWithMissingConnectionsByGeneName(Model model, String geneName);
+
+	/**
+	 * Removes all suggested connections for model.
+	 * 
+	 * @param model
+	 *          model from which all suggested connections should be removed
+	 */
+	void removeConnectionsForModel(Model model);
+
+	/**
+	 * Removes all suggested connections for model.
+	 * 
+	 * @param model
+	 *          model from which all suggested connections should be removed
+	 */
+	void removeConnectionsForModel(ModelData model);
+
+	/**
+	 * This method creates set of {@link DataMining} elements from input file.
+	 * 
+	 * @param filename
+	 *          file where data mining data is stored
+	 * @param nodes
+	 *          nodes for which data mining connections shoul be generated
+	 * @param reactions
+	 *          list of already existing reactions in the model
+	 * @param type
+	 *          {@link DataMiningType} defining type of the input entries
+	 * @param updater
+	 *          callback function that update information about progress of the
+	 *          function execution
+	 * @return data mining connections for given data
+	 * @throws IOException
+	 *           thrown when there is a problem with input file
+	 * @throws InvalidDataMiningInputFile
+	 *           thrown when the input file is invalid
+	 */
+	Set<DataMining> parseData(String filename, DataMiningType type, Collection<Element> nodes, Set<Reaction> reactions, IProgressUpdater updater)
+			throws IOException, InvalidDataMiningInputFile;
+
+	/**
+	 * This method creates set of {@link DataMining} elements from input file.
+	 * 
+	 * @param dataMiningSet
+	 *          data mining set where information about parsed file is stored
+	 * @param nodes
+	 *          nodes for which data mining connections shoul be generated
+	 * @param reactions
+	 *          list of already existing reactions in the model
+	 * @param updater
+	 *          callback function that update information about progress of the
+	 *          function execution
+	 * @return data mining connections for given data
+	 * @throws InvalidDataMiningInputFile
+	 *           thrown when the input file is invalid
+	 */
+	Set<DataMining> parseData(DataMiningSet dataMiningSet, Collection<Element> nodes, Set<Reaction> reactions, IProgressUpdater updater)
+			throws InvalidDataMiningInputFile;
+
+	/**
+	 * Returns byte array containing data from original input file that was used
+	 * in this {@link DataMiningSet}.
+	 * 
+	 * @param dms
+	 *          {@link DataMiningSetView} for which we want to retrieve original
+	 *          file data
+	 * @return original data file for given {@link DataMiningSet}
+	 */
+	byte[] getInputDataForLayout(DataMiningSetView dms);
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/interfaces/ILayoutService.java b/service/src/main/java/lcsb/mapviewer/services/interfaces/ILayoutService.java
index 4310aef512..3ac6a7c631 100644
--- a/service/src/main/java/lcsb/mapviewer/services/interfaces/ILayoutService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/interfaces/ILayoutService.java
@@ -1,494 +1,494 @@
-package lcsb.mapviewer.services.interfaces;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-
-import lcsb.mapviewer.commands.CommandExecutionException;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.user.User;
-import lcsb.mapviewer.services.search.layout.FullLayoutAliasView;
-import lcsb.mapviewer.services.search.layout.LightLayoutAliasView;
-import lcsb.mapviewer.services.search.layout.LightLayoutReactionView;
-import lcsb.mapviewer.services.utils.data.ColorSchemaType;
-import lcsb.mapviewer.services.view.LayoutView;
-
-/**
- * Service that manages layouts of the map.
- * 
- * @author Piotr Gawron
- * 
- */
-public interface ILayoutService {
-
-	/**
-	 * Parameters used for creation of the layout.
-	 * 
-	 * @author Piotr Gawron
-	 * 
-	 */
-	class CreateLayoutParams {
-
-		/**
-		 * Size of the buffer used to copy stream data.
-		 */
-		private static final int			BUFFER_SIZE	= 1024;
-
-		/**
-		 * Name of the layout.
-		 * 
-		 */
-		private String								name;
-
-		/**
-		 * Description of the layout.
-		 * 
-		 */
-		private String								description;
-
-		/**
-		 * Where the graphic files should be saved.
-		 * 
-		 */
-		private String								directory;
-
-		/**
-		 * 
-		 * {@link Model} for which the layout is created.
-		 */
-		private Model									model;
-
-		/**
-		 * Who creates the layout.
-		 * 
-		 */
-		private User									user;
-
-		/**
-		 * 
-		 * Input stream with coloring information data in the stream should
-		 * correspond to a file that can be parsed by
-		 * {@link lcsb.mapviewer.services.utils.ColorSchemaXlsxReader
-		 * ColorSchemaReader} . This is a copy of original input stream, so we can
-		 * read this input stream multiple times.
-		 */
-		private ByteArrayOutputStream	colorInputStreamCopy;
-
-		/**
-		 * Name of the file used as input (if available).
-		 */
-		private String								layoutFileName;
-
-		/**
-		 * Determines if creation of the output files should be done asynchronously
-		 * who creates the layout.
-		 * 
-		 */
-		private boolean								async				= false;
-
-		/**
-		 * Type of the uploaded file.
-		 */
-		private ColorSchemaType				colorSchemaType;
-
-		/**
-		 * @return the name
-		 * @see #name
-		 */
-		public String getName() {
-			return name;
-		}
-
-		/**
-		 * @param name
-		 *          the name to set
-		 * @see #name
-		 * @return {@link CreateLayoutParams} object
-		 */
-		public CreateLayoutParams name(String name) {
-			this.name = name;
-			return this;
-		}
-
-		/**
-		 * @return the directory
-		 * @see #directory
-		 */
-		public String getDirectory() {
-			return directory;
-		}
-
-		/**
-		 * @param directory
-		 *          the directory to set
-		 * @see #directory
-		 * @return {@link CreateLayoutParams} object
-		 */
-		public CreateLayoutParams directory(String directory) {
-			this.directory = directory;
-			return this;
-		}
-
-		/**
-		 * @return the model
-		 * @see #model
-		 */
-		public Model getModel() {
-			return model;
-		}
-
-		/**
-		 * @param model
-		 *          the model to set
-		 * @see #model
-		 * @return {@link CreateLayoutParams} object
-		 */
-		public CreateLayoutParams model(Model model) {
-			this.model = model;
-			return this;
-		}
-
-		/**
-		 * @return the user
-		 * @see #user
-		 */
-		public User getUser() {
-			return user;
-		}
-
-		/**
-		 * @param user
-		 *          the user to set
-		 * @see #user
-		 * @return {@link CreateLayoutParams} object
-		 */
-		public CreateLayoutParams user(User user) {
-			this.user = user;
-			return this;
-		}
-
-		/**
-		 * @return the colorInputStream
-		 * @see #colorInputStream
-		 */
-		public InputStream getColorInputStream() {
-			return new ByteArrayInputStream(colorInputStreamCopy.toByteArray());
-		}
-
-		/**
-		 * @param colorInputStream
-		 *          the colorInputStream to set
-		 * @see #colorInputStream
-		 * @return {@link CreateLayoutParams} object
-		 * @throws IOException
-		 *           thrown when there is a problem with accessing input stream
-		 */
-		public CreateLayoutParams colorInputStream(InputStream colorInputStream) throws IOException {
-			if (colorInputStream == null) {
-				this.colorInputStreamCopy = null;
-			} else {
-				this.colorInputStreamCopy = new ByteArrayOutputStream();
-
-				byte[] buffer = new byte[BUFFER_SIZE];
-				int len;
-				while ((len = colorInputStream.read(buffer)) > -1) {
-					this.colorInputStreamCopy.write(buffer, 0, len);
-				}
-				this.colorInputStreamCopy.flush();
-			}
-			return this;
-		}
-
-		/**
-		 * @return the async
-		 * @see #async
-		 */
-		public boolean isAsync() {
-			return async;
-		}
-
-		/**
-		 * @param async
-		 *          the async to set
-		 * @see #async
-		 * @return {@link CreateLayoutParams} object
-		 */
-		public CreateLayoutParams async(boolean async) {
-			this.async = async;
-			return this;
-		}
-
-		/**
-		 * @return the description
-		 * @see #description
-		 */
-		public String getDescription() {
-			return description;
-		}
-
-		/**
-		 * @param description
-		 *          the description to set
-		 * @see #description
-		 * @return {@link CreateLayoutParams} object
-		 */
-		public CreateLayoutParams description(String description) {
-			this.description = description;
-			return this;
-		}
-
-		/**
-		 * 
-		 * @return {@link #colorSchemaType}
-		 */
-		public ColorSchemaType getColorSchemaType() {
-			return colorSchemaType;
-		}
-
-		/**
-		 * @param colorSchemaType
-		 *          the colorSchemaType to set
-		 * @see #colorSchemaType
-		 * @return {@link CreateLayoutParams} object
-		 */
-		public CreateLayoutParams colorSchemaType(ColorSchemaType colorSchemaType) {
-			this.colorSchemaType = colorSchemaType;
-			return this;
-		}
-
-		/**
-		 * @return the layoutFileName
-		 * @see #layoutFileName
-		 */
-		public String getLayoutFileName() {
-			return layoutFileName;
-		}
-
-		/**
-		 * @param layoutFileName
-		 *          the layoutFileName to set
-		 * @return {@link CreateLayoutParams} object
-		 * @see #layoutFileName
-		 */
-		public CreateLayoutParams layoutFileName(String layoutFileName) {
-			this.layoutFileName = layoutFileName;
-			return this;
-		}
-	}
-
-	/**
-	 * Returns true if user can add layout to the model.
-	 * 
-	 * @param model
-	 *          to which model user wants to add layout
-	 * @param user
-	 *          who wants to add layout
-	 * @return <code>true</code> if user can add layout, <code>false</code>
-	 *         otherwise
-	 */
-	boolean userCanAddLayout(Model model, User user);
-
-	/**
-	 * Returns true if user can remove layout from the model.
-	 * 
-	 * @param layout
-	 *          which layout user want to remove
-	 * @param user
-	 *          who wants to remove layout
-	 * @return <code>true</code> if user can remove layout, <code>false</code>
-	 *         otherwise
-	 */
-	boolean userCanRemoveLayout(LayoutView layout, User user);
-
-	/**
-	 * Returns list of custom layouts.
-	 * 
-	 * @param model
-	 *          model where the layouts lay on
-	 * @param user
-	 *          user who asks for the layouts
-	 * @return list of custom layouts
-	 */
-	List<LayoutView> getCustomLayouts(Model model, User user);
-
-	/**
-	 * Returns list of general publically available layouts.
-	 * 
-	 * @param model
-	 *          model where the layouts lay on
-	 * @return list of custom layouts
-	 */
-	List<LayoutView> getGeneralLayouts(Model model);
-
-	/**
-	 * Removes layout from the system.
-	 * 
-	 * @param layout
-	 *          layout to remove
-	 * @param homeDir
-	 *          directory where the system is deployed
-	 * @throws IOException
-	 *           thrown when there are problems with removing layout files
-	 */
-	void removeLayout(LayoutView layout, String homeDir) throws IOException;
-
-	/**
-	 * Updates data about the layout.
-	 * 
-	 * @param layout
-	 *          layout to update
-	 */
-	void updateLayout(LayoutView layout);
-
-	/**
-	 * Adds view privilege to the layout for the user.
-	 * 
-	 * @param layout
-	 *          layout for privilege
-	 * @param user
-	 *          who should own the privilege
-	 */
-	void addViewPrivilegeToLayout(LayoutView layout, User user);
-
-	/**
-	 * Removes view privilege to the layout from the user.
-	 * 
-	 * @param layout
-	 *          layout for privilege remove
-	 * @param user
-	 *          who shouldn't have the privilege
-	 */
-	void dropViewPrivilegeFromLayout(LayoutView layout, User user);
-
-	/**
-	 * Create layout based on the data in the parameter.
-	 * 
-	 * @param params
-	 *          list of {@link CreateLayoutParams params} necessary to create
-	 *          layout
-	 * @return object that refers to created layout
-	 * @throws IOException
-	 *           thrown when there are problems with files
-	 * @throws InvalidColorSchemaException
-	 *           if the coloring source is invalid
-	 * @throws CommandExecutionException
-	 */
-	LayoutView createLayout(CreateLayoutParams params) throws IOException, InvalidColorSchemaException;
-
-	/**
-	 * Create layout based on the data in the parameter. Layout will contain set
-	 * of images that can be further visualized in goolge maps api.
-	 * 
-	 * @param params
-	 *          list of {@link CreateLayoutParams params} necessary to create
-	 *          layout
-	 * @return object that refers to created layout
-	 * @throws IOException
-	 *           thrown when there are problems with files
-	 * @throws CommandExecutionException
-	 *           if the coloring source is invalid
-	 * @throws InvalidColorSchemaException
-	 *           if the coloring source is invalid
-	 */
-	LayoutView createLayoutWithImages(CreateLayoutParams params) throws IOException, CommandExecutionException, InvalidColorSchemaException;
-
-	/**
-	 * Returns number of still available custom layouts for the user.
-	 * 
-	 * @param user
-	 *          user for which the number of available custom layouts will be
-	 *          returned
-	 * @return number of available custom layouts
-	 */
-	long getAvailableCustomLayoutsNumber(User user);
-
-	/**
-	 * Returns layout identified by name and model.
-	 * 
-	 * @param model
-	 *          model where the layouts lay on
-	 * @param name
-	 *          name of the layout
-	 * @return layout
-	 */
-	LayoutView getLayoutByName(Model model, String name);
-
-	/**
-	 * Returns byte array containing data from original input file that was used
-	 * to generate the layout.
-	 * 
-	 * @param layout
-	 *          layout for which we want to retrieve original file data
-	 * @return original data file for given layout, if such file is not stored in
-	 *         database (compatibility reasons) then null is returned
-	 */
-	byte[] getInputDataForLayout(LayoutView layout);
-
-	/**
-	 * Returns a list of {@link LightLayoutAliasView aliases} that are visualized
-	 * in a {@link lcsb.mapviewer.model.map.layout.Layout}.
-	 * 
-	 * @param model
-	 *          model where data is lcoated
-	 * @param layoutId
-	 *          identifier of the layout
-	 * @return a list of {@link LightLayoutAliasView aliases} that are visualized
-	 *         in a {@link lcsb.mapviewer.model.map.layout.Layout}
-	 */
-	List<LightLayoutAliasView> getAliasesForLayout(Model model, int layoutId);
-
-	/**
-	 * Returns a list of {@link LightLayoutReactionView reactions} that are
-	 * visualized in a {@link lcsb.mapviewer.model.map.layout.Layout}.
-	 * 
-	 * @param model
-	 *          model where data is lcoated
-	 * @param layoutId
-	 *          identifier of the layout
-	 * @return a list of {@link LightLayoutReactionView reactions} that are
-	 *         visualized in a {@link lcsb.mapviewer.model.map.layout.Layout}
-	 */
-	List<LightLayoutReactionView> getReactionsForLayout(Model model, int layoutId);
-
-	/**
-	 * Returns mapping between {@link lcsb.mapviewer.model.map.layout.alias.Alias
-	 * Alias}/ {@link lcsb.mapviewer.model.map.reaction.Reaction Reaction} and
-	 * {@link ColorSchema} used for coloring object in the layout given in the
-	 * parameter.
-	 * 
-	 * @param model
-	 *          model where data is lcoated
-	 * @param layoutId
-	 *          identifier of the layout
-	 * @return a list of {@link LightLayoutReactionView reactions} that are
-	 *         visualized in a {@link lcsb.mapviewer.model.map.layout.Layout}
-	 */
-	Map<Object, ColorSchema> getElementsForLayout(Model model, Integer layoutId);
-
-	/**
-	 * Returns a list of {@link FullLayoutAliasView aliases} that are visualized
-	 * in a {@link lcsb.mapviewer.model.map.layout.Layout} and have given
-	 * identifiers.
-	 * 
-	 * @param model
-	 *          model where data is lcoated
-	 * @param layoutId
-	 *          identifier of the layout
-	 * @param identifiers
-	 *          list of alias identifiers in a given submodel. Every {@link Pair}
-	 *          contains information about {@link Model#getId() model identifier}
-	 *          (in {@link Pair#left}) and
-	 *          {@link lcsb.mapviewer.model.map.layout.alias.Alias#getId() alias
-	 *          identifier} (in {@link Pair#right}).
-	 * @return a list of {@link LightLayoutAliasView aliases} that are visualized
-	 *         in a {@link lcsb.mapviewer.model.map.layout.Layout}
-	 */
-	List<FullLayoutAliasView> getFullAliasesForLayoutByIds(Model model, List<Pair<Integer, Integer>> identifiers, int layoutId);
-
-}
+package lcsb.mapviewer.services.interfaces;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import lcsb.mapviewer.commands.CommandExecutionException;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.user.User;
+import lcsb.mapviewer.services.search.layout.FullLayoutAliasView;
+import lcsb.mapviewer.services.search.layout.LightLayoutAliasView;
+import lcsb.mapviewer.services.search.layout.LightLayoutReactionView;
+import lcsb.mapviewer.services.utils.data.ColorSchemaType;
+import lcsb.mapviewer.services.view.LayoutView;
+
+/**
+ * Service that manages layouts of the map.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public interface ILayoutService {
+
+	/**
+	 * Parameters used for creation of the layout.
+	 * 
+	 * @author Piotr Gawron
+	 * 
+	 */
+	class CreateLayoutParams {
+
+		/**
+		 * Size of the buffer used to copy stream data.
+		 */
+		private static final int			BUFFER_SIZE	= 1024;
+
+		/**
+		 * Name of the layout.
+		 * 
+		 */
+		private String								name;
+
+		/**
+		 * Description of the layout.
+		 * 
+		 */
+		private String								description;
+
+		/**
+		 * Where the graphic files should be saved.
+		 * 
+		 */
+		private String								directory;
+
+		/**
+		 * 
+		 * {@link Model} for which the layout is created.
+		 */
+		private Model									model;
+
+		/**
+		 * Who creates the layout.
+		 * 
+		 */
+		private User									user;
+
+		/**
+		 * 
+		 * Input stream with coloring information data in the stream should
+		 * correspond to a file that can be parsed by
+		 * {@link lcsb.mapviewer.services.utils.ColorSchemaXlsxReader
+		 * ColorSchemaReader} . This is a copy of original input stream, so we can
+		 * read this input stream multiple times.
+		 */
+		private ByteArrayOutputStream	colorInputStreamCopy;
+
+		/**
+		 * Name of the file used as input (if available).
+		 */
+		private String								layoutFileName;
+
+		/**
+		 * Determines if creation of the output files should be done asynchronously
+		 * who creates the layout.
+		 * 
+		 */
+		private boolean								async				= false;
+
+		/**
+		 * Type of the uploaded file.
+		 */
+		private ColorSchemaType				colorSchemaType;
+
+		/**
+		 * @return the name
+		 * @see #name
+		 */
+		public String getName() {
+			return name;
+		}
+
+		/**
+		 * @param name
+		 *          the name to set
+		 * @see #name
+		 * @return {@link CreateLayoutParams} object
+		 */
+		public CreateLayoutParams name(String name) {
+			this.name = name;
+			return this;
+		}
+
+		/**
+		 * @return the directory
+		 * @see #directory
+		 */
+		public String getDirectory() {
+			return directory;
+		}
+
+		/**
+		 * @param directory
+		 *          the directory to set
+		 * @see #directory
+		 * @return {@link CreateLayoutParams} object
+		 */
+		public CreateLayoutParams directory(String directory) {
+			this.directory = directory;
+			return this;
+		}
+
+		/**
+		 * @return the model
+		 * @see #model
+		 */
+		public Model getModel() {
+			return model;
+		}
+
+		/**
+		 * @param model
+		 *          the model to set
+		 * @see #model
+		 * @return {@link CreateLayoutParams} object
+		 */
+		public CreateLayoutParams model(Model model) {
+			this.model = model;
+			return this;
+		}
+
+		/**
+		 * @return the user
+		 * @see #user
+		 */
+		public User getUser() {
+			return user;
+		}
+
+		/**
+		 * @param user
+		 *          the user to set
+		 * @see #user
+		 * @return {@link CreateLayoutParams} object
+		 */
+		public CreateLayoutParams user(User user) {
+			this.user = user;
+			return this;
+		}
+
+		/**
+		 * @return the colorInputStream
+		 * @see #colorInputStream
+		 */
+		public InputStream getColorInputStream() {
+			return new ByteArrayInputStream(colorInputStreamCopy.toByteArray());
+		}
+
+		/**
+		 * @param colorInputStream
+		 *          the colorInputStream to set
+		 * @see #colorInputStream
+		 * @return {@link CreateLayoutParams} object
+		 * @throws IOException
+		 *           thrown when there is a problem with accessing input stream
+		 */
+		public CreateLayoutParams colorInputStream(InputStream colorInputStream) throws IOException {
+			if (colorInputStream == null) {
+				this.colorInputStreamCopy = null;
+			} else {
+				this.colorInputStreamCopy = new ByteArrayOutputStream();
+
+				byte[] buffer = new byte[BUFFER_SIZE];
+				int len;
+				while ((len = colorInputStream.read(buffer)) > -1) {
+					this.colorInputStreamCopy.write(buffer, 0, len);
+				}
+				this.colorInputStreamCopy.flush();
+			}
+			return this;
+		}
+
+		/**
+		 * @return the async
+		 * @see #async
+		 */
+		public boolean isAsync() {
+			return async;
+		}
+
+		/**
+		 * @param async
+		 *          the async to set
+		 * @see #async
+		 * @return {@link CreateLayoutParams} object
+		 */
+		public CreateLayoutParams async(boolean async) {
+			this.async = async;
+			return this;
+		}
+
+		/**
+		 * @return the description
+		 * @see #description
+		 */
+		public String getDescription() {
+			return description;
+		}
+
+		/**
+		 * @param description
+		 *          the description to set
+		 * @see #description
+		 * @return {@link CreateLayoutParams} object
+		 */
+		public CreateLayoutParams description(String description) {
+			this.description = description;
+			return this;
+		}
+
+		/**
+		 * 
+		 * @return {@link #colorSchemaType}
+		 */
+		public ColorSchemaType getColorSchemaType() {
+			return colorSchemaType;
+		}
+
+		/**
+		 * @param colorSchemaType
+		 *          the colorSchemaType to set
+		 * @see #colorSchemaType
+		 * @return {@link CreateLayoutParams} object
+		 */
+		public CreateLayoutParams colorSchemaType(ColorSchemaType colorSchemaType) {
+			this.colorSchemaType = colorSchemaType;
+			return this;
+		}
+
+		/**
+		 * @return the layoutFileName
+		 * @see #layoutFileName
+		 */
+		public String getLayoutFileName() {
+			return layoutFileName;
+		}
+
+		/**
+		 * @param layoutFileName
+		 *          the layoutFileName to set
+		 * @return {@link CreateLayoutParams} object
+		 * @see #layoutFileName
+		 */
+		public CreateLayoutParams layoutFileName(String layoutFileName) {
+			this.layoutFileName = layoutFileName;
+			return this;
+		}
+	}
+
+	/**
+	 * Returns true if user can add layout to the model.
+	 * 
+	 * @param model
+	 *          to which model user wants to add layout
+	 * @param user
+	 *          who wants to add layout
+	 * @return <code>true</code> if user can add layout, <code>false</code>
+	 *         otherwise
+	 */
+	boolean userCanAddLayout(Model model, User user);
+
+	/**
+	 * Returns true if user can remove layout from the model.
+	 * 
+	 * @param layout
+	 *          which layout user want to remove
+	 * @param user
+	 *          who wants to remove layout
+	 * @return <code>true</code> if user can remove layout, <code>false</code>
+	 *         otherwise
+	 */
+	boolean userCanRemoveLayout(LayoutView layout, User user);
+
+	/**
+	 * Returns list of custom layouts.
+	 * 
+	 * @param model
+	 *          model where the layouts lay on
+	 * @param user
+	 *          user who asks for the layouts
+	 * @return list of custom layouts
+	 */
+	List<LayoutView> getCustomLayouts(Model model, User user);
+
+	/**
+	 * Returns list of general publically available layouts.
+	 * 
+	 * @param model
+	 *          model where the layouts lay on
+	 * @return list of custom layouts
+	 */
+	List<LayoutView> getGeneralLayouts(Model model);
+
+	/**
+	 * Removes layout from the system.
+	 * 
+	 * @param layout
+	 *          layout to remove
+	 * @param homeDir
+	 *          directory where the system is deployed
+	 * @throws IOException
+	 *           thrown when there are problems with removing layout files
+	 */
+	void removeLayout(LayoutView layout, String homeDir) throws IOException;
+
+	/**
+	 * Updates data about the layout.
+	 * 
+	 * @param layout
+	 *          layout to update
+	 */
+	void updateLayout(LayoutView layout);
+
+	/**
+	 * Adds view privilege to the layout for the user.
+	 * 
+	 * @param layout
+	 *          layout for privilege
+	 * @param user
+	 *          who should own the privilege
+	 */
+	void addViewPrivilegeToLayout(LayoutView layout, User user);
+
+	/**
+	 * Removes view privilege to the layout from the user.
+	 * 
+	 * @param layout
+	 *          layout for privilege remove
+	 * @param user
+	 *          who shouldn't have the privilege
+	 */
+	void dropViewPrivilegeFromLayout(LayoutView layout, User user);
+
+	/**
+	 * Create layout based on the data in the parameter.
+	 * 
+	 * @param params
+	 *          list of {@link CreateLayoutParams params} necessary to create
+	 *          layout
+	 * @return object that refers to created layout
+	 * @throws IOException
+	 *           thrown when there are problems with files
+	 * @throws InvalidColorSchemaException
+	 *           if the coloring source is invalid
+	 * @throws CommandExecutionException
+	 */
+	LayoutView createLayout(CreateLayoutParams params) throws IOException, InvalidColorSchemaException;
+
+	/**
+	 * Create layout based on the data in the parameter. Layout will contain set
+	 * of images that can be further visualized in goolge maps api.
+	 * 
+	 * @param params
+	 *          list of {@link CreateLayoutParams params} necessary to create
+	 *          layout
+	 * @return object that refers to created layout
+	 * @throws IOException
+	 *           thrown when there are problems with files
+	 * @throws CommandExecutionException
+	 *           if the coloring source is invalid
+	 * @throws InvalidColorSchemaException
+	 *           if the coloring source is invalid
+	 */
+	LayoutView createLayoutWithImages(CreateLayoutParams params) throws IOException, CommandExecutionException, InvalidColorSchemaException;
+
+	/**
+	 * Returns number of still available custom layouts for the user.
+	 * 
+	 * @param user
+	 *          user for which the number of available custom layouts will be
+	 *          returned
+	 * @return number of available custom layouts
+	 */
+	long getAvailableCustomLayoutsNumber(User user);
+
+	/**
+	 * Returns layout identified by name and model.
+	 * 
+	 * @param model
+	 *          model where the layouts lay on
+	 * @param name
+	 *          name of the layout
+	 * @return layout
+	 */
+	LayoutView getLayoutByName(Model model, String name);
+
+	/**
+	 * Returns byte array containing data from original input file that was used
+	 * to generate the layout.
+	 * 
+	 * @param layout
+	 *          layout for which we want to retrieve original file data
+	 * @return original data file for given layout, if such file is not stored in
+	 *         database (compatibility reasons) then null is returned
+	 */
+	byte[] getInputDataForLayout(LayoutView layout);
+
+	/**
+	 * Returns a list of {@link LightLayoutAliasView aliases} that are visualized
+	 * in a {@link lcsb.mapviewer.model.map.layout.Layout}.
+	 * 
+	 * @param model
+	 *          model where data is lcoated
+	 * @param layoutId
+	 *          identifier of the layout
+	 * @return a list of {@link LightLayoutAliasView aliases} that are visualized
+	 *         in a {@link lcsb.mapviewer.model.map.layout.Layout}
+	 */
+	List<LightLayoutAliasView> getAliasesForLayout(Model model, int layoutId);
+
+	/**
+	 * Returns a list of {@link LightLayoutReactionView reactions} that are
+	 * visualized in a {@link lcsb.mapviewer.model.map.layout.Layout}.
+	 * 
+	 * @param model
+	 *          model where data is lcoated
+	 * @param layoutId
+	 *          identifier of the layout
+	 * @return a list of {@link LightLayoutReactionView reactions} that are
+	 *         visualized in a {@link lcsb.mapviewer.model.map.layout.Layout}
+	 */
+	List<LightLayoutReactionView> getReactionsForLayout(Model model, int layoutId);
+
+	/**
+	 * Returns mapping between {@link lcsb.mapviewer.model.map.layout.alias.Alias
+	 * Alias}/ {@link lcsb.mapviewer.model.map.reaction.Reaction Reaction} and
+	 * {@link ColorSchema} used for coloring object in the layout given in the
+	 * parameter.
+	 * 
+	 * @param model
+	 *          model where data is lcoated
+	 * @param layoutId
+	 *          identifier of the layout
+	 * @return a list of {@link LightLayoutReactionView reactions} that are
+	 *         visualized in a {@link lcsb.mapviewer.model.map.layout.Layout}
+	 */
+	Map<Object, ColorSchema> getElementsForLayout(Model model, Integer layoutId);
+
+	/**
+	 * Returns a list of {@link FullLayoutAliasView aliases} that are visualized
+	 * in a {@link lcsb.mapviewer.model.map.layout.Layout} and have given
+	 * identifiers.
+	 * 
+	 * @param model
+	 *          model where data is lcoated
+	 * @param layoutId
+	 *          identifier of the layout
+	 * @param identifiers
+	 *          list of alias identifiers in a given submodel. Every {@link Pair}
+	 *          contains information about {@link Model#getId() model identifier}
+	 *          (in {@link Pair#left}) and
+	 *          {@link lcsb.mapviewer.model.map.layout.alias.Alias#getId() alias
+	 *          identifier} (in {@link Pair#right}).
+	 * @return a list of {@link LightLayoutAliasView aliases} that are visualized
+	 *         in a {@link lcsb.mapviewer.model.map.layout.Layout}
+	 */
+	List<FullLayoutAliasView> getFullAliasesForLayoutByIds(Model model, List<Pair<Integer, Integer>> identifiers, int layoutId);
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/interfaces/ISearchService.java b/service/src/main/java/lcsb/mapviewer/services/interfaces/ISearchService.java
index c6664cd320..e58176d822 100644
--- a/service/src/main/java/lcsb/mapviewer/services/interfaces/ISearchService.java
+++ b/service/src/main/java/lcsb/mapviewer/services/interfaces/ISearchService.java
@@ -1,320 +1,320 @@
-package lcsb.mapviewer.services.interfaces;
-
-import java.awt.geom.Point2D;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
-import lcsb.mapviewer.model.map.model.SubmodelConnection;
-import lcsb.mapviewer.services.search.data.SearchElementResult;
-
-/**
- * Service that gives access to search functionalities.
- * 
- * @author Piotr Gawron
- * 
- */
-public interface ISearchService {
-	/**
-	 * Parameters of search objects on the map using coordinates. It's possible to
-	 * add also information about nested model and level at which searching is
-	 * performed in the hierarchical view. More information about hierarchical
-	 * view can be found in the definition of
-	 * {@link lcsb.mapviewer.converter.graphics.AbstractImageGenerator
-	 * AbstractImageGenerator}.
-	 * 
-	 * @author Piotr Gawron
-	 * 
-	 */
-	class CoordinatesSearchParams {
-
-		/**
-		 * Default class logger.
-		 */
-		private final Logger logger						= Logger.getLogger(CoordinatesSearchParams.class);
-
-		/**
-		 * Model where we perform search.
-		 */
-		private Model				 model						= null;
-
-		/**
-		 * X coordinate of the search event.
-		 */
-		private double			 x								= 0;
-
-		/**
-		 * Y coordinate of the search event.
-		 */
-		private double			 y								= 0;
-
-		/**
-		 * Maximum distance between object that could be found and point that is
-		 * valid.
-		 */
-		private double			 distance					= 0;
-
-		/**
-		 * Index of the layout in model for which we perform search. It allows to
-		 * determine if the layout is hierarchical or not.
-		 */
-		private Integer			 layoutIdentifier	= null;
-
-		/**
-		 * Level at which the search is performed. It's used during determining if
-		 * the object is visible in hierarchical view.
-		 */
-		private Integer			 level						= null;
-
-		/**
-		 * @return the model
-		 * @see #model
-		 */
-		public Model getModel() {
-			return model;
-		}
-
-		/**
-		 * @param model
-		 *          the model to set
-		 * @return object with all parameters
-		 * @see #model
-		 */
-		public CoordinatesSearchParams model(Model model) {
-			this.model = model;
-			return this;
-		}
-
-		/**
-		 * @param point
-		 *          the coordinates to set
-		 * @return object with all parameters
-		 * @see #model
-		 */
-		public CoordinatesSearchParams point(Point2D point) {
-			this.x = point.getX();
-			this.y = point.getY();
-			return this;
-		}
-
-		/**
-		 * @return the x
-		 * @see #x
-		 */
-		public double getX() {
-			return x;
-		}
-
-		/**
-		 * @param x
-		 *          the x to set
-		 * @return object with all parameters
-		 * @see #x
-		 */
-		public CoordinatesSearchParams x(double x) {
-			this.x = x;
-			return this;
-		}
-
-		/**
-		 * @return the y
-		 * @see #y
-		 */
-		public double getY() {
-			return y;
-		}
-
-		/**
-		 * @param y
-		 *          the y to set
-		 * @return object with all parameters
-		 * @see #y
-		 */
-		public CoordinatesSearchParams y(double y) {
-			this.y = y;
-			return this;
-		}
-
-		/**
-		 * @return the distance
-		 * @see #distance
-		 */
-		public double getDistance() {
-			return distance;
-		}
-
-		/**
-		 * @param distance
-		 *          the distance to set
-		 * @return object with all parameters
-		 * @see #distance
-		 */
-		public CoordinatesSearchParams distance(double distance) {
-			this.distance = distance;
-			return this;
-		}
-
-		/**
-		 * @return layout database identifier
-		 * @see #layoutIdentifier
-		 */
-		public Integer getLayoutIdentfier() {
-			return layoutIdentifier;
-		}
-
-		/**
-		 * @param layoutIdentifier
-		 *          layout database identifier to set
-		 * @return object with all parameters
-		 * @see #layoutIdentifier
-		 */
-		public CoordinatesSearchParams layoutIdentifier(Integer layoutIdentifier) {
-			nested = null;
-			this.layoutIdentifier = layoutIdentifier;
-			return this;
-		}
-
-		/**
-		 * @param level
-		 *          the level to set
-		 * @return object with all parameters
-		 * @see #level
-		 */
-		public CoordinatesSearchParams level(Integer level) {
-			this.level = level;
-			nested = null;
-			return this;
-		}
-
-		/**
-		 * @return the level
-		 * @see #level
-		 */
-		public Integer getLevel() {
-			return level;
-		}
-
-		/**
-		 * This value determines if the search is performed on the nested
-		 * (hierarchical) view or not. If nested is <code>null</code>, then it means
-		 * that the nested state is unknown and should be recomputed.
-		 */
-		private Boolean nested = null;
-
-		/**
-		 * Checks if the search param point to search in nested (hierarchical) view.
-		 * 
-		 * @return <code>true</code> if search param point to search in nested
-		 *         (hierarchical) view, <code>false</code> otherwise
-		 */
-		public boolean isNested() {
-			if (nested == null) {
-				computeNested();
-			}
-			return nested;
-		}
-
-		/**
-		 * This method finds out if the search is performed on the nested
-		 * (hierarchical) view or not and saves it in the local state.
-		 */
-		private void computeNested() {
-			nested = false;
-			if (getLayoutIdentfier() != null) {
-				Layout layout = getModel().getLayoutByIdentifier(getLayoutIdentfier());
-				if (layout != null) {
-					nested = layout.isHierarchicalView();
-				} else {
-					for (SubmodelConnection sc : getModel().getParentModels()) {
-						if (sc instanceof ModelSubmodelConnection) {
-
-							layout = ((ModelSubmodelConnection) sc).getParentModel().getModel().getLayoutByIdentifier(getLayoutIdentfier());
-							if (layout != null) {
-								break;
-							}
-						}
-					}
-					if (layout != null) {
-						nested = layout.isHierarchicalView();
-					} else {
-						logger.warn("Unkown layout with id: " + getLayoutIdentfier());
-					}
-				}
-			} else {
-				logger.warn("Layout identifier is null");
-			}
-
-		}
-
-	}
-
-	/**
-	 * Search the element on the map using coordinates. It is also possible to
-	 * provide information about layout (if it's nested or not) and hierarchical
-	 * level.
-	 * 
-	 * @param params
-	 *          set of search params. More information can be found here:
-	 *          {@link CoordinatesSearchParams}
-	 * @return object that match best the search criteria. If such object doesn't
-	 *         exist then <code>null</code> is returned.
-	 */
-	SearchElementResult searchByCoordinates(CoordinatesSearchParams params);
-
-	/**
-	 * Search for elements on the map by query. Returns many possibilities from
-	 * best matching to less matching possibility.
-	 * 
-	 * @param model
-	 *          model on which we perform search
-	 * @param query
-	 *          the query
-	 * @param limit
-	 *          maximum number of results
-	 * @param perfectMatch
-	 *          should the match be perfect
-	 * @param ipAddress
-	 *          ip address of a client who is searchin (used for logging purpose)
-	 * @return list of objects that matches the query sorted by the match quality
-	 */
-	SearchElementResult searchByQuery(Model model, String query, int limit, Boolean perfectMatch, String ipAddress);
-
-	/**
-	 * Returns the closest elements to the coordinates on the model.
-	 * 
-	 * @param model
-	 *          model on which the search is performed
-	 * @param point
-	 *          coordinates where search is performed
-	 * @param numberOfElements
-	 *          how many closest elements should be returned
-	 * @return list of the closest elements
-	 */
-	List<Object> getClosestElements(Model model, Point2D point, int numberOfElements);
-
-	/**
-	 * Returns list of autocomplete strings for the partial query.
-	 * 
-	 * @param model
-	 *          on which model the search is performed
-	 * @param query
-	 *          partial query used for autocomplete
-	 * @return list of strings that could be used for autocomplete the query
-	 */
-	List<String> getAutocompleteList(Model model, String query);
-
-	/**
-	 * Assign icons to elements in {@link SearchElementResult search result}.
-	 * 
-	 * @param results
-	 *          search result to be modified
-	 * @param iconSet
-	 *          icon set to be used
-	 * @see lcsb.mapviewer.services.overlay.IconManager
-	 */
-	void assignIcons(SearchElementResult results, int iconSet);
-
-}
+package lcsb.mapviewer.services.interfaces;
+
+import java.awt.geom.Point2D;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
+import lcsb.mapviewer.model.map.model.SubmodelConnection;
+import lcsb.mapviewer.services.search.data.SearchElementResult;
+
+/**
+ * Service that gives access to search functionalities.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public interface ISearchService {
+	/**
+	 * Parameters of search objects on the map using coordinates. It's possible to
+	 * add also information about nested model and level at which searching is
+	 * performed in the hierarchical view. More information about hierarchical
+	 * view can be found in the definition of
+	 * {@link lcsb.mapviewer.converter.graphics.AbstractImageGenerator
+	 * AbstractImageGenerator}.
+	 * 
+	 * @author Piotr Gawron
+	 * 
+	 */
+	class CoordinatesSearchParams {
+
+		/**
+		 * Default class logger.
+		 */
+		private final Logger logger						= Logger.getLogger(CoordinatesSearchParams.class);
+
+		/**
+		 * Model where we perform search.
+		 */
+		private Model				 model						= null;
+
+		/**
+		 * X coordinate of the search event.
+		 */
+		private double			 x								= 0;
+
+		/**
+		 * Y coordinate of the search event.
+		 */
+		private double			 y								= 0;
+
+		/**
+		 * Maximum distance between object that could be found and point that is
+		 * valid.
+		 */
+		private double			 distance					= 0;
+
+		/**
+		 * Index of the layout in model for which we perform search. It allows to
+		 * determine if the layout is hierarchical or not.
+		 */
+		private Integer			 layoutIdentifier	= null;
+
+		/**
+		 * Level at which the search is performed. It's used during determining if
+		 * the object is visible in hierarchical view.
+		 */
+		private Integer			 level						= null;
+
+		/**
+		 * @return the model
+		 * @see #model
+		 */
+		public Model getModel() {
+			return model;
+		}
+
+		/**
+		 * @param model
+		 *          the model to set
+		 * @return object with all parameters
+		 * @see #model
+		 */
+		public CoordinatesSearchParams model(Model model) {
+			this.model = model;
+			return this;
+		}
+
+		/**
+		 * @param point
+		 *          the coordinates to set
+		 * @return object with all parameters
+		 * @see #model
+		 */
+		public CoordinatesSearchParams point(Point2D point) {
+			this.x = point.getX();
+			this.y = point.getY();
+			return this;
+		}
+
+		/**
+		 * @return the x
+		 * @see #x
+		 */
+		public double getX() {
+			return x;
+		}
+
+		/**
+		 * @param x
+		 *          the x to set
+		 * @return object with all parameters
+		 * @see #x
+		 */
+		public CoordinatesSearchParams x(double x) {
+			this.x = x;
+			return this;
+		}
+
+		/**
+		 * @return the y
+		 * @see #y
+		 */
+		public double getY() {
+			return y;
+		}
+
+		/**
+		 * @param y
+		 *          the y to set
+		 * @return object with all parameters
+		 * @see #y
+		 */
+		public CoordinatesSearchParams y(double y) {
+			this.y = y;
+			return this;
+		}
+
+		/**
+		 * @return the distance
+		 * @see #distance
+		 */
+		public double getDistance() {
+			return distance;
+		}
+
+		/**
+		 * @param distance
+		 *          the distance to set
+		 * @return object with all parameters
+		 * @see #distance
+		 */
+		public CoordinatesSearchParams distance(double distance) {
+			this.distance = distance;
+			return this;
+		}
+
+		/**
+		 * @return layout database identifier
+		 * @see #layoutIdentifier
+		 */
+		public Integer getLayoutIdentfier() {
+			return layoutIdentifier;
+		}
+
+		/**
+		 * @param layoutIdentifier
+		 *          layout database identifier to set
+		 * @return object with all parameters
+		 * @see #layoutIdentifier
+		 */
+		public CoordinatesSearchParams layoutIdentifier(Integer layoutIdentifier) {
+			nested = null;
+			this.layoutIdentifier = layoutIdentifier;
+			return this;
+		}
+
+		/**
+		 * @param level
+		 *          the level to set
+		 * @return object with all parameters
+		 * @see #level
+		 */
+		public CoordinatesSearchParams level(Integer level) {
+			this.level = level;
+			nested = null;
+			return this;
+		}
+
+		/**
+		 * @return the level
+		 * @see #level
+		 */
+		public Integer getLevel() {
+			return level;
+		}
+
+		/**
+		 * This value determines if the search is performed on the nested
+		 * (hierarchical) view or not. If nested is <code>null</code>, then it means
+		 * that the nested state is unknown and should be recomputed.
+		 */
+		private Boolean nested = null;
+
+		/**
+		 * Checks if the search param point to search in nested (hierarchical) view.
+		 * 
+		 * @return <code>true</code> if search param point to search in nested
+		 *         (hierarchical) view, <code>false</code> otherwise
+		 */
+		public boolean isNested() {
+			if (nested == null) {
+				computeNested();
+			}
+			return nested;
+		}
+
+		/**
+		 * This method finds out if the search is performed on the nested
+		 * (hierarchical) view or not and saves it in the local state.
+		 */
+		private void computeNested() {
+			nested = false;
+			if (getLayoutIdentfier() != null) {
+				Layout layout = getModel().getLayoutByIdentifier(getLayoutIdentfier());
+				if (layout != null) {
+					nested = layout.isHierarchicalView();
+				} else {
+					for (SubmodelConnection sc : getModel().getParentModels()) {
+						if (sc instanceof ModelSubmodelConnection) {
+
+							layout = ((ModelSubmodelConnection) sc).getParentModel().getModel().getLayoutByIdentifier(getLayoutIdentfier());
+							if (layout != null) {
+								break;
+							}
+						}
+					}
+					if (layout != null) {
+						nested = layout.isHierarchicalView();
+					} else {
+						logger.warn("Unkown layout with id: " + getLayoutIdentfier());
+					}
+				}
+			} else {
+				logger.warn("Layout identifier is null");
+			}
+
+		}
+
+	}
+
+	/**
+	 * Search the element on the map using coordinates. It is also possible to
+	 * provide information about layout (if it's nested or not) and hierarchical
+	 * level.
+	 * 
+	 * @param params
+	 *          set of search params. More information can be found here:
+	 *          {@link CoordinatesSearchParams}
+	 * @return object that match best the search criteria. If such object doesn't
+	 *         exist then <code>null</code> is returned.
+	 */
+	SearchElementResult searchByCoordinates(CoordinatesSearchParams params);
+
+	/**
+	 * Search for elements on the map by query. Returns many possibilities from
+	 * best matching to less matching possibility.
+	 * 
+	 * @param model
+	 *          model on which we perform search
+	 * @param query
+	 *          the query
+	 * @param limit
+	 *          maximum number of results
+	 * @param perfectMatch
+	 *          should the match be perfect
+	 * @param ipAddress
+	 *          ip address of a client who is searchin (used for logging purpose)
+	 * @return list of objects that matches the query sorted by the match quality
+	 */
+	SearchElementResult searchByQuery(Model model, String query, int limit, Boolean perfectMatch, String ipAddress);
+
+	/**
+	 * Returns the closest elements to the coordinates on the model.
+	 * 
+	 * @param model
+	 *          model on which the search is performed
+	 * @param point
+	 *          coordinates where search is performed
+	 * @param numberOfElements
+	 *          how many closest elements should be returned
+	 * @return list of the closest elements
+	 */
+	List<Object> getClosestElements(Model model, Point2D point, int numberOfElements);
+
+	/**
+	 * Returns list of autocomplete strings for the partial query.
+	 * 
+	 * @param model
+	 *          on which model the search is performed
+	 * @param query
+	 *          partial query used for autocomplete
+	 * @return list of strings that could be used for autocomplete the query
+	 */
+	List<String> getAutocompleteList(Model model, String query);
+
+	/**
+	 * Assign icons to elements in {@link SearchElementResult search result}.
+	 * 
+	 * @param results
+	 *          search result to be modified
+	 * @param iconSet
+	 *          icon set to be used
+	 * @see lcsb.mapviewer.services.overlay.IconManager
+	 */
+	void assignIcons(SearchElementResult results, int iconSet);
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/search/ISearchResultView.java b/service/src/main/java/lcsb/mapviewer/services/search/ISearchResultView.java
index 9ae22f8517..0c115ed7ee 100644
--- a/service/src/main/java/lcsb/mapviewer/services/search/ISearchResultView.java
+++ b/service/src/main/java/lcsb/mapviewer/services/search/ISearchResultView.java
@@ -1,31 +1,31 @@
-package lcsb.mapviewer.services.search;
-
-import java.io.Serializable;
-
-/**
- * Result of search engine (it can be result of standard search method, or drug
- * search, mirna search etc).
- * 
- * @author Piotr Gawron
- *
- */
-public interface ISearchResultView extends Serializable {
-
-	/**
-	 * Returns unique identifiers of the search (search with the same identifier
-	 * should have the same content).
-	 * 
-	 * @return unique identifier of the search
-	 */
-	String getUniqueId();
-
-	/**
-	 * Sets unique identifiers of the search (search with the same identifier
-	 * should have the same content).
-	 * 
-	 * @param uniqueId
-	 *          identifier of the search
-	 */
-	void setUniqueId(String uniqueId);
-
-}
+package lcsb.mapviewer.services.search;
+
+import java.io.Serializable;
+
+/**
+ * Result of search engine (it can be result of standard search method, or drug
+ * search, mirna search etc).
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public interface ISearchResultView extends Serializable {
+
+	/**
+	 * Returns unique identifiers of the search (search with the same identifier
+	 * should have the same content).
+	 * 
+	 * @return unique identifier of the search
+	 */
+	String getUniqueId();
+
+	/**
+	 * Sets unique identifiers of the search (search with the same identifier
+	 * should have the same content).
+	 * 
+	 * @param uniqueId
+	 *          identifier of the search
+	 */
+	void setUniqueId(String uniqueId);
+
+}
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 a531c1b6d7..060d242ccb 100644
--- a/service/src/main/java/lcsb/mapviewer/services/search/SearchResultFactory.java
+++ b/service/src/main/java/lcsb/mapviewer/services/search/SearchResultFactory.java
@@ -1,220 +1,220 @@
-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.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-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;
-import lcsb.mapviewer.services.search.db.TargetDetails;
-import lcsb.mapviewer.services.search.db.TargetView;
-import lcsb.mapviewer.services.view.AnnotationViewFactory;
-
-/**
- * Factory for {@link ISearchResultView search results}.
- * 
- * @author Piotr Gawron
- *
- * @param <T>
- *          type from which objects arec reated
- * @param <S>
- *          search ruslt type
- */
-@Transactional(value = "txManager")
-public abstract class SearchResultFactory<T, S extends ISearchResultView> extends ElementViewFactory<T, S> {
-
-	/**
-	 * Default class logger.
-	 */
-	private final Logger logger = Logger.getLogger(SearchResultFactory.class);
-
-	/**
-	 * Creates list of object identifiers from search result.
-	 * 
-	 * @param object
-	 *          search result from which elements should be extracted
-	 * @param model
-	 *          model on which search was performed
-	 * @return list of lightweighted structures for given search result
-	 */
-	public abstract List<ElementIdentifier> searchResultToElementIdentifier(S object, Model model);
-
-	/**
-	 * Factory object used for creation of
-	 * {@link lcsb.mapviewer.services.view.AnnotationView} elements.
-	 */
-	@Autowired
-	private AnnotationViewFactory annotationViewFactory;
-
-	/**
-	 * Returns detailed information about element respective to the set of targets
-	 * (which should be connected to single drug/mirna/chemical).
-	 * 
-	 * @param element
-	 *          element for which we are looking for detailed information
-	 * @param model
-	 *          {@link Model} on which element is located
-	 * @param targets
-	 *          list of targets from which detailed information should be
-	 *          extracted
-	 * @return detailed information for element in the specific drug,
-	 *         <code>null</code> if such information doesnt exist
-	 */
-	public TargetDetails getElementInformationForResult(Collection<TargetView> targets, ElementIdentifier element, Model model) {
-		if (ElementIdentifierType.REACTION.getJsName().equalsIgnoreCase(element.getType())) {
-			logger.warn("Detail information for reactions not available");
-			return null;
-		} else if (ElementIdentifierType.POINT.getJsName().equalsIgnoreCase(element.getType())) {
-			logger.warn("Detail information for points not available");
-			return null;
-		} else if (ElementIdentifierType.ALIAS.getJsName().equalsIgnoreCase(element.getType())) {
-			Model m = model.getSubmodelById(element.getModelId());
-			Alias alias = m.getAliasByDbId(Integer.valueOf(element.getObjectId()));
-			if (alias == null) {
-				logger.warn("Alias with object id = " + element.getObjectId() + " is unknown.");
-				return null;
-			}
-			Element mapElement = alias.getElement();
-
-			for (TargetView row : targets) {
-				if (elementMatch(row, mapElement)) {
-					TargetDetails result = new TargetDetails();
-					result.setDatabaseSource(row.getAnnotation());
-					for (Article article : row.getReferences()) {
-						result.getReferences().add(annotationViewFactory.create(article));
-					}
-					for (GeneRow protein : row.getProteins()) {
-						result.getReferences().add(protein.getAnnotation());
-					}
-					return result;
-				}
-			}
-		} else {
-			throw new InvalidArgumentException("Unknown element type: " + element.getType());
-		}
-		return null;
-	}
-
-	/**
-	 * Check if the target should be applied to the element.
-	 * 
-	 * @param target
-	 *          drug target to check
-	 * @param element
-	 *          {@link Element} to check
-	 * @return <code>true</code> if drug target can target element,
-	 *         <code>false</code> otherwise
-	 */
-	protected boolean elementMatch(TargetView target, Element element) {
-		if (target.getType().equals(TargetType.COMPLEX_PROTEIN.getCommonName())) {
-			MiriamData targetAnnotation = annotationViewFactory.viewToObject(target.getAnnotation());
-			if (MiriamType.CHEMBL_TARGET.equals(targetAnnotation.getDataType())) {
-				if (element.getMiriamData().contains(targetAnnotation)) {
-					return true;
-				}
-			}
-			Collection<String> ids = new HashSet<String>();
-			for (GeneRow row : target.getProteins()) {
-				ids.add(row.getAnnotation().getName());
-			}
-
-			if (element instanceof ComplexSpecies) {
-				ComplexSpecies complex = (ComplexSpecies) element;
-				Set<Species> speciesSet = complex.getAllSimpleChildren();
-				if (speciesSet.size() != ids.size()) {
-					return false;
-				}
-
-				for (Species id : speciesSet) {
-					if (!ids.contains(id.getName())) {
-						return false;
-					}
-				}
-				return true;
-			}
-			return false;
-		} else if (target.getType().equals(TargetType.SINGLE_PROTEIN.getCommonName())) {
-			MiriamData targetAnnotation = null;
-			if (target.getAnnotation() != null) {
-				targetAnnotation = annotationViewFactory.viewToObject(target.getAnnotation());
-			} else if (target.getProteins().size() > 0) {
-				targetAnnotation = annotationViewFactory.viewToObject(target.getProteins().get(0).getAnnotation());
-			} else {
-				logger.warn("Invalid target found: " + target);
-			}
-			if (targetAnnotation != null && element.getMiriamData().contains(targetAnnotation)) {
-				return true;
-			}
-			if (element instanceof Protein || element instanceof Rna || element instanceof Gene) {
-				if (target.getProteins().size() > 0) {
-					String hgncId = target.getProteins().get(0).getAnnotation().getName();
-					if (element.getName().equalsIgnoreCase(hgncId)) {
-						return true;
-					}
-				}
-			}
-			return false;
-		} else if (target.getType().equals(TargetType.PROTEIN_FAMILY.getCommonName())) {
-			if (element instanceof Protein || element instanceof Rna || element instanceof Gene) {
-				String hgncId = target.getProteins().get(0).getAnnotation().getName();
-				if (element.getName().equalsIgnoreCase(hgncId)) {
-					return true;
-				} else if (element.getMiriamData().contains(new MiriamData(MiriamType.HGNC_SYMBOL, hgncId))) {
-					return true;
-				}
-				for (GeneRow protein : target.getProteins()) {
-					hgncId = protein.getAnnotation().getName();
-					if (element.getName().equalsIgnoreCase(hgncId)) {
-						return true;
-					} else if (element.getMiriamData().contains(new MiriamData(MiriamType.HGNC_SYMBOL, hgncId))) {
-						return true;
-					}
-				}
-			}
-			return false;
-		} else if (target.getType().equals(TargetType.OTHER.getCommonName())) {
-			// in other case just compare names
-			String name = target.getProteins().get(0).getAnnotation().getName();
-			return element.getName().equalsIgnoreCase(name);
-		} else {
-			throw new InvalidArgumentException("Unknown drug target type: " + target.getType());
-		}
-	}
-
-	/**
-	 * @return the annotationViewFactory
-	 * @see #annotationViewFactory
-	 */
-	public AnnotationViewFactory getAnnotationViewFactory() {
-		return annotationViewFactory;
-	}
-
-	/**
-	 * @param annotationViewFactory
-	 *          the annotationViewFactory to set
-	 * @see #annotationViewFactory
-	 */
-	public void setAnnotationViewFactory(AnnotationViewFactory annotationViewFactory) {
-		this.annotationViewFactory = annotationViewFactory;
-	}
-
-}
+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.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+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;
+import lcsb.mapviewer.services.search.db.TargetDetails;
+import lcsb.mapviewer.services.search.db.TargetView;
+import lcsb.mapviewer.services.view.AnnotationViewFactory;
+
+/**
+ * Factory for {@link ISearchResultView search results}.
+ * 
+ * @author Piotr Gawron
+ *
+ * @param <T>
+ *          type from which objects arec reated
+ * @param <S>
+ *          search ruslt type
+ */
+@Transactional(value = "txManager")
+public abstract class SearchResultFactory<T, S extends ISearchResultView> extends ElementViewFactory<T, S> {
+
+	/**
+	 * Default class logger.
+	 */
+	private final Logger logger = Logger.getLogger(SearchResultFactory.class);
+
+	/**
+	 * Creates list of object identifiers from search result.
+	 * 
+	 * @param object
+	 *          search result from which elements should be extracted
+	 * @param model
+	 *          model on which search was performed
+	 * @return list of lightweighted structures for given search result
+	 */
+	public abstract List<ElementIdentifier> searchResultToElementIdentifier(S object, Model model);
+
+	/**
+	 * Factory object used for creation of
+	 * {@link lcsb.mapviewer.services.view.AnnotationView} elements.
+	 */
+	@Autowired
+	private AnnotationViewFactory annotationViewFactory;
+
+	/**
+	 * Returns detailed information about element respective to the set of targets
+	 * (which should be connected to single drug/mirna/chemical).
+	 * 
+	 * @param element
+	 *          element for which we are looking for detailed information
+	 * @param model
+	 *          {@link Model} on which element is located
+	 * @param targets
+	 *          list of targets from which detailed information should be
+	 *          extracted
+	 * @return detailed information for element in the specific drug,
+	 *         <code>null</code> if such information doesnt exist
+	 */
+	public TargetDetails getElementInformationForResult(Collection<TargetView> targets, ElementIdentifier element, Model model) {
+		if (ElementIdentifierType.REACTION.getJsName().equalsIgnoreCase(element.getType())) {
+			logger.warn("Detail information for reactions not available");
+			return null;
+		} else if (ElementIdentifierType.POINT.getJsName().equalsIgnoreCase(element.getType())) {
+			logger.warn("Detail information for points not available");
+			return null;
+		} else if (ElementIdentifierType.ALIAS.getJsName().equalsIgnoreCase(element.getType())) {
+			Model m = model.getSubmodelById(element.getModelId());
+			Alias alias = m.getAliasByDbId(Integer.valueOf(element.getObjectId()));
+			if (alias == null) {
+				logger.warn("Alias with object id = " + element.getObjectId() + " is unknown.");
+				return null;
+			}
+			Element mapElement = alias.getElement();
+
+			for (TargetView row : targets) {
+				if (elementMatch(row, mapElement)) {
+					TargetDetails result = new TargetDetails();
+					result.setDatabaseSource(row.getAnnotation());
+					for (Article article : row.getReferences()) {
+						result.getReferences().add(annotationViewFactory.create(article));
+					}
+					for (GeneRow protein : row.getProteins()) {
+						result.getReferences().add(protein.getAnnotation());
+					}
+					return result;
+				}
+			}
+		} else {
+			throw new InvalidArgumentException("Unknown element type: " + element.getType());
+		}
+		return null;
+	}
+
+	/**
+	 * Check if the target should be applied to the element.
+	 * 
+	 * @param target
+	 *          drug target to check
+	 * @param element
+	 *          {@link Element} to check
+	 * @return <code>true</code> if drug target can target element,
+	 *         <code>false</code> otherwise
+	 */
+	protected boolean elementMatch(TargetView target, Element element) {
+		if (target.getType().equals(TargetType.COMPLEX_PROTEIN.getCommonName())) {
+			MiriamData targetAnnotation = annotationViewFactory.viewToObject(target.getAnnotation());
+			if (MiriamType.CHEMBL_TARGET.equals(targetAnnotation.getDataType())) {
+				if (element.getMiriamData().contains(targetAnnotation)) {
+					return true;
+				}
+			}
+			Collection<String> ids = new HashSet<String>();
+			for (GeneRow row : target.getProteins()) {
+				ids.add(row.getAnnotation().getName());
+			}
+
+			if (element instanceof ComplexSpecies) {
+				ComplexSpecies complex = (ComplexSpecies) element;
+				Set<Species> speciesSet = complex.getAllSimpleChildren();
+				if (speciesSet.size() != ids.size()) {
+					return false;
+				}
+
+				for (Species id : speciesSet) {
+					if (!ids.contains(id.getName())) {
+						return false;
+					}
+				}
+				return true;
+			}
+			return false;
+		} else if (target.getType().equals(TargetType.SINGLE_PROTEIN.getCommonName())) {
+			MiriamData targetAnnotation = null;
+			if (target.getAnnotation() != null) {
+				targetAnnotation = annotationViewFactory.viewToObject(target.getAnnotation());
+			} else if (target.getProteins().size() > 0) {
+				targetAnnotation = annotationViewFactory.viewToObject(target.getProteins().get(0).getAnnotation());
+			} else {
+				logger.warn("Invalid target found: " + target);
+			}
+			if (targetAnnotation != null && element.getMiriamData().contains(targetAnnotation)) {
+				return true;
+			}
+			if (element instanceof Protein || element instanceof Rna || element instanceof Gene) {
+				if (target.getProteins().size() > 0) {
+					String hgncId = target.getProteins().get(0).getAnnotation().getName();
+					if (element.getName().equalsIgnoreCase(hgncId)) {
+						return true;
+					}
+				}
+			}
+			return false;
+		} else if (target.getType().equals(TargetType.PROTEIN_FAMILY.getCommonName())) {
+			if (element instanceof Protein || element instanceof Rna || element instanceof Gene) {
+				String hgncId = target.getProteins().get(0).getAnnotation().getName();
+				if (element.getName().equalsIgnoreCase(hgncId)) {
+					return true;
+				} else if (element.getMiriamData().contains(new MiriamData(MiriamType.HGNC_SYMBOL, hgncId))) {
+					return true;
+				}
+				for (GeneRow protein : target.getProteins()) {
+					hgncId = protein.getAnnotation().getName();
+					if (element.getName().equalsIgnoreCase(hgncId)) {
+						return true;
+					} else if (element.getMiriamData().contains(new MiriamData(MiriamType.HGNC_SYMBOL, hgncId))) {
+						return true;
+					}
+				}
+			}
+			return false;
+		} else if (target.getType().equals(TargetType.OTHER.getCommonName())) {
+			// in other case just compare names
+			String name = target.getProteins().get(0).getAnnotation().getName();
+			return element.getName().equalsIgnoreCase(name);
+		} else {
+			throw new InvalidArgumentException("Unknown drug target type: " + target.getType());
+		}
+	}
+
+	/**
+	 * @return the annotationViewFactory
+	 * @see #annotationViewFactory
+	 */
+	public AnnotationViewFactory getAnnotationViewFactory() {
+		return annotationViewFactory;
+	}
+
+	/**
+	 * @param annotationViewFactory
+	 *          the annotationViewFactory to set
+	 * @see #annotationViewFactory
+	 */
+	public void setAnnotationViewFactory(AnnotationViewFactory annotationViewFactory) {
+		this.annotationViewFactory = annotationViewFactory;
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/search/comment/FullCommentView.java b/service/src/main/java/lcsb/mapviewer/services/search/comment/FullCommentView.java
index 8c8000c88a..871f7150b1 100644
--- a/service/src/main/java/lcsb/mapviewer/services/search/comment/FullCommentView.java
+++ b/service/src/main/java/lcsb/mapviewer/services/search/comment/FullCommentView.java
@@ -1,97 +1,97 @@
-package lcsb.mapviewer.services.search.comment;
-
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.List;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.services.search.ISearchResultView;
-
-/**
- * This class represent data that are sent into the client (by designe Google
- * Map object, but not necessery). It is connected to the comment on the map. It
- * contains information required for vizualization like localization
- * information. However, there are no information about formating, css, etc.
- * 
- * @author Piotr Gawron
- * 
- */
-public class FullCommentView extends LightCommentView implements ISearchResultView {
-
-	/**
-	 * 
-	 */
-	private static final long					 serialVersionUID	= 1L;
-
-	/**
-	 * List of comments in the marker. {@link Pair#left} is id of a comment;
-	 * {@link Pair#right} is a content.
-	 */
-	private List<Pair<String, String>> comments					= new ArrayList<Pair<String, String>>();
-
-	/**
-	 * Type of the object that is commented.
-	 */
-	private Class<?>									 type							= null;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param point
-	 *          {@link Point2D} where the comment is placed
-	 * @param idModel
-	 *          identifier of the model where comment is placed
-	 * 
-	 */
-	public FullCommentView(Point2D point, Integer idModel) {
-		super(point, idModel);
-	}
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param objectId
-	 *          identifier of the element that is commented
-	 * @param idModel
-	 *          identifier of the model where comment is placed
-	 * 
-	 */
-	public FullCommentView(Integer objectId, Integer idModel) {
-		super(objectId, idModel);
-	}
-
-	/**
-	 * @return the comments
-	 * @see #comments
-	 */
-	public List<Pair<String, String>> getComments() {
-		return comments;
-	}
-
-	/**
-	 * @param comments
-	 *          the comments to set
-	 * @see #comments
-	 */
-	public void setComments(List<Pair<String, String>> comments) {
-		this.comments = comments;
-	}
-
-	/**
-	 * @return the type
-	 * @see #type
-	 */
-	public Class<?> getType() {
-		return type;
-	}
-
-	/**
-	 * @param type
-	 *          the type to set
-	 * @see #type
-	 */
-	public void setType(Class<?> type) {
-		this.type = type;
-	}
-
-}
+package lcsb.mapviewer.services.search.comment;
+
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.services.search.ISearchResultView;
+
+/**
+ * This class represent data that are sent into the client (by designe Google
+ * Map object, but not necessery). It is connected to the comment on the map. It
+ * contains information required for vizualization like localization
+ * information. However, there are no information about formating, css, etc.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class FullCommentView extends LightCommentView implements ISearchResultView {
+
+	/**
+	 * 
+	 */
+	private static final long					 serialVersionUID	= 1L;
+
+	/**
+	 * List of comments in the marker. {@link Pair#left} is id of a comment;
+	 * {@link Pair#right} is a content.
+	 */
+	private List<Pair<String, String>> comments					= new ArrayList<Pair<String, String>>();
+
+	/**
+	 * Type of the object that is commented.
+	 */
+	private Class<?>									 type							= null;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param point
+	 *          {@link Point2D} where the comment is placed
+	 * @param idModel
+	 *          identifier of the model where comment is placed
+	 * 
+	 */
+	public FullCommentView(Point2D point, Integer idModel) {
+		super(point, idModel);
+	}
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param objectId
+	 *          identifier of the element that is commented
+	 * @param idModel
+	 *          identifier of the model where comment is placed
+	 * 
+	 */
+	public FullCommentView(Integer objectId, Integer idModel) {
+		super(objectId, idModel);
+	}
+
+	/**
+	 * @return the comments
+	 * @see #comments
+	 */
+	public List<Pair<String, String>> getComments() {
+		return comments;
+	}
+
+	/**
+	 * @param comments
+	 *          the comments to set
+	 * @see #comments
+	 */
+	public void setComments(List<Pair<String, String>> comments) {
+		this.comments = comments;
+	}
+
+	/**
+	 * @return the type
+	 * @see #type
+	 */
+	public Class<?> getType() {
+		return type;
+	}
+
+	/**
+	 * @param type
+	 *          the type to set
+	 * @see #type
+	 */
+	public void setType(Class<?> type) {
+		this.type = type;
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/search/data/LightReactionView.java b/service/src/main/java/lcsb/mapviewer/services/search/data/LightReactionView.java
index 959a3185ed..beb4349e49 100644
--- a/service/src/main/java/lcsb/mapviewer/services/search/data/LightReactionView.java
+++ b/service/src/main/java/lcsb/mapviewer/services/search/data/LightReactionView.java
@@ -1,198 +1,198 @@
-package lcsb.mapviewer.services.search.data;
-
-import java.awt.geom.Line2D;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.List;
-
-import lcsb.mapviewer.model.map.reaction.Modifier;
-import lcsb.mapviewer.model.map.reaction.NodeOperator;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.services.search.ElementView;
-import lcsb.mapviewer.services.search.ILightView;
-
-/**
- * Light {@link ElementView view} for alias representing data that should be
- * send to client.
- * 
- * @author Piotr Gawron
- *
- */
-public class LightReactionView extends ElementView implements ILightView {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * List of lines that depict the reaction.
-	 */
-	private List<LightLine>		lines						 = new ArrayList<>();
-
-	/**
-	 * Central point of the reaction.
-	 */
-	private Point2D						centerPoint;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param reaction
-	 *          original {@link Reaction} from which the object is created
-	 */
-	public LightReactionView(Reaction reaction) {
-		super(reaction.getId(), reaction.getModel().getId());
-		if (reaction != null) {
-			for (Reactant reactant : reaction.getReactants()) {
-				addReactantLines(reactant);
-			}
-			for (Product product : reaction.getProducts()) {
-				addProductLines(product);
-			}
-			for (Modifier modifier : reaction.getModifiers()) {
-				addModifierLines(modifier);
-			}
-			for (NodeOperator operator : reaction.getOperators()) {
-				addOperatorLines(operator);
-			}
-			setCenterPoint(reaction.getCenterPoint());
-		}
-	}
-
-	/**
-	 * Transform {@link NodeOperator} into set of {@link LightLine lines} and put
-	 * them into {@link #lines} field.
-	 * 
-	 * @param operator
-	 *          operator to be transformed
-	 */
-	private void addOperatorLines(NodeOperator operator) {
-		List<Line2D> rLines = operator.getLine().getLines();
-		for (int i = 0; i < rLines.size(); i++) {
-			LightLine l = new LightLine(rLines.get(i));
-			l.setType(LightLineType.MIDDLE);
-			lines.add(l);
-		}
-	}
-
-	/**
-	 * Transform {@link Modifier} into set of {@link LightLine lines} and put them
-	 * into {@link #lines} field.
-	 * 
-	 * @param modifier
-	 *          modifier to be transformed
-	 */
-	private void addModifierLines(Modifier modifier) {
-		List<Line2D> rLines = modifier.getLine().getLines();
-		if (rLines.size() > 0) {
-			LightLine l = new LightLine(rLines.get(rLines.size() - 1));
-			l.setType(LightLineType.MIDDLE);
-			lines.add(l);
-			for (int i = 0; i < rLines.size() - 1; i++) {
-				l = new LightLine(rLines.get(i));
-				l.setType(LightLineType.MIDDLE);
-				lines.add(l);
-			}
-		}
-	}
-
-	/**
-	 * Transform {@link Product} into set of {@link LightLine lines} and put them
-	 * into {@link #lines} field.
-	 * 
-	 * @param product
-	 *          product to be transformed
-	 */
-	private void addProductLines(Product product) {
-		List<Line2D> rLines = product.getLine().getLines();
-		if (rLines.size() > 0) {
-			LightLine l = new LightLine(rLines.get(rLines.size() - 1));
-			l.setType(LightLineType.END);
-			lines.add(l);
-			for (int i = 0; i < rLines.size() - 1; i++) {
-				l = new LightLine(rLines.get(i));
-				l.setType(LightLineType.MIDDLE);
-				lines.add(l);
-			}
-		}
-	}
-
-	/**
-	 * Transform {@link Reactant} into set of {@link LightLine lines} and put them
-	 * into {@link #lines} field.
-	 * 
-	 * @param reactant
-	 *          reactant to be transformed
-	 */
-	public void addReactantLines(Reactant reactant) {
-		List<Line2D> rLines = reactant.getLine().getLines();
-		if (rLines.size() > 0) {
-			LightLine l = new LightLine(rLines.get(0));
-			l.setType(LightLineType.START);
-			lines.add(l);
-			for (int i = 1; i < rLines.size(); i++) {
-				l = new LightLine(rLines.get(i));
-				l.setType(LightLineType.MIDDLE);
-				lines.add(l);
-			}
-		}
-	}
-
-	/**
-	 * Constructor that should be used only for (de)serialization.
-	 */
-	protected LightReactionView() {
-		super();
-	}
-
-	/**
-	 * Contructor that creates object from {@link FullReactionView} by copying the
-	 * values from it.
-	 * 
-	 * @param original
-	 *          original object
-	 */
-	protected LightReactionView(FullReactionView original) {
-		super(original.getUniqueId(), original.getModelId());
-		for (LightLine line : original.getLines()) {
-			lines.add(new LightLine(line));
-		}
-	}
-
-	/**
-	 * @return the lines
-	 * @see #lines
-	 */
-	public List<LightLine> getLines() {
-		return lines;
-	}
-
-	/**
-	 * @param lines
-	 *          the lines to set
-	 * @see #lines
-	 */
-	public void setLines(List<LightLine> lines) {
-		this.lines = lines;
-	}
-
-	/**
-	 * @return the centerPoint
-	 * @see #centerPoint
-	 */
-	public Point2D getCenterPoint() {
-		return centerPoint;
-	}
-
-	/**
-	 * @param centerPoint
-	 *          the centerPoint to set
-	 * @see #centerPoint
-	 */
-	public void setCenterPoint(Point2D centerPoint) {
-		this.centerPoint = centerPoint;
-	}
-}
+package lcsb.mapviewer.services.search.data;
+
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import lcsb.mapviewer.model.map.reaction.Modifier;
+import lcsb.mapviewer.model.map.reaction.NodeOperator;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.services.search.ElementView;
+import lcsb.mapviewer.services.search.ILightView;
+
+/**
+ * Light {@link ElementView view} for alias representing data that should be
+ * send to client.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class LightReactionView extends ElementView implements ILightView {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * List of lines that depict the reaction.
+	 */
+	private List<LightLine>		lines						 = new ArrayList<>();
+
+	/**
+	 * Central point of the reaction.
+	 */
+	private Point2D						centerPoint;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param reaction
+	 *          original {@link Reaction} from which the object is created
+	 */
+	public LightReactionView(Reaction reaction) {
+		super(reaction.getId(), reaction.getModel().getId());
+		if (reaction != null) {
+			for (Reactant reactant : reaction.getReactants()) {
+				addReactantLines(reactant);
+			}
+			for (Product product : reaction.getProducts()) {
+				addProductLines(product);
+			}
+			for (Modifier modifier : reaction.getModifiers()) {
+				addModifierLines(modifier);
+			}
+			for (NodeOperator operator : reaction.getOperators()) {
+				addOperatorLines(operator);
+			}
+			setCenterPoint(reaction.getCenterPoint());
+		}
+	}
+
+	/**
+	 * Transform {@link NodeOperator} into set of {@link LightLine lines} and put
+	 * them into {@link #lines} field.
+	 * 
+	 * @param operator
+	 *          operator to be transformed
+	 */
+	private void addOperatorLines(NodeOperator operator) {
+		List<Line2D> rLines = operator.getLine().getLines();
+		for (int i = 0; i < rLines.size(); i++) {
+			LightLine l = new LightLine(rLines.get(i));
+			l.setType(LightLineType.MIDDLE);
+			lines.add(l);
+		}
+	}
+
+	/**
+	 * Transform {@link Modifier} into set of {@link LightLine lines} and put them
+	 * into {@link #lines} field.
+	 * 
+	 * @param modifier
+	 *          modifier to be transformed
+	 */
+	private void addModifierLines(Modifier modifier) {
+		List<Line2D> rLines = modifier.getLine().getLines();
+		if (rLines.size() > 0) {
+			LightLine l = new LightLine(rLines.get(rLines.size() - 1));
+			l.setType(LightLineType.MIDDLE);
+			lines.add(l);
+			for (int i = 0; i < rLines.size() - 1; i++) {
+				l = new LightLine(rLines.get(i));
+				l.setType(LightLineType.MIDDLE);
+				lines.add(l);
+			}
+		}
+	}
+
+	/**
+	 * Transform {@link Product} into set of {@link LightLine lines} and put them
+	 * into {@link #lines} field.
+	 * 
+	 * @param product
+	 *          product to be transformed
+	 */
+	private void addProductLines(Product product) {
+		List<Line2D> rLines = product.getLine().getLines();
+		if (rLines.size() > 0) {
+			LightLine l = new LightLine(rLines.get(rLines.size() - 1));
+			l.setType(LightLineType.END);
+			lines.add(l);
+			for (int i = 0; i < rLines.size() - 1; i++) {
+				l = new LightLine(rLines.get(i));
+				l.setType(LightLineType.MIDDLE);
+				lines.add(l);
+			}
+		}
+	}
+
+	/**
+	 * Transform {@link Reactant} into set of {@link LightLine lines} and put them
+	 * into {@link #lines} field.
+	 * 
+	 * @param reactant
+	 *          reactant to be transformed
+	 */
+	public void addReactantLines(Reactant reactant) {
+		List<Line2D> rLines = reactant.getLine().getLines();
+		if (rLines.size() > 0) {
+			LightLine l = new LightLine(rLines.get(0));
+			l.setType(LightLineType.START);
+			lines.add(l);
+			for (int i = 1; i < rLines.size(); i++) {
+				l = new LightLine(rLines.get(i));
+				l.setType(LightLineType.MIDDLE);
+				lines.add(l);
+			}
+		}
+	}
+
+	/**
+	 * Constructor that should be used only for (de)serialization.
+	 */
+	protected LightReactionView() {
+		super();
+	}
+
+	/**
+	 * Contructor that creates object from {@link FullReactionView} by copying the
+	 * values from it.
+	 * 
+	 * @param original
+	 *          original object
+	 */
+	protected LightReactionView(FullReactionView original) {
+		super(original.getUniqueId(), original.getModelId());
+		for (LightLine line : original.getLines()) {
+			lines.add(new LightLine(line));
+		}
+	}
+
+	/**
+	 * @return the lines
+	 * @see #lines
+	 */
+	public List<LightLine> getLines() {
+		return lines;
+	}
+
+	/**
+	 * @param lines
+	 *          the lines to set
+	 * @see #lines
+	 */
+	public void setLines(List<LightLine> lines) {
+		this.lines = lines;
+	}
+
+	/**
+	 * @return the centerPoint
+	 * @see #centerPoint
+	 */
+	public Point2D getCenterPoint() {
+		return centerPoint;
+	}
+
+	/**
+	 * @param centerPoint
+	 *          the centerPoint to set
+	 * @see #centerPoint
+	 */
+	public void setCenterPoint(Point2D centerPoint) {
+		this.centerPoint = centerPoint;
+	}
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/search/data/SearchElementResult.java b/service/src/main/java/lcsb/mapviewer/services/search/data/SearchElementResult.java
index 3c4e9e263c..02d0129b08 100644
--- a/service/src/main/java/lcsb/mapviewer/services/search/data/SearchElementResult.java
+++ b/service/src/main/java/lcsb/mapviewer/services/search/data/SearchElementResult.java
@@ -1,129 +1,129 @@
-package lcsb.mapviewer.services.search.data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import lcsb.mapviewer.services.search.IHeavyView;
-import lcsb.mapviewer.services.search.ISearchResultView;
-
-/**
- * Class representing result of search query.
- * 
- * @author Piotr Gawron
- *
- */
-public class SearchElementResult implements Serializable, ISearchResultView {
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * String that identifies this search result (all results with the same id
-	 * should have the same content).
-	 */
-	private String						uniqueId;
-
-	/**
-	 * List of elements found as a results of the search operation.
-	 */
-	private List<IHeavyView>	elements				 = new ArrayList<>();
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param name
-	 *          search query used to create a result
-	 */
-	public SearchElementResult(String name) {
-		setName(name);
-	}
-
-	@Override
-	public String getUniqueId() {
-		return uniqueId;
-	}
-
-	@Override
-	public void setUniqueId(String uniqueId) {
-		this.uniqueId = uniqueId;
-	}
-
-	/**
-	 * Returns string used to create this result.
-	 * 
-	 * @return string used to create this result
-	 */
-	public String getName() {
-		return uniqueId;
-	}
-
-	/**
-	 * Sets string used to create this result.
-	 * 
-	 * @param name
-	 *          string used to create this result
-	 */
-	public void setName(String name) {
-		this.uniqueId = name;
-	}
-
-	/**
-	 * @return the elements
-	 * @see #elements
-	 */
-	public List<IHeavyView> getElements() {
-		return elements;
-	}
-
-	/**
-	 * @param elements
-	 *          the elements to set
-	 * @see #elements
-	 */
-	public void setElements(List<IHeavyView> elements) {
-		this.elements = elements;
-	}
-
-	/**
-	 * Adds elements to this search result.
-	 * 
-	 * @param results
-	 *          elements to add
-	 */
-	public void addAll(List<IHeavyView> results) {
-		elements.addAll(results);
-	}
-
-	/**
-	 * Adds element to this search result.
-	 * 
-	 * @param result
-	 *          element to add
-	 */
-	public void add(FullAliasView result) {
-		elements.add(result);
-	}
-
-	/**
-	 * Returns number of elements in this search result.
-	 * 
-	 * @return number of elements in this search result
-	 */
-	public int size() {
-		return elements.size();
-	}
-
-	/**
-	 * Gets i-th element in this search result.
-	 * 
-	 * @param i
-	 *          index of the element to return
-	 * @return i-th element in this search result
-	 */
-	public IHeavyView get(int i) {
-		return elements.get(i);
-	}
-
-}
+package lcsb.mapviewer.services.search.data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import lcsb.mapviewer.services.search.IHeavyView;
+import lcsb.mapviewer.services.search.ISearchResultView;
+
+/**
+ * Class representing result of search query.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class SearchElementResult implements Serializable, ISearchResultView {
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * String that identifies this search result (all results with the same id
+	 * should have the same content).
+	 */
+	private String						uniqueId;
+
+	/**
+	 * List of elements found as a results of the search operation.
+	 */
+	private List<IHeavyView>	elements				 = new ArrayList<>();
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param name
+	 *          search query used to create a result
+	 */
+	public SearchElementResult(String name) {
+		setName(name);
+	}
+
+	@Override
+	public String getUniqueId() {
+		return uniqueId;
+	}
+
+	@Override
+	public void setUniqueId(String uniqueId) {
+		this.uniqueId = uniqueId;
+	}
+
+	/**
+	 * Returns string used to create this result.
+	 * 
+	 * @return string used to create this result
+	 */
+	public String getName() {
+		return uniqueId;
+	}
+
+	/**
+	 * Sets string used to create this result.
+	 * 
+	 * @param name
+	 *          string used to create this result
+	 */
+	public void setName(String name) {
+		this.uniqueId = name;
+	}
+
+	/**
+	 * @return the elements
+	 * @see #elements
+	 */
+	public List<IHeavyView> getElements() {
+		return elements;
+	}
+
+	/**
+	 * @param elements
+	 *          the elements to set
+	 * @see #elements
+	 */
+	public void setElements(List<IHeavyView> elements) {
+		this.elements = elements;
+	}
+
+	/**
+	 * Adds elements to this search result.
+	 * 
+	 * @param results
+	 *          elements to add
+	 */
+	public void addAll(List<IHeavyView> results) {
+		elements.addAll(results);
+	}
+
+	/**
+	 * Adds element to this search result.
+	 * 
+	 * @param result
+	 *          element to add
+	 */
+	public void add(FullAliasView result) {
+		elements.add(result);
+	}
+
+	/**
+	 * Returns number of elements in this search result.
+	 * 
+	 * @return number of elements in this search result
+	 */
+	public int size() {
+		return elements.size();
+	}
+
+	/**
+	 * Gets i-th element in this search result.
+	 * 
+	 * @param i
+	 *          index of the element to return
+	 * @return i-th element in this search result
+	 */
+	public IHeavyView get(int i) {
+		return elements.get(i);
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java b/service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
index ecd9f2da35..47b4bd9ea1 100644
--- a/service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
+++ b/service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
@@ -1,675 +1,675 @@
-package lcsb.mapviewer.services.utils;
-
-import java.awt.Color;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.annotation.services.MiriamConnector;
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.TextFileUtils;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.converter.model.celldesigner.species.SpeciesMapping;
-import lcsb.mapviewer.converter.zip.ZipEntryFileFactory;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.GeneVariation;
-import lcsb.mapviewer.model.map.layout.GeneVariationColorSchema;
-import lcsb.mapviewer.model.map.layout.GenericColorSchema;
-import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
-import lcsb.mapviewer.model.map.layout.ReferenceGenomeType;
-import lcsb.mapviewer.services.utils.data.ColorSchemaColumn;
-import lcsb.mapviewer.services.utils.data.ColorSchemaType;
-
-/**
- * Class that reads information about set of {@link ColorSchema color schemas}
- * from the input file.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ColorSchemaReader {
-
-	/**
-	 * Defines number of gene variants per element that is a threshold for
-	 * changing color.
-	 */
-	private static final int SATURATION_SIZE_OF_GENE_VARIANTS	= 10;
-
-	/**
-	 * Max value of red in a color.
-	 */
-	private static final int MAX_RED_VALUE										= 255;
-
-	/**
-	 * Min value of red in a color when computing color for gene variants.
-	 */
-	private static final int MIN_GV_RED_VALUE									= 128;
-
-	/**
-	 * Default class logger.
-	 */
-	private Logger					 logger														= Logger.getLogger(ColorSchemaReader.class);
-
-	/**
-	 * Objects that manipulates {@link MiriamData}.
-	 */
-	private MiriamConnector	 mc																= new MiriamConnector();
-
-	/**
-	 * Reads information about set of {@link ColorSchema color schemas} from the
-	 * input stream.
-	 * 
-	 * @param colorInputStream
-	 *          input stream with {@link ColorSchema}
-	 * @param params
-	 *          list of parameters that were parsed from file header (lines
-	 *          starting with '#')
-	 * @return list of coloring schemas
-	 * @throws IOException
-	 *           thrown when there is a problem with input stream
-	 * @throws InvalidColorSchemaException
-	 *           thrown when color schema is invalid
-	 */
-	public Collection<ColorSchema> readColorSchema(InputStream colorInputStream, Map<String, String> params) throws IOException, InvalidColorSchemaException {
-		if (params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_TYPE) == null) {
-			return readGenericColorSchema(colorInputStream);
-		} else {
-			ColorSchemaType type = ColorSchemaType.valueOf(params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_TYPE));
-			if (type == null) {
-				logger.warn("Unknown type of layout file: " + params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_TYPE));
-				return readGenericColorSchema(colorInputStream);
-			}
-			switch (type) {
-				case GENERIC:
-					return readGenericColorSchema(colorInputStream);
-				case GENETIC_VARIANT:
-					return readGeneticVariantColorSchema(colorInputStream, params);
-				default:
-					logger.warn("Layout type not implemented: " + type);
-					return readGenericColorSchema(colorInputStream);
-			}
-		}
-	}
-
-	/**
-	 * Reads information about set of {@link GeneVariationColorSchema gene variant
-	 * color schemas} from the input stream.
-	 * 
-	 * @param colorInputStream
-	 *          input stream with {@link GeneVariationColorSchema}
-	 * @param params
-	 *          list of parameters that were parsed from file header (lines
-	 *          starting with '#')
-	 * @return list of coloring schemas
-	 * @throws IOException
-	 *           thrown when there is a problem with input stream
-	 * @throws InvalidColorSchemaException
-	 *           thrown when color schema is invalid
-	 */
-	protected Collection<ColorSchema> readGeneticVariantColorSchema(InputStream colorInputStream, Map<String, String> params)
-			throws IOException, InvalidColorSchemaException {
-		List<ColorSchema> result = new ArrayList<>();
-		BufferedReader br = new BufferedReader(new InputStreamReader(colorInputStream));
-		String referenceGenomeVersionStr = params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_GENOME_VERSION);
-		ReferenceGenomeType genomeType = extractReferenceGenomeType(params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_GENOME_TYPE));
-		try {
-			String line = br.readLine();
-			int lineIndex = 1;
-			while (line != null && line.startsWith("#")) {
-				lineIndex++;
-				line = br.readLine();
-			}
-			String[] columns = line.split("\t");
-
-			Map<ColorSchemaColumn, Integer> schemaColumns = new HashMap<ColorSchemaColumn, Integer>();
-			List<Pair<MiriamType, Integer>> customIdentifiers = new ArrayList<Pair<MiriamType, Integer>>();
-			parseColumns(columns, schemaColumns, customIdentifiers, ColorSchemaType.GENETIC_VARIANT);
-			Integer colorColumn = schemaColumns.get(ColorSchemaColumn.COLOR);
-			Integer contigColumn = schemaColumns.get(ColorSchemaColumn.CONTIG);
-			Integer nameColumn = schemaColumns.get(ColorSchemaColumn.NAME);
-			Integer identifierColumn = schemaColumns.get(ColorSchemaColumn.IDENTIFIER);
-			Integer compartmentColumn = schemaColumns.get(ColorSchemaColumn.COMPARTMENT);
-			Integer typeColumn = schemaColumns.get(ColorSchemaColumn.TYPE);
-			Integer positionColumn = schemaColumns.get(ColorSchemaColumn.POSITION);
-			Integer originalDnaColumn = schemaColumns.get(ColorSchemaColumn.ORIGINAL_DNA);
-			Integer alternativeDnaColumn = schemaColumns.get(ColorSchemaColumn.ALTERNATIVE_DNA);
-			Integer descriptionColumn = schemaColumns.get(ColorSchemaColumn.DESCRIPTION);
-			Integer referencesColumn = schemaColumns.get(ColorSchemaColumn.REFERENCES);
-			Integer referenceGenomeTypeColumn = schemaColumns.get(ColorSchemaColumn.REFERENCE_GENOME_TYPE);
-			Integer referenceGenomeVersionColumn = schemaColumns.get(ColorSchemaColumn.REFERENCE_GENOME_VERSION);
-			if (nameColumn == null && identifierColumn == null && customIdentifiers.size() == 0) {
-				throw new InvalidColorSchemaException("One of these columns is obligatory: name, identifier");
-			}
-			if (contigColumn == null) {
-				throw new InvalidColorSchemaException(ColorSchemaColumn.CONTIG.getTitle() + " column is obligatory");
-			}
-			if (positionColumn == null) {
-				throw new InvalidColorSchemaException(ColorSchemaColumn.POSITION.getTitle() + " column is obligatory");
-			}
-			if (originalDnaColumn == null) {
-				throw new InvalidColorSchemaException(ColorSchemaColumn.ORIGINAL_DNA.getTitle() + " column is obligatory");
-			}
-			if (referenceGenomeTypeColumn == null && genomeType == null) {
-				throw new InvalidColorSchemaException(ColorSchemaColumn.REFERENCE_GENOME_TYPE.getTitle() + " column is obligatory");
-			}
-			if (referenceGenomeVersionColumn == null && referenceGenomeVersionStr == null) {
-				throw new InvalidColorSchemaException(ColorSchemaColumn.REFERENCE_GENOME_VERSION.getTitle() + " column is obligatory");
-			}
-			lineIndex++;
-			line = br.readLine();
-			while (line != null) {
-				lineIndex++;
-				if (!line.trim().equals("")) {
-					String[] values = line.split("\t", -1);
-					if (values.length != columns.length) {
-						throw new InvalidColorSchemaException("[Line " + lineIndex + "] Wrong number of cells");
-					}
-					GeneVariationColorSchema schema = new GeneVariationColorSchema();
-					if (nameColumn != null) {
-						processNameColumn(schema, values[nameColumn]);
-					}
-					if (compartmentColumn != null) {
-						processCompartmentColumn(schema, values[compartmentColumn]);
-					}
-					if (typeColumn != null) {
-						String[] types = values[typeColumn].split(",");
-						for (String string : types) {
-							SpeciesMapping mapping = SpeciesMapping.getMappingByString(string);
-							if (mapping != null) {
-								schema.addType(mapping.getClazz());
-							} else {
-								throw new InvalidColorSchemaException("[Line " + lineIndex + "] Unknown class type: " + string + ".");
-							}
-						}
-					}
-					if (colorColumn != null) {
-						schema.setColor(values[colorColumn]);
-					}
-					if (identifierColumn != null && !values[identifierColumn].equals("")) {
-						if (mc.isValidIdentifier(values[identifierColumn])) {
-							schema.setGeneralIdentifier(values[identifierColumn]);
-						} else {
-							throw new InvalidColorSchemaException("[Line " + lineIndex + "] Invalid identifier: " + values[identifierColumn]);
-						}
-					}
-					if (descriptionColumn != null) {
-						schema.setDescription(values[descriptionColumn]);
-					}
-					for (Pair<MiriamType, Integer> pair : customIdentifiers) {
-						processIdentifier(values[pair.getRight()], pair.getLeft(), schema);
-					}
-
-					GeneVariation gv = new GeneVariation();
-					if (positionColumn != null) {
-						try {
-							gv.setPosition(Long.parseLong(values[positionColumn]));
-						} catch (NumberFormatException e) {
-							throw new InvalidColorSchemaException("[Line " + lineIndex + "] Invalid position: " + values[positionColumn], e);
-						}
-					}
-					if (originalDnaColumn != null) {
-						gv.setOriginalDna(values[originalDnaColumn]);
-					}
-					if (alternativeDnaColumn != null) {
-						gv.setModifiedDna(values[alternativeDnaColumn]);
-					}
-					if (referencesColumn != null) {
-						String[] references = values[referencesColumn].split(";");
-						for (String string : references) {
-							try {
-								gv.addReference(MiriamType.getMiriamByUri(string));
-							} catch (InvalidArgumentException e) {
-								throw new InvalidColorSchemaException("[Line " + lineIndex + "] Invalid reference: " + string, e);
-							}
-						}
-					}
-					if (referenceGenomeTypeColumn != null) {
-						gv.setReferenceGenomeType(extractReferenceGenomeType(values[referenceGenomeTypeColumn]));
-					} else {
-						gv.setReferenceGenomeType(genomeType);
-					}
-					if (referenceGenomeVersionColumn != null) {
-						gv.setReferenceGenomeVersion(values[referenceGenomeVersionColumn]);
-					} else {
-						gv.setReferenceGenomeVersion(referenceGenomeVersionStr);
-					}
-					gv.setContig(values[contigColumn]);
-
-					schema.addGeneVariation(gv);
-					if (schema.getName().contains(";")) {
-						String[] names = schema.getName().split(";");
-						for (String string : names) {
-							if (!string.trim().isEmpty()) {
-								GeneVariationColorSchema schemaCopy = schema.copy();
-								schemaCopy.setName(string);
-								result.add(schemaCopy);
-							}
-						}
-					} else {
-						result.add(schema);
-					}
-				}
-				line = br.readLine();
-			}
-		} finally {
-			br.close();
-		}
-		return mergeSchemas(result);
-	}
-
-	/**
-	 * Sets proper value of identifier to {@link ColorSchema} from cell content.
-	 * 
-	 * @param schema
-	 *          {@link ColorSchema} where name should be set
-	 * @param type
-	 *          {@link MiriamType} type of the identifier 
-	 * @param content
-	 *          content of the cell where identifier of given type is stored
-	 */
-	private void processIdentifier(String content, MiriamType type, ColorSchema schema) {
-		if (!content.isEmpty()) {
-			schema.addIdentifierColumn(new Pair<MiriamType, String>(type, content));
-		}
-	}
-
-	/**
-	 * Sets proper name to {@link ColorSchema} from cell content.
-	 * 
-	 * @param schema
-	 *          {@link ColorSchema} where name should be set
-	 * @param content
-	 *          content of the cell where name is stored
-	 */
-	private void processNameColumn(ColorSchema schema, String content) {
-		if (!content.isEmpty()) {
-			schema.setName(content);
-		}
-	}
-
-	/**
-	 * Sets proper compartment names to {@link ColorSchema} from cell content.
-	 * 
-	 * @param schema
-	 *          {@link ColorSchema} where name should be set
-	 * @param content
-	 *          content of the cell where compartments are stored
-	 */
-	private void processCompartmentColumn(ColorSchema schema, String content) {
-		for (String string : content.split(",")) {
-			if (!string.isEmpty()) {
-				schema.addCompartment(string);
-			}
-		}
-	}
-
-	/**
-	 * Transforms string into {@link ReferenceGenomeType}.
-	 * 
-	 * @param referenceGenomeStr
-	 *          type as a string
-	 * @return {@link ReferenceGenomeType} obtained from input string
-	 * @throws InvalidColorSchemaException
-	 *           thrown when input string cannot be resolved into
-	 *           {@link ReferenceGenomeType}
-	 */
-	protected ReferenceGenomeType extractReferenceGenomeType(String referenceGenomeStr) throws InvalidColorSchemaException {
-		ReferenceGenomeType genomeType = null;
-		if (referenceGenomeStr != null) {
-			try {
-				genomeType = ReferenceGenomeType.valueOf(referenceGenomeStr);
-			} catch (IllegalArgumentException e) {
-				throw new InvalidColorSchemaException(
-						"Unknown genome type: " + referenceGenomeStr + ". Acceptable values: " + StringUtils.join(ReferenceGenomeType.values(), ","), e);
-			}
-		}
-		return genomeType;
-	}
-
-	/**
-	 * Merges collection of {@link ColorSchema} that might contain duplicate names
-	 * into collection that doesn't have duplicate names.
-	 * 
-	 * @param schemas
-	 *          {@link Collection} of {@link ColorSchema} that might contain
-	 *          duplicate name
-	 * @return {@link Collection} of {@link ColorSchema} that doesn't contain
-	 *         duplicate names
-	 * 
-	 */
-	private Collection<ColorSchema> mergeSchemas(Collection<ColorSchema> schemas) {
-		Map<String, ColorSchema> schemasByName = new HashMap<>();
-		for (ColorSchema colorSchema : schemas) {
-			ColorSchema mergedSchema = schemasByName.get(colorSchema.getName());
-			if (mergedSchema == null) {
-				mergedSchema = colorSchema.copy();
-				schemasByName.put(colorSchema.getName(), mergedSchema);
-			} else {
-				if (mergedSchema instanceof GeneVariationColorSchema) {
-					if (colorSchema instanceof GeneVariationColorSchema) {
-						((GeneVariationColorSchema) mergedSchema).addGeneVariations(((GeneVariationColorSchema) colorSchema).getGeneVariations());
-					} else {
-						throw new NotImplementedException("Merge between classes not imeplemented:" + mergedSchema.getClass() + "," + colorSchema.getClass());
-					}
-				} else {
-					throw new NotImplementedException("Merge between classes not imeplemented:" + mergedSchema.getClass() + "," + colorSchema.getClass());
-				}
-			}
-		}
-		for (ColorSchema colorSchema : schemasByName.values()) {
-			if (colorSchema instanceof GeneVariationColorSchema) {
-				colorSchema.setColor(getGeneVariantsColor(((GeneVariationColorSchema) colorSchema).getGeneVariations()));
-			}
-		}
-		return schemasByName.values();
-	}
-
-	/**
-	 * Gets color that should be assigned to {@link GeneVariationColorSchema}.
-	 * 
-	 * @param geneVariations
-	 *          list of viariants
-	 * @return {@link Color} that should be assigned to
-	 *         {@link GeneVariationColorSchema}
-	 */
-	private Color getGeneVariantsColor(List<GeneVariation> geneVariations) {
-		int size = geneVariations.size();
-		if (size >= SATURATION_SIZE_OF_GENE_VARIANTS) {
-			return Color.RED;
-		} else {
-			double ratio = (double) size / (double) SATURATION_SIZE_OF_GENE_VARIANTS;
-			return new Color((int) (MIN_GV_RED_VALUE + ratio * (MAX_RED_VALUE - MIN_GV_RED_VALUE)), 0, 0);
-		}
-	}
-
-	/**
-	 * Reads information about set of {@link GenericColorSchema generic color
-	 * schemas} from the input stream.
-	 * 
-	 * @param colorInputStream
-	 *          input stream with {@link GenericColorSchema}
-	 * @return list of coloring schemas
-	 * @throws IOException
-	 *           thrown when there is a problem with input stream
-	 * @throws InvalidColorSchemaException
-	 *           thrown when color schema is invalid
-	 */
-	protected Collection<ColorSchema> readGenericColorSchema(InputStream colorInputStream) throws IOException, InvalidColorSchemaException {
-		MiriamConnector mc = new MiriamConnector();
-		List<ColorSchema> result = new ArrayList<>();
-
-		BufferedReader br = new BufferedReader(new InputStreamReader(colorInputStream));
-
-		try {
-			String line = br.readLine();
-			int lineIndex = 1;
-			while (line != null && line.startsWith("#")) {
-				lineIndex++;
-				line = br.readLine();
-			}
-			String[] columns = line.split("\t");
-
-			Map<ColorSchemaColumn, Integer> schemaColumns = new HashMap<ColorSchemaColumn, Integer>();
-			List<Pair<MiriamType, Integer>> customIdentifiers = new ArrayList<Pair<MiriamType, Integer>>();
-			parseColumns(columns, schemaColumns, customIdentifiers, ColorSchemaType.GENERIC);
-
-			Integer valueColumn = schemaColumns.get(ColorSchemaColumn.VALUE);
-			Integer colorColumn = schemaColumns.get(ColorSchemaColumn.COLOR);
-			Integer nameColumn = schemaColumns.get(ColorSchemaColumn.NAME);
-			Integer identifierColumn = schemaColumns.get(ColorSchemaColumn.IDENTIFIER);
-			Integer reactionIdentifierColumn = schemaColumns.get(ColorSchemaColumn.REACTION_IDENTIFIER);
-			Integer compartmentColumn = schemaColumns.get(ColorSchemaColumn.COMPARTMENT);
-			Integer typeColumn = schemaColumns.get(ColorSchemaColumn.TYPE);
-			Integer lineWidthColumn = schemaColumns.get(ColorSchemaColumn.LINE_WIDTH);
-			Integer reverseReactionColumn = schemaColumns.get(ColorSchemaColumn.REVERSE_REACTION);
-
-			if (valueColumn != null && colorColumn != null) {
-				throw new InvalidColorSchemaException("Schema can contain only one of these two columns: " + columns[valueColumn] + ", " + columns[colorColumn]);
-			}
-
-			if (nameColumn == null && identifierColumn == null && customIdentifiers.size() == 0 && reactionIdentifierColumn == null) {
-				throw new InvalidColorSchemaException("One of these columns is obligatory: name, identifier, reactionIdentifier");
-			}
-
-			if (valueColumn == null && colorColumn == null) {
-				throw new InvalidColorSchemaException("Schema must contain one of these two columns: value, name");
-			}
-
-			lineIndex++;
-			line = br.readLine();
-			while (line != null) {
-				lineIndex++;
-
-				if (line.trim().equals("")) {
-					line = br.readLine();
-					continue;
-				}
-				String[] values = line.split("\t", -1);
-				if (values.length != columns.length) {
-					throw new InvalidColorSchemaException("[Line " + lineIndex + "] Wrong number of cells");
-				}
-				ColorSchema schema = new GenericColorSchema();
-				if (nameColumn != null) {
-					processNameColumn(schema, values[nameColumn]);
-				}
-				if (valueColumn != null) {
-					try {
-						schema.setValue(Double.parseDouble(values[valueColumn].replace(",", ".")));
-					} catch (NumberFormatException e) {
-						throw new InvalidColorSchemaException("[Line " + lineIndex + "] Problem with parsing value: \"" + values[valueColumn] + "\"");
-					}
-					if (schema.getValue() > 1 + Configuration.EPSILON || schema.getValue() < -1 - Configuration.EPSILON) {
-						throw new InvalidColorSchemaException(
-								"[Line " + lineIndex + "] Value " + schema.getValue() + " out of range. Only values between -1 and 1 are allowed.");
-					}
-				}
-				if (compartmentColumn != null) {
-					processCompartmentColumn(schema, values[compartmentColumn]);
-				}
-				if (typeColumn != null) {
-					String[] types = values[typeColumn].split(",");
-					for (String string : types) {
-						SpeciesMapping mapping = SpeciesMapping.getMappingByString(string);
-						if (mapping != null) {
-							schema.addType(mapping.getClazz());
-						} else {
-							throw new InvalidColorSchemaException("Unknown class type: " + string + ".");
-						}
-					}
-
-				}
-				if (colorColumn != null) {
-					schema.setColor(values[colorColumn]);
-				}
-				if (reactionIdentifierColumn != null) {
-					processReactionIdentifier(schema, values[reactionIdentifierColumn]);
-				}
-				if (lineWidthColumn != null) {
-					if (!values[lineWidthColumn].trim().equals("")) {
-						try {
-							schema.setLineWidth(Double.parseDouble(values[lineWidthColumn].replace(",", ".")));
-						} catch (NumberFormatException e) {
-							throw new InvalidColorSchemaException("[Line " + lineIndex + "] Problem with parsing value: \"" + values[lineWidthColumn] + "\"");
-						}
-					}
-				}
-				if (reverseReactionColumn != null) {
-					schema.setReverseReaction("true".equalsIgnoreCase(values[reverseReactionColumn]));
-				}
-				if (identifierColumn != null && !values[identifierColumn].equals("")) {
-					if (mc.isValidIdentifier(values[identifierColumn])) {
-						schema.setGeneralIdentifier(values[identifierColumn]);
-					} else {
-						throw new InvalidColorSchemaException("[Line " + lineIndex + "]" + " Invalid identifier: " + values[identifierColumn]);
-					}
-				}
-				for (Pair<MiriamType, Integer> pair : customIdentifiers) {
-					processIdentifier(values[pair.getRight()], pair.getLeft(), schema);
-				}
-				result.add(schema);
-				line = br.readLine();
-			}
-		} finally {
-			br.close();
-		}
-		return result;
-	}
-
-	/**
-	 * Sets proper reaction identifier to {@link ColorSchema} from cell content.
-	 * 
-	 * @param schema
-	 *          {@link ColorSchema} where name should be set
-	 * @param content
-	 *          content of the cell where reaction identifieris stored
-	 */
-
-	private void processReactionIdentifier(ColorSchema schema, String content) {
-		if (!content.isEmpty()) {
-			schema.setReactionIdentifier(content);
-		}
-	}
-
-	/**
-	 * Transform headers of columns into map with {@link ColorSchemaColumn column
-	 * types} to column number.
-	 * 
-	 * @param columns
-	 *          headers of columns
-	 * @param schemaColumns
-	 *          map with {@link ColorSchemaColumn column types} to column number
-	 *          where result will be returned
-	 * @param customIdentifiers
-	 *          identifiers columns (used when elements are identified by
-	 *          {@link MiriamType})
-	 * @param type
-	 *          type of the color schema (for instance
-	 *          {@link ColorSchemaType#GENETIC_VARIANT gene variants})
-	 * @throws InvalidColorSchemaException
-	 *           thrown when the list of column headers contain invalid value
-	 */
-	public void parseColumns(String[] columns, Map<ColorSchemaColumn, Integer> schemaColumns, List<Pair<MiriamType, Integer>> customIdentifiers,
-			ColorSchemaType type) throws InvalidColorSchemaException {
-		Map<String, MiriamType> acceptableIdentifiers = new HashMap<String, MiriamType>();
-		for (MiriamType miriamType : MiriamType.values()) {
-			acceptableIdentifiers.put(miriamType.getCommonName().toLowerCase(), miriamType);
-		}
-
-		for (int i = 0; i < columns.length; i++) {
-			boolean found = false;
-			for (ColorSchemaColumn schemaColumn : ColorSchemaColumn.values()) {
-				if (columns[i].trim().equalsIgnoreCase(schemaColumn.getTitle()) && schemaColumn.getTypes().contains(type)) {
-					schemaColumns.put(schemaColumn, i);
-					found = true;
-				}
-			}
-			if (!found) {
-				if (acceptableIdentifiers.keySet().contains(columns[i].toLowerCase())) {
-					customIdentifiers.add(new Pair<MiriamType, Integer>(acceptableIdentifiers.get(columns[i].toLowerCase()), i));
-				} else {
-					String columnNames = "";
-					for (ColorSchemaColumn schemaColumn : ColorSchemaColumn.values()) {
-						if (schemaColumn.getTypes().contains(type)) {
-							columnNames += schemaColumn.getTitle() + ", ";
-						}
-					}
-					for (String string : acceptableIdentifiers.keySet()) {
-						columnNames += string + ", ";
-					}
-					throw new InvalidColorSchemaException("Unknown column type: " + columns[i] + ". Acceptable column name: " + columnNames);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Reads information about set of {@link ColorSchema color schemas} from the
-	 * filename.
-	 * 
-	 * @param filename
-	 *          file with {@link ColorSchema}
-	 * @return list of coloring schemas
-	 * @throws IOException
-	 *           thrown when there is a problem with input stream
-	 * @throws InvalidColorSchemaException
-	 *           thrown when color schema is invalid
-	 */
-	public Collection<ColorSchema> readColorSchema(String filename) throws IOException, InvalidColorSchemaException {
-		return readColorSchema(new FileInputStream(filename), TextFileUtils.getHeaderParametersFromFile(new FileInputStream(filename)));
-	}
-
-	/**
-	 * Returns list of columns that should be printed for given coloring schemas.
-	 * 
-	 * @param schemas
-	 *          list of schemas
-	 * @return list of columns that should be printed (were set in the coloring
-	 *         schemas)
-	 */
-	public Collection<ColorSchemaColumn> getSetColorSchemaColumns(Collection<ColorSchema> schemas) {
-		Set<ColorSchemaColumn> result = new HashSet<ColorSchemaColumn>();
-		for (ColorSchema schema : schemas) {
-			if (schema.getColor() != null) {
-				result.add(ColorSchemaColumn.COLOR);
-			}
-			if (schema.getCompartments().size() > 0) {
-				result.add(ColorSchemaColumn.COMPARTMENT);
-			}
-			if (schema.getGeneralIdentifier() != null || schema.getIdentifierColumns().size() > 0) {
-				result.add(ColorSchemaColumn.IDENTIFIER);
-			}
-			if (schema.getLineWidth() != null) {
-				result.add(ColorSchemaColumn.LINE_WIDTH);
-			}
-			if (schema.getName() != null) {
-				result.add(ColorSchemaColumn.NAME);
-			}
-			if (schema.getReactionIdentifier() != null) {
-				result.add(ColorSchemaColumn.REACTION_IDENTIFIER);
-			}
-			if (schema.getReverseReaction() != null) {
-				result.add(ColorSchemaColumn.REVERSE_REACTION);
-			}
-			if (schema.getTypes().size() > 0) {
-				result.add(ColorSchemaColumn.TYPE);
-			}
-			if (schema.getValue() != null) {
-				result.add(ColorSchemaColumn.VALUE);
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Reads information about set of {@link ColorSchema color schemas} from the
-	 * input stream represented as byte array.
-	 * 
-	 * @param inputData
-	 *          source in form of byte array
-	 * @return list of coloring schemas
-	 * @throws IOException
-	 *           thrown when there is a problem with input stream
-	 * @throws InvalidColorSchemaException
-	 *           thrown when color schema is invalid
-	 */
-	public Collection<ColorSchema> readColorSchema(byte[] inputData) throws IOException, InvalidColorSchemaException {
-		return readColorSchema(new ByteArrayInputStream(inputData), TextFileUtils.getHeaderParametersFromFile(new ByteArrayInputStream(inputData)));
-	}
-}
+package lcsb.mapviewer.services.utils;
+
+import java.awt.Color;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.annotation.services.MiriamConnector;
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.TextFileUtils;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.converter.model.celldesigner.species.SpeciesMapping;
+import lcsb.mapviewer.converter.zip.ZipEntryFileFactory;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.GeneVariation;
+import lcsb.mapviewer.model.map.layout.GeneVariationColorSchema;
+import lcsb.mapviewer.model.map.layout.GenericColorSchema;
+import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
+import lcsb.mapviewer.model.map.layout.ReferenceGenomeType;
+import lcsb.mapviewer.services.utils.data.ColorSchemaColumn;
+import lcsb.mapviewer.services.utils.data.ColorSchemaType;
+
+/**
+ * Class that reads information about set of {@link ColorSchema color schemas}
+ * from the input file.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ColorSchemaReader {
+
+	/**
+	 * Defines number of gene variants per element that is a threshold for
+	 * changing color.
+	 */
+	private static final int SATURATION_SIZE_OF_GENE_VARIANTS	= 10;
+
+	/**
+	 * Max value of red in a color.
+	 */
+	private static final int MAX_RED_VALUE										= 255;
+
+	/**
+	 * Min value of red in a color when computing color for gene variants.
+	 */
+	private static final int MIN_GV_RED_VALUE									= 128;
+
+	/**
+	 * Default class logger.
+	 */
+	private Logger					 logger														= Logger.getLogger(ColorSchemaReader.class);
+
+	/**
+	 * Objects that manipulates {@link MiriamData}.
+	 */
+	private MiriamConnector	 mc																= new MiriamConnector();
+
+	/**
+	 * Reads information about set of {@link ColorSchema color schemas} from the
+	 * input stream.
+	 * 
+	 * @param colorInputStream
+	 *          input stream with {@link ColorSchema}
+	 * @param params
+	 *          list of parameters that were parsed from file header (lines
+	 *          starting with '#')
+	 * @return list of coloring schemas
+	 * @throws IOException
+	 *           thrown when there is a problem with input stream
+	 * @throws InvalidColorSchemaException
+	 *           thrown when color schema is invalid
+	 */
+	public Collection<ColorSchema> readColorSchema(InputStream colorInputStream, Map<String, String> params) throws IOException, InvalidColorSchemaException {
+		if (params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_TYPE) == null) {
+			return readGenericColorSchema(colorInputStream);
+		} else {
+			ColorSchemaType type = ColorSchemaType.valueOf(params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_TYPE));
+			if (type == null) {
+				logger.warn("Unknown type of layout file: " + params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_TYPE));
+				return readGenericColorSchema(colorInputStream);
+			}
+			switch (type) {
+				case GENERIC:
+					return readGenericColorSchema(colorInputStream);
+				case GENETIC_VARIANT:
+					return readGeneticVariantColorSchema(colorInputStream, params);
+				default:
+					logger.warn("Layout type not implemented: " + type);
+					return readGenericColorSchema(colorInputStream);
+			}
+		}
+	}
+
+	/**
+	 * Reads information about set of {@link GeneVariationColorSchema gene variant
+	 * color schemas} from the input stream.
+	 * 
+	 * @param colorInputStream
+	 *          input stream with {@link GeneVariationColorSchema}
+	 * @param params
+	 *          list of parameters that were parsed from file header (lines
+	 *          starting with '#')
+	 * @return list of coloring schemas
+	 * @throws IOException
+	 *           thrown when there is a problem with input stream
+	 * @throws InvalidColorSchemaException
+	 *           thrown when color schema is invalid
+	 */
+	protected Collection<ColorSchema> readGeneticVariantColorSchema(InputStream colorInputStream, Map<String, String> params)
+			throws IOException, InvalidColorSchemaException {
+		List<ColorSchema> result = new ArrayList<>();
+		BufferedReader br = new BufferedReader(new InputStreamReader(colorInputStream));
+		String referenceGenomeVersionStr = params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_GENOME_VERSION);
+		ReferenceGenomeType genomeType = extractReferenceGenomeType(params.get(ZipEntryFileFactory.LAYOUT_HEADER_PARAM_GENOME_TYPE));
+		try {
+			String line = br.readLine();
+			int lineIndex = 1;
+			while (line != null && line.startsWith("#")) {
+				lineIndex++;
+				line = br.readLine();
+			}
+			String[] columns = line.split("\t");
+
+			Map<ColorSchemaColumn, Integer> schemaColumns = new HashMap<ColorSchemaColumn, Integer>();
+			List<Pair<MiriamType, Integer>> customIdentifiers = new ArrayList<Pair<MiriamType, Integer>>();
+			parseColumns(columns, schemaColumns, customIdentifiers, ColorSchemaType.GENETIC_VARIANT);
+			Integer colorColumn = schemaColumns.get(ColorSchemaColumn.COLOR);
+			Integer contigColumn = schemaColumns.get(ColorSchemaColumn.CONTIG);
+			Integer nameColumn = schemaColumns.get(ColorSchemaColumn.NAME);
+			Integer identifierColumn = schemaColumns.get(ColorSchemaColumn.IDENTIFIER);
+			Integer compartmentColumn = schemaColumns.get(ColorSchemaColumn.COMPARTMENT);
+			Integer typeColumn = schemaColumns.get(ColorSchemaColumn.TYPE);
+			Integer positionColumn = schemaColumns.get(ColorSchemaColumn.POSITION);
+			Integer originalDnaColumn = schemaColumns.get(ColorSchemaColumn.ORIGINAL_DNA);
+			Integer alternativeDnaColumn = schemaColumns.get(ColorSchemaColumn.ALTERNATIVE_DNA);
+			Integer descriptionColumn = schemaColumns.get(ColorSchemaColumn.DESCRIPTION);
+			Integer referencesColumn = schemaColumns.get(ColorSchemaColumn.REFERENCES);
+			Integer referenceGenomeTypeColumn = schemaColumns.get(ColorSchemaColumn.REFERENCE_GENOME_TYPE);
+			Integer referenceGenomeVersionColumn = schemaColumns.get(ColorSchemaColumn.REFERENCE_GENOME_VERSION);
+			if (nameColumn == null && identifierColumn == null && customIdentifiers.size() == 0) {
+				throw new InvalidColorSchemaException("One of these columns is obligatory: name, identifier");
+			}
+			if (contigColumn == null) {
+				throw new InvalidColorSchemaException(ColorSchemaColumn.CONTIG.getTitle() + " column is obligatory");
+			}
+			if (positionColumn == null) {
+				throw new InvalidColorSchemaException(ColorSchemaColumn.POSITION.getTitle() + " column is obligatory");
+			}
+			if (originalDnaColumn == null) {
+				throw new InvalidColorSchemaException(ColorSchemaColumn.ORIGINAL_DNA.getTitle() + " column is obligatory");
+			}
+			if (referenceGenomeTypeColumn == null && genomeType == null) {
+				throw new InvalidColorSchemaException(ColorSchemaColumn.REFERENCE_GENOME_TYPE.getTitle() + " column is obligatory");
+			}
+			if (referenceGenomeVersionColumn == null && referenceGenomeVersionStr == null) {
+				throw new InvalidColorSchemaException(ColorSchemaColumn.REFERENCE_GENOME_VERSION.getTitle() + " column is obligatory");
+			}
+			lineIndex++;
+			line = br.readLine();
+			while (line != null) {
+				lineIndex++;
+				if (!line.trim().equals("")) {
+					String[] values = line.split("\t", -1);
+					if (values.length != columns.length) {
+						throw new InvalidColorSchemaException("[Line " + lineIndex + "] Wrong number of cells");
+					}
+					GeneVariationColorSchema schema = new GeneVariationColorSchema();
+					if (nameColumn != null) {
+						processNameColumn(schema, values[nameColumn]);
+					}
+					if (compartmentColumn != null) {
+						processCompartmentColumn(schema, values[compartmentColumn]);
+					}
+					if (typeColumn != null) {
+						String[] types = values[typeColumn].split(",");
+						for (String string : types) {
+							SpeciesMapping mapping = SpeciesMapping.getMappingByString(string);
+							if (mapping != null) {
+								schema.addType(mapping.getClazz());
+							} else {
+								throw new InvalidColorSchemaException("[Line " + lineIndex + "] Unknown class type: " + string + ".");
+							}
+						}
+					}
+					if (colorColumn != null) {
+						schema.setColor(values[colorColumn]);
+					}
+					if (identifierColumn != null && !values[identifierColumn].equals("")) {
+						if (mc.isValidIdentifier(values[identifierColumn])) {
+							schema.setGeneralIdentifier(values[identifierColumn]);
+						} else {
+							throw new InvalidColorSchemaException("[Line " + lineIndex + "] Invalid identifier: " + values[identifierColumn]);
+						}
+					}
+					if (descriptionColumn != null) {
+						schema.setDescription(values[descriptionColumn]);
+					}
+					for (Pair<MiriamType, Integer> pair : customIdentifiers) {
+						processIdentifier(values[pair.getRight()], pair.getLeft(), schema);
+					}
+
+					GeneVariation gv = new GeneVariation();
+					if (positionColumn != null) {
+						try {
+							gv.setPosition(Long.parseLong(values[positionColumn]));
+						} catch (NumberFormatException e) {
+							throw new InvalidColorSchemaException("[Line " + lineIndex + "] Invalid position: " + values[positionColumn], e);
+						}
+					}
+					if (originalDnaColumn != null) {
+						gv.setOriginalDna(values[originalDnaColumn]);
+					}
+					if (alternativeDnaColumn != null) {
+						gv.setModifiedDna(values[alternativeDnaColumn]);
+					}
+					if (referencesColumn != null) {
+						String[] references = values[referencesColumn].split(";");
+						for (String string : references) {
+							try {
+								gv.addReference(MiriamType.getMiriamByUri(string));
+							} catch (InvalidArgumentException e) {
+								throw new InvalidColorSchemaException("[Line " + lineIndex + "] Invalid reference: " + string, e);
+							}
+						}
+					}
+					if (referenceGenomeTypeColumn != null) {
+						gv.setReferenceGenomeType(extractReferenceGenomeType(values[referenceGenomeTypeColumn]));
+					} else {
+						gv.setReferenceGenomeType(genomeType);
+					}
+					if (referenceGenomeVersionColumn != null) {
+						gv.setReferenceGenomeVersion(values[referenceGenomeVersionColumn]);
+					} else {
+						gv.setReferenceGenomeVersion(referenceGenomeVersionStr);
+					}
+					gv.setContig(values[contigColumn]);
+
+					schema.addGeneVariation(gv);
+					if (schema.getName().contains(";")) {
+						String[] names = schema.getName().split(";");
+						for (String string : names) {
+							if (!string.trim().isEmpty()) {
+								GeneVariationColorSchema schemaCopy = schema.copy();
+								schemaCopy.setName(string);
+								result.add(schemaCopy);
+							}
+						}
+					} else {
+						result.add(schema);
+					}
+				}
+				line = br.readLine();
+			}
+		} finally {
+			br.close();
+		}
+		return mergeSchemas(result);
+	}
+
+	/**
+	 * Sets proper value of identifier to {@link ColorSchema} from cell content.
+	 * 
+	 * @param schema
+	 *          {@link ColorSchema} where name should be set
+	 * @param type
+	 *          {@link MiriamType} type of the identifier 
+	 * @param content
+	 *          content of the cell where identifier of given type is stored
+	 */
+	private void processIdentifier(String content, MiriamType type, ColorSchema schema) {
+		if (!content.isEmpty()) {
+			schema.addIdentifierColumn(new Pair<MiriamType, String>(type, content));
+		}
+	}
+
+	/**
+	 * Sets proper name to {@link ColorSchema} from cell content.
+	 * 
+	 * @param schema
+	 *          {@link ColorSchema} where name should be set
+	 * @param content
+	 *          content of the cell where name is stored
+	 */
+	private void processNameColumn(ColorSchema schema, String content) {
+		if (!content.isEmpty()) {
+			schema.setName(content);
+		}
+	}
+
+	/**
+	 * Sets proper compartment names to {@link ColorSchema} from cell content.
+	 * 
+	 * @param schema
+	 *          {@link ColorSchema} where name should be set
+	 * @param content
+	 *          content of the cell where compartments are stored
+	 */
+	private void processCompartmentColumn(ColorSchema schema, String content) {
+		for (String string : content.split(",")) {
+			if (!string.isEmpty()) {
+				schema.addCompartment(string);
+			}
+		}
+	}
+
+	/**
+	 * Transforms string into {@link ReferenceGenomeType}.
+	 * 
+	 * @param referenceGenomeStr
+	 *          type as a string
+	 * @return {@link ReferenceGenomeType} obtained from input string
+	 * @throws InvalidColorSchemaException
+	 *           thrown when input string cannot be resolved into
+	 *           {@link ReferenceGenomeType}
+	 */
+	protected ReferenceGenomeType extractReferenceGenomeType(String referenceGenomeStr) throws InvalidColorSchemaException {
+		ReferenceGenomeType genomeType = null;
+		if (referenceGenomeStr != null) {
+			try {
+				genomeType = ReferenceGenomeType.valueOf(referenceGenomeStr);
+			} catch (IllegalArgumentException e) {
+				throw new InvalidColorSchemaException(
+						"Unknown genome type: " + referenceGenomeStr + ". Acceptable values: " + StringUtils.join(ReferenceGenomeType.values(), ","), e);
+			}
+		}
+		return genomeType;
+	}
+
+	/**
+	 * Merges collection of {@link ColorSchema} that might contain duplicate names
+	 * into collection that doesn't have duplicate names.
+	 * 
+	 * @param schemas
+	 *          {@link Collection} of {@link ColorSchema} that might contain
+	 *          duplicate name
+	 * @return {@link Collection} of {@link ColorSchema} that doesn't contain
+	 *         duplicate names
+	 * 
+	 */
+	private Collection<ColorSchema> mergeSchemas(Collection<ColorSchema> schemas) {
+		Map<String, ColorSchema> schemasByName = new HashMap<>();
+		for (ColorSchema colorSchema : schemas) {
+			ColorSchema mergedSchema = schemasByName.get(colorSchema.getName());
+			if (mergedSchema == null) {
+				mergedSchema = colorSchema.copy();
+				schemasByName.put(colorSchema.getName(), mergedSchema);
+			} else {
+				if (mergedSchema instanceof GeneVariationColorSchema) {
+					if (colorSchema instanceof GeneVariationColorSchema) {
+						((GeneVariationColorSchema) mergedSchema).addGeneVariations(((GeneVariationColorSchema) colorSchema).getGeneVariations());
+					} else {
+						throw new NotImplementedException("Merge between classes not imeplemented:" + mergedSchema.getClass() + "," + colorSchema.getClass());
+					}
+				} else {
+					throw new NotImplementedException("Merge between classes not imeplemented:" + mergedSchema.getClass() + "," + colorSchema.getClass());
+				}
+			}
+		}
+		for (ColorSchema colorSchema : schemasByName.values()) {
+			if (colorSchema instanceof GeneVariationColorSchema) {
+				colorSchema.setColor(getGeneVariantsColor(((GeneVariationColorSchema) colorSchema).getGeneVariations()));
+			}
+		}
+		return schemasByName.values();
+	}
+
+	/**
+	 * Gets color that should be assigned to {@link GeneVariationColorSchema}.
+	 * 
+	 * @param geneVariations
+	 *          list of viariants
+	 * @return {@link Color} that should be assigned to
+	 *         {@link GeneVariationColorSchema}
+	 */
+	private Color getGeneVariantsColor(List<GeneVariation> geneVariations) {
+		int size = geneVariations.size();
+		if (size >= SATURATION_SIZE_OF_GENE_VARIANTS) {
+			return Color.RED;
+		} else {
+			double ratio = (double) size / (double) SATURATION_SIZE_OF_GENE_VARIANTS;
+			return new Color((int) (MIN_GV_RED_VALUE + ratio * (MAX_RED_VALUE - MIN_GV_RED_VALUE)), 0, 0);
+		}
+	}
+
+	/**
+	 * Reads information about set of {@link GenericColorSchema generic color
+	 * schemas} from the input stream.
+	 * 
+	 * @param colorInputStream
+	 *          input stream with {@link GenericColorSchema}
+	 * @return list of coloring schemas
+	 * @throws IOException
+	 *           thrown when there is a problem with input stream
+	 * @throws InvalidColorSchemaException
+	 *           thrown when color schema is invalid
+	 */
+	protected Collection<ColorSchema> readGenericColorSchema(InputStream colorInputStream) throws IOException, InvalidColorSchemaException {
+		MiriamConnector mc = new MiriamConnector();
+		List<ColorSchema> result = new ArrayList<>();
+
+		BufferedReader br = new BufferedReader(new InputStreamReader(colorInputStream));
+
+		try {
+			String line = br.readLine();
+			int lineIndex = 1;
+			while (line != null && line.startsWith("#")) {
+				lineIndex++;
+				line = br.readLine();
+			}
+			String[] columns = line.split("\t");
+
+			Map<ColorSchemaColumn, Integer> schemaColumns = new HashMap<ColorSchemaColumn, Integer>();
+			List<Pair<MiriamType, Integer>> customIdentifiers = new ArrayList<Pair<MiriamType, Integer>>();
+			parseColumns(columns, schemaColumns, customIdentifiers, ColorSchemaType.GENERIC);
+
+			Integer valueColumn = schemaColumns.get(ColorSchemaColumn.VALUE);
+			Integer colorColumn = schemaColumns.get(ColorSchemaColumn.COLOR);
+			Integer nameColumn = schemaColumns.get(ColorSchemaColumn.NAME);
+			Integer identifierColumn = schemaColumns.get(ColorSchemaColumn.IDENTIFIER);
+			Integer reactionIdentifierColumn = schemaColumns.get(ColorSchemaColumn.REACTION_IDENTIFIER);
+			Integer compartmentColumn = schemaColumns.get(ColorSchemaColumn.COMPARTMENT);
+			Integer typeColumn = schemaColumns.get(ColorSchemaColumn.TYPE);
+			Integer lineWidthColumn = schemaColumns.get(ColorSchemaColumn.LINE_WIDTH);
+			Integer reverseReactionColumn = schemaColumns.get(ColorSchemaColumn.REVERSE_REACTION);
+
+			if (valueColumn != null && colorColumn != null) {
+				throw new InvalidColorSchemaException("Schema can contain only one of these two columns: " + columns[valueColumn] + ", " + columns[colorColumn]);
+			}
+
+			if (nameColumn == null && identifierColumn == null && customIdentifiers.size() == 0 && reactionIdentifierColumn == null) {
+				throw new InvalidColorSchemaException("One of these columns is obligatory: name, identifier, reactionIdentifier");
+			}
+
+			if (valueColumn == null && colorColumn == null) {
+				throw new InvalidColorSchemaException("Schema must contain one of these two columns: value, name");
+			}
+
+			lineIndex++;
+			line = br.readLine();
+			while (line != null) {
+				lineIndex++;
+
+				if (line.trim().equals("")) {
+					line = br.readLine();
+					continue;
+				}
+				String[] values = line.split("\t", -1);
+				if (values.length != columns.length) {
+					throw new InvalidColorSchemaException("[Line " + lineIndex + "] Wrong number of cells");
+				}
+				ColorSchema schema = new GenericColorSchema();
+				if (nameColumn != null) {
+					processNameColumn(schema, values[nameColumn]);
+				}
+				if (valueColumn != null) {
+					try {
+						schema.setValue(Double.parseDouble(values[valueColumn].replace(",", ".")));
+					} catch (NumberFormatException e) {
+						throw new InvalidColorSchemaException("[Line " + lineIndex + "] Problem with parsing value: \"" + values[valueColumn] + "\"");
+					}
+					if (schema.getValue() > 1 + Configuration.EPSILON || schema.getValue() < -1 - Configuration.EPSILON) {
+						throw new InvalidColorSchemaException(
+								"[Line " + lineIndex + "] Value " + schema.getValue() + " out of range. Only values between -1 and 1 are allowed.");
+					}
+				}
+				if (compartmentColumn != null) {
+					processCompartmentColumn(schema, values[compartmentColumn]);
+				}
+				if (typeColumn != null) {
+					String[] types = values[typeColumn].split(",");
+					for (String string : types) {
+						SpeciesMapping mapping = SpeciesMapping.getMappingByString(string);
+						if (mapping != null) {
+							schema.addType(mapping.getClazz());
+						} else {
+							throw new InvalidColorSchemaException("Unknown class type: " + string + ".");
+						}
+					}
+
+				}
+				if (colorColumn != null) {
+					schema.setColor(values[colorColumn]);
+				}
+				if (reactionIdentifierColumn != null) {
+					processReactionIdentifier(schema, values[reactionIdentifierColumn]);
+				}
+				if (lineWidthColumn != null) {
+					if (!values[lineWidthColumn].trim().equals("")) {
+						try {
+							schema.setLineWidth(Double.parseDouble(values[lineWidthColumn].replace(",", ".")));
+						} catch (NumberFormatException e) {
+							throw new InvalidColorSchemaException("[Line " + lineIndex + "] Problem with parsing value: \"" + values[lineWidthColumn] + "\"");
+						}
+					}
+				}
+				if (reverseReactionColumn != null) {
+					schema.setReverseReaction("true".equalsIgnoreCase(values[reverseReactionColumn]));
+				}
+				if (identifierColumn != null && !values[identifierColumn].equals("")) {
+					if (mc.isValidIdentifier(values[identifierColumn])) {
+						schema.setGeneralIdentifier(values[identifierColumn]);
+					} else {
+						throw new InvalidColorSchemaException("[Line " + lineIndex + "]" + " Invalid identifier: " + values[identifierColumn]);
+					}
+				}
+				for (Pair<MiriamType, Integer> pair : customIdentifiers) {
+					processIdentifier(values[pair.getRight()], pair.getLeft(), schema);
+				}
+				result.add(schema);
+				line = br.readLine();
+			}
+		} finally {
+			br.close();
+		}
+		return result;
+	}
+
+	/**
+	 * Sets proper reaction identifier to {@link ColorSchema} from cell content.
+	 * 
+	 * @param schema
+	 *          {@link ColorSchema} where name should be set
+	 * @param content
+	 *          content of the cell where reaction identifieris stored
+	 */
+
+	private void processReactionIdentifier(ColorSchema schema, String content) {
+		if (!content.isEmpty()) {
+			schema.setReactionIdentifier(content);
+		}
+	}
+
+	/**
+	 * Transform headers of columns into map with {@link ColorSchemaColumn column
+	 * types} to column number.
+	 * 
+	 * @param columns
+	 *          headers of columns
+	 * @param schemaColumns
+	 *          map with {@link ColorSchemaColumn column types} to column number
+	 *          where result will be returned
+	 * @param customIdentifiers
+	 *          identifiers columns (used when elements are identified by
+	 *          {@link MiriamType})
+	 * @param type
+	 *          type of the color schema (for instance
+	 *          {@link ColorSchemaType#GENETIC_VARIANT gene variants})
+	 * @throws InvalidColorSchemaException
+	 *           thrown when the list of column headers contain invalid value
+	 */
+	public void parseColumns(String[] columns, Map<ColorSchemaColumn, Integer> schemaColumns, List<Pair<MiriamType, Integer>> customIdentifiers,
+			ColorSchemaType type) throws InvalidColorSchemaException {
+		Map<String, MiriamType> acceptableIdentifiers = new HashMap<String, MiriamType>();
+		for (MiriamType miriamType : MiriamType.values()) {
+			acceptableIdentifiers.put(miriamType.getCommonName().toLowerCase(), miriamType);
+		}
+
+		for (int i = 0; i < columns.length; i++) {
+			boolean found = false;
+			for (ColorSchemaColumn schemaColumn : ColorSchemaColumn.values()) {
+				if (columns[i].trim().equalsIgnoreCase(schemaColumn.getTitle()) && schemaColumn.getTypes().contains(type)) {
+					schemaColumns.put(schemaColumn, i);
+					found = true;
+				}
+			}
+			if (!found) {
+				if (acceptableIdentifiers.keySet().contains(columns[i].toLowerCase())) {
+					customIdentifiers.add(new Pair<MiriamType, Integer>(acceptableIdentifiers.get(columns[i].toLowerCase()), i));
+				} else {
+					String columnNames = "";
+					for (ColorSchemaColumn schemaColumn : ColorSchemaColumn.values()) {
+						if (schemaColumn.getTypes().contains(type)) {
+							columnNames += schemaColumn.getTitle() + ", ";
+						}
+					}
+					for (String string : acceptableIdentifiers.keySet()) {
+						columnNames += string + ", ";
+					}
+					throw new InvalidColorSchemaException("Unknown column type: " + columns[i] + ". Acceptable column name: " + columnNames);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Reads information about set of {@link ColorSchema color schemas} from the
+	 * filename.
+	 * 
+	 * @param filename
+	 *          file with {@link ColorSchema}
+	 * @return list of coloring schemas
+	 * @throws IOException
+	 *           thrown when there is a problem with input stream
+	 * @throws InvalidColorSchemaException
+	 *           thrown when color schema is invalid
+	 */
+	public Collection<ColorSchema> readColorSchema(String filename) throws IOException, InvalidColorSchemaException {
+		return readColorSchema(new FileInputStream(filename), TextFileUtils.getHeaderParametersFromFile(new FileInputStream(filename)));
+	}
+
+	/**
+	 * Returns list of columns that should be printed for given coloring schemas.
+	 * 
+	 * @param schemas
+	 *          list of schemas
+	 * @return list of columns that should be printed (were set in the coloring
+	 *         schemas)
+	 */
+	public Collection<ColorSchemaColumn> getSetColorSchemaColumns(Collection<ColorSchema> schemas) {
+		Set<ColorSchemaColumn> result = new HashSet<ColorSchemaColumn>();
+		for (ColorSchema schema : schemas) {
+			if (schema.getColor() != null) {
+				result.add(ColorSchemaColumn.COLOR);
+			}
+			if (schema.getCompartments().size() > 0) {
+				result.add(ColorSchemaColumn.COMPARTMENT);
+			}
+			if (schema.getGeneralIdentifier() != null || schema.getIdentifierColumns().size() > 0) {
+				result.add(ColorSchemaColumn.IDENTIFIER);
+			}
+			if (schema.getLineWidth() != null) {
+				result.add(ColorSchemaColumn.LINE_WIDTH);
+			}
+			if (schema.getName() != null) {
+				result.add(ColorSchemaColumn.NAME);
+			}
+			if (schema.getReactionIdentifier() != null) {
+				result.add(ColorSchemaColumn.REACTION_IDENTIFIER);
+			}
+			if (schema.getReverseReaction() != null) {
+				result.add(ColorSchemaColumn.REVERSE_REACTION);
+			}
+			if (schema.getTypes().size() > 0) {
+				result.add(ColorSchemaColumn.TYPE);
+			}
+			if (schema.getValue() != null) {
+				result.add(ColorSchemaColumn.VALUE);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Reads information about set of {@link ColorSchema color schemas} from the
+	 * input stream represented as byte array.
+	 * 
+	 * @param inputData
+	 *          source in form of byte array
+	 * @return list of coloring schemas
+	 * @throws IOException
+	 *           thrown when there is a problem with input stream
+	 * @throws InvalidColorSchemaException
+	 *           thrown when color schema is invalid
+	 */
+	public Collection<ColorSchema> readColorSchema(byte[] inputData) throws IOException, InvalidColorSchemaException {
+		return readColorSchema(new ByteArrayInputStream(inputData), TextFileUtils.getHeaderParametersFromFile(new ByteArrayInputStream(inputData)));
+	}
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaXlsxReader.java b/service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaXlsxReader.java
index 47d540e767..c4cadbe527 100644
--- a/service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaXlsxReader.java
+++ b/service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaXlsxReader.java
@@ -1,337 +1,337 @@
-package lcsb.mapviewer.services.utils;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.io.FilenameUtils;
-import org.apache.log4j.Logger;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.DataFormat;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-
-import lcsb.mapviewer.annotation.services.MiriamConnector;
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.converter.model.celldesigner.species.SpeciesMapping;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.GenericColorSchema;
-import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
-import lcsb.mapviewer.services.utils.data.ColorSchemaColumn;
-
-/**
- * Class that reads information about set of {@link ColorSchema color schemas}
- * from the input file.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ColorSchemaXlsxReader {
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private Logger logger = Logger.getLogger(ColorSchemaXlsxReader.class);
-
-	/**
-	 * @param fileName
-	 *            file name
-	 * @param sheetName
-	 *            sheet name.
-	 * @return list of ColorSchema.
-	 * @throws IOException
-	 *             exception related to opening the input stream.
-	 * @throws InvalidColorSchemaException
-	 *             invalid color schema exception.
-	 */
-	public Collection<ColorSchema> readColorSchema(String fileName, String sheetName)
-			throws IOException, InvalidColorSchemaException {
-		List<ColorSchema> result = new ArrayList<ColorSchema>();
-		FileInputStream file = null;
-		Workbook workbook = null;
-
-		try {
-			file = new FileInputStream(fileName);
-			// Using XSSF for xlsx format, for xls use HSSF
-			// <-Interface, accepts both HSSF and XSSF.
-			if (FilenameUtils.getExtension(fileName).equalsIgnoreCase("xls")) {
-				workbook = new HSSFWorkbook(file);
-			} else if (FilenameUtils.getExtension(fileName).equalsIgnoreCase("xlsx")) {
-				workbook = new XSSFWorkbook(file);
-			} else {
-				throw new IllegalArgumentException("Received file does not have a standard excel extension.");
-			}
-			Sheet sheet = null;
-			if (sheetName == null) {
-				sheet = workbook.getSheetAt(0);
-			} else {
-				sheet = workbook.getSheet(sheetName);
-			}
-			DataFormat fmt = workbook.createDataFormat();
-			CellStyle textStyle = workbook.createCellStyle();
-			textStyle.setDataFormat(fmt.getFormat("@"));
-
-			Iterator<Row> rowIterator = sheet.iterator();
-			Integer valueColumn = null;
-			Integer colorColumn = null;
-			Integer nameColumn = null;
-			Integer identifierColumn = null;
-			Integer reactionIdentifierColumn = null;
-			Integer compartmentColumn = null;
-			Integer typeColumn = null;
-			Integer lineWidthColumn = null;
-			Integer reverseReactionColumn = null;
-			List<Pair<MiriamType, Integer>> foundCustomIdentifiers = new ArrayList<Pair<MiriamType, Integer>>();
-			int lineIndex = 0;
-			Map<ColorSchemaColumn, Integer> foundSchemaColumns = new HashMap<ColorSchemaColumn, Integer>();
-			while (rowIterator.hasNext()) {
-				Row row = rowIterator.next();
-				Cell cell = row.getCell(0, Row.RETURN_BLANK_AS_NULL);
-				if (cell == null) {
-					continue;
-				} else {
-					cell.setCellType(Cell.CELL_TYPE_STRING);
-					if (cell.getStringCellValue().startsWith("#")) {
-						continue;
-					}
-				}
-				lineIndex++;
-				if (lineIndex == 1) {
-
-					Map<String, MiriamType> acceptableIdentifiers = new HashMap<String, MiriamType>();
-					for (MiriamType type : MiriamType.values()) {
-						acceptableIdentifiers.put(type.getCommonName().toLowerCase(), type);
-					}
-
-					Iterator<Cell> cellIterator = row.cellIterator();
-					int columnIndex = 0;
-					while (cellIterator.hasNext()) {
-						columnIndex++;
-						sheet.setDefaultColumnStyle(columnIndex, textStyle);
-						cell = cellIterator.next();
-						cell.setCellType(Cell.CELL_TYPE_STRING);
-						String value = cell.getStringCellValue();
-						boolean found = false;
-						for (ColorSchemaColumn schemaColumn : ColorSchemaColumn.values()) {
-							if (value.trim().equalsIgnoreCase(schemaColumn.getTitle())) {
-								foundSchemaColumns.put(schemaColumn, columnIndex - 1);
-								found = true;
-								break;
-							}
-						}
-						if (!found) {
-							if (acceptableIdentifiers.keySet().contains(value.toLowerCase())) {
-								foundCustomIdentifiers.add(new Pair<MiriamType, Integer>(
-										acceptableIdentifiers.get(value.toLowerCase()), columnIndex - 1));
-							} else {
-								String columnNames = "";
-								for (ColorSchemaColumn schemaColumn : ColorSchemaColumn.values()) {
-									columnNames += schemaColumn.getTitle() + ", ";
-								}
-								for (String string : acceptableIdentifiers.keySet()) {
-									columnNames += ", " + string;
-								}
-								throw new InvalidColorSchemaException(
-										"Unknown column type: " + value + ". Acceptable column name: " + columnNames);
-							}
-						}
-					}
-					valueColumn = foundSchemaColumns.get(ColorSchemaColumn.VALUE);
-					colorColumn = foundSchemaColumns.get(ColorSchemaColumn.COLOR);
-					nameColumn = foundSchemaColumns.get(ColorSchemaColumn.NAME);
-					identifierColumn = foundSchemaColumns.get(ColorSchemaColumn.IDENTIFIER);
-					reactionIdentifierColumn = foundSchemaColumns.get(ColorSchemaColumn.REACTION_IDENTIFIER);
-					compartmentColumn = foundSchemaColumns.get(ColorSchemaColumn.COMPARTMENT);
-					typeColumn = foundSchemaColumns.get(ColorSchemaColumn.TYPE);
-					lineWidthColumn = foundSchemaColumns.get(ColorSchemaColumn.LINE_WIDTH);
-					reverseReactionColumn = foundSchemaColumns.get(ColorSchemaColumn.REVERSE_REACTION);
-
-					if (valueColumn != null && colorColumn != null) {
-						throw new InvalidColorSchemaException("Schema can contain only one of these two columns: ");
-					}
-
-					if (nameColumn == null && identifierColumn == null && foundCustomIdentifiers.size() == 0
-							&& reactionIdentifierColumn == null) {
-						throw new InvalidColorSchemaException(
-								"One of these columns is obligatory: name, identifier, reactionIdentifier");
-					}
-
-					if (valueColumn == null && colorColumn == null) {
-						throw new InvalidColorSchemaException(
-								"Schema must contain one of these two columns: value, name");
-					}
-
-				} else {
-					ColorSchema schema = new GenericColorSchema();
-					if (nameColumn != null) {
-						schema.setName(row.getCell(nameColumn).getStringCellValue());
-					}
-					if (valueColumn != null) {
-						try {
-							cell = row.getCell(valueColumn);
-							cell.setCellType(Cell.CELL_TYPE_STRING);
-							schema.setValue(Double.parseDouble(cell.getStringCellValue().replace(",", ".")));
-						} catch (Exception e) {
-							throw new InvalidColorSchemaException("[Line " + lineIndex
-									+ "] Problem with parsing value for value column. Cell value" + cell);
-						}
-						if (schema.getValue() > 1 + Configuration.EPSILON
-								|| schema.getValue() < -1 - Configuration.EPSILON) {
-							throw new InvalidColorSchemaException("[Line " + lineIndex + "] Value " + schema.getValue()
-									+ " out of range. Only values between -1 and 1 are allowed.");
-						}
-					}
-					if (compartmentColumn != null) {
-						String value = row.getCell(compartmentColumn).getStringCellValue();
-						if (value != null) {
-							String[] compartments = value.split(",");
-							schema.addCompartments(compartments);
-						}
-					}
-					if (typeColumn != null) {
-						String value = row.getCell(typeColumn).getStringCellValue();
-						if (value != null) {
-							String[] types = value.split(",");
-							for (String string : types) {
-								SpeciesMapping mapping = SpeciesMapping.getMappingByString(string);
-								if (mapping != null) {
-									schema.addType(mapping.getClazz());
-								} else {
-									throw new InvalidColorSchemaException("Unknown class type: " + string + ".");
-								}
-							}
-						}
-					}
-					if (colorColumn != null) {
-						schema.setColor(row.getCell(colorColumn).getStringCellValue());
-					}
-					if (reactionIdentifierColumn != null) {
-						schema.setReactionIdentifier(row.getCell(reactionIdentifierColumn).getStringCellValue());
-					}
-					if (lineWidthColumn != null) {
-						cell = row.getCell(lineWidthColumn);
-						cell.setCellType(Cell.CELL_TYPE_STRING);
-						String value = cell.getStringCellValue();
-						if (value != null && !value.trim().isEmpty()) {
-							try {
-								schema.setLineWidth(Double.parseDouble(value.replace(",", ".")));
-							} catch (NumberFormatException e) {
-								throw new InvalidColorSchemaException(
-										"[Line " + lineIndex + "] Problem with parsing value: \"" + value + "\"");
-							}
-						}
-					}
-					if (reverseReactionColumn != null) {
-						cell = row.getCell(reverseReactionColumn);
-						if (cell != null) {
-							cell.setCellType(Cell.CELL_TYPE_STRING);
-							schema.setReverseReaction("true".equalsIgnoreCase(cell.getStringCellValue()));
-						}
-					}
-					if (identifierColumn != null) {
-						cell = row.getCell(identifierColumn);
-						if (cell != null && !cell.getStringCellValue().trim().isEmpty()) {
-							MiriamConnector miriamConnector = new MiriamConnector();
-							String value = cell.getStringCellValue().trim();
-							if (miriamConnector.isValidIdentifier(value)) {
-								schema.setGeneralIdentifier(value);
-							} else {
-								throw new InvalidColorSchemaException(
-										"[Line " + lineIndex + "]" + " Invalid identifier: " + value);
-							}
-						}
-					}
-					for (Pair<MiriamType, Integer> pair : foundCustomIdentifiers) {
-						cell = row.getCell(pair.getRight());
-						if (cell != null) {
-							schema.addIdentifierColumn(
-									new Pair<MiriamType, String>(pair.getLeft(), cell.getStringCellValue()));
-						}
-					}
-
-					if ((schema.getValue() != null && schema.getColor() != null)
-							|| (schema.getValue() == null && schema.getColor() == null)) {
-						throw new InvalidColorSchemaException("Value or Color is needed not both");
-					}
-
-					if (schema.getName() == null && schema.getGeneralIdentifier() == null
-							&& foundCustomIdentifiers.size() == 0 && schema.getReactionIdentifier() == null) {
-						throw new InvalidColorSchemaException(
-								"One of these columns values is obligatory: name, identifier, reactionIdentifier");
-					}
-					result.add(schema);
-				}
-			}
-		} finally {
-			try {
-				if (file != null) {
-					file.close();
-				}
-				if (workbook != null) {
-					workbook.close();
-				}
-			} catch (Exception e) {
-
-			}
-		}
-		return result;
-
-	}
-
-	/**
-	 * Returns list of columns that should be printed for given coloring
-	 * schemas.
-	 * 
-	 * @param schemas
-	 *            list of schemas
-	 * @return list of columns that should be printed (were set in the coloring
-	 *         schemas)
-	 */
-	public Collection<ColorSchemaColumn> getSetColorSchemaColumns(Collection<ColorSchema> schemas) {
-		Set<ColorSchemaColumn> result = new HashSet<ColorSchemaColumn>();
-		for (ColorSchema schema : schemas) {
-			if (schema.getColor() != null) {
-				result.add(ColorSchemaColumn.COLOR);
-			}
-			if (schema.getCompartments().size() > 0) {
-				result.add(ColorSchemaColumn.COMPARTMENT);
-			}
-			if (schema.getGeneralIdentifier() != null || schema.getIdentifierColumns().size() > 0) {
-				result.add(ColorSchemaColumn.IDENTIFIER);
-			}
-			if (schema.getLineWidth() != null) {
-				result.add(ColorSchemaColumn.LINE_WIDTH);
-			}
-			if (schema.getName() != null) {
-				result.add(ColorSchemaColumn.NAME);
-			}
-			if (schema.getReactionIdentifier() != null) {
-				result.add(ColorSchemaColumn.REACTION_IDENTIFIER);
-			}
-			if (schema.getReverseReaction() != null) {
-				result.add(ColorSchemaColumn.REVERSE_REACTION);
-			}
-			if (schema.getTypes().size() > 0) {
-				result.add(ColorSchemaColumn.TYPE);
-			}
-			if (schema.getValue() != null) {
-				result.add(ColorSchemaColumn.VALUE);
-			}
-		}
-		return result;
-	}
-
-}
+package lcsb.mapviewer.services.utils;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.log4j.Logger;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.DataFormat;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import lcsb.mapviewer.annotation.services.MiriamConnector;
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.converter.model.celldesigner.species.SpeciesMapping;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.GenericColorSchema;
+import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
+import lcsb.mapviewer.services.utils.data.ColorSchemaColumn;
+
+/**
+ * Class that reads information about set of {@link ColorSchema color schemas}
+ * from the input file.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ColorSchemaXlsxReader {
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private Logger logger = Logger.getLogger(ColorSchemaXlsxReader.class);
+
+	/**
+	 * @param fileName
+	 *            file name
+	 * @param sheetName
+	 *            sheet name.
+	 * @return list of ColorSchema.
+	 * @throws IOException
+	 *             exception related to opening the input stream.
+	 * @throws InvalidColorSchemaException
+	 *             invalid color schema exception.
+	 */
+	public Collection<ColorSchema> readColorSchema(String fileName, String sheetName)
+			throws IOException, InvalidColorSchemaException {
+		List<ColorSchema> result = new ArrayList<ColorSchema>();
+		FileInputStream file = null;
+		Workbook workbook = null;
+
+		try {
+			file = new FileInputStream(fileName);
+			// Using XSSF for xlsx format, for xls use HSSF
+			// <-Interface, accepts both HSSF and XSSF.
+			if (FilenameUtils.getExtension(fileName).equalsIgnoreCase("xls")) {
+				workbook = new HSSFWorkbook(file);
+			} else if (FilenameUtils.getExtension(fileName).equalsIgnoreCase("xlsx")) {
+				workbook = new XSSFWorkbook(file);
+			} else {
+				throw new IllegalArgumentException("Received file does not have a standard excel extension.");
+			}
+			Sheet sheet = null;
+			if (sheetName == null) {
+				sheet = workbook.getSheetAt(0);
+			} else {
+				sheet = workbook.getSheet(sheetName);
+			}
+			DataFormat fmt = workbook.createDataFormat();
+			CellStyle textStyle = workbook.createCellStyle();
+			textStyle.setDataFormat(fmt.getFormat("@"));
+
+			Iterator<Row> rowIterator = sheet.iterator();
+			Integer valueColumn = null;
+			Integer colorColumn = null;
+			Integer nameColumn = null;
+			Integer identifierColumn = null;
+			Integer reactionIdentifierColumn = null;
+			Integer compartmentColumn = null;
+			Integer typeColumn = null;
+			Integer lineWidthColumn = null;
+			Integer reverseReactionColumn = null;
+			List<Pair<MiriamType, Integer>> foundCustomIdentifiers = new ArrayList<Pair<MiriamType, Integer>>();
+			int lineIndex = 0;
+			Map<ColorSchemaColumn, Integer> foundSchemaColumns = new HashMap<ColorSchemaColumn, Integer>();
+			while (rowIterator.hasNext()) {
+				Row row = rowIterator.next();
+				Cell cell = row.getCell(0, Row.RETURN_BLANK_AS_NULL);
+				if (cell == null) {
+					continue;
+				} else {
+					cell.setCellType(Cell.CELL_TYPE_STRING);
+					if (cell.getStringCellValue().startsWith("#")) {
+						continue;
+					}
+				}
+				lineIndex++;
+				if (lineIndex == 1) {
+
+					Map<String, MiriamType> acceptableIdentifiers = new HashMap<String, MiriamType>();
+					for (MiriamType type : MiriamType.values()) {
+						acceptableIdentifiers.put(type.getCommonName().toLowerCase(), type);
+					}
+
+					Iterator<Cell> cellIterator = row.cellIterator();
+					int columnIndex = 0;
+					while (cellIterator.hasNext()) {
+						columnIndex++;
+						sheet.setDefaultColumnStyle(columnIndex, textStyle);
+						cell = cellIterator.next();
+						cell.setCellType(Cell.CELL_TYPE_STRING);
+						String value = cell.getStringCellValue();
+						boolean found = false;
+						for (ColorSchemaColumn schemaColumn : ColorSchemaColumn.values()) {
+							if (value.trim().equalsIgnoreCase(schemaColumn.getTitle())) {
+								foundSchemaColumns.put(schemaColumn, columnIndex - 1);
+								found = true;
+								break;
+							}
+						}
+						if (!found) {
+							if (acceptableIdentifiers.keySet().contains(value.toLowerCase())) {
+								foundCustomIdentifiers.add(new Pair<MiriamType, Integer>(
+										acceptableIdentifiers.get(value.toLowerCase()), columnIndex - 1));
+							} else {
+								String columnNames = "";
+								for (ColorSchemaColumn schemaColumn : ColorSchemaColumn.values()) {
+									columnNames += schemaColumn.getTitle() + ", ";
+								}
+								for (String string : acceptableIdentifiers.keySet()) {
+									columnNames += ", " + string;
+								}
+								throw new InvalidColorSchemaException(
+										"Unknown column type: " + value + ". Acceptable column name: " + columnNames);
+							}
+						}
+					}
+					valueColumn = foundSchemaColumns.get(ColorSchemaColumn.VALUE);
+					colorColumn = foundSchemaColumns.get(ColorSchemaColumn.COLOR);
+					nameColumn = foundSchemaColumns.get(ColorSchemaColumn.NAME);
+					identifierColumn = foundSchemaColumns.get(ColorSchemaColumn.IDENTIFIER);
+					reactionIdentifierColumn = foundSchemaColumns.get(ColorSchemaColumn.REACTION_IDENTIFIER);
+					compartmentColumn = foundSchemaColumns.get(ColorSchemaColumn.COMPARTMENT);
+					typeColumn = foundSchemaColumns.get(ColorSchemaColumn.TYPE);
+					lineWidthColumn = foundSchemaColumns.get(ColorSchemaColumn.LINE_WIDTH);
+					reverseReactionColumn = foundSchemaColumns.get(ColorSchemaColumn.REVERSE_REACTION);
+
+					if (valueColumn != null && colorColumn != null) {
+						throw new InvalidColorSchemaException("Schema can contain only one of these two columns: ");
+					}
+
+					if (nameColumn == null && identifierColumn == null && foundCustomIdentifiers.size() == 0
+							&& reactionIdentifierColumn == null) {
+						throw new InvalidColorSchemaException(
+								"One of these columns is obligatory: name, identifier, reactionIdentifier");
+					}
+
+					if (valueColumn == null && colorColumn == null) {
+						throw new InvalidColorSchemaException(
+								"Schema must contain one of these two columns: value, name");
+					}
+
+				} else {
+					ColorSchema schema = new GenericColorSchema();
+					if (nameColumn != null) {
+						schema.setName(row.getCell(nameColumn).getStringCellValue());
+					}
+					if (valueColumn != null) {
+						try {
+							cell = row.getCell(valueColumn);
+							cell.setCellType(Cell.CELL_TYPE_STRING);
+							schema.setValue(Double.parseDouble(cell.getStringCellValue().replace(",", ".")));
+						} catch (Exception e) {
+							throw new InvalidColorSchemaException("[Line " + lineIndex
+									+ "] Problem with parsing value for value column. Cell value" + cell);
+						}
+						if (schema.getValue() > 1 + Configuration.EPSILON
+								|| schema.getValue() < -1 - Configuration.EPSILON) {
+							throw new InvalidColorSchemaException("[Line " + lineIndex + "] Value " + schema.getValue()
+									+ " out of range. Only values between -1 and 1 are allowed.");
+						}
+					}
+					if (compartmentColumn != null) {
+						String value = row.getCell(compartmentColumn).getStringCellValue();
+						if (value != null) {
+							String[] compartments = value.split(",");
+							schema.addCompartments(compartments);
+						}
+					}
+					if (typeColumn != null) {
+						String value = row.getCell(typeColumn).getStringCellValue();
+						if (value != null) {
+							String[] types = value.split(",");
+							for (String string : types) {
+								SpeciesMapping mapping = SpeciesMapping.getMappingByString(string);
+								if (mapping != null) {
+									schema.addType(mapping.getClazz());
+								} else {
+									throw new InvalidColorSchemaException("Unknown class type: " + string + ".");
+								}
+							}
+						}
+					}
+					if (colorColumn != null) {
+						schema.setColor(row.getCell(colorColumn).getStringCellValue());
+					}
+					if (reactionIdentifierColumn != null) {
+						schema.setReactionIdentifier(row.getCell(reactionIdentifierColumn).getStringCellValue());
+					}
+					if (lineWidthColumn != null) {
+						cell = row.getCell(lineWidthColumn);
+						cell.setCellType(Cell.CELL_TYPE_STRING);
+						String value = cell.getStringCellValue();
+						if (value != null && !value.trim().isEmpty()) {
+							try {
+								schema.setLineWidth(Double.parseDouble(value.replace(",", ".")));
+							} catch (NumberFormatException e) {
+								throw new InvalidColorSchemaException(
+										"[Line " + lineIndex + "] Problem with parsing value: \"" + value + "\"");
+							}
+						}
+					}
+					if (reverseReactionColumn != null) {
+						cell = row.getCell(reverseReactionColumn);
+						if (cell != null) {
+							cell.setCellType(Cell.CELL_TYPE_STRING);
+							schema.setReverseReaction("true".equalsIgnoreCase(cell.getStringCellValue()));
+						}
+					}
+					if (identifierColumn != null) {
+						cell = row.getCell(identifierColumn);
+						if (cell != null && !cell.getStringCellValue().trim().isEmpty()) {
+							MiriamConnector miriamConnector = new MiriamConnector();
+							String value = cell.getStringCellValue().trim();
+							if (miriamConnector.isValidIdentifier(value)) {
+								schema.setGeneralIdentifier(value);
+							} else {
+								throw new InvalidColorSchemaException(
+										"[Line " + lineIndex + "]" + " Invalid identifier: " + value);
+							}
+						}
+					}
+					for (Pair<MiriamType, Integer> pair : foundCustomIdentifiers) {
+						cell = row.getCell(pair.getRight());
+						if (cell != null) {
+							schema.addIdentifierColumn(
+									new Pair<MiriamType, String>(pair.getLeft(), cell.getStringCellValue()));
+						}
+					}
+
+					if ((schema.getValue() != null && schema.getColor() != null)
+							|| (schema.getValue() == null && schema.getColor() == null)) {
+						throw new InvalidColorSchemaException("Value or Color is needed not both");
+					}
+
+					if (schema.getName() == null && schema.getGeneralIdentifier() == null
+							&& foundCustomIdentifiers.size() == 0 && schema.getReactionIdentifier() == null) {
+						throw new InvalidColorSchemaException(
+								"One of these columns values is obligatory: name, identifier, reactionIdentifier");
+					}
+					result.add(schema);
+				}
+			}
+		} finally {
+			try {
+				if (file != null) {
+					file.close();
+				}
+				if (workbook != null) {
+					workbook.close();
+				}
+			} catch (Exception e) {
+
+			}
+		}
+		return result;
+
+	}
+
+	/**
+	 * Returns list of columns that should be printed for given coloring
+	 * schemas.
+	 * 
+	 * @param schemas
+	 *            list of schemas
+	 * @return list of columns that should be printed (were set in the coloring
+	 *         schemas)
+	 */
+	public Collection<ColorSchemaColumn> getSetColorSchemaColumns(Collection<ColorSchema> schemas) {
+		Set<ColorSchemaColumn> result = new HashSet<ColorSchemaColumn>();
+		for (ColorSchema schema : schemas) {
+			if (schema.getColor() != null) {
+				result.add(ColorSchemaColumn.COLOR);
+			}
+			if (schema.getCompartments().size() > 0) {
+				result.add(ColorSchemaColumn.COMPARTMENT);
+			}
+			if (schema.getGeneralIdentifier() != null || schema.getIdentifierColumns().size() > 0) {
+				result.add(ColorSchemaColumn.IDENTIFIER);
+			}
+			if (schema.getLineWidth() != null) {
+				result.add(ColorSchemaColumn.LINE_WIDTH);
+			}
+			if (schema.getName() != null) {
+				result.add(ColorSchemaColumn.NAME);
+			}
+			if (schema.getReactionIdentifier() != null) {
+				result.add(ColorSchemaColumn.REACTION_IDENTIFIER);
+			}
+			if (schema.getReverseReaction() != null) {
+				result.add(ColorSchemaColumn.REVERSE_REACTION);
+			}
+			if (schema.getTypes().size() > 0) {
+				result.add(ColorSchemaColumn.TYPE);
+			}
+			if (schema.getValue() != null) {
+				result.add(ColorSchemaColumn.VALUE);
+			}
+		}
+		return result;
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/utils/CreateProjectParams.java b/service/src/main/java/lcsb/mapviewer/services/utils/CreateProjectParams.java
index b5900a71e3..6162c795dd 100644
--- a/service/src/main/java/lcsb/mapviewer/services/utils/CreateProjectParams.java
+++ b/service/src/main/java/lcsb/mapviewer/services/utils/CreateProjectParams.java
@@ -1,703 +1,703 @@
-package lcsb.mapviewer.services.utils;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Set;
-
-import org.apache.commons.io.IOUtils;
-import org.primefaces.model.TreeNode;
-
-import lcsb.mapviewer.converter.zip.ZipEntryFile;
-import lcsb.mapviewer.model.map.AnnotatedObject;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.services.overlay.AnnotatedObjectTreeRow;
-
-/**
- * Set of parameters used during creation of new project.
- * 
- * @author Piotr Gawron
- * 
- */
-public class CreateProjectParams {
-
-	/**
-	 * User defined project identifier.
-	 */
-	private String																								 projectId;
-
-	/**
-	 * Name of the project.
-	 */
-	private String																								 projectName;
-
-	/**
-	 * Disease associated to the project.
-	 */
-	private String																								 disease;
-
-	/**
-	 * Organism associated to the project.
-	 */
-	private String																								 organism;
-
-	/**
-	 * Path to a file used as a model.
-	 */
-	private String																								 projectFile;
-
-	/**
-	 * Is the project a complex multi-file project.
-	 */
-	private boolean																								 complex;
-
-	/**
-	 * List of zip entries in the complex model definition.
-	 */
-	private List<ZipEntryFile>																		 zipEntries							= new ArrayList<ZipEntryFile>();
-
-	/**
-	 * Should the elements be annotated by the external resources.
-	 */
-	private boolean																								 updateAnnotations			= false;
-
-	/**
-	 * Do we want to generate images for all available layers.
-	 */
-	private boolean																								 images									= false;
-
-	/**
-	 * Should the map be autoresized after processing (to trim unnecessary
-	 * margins).
-	 */
-	private boolean																								 autoResize							= true;
-
-	/**
-	 * Should the data from external resources but linked to model be cached.
-	 */
-	private boolean																								 cacheModel							= true;
-
-	/**
-	 * Should the process of creation of the project be asynchronous (in separate
-	 * thread).
-	 */
-	private boolean																								 async									= false;
-
-	/**
-	 * Should the map be displayed in SBGN format.
-	 */
-	private boolean																								 sbgnFormat							= false;
-
-	/**
-	 * Is the {@link lcsb.mapviewer.services.utils.data.BuildInLayout#NORMAL}
-	 * default {@link lcsb.mapviewer.model.map.layout.Layout Layout} when
-	 * generating new project.
-	 */
-	private boolean																								 networkLayoutAsDefault	= false;
-
-	/**
-	 * Do we want to analyze annotations after processing of the map. If yes then
-	 * in the email with summary of the generation process information about
-	 * improper annotations will be sent.
-	 */
-	private boolean																								 analyzeAnnotations			= false;
-
-	/**
-	 * Email address that should be notified after everything is done.
-	 */
-	private String																								 notifyEmail						= null;
-
-	/**
-	 * Description of the project.
-	 */
-	private String																								 description						= "";
-
-	/**
-	 * Version of the map.
-	 */
-	private String																								 version								= "0";
-
-	/**
-	 * Users that should have access to the map.
-	 */
-	private List<String[]>																				 users									= new ArrayList<String[]>();
-
-	/**
-	 * Directory with the static images that will be stored on server. This
-	 * directory is relative and it's a simple uniqe name within folder with
-	 * images.
-	 */
-	private String																								 projectDir;
-
-	/**
-	 * Map that contains informnation what kind of annotators should be used for
-	 * specific class.
-	 */
-	private Map<Class<?>, List<String>>														 annotatorsMap					= null;
-
-	/**
-	 * Map that contains information which {@link MiriamType miriam types} are
-	 * valid for which class.
-	 */
-	private Map<Class<? extends AnnotatedObject>, Set<MiriamType>> validAnnotations				= null;
-
-	/**
-	 * Map that contains information which {@link MiriamType miriam types} are
-	 * obigatory for which class.
-	 */
-	private Map<Class<? extends AnnotatedObject>, Set<MiriamType>> requiredAnnotations		= null;
-
-	/**
-	 * @param projectId
-	 *          the projectId to set
-	 * @return object with all parameters
-	 * @see #projectId
-	 */
-	public CreateProjectParams projectId(String projectId) {
-		this.projectId = projectId;
-		return this;
-	}
-
-	/**
-	 * @param notifyEmail
-	 *          the notifyEmail to set
-	 * @return object with all parameters
-	 * @see #notifyEmail
-	 */
-	public CreateProjectParams notifyEmail(String notifyEmail) {
-		this.notifyEmail = notifyEmail;
-		return this;
-	}
-
-	/**
-	 * @param projectFile
-	 *          the projectFile to set
-	 * @return object with all parameters
-	 * @see #projectFile
-	 */
-	public CreateProjectParams projectFile(String projectFile) {
-		this.projectFile = projectFile;
-		return this;
-	}
-
-	/**
-	 * @param autoResize
-	 *          the autoResize to set
-	 * @return object with all parameters
-	 * @see #autoResize
-	 */
-	public CreateProjectParams autoResize(boolean autoResize) {
-		this.autoResize = autoResize;
-		return this;
-	}
-
-	/**
-	 * Sets input stream from which projects should be generated.
-	 * 
-	 * @param is
-	 *          inputstream with the data of the project to be generated
-	 * @return object with all parameters
-	 * @throws IOException
-	 *           thrown if there are some problem with the stream
-	 */
-	public CreateProjectParams projectFile(InputStream is) throws IOException {
-		File temp = File.createTempFile("model", ".xml");
-		IOUtils.copy(is, new FileOutputStream(temp));
-		this.projectFile = temp.getAbsolutePath();
-		return this;
-	}
-
-	/**
-	 * Sets file from which projects should be generated.
-	 * 
-	 * @param file
-	 *          file with the data of the project to be generated
-	 * @return object with all parameters
-	 */
-	public CreateProjectParams projectFile(File file) {
-		this.projectFile = file.getAbsolutePath();
-		return this;
-	}
-
-	/**
-	 * @param async
-	 *          the async to set
-	 * @return object with all parameters
-	 * @see #async
-	 */
-	public CreateProjectParams async(boolean async) {
-		this.async = async;
-		return this;
-	}
-
-	/**
-	 * @param analyzeAnnotations
-	 *          the analyzeAnnotations to set
-	 * @return object with all parameters
-	 * @see #analyzeAnnotations
-	 */
-	public CreateProjectParams analyzeAnnotations(boolean analyzeAnnotations) {
-		this.analyzeAnnotations = analyzeAnnotations;
-		return this;
-	}
-
-	/**
-	 * @param updateAnnotations
-	 *          the updateAnnotations to set
-	 * @return object with all parameters
-	 * @see #updateAnnotations
-	 */
-	public CreateProjectParams annotations(boolean updateAnnotations) {
-		this.updateAnnotations = updateAnnotations;
-		return this;
-	}
-
-	/**
-	 * @param images
-	 *          the images to set
-	 * @return object with all parameters
-	 * @see #images
-	 */
-	public CreateProjectParams images(boolean images) {
-		this.images = images;
-		return this;
-	}
-
-	/**
-	 * @param description
-	 *          the description to set
-	 * @return object with all parameters
-	 * @see #description
-	 */
-	public CreateProjectParams description(String description) {
-		this.description = description;
-		return this;
-	}
-
-	/**
-	 * @param version
-	 *          the version to set
-	 * @return object with all parameters
-	 * @see #version
-	 */
-	public CreateProjectParams version(String version) {
-		this.version = version;
-		return this;
-	}
-
-	/**
-	 * Adds a user to the list of users that should have access to the project
-	 * from the beginning.
-	 * 
-	 * @param login
-	 *          login of the user
-	 * @param password
-	 *          password (in case user doesn't exist yet)
-	 * @return object with all parameters
-	 * @return
-	 */
-	public CreateProjectParams addUser(String login, String password) {
-		this.users.add(new String[] { login, password });
-		return this;
-	}
-
-	/**
-	 * @return the users
-	 * @see #users
-	 */
-	public List<String[]> getUsers() {
-		return users;
-	}
-
-	/**
-	 * @return the version
-	 * @see #version
-	 */
-	public String getVersion() {
-		return version;
-	}
-
-	/**
-	 * @return the description
-	 * @see #description
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * @return the notifyEmail
-	 * @see #notifyEmail
-	 */
-	public String getNotifyEmail() {
-		return notifyEmail;
-	}
-
-	/**
-	 * @return the analyzeAnnotations
-	 * @see #analyzeAnnotations
-	 */
-	public boolean isAnalyzeAnnotations() {
-		return analyzeAnnotations;
-	}
-
-	/**
-	 * @return the async
-	 * @see #async
-	 */
-	public boolean isAsync() {
-		return async;
-	}
-
-	/**
-	 * @return the autoResize
-	 * @see #autoResize
-	 */
-	public boolean isAutoResize() {
-		return autoResize;
-	}
-
-	/**
-	 * @return the images
-	 * @see #images
-	 */
-	public boolean isImages() {
-		return images;
-	}
-
-	/**
-	 * @return the updateAnnotations
-	 * @see #updateAnnotations
-	 */
-	public boolean isUpdateAnnotations() {
-		return updateAnnotations;
-	}
-
-	/**
-	 * @return the projectFile
-	 * @see #projectFile
-	 */
-	public String getProjectFile() {
-		return projectFile;
-	}
-
-	/**
-	 * @return the projectId
-	 * @see #projectId
-	 */
-	public String getProjectId() {
-		return projectId;
-	}
-
-	/**
-	 * @return the cacheModel
-	 * @see #cacheModel
-	 */
-	public boolean isCacheModel() {
-		return cacheModel;
-	}
-
-	/**
-	 * @param cacheModel
-	 *          the cacheModel to set
-	 * @see #cacheModel
-	 * @return object with all parameters
-	 */
-	public CreateProjectParams cacheModel(boolean cacheModel) {
-		this.cacheModel = cacheModel;
-		return this;
-	}
-
-	/**
-	 * @return the submodels
-	 * @see #zipEntries
-	 */
-	public List<ZipEntryFile> getZipEntries() {
-		return zipEntries;
-	}
-
-	/**
-	 * @param entry
-	 *          the submodel to add
-	 * @see #zipEntries
-	 * @return object with all parameters
-	 */
-	public CreateProjectParams addZipEntry(ZipEntryFile entry) {
-		if (entry != null) {
-			this.zipEntries.add(entry);
-		}
-		return this;
-	}
-
-	/**
-	 * @return the complex
-	 * @see #complex
-	 */
-	public boolean isComplex() {
-		return complex;
-	}
-
-	/**
-	 * @return the sbgnFormat
-	 * @see #sbgnFormat
-	 */
-	public boolean isSbgnFormat() {
-		return sbgnFormat;
-	}
-
-	/**
-	 * @param sbgnFormat
-	 *          the sbgnFormat to set
-	 * @see #sbgnFormat
-	 */
-	public void sbgnFormat(boolean sbgnFormat) {
-		this.sbgnFormat = sbgnFormat;
-	}
-
-	/**
-	 * @param complex
-	 *          the complex to set
-	 * @see #complex
-	 * @return object with all parameters
-	 */
-	public CreateProjectParams complex(boolean complex) {
-		this.complex = complex;
-		return this;
-	}
-
-	/**
-	 * Creates {@link #annotatorsMap}.
-	 * 
-	 * @param annotatorsTree
-	 *          tree containing information about annotators for given classes
-	 */
-	public void annotatorsMap(TreeNode annotatorsTree) {
-		Map<Class<?>, List<String>> map = new HashMap<Class<?>, List<String>>();
-		Queue<TreeNode> queue = new LinkedList<TreeNode>();
-		queue.add(annotatorsTree);
-		while (!queue.isEmpty()) {
-			TreeNode node = queue.poll();
-
-			Set<String> set = new HashSet<String>();
-
-			TreeNode parent = node;
-			while (parent != null) {
-				set.addAll(((AnnotatedObjectTreeRow) parent.getData()).getUsedAnnotators());
-				parent = parent.getParent();
-			}
-			List<String> list = new ArrayList<String>();
-			list.addAll(set);
-			map.put(((AnnotatedObjectTreeRow) node.getData()).getClazz(), list);
-
-			for (TreeNode node2 : node.getChildren()) {
-				queue.add(node2);
-			}
-		}
-		annotatorsMap = map;
-	}
-
-	/**
-	 * @return the annotatorsMap
-	 * @see #annotatorsMap
-	 */
-	public Map<Class<?>, List<String>> getAnnotatorsMap() {
-		return annotatorsMap;
-	}
-
-	/**
-	 * @param annotatorsMap
-	 *          the annotatorsMap to set
-	 * @see #annotatorsMap
-	 */
-	public void setAnnotatorsMap(Map<Class<?>, List<String>> annotatorsMap) {
-		this.annotatorsMap = annotatorsMap;
-	}
-
-	/**
-	 * Creates {@link #validAnnotations}.
-	 * 
-	 * @param annotatorsTree
-	 *          tree containing information about valid {@link MiriamType miriam
-	 *          types}
-	 */
-	@SuppressWarnings("unchecked")
-	public void validAnnotations(TreeNode annotatorsTree) {
-		Map<Class<? extends AnnotatedObject>, Set<MiriamType>> map = new HashMap<Class<? extends AnnotatedObject>, Set<MiriamType>>();
-		Queue<TreeNode> queue = new LinkedList<TreeNode>();
-		queue.add(annotatorsTree);
-		while (!queue.isEmpty()) {
-			TreeNode node = queue.poll();
-			Set<MiriamType> set = new HashSet<MiriamType>();
-
-			TreeNode parent = node;
-			while (parent != null) {
-				set.addAll(((AnnotatedObjectTreeRow) parent.getData()).getValidAnnotations());
-				parent = parent.getParent();
-			}
-			map.put((Class<? extends AnnotatedObject>) ((AnnotatedObjectTreeRow) node.getData()).getClazz(), set);
-
-			for (TreeNode node2 : node.getChildren()) {
-				queue.add(node2);
-			}
-		}
-		validAnnotations = map;
-	}
-
-	/**
-	 * Creates {@link #requiredAnnotations}.
-	 * 
-	 * @param annotatorsTree
-	 *          tree containing information about required {@link MiriamType
-	 *          miriam types}
-	 */
-	@SuppressWarnings("unchecked")
-	public void requiredAnnotations(TreeNode annotatorsTree) {
-		Map<Class<? extends AnnotatedObject>, Set<MiriamType>> map = new HashMap<Class<? extends AnnotatedObject>, Set<MiriamType>>();
-		Queue<TreeNode> queue = new LinkedList<TreeNode>();
-		queue.add(annotatorsTree);
-		while (!queue.isEmpty()) {
-			TreeNode node = queue.poll();
-			boolean valid = ((AnnotatedObjectTreeRow) node.getData()).getRequire();
-			Set<MiriamType> set = new HashSet<MiriamType>();
-
-			TreeNode parent = node;
-			while (parent != null) {
-				set.addAll(((AnnotatedObjectTreeRow) parent.getData()).getRequiredAnnotations());
-				if (((AnnotatedObjectTreeRow) parent.getData()).getRequire()) {
-					valid = true;
-				}
-				parent = parent.getParent();
-			}
-			if (!valid) {
-				set = null;
-			}
-			map.put((Class<? extends AnnotatedObject>) ((AnnotatedObjectTreeRow) node.getData()).getClazz(), set);
-
-			for (TreeNode node2 : node.getChildren()) {
-				queue.add(node2);
-			}
-		}
-		requiredAnnotations = map;
-	}
-
-	/**
-	 * Returns {@link #validAnnotations}.
-	 * 
-	 * @return {@link #validAnnotations}.
-	 */
-	public Map<Class<? extends AnnotatedObject>, Set<MiriamType>> getValidAnnotations() {
-		return validAnnotations;
-	}
-
-	/**
-	 * Returns {@link #requiredAnnotations}.
-	 * 
-	 * @return {@link #requiredAnnotations}.
-	 */
-	public Map<Class<? extends AnnotatedObject>, Set<MiriamType>> getRequiredAnnotations() {
-		return requiredAnnotations;
-	}
-
-	/**
-	 * Sets {@link #projectDir}.
-	 * 
-	 * @param directory
-	 *          new {@link #projectDir} value
-	 * @return instance of this class with new value set
-	 */
-	public CreateProjectParams projectDir(String directory) {
-		this.projectDir = directory;
-		return this;
-	}
-
-	/**
-	 * @return the projectDir
-	 * @see #projectDir
-	 */
-	public String getProjectDir() {
-		return projectDir;
-	}
-
-	/**
-	 * 
-	 * @param projectName
-	 *          new {@link #projectName}
-	 * @return instance of this class with new value set
-	 */
-	public CreateProjectParams projectName(String projectName) {
-		this.projectName = projectName;
-		return this;
-	}
-
-	/**
-	 * @return the projectName
-	 * @see #projectName
-	 */
-	public String getProjectName() {
-		return projectName;
-	}
-
-	/**
-	 * @param value
-	 *          the networkLayoutAsDefault to set
-	 * @see #networkLayoutAsDefault
-	 * @return instance of this class with new value set
-	 */
-	public CreateProjectParams networkLayoutAsDefault(boolean value) {
-		this.networkLayoutAsDefault = value;
-		return this;
-
-	}
-
-	/**
-	 * @return the networkLayoutAsDefault
-	 * @see #networkLayoutAsDefault
-	 */
-	public boolean isNetworkLayoutAsDefault() {
-		return networkLayoutAsDefault;
-	}
-
-	/**
-	 * @return disease MESH code.
-	 */
-	public String getDisease() {
-		return disease;
-	}
-
-	/**
-	 * @param disease
-	 *          the code of the disease.
-	 * @return updated params object.
-	 */
-	public CreateProjectParams projectDisease(String disease) {
-		this.disease = disease;
-		return this;
-	}
-
-	/**
-	 * @return the organism
-	 * @see #organism
-	 */
-	public String getOrganism() {
-		return organism;
-	}
-
-	/**
-	 * @param organism
-	 *          the organism to set
-	 * @return updated params object.
-	 */
-	public CreateProjectParams projectOrganism(String organism) {
-		this.organism = organism;
-		return this;
-	}
-
-}
+package lcsb.mapviewer.services.utils;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+
+import org.apache.commons.io.IOUtils;
+import org.primefaces.model.TreeNode;
+
+import lcsb.mapviewer.converter.zip.ZipEntryFile;
+import lcsb.mapviewer.model.map.AnnotatedObject;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.services.overlay.AnnotatedObjectTreeRow;
+
+/**
+ * Set of parameters used during creation of new project.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class CreateProjectParams {
+
+	/**
+	 * User defined project identifier.
+	 */
+	private String																								 projectId;
+
+	/**
+	 * Name of the project.
+	 */
+	private String																								 projectName;
+
+	/**
+	 * Disease associated to the project.
+	 */
+	private String																								 disease;
+
+	/**
+	 * Organism associated to the project.
+	 */
+	private String																								 organism;
+
+	/**
+	 * Path to a file used as a model.
+	 */
+	private String																								 projectFile;
+
+	/**
+	 * Is the project a complex multi-file project.
+	 */
+	private boolean																								 complex;
+
+	/**
+	 * List of zip entries in the complex model definition.
+	 */
+	private List<ZipEntryFile>																		 zipEntries							= new ArrayList<ZipEntryFile>();
+
+	/**
+	 * Should the elements be annotated by the external resources.
+	 */
+	private boolean																								 updateAnnotations			= false;
+
+	/**
+	 * Do we want to generate images for all available layers.
+	 */
+	private boolean																								 images									= false;
+
+	/**
+	 * Should the map be autoresized after processing (to trim unnecessary
+	 * margins).
+	 */
+	private boolean																								 autoResize							= true;
+
+	/**
+	 * Should the data from external resources but linked to model be cached.
+	 */
+	private boolean																								 cacheModel							= true;
+
+	/**
+	 * Should the process of creation of the project be asynchronous (in separate
+	 * thread).
+	 */
+	private boolean																								 async									= false;
+
+	/**
+	 * Should the map be displayed in SBGN format.
+	 */
+	private boolean																								 sbgnFormat							= false;
+
+	/**
+	 * Is the {@link lcsb.mapviewer.services.utils.data.BuildInLayout#NORMAL}
+	 * default {@link lcsb.mapviewer.model.map.layout.Layout Layout} when
+	 * generating new project.
+	 */
+	private boolean																								 networkLayoutAsDefault	= false;
+
+	/**
+	 * Do we want to analyze annotations after processing of the map. If yes then
+	 * in the email with summary of the generation process information about
+	 * improper annotations will be sent.
+	 */
+	private boolean																								 analyzeAnnotations			= false;
+
+	/**
+	 * Email address that should be notified after everything is done.
+	 */
+	private String																								 notifyEmail						= null;
+
+	/**
+	 * Description of the project.
+	 */
+	private String																								 description						= "";
+
+	/**
+	 * Version of the map.
+	 */
+	private String																								 version								= "0";
+
+	/**
+	 * Users that should have access to the map.
+	 */
+	private List<String[]>																				 users									= new ArrayList<String[]>();
+
+	/**
+	 * Directory with the static images that will be stored on server. This
+	 * directory is relative and it's a simple uniqe name within folder with
+	 * images.
+	 */
+	private String																								 projectDir;
+
+	/**
+	 * Map that contains informnation what kind of annotators should be used for
+	 * specific class.
+	 */
+	private Map<Class<?>, List<String>>														 annotatorsMap					= null;
+
+	/**
+	 * Map that contains information which {@link MiriamType miriam types} are
+	 * valid for which class.
+	 */
+	private Map<Class<? extends AnnotatedObject>, Set<MiriamType>> validAnnotations				= null;
+
+	/**
+	 * Map that contains information which {@link MiriamType miriam types} are
+	 * obigatory for which class.
+	 */
+	private Map<Class<? extends AnnotatedObject>, Set<MiriamType>> requiredAnnotations		= null;
+
+	/**
+	 * @param projectId
+	 *          the projectId to set
+	 * @return object with all parameters
+	 * @see #projectId
+	 */
+	public CreateProjectParams projectId(String projectId) {
+		this.projectId = projectId;
+		return this;
+	}
+
+	/**
+	 * @param notifyEmail
+	 *          the notifyEmail to set
+	 * @return object with all parameters
+	 * @see #notifyEmail
+	 */
+	public CreateProjectParams notifyEmail(String notifyEmail) {
+		this.notifyEmail = notifyEmail;
+		return this;
+	}
+
+	/**
+	 * @param projectFile
+	 *          the projectFile to set
+	 * @return object with all parameters
+	 * @see #projectFile
+	 */
+	public CreateProjectParams projectFile(String projectFile) {
+		this.projectFile = projectFile;
+		return this;
+	}
+
+	/**
+	 * @param autoResize
+	 *          the autoResize to set
+	 * @return object with all parameters
+	 * @see #autoResize
+	 */
+	public CreateProjectParams autoResize(boolean autoResize) {
+		this.autoResize = autoResize;
+		return this;
+	}
+
+	/**
+	 * Sets input stream from which projects should be generated.
+	 * 
+	 * @param is
+	 *          inputstream with the data of the project to be generated
+	 * @return object with all parameters
+	 * @throws IOException
+	 *           thrown if there are some problem with the stream
+	 */
+	public CreateProjectParams projectFile(InputStream is) throws IOException {
+		File temp = File.createTempFile("model", ".xml");
+		IOUtils.copy(is, new FileOutputStream(temp));
+		this.projectFile = temp.getAbsolutePath();
+		return this;
+	}
+
+	/**
+	 * Sets file from which projects should be generated.
+	 * 
+	 * @param file
+	 *          file with the data of the project to be generated
+	 * @return object with all parameters
+	 */
+	public CreateProjectParams projectFile(File file) {
+		this.projectFile = file.getAbsolutePath();
+		return this;
+	}
+
+	/**
+	 * @param async
+	 *          the async to set
+	 * @return object with all parameters
+	 * @see #async
+	 */
+	public CreateProjectParams async(boolean async) {
+		this.async = async;
+		return this;
+	}
+
+	/**
+	 * @param analyzeAnnotations
+	 *          the analyzeAnnotations to set
+	 * @return object with all parameters
+	 * @see #analyzeAnnotations
+	 */
+	public CreateProjectParams analyzeAnnotations(boolean analyzeAnnotations) {
+		this.analyzeAnnotations = analyzeAnnotations;
+		return this;
+	}
+
+	/**
+	 * @param updateAnnotations
+	 *          the updateAnnotations to set
+	 * @return object with all parameters
+	 * @see #updateAnnotations
+	 */
+	public CreateProjectParams annotations(boolean updateAnnotations) {
+		this.updateAnnotations = updateAnnotations;
+		return this;
+	}
+
+	/**
+	 * @param images
+	 *          the images to set
+	 * @return object with all parameters
+	 * @see #images
+	 */
+	public CreateProjectParams images(boolean images) {
+		this.images = images;
+		return this;
+	}
+
+	/**
+	 * @param description
+	 *          the description to set
+	 * @return object with all parameters
+	 * @see #description
+	 */
+	public CreateProjectParams description(String description) {
+		this.description = description;
+		return this;
+	}
+
+	/**
+	 * @param version
+	 *          the version to set
+	 * @return object with all parameters
+	 * @see #version
+	 */
+	public CreateProjectParams version(String version) {
+		this.version = version;
+		return this;
+	}
+
+	/**
+	 * Adds a user to the list of users that should have access to the project
+	 * from the beginning.
+	 * 
+	 * @param login
+	 *          login of the user
+	 * @param password
+	 *          password (in case user doesn't exist yet)
+	 * @return object with all parameters
+	 * @return
+	 */
+	public CreateProjectParams addUser(String login, String password) {
+		this.users.add(new String[] { login, password });
+		return this;
+	}
+
+	/**
+	 * @return the users
+	 * @see #users
+	 */
+	public List<String[]> getUsers() {
+		return users;
+	}
+
+	/**
+	 * @return the version
+	 * @see #version
+	 */
+	public String getVersion() {
+		return version;
+	}
+
+	/**
+	 * @return the description
+	 * @see #description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * @return the notifyEmail
+	 * @see #notifyEmail
+	 */
+	public String getNotifyEmail() {
+		return notifyEmail;
+	}
+
+	/**
+	 * @return the analyzeAnnotations
+	 * @see #analyzeAnnotations
+	 */
+	public boolean isAnalyzeAnnotations() {
+		return analyzeAnnotations;
+	}
+
+	/**
+	 * @return the async
+	 * @see #async
+	 */
+	public boolean isAsync() {
+		return async;
+	}
+
+	/**
+	 * @return the autoResize
+	 * @see #autoResize
+	 */
+	public boolean isAutoResize() {
+		return autoResize;
+	}
+
+	/**
+	 * @return the images
+	 * @see #images
+	 */
+	public boolean isImages() {
+		return images;
+	}
+
+	/**
+	 * @return the updateAnnotations
+	 * @see #updateAnnotations
+	 */
+	public boolean isUpdateAnnotations() {
+		return updateAnnotations;
+	}
+
+	/**
+	 * @return the projectFile
+	 * @see #projectFile
+	 */
+	public String getProjectFile() {
+		return projectFile;
+	}
+
+	/**
+	 * @return the projectId
+	 * @see #projectId
+	 */
+	public String getProjectId() {
+		return projectId;
+	}
+
+	/**
+	 * @return the cacheModel
+	 * @see #cacheModel
+	 */
+	public boolean isCacheModel() {
+		return cacheModel;
+	}
+
+	/**
+	 * @param cacheModel
+	 *          the cacheModel to set
+	 * @see #cacheModel
+	 * @return object with all parameters
+	 */
+	public CreateProjectParams cacheModel(boolean cacheModel) {
+		this.cacheModel = cacheModel;
+		return this;
+	}
+
+	/**
+	 * @return the submodels
+	 * @see #zipEntries
+	 */
+	public List<ZipEntryFile> getZipEntries() {
+		return zipEntries;
+	}
+
+	/**
+	 * @param entry
+	 *          the submodel to add
+	 * @see #zipEntries
+	 * @return object with all parameters
+	 */
+	public CreateProjectParams addZipEntry(ZipEntryFile entry) {
+		if (entry != null) {
+			this.zipEntries.add(entry);
+		}
+		return this;
+	}
+
+	/**
+	 * @return the complex
+	 * @see #complex
+	 */
+	public boolean isComplex() {
+		return complex;
+	}
+
+	/**
+	 * @return the sbgnFormat
+	 * @see #sbgnFormat
+	 */
+	public boolean isSbgnFormat() {
+		return sbgnFormat;
+	}
+
+	/**
+	 * @param sbgnFormat
+	 *          the sbgnFormat to set
+	 * @see #sbgnFormat
+	 */
+	public void sbgnFormat(boolean sbgnFormat) {
+		this.sbgnFormat = sbgnFormat;
+	}
+
+	/**
+	 * @param complex
+	 *          the complex to set
+	 * @see #complex
+	 * @return object with all parameters
+	 */
+	public CreateProjectParams complex(boolean complex) {
+		this.complex = complex;
+		return this;
+	}
+
+	/**
+	 * Creates {@link #annotatorsMap}.
+	 * 
+	 * @param annotatorsTree
+	 *          tree containing information about annotators for given classes
+	 */
+	public void annotatorsMap(TreeNode annotatorsTree) {
+		Map<Class<?>, List<String>> map = new HashMap<Class<?>, List<String>>();
+		Queue<TreeNode> queue = new LinkedList<TreeNode>();
+		queue.add(annotatorsTree);
+		while (!queue.isEmpty()) {
+			TreeNode node = queue.poll();
+
+			Set<String> set = new HashSet<String>();
+
+			TreeNode parent = node;
+			while (parent != null) {
+				set.addAll(((AnnotatedObjectTreeRow) parent.getData()).getUsedAnnotators());
+				parent = parent.getParent();
+			}
+			List<String> list = new ArrayList<String>();
+			list.addAll(set);
+			map.put(((AnnotatedObjectTreeRow) node.getData()).getClazz(), list);
+
+			for (TreeNode node2 : node.getChildren()) {
+				queue.add(node2);
+			}
+		}
+		annotatorsMap = map;
+	}
+
+	/**
+	 * @return the annotatorsMap
+	 * @see #annotatorsMap
+	 */
+	public Map<Class<?>, List<String>> getAnnotatorsMap() {
+		return annotatorsMap;
+	}
+
+	/**
+	 * @param annotatorsMap
+	 *          the annotatorsMap to set
+	 * @see #annotatorsMap
+	 */
+	public void setAnnotatorsMap(Map<Class<?>, List<String>> annotatorsMap) {
+		this.annotatorsMap = annotatorsMap;
+	}
+
+	/**
+	 * Creates {@link #validAnnotations}.
+	 * 
+	 * @param annotatorsTree
+	 *          tree containing information about valid {@link MiriamType miriam
+	 *          types}
+	 */
+	@SuppressWarnings("unchecked")
+	public void validAnnotations(TreeNode annotatorsTree) {
+		Map<Class<? extends AnnotatedObject>, Set<MiriamType>> map = new HashMap<Class<? extends AnnotatedObject>, Set<MiriamType>>();
+		Queue<TreeNode> queue = new LinkedList<TreeNode>();
+		queue.add(annotatorsTree);
+		while (!queue.isEmpty()) {
+			TreeNode node = queue.poll();
+			Set<MiriamType> set = new HashSet<MiriamType>();
+
+			TreeNode parent = node;
+			while (parent != null) {
+				set.addAll(((AnnotatedObjectTreeRow) parent.getData()).getValidAnnotations());
+				parent = parent.getParent();
+			}
+			map.put((Class<? extends AnnotatedObject>) ((AnnotatedObjectTreeRow) node.getData()).getClazz(), set);
+
+			for (TreeNode node2 : node.getChildren()) {
+				queue.add(node2);
+			}
+		}
+		validAnnotations = map;
+	}
+
+	/**
+	 * Creates {@link #requiredAnnotations}.
+	 * 
+	 * @param annotatorsTree
+	 *          tree containing information about required {@link MiriamType
+	 *          miriam types}
+	 */
+	@SuppressWarnings("unchecked")
+	public void requiredAnnotations(TreeNode annotatorsTree) {
+		Map<Class<? extends AnnotatedObject>, Set<MiriamType>> map = new HashMap<Class<? extends AnnotatedObject>, Set<MiriamType>>();
+		Queue<TreeNode> queue = new LinkedList<TreeNode>();
+		queue.add(annotatorsTree);
+		while (!queue.isEmpty()) {
+			TreeNode node = queue.poll();
+			boolean valid = ((AnnotatedObjectTreeRow) node.getData()).getRequire();
+			Set<MiriamType> set = new HashSet<MiriamType>();
+
+			TreeNode parent = node;
+			while (parent != null) {
+				set.addAll(((AnnotatedObjectTreeRow) parent.getData()).getRequiredAnnotations());
+				if (((AnnotatedObjectTreeRow) parent.getData()).getRequire()) {
+					valid = true;
+				}
+				parent = parent.getParent();
+			}
+			if (!valid) {
+				set = null;
+			}
+			map.put((Class<? extends AnnotatedObject>) ((AnnotatedObjectTreeRow) node.getData()).getClazz(), set);
+
+			for (TreeNode node2 : node.getChildren()) {
+				queue.add(node2);
+			}
+		}
+		requiredAnnotations = map;
+	}
+
+	/**
+	 * Returns {@link #validAnnotations}.
+	 * 
+	 * @return {@link #validAnnotations}.
+	 */
+	public Map<Class<? extends AnnotatedObject>, Set<MiriamType>> getValidAnnotations() {
+		return validAnnotations;
+	}
+
+	/**
+	 * Returns {@link #requiredAnnotations}.
+	 * 
+	 * @return {@link #requiredAnnotations}.
+	 */
+	public Map<Class<? extends AnnotatedObject>, Set<MiriamType>> getRequiredAnnotations() {
+		return requiredAnnotations;
+	}
+
+	/**
+	 * Sets {@link #projectDir}.
+	 * 
+	 * @param directory
+	 *          new {@link #projectDir} value
+	 * @return instance of this class with new value set
+	 */
+	public CreateProjectParams projectDir(String directory) {
+		this.projectDir = directory;
+		return this;
+	}
+
+	/**
+	 * @return the projectDir
+	 * @see #projectDir
+	 */
+	public String getProjectDir() {
+		return projectDir;
+	}
+
+	/**
+	 * 
+	 * @param projectName
+	 *          new {@link #projectName}
+	 * @return instance of this class with new value set
+	 */
+	public CreateProjectParams projectName(String projectName) {
+		this.projectName = projectName;
+		return this;
+	}
+
+	/**
+	 * @return the projectName
+	 * @see #projectName
+	 */
+	public String getProjectName() {
+		return projectName;
+	}
+
+	/**
+	 * @param value
+	 *          the networkLayoutAsDefault to set
+	 * @see #networkLayoutAsDefault
+	 * @return instance of this class with new value set
+	 */
+	public CreateProjectParams networkLayoutAsDefault(boolean value) {
+		this.networkLayoutAsDefault = value;
+		return this;
+
+	}
+
+	/**
+	 * @return the networkLayoutAsDefault
+	 * @see #networkLayoutAsDefault
+	 */
+	public boolean isNetworkLayoutAsDefault() {
+		return networkLayoutAsDefault;
+	}
+
+	/**
+	 * @return disease MESH code.
+	 */
+	public String getDisease() {
+		return disease;
+	}
+
+	/**
+	 * @param disease
+	 *          the code of the disease.
+	 * @return updated params object.
+	 */
+	public CreateProjectParams projectDisease(String disease) {
+		this.disease = disease;
+		return this;
+	}
+
+	/**
+	 * @return the organism
+	 * @see #organism
+	 */
+	public String getOrganism() {
+		return organism;
+	}
+
+	/**
+	 * @param organism
+	 *          the organism to set
+	 * @return updated params object.
+	 */
+	public CreateProjectParams projectOrganism(String organism) {
+		this.organism = organism;
+		return this;
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/utils/SearchIndexer.java b/service/src/main/java/lcsb/mapviewer/services/utils/SearchIndexer.java
index f1c783fb36..b7bc490f3d 100644
--- a/service/src/main/java/lcsb/mapviewer/services/utils/SearchIndexer.java
+++ b/service/src/main/java/lcsb/mapviewer/services/utils/SearchIndexer.java
@@ -1,191 +1,191 @@
-package lcsb.mapviewer.services.utils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SearchIndex;
-
-/**
- * This class is responsible for seqrch queries. It allows to create an index
- * for an alias and a query this index in a way.
- * 
- * @author Piotr Gawron
- * 
- */
-public class SearchIndexer {
-
-	/**
-	 * Base score of the index generated for alias id. It will be used as a shift
-	 * for {@link SearchIndex#weight} value.
-	 */
-	private static final int SEARCH_SCORE_LEVEL_FOR_ALIAS_ID							= 60;
-
-	/**
-	 * Base score of the index generated for species id. It will be used as a
-	 * shift for {@link SearchIndex#weight} value.
-	 */
-	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_ID						= 70;
-
-	/**
-	 * Base score of the index generated for {@link Element#formerSymbols}. It
-	 * will be used as a shift for {@link SearchIndex#weight} value.
-	 */
-	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_FORMER_SYMBOL	= 75;
-
-	/**
-	 * Base score of the index generated for full name. It will be used as a shift
-	 * for {@link SearchIndex#weight} value.
-	 */
-	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_FULL_NAME			= 80;
-
-	/**
-	 * Base score of the index generated for synonims. It will be used as a shift
-	 * for {@link SearchIndex#weight} value.
-	 */
-	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_SYNONIM				= 90;
-
-	/**
-	 * Base score of the index generated for name. It will be used as a shift for
-	 * {@link SearchIndex#weight} value.
-	 */
-	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_NAME					= 100;
-
-	/**
-	 * Default class logger.
-	 */
-	private Logger					 logger																				= Logger.getLogger(SearchIndexer.class);
-
-	/**
-	 * This method create list of indexes for an alias. Right now every index is
-	 * one of the following indexed strings (from most important to less
-	 * important): <br/>
-	 * <ul>
-	 * <li>species name,</li>
-	 * <li>synonyms (only for proteins annotated by vencata server),</li>
-	 * <li>common names (only for proteins annotated by vencata server),</li>
-	 * <li>former symbols,</li>
-	 * <li>speciesID,</li>
-	 * <li>aliasID,</li>
-	 * </ul>
-	 * 
-	 * @param alias
-	 *          object to be indexed
-	 * @return list of indexes for an alias
-	 */
-	public List<SearchIndex> createIndexForAlias(Alias alias) {
-		List<SearchIndex> result = new ArrayList<SearchIndex>();
-		String id1 = alias.getAliasId();
-		result.add(new SearchIndex(getIndexStringForString(id1), SEARCH_SCORE_LEVEL_FOR_ALIAS_ID));
-		Element species = alias.getElement();
-		if (species != null) {
-			String id2 = species.getElementId();
-			String id3 = species.getName();
-
-			result.add(new SearchIndex(getIndexStringForString(id2), SEARCH_SCORE_LEVEL_FOR_SPECIES_ID));
-			result.add(new SearchIndex(getIndexStringForString(id3), SEARCH_SCORE_LEVEL_FOR_SPECIES_NAME));
-
-			for (String string : species.getSynonyms()) {
-				result.add(new SearchIndex(getIndexStringForString(string), SEARCH_SCORE_LEVEL_FOR_SPECIES_SYNONIM));
-			}
-			for (String string : species.getFormerSymbols()) {
-				result.add(new SearchIndex(getIndexStringForString(string), SEARCH_SCORE_LEVEL_FOR_SPECIES_FORMER_SYMBOL));
-			}
-			String name = species.getFullName();
-			if (name != null && !name.equals("")) {
-				result.add(new SearchIndex(getIndexStringForString(name), SEARCH_SCORE_LEVEL_FOR_SPECIES_FULL_NAME));
-			}
-		} else {
-			logger.warn("Indexing alias which doesn't contain element...");
-		}
-		return result;
-	}
-
-	/**
-	 * This method transform a string into indexed string version. Right now the
-	 * indexed version is a lowercase string which contains only alphanumerical
-	 * characters.
-	 * 
-	 * @param str
-	 *          string for conversion
-	 * @return indexed version of the input string
-	 */
-	private String getIndexStringForString(String str) {
-		return str.toLowerCase().replaceAll("[^a-z0-9]", "");
-	}
-
-	/**
-	 * This method transform a string into indexed query. AvailablePrefixes
-	 * contains a collection of all possible prefixes for query string that should
-	 * be ommitted.
-	 * 
-	 * @param originalQuery
-	 *          query to be transformed
-	 * @param availablePrefixes
-	 *          collection of valid prefixes in the query
-	 * 
-	 * @return indexed string of the qoriginal query
-	 */
-	public String getQueryStringForIndex(String originalQuery, Collection<String> availablePrefixes) {
-		String result = originalQuery;
-		for (String string : availablePrefixes) {
-			if (result.startsWith(string + ":")) {
-				result = result.replaceFirst(string + ":", "");
-				break;
-			}
-		}
-
-		return getIndexStringForString(result);
-	}
-
-	/**
-	 * This method check if query match search index and return probability of the
-	 * hit between <0,1> (0 - means query is not similar to index, 1 means perfect
-	 * match) increased by the index weight if probability is higher than 0.
-	 * 
-	 * @param query
-	 *          query to be checked (it should be already prepared in the same way
-	 *          as index is)
-	 * @param index
-	 *          search index value to be checked
-	 * @return probabily value (range <0,1>) of match between query and index
-	 *         increased by the index weight
-	 */
-	public double match(String query, SearchIndex index) {
-		double partialValue = 0;
-		if (index.getValue().contains(query)) {
-			partialValue = ((double) query.length()) / ((double) index.getValue().length());
-		}
-		if (partialValue > 0) {
-			return index.getWeight() + partialValue;
-		} else {
-			return 0;
-		}
-	}
-
-	/**
-	 * Return type of elements that can be returned for the query.
-	 * 
-	 * @param string
-	 *          query string.
-	 * @param speciesSearchReversePrefix
-	 *          map containing information about possible prefixes used in the
-	 *          query
-	 * @return class of the element that might exist in the result
-	 */
-	public Class<? extends Element> getTypeForQuery(String string, Map<String, Class<? extends Element>> speciesSearchReversePrefix) {
-		String result = string;
-		for (Entry<String, Class<? extends Element>> entry : speciesSearchReversePrefix.entrySet()) {
-			if (result.startsWith(entry.getKey() + ":")) {
-				return entry.getValue();
-			}
-		}
-		return Element.class;
-	}
-}
+package lcsb.mapviewer.services.utils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.SearchIndex;
+
+/**
+ * This class is responsible for seqrch queries. It allows to create an index
+ * for an alias and a query this index in a way.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class SearchIndexer {
+
+	/**
+	 * Base score of the index generated for alias id. It will be used as a shift
+	 * for {@link SearchIndex#weight} value.
+	 */
+	private static final int SEARCH_SCORE_LEVEL_FOR_ALIAS_ID							= 60;
+
+	/**
+	 * Base score of the index generated for species id. It will be used as a
+	 * shift for {@link SearchIndex#weight} value.
+	 */
+	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_ID						= 70;
+
+	/**
+	 * Base score of the index generated for {@link Element#formerSymbols}. It
+	 * will be used as a shift for {@link SearchIndex#weight} value.
+	 */
+	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_FORMER_SYMBOL	= 75;
+
+	/**
+	 * Base score of the index generated for full name. It will be used as a shift
+	 * for {@link SearchIndex#weight} value.
+	 */
+	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_FULL_NAME			= 80;
+
+	/**
+	 * Base score of the index generated for synonims. It will be used as a shift
+	 * for {@link SearchIndex#weight} value.
+	 */
+	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_SYNONIM				= 90;
+
+	/**
+	 * Base score of the index generated for name. It will be used as a shift for
+	 * {@link SearchIndex#weight} value.
+	 */
+	private static final int SEARCH_SCORE_LEVEL_FOR_SPECIES_NAME					= 100;
+
+	/**
+	 * Default class logger.
+	 */
+	private Logger					 logger																				= Logger.getLogger(SearchIndexer.class);
+
+	/**
+	 * This method create list of indexes for an alias. Right now every index is
+	 * one of the following indexed strings (from most important to less
+	 * important): <br/>
+	 * <ul>
+	 * <li>species name,</li>
+	 * <li>synonyms (only for proteins annotated by vencata server),</li>
+	 * <li>common names (only for proteins annotated by vencata server),</li>
+	 * <li>former symbols,</li>
+	 * <li>speciesID,</li>
+	 * <li>aliasID,</li>
+	 * </ul>
+	 * 
+	 * @param alias
+	 *          object to be indexed
+	 * @return list of indexes for an alias
+	 */
+	public List<SearchIndex> createIndexForAlias(Alias alias) {
+		List<SearchIndex> result = new ArrayList<SearchIndex>();
+		String id1 = alias.getAliasId();
+		result.add(new SearchIndex(getIndexStringForString(id1), SEARCH_SCORE_LEVEL_FOR_ALIAS_ID));
+		Element species = alias.getElement();
+		if (species != null) {
+			String id2 = species.getElementId();
+			String id3 = species.getName();
+
+			result.add(new SearchIndex(getIndexStringForString(id2), SEARCH_SCORE_LEVEL_FOR_SPECIES_ID));
+			result.add(new SearchIndex(getIndexStringForString(id3), SEARCH_SCORE_LEVEL_FOR_SPECIES_NAME));
+
+			for (String string : species.getSynonyms()) {
+				result.add(new SearchIndex(getIndexStringForString(string), SEARCH_SCORE_LEVEL_FOR_SPECIES_SYNONIM));
+			}
+			for (String string : species.getFormerSymbols()) {
+				result.add(new SearchIndex(getIndexStringForString(string), SEARCH_SCORE_LEVEL_FOR_SPECIES_FORMER_SYMBOL));
+			}
+			String name = species.getFullName();
+			if (name != null && !name.equals("")) {
+				result.add(new SearchIndex(getIndexStringForString(name), SEARCH_SCORE_LEVEL_FOR_SPECIES_FULL_NAME));
+			}
+		} else {
+			logger.warn("Indexing alias which doesn't contain element...");
+		}
+		return result;
+	}
+
+	/**
+	 * This method transform a string into indexed string version. Right now the
+	 * indexed version is a lowercase string which contains only alphanumerical
+	 * characters.
+	 * 
+	 * @param str
+	 *          string for conversion
+	 * @return indexed version of the input string
+	 */
+	private String getIndexStringForString(String str) {
+		return str.toLowerCase().replaceAll("[^a-z0-9]", "");
+	}
+
+	/**
+	 * This method transform a string into indexed query. AvailablePrefixes
+	 * contains a collection of all possible prefixes for query string that should
+	 * be ommitted.
+	 * 
+	 * @param originalQuery
+	 *          query to be transformed
+	 * @param availablePrefixes
+	 *          collection of valid prefixes in the query
+	 * 
+	 * @return indexed string of the qoriginal query
+	 */
+	public String getQueryStringForIndex(String originalQuery, Collection<String> availablePrefixes) {
+		String result = originalQuery;
+		for (String string : availablePrefixes) {
+			if (result.startsWith(string + ":")) {
+				result = result.replaceFirst(string + ":", "");
+				break;
+			}
+		}
+
+		return getIndexStringForString(result);
+	}
+
+	/**
+	 * This method check if query match search index and return probability of the
+	 * hit between <0,1> (0 - means query is not similar to index, 1 means perfect
+	 * match) increased by the index weight if probability is higher than 0.
+	 * 
+	 * @param query
+	 *          query to be checked (it should be already prepared in the same way
+	 *          as index is)
+	 * @param index
+	 *          search index value to be checked
+	 * @return probabily value (range <0,1>) of match between query and index
+	 *         increased by the index weight
+	 */
+	public double match(String query, SearchIndex index) {
+		double partialValue = 0;
+		if (index.getValue().contains(query)) {
+			partialValue = ((double) query.length()) / ((double) index.getValue().length());
+		}
+		if (partialValue > 0) {
+			return index.getWeight() + partialValue;
+		} else {
+			return 0;
+		}
+	}
+
+	/**
+	 * Return type of elements that can be returned for the query.
+	 * 
+	 * @param string
+	 *          query string.
+	 * @param speciesSearchReversePrefix
+	 *          map containing information about possible prefixes used in the
+	 *          query
+	 * @return class of the element that might exist in the result
+	 */
+	public Class<? extends Element> getTypeForQuery(String string, Map<String, Class<? extends Element>> speciesSearchReversePrefix) {
+		String result = string;
+		for (Entry<String, Class<? extends Element>> entry : speciesSearchReversePrefix.entrySet()) {
+			if (result.startsWith(entry.getKey() + ":")) {
+				return entry.getValue();
+			}
+		}
+		return Element.class;
+	}
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingView.java b/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingView.java
index 1fda1073b2..f7c5284cb1 100644
--- a/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingView.java
+++ b/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingView.java
@@ -1,125 +1,125 @@
-package lcsb.mapviewer.services.view;
-
-import java.io.Serializable;
-
-import lcsb.mapviewer.model.map.layout.ReferenceGenome;
-import lcsb.mapviewer.model.map.layout.ReferenceGenomeGeneMapping;
-
-/**
- * View representation of the {@link ReferenceGenome}.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ReferenceGenomeGeneMappingView extends AbstractView<ReferenceGenomeGeneMapping> implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long	serialVersionUID = 1L;
-
-	/**
-	 * {@link ReferenceGenomeGeneMapping#name}.
-	 */
-	private String						name;
-
-	/**
-	 * Url from which reference genome was downloaded.
-	 */
-	private String						sourceUrl;
-
-	/**
-	 * Local url where reference genome file can be accessed.
-	 */
-	private String						localUrl;
-
-	/**
-	 * Progess of downloading process (100 means file is downloaded).
-	 */
-	private double						downloadProgress;
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param object
-	 *          {@link ReferenceGenome} which this view should visualize
-	 */
-	protected ReferenceGenomeGeneMappingView(ReferenceGenomeGeneMapping object) {
-		super(object);
-	}
-
-	/**
-	 * Default constructor. Should be used only for deserialization.
-	 */
-	protected ReferenceGenomeGeneMappingView() {
-	}
-
-	/**
-	 * @return the name
-	 * @see #name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * @param name
-	 *          the name to set
-	 * @see #name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * @return the sourceUrl
-	 * @see #sourceUrl
-	 */
-	public String getSourceUrl() {
-		return sourceUrl;
-	}
-
-	/**
-	 * @param sourceUrl
-	 *          the sourceUrl to set
-	 * @see #sourceUrl
-	 */
-	public void setSourceUrl(String sourceUrl) {
-		this.sourceUrl = sourceUrl;
-	}
-
-	/**
-	 * @return the localUrl
-	 * @see #localUrl
-	 */
-	public String getLocalUrl() {
-		return localUrl;
-	}
-
-	/**
-	 * @param localUrl
-	 *          the localUrl to set
-	 * @see #localUrl
-	 */
-	public void setLocalUrl(String localUrl) {
-		this.localUrl = localUrl;
-	}
-
-	/**
-	 * @return the downloadProgress
-	 * @see #downloadProgress
-	 */
-	public double getDownloadProgress() {
-		return downloadProgress;
-	}
-
-	/**
-	 * @param downloadProgress
-	 *          the downloadProgress to set
-	 * @see #downloadProgress
-	 */
-	public void setDownloadProgress(double downloadProgress) {
-		this.downloadProgress = downloadProgress;
-	}
-
-}
+package lcsb.mapviewer.services.view;
+
+import java.io.Serializable;
+
+import lcsb.mapviewer.model.map.layout.ReferenceGenome;
+import lcsb.mapviewer.model.map.layout.ReferenceGenomeGeneMapping;
+
+/**
+ * View representation of the {@link ReferenceGenome}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ReferenceGenomeGeneMappingView extends AbstractView<ReferenceGenomeGeneMapping> implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long	serialVersionUID = 1L;
+
+	/**
+	 * {@link ReferenceGenomeGeneMapping#name}.
+	 */
+	private String						name;
+
+	/**
+	 * Url from which reference genome was downloaded.
+	 */
+	private String						sourceUrl;
+
+	/**
+	 * Local url where reference genome file can be accessed.
+	 */
+	private String						localUrl;
+
+	/**
+	 * Progess of downloading process (100 means file is downloaded).
+	 */
+	private double						downloadProgress;
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param object
+	 *          {@link ReferenceGenome} which this view should visualize
+	 */
+	protected ReferenceGenomeGeneMappingView(ReferenceGenomeGeneMapping object) {
+		super(object);
+	}
+
+	/**
+	 * Default constructor. Should be used only for deserialization.
+	 */
+	protected ReferenceGenomeGeneMappingView() {
+	}
+
+	/**
+	 * @return the name
+	 * @see #name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * @param name
+	 *          the name to set
+	 * @see #name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * @return the sourceUrl
+	 * @see #sourceUrl
+	 */
+	public String getSourceUrl() {
+		return sourceUrl;
+	}
+
+	/**
+	 * @param sourceUrl
+	 *          the sourceUrl to set
+	 * @see #sourceUrl
+	 */
+	public void setSourceUrl(String sourceUrl) {
+		this.sourceUrl = sourceUrl;
+	}
+
+	/**
+	 * @return the localUrl
+	 * @see #localUrl
+	 */
+	public String getLocalUrl() {
+		return localUrl;
+	}
+
+	/**
+	 * @param localUrl
+	 *          the localUrl to set
+	 * @see #localUrl
+	 */
+	public void setLocalUrl(String localUrl) {
+		this.localUrl = localUrl;
+	}
+
+	/**
+	 * @return the downloadProgress
+	 * @see #downloadProgress
+	 */
+	public double getDownloadProgress() {
+		return downloadProgress;
+	}
+
+	/**
+	 * @param downloadProgress
+	 *          the downloadProgress to set
+	 * @see #downloadProgress
+	 */
+	public void setDownloadProgress(double downloadProgress) {
+		this.downloadProgress = downloadProgress;
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingViewFactory.java b/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingViewFactory.java
index 7224c89568..9eabc77f2f 100644
--- a/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingViewFactory.java
+++ b/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingViewFactory.java
@@ -1,59 +1,59 @@
-package lcsb.mapviewer.services.view;
-
-import java.io.FileNotFoundException;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.google.gson.Gson;
-
-import lcsb.mapviewer.annotation.cache.BigFileCache;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.layout.ReferenceGenomeGeneMapping;
-
-/**
- * Factory class for {@link AnnotationView} class.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ReferenceGenomeGeneMappingViewFactory extends AbstractViewFactory<ReferenceGenomeGeneMapping, ReferenceGenomeGeneMappingView> {
-
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger	logger = Logger.getLogger(ReferenceGenomeGeneMappingViewFactory.class);
-
-	/**
-	 * Service that allows to access big files (reference genome is stored as a
-	 * big file on the server).
-	 */
-	@Autowired
-	private BigFileCache	bigFileCache;
-
-	@Override
-	public ReferenceGenomeGeneMappingView create(ReferenceGenomeGeneMapping object) {
-		ReferenceGenomeGeneMappingView result = new ReferenceGenomeGeneMappingView();
-		result.setDownloadProgress(object.getDownloadProgress());
-		try {
-			result.setLocalUrl("../" + bigFileCache.getLocalPathForFile(object.getSourceUrl()));
-		} catch (FileNotFoundException e) {
-			result.setLocalUrl(null);
-		}
-		result.setSourceUrl(object.getSourceUrl());
-		result.setName(object.getName());
-		return result;
-	}
-
-	@Override
-	public String createGson(ReferenceGenomeGeneMappingView object) {
-		return new Gson().toJson(object);
-	}
-
-	@Override
-	public ReferenceGenomeGeneMapping viewToObject(ReferenceGenomeGeneMappingView view) {
-		throw new NotImplementedException();
-	}
-
-}
+package lcsb.mapviewer.services.view;
+
+import java.io.FileNotFoundException;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.google.gson.Gson;
+
+import lcsb.mapviewer.annotation.cache.BigFileCache;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.layout.ReferenceGenomeGeneMapping;
+
+/**
+ * Factory class for {@link AnnotationView} class.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ReferenceGenomeGeneMappingViewFactory extends AbstractViewFactory<ReferenceGenomeGeneMapping, ReferenceGenomeGeneMappingView> {
+
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger	logger = Logger.getLogger(ReferenceGenomeGeneMappingViewFactory.class);
+
+	/**
+	 * Service that allows to access big files (reference genome is stored as a
+	 * big file on the server).
+	 */
+	@Autowired
+	private BigFileCache	bigFileCache;
+
+	@Override
+	public ReferenceGenomeGeneMappingView create(ReferenceGenomeGeneMapping object) {
+		ReferenceGenomeGeneMappingView result = new ReferenceGenomeGeneMappingView();
+		result.setDownloadProgress(object.getDownloadProgress());
+		try {
+			result.setLocalUrl("../" + bigFileCache.getLocalPathForFile(object.getSourceUrl()));
+		} catch (FileNotFoundException e) {
+			result.setLocalUrl(null);
+		}
+		result.setSourceUrl(object.getSourceUrl());
+		result.setName(object.getName());
+		return result;
+	}
+
+	@Override
+	public String createGson(ReferenceGenomeGeneMappingView object) {
+		return new Gson().toJson(object);
+	}
+
+	@Override
+	public ReferenceGenomeGeneMapping viewToObject(ReferenceGenomeGeneMappingView view) {
+		throw new NotImplementedException();
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeView.java b/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeView.java
index b08627bc75..a36ab1accd 100644
--- a/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeView.java
+++ b/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeView.java
@@ -1,193 +1,193 @@
-package lcsb.mapviewer.services.view;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import lcsb.mapviewer.model.map.layout.ReferenceGenome;
-import lcsb.mapviewer.model.map.layout.ReferenceGenomeType;
-
-/**
- * View representation of the {@link ReferenceGenome}.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ReferenceGenomeView extends AbstractView<ReferenceGenome> implements Serializable {
-
-	/**
-	 * 
-	 */
-	private static final long										 serialVersionUID	= 1L;
-
-	/**
-	 * {@link ReferenceGenome#organism}.
-	 */
-	private AnnotationView											 organism;
-
-	/**
-	 * {@link ReferenceGenome#type}.
-	 */
-	private ReferenceGenomeType									 type;
-
-	/**
-	 * {@link ReferenceGenome#version}.
-	 */
-	private String															 version;
-
-	/**
-	 * Progress of download process (100 means that file is complete).
-	 */
-	private double															 downloadProgress;
-
-	/**
-	 * Url from which reference genome file was downloaded.
-	 */
-	private String															 sourceUrl;
-
-	/**
-	 * Url to local copy of reference genome file.
-	 */
-	private String															 localUrl;
-
-	/**
-	 * List of gene mappings for reference genome.
-	 */
-	private List<ReferenceGenomeGeneMappingView> geneMapping			= new ArrayList<>();
-
-	/**
-	 * Default constructor.
-	 * 
-	 * @param object
-	 *          {@link ReferenceGenome} which this view should visualize
-	 */
-	protected ReferenceGenomeView(ReferenceGenome object) {
-		super(object);
-	}
-
-	/**
-	 * Default constructor. Should be used only for deserialization.
-	 */
-	protected ReferenceGenomeView() {
-	}
-
-	/**
-	 * @return the organism
-	 * @see #organism
-	 */
-	public AnnotationView getOrganism() {
-		return organism;
-	}
-
-	/**
-	 * @param organism
-	 *          the organism to set
-	 * @see #organism
-	 */
-	public void setOrganism(AnnotationView organism) {
-		this.organism = organism;
-	}
-
-	/**
-	 * @return the type
-	 * @see #type
-	 */
-	public ReferenceGenomeType getType() {
-		return type;
-	}
-
-	/**
-	 * @param type
-	 *          the type to set
-	 * @see #type
-	 */
-	public void setType(ReferenceGenomeType type) {
-		this.type = type;
-	}
-
-	/**
-	 * @return the version
-	 * @see #version
-	 */
-	public String getVersion() {
-		return version;
-	}
-
-	/**
-	 * @param version
-	 *          the version to set
-	 * @see #version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-
-	/**
-	 * @return the downloadProgress
-	 * @see #downloadProgress
-	 */
-	public double getDownloadProgress() {
-		return downloadProgress;
-	}
-
-	/**
-	 * @param downloadProgress
-	 *          the downloadProgress to set
-	 * @see #downloadProgress
-	 */
-	public void setDownloadProgress(double downloadProgress) {
-		this.downloadProgress = downloadProgress;
-	}
-
-	/**
-	 * @return the sourceUrl
-	 * @see #sourceUrl
-	 */
-	public String getSourceUrl() {
-		return sourceUrl;
-	}
-
-	/**
-	 * @param sourceUrl
-	 *          the sourceUrl to set
-	 * @see #sourceUrl
-	 */
-	public void setSourceUrl(String sourceUrl) {
-		this.sourceUrl = sourceUrl;
-	}
-
-	/**
-	 * @return the localUrl
-	 * @see #localUrl
-	 */
-	public String getLocalUrl() {
-		return localUrl;
-	}
-
-	/**
-	 * @param localUrl
-	 *          the localUrl to set
-	 * @see #localUrl
-	 */
-	public void setLocalUrl(String localUrl) {
-		this.localUrl = localUrl;
-	}
-
-	/**
-	 * @return the geneMapping
-	 * @see #geneMapping
-	 */
-	public List<ReferenceGenomeGeneMappingView> getGeneMapping() {
-		return geneMapping;
-	}
-
-	/**
-	 * @param geneMapping
-	 *          the geneMapping to set
-	 * @see #geneMapping
-	 */
-	public void setGeneMapping(List<ReferenceGenomeGeneMappingView> geneMapping) {
-		this.geneMapping = geneMapping;
-	}
-
-}
+package lcsb.mapviewer.services.view;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import lcsb.mapviewer.model.map.layout.ReferenceGenome;
+import lcsb.mapviewer.model.map.layout.ReferenceGenomeType;
+
+/**
+ * View representation of the {@link ReferenceGenome}.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ReferenceGenomeView extends AbstractView<ReferenceGenome> implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long										 serialVersionUID	= 1L;
+
+	/**
+	 * {@link ReferenceGenome#organism}.
+	 */
+	private AnnotationView											 organism;
+
+	/**
+	 * {@link ReferenceGenome#type}.
+	 */
+	private ReferenceGenomeType									 type;
+
+	/**
+	 * {@link ReferenceGenome#version}.
+	 */
+	private String															 version;
+
+	/**
+	 * Progress of download process (100 means that file is complete).
+	 */
+	private double															 downloadProgress;
+
+	/**
+	 * Url from which reference genome file was downloaded.
+	 */
+	private String															 sourceUrl;
+
+	/**
+	 * Url to local copy of reference genome file.
+	 */
+	private String															 localUrl;
+
+	/**
+	 * List of gene mappings for reference genome.
+	 */
+	private List<ReferenceGenomeGeneMappingView> geneMapping			= new ArrayList<>();
+
+	/**
+	 * Default constructor.
+	 * 
+	 * @param object
+	 *          {@link ReferenceGenome} which this view should visualize
+	 */
+	protected ReferenceGenomeView(ReferenceGenome object) {
+		super(object);
+	}
+
+	/**
+	 * Default constructor. Should be used only for deserialization.
+	 */
+	protected ReferenceGenomeView() {
+	}
+
+	/**
+	 * @return the organism
+	 * @see #organism
+	 */
+	public AnnotationView getOrganism() {
+		return organism;
+	}
+
+	/**
+	 * @param organism
+	 *          the organism to set
+	 * @see #organism
+	 */
+	public void setOrganism(AnnotationView organism) {
+		this.organism = organism;
+	}
+
+	/**
+	 * @return the type
+	 * @see #type
+	 */
+	public ReferenceGenomeType getType() {
+		return type;
+	}
+
+	/**
+	 * @param type
+	 *          the type to set
+	 * @see #type
+	 */
+	public void setType(ReferenceGenomeType type) {
+		this.type = type;
+	}
+
+	/**
+	 * @return the version
+	 * @see #version
+	 */
+	public String getVersion() {
+		return version;
+	}
+
+	/**
+	 * @param version
+	 *          the version to set
+	 * @see #version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	/**
+	 * @return the downloadProgress
+	 * @see #downloadProgress
+	 */
+	public double getDownloadProgress() {
+		return downloadProgress;
+	}
+
+	/**
+	 * @param downloadProgress
+	 *          the downloadProgress to set
+	 * @see #downloadProgress
+	 */
+	public void setDownloadProgress(double downloadProgress) {
+		this.downloadProgress = downloadProgress;
+	}
+
+	/**
+	 * @return the sourceUrl
+	 * @see #sourceUrl
+	 */
+	public String getSourceUrl() {
+		return sourceUrl;
+	}
+
+	/**
+	 * @param sourceUrl
+	 *          the sourceUrl to set
+	 * @see #sourceUrl
+	 */
+	public void setSourceUrl(String sourceUrl) {
+		this.sourceUrl = sourceUrl;
+	}
+
+	/**
+	 * @return the localUrl
+	 * @see #localUrl
+	 */
+	public String getLocalUrl() {
+		return localUrl;
+	}
+
+	/**
+	 * @param localUrl
+	 *          the localUrl to set
+	 * @see #localUrl
+	 */
+	public void setLocalUrl(String localUrl) {
+		this.localUrl = localUrl;
+	}
+
+	/**
+	 * @return the geneMapping
+	 * @see #geneMapping
+	 */
+	public List<ReferenceGenomeGeneMappingView> getGeneMapping() {
+		return geneMapping;
+	}
+
+	/**
+	 * @param geneMapping
+	 *          the geneMapping to set
+	 * @see #geneMapping
+	 */
+	public void setGeneMapping(List<ReferenceGenomeGeneMappingView> geneMapping) {
+		this.geneMapping = geneMapping;
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeViewFactory.java b/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeViewFactory.java
index 642ebc28d5..3020d06825 100644
--- a/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeViewFactory.java
+++ b/service/src/main/java/lcsb/mapviewer/services/view/ReferenceGenomeViewFactory.java
@@ -1,74 +1,74 @@
-package lcsb.mapviewer.services.view;
-
-import java.io.FileNotFoundException;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.google.gson.Gson;
-
-import lcsb.mapviewer.annotation.cache.BigFileCache;
-import lcsb.mapviewer.common.exception.NotImplementedException;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.layout.ReferenceGenome;
-
-/**
- * Factory class for {@link AnnotationView} class.
- * 
- * @author Piotr Gawron
- * 
- */
-public class ReferenceGenomeViewFactory extends AbstractViewFactory<ReferenceGenome, ReferenceGenomeView> {
-
-	/**
-	 * Default class logger.
-	 */
-	private static Logger													logger = Logger.getLogger(ReferenceGenomeViewFactory.class);
-
-	/**
-	 * Access point for big files.
-	 */
-	@Autowired
-	private BigFileCache													bigFileCache;
-
-	/**
-	 * Factory that changes {@link MiriamData} into readable annotations.
-	 */
-	@Autowired
-	private AnnotationViewFactory									annotationViewFactory;
-
-	/**
-	 * Factory that creates readable gene mappings.
-	 */
-	@Autowired
-	private ReferenceGenomeGeneMappingViewFactory	referenceGenomeGeneMappingViewFactory;
-
-	@Override
-	public ReferenceGenomeView create(ReferenceGenome object) {
-		ReferenceGenomeView result = new ReferenceGenomeView();
-		result.setDownloadProgress(object.getDownloadProgress());
-		result.setGeneMapping(referenceGenomeGeneMappingViewFactory.createList(object.getGeneMapping()));
-		try {
-			result.setLocalUrl("../" + bigFileCache.getLocalPathForFile(object.getSourceUrl()));
-		} catch (FileNotFoundException e) {
-			logger.warn("Cannot find local file", e);
-			result.setLocalUrl(null);
-		}
-		result.setOrganism(annotationViewFactory.create(object.getOrganism()));
-		result.setSourceUrl(object.getSourceUrl());
-		result.setType(object.getType());
-		result.setVersion(object.getVersion());
-		return result;
-	}
-
-	@Override
-	public String createGson(ReferenceGenomeView object) {
-		return new Gson().toJson(object);
-	}
-
-	@Override
-	public ReferenceGenome viewToObject(ReferenceGenomeView view) {
-		throw new NotImplementedException();
-	}
-
-}
+package lcsb.mapviewer.services.view;
+
+import java.io.FileNotFoundException;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.google.gson.Gson;
+
+import lcsb.mapviewer.annotation.cache.BigFileCache;
+import lcsb.mapviewer.common.exception.NotImplementedException;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.layout.ReferenceGenome;
+
+/**
+ * Factory class for {@link AnnotationView} class.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class ReferenceGenomeViewFactory extends AbstractViewFactory<ReferenceGenome, ReferenceGenomeView> {
+
+	/**
+	 * Default class logger.
+	 */
+	private static Logger													logger = Logger.getLogger(ReferenceGenomeViewFactory.class);
+
+	/**
+	 * Access point for big files.
+	 */
+	@Autowired
+	private BigFileCache													bigFileCache;
+
+	/**
+	 * Factory that changes {@link MiriamData} into readable annotations.
+	 */
+	@Autowired
+	private AnnotationViewFactory									annotationViewFactory;
+
+	/**
+	 * Factory that creates readable gene mappings.
+	 */
+	@Autowired
+	private ReferenceGenomeGeneMappingViewFactory	referenceGenomeGeneMappingViewFactory;
+
+	@Override
+	public ReferenceGenomeView create(ReferenceGenome object) {
+		ReferenceGenomeView result = new ReferenceGenomeView();
+		result.setDownloadProgress(object.getDownloadProgress());
+		result.setGeneMapping(referenceGenomeGeneMappingViewFactory.createList(object.getGeneMapping()));
+		try {
+			result.setLocalUrl("../" + bigFileCache.getLocalPathForFile(object.getSourceUrl()));
+		} catch (FileNotFoundException e) {
+			logger.warn("Cannot find local file", e);
+			result.setLocalUrl(null);
+		}
+		result.setOrganism(annotationViewFactory.create(object.getOrganism()));
+		result.setSourceUrl(object.getSourceUrl());
+		result.setType(object.getType());
+		result.setVersion(object.getVersion());
+		return result;
+	}
+
+	@Override
+	public String createGson(ReferenceGenomeView object) {
+		return new Gson().toJson(object);
+	}
+
+	@Override
+	public ReferenceGenome viewToObject(ReferenceGenomeView view) {
+		throw new NotImplementedException();
+	}
+
+}
diff --git a/service/src/main/java/lcsb/mapviewer/services/view/UserViewFactory.java b/service/src/main/java/lcsb/mapviewer/services/view/UserViewFactory.java
index 094ba434e0..7270a6114a 100644
--- a/service/src/main/java/lcsb/mapviewer/services/view/UserViewFactory.java
+++ b/service/src/main/java/lcsb/mapviewer/services/view/UserViewFactory.java
@@ -1,238 +1,238 @@
-package lcsb.mapviewer.services.view;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.user.BasicPrivilege;
-import lcsb.mapviewer.model.user.ObjectPrivilege;
-import lcsb.mapviewer.model.user.PrivilegeType;
-import lcsb.mapviewer.model.user.User;
-import lcsb.mapviewer.persist.dao.ProjectDao;
-import lcsb.mapviewer.services.utils.InvalidPrivilegeException;
-import lcsb.mapviewer.services.view.UserView.UserLayoutPrivilege;
-import lcsb.mapviewer.services.view.UserView.UserProjectPrivilegeView;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.common.exception.NotImplementedException;
-
-import com.google.gson.Gson;
-
-/**
- * Factory class for {@link UserView} class.
- * 
- * @author Piotr Gawron
- * 
- */
-public class UserViewFactory extends AbstractViewFactory<User, UserView> {
-	
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private static Logger				 logger	= Logger.getLogger(UserViewFactory.class);
-
-	/**
-	 * Data access object for projects.
-	 */
-	@Autowired
-	private ProjectDao					 projectDao;
-	
-	/**
-	 * Factory object for {@link PrivilegeView} elements.
-	 */
-	@Autowired
-	private PrivilegeViewFactory privilegeViewFactory;
-
-	@Override
-	public UserView create(User user) {
-		return create(user, projectDao.getAll());
-	}
-
-	/**
-	 * Creates {@link UserView} obejct for given user and given list of projects.
-	 * 
-	 * @param user
-	 *          object for which {@link UserView} element will be created
-	 * @param projects
-	 *          list of project for which privileges will be created as
-	 *          {@link PrivilegeView} elements in the result
-	 * @return {@link UserView} obejct for given user
-	 */
-	public UserView create(User user, List<Project> projects) {
-		UserView result = null;
-		if (user == null) {
-			result = new UserView();
-			for (Project project : projects) {
-				result.getProjectPrivileges().add(result.new UserProjectPrivilegeView(project));
-			}
-			for (PrivilegeType type : getBasicTypes()) {
-				result.getBasicPrivileges().add(privilegeViewFactory.create(type));
-			}
-			for (UserProjectPrivilegeView projectPrivilege : result.getProjectPrivileges()) {
-				for (PrivilegeType type : getObjectTypes()) {
-					if (type.getPrivilegeObjectType().equals(Project.class)) {
-						projectPrivilege.getProjectPrivileges().add(privilegeViewFactory.create(type));
-					}
-				}
-			}
-		} else {
-			result = new UserView(user);
-
-			for (Project project : projects) {
-				result.getProjectPrivileges().add(result.new UserProjectPrivilegeView(project));
-			}
-
-			setPrivilegeStatusFromDb(user, result);
-
-			createUnknownPrivileges(result);
-		}
-
-		Collections.sort(result.getBasicPrivileges());
-		for (UserProjectPrivilegeView row1 : result.getProjectPrivileges()) {
-			Collections.sort(row1.getProjectPrivileges());
-		}
-
-		return result;
-	}
-
-	/**
-	 * Creates privileges for user that doesn't exists in database.
-	 * 
-	 * @param row
-	 *          user for which we want to add missing privileges
-	 */
-	private void createUnknownPrivileges(UserView row) {
-		Set<PrivilegeType> knownPrivileges = new HashSet<PrivilegeType>();
-		for (PrivilegeView privilege : row.getBasicPrivileges()) {
-			knownPrivileges.add(privilege.getType());
-		}
-
-		for (PrivilegeType type : getBasicTypes()) {
-			if (!knownPrivileges.contains(type)) {
-				row.getBasicPrivileges().add(privilegeViewFactory.create(type));
-			}
-		}
-		for (UserProjectPrivilegeView projectPrivilege : row.getProjectPrivileges()) {
-			knownPrivileges.clear();
-			for (PrivilegeView privilege : projectPrivilege.getProjectPrivileges()) {
-				knownPrivileges.add(privilege.getType());
-			}
-			for (PrivilegeType type : getObjectTypes()) {
-				if (type.getPrivilegeObjectType().equals(Project.class)) {
-					if (!knownPrivileges.contains(type)) {
-						projectPrivilege.getProjectPrivileges().add(privilegeViewFactory.create(type));
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * Method that assignes privileges from original user object into view
-	 * representation userView.
-	 * 
-	 * @param user
-	 *          original object retrieved from database
-	 * @param userView
-	 *          representation of the user passed later on to higher layer
-	 */
-	private void setPrivilegeStatusFromDb(User user, UserView userView) {
-		for (BasicPrivilege privilege : user.getPrivileges()) {
-			if (privilege.getClass().equals(BasicPrivilege.class)) {
-				userView.getBasicPrivileges().add(privilegeViewFactory.create(privilege));
-			} else if (privilege.getClass().equals(ObjectPrivilege.class)) {
-				if (privilege.getType().getPrivilegeObjectType().equals(Project.class)) {
-					int projectId = ((ObjectPrivilege) privilege).getIdObject();
-					UserProjectPrivilegeView projectPrivilege = userView.getProjectPrivilegeByProjectId(projectId);
-					if (projectPrivilege != null) {
-						projectPrivilege.getProjectPrivileges().add(privilegeViewFactory.create(privilege));
-					}
-				} else if (privilege.getType().getPrivilegeObjectType().equals(Layout.class)) {
-					int layoutId = ((ObjectPrivilege) privilege).getIdObject();
-					UserLayoutPrivilege layoutPrivilege = userView.getLayoutPrivilegeByLayoutId(layoutId);
-					if (layoutPrivilege != null) {
-						layoutPrivilege.getLayoutPrivileges().add(privilegeViewFactory.create(privilege));
-					}
-				} else {
-					throw new InvalidPrivilegeException("Unknown class for object privilege: " + privilege.getType().getPrivilegeObjectType());
-				}
-			} else {
-				throw new InvalidPrivilegeException("Unknown privilege type: " + privilege.getType());
-			}
-		}
-	}
-
-	/**
-	 * Returns list of basic privilege types (privileges that doesn't refer to
-	 * another object).
-	 * 
-	 * @return list of basic privilege types
-	 */
-	public List<PrivilegeType> getBasicTypes() {
-		if (basicTypes == null) {
-			fillTypeList();
-		}
-		return basicTypes;
-	}
-
-	/**
-	 * List of type privileges that refers to {@link BasicPrivilege} class.
-	 */
-	private List<PrivilegeType>	basicTypes	= null;
-	/**
-	 * List of type privileges that refers to {@link ObjectPrivilege} class.
-	 */
-	private List<PrivilegeType>	objectTypes	= null;
-
-	/**
-	 * Returns list of object privilege types (privileges that refer to another
-	 * object).
-	 * 
-	 * @return list of object privilege types
-	 */
-	public List<PrivilegeType> getObjectTypes() {
-		if (objectTypes == null) {
-			fillTypeList();
-		}
-		return objectTypes;
-	}
-
-	/**
-	 * This method initializes {@link #basicTypes} and {@link #objectTypes} lists.
-	 */
-	private void fillTypeList() {
-		basicTypes = new ArrayList<PrivilegeType>();
-		objectTypes = new ArrayList<PrivilegeType>();
-
-		PrivilegeType[] types = PrivilegeType.values();
-
-		for (PrivilegeType privilegeType : types) {
-			if (privilegeType.getPrivilegeClassType().equals(BasicPrivilege.class)) {
-				basicTypes.add(privilegeType);
-			} else if (privilegeType.getPrivilegeClassType().equals(ObjectPrivilege.class)) {
-				objectTypes.add(privilegeType);
-			} else {
-				throw new InvalidPrivilegeException("Unknown privilege type: " + privilegeType.getPrivilegeClassType());
-			}
-		}
-
-	}
-
-	@Override
-	public String createGson(UserView object) {
-		return new Gson().toJson(object);
-	}
-
-	@Override
-	public User viewToObject(UserView view) {
-		throw new NotImplementedException();
-	}
-
-}
+package lcsb.mapviewer.services.view;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.user.BasicPrivilege;
+import lcsb.mapviewer.model.user.ObjectPrivilege;
+import lcsb.mapviewer.model.user.PrivilegeType;
+import lcsb.mapviewer.model.user.User;
+import lcsb.mapviewer.persist.dao.ProjectDao;
+import lcsb.mapviewer.services.utils.InvalidPrivilegeException;
+import lcsb.mapviewer.services.view.UserView.UserLayoutPrivilege;
+import lcsb.mapviewer.services.view.UserView.UserProjectPrivilegeView;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.common.exception.NotImplementedException;
+
+import com.google.gson.Gson;
+
+/**
+ * Factory class for {@link UserView} class.
+ * 
+ * @author Piotr Gawron
+ * 
+ */
+public class UserViewFactory extends AbstractViewFactory<User, UserView> {
+	
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private static Logger				 logger	= Logger.getLogger(UserViewFactory.class);
+
+	/**
+	 * Data access object for projects.
+	 */
+	@Autowired
+	private ProjectDao					 projectDao;
+	
+	/**
+	 * Factory object for {@link PrivilegeView} elements.
+	 */
+	@Autowired
+	private PrivilegeViewFactory privilegeViewFactory;
+
+	@Override
+	public UserView create(User user) {
+		return create(user, projectDao.getAll());
+	}
+
+	/**
+	 * Creates {@link UserView} obejct for given user and given list of projects.
+	 * 
+	 * @param user
+	 *          object for which {@link UserView} element will be created
+	 * @param projects
+	 *          list of project for which privileges will be created as
+	 *          {@link PrivilegeView} elements in the result
+	 * @return {@link UserView} obejct for given user
+	 */
+	public UserView create(User user, List<Project> projects) {
+		UserView result = null;
+		if (user == null) {
+			result = new UserView();
+			for (Project project : projects) {
+				result.getProjectPrivileges().add(result.new UserProjectPrivilegeView(project));
+			}
+			for (PrivilegeType type : getBasicTypes()) {
+				result.getBasicPrivileges().add(privilegeViewFactory.create(type));
+			}
+			for (UserProjectPrivilegeView projectPrivilege : result.getProjectPrivileges()) {
+				for (PrivilegeType type : getObjectTypes()) {
+					if (type.getPrivilegeObjectType().equals(Project.class)) {
+						projectPrivilege.getProjectPrivileges().add(privilegeViewFactory.create(type));
+					}
+				}
+			}
+		} else {
+			result = new UserView(user);
+
+			for (Project project : projects) {
+				result.getProjectPrivileges().add(result.new UserProjectPrivilegeView(project));
+			}
+
+			setPrivilegeStatusFromDb(user, result);
+
+			createUnknownPrivileges(result);
+		}
+
+		Collections.sort(result.getBasicPrivileges());
+		for (UserProjectPrivilegeView row1 : result.getProjectPrivileges()) {
+			Collections.sort(row1.getProjectPrivileges());
+		}
+
+		return result;
+	}
+
+	/**
+	 * Creates privileges for user that doesn't exists in database.
+	 * 
+	 * @param row
+	 *          user for which we want to add missing privileges
+	 */
+	private void createUnknownPrivileges(UserView row) {
+		Set<PrivilegeType> knownPrivileges = new HashSet<PrivilegeType>();
+		for (PrivilegeView privilege : row.getBasicPrivileges()) {
+			knownPrivileges.add(privilege.getType());
+		}
+
+		for (PrivilegeType type : getBasicTypes()) {
+			if (!knownPrivileges.contains(type)) {
+				row.getBasicPrivileges().add(privilegeViewFactory.create(type));
+			}
+		}
+		for (UserProjectPrivilegeView projectPrivilege : row.getProjectPrivileges()) {
+			knownPrivileges.clear();
+			for (PrivilegeView privilege : projectPrivilege.getProjectPrivileges()) {
+				knownPrivileges.add(privilege.getType());
+			}
+			for (PrivilegeType type : getObjectTypes()) {
+				if (type.getPrivilegeObjectType().equals(Project.class)) {
+					if (!knownPrivileges.contains(type)) {
+						projectPrivilege.getProjectPrivileges().add(privilegeViewFactory.create(type));
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * Method that assignes privileges from original user object into view
+	 * representation userView.
+	 * 
+	 * @param user
+	 *          original object retrieved from database
+	 * @param userView
+	 *          representation of the user passed later on to higher layer
+	 */
+	private void setPrivilegeStatusFromDb(User user, UserView userView) {
+		for (BasicPrivilege privilege : user.getPrivileges()) {
+			if (privilege.getClass().equals(BasicPrivilege.class)) {
+				userView.getBasicPrivileges().add(privilegeViewFactory.create(privilege));
+			} else if (privilege.getClass().equals(ObjectPrivilege.class)) {
+				if (privilege.getType().getPrivilegeObjectType().equals(Project.class)) {
+					int projectId = ((ObjectPrivilege) privilege).getIdObject();
+					UserProjectPrivilegeView projectPrivilege = userView.getProjectPrivilegeByProjectId(projectId);
+					if (projectPrivilege != null) {
+						projectPrivilege.getProjectPrivileges().add(privilegeViewFactory.create(privilege));
+					}
+				} else if (privilege.getType().getPrivilegeObjectType().equals(Layout.class)) {
+					int layoutId = ((ObjectPrivilege) privilege).getIdObject();
+					UserLayoutPrivilege layoutPrivilege = userView.getLayoutPrivilegeByLayoutId(layoutId);
+					if (layoutPrivilege != null) {
+						layoutPrivilege.getLayoutPrivileges().add(privilegeViewFactory.create(privilege));
+					}
+				} else {
+					throw new InvalidPrivilegeException("Unknown class for object privilege: " + privilege.getType().getPrivilegeObjectType());
+				}
+			} else {
+				throw new InvalidPrivilegeException("Unknown privilege type: " + privilege.getType());
+			}
+		}
+	}
+
+	/**
+	 * Returns list of basic privilege types (privileges that doesn't refer to
+	 * another object).
+	 * 
+	 * @return list of basic privilege types
+	 */
+	public List<PrivilegeType> getBasicTypes() {
+		if (basicTypes == null) {
+			fillTypeList();
+		}
+		return basicTypes;
+	}
+
+	/**
+	 * List of type privileges that refers to {@link BasicPrivilege} class.
+	 */
+	private List<PrivilegeType>	basicTypes	= null;
+	/**
+	 * List of type privileges that refers to {@link ObjectPrivilege} class.
+	 */
+	private List<PrivilegeType>	objectTypes	= null;
+
+	/**
+	 * Returns list of object privilege types (privileges that refer to another
+	 * object).
+	 * 
+	 * @return list of object privilege types
+	 */
+	public List<PrivilegeType> getObjectTypes() {
+		if (objectTypes == null) {
+			fillTypeList();
+		}
+		return objectTypes;
+	}
+
+	/**
+	 * This method initializes {@link #basicTypes} and {@link #objectTypes} lists.
+	 */
+	private void fillTypeList() {
+		basicTypes = new ArrayList<PrivilegeType>();
+		objectTypes = new ArrayList<PrivilegeType>();
+
+		PrivilegeType[] types = PrivilegeType.values();
+
+		for (PrivilegeType privilegeType : types) {
+			if (privilegeType.getPrivilegeClassType().equals(BasicPrivilege.class)) {
+				basicTypes.add(privilegeType);
+			} else if (privilegeType.getPrivilegeClassType().equals(ObjectPrivilege.class)) {
+				objectTypes.add(privilegeType);
+			} else {
+				throw new InvalidPrivilegeException("Unknown privilege type: " + privilegeType.getPrivilegeClassType());
+			}
+		}
+
+	}
+
+	@Override
+	public String createGson(UserView object) {
+		return new Gson().toJson(object);
+	}
+
+	@Override
+	public User viewToObject(UserView view) {
+		throw new NotImplementedException();
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/AllImplServiceTests.java b/service/src/test/java/lcsb/mapviewer/services/impl/AllImplServiceTests.java
index 5ee1099523..c73eb1cb66 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/AllImplServiceTests.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/AllImplServiceTests.java
@@ -1,24 +1,24 @@
-package lcsb.mapviewer.services.impl;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ CommentServiceTest.class, //
-		ConfigurationServiceTest.class, //
-		DataMiningServiceTest.class, //
-		DataMiningServiceTest2.class, //
-		ExporterServiceTest.class, //
-		ExternalServicesServiceTest.class, //
-		LayoutServiceTest.class, //
-		LogServiceTest.class, //
-		Md5PasswordEncoderTest.class, //
-		ModelServiceTest.class, //
-		ProjectServiceTest.class, //
-		SearchServiceTest.class, //
-		UserServiceTest.class,//
-})
-public class AllImplServiceTests {
-
-}
+package lcsb.mapviewer.services.impl;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({ CommentServiceTest.class, //
+		ConfigurationServiceTest.class, //
+		DataMiningServiceTest.class, //
+		DataMiningServiceTest2.class, //
+		ExporterServiceTest.class, //
+		ExternalServicesServiceTest.class, //
+		LayoutServiceTest.class, //
+		LogServiceTest.class, //
+		Md5PasswordEncoderTest.class, //
+		ModelServiceTest.class, //
+		ProjectServiceTest.class, //
+		SearchServiceTest.class, //
+		UserServiceTest.class,//
+})
+public class AllImplServiceTests {
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/DataMiningServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/DataMiningServiceTest.java
index 9683e0609c..a1b51aa31d 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/DataMiningServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/DataMiningServiceTest.java
@@ -1,193 +1,194 @@
-package lcsb.mapviewer.services.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.FileInputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import lcsb.mapviewer.common.IProgressUpdater;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.log.GenericLog;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.graph.DataMining;
-import lcsb.mapviewer.model.map.graph.DataMiningSet;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.interfaces.IDataMiningService;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.annotation.Rollback;
-
-@Rollback(true)
-public class DataMiningServiceTest extends ServiceTestFunctions {
-	static Logger					logger	= Logger.getLogger(DataMiningServiceTest.class);
-
-	private Model					model;
-	private Project				project;
-	private Set<Element>	nodes;
-	private Element				node;
-
-	@Autowired
-	IDataMiningService		dm;
-
-	@Before
-	public void setUp() throws Exception {
-		model = getModelForFile("testFiles/graph_path_example3.xml", false);
-		project = new Project();
-		project.addModel(model);
-		projectDao.add(project);
-		modelDao.add(model);
-		nodes = model.getElements();
-		node = nodes.iterator().next();
-
-		createUser();
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		modelDao.delete(model);
-		projectDao.delete(project);
-		userDao.delete(user);
-	}
-
-	@Test
-	public void testAddDeleteMissingConnection2() throws Exception {
-		try {
-			DataMining connection = new DataMining();
-			connection.setElement(node);
-
-			long logCounter = logDao.getCount();
-			dataMiningService.addMissingConnection(connection);
-			long newLogCounter = logDao.getCount();
-			assertEquals(logCounter + 1, newLogCounter);
-			assertNotNull(connection.getId());
-			assertNotNull(missingConnectionDao.getById(connection.getId()));
-
-			dataMiningService.deleteMissingConnection(connection, "No reason");
-			long newLogCounter2 = logDao.getCount();
-			assertEquals(newLogCounter + 1, newLogCounter2);
-			assertNull(missingConnectionDao.getById(connection.getId()));
-
-			GenericLog log = logDao.getLastLog();
-			logDao.delete(log);
-			log = logDao.getLastLog();
-			logDao.delete(log);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void getNodesByName() throws Exception {
-		try {
-			DataMining connection = new DataMining();
-			connection.setElement(node);
-			connection.addSuggestedConnection(new MiriamData(MiriamType.UNKNOWN, "ABLA"));
-
-			dataMiningService.addMissingConnection(connection);
-
-			Collection<Element> coll = dataMiningService.getSpeciesWithMissingConnectionsByGeneName(model, "ABLA");
-			assertNotNull(coll);
-			assertTrue(coll.size() > 0);
-
-			dataMiningService.deleteMissingConnection(connection, "No reason");
-
-			GenericLog log = logDao.getLastLog();
-			logDao.delete(log);
-			log = logDao.getLastLog();
-			logDao.delete(log);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetSimillarConnections() throws Exception {
-		try {
-			DataMining connection = new DataMining();
-			connection.addSuggestedConnection(new MiriamData(MiriamType.UNKNOWN, "SOME2"));
-			connection.addSuggestedConnection(new MiriamData(MiriamType.UNKNOWN, "OTHER"));
-			connection.setDescription("blablabla");
-			connection.setElement(node);
-
-			dataMiningService.addMissingConnection(connection);
-			GenericLog log = logDao.getLastLog();
-			logDao.delete(log);
-
-			Collection<Element> elements = dataMiningService.getSpeciesWithMissingConnectionsByGeneName(model, "SOME2");
-			assertEquals(1, elements.size());
-
-			dataMiningService.deleteMissingConnection(connection, "No reason");
-			log = logDao.getLastLog();
-			logDao.delete(log);
-
-			missingConnectionDao.evict(connection);
-			missingConnectionDao.flush();
-
-			elements = dataMiningService.getSpeciesWithMissingConnectionsByGeneName(model, "SOME2");
-
-			assertEquals(0, elements.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDuplicateMiriamInParseData() throws Exception {
-		try {
-			DataMiningSet dm = new DataMiningSet();
-			dm.setInputData(IOUtils.toByteArray(new FileInputStream("testFiles/data_mining/sample_input.txt")));
-			Set<Element> set = new HashSet<>();
-			Protein p1 = new Protein();
-			p1.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
-			Protein p2 = new Protein();
-			p2.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
-			set.add(p1);
-			set.add(p2);
-
-			Set<DataMining> result = dataMiningService.parseData(dm, set, new HashSet<>(), new IProgressUpdater() {
-				@Override
-				public void setProgress(double progress) {
-				}
-			});
-
-			List<MiriamData> list = new ArrayList<>();
-			for (DataMining dataMining : result) {
-				list.addAll(dataMining.getReferences());
-			}
-			for (int i = 0; i < list.size(); i++) {
-				for (int j = i + 1; j < list.size(); j++) {
-					assertFalse("Duplicates of miriam objects found", list.get(i) == list.get(j));
-				}
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-}
+package lcsb.mapviewer.services.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.annotation.Rollback;
+
+import lcsb.mapviewer.common.IProgressUpdater;
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.log.GenericLog;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.graph.DataMining;
+import lcsb.mapviewer.model.map.graph.DataMiningSet;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.interfaces.IDataMiningService;
+
+@Rollback(true)
+public class DataMiningServiceTest extends ServiceTestFunctions {
+	static Logger					logger	= Logger.getLogger(DataMiningServiceTest.class);
+
+	private Model					model;
+	private Project				project;
+	private Set<Element>	nodes;
+	private Element				node;
+
+	@Autowired
+	IDataMiningService		dm;
+
+	@Before
+	public void setUp() throws Exception {
+		model = getModelForFile("testFiles/graph_path_example3.xml", false);
+		project = new Project();
+		project.addModel(model);
+		projectDao.add(project);
+		modelDao.add(model);
+		nodes = model.getElements();
+		node = nodes.iterator().next();
+
+		createUser();
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		modelDao.delete(model);
+		projectDao.delete(project);
+		userDao.delete(user);
+	}
+
+	@Test
+	public void testAddDeleteMissingConnection2() throws Exception {
+		try {
+			DataMining connection = new DataMining();
+			connection.setElement(node);
+
+			long logCounter = logDao.getCount();
+			dataMiningService.addMissingConnection(connection);
+			long newLogCounter = logDao.getCount();
+			assertEquals(logCounter + 1, newLogCounter);
+			assertNotNull(connection.getId());
+			assertNotNull(missingConnectionDao.getById(connection.getId()));
+
+			dataMiningService.deleteMissingConnection(connection, "No reason");
+			long newLogCounter2 = logDao.getCount();
+			assertEquals(newLogCounter + 1, newLogCounter2);
+			assertNull(missingConnectionDao.getById(connection.getId()));
+
+			GenericLog log = logDao.getLastLog();
+			logDao.delete(log);
+			log = logDao.getLastLog();
+			logDao.delete(log);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void getNodesByName() throws Exception {
+		try {
+			DataMining connection = new DataMining();
+			connection.setElement(node);
+			connection.addSuggestedConnection(new MiriamData(MiriamType.UNKNOWN, "ABLA"));
+
+			dataMiningService.addMissingConnection(connection);
+
+			Collection<Element> coll = dataMiningService.getSpeciesWithMissingConnectionsByGeneName(model, "ABLA");
+			assertNotNull(coll);
+			assertTrue(coll.size() > 0);
+
+			dataMiningService.deleteMissingConnection(connection, "No reason");
+
+			GenericLog log = logDao.getLastLog();
+			logDao.delete(log);
+			log = logDao.getLastLog();
+			logDao.delete(log);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetSimillarConnections() throws Exception {
+		try {
+			DataMining connection = new DataMining();
+			connection.addSuggestedConnection(new MiriamData(MiriamType.UNKNOWN, "SOME2"));
+			connection.addSuggestedConnection(new MiriamData(MiriamType.UNKNOWN, "OTHER"));
+			connection.setDescription("blablabla");
+			connection.setElement(node);
+
+			dataMiningService.addMissingConnection(connection);
+			GenericLog log = logDao.getLastLog();
+			logDao.delete(log);
+
+			Collection<Element> elements = dataMiningService.getSpeciesWithMissingConnectionsByGeneName(model, "SOME2");
+			assertEquals(1, elements.size());
+
+			dataMiningService.deleteMissingConnection(connection, "No reason");
+			log = logDao.getLastLog();
+			logDao.delete(log);
+
+			missingConnectionDao.evict(connection);
+			missingConnectionDao.flush();
+
+			elements = dataMiningService.getSpeciesWithMissingConnectionsByGeneName(model, "SOME2");
+
+			assertEquals(0, elements.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDuplicateMiriamInParseData() throws Exception {
+		try {
+			DataMiningSet dm = new DataMiningSet();
+			dm.setInputData(IOUtils.toByteArray(new FileInputStream("testFiles/data_mining/sample_input.txt")));
+			Set<Element> set = new HashSet<>();
+			Protein p1 = new GenericProtein();
+			p1.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
+			Protein p2 = new GenericProtein();
+			p2.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
+			set.add(p1);
+			set.add(p2);
+
+			Set<DataMining> result = dataMiningService.parseData(dm, set, new HashSet<>(), new IProgressUpdater() {
+				@Override
+				public void setProgress(double progress) {
+				}
+			});
+
+			List<MiriamData> list = new ArrayList<>();
+			for (DataMining dataMining : result) {
+				list.addAll(dataMining.getReferences());
+			}
+			for (int i = 0; i < list.size(); i++) {
+				for (int j = i + 1; j < list.size(); j++) {
+					assertFalse("Duplicates of miriam objects found", list.get(i) == list.get(j));
+				}
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/DataMiningServiceTest2.java b/service/src/test/java/lcsb/mapviewer/services/impl/DataMiningServiceTest2.java
index 2c9adc3f28..6a0ec1ed15 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/DataMiningServiceTest2.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/DataMiningServiceTest2.java
@@ -1,202 +1,202 @@
-package lcsb.mapviewer.services.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import lcsb.mapviewer.common.IProgressUpdater;
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.graph.DataMining;
-import lcsb.mapviewer.model.map.graph.DataMiningType;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.test.annotation.Rollback;
-
-@Rollback(true)
-public class DataMiningServiceTest2 extends ServiceTestFunctions {
-	static Logger	logger	= Logger.getLogger(DataMiningServiceTest2.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testParseData() throws Exception {
-		try {
-			Protein snca = new GenericProtein();
-			snca.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
-			Protein park1 = new GenericProtein();
-			park1.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK1"));
-			SimpleMolecule sm = new SimpleMolecule();
-			sm.addMiriamData(new MiriamData(MiriamType.CHEBI, "CHEBI:1234"));
-
-			Collection<Element> nodes = new ArrayList<Element>();
-			nodes.add(snca);
-			nodes.add(park1);
-
-			Set<DataMining> res = dataMiningService.parseData(
-					"testFiles/data_mining/sample_input.txt", DataMiningType.UNKNOWN, nodes, new HashSet<Reaction>(), new IProgressUpdater() {
-						@Override
-						public void setProgress(double progress) {
-						}
-					});
-			assertNotNull(res);
-			assertEquals(2, res.size());
-			nodes.add(sm);
-
-			res = dataMiningService.parseData(
-					"testFiles/data_mining/sample_input.txt", DataMiningType.UNKNOWN, nodes, new HashSet<Reaction>(), new IProgressUpdater() {
-						@Override
-						public void setProgress(double progress) {
-						}
-					});
-			assertEquals(3, res.size());
-			nodes.add(sm);
-
-			for (DataMining dm : res) {
-				if (dm.getElement().equals(snca)) {
-					assertEquals(1, dm.getSuggestedConnections().size());
-					MiriamData md = dm.getSuggestedConnections().get(0);
-					assertEquals(new MiriamData(MiriamType.HGNC_SYMBOL, "BAC"), md);
-					assertEquals("unknown desc", dm.getDescription());
-					assertEquals(1, dm.getReferences().size());
-				} else if (dm.getElement().equals(park1)) {
-					assertEquals(1, dm.getSuggestedConnections().size());
-					MiriamData md = dm.getSuggestedConnections().get(0);
-					assertEquals(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK7"), md);
-					assertEquals("desc", dm.getDescription());
-					assertEquals(0, dm.getReferences().size());
-				} else if (dm.getElement().equals(sm)) {
-					assertEquals(1, dm.getSuggestedConnections().size());
-					MiriamData md = dm.getSuggestedConnections().get(0);
-					assertEquals(new MiriamData(MiriamType.CHEBI, "CHEBI:123"), md);
-					assertEquals("", dm.getDescription());
-					assertEquals(2, dm.getReferences().size());
-				} else {
-					fail("Unknown dm element: " + dm.getElement());
-				}
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDataMiningMiriamDataFormat() throws Exception {
-		try {
-			Protein snca = new GenericProtein();
-			snca.addMiriamData(new MiriamData(MiriamType.HGNC, "18618"));
-
-			Collection<Element> nodes = new ArrayList<Element>();
-			nodes.add(snca);
-
-			Set<DataMining> res = dataMiningService.parseData("testFiles/data_mining/test_dm.txt", DataMiningType.UNKNOWN, nodes, new HashSet<Reaction>(), new IProgressUpdater() {
-				@Override
-				public void setProgress(double progress) {
-				}
-			});
-			assertNotNull(res);
-
-			for (DataMining dataMining : res) {
-				for (MiriamData md : dataMining.getReferences())
-					assertFalse("Invalid miriam resource: " + md.getResource(), md.getResource().contains("urn"));
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testParseDataWithFiltering() throws Exception {
-		try {
-			Protein park7 = new GenericProtein();
-			park7.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK7"));
-			Protein park1 = new GenericProtein();
-			park1.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK1"));
-
-			Collection<Element> nodes = new ArrayList<Element>();
-			nodes.add(park7);
-			nodes.add(park1);
-
-			Reaction reaction = new Reaction();
-			reaction.addProduct(new Product(null, park7));
-			reaction.addReactant(new Reactant(null, park1));
-
-			Set<Reaction> reactions = new HashSet<Reaction>();
-			reactions.add(reaction);
-
-			Set<DataMining> res = dataMiningService.parseData(
-					"testFiles/data_mining/sample_input.txt", DataMiningType.UNKNOWN, nodes, reactions, new IProgressUpdater() {
-						@Override
-						public void setProgress(double progress) {
-						}
-					});
-			assertNotNull(res);
-			assertEquals(0, res.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testParseDataWithFiltering2() throws Exception {
-		try {
-			Protein park7 = new GenericProtein();
-			park7.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK7"));
-			Protein park1 = new GenericProtein();
-			park1.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK1"));
-
-			Collection<Element> nodes = new ArrayList<Element>();
-			nodes.add(park7);
-			nodes.add(park1);
-
-			Reaction reaction = new Reaction();
-			reaction.addProduct(new Product(null, park1));
-			reaction.addReactant(new Reactant(null, park7));
-
-			Set<Reaction> reactions = new HashSet<Reaction>();
-			reactions.add(reaction);
-
-			Set<DataMining> res = dataMiningService.parseData(
-					"testFiles/data_mining/sample_input.txt", DataMiningType.UNKNOWN, nodes, reactions, new IProgressUpdater() {
-						@Override
-						public void setProgress(double progress) {
-						}
-					});
-			assertNotNull(res);
-			assertEquals(0, res.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-}
+package lcsb.mapviewer.services.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import lcsb.mapviewer.common.IProgressUpdater;
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.graph.DataMining;
+import lcsb.mapviewer.model.map.graph.DataMiningType;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.test.annotation.Rollback;
+
+@Rollback(true)
+public class DataMiningServiceTest2 extends ServiceTestFunctions {
+	static Logger	logger	= Logger.getLogger(DataMiningServiceTest2.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testParseData() throws Exception {
+		try {
+			Protein snca = new GenericProtein();
+			snca.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "SNCA"));
+			Protein park1 = new GenericProtein();
+			park1.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK1"));
+			SimpleMolecule sm = new SimpleMolecule();
+			sm.addMiriamData(new MiriamData(MiriamType.CHEBI, "CHEBI:1234"));
+
+			Collection<Element> nodes = new ArrayList<Element>();
+			nodes.add(snca);
+			nodes.add(park1);
+
+			Set<DataMining> res = dataMiningService.parseData(
+					"testFiles/data_mining/sample_input.txt", DataMiningType.UNKNOWN, nodes, new HashSet<Reaction>(), new IProgressUpdater() {
+						@Override
+						public void setProgress(double progress) {
+						}
+					});
+			assertNotNull(res);
+			assertEquals(2, res.size());
+			nodes.add(sm);
+
+			res = dataMiningService.parseData(
+					"testFiles/data_mining/sample_input.txt", DataMiningType.UNKNOWN, nodes, new HashSet<Reaction>(), new IProgressUpdater() {
+						@Override
+						public void setProgress(double progress) {
+						}
+					});
+			assertEquals(3, res.size());
+			nodes.add(sm);
+
+			for (DataMining dm : res) {
+				if (dm.getElement().equals(snca)) {
+					assertEquals(1, dm.getSuggestedConnections().size());
+					MiriamData md = dm.getSuggestedConnections().get(0);
+					assertEquals(new MiriamData(MiriamType.HGNC_SYMBOL, "BAC"), md);
+					assertEquals("unknown desc", dm.getDescription());
+					assertEquals(1, dm.getReferences().size());
+				} else if (dm.getElement().equals(park1)) {
+					assertEquals(1, dm.getSuggestedConnections().size());
+					MiriamData md = dm.getSuggestedConnections().get(0);
+					assertEquals(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK7"), md);
+					assertEquals("desc", dm.getDescription());
+					assertEquals(0, dm.getReferences().size());
+				} else if (dm.getElement().equals(sm)) {
+					assertEquals(1, dm.getSuggestedConnections().size());
+					MiriamData md = dm.getSuggestedConnections().get(0);
+					assertEquals(new MiriamData(MiriamType.CHEBI, "CHEBI:123"), md);
+					assertEquals("", dm.getDescription());
+					assertEquals(2, dm.getReferences().size());
+				} else {
+					fail("Unknown dm element: " + dm.getElement());
+				}
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDataMiningMiriamDataFormat() throws Exception {
+		try {
+			Protein snca = new GenericProtein();
+			snca.addMiriamData(new MiriamData(MiriamType.HGNC, "18618"));
+
+			Collection<Element> nodes = new ArrayList<Element>();
+			nodes.add(snca);
+
+			Set<DataMining> res = dataMiningService.parseData("testFiles/data_mining/test_dm.txt", DataMiningType.UNKNOWN, nodes, new HashSet<Reaction>(), new IProgressUpdater() {
+				@Override
+				public void setProgress(double progress) {
+				}
+			});
+			assertNotNull(res);
+
+			for (DataMining dataMining : res) {
+				for (MiriamData md : dataMining.getReferences())
+					assertFalse("Invalid miriam resource: " + md.getResource(), md.getResource().contains("urn"));
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testParseDataWithFiltering() throws Exception {
+		try {
+			Protein park7 = new GenericProtein();
+			park7.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK7"));
+			Protein park1 = new GenericProtein();
+			park1.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK1"));
+
+			Collection<Element> nodes = new ArrayList<Element>();
+			nodes.add(park7);
+			nodes.add(park1);
+
+			Reaction reaction = new Reaction();
+			reaction.addProduct(new Product(null, park7));
+			reaction.addReactant(new Reactant(null, park1));
+
+			Set<Reaction> reactions = new HashSet<Reaction>();
+			reactions.add(reaction);
+
+			Set<DataMining> res = dataMiningService.parseData(
+					"testFiles/data_mining/sample_input.txt", DataMiningType.UNKNOWN, nodes, reactions, new IProgressUpdater() {
+						@Override
+						public void setProgress(double progress) {
+						}
+					});
+			assertNotNull(res);
+			assertEquals(0, res.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testParseDataWithFiltering2() throws Exception {
+		try {
+			Protein park7 = new GenericProtein();
+			park7.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK7"));
+			Protein park1 = new GenericProtein();
+			park1.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "PARK1"));
+
+			Collection<Element> nodes = new ArrayList<Element>();
+			nodes.add(park7);
+			nodes.add(park1);
+
+			Reaction reaction = new Reaction();
+			reaction.addProduct(new Product(null, park1));
+			reaction.addReactant(new Reactant(null, park7));
+
+			Set<Reaction> reactions = new HashSet<Reaction>();
+			reactions.add(reaction);
+
+			Set<DataMining> res = dataMiningService.parseData(
+					"testFiles/data_mining/sample_input.txt", DataMiningType.UNKNOWN, nodes, reactions, new IProgressUpdater() {
+						@Override
+						public void setProgress(double progress) {
+						}
+					});
+			assertNotNull(res);
+			assertEquals(0, res.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/ExternalServicesServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/ExternalServicesServiceTest.java
index 8b1db0dd70..66041bf94d 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/ExternalServicesServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/ExternalServicesServiceTest.java
@@ -1,67 +1,67 @@
-package lcsb.mapviewer.services.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
-import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-
-public class ExternalServicesServiceTest extends ServiceTestFunctions {
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test(timeout = 60000)
-	@Ignore("Bug 451")
-	public void testDefaultServices() throws Exception {
-		try {
-			externalServicesService.clearServices();
-			externalServicesService.registerDefaultServices();
-			List<ExternalServiceStatus> statuses = externalServicesService.getExternalServiceStatuses();
-			assertNotNull(statuses);
-			assertTrue(statuses.size() > 0);
-
-			for (ExternalServiceStatus externalServiceStatus : statuses) {
-				assertEquals(externalServiceStatus.getName() + " is down", ExternalServiceStatusType.OK, externalServiceStatus.getStatus());
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRegister() throws Exception {
-		try {
-			externalServicesService.clearServices();
-			externalServicesService.registerService(new OkServiceMock());
-			externalServicesService.registerService(new FailServiceMock());
-
-			List<ExternalServiceStatus> statuses = externalServicesService.getExternalServiceStatuses();
-			assertNotNull(statuses);
-			assertEquals(2, statuses.size());
-
-			assertEquals(ExternalServiceStatusType.OK, statuses.get(0).getStatus());
-			assertEquals(ExternalServiceStatusType.DOWN, statuses.get(1).getStatus());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
+import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+
+public class ExternalServicesServiceTest extends ServiceTestFunctions {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test(timeout = 60000)
+	@Ignore("Bug 451")
+	public void testDefaultServices() throws Exception {
+		try {
+			externalServicesService.clearServices();
+			externalServicesService.registerDefaultServices();
+			List<ExternalServiceStatus> statuses = externalServicesService.getExternalServiceStatuses();
+			assertNotNull(statuses);
+			assertTrue(statuses.size() > 0);
+
+			for (ExternalServiceStatus externalServiceStatus : statuses) {
+				assertEquals(externalServiceStatus.getName() + " is down", ExternalServiceStatusType.OK, externalServiceStatus.getStatus());
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRegister() throws Exception {
+		try {
+			externalServicesService.clearServices();
+			externalServicesService.registerService(new OkServiceMock());
+			externalServicesService.registerService(new FailServiceMock());
+
+			List<ExternalServiceStatus> statuses = externalServicesService.getExternalServiceStatuses();
+			assertNotNull(statuses);
+			assertEquals(2, statuses.size());
+
+			assertEquals(ExternalServiceStatusType.OK, statuses.get(0).getStatus());
+			assertEquals(ExternalServiceStatusType.DOWN, statuses.get(1).getStatus());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/FailServiceMock.java b/service/src/test/java/lcsb/mapviewer/services/impl/FailServiceMock.java
index c7a4866c06..b147987259 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/FailServiceMock.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/FailServiceMock.java
@@ -1,16 +1,16 @@
-package lcsb.mapviewer.services.impl;
-
-import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
-import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
-import lcsb.mapviewer.annotation.services.IExternalService;
-
-public class FailServiceMock implements IExternalService {
-
-	@Override
-	public ExternalServiceStatus getServiceStatus() {
-		ExternalServiceStatus status = new ExternalServiceStatus("Test service", "unknown");
-		status.setStatus(ExternalServiceStatusType.DOWN);
-		return status;
-	}
-
-}
+package lcsb.mapviewer.services.impl;
+
+import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
+import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
+import lcsb.mapviewer.annotation.services.IExternalService;
+
+public class FailServiceMock implements IExternalService {
+
+	@Override
+	public ExternalServiceStatus getServiceStatus() {
+		ExternalServiceStatus status = new ExternalServiceStatus("Test service", "unknown");
+		status.setStatus(ExternalServiceStatusType.DOWN);
+		return status;
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/LayoutServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/LayoutServiceTest.java
index 06c519bc6a..e71ee5c5c3 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/LayoutServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/LayoutServiceTest.java
@@ -1,461 +1,461 @@
-package lcsb.mapviewer.services.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.converter.ConverterParams;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.LayoutStatus;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
-import lcsb.mapviewer.model.map.model.SubmodelType;
-import lcsb.mapviewer.model.user.BasicPrivilege;
-import lcsb.mapviewer.model.user.ObjectPrivilege;
-import lcsb.mapviewer.model.user.PrivilegeType;
-import lcsb.mapviewer.model.user.User;
-import lcsb.mapviewer.persist.dao.map.LayoutDao;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.interfaces.ILayoutService.CreateLayoutParams;
-import lcsb.mapviewer.services.search.layout.LightLayoutAliasView;
-import lcsb.mapviewer.services.search.layout.LightLayoutReactionView;
-import lcsb.mapviewer.services.view.LayoutView;
-
-public class LayoutServiceTest extends ServiceTestFunctions {
-	Logger		logger		= Logger.getLogger(LayoutServiceTest.class);
-
-	Project		project		= null;
-	Model			model			= null;
-
-	String		projectId	= "Some_id";
-
-	@Autowired
-	LayoutDao	layoutDao;
-
-	@Before
-	public void setUp() throws Exception {
-		logService.setLoggedUser(userService.getUserByLogin(Configuration.ANONYMOUS_LOGIN));
-
-		// we use custom threads because in layoutservice there is commit method
-		// called, and because of that hibernate session injected by spring cannot
-		// commit at the end of the test case
-
-		dbUtils.createSessionForCurrentThread();
-
-		project = projectDao.getProjectByProjectId(projectId);
-		if (project != null) {
-			projectDao.delete(project);
-		}
-
-		project = new Project();
-
-		CellDesignerXmlParser parser = new CellDesignerXmlParser();
-		model = parser.createModel(new ConverterParams().filename("testFiles/sample.xml"));
-
-		project.addModel(model);
-		project.setProjectId("Some_id2");
-
-		projectService.addProject(project);
-
-		createUser();
-		createUser2();
-
-		userService.addUser(user2);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		userService.deleteUser(user2);
-		userService.deleteUser(user);
-		projectService.removeProject(project, null, false);
-
-		// close session
-		dbUtils.closeSessionForCurrentThread();
-	}
-
-	@Test
-	public void testUserCanAddLayout() throws Exception {
-		try {
-			int initialSize = model.getLayouts().size();
-			assertFalse(layoutService.userCanAddLayout(model, user));
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-
-			assertFalse(layoutService.userCanAddLayout(model, user));
-
-			userService.setUserPrivilege(user, new ObjectPrivilege(project, 1, PrivilegeType.VIEW_PROJECT, user));
-
-			assertTrue(layoutService.userCanAddLayout(model, user));
-
-			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
-					directory("testDir").//
-					model(model).//
-					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
-					user(user);
-			LayoutView row = layoutService.createLayout(params);
-
-			assertFalse(layoutService.userCanAddLayout(model, user));
-
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-
-			assertFalse(layoutService.userCanAddLayout(model, user));
-
-			userService.setUserPrivilege(user, new BasicPrivilege(2, PrivilegeType.CUSTOM_LAYOUTS, user));
-
-			assertTrue(layoutService.userCanAddLayout(model, user));
-
-			assertTrue(layoutService.userCanRemoveLayout(row, user));
-
-			layoutService.removeLayout(row, null);
-
-			assertEquals(initialSize, model.getLayouts().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAvailable() throws Exception {
-		try {
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-			assertEquals(1, layoutService.getAvailableCustomLayoutsNumber(user));
-
-			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
-					directory("testDir").//
-					model(model).//
-					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
-					user(user);
-			LayoutView row = layoutService.createLayout(params);
-
-			assertEquals(0, layoutService.getAvailableCustomLayoutsNumber(user));
-
-			ModelSubmodelConnection connection = new ModelSubmodelConnection(model, SubmodelType.UNKNOWN);
-			model.addSubmodelConnection(connection);
-
-			modelDao.update(model);
-
-			assertEquals(1, layoutService.getAvailableCustomLayoutsNumber(user));
-
-			layoutService.removeLayout(row, null);
-
-			assertEquals(1, layoutService.getAvailableCustomLayoutsNumber(user));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetCustomLayouts() throws Exception {
-		try {
-			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
-			assertNotNull(layouts);
-			assertEquals(0, layouts.size());
-
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-
-			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
-					directory("testDir").//
-					model(model).//
-					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
-					user(user);
-			LayoutView row = layoutService.createLayout(params);
-
-			assertNotNull(row);
-			assertNotNull(row.getIdObject());
-
-			layouts = layoutService.getCustomLayouts(model, user);
-			assertEquals(1, layouts.size());
-
-			layouts = layoutService.getCustomLayouts(model, user2);
-			assertEquals(0, layouts.size());
-
-			layoutService.addViewPrivilegeToLayout(row, user2);
-
-			layouts = layoutService.getCustomLayouts(model, user2);
-			assertEquals(1, layouts.size());
-
-			layoutService.dropViewPrivilegeFromLayout(row, user2);
-
-			layouts = layoutService.getCustomLayouts(model, user2);
-			assertEquals(0, layouts.size());
-
-			// null user shouldn't have acces to custom layouts
-			layouts = layoutService.getCustomLayouts(model, null);
-			assertEquals(0, layouts.size());
-
-			layoutService.removeLayout(row, null);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLayoutByName() throws Exception {
-		try {
-			String name = "testName";
-			LayoutView layout = layoutService.getLayoutByName(model, name);
-			assertNull(layout);
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-
-			CreateLayoutParams params = new CreateLayoutParams().name(name).//
-					directory("testDir").//
-					model(model).//
-					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
-					user(user);
-			LayoutView row = layoutService.createLayout(params);
-
-			layout = layoutService.getLayoutByName(model, name);
-			assertNotNull(layout);
-
-			layoutService.removeLayout(row, null);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUpdateLayout() throws Exception {
-		try {
-			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
-			assertNotNull(layouts);
-			assertEquals(0, layouts.size());
-
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-
-			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
-					directory("testDir").//
-					model(model).//
-					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
-					user(user);
-			LayoutView row = layoutService.createLayout(params);
-
-			layouts = layoutService.getCustomLayouts(model, user);
-			assertEquals(1, layouts.size());
-			assertEquals("Test", layouts.get(0).getName());
-
-			row.setName("New name");
-
-			layoutService.updateLayout(row);
-
-			layouts = layoutService.getCustomLayouts(model, user);
-			assertEquals(1, layouts.size());
-			assertEquals("New name", layouts.get(0).getName());
-
-			layoutService.removeLayout(row, null);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test(timeout = 15000)
-	public void testCreateAsyncLayout() throws Exception {
-		try {
-			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
-			assertNotNull(layouts);
-			assertEquals(0, layouts.size());
-
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
-					directory("testDir").//
-					model(model).//
-					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
-					user(user).//
-					async(true);
-
-			long logCounter = logDao.getCount();
-			LayoutView row = layoutService.createLayout(params);
-
-			assertNotNull(row);
-			assertNotNull(row.getIdObject());
-
-			Layout layoutDb = layoutDao.getById(row.getIdObject());
-			do {
-				Thread.sleep(200);
-				layoutDao.refresh(layoutDb);
-			} while (layoutDb.getStatus() != LayoutStatus.OK);
-
-			layouts = layoutService.getCustomLayouts(model, user);
-			assertEquals(1, layouts.size());
-
-			long logCounter2 = logDao.getCount();
-			assertTrue("Log didn't appeard after creating layout", logCounter < logCounter2);
-
-			LayoutView layout = layouts.get(0);
-			logger.debug(layout.getStatus() + ", " + layout.getProgress());
-
-			assertFalse("Layout images weren't generated...", layout.getStatus().equalsIgnoreCase("Not available"));
-
-			logCounter = logDao.getCount();
-			layoutService.removeLayout(layout, null);
-			logCounter2 = logDao.getCount();
-
-			assertTrue("Log didn't appeard after removing layout", logCounter < logCounter2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAddLayoutToComplexModel() throws Exception {
-		Project localProject = new Project();
-		try {
-
-			CellDesignerXmlParser parser = new CellDesignerXmlParser();
-			Model localModel = parser.createModel(new ConverterParams().filename("testFiles/sample.xml"));
-			Model localSubmodelModel = parser.createModel(new ConverterParams().filename("testFiles/sample.xml"));
-
-			ModelSubmodelConnection connection = new ModelSubmodelConnection(localSubmodelModel, SubmodelType.UNKNOWN);
-			connection.setName("AS");
-			localModel.addSubmodelConnection(connection);
-
-			localProject.addModel(localModel);
-			localProject.setProjectId("Some_id");
-
-			projectService.addProject(localProject);
-
-			String tmpLogin = "Test login3";
-			User tmpUser = userService.getUserByLogin(tmpLogin);
-			if (tmpUser != null) {
-				userService.deleteUser(tmpUser);
-				userDao.commit();
-			}
-
-			User localUser = new User();
-			localUser.setLogin(tmpLogin);
-
-			userService.addUser(localUser);
-
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-			userService.setUserPrivilege(user, new ObjectPrivilege(project, 1, PrivilegeType.VIEW_PROJECT, user));
-
-			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
-					directory("testDir").//
-					model(localModel).//
-					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
-					user(localUser);
-
-			layoutService.createLayout(params);
-
-			Project pr2 = projectService.getProjectByProjectId(localProject.getProjectId());
-
-			Model fromDbModel = pr2.getModels().iterator().next().getModel();
-
-			assertTrue(fromDbModel.getLayouts().size() > 0);
-
-			Model submodel = fromDbModel.getSubmodelConnections().iterator().next().getSubmodel().getModel();
-			assertEquals(fromDbModel.getLayouts().size(), submodel.getLayouts().size());
-
-			File f1 = new File(fromDbModel.getLayouts().get(0).getDirectory() + "/2/0/0.PNG");
-			File f2 = new File(submodel.getLayouts().get(0).getDirectory() + "/2/0/0.PNG");
-			assertFalse(f1.exists());
-			assertFalse(f2.exists());
-
-			userService.deleteUser(localUser);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			projectService.removeProject(localProject, null, false);
-		}
-	}
-
-	@Test
-	public void testInputDataInLayout() throws Exception {
-		try {
-			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
-			assertNotNull(layouts);
-			assertEquals(0, layouts.size());
-
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
-					directory("testDir").//
-					model(model).//
-					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
-					user(user).//
-					async(false);
-
-			LayoutView row = layoutService.createLayout(params);
-
-			assertNotNull(row);
-			assertNotNull(row.getIdObject());
-			assertTrue("true".equalsIgnoreCase(row.getInputDataAvailable()));
-			byte[] inputData = layoutService.getInputDataForLayout(row);
-			assertNotNull(inputData);
-			byte[] originalData = IOUtils.toByteArray(new FileInputStream("testFiles/enricoData/ge001.txt"));
-			assertEquals(new String(originalData, StandardCharsets.UTF_8), new String(inputData, StandardCharsets.UTF_8));
-
-			layoutService.removeLayout(row, null);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetLayoutAliases() throws Exception {
-		try {
-			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
-			assertNotNull(layouts);
-			assertEquals(0, layouts.size());
-
-			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
-			ByteArrayInputStream bais = new ByteArrayInputStream(
-					"name	reactionIdentifier	Color\ns1		#CC0000\ns2		#CCCC00\n	re1	#CCCC00\n".getBytes(StandardCharsets.UTF_8));
-			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
-					directory("testDir").//
-					model(model).//
-					colorInputStream(bais).//
-					user(user).//
-					async(false);
-
-			LayoutView row = layoutService.createLayout(params);
-
-			List<LightLayoutAliasView> result = layoutService.getAliasesForLayout(model, row.getIdObject());
-
-			assertTrue(result.size() > 0);
-
-			List<LightLayoutReactionView> result2 = layoutService.getReactionsForLayout(model, row.getIdObject());
-
-			assertEquals(1, result2.size());
-
-			layoutService.removeLayout(row, null);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-
-}
+package lcsb.mapviewer.services.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.converter.ConverterParams;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.LayoutStatus;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
+import lcsb.mapviewer.model.map.model.SubmodelType;
+import lcsb.mapviewer.model.user.BasicPrivilege;
+import lcsb.mapviewer.model.user.ObjectPrivilege;
+import lcsb.mapviewer.model.user.PrivilegeType;
+import lcsb.mapviewer.model.user.User;
+import lcsb.mapviewer.persist.dao.map.LayoutDao;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.interfaces.ILayoutService.CreateLayoutParams;
+import lcsb.mapviewer.services.search.layout.LightLayoutAliasView;
+import lcsb.mapviewer.services.search.layout.LightLayoutReactionView;
+import lcsb.mapviewer.services.view.LayoutView;
+
+public class LayoutServiceTest extends ServiceTestFunctions {
+	Logger		logger		= Logger.getLogger(LayoutServiceTest.class);
+
+	Project		project		= null;
+	Model			model			= null;
+
+	String		projectId	= "Some_id";
+
+	@Autowired
+	LayoutDao	layoutDao;
+
+	@Before
+	public void setUp() throws Exception {
+		logService.setLoggedUser(userService.getUserByLogin(Configuration.ANONYMOUS_LOGIN));
+
+		// we use custom threads because in layoutservice there is commit method
+		// called, and because of that hibernate session injected by spring cannot
+		// commit at the end of the test case
+
+		dbUtils.createSessionForCurrentThread();
+
+		project = projectDao.getProjectByProjectId(projectId);
+		if (project != null) {
+			projectDao.delete(project);
+		}
+
+		project = new Project();
+
+		CellDesignerXmlParser parser = new CellDesignerXmlParser();
+		model = parser.createModel(new ConverterParams().filename("testFiles/sample.xml"));
+
+		project.addModel(model);
+		project.setProjectId("Some_id2");
+
+		projectService.addProject(project);
+
+		createUser();
+		createUser2();
+
+		userService.addUser(user2);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		userService.deleteUser(user2);
+		userService.deleteUser(user);
+		projectService.removeProject(project, null, false);
+
+		// close session
+		dbUtils.closeSessionForCurrentThread();
+	}
+
+	@Test
+	public void testUserCanAddLayout() throws Exception {
+		try {
+			int initialSize = model.getLayouts().size();
+			assertFalse(layoutService.userCanAddLayout(model, user));
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+
+			assertFalse(layoutService.userCanAddLayout(model, user));
+
+			userService.setUserPrivilege(user, new ObjectPrivilege(project, 1, PrivilegeType.VIEW_PROJECT, user));
+
+			assertTrue(layoutService.userCanAddLayout(model, user));
+
+			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
+					directory("testDir").//
+					model(model).//
+					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
+					user(user);
+			LayoutView row = layoutService.createLayout(params);
+
+			assertFalse(layoutService.userCanAddLayout(model, user));
+
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+
+			assertFalse(layoutService.userCanAddLayout(model, user));
+
+			userService.setUserPrivilege(user, new BasicPrivilege(2, PrivilegeType.CUSTOM_LAYOUTS, user));
+
+			assertTrue(layoutService.userCanAddLayout(model, user));
+
+			assertTrue(layoutService.userCanRemoveLayout(row, user));
+
+			layoutService.removeLayout(row, null);
+
+			assertEquals(initialSize, model.getLayouts().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAvailable() throws Exception {
+		try {
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+			assertEquals(1, layoutService.getAvailableCustomLayoutsNumber(user));
+
+			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
+					directory("testDir").//
+					model(model).//
+					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
+					user(user);
+			LayoutView row = layoutService.createLayout(params);
+
+			assertEquals(0, layoutService.getAvailableCustomLayoutsNumber(user));
+
+			ModelSubmodelConnection connection = new ModelSubmodelConnection(model, SubmodelType.UNKNOWN);
+			model.addSubmodelConnection(connection);
+
+			modelDao.update(model);
+
+			assertEquals(1, layoutService.getAvailableCustomLayoutsNumber(user));
+
+			layoutService.removeLayout(row, null);
+
+			assertEquals(1, layoutService.getAvailableCustomLayoutsNumber(user));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetCustomLayouts() throws Exception {
+		try {
+			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
+			assertNotNull(layouts);
+			assertEquals(0, layouts.size());
+
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+
+			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
+					directory("testDir").//
+					model(model).//
+					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
+					user(user);
+			LayoutView row = layoutService.createLayout(params);
+
+			assertNotNull(row);
+			assertNotNull(row.getIdObject());
+
+			layouts = layoutService.getCustomLayouts(model, user);
+			assertEquals(1, layouts.size());
+
+			layouts = layoutService.getCustomLayouts(model, user2);
+			assertEquals(0, layouts.size());
+
+			layoutService.addViewPrivilegeToLayout(row, user2);
+
+			layouts = layoutService.getCustomLayouts(model, user2);
+			assertEquals(1, layouts.size());
+
+			layoutService.dropViewPrivilegeFromLayout(row, user2);
+
+			layouts = layoutService.getCustomLayouts(model, user2);
+			assertEquals(0, layouts.size());
+
+			// null user shouldn't have acces to custom layouts
+			layouts = layoutService.getCustomLayouts(model, null);
+			assertEquals(0, layouts.size());
+
+			layoutService.removeLayout(row, null);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLayoutByName() throws Exception {
+		try {
+			String name = "testName";
+			LayoutView layout = layoutService.getLayoutByName(model, name);
+			assertNull(layout);
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+
+			CreateLayoutParams params = new CreateLayoutParams().name(name).//
+					directory("testDir").//
+					model(model).//
+					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
+					user(user);
+			LayoutView row = layoutService.createLayout(params);
+
+			layout = layoutService.getLayoutByName(model, name);
+			assertNotNull(layout);
+
+			layoutService.removeLayout(row, null);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUpdateLayout() throws Exception {
+		try {
+			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
+			assertNotNull(layouts);
+			assertEquals(0, layouts.size());
+
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+
+			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
+					directory("testDir").//
+					model(model).//
+					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
+					user(user);
+			LayoutView row = layoutService.createLayout(params);
+
+			layouts = layoutService.getCustomLayouts(model, user);
+			assertEquals(1, layouts.size());
+			assertEquals("Test", layouts.get(0).getName());
+
+			row.setName("New name");
+
+			layoutService.updateLayout(row);
+
+			layouts = layoutService.getCustomLayouts(model, user);
+			assertEquals(1, layouts.size());
+			assertEquals("New name", layouts.get(0).getName());
+
+			layoutService.removeLayout(row, null);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test(timeout = 15000)
+	public void testCreateAsyncLayout() throws Exception {
+		try {
+			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
+			assertNotNull(layouts);
+			assertEquals(0, layouts.size());
+
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
+					directory("testDir").//
+					model(model).//
+					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
+					user(user).//
+					async(true);
+
+			long logCounter = logDao.getCount();
+			LayoutView row = layoutService.createLayout(params);
+
+			assertNotNull(row);
+			assertNotNull(row.getIdObject());
+
+			Layout layoutDb = layoutDao.getById(row.getIdObject());
+			do {
+				Thread.sleep(200);
+				layoutDao.refresh(layoutDb);
+			} while (layoutDb.getStatus() != LayoutStatus.OK);
+
+			layouts = layoutService.getCustomLayouts(model, user);
+			assertEquals(1, layouts.size());
+
+			long logCounter2 = logDao.getCount();
+			assertTrue("Log didn't appeard after creating layout", logCounter < logCounter2);
+
+			LayoutView layout = layouts.get(0);
+			logger.debug(layout.getStatus() + ", " + layout.getProgress());
+
+			assertFalse("Layout images weren't generated...", layout.getStatus().equalsIgnoreCase("Not available"));
+
+			logCounter = logDao.getCount();
+			layoutService.removeLayout(layout, null);
+			logCounter2 = logDao.getCount();
+
+			assertTrue("Log didn't appeard after removing layout", logCounter < logCounter2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAddLayoutToComplexModel() throws Exception {
+		Project localProject = new Project();
+		try {
+
+			CellDesignerXmlParser parser = new CellDesignerXmlParser();
+			Model localModel = parser.createModel(new ConverterParams().filename("testFiles/sample.xml"));
+			Model localSubmodelModel = parser.createModel(new ConverterParams().filename("testFiles/sample.xml"));
+
+			ModelSubmodelConnection connection = new ModelSubmodelConnection(localSubmodelModel, SubmodelType.UNKNOWN);
+			connection.setName("AS");
+			localModel.addSubmodelConnection(connection);
+
+			localProject.addModel(localModel);
+			localProject.setProjectId("Some_id");
+
+			projectService.addProject(localProject);
+
+			String tmpLogin = "Test login3";
+			User tmpUser = userService.getUserByLogin(tmpLogin);
+			if (tmpUser != null) {
+				userService.deleteUser(tmpUser);
+				userDao.commit();
+			}
+
+			User localUser = new User();
+			localUser.setLogin(tmpLogin);
+
+			userService.addUser(localUser);
+
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+			userService.setUserPrivilege(user, new ObjectPrivilege(project, 1, PrivilegeType.VIEW_PROJECT, user));
+
+			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
+					directory("testDir").//
+					model(localModel).//
+					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
+					user(localUser);
+
+			layoutService.createLayout(params);
+
+			Project pr2 = projectService.getProjectByProjectId(localProject.getProjectId());
+
+			Model fromDbModel = pr2.getModels().iterator().next().getModel();
+
+			assertTrue(fromDbModel.getLayouts().size() > 0);
+
+			Model submodel = fromDbModel.getSubmodelConnections().iterator().next().getSubmodel().getModel();
+			assertEquals(fromDbModel.getLayouts().size(), submodel.getLayouts().size());
+
+			File f1 = new File(fromDbModel.getLayouts().get(0).getDirectory() + "/2/0/0.PNG");
+			File f2 = new File(submodel.getLayouts().get(0).getDirectory() + "/2/0/0.PNG");
+			assertFalse(f1.exists());
+			assertFalse(f2.exists());
+
+			userService.deleteUser(localUser);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			projectService.removeProject(localProject, null, false);
+		}
+	}
+
+	@Test
+	public void testInputDataInLayout() throws Exception {
+		try {
+			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
+			assertNotNull(layouts);
+			assertEquals(0, layouts.size());
+
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
+					directory("testDir").//
+					model(model).//
+					colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt")).//
+					user(user).//
+					async(false);
+
+			LayoutView row = layoutService.createLayout(params);
+
+			assertNotNull(row);
+			assertNotNull(row.getIdObject());
+			assertTrue("true".equalsIgnoreCase(row.getInputDataAvailable()));
+			byte[] inputData = layoutService.getInputDataForLayout(row);
+			assertNotNull(inputData);
+			byte[] originalData = IOUtils.toByteArray(new FileInputStream("testFiles/enricoData/ge001.txt"));
+			assertEquals(new String(originalData, StandardCharsets.UTF_8), new String(inputData, StandardCharsets.UTF_8));
+
+			layoutService.removeLayout(row, null);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetLayoutAliases() throws Exception {
+		try {
+			List<LayoutView> layouts = layoutService.getCustomLayouts(model, user);
+			assertNotNull(layouts);
+			assertEquals(0, layouts.size());
+
+			userService.setUserPrivilege(user, new BasicPrivilege(1, PrivilegeType.CUSTOM_LAYOUTS, user));
+			ByteArrayInputStream bais = new ByteArrayInputStream(
+					"name	reactionIdentifier	Color\ns1		#CC0000\ns2		#CCCC00\n	re1	#CCCC00\n".getBytes(StandardCharsets.UTF_8));
+			CreateLayoutParams params = new CreateLayoutParams().name("Test").//
+					directory("testDir").//
+					model(model).//
+					colorInputStream(bais).//
+					user(user).//
+					async(false);
+
+			LayoutView row = layoutService.createLayout(params);
+
+			List<LightLayoutAliasView> result = layoutService.getAliasesForLayout(model, row.getIdObject());
+
+			assertTrue(result.size() > 0);
+
+			List<LightLayoutReactionView> result2 = layoutService.getReactionsForLayout(model, row.getIdObject());
+
+			assertEquals(1, result2.size());
+
+			layoutService.removeLayout(row, null);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/ModelServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/ModelServiceTest.java
index b424ae797b..6430c72e62 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/ModelServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/ModelServiceTest.java
@@ -1,163 +1,163 @@
-package lcsb.mapviewer.services.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.annotation.Rollback;
-
-import lcsb.mapviewer.annotation.services.PubmedParser;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.converter.graphics.MapGenerator;
-import lcsb.mapviewer.converter.graphics.MapGenerator.MapGeneratorParams;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.interfaces.IModelService;
-import lcsb.mapviewer.services.search.data.LightAliasView;
-import lcsb.mapviewer.services.view.ProjectView;
-
-@Rollback(true)
-public class ModelServiceTest extends ServiceTestFunctions {
-	static Logger	logger = Logger.getLogger(ModelServiceTest.class);
-	@Autowired
-	IModelService	modelService;
-
-	@Autowired
-	PubmedParser	backend;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testRemoveModel() throws Exception {
-		try {
-			String directory = "test_directory";
-			String projectId = "Some_id";
-			Project project = new Project();
-			project.setProjectId(projectId);
-			projectDao.add(project);
-
-			Model model = getModelForFile("testFiles/sample.xml", false);
-			model.addLayout(new Layout("test", directory, false));
-
-			project.addModel(model);
-			projectDao.update(project);
-
-			MapGenerator generator = new MapGenerator();
-			MapGeneratorParams params = generator.new MapGeneratorParams().model(model).directory(directory);
-			generator.generateMapImages(params);
-
-			ProjectView row = projectService.getProjectViewByProjectId(project.getProjectId());
-			projectService.removeProject(row, null, false);
-
-			File file = new File(directory);
-			assertFalse(file.exists());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testGetAliasByIds() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/sample.xml", false);
-			int counter = 0;
-			Alias alias0 = null;
-			for (Alias alias : model.getAliases()) {
-				if (counter == 0) {
-					alias0 = alias;
-				}
-				alias.setId(counter++);
-			}
-			List<Pair<Integer, Integer>> identifiers = new ArrayList<>();
-			identifiers.add(new Pair<Integer, Integer>(0, 0));
-			List<LightAliasView> list = modelService.getLightAliasesByIds(model, identifiers);
-			assertEquals(1, list.size());
-			assertEquals(alias0.getX(), list.get(0).getBounds().getX(), EPSILON);
-			assertEquals(alias0.getY(), list.get(0).getBounds().getY(), EPSILON);
-			assertEquals(alias0.getWidth(), list.get(0).getBounds().getWidth(), EPSILON);
-			assertEquals(alias0.getHeight(), list.get(0).getBounds().getHeight(), EPSILON);
-			identifiers.add(new Pair<Integer, Integer>(0, 5));
-			list = modelService.getLightAliasesByIds(model, identifiers);
-			assertEquals(2, list.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testGetAliasByInvalidIds() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/db_problem_model.xml", false);
-			List<Pair<Integer, Integer>> identifiers = new ArrayList<>();
-			// check with wrong alias id
-			identifiers.add(new Pair<Integer, Integer>(0, 1));
-			try {
-				modelService.getLightAliasesByIds(model, identifiers);
-				fail(InvalidArgumentException.class + " expected");
-			} catch (InvalidArgumentException e) {
-
-			}
-			identifiers = new ArrayList<>();
-			// check with wrong model id
-			identifiers.add(new Pair<Integer, Integer>(1, 0));
-			try {
-				modelService.getLightAliasesByIds(model, identifiers);
-				fail(InvalidArgumentException.class + " expected");
-			} catch (InvalidArgumentException e) {
-
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testAddModel() throws Exception {
-		try {
-			String projectId = "Some_id";
-			Project project = new Project();
-			project.setProjectId(projectId);
-			projectDao.add(project);
-
-			Model model = getModelForFile("testFiles/db_problem_model.xml", false);
-
-			project.addModel(model);
-			projectDao.update(project);
-
-			ProjectView row = projectService.getProjectViewByProjectId(project.getProjectId());
-			projectService.removeProject(row, null, false);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-}
+package lcsb.mapviewer.services.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.annotation.Rollback;
+
+import lcsb.mapviewer.annotation.services.PubmedParser;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.converter.graphics.MapGenerator;
+import lcsb.mapviewer.converter.graphics.MapGenerator.MapGeneratorParams;
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.interfaces.IModelService;
+import lcsb.mapviewer.services.search.data.LightAliasView;
+import lcsb.mapviewer.services.view.ProjectView;
+
+@Rollback(true)
+public class ModelServiceTest extends ServiceTestFunctions {
+	static Logger	logger = Logger.getLogger(ModelServiceTest.class);
+	@Autowired
+	IModelService	modelService;
+
+	@Autowired
+	PubmedParser	backend;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testRemoveModel() throws Exception {
+		try {
+			String directory = "test_directory";
+			String projectId = "Some_id";
+			Project project = new Project();
+			project.setProjectId(projectId);
+			projectDao.add(project);
+
+			Model model = getModelForFile("testFiles/sample.xml", false);
+			model.addLayout(new Layout("test", directory, false));
+
+			project.addModel(model);
+			projectDao.update(project);
+
+			MapGenerator generator = new MapGenerator();
+			MapGeneratorParams params = generator.new MapGeneratorParams().model(model).directory(directory);
+			generator.generateMapImages(params);
+
+			ProjectView row = projectService.getProjectViewByProjectId(project.getProjectId());
+			projectService.removeProject(row, null, false);
+
+			File file = new File(directory);
+			assertFalse(file.exists());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testGetAliasByIds() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/sample.xml", false);
+			int counter = 0;
+			Alias alias0 = null;
+			for (Alias alias : model.getAliases()) {
+				if (counter == 0) {
+					alias0 = alias;
+				}
+				alias.setId(counter++);
+			}
+			List<Pair<Integer, Integer>> identifiers = new ArrayList<>();
+			identifiers.add(new Pair<Integer, Integer>(0, 0));
+			List<LightAliasView> list = modelService.getLightAliasesByIds(model, identifiers);
+			assertEquals(1, list.size());
+			assertEquals(alias0.getX(), list.get(0).getBounds().getX(), EPSILON);
+			assertEquals(alias0.getY(), list.get(0).getBounds().getY(), EPSILON);
+			assertEquals(alias0.getWidth(), list.get(0).getBounds().getWidth(), EPSILON);
+			assertEquals(alias0.getHeight(), list.get(0).getBounds().getHeight(), EPSILON);
+			identifiers.add(new Pair<Integer, Integer>(0, 5));
+			list = modelService.getLightAliasesByIds(model, identifiers);
+			assertEquals(2, list.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testGetAliasByInvalidIds() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/db_problem_model.xml", false);
+			List<Pair<Integer, Integer>> identifiers = new ArrayList<>();
+			// check with wrong alias id
+			identifiers.add(new Pair<Integer, Integer>(0, 1));
+			try {
+				modelService.getLightAliasesByIds(model, identifiers);
+				fail(InvalidArgumentException.class + " expected");
+			} catch (InvalidArgumentException e) {
+
+			}
+			identifiers = new ArrayList<>();
+			// check with wrong model id
+			identifiers.add(new Pair<Integer, Integer>(1, 0));
+			try {
+				modelService.getLightAliasesByIds(model, identifiers);
+				fail(InvalidArgumentException.class + " expected");
+			} catch (InvalidArgumentException e) {
+
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testAddModel() throws Exception {
+		try {
+			String projectId = "Some_id";
+			Project project = new Project();
+			project.setProjectId(projectId);
+			projectDao.add(project);
+
+			Model model = getModelForFile("testFiles/db_problem_model.xml", false);
+
+			project.addModel(model);
+			projectDao.update(project);
+
+			ProjectView row = projectService.getProjectViewByProjectId(project.getProjectId());
+			projectService.removeProject(row, null, false);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/OkServiceMock.java b/service/src/test/java/lcsb/mapviewer/services/impl/OkServiceMock.java
index e26c4c69e1..d184b82fb3 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/OkServiceMock.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/OkServiceMock.java
@@ -1,16 +1,16 @@
-package lcsb.mapviewer.services.impl;
-
-import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
-import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
-import lcsb.mapviewer.annotation.services.IExternalService;
-
-public class OkServiceMock implements IExternalService {
-
-	@Override
-	public ExternalServiceStatus getServiceStatus() {
-		ExternalServiceStatus status = new ExternalServiceStatus("Test service", "unknown");
-		status.setStatus(ExternalServiceStatusType.OK);
-		return status;
-	}
-
-}
+package lcsb.mapviewer.services.impl;
+
+import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
+import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
+import lcsb.mapviewer.annotation.services.IExternalService;
+
+public class OkServiceMock implements IExternalService {
+
+	@Override
+	public ExternalServiceStatus getServiceStatus() {
+		ExternalServiceStatus status = new ExternalServiceStatus("Test service", "unknown");
+		status.setStatus(ExternalServiceStatusType.OK);
+		return status;
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/SearchServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/SearchServiceTest.java
index 97dfb6b5c5..a677f5a753 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/SearchServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/SearchServiceTest.java
@@ -1,501 +1,497 @@
-package lcsb.mapviewer.services.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Point2D;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.annotation.data.Drug;
-import lcsb.mapviewer.common.Configuration;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.species.ComplexSpecies;
-import lcsb.mapviewer.model.map.species.Degraded;
-import lcsb.mapviewer.model.map.species.Gene;
-import lcsb.mapviewer.model.map.species.Ion;
-import lcsb.mapviewer.model.map.species.Phenotype;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.model.map.species.SimpleMolecule;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.model.map.species.Unknown;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.interfaces.ISearchService.CoordinatesSearchParams;
-import lcsb.mapviewer.services.search.data.FullAliasView;
-import lcsb.mapviewer.services.search.data.FullReactionView;
-import lcsb.mapviewer.services.search.data.SearchElementResult;
-import lcsb.mapviewer.services.utils.SearchIndexer;
-
-public class SearchServiceTest extends ServiceTestFunctions {
-	static Logger					logger										 = Logger.getLogger(SearchService.class);
-
-	private Model					model											 = null;
-	SearchIndexer					indexer										 = new SearchIndexer();
-
-	Map<Class<?>, String>	speciesSearchPrefix				 = new HashMap<Class<?>, String>();
-	Map<String, Class<?>>	speciesSearchReversePrefix = new HashMap<String, Class<?>>();
-
-	@Before
-	public void setUp() throws Exception {
-		addSearchPrefix("complex", ComplexSpecies.class);
-		addSearchPrefix("degrded", Degraded.class);
-		addSearchPrefix("drug", Drug.class);
-		addSearchPrefix("gene", Gene.class);
-		addSearchPrefix("ion", Ion.class);
-		addSearchPrefix("phenotype", Phenotype.class);
-		addSearchPrefix("protein", Protein.class);
-		addSearchPrefix("rna", Rna.class);
-		addSearchPrefix("molecule", SimpleMolecule.class);
-		addSearchPrefix("unknown", Unknown.class);
-	}
-
-	private void addSearchPrefix(String prefix, Class<?> clazz) {
-		speciesSearchPrefix.put(clazz, prefix);
-		speciesSearchReversePrefix.put(prefix, clazz);
-	}
-
-	protected void createFullModel() throws Exception {
-		model = getModelForFile("testFiles/searchModel.xml", false);
-		model.setProject(new Project("unknown project"));
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testSearchByName() throws Exception {
-		try {
-			createFullModel();
-			long count = searchHistoryDao.getCount();
-			SearchElementResult result = searchService.searchByQuery(model, "reaction:re21", 50, null, "127.0.0.1");
-			
-
-			assertNotNull(result);
-			assertEquals(4, result.getElements().size());
-			FullReactionView reaction = (FullReactionView) result.getElements().get(0);
-			assertTrue(reaction.getName().contains("re21"));
-
-			long count2 = searchHistoryDao.getCount();
-
-			assertEquals(count + 1, count2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSearchByName2() throws Exception {
-		try {
-			createFullModel();
-			SearchElementResult result = searchService.searchByQuery(model, "BAD:BCL-2", 50, null, "127.0.0.1");
-
-			assertNotNull(result);
-			assertTrue(result.getElements().size() > 0);
-			FullAliasView alias = (FullAliasView) result.getElements().get(0);
-			assertEquals("BAD:BCL-2", alias.getName());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSearchById() throws Exception {
-		try {
-			createFullModel();
-			MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_HAS_VERSION, MiriamType.CAS, "123");
-			model.getElements().iterator().next().addMiriamData(md);
-			SearchElementResult global = searchService.searchByQuery(model, "CAS:123", 50, null, "127.0.0.1");
-			assertNotNull(global);
-			assertEquals(1, global.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSearchByName4() throws Exception {
-		try {
-			createFullModel();
-			SearchElementResult result = searchService.searchByQuery(model, "BC", 50, true, "127.0.0.1");
-
-			assertNotNull(result);
-			assertEquals(0, result.size());
-
-			result = searchService.searchByQuery(model, "BC", 50, false, "127.0.0.1");
-			assertNotNull(result);
-			assertTrue(result.size() > 0);
-
-			result = searchService.searchByQuery(model, "BAD:BCL-2", 50, true, "127.0.0.1");
-			assertNotNull(result);
-			assertEquals(1, result.size());
-			FullAliasView alias = (FullAliasView) result.get(0);
-			assertEquals("BAD:BCL-2", alias.getName());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testQueryName() throws Exception {
-		try {
-			createFullModel();
-			SearchElementResult result = searchService
-					.searchByQuery(model, indexer.getQueryStringForIndex("reaction:re21", new HashSet<String>()), 50, null, "127.0.0.1");
-
-			assertNotNull(result);
-			assertEquals(4, result.size());
-			FullReactionView reaction = (FullReactionView) result.get(0);
-			assertTrue(reaction.getName().contains("re21"));
-			assertTrue(result.get(1) instanceof FullAliasView);
-			assertTrue(result.get(2) instanceof FullAliasView);
-			assertTrue(result.get(3) instanceof FullAliasView);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testQueryName2() throws Exception {
-		try {
-			createFullModel();
-			model.getModelData().setId(-13);
-			SearchElementResult result = searchService
-					.searchByQuery(model, indexer.getQueryStringForIndex("BCL-2", speciesSearchReversePrefix.keySet()), 50, null, "127.0.0.1");
-			assertNotNull(result);
-			assertTrue(result.size() > 0);
-			FullAliasView alias = (FullAliasView) result.get(0);
-			assertTrue("Invalid alias: " + alias.getName(), alias.getName().toUpperCase().contains("BCL"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testQueryName3() throws Exception {
-		try {
-			createFullModel();
-			SearchElementResult result = searchService.searchByQuery(model, "fdhgjkhdsfsdhfgfhsd", 50, null, "127.0.0.1");
-
-			assertNotNull(result);
-			assertEquals(0, result.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testQueryName4() throws Exception {
-		try {
-			createFullModel();
-			SearchElementResult result = searchService
-					.searchByQuery(model, indexer.getQueryStringForIndex("protein:BCL-2", speciesSearchReversePrefix.keySet()), 50, null, "127.0.0.1");
-			assertNotNull(result);
-			assertTrue(result.size() > 0);
-			FullAliasView alias = (FullAliasView) result.get(0);
-			assertTrue("Invalid alias: " + alias.getName(), alias.getName().toUpperCase().contains("BCL"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSearchClosest() throws Exception {
-		try {
-			model = getModelForFile("testFiles/graph_path_example3.xml", true);
-			List<Object> elements = searchService.getClosestElements(model, new Point2D.Double(0, 0), 5);
-			assertNotNull(elements);
-			assertEquals(5, elements.size());
-			assertTrue(elements.get(0) instanceof SpeciesAlias);
-			SpeciesAlias sAlias = (SpeciesAlias) elements.get(0);
-			assertEquals("s1", sAlias.getSpecies().getName());
-			assertTrue(elements.get(1) instanceof Reaction);
-			Reaction reaction = (Reaction) elements.get(1);
-			assertEquals("re1", reaction.getIdReaction());
-			assertTrue(elements.get(2) instanceof SpeciesAlias);
-			sAlias = (SpeciesAlias) elements.get(2);
-			assertEquals("s3", sAlias.getSpecies().getName());
-			assertTrue(elements.get(3) instanceof Reaction);
-			reaction = (Reaction) elements.get(3);
-			assertEquals("re2", reaction.getIdReaction());
-			assertTrue(elements.get(4) instanceof SpeciesAlias);
-			sAlias = (SpeciesAlias) elements.get(4);
-			assertEquals("s2", sAlias.getSpecies().getName());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSearchClosestWithEmptyModel() throws Exception {
-		try {
-			model = new ModelFullIndexed(null);
-			List<Object> elements = searchService.getClosestElements(model, new Point2D.Double(0, 0), 5);
-			assertNotNull(elements);
-			assertEquals(0, elements.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAutocompleList() {
-		try {
-			Model model = new ModelFullIndexed(null);
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setAliasId("a1");
-			Species species = new Protein();
-			species.setElementId("s1");
-			alias.setSpecies(species);
-			species.setName("PROT identifier");
-			species.getSynonyms().add("PROT synonym");
-			species.getSynonyms().add("another synonym");
-			species.setFullName("Protein common name");
-			model.addElement(species);
-			model.addAlias(alias);
-
-			alias = new SpeciesAlias();
-			alias.setAliasId("a2");
-			species = new SimpleMolecule();
-			species.setElementId("s2");
-			alias.setSpecies(species);
-			species.setName("Molecule2");
-			model.addElement(species);
-			model.addAlias(alias);
-
-			int oldVal = Configuration.getAutocompleteSize();
-			Configuration.setAutocompleteSize(5);
-
-			List<String> list = searchService.getAutocompleteList(model, "P");
-			assertNotNull(list);
-			assertEquals(4, list.size());
-			assertTrue(list.contains("PROT identifier".toLowerCase()));
-			assertTrue(list.contains("PROT synonym".toLowerCase()));
-			assertTrue(list.contains("Protein common name".toLowerCase()));
-
-			list = searchService.getAutocompleteList(model, "PROTEIN");
-			assertNotNull(list);
-			assertEquals(2, list.size());
-			assertTrue(list.contains("Protein common name".toLowerCase()));
-
-			list = searchService.getAutocompleteList(model, "m");
-			assertNotNull(list);
-			assertEquals(2, list.size());
-			assertTrue(list.contains("Molecule2".toLowerCase()));
-
-			list = searchService.getAutocompleteList(model, "blablabla");
-			assertNotNull(list);
-			assertEquals(0, list.size());
-
-			Configuration.setAutocompleteSize(oldVal);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testGetAutocompleList2() {
-		try {
-			Model model = new ModelFullIndexed(null);
-			SpeciesAlias alias = new SpeciesAlias();
-			alias.setAliasId("a1");
-			Species species = new Protein();
-			species.setElementId("s1");
-			alias.setSpecies(species);
-			species.setName("PROT identifier");
-			species.setNotes("Synonyms: PROT synonym, another synonym\nName: Protein common name");
-			model.addElement(species);
-			model.addAlias(alias);
-
-			alias = new SpeciesAlias();
-			alias.setAliasId("a2");
-			species = new SimpleMolecule();
-			species.setElementId("s2");
-			alias.setSpecies(species);
-			species.setName("Molecule2");
-			model.addElement(species);
-			model.addAlias(alias);
-
-			List<String> list = searchService.getAutocompleteList(model, "PROT identifier");
-			assertNotNull(list);
-			assertEquals(1, list.size());
-			assertTrue(list.get(0).equalsIgnoreCase("PROT identifier"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testSearchGenericProtein() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/generic.xml", true);
-
-			List<String> list = searchService.getAutocompleteList(model, "generic");
-			assertNotNull(list);
-			assertEquals(2, list.size());
-			assertTrue(list.contains("generic"));
-			assertTrue(list.contains("generic protein"));
-
-			SearchElementResult result = searchService.searchByQuery(model, "generic protein", 10, false, null);
-			assertNotNull(result);
-
-			assertTrue(result.size() > 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testSearchByCoordCompartment() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/graph_path_example3.xml", true);
-
-			// we search in non-nested model
-			SearchElementResult res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).x(50).y(50));
-			assertNotNull(res);
-			assertEquals(0, res.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testSearchByCoordCompartment2() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/graph_path_example3.xml", true);
-
-			Layout layout = new Layout();
-			layout.setHierarchicalView(true);
-			model.addLayout(layout);
-			// we search in nested model
-			SearchElementResult res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).x(50).y(50).layoutIdentifier(0));
-			assertNotNull(res);
-
-			assertTrue(res.get(0) instanceof FullAliasView);
-			FullAliasView view = (FullAliasView) res.get(0);
-			assertEquals("Compartment", view.getType());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testSearchByCoordReaction() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/graph_path_example3.xml", true);
-
-			// find compartment
-			SearchElementResult res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model));
-			// reaction is too far
-			assertEquals(0, res.size());
-
-			res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).distance(1000));
-			assertEquals(3, res.size());
-
-			assertTrue(res.get(0) instanceof FullReactionView);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testSearchByCoordAlias() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/graph_path_example3.xml", true);
-
-			SearchElementResult res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).x(60).y(60));
-			assertNotNull(res);
-			assertTrue(res.size() > 0);
-
-			assertTrue(res.get(0) instanceof FullAliasView);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testGetMiriamTypeForQuery() throws Exception {
-		try {
-			MiriamData md = new SearchService().getMiriamTypeForQuery("hgnc:SNCA");
-			assertNotNull(md);
-			assertEquals(MiriamType.HGNC, md.getDataType());
-			assertEquals("SNCA", md.getResource());
-
-			md = new SearchService().getMiriamTypeForQuery("reactome:REACT_15128");
-			assertNotNull(md);
-			assertEquals(MiriamType.REACTOME, md.getDataType());
-			assertEquals("REACT_15128", md.getResource());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testGetMiriamTypeForQuery2() throws Exception {
-		try {
-			MiriamData md = new SearchService().getMiriamTypeForQuery("UNKNOWN_HGNC:SNCA");
-			assertNull(md);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-}
+package lcsb.mapviewer.services.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Point2D;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.annotation.data.Drug;
+import lcsb.mapviewer.common.Configuration;
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.species.ComplexSpecies;
+import lcsb.mapviewer.model.map.species.Degraded;
+import lcsb.mapviewer.model.map.species.Gene;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Ion;
+import lcsb.mapviewer.model.map.species.Phenotype;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.model.map.species.SimpleMolecule;
+import lcsb.mapviewer.model.map.species.Unknown;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.interfaces.ISearchService.CoordinatesSearchParams;
+import lcsb.mapviewer.services.search.data.FullAliasView;
+import lcsb.mapviewer.services.search.data.FullReactionView;
+import lcsb.mapviewer.services.search.data.SearchElementResult;
+import lcsb.mapviewer.services.utils.SearchIndexer;
+
+public class SearchServiceTest extends ServiceTestFunctions {
+	static Logger					logger										 = Logger.getLogger(SearchService.class);
+
+	private Model					model											 = null;
+	SearchIndexer					indexer										 = new SearchIndexer();
+
+	Map<Class<?>, String>	speciesSearchPrefix				 = new HashMap<Class<?>, String>();
+	Map<String, Class<?>>	speciesSearchReversePrefix = new HashMap<String, Class<?>>();
+
+	@Before
+	public void setUp() throws Exception {
+		addSearchPrefix("complex", ComplexSpecies.class);
+		addSearchPrefix("degrded", Degraded.class);
+		addSearchPrefix("drug", Drug.class);
+		addSearchPrefix("gene", Gene.class);
+		addSearchPrefix("ion", Ion.class);
+		addSearchPrefix("phenotype", Phenotype.class);
+		addSearchPrefix("protein", Protein.class);
+		addSearchPrefix("rna", Rna.class);
+		addSearchPrefix("molecule", SimpleMolecule.class);
+		addSearchPrefix("unknown", Unknown.class);
+	}
+
+	private void addSearchPrefix(String prefix, Class<?> clazz) {
+		speciesSearchPrefix.put(clazz, prefix);
+		speciesSearchReversePrefix.put(prefix, clazz);
+	}
+
+	protected void createFullModel() throws Exception {
+		model = getModelForFile("testFiles/searchModel.xml", false);
+		model.setProject(new Project("unknown project"));
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testSearchByName() throws Exception {
+		try {
+			createFullModel();
+			long count = searchHistoryDao.getCount();
+			SearchElementResult result = searchService.searchByQuery(model, "reaction:re21", 50, null, "127.0.0.1");
+
+			assertNotNull(result);
+			assertEquals(4, result.getElements().size());
+			FullReactionView reaction = (FullReactionView) result.getElements().get(0);
+			assertTrue(reaction.getName().contains("re21"));
+
+			long count2 = searchHistoryDao.getCount();
+
+			assertEquals(count + 1, count2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSearchByName2() throws Exception {
+		try {
+			createFullModel();
+			SearchElementResult result = searchService.searchByQuery(model, "BAD:BCL-2", 50, null, "127.0.0.1");
+
+			assertNotNull(result);
+			assertTrue(result.getElements().size() > 0);
+			FullAliasView alias = (FullAliasView) result.getElements().get(0);
+			assertEquals("BAD:BCL-2", alias.getName());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSearchById() throws Exception {
+		try {
+			createFullModel();
+			MiriamData md = new MiriamData(MiriamRelationType.BQ_BIOL_HAS_VERSION, MiriamType.CAS, "123");
+			model.getElements().iterator().next().addMiriamData(md);
+			SearchElementResult global = searchService.searchByQuery(model, "CAS:123", 50, null, "127.0.0.1");
+			assertNotNull(global);
+			assertEquals(1, global.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSearchByName4() throws Exception {
+		try {
+			createFullModel();
+			SearchElementResult result = searchService.searchByQuery(model, "BC", 50, true, "127.0.0.1");
+
+			assertNotNull(result);
+			assertEquals(0, result.size());
+
+			result = searchService.searchByQuery(model, "BC", 50, false, "127.0.0.1");
+			assertNotNull(result);
+			assertTrue(result.size() > 0);
+
+			result = searchService.searchByQuery(model, "BAD:BCL-2", 50, true, "127.0.0.1");
+			assertNotNull(result);
+			assertEquals(1, result.size());
+			FullAliasView alias = (FullAliasView) result.get(0);
+			assertEquals("BAD:BCL-2", alias.getName());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testQueryName() throws Exception {
+		try {
+			createFullModel();
+			SearchElementResult result = searchService
+					.searchByQuery(model, indexer.getQueryStringForIndex("reaction:re21", new HashSet<String>()), 50, null, "127.0.0.1");
+
+			assertNotNull(result);
+			assertEquals(4, result.size());
+			FullReactionView reaction = (FullReactionView) result.get(0);
+			assertTrue(reaction.getName().contains("re21"));
+			assertTrue(result.get(1) instanceof FullAliasView);
+			assertTrue(result.get(2) instanceof FullAliasView);
+			assertTrue(result.get(3) instanceof FullAliasView);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testQueryName2() throws Exception {
+		try {
+			createFullModel();
+			model.getModelData().setId(-13);
+			SearchElementResult result = searchService
+					.searchByQuery(model, indexer.getQueryStringForIndex("BCL-2", speciesSearchReversePrefix.keySet()), 50, null, "127.0.0.1");
+			assertNotNull(result);
+			assertTrue(result.size() > 0);
+			FullAliasView alias = (FullAliasView) result.get(0);
+			assertTrue("Invalid alias: " + alias.getName(), alias.getName().toUpperCase().contains("BCL"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testQueryName3() throws Exception {
+		try {
+			createFullModel();
+			SearchElementResult result = searchService.searchByQuery(model, "fdhgjkhdsfsdhfgfhsd", 50, null, "127.0.0.1");
+
+			assertNotNull(result);
+			assertEquals(0, result.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testQueryName4() throws Exception {
+		try {
+			createFullModel();
+			SearchElementResult result = searchService
+					.searchByQuery(model, indexer.getQueryStringForIndex("protein:BCL-2", speciesSearchReversePrefix.keySet()), 50, null, "127.0.0.1");
+			assertNotNull(result);
+			assertTrue(result.size() > 0);
+			FullAliasView alias = (FullAliasView) result.get(0);
+			assertTrue("Invalid alias: " + alias.getName(), alias.getName().toUpperCase().contains("BCL"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSearchClosest() throws Exception {
+		try {
+			model = getModelForFile("testFiles/graph_path_example3.xml", true);
+			List<Object> elements = searchService.getClosestElements(model, new Point2D.Double(0, 0), 5);
+			assertNotNull(elements);
+			assertEquals(5, elements.size());
+			assertTrue(elements.get(0) instanceof SpeciesAlias);
+			SpeciesAlias sAlias = (SpeciesAlias) elements.get(0);
+			assertEquals("s1", sAlias.getSpecies().getName());
+			assertTrue(elements.get(1) instanceof Reaction);
+			Reaction reaction = (Reaction) elements.get(1);
+			assertEquals("re1", reaction.getIdReaction());
+			assertTrue(elements.get(2) instanceof SpeciesAlias);
+			sAlias = (SpeciesAlias) elements.get(2);
+			assertEquals("s3", sAlias.getSpecies().getName());
+			assertTrue(elements.get(3) instanceof Reaction);
+			reaction = (Reaction) elements.get(3);
+			assertEquals("re2", reaction.getIdReaction());
+			assertTrue(elements.get(4) instanceof SpeciesAlias);
+			sAlias = (SpeciesAlias) elements.get(4);
+			assertEquals("s2", sAlias.getSpecies().getName());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSearchClosestWithEmptyModel() throws Exception {
+		try {
+			model = new ModelFullIndexed(null);
+			List<Object> elements = searchService.getClosestElements(model, new Point2D.Double(0, 0), 5);
+			assertNotNull(elements);
+			assertEquals(0, elements.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAutocompleList() {
+		try {
+			Model model = new ModelFullIndexed(null);
+			GenericProtein protein = new GenericProtein();
+			protein.setElementId("s1");
+			SpeciesAlias proteinAlias = new GenericProteinAlias("a", protein);
+			protein.setName("PROT identifier");
+			protein.getSynonyms().add("PROT synonym");
+			protein.getSynonyms().add("another synonym");
+			protein.setFullName("Protein common name");
+			model.addElement(protein);
+			model.addAlias(proteinAlias);
+
+			SimpleMolecule species = new SimpleMolecule();
+			SimpleMoleculeAlias alias = new SimpleMoleculeAlias(species);
+			alias.setAliasId("a2");
+			species.setElementId("s2");
+			alias.setSpecies(species);
+			species.setName("Molecule2");
+			model.addElement(species);
+			model.addAlias(alias);
+
+			int oldVal = Configuration.getAutocompleteSize();
+			Configuration.setAutocompleteSize(5);
+
+			List<String> list = searchService.getAutocompleteList(model, "P");
+			assertNotNull(list);
+			assertEquals(4, list.size());
+			assertTrue(list.contains("PROT identifier".toLowerCase()));
+			assertTrue(list.contains("PROT synonym".toLowerCase()));
+			assertTrue(list.contains("Protein common name".toLowerCase()));
+
+			list = searchService.getAutocompleteList(model, "PROTEIN");
+			assertNotNull(list);
+			assertEquals(2, list.size());
+			assertTrue(list.contains("Protein common name".toLowerCase()));
+
+			list = searchService.getAutocompleteList(model, "m");
+			assertNotNull(list);
+			assertEquals(2, list.size());
+			assertTrue(list.contains("Molecule2".toLowerCase()));
+
+			list = searchService.getAutocompleteList(model, "blablabla");
+			assertNotNull(list);
+			assertEquals(0, list.size());
+
+			Configuration.setAutocompleteSize(oldVal);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testGetAutocompleList2() {
+		try {
+			Model model = new ModelFullIndexed(null);
+			GenericProtein protein = new GenericProtein();
+			GenericProteinAlias proteinAlias = new GenericProteinAlias("a1", protein);
+			protein.setElementId("s1");
+			protein.setName("PROT identifier");
+			protein.setNotes("Synonyms: PROT synonym, another synonym\nName: Protein common name");
+			model.addElement(protein);
+			model.addAlias(proteinAlias);
+
+			SimpleMolecule species = new SimpleMolecule();
+			SimpleMoleculeAlias alias = new SimpleMoleculeAlias("a2", species);
+			species.setElementId("s2");
+			alias.setSpecies(species);
+			species.setName("Molecule2");
+			model.addElement(species);
+			model.addAlias(alias);
+
+			List<String> list = searchService.getAutocompleteList(model, "PROT identifier");
+			assertNotNull(list);
+			assertEquals(1, list.size());
+			assertTrue(list.get(0).equalsIgnoreCase("PROT identifier"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testSearchGenericProtein() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/generic.xml", true);
+
+			List<String> list = searchService.getAutocompleteList(model, "generic");
+			assertNotNull(list);
+			assertEquals(2, list.size());
+			assertTrue(list.contains("generic"));
+			assertTrue(list.contains("generic protein"));
+
+			SearchElementResult result = searchService.searchByQuery(model, "generic protein", 10, false, null);
+			assertNotNull(result);
+
+			assertTrue(result.size() > 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testSearchByCoordCompartment() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/graph_path_example3.xml", true);
+
+			// we search in non-nested model
+			SearchElementResult res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).x(50).y(50));
+			assertNotNull(res);
+			assertEquals(0, res.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testSearchByCoordCompartment2() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/graph_path_example3.xml", true);
+
+			Layout layout = new Layout();
+			layout.setHierarchicalView(true);
+			model.addLayout(layout);
+			// we search in nested model
+			SearchElementResult res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).x(50).y(50).layoutIdentifier(0));
+			assertNotNull(res);
+
+			assertTrue(res.get(0) instanceof FullAliasView);
+			FullAliasView view = (FullAliasView) res.get(0);
+			assertEquals("Compartment", view.getType());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testSearchByCoordReaction() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/graph_path_example3.xml", true);
+
+			// find compartment
+			SearchElementResult res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model));
+			// reaction is too far
+			assertEquals(0, res.size());
+
+			res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).distance(1000));
+			assertEquals(3, res.size());
+
+			assertTrue(res.get(0) instanceof FullReactionView);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testSearchByCoordAlias() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/graph_path_example3.xml", true);
+
+			SearchElementResult res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).x(60).y(60));
+			assertNotNull(res);
+			assertTrue(res.size() > 0);
+
+			assertTrue(res.get(0) instanceof FullAliasView);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testGetMiriamTypeForQuery() throws Exception {
+		try {
+			MiriamData md = new SearchService().getMiriamTypeForQuery("hgnc:SNCA");
+			assertNotNull(md);
+			assertEquals(MiriamType.HGNC, md.getDataType());
+			assertEquals("SNCA", md.getResource());
+
+			md = new SearchService().getMiriamTypeForQuery("reactome:REACT_15128");
+			assertNotNull(md);
+			assertEquals(MiriamType.REACTOME, md.getDataType());
+			assertEquals("REACT_15128", md.getResource());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testGetMiriamTypeForQuery2() throws Exception {
+		try {
+			MiriamData md = new SearchService().getMiriamTypeForQuery("UNKNOWN_HGNC:SNCA");
+			assertNull(md);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/UserServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/UserServiceTest.java
index 12cb9be59b..2339229e53 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/UserServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/UserServiceTest.java
@@ -1,452 +1,452 @@
-package lcsb.mapviewer.services.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import lcsb.mapviewer.common.exception.InvalidArgumentException;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.user.BasicPrivilege;
-import lcsb.mapviewer.model.user.ObjectPrivilege;
-import lcsb.mapviewer.model.user.PrivilegeType;
-import lcsb.mapviewer.model.user.User;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.view.PrivilegeView;
-import lcsb.mapviewer.services.view.UserView;
-import lcsb.mapviewer.services.view.UserView.UserProjectPrivilegeView;
-import lcsb.mapviewer.services.view.UserViewFactory;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.annotation.Rollback;
-
-@Rollback(true)
-public class UserServiceTest extends ServiceTestFunctions {
-	static Logger		logger = Logger.getLogger(UserServiceTest.class);
-
-	@Autowired
-	UserViewFactory	userViewFactory;
-
-	@Before
-	public void setUp() throws Exception {
-		createUser();
-		logService.setLoggedUser(user);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		userDao.delete(user);
-	}
-
-	@Test
-	public void testLogin() {
-		try {
-			assertFalse(userService.login("john.doe", "incorrect password"));
-			assertTrue(userService.login("john.doe", "passwd"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testLoginWithNull() {
-		try {
-			assertFalse(userService.login("john.doe", null));
-			assertFalse(userService.login(null, "passwd"));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUserHasPrivilegeUserPrivilegeType1() {
-		try {
-			assertFalse(userService.userHasPrivilege(user, PrivilegeType.ADD_MAP));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testUserHasPrivilegeUserPrivilegeType3() {
-		try {
-			userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT);
-			fail("An exception should occure. VIEW_MAP must be connected with object");
-		} catch (Exception e) {
-
-		}
-	}
-
-	@Test
-	public void testUserHasPrivilegeUserPrivilegeType2() {
-		try {
-			BasicPrivilege privilege = new BasicPrivilege();
-			privilege.setLevel(1);
-			privilege.setType(PrivilegeType.ADD_MAP);
-			userService.setUserPrivilege(user, privilege);
-			assertTrue(userService.userHasPrivilege(user, PrivilegeType.ADD_MAP));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testUserHasPrivilegeUserPrivilegeTypeObject() {
-		try {
-			Project project = new Project();
-			projectDao.add(project);
-
-			assertFalse(userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, project));
-			try {
-				userService.userHasPrivilege(user, PrivilegeType.ADD_MAP, project);
-				fail("An exception should occure. ADD_MAP must not be connected with object");
-			} catch (Exception e) {
-
-			}
-
-			try {
-				userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, user);
-				fail("An exception should occure. VIEW_MAP must be connected with Model type");
-			} catch (Exception e) {
-
-			}
-
-			ObjectPrivilege privilege = new ObjectPrivilege();
-			privilege.setLevel(1);
-			privilege.setType(PrivilegeType.VIEW_PROJECT);
-			privilege.setIdObject(project.getId());
-			userService.setUserPrivilege(user, privilege);
-
-			assertTrue(userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, project));
-
-			privilege = new ObjectPrivilege(project, 0, PrivilegeType.VIEW_PROJECT, user);
-			userService.setUserPrivilege(user, privilege);
-
-			assertFalse(userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, project));
-
-			projectDao.delete(project);
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	@Test
-	public void testUserHasPrivilegeUserPrivilegeTypeObject2() {
-		try {
-			userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, null);
-			fail("Exception should occur");
-		} catch (InvalidArgumentException e) {
-		}
-	}
-
-	@Test
-	public void testAddUser() throws Exception {
-		try {
-			long logCount = logDao.getCount();
-			User user2 = new User();
-			user2.setLogin("login");
-			userService.addUser(user2);
-			assertNotNull(user2.getId());
-			long logCount2 = logDao.getCount();
-			assertEquals("Log entry is missing for add user event", logCount + 1, logCount2);
-			userDao.evict(user2);
-			User user3 = userService.getUserById(user2.getId());
-			assertNotNull(user3);
-			userService.deleteUser(user3);
-			user3 = userService.getUserById(user2.getId());
-			assertNull(user3);
-
-			long logCount3 = logDao.getCount();
-			assertEquals("Log entry is missing for remove user event", logCount2 + 1, logCount3);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetAllUserList() throws Exception {
-		try {
-			User user2 = new User();
-			user2.setLogin("login");
-			userService.addUser(user2);
-
-			Project project = new Project();
-			projectDao.add(project);
-
-			ObjectPrivilege privilege = new ObjectPrivilege();
-			privilege.setLevel(1);
-			privilege.setType(PrivilegeType.VIEW_PROJECT);
-			privilege.setIdObject(project.getId());
-			userService.setUserPrivilege(user2, privilege);
-
-			List<UserView> list = userService.getAllUserRows();
-			UserView currentUser = null;
-			for (UserView userRow : list) {
-				if (userRow.getIdObject() == user2.getId()) {
-					currentUser = userRow;
-				}
-			}
-			assertNotNull(currentUser);
-			assertEquals(user2.getLogin(), currentUser.getLogin());
-
-			PrivilegeType types[] = PrivilegeType.values();
-
-			List<BasicPrivilege> basicTypes = new ArrayList<BasicPrivilege>();
-			List<ObjectPrivilege> projectObjectTypes = new ArrayList<ObjectPrivilege>();
-			for (PrivilegeType privilegeType : types) {
-				if (privilegeType.getPrivilegeClassType().equals(BasicPrivilege.class)) {
-					basicTypes.add(privilegeType.getPrivilegeClassType().newInstance());
-				} else if (privilegeType.getPrivilegeClassType().equals(ObjectPrivilege.class)) {
-					if (privilegeType.getPrivilegeObjectType().equals(Project.class)) {
-						projectObjectTypes.add((ObjectPrivilege) privilegeType.getPrivilegeClassType().newInstance());
-					}
-				}
-			}
-
-			assertEquals(basicTypes.size(), currentUser.getBasicPrivileges().size());
-
-			long projectCount = projectDao.getCount();
-
-			assertEquals(projectCount, currentUser.getProjectPrivileges().size());
-
-			UserProjectPrivilegeView currentProject = null;
-			for (UserProjectPrivilegeView projectPrivilege : currentUser.getProjectPrivileges()) {
-				assertEquals(projectObjectTypes.size(), projectPrivilege.getProjectPrivileges().size());
-				if (projectPrivilege.getIdObject() == project.getId()) {
-					currentProject = projectPrivilege;
-				}
-			}
-			assertNotNull(currentProject);
-			PrivilegeView currentPrivilege = null;
-			for (PrivilegeView row : currentProject.getProjectPrivileges()) {
-				if (row.getType() == PrivilegeType.VIEW_PROJECT) {
-					currentPrivilege = row;
-				}
-			}
-			assertNotNull(currentPrivilege);
-			assertTrue(currentPrivilege.getSelected());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	/**
-	 * Test update of a user that doesn't exist in db
-	 */
-	@Test
-	public void testUpdateUserRow() {
-		try {
-			Project project = new Project();
-			projectDao.add(project);
-
-			UserView userRow = userService.createEmptyUserRow();
-
-			for (PrivilegeView pRow : userRow.getBasicPrivileges()) {
-				if (pRow.getType().equals(PrivilegeType.ADD_MAP)) {
-					pRow.setSelected(true);
-				}
-			}
-
-			for (PrivilegeView pRow : userRow.getProjectPrivilegeByProjectId(project.getId()).getProjectPrivileges()) {
-				if (pRow.getType().equals(PrivilegeType.VIEW_PROJECT)) {
-					pRow.setSelected(true);
-				}
-			}
-
-			userService.updateUser(userRow);
-
-			assertNotNull(userRow.getIdObject());
-			assertTrue(userRow.getIdObject() != 0);
-
-			User user2 = userDao.getById(userRow.getIdObject());
-
-			assertTrue(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
-			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.PROJECT_MANAGEMENT));
-			assertTrue(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
-
-			for (PrivilegeView pRow : userRow.getBasicPrivileges()) {
-				if (pRow.getType().equals(PrivilegeType.ADD_MAP)) {
-					pRow.setSelected(false);
-				}
-			}
-
-			for (PrivilegeView pRow : userRow.getProjectPrivilegeByProjectId(project.getId()).getProjectPrivileges()) {
-				if (pRow.getType().equals(PrivilegeType.VIEW_PROJECT)) {
-					pRow.setSelected(false);
-				}
-			}
-
-			userService.updateUser(userRow);
-
-			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
-			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-	/**
-	 * Test update of a user that exist in the db
-	 * 
-	 * @throws Exception
-	 */
-	@Test
-	public void testUpdateUserRow2() throws Exception {
-		String cryptedPassword = "passwd";
-
-		try {
-			Project project = new Project();
-			projectDao.add(project);
-
-			User user2 = new User();
-			user2.setLogin("login");
-			user2.setCryptedPassword(cryptedPassword);
-			userService.addUser(user2);
-
-			List<UserView> rows = userService.getAllUserRows();
-			UserView userRow = null;
-			for (UserView userRow2 : rows) {
-				if (userRow2.getIdObject() == user2.getId())
-					userRow = userRow2;
-			}
-
-			assertNotNull(userRow);
-
-			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
-			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
-
-			for (PrivilegeView pRow : userRow.getBasicPrivileges()) {
-				if (pRow.getType().equals(PrivilegeType.ADD_MAP)) {
-					pRow.setSelected(true);
-				}
-			}
-
-			for (PrivilegeView pRow : userRow.getProjectPrivilegeByProjectId(project.getId()).getProjectPrivileges()) {
-				if (pRow.getType().equals(PrivilegeType.VIEW_PROJECT)) {
-					pRow.setSelected(true);
-				}
-			}
-
-			userRow.setPassword("");
-
-			userService.updateUser(userRow);
-
-			User user3 = userDao.getById(user2.getId());
-
-			// check if password didn't change
-			assertEquals(cryptedPassword, user3.getCryptedPassword());
-
-			assertTrue(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
-			assertTrue(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
-
-			for (PrivilegeView pRow : userRow.getBasicPrivileges()) {
-				if (pRow.getType().equals(PrivilegeType.ADD_MAP)) {
-					pRow.setSelected(false);
-				}
-			}
-
-			for (PrivilegeView pRow : userRow.getProjectPrivilegeByProjectId(project.getId()).getProjectPrivileges()) {
-				if (pRow.getType().equals(PrivilegeType.VIEW_PROJECT)) {
-					pRow.setSelected(false);
-				}
-			}
-
-			userRow.setPassword("new passwd");
-			userService.updateUser(userRow);
-
-			user3 = userDao.getById(user2.getId());
-
-			// check if password changed
-			assertFalse(cryptedPassword.equals(user3.getCryptedPassword()));
-
-			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
-			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testRemoveUserRow() throws Exception {
-		try {
-			UserView userRow = userService.createEmptyUserRow();
-			userService.deleteUser(userRow);
-
-			User user2 = new User();
-			user2.setLogin("login");
-			userService.addUser(user2);
-
-			List<UserView> rows = userService.getAllUserRows();
-			userRow = null;
-			for (UserView userRow2 : rows) {
-				if (userRow2.getIdObject() == user2.getId())
-					userRow = userRow2;
-			}
-
-			assertNotNull(userRow);
-
-			userService.deleteUser(userRow);
-
-			rows = userService.getAllUserRows();
-
-			userRow = null;
-			for (UserView userRow2 : rows) {
-				if (userRow2.getIdObject() == user2.getId())
-					userRow = userRow2;
-			}
-
-			assertNull(userRow);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateEmptyUserRow() {
-		try {
-			Project project = new Project();
-			projectDao.add(project);
-
-			UserView row = userService.createEmptyUserRow();
-
-			assertNotNull(row);
-
-			long projectCount = projectDao.getCount();
-
-			assertEquals(projectCount, row.getProjectPrivileges().size());
-			assertNotNull(row.getProjectPrivilegeByProjectId(project.getId()));
-
-			for (UserProjectPrivilegeView upRow : row.getProjectPrivileges()) {
-				assertTrue(userViewFactory.getObjectTypes().size() >= upRow.getProjectPrivileges().size());
-			}
-			assertEquals(userViewFactory.getBasicTypes().size(), row.getBasicPrivileges().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			fail("Unknown exception");
-		}
-	}
-
-}
+package lcsb.mapviewer.services.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import lcsb.mapviewer.common.exception.InvalidArgumentException;
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.user.BasicPrivilege;
+import lcsb.mapviewer.model.user.ObjectPrivilege;
+import lcsb.mapviewer.model.user.PrivilegeType;
+import lcsb.mapviewer.model.user.User;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.view.PrivilegeView;
+import lcsb.mapviewer.services.view.UserView;
+import lcsb.mapviewer.services.view.UserView.UserProjectPrivilegeView;
+import lcsb.mapviewer.services.view.UserViewFactory;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.annotation.Rollback;
+
+@Rollback(true)
+public class UserServiceTest extends ServiceTestFunctions {
+	static Logger		logger = Logger.getLogger(UserServiceTest.class);
+
+	@Autowired
+	UserViewFactory	userViewFactory;
+
+	@Before
+	public void setUp() throws Exception {
+		createUser();
+		logService.setLoggedUser(user);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		userDao.delete(user);
+	}
+
+	@Test
+	public void testLogin() {
+		try {
+			assertFalse(userService.login("john.doe", "incorrect password"));
+			assertTrue(userService.login("john.doe", "passwd"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testLoginWithNull() {
+		try {
+			assertFalse(userService.login("john.doe", null));
+			assertFalse(userService.login(null, "passwd"));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUserHasPrivilegeUserPrivilegeType1() {
+		try {
+			assertFalse(userService.userHasPrivilege(user, PrivilegeType.ADD_MAP));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testUserHasPrivilegeUserPrivilegeType3() {
+		try {
+			userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT);
+			fail("An exception should occure. VIEW_MAP must be connected with object");
+		} catch (Exception e) {
+
+		}
+	}
+
+	@Test
+	public void testUserHasPrivilegeUserPrivilegeType2() {
+		try {
+			BasicPrivilege privilege = new BasicPrivilege();
+			privilege.setLevel(1);
+			privilege.setType(PrivilegeType.ADD_MAP);
+			userService.setUserPrivilege(user, privilege);
+			assertTrue(userService.userHasPrivilege(user, PrivilegeType.ADD_MAP));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testUserHasPrivilegeUserPrivilegeTypeObject() {
+		try {
+			Project project = new Project();
+			projectDao.add(project);
+
+			assertFalse(userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, project));
+			try {
+				userService.userHasPrivilege(user, PrivilegeType.ADD_MAP, project);
+				fail("An exception should occure. ADD_MAP must not be connected with object");
+			} catch (Exception e) {
+
+			}
+
+			try {
+				userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, user);
+				fail("An exception should occure. VIEW_MAP must be connected with Model type");
+			} catch (Exception e) {
+
+			}
+
+			ObjectPrivilege privilege = new ObjectPrivilege();
+			privilege.setLevel(1);
+			privilege.setType(PrivilegeType.VIEW_PROJECT);
+			privilege.setIdObject(project.getId());
+			userService.setUserPrivilege(user, privilege);
+
+			assertTrue(userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, project));
+
+			privilege = new ObjectPrivilege(project, 0, PrivilegeType.VIEW_PROJECT, user);
+			userService.setUserPrivilege(user, privilege);
+
+			assertFalse(userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, project));
+
+			projectDao.delete(project);
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	@Test
+	public void testUserHasPrivilegeUserPrivilegeTypeObject2() {
+		try {
+			userService.userHasPrivilege(user, PrivilegeType.VIEW_PROJECT, null);
+			fail("Exception should occur");
+		} catch (InvalidArgumentException e) {
+		}
+	}
+
+	@Test
+	public void testAddUser() throws Exception {
+		try {
+			long logCount = logDao.getCount();
+			User user2 = new User();
+			user2.setLogin("login");
+			userService.addUser(user2);
+			assertNotNull(user2.getId());
+			long logCount2 = logDao.getCount();
+			assertEquals("Log entry is missing for add user event", logCount + 1, logCount2);
+			userDao.evict(user2);
+			User user3 = userService.getUserById(user2.getId());
+			assertNotNull(user3);
+			userService.deleteUser(user3);
+			user3 = userService.getUserById(user2.getId());
+			assertNull(user3);
+
+			long logCount3 = logDao.getCount();
+			assertEquals("Log entry is missing for remove user event", logCount2 + 1, logCount3);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetAllUserList() throws Exception {
+		try {
+			User user2 = new User();
+			user2.setLogin("login");
+			userService.addUser(user2);
+
+			Project project = new Project();
+			projectDao.add(project);
+
+			ObjectPrivilege privilege = new ObjectPrivilege();
+			privilege.setLevel(1);
+			privilege.setType(PrivilegeType.VIEW_PROJECT);
+			privilege.setIdObject(project.getId());
+			userService.setUserPrivilege(user2, privilege);
+
+			List<UserView> list = userService.getAllUserRows();
+			UserView currentUser = null;
+			for (UserView userRow : list) {
+				if (userRow.getIdObject() == user2.getId()) {
+					currentUser = userRow;
+				}
+			}
+			assertNotNull(currentUser);
+			assertEquals(user2.getLogin(), currentUser.getLogin());
+
+			PrivilegeType types[] = PrivilegeType.values();
+
+			List<BasicPrivilege> basicTypes = new ArrayList<BasicPrivilege>();
+			List<ObjectPrivilege> projectObjectTypes = new ArrayList<ObjectPrivilege>();
+			for (PrivilegeType privilegeType : types) {
+				if (privilegeType.getPrivilegeClassType().equals(BasicPrivilege.class)) {
+					basicTypes.add(privilegeType.getPrivilegeClassType().newInstance());
+				} else if (privilegeType.getPrivilegeClassType().equals(ObjectPrivilege.class)) {
+					if (privilegeType.getPrivilegeObjectType().equals(Project.class)) {
+						projectObjectTypes.add((ObjectPrivilege) privilegeType.getPrivilegeClassType().newInstance());
+					}
+				}
+			}
+
+			assertEquals(basicTypes.size(), currentUser.getBasicPrivileges().size());
+
+			long projectCount = projectDao.getCount();
+
+			assertEquals(projectCount, currentUser.getProjectPrivileges().size());
+
+			UserProjectPrivilegeView currentProject = null;
+			for (UserProjectPrivilegeView projectPrivilege : currentUser.getProjectPrivileges()) {
+				assertEquals(projectObjectTypes.size(), projectPrivilege.getProjectPrivileges().size());
+				if (projectPrivilege.getIdObject() == project.getId()) {
+					currentProject = projectPrivilege;
+				}
+			}
+			assertNotNull(currentProject);
+			PrivilegeView currentPrivilege = null;
+			for (PrivilegeView row : currentProject.getProjectPrivileges()) {
+				if (row.getType() == PrivilegeType.VIEW_PROJECT) {
+					currentPrivilege = row;
+				}
+			}
+			assertNotNull(currentPrivilege);
+			assertTrue(currentPrivilege.getSelected());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	/**
+	 * Test update of a user that doesn't exist in db
+	 */
+	@Test
+	public void testUpdateUserRow() {
+		try {
+			Project project = new Project();
+			projectDao.add(project);
+
+			UserView userRow = userService.createEmptyUserRow();
+
+			for (PrivilegeView pRow : userRow.getBasicPrivileges()) {
+				if (pRow.getType().equals(PrivilegeType.ADD_MAP)) {
+					pRow.setSelected(true);
+				}
+			}
+
+			for (PrivilegeView pRow : userRow.getProjectPrivilegeByProjectId(project.getId()).getProjectPrivileges()) {
+				if (pRow.getType().equals(PrivilegeType.VIEW_PROJECT)) {
+					pRow.setSelected(true);
+				}
+			}
+
+			userService.updateUser(userRow);
+
+			assertNotNull(userRow.getIdObject());
+			assertTrue(userRow.getIdObject() != 0);
+
+			User user2 = userDao.getById(userRow.getIdObject());
+
+			assertTrue(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
+			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.PROJECT_MANAGEMENT));
+			assertTrue(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
+
+			for (PrivilegeView pRow : userRow.getBasicPrivileges()) {
+				if (pRow.getType().equals(PrivilegeType.ADD_MAP)) {
+					pRow.setSelected(false);
+				}
+			}
+
+			for (PrivilegeView pRow : userRow.getProjectPrivilegeByProjectId(project.getId()).getProjectPrivileges()) {
+				if (pRow.getType().equals(PrivilegeType.VIEW_PROJECT)) {
+					pRow.setSelected(false);
+				}
+			}
+
+			userService.updateUser(userRow);
+
+			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
+			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+	/**
+	 * Test update of a user that exist in the db
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void testUpdateUserRow2() throws Exception {
+		String cryptedPassword = "passwd";
+
+		try {
+			Project project = new Project();
+			projectDao.add(project);
+
+			User user2 = new User();
+			user2.setLogin("login");
+			user2.setCryptedPassword(cryptedPassword);
+			userService.addUser(user2);
+
+			List<UserView> rows = userService.getAllUserRows();
+			UserView userRow = null;
+			for (UserView userRow2 : rows) {
+				if (userRow2.getIdObject() == user2.getId())
+					userRow = userRow2;
+			}
+
+			assertNotNull(userRow);
+
+			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
+			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
+
+			for (PrivilegeView pRow : userRow.getBasicPrivileges()) {
+				if (pRow.getType().equals(PrivilegeType.ADD_MAP)) {
+					pRow.setSelected(true);
+				}
+			}
+
+			for (PrivilegeView pRow : userRow.getProjectPrivilegeByProjectId(project.getId()).getProjectPrivileges()) {
+				if (pRow.getType().equals(PrivilegeType.VIEW_PROJECT)) {
+					pRow.setSelected(true);
+				}
+			}
+
+			userRow.setPassword("");
+
+			userService.updateUser(userRow);
+
+			User user3 = userDao.getById(user2.getId());
+
+			// check if password didn't change
+			assertEquals(cryptedPassword, user3.getCryptedPassword());
+
+			assertTrue(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
+			assertTrue(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
+
+			for (PrivilegeView pRow : userRow.getBasicPrivileges()) {
+				if (pRow.getType().equals(PrivilegeType.ADD_MAP)) {
+					pRow.setSelected(false);
+				}
+			}
+
+			for (PrivilegeView pRow : userRow.getProjectPrivilegeByProjectId(project.getId()).getProjectPrivileges()) {
+				if (pRow.getType().equals(PrivilegeType.VIEW_PROJECT)) {
+					pRow.setSelected(false);
+				}
+			}
+
+			userRow.setPassword("new passwd");
+			userService.updateUser(userRow);
+
+			user3 = userDao.getById(user2.getId());
+
+			// check if password changed
+			assertFalse(cryptedPassword.equals(user3.getCryptedPassword()));
+
+			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.ADD_MAP));
+			assertFalse(userService.userHasPrivilege(user2, PrivilegeType.VIEW_PROJECT, project));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testRemoveUserRow() throws Exception {
+		try {
+			UserView userRow = userService.createEmptyUserRow();
+			userService.deleteUser(userRow);
+
+			User user2 = new User();
+			user2.setLogin("login");
+			userService.addUser(user2);
+
+			List<UserView> rows = userService.getAllUserRows();
+			userRow = null;
+			for (UserView userRow2 : rows) {
+				if (userRow2.getIdObject() == user2.getId())
+					userRow = userRow2;
+			}
+
+			assertNotNull(userRow);
+
+			userService.deleteUser(userRow);
+
+			rows = userService.getAllUserRows();
+
+			userRow = null;
+			for (UserView userRow2 : rows) {
+				if (userRow2.getIdObject() == user2.getId())
+					userRow = userRow2;
+			}
+
+			assertNull(userRow);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCreateEmptyUserRow() {
+		try {
+			Project project = new Project();
+			projectDao.add(project);
+
+			UserView row = userService.createEmptyUserRow();
+
+			assertNotNull(row);
+
+			long projectCount = projectDao.getCount();
+
+			assertEquals(projectCount, row.getProjectPrivileges().size());
+			assertNotNull(row.getProjectPrivilegeByProjectId(project.getId()));
+
+			for (UserProjectPrivilegeView upRow : row.getProjectPrivileges()) {
+				assertTrue(userViewFactory.getObjectTypes().size() >= upRow.getProjectPrivileges().size());
+			}
+			assertEquals(userViewFactory.getBasicTypes().size(), row.getBasicPrivileges().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			fail("Unknown exception");
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/search/AllSearchTests.java b/service/src/test/java/lcsb/mapviewer/services/search/AllSearchTests.java
index a205615533..0073cd477c 100644
--- a/service/src/test/java/lcsb/mapviewer/services/search/AllSearchTests.java
+++ b/service/src/test/java/lcsb/mapviewer/services/search/AllSearchTests.java
@@ -1,20 +1,20 @@
-package lcsb.mapviewer.services.search;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-import lcsb.mapviewer.services.search.comment.AllCommentTests;
-import lcsb.mapviewer.services.search.data.AllSearchDataTests;
-import lcsb.mapviewer.services.search.db.AllSearchDbTests;
-import lcsb.mapviewer.services.search.layout.AllSearchLayoutTests;
-
-@RunWith(Suite.class)
-@SuiteClasses({ AllCommentTests.class, //
-		AllSearchDbTests.class, //
-		AllSearchDataTests.class, //
-		AllSearchLayoutTests.class,//
-})
-public class AllSearchTests {
-
-}
+package lcsb.mapviewer.services.search;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import lcsb.mapviewer.services.search.comment.AllCommentTests;
+import lcsb.mapviewer.services.search.data.AllSearchDataTests;
+import lcsb.mapviewer.services.search.db.AllSearchDbTests;
+import lcsb.mapviewer.services.search.layout.AllSearchLayoutTests;
+
+@RunWith(Suite.class)
+@SuiteClasses({ AllCommentTests.class, //
+		AllSearchDbTests.class, //
+		AllSearchDataTests.class, //
+		AllSearchLayoutTests.class,//
+})
+public class AllSearchTests {
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/search/SearchResultFactoryTest.java b/service/src/test/java/lcsb/mapviewer/services/search/SearchResultFactoryTest.java
index 39e64d9ce7..930de2e986 100644
--- a/service/src/test/java/lcsb/mapviewer/services/search/SearchResultFactoryTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/search/SearchResultFactoryTest.java
@@ -1,61 +1,61 @@
-package lcsb.mapviewer.services.search;
-
-import static org.junit.Assert.assertTrue;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.model.map.Element;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.species.Rna;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.search.db.DbSearchCriteria;
-import lcsb.mapviewer.services.search.db.GeneRow;
-import lcsb.mapviewer.services.search.db.TargetView;
-import lcsb.mapviewer.services.search.db.chemical.ChemicalView;
-import lcsb.mapviewer.services.search.db.chemical.ChemicalViewFactory;
-import lcsb.mapviewer.services.search.db.chemical.IChemicalService;
-
-public class SearchResultFactoryTest extends ServiceTestFunctions {
-
-	Logger							logger = Logger.getLogger(SearchResultFactoryTest.class);
-
-	@Autowired
-	ChemicalViewFactory	factory;
-
-	@Autowired
-	IChemicalService		chemicalService;
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testElementMatch() {
-		String geneName = "GDNF";
-		ChemicalView view = chemicalService.getByName("Amphetamine", new DbSearchCriteria().disease(new MiriamData(MiriamType.MESH_2012, "D010300")));
-		TargetView target = null;
-		for (TargetView t : view.getTargetRows()) {
-			for (GeneRow row : t.getProteins()) {
-				if (row.getAnnotation().getName().equals(geneName)) {
-					target = t;
-				}
-			}
-		}
-
-		Element element = new Rna();
-		element.setName(geneName);
-
-		assertTrue(factory.elementMatch(target, element));
-
-	}
-
-}
+package lcsb.mapviewer.services.search;
+
+import static org.junit.Assert.assertTrue;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.model.map.Element;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.species.Rna;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.search.db.DbSearchCriteria;
+import lcsb.mapviewer.services.search.db.GeneRow;
+import lcsb.mapviewer.services.search.db.TargetView;
+import lcsb.mapviewer.services.search.db.chemical.ChemicalView;
+import lcsb.mapviewer.services.search.db.chemical.ChemicalViewFactory;
+import lcsb.mapviewer.services.search.db.chemical.IChemicalService;
+
+public class SearchResultFactoryTest extends ServiceTestFunctions {
+
+	Logger							logger = Logger.getLogger(SearchResultFactoryTest.class);
+
+	@Autowired
+	ChemicalViewFactory	factory;
+
+	@Autowired
+	IChemicalService		chemicalService;
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testElementMatch() {
+		String geneName = "GDNF";
+		ChemicalView view = chemicalService.getByName("Amphetamine", new DbSearchCriteria().disease(new MiriamData(MiriamType.MESH_2012, "D010300")));
+		TargetView target = null;
+		for (TargetView t : view.getTargetRows()) {
+			for (GeneRow row : t.getProteins()) {
+				if (row.getAnnotation().getName().equals(geneName)) {
+					target = t;
+				}
+			}
+		}
+
+		Element element = new Rna();
+		element.setName(geneName);
+
+		assertTrue(factory.elementMatch(target, element));
+
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/search/data/FullAliasViewFactoryTest.java b/service/src/test/java/lcsb/mapviewer/services/search/data/FullAliasViewFactoryTest.java
index 9333901abc..cea3dbadde 100644
--- a/service/src/test/java/lcsb/mapviewer/services/search/data/FullAliasViewFactoryTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/search/data/FullAliasViewFactoryTest.java
@@ -1,258 +1,258 @@
-package lcsb.mapviewer.services.search.data;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.geom.Point2D;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.primefaces.model.TreeNode;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.annotation.data.Chebi;
-import lcsb.mapviewer.annotation.services.annotators.ChebiAnnotator;
-import lcsb.mapviewer.model.graphics.PolylineData;
-import lcsb.mapviewer.model.map.MiriamData;
-import lcsb.mapviewer.model.map.MiriamRelationType;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.agregator.Compartment;
-import lcsb.mapviewer.model.map.layout.Layout;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.model.map.reaction.Product;
-import lcsb.mapviewer.model.map.reaction.Reactant;
-import lcsb.mapviewer.model.map.reaction.Reaction;
-import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
-import lcsb.mapviewer.model.map.species.GenericProtein;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.model.map.species.Species;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.overlay.ChebiTreeRow;
-
-public class FullAliasViewFactoryTest extends ServiceTestFunctions {
-	Logger									 logger	= Logger.getLogger(FullAliasViewFactoryTest.class);
-
-	@Autowired
-	FullAliasViewFactory		 fullAliasViewFactory;
-
-	@Autowired
-	private ChebiAnnotator	 backend;
-	private SpeciesAlias		 alias;
-	private SpeciesAlias		 alias2;
-	private Point2D					 midPoint;
-	private Reaction				 reaction;
-	private SpeciesAlias		 alias3;
-
-	private Model						 model;
-
-	private CompartmentAlias compartmentAlias;
-
-	private Compartment			 compartment;
-
-	@Before
-	public void setUp() throws Exception {
-
-		model = new ModelFullIndexed(null);
-		model.setWidth(20010);
-		model.setHeight(20010);
-		model.setTileSize(256);
-		model.setZoomLevels(7);
-		model.addLayout(new Layout());
-		model.getModelData().setId(-12);
-
-		Species species = new Protein();
-		species.setElementId("A");
-		species.setName("blablabla");
-		species.setNotes("nottttttes");
-		alias = new SpeciesAlias(species);
-		alias.setAliasId("AL1");
-		alias.setX(10.0);
-		alias.setY(12.0);
-		species.getMiriamData().add(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.WIKIPEDIA, "144352"));
-		species.getMiriamData().add(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, "43345"));
-
-		model.addAlias(alias);
-		model.addElement(species);
-
-		Species species2 = new Protein();
-		species2.setName("blablabla2");
-		species2.setElementId("B");
-		alias2 = new SpeciesAlias(species2);
-		alias2.setAliasId("AL2");
-		alias2.setX(100.0);
-		alias2.setY(120.0);
-
-		model.addAlias(alias2);
-		model.addElement(species2);
-
-		midPoint = new Point2D.Double(30, 100);
-
-		reaction = new Reaction();
-
-		Reactant reactant = new Reactant(alias, species);
-		reactant.setLine(new PolylineData(alias.getCenter(), midPoint));
-		reaction.addReactant(reactant);
-
-		Product product = new Product(alias2, species2);
-		product.setLine(new PolylineData(alias2.getCenter(), midPoint));
-		reaction.addProduct(product);
-
-		model.addReaction(reaction);
-
-		Species species3 = new Protein();
-		species3.setElementId("C");
-		species3.setName("blablabla3");
-		alias3 = new SpeciesAlias(species3);
-		alias3.setAliasId("AL3");
-		alias3.setX(200.0);
-		alias3.setY(120.0);
-
-		model.addAlias(alias3);
-		model.addElement(species3);
-
-		reaction = new NegativeInfluenceReaction(reaction);
-		reaction.getMiriamData().add(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CAS, "cc"));
-
-		model.addReaction(reaction);
-
-		compartmentAlias = new CompartmentAlias();
-		compartmentAlias.setAliasId("AL4");
-		compartment = new Compartment();
-		compartment.setElementId("C4");
-		compartmentAlias.setX(10);
-		compartmentAlias.setY(10);
-		compartmentAlias.setWidth(10);
-		compartmentAlias.setHeight(10);
-		compartmentAlias.setCompartment(compartment);
-		model.addCompartment(compartment);
-		model.addAlias(compartmentAlias);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCreateGson() {
-		try {
-			Alias alias = new SpeciesAlias();
-			Protein protein = new GenericProtein();
-			protein.setName("12");
-			alias.setElement(protein);
-			alias.setModel(new ModelFullIndexed(null));
-			FullAliasView object = fullAliasViewFactory.create(alias);
-			String gson = fullAliasViewFactory.createGson(object);
-			assertNotNull(gson);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAliasOverlay() throws Exception {
-		try {
-			FullAliasView result = fullAliasViewFactory.create(alias);
-			assertNotNull(result);
-			assertEquals(model.getId(), result.getModelId());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAliasOverlay2() throws Exception {
-		try {
-			FullAliasView result = fullAliasViewFactory.create(alias2);
-			assertNotNull(result);
-			assertEquals(model.getId(), result.getModelId());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetNotes() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/protein_with_modification.xml", true);
-			model.setTileSize(256);
-			SpeciesAlias alias = (SpeciesAlias) model.getAliasByAliasId("sa1");
-			FullAliasView marker = fullAliasViewFactory.create(alias);
-			List<?> list = (List<?>) marker.getOther("posttranslationalModifications");
-			assertNotNull(list);
-			assertEquals(2, list.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateChebiTree() throws Exception {
-		try {
-			Chebi chebi = backend.getChebiElementForChebiId(new MiriamData(MiriamType.CHEBI, "CHEBI:15377"));
-
-			TreeNode root = fullAliasViewFactory.createTreeForChebi(chebi);
-
-			Set<String> el = new HashSet<String>();
-			assertNotNull(root);
-
-			Queue<TreeNode> elements = new LinkedList<TreeNode>();
-
-			elements.add(root);
-
-			while (!elements.isEmpty()) {
-				TreeNode node = elements.peek();
-				elements.remove();
-				el.add(((ChebiTreeRow) node.getData()).getName());
-				for (TreeNode child : node.getChildren()) {
-					elements.add(child);
-				}
-			}
-
-			assertTrue(el.size() > 3);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAnnotationsInConversionForChebiTree() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/graph_path_example3.xml", false);
-			model.setTileSize(256);
-			SpeciesAlias alias = (SpeciesAlias) model.getAliasByAliasId("sa4");
-			assertNotNull(alias);
-			FullAliasView result = fullAliasViewFactory.create(alias);
-			assertNotNull(result.getOther("chebiTree"));
-
-			alias = (SpeciesAlias) model.getAliasByAliasId("sa3");
-			result = fullAliasViewFactory.create(alias);
-			assertNull(result.getOther("chebiTree"));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.search.data;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.awt.geom.Point2D;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Queue;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.primefaces.model.TreeNode;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.annotation.data.Chebi;
+import lcsb.mapviewer.annotation.services.annotators.ChebiAnnotator;
+import lcsb.mapviewer.model.graphics.PolylineData;
+import lcsb.mapviewer.model.map.MiriamData;
+import lcsb.mapviewer.model.map.MiriamRelationType;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.agregator.Compartment;
+import lcsb.mapviewer.model.map.layout.Layout;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+import lcsb.mapviewer.model.map.reaction.Product;
+import lcsb.mapviewer.model.map.reaction.Reactant;
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.model.map.species.Species;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.overlay.ChebiTreeRow;
+
+public class FullAliasViewFactoryTest extends ServiceTestFunctions {
+	Logger									 logger	= Logger.getLogger(FullAliasViewFactoryTest.class);
+
+	@Autowired
+	FullAliasViewFactory		 fullAliasViewFactory;
+
+	@Autowired
+	private ChebiAnnotator	 backend;
+	private SpeciesAlias		 alias;
+	private SpeciesAlias		 alias2;
+	private Point2D					 midPoint;
+	private Reaction				 reaction;
+	private SpeciesAlias		 alias3;
+
+	private Model						 model;
+
+	private CompartmentAlias compartmentAlias;
+
+	private Compartment			 compartment;
+
+	@Before
+	public void setUp() throws Exception {
+
+		model = new ModelFullIndexed(null);
+		model.setWidth(20010);
+		model.setHeight(20010);
+		model.setTileSize(256);
+		model.setZoomLevels(7);
+		model.addLayout(new Layout());
+		model.getModelData().setId(-12);
+
+		GenericProtein species = new GenericProtein();
+		species.setElementId("A");
+		species.setName("blablabla");
+		species.setNotes("nottttttes");
+		alias = new GenericProteinAlias(species);
+		alias.setAliasId("AL1");
+		alias.setX(10.0);
+		alias.setY(12.0);
+		species.getMiriamData().add(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.WIKIPEDIA, "144352"));
+		species.getMiriamData().add(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.PUBMED, "43345"));
+
+		model.addAlias(alias);
+		model.addElement(species);
+
+		GenericProtein species2 = new GenericProtein();
+		species2.setName("blablabla2");
+		species2.setElementId("B");
+		alias2 = new GenericProteinAlias(species2);
+		alias2.setAliasId("AL2");
+		alias2.setX(100.0);
+		alias2.setY(120.0);
+
+		model.addAlias(alias2);
+		model.addElement(species2);
+
+		midPoint = new Point2D.Double(30, 100);
+
+		reaction = new Reaction();
+
+		Reactant reactant = new Reactant(alias, species);
+		reactant.setLine(new PolylineData(alias.getCenter(), midPoint));
+		reaction.addReactant(reactant);
+
+		Product product = new Product(alias2, species2);
+		product.setLine(new PolylineData(alias2.getCenter(), midPoint));
+		reaction.addProduct(product);
+
+		model.addReaction(reaction);
+
+		GenericProtein species3 = new GenericProtein();
+		species3.setElementId("C");
+		species3.setName("blablabla3");
+		alias3 = new GenericProteinAlias(species3);
+		alias3.setAliasId("AL3");
+		alias3.setX(200.0);
+		alias3.setY(120.0);
+
+		model.addAlias(alias3);
+		model.addElement(species3);
+
+		reaction = new NegativeInfluenceReaction(reaction);
+		reaction.getMiriamData().add(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.CAS, "cc"));
+
+		model.addReaction(reaction);
+
+		compartmentAlias = new CompartmentAlias();
+		compartmentAlias.setAliasId("AL4");
+		compartment = new Compartment();
+		compartment.setElementId("C4");
+		compartmentAlias.setX(10);
+		compartmentAlias.setY(10);
+		compartmentAlias.setWidth(10);
+		compartmentAlias.setHeight(10);
+		compartmentAlias.setCompartment(compartment);
+		model.addCompartment(compartment);
+		model.addAlias(compartmentAlias);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCreateGson() {
+		try {
+			GenericProtein protein = new GenericProtein();
+			protein.setName("12");
+			Alias alias = new GenericProteinAlias(protein);
+			alias.setModel(new ModelFullIndexed(null));
+			FullAliasView object = fullAliasViewFactory.create(alias);
+			String gson = fullAliasViewFactory.createGson(object);
+			assertNotNull(gson);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAliasOverlay() throws Exception {
+		try {
+			FullAliasView result = fullAliasViewFactory.create(alias);
+			assertNotNull(result);
+			assertEquals(model.getId(), result.getModelId());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAliasOverlay2() throws Exception {
+		try {
+			FullAliasView result = fullAliasViewFactory.create(alias2);
+			assertNotNull(result);
+			assertEquals(model.getId(), result.getModelId());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetNotes() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/protein_with_modification.xml", true);
+			model.setTileSize(256);
+			SpeciesAlias alias = (SpeciesAlias) model.getAliasByAliasId("sa1");
+			FullAliasView marker = fullAliasViewFactory.create(alias);
+			List<?> list = (List<?>) marker.getOther("posttranslationalModifications");
+			assertNotNull(list);
+			assertEquals(2, list.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCreateChebiTree() throws Exception {
+		try {
+			Chebi chebi = backend.getChebiElementForChebiId(new MiriamData(MiriamType.CHEBI, "CHEBI:15377"));
+
+			TreeNode root = fullAliasViewFactory.createTreeForChebi(chebi);
+
+			Set<String> el = new HashSet<String>();
+			assertNotNull(root);
+
+			Queue<TreeNode> elements = new LinkedList<TreeNode>();
+
+			elements.add(root);
+
+			while (!elements.isEmpty()) {
+				TreeNode node = elements.peek();
+				elements.remove();
+				el.add(((ChebiTreeRow) node.getData()).getName());
+				for (TreeNode child : node.getChildren()) {
+					elements.add(child);
+				}
+			}
+
+			assertTrue(el.size() > 3);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAnnotationsInConversionForChebiTree() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/graph_path_example3.xml", false);
+			model.setTileSize(256);
+			SpeciesAlias alias = (SpeciesAlias) model.getAliasByAliasId("sa4");
+			assertNotNull(alias);
+			FullAliasView result = fullAliasViewFactory.create(alias);
+			assertNotNull(result.getOther("chebiTree"));
+
+			alias = (SpeciesAlias) model.getAliasByAliasId("sa3");
+			result = fullAliasViewFactory.create(alias);
+			assertNull(result.getOther("chebiTree"));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/search/data/LightAliasViewFactoryTest.java b/service/src/test/java/lcsb/mapviewer/services/search/data/LightAliasViewFactoryTest.java
index 32def5e766..d9dfbe4f4a 100644
--- a/service/src/test/java/lcsb/mapviewer/services/search/data/LightAliasViewFactoryTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/search/data/LightAliasViewFactoryTest.java
@@ -1,43 +1,42 @@
-package lcsb.mapviewer.services.search.data;
-
-import static org.junit.Assert.assertNotNull;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-import lcsb.mapviewer.services.search.data.LightAliasView;
-import lcsb.mapviewer.services.search.data.LightAliasViewFactory;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class LightAliasViewFactoryTest {
-	Logger logger = Logger.getLogger(LightAliasViewFactoryTest.class);
-	
-	LightAliasViewFactory lightAliasViewFactory = new LightAliasViewFactory();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCreateGson() throws Exception {
-		try {
-			Alias alias = new SpeciesAlias();
-			alias.setModel(new ModelFullIndexed(null));
-			LightAliasView object = lightAliasViewFactory.create(alias);
-			String gson = lightAliasViewFactory.createGson(object);
-			assertNotNull(gson);
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.search.data;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class LightAliasViewFactoryTest {
+	Logger								logger								= Logger.getLogger(LightAliasViewFactoryTest.class);
+
+	LightAliasViewFactory	lightAliasViewFactory	= new LightAliasViewFactory();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCreateGson() throws Exception {
+		try {
+			Alias alias = new GenericProteinAlias(null, null);
+			alias.setModel(new ModelFullIndexed(null));
+			LightAliasView object = lightAliasViewFactory.create(alias);
+			String gson = lightAliasViewFactory.createGson(object);
+			assertNotNull(gson);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/search/db/drug/DrugServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/search/db/drug/DrugServiceTest.java
index fa84460d0d..6c1aecbfa2 100644
--- a/service/src/test/java/lcsb/mapviewer/services/search/db/drug/DrugServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/search/db/drug/DrugServiceTest.java
@@ -1,326 +1,327 @@
-package lcsb.mapviewer.services.search.db.drug;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import lcsb.mapviewer.annotation.data.Drug;
-import lcsb.mapviewer.annotation.services.TaxonomyBackend;
-import lcsb.mapviewer.converter.ComplexZipConverter;
-import lcsb.mapviewer.converter.ComplexZipConverterParams;
-import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
-import lcsb.mapviewer.converter.zip.ModelZipEntryFile;
-import lcsb.mapviewer.converter.zip.ZipEntryFile;
-import lcsb.mapviewer.model.Project;
-import lcsb.mapviewer.model.map.Element;
-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.ModelFullIndexed;
-import lcsb.mapviewer.model.map.model.SubmodelType;
-import lcsb.mapviewer.model.map.species.Protein;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.search.db.TargetView;
-import lcsb.mapviewer.services.search.db.DbSearchCriteria;
-import lcsb.mapviewer.services.search.db.GeneRow;
-import lcsb.mapviewer.services.search.db.drug.DrugView;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class DrugServiceTest extends ServiceTestFunctions {
-	Logger logger = Logger.getLogger(DrugServiceTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testGetEmpty() throws Exception {
-		try {
-			DrugView drug = drugService.getByName("blablablabla", new DbSearchCriteria());
-			assertNull(drug);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetTargets() throws Exception {
-		try {
-			long count = searchHistoryDao.getCount();
-			Model model = new ModelFullIndexed(null);
-			Project project = new Project();
-			project.setProjectId("TesT");
-			project.addModel(model);
-			DrugView drug = drugService.getByName("Diazoxide", new DbSearchCriteria().model(model).ipAddress("ip"));
-			assertNotNull(drug);
-			assertNotNull(drug.getName());
-			assertFalse(drug.getName().trim().equals(""));
-			assertNotNull(drug.getDescription());
-			assertFalse(drug.getDescription().trim().equals(""));
-
-			String hgnc1 = "SLC12A3";
-			String hgnc2 = "KCNJ8";
-
-			boolean hgnc1Exists = false;
-			boolean hgnc2Exists = false;
-
-			for (TargetView target : drug.getTargetRows()) {
-				for (GeneRow row : target.getProteins()) {
-					if (row.getAnnotation().getName().equalsIgnoreCase(hgnc1))
-						hgnc1Exists = true;
-					if (row.getAnnotation().getName().equalsIgnoreCase(hgnc2))
-						hgnc2Exists = true;
-				}
-			}
-
-			assertTrue("Target " + hgnc1 + " doesn't exist in target list but should", hgnc1Exists);
-			assertTrue("Target " + hgnc2 + " doesn't exist in target list but should", hgnc2Exists);
-
-			long count2 = searchHistoryDao.getCount();
-
-			assertEquals(count + 1, count2);
-
-			assertEquals("YES", drug.getBloodBrainBarrier());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetTargetsBySynonym() throws Exception {
-		try {
-			// search by synonym
-			DrugView drug = drugService.getByName("Amantidine", new DbSearchCriteria().ipAddress("ip"));
-			// search by name
-			DrugView drug2 = drugService.getByName("Amantadine", new DbSearchCriteria().ipAddress("ip"));
-			assertNotNull(drug);
-			assertNotNull(drug.getName());
-			assertFalse(drug.getName().trim().equals(""));
-			assertNotNull(drug.getDescription());
-			assertFalse(drug.getDescription().trim().equals(""));
-
-			// number of targets should be the same
-			assertEquals(drug.getTargetRows().size(), drug2.getTargetRows().size());
-			assertTrue(drug.getTargetRows().size() > 0);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testFindDrugSelegiline() throws Exception {
-		try {
-			DrugView test = drugService.getByName("Selegiline", new DbSearchCriteria().ipAddress("ip").organisms(TaxonomyBackend.HUMAN_TAXONOMY));
-			assertNotNull(test);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testDornaseAplha() throws Exception {
-		try {
-			DrugView drug = drugService.getByName("Dornase alpha", new DbSearchCriteria());
-			assertNotNull(drug.getName());
-			assertEquals("N/A", drug.getBloodBrainBarrier());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testRapamycin() throws Exception {
-		try {
-			DrugView drug = drugService.getByName("Rapamycin", new DbSearchCriteria());
-			assertNotNull(drug.getName());
-			assertEquals("NO", drug.getBloodBrainBarrier());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testSearchByElements() throws Exception {
-		try {
-			List<Element> elements = new ArrayList<Element>();
-			List<DrugView> drugs = drugService.getForTargets(elements, new DbSearchCriteria());
-			assertNotNull(drugs);
-			assertEquals(0, drugs.size());
-
-			Protein protein = new Protein();
-			protein.setName("DRD2");
-			protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "DRD2"));
-			elements.add(protein);
-
-			drugs = drugService.getForTargets(elements, new DbSearchCriteria());
-			assertNotNull(drugs);
-			assertTrue(drugs.size() > 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-
-	@Test
-	public void testSearchByElements2() throws Exception {
-		try {
-			List<Element> elements = new ArrayList<Element>();
-			Protein protein = new Protein();
-			protein.setName("DRD2");
-			protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "DRD2"));
-			elements.add(protein);
-			List<DrugView> drugs = drugService.getForTargets(elements, new DbSearchCriteria().organisms(TaxonomyBackend.HUMAN_TAXONOMY));
-
-			assertNotNull(drugs);
-			assertTrue(drugs.size() > 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testSearchByElements3() throws Exception {
-		try {
-			List<Element> elements = new ArrayList<Element>();
-			Protein protein = new Protein();
-			protein.setName("GLUD1");
-			protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "GLUD1"));
-			protein.addMiriamData(new MiriamData(MiriamType.ENTREZ, "2746"));
-			elements.add(protein);
-			List<DrugView> drugs = drugService.getForTargets(elements, new DbSearchCriteria());
-
-			assertNotNull(drugs);
-			assertTrue(drugs.size() > 0);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-
-	}
-
-	@Test
-	public void testObjectToDrugTargetList() throws Exception {
-		try {
-			DrugView drug = drugService.getByName("AMANTADINE", new DbSearchCriteria());
-			Drug drug2 = drugBankHTMLParser.findDrug("AMANTADINE");
-
-			assertTrue(drug2.getTargets().size() <= drug.getTargetRows().size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAspirinToDrugTargetList() throws Exception {
-		try {
-			DrugView drug = drugService.getByName("Aspirin", new DbSearchCriteria());
-			Drug drug2 = drugBankHTMLParser.findDrug("Aspirin");
-
-			assertTrue(drug2.getTargets().size() <= drug.getTargetRows().size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testIbuprofenMultiDbTargets() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/drug_target_2_db.xml", true);
-			DrugView drug = drugService.getByName("Ibuprofen", new DbSearchCriteria().model(model));
-			Set<String> icons = new HashSet<String>();
-			for (TargetView row : drug.getTargetRows()) {
-				if (row.getSelectable()) {
-					assertFalse("More than one target has icon: " + row.getIcon(), icons.contains(row.getIcon()));
-					icons.add(row.getIcon());
-				}
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testGetDrugByDrugNameInComplex() throws Exception {
-		try {
-			ComplexZipConverter<CellDesignerXmlParser> parser = new ComplexZipConverter<CellDesignerXmlParser>(CellDesignerXmlParser.class);
-			ComplexZipConverterParams complexParams = new ComplexZipConverterParams().zipFile("testFiles/complexModel/complex_drug_target_model.zip");
-			ZipEntryFile entry1 = new ModelZipEntryFile("main.xml", "main", true, false, SubmodelType.UNKNOWN);
-			ZipEntryFile entry2 = new ModelZipEntryFile("s1.xml", "s1", false, false, SubmodelType.UNKNOWN);
-			ZipEntryFile entry3 = new ModelZipEntryFile("s2.xml", "s2", false, false, SubmodelType.UNKNOWN);
-			ZipEntryFile entry4 = new ModelZipEntryFile("s3.xml", "s3", false, false, SubmodelType.UNKNOWN);
-			ZipEntryFile entry5 = new ModelZipEntryFile("mapping.xml", "mapping", false, true, SubmodelType.UNKNOWN);
-			complexParams.entry(entry1);
-			complexParams.entry(entry2);
-			complexParams.entry(entry3);
-			complexParams.entry(entry4);
-			complexParams.entry(entry5);
-			Model model = parser.createModel(complexParams);
-
-			DrugView drug = drugService.getByName("Aspirin", new DbSearchCriteria().model(model));
-			Set<String> icons = new HashSet<String>();
-
-			for (TargetView row : drug.getTargetRows()) {
-				if (row.getSelectable()) {
-					icons.add(row.getIcon());
-				}
-			}
-			assertTrue("At least 2 targets should be selected", icons.size() >= 2);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testAspirinSynonyms() throws Exception {
-		try {
-			DrugView drug = drugService.getByName("Aspirin", new DbSearchCriteria());
-
-			Set<String> synonyms = new HashSet<String>();
-			for (String string : drug.getSynonyms()) {
-				assertFalse("Duplicate entry in drug synonym: " + string, synonyms.contains(string));
-				synonyms.add(string);
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.search.db.drug;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import lcsb.mapviewer.annotation.data.Drug;
+import lcsb.mapviewer.annotation.services.TaxonomyBackend;
+import lcsb.mapviewer.converter.ComplexZipConverter;
+import lcsb.mapviewer.converter.ComplexZipConverterParams;
+import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
+import lcsb.mapviewer.converter.zip.ModelZipEntryFile;
+import lcsb.mapviewer.converter.zip.ZipEntryFile;
+import lcsb.mapviewer.model.Project;
+import lcsb.mapviewer.model.map.Element;
+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.ModelFullIndexed;
+import lcsb.mapviewer.model.map.model.SubmodelType;
+import lcsb.mapviewer.model.map.species.GenericProtein;
+import lcsb.mapviewer.model.map.species.Protein;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.search.db.TargetView;
+import lcsb.mapviewer.services.search.db.DbSearchCriteria;
+import lcsb.mapviewer.services.search.db.GeneRow;
+import lcsb.mapviewer.services.search.db.drug.DrugView;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class DrugServiceTest extends ServiceTestFunctions {
+	Logger logger = Logger.getLogger(DrugServiceTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testGetEmpty() throws Exception {
+		try {
+			DrugView drug = drugService.getByName("blablablabla", new DbSearchCriteria());
+			assertNull(drug);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetTargets() throws Exception {
+		try {
+			long count = searchHistoryDao.getCount();
+			Model model = new ModelFullIndexed(null);
+			Project project = new Project();
+			project.setProjectId("TesT");
+			project.addModel(model);
+			DrugView drug = drugService.getByName("Diazoxide", new DbSearchCriteria().model(model).ipAddress("ip"));
+			assertNotNull(drug);
+			assertNotNull(drug.getName());
+			assertFalse(drug.getName().trim().equals(""));
+			assertNotNull(drug.getDescription());
+			assertFalse(drug.getDescription().trim().equals(""));
+
+			String hgnc1 = "SLC12A3";
+			String hgnc2 = "KCNJ8";
+
+			boolean hgnc1Exists = false;
+			boolean hgnc2Exists = false;
+
+			for (TargetView target : drug.getTargetRows()) {
+				for (GeneRow row : target.getProteins()) {
+					if (row.getAnnotation().getName().equalsIgnoreCase(hgnc1))
+						hgnc1Exists = true;
+					if (row.getAnnotation().getName().equalsIgnoreCase(hgnc2))
+						hgnc2Exists = true;
+				}
+			}
+
+			assertTrue("Target " + hgnc1 + " doesn't exist in target list but should", hgnc1Exists);
+			assertTrue("Target " + hgnc2 + " doesn't exist in target list but should", hgnc2Exists);
+
+			long count2 = searchHistoryDao.getCount();
+
+			assertEquals(count + 1, count2);
+
+			assertEquals("YES", drug.getBloodBrainBarrier());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetTargetsBySynonym() throws Exception {
+		try {
+			// search by synonym
+			DrugView drug = drugService.getByName("Amantidine", new DbSearchCriteria().ipAddress("ip"));
+			// search by name
+			DrugView drug2 = drugService.getByName("Amantadine", new DbSearchCriteria().ipAddress("ip"));
+			assertNotNull(drug);
+			assertNotNull(drug.getName());
+			assertFalse(drug.getName().trim().equals(""));
+			assertNotNull(drug.getDescription());
+			assertFalse(drug.getDescription().trim().equals(""));
+
+			// number of targets should be the same
+			assertEquals(drug.getTargetRows().size(), drug2.getTargetRows().size());
+			assertTrue(drug.getTargetRows().size() > 0);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testFindDrugSelegiline() throws Exception {
+		try {
+			DrugView test = drugService.getByName("Selegiline", new DbSearchCriteria().ipAddress("ip").organisms(TaxonomyBackend.HUMAN_TAXONOMY));
+			assertNotNull(test);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testDornaseAplha() throws Exception {
+		try {
+			DrugView drug = drugService.getByName("Dornase alpha", new DbSearchCriteria());
+			assertNotNull(drug.getName());
+			assertEquals("N/A", drug.getBloodBrainBarrier());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testRapamycin() throws Exception {
+		try {
+			DrugView drug = drugService.getByName("Rapamycin", new DbSearchCriteria());
+			assertNotNull(drug.getName());
+			assertEquals("NO", drug.getBloodBrainBarrier());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testSearchByElements() throws Exception {
+		try {
+			List<Element> elements = new ArrayList<Element>();
+			List<DrugView> drugs = drugService.getForTargets(elements, new DbSearchCriteria());
+			assertNotNull(drugs);
+			assertEquals(0, drugs.size());
+
+			Protein protein = new GenericProtein();
+			protein.setName("DRD2");
+			protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "DRD2"));
+			elements.add(protein);
+
+			drugs = drugService.getForTargets(elements, new DbSearchCriteria());
+			assertNotNull(drugs);
+			assertTrue(drugs.size() > 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+
+	@Test
+	public void testSearchByElements2() throws Exception {
+		try {
+			List<Element> elements = new ArrayList<Element>();
+			Protein protein = new GenericProtein();
+			protein.setName("DRD2");
+			protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "DRD2"));
+			elements.add(protein);
+			List<DrugView> drugs = drugService.getForTargets(elements, new DbSearchCriteria().organisms(TaxonomyBackend.HUMAN_TAXONOMY));
+
+			assertNotNull(drugs);
+			assertTrue(drugs.size() > 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testSearchByElements3() throws Exception {
+		try {
+			List<Element> elements = new ArrayList<Element>();
+			Protein protein = new GenericProtein();
+			protein.setName("GLUD1");
+			protein.addMiriamData(new MiriamData(MiriamType.HGNC_SYMBOL, "GLUD1"));
+			protein.addMiriamData(new MiriamData(MiriamType.ENTREZ, "2746"));
+			elements.add(protein);
+			List<DrugView> drugs = drugService.getForTargets(elements, new DbSearchCriteria());
+
+			assertNotNull(drugs);
+			assertTrue(drugs.size() > 0);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+
+	}
+
+	@Test
+	public void testObjectToDrugTargetList() throws Exception {
+		try {
+			DrugView drug = drugService.getByName("AMANTADINE", new DbSearchCriteria());
+			Drug drug2 = drugBankHTMLParser.findDrug("AMANTADINE");
+
+			assertTrue(drug2.getTargets().size() <= drug.getTargetRows().size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAspirinToDrugTargetList() throws Exception {
+		try {
+			DrugView drug = drugService.getByName("Aspirin", new DbSearchCriteria());
+			Drug drug2 = drugBankHTMLParser.findDrug("Aspirin");
+
+			assertTrue(drug2.getTargets().size() <= drug.getTargetRows().size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testIbuprofenMultiDbTargets() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/drug_target_2_db.xml", true);
+			DrugView drug = drugService.getByName("Ibuprofen", new DbSearchCriteria().model(model));
+			Set<String> icons = new HashSet<String>();
+			for (TargetView row : drug.getTargetRows()) {
+				if (row.getSelectable()) {
+					assertFalse("More than one target has icon: " + row.getIcon(), icons.contains(row.getIcon()));
+					icons.add(row.getIcon());
+				}
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testGetDrugByDrugNameInComplex() throws Exception {
+		try {
+			ComplexZipConverter<CellDesignerXmlParser> parser = new ComplexZipConverter<CellDesignerXmlParser>(CellDesignerXmlParser.class);
+			ComplexZipConverterParams complexParams = new ComplexZipConverterParams().zipFile("testFiles/complexModel/complex_drug_target_model.zip");
+			ZipEntryFile entry1 = new ModelZipEntryFile("main.xml", "main", true, false, SubmodelType.UNKNOWN);
+			ZipEntryFile entry2 = new ModelZipEntryFile("s1.xml", "s1", false, false, SubmodelType.UNKNOWN);
+			ZipEntryFile entry3 = new ModelZipEntryFile("s2.xml", "s2", false, false, SubmodelType.UNKNOWN);
+			ZipEntryFile entry4 = new ModelZipEntryFile("s3.xml", "s3", false, false, SubmodelType.UNKNOWN);
+			ZipEntryFile entry5 = new ModelZipEntryFile("mapping.xml", "mapping", false, true, SubmodelType.UNKNOWN);
+			complexParams.entry(entry1);
+			complexParams.entry(entry2);
+			complexParams.entry(entry3);
+			complexParams.entry(entry4);
+			complexParams.entry(entry5);
+			Model model = parser.createModel(complexParams);
+
+			DrugView drug = drugService.getByName("Aspirin", new DbSearchCriteria().model(model));
+			Set<String> icons = new HashSet<String>();
+
+			for (TargetView row : drug.getTargetRows()) {
+				if (row.getSelectable()) {
+					icons.add(row.getIcon());
+				}
+			}
+			assertTrue("At least 2 targets should be selected", icons.size() >= 2);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testAspirinSynonyms() throws Exception {
+		try {
+			DrugView drug = drugService.getByName("Aspirin", new DbSearchCriteria());
+
+			Set<String> synonyms = new HashSet<String>();
+			for (String string : drug.getSynonyms()) {
+				assertFalse("Duplicate entry in drug synonym: " + string, synonyms.contains(string));
+				synonyms.add(string);
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/search/layout/FullLayoutAliasViewFactoryTest.java b/service/src/test/java/lcsb/mapviewer/services/search/layout/FullLayoutAliasViewFactoryTest.java
index 3559b8ca83..51f17218f3 100644
--- a/service/src/test/java/lcsb/mapviewer/services/search/layout/FullLayoutAliasViewFactoryTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/search/layout/FullLayoutAliasViewFactoryTest.java
@@ -1,52 +1,52 @@
-package lcsb.mapviewer.services.search.layout;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.awt.Color;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.GenericColorSchema;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-public class FullLayoutAliasViewFactoryTest {
-
-	FullLayoutAliasViewFactory factory = new FullLayoutAliasViewFactory();
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCreateGson() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Alias alias = new SpeciesAlias();
-			alias.setModel(model);
-			ColorSchema colorSchema = new GenericColorSchema();
-			colorSchema.setColor(Color.BLACK);
-			FullLayoutAliasView object = factory.create(new Pair<Alias, ColorSchema>(alias, colorSchema));
-			assertNotNull(factory.createGson(object));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.search.layout;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.awt.Color;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.GenericColorSchema;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class FullLayoutAliasViewFactoryTest {
+
+	FullLayoutAliasViewFactory factory = new FullLayoutAliasViewFactory();
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCreateGson() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Alias alias = new GenericProteinAlias(null, null);
+			alias.setModel(model);
+			ColorSchema colorSchema = new GenericColorSchema();
+			colorSchema.setColor(Color.BLACK);
+			FullLayoutAliasView object = factory.create(new Pair<Alias, ColorSchema>(alias, colorSchema));
+			assertNotNull(factory.createGson(object));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/search/layout/LightLayoutAliasViewFactoryTest.java b/service/src/test/java/lcsb/mapviewer/services/search/layout/LightLayoutAliasViewFactoryTest.java
index 3b0d791ca7..8d27aff2e1 100644
--- a/service/src/test/java/lcsb/mapviewer/services/search/layout/LightLayoutAliasViewFactoryTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/search/layout/LightLayoutAliasViewFactoryTest.java
@@ -1,46 +1,47 @@
-package lcsb.mapviewer.services.search.layout;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.awt.Color;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.GenericColorSchema;
-import lcsb.mapviewer.model.map.layout.alias.Alias;
-import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.model.map.model.ModelFullIndexed;
-
-public class LightLayoutAliasViewFactoryTest {
-	LightLayoutAliasViewFactory factory = new LightLayoutAliasViewFactory();
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCreateGson() throws Exception {
-		try {
-			Model model = new ModelFullIndexed(null);
-			Alias alias = new SpeciesAlias();
-			alias.setModel(model);
-			ColorSchema colorSchema = new GenericColorSchema();
-			colorSchema.setColor(Color.BLACK);
-			LightLayoutAliasView object = factory.create(new Pair<Alias, ColorSchema>(alias, colorSchema));
-			assertNotNull(factory.createGson(object));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.search.layout;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.awt.Color;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.GenericColorSchema;
+import lcsb.mapviewer.model.map.layout.alias.Alias;
+import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
+import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.model.map.model.ModelFullIndexed;
+
+public class LightLayoutAliasViewFactoryTest {
+	LightLayoutAliasViewFactory factory = new LightLayoutAliasViewFactory();
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCreateGson() throws Exception {
+		try {
+			Model model = new ModelFullIndexed(null);
+			Alias alias = new GenericProteinAlias(null, null);
+			alias.setModel(model);
+			ColorSchema colorSchema = new GenericColorSchema();
+			colorSchema.setColor(Color.BLACK);
+			LightLayoutAliasView object = factory.create(new Pair<Alias, ColorSchema>(alias, colorSchema));
+			assertNotNull(factory.createGson(object));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/utils/AllUtilsTests.java b/service/src/test/java/lcsb/mapviewer/services/utils/AllUtilsTests.java
index 09c95a4979..1a708ccb6d 100644
--- a/service/src/test/java/lcsb/mapviewer/services/utils/AllUtilsTests.java
+++ b/service/src/test/java/lcsb/mapviewer/services/utils/AllUtilsTests.java
@@ -1,20 +1,20 @@
-package lcsb.mapviewer.services.utils;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-import lcsb.mapviewer.services.utils.gmap.AllGmapUtilsTests;
-import lcsb.mapviewer.services.utils.graph.AllGraphTests;
-
-@RunWith(Suite.class)
-@SuiteClasses({ AllGmapUtilsTests.class, //
-		AllGraphTests.class, //
-		ColorSchemaReaderTest.class, //
-		ColorSchemaReaderXlsTest.class, //
-		ColorSchemaReaderXlsxTest.class, //
-		EmailSenderTest.class,//
-})
-public class AllUtilsTests {
-
-}
+package lcsb.mapviewer.services.utils;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import lcsb.mapviewer.services.utils.gmap.AllGmapUtilsTests;
+import lcsb.mapviewer.services.utils.graph.AllGraphTests;
+
+@RunWith(Suite.class)
+@SuiteClasses({ AllGmapUtilsTests.class, //
+		AllGraphTests.class, //
+		ColorSchemaReaderTest.class, //
+		ColorSchemaReaderXlsTest.class, //
+		ColorSchemaReaderXlsxTest.class, //
+		EmailSenderTest.class,//
+})
+public class AllUtilsTests {
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderTest.java b/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderTest.java
index 90648ac7d6..748a836fa7 100644
--- a/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderTest.java
@@ -1,246 +1,246 @@
-package lcsb.mapviewer.services.utils;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-import java.awt.Color;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Collection;
-
-import org.apache.commons.io.output.ByteArrayOutputStream;
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.commands.ColorModelCommand;
-import lcsb.mapviewer.common.Pair;
-import lcsb.mapviewer.common.TextFileUtils;
-import lcsb.mapviewer.model.map.MiriamType;
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
-import lcsb.mapviewer.model.map.model.Model;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-
-public class ColorSchemaReaderTest extends ServiceTestFunctions {
-	Logger logger = Logger.getLogger(ColorSchemaReaderTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testReadSchema() throws Exception {
-		try {
-			ColorSchemaReader reader = new ColorSchemaReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/enricoData/ageing.txt");
-
-			assertNotNull(schemas);
-			assertEquals(412, schemas.size());
-
-			schemas = reader.readColorSchema("testFiles/enricoData/ge001.txt");
-
-			assertNotNull(schemas);
-			assertEquals(3057, schemas.size());
-
-			schemas = reader.readColorSchema("testFiles/enricoData/ge005.txt");
-
-			assertNotNull(schemas);
-			assertEquals(4338, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadGeneVariantsSchema() throws Exception {
-		try {
-			File f = new File("testFiles/coloring/gene_variants.txt");
-      InputStream in = new FileInputStream(f);
-
-      byte[] buff = new byte[8000];
-
-      int bytesRead = 0;
-
-      ByteArrayOutputStream bao = new ByteArrayOutputStream();
-
-      while((bytesRead = in.read(buff)) != -1) {
-         bao.write(buff, 0, bytesRead);
-      }
-      in.close();
-      bao.close();
-
-      byte[] data = bao.toByteArray();
-
-      ByteArrayInputStream bin = new ByteArrayInputStream(data);
-
-			ColorSchemaReader reader = new ColorSchemaReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema(bin,TextFileUtils.getHeaderParametersFromFile(new ByteArrayInputStream(data)));
-			assertNotNull(schemas);
-			assertEquals(3, schemas.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadInvalidGeneVariantsSchema() throws Exception {
-		try {
-			ColorSchemaReader reader = new ColorSchemaReader();
-
-			reader.readColorSchema("testFiles/coloring/gene_variants_invalid_genome.txt");
-			fail("Exception expected");
-		} catch (InvalidColorSchemaException e) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadSchema2() throws Exception {
-		try {
-			ColorSchemaReader reader = new ColorSchemaReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/goodSchema.txt");
-
-			assertNotNull(schemas);
-			assertEquals(3, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadSchema3() throws Exception {
-		try {
-			try {
-				ColorSchemaReader reader = new ColorSchemaReader();
-				reader.readColorSchema("testFiles/coloring/wrongSchema.txt");
-				fail("Excepion expected");
-			} catch (InvalidColorSchemaException e) {
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicStephanSchema3() throws Exception {
-		try {
-			ColorSchemaReader reader = new ColorSchemaReader();
-			reader.readColorSchema("testFiles/coloring/problematicSchema.txt");
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadReactionSchema() throws Exception {
-		try {
-			ColorSchemaReader reader = new ColorSchemaReader();
-			Collection<ColorSchema> collection = reader.readColorSchema("testFiles/coloring/reactionSchema.txt");
-			assertEquals(1, collection.size());
-			ColorSchema schema = collection.iterator().next();
-			assertEquals("re1", schema.getReactionIdentifier());
-			assertEquals(3.0, schema.getLineWidth(), EPSILON);
-			assertEquals(Color.RED, schema.getColor());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test(timeout = 15000)
-	public void testNextVersionReadSchema() throws Exception {
-		try {
-			ColorSchemaReader reader = new ColorSchemaReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/goodLayout.v=1.0.txt");
-
-			assertNotNull(schemas);
-			assertEquals(3, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testColoring3() throws Exception {
-		try {
-			Model model = getModelForFile("testFiles/coloring/protein_to_color.xml", false);
-
-			ColorSchemaReader reader = new ColorSchemaReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/problematicSchema.txt");
-			ColorModelCommand factory = new ColorModelCommand(model, schemas);
-			factory.execute();
-
-			assertFalse(model.getAliasesBySpeciesId("s1").get(0).getColor().equals(Color.WHITE));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSchemasWithId() throws Exception {
-		try {
-			ColorSchemaReader reader = new ColorSchemaReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/schemaWithIdentifiers.txt");
-			for (ColorSchema colorSchema : schemas) {
-				for (Pair<MiriamType,String> pair: colorSchema.getIdentifierColumns()) {
-					assertNotNull(pair.getRight());
-					assertFalse(pair.getRight().isEmpty());
-				}
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testSchemasWithEmptyNameAndId() throws Exception {
-		try {
-			ColorSchemaReader reader = new ColorSchemaReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/schemaIdWithoutName.txt");
-			for (ColorSchema colorSchema : schemas) {
-				for (Pair<MiriamType,String> pair: colorSchema.getIdentifierColumns()) {
-					assertFalse(pair.getRight().isEmpty());
-					assertNull(colorSchema.getName());
-				}
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+import java.awt.Color;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.Collection;
+
+import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.commands.ColorModelCommand;
+import lcsb.mapviewer.common.Pair;
+import lcsb.mapviewer.common.TextFileUtils;
+import lcsb.mapviewer.model.map.MiriamType;
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
+import lcsb.mapviewer.model.map.model.Model;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+
+public class ColorSchemaReaderTest extends ServiceTestFunctions {
+	Logger logger = Logger.getLogger(ColorSchemaReaderTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testReadSchema() throws Exception {
+		try {
+			ColorSchemaReader reader = new ColorSchemaReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/enricoData/ageing.txt");
+
+			assertNotNull(schemas);
+			assertEquals(412, schemas.size());
+
+			schemas = reader.readColorSchema("testFiles/enricoData/ge001.txt");
+
+			assertNotNull(schemas);
+			assertEquals(3057, schemas.size());
+
+			schemas = reader.readColorSchema("testFiles/enricoData/ge005.txt");
+
+			assertNotNull(schemas);
+			assertEquals(4338, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadGeneVariantsSchema() throws Exception {
+		try {
+			File f = new File("testFiles/coloring/gene_variants.txt");
+      InputStream in = new FileInputStream(f);
+
+      byte[] buff = new byte[8000];
+
+      int bytesRead = 0;
+
+      ByteArrayOutputStream bao = new ByteArrayOutputStream();
+
+      while((bytesRead = in.read(buff)) != -1) {
+         bao.write(buff, 0, bytesRead);
+      }
+      in.close();
+      bao.close();
+
+      byte[] data = bao.toByteArray();
+
+      ByteArrayInputStream bin = new ByteArrayInputStream(data);
+
+			ColorSchemaReader reader = new ColorSchemaReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema(bin,TextFileUtils.getHeaderParametersFromFile(new ByteArrayInputStream(data)));
+			assertNotNull(schemas);
+			assertEquals(3, schemas.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadInvalidGeneVariantsSchema() throws Exception {
+		try {
+			ColorSchemaReader reader = new ColorSchemaReader();
+
+			reader.readColorSchema("testFiles/coloring/gene_variants_invalid_genome.txt");
+			fail("Exception expected");
+		} catch (InvalidColorSchemaException e) {
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadSchema2() throws Exception {
+		try {
+			ColorSchemaReader reader = new ColorSchemaReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/goodSchema.txt");
+
+			assertNotNull(schemas);
+			assertEquals(3, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadSchema3() throws Exception {
+		try {
+			try {
+				ColorSchemaReader reader = new ColorSchemaReader();
+				reader.readColorSchema("testFiles/coloring/wrongSchema.txt");
+				fail("Excepion expected");
+			} catch (InvalidColorSchemaException e) {
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicStephanSchema3() throws Exception {
+		try {
+			ColorSchemaReader reader = new ColorSchemaReader();
+			reader.readColorSchema("testFiles/coloring/problematicSchema.txt");
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadReactionSchema() throws Exception {
+		try {
+			ColorSchemaReader reader = new ColorSchemaReader();
+			Collection<ColorSchema> collection = reader.readColorSchema("testFiles/coloring/reactionSchema.txt");
+			assertEquals(1, collection.size());
+			ColorSchema schema = collection.iterator().next();
+			assertEquals("re1", schema.getReactionIdentifier());
+			assertEquals(3.0, schema.getLineWidth(), EPSILON);
+			assertEquals(Color.RED, schema.getColor());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test(timeout = 15000)
+	public void testNextVersionReadSchema() throws Exception {
+		try {
+			ColorSchemaReader reader = new ColorSchemaReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/goodLayout.v=1.0.txt");
+
+			assertNotNull(schemas);
+			assertEquals(3, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testColoring3() throws Exception {
+		try {
+			Model model = getModelForFile("testFiles/coloring/protein_to_color.xml", false);
+
+			ColorSchemaReader reader = new ColorSchemaReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/problematicSchema.txt");
+			ColorModelCommand factory = new ColorModelCommand(model, schemas);
+			factory.execute();
+
+			assertFalse(model.getAliasesBySpeciesId("s1").get(0).getColor().equals(Color.WHITE));
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSchemasWithId() throws Exception {
+		try {
+			ColorSchemaReader reader = new ColorSchemaReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/schemaWithIdentifiers.txt");
+			for (ColorSchema colorSchema : schemas) {
+				for (Pair<MiriamType,String> pair: colorSchema.getIdentifierColumns()) {
+					assertNotNull(pair.getRight());
+					assertFalse(pair.getRight().isEmpty());
+				}
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testSchemasWithEmptyNameAndId() throws Exception {
+		try {
+			ColorSchemaReader reader = new ColorSchemaReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/schemaIdWithoutName.txt");
+			for (ColorSchema colorSchema : schemas) {
+				for (Pair<MiriamType,String> pair: colorSchema.getIdentifierColumns()) {
+					assertFalse(pair.getRight().isEmpty());
+					assertNull(colorSchema.getName());
+				}
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderXlsTest.java b/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderXlsTest.java
index 01b099e1fd..0c14891425 100644
--- a/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderXlsTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderXlsTest.java
@@ -1,135 +1,135 @@
-package lcsb.mapviewer.services.utils;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.awt.Color;
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.utils.ColorSchemaXlsxReader;
-
-public class ColorSchemaReaderXlsTest extends ServiceTestFunctions {
-	Logger	logger	= Logger.getLogger(ColorSchemaReaderXlsTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testReadSchema() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-
-			Collection<ColorSchema> schemas = null;
-			
-			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xls", "ageing" );
-
-			assertNotNull(schemas);
-			assertEquals(412, schemas.size());
-
-			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xls", "ge001");
-
-			assertNotNull(schemas);
-			assertEquals(3057, schemas.size());
-
-			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xls", "ge005");
-
-			assertNotNull(schemas);
-			assertEquals(4338, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadSchema2() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xls", "goodSchema");
-
-			assertNotNull(schemas);
-			assertEquals(3, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadSchema3() throws Exception {
-		try {
-			try {
-				ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-				reader.readColorSchema("testFiles/coloring/coloring.xls", "wrongSchema");
-				fail("Excepion expected");
-			} catch (InvalidColorSchemaException e) {
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicStephanSchema3() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xls", "problematicSchema");
-			assertNotNull(schemas);
-			assertEquals(329, schemas.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadReactionSchema() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-			Collection<ColorSchema> collection = reader.readColorSchema("testFiles/coloring/coloring.xls", "reactionSchema");
-			assertEquals(1, collection.size());
-			ColorSchema schema = collection.iterator().next();
-			assertEquals("re1", schema.getReactionIdentifier());
-			assertEquals(3.0, schema.getLineWidth(), EPSILON);
-			assertEquals(Color.RED, schema.getColor());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test(timeout=15000)
-	public void testNextVersionReadSchema() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xls", "goodLayout.v=1.0");
-
-			assertNotNull(schemas);
-			assertEquals(3, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.awt.Color;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.utils.ColorSchemaXlsxReader;
+
+public class ColorSchemaReaderXlsTest extends ServiceTestFunctions {
+	Logger	logger	= Logger.getLogger(ColorSchemaReaderXlsTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testReadSchema() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+
+			Collection<ColorSchema> schemas = null;
+			
+			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xls", "ageing" );
+
+			assertNotNull(schemas);
+			assertEquals(412, schemas.size());
+
+			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xls", "ge001");
+
+			assertNotNull(schemas);
+			assertEquals(3057, schemas.size());
+
+			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xls", "ge005");
+
+			assertNotNull(schemas);
+			assertEquals(4338, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadSchema2() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xls", "goodSchema");
+
+			assertNotNull(schemas);
+			assertEquals(3, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadSchema3() throws Exception {
+		try {
+			try {
+				ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+				reader.readColorSchema("testFiles/coloring/coloring.xls", "wrongSchema");
+				fail("Excepion expected");
+			} catch (InvalidColorSchemaException e) {
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicStephanSchema3() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xls", "problematicSchema");
+			assertNotNull(schemas);
+			assertEquals(329, schemas.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadReactionSchema() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+			Collection<ColorSchema> collection = reader.readColorSchema("testFiles/coloring/coloring.xls", "reactionSchema");
+			assertEquals(1, collection.size());
+			ColorSchema schema = collection.iterator().next();
+			assertEquals("re1", schema.getReactionIdentifier());
+			assertEquals(3.0, schema.getLineWidth(), EPSILON);
+			assertEquals(Color.RED, schema.getColor());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test(timeout=15000)
+	public void testNextVersionReadSchema() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xls", "goodLayout.v=1.0");
+
+			assertNotNull(schemas);
+			assertEquals(3, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderXlsxTest.java b/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderXlsxTest.java
index 08d076cf60..05bec4e138 100644
--- a/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderXlsxTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/utils/ColorSchemaReaderXlsxTest.java
@@ -1,135 +1,135 @@
-package lcsb.mapviewer.services.utils;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.awt.Color;
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import lcsb.mapviewer.model.map.layout.ColorSchema;
-import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-import lcsb.mapviewer.services.utils.ColorSchemaXlsxReader;
-
-public class ColorSchemaReaderXlsxTest extends ServiceTestFunctions {
-	Logger	logger	= Logger.getLogger(ColorSchemaReaderXlsxTest.class);
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testReadSchema() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-
-			Collection<ColorSchema> schemas = null;
-			
-			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xlsx", "ageing" );
-
-			assertNotNull(schemas);
-			assertEquals(412, schemas.size());
-
-			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xlsx", "ge001");
-
-			assertNotNull(schemas);
-			assertEquals(3057, schemas.size());
-
-			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xlsx", "ge005");
-
-			assertNotNull(schemas);
-			assertEquals(4338, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadSchema2() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xlsx", "goodSchema");
-
-			assertNotNull(schemas);
-			assertEquals(3, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadSchema3() throws Exception {
-		try {
-			try {
-				ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-				reader.readColorSchema("testFiles/coloring/coloring.xlsx", "wrongSchema");
-				fail("Excepion expected");
-			} catch (InvalidColorSchemaException e) {
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testProblematicStephanSchema3() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xlsx", "problematicSchema");
-			assertNotNull(schemas);
-			assertEquals(329, schemas.size());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testReadReactionSchema() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-			Collection<ColorSchema> collection = reader.readColorSchema("testFiles/coloring/coloring.xlsx", "reactionSchema");
-			assertEquals(1, collection.size());
-			ColorSchema schema = collection.iterator().next();
-			assertEquals("re1", schema.getReactionIdentifier());
-			assertEquals(3.0, schema.getLineWidth(), EPSILON);
-			assertEquals(Color.RED, schema.getColor());
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test(timeout=15000)
-	public void testNextVersionReadSchema() throws Exception {
-		try {
-			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
-
-			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xlsx", "goodLayout.v=1.0");
-
-			assertNotNull(schemas);
-			assertEquals(3, schemas.size());
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.awt.Color;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import lcsb.mapviewer.model.map.layout.ColorSchema;
+import lcsb.mapviewer.model.map.layout.InvalidColorSchemaException;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+import lcsb.mapviewer.services.utils.ColorSchemaXlsxReader;
+
+public class ColorSchemaReaderXlsxTest extends ServiceTestFunctions {
+	Logger	logger	= Logger.getLogger(ColorSchemaReaderXlsxTest.class);
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testReadSchema() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+
+			Collection<ColorSchema> schemas = null;
+			
+			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xlsx", "ageing" );
+
+			assertNotNull(schemas);
+			assertEquals(412, schemas.size());
+
+			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xlsx", "ge001");
+
+			assertNotNull(schemas);
+			assertEquals(3057, schemas.size());
+
+			schemas = reader.readColorSchema("testFiles/enricoData/enricoData.xlsx", "ge005");
+
+			assertNotNull(schemas);
+			assertEquals(4338, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadSchema2() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xlsx", "goodSchema");
+
+			assertNotNull(schemas);
+			assertEquals(3, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadSchema3() throws Exception {
+		try {
+			try {
+				ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+				reader.readColorSchema("testFiles/coloring/coloring.xlsx", "wrongSchema");
+				fail("Excepion expected");
+			} catch (InvalidColorSchemaException e) {
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testProblematicStephanSchema3() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xlsx", "problematicSchema");
+			assertNotNull(schemas);
+			assertEquals(329, schemas.size());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testReadReactionSchema() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+			Collection<ColorSchema> collection = reader.readColorSchema("testFiles/coloring/coloring.xlsx", "reactionSchema");
+			assertEquals(1, collection.size());
+			ColorSchema schema = collection.iterator().next();
+			assertEquals("re1", schema.getReactionIdentifier());
+			assertEquals(3.0, schema.getLineWidth(), EPSILON);
+			assertEquals(Color.RED, schema.getColor());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test(timeout=15000)
+	public void testNextVersionReadSchema() throws Exception {
+		try {
+			ColorSchemaXlsxReader reader = new ColorSchemaXlsxReader();
+
+			Collection<ColorSchema> schemas = reader.readColorSchema("testFiles/coloring/coloring.xlsx", "goodLayout.v=1.0");
+
+			assertNotNull(schemas);
+			assertEquals(3, schemas.size());
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingViewFactoryTest.java b/service/src/test/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingViewFactoryTest.java
index fe10508090..6ad7e4e64b 100644
--- a/service/src/test/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingViewFactoryTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/view/ReferenceGenomeGeneMappingViewFactoryTest.java
@@ -1,55 +1,55 @@
-package lcsb.mapviewer.services.view;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.model.map.layout.ReferenceGenomeGeneMapping;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-
-public class ReferenceGenomeGeneMappingViewFactoryTest extends ServiceTestFunctions {
-
-	@Autowired
-	ReferenceGenomeGeneMappingViewFactory factory;
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCreateEmpty() throws Exception {
-		try {
-			ReferenceGenomeGeneMapping referenceGenome = new ReferenceGenomeGeneMapping();
-			Object object = factory.create(referenceGenome);
-			assertNotNull(object);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateGson() throws Exception {
-		try {
-			ReferenceGenomeGeneMapping mapping = new ReferenceGenomeGeneMapping();
-			ReferenceGenomeGeneMappingView object = factory.create(mapping);
-			assertNotNull(factory.createGson(object));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.view;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.model.map.layout.ReferenceGenomeGeneMapping;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+
+public class ReferenceGenomeGeneMappingViewFactoryTest extends ServiceTestFunctions {
+
+	@Autowired
+	ReferenceGenomeGeneMappingViewFactory factory;
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCreateEmpty() throws Exception {
+		try {
+			ReferenceGenomeGeneMapping referenceGenome = new ReferenceGenomeGeneMapping();
+			Object object = factory.create(referenceGenome);
+			assertNotNull(object);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCreateGson() throws Exception {
+		try {
+			ReferenceGenomeGeneMapping mapping = new ReferenceGenomeGeneMapping();
+			ReferenceGenomeGeneMappingView object = factory.create(mapping);
+			assertNotNull(factory.createGson(object));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/service/src/test/java/lcsb/mapviewer/services/view/ReferenceGenomeViewFactoryTest.java b/service/src/test/java/lcsb/mapviewer/services/view/ReferenceGenomeViewFactoryTest.java
index 3c63922b88..9a2eb39ee5 100644
--- a/service/src/test/java/lcsb/mapviewer/services/view/ReferenceGenomeViewFactoryTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/view/ReferenceGenomeViewFactoryTest.java
@@ -1,55 +1,55 @@
-package lcsb.mapviewer.services.view;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import lcsb.mapviewer.model.map.layout.ReferenceGenome;
-import lcsb.mapviewer.services.ServiceTestFunctions;
-
-public class ReferenceGenomeViewFactoryTest extends ServiceTestFunctions {
-
-	@Autowired
-	ReferenceGenomeViewFactory factory;
-
-	@AfterClass
-	public static void tearDownAfterClass() throws Exception {
-	}
-
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void testCreateEmpty() throws Exception {
-		try {
-			ReferenceGenome referenceGenome = new ReferenceGenome();
-			Object object = factory.create(referenceGenome);
-			assertNotNull(object);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-	@Test
-	public void testCreateGson() throws Exception {
-		try {
-			ReferenceGenome referenceGenome = new ReferenceGenome();
-			ReferenceGenomeView object = factory.create(referenceGenome);
-			assertNotNull(factory.createGson(object));
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw e;
-		}
-	}
-
-}
+package lcsb.mapviewer.services.view;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import lcsb.mapviewer.model.map.layout.ReferenceGenome;
+import lcsb.mapviewer.services.ServiceTestFunctions;
+
+public class ReferenceGenomeViewFactoryTest extends ServiceTestFunctions {
+
+	@Autowired
+	ReferenceGenomeViewFactory factory;
+
+	@AfterClass
+	public static void tearDownAfterClass() throws Exception {
+	}
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testCreateEmpty() throws Exception {
+		try {
+			ReferenceGenome referenceGenome = new ReferenceGenome();
+			Object object = factory.create(referenceGenome);
+			assertNotNull(object);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+	@Test
+	public void testCreateGson() throws Exception {
+		try {
+			ReferenceGenome referenceGenome = new ReferenceGenome();
+			ReferenceGenomeView object = factory.create(referenceGenome);
+			assertNotNull(factory.createGson(object));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw e;
+		}
+	}
+
+}
diff --git a/web/src/main/java/lcsb/mapviewer/bean/utils/JsfAjaxAccessControlAllowFilter.java b/web/src/main/java/lcsb/mapviewer/bean/utils/JsfAjaxAccessControlAllowFilter.java
index 71020b035e..f4e265dd9b 100644
--- a/web/src/main/java/lcsb/mapviewer/bean/utils/JsfAjaxAccessControlAllowFilter.java
+++ b/web/src/main/java/lcsb/mapviewer/bean/utils/JsfAjaxAccessControlAllowFilter.java
@@ -1,44 +1,44 @@
-package lcsb.mapviewer.bean.utils;
-
-import java.io.IOException;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.log4j.Logger;
-
-/**
- * This filter enables ajax queries from all domains. It should be used for
- * restfull API.
- * 
- * @author Piotr Gawron
- *
- */
-public class JsfAjaxAccessControlAllowFilter implements Filter {
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private final Logger logger = Logger.getLogger(JsfAjaxAccessControlAllowFilter.class);
-
-	@Override
-	public void init(FilterConfig config) throws ServletException {
-	}
-
-	@Override
-	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
-		HttpServletResponse response = (HttpServletResponse) res;
-		response.addHeader("Access-Control-Allow-Origin", "*");
-		chain.doFilter(req, response);
-	}
-
-	@Override
-	public void destroy() {
-	}
-
-}
+package lcsb.mapviewer.bean.utils;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This filter enables ajax queries from all domains. It should be used for
+ * restfull API.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class JsfAjaxAccessControlAllowFilter implements Filter {
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private final Logger logger = Logger.getLogger(JsfAjaxAccessControlAllowFilter.class);
+
+	@Override
+	public void init(FilterConfig config) throws ServletException {
+	}
+
+	@Override
+	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
+		HttpServletResponse response = (HttpServletResponse) res;
+		response.addHeader("Access-Control-Allow-Origin", "*");
+		chain.doFilter(req, response);
+	}
+
+	@Override
+	public void destroy() {
+	}
+
+}
diff --git a/web/src/main/java/lcsb/mapviewer/bean/utils/XFrameAccessControlFilter.java b/web/src/main/java/lcsb/mapviewer/bean/utils/XFrameAccessControlFilter.java
index ace17c6c93..d9b09421ac 100644
--- a/web/src/main/java/lcsb/mapviewer/bean/utils/XFrameAccessControlFilter.java
+++ b/web/src/main/java/lcsb/mapviewer/bean/utils/XFrameAccessControlFilter.java
@@ -1,51 +1,51 @@
-package lcsb.mapviewer.bean.utils;
-
-import java.io.IOException;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.validator.routines.UrlValidator;
-import org.apache.log4j.Logger;
-
-import lcsb.mapviewer.common.Configuration;
-
-/**
- * This filter enables x-frames from another domain if necessary.
- * 
- * @author Piotr Gawron
- *
- */
-public class XFrameAccessControlFilter implements Filter {
-	/**
-	 * Default class logger.
-	 */
-	@SuppressWarnings("unused")
-	private final Logger logger = Logger.getLogger(XFrameAccessControlFilter.class);
-
-	@Override
-	public void init(FilterConfig config) throws ServletException {
-	}
-
-	@Override
-	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
-		HttpServletResponse response = (HttpServletResponse) res;
-		String domain = Configuration.getxFrameDomain();
-		if (new UrlValidator().isValid(domain) || (domain != null && domain.contains("localhost"))) {
-			response.addHeader("X-Frame-Options", "ALLOW-FROM " + domain);
-		} else {
-			response.addHeader("X-Frame-Options", "DENY");
-		}
-		chain.doFilter(req, response);
-	}
-
-	@Override
-	public void destroy() {
-	}
-
-}
+package lcsb.mapviewer.bean.utils;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.validator.routines.UrlValidator;
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.common.Configuration;
+
+/**
+ * This filter enables x-frames from another domain if necessary.
+ * 
+ * @author Piotr Gawron
+ *
+ */
+public class XFrameAccessControlFilter implements Filter {
+	/**
+	 * Default class logger.
+	 */
+	@SuppressWarnings("unused")
+	private final Logger logger = Logger.getLogger(XFrameAccessControlFilter.class);
+
+	@Override
+	public void init(FilterConfig config) throws ServletException {
+	}
+
+	@Override
+	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
+		HttpServletResponse response = (HttpServletResponse) res;
+		String domain = Configuration.getxFrameDomain();
+		if (new UrlValidator().isValid(domain) || (domain != null && domain.contains("localhost"))) {
+			response.addHeader("X-Frame-Options", "ALLOW-FROM " + domain);
+		} else {
+			response.addHeader("X-Frame-Options", "DENY");
+		}
+		chain.doFilter(req, response);
+	}
+
+	@Override
+	public void destroy() {
+	}
+
+}
-- 
GitLab