use of com.vaadin.ui.FormLayout in project opennms by OpenNMS.
the class BusinessServiceEdgeInfoPanelItemProvider method createComponent.
private Component createComponent(BusinessServiceEdge ref) {
FormLayout formLayout = new FormLayout();
formLayout.setMargin(false);
formLayout.setSpacing(false);
formLayout.addComponent(createLabel("Map Function", describeMapFunction(ref.getMapFunction())));
formLayout.addComponent(createLabel("Weight", Float.toString(ref.getWeight())));
return formLayout;
}
use of com.vaadin.ui.FormLayout in project opennms by OpenNMS.
the class BusinessServiceEdgeStatusInfoPanelItemProvider method createComponent.
private Component createComponent(BusinessServiceEdge ref, GraphContainer container) {
FormLayout formLayout = new FormLayout();
formLayout.setMargin(false);
formLayout.setSpacing(false);
formLayout.addStyleName("severity");
final BusinessServiceStateMachine stateMachine = SimulationAwareStateMachineFactory.createStateMachine(businessServiceManager, container.getCriteria());
final Status outgoingStatus = BusinessServicesStatusProvider.getStatus(stateMachine, ref);
final Status incomingStatus = BusinessServicesStatusProvider.getStatus(stateMachine, ((AbstractBusinessServiceVertex) ref.getTarget().getVertex()));
formLayout.addComponent(createStatusLabel("Outgoing Severity", outgoingStatus));
formLayout.addComponent(createStatusLabel("Incoming Severity", incomingStatus));
return formLayout;
}
use of com.vaadin.ui.FormLayout in project opennms by OpenNMS.
the class BusinessServiceVertexAttributesInfoPanelItemProvider method createComponent.
private Component createComponent(VertexRef ref) {
final FormLayout formLayout = new FormLayout();
formLayout.setSpacing(false);
formLayout.setMargin(false);
final BusinessService businessService = businessServiceManager.getBusinessServiceById(((BusinessServiceVertex) ref).getServiceId());
for (Map.Entry<String, String> e : businessService.getAttributes().entrySet()) {
formLayout.addComponent(createLabel(e.getKey(), e.getValue()));
}
return formLayout;
}
use of com.vaadin.ui.FormLayout in project opennms by OpenNMS.
the class BusinessServiceVertexInfoPanelItemProvider method createComponent.
private Component createComponent(AbstractBusinessServiceVertex ref, GraphContainer graphContainer) {
final FormLayout formLayout = new FormLayout();
formLayout.setSpacing(false);
formLayout.setMargin(false);
ref.accept(new BusinessServiceVertexVisitor<Void>() {
@Override
public Void visit(BusinessServiceVertex vertex) {
final BusinessService businessService = businessServiceManager.getBusinessServiceById(vertex.getServiceId());
formLayout.addComponent(createLabel("Reduce function", getReduceFunctionDescription(businessService.getReduceFunction())));
// Apply Reduce Function specific details
businessService.getReduceFunction().accept(new ReduceFunctionVisitor<Void>() {
@Override
public Void visit(HighestSeverity highestSeverity) {
return null;
}
@Override
public Void visit(HighestSeverityAbove highestSeverityAbove) {
return null;
}
@Override
public // Threshold is not very transparent, we add an Explain Button in these cases
Void visit(Threshold threshold) {
final Button explainButton = createButton("Explain", "Explain the Threshold function", FontAwesome.TABLE, (Button.ClickListener) event -> {
ThresholdExplanationWindow explainWindow = new ThresholdExplanationWindow(SimulationAwareStateMachineFactory.createSimulatedStateMachine(businessServiceManager, graphContainer.getCriteria()).explain(businessService, (Threshold) businessService.getReduceFunction()));
UI.getCurrent().addWindow(explainWindow);
});
explainButton.setStyleName(BaseTheme.BUTTON_LINK);
formLayout.addComponent(explainButton);
return null;
}
@Override
public Void visit(ExponentialPropagation exponentialPropagation) {
return null;
}
});
return null;
}
@Override
public Void visit(IpServiceVertex vertex) {
IpService ipService = businessServiceManager.getIpServiceById(vertex.getIpServiceId());
formLayout.addComponent(createLabel("Interface", ipService.getIpAddress()));
formLayout.addComponent(createLabel("Service", ipService.getServiceName()));
if (!ipService.getServiceName().equals(vertex.getLabel())) {
formLayout.addComponent(createLabel("Friendly Name", vertex.getLabel()));
}
return null;
}
@Override
public Void visit(ReductionKeyVertex vertex) {
formLayout.addComponent(createLabel("Reduction Key", vertex.getReductionKey()));
if (!vertex.getReductionKey().equals(vertex.getLabel())) {
formLayout.addComponent(createLabel("Friendly Name", vertex.getLabel()));
}
return null;
}
});
return formLayout;
}
use of com.vaadin.ui.FormLayout in project opennms by OpenNMS.
the class DefaultEdgeInfoPanelItemProvider method createComponent.
private Component createComponent(EdgeRef ref) {
FormLayout formLayout = new FormLayout();
formLayout.setSpacing(false);
formLayout.setMargin(false);
if (ref instanceof AbstractEdge) {
AbstractEdge edge = (AbstractEdge) ref;
formLayout.addComponent(createLabel("Source", edge.getSource().getVertex().getLabel()));
formLayout.addComponent(createLabel("Target", edge.getTarget().getVertex().getLabel()));
}
return formLayout;
}
Aggregations