Commit ec4e94be authored by piotr.gawron's avatar piotr.gawron
Browse files

renaming of model structures + javadoc update

parent f8f4a66f
......@@ -240,7 +240,7 @@ public class ModelAnnotator {
*/
protected void copyAnnotationFromOtherSpecies(Model model, IProgressUpdater progressUpdater) {
double counter = 0;
double amount = model.getAliases().size();
double amount = model.getElements().size();
for (Species element : model.getSpeciesList()) {
if (element.getMiriamData().size() == 0) {
List<Element> speciesList = model.getElementsByName(element.getName());
......@@ -275,10 +275,10 @@ public class ModelAnnotator {
progressUpdater.setProgress(0);
double counter = 0;
double amount = model.getAliases().size() + model.getReactions().size();
double amount = model.getElements().size() + model.getReactions().size();
// annotate all elements
for (Element element : model.getAliases()) {
for (Element element : model.getElements()) {
List<ElementAnnotator> list = null;
if (annotators != null) {
list = annotators.get(element.getClass());
......@@ -361,9 +361,9 @@ public class ModelAnnotator {
double modelCounter = 0;
for (Model model : models) {
double ratio = modelCounter / modelSize;
double size = model.getAliases().size() + model.getReactions().size();
double size = model.getElements().size() + model.getReactions().size();
double counter = 0;
for (Element element : model.getAliases()) {
for (Element element : model.getElements()) {
result.addAll(findImproperAnnotations(element, validAnnotations.get(element.getClass())));
counter++;
updater.setProgress(ratio * IProgressUpdater.MAX_PROGRESS + (counter / size * IProgressUpdater.MAX_PROGRESS) / modelSize);
......@@ -427,7 +427,7 @@ public class ModelAnnotator {
models.add(m);
models.addAll(m.getSubmodels());
for (Model model : models) {
for (Element alias : model.getAliases()) {
for (Element alias : model.getElements()) {
result.addAll(findMissing(alias, requestedAnnotations.get(alias.getClass())));
}
for (Reaction reaction : model.getReactions()) {
......
......@@ -124,7 +124,7 @@ public class ConsoleConverter {
double size = elements.size();
double x = 0;
for (Element alias : model.getAliases()) {
for (Element alias : model.getElements()) {
alias.setWidth(inputOptions.getAliasWidth());
alias.setHeight(inputOptions.getAliasHeight());
double angle = x / size * 2 * Math.PI;
......@@ -271,8 +271,8 @@ public class ConsoleConverter {
modifiers.add(modifier);
}
}
Element alias1 = products.get(0).getAlias();
Element alias2 = reactants.get(0).getAlias();
Element alias1 = products.get(0).getElement();
Element alias2 = reactants.get(0).getElement();
Point2D middle = new Point2D.Double((alias1.getCenterX() + alias2.getCenterX()) / 2, (alias1.getCenterY() + alias2.getCenterY()) / 2);
......@@ -296,15 +296,15 @@ public class ConsoleConverter {
}
Reaction reaction = (Reaction) clazz.newInstance();
for (Product product : products) {
product.setLine(new PolylineData(middle, product.getAlias().getCenter()));
product.setLine(new PolylineData(middle, product.getElement().getCenter()));
reaction.addProduct(product);
}
for (Reactant reactant : reactants) {
reactant.setLine(new PolylineData(reactant.getAlias().getCenter(), middle));
reactant.setLine(new PolylineData(reactant.getElement().getCenter(), middle));
reaction.addReactant(reactant);
}
for (Modifier modifier : modifiers) {
modifier.setLine(new PolylineData(middle, modifier.getAlias().getCenter()));
modifier.setLine(new PolylineData(middle, modifier.getElement().getCenter()));
reaction.addModifier(modifier);
}
reaction.addMiriamData(annotations);
......
......@@ -127,7 +127,7 @@ public class ReactomeExport {
result = id;
if (alias instanceof Complex) {
for (Element a : ((Complex) alias).getAliases()) {
for (Element a : ((Complex) alias).getElements()) {
addElement(a);
}
} else if (alias instanceof Compartment) {
......@@ -178,7 +178,7 @@ public class ReactomeExport {
private void printAliases(Model model) throws IOException {
print("<Nodes>\n");
List<Element> aliases = new ArrayList<Element>();
aliases.addAll(model.getAliases());
aliases.addAll(model.getElements());
Collections.sort(aliases, Element.SIZE_COMPARATOR);
for (Element alias : aliases) {
if (!aliasFeasible(alias)) {
......@@ -207,7 +207,7 @@ public class ReactomeExport {
}
parameters.put("displayName", alias.getName());
if (alias instanceof Complex) {
for (Element a : ((Complex) alias).getAliases()) {
for (Element a : ((Complex) alias).getElements()) {
components.add(addElement(a));
}
}
......@@ -298,7 +298,7 @@ public class ReactomeExport {
}
for (ReactionNode node : reaction.getReactionNodes()) {
Integer id = tempIds.get(node.getAlias());
Integer id = tempIds.get(node.getElement());
if (node instanceof Reactant) {
inputs.put(id, getInputString((Reactant) node));
} else if (node instanceof Product) {
......@@ -443,7 +443,7 @@ public class ReactomeExport {
*/
private boolean isReactionFeasible(Reaction reaction) {
for (ReactionNode node : reaction.getReactionNodes()) {
if (!aliasFeasible(node.getAlias())) {
if (!aliasFeasible(node.getElement())) {
return false;
}
}
......
......@@ -188,7 +188,7 @@ public class Statistics {
Map<String, Set<String>> typeNames = new HashMap<>();
for (Model model : models) {
for (Element element : model.getAliases()) {
for (Element element : model.getElements()) {
if (element instanceof Species) {
names.add(element.getName());
Set<String> tmp = typeNames.get(element.getClass().getName());
......@@ -223,7 +223,7 @@ public class Statistics {
Set<String> set = new HashSet<String>();
for (Model model : models) {
for (Compartment comp : model.getCompartmentsAliases()) {
for (Compartment comp : model.getCompartments()) {
set.add(comp.getName());
}
}
......@@ -255,7 +255,7 @@ public class Statistics {
}
print("-----------------------------");
print("Complex annotations:");
for (Element element : model.getAliases()) {
for (Element element : model.getElements()) {
if (element instanceof Complex && element.getMiriamData().size() > 0) {
print(element.getClass().getSimpleName() + ";\t\tname=" + element.getName() + ";\t\tid=" + element.getElementId());
}
......@@ -316,7 +316,7 @@ public class Statistics {
*/
protected String createPubmedExportString(Model model) throws Exception {
Map<String, List<String>> links = new HashMap<String, List<String>>();
for (Element element : model.getAliases()) {
for (Element element : model.getElements()) {
for (MiriamData md : element.getMiriamData()) {
if (MiriamType.PUBMED.equals(md.getDataType())) {
List<String> list = links.get(md.getResource());
......
......@@ -126,13 +126,13 @@ public class UnknownReactionInReactome {
MatchResult matchResult = new MatchResult();
matchResult.setLocalReaction(reaction);
for (ReactionNode node : reaction.getReactants()) {
matchResult.addInvalidLocalInput(node.getAlias());
matchResult.addInvalidLocalInput(node.getElement());
}
for (ReactionNode node : reaction.getProducts()) {
matchResult.addInvalidLocalOutput(node.getAlias());
matchResult.addInvalidLocalOutput(node.getElement());
}
for (ReactionNode node : reaction.getModifiers()) {
matchResult.addInvalidLocalModifier(node.getAlias());
matchResult.addInvalidLocalModifier(node.getElement());
}
results.add(matchResult);
printResult(matchResult);
......@@ -208,9 +208,9 @@ public class UnknownReactionInReactome {
Set<String> ontologies = new HashSet<String>();
for (Compartment alias : model.getCompartmentsAliases()) {
for (Compartment alias : model.getCompartments()) {
for (ReactionNode node : result.getLocalReaction().getReactionNodes()) {
if (alias.contains(node.getAlias())) {
if (alias.contains(node.getElement())) {
ontologies.add(alias.getName());
break;
}
......
......@@ -76,7 +76,7 @@ public class VibineSnippet {
logger.debug("File processed.");
logger.debug("-------------------------------");
logger.debug("Number of elements: " + model.getAliases().size());
logger.debug("Number of elements: " + model.getElements().size());
logger.debug("Number of reactions: " + model.getReactions().size());
......@@ -96,7 +96,7 @@ public class VibineSnippet {
logger.debug("Reaction with id: " + reactionId);
logger.debug("Reaction has " + reaction.getReactionNodes().size() + " members.");
for (ReactionNode node : reaction.getReactionNodes()) {
logger.debug(node.getClass().getSimpleName() + "; points to " + node.getAlias().getClass().getSimpleName() + "[" + node.getAlias().getElementId() + "]");
logger.debug(node.getClass().getSimpleName() + "; points to " + node.getElement().getClass().getSimpleName() + "[" + node.getElement().getElementId() + "]");
}
logger.debug("-------------------------------");
}
......
......@@ -264,7 +264,7 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
double maxY = 0;
double minX = model.getWidth();
double minY = model.getHeight();
for (Element alias : model.getAliases()) {
for (Element alias : model.getElements()) {
maxX = Math.max(maxX, alias.getWidth() + alias.getX());
maxY = Math.max(maxY, alias.getHeight() + alias.getY());
......@@ -503,7 +503,7 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
}
Complex complex = (Complex) model.getElementByElementId(complexId);
if (complex != null) {
complex.addAlias(alias);
complex.addSpecies(alias);
alias.setParent(complex);
}
} else {
......@@ -541,7 +541,7 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
Complex complex = (Complex) model.getElementByElementId(complexId);
if (complex != null) {
alias.setParent(complex);
complex.addAlias((Species) alias);
complex.addSpecies((Species) alias);
}
}
} else {
......@@ -586,7 +586,7 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
compartmentCollectionXmlParser = new CompartmentCollectionXmlParser(elements);
result.append(compartmentCollectionXmlParser.toXml(model.getCompartmentsAliases()));
result.append(compartmentCollectionXmlParser.toXml(model.getCompartments()));
result.append(speciesCollectionXmlParser.speciesCollectionToSbmlString(model.getSpeciesList()));
......@@ -615,7 +615,7 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
result.append(speciesCollectionXmlParser.speciesCollectionToXmlIncludedString(model.getSpeciesList()));
result.append(aliasCollectionParser.compartmentAliasCollectionToXmlString(model.getCompartmentsAliases()));
result.append(aliasCollectionParser.compartmentAliasCollectionToXmlString(model.getCompartments()));
result.append(aliasCollectionParser.complexAliasCollectionToXmlString(model.getComplexList()));
result.append(aliasCollectionParser.speciesAliasCollectionToXmlString(model.getNotComplexSpeciesList()));
......@@ -623,7 +623,7 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
List<Gene> genes = new ArrayList<>();
List<Rna> rnas = new ArrayList<>();
List<AntisenseRna> antisenseRnas = new ArrayList<>();
for (Element element : model.getAliases()) {
for (Element element : model.getElements()) {
if (element instanceof Protein) {
proteins.add((Protein) element);
} else if (element instanceof Gene) {
......
......@@ -144,7 +144,7 @@ public class LayerXmlParser extends XmlParser {
Node node = nodes.item(x);
if (node.getNodeType() == Node.ELEMENT_NODE) {
if (node.getNodeName().equalsIgnoreCase("celldesigner:group")) {
model.addAliasGroup(getAliasGroup(node, model));
model.addElementGroup(getAliasGroup(node, model));
} else {
throw new InvalidXmlSchemaException("Unknown element of celldesigner:listOfGroups: " + node.getNodeName());
}
......@@ -176,7 +176,7 @@ public class LayerXmlParser extends XmlParser {
if (alias == null) {
throw new InvalidGroupException("Group \"" + id + "\" contains alias with id: \"" + string + "\", but such alias doesn't exist in the model.");
}
result.addAlias(alias);
result.addElement(alias);
}
NodeList nodes = groupNode.getChildNodes();
......
......@@ -169,8 +169,8 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
if ("open".equalsIgnoreCase(state)) {
String prefix = getNodeAttr("prefix", node);
String label = getNodeAttr("label", node);
alias.setAliasStatePrefix(prefix);
alias.setAliasStateLabel(label);
alias.setStatePrefix(prefix);
alias.setStateLabel(label);
} else if ("empty".equalsIgnoreCase(state)) {
return;
} else if (state == null || state.isEmpty()) {
......@@ -195,7 +195,7 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
throw new InvalidArgumentException("Parent complex alias does not exist: " + parentId + " for alias: " + alias.getElementId());
} else {
alias.setParent(ca);
ca.addAlias(alias);
ca.addSpecies(alias);
}
}
}
......@@ -207,12 +207,12 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
// exported to CellDesigner file
if (alias.getParent() instanceof Compartment && !(alias.getParent() instanceof PathwayCompartment)) {
ca = (Compartment) alias.getParent();
} else if (alias.getCompartmentAlias() != null && !(alias.getCompartmentAlias() instanceof PathwayCompartment)) {
ca = alias.getCompartmentAlias();
} else if (alias.getComplexAlias() == null) {
} else if (alias.getCompartment() != null && !(alias.getCompartment() instanceof PathwayCompartment)) {
ca = alias.getCompartment();
} else if (alias.getComplex() == null) {
ModelData modelData = alias.getModelData();
if (modelData != null) {
for (Compartment cAlias : modelData.getModel().getCompartmentsAliases()) {
for (Compartment cAlias : modelData.getModel().getCompartments()) {
if (!(cAlias instanceof PathwayCompartment) && cAlias.cross(alias)) {
if (ca == null) {
ca = cAlias;
......
......@@ -126,7 +126,7 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
throw new InvalidXmlSchemaException("ComplexAlias does not exist: " + complexAliasId + ", current: " + result.getElementId());
} else {
result.setParent(alias);
alias.addAlias(result);
alias.addSpecies(result);
}
}
return result;
......@@ -145,8 +145,8 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
if ("open".equalsIgnoreCase(state)) {
String prefix = getNodeAttr("prefix", node);
String label = getNodeAttr("label", node);
alias.setAliasStatePrefix(prefix);
alias.setAliasStateLabel(label);
alias.setStatePrefix(prefix);
alias.setStateLabel(label);
} else if ("empty".equalsIgnoreCase(state)) {
return;
} else if (state == null || state.isEmpty()) {
......@@ -163,10 +163,10 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
// artifitial compartment aliases should be excluded
if (alias.getParent() instanceof Compartment && !(alias.getParent() instanceof PathwayCompartment)) {
ca = (Compartment) alias.getParent();
} else if (alias.getComplexAlias() == null) {
} else if (alias.getComplex() == null) {
ModelData model = alias.getModelData();
if (model != null) {
for (Compartment cAlias : model.getModel().getCompartmentsAliases()) {
for (Compartment cAlias : model.getModel().getCompartments()) {
if (!(cAlias instanceof PathwayCompartment) && cAlias.cross(alias)) {
if (ca == null) {
ca = cAlias;
......@@ -231,8 +231,8 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
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");
if (alias.getStateLabel() != null || alias.getStatePrefix() != null) {
sb.append("<celldesigner:info state=\"open\" prefix=\"" + alias.getStatePrefix() + "\" label=\"" + alias.getStateLabel() + "\"/>\n");
}
sb.append("</celldesigner:speciesAlias>\n");
return sb.toString();
......
......@@ -365,7 +365,7 @@ public class ReactionFromXml extends XmlParser {
}
for (int i = 0; i < result.getModifiers().size(); i++) {
Modifier modifier = result.getModifiers().get(i);
if (modifier.getAlias() == null) {
if (modifier.getElement() == null) {
List<Modifier> modifiers = new ArrayList<Modifier>();
modifiers.add(modifier);
for (Modifier modifier2 : result.getModifiers()) {
......@@ -481,7 +481,7 @@ public class ReactionFromXml extends XmlParser {
* modifier to update
*/
private void createLineForModifier(Reaction reaction, Modifier modifier) {
Element alias = modifier.getAlias();
Element alias = modifier.getElement();
CellDesignerAliasConverter converter = new CellDesignerAliasConverter(alias);
Point2D startPoint = converter.getPointCoordinates(alias, anchorsByNodes.get(modifier));
ModifierTypeUtils modifierTypeUtils = new ModifierTypeUtils();
......@@ -820,16 +820,16 @@ public class ReactionFromXml extends XmlParser {
Product product2 = reaction.getProducts().get(1);
Reactant reactant = reaction.getReactants().get(0);
CellDesignerAliasConverter reactantConverter = new CellDesignerAliasConverter(reactant.getAlias());
CellDesignerAliasConverter product1Converter = new CellDesignerAliasConverter(product1.getAlias());
CellDesignerAliasConverter product2Converter = new CellDesignerAliasConverter(product2.getAlias());
CellDesignerAliasConverter reactantConverter = new CellDesignerAliasConverter(reactant.getElement());
CellDesignerAliasConverter product1Converter = new CellDesignerAliasConverter(product1.getElement());
CellDesignerAliasConverter product2Converter = new CellDesignerAliasConverter(product2.getElement());
Point2D p1 = reactantConverter.getPointCoordinates(reactant.getAlias(), anchorsByNodes.get(reactant));
Point2D p2 = product1Converter.getPointCoordinates(product1.getAlias(), anchorsByNodes.get(product1));
Point2D p3 = product2Converter.getPointCoordinates(product2.getAlias(), anchorsByNodes.get(product2));
Point2D p1 = reactantConverter.getPointCoordinates(reactant.getElement(), anchorsByNodes.get(reactant));
Point2D p2 = product1Converter.getPointCoordinates(product1.getElement(), anchorsByNodes.get(product1));
Point2D p3 = product2Converter.getPointCoordinates(product2.getElement(), anchorsByNodes.get(product2));
Point2D centerPoint = pointTransformation
.getCoordinatesInNormalBase(product1.getAlias().getCenter(), product2.getAlias().getCenter(), reactant.getAlias().getCenter(), p);
.getCoordinatesInNormalBase(product1.getElement().getCenter(), product2.getElement().getCenter(), reactant.getElement().getCenter(), p);
int startId0 = 0;
int num0 = points.getNum0();
......@@ -847,13 +847,13 @@ public class ReactionFromXml extends XmlParser {
PolylineData reactantLine = PolylineDataFactory.createPolylineDataFromEditPoints(centerPoint, p1, linePoints1);
p1 = product2Converter.getAnchorPointCoordinates(product2.getAlias(), anchorsByNodes.get(product2), product2Line.reverse());
p1 = product2Converter.getAnchorPointCoordinates(product2.getElement(), anchorsByNodes.get(product2), product2Line.reverse());
product2Line.setEndPoint(p1);
p1 = product1Converter.getAnchorPointCoordinates(product1.getAlias(), anchorsByNodes.get(product1), product1Line.reverse());
p1 = product1Converter.getAnchorPointCoordinates(product1.getElement(), anchorsByNodes.get(product1), product1Line.reverse());
product1Line.setEndPoint(p1);
p1 = reactantConverter.getAnchorPointCoordinates(reactant.getAlias(), anchorsByNodes.get(reactant), reactantLine.reverse());
p1 = reactantConverter.getAnchorPointCoordinates(reactant.getElement(), anchorsByNodes.get(reactant), reactantLine.reverse());
reactantLine.setEndPoint(p1);
product2Line.getEndAtd().setArrowType(ArrowType.FULL);
......@@ -884,16 +884,16 @@ public class ReactionFromXml extends XmlParser {
Product product = reaction.getProducts().get(0);
Reactant reactant1 = reaction.getReactants().get(0);
Reactant reactant2 = reaction.getReactants().get(1);
CellDesignerAliasConverter productConverter = new CellDesignerAliasConverter(product.getAlias());
CellDesignerAliasConverter reactantConverter1 = new CellDesignerAliasConverter(reactant1.getAlias());
CellDesignerAliasConverter reactantConverter2 = new CellDesignerAliasConverter(reactant2.getAlias());
Point2D p1 = reactantConverter1.getPointCoordinates(reactant1.getAlias(), anchorsByNodes.get(reactant1));
Point2D p2 = reactantConverter2.getPointCoordinates(reactant2.getAlias(), anchorsByNodes.get(reactant2));
Point2D p3 = productConverter.getPointCoordinates(product.getAlias(), anchorsByNodes.get(product));
CellDesignerAliasConverter productConverter = new CellDesignerAliasConverter(product.getElement());
CellDesignerAliasConverter reactantConverter1 = new CellDesignerAliasConverter(reactant1.getElement());
CellDesignerAliasConverter reactantConverter2 = new CellDesignerAliasConverter(reactant2.getElement());
Point2D p1 = reactantConverter1.getPointCoordinates(reactant1.getElement(), anchorsByNodes.get(reactant1));
Point2D p2 = reactantConverter2.getPointCoordinates(reactant2.getElement(), anchorsByNodes.get(reactant2));
Point2D p3 = productConverter.getPointCoordinates(product.getElement(), anchorsByNodes.get(product));
Element alias1 = reactant1.getAlias();
Element alias2 = reactant2.getAlias();
Element alias3 = product.getAlias();
Element alias1 = reactant1.getElement();
Element alias2 = reactant2.getElement();
Element alias3 = product.getElement();
Point2D pointA = alias2.getCenter();
Point2D pointC = alias1.getCenter();
......@@ -932,15 +932,15 @@ public class ReactionFromXml extends XmlParser {
PolylineData productLine = PolylineDataFactory.createPolylineDataFromEditPoints(centerPoint, p3, linePoints3);
p1 = reactantConverter1.getAnchorPointCoordinates(reactant1.getAlias(), anchorsByNodes.get(reactant1), reactant1Line.reverse());
p1 = reactantConverter1.getAnchorPointCoordinates(reactant1.getElement(), anchorsByNodes.get(reactant1), reactant1Line.reverse());
reactant1Line.setEndPoint(p1);
reactant1Line = reactant1Line.reverse();
p1 = reactantConverter2.getAnchorPointCoordinates(reactant2.getAlias(), anchorsByNodes.get(reactant2), reactant2Line.reverse());
p1 = reactantConverter2.getAnchorPointCoordinates(reactant2.getElement(), anchorsByNodes.get(reactant2), reactant2Line.reverse());
reactant2Line.setEndPoint(p1);
reactant2Line = reactant2Line.reverse();
p1 = productConverter.getAnchorPointCoordinates(product.getAlias(), anchorsByNodes.get(product), productLine.reverse());
p1 = productConverter.getAnchorPointCoordinates(product.getElement(), anchorsByNodes.get(product), productLine.reverse());
productLine.setEndPoint(p1);
if (hasGateMemebers) {
productLine.getEndAtd().setArrowType(ArrowType.OPEN);
......@@ -967,11 +967,11 @@ public class ReactionFromXml extends XmlParser {
private void createLinesForSimpleReaction(Reaction reaction, EditPoints editPoints, ConnectScheme scheme) {
Product product = reaction.getProducts().get(0);
Reactant reactant = reaction.getReactants().get(0);
CellDesignerAliasConverter productConverter = new CellDesignerAliasConverter(product.getAlias());
CellDesignerAliasConverter reactantConverter = new CellDesignerAliasConverter(reactant.getAlias());
CellDesignerAliasConverter productConverter = new CellDesignerAliasConverter(product.getElement());
CellDesignerAliasConverter reactantConverter = new CellDesignerAliasConverter(reactant.getElement());
Point2D endPoint = productConverter.getPointCoordinates(product.getAlias(), anchorsByNodes.get(product));
Point2D startPoint = reactantConverter.getPointCoordinates(reactant.getAlias(), anchorsByNodes.get(reactant));
Point2D endPoint = productConverter.getPointCoordinates(product.getElement(), anchorsByNodes.get(product));
Point2D startPoint = reactantConverter.getPointCoordinates(reactant.getElement(), anchorsByNodes.get(reactant));
PolylineData ld = PolylineDataFactory.createPolylineDataFromEditPoints(startPoint, endPoint, editPoints.getPoints());
......@@ -991,8 +991,8 @@ public class ReactionFromXml extends XmlParser {
if (index == null) {
index = 0;
}
startPoint = reactantConverter.getAnchorPointCoordinates(reactant.getAlias(), anchorsByNodes.get(reactant), ld);
endPoint = productConverter.getAnchorPointCoordinates(product.getAlias(), anchorsByNodes.get(product), ld.reverse());
startPoint = reactantConverter.getAnchorPointCoordinates(reactant.getElement(), anchorsByNodes.get(reactant), ld);
endPoint = productConverter.getAnchorPointCoordinates(product.getElement(), anchorsByNodes.get(product), ld.reverse());
ld.getPoints().set(0, startPoint);
ld.getPoints().set(ld.getPoints().size() - 1, endPoint);
......@@ -1397,7 +1397,7 @@ public class ReactionFromXml extends XmlParser {
throw new UnknownModifierClassException(errorInfo, type, reaction.getIdReaction());
}
for (Modifier modifier : reaction.getModifiers()) {
if (modifier.getAlias() == aliasList.get(0) && modifier.getClass() == mType.getClazz()) {
if (modifier.getElement() == aliasList.get(0) && modifier.getClass() == mType.getClazz()) {
result = modifier;
}
}
......@@ -1461,12 +1461,12 @@ public class ReactionFromXml extends XmlParser {
for (int i = 1; i < modifiers.size(); i++) {
Modifier param = modifiers.get(i);
CellDesignerAliasConverter reactantConverter = new CellDesignerAliasConverter(param.getAlias());
startPoint = reactantConverter.getPointCoordinates(param.getAlias(), anchorsByNodes.get(param));
CellDesignerAliasConverter reactantConverter = new CellDesignerAliasConverter(param.getElement());
startPoint = reactantConverter.getPointCoordinates(param.getElement(), anchorsByNodes.get(param));
PolylineData polyline = PolylineDataFactory.createPolylineDataFromEditPoints(startPoint, endPoint, pointsByModifier.get(param));
startPoint = reactantConverter.getAnchorPointCoordinates(param.getAlias(), anchorsByNodes.get(param), polyline);
startPoint = reactantConverter.getAnchorPointCoordinates(param.getElement(), anchorsByNodes.get(param), polyline);
polyline.setStartPoint(startPoint);
param.setLine(polyline);
}
......
......@@ -179,7 +179,7 @@ public class ReactionToXml extends XmlParser {
* @return modifierSpeciesReference sbml node for given modifer
*/
private String getModifierReferenceXmlString(Modifier modifier) {
Element alias = modifier.getAlias();
Element alias = modifier.getElement();
StringBuilder sb = new StringBuilder();
sb.append("<modifierSpeciesReference ");
sb.append("metaid=\"" + elements.getElementId(alias) + "\" ");
......@@ -217,11 +217,11 @@ public class ReactionToXml extends XmlParser {
if (modifier instanceof Modifier) {
Modifier mod = (Modifier) modifier;
if (modifiers.equals("")) {
modifiers = elements.getElementId(mod.getAlias());
aliases = mod.getAlias().getElementId();
modifiers = elements.getElementId(mod.getElement());
aliases = mod.getElement().getElementId();
} else {
modifiers += "," + elements.getElementId(mod.getAlias());
aliases += "," + mod.getAlias().getElementId();
modifiers += "," + elements.getElementId(mod.getElement());
aliases += "," + mod.getElement().getElementId();