本文整理了Java中org.opennms.features.topology.api.topo.Vertex.getIconKey()
方法的一些代码示例,展示了Vertex.getIconKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.getIconKey()
方法的具体详情如下:
包路径:org.opennms.features.topology.api.topo.Vertex
类名称:Vertex
方法名:getIconKey
暂无
代码示例来源:origin: OpenNMS/opennms
@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());
});
}
代码示例来源:origin: org.opennms.features.topology.plugins.topo/org.opennms.features.topology.plugins.topo.vmware
@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());
});
}
代码示例来源:origin: OpenNMS/opennms
@Override
public boolean enabled(List<VertexRef> targets, OperationContext operationContext) {
// only enabled, if all elements are a Vertex
return targets.stream()
.allMatch(v -> v instanceof Vertex
&& operationContext.getGraphContainer().getIconManager().findRepositoryByIconKey(((Vertex) v).getIconKey()) != null);
}
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app
@Override
public boolean enabled(List<VertexRef> targets, OperationContext operationContext) {
// only enabled, if all elements are a Vertex
return targets.stream()
.allMatch(v -> v instanceof Vertex
&& operationContext.getGraphContainer().getIconManager().findRepositoryByIconKey(((Vertex) v).getIconKey()) != null);
}
代码示例来源:origin: OpenNMS/opennms
@Override
public String setIconMapping(Vertex vertex, String newIconId) {
// We look for a IconRepository with the old icon key as mapping
final ConfigurableIconRepository iconRepository = findRepositoryByIconKey(vertex.getIconKey());
final String oldIconId = getSVGIconId(vertex.getIconKey());
if (iconRepository != null && !oldIconId.equals(newIconId)) {
String iconKey = createIconKey(vertex);
// now we set the new mapping: vertex-id => icon-id
iconRepository.addIconMapping(iconKey, newIconId);
iconRepository.save();
return iconKey;
}
return null;
}
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app
@Override
public String setIconMapping(Vertex vertex, String newIconId) {
// We look for a IconRepository with the old icon key as mapping
final ConfigurableIconRepository iconRepository = findRepositoryByIconKey(vertex.getIconKey());
final String oldIconId = getSVGIconId(vertex.getIconKey());
if (iconRepository != null && !oldIconId.equals(newIconId)) {
String iconKey = createIconKey(vertex);
// now we set the new mapping: vertex-id => icon-id
iconRepository.addIconMapping(iconKey, newIconId);
iconRepository.save();
return iconKey;
}
return null;
}
代码示例来源:origin: OpenNMS/opennms
@Override
public String getSVGIconId(Vertex vertex) {
// If there is a direct mapping for the vertex, use that mapping (overwrites icon key)
final String iconId = lookupSVGIconIdForExactKey(createIconKey(vertex));
if (iconId != null) {
return iconId;
}
// Otherwise resolve the icon key assigned by the topology provider for that vertex
return getSVGIconId(vertex.getIconKey());
}
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app
@Override
public String getSVGIconId(Vertex vertex) {
// If there is a direct mapping for the vertex, use that mapping (overwrites icon key)
final String iconId = lookupSVGIconIdForExactKey(createIconKey(vertex));
if (iconId != null) {
return iconId;
}
// Otherwise resolve the icon key assigned by the topology provider for that vertex
return getSVGIconId(vertex.getIconKey());
}
代码示例来源:origin: org.opennms.features.topology/api
protected WrappedVertex(Vertex vertex) {
this((VertexRef)vertex);
iconKey = vertex.getIconKey();
ipAddr = vertex.getIpAddress();
nodeID = vertex.getNodeID();
if (vertex.getParent() != null) parent = new WrappedVertex(vertex.getParent());
styleName = vertex.getStyleName();
tooltipText = vertex.getTooltipText();
x = vertex.getX();
y = vertex.getY();
group = vertex.isGroup();
locked = vertex.isLocked();
selected = vertex.isSelected();
}
内容来源于网络,如有侵权,请联系作者删除!