Commit eb3273bd authored by Piotr Gawron's avatar Piotr Gawron
Browse files

import of compartment border color works as before

parent 5992ea86
......@@ -456,31 +456,34 @@ public class ModelContructor {
*
* @param gpmlElement
* object from which alias will be create
* @param alias
* specie for which alias will be created
* @param element
* element for which alias will be created
* @return {@link Species} created from input {@link Label}
*/
public Element updateAlias(GraphicalPathwayElement gpmlElement, Element alias) {
if (alias instanceof Compartment) {
public Element updateAlias(GraphicalPathwayElement gpmlElement, Element element) {
if (element instanceof Compartment) {
if (((Shape) gpmlElement).getShape().equalsIgnoreCase("oval")) {
alias = new OvalCompartment((Compartment) alias);
element = new OvalCompartment((Compartment) element);
} else {
alias = new SquareCompartment((Compartment) alias);
element = new SquareCompartment((Compartment) element);
}
String name = ((Shape) gpmlElement).getTextLabel();
if (name == null) {
name = "";
}
alias.setName(name);
element.setName(name);
}
Rectangle2D rec = gpmlElement.getRectangle();
alias.setX(rec.getX());
alias.setY(rec.getY());
alias.setWidth((int) rec.getWidth());
alias.setHeight((int) rec.getHeight());
alias.setFillColor(gpmlElement.getFillColor());
return alias;
element.setX(rec.getX());
element.setY(rec.getY());
element.setWidth((int) rec.getWidth());
element.setHeight((int) rec.getHeight());
element.setFillColor(gpmlElement.getFillColor());
if (element instanceof Compartment) {
element.setBorderColor(gpmlElement.getFillColor());
}
return element;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment