Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.swt.view
Class FrameRateContributionItem

java.lang.Object
  extended by org.eclipse.jface.action.ContributionItem
      extended by org.xj3d.ui.swt.view.FrameRateContributionItem
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, org.eclipse.jface.action.IContributionItem, org.eclipse.swt.events.DisposeListener, org.eclipse.swt.internal.SWTEventListener, BrowserCoreListener, AlarmListener

public class FrameRateContributionItem
extends org.eclipse.jface.action.ContributionItem
implements BrowserCoreListener, org.eclipse.swt.events.DisposeListener, AlarmListener, java.lang.Runnable

An implementation of a contribution item for the status bar. This item consists of a label that displays the browser's current frame rate.

Version:
$Revision: 1.2 $
Author:
Rex Melton

Constructor Summary
FrameRateContributionItem(java.lang.String id, BrowserCore core)
          Constructor
 
Method Summary
 void alarmAction(AlarmEvent ae)
          Invoked when the alarm has expired.
 void browserDisposed()
          The browser has been disposed, all resources may be freed.
 void browserInitialized(VRMLScene scene)
          The browser has been initialized with new content.
 void browserShutdown()
          The browser has been shut down and the previous content is no longer valid.
 void fill(org.eclipse.swt.widgets.Composite parent)
          Construct the item.
 void run()
          Method for the display thread to update frames per second and status bar text.
 void urlLoadFailed(java.lang.String msg)
          The tried to load a URL and failed.
 void widgetDisposed(org.eclipse.swt.events.DisposeEvent evt)
          We're being disposed of - clean up
 
Methods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, fill, fill, getId, getParent, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setParent, setVisible, toString, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameRateContributionItem

public FrameRateContributionItem(java.lang.String id,
                                 BrowserCore core)
Constructor

Parameters:
id - - The identifier for this ContributionItem.
core - - The BrowserCore, source of our frame rate data.
Method Detail

fill

public void fill(org.eclipse.swt.widgets.Composite parent)
Construct the item.

Specified by:
fill in interface org.eclipse.jface.action.IContributionItem
Overrides:
fill in class org.eclipse.jface.action.ContributionItem
Parameters:
parent - - The parent composite that this item will be added to, presumably the status bar.

browserInitialized

public void browserInitialized(VRMLScene scene)
The browser has been initialized with new content. The content given is found in the accompanying scene and description.

Specified by:
browserInitialized in interface BrowserCoreListener
Parameters:
scene - - The scene of the new content

urlLoadFailed

public void urlLoadFailed(java.lang.String msg)
The tried to load a URL and failed. It is typically because none of the URLs resolved to anything valid or there were network failures.

Specified by:
urlLoadFailed in interface BrowserCoreListener
Parameters:
msg - - An error message to go with the failure

browserShutdown

public void browserShutdown()
The browser has been shut down and the previous content is no longer valid.

Specified by:
browserShutdown in interface BrowserCoreListener

browserDisposed

public void browserDisposed()
The browser has been disposed, all resources may be freed.

Specified by:
browserDisposed in interface BrowserCoreListener

widgetDisposed

public void widgetDisposed(org.eclipse.swt.events.DisposeEvent evt)
We're being disposed of - clean up

Specified by:
widgetDisposed in interface org.eclipse.swt.events.DisposeListener

alarmAction

public void alarmAction(AlarmEvent ae)
Invoked when the alarm has expired. Update the frame rate display if necessary.

Specified by:
alarmAction in interface AlarmListener
Parameters:
ae - - The event that caused the alarm

run

public void run()
Method for the display thread to update frames per second and status bar text.

Specified by:
run in interface java.lang.Runnable

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium