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

remove SemanticZoom terms from LayerText once processed

parent 74469636
Pipeline #28031 failed with stage
in 12 minutes and 13 seconds
......@@ -18,6 +18,8 @@ minerva (15.0.0~beta.5) unstable; urgency=medium
(#1274)
* Bug fix: uploading map with elements having identifiers like "artX" could
break upload (#1273)
* Bug fix: export from minerva does not include SemanticZoom terms for text
notes (#1287)
-- Piotr Gawron <piotr.gawron@uni.lu> Tue, 2 Jun 2020 16:00:00 +0200
......
......@@ -187,6 +187,7 @@ public class CreateHierarchyCommand extends ModelCommand {
compartment.setZ(text.getZ());
compartment.setGlyph(text.getGlyph());
rap.processNotes(compartment);
text.setNotes(compartment.getNotes());
compartment.setNamePoint(new Point2D.Double(text.getX() + DEFAULT_TITLE_X_COORD_IN_ARTIFITIAL_COMPARTMENT,
text.getY() + DEFAULT_TITLE_Y_COORD_IN_ARTIFITIAL_COMPARTMENT));
......
......@@ -17,8 +17,7 @@ import lcsb.mapviewer.converter.ConverterParams;
import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.compartment.PathwayCompartment;
import lcsb.mapviewer.model.map.layout.graphics.Layer;
import lcsb.mapviewer.model.map.layout.graphics.LayerRect;
import lcsb.mapviewer.model.map.layout.graphics.*;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelFullIndexed;
import lcsb.mapviewer.model.map.species.*;
......@@ -329,7 +328,7 @@ public class CreateHierarchyCommandTest extends CommandTestFunctions {
layerRect2.setFillColor(Color.YELLOW);
layer.addLayerRect(layerRect2);
model.addLayer(layer);
Protein protein = createProtein();
protein.setElementId("art0");
model.addElement(protein);
......@@ -346,4 +345,37 @@ public class CreateHierarchyCommandTest extends CommandTestFunctions {
assertNotNull(pathway);
}
@Test
public void testProcessNotesForLayerText() throws Exception {
Model model = new ModelFullIndexed(null);
Layer layer = new Layer();
LayerText layerText = new LayerText();
layerText.setNotes("colors check\n" +
"SemanticZoomLevelVisibility: 3\n" +
"SemanticZoomLevelTransparency: 4\n" +
"BackgroundColor:#0000ee\n" +
"BorderColor:#00ee00");
layer.addLayerText(layerText);
model.addLayer(layer);
Protein protein = createProtein();
protein.setElementId("art0");
model.addElement(protein);
Protein protein2 = createProtein();
protein2.setElementId("art1");
model.addElement(protein2);
CreateHierarchyCommand command = new CreateHierarchyCommand(model, 4, 80);
command.createArtificials();
PathwayCompartment pathway = (PathwayCompartment) model.getCompartments().get(0);
assertNotNull(pathway);
assertFalse(layerText.getNotes().contains("SemanticZoomLevelVisibility"));
}
}
Supports Markdown
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