Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
YoshikoWrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Philipp Spohr
YoshikoWrapper
Commits
65c2f4f5
Commit
65c2f4f5
authored
7 years ago
by
Philipp Spohr
Browse files
Options
Downloads
Patches
Plain Diff
Implemented edge-width scaling in meta-graph
parent
a6f0d70e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoSolution.java
+26
-10
26 additions, 10 deletions
.../de/hhu/ba/yoshikoWrapper/graphModel/YoshikoSolution.java
with
26 additions
and
10 deletions
src/main/java/de/hhu/ba/yoshikoWrapper/graphModel/YoshikoSolution.java
+
26
−
10
View file @
65c2f4f5
...
@@ -27,6 +27,7 @@ import java.util.HashMap;
...
@@ -27,6 +27,7 @@ import java.util.HashMap;
import
org.cytoscape.model.CyEdge
;
import
org.cytoscape.model.CyEdge
;
import
org.cytoscape.model.CyNetwork
;
import
org.cytoscape.model.CyNetwork
;
import
org.cytoscape.model.CyNode
;
import
org.cytoscape.model.CyNode
;
import
org.cytoscape.model.CyEdge.Type
;
import
org.cytoscape.model.subnetwork.CySubNetwork
;
import
org.cytoscape.model.subnetwork.CySubNetwork
;
import
org.cytoscape.view.layout.CyLayoutAlgorithm
;
import
org.cytoscape.view.layout.CyLayoutAlgorithm
;
import
org.cytoscape.view.model.CyNetworkView
;
import
org.cytoscape.view.model.CyNetworkView
;
...
@@ -70,6 +71,10 @@ public class YoshikoSolution {
...
@@ -70,6 +71,10 @@ public class YoshikoSolution {
//Add nodes
//Add nodes
for
(
YoshikoCluster
c:
cluster
)
{
for
(
YoshikoCluster
c:
cluster
)
{
VisualStyle
vs
=
CyCore
.
visualStyleFactory
.
createVisualStyle
(
CyCore
.
visualMappingManager
.
getCurrentVisualStyle
());
CyNode
clusterNode
=
metaGraph
.
addNode
();
CyNode
clusterNode
=
metaGraph
.
addNode
();
CySubNetwork
subnet
=
c
.
getSubNetwork
();
CySubNetwork
subnet
=
c
.
getSubNetwork
();
CyCore
.
networkManager
.
addNetwork
(
subnet
);
CyCore
.
networkManager
.
addNetwork
(
subnet
);
...
@@ -85,9 +90,9 @@ public class YoshikoSolution {
...
@@ -85,9 +90,9 @@ public class YoshikoSolution {
null
null
)
)
);
);
VisualStyle
vs
=
CyCore
.
visualStyleFactory
.
createVisualStyle
(
CyCore
.
visualMappingManager
.
getCurrentVisualStyle
());
CyCore
.
visualMappingManager
.
setVisualStyle
(
vs
,
subnetView
);
CyCore
.
visualMappingManager
.
setVisualStyle
(
vs
,
subnetView
);
vs
.
apply
(
subnetView
);
vs
.
apply
(
subnetView
);
subnetView
.
updateView
();
clusterNode
.
setNetworkPointer
(
subnet
);
clusterNode
.
setNetworkPointer
(
subnet
);
//Set node attributes
//Set node attributes
metaGraph
.
getRow
(
clusterNode
).
set
(
"name"
,
LocalizationManager
.
get
(
"cluster"
)+
" "
+
c
.
getID
());
metaGraph
.
getRow
(
clusterNode
).
set
(
"name"
,
LocalizationManager
.
get
(
"cluster"
)+
" "
+
c
.
getID
());
...
@@ -107,13 +112,16 @@ public class YoshikoSolution {
...
@@ -107,13 +112,16 @@ public class YoshikoSolution {
for
(
CyNode
c1n
:
c1
.
getSubNetwork
().
getNodeList
())
{
for
(
CyNode
c1n
:
c1
.
getSubNetwork
().
getNodeList
())
{
for
(
CyNode
c2n
:
c2
.
getSubNetwork
().
getNodeList
())
{
for
(
CyNode
c2n
:
c2
.
getSubNetwork
().
getNodeList
())
{
if
(
originalGraph
.
containsEdge
(
c1n
,
c2n
)
||
originalGraph
.
containsEdge
(
c2n
,
c1n
))
{
if
(
originalGraph
.
containsEdge
(
c1n
,
c2n
)
||
originalGraph
.
containsEdge
(
c2n
,
c1n
))
{
if
(
metaGraph
.
containsEdge
(
map
.
get
(
c1
),
map
.
get
(
c2
))){
if
(!
metaGraph
.
containsEdge
(
map
.
get
(
c1
),
map
.
get
(
c2
))){
//TODO: Update weight
}
else
{
CyEdge
edge
=
metaGraph
.
addEdge
(
map
.
get
(
c1
),
map
.
get
(
c2
),
false
);
CyEdge
edge
=
metaGraph
.
addEdge
(
map
.
get
(
c1
),
map
.
get
(
c2
),
false
);
metaGraph
.
getRow
(
edge
).
set
(
"edgeStrength"
,
1
);
metaGraph
.
getRow
(
edge
).
set
(
"edgeStrength"
,
1
);
}
}
else
{
CyEdge
edge
=
metaGraph
.
getConnectingEdgeList
(
map
.
get
(
c1
),
map
.
get
(
c2
),
Type
.
ANY
).
get
(
0
);
metaGraph
.
getRow
(
edge
).
set
(
"edgeStrength"
,
metaGraph
.
getRow
(
edge
).
get
(
"edgeStrength"
,
Integer
.
class
)+
1
);
}
}
}
}
}
}
}
...
@@ -131,6 +139,9 @@ public class YoshikoSolution {
...
@@ -131,6 +139,9 @@ public class YoshikoSolution {
)
)
);
);
VisualStyle
vs
=
CyCore
.
visualStyleFactory
.
createVisualStyle
(
CyCore
.
visualMappingManager
.
getCurrentVisualStyle
());
CyCore
.
networkManager
.
addNetwork
(
metaGraph
);
CyCore
.
networkManager
.
addNetwork
(
metaGraph
);
CyCore
.
networkViewManager
.
addNetworkView
(
CyCore
.
networkViewManager
.
addNetworkView
(
view
view
...
@@ -143,15 +154,20 @@ public class YoshikoSolution {
...
@@ -143,15 +154,20 @@ public class YoshikoSolution {
BasicVisualLexicon
.
NODE_SIZE
BasicVisualLexicon
.
NODE_SIZE
);
);
VisualStyle
vs
=
CyCore
.
visualStyleFactory
.
createVisualStyle
(
CyCore
.
visualMappingManager
.
getCurrentVisualStyle
());
ContinuousMapping
<
Integer
,
Double
>
contMapEdges
=
(
ContinuousMapping
<
Integer
,
Double
>)
CyCore
.
continuousMappingFactory
.
createVisualMappingFunction
(
vs
.
addVisualMappingFunction
(
contMap
);
"edgeStrength"
,
CyCore
.
visualMappingManager
.
addVisualStyle
(
vs
);
Integer
.
class
,
CyCore
.
cy
.
setCurrentNetworkView
(
view
);
BasicVisualLexicon
.
EDGE_WIDTH
);
//Apply visual style
//Apply visual style
CyCore
.
visualMappingManager
.
setVisualStyle
(
vs
,
view
);
CyCore
.
visualMappingManager
.
setVisualStyle
(
vs
,
view
);
vs
.
addVisualMappingFunction
(
contMap
);
vs
.
addVisualMappingFunction
(
contMapEdges
);
vs
.
apply
(
view
);
vs
.
apply
(
view
);
view
.
updateView
();
view
.
updateView
();
CyCore
.
cy
.
setCurrentNetworkView
(
view
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment