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
593b509f
Commit
593b509f
authored
Dec 14, 2014
by
Julius Rückert
Browse files
Added the possibility to hide visualization components from the checkbox
list.
parent
91cf2f8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/views/VisualizationTopologyView.java
View file @
593b509f
...
...
@@ -576,8 +576,14 @@ public class VisualizationTopologyView extends JFrame implements TopologyView,
public
static
void
injectComponent
(
String
name
,
int
priority
,
JComponent
component
,
boolean
active
)
{
injectComponent
(
name
,
priority
,
component
,
active
,
true
);
}
public
static
void
injectComponent
(
String
name
,
int
priority
,
JComponent
component
,
boolean
active
,
boolean
showInList
)
{
VisInfo
visInfo
=
new
VisInfo
(
name
,
priority
,
component
);
visInfo
.
setActiveByDefault
(
active
);
visInfo
.
setShowInList
(
showInList
);
components
.
add
(
visInfo
);
nameToVisInfoMap
.
put
(
name
,
visInfo
);
...
...
src/de/tud/kom/p2psim/impl/topology/views/visualization/ComponentVisManager.java
View file @
593b509f
...
...
@@ -246,12 +246,15 @@ public class ComponentVisManager {
* @version 1.0, 12.07.2012
*/
public
static
class
VisInfo
{
private
String
name
;
private
int
priority
;
private
boolean
activeByDefault
=
true
;
private
boolean
showInList
=
true
;
private
List
<
JComponent
>
components
=
Lists
.
newArrayList
();
public
VisInfo
(
String
name
,
int
priority
,
JComponent
...
component
)
{
...
...
@@ -299,6 +302,14 @@ public class ComponentVisManager {
public
void
setActiveByDefault
(
boolean
activeByDefault
)
{
this
.
activeByDefault
=
activeByDefault
;
}
public
boolean
isShowInList
()
{
return
showInList
;
}
public
void
setShowInList
(
boolean
showInList
)
{
this
.
showInList
=
showInList
;
}
}
/**
...
...
src/de/tud/kom/p2psim/impl/topology/views/visualization/ui/ComponentToggler.java
View file @
593b509f
...
...
@@ -105,7 +105,9 @@ public class ComponentToggler extends JPanel {
constraints
.
weighty
=
0
;
constraints
.
ipady
=
0
;
add
(
checkBox
,
constraints
);
if
(
visInfo
.
isShowInList
())
add
(
checkBox
,
constraints
);
componentNameToCheckBoxMap
.
put
(
visInfo
.
getName
(),
checkBox
);
for
(
JComponent
comp
:
visInfo
.
getComponents
())
{
...
...
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