Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
eaad0237
Commit
eaad0237
authored
Oct 02, 2017
by
Björn Richerzhagen
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Allow multiple NodeInfoVis (through custom name)
parent
fbd64f3f
Changes
2
Show whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/views/VisualizationTopologyView.java
View file @
eaad0237
...
@@ -43,6 +43,7 @@ import java.util.Collection;
...
@@ -43,6 +43,7 @@ import java.util.Collection;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentLinkedQueue
;
import
java.util.concurrent.ConcurrentLinkedQueue
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.concurrent.CopyOnWriteArrayList
;
...
@@ -387,7 +388,7 @@ public class VisualizationTopologyView extends JFrame
...
@@ -387,7 +388,7 @@ public class VisualizationTopologyView extends JFrame
*/
*/
protected
class
WorldPanel
extends
JLayeredPane
{
protected
class
WorldPanel
extends
JLayeredPane
{
protected
HashMap
<
INodeID
,
VisNodeInformation
>
nodeInformation
=
new
HashMap
<
INodeID
,
VisNodeInformation
>();
protected
Concurrent
HashMap
<
INodeID
,
VisNodeInformation
>
nodeInformation
=
new
Concurrent
HashMap
<
INodeID
,
VisNodeInformation
>();
protected
final
static
int
PADDING
=
16
;
protected
final
static
int
PADDING
=
16
;
...
...
src/de/tud/kom/p2psim/impl/topology/views/visualization/world/NodeInfoComponentVis.java
View file @
eaad0237
...
@@ -62,18 +62,22 @@ public class NodeInfoComponentVis extends JComponent
...
@@ -62,18 +62,22 @@ public class NodeInfoComponentVis extends JComponent
protected
Collection
<
NodeVis
>
nodes
=
new
LinkedList
<>();
protected
Collection
<
NodeVis
>
nodes
=
new
LinkedList
<>();
private
JMenu
menu
=
new
JMenu
(
"Node Info
rmation
"
);
private
JMenu
menu
=
new
JMenu
(
"Node Info"
);
protected
boolean
[]
activeLayers
=
null
;
protected
boolean
[]
activeLayers
=
null
;
boolean
hideInactiveNodes
=
false
;
boolean
hideInactiveNodes
=
false
;
private
final
String
name
;
public
<
T
extends
HostComponent
>
NodeInfoComponentVis
(
public
<
T
extends
HostComponent
>
NodeInfoComponentVis
(
final
Class
<
T
>
componentClass
)
{
final
Class
<
T
>
componentClass
)
{
setBounds
(
0
,
0
,
VisualizationInjector
.
getWorldX
(),
setBounds
(
0
,
0
,
VisualizationInjector
.
getWorldX
(),
VisualizationInjector
.
getWorldY
());
VisualizationInjector
.
getWorldY
());
setOpaque
(
true
);
setOpaque
(
true
);
setVisible
(
true
);
setVisible
(
true
);
this
.
name
=
componentClass
.
getSimpleName
();
menu
.
setText
(
"Info: "
+
name
);
Event
.
scheduleWithDelay
(
1
*
Time
.
MICROSECOND
,
new
EventHandler
()
{
Event
.
scheduleWithDelay
(
1
*
Time
.
MICROSECOND
,
new
EventHandler
()
{
@Override
@Override
...
@@ -312,7 +316,7 @@ public class NodeInfoComponentVis extends JComponent
...
@@ -312,7 +316,7 @@ public class NodeInfoComponentVis extends JComponent
@Override
@Override
public
String
getDisplayName
()
{
public
String
getDisplayName
()
{
return
"
Node Information"
;
return
"
Info: "
+
name
;
}
}
}
}
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