Skip to content
Snippets Groups Projects
Commit 1e393c97 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

method signature fixed

parent 24e9d06d
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!560Resolve "add support for modifications and states in sbml export/import"
Pipeline #8030 failed
Showing
with 21 additions and 15 deletions
......@@ -9,6 +9,7 @@ import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.NotImplementedException;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.AntisenseRna;
import lcsb.mapviewer.model.map.species.Gene;
import lcsb.mapviewer.model.map.species.Species;
import lcsb.mapviewer.model.map.species.field.CodingRegion;
import lcsb.mapviewer.model.map.species.field.ModificationResidue;
......@@ -145,7 +146,8 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
}
@Override
public void updateModelElementAfterLayoutAdded(AntisenseRna antisenseRna) {
public void updateModelElementAfterLayoutAdded(Species species) {
AntisenseRna antisenseRna = (AntisenseRna) species;
for (CellDesignerModificationResidue region : regions) {
ModificationResidue mr = region.createModificationResidue(antisenseRna);
if (mr instanceof CodingRegion) {
......
......@@ -149,8 +149,4 @@ public class CellDesignerCompartment extends CellDesignerElement<Compartment>
return result;
}
@Override
public void updateModelElementAfterLayoutAdded(Compartment element) {
}
}
......@@ -429,8 +429,6 @@ public abstract class CellDesignerElement<T extends Element> implements Serializ
*/
public abstract T createModelElement(String modelElementId);
public abstract void updateModelElementAfterLayoutAdded(T element);
/**
* Sets values from this cell designer structure into model object.
*
......
......@@ -3,6 +3,8 @@ package lcsb.mapviewer.converter.model.celldesigner.structure;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.NotImplementedException;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
......@@ -21,6 +23,7 @@ import lcsb.mapviewer.model.map.species.field.TranscriptionSite;
*
*/
public class CellDesignerGene extends CellDesignerSpecies<Gene> {
Logger logger = Logger.getLogger(CellDesignerGene.class);
/**
*
......@@ -119,7 +122,8 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> {
}
@Override
public void updateModelElementAfterLayoutAdded(Gene gene) {
public void updateModelElementAfterLayoutAdded(Species species) {
Gene gene = (Gene) species;
for (CellDesignerModificationResidue region : modificationResidues) {
ModificationResidue mr = region.createModificationResidue(gene);
if (mr instanceof CodingRegion) {
......
......@@ -9,6 +9,7 @@ import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.NotImplementedException;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.Protein;
import lcsb.mapviewer.model.map.species.Species;
import lcsb.mapviewer.model.map.species.field.BindingRegion;
import lcsb.mapviewer.model.map.species.field.ModificationResidue;
import lcsb.mapviewer.model.map.species.field.Residue;
......@@ -153,13 +154,14 @@ public class CellDesignerProtein<T extends Protein> extends CellDesignerSpecies<
}
@Override
public void updateModelElementAfterLayoutAdded(Protein element) {
public void updateModelElementAfterLayoutAdded(Species species) {
Protein protein= (Protein) species;
for (CellDesignerModificationResidue region : modificationResidues) {
ModificationResidue mr = region.createModificationResidue(element);
ModificationResidue mr = region.createModificationResidue(protein);
if (mr instanceof Residue) {
element.addResidue((Residue) mr);
protein.addResidue((Residue) mr);
} else if (mr instanceof BindingRegion) {
element.addBindingRegion((BindingRegion) mr);
protein.addBindingRegion((BindingRegion) mr);
} else {
throw new InvalidArgumentException("Cannot add modification residue to element: " + mr.getClass());
}
......
......@@ -9,6 +9,7 @@ import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.NotImplementedException;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.Rna;
import lcsb.mapviewer.model.map.species.Species;
import lcsb.mapviewer.model.map.species.field.CodingRegion;
import lcsb.mapviewer.model.map.species.field.ModificationResidue;
import lcsb.mapviewer.model.map.species.field.ModificationSite;
......@@ -143,7 +144,8 @@ public class CellDesignerRna extends CellDesignerSpecies<Rna> {
}
@Override
public void updateModelElementAfterLayoutAdded(Rna rna) {
public void updateModelElementAfterLayoutAdded(Species species) {
Rna rna = (Rna) species;
for (CellDesignerModificationResidue region : regions) {
ModificationResidue mr = region.createModificationResidue(rna);
if (mr instanceof CodingRegion) {
......
......@@ -540,7 +540,6 @@ public class CellDesignerSpecies<T extends Species> extends CellDesignerElement<
this.constant = constant;
}
@Override
public void updateModelElementAfterLayoutAdded(Species element) {
}
......
......@@ -90,7 +90,7 @@ public class GeneXmlParserTest extends CellDesignerTestFunctions {
public void testParsePhosphorylatedGene() throws Exception {
try {
Model model = getModelForFile("testFiles/problematic/phosphorylated_gene.xml");
Gene gene = (Gene) model.getElementByElementId("sa1");
Gene gene = model.getElementByElementId("sa1");
assertEquals(1, gene.getModificationResidues().size());
ModificationSite residue = (ModificationSite) gene.getModificationResidues().get(0);
assertEquals(ModificationState.PHOSPHORYLATED, residue.getState());
......
......@@ -7,6 +7,7 @@ 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;
......@@ -28,6 +29,8 @@ import lcsb.mapviewer.model.map.species.field.TranscriptionSite;
@Entity
@DiscriminatorValue("GENE")
public class Gene extends Species {
Logger logger = Logger.getLogger(Gene.class);
/**
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment