다음은 JUNG documentation에서 언급 한 Runnable을 구현하는 다음과 같은 animator
클래스입니다.미리 구현 된 Runnable 클래스를 java에서 일시 중지하는 방법은 무엇입니까?
어떤 조건이 참인 경우 thread
을 어떻게 알 수 있습니까? pause
얼마 후 start
이 실행 중입니까? 이 프로그램은 잠하여 원하는 목적지
switch (args[0])
{
case "agent":
int size=nodeAttributes.size();
int i;
for(i=0;i<size;i++)
{
if(args[1].equals(nodeAttributes.get(i).nodeName))
{
VertexCollider vtxCol = new VertexCollider(layout, panel,args[1], args[2] , args[1] , nodeAttributes.get(i));
vtxCol.setMaximumIterations(1000);
vtxCol.setDesiredPrecision(1);
vtxCol.initialize();
Animator animator = new Animator(vtxCol);
animator.start();
if(nodeAttributes.get(i).isMoving)
{
animator.stop();
animator.wait(10000);
System.out.println("stopped");
}
nodeAttributes.get(i).isMoving = true;
break;
}
}
break;
}
저는'program' 절전을하고 싶지 않습니다. 난'runnable'을 잠시 동안 잠자기하고 구현 한'animator' 클래스를 원합니다. –
애니메이터가 자체 스레드입니까? @AliNfr – JClassic
네, 문서는 그것이 독립적 인'쓰레드 '이고, 또한'보호 된 쓰레드'라고합니다. –