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

font size must be int

parent 6d379f36
......@@ -60,6 +60,7 @@ minerva (12.3.0~alpha.0) unstable; urgency=low
having the aa change information
* Bug fix: plugin contect element width is adjusted when link to tabs are
wrapped in more than one line (#758)
* Bug fix: export to CellDesigner preserve font size (#803)
minerva (12.2.2) stable; urgency=medium
* Bug fix: downloading overlays didn't work from admin panel when project
......
......@@ -572,7 +572,7 @@ public class LayerXmlParser {
result.append(" y=\"" + layer.getY() + "\" ");
result.append(" w=\"" + layer.getWidth() + "\" ");
result.append(" h=\"" + layer.getHeight() + "\"/>");
result.append("<celldesigner:font size=\"" + layer.getFontSize() + "\"/>");
result.append("<celldesigner:font size=\"" + layer.getFontSize().intValue() + "\"/>");
result.append("</celldesigner:layerSpeciesAlias>\n");
return result.toString();
}
......
......@@ -21,67 +21,71 @@ import lcsb.mapviewer.model.map.species.Element;
*/
public abstract class AbstractAliasXmlParser<T extends Element> {
/**
* Default class logger.
*/
@SuppressWarnings("unused")
private Logger logger = Logger.getLogger(AbstractAliasXmlParser.class.getName());
/**
* Default class logger.
*/
@SuppressWarnings("unused")
private Logger logger = Logger.getLogger(AbstractAliasXmlParser.class.getName());
/**
* Set of common functions used in parsing cell designer xml.
*/
private CommonXmlParser commonParser = new CommonXmlParser();
/**
* Set of common functions used in parsing cell designer xml.
*/
private CommonXmlParser commonParser = new CommonXmlParser();
/**
* Parse object from the xml node.
*
* @param node
* xml node to parse
*
* @return parsed object
* @throws InvalidXmlSchemaException
* thrown when xmlString is invalid
*/
abstract T parseXmlAlias(Node node) throws InvalidXmlSchemaException;
/**
* Parse object from the xml node.
*
* @param node
* xml node to parse
*
* @return parsed object
* @throws InvalidXmlSchemaException
* thrown when xmlString is invalid
*/
abstract T parseXmlAlias(Node node) throws InvalidXmlSchemaException;
/**
* Parse object from the xml string.
*
* @param xmlString
* xml string
* @return parsed object
* @throws InvalidXmlSchemaException
* thrown when xmlString is invalid
*/
public T parseXmlAlias(String xmlString) throws InvalidXmlSchemaException {
Document doc = XmlParser.getXmlDocumentFromString(xmlString);
NodeList root = doc.getChildNodes();
return parseXmlAlias(root.item(0));
/**
* Parse object from the xml string.
*
* @param xmlString
* xml string
* @return parsed object
* @throws InvalidXmlSchemaException
* thrown when xmlString is invalid
*/
public T parseXmlAlias(String xmlString) throws InvalidXmlSchemaException {
Document doc = XmlParser.getXmlDocumentFromString(xmlString);
NodeList root = doc.getChildNodes();
return parseXmlAlias(root.item(0));
}
}
/**
* Method that transform object into CellDesigner xml.
*
* @param alias
* object to be transformed
* @return CellDesigner xml representation of the alias
*/
abstract String toXml(T alias);
/**
* Method that transform object into CellDesigner xml.
*
* @param alias
* object to be transformed
* @return CellDesigner xml representation of the alias
*/
abstract String toXml(T alias);
/**
* @return the commonParser
*/
CommonXmlParser getCommonParser() {
return commonParser;
}
/**
* @return the commonParser
*/
CommonXmlParser getCommonParser() {
return commonParser;
}
/**
* @param commonParser
* the commonParser to set
*/
void setCommonParser(CommonXmlParser commonParser) {
this.commonParser = commonParser;
}
/**
* @param commonParser
* the commonParser to set
*/
void setCommonParser(CommonXmlParser commonParser) {
this.commonParser = commonParser;
}
protected String createFontTag(T alias) {
return "<celldesigner:font size=\"" + alias.getFontSize().intValue() + "\"/>";
}
}
......@@ -239,7 +239,7 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
sb.append("h=\"" + species.getHeight() + "\" ");
sb.append("/>\n");
sb.append("<celldesigner:font size=\"" + species.getFontSize() + "\"/>\n");
sb.append(createFontTag(species));
// TODO to be improved
sb.append("<celldesigner:view state=\"usual\"/>\n");
......
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