+ private int getStatusFromInterval(ITmfStateInterval statusInterval) {
+ ITmfStateValue stateValue = statusInterval.getStateValue();
+ int status = -1;
+ switch (stateValue.getType()) {
+ case INTEGER:
+ case NULL:
+ status = stateValue.unboxInt();
+ break;
+ case LONG:
+ status = (int) stateValue.unboxLong();
+ break;
+ case STRING:
+ String statusStr = stateValue.unboxStr();
+ Integer statusInt = fStringValueMap.get(statusStr);
+ if (statusInt != null) {
+ status = statusInt;
+ break;
+ }
+ ITimeGraphPresentationProvider2 pres = this.getPresentationProvider();
+ if (pres instanceof XmlPresentationProvider) {
+ // Add this new state to the presentation provider
+ status = ((XmlPresentationProvider) pres).addState(statusStr);
+ fStringValueMap.put(statusStr, status);
+ }
+ break;
+ case DOUBLE:
+ status = (int) stateValue.unboxDouble();
+ break;
+ case CUSTOM:
+ default:
+ break;
+ }
+
+ return status;
+ }
+