本文整理了Java中org.opennms.features.topology.api.topo.Vertex.getLabel()
方法的一些代码示例,展示了Vertex.getLabel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.getLabel()
方法的具体详情如下:
包路径:org.opennms.features.topology.api.topo.Vertex
类名称:Vertex
方法名:getLabel
暂无
代码示例来源:origin: stackoverflow.com
@Override
public int hashCode()
{
return getLabel().hashCode();
}
@Override
public boolean equals(Object o) {
Vertex v = (Vertex)o;
return v.getLabel().equals(this.getLabel());
}
@Override
public String toString()
{
return getLabel();
}
代码示例来源:origin: OpenNMS/opennms
@Override
public int compare(Vertex v1, Vertex v2) {
return ComparisonChain.start()
.compare(getIndex(v1), getIndex(v2))
.compare(v1.getLabel(), v2.getLabel())
.compare(v1.getId(), v2.getId())
.result();
}
}).collect(Collectors.toList());
代码示例来源:origin: OpenNMS/opennms
private static String getTooltipText(Vertex vertex) {
String tooltipText = vertex.getTooltipText();
// If the tooltip text is null, use the label
tooltipText = (tooltipText == null ? vertex.getLabel() : tooltipText);
// If the label is null, use a blank string
return (tooltipText == null ? "" : tooltipText);
}
代码示例来源:origin: org.opennms.features.topology/api
protected static String getLabelValue(final OperationContext operationContext, final VertexRef target) {
Vertex vertex = getVertexItem(operationContext, target);
return vertex == null ? null : vertex.getLabel();
}
代码示例来源:origin: OpenNMS/opennms
protected static String getLabelValue(final OperationContext operationContext, final VertexRef target) {
Vertex vertex = getVertexItem(operationContext, target);
return vertex == null ? null : vertex.getLabel();
}
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app
@Override
public int compare(Vertex v1, Vertex v2) {
return ComparisonChain.start()
.compare(getIndex(v1), getIndex(v2))
.compare(v1.getLabel(), v2.getLabel())
.compare(v1.getId(), v2.getId())
.result();
}
}).collect(Collectors.toList());
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app
private static String getTooltipText(Vertex vertex) {
String tooltipText = vertex.getTooltipText();
// If the tooltip text is null, use the label
tooltipText = (tooltipText == null ? vertex.getLabel() : tooltipText);
// If the label is null, use a blank string
return (tooltipText == null ? "" : tooltipText);
}
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.api
protected static String getLabelValue(final OperationContext operationContext, final VertexRef target) {
Vertex vertex = getVertexItem(operationContext, target);
return vertex == null ? null : vertex.getLabel();
}
代码示例来源:origin: OpenNMS/opennms
@Override
public List<? extends VertexRef> queryVertices(SearchQuery searchQuery, GraphContainer container) {
final List<Vertex> vertices = vmwareTopologyProvider.getVertices();
return vertices.stream().filter(v -> searchQuery.matches(v.getLabel())).collect(Collectors.toList());
}
}
代码示例来源:origin: org.opennms.features.topology.plugins.topo/org.opennms.features.topology.plugins.topo.vmware
@Override
public List<? extends VertexRef> queryVertices(SearchQuery searchQuery, GraphContainer container) {
final List<Vertex> vertices = vmwareTopologyProvider.getVertices();
return vertices.stream().filter(v -> searchQuery.matches(v.getLabel())).collect(Collectors.toList());
}
}
代码示例来源:origin: org.opennms.features.topology/api
public AbstractEdge(String namespace, String id, Vertex source, Vertex target) {
super(namespace, id);
if (source == null) {
throw new IllegalArgumentException("Source is null");
} else if (target == null) {
throw new IllegalArgumentException("Target is null");
}
m_source = new SimpleConnector(namespace, id + "::" + source.getId(), source.getLabel() + " Connector", source, this);
m_target = new SimpleConnector(namespace, id + "::" + target.getId(), target.getLabel() + " Connector", target, this);
m_styleName = "edge";
}
代码示例来源:origin: OpenNMS/opennms
@Override
public List<SearchResult> query(SearchQuery searchQuery, GraphContainer graphContainer) {
LOG.debug("SearchProvider->query: called with search query: '{}'", searchQuery);
List<Vertex> vertices = m_delegate.getVertices();
List<SearchResult> searchResults = Lists.newArrayList();
for(Vertex vertex : vertices){
if(searchQuery.matches(vertex.getLabel())) {
searchResults.add(new SearchResult(vertex, false, false));
}
if(searchResults.size() > 50) {
break; // make sure we don't display too many results => its slows the display down and makes it unusuable
}
}
LOG.debug("SearchProvider->query: found {} search results.", searchResults.size());
return searchResults;
}
代码示例来源:origin: OpenNMS/opennms
@Override
public void execute(final List<VertexRef> targets, final OperationContext operationContext) {
final VertexRef target = targets.get(0);
final Vertex vertex = getVertexItem(operationContext, target);
final Optional<OnmsNode> node = getNodeIfAvailable(vertex);
final List<String> locations = monitoringLocationDao.findAll().stream().map(OnmsMonitoringLocation::getLocationName).collect(Collectors.toList());
final String defaultLocation = node.isPresent()
? node.get().getLocation().getLocationName()
: MonitoringLocationDao.DEFAULT_MONITORING_LOCATION_ID;
final List<String> ipAddresses = node.isPresent()
? Lists.newArrayList(node.get().getIpInterfaces()).stream().map(eachInterface -> InetAddressUtils.str(eachInterface.getIpAddress())).collect(Collectors.toList())
: Lists.newArrayList(vertex.getIpAddress());
final String defaultIp = getDefaultIp(vertex, node);
final String caption = String.format("Ping - %s (%s)", vertex.getLabel(), vertex.getIpAddress());
new PingWindow(pingClient,
locations, ipAddresses,
defaultLocation, defaultIp,
caption)
.open();
}
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.netutils
@Override
public void execute(final List<VertexRef> targets, final OperationContext operationContext) {
final VertexRef target = targets.get(0);
final Vertex vertex = getVertexItem(operationContext, target);
final Optional<OnmsNode> node = getNodeIfAvailable(vertex);
final List<String> locations = monitoringLocationDao.findAll().stream().map(OnmsMonitoringLocation::getLocationName).collect(Collectors.toList());
final String defaultLocation = node.isPresent()
? node.get().getLocation().getLocationName()
: MonitoringLocationDao.DEFAULT_MONITORING_LOCATION_ID;
final List<String> ipAddresses = node.isPresent()
? Lists.newArrayList(node.get().getIpInterfaces()).stream().map(eachInterface -> InetAddressUtils.str(eachInterface.getIpAddress())).collect(Collectors.toList())
: Lists.newArrayList(vertex.getIpAddress());
final String defaultIp = getDefaultIp(vertex, node);
final String caption = String.format("Ping - %s (%s)", vertex.getLabel(), vertex.getIpAddress());
new PingWindow(pingClient,
locations, ipAddresses,
defaultLocation, defaultIp,
caption)
.open();
}
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app
private String createTooltip(Vertex vertex, AddressInfo addressInfo) {
final StringBuilder tooltip = new StringBuilder();
tooltip.append(String.format("<b>%s</b>", vertex.getLabel()));
if (addressInfo != null) {
append(tooltip, "City", addressInfo.getCity());
append(tooltip, "Zip", addressInfo.getZip());
append(tooltip, "Address", addressInfo.getAddress1());
append(tooltip, "", addressInfo.getAddress2());
append(tooltip, "State", addressInfo.getState());
append(tooltip, "Country", addressInfo.getCountry());
}
return tooltip.toString();
}
代码示例来源:origin: OpenNMS/opennms
private String createTooltip(Vertex vertex, AddressInfo addressInfo) {
final StringBuilder tooltip = new StringBuilder();
tooltip.append(String.format("<b>%s</b>", vertex.getLabel()));
if (addressInfo != null) {
append(tooltip, "City", addressInfo.getCity());
append(tooltip, "Zip", addressInfo.getZip());
append(tooltip, "Address", addressInfo.getAddress1());
append(tooltip, "", addressInfo.getAddress2());
append(tooltip, "State", addressInfo.getState());
append(tooltip, "Country", addressInfo.getCountry());
}
return tooltip.toString();
}
代码示例来源:origin: OpenNMS/opennms
final Status edgeStatus = stateMachine.getOperationalStatus(edge);
rootLayout.addComponent(createStatusLabel(childVertex.getLabel(),
edgeStatus,
String.format("%s × %d <i class=\"pull-right glyphicon %s\"></i>",
代码示例来源:origin: OpenNMS/opennms
@Override
public void visitVertex(Vertex vertex) throws PaintException {
boolean selected = isSelected(m_graphContainer.getSelectionManager(), vertex);
Point initialLocation = m_layout.getInitialLocation(vertex);
Point location = m_layout.getLocation(vertex);
SharedVertex v = new SharedVertex();
v.setKey(vertex.getKey());
//TODO cast to int for now
v.setInitialX((int)initialLocation.getX());
v.setInitialY((int)initialLocation.getY());
v.setX((int)location.getX());
v.setY((int) location.getY());
v.setSelected(selected);
v.setStatus(getStatus(vertex));
v.setStatusCount(getStatusCount(vertex));
v.setSVGIconId(getIconId(vertex));
v.setLabel(vertex.getLabel());
v.setTooltipText(getTooltipText(vertex));
v.setStyleName(getVertexStyle(vertex, selected));
v.setTargets(getTargets(vertex));
v.setEdgePathOffset(getEdgePathOffset(vertex));
m_vertices.add(v);
}
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app
@Override
public void visitVertex(Vertex vertex) throws PaintException {
boolean selected = isSelected(m_graphContainer.getSelectionManager(), vertex);
Point initialLocation = m_layout.getInitialLocation(vertex);
Point location = m_layout.getLocation(vertex);
SharedVertex v = new SharedVertex();
v.setKey(vertex.getKey());
//TODO cast to int for now
v.setInitialX((int)initialLocation.getX());
v.setInitialY((int)initialLocation.getY());
v.setX((int)location.getX());
v.setY((int) location.getY());
v.setSelected(selected);
v.setStatus(getStatus(vertex));
v.setStatusCount(getStatusCount(vertex));
v.setSVGIconId(getIconId(vertex));
v.setLabel(vertex.getLabel());
v.setTooltipText(getTooltipText(vertex));
v.setStyleName(getVertexStyle(vertex, selected));
v.setTargets(getTargets(vertex));
v.setEdgePathOffset(getEdgePathOffset(vertex));
m_vertices.add(v);
}
代码示例来源:origin: org.opennms.features.topology/netutils
setCaption(String.format("Ping - %s (%s)", vertex.getLabel(), vertex.getIpAddress()));
setResizable(false);
setModal(true);
内容来源于网络,如有侵权,请联系作者删除!