开发者

how to update jfree line chart in RCP View

I have four views in Eclipse RCP App. In that 3 View are responsible to show the multiline graphs. i am using a switch case for drawing the graph continuously until other views are get focused. But the view are not showing the updated chart. The following is the case for update the graph. i have two datasets for sample updation of the view.

All the replies are appreciated.

case 1:

System.out.println("in Case "+selectedViewId);
while(selectedViewId==1){
    try {
        Display.getDefault().syncExec(new Runnable() {
        public void run() {
        while(count<20) {
            count++;
            System.err.println("Countttttttt "+count);
            if(count%2==0){
                System.err.println(".....Oneeeeeeee");
                IViewPart vp =  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("RCP.CPU");
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(vp);
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();
                try {
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("RCP.CPU");
                } catch (PartInitException e1) {
                    e1.printStackTrace();
                }
                int value = CPU.value=1;
                CPU cpuView = CPUSingleton.getCPUObject();
            }
            else {
                System.err.println(".....tWOOOOOOOOOOOOOO");
                IViewPart vp =  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("RCP.CPU");
       开发者_Python百科         PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(vp);
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();
                try {
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("RCP.CPU");
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
                int value = CPU.value=2;
                CPU cpuView = CPUSingleton.getCPUObject();
            }
        }
        }
        });
    } catch (Exception e) {
        e.printStackTrace();
    }
}

break;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜