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

unused CellDesigner parameters removed

parent ee9b37d7
......@@ -147,9 +147,6 @@ public class GeneXmlParser extends AbstractElementXmlParser<CellDesignerGene, Ge
if (!mr.getName().equals("")) {
attributes += " name=\"" + escapeXml(mr.getName()) + "\"";
}
if (!mr.getSide().equals("")) {
attributes += " side=\"" + mr.getSide() + "\"";
}
if (mr.getAngle() != null) {
attributes += " pos=\"" + mr.getAngle() + "\"";
}
......
......@@ -135,9 +135,6 @@ public class ProteinXmlParser extends AbstractElementXmlParser<CellDesignerProte
if (!mr.getName().equals("")) {
attributes += " name=\"" + escapeXml(mr.getName()) + "\"";
}
if (!mr.getSide().equals("")) {
attributes += " side=\"" + mr.getSide() + "\"";
}
if (mr.getAngle() != null) {
attributes += " angle=\"" + mr.getAngle() + "\"";
}
......
......@@ -20,314 +20,310 @@ import lcsb.mapviewer.model.map.species.field.ModificationState;
*/
public class CellDesignerModificationResidue implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Default class logger.
*/
@SuppressWarnings("unused")
private static Logger logger = Logger.getLogger(CellDesignerModificationResidue.class.getName());
/**
* Identifier of the modification. Must be unique in single map model.
*/
private String idModificationResidue = "";
/**
* Name of the modification.
*/
private String name = "";
/**
* Some strange param in CellDesigner. No idea what is it for.
*/
private String side = "";
/**
* State in which this modification is.
*/
private ModificationState state = null;
/**
* Where this modification is located (on which side of the border).
*/
private Double angle = null;
/**
* How big is this modification (used only for some types of the
* modification).
*/
private Double size = null;
/**
* Species to which this modification belong to.
*/
private CellDesignerSpecies<?> species;
/**
* Default constructor.
*/
public CellDesignerModificationResidue() {
}
/**
* Constructor that initaize object with the data taken from the parameter.
*
* @param mr
* original object from which data is taken
*/
public CellDesignerModificationResidue(CellDesignerModificationResidue mr) {
this.idModificationResidue = mr.idModificationResidue;
this.name = mr.name;
this.angle = mr.angle;
this.size = mr.size;
this.side = mr.side;
this.state = mr.state;
}
/**
* Constructor that creates object from model representation of modification.
*
* @param mr
* model represnation of {@link ModificationResidue}
*/
public CellDesignerModificationResidue(ModificationResidue mr) {
this.idModificationResidue = mr.getIdModificationResidue();
this.name = mr.getName();
this.angle = mr.getAngle();
this.size = mr.getSize();
this.side = mr.getSide();
this.state = mr.getState();
}
/**
* Default constructor.
*
* @param id
* identifier of the modificationr esidue
*/
public CellDesignerModificationResidue(String id) {
this.idModificationResidue = id;
}
/**
* Updates fields in the object with the data given in the parameter
* modification.
*
* @param mr
* modification residue from which data will be used to update
*/
public void update(CellDesignerModificationResidue mr) {
if (mr.getName() != null && !mr.getName().equals("")) {
this.name = mr.name;
}
if (mr.getAngle() != null) {
this.angle = mr.angle;
}
if (mr.getSize() != null) {
this.size = mr.size;
}
if (mr.getSide() != null && !mr.getSide().equals("")) {
this.side = mr.side;
}
if (mr.getState() != null) {
this.state = mr.state;
}
}
@Override
public String toString() {
String result = getIdModificationResidue() + "," + getName() + "," + getState() + "," + getAngle() + "," + getSize() + "," + getSide() + ",";
return result;
}
/**
* Creates copy of the object.
*
* @return copy of the object.
*/
public CellDesignerModificationResidue copy() {
if (this.getClass() == CellDesignerModificationResidue.class) {
return new CellDesignerModificationResidue(this);
} else {
throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
}
}
/**
* Sets {@link #angle} .
*
* @param text
* angle in text format
*/
public void setAngle(String text) {
try {
if (text != null && !text.equals("")) {
angle = Double.parseDouble(text);
} else {
angle = null;
}
} catch (NumberFormatException e) {
throw new InvalidArgumentException("Invalid angle: " + text, e);
}
}
/**
* Sets {@link #size}.
*
* @param text
* size in text format.
*/
public void setSize(String text) {
try {
if (text != null && !text.equals("")) {
size = Double.parseDouble(text);
} else {
size = null;
}
} catch (NumberFormatException e) {
throw new InvalidArgumentException("Invalid size: " + text, e);
}
}
/**
* @return the id
* @see #idModificationResidue
*/
public String getIdModificationResidue() {
return idModificationResidue;
}
/**
* @param idModificationResidue
* the id to set
* @see #idModificationResidue
*/
public void setIdModificationResidue(String idModificationResidue) {
this.idModificationResidue = idModificationResidue;
}
/**
* @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 side
* @see #side
*/
public String getSide() {
return side;
}
/**
* @param side
* the side to set
* @see #side
*/
public void setSide(String side) {
this.side = side;
}
/**
* @return the state
* @see #state
*/
public ModificationState getState() {
return state;
}
/**
* @param state
* the state to set
* @see #state
*/
public void setState(ModificationState state) {
this.state = state;
}
/**
* @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;
}
/**
* @return the size
* @see #size
*/
public Double getSize() {
return size;
}
/**
* @param size
* the size to set
* @see #size
*/
public void setSize(Double size) {
this.size = size;
}
/**
* @return the species
* @see #species
*/
public CellDesignerSpecies<?> getSpecies() {
return species;
}
/**
* @param species
* the species to set
* @see #species
*/
public void setSpecies(CellDesignerSpecies<?> species) {
this.species = species;
}
/**
* Creates model representation of {@link ModificationResidue}.
*
* @return {@link ModificationResidue} representing this object in a model
*/
public ModificationResidue createModificationResidueAlias() {
ModificationResidue result = new ModificationResidue();
result.setIdModificationResidue(this.getIdModificationResidue());
result.setName(this.getName());
result.setAngle(this.getAngle());
result.setSize(this.getSize());
result.setSide(this.getSide());
result.setState(this.getState());
return result;
}
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Default class logger.
*/
@SuppressWarnings("unused")
private static Logger logger = Logger.getLogger(CellDesignerModificationResidue.class.getName());
/**
* Identifier of the modification. Must be unique in single map model.
*/
private String idModificationResidue = "";
/**
* Name of the modification.
*/
private String name = "";
/**
* Some strange param in CellDesigner. No idea what is it for.
*/
private String side = "";
/**
* State in which this modification is.
*/
private ModificationState state = null;
/**
* Where this modification is located (on which side of the border).
*/
private Double angle = null;
/**
* How big is this modification (used only for some types of the modification).
*/
private Double size = null;
/**
* Species to which this modification belong to.
*/
private CellDesignerSpecies<?> species;
/**
* Default constructor.
*/
public CellDesignerModificationResidue() {
}
/**
* Constructor that initaize object with the data taken from the parameter.
*
* @param mr
* original object from which data is taken
*/
public CellDesignerModificationResidue(CellDesignerModificationResidue mr) {
this.idModificationResidue = mr.idModificationResidue;
this.name = mr.name;
this.angle = mr.angle;
this.size = mr.size;
this.side = mr.side;
this.state = mr.state;
}
/**
* Constructor that creates object from model representation of modification.
*
* @param mr
* model representation of {@link ModificationResidue}
*/
public CellDesignerModificationResidue(ModificationResidue mr) {
this.idModificationResidue = mr.getIdModificationResidue();
this.name = mr.getName();
this.angle = mr.getAngle();
this.state = mr.getState();
}
/**
* Default constructor.
*
* @param id
* identifier of the modification residue
*/
public CellDesignerModificationResidue(String id) {
this.idModificationResidue = id;
}
/**
* Updates fields in the object with the data given in the parameter
* modification.
*
* @param mr
* modification residue from which data will be used to update
*/
public void update(CellDesignerModificationResidue mr) {
if (mr.getName() != null && !mr.getName().equals("")) {
this.name = mr.name;
}
if (mr.getAngle() != null) {
this.angle = mr.angle;
}
if (mr.getSize() != null) {
this.size = mr.size;
}
if (mr.getSide() != null && !mr.getSide().equals("")) {
this.side = mr.side;
}
if (mr.getState() != null) {
this.state = mr.state;
}
}
@Override
public String toString() {
String result = getIdModificationResidue() + "," + getName() + "," + getState() + "," + getAngle() + "," + getSize()
+ "," + getSide() + ",";
return result;
}
/**
* Creates copy of the object.
*
* @return copy of the object.
*/
public CellDesignerModificationResidue copy() {
if (this.getClass() == CellDesignerModificationResidue.class) {
return new CellDesignerModificationResidue(this);
} else {
throw new NotImplementedException("Method copy() should be overriden in class " + this.getClass());
}
}
/**
* Sets {@link #angle} .
*
* @param text
* angle in text format
*/
public void setAngle(String text) {
try {
if (text != null && !text.equals("")) {
angle = Double.parseDouble(text);
} else {
angle = null;
}
} catch (NumberFormatException e) {
throw new InvalidArgumentException("Invalid angle: " + text, e);
}
}
/**
* Sets {@link #size}.
*
* @param text
* size in text format.
*/
public void setSize(String text) {
try {
if (text != null && !text.equals("")) {
size = Double.parseDouble(text);
} else {
size = null;
}
} catch (NumberFormatException e) {
throw new InvalidArgumentException("Invalid size: " + text, e);
}
}
/**
* @return the id
* @see #idModificationResidue
*/
public String getIdModificationResidue() {
return idModificationResidue;
}
/**
* @param idModificationResidue
* the id to set
* @see #idModificationResidue
*/
public void setIdModificationResidue(String idModificationResidue) {
this.idModificationResidue = idModificationResidue;
}
/**
* @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 side
* @see #side
*/
public String getSide() {
return side;
}