Search in sources :

Example 1 with CompositeStatus

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");
    }
}
Also used : CompositeNodeState(au.gov.asd.tac.constellation.graph.schema.analytic.attribute.objects.CompositeNodeState) CompositeStatus(au.gov.asd.tac.constellation.graph.schema.analytic.attribute.objects.CompositeStatus)

Aggregations

CompositeNodeState (au.gov.asd.tac.constellation.graph.schema.analytic.attribute.objects.CompositeNodeState)1 CompositeStatus (au.gov.asd.tac.constellation.graph.schema.analytic.attribute.objects.CompositeStatus)1