Commit 593b509f authored by Julius Rückert's avatar Julius Rückert
Browse files

Added the possibility to hide visualization components from the checkbox

list.
parent 91cf2f8b
......@@ -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);
......
......@@ -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;
}
}
/**
......
......@@ -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()) {
......
Markdown is supported
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