Commit 9527bf02 authored by DanFaria's avatar DanFaria
Browse files

Fixed instance mapping viewing in ViewMapping

parent c661a097
...@@ -552,9 +552,15 @@ public class ViewMapping extends JDialog implements ActionListener ...@@ -552,9 +552,15 @@ public class ViewMapping extends JDialog implements ActionListener
{ {
if(a == null) if(a == null)
return; return;
for(Mapping m : a) for(int i : nodes)
if(nodes.contains(m.getSourceId()) && nodes.contains(m.getTargetId())) {
addMapping(m.getSourceId(), m.getTargetId()); for(int j : a.getSourceMappings(i))
if(nodes.contains(j))
addMapping(i, j);
for(int j : a.getTargetMappings(i))
if(nodes.contains(j))
addMapping(j, i);
}
} }
//Adds all ancestors of the given entity to the graph //Adds all ancestors of the given entity to the graph
...@@ -586,26 +592,17 @@ public class ViewMapping extends JDialog implements ActionListener ...@@ -586,26 +592,17 @@ public class ViewMapping extends JDialog implements ActionListener
} }
else if(t.equals(EntityType.INDIVIDUAL)) else if(t.equals(EntityType.INDIVIDUAL))
{ {
for(int i = 0; i < individualDistance; i++) for(int k : rm.getIndividualActiveRelations(id))
{ {
descendants = new HashSet<Integer>(ancestors); Set<Integer> rels = rm.getIndividualProperties(id, k);
ancestors = new HashSet<Integer>(); if(rels.size() > 0)
for(int j : descendants)
{ {
for(int k : rm.getIndividualActiveRelations(j)) if(directedGraph.getNode("" + k) == null)
{ addNode(k, 6);
Set<Integer> rels = rm.getIndividualProperties(j, k); if(!edges.contains(id,k) && !edges.contains(k,id))
if(rels.size() > 0) addEdge(id, k, rels.iterator().next());
{
if(directedGraph.getNode("" + k) == null)
addNode(k, 6);
if(!edges.contains(j,k) && !edges.contains(k,j))
addEdge(j, k, rels.iterator().next());
}
ancestors.add(k);
}
} }
nodes.addAll(ancestors); nodes.add(k);
} }
} }
} }
...@@ -637,30 +634,6 @@ public class ViewMapping extends JDialog implements ActionListener ...@@ -637,30 +634,6 @@ public class ViewMapping extends JDialog implements ActionListener
nodes.addAll(descendants); nodes.addAll(descendants);
} }
} }
else if(t.equals(EntityType.INDIVIDUAL))
{
for(int i = 0; i < individualDistance; i++)
{
ancestors = new HashSet<Integer>(descendants);
descendants = new HashSet<Integer>();
for(int j : ancestors)
{
for(int k : rm.getIndividualPassiveRelations(j))
{
Set<Integer> rels = rm.getIndividualProperties(j, k);
if(rels.size() > 0)
{
if(directedGraph.getNode("" + k) == null)
addNode(k, 6);
if(!edges.contains(j,k) && !edges.contains(k,j))
addEdge(k, j, rels.iterator().next());
}
descendants.add(k);
}
}
nodes.addAll(descendants);
}
}
} }
//Adds an anonymous edge between two entities to the graph (for subclass relations) //Adds an anonymous edge between two entities to the graph (for subclass relations)
......
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