StateCode (ThreadState state) { if (state.isSleeping()) return StateCode.PAUSED; if (state.isWaiting()) return StateCode.LOCKED; if (state.getOperation() == ThreadOperation.Socket) return StateCode.RUN_SOCKET; if (state.getOperation() == ThreadOperation.IO) return StateCode.RUN_IO; if (state.isEDT()) { return "idle".equals(state.getThreadStateDetail()) ? StateCode.IDLE : StateCode.EDT; } return StateCode.RUN; }