use of org.opennms.features.topology.api.support.VertexHopGraphProvider.VertexHopCriteria in project opennms by OpenNMS.
the class SearchBox method updateTokenFieldList.
private void updateTokenFieldList(GraphContainer graphContainer) {
final List<SearchSuggestion> suggestions = Lists.newArrayList();
final Criteria[] criterium = graphContainer.getCriteria();
for (Criteria criteria : criterium) {
try {
CollapsibleCriteria crit = (CollapsibleCriteria) criteria;
SearchSuggestion suggestion = new SearchSuggestion(crit.getNamespace(), crit.getId(), crit.getLabel());
suggestion.setCollapsible(true);
suggestion.setCollapsed(crit.isCollapsed());
suggestions.add(suggestion);
continue;
} catch (ClassCastException e) {
}
try {
VertexHopCriteria crit = (VertexHopCriteria) criteria;
SearchSuggestion suggestion = new SearchSuggestion(crit.getNamespace(), crit.getId(), crit.getLabel());
suggestions.add(suggestion);
continue;
} catch (ClassCastException e) {
}
}
getState().setFocused(suggestions);
}
use of org.opennms.features.topology.api.support.VertexHopGraphProvider.VertexHopCriteria in project opennms by OpenNMS.
the class SearchBox method removeIfSuggMapEmpty.
private void removeIfSuggMapEmpty(SearchResult searchResult, GraphContainer graphContainer) {
Criteria[] criterias = graphContainer.getCriteria();
for (Criteria criteria : criterias) {
if (criteria == null || !(criteria instanceof VertexHopCriteria)) {
continue;
}
VertexHopCriteria crit = (VertexHopCriteria) criteria;
String critNameSpace = crit.getNamespace();
if (critNameSpace == null) {
continue;
}
String critId = crit.getId();
if (critId == null) {
continue;
}
String critLabel = crit.getLabel();
if (critLabel == null) {
continue;
}
String resultNameSpace = searchResult.getNamespace();
String resultId = searchResult.getId();
String resultLabel = searchResult.getLabel();
if (critNameSpace.equals(resultNameSpace) && critId.equals(resultId) && critLabel.equals(resultLabel)) {
graphContainer.removeCriteria(crit);
}
}
}
use of org.opennms.features.topology.api.support.VertexHopGraphProvider.VertexHopCriteria in project opennms by OpenNMS.
the class GraphPainter method visitGraph.
@Override
public void visitGraph(Graph graph) throws PaintException {
m_focusVertices.clear();
Criteria[] criterias = m_graphContainer.getCriteria();
for (Criteria criteria : criterias) {
try {
VertexHopCriteria c = (VertexHopCriteria) criteria;
m_focusVertices.addAll(c.getVertices());
} catch (ClassCastException e) {
}
}
m_statusMap.clear();
m_statusMap.putAll(graph.getVertexStatus());
m_edgeStatusMap.clear();
m_edgeStatusMap.putAll(graph.getEdgeStatus());
}
Aggregations