com.wirefusion.player
Class Core

java.lang.Object
  extended by com.wirefusion.player.CoreBase
      extended by com.wirefusion.player.Core
All Implemented Interfaces:
java.lang.Runnable

public final class Core
extends com.wirefusion.player.CoreBase
implements java.lang.Runnable

The "core" object in the player.


Constructor Summary
Core()
           
 
Method Summary
 Display getDisplay()
          Returns the Display object, used for displaying the presentation.
 double getFps()
          Returns the current number of frames per second with which the presentation is played (fps).
 int getFrameNumber()
          Returns the current frame count.
 java.awt.Point getMousePosition()
          Returns the current position of the mouse cursor.
 long getPlayerTime()
          The "player" time.
 java.lang.Object getProperty(java.lang.String key)
          Returns the system property indicated by the specified key.
 java.net.URL getResourceFolderUrl()
          The URL to the resource folder.
 long getSystemTime()
          The computer time at which the rendering process of the current frame started.
 void setPreferredFps(double fps)
          Sets the peferred number of frames per second with which the presentation will be played.
 void setProperty(java.lang.String key, java.lang.Object value)
          Sets the system property indicated by the specified key.
 
Methods inherited from class com.wirefusion.player.CoreBase
keyPressed, send, setMousePos, start, stop, updateBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

Core

public Core()
Method Detail

setPreferredFps

public void setPreferredFps(double fps)
Sets the peferred number of frames per second with which the presentation will be played. The actual framerate may be lower, if the CPU is not fast enough to deliver the requested FPS. A minimum pause of 5 milliseconds will be used if an FPS lower than 100 is specified, to ensure that presentation doesn't make other processes on the computer unresponsive. For frame rates above 100, there will be no mimimum pause

Parameters:
fps - number of frames per second

getFrameNumber

public int getFrameNumber()
Returns the current frame count.

Returns:
the current frame count

getFps

public double getFps()
Returns the current number of frames per second with which the presentation is played (fps). If the computer is not fast enough to achieve the specified fps, then this value will return a lower value than the fps specifies in WireFusion.

Returns:
returns the current number of frames per second (fps)

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Sets the system property indicated by the specified key.

Parameters:
key - the name of the variable.
value - the variable.

getProperty

public java.lang.Object getProperty(java.lang.String key)
Returns the system property indicated by the specified key. All external String parameters of the player are available as system properties as well as properties set using the setProperty method.

Parameters:
key - the name of the property.
Returns:
the property, or null if there is no property associated with that key.

getMousePosition

public java.awt.Point getMousePosition()
Returns the current position of the mouse cursor.

Returns:
the current position of the mouse cursor

getDisplay

public Display getDisplay()
Returns the Display object, used for displaying the presentation.

Returns:
the Display object

getSystemTime

public long getSystemTime()
The computer time at which the rendering process of the current frame started. It is often preferred to used this method instead of System.currentTimeMillis(), so that all Wobs use the same time value during a single frame.

Returns:
the computer time, in milliseconds, at which the current frame started to render

getPlayerTime

public long getPlayerTime()
The "player" time. This time value is equal to the system time value minus the total "pause time" subtracted. Usefull when creating logic for animations, so that the animation doesn't make a "large jump" in case the player pauses for a while.

Returns:
the player time, in milliseconds

getResourceFolderUrl

public java.net.URL getResourceFolderUrl()
The URL to the resource folder.

Returns:
the URL to the resource folder.