use of org.opennms.features.topology.api.support.VertexHopGraphProvider.WrappedVertexHopCriteria in project opennms by OpenNMS.
the class RemoveFocusOtherVerticesOperation method enabled.
@Override
public boolean enabled(List<VertexRef> targets, OperationContext operationContext) {
if (targets == null || targets.isEmpty()) {
return false;
}
final GraphContainer graphContainer = operationContext.getGraphContainer();
final WrappedVertexHopCriteria wrappedVertexHopCriteria = VertexHopGraphProvider.getWrappedVertexHopCriteria(graphContainer);
if (wrappedVertexHopCriteria.isEmpty()) {
return false;
}
// Are the selected vertices in focus?
for (VertexRef target : targets) {
if (!wrappedVertexHopCriteria.contains(target)) {
return false;
}
}
// Are there any other vertices in focus?
for (VertexRef vertex : wrappedVertexHopCriteria.getVertices()) {
if (!targets.contains(vertex)) {
return true;
}
}
return false;
}
use of org.opennms.features.topology.api.support.VertexHopGraphProvider.WrappedVertexHopCriteria in project opennms by OpenNMS.
the class RemoveFocusVerticesOperation method enabled.
@Override
public boolean enabled(List<VertexRef> targets, OperationContext operationContext) {
if (targets == null || targets.isEmpty()) {
return false;
}
final GraphContainer graphContainer = operationContext.getGraphContainer();
final WrappedVertexHopCriteria wrappedVertexHopCriteria = VertexHopGraphProvider.getWrappedVertexHopCriteria(graphContainer);
if (wrappedVertexHopCriteria.isEmpty()) {
return false;
}
for (VertexRef target : targets) {
// If any of the vertices are currently in the criteria, return true
if (wrappedVertexHopCriteria.contains(target)) {
return true;
}
}
return false;
}
Aggregations