Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Pichot
AML-E-Project
Commits
9527bf02
Commit
9527bf02
authored
Jul 23, 2019
by
DanFaria
Browse files
Fixed instance mapping viewing in ViewMapping
parent
c661a097
Changes
1
Hide whitespace changes
Inline
Side-by-side
AgreementMakerLight/src/aml/ui/ViewMapping.java
View file @
9527bf02
...
...
@@ -552,9 +552,15 @@ public class ViewMapping extends JDialog implements ActionListener
{
if
(
a
==
null
)
return
;
for
(
Mapping
m
:
a
)
if
(
nodes
.
contains
(
m
.
getSourceId
())
&&
nodes
.
contains
(
m
.
getTargetId
()))
addMapping
(
m
.
getSourceId
(),
m
.
getTargetId
());
for
(
int
i
:
nodes
)
{
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
...
...
@@ -586,26 +592,17 @@ public class ViewMapping extends JDialog implements ActionListener
}
else
if
(
t
.
equals
(
EntityType
.
INDIVIDUAL
))
{
for
(
int
i
=
0
;
i
<
individualDistance
;
i
++
)
for
(
int
k
:
rm
.
getIndividualActiveRelations
(
id
)
)
{
descendants
=
new
HashSet
<
Integer
>(
ancestors
);
ancestors
=
new
HashSet
<
Integer
>();
for
(
int
j
:
descendants
)
Set
<
Integer
>
rels
=
rm
.
getIndividualProperties
(
id
,
k
);
if
(
rels
.
size
()
>
0
)
{
for
(
int
k
:
rm
.
getIndividualActiveRelations
(
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
(
j
,
k
,
rels
.
iterator
().
next
());
}
ancestors
.
add
(
k
);
}
if
(
directedGraph
.
getNode
(
""
+
k
)
==
null
)
addNode
(
k
,
6
);
if
(!
edges
.
contains
(
id
,
k
)
&&
!
edges
.
contains
(
k
,
id
))
addEdge
(
id
,
k
,
rels
.
iterator
().
next
());
}
nodes
.
add
All
(
ancestors
);
nodes
.
add
(
k
);
}
}
}
...
...
@@ -637,30 +634,6 @@ public class ViewMapping extends JDialog implements ActionListener
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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment