@Override public Defaults getDefaults() { return new Defaults() .withSemanticZoomLevel(defaultSzl) .withPreferredLayout(preferredLayout) .withCriteria(() -> { List<VertexHopGraphProvider.VertexHopCriteria> focusCriteria = focusStrategy.getFocusCriteria(this, focusIds.toArray(new String[focusIds.size()])); return Lists.newArrayList(focusCriteria); }); }
@Override public Defaults getDefaults() { return new Defaults() .withSemanticZoomLevel(defaultSzl) .withPreferredLayout(preferredLayout) .withCriteria(() -> { List<VertexHopGraphProvider.VertexHopCriteria> focusCriteria = focusStrategy.getFocusCriteria(this, focusIds.toArray(new String[focusIds.size()])); return Lists.newArrayList(focusCriteria); }); }
@Override public Defaults getDefaults() { // Current implementation of default focus strategy either creates a DefaultVertexHopCriteria for // semantic zoom level 0 and the node with the worst state; or for the first node (if all nodes have state NORMAL) return new Defaults() .withSemanticZoomLevel(0) .withPreferredLayout("Hierarchy Layout") .withCriteria(() -> { Map<VertexRef, Status> resultMap = statusProvider.getStatusForVertices(this, Lists.newArrayList(this.getVertices()), new Criteria[0]); Optional<Map.Entry<VertexRef, Status>> max = resultMap.entrySet().stream().max(Comparator.comparing(e -> OnmsSeverity.get(e.getValue().computeStatus()))); if (max.isPresent()) { return Lists.newArrayList(new VertexHopGraphProvider.DefaultVertexHopCriteria(max.get().getKey())); } else if (this.getVertexTotalCount() > 0) { return Lists.newArrayList(new VertexHopGraphProvider.DefaultVertexHopCriteria(this.getVertices().get(0))); } else { return Lists.newArrayList(); } }); }
@Override public Defaults getDefaults() { // Current implementation of default focus strategy either creates a DefaultVertexHopCriteria for // semantic zoom level 0 and the node with the worst state; or for the first node (if all nodes have state NORMAL) return new Defaults() .withSemanticZoomLevel(0) .withPreferredLayout("Hierarchy Layout") .withCriteria(() -> { Map<VertexRef, Status> resultMap = statusProvider.getStatusForVertices(this, Lists.newArrayList(this.getVertices()), new Criteria[0]); Optional<Map.Entry<VertexRef, Status>> max = resultMap.entrySet().stream().max(Comparator.comparing(e -> OnmsSeverity.get(e.getValue().computeStatus()))); if (max.isPresent()) { return Lists.newArrayList(new VertexHopGraphProvider.DefaultVertexHopCriteria(max.get().getKey())); } else if (this.getVertexTotalCount() > 0) { return Lists.newArrayList(new VertexHopGraphProvider.DefaultVertexHopCriteria(this.getVertices().get(0))); } else { return Lists.newArrayList(); } }); }
@Override public Defaults getDefaults() { return new Defaults() .withSemanticZoomLevel(Defaults.DEFAULT_SEMANTIC_ZOOM_LEVEL) .withPreferredLayout("D3 Layout") // D3 Layout .withCriteria(() -> { final OnmsNode node = m_nodeDao.getDefaultFocusPoint(); if (node != null) { final Vertex defaultVertex = getVertex(TOPOLOGY_NAMESPACE_LINKD, node.getNodeId()); if (defaultVertex != null) { return Lists.newArrayList(LinkdHopCriteria.createCriteria(node.getNodeId(), node.getLabel())); } } return Lists.newArrayList(); }); }