@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); }); }
public static GraphContainer.Callback applyDefaultCriteria() { return (graphContainer, graphProvider) -> { List<Criteria> defaultCriteriaList = graphProvider.getDefaults().getCriteria(); if (defaultCriteriaList != null) { defaultCriteriaList.forEach(graphContainer::addCriteria); } }; }
@Override public Defaults getDefaults() { return new Defaults() .withCriteria(() -> { if (getVertices().isEmpty()) { return Lists.newArrayList(); } return getVertices().stream().filter(e -> Icons.DATACENTER.equals(e.getIconKey())).map(DefaultVertexHopCriteria::new).collect(Collectors.toList()); }); }
@Override public Defaults getDefaults() { return new Defaults() .withPreferredLayout("Hierarchy Layout") .withCriteria(() -> { // Only show the first application by default List<OnmsApplication> applications = applicationDao.findAll(); if (!applications.isEmpty()) { return Lists.newArrayList(new VertexHopGraphProvider.DefaultVertexHopCriteria(new ApplicationVertex(applications.get(0)))); } return null; }); }
@Override public Defaults getDefaults() { return new Defaults(); }
@Override public Defaults getDefaults() { return new Defaults() .withPreferredLayout("Hierarchy Layout") .withCriteria(() -> { // Only show the first application by default List<OnmsApplication> applications = applicationDao.findAll(); if (!applications.isEmpty()) { return Lists.newArrayList(new VertexHopGraphProvider.DefaultVertexHopCriteria(new ApplicationVertex(applications.get(0)))); } return null; }); }
@Override public Defaults getDefaults() { return new Defaults() .withCriteria(() -> { if (getVertices().isEmpty()) { return Lists.newArrayList(); } return getVertices().stream().filter(e -> Icons.DATACENTER.equals(e.getIconKey())).map(DefaultVertexHopCriteria::new).collect(Collectors.toList()); }); }
@Override public Defaults getDefaults() { return new Defaults(); }
@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() .withPreferredLayout("Hierarchy Layout") .withCriteria(() -> { // Grab the business service with the smallest id List<BusinessService> businessServices = businessServiceManager.findMatching(new CriteriaBuilder(BusinessService.class).orderBy("id", true).limit(1).toCriteria()); // If one was found, use it for the default focus if (!businessServices.isEmpty()) { BusinessService businessService = businessServices.iterator().next(); BusinessServiceVertex businessServiceVertex = new BusinessServiceVertex(businessService, 0); return Lists.newArrayList(new VertexHopGraphProvider.DefaultVertexHopCriteria(businessServiceVertex)); } return null; }); }
@Override public Defaults getDefaults() { return new Defaults(); }
public static GraphContainer.Callback applyDefaultCriteria() { return (graphContainer, graphProvider) -> { List<Criteria> defaultCriteriaList = graphProvider.getDefaults().getCriteria(); if (defaultCriteriaList != null) { defaultCriteriaList.forEach(graphContainer::addCriteria); } }; }
@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(); }); }
@Override public void buttonClick(Button.ClickEvent event) { List<Criteria> defaultCriteriaList = graphContainer.getTopologyServiceClient().getDefaults().getCriteria(); if (defaultCriteriaList != null && !defaultCriteriaList.isEmpty()) { defaultCriteriaList.forEach(graphContainer::addCriteria); graphContainer.redoLayout(); noDefaultsAvailable.setVisible(false); } else { noDefaultsAvailable.setVisible(true); } } });
@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 void buttonClick(Button.ClickEvent event) { List<Criteria> defaultCriteriaList = graphContainer.getTopologyServiceClient().getDefaults().getCriteria(); if (defaultCriteriaList != null && !defaultCriteriaList.isEmpty()) { defaultCriteriaList.forEach(graphContainer::addCriteria); graphContainer.redoLayout(); noDefaultsAvailable.setVisible(false); } else { noDefaultsAvailable.setVisible(true); } } });
@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(); } }); }
public void handleClick(Breadcrumb breadcrumb, GraphContainer graphContainer) { final GraphProvider targetGraphProvider = graphContainer.getTopologyServiceClient().getGraphProviderBy(breadcrumb.getTargetNamespace()); if (isLeaf(breadcrumb)) { if (breadcrumb.getSourceVertices().isEmpty()) { final List<VertexRef> defaultFocus = targetGraphProvider.getDefaults().getCriteria() .stream() .filter(c -> c instanceof VertexHopGraphProvider.VertexHopCriteria) .map(c -> ((VertexHopGraphProvider.VertexHopCriteria) c).getVertices()) .flatMap(Set::stream) .collect(Collectors.toList()); handleClick(graphContainer, targetGraphProvider, defaultFocus, breadcrumb); } else { List<VertexRef> oppositeVertices = breadcrumb.getSourceVertices().stream().flatMap(sourceVertex -> getOppositeVertices(graphContainer, breadcrumb.getTargetNamespace(), sourceVertex).stream()).collect(Collectors.toList()); handleClick(graphContainer, targetGraphProvider, oppositeVertices, breadcrumb); } } else { Breadcrumb next = getNext(breadcrumb); handleClick(graphContainer, targetGraphProvider, next.getSourceVertices(), breadcrumb); } }
public void handleClick(Breadcrumb breadcrumb, GraphContainer graphContainer) { final GraphProvider targetGraphProvider = graphContainer.getTopologyServiceClient().getGraphProviderBy(breadcrumb.getTargetNamespace()); if (isLeaf(breadcrumb)) { if (breadcrumb.getSourceVertices().isEmpty()) { final List<VertexRef> defaultFocus = targetGraphProvider.getDefaults().getCriteria() .stream() .filter(c -> c instanceof VertexHopGraphProvider.VertexHopCriteria) .map(c -> ((VertexHopGraphProvider.VertexHopCriteria) c).getVertices()) .flatMap(Set::stream) .collect(Collectors.toList()); handleClick(graphContainer, targetGraphProvider, defaultFocus, breadcrumb); } else { List<VertexRef> oppositeVertices = breadcrumb.getSourceVertices().stream().flatMap(sourceVertex -> getOppositeVertices(graphContainer, breadcrumb.getTargetNamespace(), sourceVertex).stream()).collect(Collectors.toList()); handleClick(graphContainer, targetGraphProvider, oppositeVertices, breadcrumb); } } else { Breadcrumb next = getNext(breadcrumb); handleClick(graphContainer, targetGraphProvider, next.getSourceVertices(), breadcrumb); } }
List<Criteria> defaultCriteriaList = m_graphContainer.getTopologyServiceClient().getDefaults().getCriteria(); if (defaultCriteriaList != null) {