Skip to content

Commit

Permalink
Create the clone.Label if the clone text is not empty
Browse files Browse the repository at this point in the history
Related to Issue #11
  • Loading branch information
Irina Balaur committed Mar 15, 2019
1 parent 155ff5f commit ab28396
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/main/java/fr/eisbm/GraphMLHandlers/GlyphHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -493,22 +493,22 @@ else if (_element.getAttribute(ConverterDefines.KEY_TAG).equals(modelAttributes.

// parse clone information
else if (_element.getAttribute(ConverterDefines.KEY_TAG).equals(modelAttributes.szCloneTagId)) {
if (!_element.getTextContent().equals("")) {
Label _label = new Label();
String text = "";
if (!_element.getTextContent().trim().equals("")) {
Clone _clone = new Clone();
// This is in concordance with the SBGN to GraphML translation as sometimes,
// label text within in the clone is not specified, but it is usually equal to
// empty space. Thus, the condition if from above would be false and the clone
// would not be set. The FlieUtils.CloneIsSet was introduced in order to show
// would not be set. The FileUtils.CloneIsSet was introduced in order to show
// that the glyph has a clone that has to be set, even if the label text is an
// empty string. At the decoding step, this additional information must be
// removed.
if (!_element.getTextContent().equals(CloneHandler.CloneIsSet)) {
text = _element.getTextContent();
Label _label = new Label();
String text = _element.getTextContent();
_label.setText(text);
_clone.setLabel(_label);
}
_label.setText(text);
Clone _clone = new Clone();
_clone.setLabel(_label);

_glyph.setClone(_clone);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/pd/PD2GraphML.java
Original file line number Diff line number Diff line change
Expand Up @@ -1985,8 +1985,8 @@ private void addClone(TransformerHandler handler, Clone clone) throws SAXExcepti

if (null != clone) {
// Sometimes, label text within in the clone is not specified, but it is usually
// equal to an empty space. Thus, the condition if from below would be false and
// the clone would not be set. The FlieUtils.CloneIsSet was introduced in order
// equal to an empty space. Thus, the "if" condition from below is false and
// the clone is not be set. The FileUtils.CloneIsSet was introduced in order
// to show that the glyph has a clone that has to be set, even if the label text
// is an empty string. At the decoding step, this additional information must be
// removed.
Expand Down

0 comments on commit ab28396

Please sign in to comment.