use of au.gov.asd.tac.constellation.graph.schema.analytic.attribute.objects.CompositeStatus in project constellation by constellation-app.
the class CompositeNodeStateAttributeInteraction method getDisplayText.
@Override
public String getDisplayText(final Object value) {
if (value == null) {
return null;
}
final CompositeNodeState state = (CompositeNodeState) value;
final CompositeStatus status = state.getStatus();
if (status.equals(CompositeStatus.NOT_A_COMPOSITE)) {
return "";
} else if (status.equals(CompositeStatus.IS_A_COMPOSITE)) {
return String.format("%s comprising %d nodes.", status.compositeName, state.getNumberOfNodes());
} else {
return String.format("%s with %d other node%s.", status.compositeName, state.getNumberOfNodes() - 1, state.getNumberOfNodes() == 1 ? "" : "s");
}
}
Aggregations