Skip to content
Snippets Groups Projects

issues that were discovered during biohackathon 2019 in Paris

Merged Piotr Gawron requested to merge wikipathways-issues into master
58 files
+ 1571
462
Compare changes
  • Side-by-side
  • Inline
Files
58
@@ -37,8 +37,6 @@ public class ZIndexPopulator {
* @param model
*/
public void populateZIndex(Model model) {
int maxZIndex = 0;
List<Drawable> bioEntities = new ArrayList<>();
for (Layer layer : model.getLayers()) {
bioEntities.addAll(layer.getOvals());
@@ -46,7 +44,15 @@ public class ZIndexPopulator {
bioEntities.addAll(layer.getTexts());
}
bioEntities.addAll(model.getBioEntities());
bioEntities.sort(new Comparator<Drawable>() {
populateZIndex(bioEntities);
}
public void populateZIndex(Collection<? extends Drawable> drawables) {
List<? extends Drawable> sortedDrawables=new ArrayList<>(drawables);
int maxZIndex = 0;
sortedDrawables.sort(new Comparator<Drawable>() {
@Override
public int compare(Drawable o1, Drawable o2) {
if (o1 instanceof Reaction) {
@@ -91,11 +97,10 @@ public class ZIndexPopulator {
}
});
for (Drawable bioEntity : bioEntities) {
for (Drawable bioEntity : sortedDrawables) {
if (bioEntity.getZ() == null) {
bioEntity.setZ(++maxZIndex);
}
}
}
}
Loading